Changeset 3576222
- Timestamp:
- 06/17/2026 06:04:12 PM (4 months ago)
- Location:
- bitbot/trunk
- Files:
-
- 3 edited
-
assets/admin/admin.js (modified) (14 diffs)
-
bitbot.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bitbot/trunk/assets/admin/admin.js
r3576181 r3576222 1 var RF=Object.defineProperty;var nN=e=>{throw TypeError(e)};var kF=(e,t,n)=>t in e?RF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Gs=(e,t,n)=>kF(e,typeof t!="symbol"?t+"":t,n),ky=(e,t,n)=>t.has(e)||nN("Cannot "+n);var F=(e,t,n)=>(ky(e,t,"read from private field"),n?n.call(e):t.get(e)),Te=(e,t,n)=>t.has(e)?nN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ge=(e,t,n,r)=>(ky(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ke=(e,t,n)=>(ky(e,t,"access private method"),n);var ym=(e,t,n,r)=>({set _(i){ge(e,t,i,n)},get _(){return F(e,t,r)}});function LF(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var rN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ei(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ly={exports:{}},Od={};/**1 var kF=Object.defineProperty;var nN=e=>{throw TypeError(e)};var LF=(e,t,n)=>t in e?kF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Gs=(e,t,n)=>LF(e,typeof t!="symbol"?t+"":t,n),ky=(e,t,n)=>t.has(e)||nN("Cannot "+n);var q=(e,t,n)=>(ky(e,t,"read from private field"),n?n.call(e):t.get(e)),Te=(e,t,n)=>t.has(e)?nN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ge=(e,t,n,r)=>(ky(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ke=(e,t,n)=>(ky(e,t,"access private method"),n);var ym=(e,t,n,r)=>({set _(i){ge(e,t,i,n)},get _(){return q(e,t,r)}});function IF(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var rN=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ei(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ly={exports:{}},Nd={};/** 2 2 * @license React 3 3 * react-jsx-runtime.production.js … … 7 7 * This source code is licensed under the MIT license found in the 8 8 * LICENSE file in the root directory of this source tree. 9 */var aN;function IF(){if(aN)return Od;aN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var l=null;if(o!==void 0&&(l=""+o),i.key!==void 0&&(l=""+i.key),"key"in i){o={};for(var u in i)u!=="key"&&(o[u]=i[u])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:o}}return Od.Fragment=t,Od.jsx=n,Od.jsxs=n,Od}var iN;function zF(){return iN||(iN=1,Ly.exports=IF()),Ly.exports}var d=zF(),Iy={exports:{}},Ue={};/**9 */var aN;function zF(){if(aN)return Nd;aN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var l=null;if(o!==void 0&&(l=""+o),i.key!==void 0&&(l=""+i.key),"key"in i){o={};for(var u in i)u!=="key"&&(o[u]=i[u])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:o}}return Nd.Fragment=t,Nd.jsx=n,Nd.jsxs=n,Nd}var iN;function UF(){return iN||(iN=1,Ly.exports=zF()),Ly.exports}var d=UF(),Iy={exports:{}},Ue={};/** 10 10 * @license React 11 11 * react.production.js … … 15 15 * This source code is licensed under the MIT license found in the 16 16 * LICENSE file in the root directory of this source tree. 17 */var oN;function UF(){if(oN)return Ue;oN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),g=Symbol.iterator;function x(k){return k===null||typeof k!="object"?null:(k=g&&k[g]||k["@@iterator"],typeof k=="function"?k:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,A={};function j(k,Q,ce){this.props=k,this.context=Q,this.refs=A,this.updater=ce||E}j.prototype.isReactComponent={},j.prototype.setState=function(k,Q){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,Q,"setState")},j.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function C(){}C.prototype=j.prototype;function O(k,Q,ce){this.props=k,this.context=Q,this.refs=A,this.updater=ce||E}var T=O.prototype=new C;T.constructor=O,S(T,j.prototype),T.isPureReactComponent=!0;var _=Array.isArray;function P(){}var D={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function z(k,Q,ce){var fe=ce.ref;return{$$typeof:e,type:k,key:Q,ref:fe!==void 0?fe:null,props:ce}}function R(k,Q){return z(k.type,Q,k.props)}function q(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function U(k){var Q={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ce){return Q[ce]})}var re=/\/+/g;function G(k,Q){return typeof k=="object"&&k!==null&&k.key!=null?U(""+k.key):Q.toString(36)}function ie(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(P,P):(k.status="pending",k.then(function(Q){k.status==="pending"&&(k.status="fulfilled",k.value=Q)},function(Q){k.status==="pending"&&(k.status="rejected",k.reason=Q)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function K(k,Q,ce,fe,xe){var Oe=typeof k;(Oe==="undefined"||Oe==="boolean")&&(k=null);var qe=!1;if(k===null)qe=!0;else switch(Oe){case"bigint":case"string":case"number":qe=!0;break;case"object":switch(k.$$typeof){case e:case t:qe=!0;break;case p:return qe=k._init,K(qe(k._payload),Q,ce,fe,xe)}}if(qe)return xe=xe(k),qe=fe===""?"."+G(k,0):fe,_(xe)?(ce="",qe!=null&&(ce=qe.replace(re,"$&/")+"/"),K(xe,Q,ce,"",function(ue){return ue})):xe!=null&&(q(xe)&&(xe=R(xe,ce+(xe.key==null||k&&k.key===xe.key?"":(""+xe.key).replace(re,"$&/")+"/")+qe)),Q.push(xe)),1;qe=0;var Be=fe===""?".":fe+":";if(_(k))for(var he=0;he<k.length;he++)fe=k[he],Oe=Be+G(fe,he),qe+=K(fe,Q,ce,Oe,xe);else if(he=x(k),typeof he=="function")for(k=he.call(k),he=0;!(fe=k.next()).done;)fe=fe.value,Oe=Be+G(fe,he++),qe+=K(fe,Q,ce,Oe,xe);else if(Oe==="object"){if(typeof k.then=="function")return K(ie(k),Q,ce,fe,xe);throw Q=String(k),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return qe}function Z(k,Q,ce){if(k==null)return k;var fe=[],xe=0;return K(k,fe,"","",function(Oe){return Q.call(ce,Oe,xe++)}),fe}function $(k){if(k._status===-1){var Q=k._result;Q=Q(),Q.then(function(ce){(k._status===0||k._status===-1)&&(k._status=1,k._result=ce)},function(ce){(k._status===0||k._status===-1)&&(k._status=2,k._result=ce)}),k._status===-1&&(k._status=0,k._result=Q)}if(k._status===1)return k._result.default;throw k._result}var ee=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},pe={map:Z,forEach:function(k,Q,ce){Z(k,function(){Q.apply(this,arguments)},ce)},count:function(k){var Q=0;return Z(k,function(){Q++}),Q},toArray:function(k){return Z(k,function(Q){return Q})||[]},only:function(k){if(!q(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Ue.Activity=b,Ue.Children=pe,Ue.Component=j,Ue.Fragment=n,Ue.Profiler=i,Ue.PureComponent=O,Ue.StrictMode=r,Ue.Suspense=f,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(k){return D.H.useMemoCache(k)}},Ue.cache=function(k){return function(){return k.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(k,Q,ce){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var fe=S({},k.props),xe=k.key;if(Q!=null)for(Oe in Q.key!==void 0&&(xe=""+Q.key),Q)!L.call(Q,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&Q.ref===void 0||(fe[Oe]=Q[Oe]);var Oe=arguments.length-2;if(Oe===1)fe.children=ce;else if(1<Oe){for(var qe=Array(Oe),Be=0;Be<Oe;Be++)qe[Be]=arguments[Be+2];fe.children=qe}return z(k.type,xe,fe)},Ue.createContext=function(k){return k={$$typeof:l,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:o,_context:k},k},Ue.createElement=function(k,Q,ce){var fe,xe={},Oe=null;if(Q!=null)for(fe in Q.key!==void 0&&(Oe=""+Q.key),Q)L.call(Q,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(xe[fe]=Q[fe]);var qe=arguments.length-2;if(qe===1)xe.children=ce;else if(1<qe){for(var Be=Array(qe),he=0;he<qe;he++)Be[he]=arguments[he+2];xe.children=Be}if(k&&k.defaultProps)for(fe in qe=k.defaultProps,qe)xe[fe]===void 0&&(xe[fe]=qe[fe]);return z(k,Oe,xe)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(k){return{$$typeof:u,render:k}},Ue.isValidElement=q,Ue.lazy=function(k){return{$$typeof:p,_payload:{_status:-1,_result:k},_init:$}},Ue.memo=function(k,Q){return{$$typeof:h,type:k,compare:Q===void 0?null:Q}},Ue.startTransition=function(k){var Q=D.T,ce={};D.T=ce;try{var fe=k(),xe=D.S;xe!==null&&xe(ce,fe),typeof fe=="object"&&fe!==null&&typeof fe.then=="function"&&fe.then(P,ee)}catch(Oe){ee(Oe)}finally{Q!==null&&ce.types!==null&&(Q.types=ce.types),D.T=Q}},Ue.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ue.use=function(k){return D.H.use(k)},Ue.useActionState=function(k,Q,ce){return D.H.useActionState(k,Q,ce)},Ue.useCallback=function(k,Q){return D.H.useCallback(k,Q)},Ue.useContext=function(k){return D.H.useContext(k)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(k,Q){return D.H.useDeferredValue(k,Q)},Ue.useEffect=function(k,Q){return D.H.useEffect(k,Q)},Ue.useEffectEvent=function(k){return D.H.useEffectEvent(k)},Ue.useId=function(){return D.H.useId()},Ue.useImperativeHandle=function(k,Q,ce){return D.H.useImperativeHandle(k,Q,ce)},Ue.useInsertionEffect=function(k,Q){return D.H.useInsertionEffect(k,Q)},Ue.useLayoutEffect=function(k,Q){return D.H.useLayoutEffect(k,Q)},Ue.useMemo=function(k,Q){return D.H.useMemo(k,Q)},Ue.useOptimistic=function(k,Q){return D.H.useOptimistic(k,Q)},Ue.useReducer=function(k,Q,ce){return D.H.useReducer(k,Q,ce)},Ue.useRef=function(k){return D.H.useRef(k)},Ue.useState=function(k){return D.H.useState(k)},Ue.useSyncExternalStore=function(k,Q,ce){return D.H.useSyncExternalStore(k,Q,ce)},Ue.useTransition=function(){return D.H.useTransition()},Ue.version="19.2.6",Ue}var sN;function xu(){return sN||(sN=1,Iy.exports=UF()),Iy.exports}var v=xu();const Zt=Ei(v),LS=LF({__proto__:null,default:Zt},[v]);var zy={exports:{}},Nd={},Uy={exports:{}},qy={};/**17 */var oN;function qF(){if(oN)return Ue;oN=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),g=Symbol.iterator;function x(k){return k===null||typeof k!="object"?null:(k=g&&k[g]||k["@@iterator"],typeof k=="function"?k:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,A={};function j(k,Q,ce){this.props=k,this.context=Q,this.refs=A,this.updater=ce||E}j.prototype.isReactComponent={},j.prototype.setState=function(k,Q){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,Q,"setState")},j.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function C(){}C.prototype=j.prototype;function O(k,Q,ce){this.props=k,this.context=Q,this.refs=A,this.updater=ce||E}var T=O.prototype=new C;T.constructor=O,S(T,j.prototype),T.isPureReactComponent=!0;var _=Array.isArray;function P(){}var D={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function z(k,Q,ce){var fe=ce.ref;return{$$typeof:e,type:k,key:Q,ref:fe!==void 0?fe:null,props:ce}}function F(k,Q){return z(k.type,Q,k.props)}function G(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function R(k){var Q={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ce){return Q[ce]})}var J=/\/+/g;function $(k,Q){return typeof k=="object"&&k!==null&&k.key!=null?R(""+k.key):Q.toString(36)}function ne(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(P,P):(k.status="pending",k.then(function(Q){k.status==="pending"&&(k.status="fulfilled",k.value=Q)},function(Q){k.status==="pending"&&(k.status="rejected",k.reason=Q)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function K(k,Q,ce,fe,xe){var Oe=typeof k;(Oe==="undefined"||Oe==="boolean")&&(k=null);var qe=!1;if(k===null)qe=!0;else switch(Oe){case"bigint":case"string":case"number":qe=!0;break;case"object":switch(k.$$typeof){case e:case t:qe=!0;break;case p:return qe=k._init,K(qe(k._payload),Q,ce,fe,xe)}}if(qe)return xe=xe(k),qe=fe===""?"."+$(k,0):fe,_(xe)?(ce="",qe!=null&&(ce=qe.replace(J,"$&/")+"/"),K(xe,Q,ce,"",function(ue){return ue})):xe!=null&&(G(xe)&&(xe=F(xe,ce+(xe.key==null||k&&k.key===xe.key?"":(""+xe.key).replace(J,"$&/")+"/")+qe)),Q.push(xe)),1;qe=0;var Be=fe===""?".":fe+":";if(_(k))for(var he=0;he<k.length;he++)fe=k[he],Oe=Be+$(fe,he),qe+=K(fe,Q,ce,Oe,xe);else if(he=x(k),typeof he=="function")for(k=he.call(k),he=0;!(fe=k.next()).done;)fe=fe.value,Oe=Be+$(fe,he++),qe+=K(fe,Q,ce,Oe,xe);else if(Oe==="object"){if(typeof k.then=="function")return K(ne(k),Q,ce,fe,xe);throw Q=String(k),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return qe}function Z(k,Q,ce){if(k==null)return k;var fe=[],xe=0;return K(k,fe,"","",function(Oe){return Q.call(ce,Oe,xe++)}),fe}function B(k){if(k._status===-1){var Q=k._result;Q=Q(),Q.then(function(ce){(k._status===0||k._status===-1)&&(k._status=1,k._result=ce)},function(ce){(k._status===0||k._status===-1)&&(k._status=2,k._result=ce)}),k._status===-1&&(k._status=0,k._result=Q)}if(k._status===1)return k._result.default;throw k._result}var te=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},pe={map:Z,forEach:function(k,Q,ce){Z(k,function(){Q.apply(this,arguments)},ce)},count:function(k){var Q=0;return Z(k,function(){Q++}),Q},toArray:function(k){return Z(k,function(Q){return Q})||[]},only:function(k){if(!G(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Ue.Activity=b,Ue.Children=pe,Ue.Component=j,Ue.Fragment=n,Ue.Profiler=i,Ue.PureComponent=O,Ue.StrictMode=r,Ue.Suspense=f,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(k){return D.H.useMemoCache(k)}},Ue.cache=function(k){return function(){return k.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(k,Q,ce){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var fe=S({},k.props),xe=k.key;if(Q!=null)for(Oe in Q.key!==void 0&&(xe=""+Q.key),Q)!L.call(Q,Oe)||Oe==="key"||Oe==="__self"||Oe==="__source"||Oe==="ref"&&Q.ref===void 0||(fe[Oe]=Q[Oe]);var Oe=arguments.length-2;if(Oe===1)fe.children=ce;else if(1<Oe){for(var qe=Array(Oe),Be=0;Be<Oe;Be++)qe[Be]=arguments[Be+2];fe.children=qe}return z(k.type,xe,fe)},Ue.createContext=function(k){return k={$$typeof:l,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:o,_context:k},k},Ue.createElement=function(k,Q,ce){var fe,xe={},Oe=null;if(Q!=null)for(fe in Q.key!==void 0&&(Oe=""+Q.key),Q)L.call(Q,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(xe[fe]=Q[fe]);var qe=arguments.length-2;if(qe===1)xe.children=ce;else if(1<qe){for(var Be=Array(qe),he=0;he<qe;he++)Be[he]=arguments[he+2];xe.children=Be}if(k&&k.defaultProps)for(fe in qe=k.defaultProps,qe)xe[fe]===void 0&&(xe[fe]=qe[fe]);return z(k,Oe,xe)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(k){return{$$typeof:u,render:k}},Ue.isValidElement=G,Ue.lazy=function(k){return{$$typeof:p,_payload:{_status:-1,_result:k},_init:B}},Ue.memo=function(k,Q){return{$$typeof:h,type:k,compare:Q===void 0?null:Q}},Ue.startTransition=function(k){var Q=D.T,ce={};D.T=ce;try{var fe=k(),xe=D.S;xe!==null&&xe(ce,fe),typeof fe=="object"&&fe!==null&&typeof fe.then=="function"&&fe.then(P,te)}catch(Oe){te(Oe)}finally{Q!==null&&ce.types!==null&&(Q.types=ce.types),D.T=Q}},Ue.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ue.use=function(k){return D.H.use(k)},Ue.useActionState=function(k,Q,ce){return D.H.useActionState(k,Q,ce)},Ue.useCallback=function(k,Q){return D.H.useCallback(k,Q)},Ue.useContext=function(k){return D.H.useContext(k)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(k,Q){return D.H.useDeferredValue(k,Q)},Ue.useEffect=function(k,Q){return D.H.useEffect(k,Q)},Ue.useEffectEvent=function(k){return D.H.useEffectEvent(k)},Ue.useId=function(){return D.H.useId()},Ue.useImperativeHandle=function(k,Q,ce){return D.H.useImperativeHandle(k,Q,ce)},Ue.useInsertionEffect=function(k,Q){return D.H.useInsertionEffect(k,Q)},Ue.useLayoutEffect=function(k,Q){return D.H.useLayoutEffect(k,Q)},Ue.useMemo=function(k,Q){return D.H.useMemo(k,Q)},Ue.useOptimistic=function(k,Q){return D.H.useOptimistic(k,Q)},Ue.useReducer=function(k,Q,ce){return D.H.useReducer(k,Q,ce)},Ue.useRef=function(k){return D.H.useRef(k)},Ue.useState=function(k){return D.H.useState(k)},Ue.useSyncExternalStore=function(k,Q,ce){return D.H.useSyncExternalStore(k,Q,ce)},Ue.useTransition=function(){return D.H.useTransition()},Ue.version="19.2.6",Ue}var sN;function xu(){return sN||(sN=1,Iy.exports=qF()),Iy.exports}var v=xu();const Zt=Ei(v),LS=IF({__proto__:null,default:Zt},[v]);var zy={exports:{}},Td={},Uy={exports:{}},qy={};/** 18 18 * @license React 19 19 * scheduler.production.js … … 23 23 * This source code is licensed under the MIT license found in the 24 24 * LICENSE file in the root directory of this source tree. 25 */var lN;function qF(){return lN||(lN=1,(function(e){function t(K,Z){var $=K.length;K.push(Z);e:for(;0<$;){var ee=$-1>>>1,pe=K[ee];if(0<i(pe,Z))K[ee]=Z,K[$]=pe,$=ee;else break e}}function n(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var Z=K[0],$=K.pop();if($!==Z){K[0]=$;e:for(var ee=0,pe=K.length,k=pe>>>1;ee<k;){var Q=2*(ee+1)-1,ce=K[Q],fe=Q+1,xe=K[fe];if(0>i(ce,$))fe<pe&&0>i(xe,ce)?(K[ee]=xe,K[fe]=$,ee=fe):(K[ee]=ce,K[Q]=$,ee=Q);else if(fe<pe&&0>i(xe,$))K[ee]=xe,K[fe]=$,ee=fe;else break e}}return Z}function i(K,Z){var $=K.sortIndex-Z.sortIndex;return $!==0?$:K.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var f=[],h=[],p=1,b=null,g=3,x=!1,E=!1,S=!1,A=!1,j=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function T(K){for(var Z=n(h);Z!==null;){if(Z.callback===null)r(h);else if(Z.startTime<=K)r(h),Z.sortIndex=Z.expirationTime,t(f,Z);else break;Z=n(h)}}function _(K){if(S=!1,T(K),!E)if(n(f)!==null)E=!0,P||(P=!0,U());else{var Z=n(h);Z!==null&&ie(_,Z.startTime-K)}}var P=!1,D=-1,L=5,z=-1;function R(){return A?!0:!(e.unstable_now()-z<L)}function q(){if(A=!1,P){var K=e.unstable_now();z=K;var Z=!0;try{e:{E=!1,S&&(S=!1,C(D),D=-1),x=!0;var $=g;try{t:{for(T(K),b=n(f);b!==null&&!(b.expirationTime>K&&R());){var ee=b.callback;if(typeof ee=="function"){b.callback=null,g=b.priorityLevel;var pe=ee(b.expirationTime<=K);if(K=e.unstable_now(),typeof pe=="function"){b.callback=pe,T(K),Z=!0;break t}b===n(f)&&r(f),T(K)}else r(f);b=n(f)}if(b!==null)Z=!0;else{var k=n(h);k!==null&&ie(_,k.startTime-K),Z=!1}}break e}finally{b=null,g=$,x=!1}Z=void 0}}finally{Z?U():P=!1}}}var U;if(typeof O=="function")U=function(){O(q)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,G=re.port2;re.port1.onmessage=q,U=function(){G.postMessage(null)}}else U=function(){j(q,0)};function ie(K,Z){D=j(function(){K(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(K){switch(g){case 1:case 2:case 3:var Z=3;break;default:Z=g}var $=g;g=Z;try{return K()}finally{g=$}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(K,Z){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var $=g;g=K;try{return Z()}finally{g=$}},e.unstable_scheduleCallback=function(K,Z,$){var ee=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?ee+$:ee):$=ee,K){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=$+pe,K={id:p++,callback:Z,priorityLevel:K,startTime:$,expirationTime:pe,sortIndex:-1},$>ee?(K.sortIndex=$,t(h,K),n(f)===null&&K===n(h)&&(S?(C(D),D=-1):S=!0,ie(_,$-ee))):(K.sortIndex=pe,t(f,K),E||x||(E=!0,P||(P=!0,U()))),K},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(K){var Z=g;return function(){var $=g;g=Z;try{return K.apply(this,arguments)}finally{g=$}}}})(qy)),qy}var cN;function BF(){return cN||(cN=1,Uy.exports=qF()),Uy.exports}var By={exports:{}},Jn={};/**25 */var lN;function BF(){return lN||(lN=1,(function(e){function t(K,Z){var B=K.length;K.push(Z);e:for(;0<B;){var te=B-1>>>1,pe=K[te];if(0<i(pe,Z))K[te]=Z,K[B]=pe,B=te;else break e}}function n(K){return K.length===0?null:K[0]}function r(K){if(K.length===0)return null;var Z=K[0],B=K.pop();if(B!==Z){K[0]=B;e:for(var te=0,pe=K.length,k=pe>>>1;te<k;){var Q=2*(te+1)-1,ce=K[Q],fe=Q+1,xe=K[fe];if(0>i(ce,B))fe<pe&&0>i(xe,ce)?(K[te]=xe,K[fe]=B,te=fe):(K[te]=ce,K[Q]=B,te=Q);else if(fe<pe&&0>i(xe,B))K[te]=xe,K[fe]=B,te=fe;else break e}}return Z}function i(K,Z){var B=K.sortIndex-Z.sortIndex;return B!==0?B:K.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var f=[],h=[],p=1,b=null,g=3,x=!1,E=!1,S=!1,A=!1,j=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function T(K){for(var Z=n(h);Z!==null;){if(Z.callback===null)r(h);else if(Z.startTime<=K)r(h),Z.sortIndex=Z.expirationTime,t(f,Z);else break;Z=n(h)}}function _(K){if(S=!1,T(K),!E)if(n(f)!==null)E=!0,P||(P=!0,R());else{var Z=n(h);Z!==null&&ne(_,Z.startTime-K)}}var P=!1,D=-1,L=5,z=-1;function F(){return A?!0:!(e.unstable_now()-z<L)}function G(){if(A=!1,P){var K=e.unstable_now();z=K;var Z=!0;try{e:{E=!1,S&&(S=!1,C(D),D=-1),x=!0;var B=g;try{t:{for(T(K),b=n(f);b!==null&&!(b.expirationTime>K&&F());){var te=b.callback;if(typeof te=="function"){b.callback=null,g=b.priorityLevel;var pe=te(b.expirationTime<=K);if(K=e.unstable_now(),typeof pe=="function"){b.callback=pe,T(K),Z=!0;break t}b===n(f)&&r(f),T(K)}else r(f);b=n(f)}if(b!==null)Z=!0;else{var k=n(h);k!==null&&ne(_,k.startTime-K),Z=!1}}break e}finally{b=null,g=B,x=!1}Z=void 0}}finally{Z?R():P=!1}}}var R;if(typeof O=="function")R=function(){O(G)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,$=J.port2;J.port1.onmessage=G,R=function(){$.postMessage(null)}}else R=function(){j(G,0)};function ne(K,Z){D=j(function(){K(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(K){K.callback=null},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(K){switch(g){case 1:case 2:case 3:var Z=3;break;default:Z=g}var B=g;g=Z;try{return K()}finally{g=B}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(K,Z){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var B=g;g=K;try{return Z()}finally{g=B}},e.unstable_scheduleCallback=function(K,Z,B){var te=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?te+B:te):B=te,K){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=B+pe,K={id:p++,callback:Z,priorityLevel:K,startTime:B,expirationTime:pe,sortIndex:-1},B>te?(K.sortIndex=B,t(h,K),n(f)===null&&K===n(h)&&(S?(C(D),D=-1):S=!0,ne(_,B-te))):(K.sortIndex=pe,t(f,K),E||x||(E=!0,P||(P=!0,R()))),K},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(K){var Z=g;return function(){var B=g;g=Z;try{return K.apply(this,arguments)}finally{g=B}}}})(qy)),qy}var cN;function FF(){return cN||(cN=1,Uy.exports=BF()),Uy.exports}var By={exports:{}},Jn={};/** 26 26 * @license React 27 27 * react-dom.production.js … … 31 31 * This source code is licensed under the MIT license found in the 32 32 * LICENSE file in the root directory of this source tree. 33 */var uN;function FF(){if(uN)return Jn;uN=1;var e=xu();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(f,h,p){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:b==null?null:""+b,children:f,containerInfo:h,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Jn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Jn.createPortal=function(f,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(f,h,null,p)},Jn.flushSync=function(f){var h=l.T,p=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=h,r.p=p,r.d.f()}},Jn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Jn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Jn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var p=h.as,b=u(p,h.crossOrigin),g=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:g,fetchPriority:x}):p==="script"&&r.d.X(f,{crossOrigin:b,integrity:g,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Jn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=u(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Jn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,b=u(p,h.crossOrigin);r.d.L(f,p,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Jn.preloadModule=function(f,h){if(typeof f=="string")if(h){var p=u(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Jn.requestFormReset=function(f){r.d.r(f)},Jn.unstable_batchedUpdates=function(f,h){return f(h)},Jn.useFormState=function(f,h,p){return l.H.useFormState(f,h,p)},Jn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Jn.version="19.2.6",Jn}var dN;function rk(){if(dN)return By.exports;dN=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),By.exports=FF(),By.exports}/**33 */var uN;function $F(){if(uN)return Jn;uN=1;var e=xu();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(f,h,p){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:b==null?null:""+b,children:f,containerInfo:h,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Jn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Jn.createPortal=function(f,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(f,h,null,p)},Jn.flushSync=function(f){var h=l.T,p=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=h,r.p=p,r.d.f()}},Jn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Jn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Jn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var p=h.as,b=u(p,h.crossOrigin),g=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:g,fetchPriority:x}):p==="script"&&r.d.X(f,{crossOrigin:b,integrity:g,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Jn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=u(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Jn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,b=u(p,h.crossOrigin);r.d.L(f,p,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Jn.preloadModule=function(f,h){if(typeof f=="string")if(h){var p=u(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Jn.requestFormReset=function(f){r.d.r(f)},Jn.unstable_batchedUpdates=function(f,h){return f(h)},Jn.useFormState=function(f,h,p){return l.H.useFormState(f,h,p)},Jn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Jn.version="19.2.6",Jn}var dN;function ak(){if(dN)return By.exports;dN=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),By.exports=$F(),By.exports}/** 34 34 * @license React 35 35 * react-dom-client.production.js … … 39 39 * This source code is licensed under the MIT license found in the 40 40 * LICENSE file in the root directory of this source tree. 41 */var fN;function $F(){if(fN)return Nd;fN=1;var e=BF(),t=xu(),n=rk();function r(a){var s="https://react.dev/errors/"+a;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var s=a,c=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,(s.flags&4098)!==0&&(c=s.return),a=s.return;while(a)}return s.tag===3?c:null}function l(a){if(a.tag===13){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function u(a){if(a.tag===31){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function f(a){if(o(a)!==a)throw Error(r(188))}function h(a){var s=a.alternate;if(!s){if(s=o(a),s===null)throw Error(r(188));return s!==a?null:a}for(var c=a,m=s;;){var y=c.return;if(y===null)break;var w=y.alternate;if(w===null){if(m=y.return,m!==null){c=m;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===c)return f(y),a;if(w===m)return f(y),s;w=w.sibling}throw Error(r(188))}if(c.return!==m.return)c=y,m=w;else{for(var N=!1,M=y.child;M;){if(M===c){N=!0,c=y,m=w;break}if(M===m){N=!0,m=y,c=w;break}M=M.sibling}if(!N){for(M=w.child;M;){if(M===c){N=!0,c=w,m=y;break}if(M===m){N=!0,m=w,c=y;break}M=M.sibling}if(!N)throw Error(r(189))}}if(c.alternate!==m)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?a:s}function p(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a;for(a=a.child;a!==null;){if(s=p(a),s!==null)return s;a=a.sibling}return null}var b=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),O=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),R=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function U(a){return a===null||typeof a!="object"?null:(a=q&&a[q]||a["@@iterator"],typeof a=="function"?a:null)}var re=Symbol.for("react.client.reference");function G(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===re?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case j:return"Profiler";case A:return"StrictMode";case _:return"Suspense";case P:return"SuspenseList";case z:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case E:return"Portal";case O:return a.displayName||"Context";case C:return(a._context.displayName||"Context")+".Consumer";case T:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case D:return s=a.displayName||null,s!==null?s:G(a.type)||"Memo";case L:s=a._payload,a=a._init;try{return G(a(s))}catch{}}return null}var ie=Array.isArray,K=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},ee=[],pe=-1;function k(a){return{current:a}}function Q(a){0>pe||(a.current=ee[pe],ee[pe]=null,pe--)}function ce(a,s){pe++,ee[pe]=a.current,a.current=s}var fe=k(null),xe=k(null),Oe=k(null),qe=k(null);function Be(a,s){switch(ce(Oe,s),ce(xe,a),ce(fe,null),s.nodeType){case 9:case 11:a=(a=s.documentElement)&&(a=a.namespaceURI)?jO(a):0;break;default:if(a=s.tagName,s=s.namespaceURI)s=jO(s),a=CO(s,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}Q(fe),ce(fe,a)}function he(){Q(fe),Q(xe),Q(Oe)}function ue(a){a.memoizedState!==null&&ce(qe,a);var s=fe.current,c=CO(s,a.type);s!==c&&(ce(xe,a),ce(fe,c))}function Ee(a){xe.current===a&&(Q(fe),Q(xe)),qe.current===a&&(Q(qe),Ed._currentValue=$)}var de,Le;function Me(a){if(de===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);de=s&&s[1]||"",Le=-1<c.stack.indexOf(`41 */var fN;function KF(){if(fN)return Td;fN=1;var e=FF(),t=xu(),n=ak();function r(a){var s="https://react.dev/errors/"+a;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var s=a,c=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,(s.flags&4098)!==0&&(c=s.return),a=s.return;while(a)}return s.tag===3?c:null}function l(a){if(a.tag===13){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function u(a){if(a.tag===31){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function f(a){if(o(a)!==a)throw Error(r(188))}function h(a){var s=a.alternate;if(!s){if(s=o(a),s===null)throw Error(r(188));return s!==a?null:a}for(var c=a,m=s;;){var y=c.return;if(y===null)break;var w=y.alternate;if(w===null){if(m=y.return,m!==null){c=m;continue}break}if(y.child===w.child){for(w=y.child;w;){if(w===c)return f(y),a;if(w===m)return f(y),s;w=w.sibling}throw Error(r(188))}if(c.return!==m.return)c=y,m=w;else{for(var N=!1,M=y.child;M;){if(M===c){N=!0,c=y,m=w;break}if(M===m){N=!0,m=y,c=w;break}M=M.sibling}if(!N){for(M=w.child;M;){if(M===c){N=!0,c=w,m=y;break}if(M===m){N=!0,m=w,c=y;break}M=M.sibling}if(!N)throw Error(r(189))}}if(c.alternate!==m)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?a:s}function p(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a;for(a=a.child;a!==null;){if(s=p(a),s!==null)return s;a=a.sibling}return null}var b=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),O=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function R(a){return a===null||typeof a!="object"?null:(a=G&&a[G]||a["@@iterator"],typeof a=="function"?a:null)}var J=Symbol.for("react.client.reference");function $(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===J?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case S:return"Fragment";case j:return"Profiler";case A:return"StrictMode";case _:return"Suspense";case P:return"SuspenseList";case z:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case E:return"Portal";case O:return a.displayName||"Context";case C:return(a._context.displayName||"Context")+".Consumer";case T:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case D:return s=a.displayName||null,s!==null?s:$(a.type)||"Memo";case L:s=a._payload,a=a._init;try{return $(a(s))}catch{}}return null}var ne=Array.isArray,K=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},te=[],pe=-1;function k(a){return{current:a}}function Q(a){0>pe||(a.current=te[pe],te[pe]=null,pe--)}function ce(a,s){pe++,te[pe]=a.current,a.current=s}var fe=k(null),xe=k(null),Oe=k(null),qe=k(null);function Be(a,s){switch(ce(Oe,s),ce(xe,a),ce(fe,null),s.nodeType){case 9:case 11:a=(a=s.documentElement)&&(a=a.namespaceURI)?jO(a):0;break;default:if(a=s.tagName,s=s.namespaceURI)s=jO(s),a=CO(s,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}Q(fe),ce(fe,a)}function he(){Q(fe),Q(xe),Q(Oe)}function ue(a){a.memoizedState!==null&&ce(qe,a);var s=fe.current,c=CO(s,a.type);s!==c&&(ce(xe,a),ce(fe,c))}function Ee(a){xe.current===a&&(Q(fe),Q(xe)),qe.current===a&&(Q(qe),Ad._currentValue=B)}var de,Le;function Me(a){if(de===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);de=s&&s[1]||"",Le=-1<c.stack.indexOf(` 42 42 at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return` 43 `+de+a+Le}var Ie=!1;function ut(a,s){if(!a||Ie)return"";Ie=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(s){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch( te){var J=te}Reflect.construct(a,[],se)}else{try{se.call()}catch(te){J=te}a.call(se.prototype)}}else{try{throw Error()}catch(te){J=te}(se=a())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(te){if(te&&J&&typeof te.stack=="string")return[te.stack,J.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=m.DetermineComponentFrameRoot(),N=w[0],M=w[1];if(N&&M){var B=N.split(`43 `+de+a+Le}var Ie=!1;function ut(a,s){if(!a||Ie)return"";Ie=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(s){var se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(re){var ee=re}Reflect.construct(a,[],se)}else{try{se.call()}catch(re){ee=re}a.call(se.prototype)}}else{try{throw Error()}catch(re){ee=re}(se=a())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(re){if(re&&ee&&typeof re.stack=="string")return[re.stack,ee.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=m.DetermineComponentFrameRoot(),N=w[0],M=w[1];if(N&&M){var U=N.split(` 44 44 `),X=M.split(` 45 `);for(y=m=0;m< B.length&&!B[m].includes("DetermineComponentFrameRoot");)m++;for(;y<X.length&&!X[y].includes("DetermineComponentFrameRoot");)y++;if(m===B.length||y===X.length)for(m=B.length-1,y=X.length-1;1<=m&&0<=y&&B[m]!==X[y];)y--;for(;1<=m&&0<=y;m--,y--)if(B[m]!==X[y]){if(m!==1||y!==1)do if(m--,y--,0>y||B[m]!==X[y]){var ae=`46 `+ B[m].replace(" at new "," at ");return a.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",a.displayName)),ae}while(1<=m&&0<=y);break}}}finally{Ie=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?Me(c):""}function Un(a,s){switch(a.tag){case 26:case 27:case 5:return Me(a.type);case 16:return Me("Lazy");case 13:return a.child!==s&&s!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return ut(a.type,!1);case 11:return ut(a.type.render,!1);case 1:return ut(a.type,!0);case 31:return Me("Activity");default:return""}}function qn(a){try{var s="",c=null;do s+=Un(a,c),c=a,a=a.return;while(a);return s}catch(m){return`45 `);for(y=m=0;m<U.length&&!U[m].includes("DetermineComponentFrameRoot");)m++;for(;y<X.length&&!X[y].includes("DetermineComponentFrameRoot");)y++;if(m===U.length||y===X.length)for(m=U.length-1,y=X.length-1;1<=m&&0<=y&&U[m]!==X[y];)y--;for(;1<=m&&0<=y;m--,y--)if(U[m]!==X[y]){if(m!==1||y!==1)do if(m--,y--,0>y||U[m]!==X[y]){var ie=` 46 `+U[m].replace(" at new "," at ");return a.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",a.displayName)),ie}while(1<=m&&0<=y);break}}}finally{Ie=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?Me(c):""}function Un(a,s){switch(a.tag){case 26:case 27:case 5:return Me(a.type);case 16:return Me("Lazy");case 13:return a.child!==s&&s!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return ut(a.type,!1);case 11:return ut(a.type.render,!1);case 1:return ut(a.type,!0);case 31:return Me("Activity");default:return""}}function qn(a){try{var s="",c=null;do s+=Un(a,c),c=a,a=a.return;while(a);return s}catch(m){return` 47 47 Error generating stack: `+m.message+` 48 `+m.stack}}var Ya=Object.prototype.hasOwnProperty,Xn=e.unstable_scheduleCallback,ja=e.unstable_cancelCallback,Oi=e.unstable_shouldYield,zr=e.unstable_requestPaint,Kt=e.unstable_now,Ca=e.unstable_getCurrentPriorityLevel,Eo=e.unstable_ImmediatePriority,Ur=e.unstable_UserBlockingPriority,Cn=e.unstable_NormalPriority,ia=e.unstable_LowPriority,Wa=e.unstable_IdlePriority,qr=e.log,Ts=e.unstable_setDisableYieldValue,Qa=null,bn=null;function Zn(a){if(typeof qr=="function"&&Ts(a),bn&&typeof bn.setStrictMode=="function")try{bn.setStrictMode(Qa,a)}catch{}}var zt=Math.clz32?Math.clz32:Il,Sr=Math.log,Ao=Math.LN2;function Il(a){return a>>>=0,a===0?32:31-(Sr(a)/Ao|0)|0}var Ni=256,Va=262144,Rt=4194304;function At(a){var s=a&42;if(s!==0)return s;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Ut(a,s,c){var m=a.pendingLanes;if(m===0)return 0;var y=0,w=a.suspendedLanes,N=a.pingedLanes;a=a.warmLanes;var M=m&134217727;return M!==0?(m=M&~w,m!==0?y=At(m):(N&=M,N!==0?y=At(N):c||(c=M&~a,c!==0&&(y=At(c))))):(M=m&~w,M!==0?y=At(M):N!==0?y=At(N):c||(c=m&~a,c!==0&&(y=At(c)))),y===0?0:s!==0&&s!==y&&(s&w)===0&&(w=y&-y,c=s&-s,w>=c||w===32&&(c&4194048)!==0)?s:y}function Ot(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function en(a,s){switch(a){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sn(){var a=Rt;return Rt<<=1,(Rt&62914560)===0&&(Rt=4194304),a}function On(a){for(var s=[],c=0;31>c;c++)s.push(a);return s}function Er(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function qt(a,s,c,m,y,w){var N=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var M=a.entanglements, B=a.expirationTimes,X=a.hiddenUpdates;for(c=N&~c;0<c;){var ae=31-zt(c),se=1<<ae;M[ae]=0,B[ae]=-1;var J=X[ae];if(J!==null)for(X[ae]=null,ae=0;ae<J.length;ae++){var te=J[ae];te!==null&&(te.lane&=-536870913)}c&=~se}m!==0&&cr(a,m,0),w!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=w&~(N&~s))}function cr(a,s,c){a.pendingLanes|=s,a.suspendedLanes&=~s;var m=31-zt(s);a.entangledLanes|=s,a.entanglements[m]=a.entanglements[m]|1073741824|c&261930}function ur(a,s){var c=a.entangledLanes|=s;for(a=a.entanglements;c;){var m=31-zt(c),y=1<<m;y&s|a[m]&s&&(a[m]|=s),c&=~y}}function Nn(a,s){var c=s&-s;return c=(c&42)!==0?1:Oa(c),(c&(a.suspendedLanes|s))!==0?0:c}function Oa(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Na(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function nt(){var a=Z.p;return a!==0?a:(a=window.event,a===void 0?32:QO(a.type))}function dr(a,s){var c=Z.p;try{return Z.p=a,s()}finally{Z.p=c}}var Ar=Math.random().toString(36).slice(2),ln="__reactFiber$"+Ar,Tn="__reactProps$"+Ar,Ti="__reactContainer$"+Ar,zl="__reactEvents$"+Ar,Pv="__reactListeners$"+Ar,Br="__reactHandles$"+Ar,Lu="__reactResources$"+Ar,Fr="__reactMarker$"+Ar;function Iu(a){delete a[ln],delete a[Tn],delete a[zl],delete a[Pv],delete a[Br]}function jo(a){var s=a[ln];if(s)return s;for(var c=a.parentNode;c;){if(s=c[Ti]||c[ln]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(a=MO(a);a!==null;){if(c=a[ln])return c;a=MO(a)}return s}a=c,c=a.parentNode}return null}function Pi(a){if(a=a[ln]||a[Ti]){var s=a.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return a}return null}function Co(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(r(33))}function Xa(a){var s=a[Lu];return s||(s=a[Lu]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Bt(a){a[Fr]=!0}var _i=new Set,Oo={};function Bn(a,s){Di(a,s),Di(a+"Capture",s)}function Di(a,s){for(Oo[a]=s,a=0;a<s.length;a++)_i.add(s[a])}var sh=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),lh={},zu={};function ch(a){return Ya.call(zu,a)?!0:Ya.call(lh,a)?!1:sh.test(a)?zu[a]=!0:(lh[a]=!0,!1)}function Mi(a,s,c){if(ch(s))if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var m=s.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+c)}}function No(a,s,c){if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(s);return}a.setAttribute(s,""+c)}}function ve(a,s,c,m){if(m===null)a.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(s,c,""+m)}}function I(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ne(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function be(a,s,c){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,s);if(!a.hasOwnProperty(s)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var y=m.get,w=m.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return y.call(this)},set:function(N){c=""+N,w.call(this,N)}}),Object.defineProperty(a,s,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(N){c=""+N},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function _e(a){if(!a._valueTracker){var s=ne(a)?"checked":"value";a._valueTracker=be(a,s,""+a[s])}}function ke(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var c=s.getValue(),m="";return a&&(m=ne(a)?a.checked?"true":"false":a.value),a=m,a!==c?(s.setValue(a),!0):!1}function ze(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var tn=/[\n"\\]/g;function Ge(a){return a.replace(tn,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Nt(a,s,c,m,y,w,N,M){a.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?a.type=N:a.removeAttribute("type"),s!=null?N==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+I(s)):a.value!==""+I(s)&&(a.value=""+I(s)):N!=="submit"&&N!=="reset"||a.removeAttribute("value"),s!=null?Ht(a,N,I(s)):c!=null?Ht(a,N,I(c)):m!=null&&a.removeAttribute("value"),y==null&&w!=null&&(a.defaultChecked=!!w),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?a.name=""+I(M):a.removeAttribute("name")}function Ta(a,s,c,m,y,w,N,M){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(a.type=w),s!=null||c!=null){if(!(w!=="submit"&&w!=="reset"||s!=null)){_e(a);return}c=c!=null?""+I(c):"",s=s!=null?""+I(s):c,M||s===a.value||(a.value=s),a.defaultValue=s}m=m??y,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=M?a.checked:!!m,a.defaultChecked=!!m,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.name=N),_e(a)}function Ht(a,s,c){s==="number"&&ze(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function Ri(a,s,c,m){if(a=a.options,s){s={};for(var y=0;y<c.length;y++)s["$"+c[y]]=!0;for(c=0;c<a.length;c++)y=s.hasOwnProperty("$"+a[c].value),a[c].selected!==y&&(a[c].selected=y),y&&m&&(a[c].defaultSelected=!0)}else{for(c=""+I(c),s=null,y=0;y<a.length;y++){if(a[y].value===c){a[y].selected=!0,m&&(a[y].defaultSelected=!0);return}s!==null||a[y].disabled||(s=a[y])}s!==null&&(s.selected=!0)}}function Uu(a,s,c){if(s!=null&&(s=""+I(s),s!==a.value&&(a.value=s),c==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=c!=null?""+I(c):""}function wj(a,s,c,m){if(s==null){if(m!=null){if(c!=null)throw Error(r(92));if(ie(m)){if(1<m.length)throw Error(r(93));m=m[0]}c=m}c==null&&(c=""),s=c}c=I(s),a.defaultValue=c,m=a.textContent,m===c&&m!==""&&m!==null&&(a.value=m),_e(a)}function Ul(a,s){if(s){var c=a.firstChild;if(c&&c===a.lastChild&&c.nodeType===3){c.nodeValue=s;return}}a.textContent=s}var Tq=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Sj(a,s,c){var m=s.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?m?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":m?a.setProperty(s,c):typeof c!="number"||c===0||Tq.has(s)?s==="float"?a.cssFloat=c:a[s]=(""+c).trim():a[s]=c+"px"}function Ej(a,s,c){if(s!=null&&typeof s!="object")throw Error(r(62));if(a=a.style,c!=null){for(var m in c)!c.hasOwnProperty(m)||s!=null&&s.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var y in s)m=s[y],s.hasOwnProperty(y)&&c[y]!==m&&Sj(a,y,m)}else for(var w in s)s.hasOwnProperty(w)&&Sj(a,w,s[w])}function _v(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pq=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),_q=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function uh(a){return _q.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function ki(){}var Dv=null;function Mv(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ql=null,Bl=null;function Aj(a){var s=Pi(a);if(s&&(a=s.stateNode)){var c=a[Tn]||null;e:switch(a=s.stateNode,s.type){case"input":if(Nt(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),s=c.name,c.type==="radio"&&s!=null){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Ge(""+s)+'"][type="radio"]'),s=0;s<c.length;s++){var m=c[s];if(m!==a&&m.form===a.form){var y=m[Tn]||null;if(!y)throw Error(r(90));Nt(m,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(s=0;s<c.length;s++)m=c[s],m.form===a.form&&ke(m)}break e;case"textarea":Uu(a,c.value,c.defaultValue);break e;case"select":s=c.value,s!=null&&Ri(a,!!c.multiple,s,!1)}}}var Rv=!1;function jj(a,s,c){if(Rv)return a(s,c);Rv=!0;try{var m=a(s);return m}finally{if(Rv=!1,(ql!==null||Bl!==null)&&(Xh(),ql&&(s=ql,a=Bl,Bl=ql=null,Aj(s),a)))for(s=0;s<a.length;s++)Aj(a[s])}}function qu(a,s){var c=a.stateNode;if(c===null)return null;var m=c[Tn]||null;if(m===null)return null;c=m[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(c&&typeof c!="function")throw Error(r(231,s,typeof c));return c}var Li=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kv=!1;if(Li)try{var Bu={};Object.defineProperty(Bu,"passive",{get:function(){kv=!0}}),window.addEventListener("test",Bu,Bu),window.removeEventListener("test",Bu,Bu)}catch{kv=!1}var To=null,Lv=null,dh=null;function Cj(){if(dh)return dh;var a,s=Lv,c=s.length,m,y="value"in To?To.value:To.textContent,w=y.length;for(a=0;a<c&&s[a]===y[a];a++);var N=c-a;for(m=1;m<=N&&s[c-m]===y[w-m];m++);return dh=y.slice(a,1<m?1-m:void 0)}function fh(a){var s=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&s===13&&(a=13)):a=s,a===10&&(a=13),32<=a||a===13?a:0}function hh(){return!0}function Oj(){return!1}function jr(a){function s(c,m,y,w,N){this._reactName=c,this._targetInst=y,this.type=m,this.nativeEvent=w,this.target=N,this.currentTarget=null;for(var M in a)a.hasOwnProperty(M)&&(c=a[M],this[M]=c?c(w):w[M]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?hh:Oj,this.isPropagationStopped=Oj,this}return b(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=hh)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=hh)},persist:function(){},isPersistent:hh}),s}var Ps={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mh=jr(Ps),Fu=b({},Ps,{view:0,detail:0}),Dq=jr(Fu),Iv,zv,$u,ph=b({},Fu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qv,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==$u&&($u&&a.type==="mousemove"?(Iv=a.screenX-$u.screenX,zv=a.screenY-$u.screenY):zv=Iv=0,$u=a),Iv)},movementY:function(a){return"movementY"in a?a.movementY:zv}}),Nj=jr(ph),Mq=b({},ph,{dataTransfer:0}),Rq=jr(Mq),kq=b({},Fu,{relatedTarget:0}),Uv=jr(kq),Lq=b({},Ps,{animationName:0,elapsedTime:0,pseudoElement:0}),Iq=jr(Lq),zq=b({},Ps,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Uq=jr(zq),qq=b({},Ps,{data:0}),Tj=jr(qq),Bq={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Fq={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},$q={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kq(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=$q[a])?!!s[a]:!1}function qv(){return Kq}var Hq=b({},Fu,{key:function(a){if(a.key){var s=Bq[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=fh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Fq[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qv,charCode:function(a){return a.type==="keypress"?fh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?fh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Gq=jr(Hq),Yq=b({},ph,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pj=jr(Yq),Wq=b({},Fu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qv}),Qq=jr(Wq),Vq=b({},Ps,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xq=jr(Vq),Zq=b({},ph,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Jq=jr(Zq),eB=b({},Ps,{newState:0,oldState:0}),tB=jr(eB),nB=[9,13,27,32],Bv=Li&&"CompositionEvent"in window,Ku=null;Li&&"documentMode"in document&&(Ku=document.documentMode);var rB=Li&&"TextEvent"in window&&!Ku,_j=Li&&(!Bv||Ku&&8<Ku&&11>=Ku),Dj=" ",Mj=!1;function Rj(a,s){switch(a){case"keyup":return nB.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kj(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Fl=!1;function aB(a,s){switch(a){case"compositionend":return kj(s);case"keypress":return s.which!==32?null:(Mj=!0,Dj);case"textInput":return a=s.data,a===Dj&&Mj?null:a;default:return null}}function iB(a,s){if(Fl)return a==="compositionend"||!Bv&&Rj(a,s)?(a=Cj(),dh=Lv=To=null,Fl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return _j&&s.locale!=="ko"?null:s.data;default:return null}}var oB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Lj(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!oB[a.type]:s==="textarea"}function Ij(a,s,c,m){ql?Bl?Bl.push(m):Bl=[m]:ql=m,s=am(s,"onChange"),0<s.length&&(c=new mh("onChange","change",null,c,m),a.push({event:c,listeners:s}))}var Hu=null,Gu=null;function sB(a){yO(a,0)}function bh(a){var s=Co(a);if(ke(s))return a}function zj(a,s){if(a==="change")return s}var Uj=!1;if(Li){var Fv;if(Li){var $v="oninput"in document;if(!$v){var qj=document.createElement("div");qj.setAttribute("oninput","return;"),$v=typeof qj.oninput=="function"}Fv=$v}else Fv=!1;Uj=Fv&&(!document.documentMode||9<document.documentMode)}function Bj(){Hu&&(Hu.detachEvent("onpropertychange",Fj),Gu=Hu=null)}function Fj(a){if(a.propertyName==="value"&&bh(Gu)){var s=[];Ij(s,Gu,a,Mv(a)),jj(sB,s)}}function lB(a,s,c){a==="focusin"?(Bj(),Hu=s,Gu=c,Hu.attachEvent("onpropertychange",Fj)):a==="focusout"&&Bj()}function cB(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return bh(Gu)}function uB(a,s){if(a==="click")return bh(s)}function dB(a,s){if(a==="input"||a==="change")return bh(s)}function fB(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var $r=typeof Object.is=="function"?Object.is:fB;function Yu(a,s){if($r(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var c=Object.keys(a),m=Object.keys(s);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var y=c[m];if(!Ya.call(s,y)||!$r(a[y],s[y]))return!1}return!0}function $j(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Kj(a,s){var c=$j(a);a=0;for(var m;c;){if(c.nodeType===3){if(m=a+c.textContent.length,a<=s&&m>=s)return{node:c,offset:s-a};a=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=$j(c)}}function Hj(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?Hj(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function Gj(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=ze(a.document);s instanceof a.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)a=s.contentWindow;else break;s=ze(a.document)}return s}function Kv(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}var hB=Li&&"documentMode"in document&&11>=document.documentMode,$l=null,Hv=null,Wu=null,Gv=!1;function Yj(a,s,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Gv||$l==null||$l!==ze(m)||(m=$l,"selectionStart"in m&&Kv(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Wu&&Yu(Wu,m)||(Wu=m,m=am(Hv,"onSelect"),0<m.length&&(s=new mh("onSelect","select",null,s,c),a.push({event:s,listeners:m}),s.target=$l)))}function _s(a,s){var c={};return c[a.toLowerCase()]=s.toLowerCase(),c["Webkit"+a]="webkit"+s,c["Moz"+a]="moz"+s,c}var Kl={animationend:_s("Animation","AnimationEnd"),animationiteration:_s("Animation","AnimationIteration"),animationstart:_s("Animation","AnimationStart"),transitionrun:_s("Transition","TransitionRun"),transitionstart:_s("Transition","TransitionStart"),transitioncancel:_s("Transition","TransitionCancel"),transitionend:_s("Transition","TransitionEnd")},Yv={},Wj={};Li&&(Wj=document.createElement("div").style,"AnimationEvent"in window||(delete Kl.animationend.animation,delete Kl.animationiteration.animation,delete Kl.animationstart.animation),"TransitionEvent"in window||delete Kl.transitionend.transition);function Ds(a){if(Yv[a])return Yv[a];if(!Kl[a])return a;var s=Kl[a],c;for(c in s)if(s.hasOwnProperty(c)&&c in Wj)return Yv[a]=s[c];return a}var Qj=Ds("animationend"),Vj=Ds("animationiteration"),Xj=Ds("animationstart"),mB=Ds("transitionrun"),pB=Ds("transitionstart"),bB=Ds("transitioncancel"),Zj=Ds("transitionend"),Jj=new Map,Wv="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Wv.push("scrollEnd");function Pa(a,s){Jj.set(a,s),Bn(s,[a])}var vh=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},oa=[],Hl=0,Qv=0;function gh(){for(var a=Hl,s=Qv=Hl=0;s<a;){var c=oa[s];oa[s++]=null;var m=oa[s];oa[s++]=null;var y=oa[s];oa[s++]=null;var w=oa[s];if(oa[s++]=null,m!==null&&y!==null){var N=m.pending;N===null?y.next=y:(y.next=N.next,N.next=y),m.pending=y}w!==0&&eC(c,y,w)}}function yh(a,s,c,m){oa[Hl++]=a,oa[Hl++]=s,oa[Hl++]=c,oa[Hl++]=m,Qv|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function Vv(a,s,c,m){return yh(a,s,c,m),xh(a)}function Ms(a,s){return yh(a,null,null,s),xh(a)}function eC(a,s,c){a.lanes|=c;var m=a.alternate;m!==null&&(m.lanes|=c);for(var y=!1,w=a.return;w!==null;)w.childLanes|=c,m=w.alternate,m!==null&&(m.childLanes|=c),w.tag===22&&(a=w.stateNode,a===null||a._visibility&1||(y=!0)),a=w,w=w.return;return a.tag===3?(w=a.stateNode,y&&s!==null&&(y=31-zt(c),a=w.hiddenUpdates,m=a[y],m===null?a[y]=[s]:m.push(s),s.lane=c|536870912),w):null}function xh(a){if(50<bd)throw bd=0,iy=null,Error(r(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var Gl={};function vB(a,s,c,m){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(a,s,c,m){return new vB(a,s,c,m)}function Xv(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Ii(a,s){var c=a.alternate;return c===null?(c=Kr(a.tag,s,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=s,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&65011712,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,s=a.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function tC(a,s){a.flags&=65011714;var c=a.alternate;return c===null?(a.childLanes=0,a.lanes=s,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,s=c.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a}function wh(a,s,c,m,y,w){var N=0;if(m=a,typeof a=="function")Xv(a)&&(N=1);else if(typeof a=="string")N=SF(a,c,fe.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case z:return a=Kr(31,c,s,y),a.elementType=z,a.lanes=w,a;case S:return Rs(c.children,y,w,s);case A:N=8,y|=24;break;case j:return a=Kr(12,c,s,y|2),a.elementType=j,a.lanes=w,a;case _:return a=Kr(13,c,s,y),a.elementType=_,a.lanes=w,a;case P:return a=Kr(19,c,s,y),a.elementType=P,a.lanes=w,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case O:N=10;break e;case C:N=9;break e;case T:N=11;break e;case D:N=14;break e;case L:N=16,m=null;break e}N=29,c=Error(r(130,a===null?"null":typeof a,"")),m=null}return s=Kr(N,c,s,y),s.elementType=a,s.type=m,s.lanes=w,s}function Rs(a,s,c,m){return a=Kr(7,a,m,s),a.lanes=c,a}function Zv(a,s,c){return a=Kr(6,a,null,s),a.lanes=c,a}function nC(a){var s=Kr(18,null,null,0);return s.stateNode=a,s}function Jv(a,s,c){return s=Kr(4,a.children!==null?a.children:[],a.key,s),s.lanes=c,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}var rC=new WeakMap;function sa(a,s){if(typeof a=="object"&&a!==null){var c=rC.get(a);return c!==void 0?c:(s={value:a,source:s,stack:qn(s)},rC.set(a,s),s)}return{value:a,source:s,stack:qn(s)}}var Yl=[],Wl=0,Sh=null,Qu=0,la=[],ca=0,Po=null,Za=1,Ja="";function zi(a,s){Yl[Wl++]=Qu,Yl[Wl++]=Sh,Sh=a,Qu=s}function aC(a,s,c){la[ca++]=Za,la[ca++]=Ja,la[ca++]=Po,Po=a;var m=Za;a=Ja;var y=32-zt(m)-1;m&=~(1<<y),c+=1;var w=32-zt(s)+y;if(30<w){var N=y-y%5;w=(m&(1<<N)-1).toString(32),m>>=N,y-=N,Za=1<<32-zt(s)+y|c<<y|m,Ja=w+a}else Za=1<<w|c<<y|m,Ja=a}function eg(a){a.return!==null&&(zi(a,1),aC(a,1,0))}function tg(a){for(;a===Sh;)Sh=Yl[--Wl],Yl[Wl]=null,Qu=Yl[--Wl],Yl[Wl]=null;for(;a===Po;)Po=la[--ca],la[ca]=null,Ja=la[--ca],la[ca]=null,Za=la[--ca],la[ca]=null}function iC(a,s){la[ca++]=Za,la[ca++]=Ja,la[ca++]=Po,Za=s.id,Ja=s.overflow,Po=a}var Fn=null,Tt=null,Ze=!1,_o=null,ua=!1,ng=Error(r(519));function Do(a){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vu(sa(s,a)),ng}function oC(a){var s=a.stateNode,c=a.type,m=a.memoizedProps;switch(s[ln]=a,s[Tn]=m,c){case"dialog":Qe("cancel",s),Qe("close",s);break;case"iframe":case"object":case"embed":Qe("load",s);break;case"video":case"audio":for(c=0;c<gd.length;c++)Qe(gd[c],s);break;case"source":Qe("error",s);break;case"img":case"image":case"link":Qe("error",s),Qe("load",s);break;case"details":Qe("toggle",s);break;case"input":Qe("invalid",s),Ta(s,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Qe("invalid",s);break;case"textarea":Qe("invalid",s),wj(s,m.value,m.defaultValue,m.children)}c=m.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||s.textContent===""+c||m.suppressHydrationWarning===!0||EO(s.textContent,c)?(m.popover!=null&&(Qe("beforetoggle",s),Qe("toggle",s)),m.onScroll!=null&&Qe("scroll",s),m.onScrollEnd!=null&&Qe("scrollend",s),m.onClick!=null&&(s.onclick=ki),s=!0):s=!1,s||Do(a,!0)}function sC(a){for(Fn=a.return;Fn;)switch(Fn.tag){case 5:case 31:case 13:ua=!1;return;case 27:case 3:ua=!0;return;default:Fn=Fn.return}}function Ql(a){if(a!==Fn)return!1;if(!Ze)return sC(a),Ze=!0,!1;var s=a.tag,c;if((c=s!==3&&s!==27)&&((c=s===5)&&(c=a.type,c=!(c!=="form"&&c!=="button")||xy(a.type,a.memoizedProps)),c=!c),c&&Tt&&Do(a),sC(a),s===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tt=DO(a)}else if(s===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tt=DO(a)}else s===27?(s=Tt,Go(a.type)?(a=jy,jy=null,Tt=a):Tt=s):Tt=Fn?fa(a.stateNode.nextSibling):null;return!0}function ks(){Tt=Fn=null,Ze=!1}function rg(){var a=_o;return a!==null&&(Tr===null?Tr=a:Tr.push.apply(Tr,a),_o=null),a}function Vu(a){_o===null?_o=[a]:_o.push(a)}var ag=k(null),Ls=null,Ui=null;function Mo(a,s,c){ce(ag,s._currentValue),s._currentValue=c}function qi(a){a._currentValue=ag.current,Q(ag)}function ig(a,s,c){for(;a!==null;){var m=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,m!==null&&(m.childLanes|=s)):m!==null&&(m.childLanes&s)!==s&&(m.childLanes|=s),a===c)break;a=a.return}}function og(a,s,c,m){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var w=y.dependencies;if(w!==null){var N=y.child;w=w.firstContext;e:for(;w!==null;){var M=w;w=y;for(var B=0;B<s.length;B++)if(M.context===s[B]){w.lanes|=c,M=w.alternate,M!==null&&(M.lanes|=c),ig(w.return,c,a),m||(N=null);break e}w=M.next}}else if(y.tag===18){if(N=y.return,N===null)throw Error(r(341));N.lanes|=c,w=N.alternate,w!==null&&(w.lanes|=c),ig(N,c,a),N=null}else N=y.child;if(N!==null)N.return=y;else for(N=y;N!==null;){if(N===a){N=null;break}if(y=N.sibling,y!==null){y.return=N.return,N=y;break}N=N.return}y=N}}function Vl(a,s,c,m){a=null;for(var y=s,w=!1;y!==null;){if(!w){if((y.flags&524288)!==0)w=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var N=y.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var M=y.type;$r(y.pendingProps.value,N.value)||(a!==null?a.push(M):a=[M])}}else if(y===qe.current){if(N=y.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(Ed):a=[Ed])}y=y.return}a!==null&&og(s,a,c,m),s.flags|=262144}function Eh(a){for(a=a.firstContext;a!==null;){if(!$r(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Is(a){Ls=a,Ui=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function $n(a){return lC(Ls,a)}function Ah(a,s){return Ls===null&&Is(a),lC(a,s)}function lC(a,s){var c=s._currentValue;if(s={context:s,memoizedValue:c,next:null},Ui===null){if(a===null)throw Error(r(308));Ui=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else Ui=Ui.next=s;return c}var gB=typeof AbortController<"u"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(c,m){a.push(m)}};this.abort=function(){s.aborted=!0,a.forEach(function(c){return c()})}},yB=e.unstable_scheduleCallback,xB=e.unstable_NormalPriority,cn={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sg(){return{controller:new gB,data:new Map,refCount:0}}function Xu(a){a.refCount--,a.refCount===0&&yB(xB,function(){a.controller.abort()})}var Zu=null,lg=0,Xl=0,Zl=null;function wB(a,s){if(Zu===null){var c=Zu=[];lg=0,Xl=dy(),Zl={status:"pending",value:void 0,then:function(m){c.push(m)}}}return lg++,s.then(cC,cC),s}function cC(){if(--lg===0&&Zu!==null){Zl!==null&&(Zl.status="fulfilled");var a=Zu;Zu=null,Xl=0,Zl=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function SB(a,s){var c=[],m={status:"pending",value:null,reason:null,then:function(y){c.push(y)}};return a.then(function(){m.status="fulfilled",m.value=s;for(var y=0;y<c.length;y++)(0,c[y])(s)},function(y){for(m.status="rejected",m.reason=y,y=0;y<c.length;y++)(0,c[y])(void 0)}),m}var uC=K.S;K.S=function(a,s){Y1=Kt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&wB(a,s),uC!==null&&uC(a,s)};var zs=k(null);function cg(){var a=zs.current;return a!==null?a:wt.pooledCache}function jh(a,s){s===null?ce(zs,zs.current):ce(zs,s.pool)}function dC(){var a=cg();return a===null?null:{parent:cn._currentValue,pool:a}}var Jl=Error(r(460)),ug=Error(r(474)),Ch=Error(r(542)),Oh={then:function(){}};function fC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function hC(a,s,c){switch(c=a[c],c===void 0?a.push(s):c!==s&&(s.then(ki,ki),s=c),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,pC(a),a;default:if(typeof s.status=="string")s.then(ki,ki);else{if(a=wt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=s,a.status="pending",a.then(function(m){if(s.status==="pending"){var y=s;y.status="fulfilled",y.value=m}},function(m){if(s.status==="pending"){var y=s;y.status="rejected",y.reason=m}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,pC(a),a}throw qs=s,Jl}}function Us(a){try{var s=a._init;return s(a._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(qs=c,Jl):c}}var qs=null;function mC(){if(qs===null)throw Error(r(459));var a=qs;return qs=null,a}function pC(a){if(a===Jl||a===Ch)throw Error(r(483))}var ec=null,Ju=0;function Nh(a){var s=Ju;return Ju+=1,ec===null&&(ec=[]),hC(ec,a,s)}function ed(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function Th(a,s){throw s.$$typeof===g?Error(r(525)):(a=Object.prototype.toString.call(s),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":a)))}function bC(a){function s(Y,H){if(a){var V=Y.deletions;V===null?(Y.deletions=[H],Y.flags|=16):V.push(H)}}function c(Y,H){if(!a)return null;for(;H!==null;)s(Y,H),H=H.sibling;return null}function m(Y){for(var H=new Map;Y!==null;)Y.key!==null?H.set(Y.key,Y):H.set(Y.index,Y),Y=Y.sibling;return H}function y(Y,H){return Y=Ii(Y,H),Y.index=0,Y.sibling=null,Y}function w(Y,H,V){return Y.index=V,a?(V=Y.alternate,V!==null?(V=V.index,V<H?(Y.flags|=67108866,H):V):(Y.flags|=67108866,H)):(Y.flags|=1048576,H)}function N(Y){return a&&Y.alternate===null&&(Y.flags|=67108866),Y}function M(Y,H,V,oe){return H===null||H.tag!==6?(H=Zv(V,Y.mode,oe),H.return=Y,H):(H=y(H,V),H.return=Y,H)}function B(Y,H,V,oe){var Pe=V.type;return Pe===S?ae(Y,H,V.props.children,oe,V.key):H!==null&&(H.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===L&&Us(Pe)===H.type)?(H=y(H,V.props),ed(H,V),H.return=Y,H):(H=wh(V.type,V.key,V.props,null,Y.mode,oe),ed(H,V),H.return=Y,H)}function X(Y,H,V,oe){return H===null||H.tag!==4||H.stateNode.containerInfo!==V.containerInfo||H.stateNode.implementation!==V.implementation?(H=Jv(V,Y.mode,oe),H.return=Y,H):(H=y(H,V.children||[]),H.return=Y,H)}function ae(Y,H,V,oe,Pe){return H===null||H.tag!==7?(H=Rs(V,Y.mode,oe,Pe),H.return=Y,H):(H=y(H,V),H.return=Y,H)}function se(Y,H,V){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Zv(""+H,Y.mode,V),H.return=Y,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case x:return V=wh(H.type,H.key,H.props,null,Y.mode,V),ed(V,H),V.return=Y,V;case E:return H=Jv(H,Y.mode,V),H.return=Y,H;case L:return H=Us(H),se(Y,H,V)}if(ie(H)||U(H))return H=Rs(H,Y.mode,V,null),H.return=Y,H;if(typeof H.then=="function")return se(Y,Nh(H),V);if(H.$$typeof===O)return se(Y,Ah(Y,H),V);Th(Y,H)}return null}function J(Y,H,V,oe){var Pe=H!==null?H.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Pe!==null?null:M(Y,H,""+V,oe);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case x:return V.key===Pe?B(Y,H,V,oe):null;case E:return V.key===Pe?X(Y,H,V,oe):null;case L:return V=Us(V),J(Y,H,V,oe)}if(ie(V)||U(V))return Pe!==null?null:ae(Y,H,V,oe,null);if(typeof V.then=="function")return J(Y,H,Nh(V),oe);if(V.$$typeof===O)return J(Y,H,Ah(Y,V),oe);Th(Y,V)}return null}function te(Y,H,V,oe,Pe){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Y=Y.get(V)||null,M(H,Y,""+oe,Pe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return Y=Y.get(oe.key===null?V:oe.key)||null,B(H,Y,oe,Pe);case E:return Y=Y.get(oe.key===null?V:oe.key)||null,X(H,Y,oe,Pe);case L:return oe=Us(oe),te(Y,H,V,oe,Pe)}if(ie(oe)||U(oe))return Y=Y.get(V)||null,ae(H,Y,oe,Pe,null);if(typeof oe.then=="function")return te(Y,H,V,Nh(oe),Pe);if(oe.$$typeof===O)return te(Y,H,V,Ah(H,oe),Pe);Th(H,oe)}return null}function Ae(Y,H,V,oe){for(var Pe=null,at=null,Ce=H,$e=H=0,Xe=null;Ce!==null&&$e<V.length;$e++){Ce.index>$e?(Xe=Ce,Ce=null):Xe=Ce.sibling;var it=J(Y,Ce,V[$e],oe);if(it===null){Ce===null&&(Ce=Xe);break}a&&Ce&&it.alternate===null&&s(Y,Ce),H=w(it,H,$e),at===null?Pe=it:at.sibling=it,at=it,Ce=Xe}if($e===V.length)return c(Y,Ce),Ze&&zi(Y,$e),Pe;if(Ce===null){for(;$e<V.length;$e++)Ce=se(Y,V[$e],oe),Ce!==null&&(H=w(Ce,H,$e),at===null?Pe=Ce:at.sibling=Ce,at=Ce);return Ze&&zi(Y,$e),Pe}for(Ce=m(Ce);$e<V.length;$e++)Xe=te(Ce,Y,$e,V[$e],oe),Xe!==null&&(a&&Xe.alternate!==null&&Ce.delete(Xe.key===null?$e:Xe.key),H=w(Xe,H,$e),at===null?Pe=Xe:at.sibling=Xe,at=Xe);return a&&Ce.forEach(function(Xo){return s(Y,Xo)}),Ze&&zi(Y,$e),Pe}function De(Y,H,V,oe){if(V==null)throw Error(r(151));for(var Pe=null,at=null,Ce=H,$e=H=0,Xe=null,it=V.next();Ce!==null&&!it.done;$e++,it=V.next()){Ce.index>$e?(Xe=Ce,Ce=null):Xe=Ce.sibling;var Xo=J(Y,Ce,it.value,oe);if(Xo===null){Ce===null&&(Ce=Xe);break}a&&Ce&&Xo.alternate===null&&s(Y,Ce),H=w(Xo,H,$e),at===null?Pe=Xo:at.sibling=Xo,at=Xo,Ce=Xe}if(it.done)return c(Y,Ce),Ze&&zi(Y,$e),Pe;if(Ce===null){for(;!it.done;$e++,it=V.next())it=se(Y,it.value,oe),it!==null&&(H=w(it,H,$e),at===null?Pe=it:at.sibling=it,at=it);return Ze&&zi(Y,$e),Pe}for(Ce=m(Ce);!it.done;$e++,it=V.next())it=te(Ce,Y,$e,it.value,oe),it!==null&&(a&&it.alternate!==null&&Ce.delete(it.key===null?$e:it.key),H=w(it,H,$e),at===null?Pe=it:at.sibling=it,at=it);return a&&Ce.forEach(function(MF){return s(Y,MF)}),Ze&&zi(Y,$e),Pe}function vt(Y,H,V,oe){if(typeof V=="object"&&V!==null&&V.type===S&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case x:e:{for(var Pe=V.key;H!==null;){if(H.key===Pe){if(Pe=V.type,Pe===S){if(H.tag===7){c(Y,H.sibling),oe=y(H,V.props.children),oe.return=Y,Y=oe;break e}}else if(H.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===L&&Us(Pe)===H.type){c(Y,H.sibling),oe=y(H,V.props),ed(oe,V),oe.return=Y,Y=oe;break e}c(Y,H);break}else s(Y,H);H=H.sibling}V.type===S?(oe=Rs(V.props.children,Y.mode,oe,V.key),oe.return=Y,Y=oe):(oe=wh(V.type,V.key,V.props,null,Y.mode,oe),ed(oe,V),oe.return=Y,Y=oe)}return N(Y);case E:e:{for(Pe=V.key;H!==null;){if(H.key===Pe)if(H.tag===4&&H.stateNode.containerInfo===V.containerInfo&&H.stateNode.implementation===V.implementation){c(Y,H.sibling),oe=y(H,V.children||[]),oe.return=Y,Y=oe;break e}else{c(Y,H);break}else s(Y,H);H=H.sibling}oe=Jv(V,Y.mode,oe),oe.return=Y,Y=oe}return N(Y);case L:return V=Us(V),vt(Y,H,V,oe)}if(ie(V))return Ae(Y,H,V,oe);if(U(V)){if(Pe=U(V),typeof Pe!="function")throw Error(r(150));return V=Pe.call(V),De(Y,H,V,oe)}if(typeof V.then=="function")return vt(Y,H,Nh(V),oe);if(V.$$typeof===O)return vt(Y,H,Ah(Y,V),oe);Th(Y,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,H!==null&&H.tag===6?(c(Y,H.sibling),oe=y(H,V),oe.return=Y,Y=oe):(c(Y,H),oe=Zv(V,Y.mode,oe),oe.return=Y,Y=oe),N(Y)):c(Y,H)}return function(Y,H,V,oe){try{Ju=0;var Pe=vt(Y,H,V,oe);return ec=null,Pe}catch(Ce){if(Ce===Jl||Ce===Ch)throw Ce;var at=Kr(29,Ce,null,Y.mode);return at.lanes=oe,at.return=Y,at}finally{}}}var Bs=bC(!0),vC=bC(!1),Ro=!1;function dg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fg(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ko(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Lo(a,s,c){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(lt&2)!==0){var y=m.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),m.pending=s,s=xh(a),eC(a,null,c),s}return yh(a,m,s,c),xh(a)}function td(a,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194048)!==0)){var m=s.lanes;m&=a.pendingLanes,c|=m,s.lanes=c,ur(a,c)}}function hg(a,s){var c=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var y=null,w=null;if(c=c.firstBaseUpdate,c!==null){do{var N={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};w===null?y=w=N:w=w.next=N,c=c.next}while(c!==null);w===null?y=w=s:w=w.next=s}else y=w=s;c={baseState:m.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:m.shared,callbacks:m.callbacks},a.updateQueue=c;return}a=c.lastBaseUpdate,a===null?c.firstBaseUpdate=s:a.next=s,c.lastBaseUpdate=s}var mg=!1;function nd(){if(mg){var a=Zl;if(a!==null)throw a}}function rd(a,s,c,m){mg=!1;var y=a.updateQueue;Ro=!1;var w=y.firstBaseUpdate,N=y.lastBaseUpdate,M=y.shared.pending;if(M!==null){y.shared.pending=null;var B=M,X=B.next;B.next=null,N===null?w=X:N.next=X,N=B;var ae=a.alternate;ae!==null&&(ae=ae.updateQueue,M=ae.lastBaseUpdate,M!==N&&(M===null?ae.firstBaseUpdate=X:M.next=X,ae.lastBaseUpdate=B))}if(w!==null){var se=y.baseState;N=0,ae=X=B=null,M=w;do{var J=M.lane&-536870913,te=J!==M.lane;if(te?(Ve&J)===J:(m&J)===J){J!==0&&J===Xl&&(mg=!0),ae!==null&&(ae=ae.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Ae=a,De=M;J=s;var vt=c;switch(De.tag){case 1:if(Ae=De.payload,typeof Ae=="function"){se=Ae.call(vt,se,J);break e}se=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=De.payload,J=typeof Ae=="function"?Ae.call(vt,se,J):Ae,J==null)break e;se=b({},se,J);break e;case 2:Ro=!0}}J=M.callback,J!==null&&(a.flags|=64,te&&(a.flags|=8192),te=y.callbacks,te===null?y.callbacks=[J]:te.push(J))}else te={lane:J,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ae===null?(X=ae=te,B=se):ae=ae.next=te,N|=J;if(M=M.next,M===null){if(M=y.shared.pending,M===null)break;te=M,M=te.next,te.next=null,y.lastBaseUpdate=te,y.shared.pending=null}}while(!0);ae===null&&(B=se),y.baseState=B,y.firstBaseUpdate=X,y.lastBaseUpdate=ae,w===null&&(y.shared.lanes=0),Bo|=N,a.lanes=N,a.memoizedState=se}}function gC(a,s){if(typeof a!="function")throw Error(r(191,a));a.call(s)}function yC(a,s){var c=a.callbacks;if(c!==null)for(a.callbacks=null,a=0;a<c.length;a++)gC(c[a],s)}var tc=k(null),Ph=k(0);function xC(a,s){a=Qi,ce(Ph,a),ce(tc,s),Qi=a|s.baseLanes}function pg(){ce(Ph,Qi),ce(tc,tc.current)}function bg(){Qi=Ph.current,Q(tc),Q(Ph)}var Hr=k(null),da=null;function Io(a){var s=a.alternate;ce(nn,nn.current&1),ce(Hr,a),da===null&&(s===null||tc.current!==null||s.memoizedState!==null)&&(da=a)}function vg(a){ce(nn,nn.current),ce(Hr,a),da===null&&(da=a)}function wC(a){a.tag===22?(ce(nn,nn.current),ce(Hr,a),da===null&&(da=a)):zo()}function zo(){ce(nn,nn.current),ce(Hr,Hr.current)}function Gr(a){Q(Hr),da===a&&(da=null),Q(nn)}var nn=k(0);function _h(a){for(var s=a;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Ey(c)||Ay(c)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Bi=0,Fe=null,pt=null,un=null,Dh=!1,nc=!1,Fs=!1,Mh=0,ad=0,rc=null,EB=0;function Gt(){throw Error(r(321))}function gg(a,s){if(s===null)return!1;for(var c=0;c<s.length&&c<a.length;c++)if(!$r(a[c],s[c]))return!1;return!0}function yg(a,s,c,m,y,w){return Bi=w,Fe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,K.H=a===null||a.memoizedState===null?a1:Rg,Fs=!1,w=c(m,y),Fs=!1,nc&&(w=EC(s,c,m,y)),SC(a),w}function SC(a){K.H=sd;var s=pt!==null&&pt.next!==null;if(Bi=0,un=pt=Fe=null,Dh=!1,ad=0,rc=null,s)throw Error(r(300));a===null||dn||(a=a.dependencies,a!==null&&Eh(a)&&(dn=!0))}function EC(a,s,c,m){Fe=a;var y=0;do{if(nc&&(rc=null),ad=0,nc=!1,25<=y)throw Error(r(301));if(y+=1,un=pt=null,a.updateQueue!=null){var w=a.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}K.H=i1,w=s(c,m)}while(nc);return w}function AB(){var a=K.H,s=a.useState()[0];return s=typeof s.then=="function"?id(s):s,a=a.useState()[0],(pt!==null?pt.memoizedState:null)!==a&&(Fe.flags|=1024),s}function xg(){var a=Mh!==0;return Mh=0,a}function wg(a,s,c){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~c}function Sg(a){if(Dh){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}Dh=!1}Bi=0,un=pt=Fe=null,nc=!1,ad=Mh=0,rc=null}function fr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?Fe.memoizedState=un=a:un=un.next=a,un}function rn(){if(pt===null){var a=Fe.alternate;a=a!==null?a.memoizedState:null}else a=pt.next;var s=un===null?Fe.memoizedState:un.next;if(s!==null)un=s,pt=a;else{if(a===null)throw Fe.alternate===null?Error(r(467)):Error(r(310));pt=a,a={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},un===null?Fe.memoizedState=un=a:un=un.next=a}return un}function Rh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function id(a){var s=ad;return ad+=1,rc===null&&(rc=[]),a=hC(rc,a,s),s=Fe,(un===null?s.memoizedState:un.next)===null&&(s=s.alternate,K.H=s===null||s.memoizedState===null?a1:Rg),a}function kh(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return id(a);if(a.$$typeof===O)return $n(a)}throw Error(r(438,String(a)))}function Eg(a){var s=null,c=Fe.updateQueue;if(c!==null&&(s=c.memoCache),s==null){var m=Fe.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(s={data:m.data.map(function(y){return y.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),c===null&&(c=Rh(),Fe.updateQueue=c),c.memoCache=s,c=s.data[s.index],c===void 0)for(c=s.data[s.index]=Array(a),m=0;m<a;m++)c[m]=R;return s.index++,c}function Fi(a,s){return typeof s=="function"?s(a):s}function Lh(a){var s=rn();return Ag(s,pt,a)}function Ag(a,s,c){var m=a.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var y=a.baseQueue,w=m.pending;if(w!==null){if(y!==null){var N=y.next;y.next=w.next,w.next=N}s.baseQueue=y=w,m.pending=null}if(w=a.baseState,y===null)a.memoizedState=w;else{s=y.next;var M=N=null,B=null,X=s,ae=!1;do{var se=X.lane&-536870913;if(se!==X.lane?(Ve&se)===se:(Bi&se)===se){var J=X.revertLane;if(J===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),se===Xl&&(ae=!0);else if((Bi&J)===J){X=X.next,J===Xl&&(ae=!0);continue}else se={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},B===null?(M=B=se,N=w):B=B.next=se,Fe.lanes|=J,Bo|=J;se=X.action,Fs&&c(w,se),w=X.hasEagerState?X.eagerState:c(w,se)}else J={lane:se,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},B===null?(M=B=J,N=w):B=B.next=J,Fe.lanes|=se,Bo|=se;X=X.next}while(X!==null&&X!==s);if(B===null?N=w:B.next=M,!$r(w,a.memoizedState)&&(dn=!0,ae&&(c=Zl,c!==null)))throw c;a.memoizedState=w,a.baseState=N,a.baseQueue=B,m.lastRenderedState=w}return y===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function jg(a){var s=rn(),c=s.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=a;var m=c.dispatch,y=c.pending,w=s.memoizedState;if(y!==null){c.pending=null;var N=y=y.next;do w=a(w,N.action),N=N.next;while(N!==y);$r(w,s.memoizedState)||(dn=!0),s.memoizedState=w,s.baseQueue===null&&(s.baseState=w),c.lastRenderedState=w}return[w,m]}function AC(a,s,c){var m=Fe,y=rn(),w=Ze;if(w){if(c===void 0)throw Error(r(407));c=c()}else c=s();var N=!$r((pt||y).memoizedState,c);if(N&&(y.memoizedState=c,dn=!0),y=y.queue,Ng(OC.bind(null,m,y,a),[a]),y.getSnapshot!==s||N||un!==null&&un.memoizedState.tag&1){if(m.flags|=2048,ac(9,{destroy:void 0},CC.bind(null,m,y,c,s),null),wt===null)throw Error(r(349));w||(Bi&127)!==0||jC(m,s,c)}return c}function jC(a,s,c){a.flags|=16384,a={getSnapshot:s,value:c},s=Fe.updateQueue,s===null?(s=Rh(),Fe.updateQueue=s,s.stores=[a]):(c=s.stores,c===null?s.stores=[a]:c.push(a))}function CC(a,s,c,m){s.value=c,s.getSnapshot=m,NC(s)&&TC(a)}function OC(a,s,c){return c(function(){NC(s)&&TC(a)})}function NC(a){var s=a.getSnapshot;a=a.value;try{var c=s();return!$r(a,c)}catch{return!0}}function TC(a){var s=Ms(a,2);s!==null&&Pr(s,a,2)}function Cg(a){var s=fr();if(typeof a=="function"){var c=a;if(a=c(),Fs){Zn(!0);try{c()}finally{Zn(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:a},s}function PC(a,s,c,m){return a.baseState=c,Ag(a,pt,typeof m=="function"?m:Fi)}function jB(a,s,c,m,y){if(Uh(a))throw Error(r(485));if(a=s.action,a!==null){var w={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){w.listeners.push(N)}};K.T!==null?c(!0):w.isTransition=!1,m(w),c=s.pending,c===null?(w.next=s.pending=w,_C(s,w)):(w.next=c.next,s.pending=c.next=w)}}function _C(a,s){var c=s.action,m=s.payload,y=a.state;if(s.isTransition){var w=K.T,N={};K.T=N;try{var M=c(y,m),B=K.S;B!==null&&B(N,M),DC(a,s,M)}catch(X){Og(a,s,X)}finally{w!==null&&N.types!==null&&(w.types=N.types),K.T=w}}else try{w=c(y,m),DC(a,s,w)}catch(X){Og(a,s,X)}}function DC(a,s,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){MC(a,s,m)},function(m){return Og(a,s,m)}):MC(a,s,c)}function MC(a,s,c){s.status="fulfilled",s.value=c,RC(s),a.state=c,s=a.pending,s!==null&&(c=s.next,c===s?a.pending=null:(c=c.next,s.next=c,_C(a,c)))}function Og(a,s,c){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do s.status="rejected",s.reason=c,RC(s),s=s.next;while(s!==m)}a.action=null}function RC(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function kC(a,s){return s}function LC(a,s){if(Ze){var c=wt.formState;if(c!==null){e:{var m=Fe;if(Ze){if(Tt){t:{for(var y=Tt,w=ua;y.nodeType!==8;){if(!w){y=null;break t}if(y=fa(y.nextSibling),y===null){y=null;break t}}w=y.data,y=w==="F!"||w==="F"?y:null}if(y){Tt=fa(y.nextSibling),m=y.data==="F!";break e}}Do(m)}m=!1}m&&(s=c[0])}}return c=fr(),c.memoizedState=c.baseState=s,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kC,lastRenderedState:s},c.queue=m,c=t1.bind(null,Fe,m),m.dispatch=c,m=Cg(!1),w=Mg.bind(null,Fe,!1,m.queue),m=fr(),y={state:s,dispatch:null,action:a,pending:null},m.queue=y,c=jB.bind(null,Fe,y,w,c),y.dispatch=c,m.memoizedState=a,[s,c,!1]}function IC(a){var s=rn();return zC(s,pt,a)}function zC(a,s,c){if(s=Ag(a,s,kC)[0],a=Lh(Fi)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var m=id(s)}catch(N){throw N===Jl?Ch:N}else m=s;s=rn();var y=s.queue,w=y.dispatch;return c!==s.memoizedState&&(Fe.flags|=2048,ac(9,{destroy:void 0},CB.bind(null,y,c),null)),[m,w,a]}function CB(a,s){a.action=s}function UC(a){var s=rn(),c=pt;if(c!==null)return zC(s,c,a);rn(),s=s.memoizedState,c=rn();var m=c.queue.dispatch;return c.memoizedState=a,[s,m,!1]}function ac(a,s,c,m){return a={tag:a,create:c,deps:m,inst:s,next:null},s=Fe.updateQueue,s===null&&(s=Rh(),Fe.updateQueue=s),c=s.lastEffect,c===null?s.lastEffect=a.next=a:(m=c.next,c.next=a,a.next=m,s.lastEffect=a),a}function qC(){return rn().memoizedState}function Ih(a,s,c,m){var y=fr();Fe.flags|=a,y.memoizedState=ac(1|s,{destroy:void 0},c,m===void 0?null:m)}function zh(a,s,c,m){var y=rn();m=m===void 0?null:m;var w=y.memoizedState.inst;pt!==null&&m!==null&&gg(m,pt.memoizedState.deps)?y.memoizedState=ac(s,w,c,m):(Fe.flags|=a,y.memoizedState=ac(1|s,w,c,m))}function BC(a,s){Ih(8390656,8,a,s)}function Ng(a,s){zh(2048,8,a,s)}function OB(a){Fe.flags|=4;var s=Fe.updateQueue;if(s===null)s=Rh(),Fe.updateQueue=s,s.events=[a];else{var c=s.events;c===null?s.events=[a]:c.push(a)}}function FC(a){var s=rn().memoizedState;return OB({ref:s,nextImpl:a}),function(){if((lt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function $C(a,s){return zh(4,2,a,s)}function KC(a,s){return zh(4,4,a,s)}function HC(a,s){if(typeof s=="function"){a=a();var c=s(a);return function(){typeof c=="function"?c():s(null)}}if(s!=null)return a=a(),s.current=a,function(){s.current=null}}function GC(a,s,c){c=c!=null?c.concat([a]):null,zh(4,4,HC.bind(null,s,a),c)}function Tg(){}function YC(a,s){var c=rn();s=s===void 0?null:s;var m=c.memoizedState;return s!==null&&gg(s,m[1])?m[0]:(c.memoizedState=[a,s],a)}function WC(a,s){var c=rn();s=s===void 0?null:s;var m=c.memoizedState;if(s!==null&&gg(s,m[1]))return m[0];if(m=a(),Fs){Zn(!0);try{a()}finally{Zn(!1)}}return c.memoizedState=[m,s],m}function Pg(a,s,c){return c===void 0||(Bi&1073741824)!==0&&(Ve&261930)===0?a.memoizedState=s:(a.memoizedState=c,a=Q1(),Fe.lanes|=a,Bo|=a,c)}function QC(a,s,c,m){return $r(c,s)?c:tc.current!==null?(a=Pg(a,c,m),$r(a,s)||(dn=!0),a):(Bi&42)===0||(Bi&1073741824)!==0&&(Ve&261930)===0?(dn=!0,a.memoizedState=c):(a=Q1(),Fe.lanes|=a,Bo|=a,s)}function VC(a,s,c,m,y){var w=Z.p;Z.p=w!==0&&8>w?w:8;var N=K.T,M={};K.T=M,Mg(a,!1,s,c);try{var B=y(),X=K.S;if(X!==null&&X(M,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ae=SB(B,m);od(a,s,ae,Qr(a))}else od(a,s,m,Qr(a))}catch(se){od(a,s,{then:function(){},status:"rejected",reason:se},Qr())}finally{Z.p=w,N!==null&&M.types!==null&&(N.types=M.types),K.T=N}}function NB(){}function _g(a,s,c,m){if(a.tag!==5)throw Error(r(476));var y=XC(a).queue;VC(a,y,s,$,c===null?NB:function(){return ZC(a),c(m)})}function XC(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:$},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:c},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function ZC(a){var s=XC(a);s.next===null&&(s=a.alternate.memoizedState),od(a,s.next.queue,{},Qr())}function Dg(){return $n(Ed)}function JC(){return rn().memoizedState}function e1(){return rn().memoizedState}function TB(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var c=Qr();a=ko(c);var m=Lo(s,a,c);m!==null&&(Pr(m,s,c),td(m,s,c)),s={cache:sg()},a.payload=s;return}s=s.return}}function PB(a,s,c){var m=Qr();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Uh(a)?n1(s,c):(c=Vv(a,s,c,m),c!==null&&(Pr(c,a,m),r1(c,s,m)))}function t1(a,s,c){var m=Qr();od(a,s,c,m)}function od(a,s,c,m){var y={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Uh(a))n1(s,y);else{var w=a.alternate;if(a.lanes===0&&(w===null||w.lanes===0)&&(w=s.lastRenderedReducer,w!==null))try{var N=s.lastRenderedState,M=w(N,c);if(y.hasEagerState=!0,y.eagerState=M,$r(M,N))return yh(a,s,y,0),wt===null&&gh(),!1}catch{}finally{}if(c=Vv(a,s,y,m),c!==null)return Pr(c,a,m),r1(c,s,m),!0}return!1}function Mg(a,s,c,m){if(m={lane:2,revertLane:dy(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Uh(a)){if(s)throw Error(r(479))}else s=Vv(a,c,m,2),s!==null&&Pr(s,a,2)}function Uh(a){var s=a.alternate;return a===Fe||s!==null&&s===Fe}function n1(a,s){nc=Dh=!0;var c=a.pending;c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s}function r1(a,s,c){if((c&4194048)!==0){var m=s.lanes;m&=a.pendingLanes,c|=m,s.lanes=c,ur(a,c)}}var sd={readContext:$n,use:kh,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};sd.useEffectEvent=Gt;var a1={readContext:$n,use:kh,useCallback:function(a,s){return fr().memoizedState=[a,s===void 0?null:s],a},useContext:$n,useEffect:BC,useImperativeHandle:function(a,s,c){c=c!=null?c.concat([a]):null,Ih(4194308,4,HC.bind(null,s,a),c)},useLayoutEffect:function(a,s){return Ih(4194308,4,a,s)},useInsertionEffect:function(a,s){Ih(4,2,a,s)},useMemo:function(a,s){var c=fr();s=s===void 0?null:s;var m=a();if(Fs){Zn(!0);try{a()}finally{Zn(!1)}}return c.memoizedState=[m,s],m},useReducer:function(a,s,c){var m=fr();if(c!==void 0){var y=c(s);if(Fs){Zn(!0);try{c(s)}finally{Zn(!1)}}}else y=s;return m.memoizedState=m.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},m.queue=a,a=a.dispatch=PB.bind(null,Fe,a),[m.memoizedState,a]},useRef:function(a){var s=fr();return a={current:a},s.memoizedState=a},useState:function(a){a=Cg(a);var s=a.queue,c=t1.bind(null,Fe,s);return s.dispatch=c,[a.memoizedState,c]},useDebugValue:Tg,useDeferredValue:function(a,s){var c=fr();return Pg(c,a,s)},useTransition:function(){var a=Cg(!1);return a=VC.bind(null,Fe,a.queue,!0,!1),fr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,c){var m=Fe,y=fr();if(Ze){if(c===void 0)throw Error(r(407));c=c()}else{if(c=s(),wt===null)throw Error(r(349));(Ve&127)!==0||jC(m,s,c)}y.memoizedState=c;var w={value:c,getSnapshot:s};return y.queue=w,BC(OC.bind(null,m,w,a),[a]),m.flags|=2048,ac(9,{destroy:void 0},CC.bind(null,m,w,c,s),null),c},useId:function(){var a=fr(),s=wt.identifierPrefix;if(Ze){var c=Ja,m=Za;c=(m&~(1<<32-zt(m)-1)).toString(32)+c,s="_"+s+"R_"+c,c=Mh++,0<c&&(s+="H"+c.toString(32)),s+="_"}else c=EB++,s="_"+s+"r_"+c.toString(32)+"_";return a.memoizedState=s},useHostTransitionStatus:Dg,useFormState:LC,useActionState:LC,useOptimistic:function(a){var s=fr();s.memoizedState=s.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=c,s=Mg.bind(null,Fe,!0,c),c.dispatch=s,[a,s]},useMemoCache:Eg,useCacheRefresh:function(){return fr().memoizedState=TB.bind(null,Fe)},useEffectEvent:function(a){var s=fr(),c={impl:a};return s.memoizedState=c,function(){if((lt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},Rg={readContext:$n,use:kh,useCallback:YC,useContext:$n,useEffect:Ng,useImperativeHandle:GC,useInsertionEffect:$C,useLayoutEffect:KC,useMemo:WC,useReducer:Lh,useRef:qC,useState:function(){return Lh(Fi)},useDebugValue:Tg,useDeferredValue:function(a,s){var c=rn();return QC(c,pt.memoizedState,a,s)},useTransition:function(){var a=Lh(Fi)[0],s=rn().memoizedState;return[typeof a=="boolean"?a:id(a),s]},useSyncExternalStore:AC,useId:JC,useHostTransitionStatus:Dg,useFormState:IC,useActionState:IC,useOptimistic:function(a,s){var c=rn();return PC(c,pt,a,s)},useMemoCache:Eg,useCacheRefresh:e1};Rg.useEffectEvent=FC;var i1={readContext:$n,use:kh,useCallback:YC,useContext:$n,useEffect:Ng,useImperativeHandle:GC,useInsertionEffect:$C,useLayoutEffect:KC,useMemo:WC,useReducer:jg,useRef:qC,useState:function(){return jg(Fi)},useDebugValue:Tg,useDeferredValue:function(a,s){var c=rn();return pt===null?Pg(c,a,s):QC(c,pt.memoizedState,a,s)},useTransition:function(){var a=jg(Fi)[0],s=rn().memoizedState;return[typeof a=="boolean"?a:id(a),s]},useSyncExternalStore:AC,useId:JC,useHostTransitionStatus:Dg,useFormState:UC,useActionState:UC,useOptimistic:function(a,s){var c=rn();return pt!==null?PC(c,pt,a,s):(c.baseState=a,[a,c.queue.dispatch])},useMemoCache:Eg,useCacheRefresh:e1};i1.useEffectEvent=FC;function kg(a,s,c,m){s=a.memoizedState,c=c(m,s),c=c==null?s:b({},s,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}var Lg={enqueueSetState:function(a,s,c){a=a._reactInternals;var m=Qr(),y=ko(m);y.payload=s,c!=null&&(y.callback=c),s=Lo(a,y,m),s!==null&&(Pr(s,a,m),td(s,a,m))},enqueueReplaceState:function(a,s,c){a=a._reactInternals;var m=Qr(),y=ko(m);y.tag=1,y.payload=s,c!=null&&(y.callback=c),s=Lo(a,y,m),s!==null&&(Pr(s,a,m),td(s,a,m))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var c=Qr(),m=ko(c);m.tag=2,s!=null&&(m.callback=s),s=Lo(a,m,c),s!==null&&(Pr(s,a,c),td(s,a,c))}};function o1(a,s,c,m,y,w,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,w,N):s.prototype&&s.prototype.isPureReactComponent?!Yu(c,m)||!Yu(y,w):!0}function s1(a,s,c,m){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,m),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,m),s.state!==a&&Lg.enqueueReplaceState(s,s.state,null)}function $s(a,s){var c=s;if("ref"in s){c={};for(var m in s)m!=="ref"&&(c[m]=s[m])}if(a=a.defaultProps){c===s&&(c=b({},c));for(var y in a)c[y]===void 0&&(c[y]=a[y])}return c}function l1(a){vh(a)}function c1(a){console.error(a)}function u1(a){vh(a)}function qh(a,s){try{var c=a.onUncaughtError;c(s.value,{componentStack:s.stack})}catch(m){setTimeout(function(){throw m})}}function d1(a,s,c){try{var m=a.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Ig(a,s,c){return c=ko(c),c.tag=3,c.payload={element:null},c.callback=function(){qh(a,s)},c}function f1(a){return a=ko(a),a.tag=3,a}function h1(a,s,c,m){var y=c.type.getDerivedStateFromError;if(typeof y=="function"){var w=m.value;a.payload=function(){return y(w)},a.callback=function(){d1(s,c,m)}}var N=c.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(a.callback=function(){d1(s,c,m),typeof y!="function"&&(Fo===null?Fo=new Set([this]):Fo.add(this));var M=m.stack;this.componentDidCatch(m.value,{componentStack:M!==null?M:""})})}function _B(a,s,c,m,y){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(s=c.alternate,s!==null&&Vl(s,c,y,!0),c=Hr.current,c!==null){switch(c.tag){case 31:case 13:return da===null?Zh():c.alternate===null&&Yt===0&&(Yt=3),c.flags&=-257,c.flags|=65536,c.lanes=y,m===Oh?c.flags|=16384:(s=c.updateQueue,s===null?c.updateQueue=new Set([m]):s.add(m),ly(a,m,y)),!1;case 22:return c.flags|=65536,m===Oh?c.flags|=16384:(s=c.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([m])},c.updateQueue=s):(c=s.retryQueue,c===null?s.retryQueue=new Set([m]):c.add(m)),ly(a,m,y)),!1}throw Error(r(435,c.tag))}return ly(a,m,y),Zh(),!1}if(Ze)return s=Hr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=y,m!==ng&&(a=Error(r(422),{cause:m}),Vu(sa(a,c)))):(m!==ng&&(s=Error(r(423),{cause:m}),Vu(sa(s,c))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,m=sa(m,c),y=Ig(a.stateNode,m,y),hg(a,y),Yt!==4&&(Yt=2)),!1;var w=Error(r(520),{cause:m});if(w=sa(w,c),pd===null?pd=[w]:pd.push(w),Yt!==4&&(Yt=2),s===null)return!0;m=sa(m,c),c=s;do{switch(c.tag){case 3:return c.flags|=65536,a=y&-y,c.lanes|=a,a=Ig(c.stateNode,m,a),hg(c,a),!1;case 1:if(s=c.type,w=c.stateNode,(c.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Fo===null||!Fo.has(w))))return c.flags|=65536,y&=-y,c.lanes|=y,y=f1(y),h1(y,a,c,m),hg(c,y),!1}c=c.return}while(c!==null);return!1}var zg=Error(r(461)),dn=!1;function Kn(a,s,c,m){s.child=a===null?vC(s,null,c,m):Bs(s,a.child,c,m)}function m1(a,s,c,m,y){c=c.render;var w=s.ref;if("ref"in m){var N={};for(var M in m)M!=="ref"&&(N[M]=m[M])}else N=m;return Is(s),m=yg(a,s,c,N,w,y),M=xg(),a!==null&&!dn?(wg(a,s,y),$i(a,s,y)):(Ze&&M&&eg(s),s.flags|=1,Kn(a,s,m,y),s.child)}function p1(a,s,c,m,y){if(a===null){var w=c.type;return typeof w=="function"&&!Xv(w)&&w.defaultProps===void 0&&c.compare===null?(s.tag=15,s.type=w,b1(a,s,w,m,y)):(a=wh(c.type,null,m,s,s.mode,y),a.ref=s.ref,a.return=s,s.child=a)}if(w=a.child,!Gg(a,y)){var N=w.memoizedProps;if(c=c.compare,c=c!==null?c:Yu,c(N,m)&&a.ref===s.ref)return $i(a,s,y)}return s.flags|=1,a=Ii(w,m),a.ref=s.ref,a.return=s,s.child=a}function b1(a,s,c,m,y){if(a!==null){var w=a.memoizedProps;if(Yu(w,m)&&a.ref===s.ref)if(dn=!1,s.pendingProps=m=w,Gg(a,y))(a.flags&131072)!==0&&(dn=!0);else return s.lanes=a.lanes,$i(a,s,y)}return Ug(a,s,c,m,y)}function v1(a,s,c,m){var y=m.children,w=a!==null?a.memoizedState:null;if(a===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((s.flags&128)!==0){if(w=w!==null?w.baseLanes|c:c,a!==null){for(m=s.child=a.child,y=0;m!==null;)y=y|m.lanes|m.childLanes,m=m.sibling;m=y&~w}else m=0,s.child=null;return g1(a,s,w,c,m)}if((c&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&jh(s,w!==null?w.cachePool:null),w!==null?xC(s,w):pg(),wC(s);else return m=s.lanes=536870912,g1(a,s,w!==null?w.baseLanes|c:c,c,m)}else w!==null?(jh(s,w.cachePool),xC(s,w),zo(),s.memoizedState=null):(a!==null&&jh(s,null),pg(),zo());return Kn(a,s,y,c),s.child}function ld(a,s){return a!==null&&a.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function g1(a,s,c,m,y){var w=cg();return w=w===null?null:{parent:cn._currentValue,pool:w},s.memoizedState={baseLanes:c,cachePool:w},a!==null&&jh(s,null),pg(),wC(s),a!==null&&Vl(a,s,m,!0),s.childLanes=y,null}function Bh(a,s){return s=$h({mode:s.mode,children:s.children},a.mode),s.ref=a.ref,a.child=s,s.return=a,s}function y1(a,s,c){return Bs(s,a.child,null,c),a=Bh(s,s.pendingProps),a.flags|=2,Gr(s),s.memoizedState=null,a}function DB(a,s,c){var m=s.pendingProps,y=(s.flags&128)!==0;if(s.flags&=-129,a===null){if(Ze){if(m.mode==="hidden")return a=Bh(s,m),s.lanes=536870912,ld(null,a);if(vg(s),(a=Tt)?(a=_O(a,ua),a=a!==null&&a.data==="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Po!==null?{id:Za,overflow:Ja}:null,retryLane:536870912,hydrationErrors:null},c=nC(a),c.return=s,s.child=c,Fn=s,Tt=null)):a=null,a===null)throw Do(s);return s.lanes=536870912,null}return Bh(s,m)}var w=a.memoizedState;if(w!==null){var N=w.dehydrated;if(vg(s),y)if(s.flags&256)s.flags&=-257,s=y1(a,s,c);else if(s.memoizedState!==null)s.child=a.child,s.flags|=128,s=null;else throw Error(r(558));else if(dn||Vl(a,s,c,!1),y=(c&a.childLanes)!==0,dn||y){if(m=wt,m!==null&&(N=Nn(m,c),N!==0&&N!==w.retryLane))throw w.retryLane=N,Ms(a,N),Pr(m,a,N),zg;Zh(),s=y1(a,s,c)}else a=w.treeContext,Tt=fa(N.nextSibling),Fn=s,Ze=!0,_o=null,ua=!1,a!==null&&iC(s,a),s=Bh(s,m),s.flags|=4096;return s}return a=Ii(a.child,{mode:m.mode,children:m.children}),a.ref=s.ref,s.child=a,a.return=s,a}function Fh(a,s){var c=s.ref;if(c===null)a!==null&&a.ref!==null&&(s.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(a===null||a.ref!==c)&&(s.flags|=4194816)}}function Ug(a,s,c,m,y){return Is(s),c=yg(a,s,c,m,void 0,y),m=xg(),a!==null&&!dn?(wg(a,s,y),$i(a,s,y)):(Ze&&m&&eg(s),s.flags|=1,Kn(a,s,c,y),s.child)}function x1(a,s,c,m,y,w){return Is(s),s.updateQueue=null,c=EC(s,m,c,y),SC(a),m=xg(),a!==null&&!dn?(wg(a,s,w),$i(a,s,w)):(Ze&&m&&eg(s),s.flags|=1,Kn(a,s,c,w),s.child)}function w1(a,s,c,m,y){if(Is(s),s.stateNode===null){var w=Gl,N=c.contextType;typeof N=="object"&&N!==null&&(w=$n(N)),w=new c(m,w),s.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Lg,s.stateNode=w,w._reactInternals=s,w=s.stateNode,w.props=m,w.state=s.memoizedState,w.refs={},dg(s),N=c.contextType,w.context=typeof N=="object"&&N!==null?$n(N):Gl,w.state=s.memoizedState,N=c.getDerivedStateFromProps,typeof N=="function"&&(kg(s,c,N,m),w.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(N=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),N!==w.state&&Lg.enqueueReplaceState(w,w.state,null),rd(s,m,w,y),nd(),w.state=s.memoizedState),typeof w.componentDidMount=="function"&&(s.flags|=4194308),m=!0}else if(a===null){w=s.stateNode;var M=s.memoizedProps,B=$s(c,M);w.props=B;var X=w.context,ae=c.contextType;N=Gl,typeof ae=="object"&&ae!==null&&(N=$n(ae));var se=c.getDerivedStateFromProps;ae=typeof se=="function"||typeof w.getSnapshotBeforeUpdate=="function",M=s.pendingProps!==M,ae||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(M||X!==N)&&s1(s,w,m,N),Ro=!1;var J=s.memoizedState;w.state=J,rd(s,m,w,y),nd(),X=s.memoizedState,M||J!==X||Ro?(typeof se=="function"&&(kg(s,c,se,m),X=s.memoizedState),(B=Ro||o1(s,c,B,m,J,X,N))?(ae||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(s.flags|=4194308)):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=m,s.memoizedState=X),w.props=m,w.state=X,w.context=N,m=B):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),m=!1)}else{w=s.stateNode,fg(a,s),N=s.memoizedProps,ae=$s(c,N),w.props=ae,se=s.pendingProps,J=w.context,X=c.contextType,B=Gl,typeof X=="object"&&X!==null&&(B=$n(X)),M=c.getDerivedStateFromProps,(X=typeof M=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N!==se||J!==B)&&s1(s,w,m,B),Ro=!1,J=s.memoizedState,w.state=J,rd(s,m,w,y),nd();var te=s.memoizedState;N!==se||J!==te||Ro||a!==null&&a.dependencies!==null&&Eh(a.dependencies)?(typeof M=="function"&&(kg(s,c,M,m),te=s.memoizedState),(ae=Ro||o1(s,c,ae,m,J,te,B)||a!==null&&a.dependencies!==null&&Eh(a.dependencies))?(X||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(m,te,B),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(m,te,B)),typeof w.componentDidUpdate=="function"&&(s.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof w.componentDidUpdate!="function"||N===a.memoizedProps&&J===a.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&J===a.memoizedState||(s.flags|=1024),s.memoizedProps=m,s.memoizedState=te),w.props=m,w.state=te,w.context=B,m=ae):(typeof w.componentDidUpdate!="function"||N===a.memoizedProps&&J===a.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&J===a.memoizedState||(s.flags|=1024),m=!1)}return w=m,Fh(a,s),m=(s.flags&128)!==0,w||m?(w=s.stateNode,c=m&&typeof c.getDerivedStateFromError!="function"?null:w.render(),s.flags|=1,a!==null&&m?(s.child=Bs(s,a.child,null,y),s.child=Bs(s,null,c,y)):Kn(a,s,c,y),s.memoizedState=w.state,a=s.child):a=$i(a,s,y),a}function S1(a,s,c,m){return ks(),s.flags|=256,Kn(a,s,c,m),s.child}var qg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bg(a){return{baseLanes:a,cachePool:dC()}}function Fg(a,s,c){return a=a!==null?a.childLanes&~c:0,s&&(a|=Wr),a}function E1(a,s,c){var m=s.pendingProps,y=!1,w=(s.flags&128)!==0,N;if((N=w)||(N=a!==null&&a.memoizedState===null?!1:(nn.current&2)!==0),N&&(y=!0,s.flags&=-129),N=(s.flags&32)!==0,s.flags&=-33,a===null){if(Ze){if(y?Io(s):zo(),(a=Tt)?(a=_O(a,ua),a=a!==null&&a.data!=="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Po!==null?{id:Za,overflow:Ja}:null,retryLane:536870912,hydrationErrors:null},c=nC(a),c.return=s,s.child=c,Fn=s,Tt=null)):a=null,a===null)throw Do(s);return Ay(a)?s.lanes=32:s.lanes=536870912,null}var M=m.children;return m=m.fallback,y?(zo(),y=s.mode,M=$h({mode:"hidden",children:M},y),m=Rs(m,y,c,null),M.return=s,m.return=s,M.sibling=m,s.child=M,m=s.child,m.memoizedState=Bg(c),m.childLanes=Fg(a,N,c),s.memoizedState=qg,ld(null,m)):(Io(s),$g(s,M))}var B=a.memoizedState;if(B!==null&&(M=B.dehydrated,M!==null)){if(w)s.flags&256?(Io(s),s.flags&=-257,s=Kg(a,s,c)):s.memoizedState!==null?(zo(),s.child=a.child,s.flags|=128,s=null):(zo(),M=m.fallback,y=s.mode,m=$h({mode:"visible",children:m.children},y),M=Rs(M,y,c,null),M.flags|=2,m.return=s,M.return=s,m.sibling=M,s.child=m,Bs(s,a.child,null,c),m=s.child,m.memoizedState=Bg(c),m.childLanes=Fg(a,N,c),s.memoizedState=qg,s=ld(null,m));else if(Io(s),Ay(M)){if(N=M.nextSibling&&M.nextSibling.dataset,N)var X=N.dgst;N=X,m=Error(r(419)),m.stack="",m.digest=N,Vu({value:m,source:null,stack:null}),s=Kg(a,s,c)}else if(dn||Vl(a,s,c,!1),N=(c&a.childLanes)!==0,dn||N){if(N=wt,N!==null&&(m=Nn(N,c),m!==0&&m!==B.retryLane))throw B.retryLane=m,Ms(a,m),Pr(N,a,m),zg;Ey(M)||Zh(),s=Kg(a,s,c)}else Ey(M)?(s.flags|=192,s.child=a.child,s=null):(a=B.treeContext,Tt=fa(M.nextSibling),Fn=s,Ze=!0,_o=null,ua=!1,a!==null&&iC(s,a),s=$g(s,m.children),s.flags|=4096);return s}return y?(zo(),M=m.fallback,y=s.mode,B=a.child,X=B.sibling,m=Ii(B,{mode:"hidden",children:m.children}),m.subtreeFlags=B.subtreeFlags&65011712,X!==null?M=Ii(X,M):(M=Rs(M,y,c,null),M.flags|=2),M.return=s,m.return=s,m.sibling=M,s.child=m,ld(null,m),m=s.child,M=a.child.memoizedState,M===null?M=Bg(c):(y=M.cachePool,y!==null?(B=cn._currentValue,y=y.parent!==B?{parent:B,pool:B}:y):y=dC(),M={baseLanes:M.baseLanes|c,cachePool:y}),m.memoizedState=M,m.childLanes=Fg(a,N,c),s.memoizedState=qg,ld(a.child,m)):(Io(s),c=a.child,a=c.sibling,c=Ii(c,{mode:"visible",children:m.children}),c.return=s,c.sibling=null,a!==null&&(N=s.deletions,N===null?(s.deletions=[a],s.flags|=16):N.push(a)),s.child=c,s.memoizedState=null,c)}function $g(a,s){return s=$h({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function $h(a,s){return a=Kr(22,a,null,s),a.lanes=0,a}function Kg(a,s,c){return Bs(s,a.child,null,c),a=$g(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function A1(a,s,c){a.lanes|=s;var m=a.alternate;m!==null&&(m.lanes|=s),ig(a.return,s,c)}function Hg(a,s,c,m,y,w){var N=a.memoizedState;N===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:y,treeForkCount:w}:(N.isBackwards=s,N.rendering=null,N.renderingStartTime=0,N.last=m,N.tail=c,N.tailMode=y,N.treeForkCount=w)}function j1(a,s,c){var m=s.pendingProps,y=m.revealOrder,w=m.tail;m=m.children;var N=nn.current,M=(N&2)!==0;if(M?(N=N&1|2,s.flags|=128):N&=1,ce(nn,N),Kn(a,s,m,c),m=Ze?Qu:0,!M&&a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&A1(a,c,s);else if(a.tag===19)A1(a,c,s);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(y){case"forwards":for(c=s.child,y=null;c!==null;)a=c.alternate,a!==null&&_h(a)===null&&(y=c),c=c.sibling;c=y,c===null?(y=s.child,s.child=null):(y=c.sibling,c.sibling=null),Hg(s,!1,y,c,w,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,y=s.child,s.child=null;y!==null;){if(a=y.alternate,a!==null&&_h(a)===null){s.child=y;break}a=y.sibling,y.sibling=c,c=y,y=a}Hg(s,!0,c,null,w,m);break;case"together":Hg(s,!1,null,null,void 0,m);break;default:s.memoizedState=null}return s.child}function $i(a,s,c){if(a!==null&&(s.dependencies=a.dependencies),Bo|=s.lanes,(c&s.childLanes)===0)if(a!==null){if(Vl(a,s,c,!1),(c&s.childLanes)===0)return null}else return null;if(a!==null&&s.child!==a.child)throw Error(r(153));if(s.child!==null){for(a=s.child,c=Ii(a,a.pendingProps),s.child=c,c.return=s;a.sibling!==null;)a=a.sibling,c=c.sibling=Ii(a,a.pendingProps),c.return=s;c.sibling=null}return s.child}function Gg(a,s){return(a.lanes&s)!==0?!0:(a=a.dependencies,!!(a!==null&&Eh(a)))}function MB(a,s,c){switch(s.tag){case 3:Be(s,s.stateNode.containerInfo),Mo(s,cn,a.memoizedState.cache),ks();break;case 27:case 5:ue(s);break;case 4:Be(s,s.stateNode.containerInfo);break;case 10:Mo(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,vg(s),null;break;case 13:var m=s.memoizedState;if(m!==null)return m.dehydrated!==null?(Io(s),s.flags|=128,null):(c&s.child.childLanes)!==0?E1(a,s,c):(Io(s),a=$i(a,s,c),a!==null?a.sibling:null);Io(s);break;case 19:var y=(a.flags&128)!==0;if(m=(c&s.childLanes)!==0,m||(Vl(a,s,c,!1),m=(c&s.childLanes)!==0),y){if(m)return j1(a,s,c);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),ce(nn,nn.current),m)break;return null;case 22:return s.lanes=0,v1(a,s,c,s.pendingProps);case 24:Mo(s,cn,a.memoizedState.cache)}return $i(a,s,c)}function C1(a,s,c){if(a!==null)if(a.memoizedProps!==s.pendingProps)dn=!0;else{if(!Gg(a,c)&&(s.flags&128)===0)return dn=!1,MB(a,s,c);dn=(a.flags&131072)!==0}else dn=!1,Ze&&(s.flags&1048576)!==0&&aC(s,Qu,s.index);switch(s.lanes=0,s.tag){case 16:e:{var m=s.pendingProps;if(a=Us(s.elementType),s.type=a,typeof a=="function")Xv(a)?(m=$s(a,m),s.tag=1,s=w1(null,s,a,m,c)):(s.tag=0,s=Ug(null,s,a,m,c));else{if(a!=null){var y=a.$$typeof;if(y===T){s.tag=11,s=m1(null,s,a,m,c);break e}else if(y===D){s.tag=14,s=p1(null,s,a,m,c);break e}}throw s=G(a)||a,Error(r(306,s,""))}}return s;case 0:return Ug(a,s,s.type,s.pendingProps,c);case 1:return m=s.type,y=$s(m,s.pendingProps),w1(a,s,m,y,c);case 3:e:{if(Be(s,s.stateNode.containerInfo),a===null)throw Error(r(387));m=s.pendingProps;var w=s.memoizedState;y=w.element,fg(a,s),rd(s,m,null,c);var N=s.memoizedState;if(m=N.cache,Mo(s,cn,m),m!==w.cache&&og(s,[cn],c,!0),nd(),m=N.element,w.isDehydrated)if(w={element:m,isDehydrated:!1,cache:N.cache},s.updateQueue.baseState=w,s.memoizedState=w,s.flags&256){s=S1(a,s,m,c);break e}else if(m!==y){y=sa(Error(r(424)),s),Vu(y),s=S1(a,s,m,c);break e}else{switch(a=s.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Tt=fa(a.firstChild),Fn=s,Ze=!0,_o=null,ua=!0,c=vC(s,null,m,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(ks(),m===y){s=$i(a,s,c);break e}Kn(a,s,m,c)}s=s.child}return s;case 26:return Fh(a,s),a===null?(c=IO(s.type,null,s.pendingProps,null))?s.memoizedState=c:Ze||(c=s.type,a=s.pendingProps,m=im(Oe.current).createElement(c),m[ln]=s,m[Tn]=a,Hn(m,c,a),Bt(m),s.stateNode=m):s.memoizedState=IO(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return ue(s),a===null&&Ze&&(m=s.stateNode=RO(s.type,s.pendingProps,Oe.current),Fn=s,ua=!0,y=Tt,Go(s.type)?(jy=y,Tt=fa(m.firstChild)):Tt=y),Kn(a,s,s.pendingProps.children,c),Fh(a,s),a===null&&(s.flags|=4194304),s.child;case 5:return a===null&&Ze&&((y=m=Tt)&&(m=cF(m,s.type,s.pendingProps,ua),m!==null?(s.stateNode=m,Fn=s,Tt=fa(m.firstChild),ua=!1,y=!0):y=!1),y||Do(s)),ue(s),y=s.type,w=s.pendingProps,N=a!==null?a.memoizedProps:null,m=w.children,xy(y,w)?m=null:N!==null&&xy(y,N)&&(s.flags|=32),s.memoizedState!==null&&(y=yg(a,s,AB,null,null,c),Ed._currentValue=y),Fh(a,s),Kn(a,s,m,c),s.child;case 6:return a===null&&Ze&&((a=c=Tt)&&(c=uF(c,s.pendingProps,ua),c!==null?(s.stateNode=c,Fn=s,Tt=null,a=!0):a=!1),a||Do(s)),null;case 13:return E1(a,s,c);case 4:return Be(s,s.stateNode.containerInfo),m=s.pendingProps,a===null?s.child=Bs(s,null,m,c):Kn(a,s,m,c),s.child;case 11:return m1(a,s,s.type,s.pendingProps,c);case 7:return Kn(a,s,s.pendingProps,c),s.child;case 8:return Kn(a,s,s.pendingProps.children,c),s.child;case 12:return Kn(a,s,s.pendingProps.children,c),s.child;case 10:return m=s.pendingProps,Mo(s,s.type,m.value),Kn(a,s,m.children,c),s.child;case 9:return y=s.type._context,m=s.pendingProps.children,Is(s),y=$n(y),m=m(y),s.flags|=1,Kn(a,s,m,c),s.child;case 14:return p1(a,s,s.type,s.pendingProps,c);case 15:return b1(a,s,s.type,s.pendingProps,c);case 19:return j1(a,s,c);case 31:return DB(a,s,c);case 22:return v1(a,s,c,s.pendingProps);case 24:return Is(s),m=$n(cn),a===null?(y=cg(),y===null&&(y=wt,w=sg(),y.pooledCache=w,w.refCount++,w!==null&&(y.pooledCacheLanes|=c),y=w),s.memoizedState={parent:m,cache:y},dg(s),Mo(s,cn,y)):((a.lanes&c)!==0&&(fg(a,s),rd(s,null,null,c),nd()),y=a.memoizedState,w=s.memoizedState,y.parent!==m?(y={parent:m,cache:m},s.memoizedState=y,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=y),Mo(s,cn,m)):(m=w.cache,Mo(s,cn,m),m!==y.cache&&og(s,[cn],c,!0))),Kn(a,s,s.pendingProps.children,c),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ki(a){a.flags|=4}function Yg(a,s,c,m,y){if((s=(a.mode&32)!==0)&&(s=!1),s){if(a.flags|=16777216,(y&335544128)===y)if(a.stateNode.complete)a.flags|=8192;else if(J1())a.flags|=8192;else throw qs=Oh,ug}else a.flags&=-16777217}function O1(a,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!FO(s))if(J1())a.flags|=8192;else throw qs=Oh,ug}function Kh(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?sn():536870912,a.lanes|=s,lc|=s)}function cd(a,s){if(!Ze)switch(a.tailMode){case"hidden":s=a.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function Pt(a){var s=a.alternate!==null&&a.alternate.child===a.child,c=0,m=0;if(s)for(var y=a.child;y!==null;)c|=y.lanes|y.childLanes,m|=y.subtreeFlags&65011712,m|=y.flags&65011712,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)c|=y.lanes|y.childLanes,m|=y.subtreeFlags,m|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=m,a.childLanes=c,s}function RB(a,s,c){var m=s.pendingProps;switch(tg(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(s),null;case 1:return Pt(s),null;case 3:return c=s.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),s.memoizedState.cache!==m&&(s.flags|=2048),qi(cn),he(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&(Ql(s)?Ki(s):a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,rg())),Pt(s),null;case 26:var y=s.type,w=s.memoizedState;return a===null?(Ki(s),w!==null?(Pt(s),O1(s,w)):(Pt(s),Yg(s,y,null,m,c))):w?w!==a.memoizedState?(Ki(s),Pt(s),O1(s,w)):(Pt(s),s.flags&=-16777217):(a=a.memoizedProps,a!==m&&Ki(s),Pt(s),Yg(s,y,a,m,c)),null;case 27:if(Ee(s),c=Oe.current,y=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==m&&Ki(s);else{if(!m){if(s.stateNode===null)throw Error(r(166));return Pt(s),null}a=fe.current,Ql(s)?oC(s):(a=RO(y,m,c),s.stateNode=a,Ki(s))}return Pt(s),null;case 5:if(Ee(s),y=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==m&&Ki(s);else{if(!m){if(s.stateNode===null)throw Error(r(166));return Pt(s),null}if(w=fe.current,Ql(s))oC(s);else{var N=im(Oe.current);switch(w){case 1:w=N.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:w=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":w=N.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":w=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":w=N.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof m.is=="string"?N.createElement("select",{is:m.is}):N.createElement("select"),m.multiple?w.multiple=!0:m.size&&(w.size=m.size);break;default:w=typeof m.is=="string"?N.createElement(y,{is:m.is}):N.createElement(y)}}w[ln]=s,w[Tn]=m;e:for(N=s.child;N!==null;){if(N.tag===5||N.tag===6)w.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===s)break e;for(;N.sibling===null;){if(N.return===null||N.return===s)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}s.stateNode=w;e:switch(Hn(w,y,m),y){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Ki(s)}}return Pt(s),Yg(s,s.type,a===null?null:a.memoizedProps,s.pendingProps,c),null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==m&&Ki(s);else{if(typeof m!="string"&&s.stateNode===null)throw Error(r(166));if(a=Oe.current,Ql(s)){if(a=s.stateNode,c=s.memoizedProps,m=null,y=Fn,y!==null)switch(y.tag){case 27:case 5:m=y.memoizedProps}a[ln]=s,a=!!(a.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||EO(a.nodeValue,c)),a||Do(s,!0)}else a=im(a).createTextNode(m),a[ln]=s,s.stateNode=a}return Pt(s),null;case 31:if(c=s.memoizedState,a===null||a.memoizedState!==null){if(m=Ql(s),c!==null){if(a===null){if(!m)throw Error(r(318));if(a=s.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[ln]=s}else ks(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Pt(s),a=!1}else c=rg(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=c),a=!0;if(!a)return s.flags&256?(Gr(s),s):(Gr(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Pt(s),null;case 13:if(m=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=Ql(s),m!==null&&m.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[ln]=s}else ks(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Pt(s),y=!1}else y=rg(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return s.flags&256?(Gr(s),s):(Gr(s),null)}return Gr(s),(s.flags&128)!==0?(s.lanes=c,s):(c=m!==null,a=a!==null&&a.memoizedState!==null,c&&(m=s.child,y=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(y=m.alternate.memoizedState.cachePool.pool),w=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(w=m.memoizedState.cachePool.pool),w!==y&&(m.flags|=2048)),c!==a&&c&&(s.child.flags|=8192),Kh(s,s.updateQueue),Pt(s),null);case 4:return he(),a===null&&py(s.stateNode.containerInfo),Pt(s),null;case 10:return qi(s.type),Pt(s),null;case 19:if(Q(nn),m=s.memoizedState,m===null)return Pt(s),null;if(y=(s.flags&128)!==0,w=m.rendering,w===null)if(y)cd(m,!1);else{if(Yt!==0||a!==null&&(a.flags&128)!==0)for(a=s.child;a!==null;){if(w=_h(a),w!==null){for(s.flags|=128,cd(m,!1),a=w.updateQueue,s.updateQueue=a,Kh(s,a),s.subtreeFlags=0,a=c,c=s.child;c!==null;)tC(c,a),c=c.sibling;return ce(nn,nn.current&1|2),Ze&&zi(s,m.treeForkCount),s.child}a=a.sibling}m.tail!==null&&Kt()>Qh&&(s.flags|=128,y=!0,cd(m,!1),s.lanes=4194304)}else{if(!y)if(a=_h(w),a!==null){if(s.flags|=128,y=!0,a=a.updateQueue,s.updateQueue=a,Kh(s,a),cd(m,!0),m.tail===null&&m.tailMode==="hidden"&&!w.alternate&&!Ze)return Pt(s),null}else 2*Kt()-m.renderingStartTime>Qh&&c!==536870912&&(s.flags|=128,y=!0,cd(m,!1),s.lanes=4194304);m.isBackwards?(w.sibling=s.child,s.child=w):(a=m.last,a!==null?a.sibling=w:s.child=w,m.last=w)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=Kt(),a.sibling=null,c=nn.current,ce(nn,y?c&1|2:c&1),Ze&&zi(s,m.treeForkCount),a):(Pt(s),null);case 22:case 23:return Gr(s),bg(),m=s.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(s.flags|=8192):m&&(s.flags|=8192),m?(c&536870912)!==0&&(s.flags&128)===0&&(Pt(s),s.subtreeFlags&6&&(s.flags|=8192)):Pt(s),c=s.updateQueue,c!==null&&Kh(s,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),m=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==c&&(s.flags|=2048),a!==null&&Q(zs),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),qi(cn),Pt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function kB(a,s){switch(tg(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return qi(cn),he(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return Ee(s),null;case 31:if(s.memoizedState!==null){if(Gr(s),s.alternate===null)throw Error(r(340));ks()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 13:if(Gr(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));ks()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return Q(nn),null;case 4:return he(),null;case 10:return qi(s.type),null;case 22:case 23:return Gr(s),bg(),a!==null&&Q(zs),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return qi(cn),null;case 25:return null;default:return null}}function N1(a,s){switch(tg(s),s.tag){case 3:qi(cn),he();break;case 26:case 27:case 5:Ee(s);break;case 4:he();break;case 31:s.memoizedState!==null&&Gr(s);break;case 13:Gr(s);break;case 19:Q(nn);break;case 10:qi(s.type);break;case 22:case 23:Gr(s),bg(),a!==null&&Q(zs);break;case 24:qi(cn)}}function ud(a,s){try{var c=s.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var y=m.next;c=y;do{if((c.tag&a)===a){m=void 0;var w=c.create,N=c.inst;m=w(),N.destroy=m}c=c.next}while(c!==y)}}catch(M){mt(s,s.return,M)}}function Uo(a,s,c){try{var m=s.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var w=y.next;m=w;do{if((m.tag&a)===a){var N=m.inst,M=N.destroy;if(M!==void 0){N.destroy=void 0,y=s;var B=c,X=M;try{X()}catch(ae){mt(y,B,ae)}}}m=m.next}while(m!==w)}}catch(ae){mt(s,s.return,ae)}}function T1(a){var s=a.updateQueue;if(s!==null){var c=a.stateNode;try{yC(s,c)}catch(m){mt(a,a.return,m)}}}function P1(a,s,c){c.props=$s(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(m){mt(a,s,m)}}function dd(a,s){try{var c=a.ref;if(c!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof c=="function"?a.refCleanup=c(m):c.current=m}}catch(y){mt(a,s,y)}}function ei(a,s){var c=a.ref,m=a.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(y){mt(a,s,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(y){mt(a,s,y)}else c.current=null}function _1(a){var s=a.type,c=a.memoizedProps,m=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":c.autoFocus&&m.focus();break e;case"img":c.src?m.src=c.src:c.srcSet&&(m.srcset=c.srcSet)}}catch(y){mt(a,a.return,y)}}function Wg(a,s,c){try{var m=a.stateNode;rF(m,a.type,c,s),m[Tn]=s}catch(y){mt(a,a.return,y)}}function D1(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Go(a.type)||a.tag===4}function Qg(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||D1(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Go(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Vg(a,s,c){var m=a.tag;if(m===5||m===6)a=a.stateNode,s?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(a,s):(s=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,s.appendChild(a),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=ki));else if(m!==4&&(m===27&&Go(a.type)&&(c=a.stateNode,s=null),a=a.child,a!==null))for(Vg(a,s,c),a=a.sibling;a!==null;)Vg(a,s,c),a=a.sibling}function Hh(a,s,c){var m=a.tag;if(m===5||m===6)a=a.stateNode,s?c.insertBefore(a,s):c.appendChild(a);else if(m!==4&&(m===27&&Go(a.type)&&(c=a.stateNode),a=a.child,a!==null))for(Hh(a,s,c),a=a.sibling;a!==null;)Hh(a,s,c),a=a.sibling}function M1(a){var s=a.stateNode,c=a.memoizedProps;try{for(var m=a.type,y=s.attributes;y.length;)s.removeAttributeNode(y[0]);Hn(s,m,c),s[ln]=a,s[Tn]=c}catch(w){mt(a,a.return,w)}}var Hi=!1,fn=!1,Xg=!1,R1=typeof WeakSet=="function"?WeakSet:Set,Pn=null;function LB(a,s){if(a=a.containerInfo,gy=fm,a=Gj(a),Kv(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else e:{c=(c=a.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var y=m.anchorOffset,w=m.focusNode;m=m.focusOffset;try{c.nodeType,w.nodeType}catch{c=null;break e}var N=0,M=-1,B=-1,X=0,ae=0,se=a,J=null;t:for(;;){for(var te;se!==c||y!==0&&se.nodeType!==3||(M=N+y),se!==w||m!==0&&se.nodeType!==3||(B=N+m),se.nodeType===3&&(N+=se.nodeValue.length),(te=se.firstChild)!==null;)J=se,se=te;for(;;){if(se===a)break t;if(J===c&&++X===y&&(M=N),J===w&&++ae===m&&(B=N),(te=se.nextSibling)!==null)break;se=J,J=se.parentNode}se=te}c=M===-1||B===-1?null:{start:M,end:B}}else c=null}c=c||{start:0,end:0}}else c=null;for(yy={focusedElem:a,selectionRange:c},fm=!1,Pn=s;Pn!==null;)if(s=Pn,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,Pn=a;else for(;Pn!==null;){switch(s=Pn,w=s.alternate,a=s.flags,s.tag){case 0:if((a&4)!==0&&(a=s.updateQueue,a=a!==null?a.events:null,a!==null))for(c=0;c<a.length;c++)y=a[c],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&w!==null){a=void 0,c=s,y=w.memoizedProps,w=w.memoizedState,m=c.stateNode;try{var Ae=$s(c.type,y);a=m.getSnapshotBeforeUpdate(Ae,w),m.__reactInternalSnapshotBeforeUpdate=a}catch(De){mt(c,c.return,De)}}break;case 3:if((a&1024)!==0){if(a=s.stateNode.containerInfo,c=a.nodeType,c===9)Sy(a);else if(c===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Sy(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=s.sibling,a!==null){a.return=s.return,Pn=a;break}Pn=s.return}}function k1(a,s,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:Yi(a,c),m&4&&ud(5,c);break;case 1:if(Yi(a,c),m&4)if(a=c.stateNode,s===null)try{a.componentDidMount()}catch(N){mt(c,c.return,N)}else{var y=$s(c.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(y,s,a.__reactInternalSnapshotBeforeUpdate)}catch(N){mt(c,c.return,N)}}m&64&&T1(c),m&512&&dd(c,c.return);break;case 3:if(Yi(a,c),m&64&&(a=c.updateQueue,a!==null)){if(s=null,c.child!==null)switch(c.child.tag){case 27:case 5:s=c.child.stateNode;break;case 1:s=c.child.stateNode}try{yC(a,s)}catch(N){mt(c,c.return,N)}}break;case 27:s===null&&m&4&&M1(c);case 26:case 5:Yi(a,c),s===null&&m&4&&_1(c),m&512&&dd(c,c.return);break;case 12:Yi(a,c);break;case 31:Yi(a,c),m&4&&z1(a,c);break;case 13:Yi(a,c),m&4&&U1(a,c),m&64&&(a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(c=HB.bind(null,c),dF(a,c))));break;case 22:if(m=c.memoizedState!==null||Hi,!m){s=s!==null&&s.memoizedState!==null||fn,y=Hi;var w=fn;Hi=m,(fn=s)&&!w?Wi(a,c,(c.subtreeFlags&8772)!==0):Yi(a,c),Hi=y,fn=w}break;case 30:break;default:Yi(a,c)}}function L1(a){var s=a.alternate;s!==null&&(a.alternate=null,L1(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&Iu(s)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var kt=null,Cr=!1;function Gi(a,s,c){for(c=c.child;c!==null;)I1(a,s,c),c=c.sibling}function I1(a,s,c){if(bn&&typeof bn.onCommitFiberUnmount=="function")try{bn.onCommitFiberUnmount(Qa,c)}catch{}switch(c.tag){case 26:fn||ei(c,s),Gi(a,s,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:fn||ei(c,s);var m=kt,y=Cr;Go(c.type)&&(kt=c.stateNode,Cr=!1),Gi(a,s,c),xd(c.stateNode),kt=m,Cr=y;break;case 5:fn||ei(c,s);case 6:if(m=kt,y=Cr,kt=null,Gi(a,s,c),kt=m,Cr=y,kt!==null)if(Cr)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(c.stateNode)}catch(w){mt(c,s,w)}else try{kt.removeChild(c.stateNode)}catch(w){mt(c,s,w)}break;case 18:kt!==null&&(Cr?(a=kt,TO(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,c.stateNode),bc(a)):TO(kt,c.stateNode));break;case 4:m=kt,y=Cr,kt=c.stateNode.containerInfo,Cr=!0,Gi(a,s,c),kt=m,Cr=y;break;case 0:case 11:case 14:case 15:Uo(2,c,s),fn||Uo(4,c,s),Gi(a,s,c);break;case 1:fn||(ei(c,s),m=c.stateNode,typeof m.componentWillUnmount=="function"&&P1(c,s,m)),Gi(a,s,c);break;case 21:Gi(a,s,c);break;case 22:fn=(m=fn)||c.memoizedState!==null,Gi(a,s,c),fn=m;break;default:Gi(a,s,c)}}function z1(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{bc(a)}catch(c){mt(s,s.return,c)}}}function U1(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{bc(a)}catch(c){mt(s,s.return,c)}}function IB(a){switch(a.tag){case 31:case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new R1),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new R1),s;default:throw Error(r(435,a.tag))}}function Gh(a,s){var c=IB(a);s.forEach(function(m){if(!c.has(m)){c.add(m);var y=GB.bind(null,a,m);m.then(y,y)}})}function Or(a,s){var c=s.deletions;if(c!==null)for(var m=0;m<c.length;m++){var y=c[m],w=a,N=s,M=N;e:for(;M!==null;){switch(M.tag){case 27:if(Go(M.type)){kt=M.stateNode,Cr=!1;break e}break;case 5:kt=M.stateNode,Cr=!1;break e;case 3:case 4:kt=M.stateNode.containerInfo,Cr=!0;break e}M=M.return}if(kt===null)throw Error(r(160));I1(w,N,y),kt=null,Cr=!1,w=y.alternate,w!==null&&(w.return=null),y.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)q1(s,a),s=s.sibling}var _a=null;function q1(a,s){var c=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Or(s,a),Nr(a),m&4&&(Uo(3,a,a.return),ud(3,a),Uo(5,a,a.return));break;case 1:Or(s,a),Nr(a),m&512&&(fn||c===null||ei(c,c.return)),m&64&&Hi&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=c===null?m:c.concat(m))));break;case 26:var y=_a;if(Or(s,a),Nr(a),m&512&&(fn||c===null||ei(c,c.return)),m&4){var w=c!==null?c.memoizedState:null;if(m=a.memoizedState,c===null)if(m===null)if(a.stateNode===null){e:{m=a.type,c=a.memoizedProps,y=y.ownerDocument||y;t:switch(m){case"title":w=y.getElementsByTagName("title")[0],(!w||w[Fr]||w[ln]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=y.createElement(m),y.head.insertBefore(w,y.querySelector("head > title"))),Hn(w,m,c),w[ln]=a,Bt(w),m=w;break e;case"link":var N=qO("link","href",y).get(m+(c.href||""));if(N){for(var M=0;M<N.length;M++)if(w=N[M],w.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&w.getAttribute("rel")===(c.rel==null?null:c.rel)&&w.getAttribute("title")===(c.title==null?null:c.title)&&w.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){N.splice(M,1);break t}}w=y.createElement(m),Hn(w,m,c),y.head.appendChild(w);break;case"meta":if(N=qO("meta","content",y).get(m+(c.content||""))){for(M=0;M<N.length;M++)if(w=N[M],w.getAttribute("content")===(c.content==null?null:""+c.content)&&w.getAttribute("name")===(c.name==null?null:c.name)&&w.getAttribute("property")===(c.property==null?null:c.property)&&w.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&w.getAttribute("charset")===(c.charSet==null?null:c.charSet)){N.splice(M,1);break t}}w=y.createElement(m),Hn(w,m,c),y.head.appendChild(w);break;default:throw Error(r(468,m))}w[ln]=a,Bt(w),m=w}a.stateNode=m}else BO(y,a.type,a.stateNode);else a.stateNode=UO(y,m,a.memoizedProps);else w!==m?(w===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):w.count--,m===null?BO(y,a.type,a.stateNode):UO(y,m,a.memoizedProps)):m===null&&a.stateNode!==null&&Wg(a,a.memoizedProps,c.memoizedProps)}break;case 27:Or(s,a),Nr(a),m&512&&(fn||c===null||ei(c,c.return)),c!==null&&m&4&&Wg(a,a.memoizedProps,c.memoizedProps);break;case 5:if(Or(s,a),Nr(a),m&512&&(fn||c===null||ei(c,c.return)),a.flags&32){y=a.stateNode;try{Ul(y,"")}catch(Ae){mt(a,a.return,Ae)}}m&4&&a.stateNode!=null&&(y=a.memoizedProps,Wg(a,y,c!==null?c.memoizedProps:y)),m&1024&&(Xg=!0);break;case 6:if(Or(s,a),Nr(a),m&4){if(a.stateNode===null)throw Error(r(162));m=a.memoizedProps,c=a.stateNode;try{c.nodeValue=m}catch(Ae){mt(a,a.return,Ae)}}break;case 3:if(lm=null,y=_a,_a=om(s.containerInfo),Or(s,a),_a=y,Nr(a),m&4&&c!==null&&c.memoizedState.isDehydrated)try{bc(s.containerInfo)}catch(Ae){mt(a,a.return,Ae)}Xg&&(Xg=!1,B1(a));break;case 4:m=_a,_a=om(a.stateNode.containerInfo),Or(s,a),Nr(a),_a=m;break;case 12:Or(s,a),Nr(a);break;case 31:Or(s,a),Nr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gh(a,m)));break;case 13:Or(s,a),Nr(a),a.child.flags&8192&&a.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Wh=Kt()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gh(a,m)));break;case 22:y=a.memoizedState!==null;var B=c!==null&&c.memoizedState!==null,X=Hi,ae=fn;if(Hi=X||y,fn=ae||B,Or(s,a),fn=ae,Hi=X,Nr(a),m&8192)e:for(s=a.stateNode,s._visibility=y?s._visibility&-2:s._visibility|1,y&&(c===null||B||Hi||fn||Ks(a)),c=null,s=a;;){if(s.tag===5||s.tag===26){if(c===null){B=c=s;try{if(w=B.stateNode,y)N=w.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{M=B.stateNode;var se=B.memoizedProps.style,J=se!=null&&se.hasOwnProperty("display")?se.display:null;M.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(Ae){mt(B,B.return,Ae)}}}else if(s.tag===6){if(c===null){B=s;try{B.stateNode.nodeValue=y?"":B.memoizedProps}catch(Ae){mt(B,B.return,Ae)}}}else if(s.tag===18){if(c===null){B=s;try{var te=B.stateNode;y?PO(te,!0):PO(B.stateNode,!1)}catch(Ae){mt(B,B.return,Ae)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===a)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;c===s&&(c=null),s=s.return}c===s&&(c=null),s.sibling.return=s.return,s=s.sibling}m&4&&(m=a.updateQueue,m!==null&&(c=m.retryQueue,c!==null&&(m.retryQueue=null,Gh(a,c))));break;case 19:Or(s,a),Nr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gh(a,m)));break;case 30:break;case 21:break;default:Or(s,a),Nr(a)}}function Nr(a){var s=a.flags;if(s&2){try{for(var c,m=a.return;m!==null;){if(D1(m)){c=m;break}m=m.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var y=c.stateNode,w=Qg(a);Hh(a,w,y);break;case 5:var N=c.stateNode;c.flags&32&&(Ul(N,""),c.flags&=-33);var M=Qg(a);Hh(a,M,N);break;case 3:case 4:var B=c.stateNode.containerInfo,X=Qg(a);Vg(a,X,B);break;default:throw Error(r(161))}}catch(ae){mt(a,a.return,ae)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function B1(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;B1(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function Yi(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)k1(a,s.alternate,s),s=s.sibling}function Ks(a){for(a=a.child;a!==null;){var s=a;switch(s.tag){case 0:case 11:case 14:case 15:Uo(4,s,s.return),Ks(s);break;case 1:ei(s,s.return);var c=s.stateNode;typeof c.componentWillUnmount=="function"&&P1(s,s.return,c),Ks(s);break;case 27:xd(s.stateNode);case 26:case 5:ei(s,s.return),Ks(s);break;case 22:s.memoizedState===null&&Ks(s);break;case 30:Ks(s);break;default:Ks(s)}a=a.sibling}}function Wi(a,s,c){for(c=c&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var m=s.alternate,y=a,w=s,N=w.flags;switch(w.tag){case 0:case 11:case 15:Wi(y,w,c),ud(4,w);break;case 1:if(Wi(y,w,c),m=w,y=m.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(X){mt(m,m.return,X)}if(m=w,y=m.updateQueue,y!==null){var M=m.stateNode;try{var B=y.shared.hiddenCallbacks;if(B!==null)for(y.shared.hiddenCallbacks=null,y=0;y<B.length;y++)gC(B[y],M)}catch(X){mt(m,m.return,X)}}c&&N&64&&T1(w),dd(w,w.return);break;case 27:M1(w);case 26:case 5:Wi(y,w,c),c&&m===null&&N&4&&_1(w),dd(w,w.return);break;case 12:Wi(y,w,c);break;case 31:Wi(y,w,c),c&&N&4&&z1(y,w);break;case 13:Wi(y,w,c),c&&N&4&&U1(y,w);break;case 22:w.memoizedState===null&&Wi(y,w,c),dd(w,w.return);break;case 30:break;default:Wi(y,w,c)}s=s.sibling}}function Zg(a,s){var c=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==c&&(a!=null&&a.refCount++,c!=null&&Xu(c))}function Jg(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Xu(a))}function Da(a,s,c,m){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)F1(a,s,c,m),s=s.sibling}function F1(a,s,c,m){var y=s.flags;switch(s.tag){case 0:case 11:case 15:Da(a,s,c,m),y&2048&&ud(9,s);break;case 1:Da(a,s,c,m);break;case 3:Da(a,s,c,m),y&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Xu(a)));break;case 12:if(y&2048){Da(a,s,c,m),a=s.stateNode;try{var w=s.memoizedProps,N=w.id,M=w.onPostCommit;typeof M=="function"&&M(N,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(B){mt(s,s.return,B)}}else Da(a,s,c,m);break;case 31:Da(a,s,c,m);break;case 13:Da(a,s,c,m);break;case 23:break;case 22:w=s.stateNode,N=s.alternate,s.memoizedState!==null?w._visibility&2?Da(a,s,c,m):fd(a,s):w._visibility&2?Da(a,s,c,m):(w._visibility|=2,ic(a,s,c,m,(s.subtreeFlags&10256)!==0||!1)),y&2048&&Zg(N,s);break;case 24:Da(a,s,c,m),y&2048&&Jg(s.alternate,s);break;default:Da(a,s,c,m)}}function ic(a,s,c,m,y){for(y=y&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var w=a,N=s,M=c,B=m,X=N.flags;switch(N.tag){case 0:case 11:case 15:ic(w,N,M,B,y),ud(8,N);break;case 23:break;case 22:var ae=N.stateNode;N.memoizedState!==null?ae._visibility&2?ic(w,N,M,B,y):fd(w,N):(ae._visibility|=2,ic(w,N,M,B,y)),y&&X&2048&&Zg(N.alternate,N);break;case 24:ic(w,N,M,B,y),y&&X&2048&&Jg(N.alternate,N);break;default:ic(w,N,M,B,y)}s=s.sibling}}function fd(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var c=a,m=s,y=m.flags;switch(m.tag){case 22:fd(c,m),y&2048&&Zg(m.alternate,m);break;case 24:fd(c,m),y&2048&&Jg(m.alternate,m);break;default:fd(c,m)}s=s.sibling}}var hd=8192;function oc(a,s,c){if(a.subtreeFlags&hd)for(a=a.child;a!==null;)$1(a,s,c),a=a.sibling}function $1(a,s,c){switch(a.tag){case 26:oc(a,s,c),a.flags&hd&&a.memoizedState!==null&&EF(c,_a,a.memoizedState,a.memoizedProps);break;case 5:oc(a,s,c);break;case 3:case 4:var m=_a;_a=om(a.stateNode.containerInfo),oc(a,s,c),_a=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=hd,hd=16777216,oc(a,s,c),hd=m):oc(a,s,c));break;default:oc(a,s,c)}}function K1(a){var s=a.alternate;if(s!==null&&(a=s.child,a!==null)){s.child=null;do s=a.sibling,a.sibling=null,a=s;while(a!==null)}}function md(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var m=s[c];Pn=m,G1(m,a)}K1(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)H1(a),a=a.sibling}function H1(a){switch(a.tag){case 0:case 11:case 15:md(a),a.flags&2048&&Uo(9,a,a.return);break;case 3:md(a);break;case 12:md(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&2&&(a.return===null||a.return.tag!==13)?(s._visibility&=-3,Yh(a)):md(a);break;default:md(a)}}function Yh(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var m=s[c];Pn=m,G1(m,a)}K1(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:Uo(8,s,s.return),Yh(s);break;case 22:c=s.stateNode,c._visibility&2&&(c._visibility&=-3,Yh(s));break;default:Yh(s)}a=a.sibling}}function G1(a,s){for(;Pn!==null;){var c=Pn;switch(c.tag){case 0:case 11:case 15:Uo(8,c,s);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var m=c.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Xu(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,Pn=m;else e:for(c=a;Pn!==null;){m=Pn;var y=m.sibling,w=m.return;if(L1(m),m===c){Pn=null;break e}if(y!==null){y.return=w,Pn=y;break e}Pn=w}}}var zB={getCacheForType:function(a){var s=$n(cn),c=s.data.get(a);return c===void 0&&(c=a(),s.data.set(a,c)),c},cacheSignal:function(){return $n(cn).controller.signal}},UB=typeof WeakMap=="function"?WeakMap:Map,lt=0,wt=null,We=null,Ve=0,ht=0,Yr=null,qo=!1,sc=!1,ey=!1,Qi=0,Yt=0,Bo=0,Hs=0,ty=0,Wr=0,lc=0,pd=null,Tr=null,ny=!1,Wh=0,Y1=0,Qh=1/0,Vh=null,Fo=null,vn=0,$o=null,cc=null,Vi=0,ry=0,ay=null,W1=null,bd=0,iy=null;function Qr(){return(lt&2)!==0&&Ve!==0?Ve&-Ve:K.T!==null?dy():nt()}function Q1(){if(Wr===0)if((Ve&536870912)===0||Ze){var a=Va;Va<<=1,(Va&3932160)===0&&(Va=262144),Wr=a}else Wr=536870912;return a=Hr.current,a!==null&&(a.flags|=32),Wr}function Pr(a,s,c){(a===wt&&(ht===2||ht===9)||a.cancelPendingCommit!==null)&&(uc(a,0),Ko(a,Ve,Wr,!1)),Er(a,c),((lt&2)===0||a!==wt)&&(a===wt&&((lt&2)===0&&(Hs|=c),Yt===4&&Ko(a,Ve,Wr,!1)),ti(a))}function V1(a,s,c){if((lt&6)!==0)throw Error(r(327));var m=!c&&(s&127)===0&&(s&a.expiredLanes)===0||Ot(a,s),y=m?FB(a,s):sy(a,s,!0),w=m;do{if(y===0){sc&&!m&&Ko(a,s,0,!1);break}else{if(c=a.current.alternate,w&&!qB(c)){y=sy(a,s,!1),w=!1;continue}if(y===2){if(w=s,a.errorRecoveryDisabledLanes&w)var N=0;else N=a.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){s=N;e:{var M=a;y=pd;var B=M.current.memoizedState.isDehydrated;if(B&&(uc(M,N).flags|=256),N=sy(M,N,!1),N!==2){if(ey&&!B){M.errorRecoveryDisabledLanes|=w,Hs|=w,y=4;break e}w=Tr,Tr=y,w!==null&&(Tr===null?Tr=w:Tr.push.apply(Tr,w))}y=N}if(w=!1,y!==2)continue}}if(y===1){uc(a,0),Ko(a,s,0,!0);break}e:{switch(m=a,w=y,w){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Ko(m,s,Wr,!qo);break e;case 2:Tr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(y=Wh+300-Kt(),10<y)){if(Ko(m,s,Wr,!qo),Ut(m,0,!0)!==0)break e;Vi=s,m.timeoutHandle=OO(X1.bind(null,m,c,Tr,Vh,ny,s,Wr,Hs,lc,qo,w,"Throttled",-0,0),y);break e}X1(m,c,Tr,Vh,ny,s,Wr,Hs,lc,qo,w,null,-0,0)}}break}while(!0);ti(a)}function X1(a,s,c,m,y,w,N,M,B,X,ae,se,J,te){if(a.timeoutHandle=-1,se=s.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ki},$1(s,w,se);var Ae=(w&62914560)===w?Wh-Kt():(w&4194048)===w?Y1-Kt():0;if(Ae=AF(se,Ae),Ae!==null){Vi=w,a.cancelPendingCommit=Ae(iO.bind(null,a,s,w,c,m,y,N,M,B,ae,se,null,J,te)),Ko(a,w,N,!X);return}}iO(a,s,w,c,m,y,N,M,B)}function qB(a){for(var s=a;;){var c=s.tag;if((c===0||c===11||c===15)&&s.flags&16384&&(c=s.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var m=0;m<c.length;m++){var y=c[m],w=y.getSnapshot;y=y.value;try{if(!$r(w(),y))return!1}catch{return!1}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ko(a,s,c,m){s&=~ty,s&=~Hs,a.suspendedLanes|=s,a.pingedLanes&=~s,m&&(a.warmLanes|=s),m=a.expirationTimes;for(var y=s;0<y;){var w=31-zt(y),N=1<<w;m[w]=-1,y&=~N}c!==0&&cr(a,c,s)}function Xh(){return(lt&6)===0?(vd(0),!1):!0}function oy(){if(We!==null){if(ht===0)var a=We.return;else a=We,Ui=Ls=null,Sg(a),ec=null,Ju=0,a=We;for(;a!==null;)N1(a.alternate,a),a=a.return;We=null}}function uc(a,s){var c=a.timeoutHandle;c!==-1&&(a.timeoutHandle=-1,oF(c)),c=a.cancelPendingCommit,c!==null&&(a.cancelPendingCommit=null,c()),Vi=0,oy(),wt=a,We=c=Ii(a.current,null),Ve=s,ht=0,Yr=null,qo=!1,sc=Ot(a,s),ey=!1,lc=Wr=ty=Hs=Bo=Yt=0,Tr=pd=null,ny=!1,(s&8)!==0&&(s|=s&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=s;0<m;){var y=31-zt(m),w=1<<y;s|=a[y],m&=~w}return Qi=s,gh(),c}function Z1(a,s){Fe=null,K.H=sd,s===Jl||s===Ch?(s=mC(),ht=3):s===ug?(s=mC(),ht=4):ht=s===zg?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Yr=s,We===null&&(Yt=1,qh(a,sa(s,a.current)))}function J1(){var a=Hr.current;return a===null?!0:(Ve&4194048)===Ve?da===null:(Ve&62914560)===Ve||(Ve&536870912)!==0?a===da:!1}function eO(){var a=K.H;return K.H=sd,a===null?sd:a}function tO(){var a=K.A;return K.A=zB,a}function Zh(){Yt=4,qo||(Ve&4194048)!==Ve&&Hr.current!==null||(sc=!0),(Bo&134217727)===0&&(Hs&134217727)===0||wt===null||Ko(wt,Ve,Wr,!1)}function sy(a,s,c){var m=lt;lt|=2;var y=eO(),w=tO();(wt!==a||Ve!==s)&&(Vh=null,uc(a,s)),s=!1;var N=Yt;e:do try{if(ht!==0&&We!==null){var M=We,B=Yr;switch(ht){case 8:oy(),N=6;break e;case 3:case 2:case 9:case 6:Hr.current===null&&(s=!0);var X=ht;if(ht=0,Yr=null,dc(a,M,B,X),c&&sc){N=0;break e}break;default:X=ht,ht=0,Yr=null,dc(a,M,B,X)}}BB(),N=Yt;break}catch(ae){Z1(a,ae)}while(!0);return s&&a.shellSuspendCounter++,Ui=Ls=null,lt=m,K.H=y,K.A=w,We===null&&(wt=null,Ve=0,gh()),N}function BB(){for(;We!==null;)nO(We)}function FB(a,s){var c=lt;lt|=2;var m=eO(),y=tO();wt!==a||Ve!==s?(Vh=null,Qh=Kt()+500,uc(a,s)):sc=Ot(a,s);e:do try{if(ht!==0&&We!==null){s=We;var w=Yr;t:switch(ht){case 1:ht=0,Yr=null,dc(a,s,w,1);break;case 2:case 9:if(fC(w)){ht=0,Yr=null,rO(s);break}s=function(){ht!==2&&ht!==9||wt!==a||(ht=7),ti(a)},w.then(s,s);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:fC(w)?(ht=0,Yr=null,rO(s)):(ht=0,Yr=null,dc(a,s,w,7));break;case 5:var N=null;switch(We.tag){case 26:N=We.memoizedState;case 5:case 27:var M=We;if(N?FO(N):M.stateNode.complete){ht=0,Yr=null;var B=M.sibling;if(B!==null)We=B;else{var X=M.return;X!==null?(We=X,Jh(X)):We=null}break t}}ht=0,Yr=null,dc(a,s,w,5);break;case 6:ht=0,Yr=null,dc(a,s,w,6);break;case 8:oy(),Yt=6;break e;default:throw Error(r(462))}}$B();break}catch(ae){Z1(a,ae)}while(!0);return Ui=Ls=null,K.H=m,K.A=y,lt=c,We!==null?0:(wt=null,Ve=0,gh(),Yt)}function $B(){for(;We!==null&&!Oi();)nO(We)}function nO(a){var s=C1(a.alternate,a,Qi);a.memoizedProps=a.pendingProps,s===null?Jh(a):We=s}function rO(a){var s=a,c=s.alternate;switch(s.tag){case 15:case 0:s=x1(c,s,s.pendingProps,s.type,void 0,Ve);break;case 11:s=x1(c,s,s.pendingProps,s.type.render,s.ref,Ve);break;case 5:Sg(s);default:N1(c,s),s=We=tC(s,Qi),s=C1(c,s,Qi)}a.memoizedProps=a.pendingProps,s===null?Jh(a):We=s}function dc(a,s,c,m){Ui=Ls=null,Sg(s),ec=null,Ju=0;var y=s.return;try{if(_B(a,y,s,c,Ve)){Yt=1,qh(a,sa(c,a.current)),We=null;return}}catch(w){if(y!==null)throw We=y,w;Yt=1,qh(a,sa(c,a.current)),We=null;return}s.flags&32768?(Ze||m===1?a=!0:sc||(Ve&536870912)!==0?a=!1:(qo=a=!0,(m===2||m===9||m===3||m===6)&&(m=Hr.current,m!==null&&m.tag===13&&(m.flags|=16384))),aO(s,a)):Jh(s)}function Jh(a){var s=a;do{if((s.flags&32768)!==0){aO(s,qo);return}a=s.return;var c=RB(s.alternate,s,Qi);if(c!==null){We=c;return}if(s=s.sibling,s!==null){We=s;return}We=s=a}while(s!==null);Yt===0&&(Yt=5)}function aO(a,s){do{var c=kB(a.alternate,a);if(c!==null){c.flags&=32767,We=c;return}if(c=a.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!s&&(a=a.sibling,a!==null)){We=a;return}We=a=c}while(a!==null);Yt=6,We=null}function iO(a,s,c,m,y,w,N,M,B){a.cancelPendingCommit=null;do em();while(vn!==0);if((lt&6)!==0)throw Error(r(327));if(s!==null){if(s===a.current)throw Error(r(177));if(w=s.lanes|s.childLanes,w|=Qv,qt(a,c,w,N,M,B),a===wt&&(We=wt=null,Ve=0),cc=s,$o=a,Vi=c,ry=w,ay=y,W1=m,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,YB(Cn,function(){return uO(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||m){m=K.T,K.T=null,y=Z.p,Z.p=2,N=lt,lt|=4;try{LB(a,s,c)}finally{lt=N,Z.p=y,K.T=m}}vn=1,oO(),sO(),lO()}}function oO(){if(vn===1){vn=0;var a=$o,s=cc,c=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||c){c=K.T,K.T=null;var m=Z.p;Z.p=2;var y=lt;lt|=4;try{q1(s,a);var w=yy,N=Gj(a.containerInfo),M=w.focusedElem,B=w.selectionRange;if(N!==M&&M&&M.ownerDocument&&Hj(M.ownerDocument.documentElement,M)){if(B!==null&&Kv(M)){var X=B.start,ae=B.end;if(ae===void 0&&(ae=X),"selectionStart"in M)M.selectionStart=X,M.selectionEnd=Math.min(ae,M.value.length);else{var se=M.ownerDocument||document,J=se&&se.defaultView||window;if(J.getSelection){var te=J.getSelection(),Ae=M.textContent.length,De=Math.min(B.start,Ae),vt=B.end===void 0?De:Math.min(B.end,Ae);!te.extend&&De>vt&&(N=vt,vt=De,De=N);var Y=Kj(M,De),H=Kj(M,vt);if(Y&&H&&(te.rangeCount!==1||te.anchorNode!==Y.node||te.anchorOffset!==Y.offset||te.focusNode!==H.node||te.focusOffset!==H.offset)){var V=se.createRange();V.setStart(Y.node,Y.offset),te.removeAllRanges(),De>vt?(te.addRange(V),te.extend(H.node,H.offset)):(V.setEnd(H.node,H.offset),te.addRange(V))}}}}for(se=[],te=M;te=te.parentNode;)te.nodeType===1&&se.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<se.length;M++){var oe=se[M];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}fm=!!gy,yy=gy=null}finally{lt=y,Z.p=m,K.T=c}}a.current=s,vn=2}}function sO(){if(vn===2){vn=0;var a=$o,s=cc,c=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||c){c=K.T,K.T=null;var m=Z.p;Z.p=2;var y=lt;lt|=4;try{k1(a,s.alternate,s)}finally{lt=y,Z.p=m,K.T=c}}vn=3}}function lO(){if(vn===4||vn===3){vn=0,zr();var a=$o,s=cc,c=Vi,m=W1;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?vn=5:(vn=0,cc=$o=null,cO(a,a.pendingLanes));var y=a.pendingLanes;if(y===0&&(Fo=null),Na(c),s=s.stateNode,bn&&typeof bn.onCommitFiberRoot=="function")try{bn.onCommitFiberRoot(Qa,s,void 0,(s.current.flags&128)===128)}catch{}if(m!==null){s=K.T,y=Z.p,Z.p=2,K.T=null;try{for(var w=a.onRecoverableError,N=0;N<m.length;N++){var M=m[N];w(M.value,{componentStack:M.stack})}}finally{K.T=s,Z.p=y}}(Vi&3)!==0&&em(),ti(a),y=a.pendingLanes,(c&261930)!==0&&(y&42)!==0?a===iy?bd++:(bd=0,iy=a):bd=0,vd(0)}}function cO(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,Xu(s)))}function em(){return oO(),sO(),lO(),uO()}function uO(){if(vn!==5)return!1;var a=$o,s=ry;ry=0;var c=Na(Vi),m=K.T,y=Z.p;try{Z.p=32>c?32:c,K.T=null,c=ay,ay=null;var w=$o,N=Vi;if(vn=0,cc=$o=null,Vi=0,(lt&6)!==0)throw Error(r(331));var M=lt;if(lt|=4,H1(w.current),F1(w,w.current,N,c),lt=M,vd(0,!1),bn&&typeof bn.onPostCommitFiberRoot=="function")try{bn.onPostCommitFiberRoot(Qa,w)}catch{}return!0}finally{Z.p=y,K.T=m,cO(a,s)}}function dO(a,s,c){s=sa(c,s),s=Ig(a.stateNode,s,2),a=Lo(a,s,2),a!==null&&(Er(a,2),ti(a))}function mt(a,s,c){if(a.tag===3)dO(a,a,c);else for(;s!==null;){if(s.tag===3){dO(s,a,c);break}else if(s.tag===1){var m=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Fo===null||!Fo.has(m))){a=sa(c,a),c=f1(2),m=Lo(s,c,2),m!==null&&(h1(c,m,s,a),Er(m,2),ti(m));break}}s=s.return}}function ly(a,s,c){var m=a.pingCache;if(m===null){m=a.pingCache=new UB;var y=new Set;m.set(s,y)}else y=m.get(s),y===void 0&&(y=new Set,m.set(s,y));y.has(c)||(ey=!0,y.add(c),a=KB.bind(null,a,s,c),s.then(a,a))}function KB(a,s,c){var m=a.pingCache;m!==null&&m.delete(s),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,wt===a&&(Ve&c)===c&&(Yt===4||Yt===3&&(Ve&62914560)===Ve&&300>Kt()-Wh?(lt&2)===0&&uc(a,0):ty|=c,lc===Ve&&(lc=0)),ti(a)}function fO(a,s){s===0&&(s=sn()),a=Ms(a,s),a!==null&&(Er(a,s),ti(a))}function HB(a){var s=a.memoizedState,c=0;s!==null&&(c=s.retryLane),fO(a,c)}function GB(a,s){var c=0;switch(a.tag){case 31:case 13:var m=a.stateNode,y=a.memoizedState;y!==null&&(c=y.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(s),fO(a,c)}function YB(a,s){return Xn(a,s)}var tm=null,fc=null,cy=!1,nm=!1,uy=!1,Ho=0;function ti(a){a!==fc&&a.next===null&&(fc===null?tm=fc=a:fc=fc.next=a),nm=!0,cy||(cy=!0,QB())}function vd(a,s){if(!uy&&nm){uy=!0;do for(var c=!1,m=tm;m!==null;){if(a!==0){var y=m.pendingLanes;if(y===0)var w=0;else{var N=m.suspendedLanes,M=m.pingedLanes;w=(1<<31-zt(42|a)+1)-1,w&=y&~(N&~M),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(c=!0,bO(m,w))}else w=Ve,w=Ut(m,m===wt?w:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(w&3)===0||Ot(m,w)||(c=!0,bO(m,w));m=m.next}while(c);uy=!1}}function WB(){hO()}function hO(){nm=cy=!1;var a=0;Ho!==0&&iF()&&(a=Ho);for(var s=Kt(),c=null,m=tm;m!==null;){var y=m.next,w=mO(m,s);w===0?(m.next=null,c===null?tm=y:c.next=y,y===null&&(fc=c)):(c=m,(a!==0||(w&3)!==0)&&(nm=!0)),m=y}vn!==0&&vn!==5||vd(a),Ho!==0&&(Ho=0)}function mO(a,s){for(var c=a.suspendedLanes,m=a.pingedLanes,y=a.expirationTimes,w=a.pendingLanes&-62914561;0<w;){var N=31-zt(w),M=1<<N,B=y[N];B===-1?((M&c)===0||(M&m)!==0)&&(y[N]=en(M,s)):B<=s&&(a.expiredLanes|=M),w&=~M}if(s=wt,c=Ve,c=Ut(a,a===s?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,c===0||a===s&&(ht===2||ht===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&ja(m),a.callbackNode=null,a.callbackPriority=0;if((c&3)===0||Ot(a,c)){if(s=c&-c,s===a.callbackPriority)return s;switch(m!==null&&ja(m),Na(c)){case 2:case 8:c=Ur;break;case 32:c=Cn;break;case 268435456:c=Wa;break;default:c=Cn}return m=pO.bind(null,a),c=Xn(c,m),a.callbackPriority=s,a.callbackNode=c,s}return m!==null&&m!==null&&ja(m),a.callbackPriority=2,a.callbackNode=null,2}function pO(a,s){if(vn!==0&&vn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var c=a.callbackNode;if(em()&&a.callbackNode!==c)return null;var m=Ve;return m=Ut(a,a===wt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(V1(a,m,s),mO(a,Kt()),a.callbackNode!=null&&a.callbackNode===c?pO.bind(null,a):null)}function bO(a,s){if(em())return null;V1(a,s,!0)}function QB(){sF(function(){(lt&6)!==0?Xn(Eo,WB):hO()})}function dy(){if(Ho===0){var a=Xl;a===0&&(a=Ni,Ni<<=1,(Ni&261888)===0&&(Ni=256)),Ho=a}return Ho}function vO(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:uh(""+a)}function gO(a,s){var c=s.ownerDocument.createElement("input");return c.name=s.name,c.value=s.value,a.id&&c.setAttribute("form",a.id),s.parentNode.insertBefore(c,s),a=new FormData(a),c.parentNode.removeChild(c),a}function VB(a,s,c,m,y){if(s==="submit"&&c&&c.stateNode===y){var w=vO((y[Tn]||null).action),N=m.submitter;N&&(s=(s=N[Tn]||null)?vO(s.formAction):N.getAttribute("formAction"),s!==null&&(w=s,N=null));var M=new mh("action","action",null,m,y);a.push({event:M,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Ho!==0){var B=N?gO(y,N):new FormData(y);_g(c,{pending:!0,data:B,method:y.method,action:w},null,B)}}else typeof w=="function"&&(M.preventDefault(),B=N?gO(y,N):new FormData(y),_g(c,{pending:!0,data:B,method:y.method,action:w},w,B))},currentTarget:y}]})}}for(var fy=0;fy<Wv.length;fy++){var hy=Wv[fy],XB=hy.toLowerCase(),ZB=hy[0].toUpperCase()+hy.slice(1);Pa(XB,"on"+ZB)}Pa(Qj,"onAnimationEnd"),Pa(Vj,"onAnimationIteration"),Pa(Xj,"onAnimationStart"),Pa("dblclick","onDoubleClick"),Pa("focusin","onFocus"),Pa("focusout","onBlur"),Pa(mB,"onTransitionRun"),Pa(pB,"onTransitionStart"),Pa(bB,"onTransitionCancel"),Pa(Zj,"onTransitionEnd"),Di("onMouseEnter",["mouseout","mouseover"]),Di("onMouseLeave",["mouseout","mouseover"]),Di("onPointerEnter",["pointerout","pointerover"]),Di("onPointerLeave",["pointerout","pointerover"]),Bn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),JB=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gd));function yO(a,s){s=(s&4)!==0;for(var c=0;c<a.length;c++){var m=a[c],y=m.event;m=m.listeners;e:{var w=void 0;if(s)for(var N=m.length-1;0<=N;N--){var M=m[N],B=M.instance,X=M.currentTarget;if(M=M.listener,B!==w&&y.isPropagationStopped())break e;w=M,y.currentTarget=X;try{w(y)}catch(ae){vh(ae)}y.currentTarget=null,w=B}else for(N=0;N<m.length;N++){if(M=m[N],B=M.instance,X=M.currentTarget,M=M.listener,B!==w&&y.isPropagationStopped())break e;w=M,y.currentTarget=X;try{w(y)}catch(ae){vh(ae)}y.currentTarget=null,w=B}}}}function Qe(a,s){var c=s[zl];c===void 0&&(c=s[zl]=new Set);var m=a+"__bubble";c.has(m)||(xO(s,a,2,!1),c.add(m))}function my(a,s,c){var m=0;s&&(m|=4),xO(c,a,m,s)}var rm="_reactListening"+Math.random().toString(36).slice(2);function py(a){if(!a[rm]){a[rm]=!0,_i.forEach(function(c){c!=="selectionchange"&&(JB.has(c)||my(c,!1,a),my(c,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[rm]||(s[rm]=!0,my("selectionchange",!1,s))}}function xO(a,s,c,m){switch(QO(s)){case 2:var y=OF;break;case 8:y=NF;break;default:y=Py}c=y.bind(null,s,c,a),y=void 0,!kv||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(y=!0),m?y!==void 0?a.addEventListener(s,c,{capture:!0,passive:y}):a.addEventListener(s,c,!0):y!==void 0?a.addEventListener(s,c,{passive:y}):a.addEventListener(s,c,!1)}function by(a,s,c,m,y){var w=m;if((s&1)===0&&(s&2)===0&&m!==null)e:for(;;){if(m===null)return;var N=m.tag;if(N===3||N===4){var M=m.stateNode.containerInfo;if(M===y)break;if(N===4)for(N=m.return;N!==null;){var B=N.tag;if((B===3||B===4)&&N.stateNode.containerInfo===y)return;N=N.return}for(;M!==null;){if(N=jo(M),N===null)return;if(B=N.tag,B===5||B===6||B===26||B===27){m=w=N;continue e}M=M.parentNode}}m=m.return}jj(function(){var X=w,ae=Mv(c),se=[];e:{var J=Jj.get(a);if(J!==void 0){var te=mh,Ae=a;switch(a){case"keypress":if(fh(c)===0)break e;case"keydown":case"keyup":te=Gq;break;case"focusin":Ae="focus",te=Uv;break;case"focusout":Ae="blur",te=Uv;break;case"beforeblur":case"afterblur":te=Uv;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=Nj;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=Rq;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Qq;break;case Qj:case Vj:case Xj:te=Iq;break;case Zj:te=Xq;break;case"scroll":case"scrollend":te=Dq;break;case"wheel":te=Jq;break;case"copy":case"cut":case"paste":te=Uq;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=Pj;break;case"toggle":case"beforetoggle":te=tB}var De=(s&4)!==0,vt=!De&&(a==="scroll"||a==="scrollend"),Y=De?J!==null?J+"Capture":null:J;De=[];for(var H=X,V;H!==null;){var oe=H;if(V=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||V===null||Y===null||(oe=qu(H,Y),oe!=null&&De.push(yd(H,oe,V))),vt)break;H=H.return}0<De.length&&(J=new te(J,Ae,null,c,ae),se.push({event:J,listeners:De}))}}if((s&7)===0){e:{if(J=a==="mouseover"||a==="pointerover",te=a==="mouseout"||a==="pointerout",J&&c!==Dv&&(Ae=c.relatedTarget||c.fromElement)&&(jo(Ae)||Ae[Ti]))break e;if((te||J)&&(J=ae.window===ae?ae:(J=ae.ownerDocument)?J.defaultView||J.parentWindow:window,te?(Ae=c.relatedTarget||c.toElement,te=X,Ae=Ae?jo(Ae):null,Ae!==null&&(vt=o(Ae),De=Ae.tag,Ae!==vt||De!==5&&De!==27&&De!==6)&&(Ae=null)):(te=null,Ae=X),te!==Ae)){if(De=Nj,oe="onMouseLeave",Y="onMouseEnter",H="mouse",(a==="pointerout"||a==="pointerover")&&(De=Pj,oe="onPointerLeave",Y="onPointerEnter",H="pointer"),vt=te==null?J:Co(te),V=Ae==null?J:Co(Ae),J=new De(oe,H+"leave",te,c,ae),J.target=vt,J.relatedTarget=V,oe=null,jo(ae)===X&&(De=new De(Y,H+"enter",Ae,c,ae),De.target=V,De.relatedTarget=vt,oe=De),vt=oe,te&&Ae)t:{for(De=eF,Y=te,H=Ae,V=0,oe=Y;oe;oe=De(oe))V++;oe=0;for(var Pe=H;Pe;Pe=De(Pe))oe++;for(;0<V-oe;)Y=De(Y),V--;for(;0<oe-V;)H=De(H),oe--;for(;V--;){if(Y===H||H!==null&&Y===H.alternate){De=Y;break t}Y=De(Y),H=De(H)}De=null}else De=null;te!==null&&wO(se,J,te,De,!1),Ae!==null&&vt!==null&&wO(se,vt,Ae,De,!0)}}e:{if(J=X?Co(X):window,te=J.nodeName&&J.nodeName.toLowerCase(),te==="select"||te==="input"&&J.type==="file")var at=zj;else if(Lj(J))if(Uj)at=dB;else{at=cB;var Ce=lB}else te=J.nodeName,!te||te.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?X&&_v(X.elementType)&&(at=zj):at=uB;if(at&&(at=at(a,X))){Ij(se,at,c,ae);break e}Ce&&Ce(a,J,X),a==="focusout"&&X&&J.type==="number"&&X.memoizedProps.value!=null&&Ht(J,"number",J.value)}switch(Ce=X?Co(X):window,a){case"focusin":(Lj(Ce)||Ce.contentEditable==="true")&&($l=Ce,Hv=X,Wu=null);break;case"focusout":Wu=Hv=$l=null;break;case"mousedown":Gv=!0;break;case"contextmenu":case"mouseup":case"dragend":Gv=!1,Yj(se,c,ae);break;case"selectionchange":if(hB)break;case"keydown":case"keyup":Yj(se,c,ae)}var $e;if(Bv)e:{switch(a){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else Fl?Rj(a,c)&&(Xe="onCompositionEnd"):a==="keydown"&&c.keyCode===229&&(Xe="onCompositionStart");Xe&&(_j&&c.locale!=="ko"&&(Fl||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&Fl&&($e=Cj()):(To=ae,Lv="value"in To?To.value:To.textContent,Fl=!0)),Ce=am(X,Xe),0<Ce.length&&(Xe=new Tj(Xe,a,null,c,ae),se.push({event:Xe,listeners:Ce}),$e?Xe.data=$e:($e=kj(c),$e!==null&&(Xe.data=$e)))),($e=rB?aB(a,c):iB(a,c))&&(Xe=am(X,"onBeforeInput"),0<Xe.length&&(Ce=new Tj("onBeforeInput","beforeinput",null,c,ae),se.push({event:Ce,listeners:Xe}),Ce.data=$e)),VB(se,a,X,c,ae)}yO(se,s)})}function yd(a,s,c){return{instance:a,listener:s,currentTarget:c}}function am(a,s){for(var c=s+"Capture",m=[];a!==null;){var y=a,w=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||w===null||(y=qu(a,c),y!=null&&m.unshift(yd(a,y,w)),y=qu(a,s),y!=null&&m.push(yd(a,y,w))),a.tag===3)return m;a=a.return}return[]}function eF(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function wO(a,s,c,m,y){for(var w=s._reactName,N=[];c!==null&&c!==m;){var M=c,B=M.alternate,X=M.stateNode;if(M=M.tag,B!==null&&B===m)break;M!==5&&M!==26&&M!==27||X===null||(B=X,y?(X=qu(c,w),X!=null&&N.unshift(yd(c,X,B))):y||(X=qu(c,w),X!=null&&N.push(yd(c,X,B)))),c=c.return}N.length!==0&&a.push({event:s,listeners:N})}var tF=/\r\n?/g,nF=/\u0000|\uFFFD/g;function SO(a){return(typeof a=="string"?a:""+a).replace(tF,`49 `).replace( nF,"")}function EO(a,s){return s=SO(s),SO(a)===s}function bt(a,s,c,m,y,w){switch(c){case"children":typeof m=="string"?s==="body"||s==="textarea"&&m===""||Ul(a,m):(typeof m=="number"||typeof m=="bigint")&&s!=="body"&&Ul(a,""+m);break;case"className":No(a,"class",m);break;case"tabIndex":No(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":No(a,c,m);break;case"style":Ej(a,m,w);break;case"data":if(s!=="object"){No(a,"data",m);break}case"src":case"href":if(m===""&&(s!=="a"||c!=="href")){a.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(c);break}m=uh(""+m),a.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(c==="formAction"?(s!=="input"&&bt(a,s,"name",y.name,y,null),bt(a,s,"formEncType",y.formEncType,y,null),bt(a,s,"formMethod",y.formMethod,y,null),bt(a,s,"formTarget",y.formTarget,y,null)):(bt(a,s,"encType",y.encType,y,null),bt(a,s,"method",y.method,y,null),bt(a,s,"target",y.target,y,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(c);break}m=uh(""+m),a.setAttribute(c,m);break;case"onClick":m!=null&&(a.onclick=ki);break;case"onScroll":m!=null&&Qe("scroll",a);break;case"onScrollEnd":m!=null&&Qe("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(c=m.__html,c!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=c}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}c=uh(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,""+m):a.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,""):a.removeAttribute(c);break;case"capture":case"download":m===!0?a.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,m):a.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(c,m):a.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(c):a.setAttribute(c,m);break;case"popover":Qe("beforetoggle",a),Qe("toggle",a),Mi(a,"popover",m);break;case"xlinkActuate":ve(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":ve(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":ve(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":ve(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":ve(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":ve(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":ve(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":ve(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":ve(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Mi(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=Pq.get(c)||c,Mi(a,c,m))}}function vy(a,s,c,m,y,w){switch(c){case"style":Ej(a,m,w);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(c=m.__html,c!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=c}}break;case"children":typeof m=="string"?Ul(a,m):(typeof m=="number"||typeof m=="bigint")&&Ul(a,""+m);break;case"onScroll":m!=null&&Qe("scroll",a);break;case"onScrollEnd":m!=null&&Qe("scrollend",a);break;case"onClick":m!=null&&(a.onclick=ki);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Oo.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(y=c.endsWith("Capture"),s=c.slice(2,y?c.length-7:void 0),w=a[Tn]||null,w=w!=null?w[c]:null,typeof w=="function"&&a.removeEventListener(s,w,y),typeof m=="function")){typeof w!="function"&&w!==null&&(c in a?a[c]=null:a.hasAttribute(c)&&a.removeAttribute(c)),a.addEventListener(s,m,y);break e}c in a?a[c]=m:m===!0?a.setAttribute(c,""):Mi(a,c,m)}}}function Hn(a,s,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",a),Qe("load",a);var m=!1,y=!1,w;for(w in c)if(c.hasOwnProperty(w)){var N=c[w];if(N!=null)switch(w){case"src":m=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:bt(a,s,w,N,c,null)}}y&&bt(a,s,"srcSet",c.srcSet,c,null),m&&bt(a,s,"src",c.src,c,null);return;case"input":Qe("invalid",a);var M=w=N=y=null,B=null,X=null;for(m in c)if(c.hasOwnProperty(m)){var ae=c[m];if(ae!=null)switch(m){case"name":y=ae;break;case"type":N=ae;break;case"checked":B=ae;break;case"defaultChecked":X=ae;break;case"value":w=ae;break;case"defaultValue":M=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,s));break;default:bt(a,s,m,ae,c,null)}}Ta(a,w,M,B,X,N,y,!1);return;case"select":Qe("invalid",a),m=N=w=null;for(y in c)if(c.hasOwnProperty(y)&&(M=c[y],M!=null))switch(y){case"value":w=M;break;case"defaultValue":N=M;break;case"multiple":m=M;default:bt(a,s,y,M,c,null)}s=w,c=N,a.multiple=!!m,s!=null?Ri(a,!!m,s,!1):c!=null&&Ri(a,!!m,c,!0);return;case"textarea":Qe("invalid",a),w=y=m=null;for(N in c)if(c.hasOwnProperty(N)&&(M=c[N],M!=null))switch(N){case"value":m=M;break;case"defaultValue":y=M;break;case"children":w=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:bt(a,s,N,M,c,null)}wj(a,m,y,w);return;case"option":for(B in c)if(c.hasOwnProperty(B)&&(m=c[B],m!=null))switch(B){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:bt(a,s,B,m,c,null)}return;case"dialog":Qe("beforetoggle",a),Qe("toggle",a),Qe("cancel",a),Qe("close",a);break;case"iframe":case"object":Qe("load",a);break;case"video":case"audio":for(m=0;m<gd.length;m++)Qe(gd[m],a);break;case"image":Qe("error",a),Qe("load",a);break;case"details":Qe("toggle",a);break;case"embed":case"source":case"link":Qe("error",a),Qe("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in c)if(c.hasOwnProperty(X)&&(m=c[X],m!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:bt(a,s,X,m,c,null)}return;default:if(_v(s)){for(ae in c)c.hasOwnProperty(ae)&&(m=c[ae],m!==void 0&&vy(a,s,ae,m,c,void 0));return}}for(M in c)c.hasOwnProperty(M)&&(m=c[M],m!=null&&bt(a,s,M,m,c,null))}function rF(a,s,c,m){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,w=null,N=null,M=null,B=null,X=null,ae=null;for(te in c){var se=c[te];if(c.hasOwnProperty(te)&&se!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":B=se;default:m.hasOwnProperty(te)||bt(a,s,te,null,m,se)}}for(var J in m){var te=m[J];if(se=c[J],m.hasOwnProperty(J)&&(te!=null||se!=null))switch(J){case"type":w=te;break;case"name":y=te;break;case"checked":X=te;break;case"defaultChecked":ae=te;break;case"value":N=te;break;case"defaultValue":M=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,s));break;default:te!==se&&bt(a,s,J,te,m,se)}}Nt(a,N,M,B,X,ae,w,y);return;case"select":te=N=M=J=null;for(w in c)if(B=c[w],c.hasOwnProperty(w)&&B!=null)switch(w){case"value":break;case"multiple":te=B;default:m.hasOwnProperty(w)||bt(a,s,w,null,m,B)}for(y in m)if(w=m[y],B=c[y],m.hasOwnProperty(y)&&(w!=null||B!=null))switch(y){case"value":J=w;break;case"defaultValue":M=w;break;case"multiple":N=w;default:w!==B&&bt(a,s,y,w,m,B)}s=M,c=N,m=te,J!=null?Ri(a,!!c,J,!1):!!m!=!!c&&(s!=null?Ri(a,!!c,s,!0):Ri(a,!!c,c?[]:"",!1));return;case"textarea":te=J=null;for(M in c)if(y=c[M],c.hasOwnProperty(M)&&y!=null&&!m.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:bt(a,s,M,null,m,y)}for(N in m)if(y=m[N],w=c[N],m.hasOwnProperty(N)&&(y!=null||w!=null))switch(N){case"value":J=y;break;case"defaultValue":te=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==w&&bt(a,s,N,y,m,w)}Uu(a,J,te);return;case"option":for(var Ae in c)if(J=c[Ae],c.hasOwnProperty(Ae)&&J!=null&&!m.hasOwnProperty(Ae))switch(Ae){case"selected":a.selected=!1;break;default:bt(a,s,Ae,null,m,J)}for(B in m)if(J=m[B],te=c[B],m.hasOwnProperty(B)&&J!==te&&(J!=null||te!=null))switch(B){case"selected":a.selected=J&&typeof J!="function"&&typeof J!="symbol";break;default:bt(a,s,B,J,m,te)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var De in c)J=c[De],c.hasOwnProperty(De)&&J!=null&&!m.hasOwnProperty(De)&&bt(a,s,De,null,m,J);for(X in m)if(J=m[X],te=c[X],m.hasOwnProperty(X)&&J!==te&&(J!=null||te!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,s));break;default:bt(a,s,X,J,m,te)}return;default:if(_v(s)){for(var vt in c)J=c[vt],c.hasOwnProperty(vt)&&J!==void 0&&!m.hasOwnProperty(vt)&&vy(a,s,vt,void 0,m,J);for(ae in m)J=m[ae],te=c[ae],!m.hasOwnProperty(ae)||J===te||J===void 0&&te===void 0||vy(a,s,ae,J,m,te);return}}for(var Y in c)J=c[Y],c.hasOwnProperty(Y)&&J!=null&&!m.hasOwnProperty(Y)&&bt(a,s,Y,null,m,J);for(se in m)J=m[se],te=c[se],!m.hasOwnProperty(se)||J===te||J==null&&te==null||bt(a,s,se,J,m,te)}function AO(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function aF(){if(typeof performance.getEntriesByType=="function"){for(var a=0,s=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var y=c[m],w=y.transferSize,N=y.initiatorType,M=y.duration;if(w&&M&&AO(N)){for(N=0,M=y.responseEnd,m+=1;m<c.length;m++){var B=c[m],X=B.startTime;if(X>M)break;var ae=B.transferSize,se=B.initiatorType;ae&&AO(se)&&(B=B.responseEnd,N+=ae*(B<M?1:(M-X)/(B-X)))}if(--m,s+=8*(w+N)/(y.duration/1e3),a++,10<a)break}}if(0<a)return s/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var gy=null,yy=null;function im(a){return a.nodeType===9?a:a.ownerDocument}function jO(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function CO(a,s){if(a===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&s==="foreignObject"?0:a}function xy(a,s){return a==="textarea"||a==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var wy=null;function iF(){var a=window.event;return a&&a.type==="popstate"?a===wy?!1:(wy=a,!0):(wy=null,!1)}var OO=typeof setTimeout=="function"?setTimeout:void 0,oF=typeof clearTimeout=="function"?clearTimeout:void 0,NO=typeof Promise=="function"?Promise:void 0,sF=typeof queueMicrotask=="function"?queueMicrotask:typeof NO<"u"?function(a){return NO.resolve(null).then(a).catch(lF)}:OO;function lF(a){setTimeout(function(){throw a})}function Go(a){return a==="head"}function TO(a,s){var c=s,m=0;do{var y=c.nextSibling;if(a.removeChild(c),y&&y.nodeType===8)if(c=y.data,c==="/$"||c==="/&"){if(m===0){a.removeChild(y),bc(s);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")xd(a.ownerDocument.documentElement);else if(c==="head"){c=a.ownerDocument.head,xd(c);for(var w=c.firstChild;w;){var N=w.nextSibling,M=w.nodeName;w[Fr]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&w.rel.toLowerCase()==="stylesheet"||c.removeChild(w),w=N}}else c==="body"&&xd(a.ownerDocument.body);c=y}while(c);bc(s)}function PO(a,s){var c=a;a=0;do{var m=c.nextSibling;if(c.nodeType===1?s?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(s?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(a===0)break;a--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||a++;c=m}while(c)}function Sy(a){var s=a.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var c=s;switch(s=s.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Sy(c),Iu(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}a.removeChild(c)}}function cF(a,s,c,m){for(;a.nodeType===1;){var y=c;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Fr])switch(s){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(w=a.getAttribute("rel"),w==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(w!==y.rel||a.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(w=a.getAttribute("src"),(w!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&w&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(s==="input"&&a.type==="hidden"){var w=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===w)return a}else return a;if(a=fa(a.nextSibling),a===null)break}return null}function uF(a,s,c){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=fa(a.nextSibling),a===null))return null;return a}function _O(a,s){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!s||(a=fa(a.nextSibling),a===null))return null;return a}function Ey(a){return a.data==="$?"||a.data==="$~"}function Ay(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function dF(a,s){var c=a.ownerDocument;if(a.data==="$~")a._reactRetry=s;else if(a.data!=="$?"||c.readyState!=="loading")s();else{var m=function(){s(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function fa(a){for(;a!=null;a=a.nextSibling){var s=a.nodeType;if(s===1||s===3)break;if(s===8){if(s=a.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return a}var jy=null;function DO(a){a=a.nextSibling;for(var s=0;a;){if(a.nodeType===8){var c=a.data;if(c==="/$"||c==="/&"){if(s===0)return fa(a.nextSibling);s--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||s++}a=a.nextSibling}return null}function MO(a){a=a.previousSibling;for(var s=0;a;){if(a.nodeType===8){var c=a.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(s===0)return a;s--}else c!=="/$"&&c!=="/&"||s++}a=a.previousSibling}return null}function RO(a,s,c){switch(s=im(c),a){case"html":if(a=s.documentElement,!a)throw Error(r(452));return a;case"head":if(a=s.head,!a)throw Error(r(453));return a;case"body":if(a=s.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function xd(a){for(var s=a.attributes;s.length;)a.removeAttributeNode(s[0]);Iu(a)}var ha=new Map,kO=new Set;function om(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Xi=Z.d;Z.d={f:fF,r:hF,D:mF,C:pF,L:bF,m:vF,X:yF,S:gF,M:xF};function fF(){var a=Xi.f(),s=Xh();return a||s}function hF(a){var s=Pi(a);s!==null&&s.tag===5&&s.type==="form"?ZC(s):Xi.r(a)}var hc=typeof document>"u"?null:document;function LO(a,s,c){var m=hc;if(m&&typeof s=="string"&&s){var y=Ge(s);y='link[rel="'+a+'"][href="'+y+'"]',typeof c=="string"&&(y+='[crossorigin="'+c+'"]'),kO.has(y)||(kO.add(y),a={rel:a,crossOrigin:c,href:s},m.querySelector(y)===null&&(s=m.createElement("link"),Hn(s,"link",a),Bt(s),m.head.appendChild(s)))}}function mF(a){Xi.D(a),LO("dns-prefetch",a,null)}function pF(a,s){Xi.C(a,s),LO("preconnect",a,s)}function bF(a,s,c){Xi.L(a,s,c);var m=hc;if(m&&a&&s){var y='link[rel="preload"][as="'+Ge(s)+'"]';s==="image"&&c&&c.imageSrcSet?(y+='[imagesrcset="'+Ge(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(y+='[imagesizes="'+Ge(c.imageSizes)+'"]')):y+='[href="'+Ge(a)+'"]';var w=y;switch(s){case"style":w=mc(a);break;case"script":w=pc(a)}ha.has(w)||(a=b({rel:"preload",href:s==="image"&&c&&c.imageSrcSet?void 0:a,as:s},c),ha.set(w,a),m.querySelector(y)!==null||s==="style"&&m.querySelector(wd(w))||s==="script"&&m.querySelector(Sd(w))||(s=m.createElement("link"),Hn(s,"link",a),Bt(s),m.head.appendChild(s)))}}function vF(a,s){Xi.m(a,s);var c=hc;if(c&&a){var m=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+Ge(m)+'"][href="'+Ge(a)+'"]',w=y;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=pc(a)}if(!ha.has(w)&&(a=b({rel:"modulepreload",href:a},s),ha.set(w,a),c.querySelector(y)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Sd(w)))return}m=c.createElement("link"),Hn(m,"link",a),Bt(m),c.head.appendChild(m)}}}function gF(a,s,c){Xi.S(a,s,c);var m=hc;if(m&&a){var y=Xa(m).hoistableStyles,w=mc(a);s=s||"default";var N=y.get(w);if(!N){var M={loading:0,preload:null};if(N=m.querySelector(wd(w)))M.loading=5;else{a=b({rel:"stylesheet",href:a,"data-precedence":s},c),(c=ha.get(w))&&Cy(a,c);var B=N=m.createElement("link");Bt(B),Hn(B,"link",a),B._p=new Promise(function(X,ae){B.onload=X,B.onerror=ae}),B.addEventListener("load",function(){M.loading|=1}),B.addEventListener("error",function(){M.loading|=2}),M.loading|=4,sm(N,s,m)}N={type:"stylesheet",instance:N,count:1,state:M},y.set(w,N)}}}function yF(a,s){Xi.X(a,s);var c=hc;if(c&&a){var m=Xa(c).hoistableScripts,y=pc(a),w=m.get(y);w||(w=c.querySelector(Sd(y)),w||(a=b({src:a,async:!0},s),(s=ha.get(y))&&Oy(a,s),w=c.createElement("script"),Bt(w),Hn(w,"link",a),c.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},m.set(y,w))}}function xF(a,s){Xi.M(a,s);var c=hc;if(c&&a){var m=Xa(c).hoistableScripts,y=pc(a),w=m.get(y);w||(w=c.querySelector(Sd(y)),w||(a=b({src:a,async:!0,type:"module"},s),(s=ha.get(y))&&Oy(a,s),w=c.createElement("script"),Bt(w),Hn(w,"link",a),c.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},m.set(y,w))}}function IO(a,s,c,m){var y=(y=Oe.current)?om(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(s=mc(c.href),c=Xa(y).hoistableStyles,m=c.get(s),m||(m={type:"style",instance:null,count:0,state:null},c.set(s,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){a=mc(c.href);var w=Xa(y).hoistableStyles,N=w.get(a);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(a,N),(w=y.querySelector(wd(a)))&&!w._p&&(N.instance=w,N.state.loading=5),ha.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},ha.set(a,c),w||wF(y,a,c,N.state))),s&&m===null)throw Error(r(528,""));return N}if(s&&m!==null)throw Error(r(529,""));return null;case"script":return s=c.async,c=c.src,typeof c=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=pc(c),c=Xa(y).hoistableScripts,m=c.get(s),m||(m={type:"script",instance:null,count:0,state:null},c.set(s,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function mc(a){return'href="'+Ge(a)+'"'}function wd(a){return'link[rel="stylesheet"]['+a+"]"}function zO(a){return b({},a,{"data-precedence":a.precedence,precedence:null})}function wF(a,s,c,m){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?m.loading=1:(s=a.createElement("link"),m.preload=s,s.addEventListener("load",function(){return m.loading|=1}),s.addEventListener("error",function(){return m.loading|=2}),Hn(s,"link",c),Bt(s),a.head.appendChild(s))}function pc(a){return'[src="'+Ge(a)+'"]'}function Sd(a){return"script[async]"+a}function UO(a,s,c){if(s.count++,s.instance===null)switch(s.type){case"style":var m=a.querySelector('style[data-href~="'+Ge(c.href)+'"]');if(m)return s.instance=m,Bt(m),m;var y=b({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),Bt(m),Hn(m,"style",y),sm(m,c.precedence,a),s.instance=m;case"stylesheet":y=mc(c.href);var w=a.querySelector(wd(y));if(w)return s.state.loading|=4,s.instance=w,Bt(w),w;m=zO(c),(y=ha.get(y))&&Cy(m,y),w=(a.ownerDocument||a).createElement("link"),Bt(w);var N=w;return N._p=new Promise(function(M,B){N.onload=M,N.onerror=B}),Hn(w,"link",m),s.state.loading|=4,sm(w,c.precedence,a),s.instance=w;case"script":return w=pc(c.src),(y=a.querySelector(Sd(w)))?(s.instance=y,Bt(y),y):(m=c,(y=ha.get(w))&&(m=b({},c),Oy(m,y)),a=a.ownerDocument||a,y=a.createElement("script"),Bt(y),Hn(y,"link",m),a.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(m=s.instance,s.state.loading|=4,sm(m,c.precedence,a));return s.instance}function sm(a,s,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=m.length?m[m.length-1]:null,w=y,N=0;N<m.length;N++){var M=m[N];if(M.dataset.precedence===s)w=M;else if(w!==y)break}w?w.parentNode.insertBefore(a,w.nextSibling):(s=c.nodeType===9?c.head:c,s.insertBefore(a,s.firstChild))}function Cy(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function Oy(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var lm=null;function qO(a,s,c){if(lm===null){var m=new Map,y=lm=new Map;y.set(c,m)}else y=lm,m=y.get(c),m||(m=new Map,y.set(c,m));if(m.has(a))return m;for(m.set(a,null),c=c.getElementsByTagName(a),y=0;y<c.length;y++){var w=c[y];if(!(w[Fr]||w[ln]||a==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var N=w.getAttribute(s)||"";N=a+N;var M=m.get(N);M?M.push(w):m.set(N,[w])}}return m}function BO(a,s,c){a=a.ownerDocument||a,a.head.insertBefore(c,s==="title"?a.querySelector("head > title"):null)}function SF(a,s,c){if(c===1||s.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return a=s.disabled,typeof s.precedence=="string"&&a==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function FO(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function EF(a,s,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var y=mc(m.href),w=s.querySelector(wd(y));if(w){s=w._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(a.count++,a=cm.bind(a),s.then(a,a)),c.state.loading|=4,c.instance=w,Bt(w);return}w=s.ownerDocument||s,m=zO(m),(y=ha.get(y))&&Cy(m,y),w=w.createElement("link"),Bt(w);var N=w;N._p=new Promise(function(M,B){N.onload=M,N.onerror=B}),Hn(w,"link",m),c.instance=w}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(c,s),(s=c.state.preload)&&(c.state.loading&3)===0&&(a.count++,c=cm.bind(a),s.addEventListener("load",c),s.addEventListener("error",c))}}var Ny=0;function AF(a,s){return a.stylesheets&&a.count===0&&dm(a,a.stylesheets),0<a.count||0<a.imgCount?function(c){var m=setTimeout(function(){if(a.stylesheets&&dm(a,a.stylesheets),a.unsuspend){var w=a.unsuspend;a.unsuspend=null,w()}},6e4+s);0<a.imgBytes&&Ny===0&&(Ny=62500*aF());var y=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&dm(a,a.stylesheets),a.unsuspend)){var w=a.unsuspend;a.unsuspend=null,w()}},(a.imgBytes>Ny?50:800)+s);return a.unsuspend=c,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(y)}}:null}function cm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var um=null;function dm(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,um=new Map,s.forEach(jF,a),um=null,cm.call(a))}function jF(a,s){if(!(s.state.loading&4)){var c=um.get(a);if(c)var m=c.get(null);else{c=new Map,um.set(a,c);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<y.length;w++){var N=y[w];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(c.set(N.dataset.precedence,N),m=N)}m&&c.set(null,m)}y=s.instance,N=y.getAttribute("data-precedence"),w=c.get(N)||m,w===m&&c.set(null,y),c.set(N,y),this.count++,m=cm.bind(this),y.addEventListener("load",m),y.addEventListener("error",m),w?w.parentNode.insertBefore(y,w.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),s.state.loading|=4}}var Ed={$$typeof:O,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function CF(a,s,c,m,y,w,N,M,B){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=On(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=On(0),this.hiddenUpdates=On(null),this.identifierPrefix=m,this.onUncaughtError=y,this.onCaughtError=w,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function $O(a,s,c,m,y,w,N,M,B,X,ae,se){return a=new CF(a,s,c,N,B,X,ae,se,M),s=1,w===!0&&(s|=24),w=Kr(3,null,null,s),a.current=w,w.stateNode=a,s=sg(),s.refCount++,a.pooledCache=s,s.refCount++,w.memoizedState={element:m,isDehydrated:c,cache:s},dg(w),a}function KO(a){return a?(a=Gl,a):Gl}function HO(a,s,c,m,y,w){y=KO(y),m.context===null?m.context=y:m.pendingContext=y,m=ko(s),m.payload={element:c},w=w===void 0?null:w,w!==null&&(m.callback=w),c=Lo(a,m,s),c!==null&&(Pr(c,a,s),td(c,a,s))}function GO(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c<s?c:s}}function Ty(a,s){GO(a,s),(a=a.alternate)&&GO(a,s)}function YO(a){if(a.tag===13||a.tag===31){var s=Ms(a,67108864);s!==null&&Pr(s,a,67108864),Ty(a,67108864)}}function WO(a){if(a.tag===13||a.tag===31){var s=Qr();s=Oa(s);var c=Ms(a,s);c!==null&&Pr(c,a,s),Ty(a,s)}}var fm=!0;function OF(a,s,c,m){var y=K.T;K.T=null;var w=Z.p;try{Z.p=2,Py(a,s,c,m)}finally{Z.p=w,K.T=y}}function NF(a,s,c,m){var y=K.T;K.T=null;var w=Z.p;try{Z.p=8,Py(a,s,c,m)}finally{Z.p=w,K.T=y}}function Py(a,s,c,m){if(fm){var y=_y(m);if(y===null)by(a,s,m,hm,c),VO(a,m);else if(PF(y,a,s,c,m))m.stopPropagation();else if(VO(a,m),s&4&&-1<TF.indexOf(a)){for(;y!==null;){var w=Pi(y);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var N=At(w.pendingLanes);if(N!==0){var M=w;for(M.pendingLanes|=2,M.entangledLanes|=2;N;){var B=1<<31-zt(N);M.entanglements[1]|=B,N&=~B}ti(w),(lt&6)===0&&(Qh=Kt()+500,vd(0))}}break;case 31:case 13:M=Ms(w,2),M!==null&&Pr(M,w,2),Xh(),Ty(w,2)}if(w=_y(m),w===null&&by(a,s,m,hm,c),w===y)break;y=w}y!==null&&m.stopPropagation()}else by(a,s,m,null,c)}}function _y(a){return a=Mv(a),Dy(a)}var hm=null;function Dy(a){if(hm=null,a=jo(a),a!==null){var s=o(a);if(s===null)a=null;else{var c=s.tag;if(c===13){if(a=l(s),a!==null)return a;a=null}else if(c===31){if(a=u(s),a!==null)return a;a=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;a=null}else s!==a&&(a=null)}}return hm=a,null}function QO(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ca()){case Eo:return 2;case Ur:return 8;case Cn:case ia:return 32;case Wa:return 268435456;default:return 32}default:return 32}}var My=!1,Yo=null,Wo=null,Qo=null,Ad=new Map,jd=new Map,Vo=[],TF="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function VO(a,s){switch(a){case"focusin":case"focusout":Yo=null;break;case"dragenter":case"dragleave":Wo=null;break;case"mouseover":case"mouseout":Qo=null;break;case"pointerover":case"pointerout":Ad.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":jd.delete(s.pointerId)}}function Cd(a,s,c,m,y,w){return a===null||a.nativeEvent!==w?(a={blockedOn:s,domEventName:c,eventSystemFlags:m,nativeEvent:w,targetContainers:[y]},s!==null&&(s=Pi(s),s!==null&&YO(s)),a):(a.eventSystemFlags|=m,s=a.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),a)}function PF(a,s,c,m,y){switch(s){case"focusin":return Yo=Cd(Yo,a,s,c,m,y),!0;case"dragenter":return Wo=Cd(Wo,a,s,c,m,y),!0;case"mouseover":return Qo=Cd(Qo,a,s,c,m,y),!0;case"pointerover":var w=y.pointerId;return Ad.set(w,Cd(Ad.get(w)||null,a,s,c,m,y)),!0;case"gotpointercapture":return w=y.pointerId,jd.set(w,Cd(jd.get(w)||null,a,s,c,m,y)),!0}return!1}function XO(a){var s=jo(a.target);if(s!==null){var c=o(s);if(c!==null){if(s=c.tag,s===13){if(s=l(c),s!==null){a.blockedOn=s,dr(a.priority,function(){WO(c)});return}}else if(s===31){if(s=u(c),s!==null){a.blockedOn=s,dr(a.priority,function(){WO(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}a.blockedOn=null}function mm(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var c=_y(a.nativeEvent);if(c===null){c=a.nativeEvent;var m=new c.constructor(c.type,c);Dv=m,c.target.dispatchEvent(m),Dv=null}else return s=Pi(c),s!==null&&YO(s),a.blockedOn=c,!1;s.shift()}return!0}function ZO(a,s,c){mm(a)&&c.delete(s)}function _F(){My=!1,Yo!==null&&mm(Yo)&&(Yo=null),Wo!==null&&mm(Wo)&&(Wo=null),Qo!==null&&mm(Qo)&&(Qo=null),Ad.forEach(ZO),jd.forEach(ZO)}function pm(a,s){a.blockedOn===s&&(a.blockedOn=null,My||(My=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,_F)))}var bm=null;function JO(a){bm!==a&&(bm=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bm===a&&(bm=null);for(var s=0;s<a.length;s+=3){var c=a[s],m=a[s+1],y=a[s+2];if(typeof m!="function"){if(Dy(m||c)===null)continue;break}var w=Pi(c);w!==null&&(a.splice(s,3),s-=3,_g(w,{pending:!0,data:y,method:c.method,action:m},m,y))}}))}function bc(a){function s(B){return pm(B,a)}Yo!==null&&pm(Yo,a),Wo!==null&&pm(Wo,a),Qo!==null&&pm(Qo,a),Ad.forEach(s),jd.forEach(s);for(var c=0;c<Vo.length;c++){var m=Vo[c];m.blockedOn===a&&(m.blockedOn=null)}for(;0<Vo.length&&(c=Vo[0],c.blockedOn===null);)XO(c),c.blockedOn===null&&Vo.shift();if(c=(a.ownerDocument||a).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var y=c[m],w=c[m+1],N=y[Tn]||null;if(typeof w=="function")N||JO(c);else if(N){var M=null;if(w&&w.hasAttribute("formAction")){if(y=w,N=w[Tn]||null)M=N.formAction;else if(Dy(y)!==null)continue}else M=N.action;typeof M=="function"?c[m+1]=M:(c.splice(m,3),m-=3),JO(c)}}}function eN(){function a(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(N){return y=N})},focusReset:"manual",scroll:"manual"})}function s(){y!==null&&(y(),y=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,y=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),y!==null&&(y(),y=null)}}}function Ry(a){this._internalRoot=a}vm.prototype.render=Ry.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(r(409));var c=s.current,m=Qr();HO(c,m,a,s,null,null)},vm.prototype.unmount=Ry.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;HO(a.current,2,null,a,null,null),Xh(),s[Ti]=null}};function vm(a){this._internalRoot=a}vm.prototype.unstable_scheduleHydration=function(a){if(a){var s=nt();a={blockedOn:null,target:a,priority:s};for(var c=0;c<Vo.length&&s!==0&&s<Vo[c].priority;c++);Vo.splice(c,0,a),c===0&&XO(a)}};var tN=t.version;if(tN!=="19.2.6")throw Error(r(527,tN,"19.2.6"));Z.findDOMNode=function(a){var s=a._reactInternals;if(s===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=h(s),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var DF={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gm.isDisabled&&gm.supportsFiber)try{Qa=gm.inject(DF),bn=gm}catch{}}return Nd.createRoot=function(a,s){if(!i(a))throw Error(r(299));var c=!1,m="",y=l1,w=c1,N=u1;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError)),s=$O(a,1,!1,null,null,c,m,null,y,w,N,eN),a[Ti]=s.current,py(a),new Ry(s)},Nd.hydrateRoot=function(a,s,c){if(!i(a))throw Error(r(299));var m=!1,y="",w=l1,N=c1,M=u1,B=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(M=c.onRecoverableError),c.formState!==void 0&&(B=c.formState)),s=$O(a,1,!0,s,c??null,m,y,B,w,N,M,eN),s.context=KO(null),c=s.current,m=Qr(),m=Oa(m),y=ko(m),y.callback=null,Lo(c,y,m),c=m,s.current.lanes=c,Er(s,c),ti(s),a[Ti]=s.current,py(a),new vm(s)},Nd.version="19.2.6",Nd}var hN;function KF(){if(hN)return zy.exports;hN=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zy.exports=$F(),zy.exports}var HF=KF(),wu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ol,is,Yc,GR,GF=(GR=class extends wu{constructor(){super();Te(this,ol);Te(this,is);Te(this,Yc);ge(this,Yc,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){F(this,is)||this.setEventListener(F(this,Yc))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,is))==null||t.call(this),ge(this,is,void 0))}setEventListener(t){var n;ge(this,Yc,t),(n=F(this,is))==null||n.call(this),ge(this,is,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){F(this,ol)!==t&&(ge(this,ol,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof F(this,ol)=="boolean"?F(this,ol):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ol=new WeakMap,is=new WeakMap,Yc=new WeakMap,GR),IS=new GF,YF={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},os,kS,YR,WF=(YR=class{constructor(){Te(this,os,YF);Te(this,kS,!1)}setTimeoutProvider(e){ge(this,os,e)}setTimeout(e,t){return F(this,os).setTimeout(e,t)}clearTimeout(e){F(this,os).clearTimeout(e)}setInterval(e,t){return F(this,os).setInterval(e,t)}clearInterval(e){F(this,os).clearInterval(e)}},os=new WeakMap,kS=new WeakMap,YR),tl=new WF;function QF(e){setTimeout(e,0)}var VF=typeof window>"u"||"Deno"in globalThis;function pr(){}function XF(e,t){return typeof e=="function"?e(t):e}function rw(e){return typeof e=="number"&&e>=0&&e!==1/0}function ak(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ps(e,t){return typeof e=="function"?e(t):e}function Xr(e,t){return typeof e=="function"?e(t):e}function mN(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:l,stale:u}=e;if(l){if(r){if(t.queryHash!==zS(l,t.options))return!1}else if(!rf(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||o&&!o(t))}function pN(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(yl(t.options.mutationKey)!==yl(o))return!1}else if(!rf(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function zS(e,t){return((t==null?void 0:t.queryKeyHashFn)||yl)(e)}function yl(e){return JSON.stringify(e,(t,n)=>aw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function rf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>rf(e[n],t[n])):!1}var ZF=Object.prototype.hasOwnProperty;function ik(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=bN(e)&&bN(t);if(!r&&!(aw(e)&&aw(t)))return t;const o=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),u=l.length,f=r?new Array(u):{};let h=0;for(let p=0;p<u;p++){const b=r?p:l[p],g=e[b],x=t[b];if(g===x){f[b]=g,(r?p<o:ZF.call(e,b))&&h++;continue}if(g===null||x===null||typeof g!="object"||typeof x!="object"){f[b]=x;continue}const E=ik(g,x,n+1);f[b]=E,E===g&&h++}return o===u&&h===o?e:f}function dp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function bN(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function aw(e){if(!vN(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!vN(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function vN(e){return Object.prototype.toString.call(e)==="[object Object]"}function JF(e){return new Promise(t=>{tl.setTimeout(t,e)})}function iw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ik(e,t):t}function Pf(e){return e}function e4(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function t4(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var US=Symbol();function ok(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===US?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function qS(e,t){return typeof e=="function"?e(...t):!!e}function n4(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var af=(()=>{let e=()=>VF;return{isServer(){return e()},setIsServer(t){e=t}}})();function ow(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var r4=QF;function a4(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=r4;const o=u=>{t?e.push(u):i(()=>{n(u)})},l=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;t++;try{f=u()}finally{t--,t||l()}return f},batchCalls:u=>(...f)=>{o(()=>{u(...f)})},schedule:o,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Sn=a4(),Wc,ss,Qc,WR,i4=(WR=class extends wu{constructor(){super();Te(this,Wc,!0);Te(this,ss);Te(this,Qc);ge(this,Qc,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){F(this,ss)||this.setEventListener(F(this,Qc))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,ss))==null||t.call(this),ge(this,ss,void 0))}setEventListener(t){var n;ge(this,Qc,t),(n=F(this,ss))==null||n.call(this),ge(this,ss,t(this.setOnline.bind(this)))}setOnline(t){F(this,Wc)!==t&&(ge(this,Wc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return F(this,Wc)}},Wc=new WeakMap,ss=new WeakMap,Qc=new WeakMap,WR),fp=new i4;function o4(e){return Math.min(1e3*2**e,3e4)}function sk(e){return(e??"online")==="online"?fp.isOnline():!0}var sw=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function lk(e){let t=!1,n=0,r;const i=ow(),o=()=>i.status!=="pending",l=S=>{var A;if(!o()){const j=new sw(S);g(j),(A=e.onCancel)==null||A.call(e,j)}},u=()=>{t=!0},f=()=>{t=!1},h=()=>IS.isFocused()&&(e.networkMode==="always"||fp.isOnline())&&e.canRun(),p=()=>sk(e.networkMode)&&e.canRun(),b=S=>{o()||(r==null||r(),i.resolve(S))},g=S=>{o()||(r==null||r(),i.reject(S))},x=()=>new Promise(S=>{var A;r=j=>{(o()||h())&&S(j)},(A=e.onPause)==null||A.call(e)}).then(()=>{var S;r=void 0,o()||(S=e.onContinue)==null||S.call(e)}),E=()=>{if(o())return;let S;const A=n===0?e.initialPromise:void 0;try{S=A??e.fn()}catch(j){S=Promise.reject(j)}Promise.resolve(S).then(b).catch(j=>{var P;if(o())return;const C=e.retry??(af.isServer()?0:3),O=e.retryDelay??o4,T=typeof O=="function"?O(n,j):O,_=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,j);if(t||!_){g(j);return}n++,(P=e.onFail)==null||P.call(e,n,j),JF(T).then(()=>h()?void 0:x()).then(()=>{t?g(j):E()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r==null||r(),i),cancelRetry:u,continueRetry:f,canStart:p,start:()=>(p()?E():x().then(E),i)}}var sl,QR,ck=(QR=class{constructor(){Te(this,sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rw(this.gcTime)&&ge(this,sl,tl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(af.isServer()?1/0:300*1e3))}clearGcTimeout(){F(this,sl)!==void 0&&(tl.clearTimeout(F(this,sl)),ge(this,sl,void 0))}},sl=new WeakMap,QR);function s4(e){return{onFetch:(t,n)=>{var p,b,g,x,E;const r=t.options,i=(g=(b=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:b.fetchMore)==null?void 0:g.direction,o=((x=t.state.data)==null?void 0:x.pages)||[],l=((E=t.state.data)==null?void 0:E.pageParams)||[];let u={pages:[],pageParams:[]},f=0;const h=async()=>{let S=!1;const A=O=>{n4(O,()=>t.signal,()=>S=!0)},j=ok(t.options,t.fetchOptions),C=async(O,T,_)=>{if(S)return Promise.reject(t.signal.reason);if(T==null&&O.pages.length)return Promise.resolve(O);const D=(()=>{const q={client:t.client,queryKey:t.queryKey,pageParam:T,direction:_?"backward":"forward",meta:t.options.meta};return A(q),q})(),L=await j(D),{maxPages:z}=t.options,R=_?t4:e4;return{pages:R(O.pages,L,z),pageParams:R(O.pageParams,T,z)}};if(i&&o.length){const O=i==="backward",T=O?uk:lw,_={pages:o,pageParams:l},P=T(r,_);u=await C(_,P,O)}else{const O=e??o.length;do{const T=f===0?l[0]??r.initialPageParam:lw(r,u);if(f>0&&T==null)break;u=await C(u,T),f++}while(f<O)}return u};t.options.persister?t.fetchFn=()=>{var S,A;return(A=(S=t.options).persister)==null?void 0:A.call(S,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function lw(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function uk(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function l4(e,t){return t?lw(e,t)!=null:!1}function c4(e,t){return!t||!e.getPreviousPageParam?!1:uk(e,t)!=null}var Vc,ll,Xc,ga,cl,_n,jf,ul,Vr,dk,Ji,VR,u4=(VR=class extends ck{constructor(t){super();Te(this,Vr);Te(this,Vc);Te(this,ll);Te(this,Xc);Te(this,ga);Te(this,cl);Te(this,_n);Te(this,jf);Te(this,ul);ge(this,ul,!1),ge(this,jf,t.defaultOptions),this.setOptions(t.options),this.observers=[],ge(this,cl,t.client),ge(this,ga,F(this,cl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ge(this,ll,yN(this.options)),this.state=t.state??F(this,ll),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return F(this,Vc)}get promise(){var t;return(t=F(this,_n))==null?void 0:t.promise}setOptions(t){if(this.options={...F(this,jf),...t},t!=null&&t._type&&ge(this,Vc,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=yN(this.options);n.data!==void 0&&(this.setState(gN(n.data,n.dataUpdatedAt)),ge(this,ll,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,ga).remove(this)}setData(t,n){const r=iw(this.state.data,t,this.options);return Ke(this,Vr,Ji).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Ke(this,Vr,Ji).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=F(this,_n))==null?void 0:r.promise;return(i=F(this,_n))==null||i.cancel(t),n?n.then(pr).catch(pr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,ll)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Xr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===US||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ps(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ak(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,_n))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=F(this,_n))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,ga).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(F(this,_n)&&(F(this,ul)||Ke(this,Vr,dk).call(this)?F(this,_n).cancel({revert:!0}):F(this,_n).cancelRetry()),this.scheduleGc()),F(this,ga).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ke(this,Vr,Ji).call(this,{type:"invalidate"})}async fetch(t,n){var h,p,b,g,x,E,S,A,j,C,O;if(this.state.fetchStatus!=="idle"&&((h=F(this,_n))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(F(this,_n))return F(this,_n).continueRetry(),F(this,_n).promise}if(t&&this.setOptions(t),!this.options.queryFn){const T=this.observers.find(_=>_.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,i=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(ge(this,ul,!0),r.signal)})},o=()=>{const T=ok(this.options,n),P=(()=>{const D={client:F(this,cl),queryKey:this.queryKey,meta:this.meta};return i(D),D})();return ge(this,ul,!1),this.options.persister?this.options.persister(T,P,this):T(P)},u=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:F(this,cl),state:this.state,fetchFn:o};return i(T),T})(),f=F(this,Vc)==="infinite"?s4(this.options.pages):this.options.behavior;f==null||f.onFetch(u,this),ge(this,Xc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=u.fetchOptions)==null?void 0:p.meta))&&Ke(this,Vr,Ji).call(this,{type:"fetch",meta:(b=u.fetchOptions)==null?void 0:b.meta}),ge(this,_n,lk({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:T=>{T instanceof sw&&T.revert&&this.setState({...F(this,Xc),fetchStatus:"idle"}),r.abort()},onFail:(T,_)=>{Ke(this,Vr,Ji).call(this,{type:"failed",failureCount:T,error:_})},onPause:()=>{Ke(this,Vr,Ji).call(this,{type:"pause"})},onContinue:()=>{Ke(this,Vr,Ji).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const T=await F(this,_n).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(x=(g=F(this,ga).config).onSuccess)==null||x.call(g,T,this),(S=(E=F(this,ga).config).onSettled)==null||S.call(E,T,this.state.error,this),T}catch(T){if(T instanceof sw){if(T.silent)return F(this,_n).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw Ke(this,Vr,Ji).call(this,{type:"error",error:T}),(j=(A=F(this,ga).config).onError)==null||j.call(A,T,this),(O=(C=F(this,ga).config).onSettled)==null||O.call(C,this.state.data,T,this),T}finally{this.scheduleGc()}}},Vc=new WeakMap,ll=new WeakMap,Xc=new WeakMap,ga=new WeakMap,cl=new WeakMap,_n=new WeakMap,jf=new WeakMap,ul=new WeakMap,Vr=new WeakSet,dk=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ji=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...fk(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...gN(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ge(this,Xc,t.manual?i:void 0),i;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Sn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),F(this,ga).notify({query:this,type:"updated",action:t})})},VR);function fk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sk(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function gN(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function yN(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Dr,Je,Cf,mr,dl,Zc,to,ls,Of,Jc,eu,fl,hl,cs,tu,ft,Gd,cw,uw,dw,fw,hw,mw,pw,mk,XR,hk=(XR=class extends wu{constructor(t,n){super();Te(this,ft);Te(this,Dr);Te(this,Je);Te(this,Cf);Te(this,mr);Te(this,dl);Te(this,Zc);Te(this,to);Te(this,ls);Te(this,Of);Te(this,Jc);Te(this,eu);Te(this,fl);Te(this,hl);Te(this,cs);Te(this,tu,new Set);this.options=n,ge(this,Dr,t),ge(this,ls,null),ge(this,to,ow()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Je).addObserver(this),xN(F(this,Je),this.options)?Ke(this,ft,Gd).call(this):this.updateResult(),Ke(this,ft,fw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bw(F(this,Je),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bw(F(this,Je),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ke(this,ft,hw).call(this),Ke(this,ft,mw).call(this),F(this,Je).removeObserver(this)}setOptions(t){const n=this.options,r=F(this,Je);if(this.options=F(this,Dr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xr(this.options.enabled,F(this,Je))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ke(this,ft,pw).call(this),F(this,Je).setOptions(this.options),n._defaulted&&!dp(this.options,n)&&F(this,Dr).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Je),observer:this});const i=this.hasListeners();i&&wN(F(this,Je),r,this.options,n)&&Ke(this,ft,Gd).call(this),this.updateResult(),i&&(F(this,Je)!==r||Xr(this.options.enabled,F(this,Je))!==Xr(n.enabled,F(this,Je))||ps(this.options.staleTime,F(this,Je))!==ps(n.staleTime,F(this,Je)))&&Ke(this,ft,cw).call(this);const o=Ke(this,ft,uw).call(this);i&&(F(this,Je)!==r||Xr(this.options.enabled,F(this,Je))!==Xr(n.enabled,F(this,Je))||o!==F(this,cs))&&Ke(this,ft,dw).call(this,o)}getOptimisticResult(t){const n=F(this,Dr).getQueryCache().build(F(this,Dr),t),r=this.createResult(n,t);return f4(this,r)&&(ge(this,mr,r),ge(this,Zc,this.options),ge(this,dl,F(this,Je).state)),r}getCurrentResult(){return F(this,mr)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&F(this,to).status==="pending"&&F(this,to).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){F(this,tu).add(t)}getCurrentQuery(){return F(this,Je)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=F(this,Dr).defaultQueryOptions(t),r=F(this,Dr).getQueryCache().build(F(this,Dr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ke(this,ft,Gd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,mr)))}createResult(t,n){var z;const r=F(this,Je),i=this.options,o=F(this,mr),l=F(this,dl),u=F(this,Zc),h=t!==r?t.state:F(this,Cf),{state:p}=t;let b={...p},g=!1,x;if(n._optimisticResults){const R=this.hasListeners(),q=!R&&xN(t,n),U=R&&wN(t,r,n,i);(q||U)&&(b={...b,...fk(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:E,errorUpdatedAt:S,status:A}=b;x=b.data;let j=!1;if(n.placeholderData!==void 0&&x===void 0&&A==="pending"){let R;o!=null&&o.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(R=o.data,j=!0):R=typeof n.placeholderData=="function"?n.placeholderData((z=F(this,eu))==null?void 0:z.state.data,F(this,eu)):n.placeholderData,R!==void 0&&(A="success",x=iw(o==null?void 0:o.data,R,n),g=!0)}if(n.select&&x!==void 0&&!j)if(o&&x===(l==null?void 0:l.data)&&n.select===F(this,Of))x=F(this,Jc);else try{ge(this,Of,n.select),x=n.select(x),x=iw(o==null?void 0:o.data,x,n),ge(this,Jc,x),ge(this,ls,null)}catch(R){ge(this,ls,R)}F(this,ls)&&(E=F(this,ls),x=F(this,Jc),S=Date.now(),A="error");const C=b.fetchStatus==="fetching",O=A==="pending",T=A==="error",_=O&&C,P=x!==void 0,L={status:A,fetchStatus:b.fetchStatus,isPending:O,isSuccess:A==="success",isError:T,isInitialLoading:_,isLoading:_,data:x,dataUpdatedAt:b.dataUpdatedAt,error:E,errorUpdatedAt:S,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:b.dataUpdateCount>h.dataUpdateCount||b.errorUpdateCount>h.errorUpdateCount,isFetching:C,isRefetching:C&&!O,isLoadingError:T&&!P,isPaused:b.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:T&&P,isStale:BS(t,n),refetch:this.refetch,promise:F(this,to),isEnabled:Xr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const R=L.data!==void 0,q=L.status==="error"&&!R,U=ie=>{q?ie.reject(L.error):R&&ie.resolve(L.data)},re=()=>{const ie=ge(this,to,L.promise=ow());U(ie)},G=F(this,to);switch(G.status){case"pending":t.queryHash===r.queryHash&&U(G);break;case"fulfilled":(q||L.data!==G.value)&&re();break;case"rejected":(!q||L.error!==G.reason)&&re();break}}return L}updateResult(){const t=F(this,mr),n=this.createResult(F(this,Je),this.options);if(ge(this,dl,F(this,Je).state),ge(this,Zc,this.options),F(this,dl).data!==void 0&&ge(this,eu,F(this,Je)),dp(n,t))return;ge(this,mr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!F(this,tu).size)return!0;const l=new Set(o??F(this,tu));return this.options.throwOnError&&l.add("error"),Object.keys(F(this,mr)).some(u=>{const f=u;return F(this,mr)[f]!==t[f]&&l.has(f)})};Ke(this,ft,mk).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ke(this,ft,fw).call(this)}},Dr=new WeakMap,Je=new WeakMap,Cf=new WeakMap,mr=new WeakMap,dl=new WeakMap,Zc=new WeakMap,to=new WeakMap,ls=new WeakMap,Of=new WeakMap,Jc=new WeakMap,eu=new WeakMap,fl=new WeakMap,hl=new WeakMap,cs=new WeakMap,tu=new WeakMap,ft=new WeakSet,Gd=function(t){Ke(this,ft,pw).call(this);let n=F(this,Je).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(pr)),n},cw=function(){Ke(this,ft,hw).call(this);const t=ps(this.options.staleTime,F(this,Je));if(af.isServer()||F(this,mr).isStale||!rw(t))return;const r=ak(F(this,mr).dataUpdatedAt,t)+1;ge(this,fl,tl.setTimeout(()=>{F(this,mr).isStale||this.updateResult()},r))},uw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,Je)):this.options.refetchInterval)??!1},dw=function(t){Ke(this,ft,mw).call(this),ge(this,cs,t),!(af.isServer()||Xr(this.options.enabled,F(this,Je))===!1||!rw(F(this,cs))||F(this,cs)===0)&&ge(this,hl,tl.setInterval(()=>{(this.options.refetchIntervalInBackground||IS.isFocused())&&Ke(this,ft,Gd).call(this)},F(this,cs)))},fw=function(){Ke(this,ft,cw).call(this),Ke(this,ft,dw).call(this,Ke(this,ft,uw).call(this))},hw=function(){F(this,fl)!==void 0&&(tl.clearTimeout(F(this,fl)),ge(this,fl,void 0))},mw=function(){F(this,hl)!==void 0&&(tl.clearInterval(F(this,hl)),ge(this,hl,void 0))},pw=function(){const t=F(this,Dr).getQueryCache().build(F(this,Dr),this.options);if(t===F(this,Je))return;const n=F(this,Je);ge(this,Je,t),ge(this,Cf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},mk=function(t){Sn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(F(this,mr))}),F(this,Dr).getQueryCache().notify({query:F(this,Je),type:"observerResultsUpdated"})})},XR);function d4(e,t){return Xr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Xr(t.retryOnMount,e)===!1)}function xN(e,t){return d4(e,t)||e.state.data!==void 0&&bw(e,t,t.refetchOnMount)}function bw(e,t,n){if(Xr(t.enabled,e)!==!1&&ps(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&BS(e,t)}return!1}function wN(e,t,n,r){return(e!==t||Xr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&BS(e,n)}function BS(e,t){return Xr(t.enabled,e)!==!1&&e.isStaleByTime(ps(t.staleTime,e))}function f4(e,t){return!dp(e.getCurrentResult(),t)}var h4=class extends hk{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var E,S;const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:o,isError:l,isRefetchError:u}=r,f=(S=(E=n.fetchMeta)==null?void 0:E.fetchMore)==null?void 0:S.direction,h=l&&f==="forward",p=i&&f==="forward",b=l&&f==="backward",g=i&&f==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:l4(t,n.data),hasPreviousPage:c4(t,n.data),isFetchNextPageError:h,isFetchingNextPage:p,isFetchPreviousPageError:b,isFetchingPreviousPage:g,isRefetchError:u&&!h&&!b,isRefetching:o&&!p&&!g}}},Nf,si,tr,ml,li,Jo,ZR,m4=(ZR=class extends ck{constructor(t){super();Te(this,li);Te(this,Nf);Te(this,si);Te(this,tr);Te(this,ml);ge(this,Nf,t.client),this.mutationId=t.mutationId,ge(this,tr,t.mutationCache),ge(this,si,[]),this.state=t.state||pk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,si).includes(t)||(F(this,si).push(t),this.clearGcTimeout(),F(this,tr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ge(this,si,F(this,si).filter(n=>n!==t)),this.scheduleGc(),F(this,tr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,si).length||(this.state.status==="pending"?this.scheduleGc():F(this,tr).remove(this))}continue(){var t;return((t=F(this,ml))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,u,f,h,p,b,g,x,E,S,A,j,C,O,T,_,P,D;const n=()=>{Ke(this,li,Jo).call(this,{type:"continue"})},r={client:F(this,Nf),meta:this.options.meta,mutationKey:this.options.mutationKey};ge(this,ml,lk({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,z)=>{Ke(this,li,Jo).call(this,{type:"failed",failureCount:L,error:z})},onPause:()=>{Ke(this,li,Jo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,tr).canRun(this)}));const i=this.state.status==="pending",o=!F(this,ml).canStart();try{if(i)n();else{Ke(this,li,Jo).call(this,{type:"pending",variables:t,isPaused:o}),F(this,tr).config.onMutate&&await F(this,tr).config.onMutate(t,this,r);const z=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,r));z!==this.state.context&&Ke(this,li,Jo).call(this,{type:"pending",context:z,variables:t,isPaused:o})}const L=await F(this,ml).start();return await((h=(f=F(this,tr).config).onSuccess)==null?void 0:h.call(f,L,t,this.state.context,this,r)),await((b=(p=this.options).onSuccess)==null?void 0:b.call(p,L,t,this.state.context,r)),await((x=(g=F(this,tr).config).onSettled)==null?void 0:x.call(g,L,null,this.state.variables,this.state.context,this,r)),await((S=(E=this.options).onSettled)==null?void 0:S.call(E,L,null,t,this.state.context,r)),Ke(this,li,Jo).call(this,{type:"success",data:L}),L}catch(L){try{await((j=(A=F(this,tr).config).onError)==null?void 0:j.call(A,L,t,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((O=(C=this.options).onError)==null?void 0:O.call(C,L,t,this.state.context,r))}catch(z){Promise.reject(z)}try{await((_=(T=F(this,tr).config).onSettled)==null?void 0:_.call(T,void 0,L,this.state.variables,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((D=(P=this.options).onSettled)==null?void 0:D.call(P,void 0,L,t,this.state.context,r))}catch(z){Promise.reject(z)}throw Ke(this,li,Jo).call(this,{type:"error",error:L}),L}finally{F(this,tr).runNext(this)}}},Nf=new WeakMap,si=new WeakMap,tr=new WeakMap,ml=new WeakMap,li=new WeakSet,Jo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Sn.batch(()=>{F(this,si).forEach(r=>{r.onMutationUpdate(t)}),F(this,tr).notify({mutation:this,type:"updated",action:t})})},ZR);function pk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var no,Ma,Tf,JR,p4=(JR=class extends wu{constructor(t={}){super();Te(this,no);Te(this,Ma);Te(this,Tf);this.config=t,ge(this,no,new Set),ge(this,Ma,new Map),ge(this,Tf,0)}build(t,n,r){const i=new m4({client:t,mutationCache:this,mutationId:++ym(this,Tf)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){F(this,no).add(t);const n=xm(t);if(typeof n=="string"){const r=F(this,Ma).get(n);r?r.push(t):F(this,Ma).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(F(this,no).delete(t)){const n=xm(t);if(typeof n=="string"){const r=F(this,Ma).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&F(this,Ma).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=xm(t);if(typeof n=="string"){const r=F(this,Ma).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=xm(t);if(typeof n=="string"){const i=(r=F(this,Ma).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Sn.batch(()=>{F(this,no).forEach(t=>{this.notify({type:"removed",mutation:t})}),F(this,no).clear(),F(this,Ma).clear()})}getAll(){return Array.from(F(this,no))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>pN(n,r))}findAll(t={}){return this.getAll().filter(n=>pN(t,n))}notify(t){Sn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Sn.batch(()=>Promise.all(t.map(n=>n.continue().catch(pr))))}},no=new WeakMap,Ma=new WeakMap,Tf=new WeakMap,JR);function xm(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ro,us,Mr,ao,uo,Jm,vw,ek,b4=(ek=class extends wu{constructor(n,r){super();Te(this,uo);Te(this,ro);Te(this,us);Te(this,Mr);Te(this,ao);ge(this,ro,n),this.setOptions(r),this.bindMethods(),Ke(this,uo,Jm).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=F(this,ro).defaultMutationOptions(n),dp(this.options,r)||F(this,ro).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,Mr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&yl(r.mutationKey)!==yl(this.options.mutationKey)?this.reset():((i=F(this,Mr))==null?void 0:i.state.status)==="pending"&&F(this,Mr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=F(this,Mr))==null||n.removeObserver(this)}onMutationUpdate(n){Ke(this,uo,Jm).call(this),Ke(this,uo,vw).call(this,n)}getCurrentResult(){return F(this,us)}reset(){var n;(n=F(this,Mr))==null||n.removeObserver(this),ge(this,Mr,void 0),Ke(this,uo,Jm).call(this),Ke(this,uo,vw).call(this)}mutate(n,r){var i;return ge(this,ao,r),(i=F(this,Mr))==null||i.removeObserver(this),ge(this,Mr,F(this,ro).getMutationCache().build(F(this,ro),this.options)),F(this,Mr).addObserver(this),F(this,Mr).execute(n)}},ro=new WeakMap,us=new WeakMap,Mr=new WeakMap,ao=new WeakMap,uo=new WeakSet,Jm=function(){var r;const n=((r=F(this,Mr))==null?void 0:r.state)??pk();ge(this,us,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},vw=function(n){Sn.batch(()=>{var r,i,o,l,u,f,h,p;if(F(this,ao)&&this.hasListeners()){const b=F(this,us).variables,g=F(this,us).context,x={client:F(this,ro),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=F(this,ao)).onSuccess)==null||i.call(r,n.data,b,g,x)}catch(E){Promise.reject(E)}try{(l=(o=F(this,ao)).onSettled)==null||l.call(o,n.data,null,b,g,x)}catch(E){Promise.reject(E)}}else if((n==null?void 0:n.type)==="error"){try{(f=(u=F(this,ao)).onError)==null||f.call(u,n.error,b,g,x)}catch(E){Promise.reject(E)}try{(p=(h=F(this,ao)).onSettled)==null||p.call(h,void 0,n.error,b,g,x)}catch(E){Promise.reject(E)}}}this.listeners.forEach(b=>{b(F(this,us))})})},ek),ci,tk,v4=(tk=class extends wu{constructor(t={}){super();Te(this,ci);this.config=t,ge(this,ci,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??zS(i,n);let l=this.get(o);return l||(l=new u4({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){F(this,ci).has(t.queryHash)||(F(this,ci).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=F(this,ci).get(t.queryHash);n&&(t.destroy(),n===t&&F(this,ci).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Sn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,ci).get(t)}getAll(){return[...F(this,ci).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>mN(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>mN(t,r)):n}notify(t){Sn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Sn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Sn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ci=new WeakMap,tk),Qt,ds,fs,nu,ru,hs,au,iu,nk,g4=(nk=class{constructor(e={}){Te(this,Qt);Te(this,ds);Te(this,fs);Te(this,nu);Te(this,ru);Te(this,hs);Te(this,au);Te(this,iu);ge(this,Qt,e.queryCache||new v4),ge(this,ds,e.mutationCache||new p4),ge(this,fs,e.defaultOptions||{}),ge(this,nu,new Map),ge(this,ru,new Map),ge(this,hs,0)}mount(){ym(this,hs)._++,F(this,hs)===1&&(ge(this,au,IS.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,Qt).onFocus())})),ge(this,iu,fp.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,Qt).onOnline())})))}unmount(){var e,t;ym(this,hs)._--,F(this,hs)===0&&((e=F(this,au))==null||e.call(this),ge(this,au,void 0),(t=F(this,iu))==null||t.call(this),ge(this,iu,void 0))}isFetching(e){return F(this,Qt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,ds).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,Qt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=F(this,Qt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ps(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return F(this,Qt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=F(this,Qt).get(r.queryHash),o=i==null?void 0:i.state.data,l=XF(t,o);if(l!==void 0)return F(this,Qt).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Sn.batch(()=>F(this,Qt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=F(this,Qt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=F(this,Qt);Sn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=F(this,Qt);return Sn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Sn.batch(()=>F(this,Qt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(pr).catch(pr)}invalidateQueries(e,t={}){return Sn.batch(()=>(F(this,Qt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Sn.batch(()=>F(this,Qt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(pr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(pr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=F(this,Qt).build(this,t);return n.isStaleByTime(ps(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pr).catch(pr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pr).catch(pr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return fp.isOnline()?F(this,ds).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,Qt)}getMutationCache(){return F(this,ds)}getDefaultOptions(){return F(this,fs)}setDefaultOptions(e){ge(this,fs,e)}setQueryDefaults(e,t){F(this,nu).set(yl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,nu).values()],n={};return t.forEach(r=>{rf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){F(this,ru).set(yl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,ru).values()],n={};return t.forEach(r=>{rf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,fs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=zS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===US&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,fs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,Qt).clear(),F(this,ds).clear()}},Qt=new WeakMap,ds=new WeakMap,fs=new WeakMap,nu=new WeakMap,ru=new WeakMap,hs=new WeakMap,au=new WeakMap,iu=new WeakMap,nk),bk=v.createContext(void 0),Ne=e=>{const t=v.useContext(bk);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},y4=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(bk.Provider,{value:e,children:t})),vk=v.createContext(!1),x4=()=>v.useContext(vk);vk.Provider;function w4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var S4=v.createContext(w4()),E4=()=>v.useContext(S4),A4=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?qS(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},j4=e=>{v.useEffect(()=>{e.clearReset()},[e])},C4=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||qS(n,[e.error,r])),O4=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},N4=(e,t)=>e.isLoading&&e.isFetching&&!t,T4=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,SN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function gk(e,t,n){var g,x,E,S;const r=x4(),i=E4(),o=Ne(),l=o.defaultQueryOptions(e);(x=(g=o.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||x.call(g,l);const u=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",O4(l),A4(l,i,u),j4(i);const f=!o.getQueryCache().get(l.queryHash),[h]=v.useState(()=>new t(o,l)),p=h.getOptimisticResult(l),b=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(A=>{const j=b?h.subscribe(Sn.batchCalls(A)):pr;return h.updateResult(),j},[h,b]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),v.useEffect(()=>{h.setOptions(l)},[l,h]),T4(l,p))throw SN(l,h,i);if(C4({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;if((S=(E=o.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||S.call(E,l,p),l.experimental_prefetchInRender&&!af.isServer()&&N4(p,r)){const A=f?SN(l,h,i):u==null?void 0:u.promise;A==null||A.catch(pr).finally(()=>{h.updateResult()})}return l.notifyOnChangeProps?p:h.trackResult(p)}function Et(e,t){return gk(e,hk)}function je(e,t){const n=Ne(),[r]=v.useState(()=>new b4(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(l=>r.subscribe(Sn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((l,u)=>{r.mutate(l,u).catch(pr)},[r]);if(i.error&&qS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function xb(e,t){return gk(e,h4)}const yk=new Set(["overview","chatbot","content","forms","leads","conversations","integrations"]);function EN(){const t=new URL(window.location.href).searchParams.get("tab");return t&&yk.has(t)?t:"overview"}const Fy="bb:tab-change";function xk(){const[e,t]=v.useState(EN);v.useEffect(()=>{const r=()=>t(EN());return window.addEventListener("popstate",r),window.addEventListener(Fy,r),()=>{window.removeEventListener("popstate",r),window.removeEventListener(Fy,r)}},[]);const n=v.useCallback(r=>{if(!yk.has(r))return;const i=new URL(window.location.href);i.searchParams.get("tab")!==r&&(i.searchParams.set("tab",r),window.history.pushState({},"",i),t(r),window.dispatchEvent(new Event(Fy)))},[]);return[e,n]}function Re(){const e=window.bitbotAdminConfig;if(!e)throw new Error("bitbotAdminConfig is missing. Ensure wp_localize_script ran (WP admin) or that index.html sets window.bitbotAdminConfig (dev).");return e}function wk(e){return e==="pro_plus"?"Agent":e==="pro"?"Assistant":"Free"}function P4(e){return e==="pro_plus"}var Vn=rk();const _4=Ei(Vn);function Rn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function AN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Sk(...e){return t=>{let n=!1;const r=e.map(i=>{const o=AN(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():AN(e[i],null)}}}}function Ua(...e){return v.useCallback(Sk(...e),e)}function D4(e,t){const n=v.createContext(t),r=o=>{const{children:l,...u}=o,f=v.useMemo(()=>u,Object.values(u));return d.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function i(o){const l=v.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function FS(e,t=[]){let n=[];function r(o,l){const u=v.createContext(l),f=n.length;n=[...n,l];const h=b=>{var j;const{scope:g,children:x,...E}=b,S=((j=g==null?void 0:g[e])==null?void 0:j[f])||u,A=v.useMemo(()=>E,Object.values(E));return d.jsx(S.Provider,{value:A,children:x})};h.displayName=o+"Provider";function p(b,g){var S;const x=((S=g==null?void 0:g[e])==null?void 0:S[f])||u,E=v.useContext(x);if(E)return E;if(l!==void 0)return l;throw new Error(`\`${b}\` must be used within \`${o}\``)}return[h,p]}const i=()=>{const o=n.map(l=>v.createContext(l));return function(u){const f=(u==null?void 0:u[e])||o;return v.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[r,M4(i,...t)]}function M4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((u,{useScope:f,scopeName:h})=>{const b=f(o)[`__scope${h}`];return{...u,...b}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function hp(e){const t=R4(e),n=v.forwardRef((r,i)=>{const{children:o,...l}=r,u=v.Children.toArray(o),f=u.find(L4);if(f){const h=f.props.children,p=u.map(b=>b===f?v.Children.count(h)>1?v.Children.only(null):v.isValidElement(h)?h.props.children:null:b);return d.jsx(t,{...l,ref:i,children:v.isValidElement(h)?v.cloneElement(h,void 0,p):null})}return d.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function R4(e){const t=v.forwardRef((n,r)=>{const{children:i,...o}=n;if(v.isValidElement(i)){const l=z4(i),u=I4(o,i.props);return i.type!==v.Fragment&&(u.ref=r?Sk(r,l):l),v.cloneElement(i,u)}return v.Children.count(i)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var k4=Symbol("radix.slottable");function L4(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k4}function I4(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function z4(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function U4(e){const t=e+"CollectionProvider",[n,r]=FS(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:A,children:j}=S,C=Zt.useRef(null),O=Zt.useRef(new Map).current;return d.jsx(i,{scope:A,itemMap:O,collectionRef:C,children:j})};l.displayName=t;const u=e+"CollectionSlot",f=hp(u),h=Zt.forwardRef((S,A)=>{const{scope:j,children:C}=S,O=o(u,j),T=Ua(A,O.collectionRef);return d.jsx(f,{ref:T,children:C})});h.displayName=u;const p=e+"CollectionItemSlot",b="data-radix-collection-item",g=hp(p),x=Zt.forwardRef((S,A)=>{const{scope:j,children:C,...O}=S,T=Zt.useRef(null),_=Ua(A,T),P=o(p,j);return Zt.useEffect(()=>(P.itemMap.set(T,{ref:T,...O}),()=>void P.itemMap.delete(T))),d.jsx(g,{[b]:"",ref:_,children:C})});x.displayName=p;function E(S){const A=o(e+"CollectionConsumer",S);return Zt.useCallback(()=>{const C=A.collectionRef.current;if(!C)return[];const O=Array.from(C.querySelectorAll(`[${b}]`));return Array.from(A.itemMap.values()).sort((P,D)=>O.indexOf(P.ref.current)-O.indexOf(D.ref.current))},[A.collectionRef,A.itemMap])}return[{Provider:l,Slot:h,ItemSlot:x},E,r]}var q4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sr=q4.reduce((e,t)=>{const n=hp(`Primitive.${t}`),r=v.forwardRef((i,o)=>{const{asChild:l,...u}=i,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(f,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ek(e,t){e&&Vn.flushSync(()=>e.dispatchEvent(t))}function fo(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function B4(e,t=globalThis==null?void 0:globalThis.document){const n=fo(e);v.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var F4="DismissableLayer",gw="dismissableLayer.update",$4="dismissableLayer.pointerDownOutside",K4="dismissableLayer.focusOutside",jN,Ak=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$S=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...f}=e,h=v.useContext(Ak),[p,b]=v.useState(null),g=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=v.useState({}),E=Ua(t,D=>b(D)),S=Array.from(h.layers),[A]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),j=S.indexOf(A),C=p?S.indexOf(p):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,T=C>=j,_=G4(D=>{const L=D.target,z=[...h.branches].some(R=>R.contains(L));!T||z||(i==null||i(D),l==null||l(D),D.defaultPrevented||u==null||u())},g),P=Y4(D=>{const L=D.target;[...h.branches].some(R=>R.contains(L))||(o==null||o(D),l==null||l(D),D.defaultPrevented||u==null||u())},g);return B4(D=>{C===h.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&u&&(D.preventDefault(),u()))},g),v.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(jN=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),CN(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=jN)}},[p,g,n,h]),v.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),CN())},[p,h]),v.useEffect(()=>{const D=()=>x({});return document.addEventListener(gw,D),()=>document.removeEventListener(gw,D)},[]),d.jsx(sr.div,{...f,ref:E,style:{pointerEvents:O?T?"auto":"none":void 0,...e.style},onFocusCapture:Rn(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Rn(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Rn(e.onPointerDownCapture,_.onPointerDownCapture)})});$S.displayName=F4;var H4="DismissableLayerBranch",jk=v.forwardRef((e,t)=>{const n=v.useContext(Ak),r=v.useRef(null),i=Ua(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(sr.div,{...e,ref:i})});jk.displayName=H4;function G4(e,t=globalThis==null?void 0:globalThis.document){const n=fo(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let f=function(){Ck($4,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Y4(e,t=globalThis==null?void 0:globalThis.document){const n=fo(e),r=v.useRef(!1);return v.useEffect(()=>{const i=o=>{o.target&&!r.current&&Ck(K4,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function CN(){const e=new CustomEvent(gw);document.dispatchEvent(e)}function Ck(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ek(i,o):i.dispatchEvent(o)}var W4=$S,Q4=jk,ou=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},V4="Portal",KS=v.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[i,o]=v.useState(!1);ou(()=>o(!0),[]);const l=n||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?_4.createPortal(d.jsx(sr.div,{...r,ref:t}),l):null});KS.displayName=V4;function X4(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var _f=e=>{const{present:t,children:n}=e,r=Z4(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Ua(r.ref,J4(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};_f.displayName="Presence";function Z4(e){const[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),o=v.useRef("none"),l=e?"mounted":"unmounted",[u,f]=X4(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const h=wm(r.current);o.current=u==="mounted"?h:"none"},[u]),ou(()=>{const h=r.current,p=i.current;if(p!==e){const g=o.current,x=wm(h);e?f("MOUNT"):x==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(p&&g!==x?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),ou(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,b=x=>{const S=wm(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&S&&(f("ANIMATION_END"),!i.current)){const A=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=A)})}},g=x=>{x.target===t&&(o.current=wm(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",b),t.addEventListener("animationend",b),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",b),t.removeEventListener("animationend",b)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:v.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function wm(e){return(e==null?void 0:e.animationName)||"none"}function J4(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var e$=LS[" useInsertionEffect ".trim().toString()]||ou;function Ok({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=t$({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:i;{const p=v.useRef(e!==void 0);v.useEffect(()=>{const b=p.current;b!==u&&console.warn(`${r} is changing from ${b?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const h=v.useCallback(p=>{var b;if(u){const g=n$(p)?p(e):p;g!==e&&((b=l.current)==null||b.call(l,g))}else o(p)},[u,e,o,l]);return[f,h]}function t$({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),i=v.useRef(n),o=v.useRef(t);return e$(()=>{o.current=t},[t]),v.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function n$(e){return typeof e=="function"}var r$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),a$="VisuallyHidden",HS=v.forwardRef((e,t)=>d.jsx(sr.span,{...e,ref:t,style:{...r$,...e.style}}));HS.displayName=a$;var GS="ToastProvider",[YS,i$,o$]=U4("Toast"),[Nk]=FS("Toast",[o$]),[s$,wb]=Nk(GS),Tk=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:l}=e,[u,f]=v.useState(null),[h,p]=v.useState(0),b=v.useRef(!1),g=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${GS}\`. Expected non-empty \`string\`.`),d.jsx(YS.Provider,{scope:t,children:d.jsx(s$,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:o,toastCount:h,viewport:u,onViewportChange:f,onToastAdd:v.useCallback(()=>p(x=>x+1),[]),onToastRemove:v.useCallback(()=>p(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:b,isClosePausedRef:g,children:l})})};Tk.displayName=GS;var Pk="ToastViewport",l$=["F8"],yw="toast.viewportPause",xw="toast.viewportResume",_k=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=l$,label:i="Notifications ({hotkey})",...o}=e,l=wb(Pk,n),u=i$(n),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),b=v.useRef(null),g=Ua(t,b,l.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=l.toastCount>0;v.useEffect(()=>{const A=j=>{var O;r.length!==0&&r.every(T=>j[T]||j.code===T)&&((O=b.current)==null||O.focus())};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[r]),v.useEffect(()=>{const A=f.current,j=b.current;if(E&&A&&j){const C=()=>{if(!l.isClosePausedRef.current){const P=new CustomEvent(yw);j.dispatchEvent(P),l.isClosePausedRef.current=!0}},O=()=>{if(l.isClosePausedRef.current){const P=new CustomEvent(xw);j.dispatchEvent(P),l.isClosePausedRef.current=!1}},T=P=>{!A.contains(P.relatedTarget)&&O()},_=()=>{A.contains(document.activeElement)||O()};return A.addEventListener("focusin",C),A.addEventListener("focusout",T),A.addEventListener("pointermove",C),A.addEventListener("pointerleave",_),window.addEventListener("blur",C),window.addEventListener("focus",O),()=>{A.removeEventListener("focusin",C),A.removeEventListener("focusout",T),A.removeEventListener("pointermove",C),A.removeEventListener("pointerleave",_),window.removeEventListener("blur",C),window.removeEventListener("focus",O)}}},[E,l.isClosePausedRef]);const S=v.useCallback(({tabbingDirection:A})=>{const C=u().map(O=>{const T=O.ref.current,_=[T,...S$(T)];return A==="forwards"?_:_.reverse()});return(A==="forwards"?C.reverse():C).flat()},[u]);return v.useEffect(()=>{const A=b.current;if(A){const j=C=>{var _,P,D;const O=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!O){const L=document.activeElement,z=C.shiftKey;if(C.target===A&&z){(_=h.current)==null||_.focus();return}const U=S({tabbingDirection:z?"backwards":"forwards"}),re=U.findIndex(G=>G===L);$y(U.slice(re+1))?C.preventDefault():z?(P=h.current)==null||P.focus():(D=p.current)==null||D.focus()}};return A.addEventListener("keydown",j),()=>A.removeEventListener("keydown",j)}},[u,S]),d.jsxs(Q4,{ref:f,role:"region","aria-label":i.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:E?void 0:"none"},children:[E&&d.jsx(ww,{ref:h,onFocusFromOutsideViewport:()=>{const A=S({tabbingDirection:"forwards"});$y(A)}}),d.jsx(YS.Slot,{scope:n,children:d.jsx(sr.ol,{tabIndex:-1,...o,ref:g})}),E&&d.jsx(ww,{ref:p,onFocusFromOutsideViewport:()=>{const A=S({tabbingDirection:"backwards"});$y(A)}})]})});_k.displayName=Pk;var Dk="ToastFocusProxy",ww=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,o=wb(Dk,n);return d.jsx(HS,{tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:l=>{var h;const u=l.relatedTarget;!((h=o.viewport)!=null&&h.contains(u))&&r()}})});ww.displayName=Dk;var Df="Toast",c$="toast.swipeStart",u$="toast.swipeMove",d$="toast.swipeCancel",f$="toast.swipeEnd",Mk=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:o,...l}=e,[u,f]=Ok({prop:r,defaultProp:i??!0,onChange:o,caller:Df});return d.jsx(_f,{present:n||u,children:d.jsx(p$,{open:u,...l,ref:t,onClose:()=>f(!1),onPause:fo(e.onPause),onResume:fo(e.onResume),onSwipeStart:Rn(e.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Rn(e.onSwipeMove,h=>{const{x:p,y:b}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${b}px`)}),onSwipeCancel:Rn(e.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Rn(e.onSwipeEnd,h=>{const{x:p,y:b}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${b}px`),f(!1)})})})});Mk.displayName=Df;var[h$,m$]=Nk(Df,{onClose(){}}),p$=v.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:o,onClose:l,onEscapeKeyDown:u,onPause:f,onResume:h,onSwipeStart:p,onSwipeMove:b,onSwipeCancel:g,onSwipeEnd:x,...E}=e,S=wb(Df,n),[A,j]=v.useState(null),C=Ua(t,G=>j(G)),O=v.useRef(null),T=v.useRef(null),_=i||S.duration,P=v.useRef(0),D=v.useRef(_),L=v.useRef(0),{onToastAdd:z,onToastRemove:R}=S,q=fo(()=>{var ie;(A==null?void 0:A.contains(document.activeElement))&&((ie=S.viewport)==null||ie.focus()),l()}),U=v.useCallback(G=>{!G||G===1/0||(window.clearTimeout(L.current),P.current=new Date().getTime(),L.current=window.setTimeout(q,G))},[q]);v.useEffect(()=>{const G=S.viewport;if(G){const ie=()=>{U(D.current),h==null||h()},K=()=>{const Z=new Date().getTime()-P.current;D.current=D.current-Z,window.clearTimeout(L.current),f==null||f()};return G.addEventListener(yw,K),G.addEventListener(xw,ie),()=>{G.removeEventListener(yw,K),G.removeEventListener(xw,ie)}}},[S.viewport,_,f,h,U]),v.useEffect(()=>{o&&!S.isClosePausedRef.current&&U(_)},[o,_,S.isClosePausedRef,U]),v.useEffect(()=>(z(),()=>R()),[z,R]);const re=v.useMemo(()=>A?qk(A):null,[A]);return S.viewport?d.jsxs(d.Fragment,{children:[re&&d.jsx(b$,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:re}),d.jsx(h$,{scope:n,onClose:q,children:Vn.createPortal(d.jsx(YS.ItemSlot,{scope:n,children:d.jsx(W4,{asChild:!0,onEscapeKeyDown:Rn(u,()=>{S.isFocusedToastEscapeKeyDownRef.current||q(),S.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx(sr.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":S.swipeDirection,...E,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Rn(e.onKeyDown,G=>{G.key==="Escape"&&(u==null||u(G.nativeEvent),G.nativeEvent.defaultPrevented||(S.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:Rn(e.onPointerDown,G=>{G.button===0&&(O.current={x:G.clientX,y:G.clientY})}),onPointerMove:Rn(e.onPointerMove,G=>{if(!O.current)return;const ie=G.clientX-O.current.x,K=G.clientY-O.current.y,Z=!!T.current,$=["left","right"].includes(S.swipeDirection),ee=["left","up"].includes(S.swipeDirection)?Math.min:Math.max,pe=$?ee(0,ie):0,k=$?0:ee(0,K),Q=G.pointerType==="touch"?10:2,ce={x:pe,y:k},fe={originalEvent:G,delta:ce};Z?(T.current=ce,Sm(u$,b,fe,{discrete:!1})):ON(ce,S.swipeDirection,Q)?(T.current=ce,Sm(c$,p,fe,{discrete:!1}),G.target.setPointerCapture(G.pointerId)):(Math.abs(ie)>Q||Math.abs(K)>Q)&&(O.current=null)}),onPointerUp:Rn(e.onPointerUp,G=>{const ie=T.current,K=G.target;if(K.hasPointerCapture(G.pointerId)&&K.releasePointerCapture(G.pointerId),T.current=null,O.current=null,ie){const Z=G.currentTarget,$={originalEvent:G,delta:ie};ON(ie,S.swipeDirection,S.swipeThreshold)?Sm(f$,x,$,{discrete:!0}):Sm(d$,g,$,{discrete:!0}),Z.addEventListener("click",ee=>ee.preventDefault(),{once:!0})}})})})}),S.viewport)})]}):null}),b$=e=>{const{__scopeToast:t,children:n,...r}=e,i=wb(Df,t),[o,l]=v.useState(!1),[u,f]=v.useState(!1);return x$(()=>l(!0)),v.useEffect(()=>{const h=window.setTimeout(()=>f(!0),1e3);return()=>window.clearTimeout(h)},[]),u?null:d.jsx(KS,{asChild:!0,children:d.jsx(HS,{...r,children:o&&d.jsxs(d.Fragment,{children:[i.label," ",n]})})})},v$="ToastTitle",Rk=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return d.jsx(sr.div,{...r,ref:t})});Rk.displayName=v$;var g$="ToastDescription",kk=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return d.jsx(sr.div,{...r,ref:t})});kk.displayName=g$;var Lk="ToastAction",y$=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?d.jsx(Uk,{altText:n,asChild:!0,children:d.jsx(zk,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Lk}\`. Expected non-empty \`string\`.`),null)});y$.displayName=Lk;var Ik="ToastClose",zk=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=m$(Ik,n);return d.jsx(Uk,{asChild:!0,children:d.jsx(sr.button,{type:"button",...r,ref:t,onClick:Rn(e.onClick,i.onClose)})})});zk.displayName=Ik;var Uk=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return d.jsx(sr.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function qk(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),w$(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const l=r.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...qk(r))}}),t}function Sm(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ek(i,o):i.dispatchEvent(o)}var ON=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),o=r>i;return t==="left"||t==="right"?o&&r>n:!o&&i>n};function x$(e=()=>{}){const t=fo(e);ou(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function w$(e){return e.nodeType===e.ELEMENT_NODE}function S$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $y(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var E$=Tk,A$=_k,j$=Mk,C$=Rk,O$=kk;const Sw=new Set;let N$=0;function Ky(e,t,n){const r={id:++N$,kind:e,title:t,description:n};Sw.forEach(i=>i(r))}const le={success:(e,t)=>Ky("success",e,t),error:(e,t)=>Ky("error",e,t),info:(e,t)=>Ky("info",e,t)},NN=3;function T$({children:e}){const[t,n]=v.useState([]);v.useEffect(()=>{const i=o=>n(l=>{const u=l.findIndex(h=>h.kind===o.kind&&h.title===o.title);if(u>=0){const h=l.slice();return h[u]=o,h}const f=[...l,o];return f.length>NN?f.slice(f.length-NN):f});return Sw.add(i),()=>{Sw.delete(i)}},[]);const r=v.useCallback(i=>{n(o=>o.filter(l=>l.id!==i))},[]);return d.jsxs(E$,{swipeDirection:"right",duration:5e3,children:[e,t.map(i=>d.jsxs(j$,{className:`bb-toast bb-toast-${i.kind}`,onOpenChange:o=>{o||r(i.id)},children:[d.jsx(C$,{className:"bb-toast-title",children:i.title}),i.description&&d.jsx(O$,{className:"bb-toast-description",children:i.description})]},i.id)),d.jsx(A$,{className:"bb-toast-viewport"})]})}const P$="modulepreload",_$=function(e){return"/"+e},TN={},D$=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));i=l(n.map(h=>{if(h=_$(h),h in TN)return;TN[h]=!0;const p=h.endsWith(".css"),b=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${b}`))return;const g=document.createElement("link");if(g.rel=p?"stylesheet":P$,p||(g.as="script"),g.crossOrigin="",g.href=h,f&&g.setAttribute("nonce",f),document.head.appendChild(g),p)return new Promise((x,E)=>{g.addEventListener("load",x),g.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return i.then(l=>{for(const u of l||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};let su=null,PN=!1;function M$(){if(PN)return;PN=!0;const e=(()=>{try{return Re()}catch{return null}})();if(!e)return;const t=e.posthogKey??"",n=e.posthogHost??"https://us.i.posthog.com";if(!t){console.info("[BitBot telemetry] No PostHog key configured. Events log to console only.");return}D$(()=>import("./module.js"),[]).then(r=>{su=r.default,su.init(t,{api_host:n,autocapture:!0,capture_pageview:!0,capture_pageleave:!0,session_recording:{maskAllInputs:!1,maskTextSelector:"[data-ph-mask]"},respect_dnt:!0,persistence:"localStorage",loaded:i=>{const o=k$(e.siteUrl),l=L$(e.apiUrl);i.identify(o,{site_url:e.siteUrl,plan:e.plan,plugin_version:e.pluginVersion}),i.register({plan:e.plan,plugin_version:e.pluginVersion,site_domain:o,environment:l});for(const u of lu)i.capture(u.name,u.props);lu.length=0}})}).catch(r=>{console.warn("[BitBot telemetry] PostHog SDK failed to load:",r)})}const lu=[],Bk=50;function Ra(e,t){console.log(`[BitBot telemetry] ${e}`,t??{}),su?su.capture(e,t):Fk()&&lu.length<Bk&&lu.push({name:e,props:t})}function R$(e,t){const n=e instanceof Error?e.message:String(e),r=e instanceof Error?e.stack:void 0;console.error("[BitBot exception]",n,{context:t,stack:r}),su?su.capture("$exception",{$exception_message:n,$exception_type:e instanceof Error?e.name:"Unknown",$exception_stack_trace_raw:r,...t}):Fk()&&lu.length<Bk&&lu.push({name:"$exception",props:{$exception_message:n,$exception_type:e instanceof Error?e.name:"Unknown",$exception_stack_trace_raw:r,...t}})}function Fk(){try{return!!Re().posthogKey}catch{return!1}}function k$(e){try{return new URL(e).host}catch{return e}}function L$(e){try{const t=new URL(e).host;return t.startsWith("dev.")?"dev":t==="youami.ai"?"prod":t.startsWith("localhost")||t.startsWith("127.")?"local":"other"}catch{return"other"}}const Ew="bitbot:auth-error";function I$(e){typeof window<"u"&&window.dispatchEvent(new CustomEvent(Ew,{detail:{error:e}}))}async function me(e,t={}){const n=Re(),r=performance.now();let i;try{i=await fetch(n.apiUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({_tag:e,apiKey:n.apiKey,...t})})}catch(l){const u=l instanceof Error?l.message:"Network error";return Ra("rpc_failure",{tag:e,kind:"network",error:u}),{success:!1,error:u}}let o;try{o=await i.json()}catch{const l=`Non-JSON response from ${e} (HTTP ${i.status})`;return Ra("rpc_failure",{tag:e,kind:"non_json",http_status:i.status}),{success:!1,error:l}}if(o&&typeof o=="object"){const l=o;if(l._tag==="Failure")return Ra("rpc_failure",{tag:e,kind:"server",http_status:i.status,error:l.error}),l.error&&/invalid api key/i.test(l.error)&&I$(l.error),{success:!1,error:l.error??"Unknown error"};if(l._tag==="Success"&&l.value!==void 0){const u=performance.now()-r;return u>2e3&&Ra("rpc_success_slow",{tag:e,ms:Math.round(u)}),{success:!0,data:l.value}}}return i.ok?{success:!0,data:o}:(Ra("rpc_failure",{tag:e,kind:"http",http_status:i.status}),{success:!1,error:`HTTP ${i.status} from ${e}`})}async function z$(e){const t=Re();try{const n=await fetch(`${t.restUrl}${e}`,{method:"GET",headers:{"X-WP-Nonce":t.nonce,Accept:"application/json"},credentials:"same-origin"});return n.ok?{success:!0,data:await n.json()}:(Ra("rest_failure",{path:e,method:"GET",http_status:n.status}),{success:!1,error:`HTTP ${n.status}`})}catch(n){const r=n instanceof Error?n.message:"Network error";return Ra("rest_failure",{path:e,method:"GET",kind:"network",error:r}),{success:!1,error:r}}}async function U$(e,t){const n=Re();try{const r=await fetch(`${n.restUrl}${e}`,{method:"POST",headers:{"X-WP-Nonce":n.nonce,"Content-Type":"application/json",Accept:"application/json"},credentials:"same-origin",body:JSON.stringify(t)});return r.ok?{success:!0,data:await r.json()}:(Ra("rest_failure",{path:e,method:"POST",http_status:r.status}),{success:!1,error:`HTTP ${r.status}`})}catch(r){const i=r instanceof Error?r.message:"Network error";return Ra("rest_failure",{path:e,method:"POST",kind:"network",error:i}),{success:!1,error:i}}}function WS(){return Et({queryKey:["overview-insights"],queryFn:async()=>{const e=await me("GetOverviewInsights");if(!e.success)throw new Error(e.error);return e.data},staleTime:120*1e3})}function Mf({open:e,title:t,aside:n,onClose:r,children:i}){return v.useEffect(()=>{if(!e)return;const o=l=>{l.key==="Escape"&&r()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e,r]),e?d.jsx("div",{className:"bb-modal-backdrop",onClick:r,children:d.jsxs("div",{className:"bb-modal",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true",children:[d.jsxs("header",{className:"bb-modal-head",children:[d.jsxs("div",{className:"bb-modal-titles",children:[d.jsx("h3",{className:"bb-modal-title",children:t}),n&&d.jsx("span",{className:"bb-modal-aside",children:n})]}),d.jsx("button",{className:"bb-modal-close",onClick:r,"aria-label":"Close",children:"×"})]}),d.jsx("div",{className:"bb-modal-body",children:i})]})}):null}function q$(e,t){if(e===0&&t===0)return{label:"no activity yet",tone:"flat"};if(t===0)return{label:"new — no prior data",tone:"up"};const n=Math.round((e-t)/t*100);return n===0?{label:"flat vs prior 7d",tone:"flat"}:n>0?{label:`↑${n}% vs prior 7d`,tone:"up"}:{label:`↓${Math.abs(n)}% vs prior 7d`,tone:"down"}}const QS="Not enough chat yet. Cards fill in once visitors start engaging.";function Su({onClick:e,label:t="View all"}){return d.jsxs("button",{type:"button",className:"bb-insight-viewall",onClick:e,children:[t," →"]})}function $k(e){const t=new URL(window.location.href);t.searchParams.set("tab",e),window.history.pushState({},"",t),window.dispatchEvent(new PopStateEvent("popstate"))}function B$({pages:e}){const[t,n]=v.useState(!1),r=i=>i.servedCount>0?Math.round(i.clickCount/i.servedCount*100):0;return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Top cited pages"}),d.jsx("span",{className:"bb-insight-aside",children:"what the bot leans on"})]}),e.length===0?d.jsx("p",{className:"bb-insight-empty",children:QS}):d.jsxs(d.Fragment,{children:[d.jsx("ul",{className:"bb-insight-pages",children:e.slice(0,3).map((i,o)=>d.jsxs("li",{className:"bb-insight-page",children:[d.jsxs("div",{className:"bb-insight-page-head",children:[d.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"bb-insight-page-title",children:i.title??i.url}),d.jsxs("span",{className:"bb-insight-page-served",children:[i.servedCount,"×"]})]}),d.jsxs("div",{className:"bb-insight-page-foot",children:[d.jsx("span",{className:"bb-insight-page-url",children:i.url}),d.jsxs("span",{className:"bb-insight-page-ctr",children:[r(i),"% CTR"]})]})]},o))}),e.length>3&&d.jsx(Su,{onClick:()=>n(!0)})]}),d.jsx(Mf,{open:t,title:"All cited pages",aside:`${e.length} pages · last 7d`,onClose:()=>n(!1),children:d.jsx("ol",{className:"bb-modal-list",children:e.map((i,o)=>d.jsxs("li",{className:"bb-modal-row",children:[d.jsx("span",{className:"bb-modal-rank",children:o+1}),d.jsxs("div",{className:"bb-modal-body-col",children:[d.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"bb-modal-row-title",children:i.title??i.url}),d.jsx("span",{className:"bb-modal-row-sub",children:i.url})]}),d.jsxs("span",{className:"bb-modal-row-count",children:[i.servedCount,"× · ",r(i),"% CTR"]})]},o))})})]})}function F$({gaps:e}){const[t,n]=v.useState(!1),r=i=>{sessionStorage.setItem("bb-faq-from-gap",JSON.stringify({topic:i.topic,example:i.example}));const o=new URL(window.location.href);o.searchParams.set("tab","content"),o.searchParams.set("sub","faqs"),window.history.pushState({},"",o),window.dispatchEvent(new PopStateEvent("popstate"))};return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Coverage gaps"}),e.length>0&&d.jsxs("span",{className:"bb-insight-aside",children:[e.reduce((i,o)=>i+o.count,0)," unanswered"]})]}),e.length===0?d.jsx("p",{className:"bb-insight-empty",children:"The bot's answering everything confidently — or there isn't enough chat yet to spot patterns."}):d.jsxs(d.Fragment,{children:[d.jsx("ul",{className:"bb-insight-gaps",children:e.slice(0,2).map((i,o)=>d.jsxs("li",{className:"bb-insight-gap",children:[d.jsxs("div",{className:"bb-insight-gap-head",children:[d.jsx("span",{className:"bb-insight-gap-topic",children:i.topic}),d.jsxs("span",{className:"bb-insight-gap-count",children:[i.count," asks"]})]}),d.jsxs("div",{className:"bb-insight-gap-example",children:['"',i.example,'"']}),d.jsx("button",{type:"button",className:"bb-insight-gap-cta",onClick:()=>r(i),children:"Auto-draft FAQ →"})]},o))}),e.length>2&&d.jsx(Su,{onClick:()=>n(!0)})]}),d.jsx(Mf,{open:t,title:"All coverage gaps",aside:`${e.length} topics`,onClose:()=>n(!1),children:d.jsx("ol",{className:"bb-modal-list",children:e.map((i,o)=>d.jsxs("li",{className:"bb-modal-row",children:[d.jsx("span",{className:"bb-modal-rank",children:o+1}),d.jsxs("div",{className:"bb-modal-body-col",children:[d.jsx("span",{className:"bb-modal-row-title",children:i.topic}),d.jsxs("span",{className:"bb-modal-row-sub",children:['"',i.example,'"']})]}),d.jsx("button",{type:"button",className:"bb-modal-row-action",onClick:()=>{n(!1),r(i)},children:"Draft FAQ →"})]},o))})})]})}function $$({topics:e,totalMessages:t}){const[n,r]=v.useState(!1);return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Top questions"}),t>0&&d.jsxs("span",{className:"bb-insight-aside",children:[t," messages"]})]}),e.length===0?d.jsx("p",{className:"bb-insight-empty",children:QS}):d.jsxs(d.Fragment,{children:[d.jsx("ol",{className:"bb-insight-list",children:e.slice(0,3).map((i,o)=>d.jsxs("li",{className:"bb-insight-list-row",children:[d.jsx("span",{className:"bb-insight-list-rank",children:o+1}),d.jsxs("div",{className:"bb-insight-list-body",children:[d.jsx("div",{className:"bb-insight-list-label",children:i.label}),d.jsxs("div",{className:"bb-insight-list-sub",children:['"',i.example,'"']})]}),d.jsx("span",{className:"bb-insight-list-count",children:i.count})]},o))}),e.length>3&&d.jsx(Su,{onClick:()=>r(!0)})]}),d.jsx(Mf,{open:n,title:"All clustered questions",aside:`${e.length} topics`,onClose:()=>r(!1),children:d.jsx("ol",{className:"bb-modal-list",children:e.map((i,o)=>d.jsxs("li",{className:"bb-modal-row",children:[d.jsx("span",{className:"bb-modal-rank",children:o+1}),d.jsxs("div",{className:"bb-modal-body-col",children:[d.jsx("span",{className:"bb-modal-row-title",children:i.label}),d.jsxs("span",{className:"bb-modal-row-sub",children:['"',i.example,'"']})]}),d.jsx("span",{className:"bb-modal-row-count",children:i.count})]},o))})})]})}function K$({countries:e,otherVisitors:t}){const[n,r]=v.useState(!1),i=e.reduce((o,l)=>o+l.count,0)+t;return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Where they're from"}),d.jsx("span",{className:"bb-insight-aside",children:"visitor IP"})]}),e.length===0?d.jsx("p",{className:"bb-insight-empty",children:QS}):d.jsxs(d.Fragment,{children:[d.jsxs("ul",{className:"bb-insight-bars",children:[e.slice(0,3).map((o,l)=>{const u=i>0?Math.round(o.count/i*100):0;return d.jsxs("li",{className:"bb-insight-bar-row",children:[d.jsx("span",{className:"bb-insight-bar-label",children:o.countryName}),d.jsx("span",{className:"bb-insight-bar-track",children:d.jsx("span",{className:"bb-insight-bar-fill",style:{width:`${Math.max(u,4)}%`}})}),d.jsx("span",{className:"bb-insight-bar-count",children:o.count})]},l)}),t>0&&d.jsx("li",{className:"bb-insight-bar-row bb-insight-bar-other",children:d.jsxs("span",{className:"bb-insight-bar-label",children:["+ ",t," other"]})})]}),(e.length>3||t>0)&&d.jsx(Su,{onClick:()=>r(!0)})]}),d.jsx(Mf,{open:n,title:"All countries",aside:`${e.length} countries`,onClose:()=>r(!1),children:d.jsxs("ol",{className:"bb-modal-list",children:[e.map((o,l)=>d.jsxs("li",{className:"bb-modal-row",children:[d.jsx("span",{className:"bb-modal-rank",children:l+1}),d.jsx("span",{className:"bb-modal-row-title",children:o.countryName}),d.jsx("span",{className:"bb-modal-row-count",children:o.count})]},l)),t>0&&d.jsx("li",{className:"bb-modal-row bb-modal-row-other",children:d.jsxs("span",{className:"bb-modal-row-title",children:["+ ",t," other visitors"]})})]})})]})}function H$({data:e}){const t=q$(e.conversations,e.conversationsPrior),n=Math.round(e.returningVisitorRate*100);return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Conversation pulse"}),d.jsxs("span",{className:"bb-insight-aside",children:["last ",e.windowDays,"d"]})]}),d.jsxs("div",{className:"bb-insight-hero",children:[d.jsx("span",{className:"bb-insight-hero-num",children:e.conversations}),d.jsx("span",{className:`bb-insight-hero-delta bb-insight-tone-${t.tone}`,children:t.label})]}),d.jsxs("dl",{className:"bb-insight-facts",children:[d.jsxs("div",{className:"bb-insight-fact",children:[d.jsx("dt",{children:"Unique visitors"}),d.jsx("dd",{children:e.uniqueVisitors})]}),d.jsxs("div",{className:"bb-insight-fact",children:[d.jsx("dt",{children:"Returning"}),d.jsxs("dd",{children:[n,d.jsx("span",{className:"bb-insight-fact-unit",children:"%"})]})]})]}),d.jsx(Su,{onClick:()=>$k("conversations"),label:"View conversations"})]})}function G$({data:e}){const t=Math.round(e.leadCaptureRate*100);return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Lead capture"}),d.jsxs("span",{className:"bb-insight-aside",children:["last ",e.windowDays,"d"]})]}),d.jsxs("div",{className:"bb-insight-hero",children:[d.jsxs("span",{className:"bb-insight-hero-num",children:[t,d.jsx("span",{className:"bb-insight-hero-unit",children:"%"})]}),d.jsx("span",{className:"bb-insight-hero-delta bb-insight-tone-flat",children:"capture rate"})]}),d.jsxs("dl",{className:"bb-insight-facts",children:[d.jsxs("div",{className:"bb-insight-fact",children:[d.jsx("dt",{children:"Leads captured"}),d.jsx("dd",{children:e.leadsCount})]}),d.jsxs("div",{className:"bb-insight-fact",children:[d.jsxs("dt",{children:["From ",e.conversations," conversations"]}),d.jsx("dd",{children:e.leadsCount===0&&e.conversations>0?"no captures yet":`${e.leadsCount} of ${e.conversations}`})]})]}),d.jsx(Su,{onClick:()=>$k("leads"),label:"View leads"})]})}function Y$(){const{data:e,isLoading:t,isError:n}=WS();return t?d.jsx("div",{className:"bb-insight-bento",children:[0,1,2,3,4,5].map(r=>d.jsx("div",{className:"bb-insight-card",children:d.jsx("div",{className:"bb-skeleton",style:{height:160,borderRadius:6}})},r))}):n||!e?d.jsx("div",{className:"bb-insight-bento",children:d.jsx("div",{className:"bb-insight-card bb-insight-card-error",children:"Couldn't load insights right now. Try refreshing in a moment."})}):d.jsxs("div",{className:"bb-insight-bento",children:[d.jsx(B$,{pages:e.topCitedPages}),d.jsx(F$,{gaps:e.coverageGaps}),d.jsx($$,{topics:e.topQuestions,totalMessages:e.userMessages}),d.jsx(K$,{countries:e.topCountries,otherVisitors:e.otherCountriesVisitors}),d.jsx(H$,{data:e}),d.jsx(G$,{data:e})]})}const W$={plan:"pro",accessMode:"active",trialEndsAt:null,daysRemaining:0,limits:{chatMessagesPerMonth:1e3,topicCreditsPerMonth:0,postsPerMonth:30,postCooldownHours:24,maxLeads:1e3,maxForms:10},usage:{chatMessagesThisMonth:347,topicCreditsThisMonth:0,postsThisMonth:8,leadsCount:42,formsCount:3,lastPostGeneratedAt:null}};function Ai(){return Et({queryKey:["plan-status"],queryFn:async()=>{if(Re().apiKey==="bb_devmockapikey0000000000000000")return W$;const t=await me("GetPlanStatus",{});if(!t.success)throw new Error(t.error);return t.data},staleTime:300*1e3,refetchOnWindowFocus:!0})}function Kk(){const{data:e,isLoading:t}=Ai(),n=(e==null?void 0:e.accessMode)??"active";return{accessMode:n,trialEndsAt:(e==null?void 0:e.trialEndsAt)??null,daysRemaining:(e==null?void 0:e.daysRemaining)??0,isFree:n==="free",isExpired:n==="expired",isActive:n==="active",isLoading:t}}const Q$="bb_devmockapikey0000000000000000",V$={status:"completed",pagesCount:128,lastSync:new Date(Date.now()-14400*1e3).toISOString()};function VS(){const t=Re().apiKey===Q$;return Et({queryKey:["sync-status"],queryFn:async()=>{if(t)return V$;const n=await me("GetSyncStatus");if(!n.success)throw new Error(n.error);return n.data},refetchInterval:n=>{var r;return((r=n.state.data)==null?void 0:r.status)==="syncing"?5e3:!1},staleTime:30*1e3})}function ir(e){if(!e)return"";const t=new Date(e).getTime();if(Number.isNaN(t))return"";const n=Date.now()-t;if(n<6e4)return"just now";const r=Math.floor(n/6e4);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);if(i<24)return`${i}h ago`;const o=Math.floor(i/24);if(o<30)return`${o}d ago`;const l=new Date(t),u=l.getFullYear()===new Date().getFullYear();return l.toLocaleDateString(void 0,u?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"})}function Hy(e){return e==null||Number.isNaN(e)?"":e.toLocaleString()}function mp(e,t=100){if(e.length<=t)return e;const n=e.slice(0,t),r=n.lastIndexOf(" ");return(r>t*.6?n.slice(0,r):n)+"…"}function XS(e){if(!e)return null;const t={loadSkill:null,searchSiteContent:"Searched your site",getCustomerProfile:"Looked up visitor info",updateCustomerProfile:"Captured visitor info",captureHandover:"Created a lead",startLiveThread:"Started a live thread",sendOtp:"Sent a verification code",verifyOtp:"Verified the code",listDrafts:"Listed your drafts",getDraft:"Opened a draft",listFaqs:"Listed your FAQs",listIndexedPages:"Checked your indexed pages",listLeads:"Listed your leads",getLead:"Opened a lead",getUnviewedLeadsCount:"Checked new leads",getSiteInsights:"Pulled your insights",listForms:"Listed your forms",getForm:"Opened a form",getChatbotInstructions:"Checked your chatbot instructions",getSiteSubscription:"Checked your subscription",runAnalyticsQuery:"Crunched the numbers",showChart:"Drew a chart",generatePostFromTopic:"Drafted a post",generatePostFromUrl:"Drafted from URL",discoverContentTopics:"Researched topics",draftFaqFromGap:"Drafted an FAQ",runLeadResearch:"Researched a lead",draftLeadFollowupEmail:"Drafted a follow-up email"};return e in t?t[e]:e.replace(/([A-Z])/g," $1").replace(/^./,n=>n.toUpperCase()).trim()}function Hk(e){switch(e){case"messenger":return{label:"Messenger",icon:"📨"};case"instagram_dm":return{label:"Instagram",icon:"📷"};case"whatsapp":return{label:"WhatsApp",icon:"🟢"};case"telegram":return{label:"Telegram",icon:"✈️"};case"sms":return{label:"SMS",icon:"✉️"};case"discord":return{label:"Discord",icon:"💜"};case"form":return{label:"Form",icon:"📝"};case"email":return{label:"Support email",icon:"✉️"};case"web_widget":default:return{label:"Web chat",icon:"💬"}}}function Gk(e){if(!e)return"Chat";const t={chat:"Chat",chat_kyc:"Chat",chat_handover:"Chat",chat_appointment:"Chat",chat_live:"Chat",chat_support:"Chat",chat_qualified:"Chat",form:"Form"};return t[e]?t[e]:e.replace(/_/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function X$(){return d.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:d.jsx("path",{d:"m9 6 6 6-6 6"})})}const Em={sync:d.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:d.jsx("path",{d:"M3 12a9 9 0 0 1 15-6.7L21 8M21 3v5h-5M21 12a9 9 0 0 1-15 6.7L3 16M3 21v-5h5"})}),leads:d.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[d.jsx("path",{d:"M4 4h16v16H4z"}),d.jsx("path",{d:"m4 7 8 5 8-5"})]}),generate:d.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:d.jsx("path",{d:"M12 5v14M5 12h14"})}),testChat:d.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:d.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})};function Z$(){const e=Ne(),{isExpired:t}=Kk(),{data:n}=VS(),r=Re(),i=r.apiKey==="bb_devmockapikey0000000000000000",{data:o}=Et({queryKey:["unviewed-leads-count"],queryFn:async()=>{if(i)return 4;const x=await me("GetUnviewedLeadsCount",{});return x.success?x.data.count:0},staleTime:60*1e3}),l=je({mutationFn:async()=>{var A;const x=new URLSearchParams({action:"bitbot_sync",nonce:r.ajaxNonce}),S=await(await fetch(r.ajaxUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:x.toString()})).json();if(!S.success)throw new Error(((A=S.data)==null?void 0:A.error)||"Sync failed");return S.data},onSuccess:()=>{le.success("Sync started"),e.invalidateQueries({queryKey:["sync-status"]})},onError:x=>le.error(x instanceof Error?x.message:"Sync failed")}),u=x=>{const E=new URL(window.location.href);E.searchParams.set("tab",x),window.history.pushState({},"",E),window.dispatchEvent(new PopStateEvent("popstate"))},f=l.isPending||(n==null?void 0:n.status)==="syncing",h=f?"Syncing now…":(n==null?void 0:n.status)==="failed"?"Sync failed":"Sync content",p=f?n!=null&&n.pagesCount?`Crawling ${n.pagesCount} pages`:"Crawling your site":(n==null?void 0:n.status)==="failed"?"Try again from the Knowledgebase tab":n!=null&&n.lastSync?`Last sync ${ir(n.lastSync)}`:"Re-crawl your site for new pages",b=o&&o>0?`${o} new ${o===1?"lead":"leads"} to review`:"See everyone who got in touch",g=[{icon:Em.sync,title:h,sub:p,onClick:()=>l.mutate(),disabled:t||f,disabledHint:t?"Reactivate your plan to sync content":void 0},{icon:Em.leads,title:"View leads",sub:b,onClick:()=>u("leads")},{icon:Em.generate,title:"Generate a blog post",sub:"From a topic, URL, or upload",onClick:()=>u("content")},{icon:Em.testChat,title:"Open the chat",sub:"Test your bot like a visitor",onClick:()=>window.open(r.siteUrl||"/","_blank")}];return d.jsxs("section",{className:"bb-card bb-quickactions-card",children:[d.jsx("header",{className:"bb-card-header",children:d.jsxs("h3",{className:"bb-card-title",children:[d.jsx("span",{className:"bb-eyebrow",children:"Shortcuts"}),d.jsx("span",{children:"Quick actions"})]})}),d.jsx("ul",{className:"bb-quickactions-list",children:g.map((x,E)=>d.jsx("li",{children:d.jsxs("button",{className:"bb-quickaction",onClick:x.onClick,disabled:x.disabled,title:x.disabledHint,children:[d.jsx("span",{className:"bb-quickaction-icon",children:x.icon}),d.jsxs("span",{className:"bb-quickaction-text",children:[d.jsx("span",{className:"bb-quickaction-title",children:x.title}),d.jsx("span",{className:"bb-quickaction-sub",children:x.sub})]}),d.jsx("span",{className:"bb-quickaction-chevron",children:d.jsx(X$,{})})]})},E))})]})}const J$="bb_devmockapikey0000000000000000",_N={enabled:!0,widgetTitle:"Chat with us",widgetPosition:"bottom-right",widgetOffsetX:20,widgetOffsetY:20,primaryColor:"#0073aa",welcomeMessage:"Hi! How can I help you today?",customInstructions:"",placeholderText:"Type your message...",fallbackMessage:"I'm not sure about that yet. Let me know how I can help.",leadCapturePrompt:"Drop your email so we can follow up.",typingIndicatorText:"Typing…",hideOnPages:"",mobileBehaviour:"inherit",cornerRadius:32,widgetShape:"rounded",suggestedQuestions:[{label:"Pricing",message:"What are your prices?"},{label:"Services",message:"What services do you offer?"},{label:"Contact",message:"How do I get in touch?"}],avatarUrl:"",avatarTransform:"",nudge:"",autoOpen:"",pinnedMessage:"",offTopicGuardrails:"",notificationEmail:""},Gy=["admin-settings"],e5=500;function ZS(){const e=Re(),t=Ne(),n=e.apiKey===J$,[r,i]=v.useState(null),[o,l]=v.useState(!1),u=Et({queryKey:Gy,queryFn:async()=>{if(n)return _N;const g=await z$("/admin-settings");if(!g.success)throw new Error(g.error);return g.data},staleTime:60*1e3}),f=je({mutationFn:async g=>{if(n)return await new Promise(E=>setTimeout(E,250)),Object.assign(_N,g),g;const x=await U$("/admin-settings",g);if(!x.success)throw new Error(x.error);return g},onSuccess:()=>{i(Date.now()),l(!1)},onError:g=>{le.error(g instanceof Error?g.message:"Save failed"),l(!1)}}),h=v.useRef({}),p=v.useRef(null),b=g=>{const x=t.getQueryData(Gy);x&&t.setQueryData(Gy,{...x,...g}),h.current={...h.current,...g},l(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{const E=h.current;h.current={},p.current=null,Object.keys(E).length>0&&f.mutate(E)},e5)};return{settings:u.data,isLoading:u.isLoading,isError:u.isError,error:u.error,save:b,isSaving:o||f.isPending,lastSavedAt:r}}function t5(){const e=Re(),t=(()=>{const u=e.widgetEnabled;return typeof u=="boolean"?u:typeof u=="string"?u!==""&&u!=="0":!0})(),[n,r]=v.useState(t),[i,o]=v.useState(!1);return{enabled:n,pending:i,toggle:async u=>{const f=n;r(u),o(!0);try{const h=new URLSearchParams({action:"bitbot_set_widget_enabled",nonce:e.ajaxNonce,enabled:u?"1":"0"}),b=await(await fetch(e.ajaxUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:h.toString()})).json();if(!b.success)throw new Error(b.error??"Toggle failed");window.bitbotAdminConfig&&(window.bitbotAdminConfig.widgetEnabled=u),le.success(u?"Widget turned on":"Widget turned off")}catch(h){r(f),le.error(h instanceof Error?h.message:"Toggle failed")}finally{o(!1)}}}}function JS(){return Et({queryKey:["integrations","meta"],queryFn:async()=>{const e=await me("GetMetaIntegration");if(!e.success)throw new Error(e.error);return e.data},staleTime:6e4})}function n5(){return je({mutationFn:async()=>{const e=await me("StartMetaOAuth");if(!e.success)throw new Error(e.error);return e.data},onError:e=>le.error(e instanceof Error?e.message:"Could not start Facebook sign-in")})}function r5(){const e=Ne();return je({mutationFn:async()=>{const t=await me("DisconnectMeta");if(!t.success)throw new Error(t.error);return t.data},onSuccess:()=>{le.success("Facebook disconnected"),e.invalidateQueries({queryKey:["integrations","meta"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not disconnect Facebook")})}function eE(){return Et({queryKey:["integrations","woocommerce"],queryFn:async()=>{const e=await me("GetWooCommerceStatus");if(!e.success)throw new Error(e.error);return e.data},staleTime:6e4})}function a5(){const e=Ne();return je({mutationFn:async({consumerKey:t,consumerSecret:n})=>{const r=await me("UpdateWcCredentials",{consumerKey:t,consumerSecret:n});if(!r.success)throw new Error(r.error);const i=await me("SetSkillEnabled",{skillName:"woocommerce",enabled:!0});if(!i.success)throw new Error(i.error);const o=await me("SetSkillVisitorExposed",{skillName:"woocommerce",exposed:!0});if(!o.success)throw new Error(o.error);return{success:!0}},onSuccess:()=>{le.success("WooCommerce connected"),e.invalidateQueries({queryKey:["integrations","woocommerce"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not save WooCommerce credentials")})}function i5(){const e=Ne();return je({mutationFn:async()=>{const t=await me("UpdateWcCredentials",{consumerKey:"",consumerSecret:""});if(!t.success)throw new Error(t.error);const n=await me("SetSkillEnabled",{skillName:"woocommerce",enabled:!1});if(!n.success)throw new Error(n.error);return{success:!0}},onSuccess:()=>{le.success("WooCommerce disconnected"),e.invalidateQueries({queryKey:["integrations","woocommerce"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not disconnect WooCommerce")})}function Rf(){return Et({queryKey:["integrations","zoho"],queryFn:async()=>{const e=await me("GetZohoIntegration");if(!e.success)throw new Error(e.error);return e.data},staleTime:6e4})}function o5(){return je({mutationFn:async()=>{const e=await me("StartZohoOAuth");if(!e.success)throw new Error(e.error);return e.data},onError:e=>le.error(e instanceof Error?e.message:"Could not start Zoho sign-in")})}function s5(){const e=Ne();return je({mutationFn:async()=>{const t=await me("DisconnectZoho");if(!t.success)throw new Error(t.error);return t.data},onSuccess:()=>{le.success("Zoho disconnected"),e.invalidateQueries({queryKey:["integrations","zoho"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not disconnect Zoho")})}function l5(){return Et({queryKey:["integrations","zoho","auto-sync"],queryFn:async()=>{const e=await me("GetZohoAutoSync");if(!e.success)throw new Error(e.error);return e.data.enabled},staleTime:6e4})}function c5(){const e=Ne();return je({mutationFn:async t=>{const n=await me("SetZohoAutoSync",{enabled:t});if(!n.success)throw new Error(n.error);return n.data.enabled},onSuccess:t=>{le.success(t?"Auto-sync to Zoho turned on":"Auto-sync to Zoho turned off"),e.invalidateQueries({queryKey:["integrations","zoho","auto-sync"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not update auto-sync")})}function u5(){const e=Ne();return je({mutationFn:async t=>{const n=await me("PushLeadToZoho",{leadId:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:()=>{le.success("Lead pushed to Zoho"),e.invalidateQueries({queryKey:["leads"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not push lead to Zoho")})}function d5(e,t){return Et({queryKey:["leads",e,"zoho-state"],queryFn:async()=>{const n=await me("GetZohoLeadStateForLead",{leadId:e});if(!n.success)throw new Error(n.error);return n.data.state},enabled:!!e&&t,staleTime:3e4})}function f5(){const e=Ne();return je({mutationFn:async()=>{const t=await me("PushAllLeadsToZoho");if(!t.success)throw new Error(t.error);return t.data},onSuccess:({pushed:t,skipped:n,failed:r})=>{const i=[];i.push(`${t} pushed`),n>0&&i.push(`${n} already in Zoho`),r>0&&i.push(`${r} failed`),le.success(i.join(" · ")),e.invalidateQueries({queryKey:["leads"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not sync leads to Zoho")})}const h5=["sync-content","notification-email"];function m5(){return d.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:d.jsx("path",{d:"M5 12h14M13 5l7 7-7 7"})})}function p5(e){const t=[];return t.push({key:"sync-content",met:e.pagesCount>0,eyebrow:e.pagesCount>0?"Indexed":"Start here",headline:e.pagesCount>0?`Indexed ${e.pagesCount} ${e.pagesCount===1?"page":"pages"}.`:"Index your site so the bot can answer.",body:e.pagesCount>0?"Re-sync any time you publish new content.":"BitBot reads your pages and posts to ground every reply. Trigger the first sync, it takes about 90 seconds.",ctaLabel:e.pagesCount>0?"Open Knowledgebase":"Sync content",goTo:"content"}),t.push({key:"notification-email",met:e.hasNotificationEmail,eyebrow:e.hasNotificationEmail?"Lead notifications":"You'll miss leads otherwise",headline:e.hasNotificationEmail?"Lead notification email is set.":"Tell us where new leads should go.",body:e.hasNotificationEmail?"New leads route to your inbox the moment they land.":"Right now, when a visitor leaves their email, the notification has nowhere to land. Add your inbox in 30 seconds.",ctaLabel:e.hasNotificationEmail?"Edit email":"Set notification email",goTo:"account:notificationEmail"}),t.push({key:"chips",met:e.chipsCount>0,eyebrow:e.chipsCount>0?"Starter chips":"Quick win",headline:e.chipsCount>0?`${e.chipsCount} starter ${e.chipsCount===1?"chip":"chips"} live.`:"Add 3 starter questions.",body:e.chipsCount>0?"Visitors see these as one-tap conversation starters in the widget.":'Sites with at least 3 starter chips get 2.4× more conversations. Suggest the questions visitors actually ask, like "How much does it cost?" or "Do you ship internationally?".',ctaLabel:e.chipsCount>0?"Edit chips":"Add chips",goTo:"chatbot"}),t.push({key:"guardrails",met:e.hasGuardrails,eyebrow:e.hasGuardrails?"Guardrails set":"Stay on-message",headline:e.hasGuardrails?"Off-topic guardrails are in place.":"Tell the bot what NOT to discuss.",body:e.hasGuardrails?"The bot refuses the topics you listed and steers back to what you can help with.":"Stop the bot from drifting into competitor talk, refund promises, or anything else off-brand. Two lines of guidance is usually enough.",ctaLabel:e.hasGuardrails?"Edit guardrails":"Add guardrails",goTo:"guardrails"}),t.push({key:"instructions",met:e.hasInstructions,eyebrow:e.hasInstructions?"Voice set":"Sound like you",headline:e.hasInstructions?"Bot voice is set.":"Give the bot your voice.",body:e.hasInstructions?"Every reply respects the style note you wrote.":'A short style note ("be friendly, lean concise, always recommend booking a demo for pricing questions") shapes every reply.',ctaLabel:e.hasInstructions?"Edit instructions":"Set instructions",goTo:"instructions"}),e.plan==="pro_plus"&&(t.push({key:"connect-meta",met:e.metaConnected,eyebrow:e.metaConnected?"Messenger + Instagram":"Answer DMs too",headline:e.metaConnected?"Facebook & Instagram are connected.":"Answer Facebook & Instagram DMs.",body:e.metaConnected?"The agent replies to Messenger and Instagram DMs with the same brain it uses on your site.":"Connect your Facebook Page and the agent answers Messenger and Instagram DMs automatically — same knowledge and skills as your website widget.",ctaLabel:e.metaConnected?"Manage Messenger":"Connect Facebook & Instagram",goTo:"integrations"}),t.push({key:"connect-woo",met:e.wcConfigured,eyebrow:e.wcConfigured?"WooCommerce":"Know your store",headline:e.wcConfigured?"WooCommerce is connected.":"Let the agent know your store.",body:e.wcConfigured?"The agent can answer product, order and stock questions, and look up a verified customer’s own orders.":"Connect WooCommerce so the agent can answer product, order and stock questions — and look up a customer’s own orders in support.",ctaLabel:e.wcConfigured?"Manage WooCommerce":"Connect WooCommerce",goTo:"integrations"}),t.push({key:"connect-zoho",met:e.zohoConnected,eyebrow:e.zohoConnected?"Zoho CRM":"Sync your leads",headline:e.zohoConnected?"Leads sync to Zoho CRM.":"Send leads straight to Zoho CRM.",body:e.zohoConnected?"Every captured lead flows into your Zoho pipeline automatically.":"Connect Zoho CRM and every captured lead lands in your pipeline automatically — no copy-paste.",ctaLabel:e.zohoConnected?"Manage Zoho":"Connect Zoho CRM",goTo:"integrations"})),e.plan==="pro"&&e.conversations7d>=40&&t.push({key:"agent-upsell",met:!1,eyebrow:"You're getting busy",headline:"Let the Agent do the follow-up.",body:`${e.conversations7d} conversations this week. Agent tier turns chats into actions automatically: handover, bookings, lead enrichment.`,ctaLabel:"See Agent",goTo:"integrations"}),t.some(r=>!r.met)||t.push({key:"all-set",met:!0,eyebrow:"Looking good",headline:"Everything important is configured.",body:"Bot is indexed, leads route to your inbox, chips are live, voice is set. Explore the Agent tab if you want to take it further.",ctaLabel:"Browse Agent",goTo:"integrations"}),t}function b5(){var C,O;const{settings:e,isLoading:t}=ZS(),{data:n,isLoading:r}=VS(),{data:i,isLoading:o}=Ai(),{data:l,isLoading:u}=WS(),{data:f}=JS(),{data:h}=eE(),{data:p}=Rf(),b=T=>{T==="guardrails"||T==="instructions"?T="chatbot:behaviour":T.startsWith("account")&&(T="leads");const[_,P]=T.includes(":")?T.split(":"):[T,null],D=new URL(window.location.href);D.searchParams.set("tab",_),P?D.searchParams.set("sub",P):D.searchParams.delete("sub"),window.history.pushState({},"",D),window.dispatchEvent(new PopStateEvent("popstate"))},g=!!(f!=null&&f.integration&&f.integration.status==="connected"&&(((C=f.integration.pages)==null?void 0:C.length)??0)>0),x=!!(h!=null&&h.configured),E=((O=p==null?void 0:p.integration)==null?void 0:O.status)==="connected",S=v.useMemo(()=>{var T,_,P,D;return p5({pagesCount:(n==null?void 0:n.pagesCount)??0,hasNotificationEmail:!!((T=e==null?void 0:e.notificationEmail)!=null&&T.trim()),chipsCount:((_=e==null?void 0:e.suggestedQuestions)==null?void 0:_.length)??0,hasGuardrails:!!((P=e==null?void 0:e.offTopicGuardrails)!=null&&P.trim()),hasInstructions:!!((D=e==null?void 0:e.customInstructions)!=null&&D.trim()),accessMode:(i==null?void 0:i.accessMode)??"free",daysRemaining:(i==null?void 0:i.daysRemaining)??30,conversations7d:(l==null?void 0:l.conversations)??0,plan:(i==null?void 0:i.plan)??"free",metaConnected:g,wcConfigured:x,zohoConnected:E})},[n==null?void 0:n.pagesCount,e,i,l==null?void 0:l.conversations,g,x,E]),A=v.useMemo(()=>{const T=S.filter(P=>!P.met);if(T.length===0)return null;const _=T.find(P=>h5.includes(P.key));return _?_.key:T[Math.floor(Math.random()*T.length)].key},[S.map(T=>`${T.key}:${T.met?1:0}`).join("|")]);if(t||r||o)return d.jsx("section",{className:"bb-nbs",children:d.jsx("div",{className:"bb-skeleton",style:{height:120,borderRadius:6}})});const j=S.find(T=>T.key===A)??S[S.length-1];return j?d.jsxs("section",{className:"bb-nbs","data-recommendation":j.key,"data-met":j.met?"true":"false",children:[d.jsx("div",{className:"bb-nbs-icon","aria-hidden":!0,children:d.jsx(m5,{})}),d.jsx("div",{className:"bb-nbs-eyebrow",children:j.eyebrow}),d.jsx("h4",{className:"bb-nbs-headline",children:j.headline}),d.jsx("p",{className:"bb-nbs-body",children:j.body}),d.jsxs("button",{className:"bb-btn bb-btn-primary",onClick:()=>b(j.goTo),disabled:u&&j.key==="all-set",children:[j.ctaLabel," →"]})]}):null}function DN(e){return typeof e=="boolean"?e:typeof e=="number"?e!==0:typeof e=="string"?e!==""&&e!=="0":!1}function v5(){const e=Re();return DN(e.widgetAccessExpired)?{kind:"expired"}:DN(e.widgetEnabled)?{kind:"ok"}:{kind:"disabled"}}function g5(){const e=v5();return e.kind==="ok"?null:e.kind==="expired"?d.jsxs("div",{className:"bb-widget-status bb-widget-status-warn",role:"status",children:[d.jsx("div",{className:"bb-widget-status-icon","aria-hidden":!0,children:"!"}),d.jsxs("div",{className:"bb-widget-status-body",children:[d.jsx("strong",{children:"Widget hidden on your site."})," ","Your subscription has ended. Reactivate to bring the chatbot back online for visitors."]})]}):d.jsxs("div",{className:"bb-widget-status bb-widget-status-info",role:"status",children:[d.jsx("div",{className:"bb-widget-status-icon","aria-hidden":!0,children:"!"}),d.jsxs("div",{className:"bb-widget-status-body",children:[d.jsx("strong",{children:"Chat is turned off."})," ","Visitors won't see the widget until you flip it back on from the Chatbot tab."]})]})}/*! @license DOMPurify 3.4.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.9/LICENSE */function MN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y5(e){if(Array.isArray(e))return e}function x5(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,l,u=[],f=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(f=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);f=!0);}catch(p){h=!0,i=p}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(h)throw i}}return u}}function w5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.50 In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S5(e,t){return y5(e)||x5(e,t)||E5(e,t)||w5()}function E5(e,t){if(e){if(typeof e=="string")return MN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?MN(e,t):void 0}}const Yk=Object.entries,RN=Object.setPrototypeOf,A5=Object.isFrozen,j5=Object.getPrototypeOf,C5=Object.getOwnPropertyDescriptor;let gr=Object.freeze,Sa=Object.seal,Rc=Object.create,Wk=typeof Reflect<"u"&&Reflect,Aw=Wk.apply,jw=Wk.construct;gr||(gr=function(t){return t});Sa||(Sa=function(t){return t});Aw||(Aw=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return t.apply(n,i)});jw||(jw=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const Zi=pn(Array.prototype.forEach),O5=pn(Array.prototype.lastIndexOf),kN=pn(Array.prototype.pop),vc=pn(Array.prototype.push),N5=pn(Array.prototype.splice),hr=Array.isArray,Yd=pn(String.prototype.toLowerCase),Yy=pn(String.prototype.toString),LN=pn(String.prototype.match),gc=pn(String.prototype.replace),IN=pn(String.prototype.indexOf),T5=pn(String.prototype.trim),P5=pn(Number.prototype.toString),_5=pn(Boolean.prototype.toString),zN=typeof BigInt>"u"?null:pn(BigInt.prototype.toString),UN=typeof Symbol>"u"?null:pn(Symbol.prototype.toString),Wt=pn(Object.prototype.hasOwnProperty),Td=pn(Object.prototype.toString),Gn=pn(RegExp.prototype.test),Ys=D5(TypeError);function pn(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Aw(e,t,r)}}function D5(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return jw(e,n)}}function He(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yd;if(RN&&RN(e,null),!hr(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=n(i);o!==i&&(A5(t)||(t[r]=o),i=o)}e[i]=!0}return e}function M5(e){for(let t=0;t<e.length;t++)Wt(e,t)||(e[t]=null);return e}function er(e){const t=Rc(null);for(const r of Yk(e)){var n=S5(r,2);const i=n[0],o=n[1];Wt(e,i)&&(hr(o)?t[i]=M5(o):o&&typeof o=="object"&&o.constructor===Object?t[i]=er(o):t[i]=o)}return t}function R5(e){switch(typeof e){case"string":return e;case"number":return P5(e);case"boolean":return _5(e);case"bigint":return zN?zN(e):"0";case"symbol":return UN?UN(e):"Symbol()";case"undefined":return Td(e);case"function":case"object":{if(e===null)return Td(e);const t=e,n=oi(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Td(r)}return Td(e)}default:return Td(e)}}function oi(e,t){for(;e!==null;){const r=C5(e,t);if(r){if(r.get)return pn(r.get);if(typeof r.value=="function")return pn(r.value)}e=j5(e)}function n(){return null}return n}function k5(e){try{return Gn(e,""),!0}catch{return!1}}const qN=gr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wy=gr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Qy=gr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),L5=gr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Vy=gr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),I5=gr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),BN=gr(["#text"]),FN=gr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Xy=gr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$N=gr(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Am=gr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),z5=Sa(/{{[\w\W]*|^[\w\W]*}}/g),U5=Sa(/<%[\w\W]*|^[\w\W]*%>/g),q5=Sa(/\${[\w\W]*/g),B5=Sa(/^data-[\-\w.\u00B7-\uFFFF]+$/),F5=Sa(/^aria-[\-\w]+$/),KN=Sa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$5=Sa(/^(?:\w+script|data):/i),K5=Sa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),H5=Sa(/^html$/i),G5=Sa(/^[a-z][.\w]*(-[.\w]+)+$/i),ni={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Y5=function(){return typeof window>"u"?null:window},W5=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},HN=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Qk(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Y5();const t=ve=>Qk(ve);if(t.version="3.4.9",t.removed=[],!e||!e.document||e.document.nodeType!==ni.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,i=r.currentScript;e.DocumentFragment;const o=e.HTMLTemplateElement,l=e.Node,u=e.Element,f=e.NodeFilter,h=e.NamedNodeMap;h===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const p=e.DOMParser,b=e.trustedTypes,g=u.prototype,x=oi(g,"cloneNode"),E=oi(g,"remove"),S=oi(g,"nextSibling"),A=oi(g,"childNodes"),j=oi(g,"parentNode"),C=oi(g,"shadowRoot"),O=oi(g,"attributes"),T=l&&l.prototype?oi(l.prototype,"nodeType"):null,_=l&&l.prototype?oi(l.prototype,"nodeName"):null;if(typeof o=="function"){const ve=n.createElement("template");ve.content&&ve.content.ownerDocument&&(n=ve.content.ownerDocument)}let P,D="",L,z=!1,R=0;const q=function(){if(R>0)throw Ys('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},U=function(I){q(),R++;try{return P.createHTML(I)}finally{R--}},re=function(I){q(),R++;try{return P.createScriptURL(I)}finally{R--}},G=function(){return z||(L=W5(b,i),z=!0),L},ie=n,K=ie.implementation,Z=ie.createNodeIterator,$=ie.createDocumentFragment,ee=ie.getElementsByTagName,pe=r.importNode;let k=HN();t.isSupported=typeof Yk=="function"&&typeof j=="function"&&K&&K.createHTMLDocument!==void 0;const Q=z5,ce=U5,fe=q5,xe=B5,Oe=F5,qe=$5,Be=K5,he=G5;let ue=KN,Ee=null;const de=He({},[...qN,...Wy,...Qy,...Vy,...BN]);let Le=null;const Me=He({},[...FN,...Xy,...$N,...Am]);let Ie=Object.seal(Rc(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ut=null,Un=null;const qn=Object.seal(Rc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ya=!0,Xn=!0,ja=!1,Oi=!0,zr=!1,Kt=!0,Ca=!1,Eo=!1,Ur=!1,Cn=!1,ia=!1,Wa=!1,qr=!0,Ts=!1;const Qa="user-content-";let bn=!0,Zn=!1,zt={},Sr=null;const Ao=He({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Il=null;const Ni=He({},["audio","video","img","source","image","track"]);let Va=null;const Rt=He({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),At="http://www.w3.org/1998/Math/MathML",Ut="http://www.w3.org/2000/svg",Ot="http://www.w3.org/1999/xhtml";let en=Ot,sn=!1,On=null;const Er=He({},[At,Ut,Ot],Yy);let qt=He({},["mi","mo","mn","ms","mtext"]),cr=He({},["annotation-xml"]);const ur=He({},["title","style","font","a","script"]);let Nn=null;const Oa=["application/xhtml+xml","text/html"],Na="text/html";let nt=null,dr=null;const Ar=n.createElement("form"),ln=function(I){return I instanceof RegExp||I instanceof Function},Tn=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(dr&&dr===I)return;(!I||typeof I!="object")&&(I={}),I=er(I),Nn=Oa.indexOf(I.PARSER_MEDIA_TYPE)===-1?Na:I.PARSER_MEDIA_TYPE,nt=Nn==="application/xhtml+xml"?Yy:Yd,Ee=Wt(I,"ALLOWED_TAGS")&&hr(I.ALLOWED_TAGS)?He({},I.ALLOWED_TAGS,nt):de,Le=Wt(I,"ALLOWED_ATTR")&&hr(I.ALLOWED_ATTR)?He({},I.ALLOWED_ATTR,nt):Me,On=Wt(I,"ALLOWED_NAMESPACES")&&hr(I.ALLOWED_NAMESPACES)?He({},I.ALLOWED_NAMESPACES,Yy):Er,Va=Wt(I,"ADD_URI_SAFE_ATTR")&&hr(I.ADD_URI_SAFE_ATTR)?He(er(Rt),I.ADD_URI_SAFE_ATTR,nt):Rt,Il=Wt(I,"ADD_DATA_URI_TAGS")&&hr(I.ADD_DATA_URI_TAGS)?He(er(Ni),I.ADD_DATA_URI_TAGS,nt):Ni,Sr=Wt(I,"FORBID_CONTENTS")&&hr(I.FORBID_CONTENTS)?He({},I.FORBID_CONTENTS,nt):Ao,ut=Wt(I,"FORBID_TAGS")&&hr(I.FORBID_TAGS)?He({},I.FORBID_TAGS,nt):er({}),Un=Wt(I,"FORBID_ATTR")&&hr(I.FORBID_ATTR)?He({},I.FORBID_ATTR,nt):er({}),zt=Wt(I,"USE_PROFILES")?I.USE_PROFILES&&typeof I.USE_PROFILES=="object"?er(I.USE_PROFILES):I.USE_PROFILES:!1,Ya=I.ALLOW_ARIA_ATTR!==!1,Xn=I.ALLOW_DATA_ATTR!==!1,ja=I.ALLOW_UNKNOWN_PROTOCOLS||!1,Oi=I.ALLOW_SELF_CLOSE_IN_ATTR!==!1,zr=I.SAFE_FOR_TEMPLATES||!1,Kt=I.SAFE_FOR_XML!==!1,Ca=I.WHOLE_DOCUMENT||!1,Cn=I.RETURN_DOM||!1,ia=I.RETURN_DOM_FRAGMENT||!1,Wa=I.RETURN_TRUSTED_TYPE||!1,Ur=I.FORCE_BODY||!1,qr=I.SANITIZE_DOM!==!1,Ts=I.SANITIZE_NAMED_PROPS||!1,bn=I.KEEP_CONTENT!==!1,Zn=I.IN_PLACE||!1,ue=k5(I.ALLOWED_URI_REGEXP)?I.ALLOWED_URI_REGEXP:KN,en=typeof I.NAMESPACE=="string"?I.NAMESPACE:Ot,qt=Wt(I,"MATHML_TEXT_INTEGRATION_POINTS")&&I.MATHML_TEXT_INTEGRATION_POINTS&&typeof I.MATHML_TEXT_INTEGRATION_POINTS=="object"?er(I.MATHML_TEXT_INTEGRATION_POINTS):He({},["mi","mo","mn","ms","mtext"]),cr=Wt(I,"HTML_INTEGRATION_POINTS")&&I.HTML_INTEGRATION_POINTS&&typeof I.HTML_INTEGRATION_POINTS=="object"?er(I.HTML_INTEGRATION_POINTS):He({},["annotation-xml"]);const ne=Wt(I,"CUSTOM_ELEMENT_HANDLING")&&I.CUSTOM_ELEMENT_HANDLING&&typeof I.CUSTOM_ELEMENT_HANDLING=="object"?er(I.CUSTOM_ELEMENT_HANDLING):Rc(null);if(Ie=Rc(null),Wt(ne,"tagNameCheck")&&ln(ne.tagNameCheck)&&(Ie.tagNameCheck=ne.tagNameCheck),Wt(ne,"attributeNameCheck")&&ln(ne.attributeNameCheck)&&(Ie.attributeNameCheck=ne.attributeNameCheck),Wt(ne,"allowCustomizedBuiltInElements")&&typeof ne.allowCustomizedBuiltInElements=="boolean"&&(Ie.allowCustomizedBuiltInElements=ne.allowCustomizedBuiltInElements),zr&&(Xn=!1),ia&&(Cn=!0),zt&&(Ee=He({},BN),Le=Rc(null),zt.html===!0&&(He(Ee,qN),He(Le,FN)),zt.svg===!0&&(He(Ee,Wy),He(Le,Xy),He(Le,Am)),zt.svgFilters===!0&&(He(Ee,Qy),He(Le,Xy),He(Le,Am)),zt.mathMl===!0&&(He(Ee,Vy),He(Le,$N),He(Le,Am))),qn.tagCheck=null,qn.attributeCheck=null,Wt(I,"ADD_TAGS")&&(typeof I.ADD_TAGS=="function"?qn.tagCheck=I.ADD_TAGS:hr(I.ADD_TAGS)&&(Ee===de&&(Ee=er(Ee)),He(Ee,I.ADD_TAGS,nt))),Wt(I,"ADD_ATTR")&&(typeof I.ADD_ATTR=="function"?qn.attributeCheck=I.ADD_ATTR:hr(I.ADD_ATTR)&&(Le===Me&&(Le=er(Le)),He(Le,I.ADD_ATTR,nt))),Wt(I,"ADD_URI_SAFE_ATTR")&&hr(I.ADD_URI_SAFE_ATTR)&&He(Va,I.ADD_URI_SAFE_ATTR,nt),Wt(I,"FORBID_CONTENTS")&&hr(I.FORBID_CONTENTS)&&(Sr===Ao&&(Sr=er(Sr)),He(Sr,I.FORBID_CONTENTS,nt)),Wt(I,"ADD_FORBID_CONTENTS")&&hr(I.ADD_FORBID_CONTENTS)&&(Sr===Ao&&(Sr=er(Sr)),He(Sr,I.ADD_FORBID_CONTENTS,nt)),bn&&(Ee["#text"]=!0),Ca&&He(Ee,["html","head","body"]),Ee.table&&(He(Ee,["tbody"]),delete ut.tbody),I.TRUSTED_TYPES_POLICY){if(typeof I.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ys('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof I.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ys('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const be=P;P=I.TRUSTED_TYPES_POLICY;try{D=U("")}catch(_e){throw P=be,_e}}else I.TRUSTED_TYPES_POLICY===null?(P=void 0,D=""):(P===void 0&&(P=G()),P&&typeof D=="string"&&(D=U("")));(k.uponSanitizeElement.length>0||k.uponSanitizeAttribute.length>0)&&Ee===de&&(Ee=er(Ee)),k.uponSanitizeAttribute.length>0&&Le===Me&&(Le=er(Le)),gr&&gr(I),dr=I},Ti=He({},[...Wy,...Qy,...L5]),zl=He({},[...Vy,...I5]),Pv=function(I){let ne=j(I);(!ne||!ne.tagName)&&(ne={namespaceURI:en,tagName:"template"});const be=Yd(I.tagName),_e=Yd(ne.tagName);return On[I.namespaceURI]?I.namespaceURI===Ut?ne.namespaceURI===Ot?be==="svg":ne.namespaceURI===At?be==="svg"&&(_e==="annotation-xml"||qt[_e]):!!Ti[be]:I.namespaceURI===At?ne.namespaceURI===Ot?be==="math":ne.namespaceURI===Ut?be==="math"&&cr[_e]:!!zl[be]:I.namespaceURI===Ot?ne.namespaceURI===Ut&&!cr[_e]||ne.namespaceURI===At&&!qt[_e]?!1:!zl[be]&&(ur[be]||!Ti[be]):!!(Nn==="application/xhtml+xml"&&On[I.namespaceURI]):!1},Br=function(I){vc(t.removed,{element:I});try{j(I).removeChild(I)}catch{if(E(I),!j(I))throw Ys("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Lu=function(I){const ne=A?A(I):I.childNodes;if(ne){const _e=[];Zi(ne,ke=>{vc(_e,ke)}),Zi(_e,ke=>{try{E(ke)}catch{}})}const be=O?O(I):null;if(be)for(let _e=be.length-1;_e>=0;--_e){const ke=be[_e],ze=ke&&ke.name;if(typeof ze=="string")try{I.removeAttribute(ze)}catch{}}},Fr=function(I,ne){try{vc(t.removed,{attribute:ne.getAttributeNode(I),from:ne})}catch{vc(t.removed,{attribute:null,from:ne})}if(ne.removeAttribute(I),I==="is")if(Cn||ia)try{Br(ne)}catch{}else try{ne.setAttribute(I,"")}catch{}},Iu=function(I){const ne=O?O(I):I.attributes;if(ne)for(let be=ne.length-1;be>=0;--be){const _e=ne[be],ke=_e&&_e.name;if(!(typeof ke!="string"||Le[nt(ke)]))try{I.removeAttribute(ke)}catch{}}},jo=function(I){const ne=[I];for(;ne.length>0;){const be=ne.pop();(T?T(be):be.nodeType)===ni.element&&Iu(be);const ke=A?A(be):be.childNodes;if(ke)for(let ze=ke.length-1;ze>=0;--ze)ne.push(ke[ze])}},Pi=function(I){let ne=null,be=null;if(Ur)I="<remove></remove>"+I;else{const ze=LN(I,/^[\r\n\t ]+/);be=ze&&ze[0]}Nn==="application/xhtml+xml"&&en===Ot&&(I='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+I+"</body></html>");const _e=P?U(I):I;if(en===Ot)try{ne=new p().parseFromString(_e,Nn)}catch{}if(!ne||!ne.documentElement){ne=K.createDocument(en,"template",null);try{ne.documentElement.innerHTML=sn?D:_e}catch{}}const ke=ne.body||ne.documentElement;return I&&be&&ke.insertBefore(n.createTextNode(be),ke.childNodes[0]||null),en===Ot?ee.call(ne,Ca?"html":"body")[0]:Ca?ne.documentElement:ke},Co=function(I){return Z.call(I.ownerDocument||I,I,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},Xa=function(I){var ne,be;I.normalize();const _e=Z.call(I.ownerDocument||I,I,f.SHOW_TEXT|f.SHOW_COMMENT|f.SHOW_CDATA_SECTION|f.SHOW_PROCESSING_INSTRUCTION,null);let ke=_e.nextNode();for(;ke;){let tn=ke.data;Zi([Q,ce,fe],Ge=>{tn=gc(tn,Ge," ")}),ke.data=tn,ke=_e.nextNode()}const ze=(ne=(be=I.querySelectorAll)===null||be===void 0?void 0:be.call(I,"template"))!==null&&ne!==void 0?ne:[];Zi(Array.from(ze),tn=>{_i(tn.content)&&Xa(tn.content)})},Bt=function(I){const ne=_?_(I):null;return typeof ne!="string"||nt(ne)!=="form"?!1:typeof I.nodeName!="string"||typeof I.textContent!="string"||typeof I.removeChild!="function"||I.attributes!==O(I)||typeof I.removeAttribute!="function"||typeof I.setAttribute!="function"||typeof I.namespaceURI!="string"||typeof I.insertBefore!="function"||typeof I.hasChildNodes!="function"||I.nodeType!==T(I)||I.childNodes!==A(I)},_i=function(I){if(!T||typeof I!="object"||I===null)return!1;try{return T(I)===ni.documentFragment}catch{return!1}},Oo=function(I){if(!T||typeof I!="object"||I===null)return!1;try{return typeof T(I)=="number"}catch{return!1}};function Bn(ve,I,ne){Zi(ve,be=>{be.call(t,I,ne,dr)})}const Di=function(I){let ne=null;if(Bn(k.beforeSanitizeElements,I,null),Bt(I))return Br(I),!0;const be=nt(_?_(I):I.nodeName);if(Bn(k.uponSanitizeElement,I,{tagName:be,allowedTags:Ee}),Kt&&I.hasChildNodes()&&!Oo(I.firstElementChild)&&Gn(/<[/\w!]/g,I.innerHTML)&&Gn(/<[/\w!]/g,I.textContent)||Kt&&I.namespaceURI===Ot&&be==="style"&&Oo(I.firstElementChild)||I.nodeType===ni.progressingInstruction||Kt&&I.nodeType===ni.comment&&Gn(/<[/\w]/g,I.data))return Br(I),!0;if(ut[be]||!(qn.tagCheck instanceof Function&&qn.tagCheck(be))&&!Ee[be]){if(!ut[be]&&zu(be)&&(Ie.tagNameCheck instanceof RegExp&&Gn(Ie.tagNameCheck,be)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(be)))return!1;if(bn&&!Sr[be]){const ke=j(I),ze=A(I);if(ze&&ke){const tn=ze.length;for(let Ge=tn-1;Ge>=0;--Ge){const Nt=Zn?ze[Ge]:x(ze[Ge],!0);ke.insertBefore(Nt,S(I))}}}return Br(I),!0}return(T?T(I):I.nodeType)===ni.element&&!Pv(I)||(be==="noscript"||be==="noembed"||be==="noframes")&&Gn(/<\/no(script|embed|frames)/i,I.innerHTML)?(Br(I),!0):(zr&&I.nodeType===ni.text&&(ne=I.textContent,Zi([Q,ce,fe],ke=>{ne=gc(ne,ke," ")}),I.textContent!==ne&&(vc(t.removed,{element:I.cloneNode()}),I.textContent=ne)),Bn(k.afterSanitizeElements,I,null),!1)},sh=function(I,ne,be){if(Un[ne]||qr&&(ne==="id"||ne==="name")&&(be in n||be in Ar))return!1;const _e=Le[ne]||qn.attributeCheck instanceof Function&&qn.attributeCheck(ne,I);if(!(Xn&&!Un[ne]&&Gn(xe,ne))){if(!(Ya&&Gn(Oe,ne))){if(!_e||Un[ne]){if(!(zu(I)&&(Ie.tagNameCheck instanceof RegExp&&Gn(Ie.tagNameCheck,I)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(I))&&(Ie.attributeNameCheck instanceof RegExp&&Gn(Ie.attributeNameCheck,ne)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(ne,I))||ne==="is"&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&Gn(Ie.tagNameCheck,be)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(be))))return!1}else if(!Va[ne]){if(!Gn(ue,gc(be,Be,""))){if(!((ne==="src"||ne==="xlink:href"||ne==="href")&&I!=="script"&&IN(be,"data:")===0&&Il[I])){if(!(ja&&!Gn(qe,gc(be,Be,"")))){if(be)return!1}}}}}}return!0},lh=He({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),zu=function(I){return!lh[Yd(I)]&&Gn(he,I)},ch=function(I){Bn(k.beforeSanitizeAttributes,I,null);const ne=I.attributes;if(!ne||Bt(I))return;const be={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Le,forceKeepAttr:void 0};let _e=ne.length;for(;_e--;){const ke=ne[_e],ze=ke.name,tn=ke.namespaceURI,Ge=ke.value,Nt=nt(ze),Ta=Ge;let Ht=ze==="value"?Ta:T5(Ta);if(be.attrName=Nt,be.attrValue=Ht,be.keepAttr=!0,be.forceKeepAttr=void 0,Bn(k.uponSanitizeAttribute,I,be),Ht=be.attrValue,Ts&&(Nt==="id"||Nt==="name")&&IN(Ht,Qa)!==0&&(Fr(ze,I),Ht=Qa+Ht),Kt&&Gn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ht)){Fr(ze,I);continue}if(Nt==="attributename"&&LN(Ht,"href")){Fr(ze,I);continue}if(be.forceKeepAttr)continue;if(!be.keepAttr){Fr(ze,I);continue}if(!Oi&&Gn(/\/>/i,Ht)){Fr(ze,I);continue}zr&&Zi([Q,ce,fe],Uu=>{Ht=gc(Ht,Uu," ")});const Ri=nt(I.nodeName);if(!sh(Ri,Nt,Ht)){Fr(ze,I);continue}if(P&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!tn)switch(b.getAttributeType(Ri,Nt)){case"TrustedHTML":{Ht=U(Ht);break}case"TrustedScriptURL":{Ht=re(Ht);break}}if(Ht!==Ta)try{tn?I.setAttributeNS(tn,ze,Ht):I.setAttribute(ze,Ht),Bt(I)?Br(I):kN(t.removed)}catch{Fr(ze,I)}}Bn(k.afterSanitizeAttributes,I,null)},Mi=function(I){let ne=null;const be=Co(I);for(Bn(k.beforeSanitizeShadowDOM,I,null);ne=be.nextNode();)if(Bn(k.uponSanitizeShadowNode,ne,null),Di(ne),ch(ne),_i(ne.content)&&Mi(ne.content),(T?T(ne):ne.nodeType)===ni.element){const ke=C?C(ne):ne.shadowRoot;_i(ke)&&(No(ke),Mi(ke))}Bn(k.afterSanitizeShadowDOM,I,null)},No=function(I){const ne=[{node:I,shadow:null}];for(;ne.length>0;){const be=ne.pop();if(be.shadow){Mi(be.shadow);continue}const _e=be.node,ze=(T?T(_e):_e.nodeType)===ni.element,tn=A?A(_e):_e.childNodes;if(tn)for(let Ge=tn.length-1;Ge>=0;--Ge)ne.push({node:tn[Ge],shadow:null});if(ze){const Ge=_?_(_e):null;if(typeof Ge=="string"&&nt(Ge)==="template"){const Nt=_e.content;_i(Nt)&&ne.push({node:Nt,shadow:null})}}if(ze){const Ge=C?C(_e):_e.shadowRoot;_i(Ge)&&ne.push({node:null,shadow:Ge},{node:Ge,shadow:null})}}};return t.sanitize=function(ve){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ne=null,be=null,_e=null,ke=null;if(sn=!ve,sn&&(ve="<!-->"),typeof ve!="string"&&!Oo(ve)&&(ve=R5(ve),typeof ve!="string"))throw Ys("dirty is not a string, aborting");if(!t.isSupported)return ve;Eo||Tn(I),t.removed=[];const ze=Zn&&typeof ve!="string"&&Oo(ve);if(ze){const Nt=_?_(ve):ve.nodeName;if(typeof Nt=="string"){const Ta=nt(Nt);if(!Ee[Ta]||ut[Ta])throw Ys("root node is forbidden and cannot be sanitized in-place")}if(Bt(ve))throw Ys("root node is clobbered and cannot be sanitized in-place");try{No(ve)}catch(Ta){throw Lu(ve),Ta}}else if(Oo(ve))ne=Pi("<!---->"),be=ne.ownerDocument.importNode(ve,!0),be.nodeType===ni.element&&be.nodeName==="BODY"||be.nodeName==="HTML"?ne=be:ne.appendChild(be),No(be);else{if(!Cn&&!zr&&!Ca&&ve.indexOf("<")===-1)return P&&Wa?U(ve):ve;if(ne=Pi(ve),!ne)return Cn?null:Wa?D:""}ne&&Ur&&Br(ne.firstChild);const tn=Co(ze?ve:ne);try{for(;_e=tn.nextNode();)Di(_e),ch(_e),_i(_e.content)&&Mi(_e.content)}catch(Nt){throw ze&&Lu(ve),Nt}if(ze)return Zi(t.removed,Nt=>{Nt.element&&jo(Nt.element)}),zr&&Xa(ve),ve;if(Cn){if(zr&&Xa(ne),ia)for(ke=$.call(ne.ownerDocument);ne.firstChild;)ke.appendChild(ne.firstChild);else ke=ne;return(Le.shadowroot||Le.shadowrootmode)&&(ke=pe.call(r,ke,!0)),ke}let Ge=Ca?ne.outerHTML:ne.innerHTML;return Ca&&Ee["!doctype"]&&ne.ownerDocument&&ne.ownerDocument.doctype&&ne.ownerDocument.doctype.name&&Gn(H5,ne.ownerDocument.doctype.name)&&(Ge="<!DOCTYPE "+ne.ownerDocument.doctype.name+`>51 `+Ge),zr&&Zi([Q,ce,fe],Nt=>{Ge=gc(Ge,Nt," ")}),P&&Wa? U(Ge):Ge},t.setConfig=function(){let ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tn(ve),Eo=!0},t.clearConfig=function(){dr=null,Eo=!1,P=L,D=""},t.isValidAttribute=function(ve,I,ne){dr||Tn({});const be=nt(ve),_e=nt(I);return sh(be,_e,ne)},t.addHook=function(ve,I){typeof I=="function"&&vc(k[ve],I)},t.removeHook=function(ve,I){if(I!==void 0){const ne=O5(k[ve],I);return ne===-1?void 0:N5(k[ve],ne,1)[0]}return kN(k[ve])},t.removeHooks=function(ve){k[ve]=[]},t.removeAllHooks=function(){k=HN()},t}var Vk=Qk();const Q5="bb_devmockapikey0000000000000000";function V5(){const t=Re().apiKey===Q5;return Et({queryKey:["announcements"],queryFn:async()=>{if(t)return[];const n=await me("GetAnnouncements");return n.success?n.data.announcements??[]:[]},staleTime:300*1e3})}function X5(){const e=Ne();return je({mutationFn:async t=>{const n=await me("DismissAnnouncement",{announcementId:t});if(!n.success)throw new Error(n.error)},onMutate:async t=>{await e.cancelQueries({queryKey:["announcements"]});const n=e.getQueryData(["announcements"]);return e.setQueryData(["announcements"],r=>(r??[]).filter(i=>i.id!==t)),{prev:n}},onError:(t,n,r)=>{r!=null&&r.prev&&e.setQueryData(["announcements"],r.prev)},onSettled:()=>{e.invalidateQueries({queryKey:["announcements"]})}})}Vk.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer"))});const Z5={ALLOWED_TAGS:["p","br","strong","b","em","i","u","a","ul","ol","li","span","img","h3","h4","small"],ALLOWED_ATTR:["href","src","alt","title","target","rel"]},J5=new Set(["info","success","warn"]);function e6(){const{data:e}=V5(),t=X5();return!e||e.length===0?null:d.jsx("div",{className:"bb-ann-stack",children:e.map(n=>d.jsx(t6,{announcement:n,onDismiss:()=>t.mutate(n.id)},n.id))})}function t6({announcement:e,onDismiss:t}){const n=v.useMemo(()=>e.bodyHtml?Vk.sanitize(e.bodyHtml,Z5):"",[e.bodyHtml]),r=J5.has(e.tone)?e.tone:"info";return d.jsxs("article",{className:`bb-ann bb-ann-${r}`,role:"status",children:[e.imageUrl&&d.jsx("img",{className:"bb-ann-img",src:e.imageUrl,alt:""}),d.jsxs("div",{className:"bb-ann-body",children:[d.jsx("h3",{className:"bb-ann-title",children:e.title}),n&&d.jsx("div",{className:"bb-ann-rich",dangerouslySetInnerHTML:{__html:n}})]}),e.ctaLabel&&e.ctaUrl&&d.jsx("a",{className:"bb-btn bb-btn-primary bb-btn-small bb-ann-cta",href:e.ctaUrl,target:"_blank",rel:"noopener noreferrer",children:e.ctaLabel}),d.jsx("button",{type:"button",className:"bb-ann-dismiss","aria-label":"Dismiss",title:"Dismiss",onClick:t,children:"×"})]})}function n6(){return d.jsxs(d.Fragment,{children:[d.jsx(g5,{}),d.jsx(e6,{}),d.jsxs("div",{className:"bb-overview-grid",children:[d.jsx("div",{className:"bb-overview-main",children:d.jsx(Y$,{})}),d.jsxs("aside",{className:"bb-overview-aside",children:[d.jsx(Z$,{}),d.jsx(b5,{})]})]})]})}var Cw=function(e,t){return Cw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Cw(e,t)};function r6(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Cw(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var jt=function(){return jt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},jt.apply(this,arguments)};function Xk(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function a6(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Zy,GN;function i6(){if(GN)return Zy;GN=1;var e=!1,t,n,r,i,o,l,u,f,h,p,b,g,x,E,S;function A(){if(!e){e=!0;var C=navigator.userAgent,O=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(C),T=/(Mac OS X)|(Windows)|(Linux)/.exec(C);if(g=/\b(iPhone|iP[ao]d)/.exec(C),x=/\b(iP[ao]d)/.exec(C),p=/Android/i.exec(C),E=/FBAN\/\w+;/i.exec(C),S=/Mobile/i.exec(C),b=!!/Win64/.exec(C),O){t=O[1]?parseFloat(O[1]):O[5]?parseFloat(O[5]):NaN,t&&document&&document.documentMode&&(t=document.documentMode);var _=/(?:Trident\/(\d+.\d+))/.exec(C);l=_?parseFloat(_[1])+4:t,n=O[2]?parseFloat(O[2]):NaN,r=O[3]?parseFloat(O[3]):NaN,i=O[4]?parseFloat(O[4]):NaN,i?(O=/(?:Chrome\/(\d+\.\d+))/.exec(C),o=O&&O[1]?parseFloat(O[1]):NaN):o=NaN}else t=n=r=o=i=NaN;if(T){if(T[1]){var P=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(C);u=P?parseFloat(P[1].replace("_",".")):!0}else u=!1;f=!!T[2],h=!!T[3]}else u=f=h=!1}}var j={ie:function(){return A()||t},ieCompatibilityMode:function(){return A()||l>t},ie64:function(){return j.ie()&&b},firefox:function(){return A()||n},opera:function(){return A()||r},webkit:function(){return A()||i},safari:function(){return j.webkit()},chrome:function(){return A()||o},windows:function(){return A()||f},osx:function(){return A()||u},linux:function(){return A()||h},iphone:function(){return A()||g},mobile:function(){return A()||g||x||p||S},nativeApp:function(){return A()||E},android:function(){return A()||p},ipad:function(){return A()||x}};return Zy=j,Zy}var Jy,YN;function o6(){if(YN)return Jy;YN=1;var e=!!(typeof window<"u"&&window.document&&window.document.createElement),t={canUseDOM:e,canUseWorkers:typeof Worker<"u",canUseEventListeners:e&&!!(window.addEventListener||window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};return Jy=t,Jy}var e0,WN;function s6(){if(WN)return e0;WN=1;var e=o6(),t;e.canUseDOM&&(t=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**48 `+m.stack}}var Ya=Object.prototype.hasOwnProperty,Xn=e.unstable_scheduleCallback,ja=e.unstable_cancelCallback,Oi=e.unstable_shouldYield,zr=e.unstable_requestPaint,Kt=e.unstable_now,Ca=e.unstable_getCurrentPriorityLevel,Eo=e.unstable_ImmediatePriority,Ur=e.unstable_UserBlockingPriority,Cn=e.unstable_NormalPriority,ia=e.unstable_LowPriority,Wa=e.unstable_IdlePriority,qr=e.log,Ts=e.unstable_setDisableYieldValue,Qa=null,bn=null;function Zn(a){if(typeof qr=="function"&&Ts(a),bn&&typeof bn.setStrictMode=="function")try{bn.setStrictMode(Qa,a)}catch{}}var zt=Math.clz32?Math.clz32:Il,Sr=Math.log,Ao=Math.LN2;function Il(a){return a>>>=0,a===0?32:31-(Sr(a)/Ao|0)|0}var Ni=256,Va=262144,Rt=4194304;function At(a){var s=a&42;if(s!==0)return s;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Ut(a,s,c){var m=a.pendingLanes;if(m===0)return 0;var y=0,w=a.suspendedLanes,N=a.pingedLanes;a=a.warmLanes;var M=m&134217727;return M!==0?(m=M&~w,m!==0?y=At(m):(N&=M,N!==0?y=At(N):c||(c=M&~a,c!==0&&(y=At(c))))):(M=m&~w,M!==0?y=At(M):N!==0?y=At(N):c||(c=m&~a,c!==0&&(y=At(c)))),y===0?0:s!==0&&s!==y&&(s&w)===0&&(w=y&-y,c=s&-s,w>=c||w===32&&(c&4194048)!==0)?s:y}function Ot(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function en(a,s){switch(a){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sn(){var a=Rt;return Rt<<=1,(Rt&62914560)===0&&(Rt=4194304),a}function On(a){for(var s=[],c=0;31>c;c++)s.push(a);return s}function Er(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function qt(a,s,c,m,y,w){var N=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var M=a.entanglements,U=a.expirationTimes,X=a.hiddenUpdates;for(c=N&~c;0<c;){var ie=31-zt(c),se=1<<ie;M[ie]=0,U[ie]=-1;var ee=X[ie];if(ee!==null)for(X[ie]=null,ie=0;ie<ee.length;ie++){var re=ee[ie];re!==null&&(re.lane&=-536870913)}c&=~se}m!==0&&cr(a,m,0),w!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=w&~(N&~s))}function cr(a,s,c){a.pendingLanes|=s,a.suspendedLanes&=~s;var m=31-zt(s);a.entangledLanes|=s,a.entanglements[m]=a.entanglements[m]|1073741824|c&261930}function ur(a,s){var c=a.entangledLanes|=s;for(a=a.entanglements;c;){var m=31-zt(c),y=1<<m;y&s|a[m]&s&&(a[m]|=s),c&=~y}}function Nn(a,s){var c=s&-s;return c=(c&42)!==0?1:Oa(c),(c&(a.suspendedLanes|s))!==0?0:c}function Oa(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Na(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function nt(){var a=Z.p;return a!==0?a:(a=window.event,a===void 0?32:QO(a.type))}function dr(a,s){var c=Z.p;try{return Z.p=a,s()}finally{Z.p=c}}var Ar=Math.random().toString(36).slice(2),ln="__reactFiber$"+Ar,Tn="__reactProps$"+Ar,Ti="__reactContainer$"+Ar,zl="__reactEvents$"+Ar,Pv="__reactListeners$"+Ar,Br="__reactHandles$"+Ar,Iu="__reactResources$"+Ar,Fr="__reactMarker$"+Ar;function zu(a){delete a[ln],delete a[Tn],delete a[zl],delete a[Pv],delete a[Br]}function jo(a){var s=a[ln];if(s)return s;for(var c=a.parentNode;c;){if(s=c[Ti]||c[ln]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(a=MO(a);a!==null;){if(c=a[ln])return c;a=MO(a)}return s}a=c,c=a.parentNode}return null}function Pi(a){if(a=a[ln]||a[Ti]){var s=a.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return a}return null}function Co(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a.stateNode;throw Error(r(33))}function Xa(a){var s=a[Iu];return s||(s=a[Iu]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Bt(a){a[Fr]=!0}var _i=new Set,Oo={};function Bn(a,s){Di(a,s),Di(a+"Capture",s)}function Di(a,s){for(Oo[a]=s,a=0;a<s.length;a++)_i.add(s[a])}var sh=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),lh={},Uu={};function ch(a){return Ya.call(Uu,a)?!0:Ya.call(lh,a)?!1:sh.test(a)?Uu[a]=!0:(lh[a]=!0,!1)}function Mi(a,s,c){if(ch(s))if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var m=s.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+c)}}function No(a,s,c){if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(s);return}a.setAttribute(s,""+c)}}function ve(a,s,c,m){if(m===null)a.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(s,c,""+m)}}function I(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ae(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function be(a,s,c){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,s);if(!a.hasOwnProperty(s)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var y=m.get,w=m.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return y.call(this)},set:function(N){c=""+N,w.call(this,N)}}),Object.defineProperty(a,s,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(N){c=""+N},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function _e(a){if(!a._valueTracker){var s=ae(a)?"checked":"value";a._valueTracker=be(a,s,""+a[s])}}function ke(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var c=s.getValue(),m="";return a&&(m=ae(a)?a.checked?"true":"false":a.value),a=m,a!==c?(s.setValue(a),!0):!1}function ze(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var tn=/[\n"\\]/g;function Ge(a){return a.replace(tn,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Nt(a,s,c,m,y,w,N,M){a.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?a.type=N:a.removeAttribute("type"),s!=null?N==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+I(s)):a.value!==""+I(s)&&(a.value=""+I(s)):N!=="submit"&&N!=="reset"||a.removeAttribute("value"),s!=null?Ht(a,N,I(s)):c!=null?Ht(a,N,I(c)):m!=null&&a.removeAttribute("value"),y==null&&w!=null&&(a.defaultChecked=!!w),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?a.name=""+I(M):a.removeAttribute("name")}function Ta(a,s,c,m,y,w,N,M){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(a.type=w),s!=null||c!=null){if(!(w!=="submit"&&w!=="reset"||s!=null)){_e(a);return}c=c!=null?""+I(c):"",s=s!=null?""+I(s):c,M||s===a.value||(a.value=s),a.defaultValue=s}m=m??y,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=M?a.checked:!!m,a.defaultChecked=!!m,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.name=N),_e(a)}function Ht(a,s,c){s==="number"&&ze(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function Ri(a,s,c,m){if(a=a.options,s){s={};for(var y=0;y<c.length;y++)s["$"+c[y]]=!0;for(c=0;c<a.length;c++)y=s.hasOwnProperty("$"+a[c].value),a[c].selected!==y&&(a[c].selected=y),y&&m&&(a[c].defaultSelected=!0)}else{for(c=""+I(c),s=null,y=0;y<a.length;y++){if(a[y].value===c){a[y].selected=!0,m&&(a[y].defaultSelected=!0);return}s!==null||a[y].disabled||(s=a[y])}s!==null&&(s.selected=!0)}}function qu(a,s,c){if(s!=null&&(s=""+I(s),s!==a.value&&(a.value=s),c==null)){a.defaultValue!==s&&(a.defaultValue=s);return}a.defaultValue=c!=null?""+I(c):""}function wj(a,s,c,m){if(s==null){if(m!=null){if(c!=null)throw Error(r(92));if(ne(m)){if(1<m.length)throw Error(r(93));m=m[0]}c=m}c==null&&(c=""),s=c}c=I(s),a.defaultValue=c,m=a.textContent,m===c&&m!==""&&m!==null&&(a.value=m),_e(a)}function Ul(a,s){if(s){var c=a.firstChild;if(c&&c===a.lastChild&&c.nodeType===3){c.nodeValue=s;return}}a.textContent=s}var Pq=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Sj(a,s,c){var m=s.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?m?a.setProperty(s,""):s==="float"?a.cssFloat="":a[s]="":m?a.setProperty(s,c):typeof c!="number"||c===0||Pq.has(s)?s==="float"?a.cssFloat=c:a[s]=(""+c).trim():a[s]=c+"px"}function Ej(a,s,c){if(s!=null&&typeof s!="object")throw Error(r(62));if(a=a.style,c!=null){for(var m in c)!c.hasOwnProperty(m)||s!=null&&s.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var y in s)m=s[y],s.hasOwnProperty(y)&&c[y]!==m&&Sj(a,y,m)}else for(var w in s)s.hasOwnProperty(w)&&Sj(a,w,s[w])}function _v(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _q=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Dq=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function uh(a){return Dq.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function ki(){}var Dv=null;function Mv(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ql=null,Bl=null;function Aj(a){var s=Pi(a);if(s&&(a=s.stateNode)){var c=a[Tn]||null;e:switch(a=s.stateNode,s.type){case"input":if(Nt(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),s=c.name,c.type==="radio"&&s!=null){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Ge(""+s)+'"][type="radio"]'),s=0;s<c.length;s++){var m=c[s];if(m!==a&&m.form===a.form){var y=m[Tn]||null;if(!y)throw Error(r(90));Nt(m,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(s=0;s<c.length;s++)m=c[s],m.form===a.form&&ke(m)}break e;case"textarea":qu(a,c.value,c.defaultValue);break e;case"select":s=c.value,s!=null&&Ri(a,!!c.multiple,s,!1)}}}var Rv=!1;function jj(a,s,c){if(Rv)return a(s,c);Rv=!0;try{var m=a(s);return m}finally{if(Rv=!1,(ql!==null||Bl!==null)&&(Xh(),ql&&(s=ql,a=Bl,Bl=ql=null,Aj(s),a)))for(s=0;s<a.length;s++)Aj(a[s])}}function Bu(a,s){var c=a.stateNode;if(c===null)return null;var m=c[Tn]||null;if(m===null)return null;c=m[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(c&&typeof c!="function")throw Error(r(231,s,typeof c));return c}var Li=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kv=!1;if(Li)try{var Fu={};Object.defineProperty(Fu,"passive",{get:function(){kv=!0}}),window.addEventListener("test",Fu,Fu),window.removeEventListener("test",Fu,Fu)}catch{kv=!1}var To=null,Lv=null,dh=null;function Cj(){if(dh)return dh;var a,s=Lv,c=s.length,m,y="value"in To?To.value:To.textContent,w=y.length;for(a=0;a<c&&s[a]===y[a];a++);var N=c-a;for(m=1;m<=N&&s[c-m]===y[w-m];m++);return dh=y.slice(a,1<m?1-m:void 0)}function fh(a){var s=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&s===13&&(a=13)):a=s,a===10&&(a=13),32<=a||a===13?a:0}function hh(){return!0}function Oj(){return!1}function jr(a){function s(c,m,y,w,N){this._reactName=c,this._targetInst=y,this.type=m,this.nativeEvent=w,this.target=N,this.currentTarget=null;for(var M in a)a.hasOwnProperty(M)&&(c=a[M],this[M]=c?c(w):w[M]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?hh:Oj,this.isPropagationStopped=Oj,this}return b(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=hh)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=hh)},persist:function(){},isPersistent:hh}),s}var Ps={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mh=jr(Ps),$u=b({},Ps,{view:0,detail:0}),Mq=jr($u),Iv,zv,Ku,ph=b({},$u,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qv,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Ku&&(Ku&&a.type==="mousemove"?(Iv=a.screenX-Ku.screenX,zv=a.screenY-Ku.screenY):zv=Iv=0,Ku=a),Iv)},movementY:function(a){return"movementY"in a?a.movementY:zv}}),Nj=jr(ph),Rq=b({},ph,{dataTransfer:0}),kq=jr(Rq),Lq=b({},$u,{relatedTarget:0}),Uv=jr(Lq),Iq=b({},Ps,{animationName:0,elapsedTime:0,pseudoElement:0}),zq=jr(Iq),Uq=b({},Ps,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),qq=jr(Uq),Bq=b({},Ps,{data:0}),Tj=jr(Bq),Fq={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$q={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Kq={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hq(a){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(a):(a=Kq[a])?!!s[a]:!1}function qv(){return Hq}var Gq=b({},$u,{key:function(a){if(a.key){var s=Fq[a.key]||a.key;if(s!=="Unidentified")return s}return a.type==="keypress"?(a=fh(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?$q[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qv,charCode:function(a){return a.type==="keypress"?fh(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?fh(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Yq=jr(Gq),Wq=b({},ph,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pj=jr(Wq),Qq=b({},$u,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qv}),Vq=jr(Qq),Xq=b({},Ps,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zq=jr(Xq),Jq=b({},ph,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),eB=jr(Jq),tB=b({},Ps,{newState:0,oldState:0}),nB=jr(tB),rB=[9,13,27,32],Bv=Li&&"CompositionEvent"in window,Hu=null;Li&&"documentMode"in document&&(Hu=document.documentMode);var aB=Li&&"TextEvent"in window&&!Hu,_j=Li&&(!Bv||Hu&&8<Hu&&11>=Hu),Dj=" ",Mj=!1;function Rj(a,s){switch(a){case"keyup":return rB.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kj(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Fl=!1;function iB(a,s){switch(a){case"compositionend":return kj(s);case"keypress":return s.which!==32?null:(Mj=!0,Dj);case"textInput":return a=s.data,a===Dj&&Mj?null:a;default:return null}}function oB(a,s){if(Fl)return a==="compositionend"||!Bv&&Rj(a,s)?(a=Cj(),dh=Lv=To=null,Fl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return _j&&s.locale!=="ko"?null:s.data;default:return null}}var sB={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Lj(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s==="input"?!!sB[a.type]:s==="textarea"}function Ij(a,s,c,m){ql?Bl?Bl.push(m):Bl=[m]:ql=m,s=am(s,"onChange"),0<s.length&&(c=new mh("onChange","change",null,c,m),a.push({event:c,listeners:s}))}var Gu=null,Yu=null;function lB(a){yO(a,0)}function bh(a){var s=Co(a);if(ke(s))return a}function zj(a,s){if(a==="change")return s}var Uj=!1;if(Li){var Fv;if(Li){var $v="oninput"in document;if(!$v){var qj=document.createElement("div");qj.setAttribute("oninput","return;"),$v=typeof qj.oninput=="function"}Fv=$v}else Fv=!1;Uj=Fv&&(!document.documentMode||9<document.documentMode)}function Bj(){Gu&&(Gu.detachEvent("onpropertychange",Fj),Yu=Gu=null)}function Fj(a){if(a.propertyName==="value"&&bh(Yu)){var s=[];Ij(s,Yu,a,Mv(a)),jj(lB,s)}}function cB(a,s,c){a==="focusin"?(Bj(),Gu=s,Yu=c,Gu.attachEvent("onpropertychange",Fj)):a==="focusout"&&Bj()}function uB(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return bh(Yu)}function dB(a,s){if(a==="click")return bh(s)}function fB(a,s){if(a==="input"||a==="change")return bh(s)}function hB(a,s){return a===s&&(a!==0||1/a===1/s)||a!==a&&s!==s}var $r=typeof Object.is=="function"?Object.is:hB;function Wu(a,s){if($r(a,s))return!0;if(typeof a!="object"||a===null||typeof s!="object"||s===null)return!1;var c=Object.keys(a),m=Object.keys(s);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var y=c[m];if(!Ya.call(s,y)||!$r(a[y],s[y]))return!1}return!0}function $j(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Kj(a,s){var c=$j(a);a=0;for(var m;c;){if(c.nodeType===3){if(m=a+c.textContent.length,a<=s&&m>=s)return{node:c,offset:s-a};a=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=$j(c)}}function Hj(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?Hj(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function Gj(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=ze(a.document);s instanceof a.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)a=s.contentWindow;else break;s=ze(a.document)}return s}function Kv(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}var mB=Li&&"documentMode"in document&&11>=document.documentMode,$l=null,Hv=null,Qu=null,Gv=!1;function Yj(a,s,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Gv||$l==null||$l!==ze(m)||(m=$l,"selectionStart"in m&&Kv(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Qu&&Wu(Qu,m)||(Qu=m,m=am(Hv,"onSelect"),0<m.length&&(s=new mh("onSelect","select",null,s,c),a.push({event:s,listeners:m}),s.target=$l)))}function _s(a,s){var c={};return c[a.toLowerCase()]=s.toLowerCase(),c["Webkit"+a]="webkit"+s,c["Moz"+a]="moz"+s,c}var Kl={animationend:_s("Animation","AnimationEnd"),animationiteration:_s("Animation","AnimationIteration"),animationstart:_s("Animation","AnimationStart"),transitionrun:_s("Transition","TransitionRun"),transitionstart:_s("Transition","TransitionStart"),transitioncancel:_s("Transition","TransitionCancel"),transitionend:_s("Transition","TransitionEnd")},Yv={},Wj={};Li&&(Wj=document.createElement("div").style,"AnimationEvent"in window||(delete Kl.animationend.animation,delete Kl.animationiteration.animation,delete Kl.animationstart.animation),"TransitionEvent"in window||delete Kl.transitionend.transition);function Ds(a){if(Yv[a])return Yv[a];if(!Kl[a])return a;var s=Kl[a],c;for(c in s)if(s.hasOwnProperty(c)&&c in Wj)return Yv[a]=s[c];return a}var Qj=Ds("animationend"),Vj=Ds("animationiteration"),Xj=Ds("animationstart"),pB=Ds("transitionrun"),bB=Ds("transitionstart"),vB=Ds("transitioncancel"),Zj=Ds("transitionend"),Jj=new Map,Wv="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Wv.push("scrollEnd");function Pa(a,s){Jj.set(a,s),Bn(s,[a])}var vh=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},oa=[],Hl=0,Qv=0;function gh(){for(var a=Hl,s=Qv=Hl=0;s<a;){var c=oa[s];oa[s++]=null;var m=oa[s];oa[s++]=null;var y=oa[s];oa[s++]=null;var w=oa[s];if(oa[s++]=null,m!==null&&y!==null){var N=m.pending;N===null?y.next=y:(y.next=N.next,N.next=y),m.pending=y}w!==0&&eC(c,y,w)}}function yh(a,s,c,m){oa[Hl++]=a,oa[Hl++]=s,oa[Hl++]=c,oa[Hl++]=m,Qv|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function Vv(a,s,c,m){return yh(a,s,c,m),xh(a)}function Ms(a,s){return yh(a,null,null,s),xh(a)}function eC(a,s,c){a.lanes|=c;var m=a.alternate;m!==null&&(m.lanes|=c);for(var y=!1,w=a.return;w!==null;)w.childLanes|=c,m=w.alternate,m!==null&&(m.childLanes|=c),w.tag===22&&(a=w.stateNode,a===null||a._visibility&1||(y=!0)),a=w,w=w.return;return a.tag===3?(w=a.stateNode,y&&s!==null&&(y=31-zt(c),a=w.hiddenUpdates,m=a[y],m===null?a[y]=[s]:m.push(s),s.lane=c|536870912),w):null}function xh(a){if(50<vd)throw vd=0,iy=null,Error(r(185));for(var s=a.return;s!==null;)a=s,s=a.return;return a.tag===3?a.stateNode:null}var Gl={};function gB(a,s,c,m){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kr(a,s,c,m){return new gB(a,s,c,m)}function Xv(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Ii(a,s){var c=a.alternate;return c===null?(c=Kr(a.tag,s,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=s,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&65011712,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,s=a.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function tC(a,s){a.flags&=65011714;var c=a.alternate;return c===null?(a.childLanes=0,a.lanes=s,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,s=c.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),a}function wh(a,s,c,m,y,w){var N=0;if(m=a,typeof a=="function")Xv(a)&&(N=1);else if(typeof a=="string")N=EF(a,c,fe.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case z:return a=Kr(31,c,s,y),a.elementType=z,a.lanes=w,a;case S:return Rs(c.children,y,w,s);case A:N=8,y|=24;break;case j:return a=Kr(12,c,s,y|2),a.elementType=j,a.lanes=w,a;case _:return a=Kr(13,c,s,y),a.elementType=_,a.lanes=w,a;case P:return a=Kr(19,c,s,y),a.elementType=P,a.lanes=w,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case O:N=10;break e;case C:N=9;break e;case T:N=11;break e;case D:N=14;break e;case L:N=16,m=null;break e}N=29,c=Error(r(130,a===null?"null":typeof a,"")),m=null}return s=Kr(N,c,s,y),s.elementType=a,s.type=m,s.lanes=w,s}function Rs(a,s,c,m){return a=Kr(7,a,m,s),a.lanes=c,a}function Zv(a,s,c){return a=Kr(6,a,null,s),a.lanes=c,a}function nC(a){var s=Kr(18,null,null,0);return s.stateNode=a,s}function Jv(a,s,c){return s=Kr(4,a.children!==null?a.children:[],a.key,s),s.lanes=c,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}var rC=new WeakMap;function sa(a,s){if(typeof a=="object"&&a!==null){var c=rC.get(a);return c!==void 0?c:(s={value:a,source:s,stack:qn(s)},rC.set(a,s),s)}return{value:a,source:s,stack:qn(s)}}var Yl=[],Wl=0,Sh=null,Vu=0,la=[],ca=0,Po=null,Za=1,Ja="";function zi(a,s){Yl[Wl++]=Vu,Yl[Wl++]=Sh,Sh=a,Vu=s}function aC(a,s,c){la[ca++]=Za,la[ca++]=Ja,la[ca++]=Po,Po=a;var m=Za;a=Ja;var y=32-zt(m)-1;m&=~(1<<y),c+=1;var w=32-zt(s)+y;if(30<w){var N=y-y%5;w=(m&(1<<N)-1).toString(32),m>>=N,y-=N,Za=1<<32-zt(s)+y|c<<y|m,Ja=w+a}else Za=1<<w|c<<y|m,Ja=a}function eg(a){a.return!==null&&(zi(a,1),aC(a,1,0))}function tg(a){for(;a===Sh;)Sh=Yl[--Wl],Yl[Wl]=null,Vu=Yl[--Wl],Yl[Wl]=null;for(;a===Po;)Po=la[--ca],la[ca]=null,Ja=la[--ca],la[ca]=null,Za=la[--ca],la[ca]=null}function iC(a,s){la[ca++]=Za,la[ca++]=Ja,la[ca++]=Po,Za=s.id,Ja=s.overflow,Po=a}var Fn=null,Tt=null,Ze=!1,_o=null,ua=!1,ng=Error(r(519));function Do(a){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xu(sa(s,a)),ng}function oC(a){var s=a.stateNode,c=a.type,m=a.memoizedProps;switch(s[ln]=a,s[Tn]=m,c){case"dialog":Qe("cancel",s),Qe("close",s);break;case"iframe":case"object":case"embed":Qe("load",s);break;case"video":case"audio":for(c=0;c<yd.length;c++)Qe(yd[c],s);break;case"source":Qe("error",s);break;case"img":case"image":case"link":Qe("error",s),Qe("load",s);break;case"details":Qe("toggle",s);break;case"input":Qe("invalid",s),Ta(s,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Qe("invalid",s);break;case"textarea":Qe("invalid",s),wj(s,m.value,m.defaultValue,m.children)}c=m.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||s.textContent===""+c||m.suppressHydrationWarning===!0||EO(s.textContent,c)?(m.popover!=null&&(Qe("beforetoggle",s),Qe("toggle",s)),m.onScroll!=null&&Qe("scroll",s),m.onScrollEnd!=null&&Qe("scrollend",s),m.onClick!=null&&(s.onclick=ki),s=!0):s=!1,s||Do(a,!0)}function sC(a){for(Fn=a.return;Fn;)switch(Fn.tag){case 5:case 31:case 13:ua=!1;return;case 27:case 3:ua=!0;return;default:Fn=Fn.return}}function Ql(a){if(a!==Fn)return!1;if(!Ze)return sC(a),Ze=!0,!1;var s=a.tag,c;if((c=s!==3&&s!==27)&&((c=s===5)&&(c=a.type,c=!(c!=="form"&&c!=="button")||xy(a.type,a.memoizedProps)),c=!c),c&&Tt&&Do(a),sC(a),s===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tt=DO(a)}else if(s===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));Tt=DO(a)}else s===27?(s=Tt,Go(a.type)?(a=jy,jy=null,Tt=a):Tt=s):Tt=Fn?fa(a.stateNode.nextSibling):null;return!0}function ks(){Tt=Fn=null,Ze=!1}function rg(){var a=_o;return a!==null&&(Tr===null?Tr=a:Tr.push.apply(Tr,a),_o=null),a}function Xu(a){_o===null?_o=[a]:_o.push(a)}var ag=k(null),Ls=null,Ui=null;function Mo(a,s,c){ce(ag,s._currentValue),s._currentValue=c}function qi(a){a._currentValue=ag.current,Q(ag)}function ig(a,s,c){for(;a!==null;){var m=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,m!==null&&(m.childLanes|=s)):m!==null&&(m.childLanes&s)!==s&&(m.childLanes|=s),a===c)break;a=a.return}}function og(a,s,c,m){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var w=y.dependencies;if(w!==null){var N=y.child;w=w.firstContext;e:for(;w!==null;){var M=w;w=y;for(var U=0;U<s.length;U++)if(M.context===s[U]){w.lanes|=c,M=w.alternate,M!==null&&(M.lanes|=c),ig(w.return,c,a),m||(N=null);break e}w=M.next}}else if(y.tag===18){if(N=y.return,N===null)throw Error(r(341));N.lanes|=c,w=N.alternate,w!==null&&(w.lanes|=c),ig(N,c,a),N=null}else N=y.child;if(N!==null)N.return=y;else for(N=y;N!==null;){if(N===a){N=null;break}if(y=N.sibling,y!==null){y.return=N.return,N=y;break}N=N.return}y=N}}function Vl(a,s,c,m){a=null;for(var y=s,w=!1;y!==null;){if(!w){if((y.flags&524288)!==0)w=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var N=y.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var M=y.type;$r(y.pendingProps.value,N.value)||(a!==null?a.push(M):a=[M])}}else if(y===qe.current){if(N=y.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(Ad):a=[Ad])}y=y.return}a!==null&&og(s,a,c,m),s.flags|=262144}function Eh(a){for(a=a.firstContext;a!==null;){if(!$r(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Is(a){Ls=a,Ui=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function $n(a){return lC(Ls,a)}function Ah(a,s){return Ls===null&&Is(a),lC(a,s)}function lC(a,s){var c=s._currentValue;if(s={context:s,memoizedValue:c,next:null},Ui===null){if(a===null)throw Error(r(308));Ui=s,a.dependencies={lanes:0,firstContext:s},a.flags|=524288}else Ui=Ui.next=s;return c}var yB=typeof AbortController<"u"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(c,m){a.push(m)}};this.abort=function(){s.aborted=!0,a.forEach(function(c){return c()})}},xB=e.unstable_scheduleCallback,wB=e.unstable_NormalPriority,cn={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sg(){return{controller:new yB,data:new Map,refCount:0}}function Zu(a){a.refCount--,a.refCount===0&&xB(wB,function(){a.controller.abort()})}var Ju=null,lg=0,Xl=0,Zl=null;function SB(a,s){if(Ju===null){var c=Ju=[];lg=0,Xl=dy(),Zl={status:"pending",value:void 0,then:function(m){c.push(m)}}}return lg++,s.then(cC,cC),s}function cC(){if(--lg===0&&Ju!==null){Zl!==null&&(Zl.status="fulfilled");var a=Ju;Ju=null,Xl=0,Zl=null;for(var s=0;s<a.length;s++)(0,a[s])()}}function EB(a,s){var c=[],m={status:"pending",value:null,reason:null,then:function(y){c.push(y)}};return a.then(function(){m.status="fulfilled",m.value=s;for(var y=0;y<c.length;y++)(0,c[y])(s)},function(y){for(m.status="rejected",m.reason=y,y=0;y<c.length;y++)(0,c[y])(void 0)}),m}var uC=K.S;K.S=function(a,s){Y1=Kt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&SB(a,s),uC!==null&&uC(a,s)};var zs=k(null);function cg(){var a=zs.current;return a!==null?a:wt.pooledCache}function jh(a,s){s===null?ce(zs,zs.current):ce(zs,s.pool)}function dC(){var a=cg();return a===null?null:{parent:cn._currentValue,pool:a}}var Jl=Error(r(460)),ug=Error(r(474)),Ch=Error(r(542)),Oh={then:function(){}};function fC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function hC(a,s,c){switch(c=a[c],c===void 0?a.push(s):c!==s&&(s.then(ki,ki),s=c),s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,pC(a),a;default:if(typeof s.status=="string")s.then(ki,ki);else{if(a=wt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=s,a.status="pending",a.then(function(m){if(s.status==="pending"){var y=s;y.status="fulfilled",y.value=m}},function(m){if(s.status==="pending"){var y=s;y.status="rejected",y.reason=m}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw a=s.reason,pC(a),a}throw qs=s,Jl}}function Us(a){try{var s=a._init;return s(a._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(qs=c,Jl):c}}var qs=null;function mC(){if(qs===null)throw Error(r(459));var a=qs;return qs=null,a}function pC(a){if(a===Jl||a===Ch)throw Error(r(483))}var ec=null,ed=0;function Nh(a){var s=ed;return ed+=1,ec===null&&(ec=[]),hC(ec,a,s)}function td(a,s){s=s.props.ref,a.ref=s!==void 0?s:null}function Th(a,s){throw s.$$typeof===g?Error(r(525)):(a=Object.prototype.toString.call(s),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":a)))}function bC(a){function s(Y,H){if(a){var V=Y.deletions;V===null?(Y.deletions=[H],Y.flags|=16):V.push(H)}}function c(Y,H){if(!a)return null;for(;H!==null;)s(Y,H),H=H.sibling;return null}function m(Y){for(var H=new Map;Y!==null;)Y.key!==null?H.set(Y.key,Y):H.set(Y.index,Y),Y=Y.sibling;return H}function y(Y,H){return Y=Ii(Y,H),Y.index=0,Y.sibling=null,Y}function w(Y,H,V){return Y.index=V,a?(V=Y.alternate,V!==null?(V=V.index,V<H?(Y.flags|=67108866,H):V):(Y.flags|=67108866,H)):(Y.flags|=1048576,H)}function N(Y){return a&&Y.alternate===null&&(Y.flags|=67108866),Y}function M(Y,H,V,oe){return H===null||H.tag!==6?(H=Zv(V,Y.mode,oe),H.return=Y,H):(H=y(H,V),H.return=Y,H)}function U(Y,H,V,oe){var Pe=V.type;return Pe===S?ie(Y,H,V.props.children,oe,V.key):H!==null&&(H.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===L&&Us(Pe)===H.type)?(H=y(H,V.props),td(H,V),H.return=Y,H):(H=wh(V.type,V.key,V.props,null,Y.mode,oe),td(H,V),H.return=Y,H)}function X(Y,H,V,oe){return H===null||H.tag!==4||H.stateNode.containerInfo!==V.containerInfo||H.stateNode.implementation!==V.implementation?(H=Jv(V,Y.mode,oe),H.return=Y,H):(H=y(H,V.children||[]),H.return=Y,H)}function ie(Y,H,V,oe,Pe){return H===null||H.tag!==7?(H=Rs(V,Y.mode,oe,Pe),H.return=Y,H):(H=y(H,V),H.return=Y,H)}function se(Y,H,V){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Zv(""+H,Y.mode,V),H.return=Y,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case x:return V=wh(H.type,H.key,H.props,null,Y.mode,V),td(V,H),V.return=Y,V;case E:return H=Jv(H,Y.mode,V),H.return=Y,H;case L:return H=Us(H),se(Y,H,V)}if(ne(H)||R(H))return H=Rs(H,Y.mode,V,null),H.return=Y,H;if(typeof H.then=="function")return se(Y,Nh(H),V);if(H.$$typeof===O)return se(Y,Ah(Y,H),V);Th(Y,H)}return null}function ee(Y,H,V,oe){var Pe=H!==null?H.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Pe!==null?null:M(Y,H,""+V,oe);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case x:return V.key===Pe?U(Y,H,V,oe):null;case E:return V.key===Pe?X(Y,H,V,oe):null;case L:return V=Us(V),ee(Y,H,V,oe)}if(ne(V)||R(V))return Pe!==null?null:ie(Y,H,V,oe,null);if(typeof V.then=="function")return ee(Y,H,Nh(V),oe);if(V.$$typeof===O)return ee(Y,H,Ah(Y,V),oe);Th(Y,V)}return null}function re(Y,H,V,oe,Pe){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Y=Y.get(V)||null,M(H,Y,""+oe,Pe);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return Y=Y.get(oe.key===null?V:oe.key)||null,U(H,Y,oe,Pe);case E:return Y=Y.get(oe.key===null?V:oe.key)||null,X(H,Y,oe,Pe);case L:return oe=Us(oe),re(Y,H,V,oe,Pe)}if(ne(oe)||R(oe))return Y=Y.get(V)||null,ie(H,Y,oe,Pe,null);if(typeof oe.then=="function")return re(Y,H,V,Nh(oe),Pe);if(oe.$$typeof===O)return re(Y,H,V,Ah(H,oe),Pe);Th(H,oe)}return null}function Ae(Y,H,V,oe){for(var Pe=null,at=null,Ce=H,$e=H=0,Xe=null;Ce!==null&&$e<V.length;$e++){Ce.index>$e?(Xe=Ce,Ce=null):Xe=Ce.sibling;var it=ee(Y,Ce,V[$e],oe);if(it===null){Ce===null&&(Ce=Xe);break}a&&Ce&&it.alternate===null&&s(Y,Ce),H=w(it,H,$e),at===null?Pe=it:at.sibling=it,at=it,Ce=Xe}if($e===V.length)return c(Y,Ce),Ze&&zi(Y,$e),Pe;if(Ce===null){for(;$e<V.length;$e++)Ce=se(Y,V[$e],oe),Ce!==null&&(H=w(Ce,H,$e),at===null?Pe=Ce:at.sibling=Ce,at=Ce);return Ze&&zi(Y,$e),Pe}for(Ce=m(Ce);$e<V.length;$e++)Xe=re(Ce,Y,$e,V[$e],oe),Xe!==null&&(a&&Xe.alternate!==null&&Ce.delete(Xe.key===null?$e:Xe.key),H=w(Xe,H,$e),at===null?Pe=Xe:at.sibling=Xe,at=Xe);return a&&Ce.forEach(function(Xo){return s(Y,Xo)}),Ze&&zi(Y,$e),Pe}function De(Y,H,V,oe){if(V==null)throw Error(r(151));for(var Pe=null,at=null,Ce=H,$e=H=0,Xe=null,it=V.next();Ce!==null&&!it.done;$e++,it=V.next()){Ce.index>$e?(Xe=Ce,Ce=null):Xe=Ce.sibling;var Xo=ee(Y,Ce,it.value,oe);if(Xo===null){Ce===null&&(Ce=Xe);break}a&&Ce&&Xo.alternate===null&&s(Y,Ce),H=w(Xo,H,$e),at===null?Pe=Xo:at.sibling=Xo,at=Xo,Ce=Xe}if(it.done)return c(Y,Ce),Ze&&zi(Y,$e),Pe;if(Ce===null){for(;!it.done;$e++,it=V.next())it=se(Y,it.value,oe),it!==null&&(H=w(it,H,$e),at===null?Pe=it:at.sibling=it,at=it);return Ze&&zi(Y,$e),Pe}for(Ce=m(Ce);!it.done;$e++,it=V.next())it=re(Ce,Y,$e,it.value,oe),it!==null&&(a&&it.alternate!==null&&Ce.delete(it.key===null?$e:it.key),H=w(it,H,$e),at===null?Pe=it:at.sibling=it,at=it);return a&&Ce.forEach(function(RF){return s(Y,RF)}),Ze&&zi(Y,$e),Pe}function vt(Y,H,V,oe){if(typeof V=="object"&&V!==null&&V.type===S&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case x:e:{for(var Pe=V.key;H!==null;){if(H.key===Pe){if(Pe=V.type,Pe===S){if(H.tag===7){c(Y,H.sibling),oe=y(H,V.props.children),oe.return=Y,Y=oe;break e}}else if(H.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===L&&Us(Pe)===H.type){c(Y,H.sibling),oe=y(H,V.props),td(oe,V),oe.return=Y,Y=oe;break e}c(Y,H);break}else s(Y,H);H=H.sibling}V.type===S?(oe=Rs(V.props.children,Y.mode,oe,V.key),oe.return=Y,Y=oe):(oe=wh(V.type,V.key,V.props,null,Y.mode,oe),td(oe,V),oe.return=Y,Y=oe)}return N(Y);case E:e:{for(Pe=V.key;H!==null;){if(H.key===Pe)if(H.tag===4&&H.stateNode.containerInfo===V.containerInfo&&H.stateNode.implementation===V.implementation){c(Y,H.sibling),oe=y(H,V.children||[]),oe.return=Y,Y=oe;break e}else{c(Y,H);break}else s(Y,H);H=H.sibling}oe=Jv(V,Y.mode,oe),oe.return=Y,Y=oe}return N(Y);case L:return V=Us(V),vt(Y,H,V,oe)}if(ne(V))return Ae(Y,H,V,oe);if(R(V)){if(Pe=R(V),typeof Pe!="function")throw Error(r(150));return V=Pe.call(V),De(Y,H,V,oe)}if(typeof V.then=="function")return vt(Y,H,Nh(V),oe);if(V.$$typeof===O)return vt(Y,H,Ah(Y,V),oe);Th(Y,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,H!==null&&H.tag===6?(c(Y,H.sibling),oe=y(H,V),oe.return=Y,Y=oe):(c(Y,H),oe=Zv(V,Y.mode,oe),oe.return=Y,Y=oe),N(Y)):c(Y,H)}return function(Y,H,V,oe){try{ed=0;var Pe=vt(Y,H,V,oe);return ec=null,Pe}catch(Ce){if(Ce===Jl||Ce===Ch)throw Ce;var at=Kr(29,Ce,null,Y.mode);return at.lanes=oe,at.return=Y,at}finally{}}}var Bs=bC(!0),vC=bC(!1),Ro=!1;function dg(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fg(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ko(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Lo(a,s,c){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(lt&2)!==0){var y=m.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),m.pending=s,s=xh(a),eC(a,null,c),s}return yh(a,m,s,c),xh(a)}function nd(a,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194048)!==0)){var m=s.lanes;m&=a.pendingLanes,c|=m,s.lanes=c,ur(a,c)}}function hg(a,s){var c=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var y=null,w=null;if(c=c.firstBaseUpdate,c!==null){do{var N={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};w===null?y=w=N:w=w.next=N,c=c.next}while(c!==null);w===null?y=w=s:w=w.next=s}else y=w=s;c={baseState:m.baseState,firstBaseUpdate:y,lastBaseUpdate:w,shared:m.shared,callbacks:m.callbacks},a.updateQueue=c;return}a=c.lastBaseUpdate,a===null?c.firstBaseUpdate=s:a.next=s,c.lastBaseUpdate=s}var mg=!1;function rd(){if(mg){var a=Zl;if(a!==null)throw a}}function ad(a,s,c,m){mg=!1;var y=a.updateQueue;Ro=!1;var w=y.firstBaseUpdate,N=y.lastBaseUpdate,M=y.shared.pending;if(M!==null){y.shared.pending=null;var U=M,X=U.next;U.next=null,N===null?w=X:N.next=X,N=U;var ie=a.alternate;ie!==null&&(ie=ie.updateQueue,M=ie.lastBaseUpdate,M!==N&&(M===null?ie.firstBaseUpdate=X:M.next=X,ie.lastBaseUpdate=U))}if(w!==null){var se=y.baseState;N=0,ie=X=U=null,M=w;do{var ee=M.lane&-536870913,re=ee!==M.lane;if(re?(Ve&ee)===ee:(m&ee)===ee){ee!==0&&ee===Xl&&(mg=!0),ie!==null&&(ie=ie.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Ae=a,De=M;ee=s;var vt=c;switch(De.tag){case 1:if(Ae=De.payload,typeof Ae=="function"){se=Ae.call(vt,se,ee);break e}se=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=De.payload,ee=typeof Ae=="function"?Ae.call(vt,se,ee):Ae,ee==null)break e;se=b({},se,ee);break e;case 2:Ro=!0}}ee=M.callback,ee!==null&&(a.flags|=64,re&&(a.flags|=8192),re=y.callbacks,re===null?y.callbacks=[ee]:re.push(ee))}else re={lane:ee,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ie===null?(X=ie=re,U=se):ie=ie.next=re,N|=ee;if(M=M.next,M===null){if(M=y.shared.pending,M===null)break;re=M,M=re.next,re.next=null,y.lastBaseUpdate=re,y.shared.pending=null}}while(!0);ie===null&&(U=se),y.baseState=U,y.firstBaseUpdate=X,y.lastBaseUpdate=ie,w===null&&(y.shared.lanes=0),Bo|=N,a.lanes=N,a.memoizedState=se}}function gC(a,s){if(typeof a!="function")throw Error(r(191,a));a.call(s)}function yC(a,s){var c=a.callbacks;if(c!==null)for(a.callbacks=null,a=0;a<c.length;a++)gC(c[a],s)}var tc=k(null),Ph=k(0);function xC(a,s){a=Qi,ce(Ph,a),ce(tc,s),Qi=a|s.baseLanes}function pg(){ce(Ph,Qi),ce(tc,tc.current)}function bg(){Qi=Ph.current,Q(tc),Q(Ph)}var Hr=k(null),da=null;function Io(a){var s=a.alternate;ce(nn,nn.current&1),ce(Hr,a),da===null&&(s===null||tc.current!==null||s.memoizedState!==null)&&(da=a)}function vg(a){ce(nn,nn.current),ce(Hr,a),da===null&&(da=a)}function wC(a){a.tag===22?(ce(nn,nn.current),ce(Hr,a),da===null&&(da=a)):zo()}function zo(){ce(nn,nn.current),ce(Hr,Hr.current)}function Gr(a){Q(Hr),da===a&&(da=null),Q(nn)}var nn=k(0);function _h(a){for(var s=a;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Ey(c)||Ay(c)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Bi=0,Fe=null,pt=null,un=null,Dh=!1,nc=!1,Fs=!1,Mh=0,id=0,rc=null,AB=0;function Gt(){throw Error(r(321))}function gg(a,s){if(s===null)return!1;for(var c=0;c<s.length&&c<a.length;c++)if(!$r(a[c],s[c]))return!1;return!0}function yg(a,s,c,m,y,w){return Bi=w,Fe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,K.H=a===null||a.memoizedState===null?a1:Rg,Fs=!1,w=c(m,y),Fs=!1,nc&&(w=EC(s,c,m,y)),SC(a),w}function SC(a){K.H=ld;var s=pt!==null&&pt.next!==null;if(Bi=0,un=pt=Fe=null,Dh=!1,id=0,rc=null,s)throw Error(r(300));a===null||dn||(a=a.dependencies,a!==null&&Eh(a)&&(dn=!0))}function EC(a,s,c,m){Fe=a;var y=0;do{if(nc&&(rc=null),id=0,nc=!1,25<=y)throw Error(r(301));if(y+=1,un=pt=null,a.updateQueue!=null){var w=a.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}K.H=i1,w=s(c,m)}while(nc);return w}function jB(){var a=K.H,s=a.useState()[0];return s=typeof s.then=="function"?od(s):s,a=a.useState()[0],(pt!==null?pt.memoizedState:null)!==a&&(Fe.flags|=1024),s}function xg(){var a=Mh!==0;return Mh=0,a}function wg(a,s,c){s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~c}function Sg(a){if(Dh){for(a=a.memoizedState;a!==null;){var s=a.queue;s!==null&&(s.pending=null),a=a.next}Dh=!1}Bi=0,un=pt=Fe=null,nc=!1,id=Mh=0,rc=null}function fr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?Fe.memoizedState=un=a:un=un.next=a,un}function rn(){if(pt===null){var a=Fe.alternate;a=a!==null?a.memoizedState:null}else a=pt.next;var s=un===null?Fe.memoizedState:un.next;if(s!==null)un=s,pt=a;else{if(a===null)throw Fe.alternate===null?Error(r(467)):Error(r(310));pt=a,a={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},un===null?Fe.memoizedState=un=a:un=un.next=a}return un}function Rh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function od(a){var s=id;return id+=1,rc===null&&(rc=[]),a=hC(rc,a,s),s=Fe,(un===null?s.memoizedState:un.next)===null&&(s=s.alternate,K.H=s===null||s.memoizedState===null?a1:Rg),a}function kh(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return od(a);if(a.$$typeof===O)return $n(a)}throw Error(r(438,String(a)))}function Eg(a){var s=null,c=Fe.updateQueue;if(c!==null&&(s=c.memoCache),s==null){var m=Fe.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(s={data:m.data.map(function(y){return y.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),c===null&&(c=Rh(),Fe.updateQueue=c),c.memoCache=s,c=s.data[s.index],c===void 0)for(c=s.data[s.index]=Array(a),m=0;m<a;m++)c[m]=F;return s.index++,c}function Fi(a,s){return typeof s=="function"?s(a):s}function Lh(a){var s=rn();return Ag(s,pt,a)}function Ag(a,s,c){var m=a.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=c;var y=a.baseQueue,w=m.pending;if(w!==null){if(y!==null){var N=y.next;y.next=w.next,w.next=N}s.baseQueue=y=w,m.pending=null}if(w=a.baseState,y===null)a.memoizedState=w;else{s=y.next;var M=N=null,U=null,X=s,ie=!1;do{var se=X.lane&-536870913;if(se!==X.lane?(Ve&se)===se:(Bi&se)===se){var ee=X.revertLane;if(ee===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),se===Xl&&(ie=!0);else if((Bi&ee)===ee){X=X.next,ee===Xl&&(ie=!0);continue}else se={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},U===null?(M=U=se,N=w):U=U.next=se,Fe.lanes|=ee,Bo|=ee;se=X.action,Fs&&c(w,se),w=X.hasEagerState?X.eagerState:c(w,se)}else ee={lane:se,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},U===null?(M=U=ee,N=w):U=U.next=ee,Fe.lanes|=se,Bo|=se;X=X.next}while(X!==null&&X!==s);if(U===null?N=w:U.next=M,!$r(w,a.memoizedState)&&(dn=!0,ie&&(c=Zl,c!==null)))throw c;a.memoizedState=w,a.baseState=N,a.baseQueue=U,m.lastRenderedState=w}return y===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function jg(a){var s=rn(),c=s.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=a;var m=c.dispatch,y=c.pending,w=s.memoizedState;if(y!==null){c.pending=null;var N=y=y.next;do w=a(w,N.action),N=N.next;while(N!==y);$r(w,s.memoizedState)||(dn=!0),s.memoizedState=w,s.baseQueue===null&&(s.baseState=w),c.lastRenderedState=w}return[w,m]}function AC(a,s,c){var m=Fe,y=rn(),w=Ze;if(w){if(c===void 0)throw Error(r(407));c=c()}else c=s();var N=!$r((pt||y).memoizedState,c);if(N&&(y.memoizedState=c,dn=!0),y=y.queue,Ng(OC.bind(null,m,y,a),[a]),y.getSnapshot!==s||N||un!==null&&un.memoizedState.tag&1){if(m.flags|=2048,ac(9,{destroy:void 0},CC.bind(null,m,y,c,s),null),wt===null)throw Error(r(349));w||(Bi&127)!==0||jC(m,s,c)}return c}function jC(a,s,c){a.flags|=16384,a={getSnapshot:s,value:c},s=Fe.updateQueue,s===null?(s=Rh(),Fe.updateQueue=s,s.stores=[a]):(c=s.stores,c===null?s.stores=[a]:c.push(a))}function CC(a,s,c,m){s.value=c,s.getSnapshot=m,NC(s)&&TC(a)}function OC(a,s,c){return c(function(){NC(s)&&TC(a)})}function NC(a){var s=a.getSnapshot;a=a.value;try{var c=s();return!$r(a,c)}catch{return!0}}function TC(a){var s=Ms(a,2);s!==null&&Pr(s,a,2)}function Cg(a){var s=fr();if(typeof a=="function"){var c=a;if(a=c(),Fs){Zn(!0);try{c()}finally{Zn(!1)}}}return s.memoizedState=s.baseState=a,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:a},s}function PC(a,s,c,m){return a.baseState=c,Ag(a,pt,typeof m=="function"?m:Fi)}function CB(a,s,c,m,y){if(Uh(a))throw Error(r(485));if(a=s.action,a!==null){var w={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){w.listeners.push(N)}};K.T!==null?c(!0):w.isTransition=!1,m(w),c=s.pending,c===null?(w.next=s.pending=w,_C(s,w)):(w.next=c.next,s.pending=c.next=w)}}function _C(a,s){var c=s.action,m=s.payload,y=a.state;if(s.isTransition){var w=K.T,N={};K.T=N;try{var M=c(y,m),U=K.S;U!==null&&U(N,M),DC(a,s,M)}catch(X){Og(a,s,X)}finally{w!==null&&N.types!==null&&(w.types=N.types),K.T=w}}else try{w=c(y,m),DC(a,s,w)}catch(X){Og(a,s,X)}}function DC(a,s,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){MC(a,s,m)},function(m){return Og(a,s,m)}):MC(a,s,c)}function MC(a,s,c){s.status="fulfilled",s.value=c,RC(s),a.state=c,s=a.pending,s!==null&&(c=s.next,c===s?a.pending=null:(c=c.next,s.next=c,_C(a,c)))}function Og(a,s,c){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do s.status="rejected",s.reason=c,RC(s),s=s.next;while(s!==m)}a.action=null}function RC(a){a=a.listeners;for(var s=0;s<a.length;s++)(0,a[s])()}function kC(a,s){return s}function LC(a,s){if(Ze){var c=wt.formState;if(c!==null){e:{var m=Fe;if(Ze){if(Tt){t:{for(var y=Tt,w=ua;y.nodeType!==8;){if(!w){y=null;break t}if(y=fa(y.nextSibling),y===null){y=null;break t}}w=y.data,y=w==="F!"||w==="F"?y:null}if(y){Tt=fa(y.nextSibling),m=y.data==="F!";break e}}Do(m)}m=!1}m&&(s=c[0])}}return c=fr(),c.memoizedState=c.baseState=s,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kC,lastRenderedState:s},c.queue=m,c=t1.bind(null,Fe,m),m.dispatch=c,m=Cg(!1),w=Mg.bind(null,Fe,!1,m.queue),m=fr(),y={state:s,dispatch:null,action:a,pending:null},m.queue=y,c=CB.bind(null,Fe,y,w,c),y.dispatch=c,m.memoizedState=a,[s,c,!1]}function IC(a){var s=rn();return zC(s,pt,a)}function zC(a,s,c){if(s=Ag(a,s,kC)[0],a=Lh(Fi)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var m=od(s)}catch(N){throw N===Jl?Ch:N}else m=s;s=rn();var y=s.queue,w=y.dispatch;return c!==s.memoizedState&&(Fe.flags|=2048,ac(9,{destroy:void 0},OB.bind(null,y,c),null)),[m,w,a]}function OB(a,s){a.action=s}function UC(a){var s=rn(),c=pt;if(c!==null)return zC(s,c,a);rn(),s=s.memoizedState,c=rn();var m=c.queue.dispatch;return c.memoizedState=a,[s,m,!1]}function ac(a,s,c,m){return a={tag:a,create:c,deps:m,inst:s,next:null},s=Fe.updateQueue,s===null&&(s=Rh(),Fe.updateQueue=s),c=s.lastEffect,c===null?s.lastEffect=a.next=a:(m=c.next,c.next=a,a.next=m,s.lastEffect=a),a}function qC(){return rn().memoizedState}function Ih(a,s,c,m){var y=fr();Fe.flags|=a,y.memoizedState=ac(1|s,{destroy:void 0},c,m===void 0?null:m)}function zh(a,s,c,m){var y=rn();m=m===void 0?null:m;var w=y.memoizedState.inst;pt!==null&&m!==null&&gg(m,pt.memoizedState.deps)?y.memoizedState=ac(s,w,c,m):(Fe.flags|=a,y.memoizedState=ac(1|s,w,c,m))}function BC(a,s){Ih(8390656,8,a,s)}function Ng(a,s){zh(2048,8,a,s)}function NB(a){Fe.flags|=4;var s=Fe.updateQueue;if(s===null)s=Rh(),Fe.updateQueue=s,s.events=[a];else{var c=s.events;c===null?s.events=[a]:c.push(a)}}function FC(a){var s=rn().memoizedState;return NB({ref:s,nextImpl:a}),function(){if((lt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function $C(a,s){return zh(4,2,a,s)}function KC(a,s){return zh(4,4,a,s)}function HC(a,s){if(typeof s=="function"){a=a();var c=s(a);return function(){typeof c=="function"?c():s(null)}}if(s!=null)return a=a(),s.current=a,function(){s.current=null}}function GC(a,s,c){c=c!=null?c.concat([a]):null,zh(4,4,HC.bind(null,s,a),c)}function Tg(){}function YC(a,s){var c=rn();s=s===void 0?null:s;var m=c.memoizedState;return s!==null&&gg(s,m[1])?m[0]:(c.memoizedState=[a,s],a)}function WC(a,s){var c=rn();s=s===void 0?null:s;var m=c.memoizedState;if(s!==null&&gg(s,m[1]))return m[0];if(m=a(),Fs){Zn(!0);try{a()}finally{Zn(!1)}}return c.memoizedState=[m,s],m}function Pg(a,s,c){return c===void 0||(Bi&1073741824)!==0&&(Ve&261930)===0?a.memoizedState=s:(a.memoizedState=c,a=Q1(),Fe.lanes|=a,Bo|=a,c)}function QC(a,s,c,m){return $r(c,s)?c:tc.current!==null?(a=Pg(a,c,m),$r(a,s)||(dn=!0),a):(Bi&42)===0||(Bi&1073741824)!==0&&(Ve&261930)===0?(dn=!0,a.memoizedState=c):(a=Q1(),Fe.lanes|=a,Bo|=a,s)}function VC(a,s,c,m,y){var w=Z.p;Z.p=w!==0&&8>w?w:8;var N=K.T,M={};K.T=M,Mg(a,!1,s,c);try{var U=y(),X=K.S;if(X!==null&&X(M,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var ie=EB(U,m);sd(a,s,ie,Qr(a))}else sd(a,s,m,Qr(a))}catch(se){sd(a,s,{then:function(){},status:"rejected",reason:se},Qr())}finally{Z.p=w,N!==null&&M.types!==null&&(N.types=M.types),K.T=N}}function TB(){}function _g(a,s,c,m){if(a.tag!==5)throw Error(r(476));var y=XC(a).queue;VC(a,y,s,B,c===null?TB:function(){return ZC(a),c(m)})}function XC(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:B},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:c},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function ZC(a){var s=XC(a);s.next===null&&(s=a.alternate.memoizedState),sd(a,s.next.queue,{},Qr())}function Dg(){return $n(Ad)}function JC(){return rn().memoizedState}function e1(){return rn().memoizedState}function PB(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var c=Qr();a=ko(c);var m=Lo(s,a,c);m!==null&&(Pr(m,s,c),nd(m,s,c)),s={cache:sg()},a.payload=s;return}s=s.return}}function _B(a,s,c){var m=Qr();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Uh(a)?n1(s,c):(c=Vv(a,s,c,m),c!==null&&(Pr(c,a,m),r1(c,s,m)))}function t1(a,s,c){var m=Qr();sd(a,s,c,m)}function sd(a,s,c,m){var y={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Uh(a))n1(s,y);else{var w=a.alternate;if(a.lanes===0&&(w===null||w.lanes===0)&&(w=s.lastRenderedReducer,w!==null))try{var N=s.lastRenderedState,M=w(N,c);if(y.hasEagerState=!0,y.eagerState=M,$r(M,N))return yh(a,s,y,0),wt===null&&gh(),!1}catch{}finally{}if(c=Vv(a,s,y,m),c!==null)return Pr(c,a,m),r1(c,s,m),!0}return!1}function Mg(a,s,c,m){if(m={lane:2,revertLane:dy(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Uh(a)){if(s)throw Error(r(479))}else s=Vv(a,c,m,2),s!==null&&Pr(s,a,2)}function Uh(a){var s=a.alternate;return a===Fe||s!==null&&s===Fe}function n1(a,s){nc=Dh=!0;var c=a.pending;c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s}function r1(a,s,c){if((c&4194048)!==0){var m=s.lanes;m&=a.pendingLanes,c|=m,s.lanes=c,ur(a,c)}}var ld={readContext:$n,use:kh,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt,useHostTransitionStatus:Gt,useFormState:Gt,useActionState:Gt,useOptimistic:Gt,useMemoCache:Gt,useCacheRefresh:Gt};ld.useEffectEvent=Gt;var a1={readContext:$n,use:kh,useCallback:function(a,s){return fr().memoizedState=[a,s===void 0?null:s],a},useContext:$n,useEffect:BC,useImperativeHandle:function(a,s,c){c=c!=null?c.concat([a]):null,Ih(4194308,4,HC.bind(null,s,a),c)},useLayoutEffect:function(a,s){return Ih(4194308,4,a,s)},useInsertionEffect:function(a,s){Ih(4,2,a,s)},useMemo:function(a,s){var c=fr();s=s===void 0?null:s;var m=a();if(Fs){Zn(!0);try{a()}finally{Zn(!1)}}return c.memoizedState=[m,s],m},useReducer:function(a,s,c){var m=fr();if(c!==void 0){var y=c(s);if(Fs){Zn(!0);try{c(s)}finally{Zn(!1)}}}else y=s;return m.memoizedState=m.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},m.queue=a,a=a.dispatch=_B.bind(null,Fe,a),[m.memoizedState,a]},useRef:function(a){var s=fr();return a={current:a},s.memoizedState=a},useState:function(a){a=Cg(a);var s=a.queue,c=t1.bind(null,Fe,s);return s.dispatch=c,[a.memoizedState,c]},useDebugValue:Tg,useDeferredValue:function(a,s){var c=fr();return Pg(c,a,s)},useTransition:function(){var a=Cg(!1);return a=VC.bind(null,Fe,a.queue,!0,!1),fr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,c){var m=Fe,y=fr();if(Ze){if(c===void 0)throw Error(r(407));c=c()}else{if(c=s(),wt===null)throw Error(r(349));(Ve&127)!==0||jC(m,s,c)}y.memoizedState=c;var w={value:c,getSnapshot:s};return y.queue=w,BC(OC.bind(null,m,w,a),[a]),m.flags|=2048,ac(9,{destroy:void 0},CC.bind(null,m,w,c,s),null),c},useId:function(){var a=fr(),s=wt.identifierPrefix;if(Ze){var c=Ja,m=Za;c=(m&~(1<<32-zt(m)-1)).toString(32)+c,s="_"+s+"R_"+c,c=Mh++,0<c&&(s+="H"+c.toString(32)),s+="_"}else c=AB++,s="_"+s+"r_"+c.toString(32)+"_";return a.memoizedState=s},useHostTransitionStatus:Dg,useFormState:LC,useActionState:LC,useOptimistic:function(a){var s=fr();s.memoizedState=s.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=c,s=Mg.bind(null,Fe,!0,c),c.dispatch=s,[a,s]},useMemoCache:Eg,useCacheRefresh:function(){return fr().memoizedState=PB.bind(null,Fe)},useEffectEvent:function(a){var s=fr(),c={impl:a};return s.memoizedState=c,function(){if((lt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},Rg={readContext:$n,use:kh,useCallback:YC,useContext:$n,useEffect:Ng,useImperativeHandle:GC,useInsertionEffect:$C,useLayoutEffect:KC,useMemo:WC,useReducer:Lh,useRef:qC,useState:function(){return Lh(Fi)},useDebugValue:Tg,useDeferredValue:function(a,s){var c=rn();return QC(c,pt.memoizedState,a,s)},useTransition:function(){var a=Lh(Fi)[0],s=rn().memoizedState;return[typeof a=="boolean"?a:od(a),s]},useSyncExternalStore:AC,useId:JC,useHostTransitionStatus:Dg,useFormState:IC,useActionState:IC,useOptimistic:function(a,s){var c=rn();return PC(c,pt,a,s)},useMemoCache:Eg,useCacheRefresh:e1};Rg.useEffectEvent=FC;var i1={readContext:$n,use:kh,useCallback:YC,useContext:$n,useEffect:Ng,useImperativeHandle:GC,useInsertionEffect:$C,useLayoutEffect:KC,useMemo:WC,useReducer:jg,useRef:qC,useState:function(){return jg(Fi)},useDebugValue:Tg,useDeferredValue:function(a,s){var c=rn();return pt===null?Pg(c,a,s):QC(c,pt.memoizedState,a,s)},useTransition:function(){var a=jg(Fi)[0],s=rn().memoizedState;return[typeof a=="boolean"?a:od(a),s]},useSyncExternalStore:AC,useId:JC,useHostTransitionStatus:Dg,useFormState:UC,useActionState:UC,useOptimistic:function(a,s){var c=rn();return pt!==null?PC(c,pt,a,s):(c.baseState=a,[a,c.queue.dispatch])},useMemoCache:Eg,useCacheRefresh:e1};i1.useEffectEvent=FC;function kg(a,s,c,m){s=a.memoizedState,c=c(m,s),c=c==null?s:b({},s,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}var Lg={enqueueSetState:function(a,s,c){a=a._reactInternals;var m=Qr(),y=ko(m);y.payload=s,c!=null&&(y.callback=c),s=Lo(a,y,m),s!==null&&(Pr(s,a,m),nd(s,a,m))},enqueueReplaceState:function(a,s,c){a=a._reactInternals;var m=Qr(),y=ko(m);y.tag=1,y.payload=s,c!=null&&(y.callback=c),s=Lo(a,y,m),s!==null&&(Pr(s,a,m),nd(s,a,m))},enqueueForceUpdate:function(a,s){a=a._reactInternals;var c=Qr(),m=ko(c);m.tag=2,s!=null&&(m.callback=s),s=Lo(a,m,c),s!==null&&(Pr(s,a,c),nd(s,a,c))}};function o1(a,s,c,m,y,w,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,w,N):s.prototype&&s.prototype.isPureReactComponent?!Wu(c,m)||!Wu(y,w):!0}function s1(a,s,c,m){a=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,m),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,m),s.state!==a&&Lg.enqueueReplaceState(s,s.state,null)}function $s(a,s){var c=s;if("ref"in s){c={};for(var m in s)m!=="ref"&&(c[m]=s[m])}if(a=a.defaultProps){c===s&&(c=b({},c));for(var y in a)c[y]===void 0&&(c[y]=a[y])}return c}function l1(a){vh(a)}function c1(a){console.error(a)}function u1(a){vh(a)}function qh(a,s){try{var c=a.onUncaughtError;c(s.value,{componentStack:s.stack})}catch(m){setTimeout(function(){throw m})}}function d1(a,s,c){try{var m=a.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function Ig(a,s,c){return c=ko(c),c.tag=3,c.payload={element:null},c.callback=function(){qh(a,s)},c}function f1(a){return a=ko(a),a.tag=3,a}function h1(a,s,c,m){var y=c.type.getDerivedStateFromError;if(typeof y=="function"){var w=m.value;a.payload=function(){return y(w)},a.callback=function(){d1(s,c,m)}}var N=c.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(a.callback=function(){d1(s,c,m),typeof y!="function"&&(Fo===null?Fo=new Set([this]):Fo.add(this));var M=m.stack;this.componentDidCatch(m.value,{componentStack:M!==null?M:""})})}function DB(a,s,c,m,y){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(s=c.alternate,s!==null&&Vl(s,c,y,!0),c=Hr.current,c!==null){switch(c.tag){case 31:case 13:return da===null?Zh():c.alternate===null&&Yt===0&&(Yt=3),c.flags&=-257,c.flags|=65536,c.lanes=y,m===Oh?c.flags|=16384:(s=c.updateQueue,s===null?c.updateQueue=new Set([m]):s.add(m),ly(a,m,y)),!1;case 22:return c.flags|=65536,m===Oh?c.flags|=16384:(s=c.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([m])},c.updateQueue=s):(c=s.retryQueue,c===null?s.retryQueue=new Set([m]):c.add(m)),ly(a,m,y)),!1}throw Error(r(435,c.tag))}return ly(a,m,y),Zh(),!1}if(Ze)return s=Hr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=y,m!==ng&&(a=Error(r(422),{cause:m}),Xu(sa(a,c)))):(m!==ng&&(s=Error(r(423),{cause:m}),Xu(sa(s,c))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,m=sa(m,c),y=Ig(a.stateNode,m,y),hg(a,y),Yt!==4&&(Yt=2)),!1;var w=Error(r(520),{cause:m});if(w=sa(w,c),bd===null?bd=[w]:bd.push(w),Yt!==4&&(Yt=2),s===null)return!0;m=sa(m,c),c=s;do{switch(c.tag){case 3:return c.flags|=65536,a=y&-y,c.lanes|=a,a=Ig(c.stateNode,m,a),hg(c,a),!1;case 1:if(s=c.type,w=c.stateNode,(c.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Fo===null||!Fo.has(w))))return c.flags|=65536,y&=-y,c.lanes|=y,y=f1(y),h1(y,a,c,m),hg(c,y),!1}c=c.return}while(c!==null);return!1}var zg=Error(r(461)),dn=!1;function Kn(a,s,c,m){s.child=a===null?vC(s,null,c,m):Bs(s,a.child,c,m)}function m1(a,s,c,m,y){c=c.render;var w=s.ref;if("ref"in m){var N={};for(var M in m)M!=="ref"&&(N[M]=m[M])}else N=m;return Is(s),m=yg(a,s,c,N,w,y),M=xg(),a!==null&&!dn?(wg(a,s,y),$i(a,s,y)):(Ze&&M&&eg(s),s.flags|=1,Kn(a,s,m,y),s.child)}function p1(a,s,c,m,y){if(a===null){var w=c.type;return typeof w=="function"&&!Xv(w)&&w.defaultProps===void 0&&c.compare===null?(s.tag=15,s.type=w,b1(a,s,w,m,y)):(a=wh(c.type,null,m,s,s.mode,y),a.ref=s.ref,a.return=s,s.child=a)}if(w=a.child,!Gg(a,y)){var N=w.memoizedProps;if(c=c.compare,c=c!==null?c:Wu,c(N,m)&&a.ref===s.ref)return $i(a,s,y)}return s.flags|=1,a=Ii(w,m),a.ref=s.ref,a.return=s,s.child=a}function b1(a,s,c,m,y){if(a!==null){var w=a.memoizedProps;if(Wu(w,m)&&a.ref===s.ref)if(dn=!1,s.pendingProps=m=w,Gg(a,y))(a.flags&131072)!==0&&(dn=!0);else return s.lanes=a.lanes,$i(a,s,y)}return Ug(a,s,c,m,y)}function v1(a,s,c,m){var y=m.children,w=a!==null?a.memoizedState:null;if(a===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((s.flags&128)!==0){if(w=w!==null?w.baseLanes|c:c,a!==null){for(m=s.child=a.child,y=0;m!==null;)y=y|m.lanes|m.childLanes,m=m.sibling;m=y&~w}else m=0,s.child=null;return g1(a,s,w,c,m)}if((c&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},a!==null&&jh(s,w!==null?w.cachePool:null),w!==null?xC(s,w):pg(),wC(s);else return m=s.lanes=536870912,g1(a,s,w!==null?w.baseLanes|c:c,c,m)}else w!==null?(jh(s,w.cachePool),xC(s,w),zo(),s.memoizedState=null):(a!==null&&jh(s,null),pg(),zo());return Kn(a,s,y,c),s.child}function cd(a,s){return a!==null&&a.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function g1(a,s,c,m,y){var w=cg();return w=w===null?null:{parent:cn._currentValue,pool:w},s.memoizedState={baseLanes:c,cachePool:w},a!==null&&jh(s,null),pg(),wC(s),a!==null&&Vl(a,s,m,!0),s.childLanes=y,null}function Bh(a,s){return s=$h({mode:s.mode,children:s.children},a.mode),s.ref=a.ref,a.child=s,s.return=a,s}function y1(a,s,c){return Bs(s,a.child,null,c),a=Bh(s,s.pendingProps),a.flags|=2,Gr(s),s.memoizedState=null,a}function MB(a,s,c){var m=s.pendingProps,y=(s.flags&128)!==0;if(s.flags&=-129,a===null){if(Ze){if(m.mode==="hidden")return a=Bh(s,m),s.lanes=536870912,cd(null,a);if(vg(s),(a=Tt)?(a=_O(a,ua),a=a!==null&&a.data==="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Po!==null?{id:Za,overflow:Ja}:null,retryLane:536870912,hydrationErrors:null},c=nC(a),c.return=s,s.child=c,Fn=s,Tt=null)):a=null,a===null)throw Do(s);return s.lanes=536870912,null}return Bh(s,m)}var w=a.memoizedState;if(w!==null){var N=w.dehydrated;if(vg(s),y)if(s.flags&256)s.flags&=-257,s=y1(a,s,c);else if(s.memoizedState!==null)s.child=a.child,s.flags|=128,s=null;else throw Error(r(558));else if(dn||Vl(a,s,c,!1),y=(c&a.childLanes)!==0,dn||y){if(m=wt,m!==null&&(N=Nn(m,c),N!==0&&N!==w.retryLane))throw w.retryLane=N,Ms(a,N),Pr(m,a,N),zg;Zh(),s=y1(a,s,c)}else a=w.treeContext,Tt=fa(N.nextSibling),Fn=s,Ze=!0,_o=null,ua=!1,a!==null&&iC(s,a),s=Bh(s,m),s.flags|=4096;return s}return a=Ii(a.child,{mode:m.mode,children:m.children}),a.ref=s.ref,s.child=a,a.return=s,a}function Fh(a,s){var c=s.ref;if(c===null)a!==null&&a.ref!==null&&(s.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(a===null||a.ref!==c)&&(s.flags|=4194816)}}function Ug(a,s,c,m,y){return Is(s),c=yg(a,s,c,m,void 0,y),m=xg(),a!==null&&!dn?(wg(a,s,y),$i(a,s,y)):(Ze&&m&&eg(s),s.flags|=1,Kn(a,s,c,y),s.child)}function x1(a,s,c,m,y,w){return Is(s),s.updateQueue=null,c=EC(s,m,c,y),SC(a),m=xg(),a!==null&&!dn?(wg(a,s,w),$i(a,s,w)):(Ze&&m&&eg(s),s.flags|=1,Kn(a,s,c,w),s.child)}function w1(a,s,c,m,y){if(Is(s),s.stateNode===null){var w=Gl,N=c.contextType;typeof N=="object"&&N!==null&&(w=$n(N)),w=new c(m,w),s.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Lg,s.stateNode=w,w._reactInternals=s,w=s.stateNode,w.props=m,w.state=s.memoizedState,w.refs={},dg(s),N=c.contextType,w.context=typeof N=="object"&&N!==null?$n(N):Gl,w.state=s.memoizedState,N=c.getDerivedStateFromProps,typeof N=="function"&&(kg(s,c,N,m),w.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(N=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),N!==w.state&&Lg.enqueueReplaceState(w,w.state,null),ad(s,m,w,y),rd(),w.state=s.memoizedState),typeof w.componentDidMount=="function"&&(s.flags|=4194308),m=!0}else if(a===null){w=s.stateNode;var M=s.memoizedProps,U=$s(c,M);w.props=U;var X=w.context,ie=c.contextType;N=Gl,typeof ie=="object"&&ie!==null&&(N=$n(ie));var se=c.getDerivedStateFromProps;ie=typeof se=="function"||typeof w.getSnapshotBeforeUpdate=="function",M=s.pendingProps!==M,ie||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(M||X!==N)&&s1(s,w,m,N),Ro=!1;var ee=s.memoizedState;w.state=ee,ad(s,m,w,y),rd(),X=s.memoizedState,M||ee!==X||Ro?(typeof se=="function"&&(kg(s,c,se,m),X=s.memoizedState),(U=Ro||o1(s,c,U,m,ee,X,N))?(ie||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(s.flags|=4194308)):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=m,s.memoizedState=X),w.props=m,w.state=X,w.context=N,m=U):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),m=!1)}else{w=s.stateNode,fg(a,s),N=s.memoizedProps,ie=$s(c,N),w.props=ie,se=s.pendingProps,ee=w.context,X=c.contextType,U=Gl,typeof X=="object"&&X!==null&&(U=$n(X)),M=c.getDerivedStateFromProps,(X=typeof M=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N!==se||ee!==U)&&s1(s,w,m,U),Ro=!1,ee=s.memoizedState,w.state=ee,ad(s,m,w,y),rd();var re=s.memoizedState;N!==se||ee!==re||Ro||a!==null&&a.dependencies!==null&&Eh(a.dependencies)?(typeof M=="function"&&(kg(s,c,M,m),re=s.memoizedState),(ie=Ro||o1(s,c,ie,m,ee,re,U)||a!==null&&a.dependencies!==null&&Eh(a.dependencies))?(X||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(m,re,U),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(m,re,U)),typeof w.componentDidUpdate=="function"&&(s.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof w.componentDidUpdate!="function"||N===a.memoizedProps&&ee===a.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&ee===a.memoizedState||(s.flags|=1024),s.memoizedProps=m,s.memoizedState=re),w.props=m,w.state=re,w.context=U,m=ie):(typeof w.componentDidUpdate!="function"||N===a.memoizedProps&&ee===a.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&ee===a.memoizedState||(s.flags|=1024),m=!1)}return w=m,Fh(a,s),m=(s.flags&128)!==0,w||m?(w=s.stateNode,c=m&&typeof c.getDerivedStateFromError!="function"?null:w.render(),s.flags|=1,a!==null&&m?(s.child=Bs(s,a.child,null,y),s.child=Bs(s,null,c,y)):Kn(a,s,c,y),s.memoizedState=w.state,a=s.child):a=$i(a,s,y),a}function S1(a,s,c,m){return ks(),s.flags|=256,Kn(a,s,c,m),s.child}var qg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bg(a){return{baseLanes:a,cachePool:dC()}}function Fg(a,s,c){return a=a!==null?a.childLanes&~c:0,s&&(a|=Wr),a}function E1(a,s,c){var m=s.pendingProps,y=!1,w=(s.flags&128)!==0,N;if((N=w)||(N=a!==null&&a.memoizedState===null?!1:(nn.current&2)!==0),N&&(y=!0,s.flags&=-129),N=(s.flags&32)!==0,s.flags&=-33,a===null){if(Ze){if(y?Io(s):zo(),(a=Tt)?(a=_O(a,ua),a=a!==null&&a.data!=="&"?a:null,a!==null&&(s.memoizedState={dehydrated:a,treeContext:Po!==null?{id:Za,overflow:Ja}:null,retryLane:536870912,hydrationErrors:null},c=nC(a),c.return=s,s.child=c,Fn=s,Tt=null)):a=null,a===null)throw Do(s);return Ay(a)?s.lanes=32:s.lanes=536870912,null}var M=m.children;return m=m.fallback,y?(zo(),y=s.mode,M=$h({mode:"hidden",children:M},y),m=Rs(m,y,c,null),M.return=s,m.return=s,M.sibling=m,s.child=M,m=s.child,m.memoizedState=Bg(c),m.childLanes=Fg(a,N,c),s.memoizedState=qg,cd(null,m)):(Io(s),$g(s,M))}var U=a.memoizedState;if(U!==null&&(M=U.dehydrated,M!==null)){if(w)s.flags&256?(Io(s),s.flags&=-257,s=Kg(a,s,c)):s.memoizedState!==null?(zo(),s.child=a.child,s.flags|=128,s=null):(zo(),M=m.fallback,y=s.mode,m=$h({mode:"visible",children:m.children},y),M=Rs(M,y,c,null),M.flags|=2,m.return=s,M.return=s,m.sibling=M,s.child=m,Bs(s,a.child,null,c),m=s.child,m.memoizedState=Bg(c),m.childLanes=Fg(a,N,c),s.memoizedState=qg,s=cd(null,m));else if(Io(s),Ay(M)){if(N=M.nextSibling&&M.nextSibling.dataset,N)var X=N.dgst;N=X,m=Error(r(419)),m.stack="",m.digest=N,Xu({value:m,source:null,stack:null}),s=Kg(a,s,c)}else if(dn||Vl(a,s,c,!1),N=(c&a.childLanes)!==0,dn||N){if(N=wt,N!==null&&(m=Nn(N,c),m!==0&&m!==U.retryLane))throw U.retryLane=m,Ms(a,m),Pr(N,a,m),zg;Ey(M)||Zh(),s=Kg(a,s,c)}else Ey(M)?(s.flags|=192,s.child=a.child,s=null):(a=U.treeContext,Tt=fa(M.nextSibling),Fn=s,Ze=!0,_o=null,ua=!1,a!==null&&iC(s,a),s=$g(s,m.children),s.flags|=4096);return s}return y?(zo(),M=m.fallback,y=s.mode,U=a.child,X=U.sibling,m=Ii(U,{mode:"hidden",children:m.children}),m.subtreeFlags=U.subtreeFlags&65011712,X!==null?M=Ii(X,M):(M=Rs(M,y,c,null),M.flags|=2),M.return=s,m.return=s,m.sibling=M,s.child=m,cd(null,m),m=s.child,M=a.child.memoizedState,M===null?M=Bg(c):(y=M.cachePool,y!==null?(U=cn._currentValue,y=y.parent!==U?{parent:U,pool:U}:y):y=dC(),M={baseLanes:M.baseLanes|c,cachePool:y}),m.memoizedState=M,m.childLanes=Fg(a,N,c),s.memoizedState=qg,cd(a.child,m)):(Io(s),c=a.child,a=c.sibling,c=Ii(c,{mode:"visible",children:m.children}),c.return=s,c.sibling=null,a!==null&&(N=s.deletions,N===null?(s.deletions=[a],s.flags|=16):N.push(a)),s.child=c,s.memoizedState=null,c)}function $g(a,s){return s=$h({mode:"visible",children:s},a.mode),s.return=a,a.child=s}function $h(a,s){return a=Kr(22,a,null,s),a.lanes=0,a}function Kg(a,s,c){return Bs(s,a.child,null,c),a=$g(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function A1(a,s,c){a.lanes|=s;var m=a.alternate;m!==null&&(m.lanes|=s),ig(a.return,s,c)}function Hg(a,s,c,m,y,w){var N=a.memoizedState;N===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:y,treeForkCount:w}:(N.isBackwards=s,N.rendering=null,N.renderingStartTime=0,N.last=m,N.tail=c,N.tailMode=y,N.treeForkCount=w)}function j1(a,s,c){var m=s.pendingProps,y=m.revealOrder,w=m.tail;m=m.children;var N=nn.current,M=(N&2)!==0;if(M?(N=N&1|2,s.flags|=128):N&=1,ce(nn,N),Kn(a,s,m,c),m=Ze?Vu:0,!M&&a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&A1(a,c,s);else if(a.tag===19)A1(a,c,s);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(y){case"forwards":for(c=s.child,y=null;c!==null;)a=c.alternate,a!==null&&_h(a)===null&&(y=c),c=c.sibling;c=y,c===null?(y=s.child,s.child=null):(y=c.sibling,c.sibling=null),Hg(s,!1,y,c,w,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,y=s.child,s.child=null;y!==null;){if(a=y.alternate,a!==null&&_h(a)===null){s.child=y;break}a=y.sibling,y.sibling=c,c=y,y=a}Hg(s,!0,c,null,w,m);break;case"together":Hg(s,!1,null,null,void 0,m);break;default:s.memoizedState=null}return s.child}function $i(a,s,c){if(a!==null&&(s.dependencies=a.dependencies),Bo|=s.lanes,(c&s.childLanes)===0)if(a!==null){if(Vl(a,s,c,!1),(c&s.childLanes)===0)return null}else return null;if(a!==null&&s.child!==a.child)throw Error(r(153));if(s.child!==null){for(a=s.child,c=Ii(a,a.pendingProps),s.child=c,c.return=s;a.sibling!==null;)a=a.sibling,c=c.sibling=Ii(a,a.pendingProps),c.return=s;c.sibling=null}return s.child}function Gg(a,s){return(a.lanes&s)!==0?!0:(a=a.dependencies,!!(a!==null&&Eh(a)))}function RB(a,s,c){switch(s.tag){case 3:Be(s,s.stateNode.containerInfo),Mo(s,cn,a.memoizedState.cache),ks();break;case 27:case 5:ue(s);break;case 4:Be(s,s.stateNode.containerInfo);break;case 10:Mo(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,vg(s),null;break;case 13:var m=s.memoizedState;if(m!==null)return m.dehydrated!==null?(Io(s),s.flags|=128,null):(c&s.child.childLanes)!==0?E1(a,s,c):(Io(s),a=$i(a,s,c),a!==null?a.sibling:null);Io(s);break;case 19:var y=(a.flags&128)!==0;if(m=(c&s.childLanes)!==0,m||(Vl(a,s,c,!1),m=(c&s.childLanes)!==0),y){if(m)return j1(a,s,c);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),ce(nn,nn.current),m)break;return null;case 22:return s.lanes=0,v1(a,s,c,s.pendingProps);case 24:Mo(s,cn,a.memoizedState.cache)}return $i(a,s,c)}function C1(a,s,c){if(a!==null)if(a.memoizedProps!==s.pendingProps)dn=!0;else{if(!Gg(a,c)&&(s.flags&128)===0)return dn=!1,RB(a,s,c);dn=(a.flags&131072)!==0}else dn=!1,Ze&&(s.flags&1048576)!==0&&aC(s,Vu,s.index);switch(s.lanes=0,s.tag){case 16:e:{var m=s.pendingProps;if(a=Us(s.elementType),s.type=a,typeof a=="function")Xv(a)?(m=$s(a,m),s.tag=1,s=w1(null,s,a,m,c)):(s.tag=0,s=Ug(null,s,a,m,c));else{if(a!=null){var y=a.$$typeof;if(y===T){s.tag=11,s=m1(null,s,a,m,c);break e}else if(y===D){s.tag=14,s=p1(null,s,a,m,c);break e}}throw s=$(a)||a,Error(r(306,s,""))}}return s;case 0:return Ug(a,s,s.type,s.pendingProps,c);case 1:return m=s.type,y=$s(m,s.pendingProps),w1(a,s,m,y,c);case 3:e:{if(Be(s,s.stateNode.containerInfo),a===null)throw Error(r(387));m=s.pendingProps;var w=s.memoizedState;y=w.element,fg(a,s),ad(s,m,null,c);var N=s.memoizedState;if(m=N.cache,Mo(s,cn,m),m!==w.cache&&og(s,[cn],c,!0),rd(),m=N.element,w.isDehydrated)if(w={element:m,isDehydrated:!1,cache:N.cache},s.updateQueue.baseState=w,s.memoizedState=w,s.flags&256){s=S1(a,s,m,c);break e}else if(m!==y){y=sa(Error(r(424)),s),Xu(y),s=S1(a,s,m,c);break e}else{switch(a=s.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Tt=fa(a.firstChild),Fn=s,Ze=!0,_o=null,ua=!0,c=vC(s,null,m,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(ks(),m===y){s=$i(a,s,c);break e}Kn(a,s,m,c)}s=s.child}return s;case 26:return Fh(a,s),a===null?(c=IO(s.type,null,s.pendingProps,null))?s.memoizedState=c:Ze||(c=s.type,a=s.pendingProps,m=im(Oe.current).createElement(c),m[ln]=s,m[Tn]=a,Hn(m,c,a),Bt(m),s.stateNode=m):s.memoizedState=IO(s.type,a.memoizedProps,s.pendingProps,a.memoizedState),null;case 27:return ue(s),a===null&&Ze&&(m=s.stateNode=RO(s.type,s.pendingProps,Oe.current),Fn=s,ua=!0,y=Tt,Go(s.type)?(jy=y,Tt=fa(m.firstChild)):Tt=y),Kn(a,s,s.pendingProps.children,c),Fh(a,s),a===null&&(s.flags|=4194304),s.child;case 5:return a===null&&Ze&&((y=m=Tt)&&(m=uF(m,s.type,s.pendingProps,ua),m!==null?(s.stateNode=m,Fn=s,Tt=fa(m.firstChild),ua=!1,y=!0):y=!1),y||Do(s)),ue(s),y=s.type,w=s.pendingProps,N=a!==null?a.memoizedProps:null,m=w.children,xy(y,w)?m=null:N!==null&&xy(y,N)&&(s.flags|=32),s.memoizedState!==null&&(y=yg(a,s,jB,null,null,c),Ad._currentValue=y),Fh(a,s),Kn(a,s,m,c),s.child;case 6:return a===null&&Ze&&((a=c=Tt)&&(c=dF(c,s.pendingProps,ua),c!==null?(s.stateNode=c,Fn=s,Tt=null,a=!0):a=!1),a||Do(s)),null;case 13:return E1(a,s,c);case 4:return Be(s,s.stateNode.containerInfo),m=s.pendingProps,a===null?s.child=Bs(s,null,m,c):Kn(a,s,m,c),s.child;case 11:return m1(a,s,s.type,s.pendingProps,c);case 7:return Kn(a,s,s.pendingProps,c),s.child;case 8:return Kn(a,s,s.pendingProps.children,c),s.child;case 12:return Kn(a,s,s.pendingProps.children,c),s.child;case 10:return m=s.pendingProps,Mo(s,s.type,m.value),Kn(a,s,m.children,c),s.child;case 9:return y=s.type._context,m=s.pendingProps.children,Is(s),y=$n(y),m=m(y),s.flags|=1,Kn(a,s,m,c),s.child;case 14:return p1(a,s,s.type,s.pendingProps,c);case 15:return b1(a,s,s.type,s.pendingProps,c);case 19:return j1(a,s,c);case 31:return MB(a,s,c);case 22:return v1(a,s,c,s.pendingProps);case 24:return Is(s),m=$n(cn),a===null?(y=cg(),y===null&&(y=wt,w=sg(),y.pooledCache=w,w.refCount++,w!==null&&(y.pooledCacheLanes|=c),y=w),s.memoizedState={parent:m,cache:y},dg(s),Mo(s,cn,y)):((a.lanes&c)!==0&&(fg(a,s),ad(s,null,null,c),rd()),y=a.memoizedState,w=s.memoizedState,y.parent!==m?(y={parent:m,cache:m},s.memoizedState=y,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=y),Mo(s,cn,m)):(m=w.cache,Mo(s,cn,m),m!==y.cache&&og(s,[cn],c,!0))),Kn(a,s,s.pendingProps.children,c),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ki(a){a.flags|=4}function Yg(a,s,c,m,y){if((s=(a.mode&32)!==0)&&(s=!1),s){if(a.flags|=16777216,(y&335544128)===y)if(a.stateNode.complete)a.flags|=8192;else if(J1())a.flags|=8192;else throw qs=Oh,ug}else a.flags&=-16777217}function O1(a,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!FO(s))if(J1())a.flags|=8192;else throw qs=Oh,ug}function Kh(a,s){s!==null&&(a.flags|=4),a.flags&16384&&(s=a.tag!==22?sn():536870912,a.lanes|=s,lc|=s)}function ud(a,s){if(!Ze)switch(a.tailMode){case"hidden":s=a.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function Pt(a){var s=a.alternate!==null&&a.alternate.child===a.child,c=0,m=0;if(s)for(var y=a.child;y!==null;)c|=y.lanes|y.childLanes,m|=y.subtreeFlags&65011712,m|=y.flags&65011712,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)c|=y.lanes|y.childLanes,m|=y.subtreeFlags,m|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=m,a.childLanes=c,s}function kB(a,s,c){var m=s.pendingProps;switch(tg(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(s),null;case 1:return Pt(s),null;case 3:return c=s.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),s.memoizedState.cache!==m&&(s.flags|=2048),qi(cn),he(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&(Ql(s)?Ki(s):a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,rg())),Pt(s),null;case 26:var y=s.type,w=s.memoizedState;return a===null?(Ki(s),w!==null?(Pt(s),O1(s,w)):(Pt(s),Yg(s,y,null,m,c))):w?w!==a.memoizedState?(Ki(s),Pt(s),O1(s,w)):(Pt(s),s.flags&=-16777217):(a=a.memoizedProps,a!==m&&Ki(s),Pt(s),Yg(s,y,a,m,c)),null;case 27:if(Ee(s),c=Oe.current,y=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==m&&Ki(s);else{if(!m){if(s.stateNode===null)throw Error(r(166));return Pt(s),null}a=fe.current,Ql(s)?oC(s):(a=RO(y,m,c),s.stateNode=a,Ki(s))}return Pt(s),null;case 5:if(Ee(s),y=s.type,a!==null&&s.stateNode!=null)a.memoizedProps!==m&&Ki(s);else{if(!m){if(s.stateNode===null)throw Error(r(166));return Pt(s),null}if(w=fe.current,Ql(s))oC(s);else{var N=im(Oe.current);switch(w){case 1:w=N.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:w=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":w=N.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":w=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":w=N.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof m.is=="string"?N.createElement("select",{is:m.is}):N.createElement("select"),m.multiple?w.multiple=!0:m.size&&(w.size=m.size);break;default:w=typeof m.is=="string"?N.createElement(y,{is:m.is}):N.createElement(y)}}w[ln]=s,w[Tn]=m;e:for(N=s.child;N!==null;){if(N.tag===5||N.tag===6)w.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===s)break e;for(;N.sibling===null;){if(N.return===null||N.return===s)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}s.stateNode=w;e:switch(Hn(w,y,m),y){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Ki(s)}}return Pt(s),Yg(s,s.type,a===null?null:a.memoizedProps,s.pendingProps,c),null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==m&&Ki(s);else{if(typeof m!="string"&&s.stateNode===null)throw Error(r(166));if(a=Oe.current,Ql(s)){if(a=s.stateNode,c=s.memoizedProps,m=null,y=Fn,y!==null)switch(y.tag){case 27:case 5:m=y.memoizedProps}a[ln]=s,a=!!(a.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||EO(a.nodeValue,c)),a||Do(s,!0)}else a=im(a).createTextNode(m),a[ln]=s,s.stateNode=a}return Pt(s),null;case 31:if(c=s.memoizedState,a===null||a.memoizedState!==null){if(m=Ql(s),c!==null){if(a===null){if(!m)throw Error(r(318));if(a=s.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[ln]=s}else ks(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Pt(s),a=!1}else c=rg(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=c),a=!0;if(!a)return s.flags&256?(Gr(s),s):(Gr(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Pt(s),null;case 13:if(m=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=Ql(s),m!==null&&m.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[ln]=s}else ks(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Pt(s),y=!1}else y=rg(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return s.flags&256?(Gr(s),s):(Gr(s),null)}return Gr(s),(s.flags&128)!==0?(s.lanes=c,s):(c=m!==null,a=a!==null&&a.memoizedState!==null,c&&(m=s.child,y=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(y=m.alternate.memoizedState.cachePool.pool),w=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(w=m.memoizedState.cachePool.pool),w!==y&&(m.flags|=2048)),c!==a&&c&&(s.child.flags|=8192),Kh(s,s.updateQueue),Pt(s),null);case 4:return he(),a===null&&py(s.stateNode.containerInfo),Pt(s),null;case 10:return qi(s.type),Pt(s),null;case 19:if(Q(nn),m=s.memoizedState,m===null)return Pt(s),null;if(y=(s.flags&128)!==0,w=m.rendering,w===null)if(y)ud(m,!1);else{if(Yt!==0||a!==null&&(a.flags&128)!==0)for(a=s.child;a!==null;){if(w=_h(a),w!==null){for(s.flags|=128,ud(m,!1),a=w.updateQueue,s.updateQueue=a,Kh(s,a),s.subtreeFlags=0,a=c,c=s.child;c!==null;)tC(c,a),c=c.sibling;return ce(nn,nn.current&1|2),Ze&&zi(s,m.treeForkCount),s.child}a=a.sibling}m.tail!==null&&Kt()>Qh&&(s.flags|=128,y=!0,ud(m,!1),s.lanes=4194304)}else{if(!y)if(a=_h(w),a!==null){if(s.flags|=128,y=!0,a=a.updateQueue,s.updateQueue=a,Kh(s,a),ud(m,!0),m.tail===null&&m.tailMode==="hidden"&&!w.alternate&&!Ze)return Pt(s),null}else 2*Kt()-m.renderingStartTime>Qh&&c!==536870912&&(s.flags|=128,y=!0,ud(m,!1),s.lanes=4194304);m.isBackwards?(w.sibling=s.child,s.child=w):(a=m.last,a!==null?a.sibling=w:s.child=w,m.last=w)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=Kt(),a.sibling=null,c=nn.current,ce(nn,y?c&1|2:c&1),Ze&&zi(s,m.treeForkCount),a):(Pt(s),null);case 22:case 23:return Gr(s),bg(),m=s.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(s.flags|=8192):m&&(s.flags|=8192),m?(c&536870912)!==0&&(s.flags&128)===0&&(Pt(s),s.subtreeFlags&6&&(s.flags|=8192)):Pt(s),c=s.updateQueue,c!==null&&Kh(s,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),m=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==c&&(s.flags|=2048),a!==null&&Q(zs),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),qi(cn),Pt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function LB(a,s){switch(tg(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return qi(cn),he(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return Ee(s),null;case 31:if(s.memoizedState!==null){if(Gr(s),s.alternate===null)throw Error(r(340));ks()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 13:if(Gr(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));ks()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return Q(nn),null;case 4:return he(),null;case 10:return qi(s.type),null;case 22:case 23:return Gr(s),bg(),a!==null&&Q(zs),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return qi(cn),null;case 25:return null;default:return null}}function N1(a,s){switch(tg(s),s.tag){case 3:qi(cn),he();break;case 26:case 27:case 5:Ee(s);break;case 4:he();break;case 31:s.memoizedState!==null&&Gr(s);break;case 13:Gr(s);break;case 19:Q(nn);break;case 10:qi(s.type);break;case 22:case 23:Gr(s),bg(),a!==null&&Q(zs);break;case 24:qi(cn)}}function dd(a,s){try{var c=s.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var y=m.next;c=y;do{if((c.tag&a)===a){m=void 0;var w=c.create,N=c.inst;m=w(),N.destroy=m}c=c.next}while(c!==y)}}catch(M){mt(s,s.return,M)}}function Uo(a,s,c){try{var m=s.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var w=y.next;m=w;do{if((m.tag&a)===a){var N=m.inst,M=N.destroy;if(M!==void 0){N.destroy=void 0,y=s;var U=c,X=M;try{X()}catch(ie){mt(y,U,ie)}}}m=m.next}while(m!==w)}}catch(ie){mt(s,s.return,ie)}}function T1(a){var s=a.updateQueue;if(s!==null){var c=a.stateNode;try{yC(s,c)}catch(m){mt(a,a.return,m)}}}function P1(a,s,c){c.props=$s(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(m){mt(a,s,m)}}function fd(a,s){try{var c=a.ref;if(c!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof c=="function"?a.refCleanup=c(m):c.current=m}}catch(y){mt(a,s,y)}}function ei(a,s){var c=a.ref,m=a.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(y){mt(a,s,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(y){mt(a,s,y)}else c.current=null}function _1(a){var s=a.type,c=a.memoizedProps,m=a.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":c.autoFocus&&m.focus();break e;case"img":c.src?m.src=c.src:c.srcSet&&(m.srcset=c.srcSet)}}catch(y){mt(a,a.return,y)}}function Wg(a,s,c){try{var m=a.stateNode;aF(m,a.type,c,s),m[Tn]=s}catch(y){mt(a,a.return,y)}}function D1(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Go(a.type)||a.tag===4}function Qg(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||D1(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Go(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Vg(a,s,c){var m=a.tag;if(m===5||m===6)a=a.stateNode,s?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(a,s):(s=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,s.appendChild(a),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=ki));else if(m!==4&&(m===27&&Go(a.type)&&(c=a.stateNode,s=null),a=a.child,a!==null))for(Vg(a,s,c),a=a.sibling;a!==null;)Vg(a,s,c),a=a.sibling}function Hh(a,s,c){var m=a.tag;if(m===5||m===6)a=a.stateNode,s?c.insertBefore(a,s):c.appendChild(a);else if(m!==4&&(m===27&&Go(a.type)&&(c=a.stateNode),a=a.child,a!==null))for(Hh(a,s,c),a=a.sibling;a!==null;)Hh(a,s,c),a=a.sibling}function M1(a){var s=a.stateNode,c=a.memoizedProps;try{for(var m=a.type,y=s.attributes;y.length;)s.removeAttributeNode(y[0]);Hn(s,m,c),s[ln]=a,s[Tn]=c}catch(w){mt(a,a.return,w)}}var Hi=!1,fn=!1,Xg=!1,R1=typeof WeakSet=="function"?WeakSet:Set,Pn=null;function IB(a,s){if(a=a.containerInfo,gy=fm,a=Gj(a),Kv(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else e:{c=(c=a.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var y=m.anchorOffset,w=m.focusNode;m=m.focusOffset;try{c.nodeType,w.nodeType}catch{c=null;break e}var N=0,M=-1,U=-1,X=0,ie=0,se=a,ee=null;t:for(;;){for(var re;se!==c||y!==0&&se.nodeType!==3||(M=N+y),se!==w||m!==0&&se.nodeType!==3||(U=N+m),se.nodeType===3&&(N+=se.nodeValue.length),(re=se.firstChild)!==null;)ee=se,se=re;for(;;){if(se===a)break t;if(ee===c&&++X===y&&(M=N),ee===w&&++ie===m&&(U=N),(re=se.nextSibling)!==null)break;se=ee,ee=se.parentNode}se=re}c=M===-1||U===-1?null:{start:M,end:U}}else c=null}c=c||{start:0,end:0}}else c=null;for(yy={focusedElem:a,selectionRange:c},fm=!1,Pn=s;Pn!==null;)if(s=Pn,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,Pn=a;else for(;Pn!==null;){switch(s=Pn,w=s.alternate,a=s.flags,s.tag){case 0:if((a&4)!==0&&(a=s.updateQueue,a=a!==null?a.events:null,a!==null))for(c=0;c<a.length;c++)y=a[c],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&w!==null){a=void 0,c=s,y=w.memoizedProps,w=w.memoizedState,m=c.stateNode;try{var Ae=$s(c.type,y);a=m.getSnapshotBeforeUpdate(Ae,w),m.__reactInternalSnapshotBeforeUpdate=a}catch(De){mt(c,c.return,De)}}break;case 3:if((a&1024)!==0){if(a=s.stateNode.containerInfo,c=a.nodeType,c===9)Sy(a);else if(c===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Sy(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=s.sibling,a!==null){a.return=s.return,Pn=a;break}Pn=s.return}}function k1(a,s,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:Yi(a,c),m&4&&dd(5,c);break;case 1:if(Yi(a,c),m&4)if(a=c.stateNode,s===null)try{a.componentDidMount()}catch(N){mt(c,c.return,N)}else{var y=$s(c.type,s.memoizedProps);s=s.memoizedState;try{a.componentDidUpdate(y,s,a.__reactInternalSnapshotBeforeUpdate)}catch(N){mt(c,c.return,N)}}m&64&&T1(c),m&512&&fd(c,c.return);break;case 3:if(Yi(a,c),m&64&&(a=c.updateQueue,a!==null)){if(s=null,c.child!==null)switch(c.child.tag){case 27:case 5:s=c.child.stateNode;break;case 1:s=c.child.stateNode}try{yC(a,s)}catch(N){mt(c,c.return,N)}}break;case 27:s===null&&m&4&&M1(c);case 26:case 5:Yi(a,c),s===null&&m&4&&_1(c),m&512&&fd(c,c.return);break;case 12:Yi(a,c);break;case 31:Yi(a,c),m&4&&z1(a,c);break;case 13:Yi(a,c),m&4&&U1(a,c),m&64&&(a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(c=GB.bind(null,c),fF(a,c))));break;case 22:if(m=c.memoizedState!==null||Hi,!m){s=s!==null&&s.memoizedState!==null||fn,y=Hi;var w=fn;Hi=m,(fn=s)&&!w?Wi(a,c,(c.subtreeFlags&8772)!==0):Yi(a,c),Hi=y,fn=w}break;case 30:break;default:Yi(a,c)}}function L1(a){var s=a.alternate;s!==null&&(a.alternate=null,L1(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&zu(s)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var kt=null,Cr=!1;function Gi(a,s,c){for(c=c.child;c!==null;)I1(a,s,c),c=c.sibling}function I1(a,s,c){if(bn&&typeof bn.onCommitFiberUnmount=="function")try{bn.onCommitFiberUnmount(Qa,c)}catch{}switch(c.tag){case 26:fn||ei(c,s),Gi(a,s,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:fn||ei(c,s);var m=kt,y=Cr;Go(c.type)&&(kt=c.stateNode,Cr=!1),Gi(a,s,c),wd(c.stateNode),kt=m,Cr=y;break;case 5:fn||ei(c,s);case 6:if(m=kt,y=Cr,kt=null,Gi(a,s,c),kt=m,Cr=y,kt!==null)if(Cr)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(c.stateNode)}catch(w){mt(c,s,w)}else try{kt.removeChild(c.stateNode)}catch(w){mt(c,s,w)}break;case 18:kt!==null&&(Cr?(a=kt,TO(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,c.stateNode),bc(a)):TO(kt,c.stateNode));break;case 4:m=kt,y=Cr,kt=c.stateNode.containerInfo,Cr=!0,Gi(a,s,c),kt=m,Cr=y;break;case 0:case 11:case 14:case 15:Uo(2,c,s),fn||Uo(4,c,s),Gi(a,s,c);break;case 1:fn||(ei(c,s),m=c.stateNode,typeof m.componentWillUnmount=="function"&&P1(c,s,m)),Gi(a,s,c);break;case 21:Gi(a,s,c);break;case 22:fn=(m=fn)||c.memoizedState!==null,Gi(a,s,c),fn=m;break;default:Gi(a,s,c)}}function z1(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{bc(a)}catch(c){mt(s,s.return,c)}}}function U1(a,s){if(s.memoizedState===null&&(a=s.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{bc(a)}catch(c){mt(s,s.return,c)}}function zB(a){switch(a.tag){case 31:case 13:case 19:var s=a.stateNode;return s===null&&(s=a.stateNode=new R1),s;case 22:return a=a.stateNode,s=a._retryCache,s===null&&(s=a._retryCache=new R1),s;default:throw Error(r(435,a.tag))}}function Gh(a,s){var c=zB(a);s.forEach(function(m){if(!c.has(m)){c.add(m);var y=YB.bind(null,a,m);m.then(y,y)}})}function Or(a,s){var c=s.deletions;if(c!==null)for(var m=0;m<c.length;m++){var y=c[m],w=a,N=s,M=N;e:for(;M!==null;){switch(M.tag){case 27:if(Go(M.type)){kt=M.stateNode,Cr=!1;break e}break;case 5:kt=M.stateNode,Cr=!1;break e;case 3:case 4:kt=M.stateNode.containerInfo,Cr=!0;break e}M=M.return}if(kt===null)throw Error(r(160));I1(w,N,y),kt=null,Cr=!1,w=y.alternate,w!==null&&(w.return=null),y.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)q1(s,a),s=s.sibling}var _a=null;function q1(a,s){var c=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Or(s,a),Nr(a),m&4&&(Uo(3,a,a.return),dd(3,a),Uo(5,a,a.return));break;case 1:Or(s,a),Nr(a),m&512&&(fn||c===null||ei(c,c.return)),m&64&&Hi&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=c===null?m:c.concat(m))));break;case 26:var y=_a;if(Or(s,a),Nr(a),m&512&&(fn||c===null||ei(c,c.return)),m&4){var w=c!==null?c.memoizedState:null;if(m=a.memoizedState,c===null)if(m===null)if(a.stateNode===null){e:{m=a.type,c=a.memoizedProps,y=y.ownerDocument||y;t:switch(m){case"title":w=y.getElementsByTagName("title")[0],(!w||w[Fr]||w[ln]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=y.createElement(m),y.head.insertBefore(w,y.querySelector("head > title"))),Hn(w,m,c),w[ln]=a,Bt(w),m=w;break e;case"link":var N=qO("link","href",y).get(m+(c.href||""));if(N){for(var M=0;M<N.length;M++)if(w=N[M],w.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&w.getAttribute("rel")===(c.rel==null?null:c.rel)&&w.getAttribute("title")===(c.title==null?null:c.title)&&w.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){N.splice(M,1);break t}}w=y.createElement(m),Hn(w,m,c),y.head.appendChild(w);break;case"meta":if(N=qO("meta","content",y).get(m+(c.content||""))){for(M=0;M<N.length;M++)if(w=N[M],w.getAttribute("content")===(c.content==null?null:""+c.content)&&w.getAttribute("name")===(c.name==null?null:c.name)&&w.getAttribute("property")===(c.property==null?null:c.property)&&w.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&w.getAttribute("charset")===(c.charSet==null?null:c.charSet)){N.splice(M,1);break t}}w=y.createElement(m),Hn(w,m,c),y.head.appendChild(w);break;default:throw Error(r(468,m))}w[ln]=a,Bt(w),m=w}a.stateNode=m}else BO(y,a.type,a.stateNode);else a.stateNode=UO(y,m,a.memoizedProps);else w!==m?(w===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):w.count--,m===null?BO(y,a.type,a.stateNode):UO(y,m,a.memoizedProps)):m===null&&a.stateNode!==null&&Wg(a,a.memoizedProps,c.memoizedProps)}break;case 27:Or(s,a),Nr(a),m&512&&(fn||c===null||ei(c,c.return)),c!==null&&m&4&&Wg(a,a.memoizedProps,c.memoizedProps);break;case 5:if(Or(s,a),Nr(a),m&512&&(fn||c===null||ei(c,c.return)),a.flags&32){y=a.stateNode;try{Ul(y,"")}catch(Ae){mt(a,a.return,Ae)}}m&4&&a.stateNode!=null&&(y=a.memoizedProps,Wg(a,y,c!==null?c.memoizedProps:y)),m&1024&&(Xg=!0);break;case 6:if(Or(s,a),Nr(a),m&4){if(a.stateNode===null)throw Error(r(162));m=a.memoizedProps,c=a.stateNode;try{c.nodeValue=m}catch(Ae){mt(a,a.return,Ae)}}break;case 3:if(lm=null,y=_a,_a=om(s.containerInfo),Or(s,a),_a=y,Nr(a),m&4&&c!==null&&c.memoizedState.isDehydrated)try{bc(s.containerInfo)}catch(Ae){mt(a,a.return,Ae)}Xg&&(Xg=!1,B1(a));break;case 4:m=_a,_a=om(a.stateNode.containerInfo),Or(s,a),Nr(a),_a=m;break;case 12:Or(s,a),Nr(a);break;case 31:Or(s,a),Nr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gh(a,m)));break;case 13:Or(s,a),Nr(a),a.child.flags&8192&&a.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Wh=Kt()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gh(a,m)));break;case 22:y=a.memoizedState!==null;var U=c!==null&&c.memoizedState!==null,X=Hi,ie=fn;if(Hi=X||y,fn=ie||U,Or(s,a),fn=ie,Hi=X,Nr(a),m&8192)e:for(s=a.stateNode,s._visibility=y?s._visibility&-2:s._visibility|1,y&&(c===null||U||Hi||fn||Ks(a)),c=null,s=a;;){if(s.tag===5||s.tag===26){if(c===null){U=c=s;try{if(w=U.stateNode,y)N=w.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{M=U.stateNode;var se=U.memoizedProps.style,ee=se!=null&&se.hasOwnProperty("display")?se.display:null;M.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(Ae){mt(U,U.return,Ae)}}}else if(s.tag===6){if(c===null){U=s;try{U.stateNode.nodeValue=y?"":U.memoizedProps}catch(Ae){mt(U,U.return,Ae)}}}else if(s.tag===18){if(c===null){U=s;try{var re=U.stateNode;y?PO(re,!0):PO(U.stateNode,!1)}catch(Ae){mt(U,U.return,Ae)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===a)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;c===s&&(c=null),s=s.return}c===s&&(c=null),s.sibling.return=s.return,s=s.sibling}m&4&&(m=a.updateQueue,m!==null&&(c=m.retryQueue,c!==null&&(m.retryQueue=null,Gh(a,c))));break;case 19:Or(s,a),Nr(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Gh(a,m)));break;case 30:break;case 21:break;default:Or(s,a),Nr(a)}}function Nr(a){var s=a.flags;if(s&2){try{for(var c,m=a.return;m!==null;){if(D1(m)){c=m;break}m=m.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var y=c.stateNode,w=Qg(a);Hh(a,w,y);break;case 5:var N=c.stateNode;c.flags&32&&(Ul(N,""),c.flags&=-33);var M=Qg(a);Hh(a,M,N);break;case 3:case 4:var U=c.stateNode.containerInfo,X=Qg(a);Vg(a,X,U);break;default:throw Error(r(161))}}catch(ie){mt(a,a.return,ie)}a.flags&=-3}s&4096&&(a.flags&=-4097)}function B1(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var s=a;B1(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),a=a.sibling}}function Yi(a,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)k1(a,s.alternate,s),s=s.sibling}function Ks(a){for(a=a.child;a!==null;){var s=a;switch(s.tag){case 0:case 11:case 14:case 15:Uo(4,s,s.return),Ks(s);break;case 1:ei(s,s.return);var c=s.stateNode;typeof c.componentWillUnmount=="function"&&P1(s,s.return,c),Ks(s);break;case 27:wd(s.stateNode);case 26:case 5:ei(s,s.return),Ks(s);break;case 22:s.memoizedState===null&&Ks(s);break;case 30:Ks(s);break;default:Ks(s)}a=a.sibling}}function Wi(a,s,c){for(c=c&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var m=s.alternate,y=a,w=s,N=w.flags;switch(w.tag){case 0:case 11:case 15:Wi(y,w,c),dd(4,w);break;case 1:if(Wi(y,w,c),m=w,y=m.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(X){mt(m,m.return,X)}if(m=w,y=m.updateQueue,y!==null){var M=m.stateNode;try{var U=y.shared.hiddenCallbacks;if(U!==null)for(y.shared.hiddenCallbacks=null,y=0;y<U.length;y++)gC(U[y],M)}catch(X){mt(m,m.return,X)}}c&&N&64&&T1(w),fd(w,w.return);break;case 27:M1(w);case 26:case 5:Wi(y,w,c),c&&m===null&&N&4&&_1(w),fd(w,w.return);break;case 12:Wi(y,w,c);break;case 31:Wi(y,w,c),c&&N&4&&z1(y,w);break;case 13:Wi(y,w,c),c&&N&4&&U1(y,w);break;case 22:w.memoizedState===null&&Wi(y,w,c),fd(w,w.return);break;case 30:break;default:Wi(y,w,c)}s=s.sibling}}function Zg(a,s){var c=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),a=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(a=s.memoizedState.cachePool.pool),a!==c&&(a!=null&&a.refCount++,c!=null&&Zu(c))}function Jg(a,s){a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Zu(a))}function Da(a,s,c,m){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)F1(a,s,c,m),s=s.sibling}function F1(a,s,c,m){var y=s.flags;switch(s.tag){case 0:case 11:case 15:Da(a,s,c,m),y&2048&&dd(9,s);break;case 1:Da(a,s,c,m);break;case 3:Da(a,s,c,m),y&2048&&(a=null,s.alternate!==null&&(a=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==a&&(s.refCount++,a!=null&&Zu(a)));break;case 12:if(y&2048){Da(a,s,c,m),a=s.stateNode;try{var w=s.memoizedProps,N=w.id,M=w.onPostCommit;typeof M=="function"&&M(N,s.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(U){mt(s,s.return,U)}}else Da(a,s,c,m);break;case 31:Da(a,s,c,m);break;case 13:Da(a,s,c,m);break;case 23:break;case 22:w=s.stateNode,N=s.alternate,s.memoizedState!==null?w._visibility&2?Da(a,s,c,m):hd(a,s):w._visibility&2?Da(a,s,c,m):(w._visibility|=2,ic(a,s,c,m,(s.subtreeFlags&10256)!==0||!1)),y&2048&&Zg(N,s);break;case 24:Da(a,s,c,m),y&2048&&Jg(s.alternate,s);break;default:Da(a,s,c,m)}}function ic(a,s,c,m,y){for(y=y&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var w=a,N=s,M=c,U=m,X=N.flags;switch(N.tag){case 0:case 11:case 15:ic(w,N,M,U,y),dd(8,N);break;case 23:break;case 22:var ie=N.stateNode;N.memoizedState!==null?ie._visibility&2?ic(w,N,M,U,y):hd(w,N):(ie._visibility|=2,ic(w,N,M,U,y)),y&&X&2048&&Zg(N.alternate,N);break;case 24:ic(w,N,M,U,y),y&&X&2048&&Jg(N.alternate,N);break;default:ic(w,N,M,U,y)}s=s.sibling}}function hd(a,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var c=a,m=s,y=m.flags;switch(m.tag){case 22:hd(c,m),y&2048&&Zg(m.alternate,m);break;case 24:hd(c,m),y&2048&&Jg(m.alternate,m);break;default:hd(c,m)}s=s.sibling}}var md=8192;function oc(a,s,c){if(a.subtreeFlags&md)for(a=a.child;a!==null;)$1(a,s,c),a=a.sibling}function $1(a,s,c){switch(a.tag){case 26:oc(a,s,c),a.flags&md&&a.memoizedState!==null&&AF(c,_a,a.memoizedState,a.memoizedProps);break;case 5:oc(a,s,c);break;case 3:case 4:var m=_a;_a=om(a.stateNode.containerInfo),oc(a,s,c),_a=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=md,md=16777216,oc(a,s,c),md=m):oc(a,s,c));break;default:oc(a,s,c)}}function K1(a){var s=a.alternate;if(s!==null&&(a=s.child,a!==null)){s.child=null;do s=a.sibling,a.sibling=null,a=s;while(a!==null)}}function pd(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var m=s[c];Pn=m,G1(m,a)}K1(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)H1(a),a=a.sibling}function H1(a){switch(a.tag){case 0:case 11:case 15:pd(a),a.flags&2048&&Uo(9,a,a.return);break;case 3:pd(a);break;case 12:pd(a);break;case 22:var s=a.stateNode;a.memoizedState!==null&&s._visibility&2&&(a.return===null||a.return.tag!==13)?(s._visibility&=-3,Yh(a)):pd(a);break;default:pd(a)}}function Yh(a){var s=a.deletions;if((a.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var m=s[c];Pn=m,G1(m,a)}K1(a)}for(a=a.child;a!==null;){switch(s=a,s.tag){case 0:case 11:case 15:Uo(8,s,s.return),Yh(s);break;case 22:c=s.stateNode,c._visibility&2&&(c._visibility&=-3,Yh(s));break;default:Yh(s)}a=a.sibling}}function G1(a,s){for(;Pn!==null;){var c=Pn;switch(c.tag){case 0:case 11:case 15:Uo(8,c,s);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var m=c.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Zu(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,Pn=m;else e:for(c=a;Pn!==null;){m=Pn;var y=m.sibling,w=m.return;if(L1(m),m===c){Pn=null;break e}if(y!==null){y.return=w,Pn=y;break e}Pn=w}}}var UB={getCacheForType:function(a){var s=$n(cn),c=s.data.get(a);return c===void 0&&(c=a(),s.data.set(a,c)),c},cacheSignal:function(){return $n(cn).controller.signal}},qB=typeof WeakMap=="function"?WeakMap:Map,lt=0,wt=null,We=null,Ve=0,ht=0,Yr=null,qo=!1,sc=!1,ey=!1,Qi=0,Yt=0,Bo=0,Hs=0,ty=0,Wr=0,lc=0,bd=null,Tr=null,ny=!1,Wh=0,Y1=0,Qh=1/0,Vh=null,Fo=null,vn=0,$o=null,cc=null,Vi=0,ry=0,ay=null,W1=null,vd=0,iy=null;function Qr(){return(lt&2)!==0&&Ve!==0?Ve&-Ve:K.T!==null?dy():nt()}function Q1(){if(Wr===0)if((Ve&536870912)===0||Ze){var a=Va;Va<<=1,(Va&3932160)===0&&(Va=262144),Wr=a}else Wr=536870912;return a=Hr.current,a!==null&&(a.flags|=32),Wr}function Pr(a,s,c){(a===wt&&(ht===2||ht===9)||a.cancelPendingCommit!==null)&&(uc(a,0),Ko(a,Ve,Wr,!1)),Er(a,c),((lt&2)===0||a!==wt)&&(a===wt&&((lt&2)===0&&(Hs|=c),Yt===4&&Ko(a,Ve,Wr,!1)),ti(a))}function V1(a,s,c){if((lt&6)!==0)throw Error(r(327));var m=!c&&(s&127)===0&&(s&a.expiredLanes)===0||Ot(a,s),y=m?$B(a,s):sy(a,s,!0),w=m;do{if(y===0){sc&&!m&&Ko(a,s,0,!1);break}else{if(c=a.current.alternate,w&&!BB(c)){y=sy(a,s,!1),w=!1;continue}if(y===2){if(w=s,a.errorRecoveryDisabledLanes&w)var N=0;else N=a.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){s=N;e:{var M=a;y=bd;var U=M.current.memoizedState.isDehydrated;if(U&&(uc(M,N).flags|=256),N=sy(M,N,!1),N!==2){if(ey&&!U){M.errorRecoveryDisabledLanes|=w,Hs|=w,y=4;break e}w=Tr,Tr=y,w!==null&&(Tr===null?Tr=w:Tr.push.apply(Tr,w))}y=N}if(w=!1,y!==2)continue}}if(y===1){uc(a,0),Ko(a,s,0,!0);break}e:{switch(m=a,w=y,w){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Ko(m,s,Wr,!qo);break e;case 2:Tr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(y=Wh+300-Kt(),10<y)){if(Ko(m,s,Wr,!qo),Ut(m,0,!0)!==0)break e;Vi=s,m.timeoutHandle=OO(X1.bind(null,m,c,Tr,Vh,ny,s,Wr,Hs,lc,qo,w,"Throttled",-0,0),y);break e}X1(m,c,Tr,Vh,ny,s,Wr,Hs,lc,qo,w,null,-0,0)}}break}while(!0);ti(a)}function X1(a,s,c,m,y,w,N,M,U,X,ie,se,ee,re){if(a.timeoutHandle=-1,se=s.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ki},$1(s,w,se);var Ae=(w&62914560)===w?Wh-Kt():(w&4194048)===w?Y1-Kt():0;if(Ae=jF(se,Ae),Ae!==null){Vi=w,a.cancelPendingCommit=Ae(iO.bind(null,a,s,w,c,m,y,N,M,U,ie,se,null,ee,re)),Ko(a,w,N,!X);return}}iO(a,s,w,c,m,y,N,M,U)}function BB(a){for(var s=a;;){var c=s.tag;if((c===0||c===11||c===15)&&s.flags&16384&&(c=s.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var m=0;m<c.length;m++){var y=c[m],w=y.getSnapshot;y=y.value;try{if(!$r(w(),y))return!1}catch{return!1}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ko(a,s,c,m){s&=~ty,s&=~Hs,a.suspendedLanes|=s,a.pingedLanes&=~s,m&&(a.warmLanes|=s),m=a.expirationTimes;for(var y=s;0<y;){var w=31-zt(y),N=1<<w;m[w]=-1,y&=~N}c!==0&&cr(a,c,s)}function Xh(){return(lt&6)===0?(gd(0),!1):!0}function oy(){if(We!==null){if(ht===0)var a=We.return;else a=We,Ui=Ls=null,Sg(a),ec=null,ed=0,a=We;for(;a!==null;)N1(a.alternate,a),a=a.return;We=null}}function uc(a,s){var c=a.timeoutHandle;c!==-1&&(a.timeoutHandle=-1,sF(c)),c=a.cancelPendingCommit,c!==null&&(a.cancelPendingCommit=null,c()),Vi=0,oy(),wt=a,We=c=Ii(a.current,null),Ve=s,ht=0,Yr=null,qo=!1,sc=Ot(a,s),ey=!1,lc=Wr=ty=Hs=Bo=Yt=0,Tr=bd=null,ny=!1,(s&8)!==0&&(s|=s&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=s;0<m;){var y=31-zt(m),w=1<<y;s|=a[y],m&=~w}return Qi=s,gh(),c}function Z1(a,s){Fe=null,K.H=ld,s===Jl||s===Ch?(s=mC(),ht=3):s===ug?(s=mC(),ht=4):ht=s===zg?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Yr=s,We===null&&(Yt=1,qh(a,sa(s,a.current)))}function J1(){var a=Hr.current;return a===null?!0:(Ve&4194048)===Ve?da===null:(Ve&62914560)===Ve||(Ve&536870912)!==0?a===da:!1}function eO(){var a=K.H;return K.H=ld,a===null?ld:a}function tO(){var a=K.A;return K.A=UB,a}function Zh(){Yt=4,qo||(Ve&4194048)!==Ve&&Hr.current!==null||(sc=!0),(Bo&134217727)===0&&(Hs&134217727)===0||wt===null||Ko(wt,Ve,Wr,!1)}function sy(a,s,c){var m=lt;lt|=2;var y=eO(),w=tO();(wt!==a||Ve!==s)&&(Vh=null,uc(a,s)),s=!1;var N=Yt;e:do try{if(ht!==0&&We!==null){var M=We,U=Yr;switch(ht){case 8:oy(),N=6;break e;case 3:case 2:case 9:case 6:Hr.current===null&&(s=!0);var X=ht;if(ht=0,Yr=null,dc(a,M,U,X),c&&sc){N=0;break e}break;default:X=ht,ht=0,Yr=null,dc(a,M,U,X)}}FB(),N=Yt;break}catch(ie){Z1(a,ie)}while(!0);return s&&a.shellSuspendCounter++,Ui=Ls=null,lt=m,K.H=y,K.A=w,We===null&&(wt=null,Ve=0,gh()),N}function FB(){for(;We!==null;)nO(We)}function $B(a,s){var c=lt;lt|=2;var m=eO(),y=tO();wt!==a||Ve!==s?(Vh=null,Qh=Kt()+500,uc(a,s)):sc=Ot(a,s);e:do try{if(ht!==0&&We!==null){s=We;var w=Yr;t:switch(ht){case 1:ht=0,Yr=null,dc(a,s,w,1);break;case 2:case 9:if(fC(w)){ht=0,Yr=null,rO(s);break}s=function(){ht!==2&&ht!==9||wt!==a||(ht=7),ti(a)},w.then(s,s);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:fC(w)?(ht=0,Yr=null,rO(s)):(ht=0,Yr=null,dc(a,s,w,7));break;case 5:var N=null;switch(We.tag){case 26:N=We.memoizedState;case 5:case 27:var M=We;if(N?FO(N):M.stateNode.complete){ht=0,Yr=null;var U=M.sibling;if(U!==null)We=U;else{var X=M.return;X!==null?(We=X,Jh(X)):We=null}break t}}ht=0,Yr=null,dc(a,s,w,5);break;case 6:ht=0,Yr=null,dc(a,s,w,6);break;case 8:oy(),Yt=6;break e;default:throw Error(r(462))}}KB();break}catch(ie){Z1(a,ie)}while(!0);return Ui=Ls=null,K.H=m,K.A=y,lt=c,We!==null?0:(wt=null,Ve=0,gh(),Yt)}function KB(){for(;We!==null&&!Oi();)nO(We)}function nO(a){var s=C1(a.alternate,a,Qi);a.memoizedProps=a.pendingProps,s===null?Jh(a):We=s}function rO(a){var s=a,c=s.alternate;switch(s.tag){case 15:case 0:s=x1(c,s,s.pendingProps,s.type,void 0,Ve);break;case 11:s=x1(c,s,s.pendingProps,s.type.render,s.ref,Ve);break;case 5:Sg(s);default:N1(c,s),s=We=tC(s,Qi),s=C1(c,s,Qi)}a.memoizedProps=a.pendingProps,s===null?Jh(a):We=s}function dc(a,s,c,m){Ui=Ls=null,Sg(s),ec=null,ed=0;var y=s.return;try{if(DB(a,y,s,c,Ve)){Yt=1,qh(a,sa(c,a.current)),We=null;return}}catch(w){if(y!==null)throw We=y,w;Yt=1,qh(a,sa(c,a.current)),We=null;return}s.flags&32768?(Ze||m===1?a=!0:sc||(Ve&536870912)!==0?a=!1:(qo=a=!0,(m===2||m===9||m===3||m===6)&&(m=Hr.current,m!==null&&m.tag===13&&(m.flags|=16384))),aO(s,a)):Jh(s)}function Jh(a){var s=a;do{if((s.flags&32768)!==0){aO(s,qo);return}a=s.return;var c=kB(s.alternate,s,Qi);if(c!==null){We=c;return}if(s=s.sibling,s!==null){We=s;return}We=s=a}while(s!==null);Yt===0&&(Yt=5)}function aO(a,s){do{var c=LB(a.alternate,a);if(c!==null){c.flags&=32767,We=c;return}if(c=a.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!s&&(a=a.sibling,a!==null)){We=a;return}We=a=c}while(a!==null);Yt=6,We=null}function iO(a,s,c,m,y,w,N,M,U){a.cancelPendingCommit=null;do em();while(vn!==0);if((lt&6)!==0)throw Error(r(327));if(s!==null){if(s===a.current)throw Error(r(177));if(w=s.lanes|s.childLanes,w|=Qv,qt(a,c,w,N,M,U),a===wt&&(We=wt=null,Ve=0),cc=s,$o=a,Vi=c,ry=w,ay=y,W1=m,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,WB(Cn,function(){return uO(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||m){m=K.T,K.T=null,y=Z.p,Z.p=2,N=lt,lt|=4;try{IB(a,s,c)}finally{lt=N,Z.p=y,K.T=m}}vn=1,oO(),sO(),lO()}}function oO(){if(vn===1){vn=0;var a=$o,s=cc,c=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||c){c=K.T,K.T=null;var m=Z.p;Z.p=2;var y=lt;lt|=4;try{q1(s,a);var w=yy,N=Gj(a.containerInfo),M=w.focusedElem,U=w.selectionRange;if(N!==M&&M&&M.ownerDocument&&Hj(M.ownerDocument.documentElement,M)){if(U!==null&&Kv(M)){var X=U.start,ie=U.end;if(ie===void 0&&(ie=X),"selectionStart"in M)M.selectionStart=X,M.selectionEnd=Math.min(ie,M.value.length);else{var se=M.ownerDocument||document,ee=se&&se.defaultView||window;if(ee.getSelection){var re=ee.getSelection(),Ae=M.textContent.length,De=Math.min(U.start,Ae),vt=U.end===void 0?De:Math.min(U.end,Ae);!re.extend&&De>vt&&(N=vt,vt=De,De=N);var Y=Kj(M,De),H=Kj(M,vt);if(Y&&H&&(re.rangeCount!==1||re.anchorNode!==Y.node||re.anchorOffset!==Y.offset||re.focusNode!==H.node||re.focusOffset!==H.offset)){var V=se.createRange();V.setStart(Y.node,Y.offset),re.removeAllRanges(),De>vt?(re.addRange(V),re.extend(H.node,H.offset)):(V.setEnd(H.node,H.offset),re.addRange(V))}}}}for(se=[],re=M;re=re.parentNode;)re.nodeType===1&&se.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<se.length;M++){var oe=se[M];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}fm=!!gy,yy=gy=null}finally{lt=y,Z.p=m,K.T=c}}a.current=s,vn=2}}function sO(){if(vn===2){vn=0;var a=$o,s=cc,c=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||c){c=K.T,K.T=null;var m=Z.p;Z.p=2;var y=lt;lt|=4;try{k1(a,s.alternate,s)}finally{lt=y,Z.p=m,K.T=c}}vn=3}}function lO(){if(vn===4||vn===3){vn=0,zr();var a=$o,s=cc,c=Vi,m=W1;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?vn=5:(vn=0,cc=$o=null,cO(a,a.pendingLanes));var y=a.pendingLanes;if(y===0&&(Fo=null),Na(c),s=s.stateNode,bn&&typeof bn.onCommitFiberRoot=="function")try{bn.onCommitFiberRoot(Qa,s,void 0,(s.current.flags&128)===128)}catch{}if(m!==null){s=K.T,y=Z.p,Z.p=2,K.T=null;try{for(var w=a.onRecoverableError,N=0;N<m.length;N++){var M=m[N];w(M.value,{componentStack:M.stack})}}finally{K.T=s,Z.p=y}}(Vi&3)!==0&&em(),ti(a),y=a.pendingLanes,(c&261930)!==0&&(y&42)!==0?a===iy?vd++:(vd=0,iy=a):vd=0,gd(0)}}function cO(a,s){(a.pooledCacheLanes&=s)===0&&(s=a.pooledCache,s!=null&&(a.pooledCache=null,Zu(s)))}function em(){return oO(),sO(),lO(),uO()}function uO(){if(vn!==5)return!1;var a=$o,s=ry;ry=0;var c=Na(Vi),m=K.T,y=Z.p;try{Z.p=32>c?32:c,K.T=null,c=ay,ay=null;var w=$o,N=Vi;if(vn=0,cc=$o=null,Vi=0,(lt&6)!==0)throw Error(r(331));var M=lt;if(lt|=4,H1(w.current),F1(w,w.current,N,c),lt=M,gd(0,!1),bn&&typeof bn.onPostCommitFiberRoot=="function")try{bn.onPostCommitFiberRoot(Qa,w)}catch{}return!0}finally{Z.p=y,K.T=m,cO(a,s)}}function dO(a,s,c){s=sa(c,s),s=Ig(a.stateNode,s,2),a=Lo(a,s,2),a!==null&&(Er(a,2),ti(a))}function mt(a,s,c){if(a.tag===3)dO(a,a,c);else for(;s!==null;){if(s.tag===3){dO(s,a,c);break}else if(s.tag===1){var m=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Fo===null||!Fo.has(m))){a=sa(c,a),c=f1(2),m=Lo(s,c,2),m!==null&&(h1(c,m,s,a),Er(m,2),ti(m));break}}s=s.return}}function ly(a,s,c){var m=a.pingCache;if(m===null){m=a.pingCache=new qB;var y=new Set;m.set(s,y)}else y=m.get(s),y===void 0&&(y=new Set,m.set(s,y));y.has(c)||(ey=!0,y.add(c),a=HB.bind(null,a,s,c),s.then(a,a))}function HB(a,s,c){var m=a.pingCache;m!==null&&m.delete(s),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,wt===a&&(Ve&c)===c&&(Yt===4||Yt===3&&(Ve&62914560)===Ve&&300>Kt()-Wh?(lt&2)===0&&uc(a,0):ty|=c,lc===Ve&&(lc=0)),ti(a)}function fO(a,s){s===0&&(s=sn()),a=Ms(a,s),a!==null&&(Er(a,s),ti(a))}function GB(a){var s=a.memoizedState,c=0;s!==null&&(c=s.retryLane),fO(a,c)}function YB(a,s){var c=0;switch(a.tag){case 31:case 13:var m=a.stateNode,y=a.memoizedState;y!==null&&(c=y.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(s),fO(a,c)}function WB(a,s){return Xn(a,s)}var tm=null,fc=null,cy=!1,nm=!1,uy=!1,Ho=0;function ti(a){a!==fc&&a.next===null&&(fc===null?tm=fc=a:fc=fc.next=a),nm=!0,cy||(cy=!0,VB())}function gd(a,s){if(!uy&&nm){uy=!0;do for(var c=!1,m=tm;m!==null;){if(a!==0){var y=m.pendingLanes;if(y===0)var w=0;else{var N=m.suspendedLanes,M=m.pingedLanes;w=(1<<31-zt(42|a)+1)-1,w&=y&~(N&~M),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(c=!0,bO(m,w))}else w=Ve,w=Ut(m,m===wt?w:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(w&3)===0||Ot(m,w)||(c=!0,bO(m,w));m=m.next}while(c);uy=!1}}function QB(){hO()}function hO(){nm=cy=!1;var a=0;Ho!==0&&oF()&&(a=Ho);for(var s=Kt(),c=null,m=tm;m!==null;){var y=m.next,w=mO(m,s);w===0?(m.next=null,c===null?tm=y:c.next=y,y===null&&(fc=c)):(c=m,(a!==0||(w&3)!==0)&&(nm=!0)),m=y}vn!==0&&vn!==5||gd(a),Ho!==0&&(Ho=0)}function mO(a,s){for(var c=a.suspendedLanes,m=a.pingedLanes,y=a.expirationTimes,w=a.pendingLanes&-62914561;0<w;){var N=31-zt(w),M=1<<N,U=y[N];U===-1?((M&c)===0||(M&m)!==0)&&(y[N]=en(M,s)):U<=s&&(a.expiredLanes|=M),w&=~M}if(s=wt,c=Ve,c=Ut(a,a===s?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,c===0||a===s&&(ht===2||ht===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&ja(m),a.callbackNode=null,a.callbackPriority=0;if((c&3)===0||Ot(a,c)){if(s=c&-c,s===a.callbackPriority)return s;switch(m!==null&&ja(m),Na(c)){case 2:case 8:c=Ur;break;case 32:c=Cn;break;case 268435456:c=Wa;break;default:c=Cn}return m=pO.bind(null,a),c=Xn(c,m),a.callbackPriority=s,a.callbackNode=c,s}return m!==null&&m!==null&&ja(m),a.callbackPriority=2,a.callbackNode=null,2}function pO(a,s){if(vn!==0&&vn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var c=a.callbackNode;if(em()&&a.callbackNode!==c)return null;var m=Ve;return m=Ut(a,a===wt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(V1(a,m,s),mO(a,Kt()),a.callbackNode!=null&&a.callbackNode===c?pO.bind(null,a):null)}function bO(a,s){if(em())return null;V1(a,s,!0)}function VB(){lF(function(){(lt&6)!==0?Xn(Eo,QB):hO()})}function dy(){if(Ho===0){var a=Xl;a===0&&(a=Ni,Ni<<=1,(Ni&261888)===0&&(Ni=256)),Ho=a}return Ho}function vO(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:uh(""+a)}function gO(a,s){var c=s.ownerDocument.createElement("input");return c.name=s.name,c.value=s.value,a.id&&c.setAttribute("form",a.id),s.parentNode.insertBefore(c,s),a=new FormData(a),c.parentNode.removeChild(c),a}function XB(a,s,c,m,y){if(s==="submit"&&c&&c.stateNode===y){var w=vO((y[Tn]||null).action),N=m.submitter;N&&(s=(s=N[Tn]||null)?vO(s.formAction):N.getAttribute("formAction"),s!==null&&(w=s,N=null));var M=new mh("action","action",null,m,y);a.push({event:M,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Ho!==0){var U=N?gO(y,N):new FormData(y);_g(c,{pending:!0,data:U,method:y.method,action:w},null,U)}}else typeof w=="function"&&(M.preventDefault(),U=N?gO(y,N):new FormData(y),_g(c,{pending:!0,data:U,method:y.method,action:w},w,U))},currentTarget:y}]})}}for(var fy=0;fy<Wv.length;fy++){var hy=Wv[fy],ZB=hy.toLowerCase(),JB=hy[0].toUpperCase()+hy.slice(1);Pa(ZB,"on"+JB)}Pa(Qj,"onAnimationEnd"),Pa(Vj,"onAnimationIteration"),Pa(Xj,"onAnimationStart"),Pa("dblclick","onDoubleClick"),Pa("focusin","onFocus"),Pa("focusout","onBlur"),Pa(pB,"onTransitionRun"),Pa(bB,"onTransitionStart"),Pa(vB,"onTransitionCancel"),Pa(Zj,"onTransitionEnd"),Di("onMouseEnter",["mouseout","mouseover"]),Di("onMouseLeave",["mouseout","mouseover"]),Di("onPointerEnter",["pointerout","pointerover"]),Di("onPointerLeave",["pointerout","pointerover"]),Bn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),eF=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yd));function yO(a,s){s=(s&4)!==0;for(var c=0;c<a.length;c++){var m=a[c],y=m.event;m=m.listeners;e:{var w=void 0;if(s)for(var N=m.length-1;0<=N;N--){var M=m[N],U=M.instance,X=M.currentTarget;if(M=M.listener,U!==w&&y.isPropagationStopped())break e;w=M,y.currentTarget=X;try{w(y)}catch(ie){vh(ie)}y.currentTarget=null,w=U}else for(N=0;N<m.length;N++){if(M=m[N],U=M.instance,X=M.currentTarget,M=M.listener,U!==w&&y.isPropagationStopped())break e;w=M,y.currentTarget=X;try{w(y)}catch(ie){vh(ie)}y.currentTarget=null,w=U}}}}function Qe(a,s){var c=s[zl];c===void 0&&(c=s[zl]=new Set);var m=a+"__bubble";c.has(m)||(xO(s,a,2,!1),c.add(m))}function my(a,s,c){var m=0;s&&(m|=4),xO(c,a,m,s)}var rm="_reactListening"+Math.random().toString(36).slice(2);function py(a){if(!a[rm]){a[rm]=!0,_i.forEach(function(c){c!=="selectionchange"&&(eF.has(c)||my(c,!1,a),my(c,!0,a))});var s=a.nodeType===9?a:a.ownerDocument;s===null||s[rm]||(s[rm]=!0,my("selectionchange",!1,s))}}function xO(a,s,c,m){switch(QO(s)){case 2:var y=NF;break;case 8:y=TF;break;default:y=Py}c=y.bind(null,s,c,a),y=void 0,!kv||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(y=!0),m?y!==void 0?a.addEventListener(s,c,{capture:!0,passive:y}):a.addEventListener(s,c,!0):y!==void 0?a.addEventListener(s,c,{passive:y}):a.addEventListener(s,c,!1)}function by(a,s,c,m,y){var w=m;if((s&1)===0&&(s&2)===0&&m!==null)e:for(;;){if(m===null)return;var N=m.tag;if(N===3||N===4){var M=m.stateNode.containerInfo;if(M===y)break;if(N===4)for(N=m.return;N!==null;){var U=N.tag;if((U===3||U===4)&&N.stateNode.containerInfo===y)return;N=N.return}for(;M!==null;){if(N=jo(M),N===null)return;if(U=N.tag,U===5||U===6||U===26||U===27){m=w=N;continue e}M=M.parentNode}}m=m.return}jj(function(){var X=w,ie=Mv(c),se=[];e:{var ee=Jj.get(a);if(ee!==void 0){var re=mh,Ae=a;switch(a){case"keypress":if(fh(c)===0)break e;case"keydown":case"keyup":re=Yq;break;case"focusin":Ae="focus",re=Uv;break;case"focusout":Ae="blur",re=Uv;break;case"beforeblur":case"afterblur":re=Uv;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=Nj;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=kq;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=Vq;break;case Qj:case Vj:case Xj:re=zq;break;case Zj:re=Zq;break;case"scroll":case"scrollend":re=Mq;break;case"wheel":re=eB;break;case"copy":case"cut":case"paste":re=qq;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=Pj;break;case"toggle":case"beforetoggle":re=nB}var De=(s&4)!==0,vt=!De&&(a==="scroll"||a==="scrollend"),Y=De?ee!==null?ee+"Capture":null:ee;De=[];for(var H=X,V;H!==null;){var oe=H;if(V=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||V===null||Y===null||(oe=Bu(H,Y),oe!=null&&De.push(xd(H,oe,V))),vt)break;H=H.return}0<De.length&&(ee=new re(ee,Ae,null,c,ie),se.push({event:ee,listeners:De}))}}if((s&7)===0){e:{if(ee=a==="mouseover"||a==="pointerover",re=a==="mouseout"||a==="pointerout",ee&&c!==Dv&&(Ae=c.relatedTarget||c.fromElement)&&(jo(Ae)||Ae[Ti]))break e;if((re||ee)&&(ee=ie.window===ie?ie:(ee=ie.ownerDocument)?ee.defaultView||ee.parentWindow:window,re?(Ae=c.relatedTarget||c.toElement,re=X,Ae=Ae?jo(Ae):null,Ae!==null&&(vt=o(Ae),De=Ae.tag,Ae!==vt||De!==5&&De!==27&&De!==6)&&(Ae=null)):(re=null,Ae=X),re!==Ae)){if(De=Nj,oe="onMouseLeave",Y="onMouseEnter",H="mouse",(a==="pointerout"||a==="pointerover")&&(De=Pj,oe="onPointerLeave",Y="onPointerEnter",H="pointer"),vt=re==null?ee:Co(re),V=Ae==null?ee:Co(Ae),ee=new De(oe,H+"leave",re,c,ie),ee.target=vt,ee.relatedTarget=V,oe=null,jo(ie)===X&&(De=new De(Y,H+"enter",Ae,c,ie),De.target=V,De.relatedTarget=vt,oe=De),vt=oe,re&&Ae)t:{for(De=tF,Y=re,H=Ae,V=0,oe=Y;oe;oe=De(oe))V++;oe=0;for(var Pe=H;Pe;Pe=De(Pe))oe++;for(;0<V-oe;)Y=De(Y),V--;for(;0<oe-V;)H=De(H),oe--;for(;V--;){if(Y===H||H!==null&&Y===H.alternate){De=Y;break t}Y=De(Y),H=De(H)}De=null}else De=null;re!==null&&wO(se,ee,re,De,!1),Ae!==null&&vt!==null&&wO(se,vt,Ae,De,!0)}}e:{if(ee=X?Co(X):window,re=ee.nodeName&&ee.nodeName.toLowerCase(),re==="select"||re==="input"&&ee.type==="file")var at=zj;else if(Lj(ee))if(Uj)at=fB;else{at=uB;var Ce=cB}else re=ee.nodeName,!re||re.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?X&&_v(X.elementType)&&(at=zj):at=dB;if(at&&(at=at(a,X))){Ij(se,at,c,ie);break e}Ce&&Ce(a,ee,X),a==="focusout"&&X&&ee.type==="number"&&X.memoizedProps.value!=null&&Ht(ee,"number",ee.value)}switch(Ce=X?Co(X):window,a){case"focusin":(Lj(Ce)||Ce.contentEditable==="true")&&($l=Ce,Hv=X,Qu=null);break;case"focusout":Qu=Hv=$l=null;break;case"mousedown":Gv=!0;break;case"contextmenu":case"mouseup":case"dragend":Gv=!1,Yj(se,c,ie);break;case"selectionchange":if(mB)break;case"keydown":case"keyup":Yj(se,c,ie)}var $e;if(Bv)e:{switch(a){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else Fl?Rj(a,c)&&(Xe="onCompositionEnd"):a==="keydown"&&c.keyCode===229&&(Xe="onCompositionStart");Xe&&(_j&&c.locale!=="ko"&&(Fl||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&Fl&&($e=Cj()):(To=ie,Lv="value"in To?To.value:To.textContent,Fl=!0)),Ce=am(X,Xe),0<Ce.length&&(Xe=new Tj(Xe,a,null,c,ie),se.push({event:Xe,listeners:Ce}),$e?Xe.data=$e:($e=kj(c),$e!==null&&(Xe.data=$e)))),($e=aB?iB(a,c):oB(a,c))&&(Xe=am(X,"onBeforeInput"),0<Xe.length&&(Ce=new Tj("onBeforeInput","beforeinput",null,c,ie),se.push({event:Ce,listeners:Xe}),Ce.data=$e)),XB(se,a,X,c,ie)}yO(se,s)})}function xd(a,s,c){return{instance:a,listener:s,currentTarget:c}}function am(a,s){for(var c=s+"Capture",m=[];a!==null;){var y=a,w=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||w===null||(y=Bu(a,c),y!=null&&m.unshift(xd(a,y,w)),y=Bu(a,s),y!=null&&m.push(xd(a,y,w))),a.tag===3)return m;a=a.return}return[]}function tF(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function wO(a,s,c,m,y){for(var w=s._reactName,N=[];c!==null&&c!==m;){var M=c,U=M.alternate,X=M.stateNode;if(M=M.tag,U!==null&&U===m)break;M!==5&&M!==26&&M!==27||X===null||(U=X,y?(X=Bu(c,w),X!=null&&N.unshift(xd(c,X,U))):y||(X=Bu(c,w),X!=null&&N.push(xd(c,X,U)))),c=c.return}N.length!==0&&a.push({event:s,listeners:N})}var nF=/\r\n?/g,rF=/\u0000|\uFFFD/g;function SO(a){return(typeof a=="string"?a:""+a).replace(nF,` 49 `).replace(rF,"")}function EO(a,s){return s=SO(s),SO(a)===s}function bt(a,s,c,m,y,w){switch(c){case"children":typeof m=="string"?s==="body"||s==="textarea"&&m===""||Ul(a,m):(typeof m=="number"||typeof m=="bigint")&&s!=="body"&&Ul(a,""+m);break;case"className":No(a,"class",m);break;case"tabIndex":No(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":No(a,c,m);break;case"style":Ej(a,m,w);break;case"data":if(s!=="object"){No(a,"data",m);break}case"src":case"href":if(m===""&&(s!=="a"||c!=="href")){a.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(c);break}m=uh(""+m),a.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(c==="formAction"?(s!=="input"&&bt(a,s,"name",y.name,y,null),bt(a,s,"formEncType",y.formEncType,y,null),bt(a,s,"formMethod",y.formMethod,y,null),bt(a,s,"formTarget",y.formTarget,y,null)):(bt(a,s,"encType",y.encType,y,null),bt(a,s,"method",y.method,y,null),bt(a,s,"target",y.target,y,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(c);break}m=uh(""+m),a.setAttribute(c,m);break;case"onClick":m!=null&&(a.onclick=ki);break;case"onScroll":m!=null&&Qe("scroll",a);break;case"onScrollEnd":m!=null&&Qe("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(c=m.__html,c!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=c}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}c=uh(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,""+m):a.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,""):a.removeAttribute(c);break;case"capture":case"download":m===!0?a.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,m):a.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(c,m):a.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(c):a.setAttribute(c,m);break;case"popover":Qe("beforetoggle",a),Qe("toggle",a),Mi(a,"popover",m);break;case"xlinkActuate":ve(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":ve(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":ve(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":ve(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":ve(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":ve(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":ve(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":ve(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":ve(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Mi(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=_q.get(c)||c,Mi(a,c,m))}}function vy(a,s,c,m,y,w){switch(c){case"style":Ej(a,m,w);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(c=m.__html,c!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=c}}break;case"children":typeof m=="string"?Ul(a,m):(typeof m=="number"||typeof m=="bigint")&&Ul(a,""+m);break;case"onScroll":m!=null&&Qe("scroll",a);break;case"onScrollEnd":m!=null&&Qe("scrollend",a);break;case"onClick":m!=null&&(a.onclick=ki);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Oo.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(y=c.endsWith("Capture"),s=c.slice(2,y?c.length-7:void 0),w=a[Tn]||null,w=w!=null?w[c]:null,typeof w=="function"&&a.removeEventListener(s,w,y),typeof m=="function")){typeof w!="function"&&w!==null&&(c in a?a[c]=null:a.hasAttribute(c)&&a.removeAttribute(c)),a.addEventListener(s,m,y);break e}c in a?a[c]=m:m===!0?a.setAttribute(c,""):Mi(a,c,m)}}}function Hn(a,s,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",a),Qe("load",a);var m=!1,y=!1,w;for(w in c)if(c.hasOwnProperty(w)){var N=c[w];if(N!=null)switch(w){case"src":m=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:bt(a,s,w,N,c,null)}}y&&bt(a,s,"srcSet",c.srcSet,c,null),m&&bt(a,s,"src",c.src,c,null);return;case"input":Qe("invalid",a);var M=w=N=y=null,U=null,X=null;for(m in c)if(c.hasOwnProperty(m)){var ie=c[m];if(ie!=null)switch(m){case"name":y=ie;break;case"type":N=ie;break;case"checked":U=ie;break;case"defaultChecked":X=ie;break;case"value":w=ie;break;case"defaultValue":M=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,s));break;default:bt(a,s,m,ie,c,null)}}Ta(a,w,M,U,X,N,y,!1);return;case"select":Qe("invalid",a),m=N=w=null;for(y in c)if(c.hasOwnProperty(y)&&(M=c[y],M!=null))switch(y){case"value":w=M;break;case"defaultValue":N=M;break;case"multiple":m=M;default:bt(a,s,y,M,c,null)}s=w,c=N,a.multiple=!!m,s!=null?Ri(a,!!m,s,!1):c!=null&&Ri(a,!!m,c,!0);return;case"textarea":Qe("invalid",a),w=y=m=null;for(N in c)if(c.hasOwnProperty(N)&&(M=c[N],M!=null))switch(N){case"value":m=M;break;case"defaultValue":y=M;break;case"children":w=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(91));break;default:bt(a,s,N,M,c,null)}wj(a,m,y,w);return;case"option":for(U in c)if(c.hasOwnProperty(U)&&(m=c[U],m!=null))switch(U){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:bt(a,s,U,m,c,null)}return;case"dialog":Qe("beforetoggle",a),Qe("toggle",a),Qe("cancel",a),Qe("close",a);break;case"iframe":case"object":Qe("load",a);break;case"video":case"audio":for(m=0;m<yd.length;m++)Qe(yd[m],a);break;case"image":Qe("error",a),Qe("load",a);break;case"details":Qe("toggle",a);break;case"embed":case"source":case"link":Qe("error",a),Qe("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in c)if(c.hasOwnProperty(X)&&(m=c[X],m!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:bt(a,s,X,m,c,null)}return;default:if(_v(s)){for(ie in c)c.hasOwnProperty(ie)&&(m=c[ie],m!==void 0&&vy(a,s,ie,m,c,void 0));return}}for(M in c)c.hasOwnProperty(M)&&(m=c[M],m!=null&&bt(a,s,M,m,c,null))}function aF(a,s,c,m){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,w=null,N=null,M=null,U=null,X=null,ie=null;for(re in c){var se=c[re];if(c.hasOwnProperty(re)&&se!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":U=se;default:m.hasOwnProperty(re)||bt(a,s,re,null,m,se)}}for(var ee in m){var re=m[ee];if(se=c[ee],m.hasOwnProperty(ee)&&(re!=null||se!=null))switch(ee){case"type":w=re;break;case"name":y=re;break;case"checked":X=re;break;case"defaultChecked":ie=re;break;case"value":N=re;break;case"defaultValue":M=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,s));break;default:re!==se&&bt(a,s,ee,re,m,se)}}Nt(a,N,M,U,X,ie,w,y);return;case"select":re=N=M=ee=null;for(w in c)if(U=c[w],c.hasOwnProperty(w)&&U!=null)switch(w){case"value":break;case"multiple":re=U;default:m.hasOwnProperty(w)||bt(a,s,w,null,m,U)}for(y in m)if(w=m[y],U=c[y],m.hasOwnProperty(y)&&(w!=null||U!=null))switch(y){case"value":ee=w;break;case"defaultValue":M=w;break;case"multiple":N=w;default:w!==U&&bt(a,s,y,w,m,U)}s=M,c=N,m=re,ee!=null?Ri(a,!!c,ee,!1):!!m!=!!c&&(s!=null?Ri(a,!!c,s,!0):Ri(a,!!c,c?[]:"",!1));return;case"textarea":re=ee=null;for(M in c)if(y=c[M],c.hasOwnProperty(M)&&y!=null&&!m.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:bt(a,s,M,null,m,y)}for(N in m)if(y=m[N],w=c[N],m.hasOwnProperty(N)&&(y!=null||w!=null))switch(N){case"value":ee=y;break;case"defaultValue":re=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==w&&bt(a,s,N,y,m,w)}qu(a,ee,re);return;case"option":for(var Ae in c)if(ee=c[Ae],c.hasOwnProperty(Ae)&&ee!=null&&!m.hasOwnProperty(Ae))switch(Ae){case"selected":a.selected=!1;break;default:bt(a,s,Ae,null,m,ee)}for(U in m)if(ee=m[U],re=c[U],m.hasOwnProperty(U)&&ee!==re&&(ee!=null||re!=null))switch(U){case"selected":a.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:bt(a,s,U,ee,m,re)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var De in c)ee=c[De],c.hasOwnProperty(De)&&ee!=null&&!m.hasOwnProperty(De)&&bt(a,s,De,null,m,ee);for(X in m)if(ee=m[X],re=c[X],m.hasOwnProperty(X)&&ee!==re&&(ee!=null||re!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(r(137,s));break;default:bt(a,s,X,ee,m,re)}return;default:if(_v(s)){for(var vt in c)ee=c[vt],c.hasOwnProperty(vt)&&ee!==void 0&&!m.hasOwnProperty(vt)&&vy(a,s,vt,void 0,m,ee);for(ie in m)ee=m[ie],re=c[ie],!m.hasOwnProperty(ie)||ee===re||ee===void 0&&re===void 0||vy(a,s,ie,ee,m,re);return}}for(var Y in c)ee=c[Y],c.hasOwnProperty(Y)&&ee!=null&&!m.hasOwnProperty(Y)&&bt(a,s,Y,null,m,ee);for(se in m)ee=m[se],re=c[se],!m.hasOwnProperty(se)||ee===re||ee==null&&re==null||bt(a,s,se,ee,m,re)}function AO(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iF(){if(typeof performance.getEntriesByType=="function"){for(var a=0,s=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var y=c[m],w=y.transferSize,N=y.initiatorType,M=y.duration;if(w&&M&&AO(N)){for(N=0,M=y.responseEnd,m+=1;m<c.length;m++){var U=c[m],X=U.startTime;if(X>M)break;var ie=U.transferSize,se=U.initiatorType;ie&&AO(se)&&(U=U.responseEnd,N+=ie*(U<M?1:(M-X)/(U-X)))}if(--m,s+=8*(w+N)/(y.duration/1e3),a++,10<a)break}}if(0<a)return s/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var gy=null,yy=null;function im(a){return a.nodeType===9?a:a.ownerDocument}function jO(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function CO(a,s){if(a===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&s==="foreignObject"?0:a}function xy(a,s){return a==="textarea"||a==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var wy=null;function oF(){var a=window.event;return a&&a.type==="popstate"?a===wy?!1:(wy=a,!0):(wy=null,!1)}var OO=typeof setTimeout=="function"?setTimeout:void 0,sF=typeof clearTimeout=="function"?clearTimeout:void 0,NO=typeof Promise=="function"?Promise:void 0,lF=typeof queueMicrotask=="function"?queueMicrotask:typeof NO<"u"?function(a){return NO.resolve(null).then(a).catch(cF)}:OO;function cF(a){setTimeout(function(){throw a})}function Go(a){return a==="head"}function TO(a,s){var c=s,m=0;do{var y=c.nextSibling;if(a.removeChild(c),y&&y.nodeType===8)if(c=y.data,c==="/$"||c==="/&"){if(m===0){a.removeChild(y),bc(s);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")wd(a.ownerDocument.documentElement);else if(c==="head"){c=a.ownerDocument.head,wd(c);for(var w=c.firstChild;w;){var N=w.nextSibling,M=w.nodeName;w[Fr]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&w.rel.toLowerCase()==="stylesheet"||c.removeChild(w),w=N}}else c==="body"&&wd(a.ownerDocument.body);c=y}while(c);bc(s)}function PO(a,s){var c=a;a=0;do{var m=c.nextSibling;if(c.nodeType===1?s?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(s?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(a===0)break;a--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||a++;c=m}while(c)}function Sy(a){var s=a.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var c=s;switch(s=s.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Sy(c),zu(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}a.removeChild(c)}}function uF(a,s,c,m){for(;a.nodeType===1;){var y=c;if(a.nodeName.toLowerCase()!==s.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Fr])switch(s){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(w=a.getAttribute("rel"),w==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(w!==y.rel||a.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(w=a.getAttribute("src"),(w!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&w&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(s==="input"&&a.type==="hidden"){var w=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===w)return a}else return a;if(a=fa(a.nextSibling),a===null)break}return null}function dF(a,s,c){if(s==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=fa(a.nextSibling),a===null))return null;return a}function _O(a,s){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!s||(a=fa(a.nextSibling),a===null))return null;return a}function Ey(a){return a.data==="$?"||a.data==="$~"}function Ay(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function fF(a,s){var c=a.ownerDocument;if(a.data==="$~")a._reactRetry=s;else if(a.data!=="$?"||c.readyState!=="loading")s();else{var m=function(){s(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function fa(a){for(;a!=null;a=a.nextSibling){var s=a.nodeType;if(s===1||s===3)break;if(s===8){if(s=a.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return a}var jy=null;function DO(a){a=a.nextSibling;for(var s=0;a;){if(a.nodeType===8){var c=a.data;if(c==="/$"||c==="/&"){if(s===0)return fa(a.nextSibling);s--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||s++}a=a.nextSibling}return null}function MO(a){a=a.previousSibling;for(var s=0;a;){if(a.nodeType===8){var c=a.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(s===0)return a;s--}else c!=="/$"&&c!=="/&"||s++}a=a.previousSibling}return null}function RO(a,s,c){switch(s=im(c),a){case"html":if(a=s.documentElement,!a)throw Error(r(452));return a;case"head":if(a=s.head,!a)throw Error(r(453));return a;case"body":if(a=s.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function wd(a){for(var s=a.attributes;s.length;)a.removeAttributeNode(s[0]);zu(a)}var ha=new Map,kO=new Set;function om(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Xi=Z.d;Z.d={f:hF,r:mF,D:pF,C:bF,L:vF,m:gF,X:xF,S:yF,M:wF};function hF(){var a=Xi.f(),s=Xh();return a||s}function mF(a){var s=Pi(a);s!==null&&s.tag===5&&s.type==="form"?ZC(s):Xi.r(a)}var hc=typeof document>"u"?null:document;function LO(a,s,c){var m=hc;if(m&&typeof s=="string"&&s){var y=Ge(s);y='link[rel="'+a+'"][href="'+y+'"]',typeof c=="string"&&(y+='[crossorigin="'+c+'"]'),kO.has(y)||(kO.add(y),a={rel:a,crossOrigin:c,href:s},m.querySelector(y)===null&&(s=m.createElement("link"),Hn(s,"link",a),Bt(s),m.head.appendChild(s)))}}function pF(a){Xi.D(a),LO("dns-prefetch",a,null)}function bF(a,s){Xi.C(a,s),LO("preconnect",a,s)}function vF(a,s,c){Xi.L(a,s,c);var m=hc;if(m&&a&&s){var y='link[rel="preload"][as="'+Ge(s)+'"]';s==="image"&&c&&c.imageSrcSet?(y+='[imagesrcset="'+Ge(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(y+='[imagesizes="'+Ge(c.imageSizes)+'"]')):y+='[href="'+Ge(a)+'"]';var w=y;switch(s){case"style":w=mc(a);break;case"script":w=pc(a)}ha.has(w)||(a=b({rel:"preload",href:s==="image"&&c&&c.imageSrcSet?void 0:a,as:s},c),ha.set(w,a),m.querySelector(y)!==null||s==="style"&&m.querySelector(Sd(w))||s==="script"&&m.querySelector(Ed(w))||(s=m.createElement("link"),Hn(s,"link",a),Bt(s),m.head.appendChild(s)))}}function gF(a,s){Xi.m(a,s);var c=hc;if(c&&a){var m=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+Ge(m)+'"][href="'+Ge(a)+'"]',w=y;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=pc(a)}if(!ha.has(w)&&(a=b({rel:"modulepreload",href:a},s),ha.set(w,a),c.querySelector(y)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Ed(w)))return}m=c.createElement("link"),Hn(m,"link",a),Bt(m),c.head.appendChild(m)}}}function yF(a,s,c){Xi.S(a,s,c);var m=hc;if(m&&a){var y=Xa(m).hoistableStyles,w=mc(a);s=s||"default";var N=y.get(w);if(!N){var M={loading:0,preload:null};if(N=m.querySelector(Sd(w)))M.loading=5;else{a=b({rel:"stylesheet",href:a,"data-precedence":s},c),(c=ha.get(w))&&Cy(a,c);var U=N=m.createElement("link");Bt(U),Hn(U,"link",a),U._p=new Promise(function(X,ie){U.onload=X,U.onerror=ie}),U.addEventListener("load",function(){M.loading|=1}),U.addEventListener("error",function(){M.loading|=2}),M.loading|=4,sm(N,s,m)}N={type:"stylesheet",instance:N,count:1,state:M},y.set(w,N)}}}function xF(a,s){Xi.X(a,s);var c=hc;if(c&&a){var m=Xa(c).hoistableScripts,y=pc(a),w=m.get(y);w||(w=c.querySelector(Ed(y)),w||(a=b({src:a,async:!0},s),(s=ha.get(y))&&Oy(a,s),w=c.createElement("script"),Bt(w),Hn(w,"link",a),c.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},m.set(y,w))}}function wF(a,s){Xi.M(a,s);var c=hc;if(c&&a){var m=Xa(c).hoistableScripts,y=pc(a),w=m.get(y);w||(w=c.querySelector(Ed(y)),w||(a=b({src:a,async:!0,type:"module"},s),(s=ha.get(y))&&Oy(a,s),w=c.createElement("script"),Bt(w),Hn(w,"link",a),c.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},m.set(y,w))}}function IO(a,s,c,m){var y=(y=Oe.current)?om(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(s=mc(c.href),c=Xa(y).hoistableStyles,m=c.get(s),m||(m={type:"style",instance:null,count:0,state:null},c.set(s,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){a=mc(c.href);var w=Xa(y).hoistableStyles,N=w.get(a);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(a,N),(w=y.querySelector(Sd(a)))&&!w._p&&(N.instance=w,N.state.loading=5),ha.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},ha.set(a,c),w||SF(y,a,c,N.state))),s&&m===null)throw Error(r(528,""));return N}if(s&&m!==null)throw Error(r(529,""));return null;case"script":return s=c.async,c=c.src,typeof c=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=pc(c),c=Xa(y).hoistableScripts,m=c.get(s),m||(m={type:"script",instance:null,count:0,state:null},c.set(s,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function mc(a){return'href="'+Ge(a)+'"'}function Sd(a){return'link[rel="stylesheet"]['+a+"]"}function zO(a){return b({},a,{"data-precedence":a.precedence,precedence:null})}function SF(a,s,c,m){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?m.loading=1:(s=a.createElement("link"),m.preload=s,s.addEventListener("load",function(){return m.loading|=1}),s.addEventListener("error",function(){return m.loading|=2}),Hn(s,"link",c),Bt(s),a.head.appendChild(s))}function pc(a){return'[src="'+Ge(a)+'"]'}function Ed(a){return"script[async]"+a}function UO(a,s,c){if(s.count++,s.instance===null)switch(s.type){case"style":var m=a.querySelector('style[data-href~="'+Ge(c.href)+'"]');if(m)return s.instance=m,Bt(m),m;var y=b({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),Bt(m),Hn(m,"style",y),sm(m,c.precedence,a),s.instance=m;case"stylesheet":y=mc(c.href);var w=a.querySelector(Sd(y));if(w)return s.state.loading|=4,s.instance=w,Bt(w),w;m=zO(c),(y=ha.get(y))&&Cy(m,y),w=(a.ownerDocument||a).createElement("link"),Bt(w);var N=w;return N._p=new Promise(function(M,U){N.onload=M,N.onerror=U}),Hn(w,"link",m),s.state.loading|=4,sm(w,c.precedence,a),s.instance=w;case"script":return w=pc(c.src),(y=a.querySelector(Ed(w)))?(s.instance=y,Bt(y),y):(m=c,(y=ha.get(w))&&(m=b({},c),Oy(m,y)),a=a.ownerDocument||a,y=a.createElement("script"),Bt(y),Hn(y,"link",m),a.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(m=s.instance,s.state.loading|=4,sm(m,c.precedence,a));return s.instance}function sm(a,s,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=m.length?m[m.length-1]:null,w=y,N=0;N<m.length;N++){var M=m[N];if(M.dataset.precedence===s)w=M;else if(w!==y)break}w?w.parentNode.insertBefore(a,w.nextSibling):(s=c.nodeType===9?c.head:c,s.insertBefore(a,s.firstChild))}function Cy(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.title==null&&(a.title=s.title)}function Oy(a,s){a.crossOrigin==null&&(a.crossOrigin=s.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=s.referrerPolicy),a.integrity==null&&(a.integrity=s.integrity)}var lm=null;function qO(a,s,c){if(lm===null){var m=new Map,y=lm=new Map;y.set(c,m)}else y=lm,m=y.get(c),m||(m=new Map,y.set(c,m));if(m.has(a))return m;for(m.set(a,null),c=c.getElementsByTagName(a),y=0;y<c.length;y++){var w=c[y];if(!(w[Fr]||w[ln]||a==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var N=w.getAttribute(s)||"";N=a+N;var M=m.get(N);M?M.push(w):m.set(N,[w])}}return m}function BO(a,s,c){a=a.ownerDocument||a,a.head.insertBefore(c,s==="title"?a.querySelector("head > title"):null)}function EF(a,s,c){if(c===1||s.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return a=s.disabled,typeof s.precedence=="string"&&a==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function FO(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function AF(a,s,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var y=mc(m.href),w=s.querySelector(Sd(y));if(w){s=w._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(a.count++,a=cm.bind(a),s.then(a,a)),c.state.loading|=4,c.instance=w,Bt(w);return}w=s.ownerDocument||s,m=zO(m),(y=ha.get(y))&&Cy(m,y),w=w.createElement("link"),Bt(w);var N=w;N._p=new Promise(function(M,U){N.onload=M,N.onerror=U}),Hn(w,"link",m),c.instance=w}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(c,s),(s=c.state.preload)&&(c.state.loading&3)===0&&(a.count++,c=cm.bind(a),s.addEventListener("load",c),s.addEventListener("error",c))}}var Ny=0;function jF(a,s){return a.stylesheets&&a.count===0&&dm(a,a.stylesheets),0<a.count||0<a.imgCount?function(c){var m=setTimeout(function(){if(a.stylesheets&&dm(a,a.stylesheets),a.unsuspend){var w=a.unsuspend;a.unsuspend=null,w()}},6e4+s);0<a.imgBytes&&Ny===0&&(Ny=62500*iF());var y=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&dm(a,a.stylesheets),a.unsuspend)){var w=a.unsuspend;a.unsuspend=null,w()}},(a.imgBytes>Ny?50:800)+s);return a.unsuspend=c,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(y)}}:null}function cm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var um=null;function dm(a,s){a.stylesheets=null,a.unsuspend!==null&&(a.count++,um=new Map,s.forEach(CF,a),um=null,cm.call(a))}function CF(a,s){if(!(s.state.loading&4)){var c=um.get(a);if(c)var m=c.get(null);else{c=new Map,um.set(a,c);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<y.length;w++){var N=y[w];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(c.set(N.dataset.precedence,N),m=N)}m&&c.set(null,m)}y=s.instance,N=y.getAttribute("data-precedence"),w=c.get(N)||m,w===m&&c.set(null,y),c.set(N,y),this.count++,m=cm.bind(this),y.addEventListener("load",m),y.addEventListener("error",m),w?w.parentNode.insertBefore(y,w.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),s.state.loading|=4}}var Ad={$$typeof:O,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function OF(a,s,c,m,y,w,N,M,U){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=On(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=On(0),this.hiddenUpdates=On(null),this.identifierPrefix=m,this.onUncaughtError=y,this.onCaughtError=w,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function $O(a,s,c,m,y,w,N,M,U,X,ie,se){return a=new OF(a,s,c,N,U,X,ie,se,M),s=1,w===!0&&(s|=24),w=Kr(3,null,null,s),a.current=w,w.stateNode=a,s=sg(),s.refCount++,a.pooledCache=s,s.refCount++,w.memoizedState={element:m,isDehydrated:c,cache:s},dg(w),a}function KO(a){return a?(a=Gl,a):Gl}function HO(a,s,c,m,y,w){y=KO(y),m.context===null?m.context=y:m.pendingContext=y,m=ko(s),m.payload={element:c},w=w===void 0?null:w,w!==null&&(m.callback=w),c=Lo(a,m,s),c!==null&&(Pr(c,a,s),nd(c,a,s))}function GO(a,s){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c<s?c:s}}function Ty(a,s){GO(a,s),(a=a.alternate)&&GO(a,s)}function YO(a){if(a.tag===13||a.tag===31){var s=Ms(a,67108864);s!==null&&Pr(s,a,67108864),Ty(a,67108864)}}function WO(a){if(a.tag===13||a.tag===31){var s=Qr();s=Oa(s);var c=Ms(a,s);c!==null&&Pr(c,a,s),Ty(a,s)}}var fm=!0;function NF(a,s,c,m){var y=K.T;K.T=null;var w=Z.p;try{Z.p=2,Py(a,s,c,m)}finally{Z.p=w,K.T=y}}function TF(a,s,c,m){var y=K.T;K.T=null;var w=Z.p;try{Z.p=8,Py(a,s,c,m)}finally{Z.p=w,K.T=y}}function Py(a,s,c,m){if(fm){var y=_y(m);if(y===null)by(a,s,m,hm,c),VO(a,m);else if(_F(y,a,s,c,m))m.stopPropagation();else if(VO(a,m),s&4&&-1<PF.indexOf(a)){for(;y!==null;){var w=Pi(y);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var N=At(w.pendingLanes);if(N!==0){var M=w;for(M.pendingLanes|=2,M.entangledLanes|=2;N;){var U=1<<31-zt(N);M.entanglements[1]|=U,N&=~U}ti(w),(lt&6)===0&&(Qh=Kt()+500,gd(0))}}break;case 31:case 13:M=Ms(w,2),M!==null&&Pr(M,w,2),Xh(),Ty(w,2)}if(w=_y(m),w===null&&by(a,s,m,hm,c),w===y)break;y=w}y!==null&&m.stopPropagation()}else by(a,s,m,null,c)}}function _y(a){return a=Mv(a),Dy(a)}var hm=null;function Dy(a){if(hm=null,a=jo(a),a!==null){var s=o(a);if(s===null)a=null;else{var c=s.tag;if(c===13){if(a=l(s),a!==null)return a;a=null}else if(c===31){if(a=u(s),a!==null)return a;a=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;a=null}else s!==a&&(a=null)}}return hm=a,null}function QO(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ca()){case Eo:return 2;case Ur:return 8;case Cn:case ia:return 32;case Wa:return 268435456;default:return 32}default:return 32}}var My=!1,Yo=null,Wo=null,Qo=null,jd=new Map,Cd=new Map,Vo=[],PF="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function VO(a,s){switch(a){case"focusin":case"focusout":Yo=null;break;case"dragenter":case"dragleave":Wo=null;break;case"mouseover":case"mouseout":Qo=null;break;case"pointerover":case"pointerout":jd.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cd.delete(s.pointerId)}}function Od(a,s,c,m,y,w){return a===null||a.nativeEvent!==w?(a={blockedOn:s,domEventName:c,eventSystemFlags:m,nativeEvent:w,targetContainers:[y]},s!==null&&(s=Pi(s),s!==null&&YO(s)),a):(a.eventSystemFlags|=m,s=a.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),a)}function _F(a,s,c,m,y){switch(s){case"focusin":return Yo=Od(Yo,a,s,c,m,y),!0;case"dragenter":return Wo=Od(Wo,a,s,c,m,y),!0;case"mouseover":return Qo=Od(Qo,a,s,c,m,y),!0;case"pointerover":var w=y.pointerId;return jd.set(w,Od(jd.get(w)||null,a,s,c,m,y)),!0;case"gotpointercapture":return w=y.pointerId,Cd.set(w,Od(Cd.get(w)||null,a,s,c,m,y)),!0}return!1}function XO(a){var s=jo(a.target);if(s!==null){var c=o(s);if(c!==null){if(s=c.tag,s===13){if(s=l(c),s!==null){a.blockedOn=s,dr(a.priority,function(){WO(c)});return}}else if(s===31){if(s=u(c),s!==null){a.blockedOn=s,dr(a.priority,function(){WO(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}a.blockedOn=null}function mm(a){if(a.blockedOn!==null)return!1;for(var s=a.targetContainers;0<s.length;){var c=_y(a.nativeEvent);if(c===null){c=a.nativeEvent;var m=new c.constructor(c.type,c);Dv=m,c.target.dispatchEvent(m),Dv=null}else return s=Pi(c),s!==null&&YO(s),a.blockedOn=c,!1;s.shift()}return!0}function ZO(a,s,c){mm(a)&&c.delete(s)}function DF(){My=!1,Yo!==null&&mm(Yo)&&(Yo=null),Wo!==null&&mm(Wo)&&(Wo=null),Qo!==null&&mm(Qo)&&(Qo=null),jd.forEach(ZO),Cd.forEach(ZO)}function pm(a,s){a.blockedOn===s&&(a.blockedOn=null,My||(My=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,DF)))}var bm=null;function JO(a){bm!==a&&(bm=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bm===a&&(bm=null);for(var s=0;s<a.length;s+=3){var c=a[s],m=a[s+1],y=a[s+2];if(typeof m!="function"){if(Dy(m||c)===null)continue;break}var w=Pi(c);w!==null&&(a.splice(s,3),s-=3,_g(w,{pending:!0,data:y,method:c.method,action:m},m,y))}}))}function bc(a){function s(U){return pm(U,a)}Yo!==null&&pm(Yo,a),Wo!==null&&pm(Wo,a),Qo!==null&&pm(Qo,a),jd.forEach(s),Cd.forEach(s);for(var c=0;c<Vo.length;c++){var m=Vo[c];m.blockedOn===a&&(m.blockedOn=null)}for(;0<Vo.length&&(c=Vo[0],c.blockedOn===null);)XO(c),c.blockedOn===null&&Vo.shift();if(c=(a.ownerDocument||a).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var y=c[m],w=c[m+1],N=y[Tn]||null;if(typeof w=="function")N||JO(c);else if(N){var M=null;if(w&&w.hasAttribute("formAction")){if(y=w,N=w[Tn]||null)M=N.formAction;else if(Dy(y)!==null)continue}else M=N.action;typeof M=="function"?c[m+1]=M:(c.splice(m,3),m-=3),JO(c)}}}function eN(){function a(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(N){return y=N})},focusReset:"manual",scroll:"manual"})}function s(){y!==null&&(y(),y=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,y=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),y!==null&&(y(),y=null)}}}function Ry(a){this._internalRoot=a}vm.prototype.render=Ry.prototype.render=function(a){var s=this._internalRoot;if(s===null)throw Error(r(409));var c=s.current,m=Qr();HO(c,m,a,s,null,null)},vm.prototype.unmount=Ry.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var s=a.containerInfo;HO(a.current,2,null,a,null,null),Xh(),s[Ti]=null}};function vm(a){this._internalRoot=a}vm.prototype.unstable_scheduleHydration=function(a){if(a){var s=nt();a={blockedOn:null,target:a,priority:s};for(var c=0;c<Vo.length&&s!==0&&s<Vo[c].priority;c++);Vo.splice(c,0,a),c===0&&XO(a)}};var tN=t.version;if(tN!=="19.2.6")throw Error(r(527,tN,"19.2.6"));Z.findDOMNode=function(a){var s=a._reactInternals;if(s===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=h(s),a=a!==null?p(a):null,a=a===null?null:a.stateNode,a};var MF={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gm.isDisabled&&gm.supportsFiber)try{Qa=gm.inject(MF),bn=gm}catch{}}return Td.createRoot=function(a,s){if(!i(a))throw Error(r(299));var c=!1,m="",y=l1,w=c1,N=u1;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(m=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError)),s=$O(a,1,!1,null,null,c,m,null,y,w,N,eN),a[Ti]=s.current,py(a),new Ry(s)},Td.hydrateRoot=function(a,s,c){if(!i(a))throw Error(r(299));var m=!1,y="",w=l1,N=c1,M=u1,U=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(M=c.onRecoverableError),c.formState!==void 0&&(U=c.formState)),s=$O(a,1,!0,s,c??null,m,y,U,w,N,M,eN),s.context=KO(null),c=s.current,m=Qr(),m=Oa(m),y=ko(m),y.callback=null,Lo(c,y,m),c=m,s.current.lanes=c,Er(s,c),ti(s),a[Ti]=s.current,py(a),new vm(s)},Td.version="19.2.6",Td}var hN;function HF(){if(hN)return zy.exports;hN=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zy.exports=KF(),zy.exports}var GF=HF(),wu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ol,is,Yc,YR,YF=(YR=class extends wu{constructor(){super();Te(this,ol);Te(this,is);Te(this,Yc);ge(this,Yc,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){q(this,is)||this.setEventListener(q(this,Yc))}onUnsubscribe(){var t;this.hasListeners()||((t=q(this,is))==null||t.call(this),ge(this,is,void 0))}setEventListener(t){var n;ge(this,Yc,t),(n=q(this,is))==null||n.call(this),ge(this,is,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){q(this,ol)!==t&&(ge(this,ol,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof q(this,ol)=="boolean"?q(this,ol):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ol=new WeakMap,is=new WeakMap,Yc=new WeakMap,YR),IS=new YF,WF={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},os,kS,WR,QF=(WR=class{constructor(){Te(this,os,WF);Te(this,kS,!1)}setTimeoutProvider(e){ge(this,os,e)}setTimeout(e,t){return q(this,os).setTimeout(e,t)}clearTimeout(e){q(this,os).clearTimeout(e)}setInterval(e,t){return q(this,os).setInterval(e,t)}clearInterval(e){q(this,os).clearInterval(e)}},os=new WeakMap,kS=new WeakMap,WR),tl=new QF;function VF(e){setTimeout(e,0)}var XF=typeof window>"u"||"Deno"in globalThis;function pr(){}function ZF(e,t){return typeof e=="function"?e(t):e}function rw(e){return typeof e=="number"&&e>=0&&e!==1/0}function ik(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ps(e,t){return typeof e=="function"?e(t):e}function Xr(e,t){return typeof e=="function"?e(t):e}function mN(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:l,stale:u}=e;if(l){if(r){if(t.queryHash!==zS(l,t.options))return!1}else if(!af(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||o&&!o(t))}function pN(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(yl(t.options.mutationKey)!==yl(o))return!1}else if(!af(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function zS(e,t){return((t==null?void 0:t.queryKeyHashFn)||yl)(e)}function yl(e){return JSON.stringify(e,(t,n)=>aw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function af(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>af(e[n],t[n])):!1}var JF=Object.prototype.hasOwnProperty;function ok(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=bN(e)&&bN(t);if(!r&&!(aw(e)&&aw(t)))return t;const o=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),u=l.length,f=r?new Array(u):{};let h=0;for(let p=0;p<u;p++){const b=r?p:l[p],g=e[b],x=t[b];if(g===x){f[b]=g,(r?p<o:JF.call(e,b))&&h++;continue}if(g===null||x===null||typeof g!="object"||typeof x!="object"){f[b]=x;continue}const E=ok(g,x,n+1);f[b]=E,E===g&&h++}return o===u&&h===o?e:f}function dp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function bN(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function aw(e){if(!vN(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!vN(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function vN(e){return Object.prototype.toString.call(e)==="[object Object]"}function e4(e){return new Promise(t=>{tl.setTimeout(t,e)})}function iw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ok(e,t):t}function Su(e){return e}function t4(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function n4(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var US=Symbol();function sk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===US?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function qS(e,t){return typeof e=="function"?e(...t):!!e}function r4(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var of=(()=>{let e=()=>XF;return{isServer(){return e()},setIsServer(t){e=t}}})();function ow(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var a4=VF;function i4(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=a4;const o=u=>{t?e.push(u):i(()=>{n(u)})},l=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(f=>{n(f)})})})};return{batch:u=>{let f;t++;try{f=u()}finally{t--,t||l()}return f},batchCalls:u=>(...f)=>{o(()=>{u(...f)})},schedule:o,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Sn=i4(),Wc,ss,Qc,QR,o4=(QR=class extends wu{constructor(){super();Te(this,Wc,!0);Te(this,ss);Te(this,Qc);ge(this,Qc,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){q(this,ss)||this.setEventListener(q(this,Qc))}onUnsubscribe(){var t;this.hasListeners()||((t=q(this,ss))==null||t.call(this),ge(this,ss,void 0))}setEventListener(t){var n;ge(this,Qc,t),(n=q(this,ss))==null||n.call(this),ge(this,ss,t(this.setOnline.bind(this)))}setOnline(t){q(this,Wc)!==t&&(ge(this,Wc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return q(this,Wc)}},Wc=new WeakMap,ss=new WeakMap,Qc=new WeakMap,QR),fp=new o4;function s4(e){return Math.min(1e3*2**e,3e4)}function lk(e){return(e??"online")==="online"?fp.isOnline():!0}var sw=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ck(e){let t=!1,n=0,r;const i=ow(),o=()=>i.status!=="pending",l=S=>{var A;if(!o()){const j=new sw(S);g(j),(A=e.onCancel)==null||A.call(e,j)}},u=()=>{t=!0},f=()=>{t=!1},h=()=>IS.isFocused()&&(e.networkMode==="always"||fp.isOnline())&&e.canRun(),p=()=>lk(e.networkMode)&&e.canRun(),b=S=>{o()||(r==null||r(),i.resolve(S))},g=S=>{o()||(r==null||r(),i.reject(S))},x=()=>new Promise(S=>{var A;r=j=>{(o()||h())&&S(j)},(A=e.onPause)==null||A.call(e)}).then(()=>{var S;r=void 0,o()||(S=e.onContinue)==null||S.call(e)}),E=()=>{if(o())return;let S;const A=n===0?e.initialPromise:void 0;try{S=A??e.fn()}catch(j){S=Promise.reject(j)}Promise.resolve(S).then(b).catch(j=>{var P;if(o())return;const C=e.retry??(of.isServer()?0:3),O=e.retryDelay??s4,T=typeof O=="function"?O(n,j):O,_=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,j);if(t||!_){g(j);return}n++,(P=e.onFail)==null||P.call(e,n,j),e4(T).then(()=>h()?void 0:x()).then(()=>{t?g(j):E()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r==null||r(),i),cancelRetry:u,continueRetry:f,canStart:p,start:()=>(p()?E():x().then(E),i)}}var sl,VR,uk=(VR=class{constructor(){Te(this,sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rw(this.gcTime)&&ge(this,sl,tl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(of.isServer()?1/0:300*1e3))}clearGcTimeout(){q(this,sl)!==void 0&&(tl.clearTimeout(q(this,sl)),ge(this,sl,void 0))}},sl=new WeakMap,VR);function l4(e){return{onFetch:(t,n)=>{var p,b,g,x,E;const r=t.options,i=(g=(b=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:b.fetchMore)==null?void 0:g.direction,o=((x=t.state.data)==null?void 0:x.pages)||[],l=((E=t.state.data)==null?void 0:E.pageParams)||[];let u={pages:[],pageParams:[]},f=0;const h=async()=>{let S=!1;const A=O=>{r4(O,()=>t.signal,()=>S=!0)},j=sk(t.options,t.fetchOptions),C=async(O,T,_)=>{if(S)return Promise.reject(t.signal.reason);if(T==null&&O.pages.length)return Promise.resolve(O);const D=(()=>{const G={client:t.client,queryKey:t.queryKey,pageParam:T,direction:_?"backward":"forward",meta:t.options.meta};return A(G),G})(),L=await j(D),{maxPages:z}=t.options,F=_?n4:t4;return{pages:F(O.pages,L,z),pageParams:F(O.pageParams,T,z)}};if(i&&o.length){const O=i==="backward",T=O?dk:lw,_={pages:o,pageParams:l},P=T(r,_);u=await C(_,P,O)}else{const O=e??o.length;do{const T=f===0?l[0]??r.initialPageParam:lw(r,u);if(f>0&&T==null)break;u=await C(u,T),f++}while(f<O)}return u};t.options.persister?t.fetchFn=()=>{var S,A;return(A=(S=t.options).persister)==null?void 0:A.call(S,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function lw(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function dk(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}function c4(e,t){return t?lw(e,t)!=null:!1}function u4(e,t){return!t||!e.getPreviousPageParam?!1:dk(e,t)!=null}var Vc,ll,Xc,ga,cl,_n,Cf,ul,Vr,fk,Ji,XR,d4=(XR=class extends uk{constructor(t){super();Te(this,Vr);Te(this,Vc);Te(this,ll);Te(this,Xc);Te(this,ga);Te(this,cl);Te(this,_n);Te(this,Cf);Te(this,ul);ge(this,ul,!1),ge(this,Cf,t.defaultOptions),this.setOptions(t.options),this.observers=[],ge(this,cl,t.client),ge(this,ga,q(this,cl).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ge(this,ll,yN(this.options)),this.state=t.state??q(this,ll),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return q(this,Vc)}get promise(){var t;return(t=q(this,_n))==null?void 0:t.promise}setOptions(t){if(this.options={...q(this,Cf),...t},t!=null&&t._type&&ge(this,Vc,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=yN(this.options);n.data!==void 0&&(this.setState(gN(n.data,n.dataUpdatedAt)),ge(this,ll,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&q(this,ga).remove(this)}setData(t,n){const r=iw(this.state.data,t,this.options);return Ke(this,Vr,Ji).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){Ke(this,Vr,Ji).call(this,{type:"setState",state:t})}cancel(t){var r,i;const n=(r=q(this,_n))==null?void 0:r.promise;return(i=q(this,_n))==null||i.cancel(t),n?n.then(pr).catch(pr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return q(this,ll)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Xr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===US||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ps(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!ik(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=q(this,_n))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=q(this,_n))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),q(this,ga).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(q(this,_n)&&(q(this,ul)||Ke(this,Vr,fk).call(this)?q(this,_n).cancel({revert:!0}):q(this,_n).cancelRetry()),this.scheduleGc()),q(this,ga).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ke(this,Vr,Ji).call(this,{type:"invalidate"})}async fetch(t,n){var h,p,b,g,x,E,S,A,j,C,O;if(this.state.fetchStatus!=="idle"&&((h=q(this,_n))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(q(this,_n))return q(this,_n).continueRetry(),q(this,_n).promise}if(t&&this.setOptions(t),!this.options.queryFn){const T=this.observers.find(_=>_.options.queryFn);T&&this.setOptions(T.options)}const r=new AbortController,i=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(ge(this,ul,!0),r.signal)})},o=()=>{const T=sk(this.options,n),P=(()=>{const D={client:q(this,cl),queryKey:this.queryKey,meta:this.meta};return i(D),D})();return ge(this,ul,!1),this.options.persister?this.options.persister(T,P,this):T(P)},u=(()=>{const T={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:q(this,cl),state:this.state,fetchFn:o};return i(T),T})(),f=q(this,Vc)==="infinite"?l4(this.options.pages):this.options.behavior;f==null||f.onFetch(u,this),ge(this,Xc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=u.fetchOptions)==null?void 0:p.meta))&&Ke(this,Vr,Ji).call(this,{type:"fetch",meta:(b=u.fetchOptions)==null?void 0:b.meta}),ge(this,_n,ck({initialPromise:n==null?void 0:n.initialPromise,fn:u.fetchFn,onCancel:T=>{T instanceof sw&&T.revert&&this.setState({...q(this,Xc),fetchStatus:"idle"}),r.abort()},onFail:(T,_)=>{Ke(this,Vr,Ji).call(this,{type:"failed",failureCount:T,error:_})},onPause:()=>{Ke(this,Vr,Ji).call(this,{type:"pause"})},onContinue:()=>{Ke(this,Vr,Ji).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const T=await q(this,_n).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(x=(g=q(this,ga).config).onSuccess)==null||x.call(g,T,this),(S=(E=q(this,ga).config).onSettled)==null||S.call(E,T,this.state.error,this),T}catch(T){if(T instanceof sw){if(T.silent)return q(this,_n).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw Ke(this,Vr,Ji).call(this,{type:"error",error:T}),(j=(A=q(this,ga).config).onError)==null||j.call(A,T,this),(O=(C=q(this,ga).config).onSettled)==null||O.call(C,this.state.data,T,this),T}finally{this.scheduleGc()}}},Vc=new WeakMap,ll=new WeakMap,Xc=new WeakMap,ga=new WeakMap,cl=new WeakMap,_n=new WeakMap,Cf=new WeakMap,ul=new WeakMap,Vr=new WeakSet,fk=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Ji=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...hk(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...gN(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ge(this,Xc,t.manual?i:void 0),i;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Sn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),q(this,ga).notify({query:this,type:"updated",action:t})})},XR);function hk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:lk(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function gN(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function yN(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Dr,Je,Of,mr,dl,Zc,to,ls,Nf,Jc,eu,fl,hl,cs,tu,ft,Yd,cw,uw,dw,fw,hw,mw,pw,pk,ZR,mk=(ZR=class extends wu{constructor(t,n){super();Te(this,ft);Te(this,Dr);Te(this,Je);Te(this,Of);Te(this,mr);Te(this,dl);Te(this,Zc);Te(this,to);Te(this,ls);Te(this,Nf);Te(this,Jc);Te(this,eu);Te(this,fl);Te(this,hl);Te(this,cs);Te(this,tu,new Set);this.options=n,ge(this,Dr,t),ge(this,ls,null),ge(this,to,ow()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(q(this,Je).addObserver(this),xN(q(this,Je),this.options)?Ke(this,ft,Yd).call(this):this.updateResult(),Ke(this,ft,fw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bw(q(this,Je),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bw(q(this,Je),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ke(this,ft,hw).call(this),Ke(this,ft,mw).call(this),q(this,Je).removeObserver(this)}setOptions(t){const n=this.options,r=q(this,Je);if(this.options=q(this,Dr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Xr(this.options.enabled,q(this,Je))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ke(this,ft,pw).call(this),q(this,Je).setOptions(this.options),n._defaulted&&!dp(this.options,n)&&q(this,Dr).getQueryCache().notify({type:"observerOptionsUpdated",query:q(this,Je),observer:this});const i=this.hasListeners();i&&wN(q(this,Je),r,this.options,n)&&Ke(this,ft,Yd).call(this),this.updateResult(),i&&(q(this,Je)!==r||Xr(this.options.enabled,q(this,Je))!==Xr(n.enabled,q(this,Je))||ps(this.options.staleTime,q(this,Je))!==ps(n.staleTime,q(this,Je)))&&Ke(this,ft,cw).call(this);const o=Ke(this,ft,uw).call(this);i&&(q(this,Je)!==r||Xr(this.options.enabled,q(this,Je))!==Xr(n.enabled,q(this,Je))||o!==q(this,cs))&&Ke(this,ft,dw).call(this,o)}getOptimisticResult(t){const n=q(this,Dr).getQueryCache().build(q(this,Dr),t),r=this.createResult(n,t);return h4(this,r)&&(ge(this,mr,r),ge(this,Zc,this.options),ge(this,dl,q(this,Je).state)),r}getCurrentResult(){return q(this,mr)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&q(this,to).status==="pending"&&q(this,to).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){q(this,tu).add(t)}getCurrentQuery(){return q(this,Je)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=q(this,Dr).defaultQueryOptions(t),r=q(this,Dr).getQueryCache().build(q(this,Dr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ke(this,ft,Yd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),q(this,mr)))}createResult(t,n){var z;const r=q(this,Je),i=this.options,o=q(this,mr),l=q(this,dl),u=q(this,Zc),h=t!==r?t.state:q(this,Of),{state:p}=t;let b={...p},g=!1,x;if(n._optimisticResults){const F=this.hasListeners(),G=!F&&xN(t,n),R=F&&wN(t,r,n,i);(G||R)&&(b={...b,...hk(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:E,errorUpdatedAt:S,status:A}=b;x=b.data;let j=!1;if(n.placeholderData!==void 0&&x===void 0&&A==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData)?(F=o.data,j=!0):F=typeof n.placeholderData=="function"?n.placeholderData((z=q(this,eu))==null?void 0:z.state.data,q(this,eu)):n.placeholderData,F!==void 0&&(A="success",x=iw(o==null?void 0:o.data,F,n),g=!0)}if(n.select&&x!==void 0&&!j)if(o&&x===(l==null?void 0:l.data)&&n.select===q(this,Nf))x=q(this,Jc);else try{ge(this,Nf,n.select),x=n.select(x),x=iw(o==null?void 0:o.data,x,n),ge(this,Jc,x),ge(this,ls,null)}catch(F){ge(this,ls,F)}q(this,ls)&&(E=q(this,ls),x=q(this,Jc),S=Date.now(),A="error");const C=b.fetchStatus==="fetching",O=A==="pending",T=A==="error",_=O&&C,P=x!==void 0,L={status:A,fetchStatus:b.fetchStatus,isPending:O,isSuccess:A==="success",isError:T,isInitialLoading:_,isLoading:_,data:x,dataUpdatedAt:b.dataUpdatedAt,error:E,errorUpdatedAt:S,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:b.dataUpdateCount>h.dataUpdateCount||b.errorUpdateCount>h.errorUpdateCount,isFetching:C,isRefetching:C&&!O,isLoadingError:T&&!P,isPaused:b.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:T&&P,isStale:BS(t,n),refetch:this.refetch,promise:q(this,to),isEnabled:Xr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=L.data!==void 0,G=L.status==="error"&&!F,R=ne=>{G?ne.reject(L.error):F&&ne.resolve(L.data)},J=()=>{const ne=ge(this,to,L.promise=ow());R(ne)},$=q(this,to);switch($.status){case"pending":t.queryHash===r.queryHash&&R($);break;case"fulfilled":(G||L.data!==$.value)&&J();break;case"rejected":(!G||L.error!==$.reason)&&J();break}}return L}updateResult(){const t=q(this,mr),n=this.createResult(q(this,Je),this.options);if(ge(this,dl,q(this,Je).state),ge(this,Zc,this.options),q(this,dl).data!==void 0&&ge(this,eu,q(this,Je)),dp(n,t))return;ge(this,mr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!q(this,tu).size)return!0;const l=new Set(o??q(this,tu));return this.options.throwOnError&&l.add("error"),Object.keys(q(this,mr)).some(u=>{const f=u;return q(this,mr)[f]!==t[f]&&l.has(f)})};Ke(this,ft,pk).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ke(this,ft,fw).call(this)}},Dr=new WeakMap,Je=new WeakMap,Of=new WeakMap,mr=new WeakMap,dl=new WeakMap,Zc=new WeakMap,to=new WeakMap,ls=new WeakMap,Nf=new WeakMap,Jc=new WeakMap,eu=new WeakMap,fl=new WeakMap,hl=new WeakMap,cs=new WeakMap,tu=new WeakMap,ft=new WeakSet,Yd=function(t){Ke(this,ft,pw).call(this);let n=q(this,Je).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(pr)),n},cw=function(){Ke(this,ft,hw).call(this);const t=ps(this.options.staleTime,q(this,Je));if(of.isServer()||q(this,mr).isStale||!rw(t))return;const r=ik(q(this,mr).dataUpdatedAt,t)+1;ge(this,fl,tl.setTimeout(()=>{q(this,mr).isStale||this.updateResult()},r))},uw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(q(this,Je)):this.options.refetchInterval)??!1},dw=function(t){Ke(this,ft,mw).call(this),ge(this,cs,t),!(of.isServer()||Xr(this.options.enabled,q(this,Je))===!1||!rw(q(this,cs))||q(this,cs)===0)&&ge(this,hl,tl.setInterval(()=>{(this.options.refetchIntervalInBackground||IS.isFocused())&&Ke(this,ft,Yd).call(this)},q(this,cs)))},fw=function(){Ke(this,ft,cw).call(this),Ke(this,ft,dw).call(this,Ke(this,ft,uw).call(this))},hw=function(){q(this,fl)!==void 0&&(tl.clearTimeout(q(this,fl)),ge(this,fl,void 0))},mw=function(){q(this,hl)!==void 0&&(tl.clearInterval(q(this,hl)),ge(this,hl,void 0))},pw=function(){const t=q(this,Dr).getQueryCache().build(q(this,Dr),this.options);if(t===q(this,Je))return;const n=q(this,Je);ge(this,Je,t),ge(this,Of,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},pk=function(t){Sn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(q(this,mr))}),q(this,Dr).getQueryCache().notify({query:q(this,Je),type:"observerResultsUpdated"})})},ZR);function f4(e,t){return Xr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Xr(t.retryOnMount,e)===!1)}function xN(e,t){return f4(e,t)||e.state.data!==void 0&&bw(e,t,t.refetchOnMount)}function bw(e,t,n){if(Xr(t.enabled,e)!==!1&&ps(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&BS(e,t)}return!1}function wN(e,t,n,r){return(e!==t||Xr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&BS(e,n)}function BS(e,t){return Xr(t.enabled,e)!==!1&&e.isStaleByTime(ps(t.staleTime,e))}function h4(e,t){return!dp(e.getCurrentResult(),t)}var m4=class extends mk{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){var E,S;const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:o,isError:l,isRefetchError:u}=r,f=(S=(E=n.fetchMeta)==null?void 0:E.fetchMore)==null?void 0:S.direction,h=l&&f==="forward",p=i&&f==="forward",b=l&&f==="backward",g=i&&f==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:c4(t,n.data),hasPreviousPage:u4(t,n.data),isFetchNextPageError:h,isFetchingNextPage:p,isFetchPreviousPageError:b,isFetchingPreviousPage:g,isRefetchError:u&&!h&&!b,isRefetching:o&&!p&&!g}}},Tf,si,tr,ml,li,Jo,JR,p4=(JR=class extends uk{constructor(t){super();Te(this,li);Te(this,Tf);Te(this,si);Te(this,tr);Te(this,ml);ge(this,Tf,t.client),this.mutationId=t.mutationId,ge(this,tr,t.mutationCache),ge(this,si,[]),this.state=t.state||bk(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){q(this,si).includes(t)||(q(this,si).push(t),this.clearGcTimeout(),q(this,tr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ge(this,si,q(this,si).filter(n=>n!==t)),this.scheduleGc(),q(this,tr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){q(this,si).length||(this.state.status==="pending"?this.scheduleGc():q(this,tr).remove(this))}continue(){var t;return((t=q(this,ml))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,u,f,h,p,b,g,x,E,S,A,j,C,O,T,_,P,D;const n=()=>{Ke(this,li,Jo).call(this,{type:"continue"})},r={client:q(this,Tf),meta:this.options.meta,mutationKey:this.options.mutationKey};ge(this,ml,ck({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,z)=>{Ke(this,li,Jo).call(this,{type:"failed",failureCount:L,error:z})},onPause:()=>{Ke(this,li,Jo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>q(this,tr).canRun(this)}));const i=this.state.status==="pending",o=!q(this,ml).canStart();try{if(i)n();else{Ke(this,li,Jo).call(this,{type:"pending",variables:t,isPaused:o}),q(this,tr).config.onMutate&&await q(this,tr).config.onMutate(t,this,r);const z=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,r));z!==this.state.context&&Ke(this,li,Jo).call(this,{type:"pending",context:z,variables:t,isPaused:o})}const L=await q(this,ml).start();return await((h=(f=q(this,tr).config).onSuccess)==null?void 0:h.call(f,L,t,this.state.context,this,r)),await((b=(p=this.options).onSuccess)==null?void 0:b.call(p,L,t,this.state.context,r)),await((x=(g=q(this,tr).config).onSettled)==null?void 0:x.call(g,L,null,this.state.variables,this.state.context,this,r)),await((S=(E=this.options).onSettled)==null?void 0:S.call(E,L,null,t,this.state.context,r)),Ke(this,li,Jo).call(this,{type:"success",data:L}),L}catch(L){try{await((j=(A=q(this,tr).config).onError)==null?void 0:j.call(A,L,t,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((O=(C=this.options).onError)==null?void 0:O.call(C,L,t,this.state.context,r))}catch(z){Promise.reject(z)}try{await((_=(T=q(this,tr).config).onSettled)==null?void 0:_.call(T,void 0,L,this.state.variables,this.state.context,this,r))}catch(z){Promise.reject(z)}try{await((D=(P=this.options).onSettled)==null?void 0:D.call(P,void 0,L,t,this.state.context,r))}catch(z){Promise.reject(z)}throw Ke(this,li,Jo).call(this,{type:"error",error:L}),L}finally{q(this,tr).runNext(this)}}},Tf=new WeakMap,si=new WeakMap,tr=new WeakMap,ml=new WeakMap,li=new WeakSet,Jo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Sn.batch(()=>{q(this,si).forEach(r=>{r.onMutationUpdate(t)}),q(this,tr).notify({mutation:this,type:"updated",action:t})})},JR);function bk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var no,Ma,Pf,ek,b4=(ek=class extends wu{constructor(t={}){super();Te(this,no);Te(this,Ma);Te(this,Pf);this.config=t,ge(this,no,new Set),ge(this,Ma,new Map),ge(this,Pf,0)}build(t,n,r){const i=new p4({client:t,mutationCache:this,mutationId:++ym(this,Pf)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){q(this,no).add(t);const n=xm(t);if(typeof n=="string"){const r=q(this,Ma).get(n);r?r.push(t):q(this,Ma).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(q(this,no).delete(t)){const n=xm(t);if(typeof n=="string"){const r=q(this,Ma).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&q(this,Ma).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=xm(t);if(typeof n=="string"){const r=q(this,Ma).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=xm(t);if(typeof n=="string"){const i=(r=q(this,Ma).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Sn.batch(()=>{q(this,no).forEach(t=>{this.notify({type:"removed",mutation:t})}),q(this,no).clear(),q(this,Ma).clear()})}getAll(){return Array.from(q(this,no))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>pN(n,r))}findAll(t={}){return this.getAll().filter(n=>pN(t,n))}notify(t){Sn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Sn.batch(()=>Promise.all(t.map(n=>n.continue().catch(pr))))}},no=new WeakMap,Ma=new WeakMap,Pf=new WeakMap,ek);function xm(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ro,us,Mr,ao,uo,Jm,vw,tk,v4=(tk=class extends wu{constructor(n,r){super();Te(this,uo);Te(this,ro);Te(this,us);Te(this,Mr);Te(this,ao);ge(this,ro,n),this.setOptions(r),this.bindMethods(),Ke(this,uo,Jm).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=q(this,ro).defaultMutationOptions(n),dp(this.options,r)||q(this,ro).getMutationCache().notify({type:"observerOptionsUpdated",mutation:q(this,Mr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&yl(r.mutationKey)!==yl(this.options.mutationKey)?this.reset():((i=q(this,Mr))==null?void 0:i.state.status)==="pending"&&q(this,Mr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=q(this,Mr))==null||n.removeObserver(this)}onMutationUpdate(n){Ke(this,uo,Jm).call(this),Ke(this,uo,vw).call(this,n)}getCurrentResult(){return q(this,us)}reset(){var n;(n=q(this,Mr))==null||n.removeObserver(this),ge(this,Mr,void 0),Ke(this,uo,Jm).call(this),Ke(this,uo,vw).call(this)}mutate(n,r){var i;return ge(this,ao,r),(i=q(this,Mr))==null||i.removeObserver(this),ge(this,Mr,q(this,ro).getMutationCache().build(q(this,ro),this.options)),q(this,Mr).addObserver(this),q(this,Mr).execute(n)}},ro=new WeakMap,us=new WeakMap,Mr=new WeakMap,ao=new WeakMap,uo=new WeakSet,Jm=function(){var r;const n=((r=q(this,Mr))==null?void 0:r.state)??bk();ge(this,us,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},vw=function(n){Sn.batch(()=>{var r,i,o,l,u,f,h,p;if(q(this,ao)&&this.hasListeners()){const b=q(this,us).variables,g=q(this,us).context,x={client:q(this,ro),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(r=q(this,ao)).onSuccess)==null||i.call(r,n.data,b,g,x)}catch(E){Promise.reject(E)}try{(l=(o=q(this,ao)).onSettled)==null||l.call(o,n.data,null,b,g,x)}catch(E){Promise.reject(E)}}else if((n==null?void 0:n.type)==="error"){try{(f=(u=q(this,ao)).onError)==null||f.call(u,n.error,b,g,x)}catch(E){Promise.reject(E)}try{(p=(h=q(this,ao)).onSettled)==null||p.call(h,void 0,n.error,b,g,x)}catch(E){Promise.reject(E)}}}this.listeners.forEach(b=>{b(q(this,us))})})},tk),ci,nk,g4=(nk=class extends wu{constructor(t={}){super();Te(this,ci);this.config=t,ge(this,ci,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??zS(i,n);let l=this.get(o);return l||(l=new d4({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(l)),l}add(t){q(this,ci).has(t.queryHash)||(q(this,ci).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=q(this,ci).get(t.queryHash);n&&(t.destroy(),n===t&&q(this,ci).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Sn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return q(this,ci).get(t)}getAll(){return[...q(this,ci).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>mN(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>mN(t,r)):n}notify(t){Sn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Sn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Sn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ci=new WeakMap,nk),Qt,ds,fs,nu,ru,hs,au,iu,rk,y4=(rk=class{constructor(e={}){Te(this,Qt);Te(this,ds);Te(this,fs);Te(this,nu);Te(this,ru);Te(this,hs);Te(this,au);Te(this,iu);ge(this,Qt,e.queryCache||new g4),ge(this,ds,e.mutationCache||new b4),ge(this,fs,e.defaultOptions||{}),ge(this,nu,new Map),ge(this,ru,new Map),ge(this,hs,0)}mount(){ym(this,hs)._++,q(this,hs)===1&&(ge(this,au,IS.subscribe(async e=>{e&&(await this.resumePausedMutations(),q(this,Qt).onFocus())})),ge(this,iu,fp.subscribe(async e=>{e&&(await this.resumePausedMutations(),q(this,Qt).onOnline())})))}unmount(){var e,t;ym(this,hs)._--,q(this,hs)===0&&((e=q(this,au))==null||e.call(this),ge(this,au,void 0),(t=q(this,iu))==null||t.call(this),ge(this,iu,void 0))}isFetching(e){return q(this,Qt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return q(this,ds).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=q(this,Qt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=q(this,Qt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ps(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return q(this,Qt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=q(this,Qt).get(r.queryHash),o=i==null?void 0:i.state.data,l=ZF(t,o);if(l!==void 0)return q(this,Qt).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Sn.batch(()=>q(this,Qt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=q(this,Qt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=q(this,Qt);Sn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=q(this,Qt);return Sn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Sn.batch(()=>q(this,Qt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(pr).catch(pr)}invalidateQueries(e,t={}){return Sn.batch(()=>(q(this,Qt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Sn.batch(()=>q(this,Qt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(pr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(pr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=q(this,Qt).build(this,t);return n.isStaleByTime(ps(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pr).catch(pr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pr).catch(pr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return fp.isOnline()?q(this,ds).resumePausedMutations():Promise.resolve()}getQueryCache(){return q(this,Qt)}getMutationCache(){return q(this,ds)}getDefaultOptions(){return q(this,fs)}setDefaultOptions(e){ge(this,fs,e)}setQueryDefaults(e,t){q(this,nu).set(yl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...q(this,nu).values()],n={};return t.forEach(r=>{af(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){q(this,ru).set(yl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...q(this,ru).values()],n={};return t.forEach(r=>{af(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...q(this,fs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=zS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===US&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...q(this,fs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){q(this,Qt).clear(),q(this,ds).clear()}},Qt=new WeakMap,ds=new WeakMap,fs=new WeakMap,nu=new WeakMap,ru=new WeakMap,hs=new WeakMap,au=new WeakMap,iu=new WeakMap,rk),vk=v.createContext(void 0),Ne=e=>{const t=v.useContext(vk);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},x4=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(vk.Provider,{value:e,children:t})),gk=v.createContext(!1),w4=()=>v.useContext(gk);gk.Provider;function S4(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var E4=v.createContext(S4()),A4=()=>v.useContext(E4),j4=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?qS(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},C4=e=>{v.useEffect(()=>{e.clearReset()},[e])},O4=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||qS(n,[e.error,r])),N4=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},T4=(e,t)=>e.isLoading&&e.isFetching&&!t,P4=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,SN=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function yk(e,t,n){var g,x,E,S;const r=w4(),i=A4(),o=Ne(),l=o.defaultQueryOptions(e);(x=(g=o.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||x.call(g,l);const u=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",N4(l),j4(l,i,u),C4(i);const f=!o.getQueryCache().get(l.queryHash),[h]=v.useState(()=>new t(o,l)),p=h.getOptimisticResult(l),b=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(A=>{const j=b?h.subscribe(Sn.batchCalls(A)):pr;return h.updateResult(),j},[h,b]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),v.useEffect(()=>{h.setOptions(l)},[l,h]),P4(l,p))throw SN(l,h,i);if(O4({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;if((S=(E=o.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||S.call(E,l,p),l.experimental_prefetchInRender&&!of.isServer()&&T4(p,r)){const A=f?SN(l,h,i):u==null?void 0:u.promise;A==null||A.catch(pr).finally(()=>{h.updateResult()})}return l.notifyOnChangeProps?p:h.trackResult(p)}function Et(e,t){return yk(e,mk)}function je(e,t){const n=Ne(),[r]=v.useState(()=>new v4(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const i=v.useSyncExternalStore(v.useCallback(l=>r.subscribe(Sn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((l,u)=>{r.mutate(l,u).catch(pr)},[r]);if(i.error&&qS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function xb(e,t){return yk(e,m4)}const xk=new Set(["overview","chatbot","content","forms","leads","conversations","integrations"]);function EN(){const t=new URL(window.location.href).searchParams.get("tab");return t&&xk.has(t)?t:"overview"}const Fy="bb:tab-change";function wk(){const[e,t]=v.useState(EN);v.useEffect(()=>{const r=()=>t(EN());return window.addEventListener("popstate",r),window.addEventListener(Fy,r),()=>{window.removeEventListener("popstate",r),window.removeEventListener(Fy,r)}},[]);const n=v.useCallback(r=>{if(!xk.has(r))return;const i=new URL(window.location.href);i.searchParams.get("tab")!==r&&(i.searchParams.set("tab",r),window.history.pushState({},"",i),t(r),window.dispatchEvent(new Event(Fy)))},[]);return[e,n]}function Re(){const e=window.bitbotAdminConfig;if(!e)throw new Error("bitbotAdminConfig is missing. Ensure wp_localize_script ran (WP admin) or that index.html sets window.bitbotAdminConfig (dev).");return e}function Sk(e){return e==="pro_plus"?"Agent":e==="pro"?"Assistant":"Free"}function _4(e){return e==="pro_plus"}var Vn=ak();const D4=Ei(Vn);function Rn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function AN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ek(...e){return t=>{let n=!1;const r=e.map(i=>{const o=AN(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():AN(e[i],null)}}}}function Ua(...e){return v.useCallback(Ek(...e),e)}function M4(e,t){const n=v.createContext(t),r=o=>{const{children:l,...u}=o,f=v.useMemo(()=>u,Object.values(u));return d.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function i(o){const l=v.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function FS(e,t=[]){let n=[];function r(o,l){const u=v.createContext(l),f=n.length;n=[...n,l];const h=b=>{var j;const{scope:g,children:x,...E}=b,S=((j=g==null?void 0:g[e])==null?void 0:j[f])||u,A=v.useMemo(()=>E,Object.values(E));return d.jsx(S.Provider,{value:A,children:x})};h.displayName=o+"Provider";function p(b,g){var S;const x=((S=g==null?void 0:g[e])==null?void 0:S[f])||u,E=v.useContext(x);if(E)return E;if(l!==void 0)return l;throw new Error(`\`${b}\` must be used within \`${o}\``)}return[h,p]}const i=()=>{const o=n.map(l=>v.createContext(l));return function(u){const f=(u==null?void 0:u[e])||o;return v.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[r,R4(i,...t)]}function R4(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((u,{useScope:f,scopeName:h})=>{const b=f(o)[`__scope${h}`];return{...u,...b}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function hp(e){const t=k4(e),n=v.forwardRef((r,i)=>{const{children:o,...l}=r,u=v.Children.toArray(o),f=u.find(I4);if(f){const h=f.props.children,p=u.map(b=>b===f?v.Children.count(h)>1?v.Children.only(null):v.isValidElement(h)?h.props.children:null:b);return d.jsx(t,{...l,ref:i,children:v.isValidElement(h)?v.cloneElement(h,void 0,p):null})}return d.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function k4(e){const t=v.forwardRef((n,r)=>{const{children:i,...o}=n;if(v.isValidElement(i)){const l=U4(i),u=z4(o,i.props);return i.type!==v.Fragment&&(u.ref=r?Ek(r,l):l),v.cloneElement(i,u)}return v.Children.count(i)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var L4=Symbol("radix.slottable");function I4(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===L4}function z4(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function U4(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function q4(e){const t=e+"CollectionProvider",[n,r]=FS(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:A,children:j}=S,C=Zt.useRef(null),O=Zt.useRef(new Map).current;return d.jsx(i,{scope:A,itemMap:O,collectionRef:C,children:j})};l.displayName=t;const u=e+"CollectionSlot",f=hp(u),h=Zt.forwardRef((S,A)=>{const{scope:j,children:C}=S,O=o(u,j),T=Ua(A,O.collectionRef);return d.jsx(f,{ref:T,children:C})});h.displayName=u;const p=e+"CollectionItemSlot",b="data-radix-collection-item",g=hp(p),x=Zt.forwardRef((S,A)=>{const{scope:j,children:C,...O}=S,T=Zt.useRef(null),_=Ua(A,T),P=o(p,j);return Zt.useEffect(()=>(P.itemMap.set(T,{ref:T,...O}),()=>void P.itemMap.delete(T))),d.jsx(g,{[b]:"",ref:_,children:C})});x.displayName=p;function E(S){const A=o(e+"CollectionConsumer",S);return Zt.useCallback(()=>{const C=A.collectionRef.current;if(!C)return[];const O=Array.from(C.querySelectorAll(`[${b}]`));return Array.from(A.itemMap.values()).sort((P,D)=>O.indexOf(P.ref.current)-O.indexOf(D.ref.current))},[A.collectionRef,A.itemMap])}return[{Provider:l,Slot:h,ItemSlot:x},E,r]}var B4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],sr=B4.reduce((e,t)=>{const n=hp(`Primitive.${t}`),r=v.forwardRef((i,o)=>{const{asChild:l,...u}=i,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(f,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ak(e,t){e&&Vn.flushSync(()=>e.dispatchEvent(t))}function fo(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function F4(e,t=globalThis==null?void 0:globalThis.document){const n=fo(e);v.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var $4="DismissableLayer",gw="dismissableLayer.update",K4="dismissableLayer.pointerDownOutside",H4="dismissableLayer.focusOutside",jN,jk=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$S=v.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...f}=e,h=v.useContext(jk),[p,b]=v.useState(null),g=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=v.useState({}),E=Ua(t,D=>b(D)),S=Array.from(h.layers),[A]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),j=S.indexOf(A),C=p?S.indexOf(p):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,T=C>=j,_=Y4(D=>{const L=D.target,z=[...h.branches].some(F=>F.contains(L));!T||z||(i==null||i(D),l==null||l(D),D.defaultPrevented||u==null||u())},g),P=W4(D=>{const L=D.target;[...h.branches].some(F=>F.contains(L))||(o==null||o(D),l==null||l(D),D.defaultPrevented||u==null||u())},g);return F4(D=>{C===h.layers.size-1&&(r==null||r(D),!D.defaultPrevented&&u&&(D.preventDefault(),u()))},g),v.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(jN=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),CN(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=jN)}},[p,g,n,h]),v.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),CN())},[p,h]),v.useEffect(()=>{const D=()=>x({});return document.addEventListener(gw,D),()=>document.removeEventListener(gw,D)},[]),d.jsx(sr.div,{...f,ref:E,style:{pointerEvents:O?T?"auto":"none":void 0,...e.style},onFocusCapture:Rn(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Rn(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Rn(e.onPointerDownCapture,_.onPointerDownCapture)})});$S.displayName=$4;var G4="DismissableLayerBranch",Ck=v.forwardRef((e,t)=>{const n=v.useContext(jk),r=v.useRef(null),i=Ua(t,r);return v.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(sr.div,{...e,ref:i})});Ck.displayName=G4;function Y4(e,t=globalThis==null?void 0:globalThis.document){const n=fo(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let f=function(){Ok(K4,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function W4(e,t=globalThis==null?void 0:globalThis.document){const n=fo(e),r=v.useRef(!1);return v.useEffect(()=>{const i=o=>{o.target&&!r.current&&Ok(H4,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function CN(){const e=new CustomEvent(gw);document.dispatchEvent(e)}function Ok(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ak(i,o):i.dispatchEvent(o)}var Q4=$S,V4=Ck,ou=globalThis!=null&&globalThis.document?v.useLayoutEffect:()=>{},X4="Portal",KS=v.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[i,o]=v.useState(!1);ou(()=>o(!0),[]);const l=n||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?D4.createPortal(d.jsx(sr.div,{...r,ref:t}),l):null});KS.displayName=X4;function Z4(e,t){return v.useReducer((n,r)=>t[n][r]??n,e)}var _f=e=>{const{present:t,children:n}=e,r=J4(t),i=typeof n=="function"?n({present:r.isPresent}):v.Children.only(n),o=Ua(r.ref,e$(i));return typeof n=="function"||r.isPresent?v.cloneElement(i,{ref:o}):null};_f.displayName="Presence";function J4(e){const[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),o=v.useRef("none"),l=e?"mounted":"unmounted",[u,f]=Z4(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return v.useEffect(()=>{const h=wm(r.current);o.current=u==="mounted"?h:"none"},[u]),ou(()=>{const h=r.current,p=i.current;if(p!==e){const g=o.current,x=wm(h);e?f("MOUNT"):x==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(p&&g!==x?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),ou(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,b=x=>{const S=wm(r.current).includes(CSS.escape(x.animationName));if(x.target===t&&S&&(f("ANIMATION_END"),!i.current)){const A=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=A)})}},g=x=>{x.target===t&&(o.current=wm(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",b),t.addEventListener("animationend",b),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",b),t.removeEventListener("animationend",b)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:v.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function wm(e){return(e==null?void 0:e.animationName)||"none"}function e$(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var t$=LS[" useInsertionEffect ".trim().toString()]||ou;function Nk({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=n$({defaultProp:t,onChange:n}),u=e!==void 0,f=u?e:i;{const p=v.useRef(e!==void 0);v.useEffect(()=>{const b=p.current;b!==u&&console.warn(`${r} is changing from ${b?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const h=v.useCallback(p=>{var b;if(u){const g=r$(p)?p(e):p;g!==e&&((b=l.current)==null||b.call(l,g))}else o(p)},[u,e,o,l]);return[f,h]}function n$({defaultProp:e,onChange:t}){const[n,r]=v.useState(e),i=v.useRef(n),o=v.useRef(t);return t$(()=>{o.current=t},[t]),v.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function r$(e){return typeof e=="function"}var a$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),i$="VisuallyHidden",HS=v.forwardRef((e,t)=>d.jsx(sr.span,{...e,ref:t,style:{...a$,...e.style}}));HS.displayName=i$;var GS="ToastProvider",[YS,o$,s$]=q4("Toast"),[Tk]=FS("Toast",[s$]),[l$,wb]=Tk(GS),Pk=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:l}=e,[u,f]=v.useState(null),[h,p]=v.useState(0),b=v.useRef(!1),g=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${GS}\`. Expected non-empty \`string\`.`),d.jsx(YS.Provider,{scope:t,children:d.jsx(l$,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:o,toastCount:h,viewport:u,onViewportChange:f,onToastAdd:v.useCallback(()=>p(x=>x+1),[]),onToastRemove:v.useCallback(()=>p(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:b,isClosePausedRef:g,children:l})})};Pk.displayName=GS;var _k="ToastViewport",c$=["F8"],yw="toast.viewportPause",xw="toast.viewportResume",Dk=v.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=c$,label:i="Notifications ({hotkey})",...o}=e,l=wb(_k,n),u=o$(n),f=v.useRef(null),h=v.useRef(null),p=v.useRef(null),b=v.useRef(null),g=Ua(t,b,l.onViewportChange),x=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),E=l.toastCount>0;v.useEffect(()=>{const A=j=>{var O;r.length!==0&&r.every(T=>j[T]||j.code===T)&&((O=b.current)==null||O.focus())};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[r]),v.useEffect(()=>{const A=f.current,j=b.current;if(E&&A&&j){const C=()=>{if(!l.isClosePausedRef.current){const P=new CustomEvent(yw);j.dispatchEvent(P),l.isClosePausedRef.current=!0}},O=()=>{if(l.isClosePausedRef.current){const P=new CustomEvent(xw);j.dispatchEvent(P),l.isClosePausedRef.current=!1}},T=P=>{!A.contains(P.relatedTarget)&&O()},_=()=>{A.contains(document.activeElement)||O()};return A.addEventListener("focusin",C),A.addEventListener("focusout",T),A.addEventListener("pointermove",C),A.addEventListener("pointerleave",_),window.addEventListener("blur",C),window.addEventListener("focus",O),()=>{A.removeEventListener("focusin",C),A.removeEventListener("focusout",T),A.removeEventListener("pointermove",C),A.removeEventListener("pointerleave",_),window.removeEventListener("blur",C),window.removeEventListener("focus",O)}}},[E,l.isClosePausedRef]);const S=v.useCallback(({tabbingDirection:A})=>{const C=u().map(O=>{const T=O.ref.current,_=[T,...E$(T)];return A==="forwards"?_:_.reverse()});return(A==="forwards"?C.reverse():C).flat()},[u]);return v.useEffect(()=>{const A=b.current;if(A){const j=C=>{var _,P,D;const O=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!O){const L=document.activeElement,z=C.shiftKey;if(C.target===A&&z){(_=h.current)==null||_.focus();return}const R=S({tabbingDirection:z?"backwards":"forwards"}),J=R.findIndex($=>$===L);$y(R.slice(J+1))?C.preventDefault():z?(P=h.current)==null||P.focus():(D=p.current)==null||D.focus()}};return A.addEventListener("keydown",j),()=>A.removeEventListener("keydown",j)}},[u,S]),d.jsxs(V4,{ref:f,role:"region","aria-label":i.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:E?void 0:"none"},children:[E&&d.jsx(ww,{ref:h,onFocusFromOutsideViewport:()=>{const A=S({tabbingDirection:"forwards"});$y(A)}}),d.jsx(YS.Slot,{scope:n,children:d.jsx(sr.ol,{tabIndex:-1,...o,ref:g})}),E&&d.jsx(ww,{ref:p,onFocusFromOutsideViewport:()=>{const A=S({tabbingDirection:"backwards"});$y(A)}})]})});Dk.displayName=_k;var Mk="ToastFocusProxy",ww=v.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,o=wb(Mk,n);return d.jsx(HS,{tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:l=>{var h;const u=l.relatedTarget;!((h=o.viewport)!=null&&h.contains(u))&&r()}})});ww.displayName=Mk;var Df="Toast",u$="toast.swipeStart",d$="toast.swipeMove",f$="toast.swipeCancel",h$="toast.swipeEnd",Rk=v.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:o,...l}=e,[u,f]=Nk({prop:r,defaultProp:i??!0,onChange:o,caller:Df});return d.jsx(_f,{present:n||u,children:d.jsx(b$,{open:u,...l,ref:t,onClose:()=>f(!1),onPause:fo(e.onPause),onResume:fo(e.onResume),onSwipeStart:Rn(e.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Rn(e.onSwipeMove,h=>{const{x:p,y:b}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${b}px`)}),onSwipeCancel:Rn(e.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Rn(e.onSwipeEnd,h=>{const{x:p,y:b}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${b}px`),f(!1)})})})});Rk.displayName=Df;var[m$,p$]=Tk(Df,{onClose(){}}),b$=v.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:o,onClose:l,onEscapeKeyDown:u,onPause:f,onResume:h,onSwipeStart:p,onSwipeMove:b,onSwipeCancel:g,onSwipeEnd:x,...E}=e,S=wb(Df,n),[A,j]=v.useState(null),C=Ua(t,$=>j($)),O=v.useRef(null),T=v.useRef(null),_=i||S.duration,P=v.useRef(0),D=v.useRef(_),L=v.useRef(0),{onToastAdd:z,onToastRemove:F}=S,G=fo(()=>{var ne;(A==null?void 0:A.contains(document.activeElement))&&((ne=S.viewport)==null||ne.focus()),l()}),R=v.useCallback($=>{!$||$===1/0||(window.clearTimeout(L.current),P.current=new Date().getTime(),L.current=window.setTimeout(G,$))},[G]);v.useEffect(()=>{const $=S.viewport;if($){const ne=()=>{R(D.current),h==null||h()},K=()=>{const Z=new Date().getTime()-P.current;D.current=D.current-Z,window.clearTimeout(L.current),f==null||f()};return $.addEventListener(yw,K),$.addEventListener(xw,ne),()=>{$.removeEventListener(yw,K),$.removeEventListener(xw,ne)}}},[S.viewport,_,f,h,R]),v.useEffect(()=>{o&&!S.isClosePausedRef.current&&R(_)},[o,_,S.isClosePausedRef,R]),v.useEffect(()=>(z(),()=>F()),[z,F]);const J=v.useMemo(()=>A?Bk(A):null,[A]);return S.viewport?d.jsxs(d.Fragment,{children:[J&&d.jsx(v$,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:J}),d.jsx(m$,{scope:n,onClose:G,children:Vn.createPortal(d.jsx(YS.ItemSlot,{scope:n,children:d.jsx(Q4,{asChild:!0,onEscapeKeyDown:Rn(u,()=>{S.isFocusedToastEscapeKeyDownRef.current||G(),S.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx(sr.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":S.swipeDirection,...E,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Rn(e.onKeyDown,$=>{$.key==="Escape"&&(u==null||u($.nativeEvent),$.nativeEvent.defaultPrevented||(S.isFocusedToastEscapeKeyDownRef.current=!0,G()))}),onPointerDown:Rn(e.onPointerDown,$=>{$.button===0&&(O.current={x:$.clientX,y:$.clientY})}),onPointerMove:Rn(e.onPointerMove,$=>{if(!O.current)return;const ne=$.clientX-O.current.x,K=$.clientY-O.current.y,Z=!!T.current,B=["left","right"].includes(S.swipeDirection),te=["left","up"].includes(S.swipeDirection)?Math.min:Math.max,pe=B?te(0,ne):0,k=B?0:te(0,K),Q=$.pointerType==="touch"?10:2,ce={x:pe,y:k},fe={originalEvent:$,delta:ce};Z?(T.current=ce,Sm(d$,b,fe,{discrete:!1})):ON(ce,S.swipeDirection,Q)?(T.current=ce,Sm(u$,p,fe,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(ne)>Q||Math.abs(K)>Q)&&(O.current=null)}),onPointerUp:Rn(e.onPointerUp,$=>{const ne=T.current,K=$.target;if(K.hasPointerCapture($.pointerId)&&K.releasePointerCapture($.pointerId),T.current=null,O.current=null,ne){const Z=$.currentTarget,B={originalEvent:$,delta:ne};ON(ne,S.swipeDirection,S.swipeThreshold)?Sm(h$,x,B,{discrete:!0}):Sm(f$,g,B,{discrete:!0}),Z.addEventListener("click",te=>te.preventDefault(),{once:!0})}})})})}),S.viewport)})]}):null}),v$=e=>{const{__scopeToast:t,children:n,...r}=e,i=wb(Df,t),[o,l]=v.useState(!1),[u,f]=v.useState(!1);return w$(()=>l(!0)),v.useEffect(()=>{const h=window.setTimeout(()=>f(!0),1e3);return()=>window.clearTimeout(h)},[]),u?null:d.jsx(KS,{asChild:!0,children:d.jsx(HS,{...r,children:o&&d.jsxs(d.Fragment,{children:[i.label," ",n]})})})},g$="ToastTitle",kk=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return d.jsx(sr.div,{...r,ref:t})});kk.displayName=g$;var y$="ToastDescription",Lk=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return d.jsx(sr.div,{...r,ref:t})});Lk.displayName=y$;var Ik="ToastAction",x$=v.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?d.jsx(qk,{altText:n,asChild:!0,children:d.jsx(Uk,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ik}\`. Expected non-empty \`string\`.`),null)});x$.displayName=Ik;var zk="ToastClose",Uk=v.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=p$(zk,n);return d.jsx(qk,{asChild:!0,children:d.jsx(sr.button,{type:"button",...r,ref:t,onClick:Rn(e.onClick,i.onClose)})})});Uk.displayName=zk;var qk=v.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return d.jsx(sr.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Bk(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),S$(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const l=r.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...Bk(r))}}),t}function Sm(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Ak(i,o):i.dispatchEvent(o)}var ON=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),o=r>i;return t==="left"||t==="right"?o&&r>n:!o&&i>n};function w$(e=()=>{}){const t=fo(e);ou(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function S$(e){return e.nodeType===e.ELEMENT_NODE}function E$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $y(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var A$=Pk,j$=Dk,C$=Rk,O$=kk,N$=Lk;const Sw=new Set;let T$=0;function Ky(e,t,n){const r={id:++T$,kind:e,title:t,description:n};Sw.forEach(i=>i(r))}const le={success:(e,t)=>Ky("success",e,t),error:(e,t)=>Ky("error",e,t),info:(e,t)=>Ky("info",e,t)},NN=3;function P$({children:e}){const[t,n]=v.useState([]);v.useEffect(()=>{const i=o=>n(l=>{const u=l.findIndex(h=>h.kind===o.kind&&h.title===o.title);if(u>=0){const h=l.slice();return h[u]=o,h}const f=[...l,o];return f.length>NN?f.slice(f.length-NN):f});return Sw.add(i),()=>{Sw.delete(i)}},[]);const r=v.useCallback(i=>{n(o=>o.filter(l=>l.id!==i))},[]);return d.jsxs(A$,{swipeDirection:"right",duration:5e3,children:[e,t.map(i=>d.jsxs(C$,{className:`bb-toast bb-toast-${i.kind}`,onOpenChange:o=>{o||r(i.id)},children:[d.jsx(O$,{className:"bb-toast-title",children:i.title}),i.description&&d.jsx(N$,{className:"bb-toast-description",children:i.description})]},i.id)),d.jsx(j$,{className:"bb-toast-viewport"})]})}const _$="modulepreload",D$=function(e){return"/"+e},TN={},M$=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));i=l(n.map(h=>{if(h=D$(h),h in TN)return;TN[h]=!0;const p=h.endsWith(".css"),b=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${b}`))return;const g=document.createElement("link");if(g.rel=p?"stylesheet":_$,p||(g.as="script"),g.crossOrigin="",g.href=h,f&&g.setAttribute("nonce",f),document.head.appendChild(g),p)return new Promise((x,E)=>{g.addEventListener("load",x),g.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return i.then(l=>{for(const u of l||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};let su=null,PN=!1;function R$(){if(PN)return;PN=!0;const e=(()=>{try{return Re()}catch{return null}})();if(!e)return;const t=e.posthogKey??"",n=e.posthogHost??"https://us.i.posthog.com";if(!t){console.info("[BitBot telemetry] No PostHog key configured. Events log to console only.");return}M$(()=>import("./module.js"),[]).then(r=>{su=r.default,su.init(t,{api_host:n,autocapture:!0,capture_pageview:!0,capture_pageleave:!0,session_recording:{maskAllInputs:!1,maskTextSelector:"[data-ph-mask]"},respect_dnt:!0,persistence:"localStorage",loaded:i=>{const o=L$(e.siteUrl),l=I$(e.apiUrl);i.identify(o,{site_url:e.siteUrl,plan:e.plan,plugin_version:e.pluginVersion}),i.register({plan:e.plan,plugin_version:e.pluginVersion,site_domain:o,environment:l});for(const u of lu)i.capture(u.name,u.props);lu.length=0}})}).catch(r=>{console.warn("[BitBot telemetry] PostHog SDK failed to load:",r)})}const lu=[],Fk=50;function Ra(e,t){console.log(`[BitBot telemetry] ${e}`,t??{}),su?su.capture(e,t):$k()&&lu.length<Fk&&lu.push({name:e,props:t})}function k$(e,t){const n=e instanceof Error?e.message:String(e),r=e instanceof Error?e.stack:void 0;console.error("[BitBot exception]",n,{context:t,stack:r}),su?su.capture("$exception",{$exception_message:n,$exception_type:e instanceof Error?e.name:"Unknown",$exception_stack_trace_raw:r,...t}):$k()&&lu.length<Fk&&lu.push({name:"$exception",props:{$exception_message:n,$exception_type:e instanceof Error?e.name:"Unknown",$exception_stack_trace_raw:r,...t}})}function $k(){try{return!!Re().posthogKey}catch{return!1}}function L$(e){try{return new URL(e).host}catch{return e}}function I$(e){try{const t=new URL(e).host;return t.startsWith("dev.")?"dev":t==="youami.ai"?"prod":t.startsWith("localhost")||t.startsWith("127.")?"local":"other"}catch{return"other"}}const Ew="bitbot:auth-error";function z$(e){typeof window<"u"&&window.dispatchEvent(new CustomEvent(Ew,{detail:{error:e}}))}async function me(e,t={}){const n=Re(),r=performance.now();let i;try{i=await fetch(n.apiUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({_tag:e,apiKey:n.apiKey,...t})})}catch(l){const u=l instanceof Error?l.message:"Network error";return Ra("rpc_failure",{tag:e,kind:"network",error:u}),{success:!1,error:u}}let o;try{o=await i.json()}catch{const l=`Non-JSON response from ${e} (HTTP ${i.status})`;return Ra("rpc_failure",{tag:e,kind:"non_json",http_status:i.status}),{success:!1,error:l}}if(o&&typeof o=="object"){const l=o;if(l._tag==="Failure")return Ra("rpc_failure",{tag:e,kind:"server",http_status:i.status,error:l.error}),l.error&&/invalid api key/i.test(l.error)&&z$(l.error),{success:!1,error:l.error??"Unknown error"};if(l._tag==="Success"&&l.value!==void 0){const u=performance.now()-r;return u>2e3&&Ra("rpc_success_slow",{tag:e,ms:Math.round(u)}),{success:!0,data:l.value}}}return i.ok?{success:!0,data:o}:(Ra("rpc_failure",{tag:e,kind:"http",http_status:i.status}),{success:!1,error:`HTTP ${i.status} from ${e}`})}async function U$(e){const t=Re();try{const n=await fetch(`${t.restUrl}${e}`,{method:"GET",headers:{"X-WP-Nonce":t.nonce,Accept:"application/json"},credentials:"same-origin"});return n.ok?{success:!0,data:await n.json()}:(Ra("rest_failure",{path:e,method:"GET",http_status:n.status}),{success:!1,error:`HTTP ${n.status}`})}catch(n){const r=n instanceof Error?n.message:"Network error";return Ra("rest_failure",{path:e,method:"GET",kind:"network",error:r}),{success:!1,error:r}}}async function q$(e,t){const n=Re();try{const r=await fetch(`${n.restUrl}${e}`,{method:"POST",headers:{"X-WP-Nonce":n.nonce,"Content-Type":"application/json",Accept:"application/json"},credentials:"same-origin",body:JSON.stringify(t)});return r.ok?{success:!0,data:await r.json()}:(Ra("rest_failure",{path:e,method:"POST",http_status:r.status}),{success:!1,error:`HTTP ${r.status}`})}catch(r){const i=r instanceof Error?r.message:"Network error";return Ra("rest_failure",{path:e,method:"POST",kind:"network",error:i}),{success:!1,error:i}}}function WS(){return Et({queryKey:["overview-insights"],queryFn:async()=>{const e=await me("GetOverviewInsights");if(!e.success)throw new Error(e.error);return e.data},staleTime:120*1e3})}function Mf({open:e,title:t,aside:n,onClose:r,children:i}){return v.useEffect(()=>{if(!e)return;const o=l=>{l.key==="Escape"&&r()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e,r]),e?d.jsx("div",{className:"bb-modal-backdrop",onClick:r,children:d.jsxs("div",{className:"bb-modal",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true",children:[d.jsxs("header",{className:"bb-modal-head",children:[d.jsxs("div",{className:"bb-modal-titles",children:[d.jsx("h3",{className:"bb-modal-title",children:t}),n&&d.jsx("span",{className:"bb-modal-aside",children:n})]}),d.jsx("button",{className:"bb-modal-close",onClick:r,"aria-label":"Close",children:"×"})]}),d.jsx("div",{className:"bb-modal-body",children:i})]})}):null}function B$(e,t){if(e===0&&t===0)return{label:"no activity yet",tone:"flat"};if(t===0)return{label:"new — no prior data",tone:"up"};const n=Math.round((e-t)/t*100);return n===0?{label:"flat vs prior 7d",tone:"flat"}:n>0?{label:`↑${n}% vs prior 7d`,tone:"up"}:{label:`↓${Math.abs(n)}% vs prior 7d`,tone:"down"}}const QS="Not enough chat yet. Cards fill in once visitors start engaging.";function Eu({onClick:e,label:t="View all"}){return d.jsxs("button",{type:"button",className:"bb-insight-viewall",onClick:e,children:[t," →"]})}function Kk(e){const t=new URL(window.location.href);t.searchParams.set("tab",e),window.history.pushState({},"",t),window.dispatchEvent(new PopStateEvent("popstate"))}function F$({pages:e}){const[t,n]=v.useState(!1),r=i=>i.servedCount>0?Math.round(i.clickCount/i.servedCount*100):0;return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Top cited pages"}),d.jsx("span",{className:"bb-insight-aside",children:"what the bot leans on"})]}),e.length===0?d.jsx("p",{className:"bb-insight-empty",children:QS}):d.jsxs(d.Fragment,{children:[d.jsx("ul",{className:"bb-insight-pages",children:e.slice(0,3).map((i,o)=>d.jsxs("li",{className:"bb-insight-page",children:[d.jsxs("div",{className:"bb-insight-page-head",children:[d.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"bb-insight-page-title",children:i.title??i.url}),d.jsxs("span",{className:"bb-insight-page-served",children:[i.servedCount,"×"]})]}),d.jsxs("div",{className:"bb-insight-page-foot",children:[d.jsx("span",{className:"bb-insight-page-url",children:i.url}),d.jsxs("span",{className:"bb-insight-page-ctr",children:[r(i),"% CTR"]})]})]},o))}),e.length>3&&d.jsx(Eu,{onClick:()=>n(!0)})]}),d.jsx(Mf,{open:t,title:"All cited pages",aside:`${e.length} pages · last 7d`,onClose:()=>n(!1),children:d.jsx("ol",{className:"bb-modal-list",children:e.map((i,o)=>d.jsxs("li",{className:"bb-modal-row",children:[d.jsx("span",{className:"bb-modal-rank",children:o+1}),d.jsxs("div",{className:"bb-modal-body-col",children:[d.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"bb-modal-row-title",children:i.title??i.url}),d.jsx("span",{className:"bb-modal-row-sub",children:i.url})]}),d.jsxs("span",{className:"bb-modal-row-count",children:[i.servedCount,"× · ",r(i),"% CTR"]})]},o))})})]})}function $$({gaps:e}){const[t,n]=v.useState(!1),r=i=>{sessionStorage.setItem("bb-faq-from-gap",JSON.stringify({topic:i.topic,example:i.example}));const o=new URL(window.location.href);o.searchParams.set("tab","content"),o.searchParams.set("sub","faqs"),window.history.pushState({},"",o),window.dispatchEvent(new PopStateEvent("popstate"))};return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Coverage gaps"}),e.length>0&&d.jsxs("span",{className:"bb-insight-aside",children:[e.reduce((i,o)=>i+o.count,0)," unanswered"]})]}),e.length===0?d.jsx("p",{className:"bb-insight-empty",children:"The bot's answering everything confidently — or there isn't enough chat yet to spot patterns."}):d.jsxs(d.Fragment,{children:[d.jsx("ul",{className:"bb-insight-gaps",children:e.slice(0,2).map((i,o)=>d.jsxs("li",{className:"bb-insight-gap",children:[d.jsxs("div",{className:"bb-insight-gap-head",children:[d.jsx("span",{className:"bb-insight-gap-topic",children:i.topic}),d.jsxs("span",{className:"bb-insight-gap-count",children:[i.count," asks"]})]}),d.jsxs("div",{className:"bb-insight-gap-example",children:['"',i.example,'"']}),d.jsx("button",{type:"button",className:"bb-insight-gap-cta",onClick:()=>r(i),children:"Auto-draft FAQ →"})]},o))}),e.length>2&&d.jsx(Eu,{onClick:()=>n(!0)})]}),d.jsx(Mf,{open:t,title:"All coverage gaps",aside:`${e.length} topics`,onClose:()=>n(!1),children:d.jsx("ol",{className:"bb-modal-list",children:e.map((i,o)=>d.jsxs("li",{className:"bb-modal-row",children:[d.jsx("span",{className:"bb-modal-rank",children:o+1}),d.jsxs("div",{className:"bb-modal-body-col",children:[d.jsx("span",{className:"bb-modal-row-title",children:i.topic}),d.jsxs("span",{className:"bb-modal-row-sub",children:['"',i.example,'"']})]}),d.jsx("button",{type:"button",className:"bb-modal-row-action",onClick:()=>{n(!1),r(i)},children:"Draft FAQ →"})]},o))})})]})}function K$({topics:e,totalMessages:t}){const[n,r]=v.useState(!1);return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Top questions"}),t>0&&d.jsxs("span",{className:"bb-insight-aside",children:[t," messages"]})]}),e.length===0?d.jsx("p",{className:"bb-insight-empty",children:QS}):d.jsxs(d.Fragment,{children:[d.jsx("ol",{className:"bb-insight-list",children:e.slice(0,3).map((i,o)=>d.jsxs("li",{className:"bb-insight-list-row",children:[d.jsx("span",{className:"bb-insight-list-rank",children:o+1}),d.jsxs("div",{className:"bb-insight-list-body",children:[d.jsx("div",{className:"bb-insight-list-label",children:i.label}),d.jsxs("div",{className:"bb-insight-list-sub",children:['"',i.example,'"']})]}),d.jsx("span",{className:"bb-insight-list-count",children:i.count})]},o))}),e.length>3&&d.jsx(Eu,{onClick:()=>r(!0)})]}),d.jsx(Mf,{open:n,title:"All clustered questions",aside:`${e.length} topics`,onClose:()=>r(!1),children:d.jsx("ol",{className:"bb-modal-list",children:e.map((i,o)=>d.jsxs("li",{className:"bb-modal-row",children:[d.jsx("span",{className:"bb-modal-rank",children:o+1}),d.jsxs("div",{className:"bb-modal-body-col",children:[d.jsx("span",{className:"bb-modal-row-title",children:i.label}),d.jsxs("span",{className:"bb-modal-row-sub",children:['"',i.example,'"']})]}),d.jsx("span",{className:"bb-modal-row-count",children:i.count})]},o))})})]})}function H$({countries:e,otherVisitors:t}){const[n,r]=v.useState(!1),i=e.reduce((o,l)=>o+l.count,0)+t;return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Where they're from"}),d.jsx("span",{className:"bb-insight-aside",children:"visitor IP"})]}),e.length===0?d.jsx("p",{className:"bb-insight-empty",children:QS}):d.jsxs(d.Fragment,{children:[d.jsxs("ul",{className:"bb-insight-bars",children:[e.slice(0,3).map((o,l)=>{const u=i>0?Math.round(o.count/i*100):0;return d.jsxs("li",{className:"bb-insight-bar-row",children:[d.jsx("span",{className:"bb-insight-bar-label",children:o.countryName}),d.jsx("span",{className:"bb-insight-bar-track",children:d.jsx("span",{className:"bb-insight-bar-fill",style:{width:`${Math.max(u,4)}%`}})}),d.jsx("span",{className:"bb-insight-bar-count",children:o.count})]},l)}),t>0&&d.jsx("li",{className:"bb-insight-bar-row bb-insight-bar-other",children:d.jsxs("span",{className:"bb-insight-bar-label",children:["+ ",t," other"]})})]}),(e.length>3||t>0)&&d.jsx(Eu,{onClick:()=>r(!0)})]}),d.jsx(Mf,{open:n,title:"All countries",aside:`${e.length} countries`,onClose:()=>r(!1),children:d.jsxs("ol",{className:"bb-modal-list",children:[e.map((o,l)=>d.jsxs("li",{className:"bb-modal-row",children:[d.jsx("span",{className:"bb-modal-rank",children:l+1}),d.jsx("span",{className:"bb-modal-row-title",children:o.countryName}),d.jsx("span",{className:"bb-modal-row-count",children:o.count})]},l)),t>0&&d.jsx("li",{className:"bb-modal-row bb-modal-row-other",children:d.jsxs("span",{className:"bb-modal-row-title",children:["+ ",t," other visitors"]})})]})})]})}function G$({data:e}){const t=B$(e.conversations,e.conversationsPrior),n=Math.round(e.returningVisitorRate*100);return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Conversation pulse"}),d.jsxs("span",{className:"bb-insight-aside",children:["last ",e.windowDays,"d"]})]}),d.jsxs("div",{className:"bb-insight-hero",children:[d.jsx("span",{className:"bb-insight-hero-num",children:e.conversations}),d.jsx("span",{className:`bb-insight-hero-delta bb-insight-tone-${t.tone}`,children:t.label})]}),d.jsxs("dl",{className:"bb-insight-facts",children:[d.jsxs("div",{className:"bb-insight-fact",children:[d.jsx("dt",{children:"Unique visitors"}),d.jsx("dd",{children:e.uniqueVisitors})]}),d.jsxs("div",{className:"bb-insight-fact",children:[d.jsx("dt",{children:"Returning"}),d.jsxs("dd",{children:[n,d.jsx("span",{className:"bb-insight-fact-unit",children:"%"})]})]})]}),d.jsx(Eu,{onClick:()=>Kk("conversations"),label:"View conversations"})]})}function Y$({data:e}){const t=Math.round(e.leadCaptureRate*100);return d.jsxs("article",{className:"bb-insight-card",children:[d.jsxs("header",{className:"bb-insight-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Lead capture"}),d.jsxs("span",{className:"bb-insight-aside",children:["last ",e.windowDays,"d"]})]}),d.jsxs("div",{className:"bb-insight-hero",children:[d.jsxs("span",{className:"bb-insight-hero-num",children:[t,d.jsx("span",{className:"bb-insight-hero-unit",children:"%"})]}),d.jsx("span",{className:"bb-insight-hero-delta bb-insight-tone-flat",children:"capture rate"})]}),d.jsxs("dl",{className:"bb-insight-facts",children:[d.jsxs("div",{className:"bb-insight-fact",children:[d.jsx("dt",{children:"Leads captured"}),d.jsx("dd",{children:e.leadsCount})]}),d.jsxs("div",{className:"bb-insight-fact",children:[d.jsxs("dt",{children:["From ",e.conversations," conversations"]}),d.jsx("dd",{children:e.leadsCount===0&&e.conversations>0?"no captures yet":`${e.leadsCount} of ${e.conversations}`})]})]}),d.jsx(Eu,{onClick:()=>Kk("leads"),label:"View leads"})]})}function W$(){const{data:e,isLoading:t,isError:n}=WS();return t?d.jsx("div",{className:"bb-insight-bento",children:[0,1,2,3,4,5].map(r=>d.jsx("div",{className:"bb-insight-card",children:d.jsx("div",{className:"bb-skeleton",style:{height:160,borderRadius:6}})},r))}):n||!e?d.jsx("div",{className:"bb-insight-bento",children:d.jsx("div",{className:"bb-insight-card bb-insight-card-error",children:"Couldn't load insights right now. Try refreshing in a moment."})}):d.jsxs("div",{className:"bb-insight-bento",children:[d.jsx(F$,{pages:e.topCitedPages}),d.jsx($$,{gaps:e.coverageGaps}),d.jsx(K$,{topics:e.topQuestions,totalMessages:e.userMessages}),d.jsx(H$,{countries:e.topCountries,otherVisitors:e.otherCountriesVisitors}),d.jsx(G$,{data:e}),d.jsx(Y$,{data:e})]})}const Q$={plan:"pro",accessMode:"active",trialEndsAt:null,daysRemaining:0,limits:{chatMessagesPerMonth:1e3,topicCreditsPerMonth:0,postsPerMonth:30,postCooldownHours:24,maxLeads:1e3,maxForms:10},usage:{chatMessagesThisMonth:347,topicCreditsThisMonth:0,postsThisMonth:8,leadsCount:42,formsCount:3,lastPostGeneratedAt:null}};function Ai(){return Et({queryKey:["plan-status"],queryFn:async()=>{if(Re().apiKey==="bb_devmockapikey0000000000000000")return Q$;const t=await me("GetPlanStatus",{});if(!t.success)throw new Error(t.error);return t.data},staleTime:300*1e3,refetchOnWindowFocus:!0})}function Hk(){const{data:e,isLoading:t}=Ai(),n=(e==null?void 0:e.accessMode)??"active";return{accessMode:n,trialEndsAt:(e==null?void 0:e.trialEndsAt)??null,daysRemaining:(e==null?void 0:e.daysRemaining)??0,isFree:n==="free",isExpired:n==="expired",isActive:n==="active",isLoading:t}}const V$="bb_devmockapikey0000000000000000",X$={status:"completed",pagesCount:128,lastSync:new Date(Date.now()-14400*1e3).toISOString()};function VS(){const t=Re().apiKey===V$;return Et({queryKey:["sync-status"],queryFn:async()=>{if(t)return X$;const n=await me("GetSyncStatus");if(!n.success)throw new Error(n.error);return n.data},refetchInterval:n=>{var r;return((r=n.state.data)==null?void 0:r.status)==="syncing"?5e3:!1},staleTime:30*1e3})}function ir(e){if(!e)return"";const t=new Date(e).getTime();if(Number.isNaN(t))return"";const n=Date.now()-t;if(n<6e4)return"just now";const r=Math.floor(n/6e4);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);if(i<24)return`${i}h ago`;const o=Math.floor(i/24);if(o<30)return`${o}d ago`;const l=new Date(t),u=l.getFullYear()===new Date().getFullYear();return l.toLocaleDateString(void 0,u?{month:"short",day:"numeric"}:{month:"short",day:"numeric",year:"numeric"})}function Hy(e){return e==null||Number.isNaN(e)?"":e.toLocaleString()}function mp(e,t=100){if(e.length<=t)return e;const n=e.slice(0,t),r=n.lastIndexOf(" ");return(r>t*.6?n.slice(0,r):n)+"…"}function XS(e){if(!e)return null;const t={loadSkill:null,searchSiteContent:"Searched your site",getCustomerProfile:"Looked up visitor info",updateCustomerProfile:"Captured visitor info",captureHandover:"Created a lead",startLiveThread:"Started a live thread",sendOtp:"Sent a verification code",verifyOtp:"Verified the code",listDrafts:"Listed your drafts",getDraft:"Opened a draft",listFaqs:"Listed your FAQs",listIndexedPages:"Checked your indexed pages",listLeads:"Listed your leads",getLead:"Opened a lead",getUnviewedLeadsCount:"Checked new leads",getSiteInsights:"Pulled your insights",listForms:"Listed your forms",getForm:"Opened a form",getChatbotInstructions:"Checked your chatbot instructions",getSiteSubscription:"Checked your subscription",runAnalyticsQuery:"Crunched the numbers",showChart:"Drew a chart",generatePostFromTopic:"Drafted a post",generatePostFromUrl:"Drafted from URL",discoverContentTopics:"Researched topics",draftFaqFromGap:"Drafted an FAQ",runLeadResearch:"Researched a lead",draftLeadFollowupEmail:"Drafted a follow-up email"};return e in t?t[e]:e.replace(/([A-Z])/g," $1").replace(/^./,n=>n.toUpperCase()).trim()}function Gk(e){switch(e){case"messenger":return{label:"Messenger",icon:"📨"};case"instagram_dm":return{label:"Instagram",icon:"📷"};case"whatsapp":return{label:"WhatsApp",icon:"🟢"};case"telegram":return{label:"Telegram",icon:"✈️"};case"sms":return{label:"SMS",icon:"✉️"};case"discord":return{label:"Discord",icon:"💜"};case"form":return{label:"Form",icon:"📝"};case"email":return{label:"Support email",icon:"✉️"};case"web_widget":default:return{label:"Web chat",icon:"💬"}}}function Yk(e){if(!e)return"Chat";const t={chat:"Chat",chat_kyc:"Chat",chat_handover:"Chat",chat_appointment:"Chat",chat_live:"Chat",chat_support:"Chat",chat_qualified:"Chat",form:"Form"};return t[e]?t[e]:e.replace(/_/g," ").replace(/\b\w/g,n=>n.toUpperCase())}function Z$(){return d.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:d.jsx("path",{d:"m9 6 6 6-6 6"})})}const Em={sync:d.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:d.jsx("path",{d:"M3 12a9 9 0 0 1 15-6.7L21 8M21 3v5h-5M21 12a9 9 0 0 1-15 6.7L3 16M3 21v-5h5"})}),leads:d.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[d.jsx("path",{d:"M4 4h16v16H4z"}),d.jsx("path",{d:"m4 7 8 5 8-5"})]}),generate:d.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:d.jsx("path",{d:"M12 5v14M5 12h14"})}),testChat:d.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:d.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})};function J$(){const e=Ne(),{isExpired:t}=Hk(),{data:n}=VS(),r=Re(),i=r.apiKey==="bb_devmockapikey0000000000000000",{data:o}=Et({queryKey:["unviewed-leads-count"],queryFn:async()=>{if(i)return 4;const x=await me("GetUnviewedLeadsCount",{});return x.success?x.data.count:0},staleTime:60*1e3}),l=je({mutationFn:async()=>{var A;const x=new URLSearchParams({action:"bitbot_sync",nonce:r.ajaxNonce}),S=await(await fetch(r.ajaxUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:x.toString()})).json();if(!S.success)throw new Error(((A=S.data)==null?void 0:A.error)||"Sync failed");return S.data},onSuccess:()=>{le.success("Sync started"),e.invalidateQueries({queryKey:["sync-status"]})},onError:x=>le.error(x instanceof Error?x.message:"Sync failed")}),u=x=>{const E=new URL(window.location.href);E.searchParams.set("tab",x),window.history.pushState({},"",E),window.dispatchEvent(new PopStateEvent("popstate"))},f=l.isPending||(n==null?void 0:n.status)==="syncing",h=f?"Syncing now…":(n==null?void 0:n.status)==="failed"?"Sync failed":"Sync content",p=f?n!=null&&n.pagesCount?`Crawling ${n.pagesCount} pages`:"Crawling your site":(n==null?void 0:n.status)==="failed"?"Try again from the Knowledgebase tab":n!=null&&n.lastSync?`Last sync ${ir(n.lastSync)}`:"Re-crawl your site for new pages",b=o&&o>0?`${o} new ${o===1?"lead":"leads"} to review`:"See everyone who got in touch",g=[{icon:Em.sync,title:h,sub:p,onClick:()=>l.mutate(),disabled:t||f,disabledHint:t?"Reactivate your plan to sync content":void 0},{icon:Em.leads,title:"View leads",sub:b,onClick:()=>u("leads")},{icon:Em.generate,title:"Generate a blog post",sub:"From a topic, URL, or upload",onClick:()=>u("content")},{icon:Em.testChat,title:"Open the chat",sub:"Test your bot like a visitor",onClick:()=>window.open(r.siteUrl||"/","_blank")}];return d.jsxs("section",{className:"bb-card bb-quickactions-card",children:[d.jsx("header",{className:"bb-card-header",children:d.jsxs("h3",{className:"bb-card-title",children:[d.jsx("span",{className:"bb-eyebrow",children:"Shortcuts"}),d.jsx("span",{children:"Quick actions"})]})}),d.jsx("ul",{className:"bb-quickactions-list",children:g.map((x,E)=>d.jsx("li",{children:d.jsxs("button",{className:"bb-quickaction",onClick:x.onClick,disabled:x.disabled,title:x.disabledHint,children:[d.jsx("span",{className:"bb-quickaction-icon",children:x.icon}),d.jsxs("span",{className:"bb-quickaction-text",children:[d.jsx("span",{className:"bb-quickaction-title",children:x.title}),d.jsx("span",{className:"bb-quickaction-sub",children:x.sub})]}),d.jsx("span",{className:"bb-quickaction-chevron",children:d.jsx(Z$,{})})]})},E))})]})}const e5="bb_devmockapikey0000000000000000",_N={enabled:!0,widgetTitle:"Chat with us",widgetPosition:"bottom-right",widgetOffsetX:20,widgetOffsetY:20,primaryColor:"#0073aa",welcomeMessage:"Hi! How can I help you today?",customInstructions:"",placeholderText:"Type your message...",fallbackMessage:"I'm not sure about that yet. Let me know how I can help.",leadCapturePrompt:"Drop your email so we can follow up.",typingIndicatorText:"Typing…",hideOnPages:"",mobileBehaviour:"inherit",cornerRadius:32,widgetShape:"rounded",suggestedQuestions:[{label:"Pricing",message:"What are your prices?"},{label:"Services",message:"What services do you offer?"},{label:"Contact",message:"How do I get in touch?"}],avatarUrl:"",avatarTransform:"",nudge:"",autoOpen:"",pinnedMessage:"",offTopicGuardrails:"",notificationEmail:""},Gy=["admin-settings"],t5=500;function ZS(){const e=Re(),t=Ne(),n=e.apiKey===e5,[r,i]=v.useState(null),[o,l]=v.useState(!1),u=Et({queryKey:Gy,queryFn:async()=>{if(n)return _N;const g=await U$("/admin-settings");if(!g.success)throw new Error(g.error);return g.data},staleTime:60*1e3}),f=je({mutationFn:async g=>{if(n)return await new Promise(E=>setTimeout(E,250)),Object.assign(_N,g),g;const x=await q$("/admin-settings",g);if(!x.success)throw new Error(x.error);return g},onSuccess:()=>{i(Date.now()),l(!1)},onError:g=>{le.error(g instanceof Error?g.message:"Save failed"),l(!1)}}),h=v.useRef({}),p=v.useRef(null),b=g=>{const x=t.getQueryData(Gy);x&&t.setQueryData(Gy,{...x,...g}),h.current={...h.current,...g},l(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{const E=h.current;h.current={},p.current=null,Object.keys(E).length>0&&f.mutate(E)},t5)};return{settings:u.data,isLoading:u.isLoading,isError:u.isError,error:u.error,save:b,isSaving:o||f.isPending,lastSavedAt:r}}function n5(){const e=Re(),t=(()=>{const u=e.widgetEnabled;return typeof u=="boolean"?u:typeof u=="string"?u!==""&&u!=="0":!0})(),[n,r]=v.useState(t),[i,o]=v.useState(!1);return{enabled:n,pending:i,toggle:async u=>{const f=n;r(u),o(!0);try{const h=new URLSearchParams({action:"bitbot_set_widget_enabled",nonce:e.ajaxNonce,enabled:u?"1":"0"}),b=await(await fetch(e.ajaxUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:h.toString()})).json();if(!b.success)throw new Error(b.error??"Toggle failed");window.bitbotAdminConfig&&(window.bitbotAdminConfig.widgetEnabled=u),le.success(u?"Widget turned on":"Widget turned off")}catch(h){r(f),le.error(h instanceof Error?h.message:"Toggle failed")}finally{o(!1)}}}}function JS(){return Et({queryKey:["integrations","meta"],queryFn:async()=>{const e=await me("GetMetaIntegration");if(!e.success)throw new Error(e.error);return e.data},staleTime:6e4})}function r5(){return je({mutationFn:async()=>{const e=await me("StartMetaOAuth");if(!e.success)throw new Error(e.error);return e.data},onError:e=>le.error(e instanceof Error?e.message:"Could not start Facebook sign-in")})}function a5(){const e=Ne();return je({mutationFn:async()=>{const t=await me("DisconnectMeta");if(!t.success)throw new Error(t.error);return t.data},onSuccess:()=>{le.success("Facebook disconnected"),e.invalidateQueries({queryKey:["integrations","meta"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not disconnect Facebook")})}function eE(){return Et({queryKey:["integrations","woocommerce"],queryFn:async()=>{const e=await me("GetWooCommerceStatus");if(!e.success)throw new Error(e.error);return e.data},staleTime:6e4})}function i5(){const e=Ne();return je({mutationFn:async({consumerKey:t,consumerSecret:n})=>{const r=await me("UpdateWcCredentials",{consumerKey:t,consumerSecret:n});if(!r.success)throw new Error(r.error);const i=await me("SetSkillEnabled",{skillName:"woocommerce",enabled:!0});if(!i.success)throw new Error(i.error);const o=await me("SetSkillVisitorExposed",{skillName:"woocommerce",exposed:!0});if(!o.success)throw new Error(o.error);return{success:!0}},onSuccess:()=>{le.success("WooCommerce connected"),e.invalidateQueries({queryKey:["integrations","woocommerce"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not save WooCommerce credentials")})}function o5(){const e=Ne();return je({mutationFn:async()=>{const t=await me("UpdateWcCredentials",{consumerKey:"",consumerSecret:""});if(!t.success)throw new Error(t.error);const n=await me("SetSkillEnabled",{skillName:"woocommerce",enabled:!1});if(!n.success)throw new Error(n.error);return{success:!0}},onSuccess:()=>{le.success("WooCommerce disconnected"),e.invalidateQueries({queryKey:["integrations","woocommerce"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not disconnect WooCommerce")})}function Rf(){return Et({queryKey:["integrations","zoho"],queryFn:async()=>{const e=await me("GetZohoIntegration");if(!e.success)throw new Error(e.error);return e.data},staleTime:6e4})}function s5(){return je({mutationFn:async()=>{const e=await me("StartZohoOAuth");if(!e.success)throw new Error(e.error);return e.data},onError:e=>le.error(e instanceof Error?e.message:"Could not start Zoho sign-in")})}function l5(){const e=Ne();return je({mutationFn:async()=>{const t=await me("DisconnectZoho");if(!t.success)throw new Error(t.error);return t.data},onSuccess:()=>{le.success("Zoho disconnected"),e.invalidateQueries({queryKey:["integrations","zoho"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not disconnect Zoho")})}function c5(){return Et({queryKey:["integrations","zoho","auto-sync"],queryFn:async()=>{const e=await me("GetZohoAutoSync");if(!e.success)throw new Error(e.error);return e.data.enabled},staleTime:6e4})}function u5(){const e=Ne();return je({mutationFn:async t=>{const n=await me("SetZohoAutoSync",{enabled:t});if(!n.success)throw new Error(n.error);return n.data.enabled},onSuccess:t=>{le.success(t?"Auto-sync to Zoho turned on":"Auto-sync to Zoho turned off"),e.invalidateQueries({queryKey:["integrations","zoho","auto-sync"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not update auto-sync")})}function d5(){const e=Ne();return je({mutationFn:async t=>{const n=await me("PushLeadToZoho",{leadId:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:()=>{le.success("Lead pushed to Zoho"),e.invalidateQueries({queryKey:["leads"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not push lead to Zoho")})}function f5(e,t){return Et({queryKey:["leads",e,"zoho-state"],queryFn:async()=>{const n=await me("GetZohoLeadStateForLead",{leadId:e});if(!n.success)throw new Error(n.error);return n.data.state},enabled:!!e&&t,staleTime:3e4})}function h5(){const e=Ne();return je({mutationFn:async()=>{const t=await me("PushAllLeadsToZoho");if(!t.success)throw new Error(t.error);return t.data},onSuccess:({pushed:t,skipped:n,failed:r})=>{const i=[];i.push(`${t} pushed`),n>0&&i.push(`${n} already in Zoho`),r>0&&i.push(`${r} failed`),le.success(i.join(" · ")),e.invalidateQueries({queryKey:["leads"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not sync leads to Zoho")})}const m5=["sync-content","notification-email"];function p5(){return d.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:d.jsx("path",{d:"M5 12h14M13 5l7 7-7 7"})})}function b5(e){const t=[];return t.push({key:"sync-content",met:e.pagesCount>0,eyebrow:e.pagesCount>0?"Indexed":"Start here",headline:e.pagesCount>0?`Indexed ${e.pagesCount} ${e.pagesCount===1?"page":"pages"}.`:"Index your site so the bot can answer.",body:e.pagesCount>0?"Re-sync any time you publish new content.":"BitBot reads your pages and posts to ground every reply. Trigger the first sync, it takes about 90 seconds.",ctaLabel:e.pagesCount>0?"Open Knowledgebase":"Sync content",goTo:"content"}),t.push({key:"notification-email",met:e.hasNotificationEmail,eyebrow:e.hasNotificationEmail?"Lead notifications":"You'll miss leads otherwise",headline:e.hasNotificationEmail?"Lead notification email is set.":"Tell us where new leads should go.",body:e.hasNotificationEmail?"New leads route to your inbox the moment they land.":"Right now, when a visitor leaves their email, the notification has nowhere to land. Add your inbox in 30 seconds.",ctaLabel:e.hasNotificationEmail?"Edit email":"Set notification email",goTo:"account:notificationEmail"}),t.push({key:"chips",met:e.chipsCount>0,eyebrow:e.chipsCount>0?"Starter chips":"Quick win",headline:e.chipsCount>0?`${e.chipsCount} starter ${e.chipsCount===1?"chip":"chips"} live.`:"Add 3 starter questions.",body:e.chipsCount>0?"Visitors see these as one-tap conversation starters in the widget.":'Sites with at least 3 starter chips get 2.4× more conversations. Suggest the questions visitors actually ask, like "How much does it cost?" or "Do you ship internationally?".',ctaLabel:e.chipsCount>0?"Edit chips":"Add chips",goTo:"chatbot"}),t.push({key:"guardrails",met:e.hasGuardrails,eyebrow:e.hasGuardrails?"Guardrails set":"Stay on-message",headline:e.hasGuardrails?"Off-topic guardrails are in place.":"Tell the bot what NOT to discuss.",body:e.hasGuardrails?"The bot refuses the topics you listed and steers back to what you can help with.":"Stop the bot from drifting into competitor talk, refund promises, or anything else off-brand. Two lines of guidance is usually enough.",ctaLabel:e.hasGuardrails?"Edit guardrails":"Add guardrails",goTo:"guardrails"}),t.push({key:"instructions",met:e.hasInstructions,eyebrow:e.hasInstructions?"Voice set":"Sound like you",headline:e.hasInstructions?"Bot voice is set.":"Give the bot your voice.",body:e.hasInstructions?"Every reply respects the style note you wrote.":'A short style note ("be friendly, lean concise, always recommend booking a demo for pricing questions") shapes every reply.',ctaLabel:e.hasInstructions?"Edit instructions":"Set instructions",goTo:"instructions"}),e.plan==="pro_plus"&&(t.push({key:"connect-meta",met:e.metaConnected,eyebrow:e.metaConnected?"Messenger + Instagram":"Answer DMs too",headline:e.metaConnected?"Facebook & Instagram are connected.":"Answer Facebook & Instagram DMs.",body:e.metaConnected?"The agent replies to Messenger and Instagram DMs with the same brain it uses on your site.":"Connect your Facebook Page and the agent answers Messenger and Instagram DMs automatically — same knowledge and skills as your website widget.",ctaLabel:e.metaConnected?"Manage Messenger":"Connect Facebook & Instagram",goTo:"integrations"}),t.push({key:"connect-woo",met:e.wcConfigured,eyebrow:e.wcConfigured?"WooCommerce":"Know your store",headline:e.wcConfigured?"WooCommerce is connected.":"Let the agent know your store.",body:e.wcConfigured?"The agent can answer product, order and stock questions, and look up a verified customer’s own orders.":"Connect WooCommerce so the agent can answer product, order and stock questions — and look up a customer’s own orders in support.",ctaLabel:e.wcConfigured?"Manage WooCommerce":"Connect WooCommerce",goTo:"integrations"}),t.push({key:"connect-zoho",met:e.zohoConnected,eyebrow:e.zohoConnected?"Zoho CRM":"Sync your leads",headline:e.zohoConnected?"Leads sync to Zoho CRM.":"Send leads straight to Zoho CRM.",body:e.zohoConnected?"Every captured lead flows into your Zoho pipeline automatically.":"Connect Zoho CRM and every captured lead lands in your pipeline automatically — no copy-paste.",ctaLabel:e.zohoConnected?"Manage Zoho":"Connect Zoho CRM",goTo:"integrations"})),e.plan==="pro"&&e.conversations7d>=40&&t.push({key:"agent-upsell",met:!1,eyebrow:"You're getting busy",headline:"Let the Agent do the follow-up.",body:`${e.conversations7d} conversations this week. Agent tier turns chats into actions automatically: handover, bookings, lead enrichment.`,ctaLabel:"See Agent",goTo:"integrations"}),t.some(r=>!r.met)||t.push({key:"all-set",met:!0,eyebrow:"Looking good",headline:"Everything important is configured.",body:"Bot is indexed, leads route to your inbox, chips are live, voice is set. Explore the Agent tab if you want to take it further.",ctaLabel:"Browse Agent",goTo:"integrations"}),t}function v5(){var C,O;const{settings:e,isLoading:t}=ZS(),{data:n,isLoading:r}=VS(),{data:i,isLoading:o}=Ai(),{data:l,isLoading:u}=WS(),{data:f}=JS(),{data:h}=eE(),{data:p}=Rf(),b=T=>{T==="guardrails"||T==="instructions"?T="chatbot:behaviour":T.startsWith("account")&&(T="leads");const[_,P]=T.includes(":")?T.split(":"):[T,null],D=new URL(window.location.href);D.searchParams.set("tab",_),P?D.searchParams.set("sub",P):D.searchParams.delete("sub"),window.history.pushState({},"",D),window.dispatchEvent(new PopStateEvent("popstate"))},g=!!(f!=null&&f.integration&&f.integration.status==="connected"&&(((C=f.integration.pages)==null?void 0:C.length)??0)>0),x=!!(h!=null&&h.configured),E=((O=p==null?void 0:p.integration)==null?void 0:O.status)==="connected",S=v.useMemo(()=>{var T,_,P,D;return b5({pagesCount:(n==null?void 0:n.pagesCount)??0,hasNotificationEmail:!!((T=e==null?void 0:e.notificationEmail)!=null&&T.trim()),chipsCount:((_=e==null?void 0:e.suggestedQuestions)==null?void 0:_.length)??0,hasGuardrails:!!((P=e==null?void 0:e.offTopicGuardrails)!=null&&P.trim()),hasInstructions:!!((D=e==null?void 0:e.customInstructions)!=null&&D.trim()),accessMode:(i==null?void 0:i.accessMode)??"free",daysRemaining:(i==null?void 0:i.daysRemaining)??30,conversations7d:(l==null?void 0:l.conversations)??0,plan:(i==null?void 0:i.plan)??"free",metaConnected:g,wcConfigured:x,zohoConnected:E})},[n==null?void 0:n.pagesCount,e,i,l==null?void 0:l.conversations,g,x,E]),A=v.useMemo(()=>{const T=S.filter(P=>!P.met);if(T.length===0)return null;const _=T.find(P=>m5.includes(P.key));return _?_.key:T[Math.floor(Math.random()*T.length)].key},[S.map(T=>`${T.key}:${T.met?1:0}`).join("|")]);if(t||r||o)return d.jsx("section",{className:"bb-nbs",children:d.jsx("div",{className:"bb-skeleton",style:{height:120,borderRadius:6}})});const j=S.find(T=>T.key===A)??S[S.length-1];return j?d.jsxs("section",{className:"bb-nbs","data-recommendation":j.key,"data-met":j.met?"true":"false",children:[d.jsx("div",{className:"bb-nbs-icon","aria-hidden":!0,children:d.jsx(p5,{})}),d.jsx("div",{className:"bb-nbs-eyebrow",children:j.eyebrow}),d.jsx("h4",{className:"bb-nbs-headline",children:j.headline}),d.jsx("p",{className:"bb-nbs-body",children:j.body}),d.jsxs("button",{className:"bb-btn bb-btn-primary",onClick:()=>b(j.goTo),disabled:u&&j.key==="all-set",children:[j.ctaLabel," →"]})]}):null}function DN(e){return typeof e=="boolean"?e:typeof e=="number"?e!==0:typeof e=="string"?e!==""&&e!=="0":!1}function g5(){const e=Re();return DN(e.widgetAccessExpired)?{kind:"expired"}:DN(e.widgetEnabled)?{kind:"ok"}:{kind:"disabled"}}function y5(){const e=g5();return e.kind==="ok"?null:e.kind==="expired"?d.jsxs("div",{className:"bb-widget-status bb-widget-status-warn",role:"status",children:[d.jsx("div",{className:"bb-widget-status-icon","aria-hidden":!0,children:"!"}),d.jsxs("div",{className:"bb-widget-status-body",children:[d.jsx("strong",{children:"Widget hidden on your site."})," ","Your subscription has ended. Reactivate to bring the chatbot back online for visitors."]})]}):d.jsxs("div",{className:"bb-widget-status bb-widget-status-info",role:"status",children:[d.jsx("div",{className:"bb-widget-status-icon","aria-hidden":!0,children:"!"}),d.jsxs("div",{className:"bb-widget-status-body",children:[d.jsx("strong",{children:"Chat is turned off."})," ","Visitors won't see the widget until you flip it back on from the Chatbot tab."]})]})}/*! @license DOMPurify 3.4.9 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.9/LICENSE */function MN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x5(e){if(Array.isArray(e))return e}function w5(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,l,u=[],f=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(f=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);f=!0);}catch(p){h=!0,i=p}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(h)throw i}}return u}}function S5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 50 In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E5(e,t){return x5(e)||w5(e,t)||A5(e,t)||S5()}function A5(e,t){if(e){if(typeof e=="string")return MN(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?MN(e,t):void 0}}const Wk=Object.entries,RN=Object.setPrototypeOf,j5=Object.isFrozen,C5=Object.getPrototypeOf,O5=Object.getOwnPropertyDescriptor;let gr=Object.freeze,Sa=Object.seal,Rc=Object.create,Qk=typeof Reflect<"u"&&Reflect,Aw=Qk.apply,jw=Qk.construct;gr||(gr=function(t){return t});Sa||(Sa=function(t){return t});Aw||(Aw=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return t.apply(n,i)});jw||(jw=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const Zi=pn(Array.prototype.forEach),N5=pn(Array.prototype.lastIndexOf),kN=pn(Array.prototype.pop),vc=pn(Array.prototype.push),T5=pn(Array.prototype.splice),hr=Array.isArray,Wd=pn(String.prototype.toLowerCase),Yy=pn(String.prototype.toString),LN=pn(String.prototype.match),gc=pn(String.prototype.replace),IN=pn(String.prototype.indexOf),P5=pn(String.prototype.trim),_5=pn(Number.prototype.toString),D5=pn(Boolean.prototype.toString),zN=typeof BigInt>"u"?null:pn(BigInt.prototype.toString),UN=typeof Symbol>"u"?null:pn(Symbol.prototype.toString),Wt=pn(Object.prototype.hasOwnProperty),Pd=pn(Object.prototype.toString),Gn=pn(RegExp.prototype.test),Ys=M5(TypeError);function pn(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Aw(e,t,r)}}function M5(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return jw(e,n)}}function He(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wd;if(RN&&RN(e,null),!hr(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=n(i);o!==i&&(j5(t)||(t[r]=o),i=o)}e[i]=!0}return e}function R5(e){for(let t=0;t<e.length;t++)Wt(e,t)||(e[t]=null);return e}function er(e){const t=Rc(null);for(const r of Wk(e)){var n=E5(r,2);const i=n[0],o=n[1];Wt(e,i)&&(hr(o)?t[i]=R5(o):o&&typeof o=="object"&&o.constructor===Object?t[i]=er(o):t[i]=o)}return t}function k5(e){switch(typeof e){case"string":return e;case"number":return _5(e);case"boolean":return D5(e);case"bigint":return zN?zN(e):"0";case"symbol":return UN?UN(e):"Symbol()";case"undefined":return Pd(e);case"function":case"object":{if(e===null)return Pd(e);const t=e,n=oi(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Pd(r)}return Pd(e)}default:return Pd(e)}}function oi(e,t){for(;e!==null;){const r=O5(e,t);if(r){if(r.get)return pn(r.get);if(typeof r.value=="function")return pn(r.value)}e=C5(e)}function n(){return null}return n}function L5(e){try{return Gn(e,""),!0}catch{return!1}}const qN=gr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Wy=gr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Qy=gr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I5=gr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Vy=gr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),z5=gr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),BN=gr(["#text"]),FN=gr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Xy=gr(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$N=gr(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Am=gr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),U5=Sa(/{{[\w\W]*|^[\w\W]*}}/g),q5=Sa(/<%[\w\W]*|^[\w\W]*%>/g),B5=Sa(/\${[\w\W]*/g),F5=Sa(/^data-[\-\w.\u00B7-\uFFFF]+$/),$5=Sa(/^aria-[\-\w]+$/),KN=Sa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),K5=Sa(/^(?:\w+script|data):/i),H5=Sa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),G5=Sa(/^html$/i),Y5=Sa(/^[a-z][.\w]*(-[.\w]+)+$/i),ni={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},W5=function(){return typeof window>"u"?null:window},Q5=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},HN=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Vk(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W5();const t=ve=>Vk(ve);if(t.version="3.4.9",t.removed=[],!e||!e.document||e.document.nodeType!==ni.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,i=r.currentScript;e.DocumentFragment;const o=e.HTMLTemplateElement,l=e.Node,u=e.Element,f=e.NodeFilter,h=e.NamedNodeMap;h===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const p=e.DOMParser,b=e.trustedTypes,g=u.prototype,x=oi(g,"cloneNode"),E=oi(g,"remove"),S=oi(g,"nextSibling"),A=oi(g,"childNodes"),j=oi(g,"parentNode"),C=oi(g,"shadowRoot"),O=oi(g,"attributes"),T=l&&l.prototype?oi(l.prototype,"nodeType"):null,_=l&&l.prototype?oi(l.prototype,"nodeName"):null;if(typeof o=="function"){const ve=n.createElement("template");ve.content&&ve.content.ownerDocument&&(n=ve.content.ownerDocument)}let P,D="",L,z=!1,F=0;const G=function(){if(F>0)throw Ys('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},R=function(I){G(),F++;try{return P.createHTML(I)}finally{F--}},J=function(I){G(),F++;try{return P.createScriptURL(I)}finally{F--}},$=function(){return z||(L=Q5(b,i),z=!0),L},ne=n,K=ne.implementation,Z=ne.createNodeIterator,B=ne.createDocumentFragment,te=ne.getElementsByTagName,pe=r.importNode;let k=HN();t.isSupported=typeof Wk=="function"&&typeof j=="function"&&K&&K.createHTMLDocument!==void 0;const Q=U5,ce=q5,fe=B5,xe=F5,Oe=$5,qe=K5,Be=H5,he=Y5;let ue=KN,Ee=null;const de=He({},[...qN,...Wy,...Qy,...Vy,...BN]);let Le=null;const Me=He({},[...FN,...Xy,...$N,...Am]);let Ie=Object.seal(Rc(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ut=null,Un=null;const qn=Object.seal(Rc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ya=!0,Xn=!0,ja=!1,Oi=!0,zr=!1,Kt=!0,Ca=!1,Eo=!1,Ur=!1,Cn=!1,ia=!1,Wa=!1,qr=!0,Ts=!1;const Qa="user-content-";let bn=!0,Zn=!1,zt={},Sr=null;const Ao=He({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Il=null;const Ni=He({},["audio","video","img","source","image","track"]);let Va=null;const Rt=He({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),At="http://www.w3.org/1998/Math/MathML",Ut="http://www.w3.org/2000/svg",Ot="http://www.w3.org/1999/xhtml";let en=Ot,sn=!1,On=null;const Er=He({},[At,Ut,Ot],Yy);let qt=He({},["mi","mo","mn","ms","mtext"]),cr=He({},["annotation-xml"]);const ur=He({},["title","style","font","a","script"]);let Nn=null;const Oa=["application/xhtml+xml","text/html"],Na="text/html";let nt=null,dr=null;const Ar=n.createElement("form"),ln=function(I){return I instanceof RegExp||I instanceof Function},Tn=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(dr&&dr===I)return;(!I||typeof I!="object")&&(I={}),I=er(I),Nn=Oa.indexOf(I.PARSER_MEDIA_TYPE)===-1?Na:I.PARSER_MEDIA_TYPE,nt=Nn==="application/xhtml+xml"?Yy:Wd,Ee=Wt(I,"ALLOWED_TAGS")&&hr(I.ALLOWED_TAGS)?He({},I.ALLOWED_TAGS,nt):de,Le=Wt(I,"ALLOWED_ATTR")&&hr(I.ALLOWED_ATTR)?He({},I.ALLOWED_ATTR,nt):Me,On=Wt(I,"ALLOWED_NAMESPACES")&&hr(I.ALLOWED_NAMESPACES)?He({},I.ALLOWED_NAMESPACES,Yy):Er,Va=Wt(I,"ADD_URI_SAFE_ATTR")&&hr(I.ADD_URI_SAFE_ATTR)?He(er(Rt),I.ADD_URI_SAFE_ATTR,nt):Rt,Il=Wt(I,"ADD_DATA_URI_TAGS")&&hr(I.ADD_DATA_URI_TAGS)?He(er(Ni),I.ADD_DATA_URI_TAGS,nt):Ni,Sr=Wt(I,"FORBID_CONTENTS")&&hr(I.FORBID_CONTENTS)?He({},I.FORBID_CONTENTS,nt):Ao,ut=Wt(I,"FORBID_TAGS")&&hr(I.FORBID_TAGS)?He({},I.FORBID_TAGS,nt):er({}),Un=Wt(I,"FORBID_ATTR")&&hr(I.FORBID_ATTR)?He({},I.FORBID_ATTR,nt):er({}),zt=Wt(I,"USE_PROFILES")?I.USE_PROFILES&&typeof I.USE_PROFILES=="object"?er(I.USE_PROFILES):I.USE_PROFILES:!1,Ya=I.ALLOW_ARIA_ATTR!==!1,Xn=I.ALLOW_DATA_ATTR!==!1,ja=I.ALLOW_UNKNOWN_PROTOCOLS||!1,Oi=I.ALLOW_SELF_CLOSE_IN_ATTR!==!1,zr=I.SAFE_FOR_TEMPLATES||!1,Kt=I.SAFE_FOR_XML!==!1,Ca=I.WHOLE_DOCUMENT||!1,Cn=I.RETURN_DOM||!1,ia=I.RETURN_DOM_FRAGMENT||!1,Wa=I.RETURN_TRUSTED_TYPE||!1,Ur=I.FORCE_BODY||!1,qr=I.SANITIZE_DOM!==!1,Ts=I.SANITIZE_NAMED_PROPS||!1,bn=I.KEEP_CONTENT!==!1,Zn=I.IN_PLACE||!1,ue=L5(I.ALLOWED_URI_REGEXP)?I.ALLOWED_URI_REGEXP:KN,en=typeof I.NAMESPACE=="string"?I.NAMESPACE:Ot,qt=Wt(I,"MATHML_TEXT_INTEGRATION_POINTS")&&I.MATHML_TEXT_INTEGRATION_POINTS&&typeof I.MATHML_TEXT_INTEGRATION_POINTS=="object"?er(I.MATHML_TEXT_INTEGRATION_POINTS):He({},["mi","mo","mn","ms","mtext"]),cr=Wt(I,"HTML_INTEGRATION_POINTS")&&I.HTML_INTEGRATION_POINTS&&typeof I.HTML_INTEGRATION_POINTS=="object"?er(I.HTML_INTEGRATION_POINTS):He({},["annotation-xml"]);const ae=Wt(I,"CUSTOM_ELEMENT_HANDLING")&&I.CUSTOM_ELEMENT_HANDLING&&typeof I.CUSTOM_ELEMENT_HANDLING=="object"?er(I.CUSTOM_ELEMENT_HANDLING):Rc(null);if(Ie=Rc(null),Wt(ae,"tagNameCheck")&&ln(ae.tagNameCheck)&&(Ie.tagNameCheck=ae.tagNameCheck),Wt(ae,"attributeNameCheck")&&ln(ae.attributeNameCheck)&&(Ie.attributeNameCheck=ae.attributeNameCheck),Wt(ae,"allowCustomizedBuiltInElements")&&typeof ae.allowCustomizedBuiltInElements=="boolean"&&(Ie.allowCustomizedBuiltInElements=ae.allowCustomizedBuiltInElements),zr&&(Xn=!1),ia&&(Cn=!0),zt&&(Ee=He({},BN),Le=Rc(null),zt.html===!0&&(He(Ee,qN),He(Le,FN)),zt.svg===!0&&(He(Ee,Wy),He(Le,Xy),He(Le,Am)),zt.svgFilters===!0&&(He(Ee,Qy),He(Le,Xy),He(Le,Am)),zt.mathMl===!0&&(He(Ee,Vy),He(Le,$N),He(Le,Am))),qn.tagCheck=null,qn.attributeCheck=null,Wt(I,"ADD_TAGS")&&(typeof I.ADD_TAGS=="function"?qn.tagCheck=I.ADD_TAGS:hr(I.ADD_TAGS)&&(Ee===de&&(Ee=er(Ee)),He(Ee,I.ADD_TAGS,nt))),Wt(I,"ADD_ATTR")&&(typeof I.ADD_ATTR=="function"?qn.attributeCheck=I.ADD_ATTR:hr(I.ADD_ATTR)&&(Le===Me&&(Le=er(Le)),He(Le,I.ADD_ATTR,nt))),Wt(I,"ADD_URI_SAFE_ATTR")&&hr(I.ADD_URI_SAFE_ATTR)&&He(Va,I.ADD_URI_SAFE_ATTR,nt),Wt(I,"FORBID_CONTENTS")&&hr(I.FORBID_CONTENTS)&&(Sr===Ao&&(Sr=er(Sr)),He(Sr,I.FORBID_CONTENTS,nt)),Wt(I,"ADD_FORBID_CONTENTS")&&hr(I.ADD_FORBID_CONTENTS)&&(Sr===Ao&&(Sr=er(Sr)),He(Sr,I.ADD_FORBID_CONTENTS,nt)),bn&&(Ee["#text"]=!0),Ca&&He(Ee,["html","head","body"]),Ee.table&&(He(Ee,["tbody"]),delete ut.tbody),I.TRUSTED_TYPES_POLICY){if(typeof I.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ys('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof I.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ys('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const be=P;P=I.TRUSTED_TYPES_POLICY;try{D=R("")}catch(_e){throw P=be,_e}}else I.TRUSTED_TYPES_POLICY===null?(P=void 0,D=""):(P===void 0&&(P=$()),P&&typeof D=="string"&&(D=R("")));(k.uponSanitizeElement.length>0||k.uponSanitizeAttribute.length>0)&&Ee===de&&(Ee=er(Ee)),k.uponSanitizeAttribute.length>0&&Le===Me&&(Le=er(Le)),gr&&gr(I),dr=I},Ti=He({},[...Wy,...Qy,...I5]),zl=He({},[...Vy,...z5]),Pv=function(I){let ae=j(I);(!ae||!ae.tagName)&&(ae={namespaceURI:en,tagName:"template"});const be=Wd(I.tagName),_e=Wd(ae.tagName);return On[I.namespaceURI]?I.namespaceURI===Ut?ae.namespaceURI===Ot?be==="svg":ae.namespaceURI===At?be==="svg"&&(_e==="annotation-xml"||qt[_e]):!!Ti[be]:I.namespaceURI===At?ae.namespaceURI===Ot?be==="math":ae.namespaceURI===Ut?be==="math"&&cr[_e]:!!zl[be]:I.namespaceURI===Ot?ae.namespaceURI===Ut&&!cr[_e]||ae.namespaceURI===At&&!qt[_e]?!1:!zl[be]&&(ur[be]||!Ti[be]):!!(Nn==="application/xhtml+xml"&&On[I.namespaceURI]):!1},Br=function(I){vc(t.removed,{element:I});try{j(I).removeChild(I)}catch{if(E(I),!j(I))throw Ys("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Iu=function(I){const ae=A?A(I):I.childNodes;if(ae){const _e=[];Zi(ae,ke=>{vc(_e,ke)}),Zi(_e,ke=>{try{E(ke)}catch{}})}const be=O?O(I):null;if(be)for(let _e=be.length-1;_e>=0;--_e){const ke=be[_e],ze=ke&&ke.name;if(typeof ze=="string")try{I.removeAttribute(ze)}catch{}}},Fr=function(I,ae){try{vc(t.removed,{attribute:ae.getAttributeNode(I),from:ae})}catch{vc(t.removed,{attribute:null,from:ae})}if(ae.removeAttribute(I),I==="is")if(Cn||ia)try{Br(ae)}catch{}else try{ae.setAttribute(I,"")}catch{}},zu=function(I){const ae=O?O(I):I.attributes;if(ae)for(let be=ae.length-1;be>=0;--be){const _e=ae[be],ke=_e&&_e.name;if(!(typeof ke!="string"||Le[nt(ke)]))try{I.removeAttribute(ke)}catch{}}},jo=function(I){const ae=[I];for(;ae.length>0;){const be=ae.pop();(T?T(be):be.nodeType)===ni.element&&zu(be);const ke=A?A(be):be.childNodes;if(ke)for(let ze=ke.length-1;ze>=0;--ze)ae.push(ke[ze])}},Pi=function(I){let ae=null,be=null;if(Ur)I="<remove></remove>"+I;else{const ze=LN(I,/^[\r\n\t ]+/);be=ze&&ze[0]}Nn==="application/xhtml+xml"&&en===Ot&&(I='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+I+"</body></html>");const _e=P?R(I):I;if(en===Ot)try{ae=new p().parseFromString(_e,Nn)}catch{}if(!ae||!ae.documentElement){ae=K.createDocument(en,"template",null);try{ae.documentElement.innerHTML=sn?D:_e}catch{}}const ke=ae.body||ae.documentElement;return I&&be&&ke.insertBefore(n.createTextNode(be),ke.childNodes[0]||null),en===Ot?te.call(ae,Ca?"html":"body")[0]:Ca?ae.documentElement:ke},Co=function(I){return Z.call(I.ownerDocument||I,I,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},Xa=function(I){var ae,be;I.normalize();const _e=Z.call(I.ownerDocument||I,I,f.SHOW_TEXT|f.SHOW_COMMENT|f.SHOW_CDATA_SECTION|f.SHOW_PROCESSING_INSTRUCTION,null);let ke=_e.nextNode();for(;ke;){let tn=ke.data;Zi([Q,ce,fe],Ge=>{tn=gc(tn,Ge," ")}),ke.data=tn,ke=_e.nextNode()}const ze=(ae=(be=I.querySelectorAll)===null||be===void 0?void 0:be.call(I,"template"))!==null&&ae!==void 0?ae:[];Zi(Array.from(ze),tn=>{_i(tn.content)&&Xa(tn.content)})},Bt=function(I){const ae=_?_(I):null;return typeof ae!="string"||nt(ae)!=="form"?!1:typeof I.nodeName!="string"||typeof I.textContent!="string"||typeof I.removeChild!="function"||I.attributes!==O(I)||typeof I.removeAttribute!="function"||typeof I.setAttribute!="function"||typeof I.namespaceURI!="string"||typeof I.insertBefore!="function"||typeof I.hasChildNodes!="function"||I.nodeType!==T(I)||I.childNodes!==A(I)},_i=function(I){if(!T||typeof I!="object"||I===null)return!1;try{return T(I)===ni.documentFragment}catch{return!1}},Oo=function(I){if(!T||typeof I!="object"||I===null)return!1;try{return typeof T(I)=="number"}catch{return!1}};function Bn(ve,I,ae){Zi(ve,be=>{be.call(t,I,ae,dr)})}const Di=function(I){let ae=null;if(Bn(k.beforeSanitizeElements,I,null),Bt(I))return Br(I),!0;const be=nt(_?_(I):I.nodeName);if(Bn(k.uponSanitizeElement,I,{tagName:be,allowedTags:Ee}),Kt&&I.hasChildNodes()&&!Oo(I.firstElementChild)&&Gn(/<[/\w!]/g,I.innerHTML)&&Gn(/<[/\w!]/g,I.textContent)||Kt&&I.namespaceURI===Ot&&be==="style"&&Oo(I.firstElementChild)||I.nodeType===ni.progressingInstruction||Kt&&I.nodeType===ni.comment&&Gn(/<[/\w]/g,I.data))return Br(I),!0;if(ut[be]||!(qn.tagCheck instanceof Function&&qn.tagCheck(be))&&!Ee[be]){if(!ut[be]&&Uu(be)&&(Ie.tagNameCheck instanceof RegExp&&Gn(Ie.tagNameCheck,be)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(be)))return!1;if(bn&&!Sr[be]){const ke=j(I),ze=A(I);if(ze&&ke){const tn=ze.length;for(let Ge=tn-1;Ge>=0;--Ge){const Nt=Zn?ze[Ge]:x(ze[Ge],!0);ke.insertBefore(Nt,S(I))}}}return Br(I),!0}return(T?T(I):I.nodeType)===ni.element&&!Pv(I)||(be==="noscript"||be==="noembed"||be==="noframes")&&Gn(/<\/no(script|embed|frames)/i,I.innerHTML)?(Br(I),!0):(zr&&I.nodeType===ni.text&&(ae=I.textContent,Zi([Q,ce,fe],ke=>{ae=gc(ae,ke," ")}),I.textContent!==ae&&(vc(t.removed,{element:I.cloneNode()}),I.textContent=ae)),Bn(k.afterSanitizeElements,I,null),!1)},sh=function(I,ae,be){if(Un[ae]||qr&&(ae==="id"||ae==="name")&&(be in n||be in Ar))return!1;const _e=Le[ae]||qn.attributeCheck instanceof Function&&qn.attributeCheck(ae,I);if(!(Xn&&!Un[ae]&&Gn(xe,ae))){if(!(Ya&&Gn(Oe,ae))){if(!_e||Un[ae]){if(!(Uu(I)&&(Ie.tagNameCheck instanceof RegExp&&Gn(Ie.tagNameCheck,I)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(I))&&(Ie.attributeNameCheck instanceof RegExp&&Gn(Ie.attributeNameCheck,ae)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(ae,I))||ae==="is"&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&Gn(Ie.tagNameCheck,be)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(be))))return!1}else if(!Va[ae]){if(!Gn(ue,gc(be,Be,""))){if(!((ae==="src"||ae==="xlink:href"||ae==="href")&&I!=="script"&&IN(be,"data:")===0&&Il[I])){if(!(ja&&!Gn(qe,gc(be,Be,"")))){if(be)return!1}}}}}}return!0},lh=He({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Uu=function(I){return!lh[Wd(I)]&&Gn(he,I)},ch=function(I){Bn(k.beforeSanitizeAttributes,I,null);const ae=I.attributes;if(!ae||Bt(I))return;const be={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Le,forceKeepAttr:void 0};let _e=ae.length;for(;_e--;){const ke=ae[_e],ze=ke.name,tn=ke.namespaceURI,Ge=ke.value,Nt=nt(ze),Ta=Ge;let Ht=ze==="value"?Ta:P5(Ta);if(be.attrName=Nt,be.attrValue=Ht,be.keepAttr=!0,be.forceKeepAttr=void 0,Bn(k.uponSanitizeAttribute,I,be),Ht=be.attrValue,Ts&&(Nt==="id"||Nt==="name")&&IN(Ht,Qa)!==0&&(Fr(ze,I),Ht=Qa+Ht),Kt&&Gn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ht)){Fr(ze,I);continue}if(Nt==="attributename"&&LN(Ht,"href")){Fr(ze,I);continue}if(be.forceKeepAttr)continue;if(!be.keepAttr){Fr(ze,I);continue}if(!Oi&&Gn(/\/>/i,Ht)){Fr(ze,I);continue}zr&&Zi([Q,ce,fe],qu=>{Ht=gc(Ht,qu," ")});const Ri=nt(I.nodeName);if(!sh(Ri,Nt,Ht)){Fr(ze,I);continue}if(P&&typeof b=="object"&&typeof b.getAttributeType=="function"&&!tn)switch(b.getAttributeType(Ri,Nt)){case"TrustedHTML":{Ht=R(Ht);break}case"TrustedScriptURL":{Ht=J(Ht);break}}if(Ht!==Ta)try{tn?I.setAttributeNS(tn,ze,Ht):I.setAttribute(ze,Ht),Bt(I)?Br(I):kN(t.removed)}catch{Fr(ze,I)}}Bn(k.afterSanitizeAttributes,I,null)},Mi=function(I){let ae=null;const be=Co(I);for(Bn(k.beforeSanitizeShadowDOM,I,null);ae=be.nextNode();)if(Bn(k.uponSanitizeShadowNode,ae,null),Di(ae),ch(ae),_i(ae.content)&&Mi(ae.content),(T?T(ae):ae.nodeType)===ni.element){const ke=C?C(ae):ae.shadowRoot;_i(ke)&&(No(ke),Mi(ke))}Bn(k.afterSanitizeShadowDOM,I,null)},No=function(I){const ae=[{node:I,shadow:null}];for(;ae.length>0;){const be=ae.pop();if(be.shadow){Mi(be.shadow);continue}const _e=be.node,ze=(T?T(_e):_e.nodeType)===ni.element,tn=A?A(_e):_e.childNodes;if(tn)for(let Ge=tn.length-1;Ge>=0;--Ge)ae.push({node:tn[Ge],shadow:null});if(ze){const Ge=_?_(_e):null;if(typeof Ge=="string"&&nt(Ge)==="template"){const Nt=_e.content;_i(Nt)&&ae.push({node:Nt,shadow:null})}}if(ze){const Ge=C?C(_e):_e.shadowRoot;_i(Ge)&&ae.push({node:null,shadow:Ge},{node:Ge,shadow:null})}}};return t.sanitize=function(ve){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ae=null,be=null,_e=null,ke=null;if(sn=!ve,sn&&(ve="<!-->"),typeof ve!="string"&&!Oo(ve)&&(ve=k5(ve),typeof ve!="string"))throw Ys("dirty is not a string, aborting");if(!t.isSupported)return ve;Eo||Tn(I),t.removed=[];const ze=Zn&&typeof ve!="string"&&Oo(ve);if(ze){const Nt=_?_(ve):ve.nodeName;if(typeof Nt=="string"){const Ta=nt(Nt);if(!Ee[Ta]||ut[Ta])throw Ys("root node is forbidden and cannot be sanitized in-place")}if(Bt(ve))throw Ys("root node is clobbered and cannot be sanitized in-place");try{No(ve)}catch(Ta){throw Iu(ve),Ta}}else if(Oo(ve))ae=Pi("<!---->"),be=ae.ownerDocument.importNode(ve,!0),be.nodeType===ni.element&&be.nodeName==="BODY"||be.nodeName==="HTML"?ae=be:ae.appendChild(be),No(be);else{if(!Cn&&!zr&&!Ca&&ve.indexOf("<")===-1)return P&&Wa?R(ve):ve;if(ae=Pi(ve),!ae)return Cn?null:Wa?D:""}ae&&Ur&&Br(ae.firstChild);const tn=Co(ze?ve:ae);try{for(;_e=tn.nextNode();)Di(_e),ch(_e),_i(_e.content)&&Mi(_e.content)}catch(Nt){throw ze&&Iu(ve),Nt}if(ze)return Zi(t.removed,Nt=>{Nt.element&&jo(Nt.element)}),zr&&Xa(ve),ve;if(Cn){if(zr&&Xa(ae),ia)for(ke=B.call(ae.ownerDocument);ae.firstChild;)ke.appendChild(ae.firstChild);else ke=ae;return(Le.shadowroot||Le.shadowrootmode)&&(ke=pe.call(r,ke,!0)),ke}let Ge=Ca?ae.outerHTML:ae.innerHTML;return Ca&&Ee["!doctype"]&&ae.ownerDocument&&ae.ownerDocument.doctype&&ae.ownerDocument.doctype.name&&Gn(G5,ae.ownerDocument.doctype.name)&&(Ge="<!DOCTYPE "+ae.ownerDocument.doctype.name+`> 51 `+Ge),zr&&Zi([Q,ce,fe],Nt=>{Ge=gc(Ge,Nt," ")}),P&&Wa?R(Ge):Ge},t.setConfig=function(){let ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tn(ve),Eo=!0},t.clearConfig=function(){dr=null,Eo=!1,P=L,D=""},t.isValidAttribute=function(ve,I,ae){dr||Tn({});const be=nt(ve),_e=nt(I);return sh(be,_e,ae)},t.addHook=function(ve,I){typeof I=="function"&&vc(k[ve],I)},t.removeHook=function(ve,I){if(I!==void 0){const ae=N5(k[ve],I);return ae===-1?void 0:T5(k[ve],ae,1)[0]}return kN(k[ve])},t.removeHooks=function(ve){k[ve]=[]},t.removeAllHooks=function(){k=HN()},t}var Xk=Vk();const V5="bb_devmockapikey0000000000000000";function X5(){const t=Re().apiKey===V5;return Et({queryKey:["announcements"],queryFn:async()=>{if(t)return[];const n=await me("GetAnnouncements");return n.success?n.data.announcements??[]:[]},staleTime:300*1e3})}function Z5(){const e=Ne();return je({mutationFn:async t=>{const n=await me("DismissAnnouncement",{announcementId:t});if(!n.success)throw new Error(n.error)},onMutate:async t=>{await e.cancelQueries({queryKey:["announcements"]});const n=e.getQueryData(["announcements"]);return e.setQueryData(["announcements"],r=>(r??[]).filter(i=>i.id!==t)),{prev:n}},onError:(t,n,r)=>{r!=null&&r.prev&&e.setQueryData(["announcements"],r.prev)},onSettled:()=>{e.invalidateQueries({queryKey:["announcements"]})}})}Xk.addHook("afterSanitizeAttributes",e=>{e.tagName==="A"&&(e.setAttribute("target","_blank"),e.setAttribute("rel","noopener noreferrer"))});const J5={ALLOWED_TAGS:["p","br","strong","b","em","i","u","a","ul","ol","li","span","img","h3","h4","small"],ALLOWED_ATTR:["href","src","alt","title","target","rel"]},e6=new Set(["info","success","warn"]);function t6(){const{data:e}=X5(),t=Z5();return!e||e.length===0?null:d.jsx("div",{className:"bb-ann-stack",children:e.map(n=>d.jsx(n6,{announcement:n,onDismiss:()=>t.mutate(n.id)},n.id))})}function n6({announcement:e,onDismiss:t}){const n=v.useMemo(()=>e.bodyHtml?Xk.sanitize(e.bodyHtml,J5):"",[e.bodyHtml]),r=e6.has(e.tone)?e.tone:"info";return d.jsxs("article",{className:`bb-ann bb-ann-${r}`,role:"status",children:[e.imageUrl&&d.jsx("img",{className:"bb-ann-img",src:e.imageUrl,alt:""}),d.jsxs("div",{className:"bb-ann-body",children:[d.jsx("h3",{className:"bb-ann-title",children:e.title}),n&&d.jsx("div",{className:"bb-ann-rich",dangerouslySetInnerHTML:{__html:n}})]}),e.ctaLabel&&e.ctaUrl&&d.jsx("a",{className:"bb-btn bb-btn-primary bb-btn-small bb-ann-cta",href:e.ctaUrl,target:"_blank",rel:"noopener noreferrer",children:e.ctaLabel}),d.jsx("button",{type:"button",className:"bb-ann-dismiss","aria-label":"Dismiss",title:"Dismiss",onClick:t,children:"×"})]})}function r6(){return d.jsxs(d.Fragment,{children:[d.jsx(y5,{}),d.jsx(t6,{}),d.jsxs("div",{className:"bb-overview-grid",children:[d.jsx("div",{className:"bb-overview-main",children:d.jsx(W$,{})}),d.jsxs("aside",{className:"bb-overview-aside",children:[d.jsx(J$,{}),d.jsx(v5,{})]})]})]})}var Cw=function(e,t){return Cw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},Cw(e,t)};function a6(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Cw(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var jt=function(){return jt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},jt.apply(this,arguments)};function Zk(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function i6(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Zy,GN;function o6(){if(GN)return Zy;GN=1;var e=!1,t,n,r,i,o,l,u,f,h,p,b,g,x,E,S;function A(){if(!e){e=!0;var C=navigator.userAgent,O=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(C),T=/(Mac OS X)|(Windows)|(Linux)/.exec(C);if(g=/\b(iPhone|iP[ao]d)/.exec(C),x=/\b(iP[ao]d)/.exec(C),p=/Android/i.exec(C),E=/FBAN\/\w+;/i.exec(C),S=/Mobile/i.exec(C),b=!!/Win64/.exec(C),O){t=O[1]?parseFloat(O[1]):O[5]?parseFloat(O[5]):NaN,t&&document&&document.documentMode&&(t=document.documentMode);var _=/(?:Trident\/(\d+.\d+))/.exec(C);l=_?parseFloat(_[1])+4:t,n=O[2]?parseFloat(O[2]):NaN,r=O[3]?parseFloat(O[3]):NaN,i=O[4]?parseFloat(O[4]):NaN,i?(O=/(?:Chrome\/(\d+\.\d+))/.exec(C),o=O&&O[1]?parseFloat(O[1]):NaN):o=NaN}else t=n=r=o=i=NaN;if(T){if(T[1]){var P=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(C);u=P?parseFloat(P[1].replace("_",".")):!0}else u=!1;f=!!T[2],h=!!T[3]}else u=f=h=!1}}var j={ie:function(){return A()||t},ieCompatibilityMode:function(){return A()||l>t},ie64:function(){return j.ie()&&b},firefox:function(){return A()||n},opera:function(){return A()||r},webkit:function(){return A()||i},safari:function(){return j.webkit()},chrome:function(){return A()||o},windows:function(){return A()||f},osx:function(){return A()||u},linux:function(){return A()||h},iphone:function(){return A()||g},mobile:function(){return A()||g||x||p||S},nativeApp:function(){return A()||E},android:function(){return A()||p},ipad:function(){return A()||x}};return Zy=j,Zy}var Jy,YN;function s6(){if(YN)return Jy;YN=1;var e=!!(typeof window<"u"&&window.document&&window.document.createElement),t={canUseDOM:e,canUseWorkers:typeof Worker<"u",canUseEventListeners:e&&!!(window.addEventListener||window.attachEvent),canUseViewport:e&&!!window.screen,isInWorker:!e};return Jy=t,Jy}var e0,WN;function l6(){if(WN)return e0;WN=1;var e=s6(),t;e.canUseDOM&&(t=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/** 52 52 * Checks if an event is supported in the current execution environment. 53 53 * … … 62 62 * @internal 63 63 * @license Modernizr 3.0.0pre (Custom Build) | MIT 64 */function n(r,i){if(!e.canUseDOM||i&&!("addEventListener"in document))return!1;var o="on"+r,l=o in document;if(!l){var u=document.createElement("div");u.setAttribute(o,"return;"),l=typeof u[o]=="function"}return!l&&t&&r==="wheel"&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}return e0=n,e0}var t0,QN;function l6(){if(QN)return t0;QN=1;var e=i6(),t=s6(),n=10,r=40,i=800;function o(l){var u=0,f=0,h=0,p=0;return"detail"in l&&(f=l.detail),"wheelDelta"in l&&(f=-l.wheelDelta/120),"wheelDeltaY"in l&&(f=-l.wheelDeltaY/120),"wheelDeltaX"in l&&(u=-l.wheelDeltaX/120),"axis"in l&&l.axis===l.HORIZONTAL_AXIS&&(u=f,f=0),h=u*n,p=f*n,"deltaY"in l&&(p=l.deltaY),"deltaX"in l&&(h=l.deltaX),(h||p)&&l.deltaMode&&(l.deltaMode==1?(h*=r,p*=r):(h*=i,p*=i)),h&&!u&&(u=h<1?-1:1),p&&!f&&(f=p<1?-1:1),{spinX:u,spinY:f,pixelX:h,pixelY:p}}return o.getEventType=function(){return e.firefox()?"DOMMouseScroll":t("wheel")?"wheel":"mousewheel"},t0=o,t0}var n0,VN;function c6(){return VN||(VN=1,n0=l6()),n0}var u6=c6();const d6=Ei(u6);function f6(e,t,n,r,i,o){o===void 0&&(o=0);var l=cu(e,t,o),u=l.width,f=l.height,h=Math.min(u,n),p=Math.min(f,r);return h>p*i?{width:p*i,height:p}:{width:h,height:h/i}}function h6(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}function Pd(e,t,n,r,i){i===void 0&&(i=0);var o=cu(t.width,t.height,i),l=o.width,u=o.height;return{x:XN(e.x,l,n.width,r),y:XN(e.y,u,n.height,r)}}function XN(e,t,n,r){var i=Math.abs(t*r/2-n/2);return Sb(e,-i,i)}function ZN(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function JN(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*180/Math.PI}function m6(e,t,n,r,i,o,l){o===void 0&&(o=0),l===void 0&&(l=!0);var u=l?p6:b6,f=cu(t.width,t.height,o),h=cu(t.naturalWidth,t.naturalHeight,o),p={x:u(100,((f.width-n.width/i)/2-e.x/i)/f.width*100),y:u(100,((f.height-n.height/i)/2-e.y/i)/f.height*100),width:u(100,n.width/f.width*100/i),height:u(100,n.height/f.height*100/i)},b=Math.round(u(h.width,p.width*h.width/100)),g=Math.round(u(h.height,p.height*h.height/100)),x=h.width>=h.height*r,E=x?{width:Math.round(g*r),height:g}:{width:b,height:Math.round(b/r)},S=jt(jt({},E),{x:Math.round(u(h.width-E.width,p.x*h.width/100)),y:Math.round(u(h.height-E.height,p.y*h.height/100))});return{croppedAreaPercentages:p,croppedAreaPixels:S}}function p6(e,t){return Math.min(e,Math.max(0,t))}function b6(e,t){return t}function v6(e,t,n,r,i,o){var l=cu(t.width,t.height,n),u=Sb(r.width/l.width*(100/e.width),i,o),f={x:u*l.width/2-r.width/2-l.width*u*(e.x/100),y:u*l.height/2-r.height/2-l.height*u*(e.y/100)};return{crop:f,zoom:u}}function g6(e,t,n){var r=h6(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}function y6(e,t,n,r,i,o){n===void 0&&(n=0);var l=cu(t.naturalWidth,t.naturalHeight,n),u=Sb(g6(e,t,r),i,o),f=r.height>r.width?r.height/e.height:r.width/e.width,h={x:((l.width-e.width)/2-e.x)*f,y:((l.height-e.height)/2-e.y)*f};return{crop:h,zoom:u}}function eT(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function x6(e){return e*Math.PI/180}function cu(e,t,n){var r=x6(n);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function Sb(e,t,n){return Math.min(Math.max(e,t),n)}function jm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(n){return typeof n=="string"&&n.length>0}).join(" ").trim()}var w6=`.reactEasyCrop_Container {64 */function n(r,i){if(!e.canUseDOM||i&&!("addEventListener"in document))return!1;var o="on"+r,l=o in document;if(!l){var u=document.createElement("div");u.setAttribute(o,"return;"),l=typeof u[o]=="function"}return!l&&t&&r==="wheel"&&(l=document.implementation.hasFeature("Events.wheel","3.0")),l}return e0=n,e0}var t0,QN;function c6(){if(QN)return t0;QN=1;var e=o6(),t=l6(),n=10,r=40,i=800;function o(l){var u=0,f=0,h=0,p=0;return"detail"in l&&(f=l.detail),"wheelDelta"in l&&(f=-l.wheelDelta/120),"wheelDeltaY"in l&&(f=-l.wheelDeltaY/120),"wheelDeltaX"in l&&(u=-l.wheelDeltaX/120),"axis"in l&&l.axis===l.HORIZONTAL_AXIS&&(u=f,f=0),h=u*n,p=f*n,"deltaY"in l&&(p=l.deltaY),"deltaX"in l&&(h=l.deltaX),(h||p)&&l.deltaMode&&(l.deltaMode==1?(h*=r,p*=r):(h*=i,p*=i)),h&&!u&&(u=h<1?-1:1),p&&!f&&(f=p<1?-1:1),{spinX:u,spinY:f,pixelX:h,pixelY:p}}return o.getEventType=function(){return e.firefox()?"DOMMouseScroll":t("wheel")?"wheel":"mousewheel"},t0=o,t0}var n0,VN;function u6(){return VN||(VN=1,n0=c6()),n0}var d6=u6();const f6=Ei(d6);function h6(e,t,n,r,i,o){o===void 0&&(o=0);var l=cu(e,t,o),u=l.width,f=l.height,h=Math.min(u,n),p=Math.min(f,r);return h>p*i?{width:p*i,height:p}:{width:h,height:h/i}}function m6(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}function _d(e,t,n,r,i){i===void 0&&(i=0);var o=cu(t.width,t.height,i),l=o.width,u=o.height;return{x:XN(e.x,l,n.width,r),y:XN(e.y,u,n.height,r)}}function XN(e,t,n,r){var i=Math.abs(t*r/2-n/2);return Sb(e,-i,i)}function ZN(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function JN(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*180/Math.PI}function p6(e,t,n,r,i,o,l){o===void 0&&(o=0),l===void 0&&(l=!0);var u=l?b6:v6,f=cu(t.width,t.height,o),h=cu(t.naturalWidth,t.naturalHeight,o),p={x:u(100,((f.width-n.width/i)/2-e.x/i)/f.width*100),y:u(100,((f.height-n.height/i)/2-e.y/i)/f.height*100),width:u(100,n.width/f.width*100/i),height:u(100,n.height/f.height*100/i)},b=Math.round(u(h.width,p.width*h.width/100)),g=Math.round(u(h.height,p.height*h.height/100)),x=h.width>=h.height*r,E=x?{width:Math.round(g*r),height:g}:{width:b,height:Math.round(b/r)},S=jt(jt({},E),{x:Math.round(u(h.width-E.width,p.x*h.width/100)),y:Math.round(u(h.height-E.height,p.y*h.height/100))});return{croppedAreaPercentages:p,croppedAreaPixels:S}}function b6(e,t){return Math.min(e,Math.max(0,t))}function v6(e,t){return t}function g6(e,t,n,r,i,o){var l=cu(t.width,t.height,n),u=Sb(r.width/l.width*(100/e.width),i,o),f={x:u*l.width/2-r.width/2-l.width*u*(e.x/100),y:u*l.height/2-r.height/2-l.height*u*(e.y/100)};return{crop:f,zoom:u}}function y6(e,t,n){var r=m6(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}function x6(e,t,n,r,i,o){n===void 0&&(n=0);var l=cu(t.naturalWidth,t.naturalHeight,n),u=Sb(y6(e,t,r),i,o),f=r.height>r.width?r.height/e.height:r.width/e.width,h={x:((l.width-e.width)/2-e.x)*f,y:((l.height-e.height)/2-e.y)*f};return{crop:h,zoom:u}}function eT(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function w6(e){return e*Math.PI/180}function cu(e,t,n){var r=w6(n);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function Sb(e,t,n){return Math.min(Math.max(e,t),n)}function jm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(n){return typeof n=="string"&&n.length>0}).join(" ").trim()}var S6=`.reactEasyCrop_Container { 65 65 position: absolute; 66 66 top: 0; … … 142 142 border-right: 0; 143 143 } 144 `, S6=1,E6=3,A6=1,j6=(function(e){r6(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.cropperRef=v.createRef(),n.imageRef=v.createRef(),n.videoRef=v.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document<"u"?document:null,n.currentWindow=typeof window<"u"?window:null,n.resizeObserver=null,n.previousCropSize=null,n.isInitialized=!1,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(i){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturechange",n.onGestureChange),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.previousCropSize=r,n.emitCropData(),n.setInitialCrop(r),n.isInitialized=!0),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var i=v6(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=i.crop,l=i.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(l)}else if(n.props.initialCroppedAreaPixels){var u=y6(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=u.crop,l=u.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(l)}},n.computeSizes=function(){var r,i,o,l,u,f,h=n.imageRef.current||n.videoRef.current;if(h&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var p=n.containerRect.width/n.containerRect.height,b=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,g=((o=n.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((l=n.videoRef.current)===null||l===void 0?void 0:l.videoHeight)||0,x=h.offsetWidth<b||h.offsetHeight<g,E=b/g,S=void 0;if(x)switch(n.state.mediaObjectFit){default:case"contain":S=p>E?{width:n.containerRect.height*E,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/E};break;case"horizontal-cover":S={width:n.containerRect.width,height:n.containerRect.width/E};break;case"vertical-cover":S={width:n.containerRect.height*E,height:n.containerRect.height};break}else S={width:h.offsetWidth,height:h.offsetHeight};n.mediaSize=jt(jt({},S),{naturalWidth:b,naturalHeight:g}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var A=n.props.cropSize?n.props.cropSize:f6(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((u=n.state.cropSize)===null||u===void 0?void 0:u.height)!==A.height||((f=n.state.cropSize)===null||f===void 0?void 0:f.width)!==A.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(A),n.setState({cropSize:A},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(A),A}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(t.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(t.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(t.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureChange),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureChange=function(r){if(r.preventDefault(),!n.isTouching){var i=t.getMousePoint(r),o=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(o,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var l=n.gestureRotationStart+r.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var i,o,l=r.x,u=r.y;n.dragStartPosition={x:l,y:u},n.dragStartCrop=jt({},n.props.crop),(o=(i=n.props).onInteractionStart)===null||o===void 0||o.call(i)},n.onDrag=function(r){var i=r.x,o=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(i===void 0||o===void 0)){var l=i-n.dragStartPosition.x,u=o-n.dragStartPosition.y,f={x:n.dragStartCrop.x+l,y:n.dragStartCrop.y+u},h=n.props.restrictPosition?Pd(f,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):f;n.props.onCropChange(h)}}))},n.onDragStopped=function(){var r,i;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(i=(r=n.props).onInteractionEnd)===null||i===void 0||i.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var i=t.getMousePoint(r),o=d6(r).pixelY,l=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(l,i,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var u,f;return(f=(u=n.props).onInteractionStart)===null||f===void 0?void 0:f.call(u)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var u,f;return(f=(u=n.props).onInteractionEnd)===null||f===void 0?void 0:f.call(u)})},250)}},n.getPointOnContainer=function(r,i){var o=r.x,l=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-i.x),y:n.containerRect.height/2-(l-i.y)}},n.getPointOnMedia=function(r){var i=r.x,o=r.y,l=n.props,u=l.crop,f=l.zoom;return{x:(i+u.x)/f,y:(o+u.y)/f}},n.setNewZoom=function(r,i,o){var l=o===void 0?{}:o,u=l.shouldUpdatePosition,f=u===void 0?!0:u;if(!(!n.state.cropSize||!n.props.onZoomChange)){var h=Sb(r,n.props.minZoom,n.props.maxZoom);if(f){var p=n.getPointOnContainer(i,n.containerPosition),b=n.getPointOnMedia(p),g={x:b.x*h-p.x,y:b.y*h-p.y},x=n.props.restrictPosition?Pd(g,n.mediaSize,n.state.cropSize,h,n.props.rotation):g;n.props.onCropChange(x)}n.props.onZoomChange(h)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?Pd(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return m6(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(i,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.recomputeCropPosition=function(){var r,i;if(n.state.cropSize){var o=n.props.crop;if(n.isInitialized&&(!((r=n.previousCropSize)===null||r===void 0)&&r.width)&&(!((i=n.previousCropSize)===null||i===void 0)&&i.height)){var l=Math.abs(n.previousCropSize.width-n.state.cropSize.width)>1e-6||Math.abs(n.previousCropSize.height-n.state.cropSize.height)>1e-6;if(l){var u=n.state.cropSize.width/n.previousCropSize.width,f=n.state.cropSize.height/n.previousCropSize.height;o={x:n.props.crop.x*u,y:n.props.crop.y*f}}}var h=n.props.restrictPosition?Pd(o,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):o;n.previousCropSize=n.state.cropSize,n.props.onCropChange(h),n.emitCropData()}},n.onKeyDown=function(r){var i,o,l=n.props,u=l.crop,f=l.onCropChange,h=l.keyboardStep,p=l.zoom,b=l.rotation,g=h;if(n.state.cropSize){r.shiftKey&&(g*=.2);var x=jt({},u);switch(r.key){case"ArrowUp":x.y-=g,r.preventDefault();break;case"ArrowDown":x.y+=g,r.preventDefault();break;case"ArrowLeft":x.x-=g,r.preventDefault();break;case"ArrowRight":x.x+=g,r.preventDefault();break;default:return}n.props.restrictPosition&&(x=Pd(x,n.mediaSize,n.state.cropSize,p,b)),r.repeat||(o=(i=n.props).onInteractionStart)===null||o===void 0||o.call(i),f(x)}},n.onKeyUp=function(r){var i,o;switch(r.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":r.preventDefault();break;default:return}n.emitCropData(),(o=(i=n.props).onInteractionEnd)===null||o===void 0||o.call(i)},n}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=w6,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var r,i,o,l,u,f,h,p,b;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.height)||((o=n.cropSize)===null||o===void 0?void 0:o.width)!==((l=this.props.cropSize)===null||l===void 0?void 0:l.width)?this.computeSizes():(((u=n.crop)===null||u===void 0?void 0:u.x)!==((f=this.props.crop)===null||f===void 0?void 0:f.x)||((h=n.crop)===null||h===void 0?void 0:h.y)!==((p=this.props.crop)===null||p===void 0?void 0:p.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((b=this.videoRef.current)===null||b===void 0||b.load());var g=this.getObjectFit();g!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:g},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,r=n.cropSize,i=n.aspect;return r?r.width/r.height:i},t.prototype.getObjectFit=function(){var n,r,i,o;if(this.props.objectFit==="cover"){var l=this.imageRef.current||this.videoRef.current;if(l&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var u=this.containerRect.width/this.containerRect.height,f=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,h=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,p=f/h;return p<u?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(n){var r=t.getTouchPoint(n.touches[0]),i=t.getTouchPoint(n.touches[1]);this.lastPinchDistance=ZN(r,i),this.lastPinchRotation=JN(r,i),this.onDragStart(eT(r,i))},t.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var i=t.getTouchPoint(n.touches[0]),o=t.getTouchPoint(n.touches[1]),l=eT(i,o);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var u=ZN(i,o),f=r.props.zoom*(u/r.lastPinchDistance);r.setNewZoom(f,l,{shouldUpdatePosition:!1}),r.lastPinchDistance=u;var h=JN(i,o),p=r.props.rotation+(h-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(p),r.lastPinchRotation=h})}},t.prototype.render=function(){var n=this,r,i=this.props,o=i.image,l=i.video,u=i.mediaProps,f=i.cropperProps,h=i.transform,p=i.crop,b=p.x,g=p.y,x=i.rotation,E=i.zoom,S=i.cropShape,A=i.showGrid,j=i.roundCropAreaPixels,C=i.style,O=C.containerStyle,T=C.cropAreaStyle,_=C.mediaStyle,P=i.classes,D=P.containerClassName,L=P.cropAreaClassName,z=P.mediaClassName,R=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return v.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(U){return n.containerRef=U},"data-testid":"container",style:O,className:jm("reactEasyCrop_Container",D)},o?v.createElement("img",jt({alt:"",className:jm("reactEasyCrop_Image",R==="contain"&&"reactEasyCrop_Contain",R==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",R==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",z)},u,{src:o,ref:this.imageRef,style:jt(jt({},_),{transform:h||"translate(".concat(b,"px, ").concat(g,"px) rotate(").concat(x,"deg) scale(").concat(E,")")}),onLoad:this.onMediaLoad})):l&&v.createElement("video",jt({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:jm("reactEasyCrop_Video",R==="contain"&&"reactEasyCrop_Contain",R==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",R==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",z)},u,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:jt(jt({},_),{transform:h||"translate(".concat(b,"px, ").concat(g,"px) rotate(").concat(x,"deg) scale(").concat(E,")")}),controls:!1}),(Array.isArray(l)?l:[{src:l}]).map(function(q){return v.createElement("source",jt({key:q.src},q))})),this.state.cropSize&&v.createElement("div",jt({ref:this.cropperRef,style:jt(jt({},T),{width:j?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:j?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:jm("reactEasyCrop_CropArea",S==="round"&&"reactEasyCrop_CropAreaRound",A&&"reactEasyCrop_CropAreaGrid",L)},f)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:E6,minZoom:S6,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:A6},t.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t})(v.Component);const tT=320,C6={rounded:{aspect:1,cropShape:"round"},pill:{aspect:4,cropShape:"rect"}};function O6({imageUrl:e,fabShape:t,initial:n,onSave:r,onCancel:i}){const o=C6[t],l=tT,u=Math.round(tT/o.aspect),[f,h]=v.useState({x:0,y:0}),[p,b]=v.useState(1),[g,x]=v.useState(null),[E,S]=v.useState(null);v.useEffect(()=>{if(!e)return;const O=new Image;O.onload=()=>{O.naturalWidth>0&&O.naturalHeight>0&&S({w:O.naturalWidth,h:O.naturalHeight})},O.src=e},[e]),v.useEffect(()=>{if(!n||!E||n.shape!==t)return;const O=Math.max(1,Math.min(4,E.w/Math.max(1,n.cropW)));b(O)},[n,E,t]);const A=v.useCallback((O,T)=>{x(T)},[]),j=()=>{if(!E||!g){i();return}r({shape:t,cropX:Math.round(g.x),cropY:Math.round(g.y),cropW:Math.round(g.width),cropH:Math.round(g.height),sourceW:E.w,sourceH:E.h})},C=()=>{h({x:0,y:0}),b(1)};return Vn.createPortal(d.jsx("div",{className:"bb-portal-scope bb-avatar-crop-modal-overlay",onClick:O=>{O.target===O.currentTarget&&i()},role:"dialog","aria-modal":"true","aria-label":"Adjust avatar crop",children:d.jsxs("div",{className:"bb-avatar-crop-modal",children:[d.jsxs("header",{className:"bb-avatar-crop-head",children:[d.jsx("h3",{children:"Frame your avatar"}),d.jsxs("p",{children:["Drag to reposition, slider to zoom. Cropping for the"," ",d.jsx("strong",{children:t==="pill"?"Pill":"Rounded"})," ","FAB — this is exactly how visitors will see it."]})]}),d.jsx("div",{className:"bb-avatar-crop-stage",style:{width:l,height:u},children:d.jsx(j6,{image:e,crop:f,zoom:p,aspect:o.aspect,cropShape:o.cropShape,showGrid:!1,minZoom:1,maxZoom:4,zoomSpeed:.5,onCropChange:h,onZoomChange:b,onCropComplete:A,objectFit:"cover"})}),d.jsxs("div",{className:"bb-avatar-crop-zoom",children:[d.jsxs("label",{children:[d.jsx("span",{children:"Zoom"}),d.jsx("input",{type:"range",min:1,max:4,step:.05,value:p,onChange:O=>b(Number(O.target.value)),className:"bb-slider"})]}),d.jsx("button",{type:"button",className:"bb-link-btn",onClick:C,children:"Reset"})]}),d.jsxs("footer",{className:"bb-avatar-crop-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost",onClick:i,children:"Cancel"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:j,children:"Use this crop"})]})]})}),document.body)}function Eb(e){if(!e)return null;try{const t=JSON.parse(e);return typeof t!="object"||t===null||typeof t.cropW!="number"||typeof t.cropH!="number"||typeof t.sourceW!="number"||typeof t.sourceH!="number"||t.cropW<=0||t.cropH<=0||t.sourceW<=0||t.sourceH<=0?null:{shape:t.shape==="pill"?"pill":"rounded",cropX:Number(t.cropX??0),cropY:Number(t.cropY??0),cropW:Number(t.cropW),cropH:Number(t.cropH),sourceW:Number(t.sourceW),sourceH:Number(t.sourceH)}}catch{return null}}function tE(e,t,n,r){if(!e||e.shape!==t||e.cropW<=0||e.cropH<=0)return null;const i=n/e.cropW,o=r/e.cropH,l=e.sourceW*i,u=e.sourceH*o,f=-e.cropX*i,h=-e.cropY*o;return{backgroundSize:`${l}px ${u}px`,backgroundPosition:`${f}px ${h}px`}}function N6({settings:e,onClose:t}){const n=e.primaryColor||"#0073aa",r=e.widgetTitle||"Chat with us",i=e.welcomeMessage||"Hi! How can I help you today?",o=e.placeholderText||"Type your message...",l=e.suggestedQuestions||[],u=e.avatarUrl||"",f=tE(Eb(e.avatarTransform),"rounded",32,32);return d.jsxs("div",{className:"bb-pp-screen",children:[d.jsxs("header",{className:"bb-pp-header",style:{background:n},children:[u&&d.jsx("span",{className:"bb-pp-header-avatar",children:f?d.jsx("span",{className:"bb-pp-header-avatar-bg",style:{backgroundImage:`url(${u})`,backgroundSize:f.backgroundSize,backgroundPosition:f.backgroundPosition,backgroundRepeat:"no-repeat"}}):d.jsx("img",{src:u,alt:"",className:"bb-pp-header-avatar-img"})}),d.jsx("span",{className:"bb-pp-header-title",children:r}),d.jsx("button",{className:"bb-pp-minimize","aria-label":"Minimize",type:"button",onClick:t,title:"Minimize (preview)",children:d.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})]}),d.jsxs("div",{className:"bb-pp-body",children:[d.jsx("div",{className:"bb-pp-message bb-pp-message-bot",children:d.jsx("div",{className:"bb-pp-bubble bb-pp-bubble-bot",children:i})}),l.length>0&&d.jsx("div",{className:"bb-pp-chips",children:l.slice(0,4).map((h,p)=>d.jsx("button",{type:"button",className:"bb-pp-chip",style:{borderColor:n,color:n},children:h.label||"…"},p))})]}),d.jsxs("div",{className:"bb-pp-composer",children:[d.jsx("input",{className:"bb-pp-input",placeholder:o,disabled:!0,style:{borderColor:n}}),d.jsx("button",{className:"bb-pp-send",style:{background:n},"aria-label":"Send",children:d.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"white",strokeWidth:"2",children:[d.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),d.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),d.jsxs("div",{className:"bb-pp-branding",children:["Powered by ",d.jsx("strong",{children:"BitBot"})]})]})}function T6({shape:e,primary:t,avatarUrl:n,avatarBg:r,showCloseIcon:i,cornerRadius:o}){const l=Math.round(o/56*36),u=e==="circle"?"50%":e==="square"?"2px":e==="pill"?`${l}px`:e==="hexagon"?"50%":`${l}px`,f=e==="pill"?72:void 0,h=e==="pill"?18:void 0,p=i?d.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"white",strokeWidth:"2",children:[d.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):n?r?d.jsx("span",{className:"bb-pp-fab-avatar",style:{backgroundImage:`url(${n})`,backgroundSize:r.backgroundSize,backgroundPosition:r.backgroundPosition,backgroundRepeat:"no-repeat"}}):d.jsx("img",{src:n,alt:"",className:"bb-pp-fab-avatar"}):d.jsx("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"white",strokeWidth:"1.5",children:d.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})});return d.jsx("div",{className:"bb-pp-fab",style:{background:t,borderRadius:u,width:f,height:h},children:p})}function nT(e){return Math.max(6,Math.min(60,Math.round(e/3)))}function P6({settings:e}){const[t,n]=v.useState("open"),r=e.widgetPosition!=="bottom-left",i=nT(e.widgetOffsetX??20),o=nT(e.widgetOffsetY??20),l=e.primaryColor||"#0073aa";return d.jsxs("div",{className:"bb-phone-preview",children:[d.jsxs("div",{className:"bb-pp-header-bar",children:[d.jsx("span",{className:"bb-pp-eyebrow",children:"Live preview"}),d.jsxs("div",{className:"bb-pp-mode-toggle",role:"tablist","aria-label":"Preview state",children:[d.jsx("button",{type:"button",role:"tab","aria-selected":t==="open",className:`bb-pp-mode-btn ${t==="open"?"bb-pp-mode-btn-active":""}`,onClick:()=>n("open"),children:"Open"}),d.jsx("button",{type:"button",role:"tab","aria-selected":t==="closed",className:`bb-pp-mode-btn ${t==="closed"?"bb-pp-mode-btn-active":""}`,onClick:()=>n("closed"),children:"Closed"})]})]}),d.jsxs("div",{className:"bb-pp-desktop",children:[d.jsxs("div",{className:"bb-pp-browser-chrome",children:[d.jsx("span",{className:"bb-pp-browser-dot",style:{background:"#FF5F57"}}),d.jsx("span",{className:"bb-pp-browser-dot",style:{background:"#FEBC2E"}}),d.jsx("span",{className:"bb-pp-browser-dot",style:{background:"#28C840"}}),d.jsx("span",{className:"bb-pp-browser-addr",children:(()=>{var u;try{return new URL(((u=window.bitbotAdminConfig)==null?void 0:u.siteUrl)??"").host}catch{return"your-site.com"}})()})]}),d.jsxs("div",{className:"bb-pp-page",children:[d.jsx("div",{className:"bb-pp-page-headline"}),d.jsx("div",{className:"bb-pp-page-line",style:{width:"80%"}}),d.jsx("div",{className:"bb-pp-page-line",style:{width:"92%"}}),d.jsx("div",{className:"bb-pp-page-line",style:{width:"65%"}}),d.jsx("div",{className:"bb-pp-page-line",style:{width:"78%"}})]}),t==="open"&&d.jsx("div",{className:"bb-pp-desktop-panel",style:{bottom:o+44,[r?"right":"left"]:i,"--bb-pp-radius":`${e.cornerRadius??16}px`},children:d.jsx(N6,{settings:e,onClose:()=>n("closed")})}),d.jsx("button",{type:"button",className:"bb-pp-desktop-fab-wrap bb-pp-desktop-fab-button",onClick:()=>n(t==="open"?"closed":"open"),"aria-label":t==="open"?"Close chat (preview)":"Open chat (preview)",style:{bottom:o,[r?"right":"left"]:i},children:d.jsx(T6,{shape:e.widgetShape,primary:l,avatarUrl:e.avatarUrl||void 0,avatarBg:tE(Eb(e.avatarTransform),e.widgetShape==="pill"?"pill":"rounded",e.widgetShape==="pill"?72:36,e.widgetShape==="pill"?18:36),showCloseIcon:t==="open",cornerRadius:e.cornerRadius??16})})]}),d.jsx("p",{className:"bb-pp-caption",children:t==="open"?d.jsxs(d.Fragment,{children:["What a visitor sees while chatting. Anchored ",r?"bottom-right":"bottom-left"," · ",e.widgetOffsetX," px from side, ",e.widgetOffsetY," px from bottom."]}):d.jsx(d.Fragment,{children:"What a visitor sees before they click. Click the bubble to preview the open state."})})]})}function Lr({eyebrow:e,title:t,titleAction:n,children:r,className:i,noBody:o}){const l=e||t||n;return d.jsxs("section",{className:`bb-card ${i??""}`,children:[l&&d.jsxs("header",{className:"bb-card-header",children:[(e||t)&&d.jsxs("h3",{className:"bb-card-title",children:[e&&d.jsx("span",{className:"bb-eyebrow",children:e}),t&&d.jsx("span",{children:t})]}),n&&d.jsx("div",{className:"bb-card-action",children:n})]}),o?r:d.jsx("div",{className:"bb-card-body",children:r})]})}function _6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const Ab=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Eu(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function nE(e){return"nodeType"in e}function Ir(e){var t,n;return e?Eu(e)?e:nE(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function rE(e){const{Document:t}=Ir(e);return e instanceof t}function kf(e){return Eu(e)?!1:e instanceof Ir(e).HTMLElement}function Zk(e){return e instanceof Ir(e).SVGElement}function Au(e){return e?Eu(e)?e.document:nE(e)?rE(e)?e:kf(e)||Zk(e)?e.ownerDocument:document:document:document}const pi=Ab?v.useLayoutEffect:v.useEffect;function aE(e){const t=v.useRef(e);return pi(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function D6(){const e=v.useRef(null),t=v.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function of(e,t){t===void 0&&(t=[e]);const n=v.useRef(e);return pi(()=>{n.current!==e&&(n.current=e)},t),n}function Lf(e,t){const n=v.useRef();return v.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function pp(e){const t=aE(e),n=v.useRef(null),r=v.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function Ow(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let r0={};function If(e,t){return v.useMemo(()=>{if(t)return t;const n=r0[e]==null?0:r0[e]+1;return r0[e]=n,e+"-"+n},[e,t])}function Jk(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,l)=>{const u=Object.entries(l);for(const[f,h]of u){const p=o[f];p!=null&&(o[f]=p+e*h)}return o},{...t})}}const qc=Jk(1),bp=Jk(-1);function M6(e){return"clientX"in e&&"clientY"in e}function iE(e){if(!e)return!1;const{KeyboardEvent:t}=Ir(e.target);return t&&e instanceof t}function R6(e){if(!e)return!1;const{TouchEvent:t}=Ir(e.target);return t&&e instanceof t}function Nw(e){if(R6(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return M6(e)?{x:e.clientX,y:e.clientY}:null}const sf=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[sf.Translate.toString(e),sf.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),rT="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function k6(e){return e.matches(rT)?e:e.querySelector(rT)}const L6={display:"none"};function I6(e){let{id:t,value:n}=e;return Zt.createElement("div",{id:t,style:L6},n)}function z6(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Zt.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function U6(){const[e,t]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const e2=v.createContext(null);function q6(e){const t=v.useContext(e2);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function B6(){const[e]=v.useState(()=>new Set),t=v.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[v.useCallback(r=>{let{type:i,event:o}=r;e.forEach(l=>{var u;return(u=l[i])==null?void 0:u.call(l,o)})},[e]),t]}const F6={draggable:`144 `,E6=1,A6=3,j6=1,C6=(function(e){a6(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.cropperRef=v.createRef(),n.imageRef=v.createRef(),n.videoRef=v.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document<"u"?document:null,n.currentWindow=typeof window<"u"?window:null,n.resizeObserver=null,n.previousCropSize=null,n.isInitialized=!1,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(i){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturechange",n.onGestureChange),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.previousCropSize=r,n.emitCropData(),n.setInitialCrop(r),n.isInitialized=!0),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var i=g6(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=i.crop,l=i.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(l)}else if(n.props.initialCroppedAreaPixels){var u=x6(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=u.crop,l=u.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(l)}},n.computeSizes=function(){var r,i,o,l,u,f,h=n.imageRef.current||n.videoRef.current;if(h&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var p=n.containerRect.width/n.containerRect.height,b=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,g=((o=n.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((l=n.videoRef.current)===null||l===void 0?void 0:l.videoHeight)||0,x=h.offsetWidth<b||h.offsetHeight<g,E=b/g,S=void 0;if(x)switch(n.state.mediaObjectFit){default:case"contain":S=p>E?{width:n.containerRect.height*E,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/E};break;case"horizontal-cover":S={width:n.containerRect.width,height:n.containerRect.width/E};break;case"vertical-cover":S={width:n.containerRect.height*E,height:n.containerRect.height};break}else S={width:h.offsetWidth,height:h.offsetHeight};n.mediaSize=jt(jt({},S),{naturalWidth:b,naturalHeight:g}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var A=n.props.cropSize?n.props.cropSize:h6(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((u=n.state.cropSize)===null||u===void 0?void 0:u.height)!==A.height||((f=n.state.cropSize)===null||f===void 0?void 0:f.width)!==A.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(A),n.setState({cropSize:A},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(A),A}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(t.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(t.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(t.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureChange),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureChange=function(r){if(r.preventDefault(),!n.isTouching){var i=t.getMousePoint(r),o=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(o,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var l=n.gestureRotationStart+r.rotation;n.props.onRotationChange(l)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var i,o,l=r.x,u=r.y;n.dragStartPosition={x:l,y:u},n.dragStartCrop=jt({},n.props.crop),(o=(i=n.props).onInteractionStart)===null||o===void 0||o.call(i)},n.onDrag=function(r){var i=r.x,o=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(i===void 0||o===void 0)){var l=i-n.dragStartPosition.x,u=o-n.dragStartPosition.y,f={x:n.dragStartCrop.x+l,y:n.dragStartCrop.y+u},h=n.props.restrictPosition?_d(f,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):f;n.props.onCropChange(h)}}))},n.onDragStopped=function(){var r,i;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(i=(r=n.props).onInteractionEnd)===null||i===void 0||i.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var i=t.getMousePoint(r),o=f6(r).pixelY,l=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(l,i,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var u,f;return(f=(u=n.props).onInteractionStart)===null||f===void 0?void 0:f.call(u)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var u,f;return(f=(u=n.props).onInteractionEnd)===null||f===void 0?void 0:f.call(u)})},250)}},n.getPointOnContainer=function(r,i){var o=r.x,l=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-i.x),y:n.containerRect.height/2-(l-i.y)}},n.getPointOnMedia=function(r){var i=r.x,o=r.y,l=n.props,u=l.crop,f=l.zoom;return{x:(i+u.x)/f,y:(o+u.y)/f}},n.setNewZoom=function(r,i,o){var l=o===void 0?{}:o,u=l.shouldUpdatePosition,f=u===void 0?!0:u;if(!(!n.state.cropSize||!n.props.onZoomChange)){var h=Sb(r,n.props.minZoom,n.props.maxZoom);if(f){var p=n.getPointOnContainer(i,n.containerPosition),b=n.getPointOnMedia(p),g={x:b.x*h-p.x,y:b.y*h-p.y},x=n.props.restrictPosition?_d(g,n.mediaSize,n.state.cropSize,h,n.props.rotation):g;n.props.onCropChange(x)}n.props.onZoomChange(h)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?_d(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return p6(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(i,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.recomputeCropPosition=function(){var r,i;if(n.state.cropSize){var o=n.props.crop;if(n.isInitialized&&(!((r=n.previousCropSize)===null||r===void 0)&&r.width)&&(!((i=n.previousCropSize)===null||i===void 0)&&i.height)){var l=Math.abs(n.previousCropSize.width-n.state.cropSize.width)>1e-6||Math.abs(n.previousCropSize.height-n.state.cropSize.height)>1e-6;if(l){var u=n.state.cropSize.width/n.previousCropSize.width,f=n.state.cropSize.height/n.previousCropSize.height;o={x:n.props.crop.x*u,y:n.props.crop.y*f}}}var h=n.props.restrictPosition?_d(o,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):o;n.previousCropSize=n.state.cropSize,n.props.onCropChange(h),n.emitCropData()}},n.onKeyDown=function(r){var i,o,l=n.props,u=l.crop,f=l.onCropChange,h=l.keyboardStep,p=l.zoom,b=l.rotation,g=h;if(n.state.cropSize){r.shiftKey&&(g*=.2);var x=jt({},u);switch(r.key){case"ArrowUp":x.y-=g,r.preventDefault();break;case"ArrowDown":x.y+=g,r.preventDefault();break;case"ArrowLeft":x.x-=g,r.preventDefault();break;case"ArrowRight":x.x+=g,r.preventDefault();break;default:return}n.props.restrictPosition&&(x=_d(x,n.mediaSize,n.state.cropSize,p,b)),r.repeat||(o=(i=n.props).onInteractionStart)===null||o===void 0||o.call(i),f(x)}},n.onKeyUp=function(r){var i,o;switch(r.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":r.preventDefault();break;default:return}n.emitCropData(),(o=(i=n.props).onInteractionEnd)===null||o===void 0||o.call(i)},n}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=S6,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var r,i,o,l,u,f,h,p,b;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.height)||((o=n.cropSize)===null||o===void 0?void 0:o.width)!==((l=this.props.cropSize)===null||l===void 0?void 0:l.width)?this.computeSizes():(((u=n.crop)===null||u===void 0?void 0:u.x)!==((f=this.props.crop)===null||f===void 0?void 0:f.x)||((h=n.crop)===null||h===void 0?void 0:h.y)!==((p=this.props.crop)===null||p===void 0?void 0:p.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((b=this.videoRef.current)===null||b===void 0||b.load());var g=this.getObjectFit();g!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:g},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,r=n.cropSize,i=n.aspect;return r?r.width/r.height:i},t.prototype.getObjectFit=function(){var n,r,i,o;if(this.props.objectFit==="cover"){var l=this.imageRef.current||this.videoRef.current;if(l&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var u=this.containerRect.width/this.containerRect.height,f=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,h=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,p=f/h;return p<u?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(n){var r=t.getTouchPoint(n.touches[0]),i=t.getTouchPoint(n.touches[1]);this.lastPinchDistance=ZN(r,i),this.lastPinchRotation=JN(r,i),this.onDragStart(eT(r,i))},t.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var i=t.getTouchPoint(n.touches[0]),o=t.getTouchPoint(n.touches[1]),l=eT(i,o);this.onDrag(l),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var u=ZN(i,o),f=r.props.zoom*(u/r.lastPinchDistance);r.setNewZoom(f,l,{shouldUpdatePosition:!1}),r.lastPinchDistance=u;var h=JN(i,o),p=r.props.rotation+(h-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(p),r.lastPinchRotation=h})}},t.prototype.render=function(){var n=this,r,i=this.props,o=i.image,l=i.video,u=i.mediaProps,f=i.cropperProps,h=i.transform,p=i.crop,b=p.x,g=p.y,x=i.rotation,E=i.zoom,S=i.cropShape,A=i.showGrid,j=i.roundCropAreaPixels,C=i.style,O=C.containerStyle,T=C.cropAreaStyle,_=C.mediaStyle,P=i.classes,D=P.containerClassName,L=P.cropAreaClassName,z=P.mediaClassName,F=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return v.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(R){return n.containerRef=R},"data-testid":"container",style:O,className:jm("reactEasyCrop_Container",D)},o?v.createElement("img",jt({alt:"",className:jm("reactEasyCrop_Image",F==="contain"&&"reactEasyCrop_Contain",F==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",F==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",z)},u,{src:o,ref:this.imageRef,style:jt(jt({},_),{transform:h||"translate(".concat(b,"px, ").concat(g,"px) rotate(").concat(x,"deg) scale(").concat(E,")")}),onLoad:this.onMediaLoad})):l&&v.createElement("video",jt({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:jm("reactEasyCrop_Video",F==="contain"&&"reactEasyCrop_Contain",F==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",F==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",z)},u,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:jt(jt({},_),{transform:h||"translate(".concat(b,"px, ").concat(g,"px) rotate(").concat(x,"deg) scale(").concat(E,")")}),controls:!1}),(Array.isArray(l)?l:[{src:l}]).map(function(G){return v.createElement("source",jt({key:G.src},G))})),this.state.cropSize&&v.createElement("div",jt({ref:this.cropperRef,style:jt(jt({},T),{width:j?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:j?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:jm("reactEasyCrop_CropArea",S==="round"&&"reactEasyCrop_CropAreaRound",A&&"reactEasyCrop_CropAreaGrid",L)},f)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:A6,minZoom:E6,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:j6},t.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t})(v.Component);const tT=320,O6={rounded:{aspect:1,cropShape:"round"},pill:{aspect:4,cropShape:"rect"}};function N6({imageUrl:e,fabShape:t,initial:n,onSave:r,onCancel:i}){const o=O6[t],l=tT,u=Math.round(tT/o.aspect),[f,h]=v.useState({x:0,y:0}),[p,b]=v.useState(1),[g,x]=v.useState(null),[E,S]=v.useState(null);v.useEffect(()=>{if(!e)return;const O=new Image;O.onload=()=>{O.naturalWidth>0&&O.naturalHeight>0&&S({w:O.naturalWidth,h:O.naturalHeight})},O.src=e},[e]),v.useEffect(()=>{if(!n||!E||n.shape!==t)return;const O=Math.max(1,Math.min(4,E.w/Math.max(1,n.cropW)));b(O)},[n,E,t]);const A=v.useCallback((O,T)=>{x(T)},[]),j=()=>{if(!E||!g){i();return}r({shape:t,cropX:Math.round(g.x),cropY:Math.round(g.y),cropW:Math.round(g.width),cropH:Math.round(g.height),sourceW:E.w,sourceH:E.h})},C=()=>{h({x:0,y:0}),b(1)};return Vn.createPortal(d.jsx("div",{className:"bb-portal-scope bb-avatar-crop-modal-overlay",onClick:O=>{O.target===O.currentTarget&&i()},role:"dialog","aria-modal":"true","aria-label":"Adjust avatar crop",children:d.jsxs("div",{className:"bb-avatar-crop-modal",children:[d.jsxs("header",{className:"bb-avatar-crop-head",children:[d.jsx("h3",{children:"Frame your avatar"}),d.jsxs("p",{children:["Drag to reposition, slider to zoom. Cropping for the"," ",d.jsx("strong",{children:t==="pill"?"Pill":"Rounded"})," ","FAB — this is exactly how visitors will see it."]})]}),d.jsx("div",{className:"bb-avatar-crop-stage",style:{width:l,height:u},children:d.jsx(C6,{image:e,crop:f,zoom:p,aspect:o.aspect,cropShape:o.cropShape,showGrid:!1,minZoom:1,maxZoom:4,zoomSpeed:.5,onCropChange:h,onZoomChange:b,onCropComplete:A,objectFit:"cover"})}),d.jsxs("div",{className:"bb-avatar-crop-zoom",children:[d.jsxs("label",{children:[d.jsx("span",{children:"Zoom"}),d.jsx("input",{type:"range",min:1,max:4,step:.05,value:p,onChange:O=>b(Number(O.target.value)),className:"bb-slider"})]}),d.jsx("button",{type:"button",className:"bb-link-btn",onClick:C,children:"Reset"})]}),d.jsxs("footer",{className:"bb-avatar-crop-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost",onClick:i,children:"Cancel"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:j,children:"Use this crop"})]})]})}),document.body)}function Eb(e){if(!e)return null;try{const t=JSON.parse(e);return typeof t!="object"||t===null||typeof t.cropW!="number"||typeof t.cropH!="number"||typeof t.sourceW!="number"||typeof t.sourceH!="number"||t.cropW<=0||t.cropH<=0||t.sourceW<=0||t.sourceH<=0?null:{shape:t.shape==="pill"?"pill":"rounded",cropX:Number(t.cropX??0),cropY:Number(t.cropY??0),cropW:Number(t.cropW),cropH:Number(t.cropH),sourceW:Number(t.sourceW),sourceH:Number(t.sourceH)}}catch{return null}}function tE(e,t,n,r){if(!e||e.shape!==t||e.cropW<=0||e.cropH<=0)return null;const i=n/e.cropW,o=r/e.cropH,l=e.sourceW*i,u=e.sourceH*o,f=-e.cropX*i,h=-e.cropY*o;return{backgroundSize:`${l}px ${u}px`,backgroundPosition:`${f}px ${h}px`}}function T6({settings:e,onClose:t}){const n=e.primaryColor||"#0073aa",r=e.widgetTitle||"Chat with us",i=e.welcomeMessage||"Hi! How can I help you today?",o=e.placeholderText||"Type your message...",l=e.suggestedQuestions||[],u=e.avatarUrl||"",f=tE(Eb(e.avatarTransform),"rounded",32,32);return d.jsxs("div",{className:"bb-pp-screen",children:[d.jsxs("header",{className:"bb-pp-header",style:{background:n},children:[u&&d.jsx("span",{className:"bb-pp-header-avatar",children:f?d.jsx("span",{className:"bb-pp-header-avatar-bg",style:{backgroundImage:`url(${u})`,backgroundSize:f.backgroundSize,backgroundPosition:f.backgroundPosition,backgroundRepeat:"no-repeat"}}):d.jsx("img",{src:u,alt:"",className:"bb-pp-header-avatar-img"})}),d.jsx("span",{className:"bb-pp-header-title",children:r}),d.jsx("button",{className:"bb-pp-minimize","aria-label":"Minimize",type:"button",onClick:t,title:"Minimize (preview)",children:d.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",children:d.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})})})]}),d.jsxs("div",{className:"bb-pp-body",children:[d.jsx("div",{className:"bb-pp-message bb-pp-message-bot",children:d.jsx("div",{className:"bb-pp-bubble bb-pp-bubble-bot",children:i})}),l.length>0&&d.jsx("div",{className:"bb-pp-chips",children:l.slice(0,4).map((h,p)=>d.jsx("button",{type:"button",className:"bb-pp-chip",style:{borderColor:n,color:n},children:h.label||"…"},p))})]}),d.jsxs("div",{className:"bb-pp-composer",children:[d.jsx("input",{className:"bb-pp-input",placeholder:o,disabled:!0,style:{borderColor:n}}),d.jsx("button",{className:"bb-pp-send",style:{background:n},"aria-label":"Send",children:d.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"none",stroke:"white",strokeWidth:"2",children:[d.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),d.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),d.jsxs("div",{className:"bb-pp-branding",children:["Powered by ",d.jsx("strong",{children:"BitBot"})]})]})}function P6({shape:e,primary:t,avatarUrl:n,avatarBg:r,showCloseIcon:i,cornerRadius:o}){const l=Math.round(o/56*36),u=e==="circle"?"50%":e==="square"?"2px":e==="pill"?`${l}px`:e==="hexagon"?"50%":`${l}px`,f=e==="pill"?72:void 0,h=e==="pill"?18:void 0,p=i?d.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"white",strokeWidth:"2",children:[d.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):n?r?d.jsx("span",{className:"bb-pp-fab-avatar",style:{backgroundImage:`url(${n})`,backgroundSize:r.backgroundSize,backgroundPosition:r.backgroundPosition,backgroundRepeat:"no-repeat"}}):d.jsx("img",{src:n,alt:"",className:"bb-pp-fab-avatar"}):d.jsx("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"white",strokeWidth:"1.5",children:d.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})});return d.jsx("div",{className:"bb-pp-fab",style:{background:t,borderRadius:u,width:f,height:h},children:p})}function nT(e){return Math.max(6,Math.min(60,Math.round(e/3)))}function _6({settings:e}){const[t,n]=v.useState("open"),r=e.widgetPosition!=="bottom-left",i=nT(e.widgetOffsetX??20),o=nT(e.widgetOffsetY??20),l=e.primaryColor||"#0073aa";return d.jsxs("div",{className:"bb-phone-preview",children:[d.jsxs("div",{className:"bb-pp-header-bar",children:[d.jsx("span",{className:"bb-pp-eyebrow",children:"Live preview"}),d.jsxs("div",{className:"bb-pp-mode-toggle",role:"tablist","aria-label":"Preview state",children:[d.jsx("button",{type:"button",role:"tab","aria-selected":t==="open",className:`bb-pp-mode-btn ${t==="open"?"bb-pp-mode-btn-active":""}`,onClick:()=>n("open"),children:"Open"}),d.jsx("button",{type:"button",role:"tab","aria-selected":t==="closed",className:`bb-pp-mode-btn ${t==="closed"?"bb-pp-mode-btn-active":""}`,onClick:()=>n("closed"),children:"Closed"})]})]}),d.jsxs("div",{className:"bb-pp-desktop",children:[d.jsxs("div",{className:"bb-pp-browser-chrome",children:[d.jsx("span",{className:"bb-pp-browser-dot",style:{background:"#FF5F57"}}),d.jsx("span",{className:"bb-pp-browser-dot",style:{background:"#FEBC2E"}}),d.jsx("span",{className:"bb-pp-browser-dot",style:{background:"#28C840"}}),d.jsx("span",{className:"bb-pp-browser-addr",children:(()=>{var u;try{return new URL(((u=window.bitbotAdminConfig)==null?void 0:u.siteUrl)??"").host}catch{return"your-site.com"}})()})]}),d.jsxs("div",{className:"bb-pp-page",children:[d.jsx("div",{className:"bb-pp-page-headline"}),d.jsx("div",{className:"bb-pp-page-line",style:{width:"80%"}}),d.jsx("div",{className:"bb-pp-page-line",style:{width:"92%"}}),d.jsx("div",{className:"bb-pp-page-line",style:{width:"65%"}}),d.jsx("div",{className:"bb-pp-page-line",style:{width:"78%"}})]}),t==="open"&&d.jsx("div",{className:"bb-pp-desktop-panel",style:{bottom:o+44,[r?"right":"left"]:i,"--bb-pp-radius":`${e.cornerRadius??16}px`},children:d.jsx(T6,{settings:e,onClose:()=>n("closed")})}),d.jsx("button",{type:"button",className:"bb-pp-desktop-fab-wrap bb-pp-desktop-fab-button",onClick:()=>n(t==="open"?"closed":"open"),"aria-label":t==="open"?"Close chat (preview)":"Open chat (preview)",style:{bottom:o,[r?"right":"left"]:i},children:d.jsx(P6,{shape:e.widgetShape,primary:l,avatarUrl:e.avatarUrl||void 0,avatarBg:tE(Eb(e.avatarTransform),e.widgetShape==="pill"?"pill":"rounded",e.widgetShape==="pill"?72:36,e.widgetShape==="pill"?18:36),showCloseIcon:t==="open",cornerRadius:e.cornerRadius??16})})]}),d.jsx("p",{className:"bb-pp-caption",children:t==="open"?d.jsxs(d.Fragment,{children:["What a visitor sees while chatting. Anchored ",r?"bottom-right":"bottom-left"," · ",e.widgetOffsetX," px from side, ",e.widgetOffsetY," px from bottom."]}):d.jsx(d.Fragment,{children:"What a visitor sees before they click. Click the bubble to preview the open state."})})]})}function Lr({eyebrow:e,title:t,titleAction:n,children:r,className:i,noBody:o}){const l=e||t||n;return d.jsxs("section",{className:`bb-card ${i??""}`,children:[l&&d.jsxs("header",{className:"bb-card-header",children:[(e||t)&&d.jsxs("h3",{className:"bb-card-title",children:[e&&d.jsx("span",{className:"bb-eyebrow",children:e}),t&&d.jsx("span",{children:t})]}),n&&d.jsx("div",{className:"bb-card-action",children:n})]}),o?r:d.jsx("div",{className:"bb-card-body",children:r})]})}function D6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const Ab=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Au(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function nE(e){return"nodeType"in e}function Ir(e){var t,n;return e?Au(e)?e:nE(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function rE(e){const{Document:t}=Ir(e);return e instanceof t}function kf(e){return Au(e)?!1:e instanceof Ir(e).HTMLElement}function Jk(e){return e instanceof Ir(e).SVGElement}function ju(e){return e?Au(e)?e.document:nE(e)?rE(e)?e:kf(e)||Jk(e)?e.ownerDocument:document:document:document}const pi=Ab?v.useLayoutEffect:v.useEffect;function aE(e){const t=v.useRef(e);return pi(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function M6(){const e=v.useRef(null),t=v.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function sf(e,t){t===void 0&&(t=[e]);const n=v.useRef(e);return pi(()=>{n.current!==e&&(n.current=e)},t),n}function Lf(e,t){const n=v.useRef();return v.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function pp(e){const t=aE(e),n=v.useRef(null),r=v.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function Ow(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let r0={};function If(e,t){return v.useMemo(()=>{if(t)return t;const n=r0[e]==null?0:r0[e]+1;return r0[e]=n,e+"-"+n},[e,t])}function e2(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,l)=>{const u=Object.entries(l);for(const[f,h]of u){const p=o[f];p!=null&&(o[f]=p+e*h)}return o},{...t})}}const qc=e2(1),bp=e2(-1);function R6(e){return"clientX"in e&&"clientY"in e}function iE(e){if(!e)return!1;const{KeyboardEvent:t}=Ir(e.target);return t&&e instanceof t}function k6(e){if(!e)return!1;const{TouchEvent:t}=Ir(e.target);return t&&e instanceof t}function Nw(e){if(k6(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return R6(e)?{x:e.clientX,y:e.clientY}:null}const lf=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[lf.Translate.toString(e),lf.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),rT="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function L6(e){return e.matches(rT)?e:e.querySelector(rT)}const I6={display:"none"};function z6(e){let{id:t,value:n}=e;return Zt.createElement("div",{id:t,style:I6},n)}function U6(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Zt.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function q6(){const[e,t]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const t2=v.createContext(null);function B6(e){const t=v.useContext(t2);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function F6(){const[e]=v.useState(()=>new Set),t=v.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[v.useCallback(r=>{let{type:i,event:o}=r;e.forEach(l=>{var u;return(u=l[i])==null?void 0:u.call(l,o)})},[e]),t]}const $6={draggable:` 145 145 To pick up a draggable item, press the space bar. 146 146 While dragging, use the arrow keys to move the item. 147 147 Press space again to drop the item in its new position, or press escape to cancel. 148 `}, $6={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function K6(e){let{announcements:t=$6,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=F6}=e;const{announce:o,announcement:l}=U6(),u=If("DndLiveRegion"),[f,h]=v.useState(!1);if(v.useEffect(()=>{h(!0)},[]),q6(v.useMemo(()=>({onDragStart(b){let{active:g}=b;o(t.onDragStart({active:g}))},onDragMove(b){let{active:g,over:x}=b;t.onDragMove&&o(t.onDragMove({active:g,over:x}))},onDragOver(b){let{active:g,over:x}=b;o(t.onDragOver({active:g,over:x}))},onDragEnd(b){let{active:g,over:x}=b;o(t.onDragEnd({active:g,over:x}))},onDragCancel(b){let{active:g,over:x}=b;o(t.onDragCancel({active:g,over:x}))}}),[o,t])),!f)return null;const p=Zt.createElement(Zt.Fragment,null,Zt.createElement(I6,{id:r,value:i.draggable}),Zt.createElement(z6,{id:u,announcement:l}));return n?Vn.createPortal(p,n):p}var wn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(wn||(wn={}));function vp(){}function H6(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function G6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const qa=Object.freeze({x:0,y:0});function Y6(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function W6(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Q6(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function V6(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function aT(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const X6=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=aT(t,t.left,t.top),o=[];for(const l of r){const{id:u}=l,f=n.get(u);if(f){const h=Y6(aT(f),i);o.push({id:u,data:{droppableContainer:l,value:h}})}}return o.sort(W6)};function Z6(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),l=i-r,u=o-n;if(r<i&&n<o){const f=t.width*t.height,h=e.width*e.height,p=l*u,b=p/(f+h-p);return Number(b.toFixed(4))}return 0}const J6=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:l}=o,u=n.get(l);if(u){const f=Z6(u,t);f>0&&i.push({id:l,data:{droppableContainer:o,value:f}})}}return i.sort(Q6)};function eK(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function t2(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:qa}function tK(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((l,u)=>({...l,top:l.top+e*u.y,bottom:l.bottom+e*u.y,left:l.left+e*u.x,right:l.right+e*u.x}),{...n})}}const nK=tK(1);function rK(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function aK(e,t,n){const r=rK(t);if(!r)return e;const{scaleX:i,scaleY:o,x:l,y:u}=r,f=e.left-l-(1-i)*parseFloat(n),h=e.top-u-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),p=i?e.width/i:e.width,b=o?e.height/o:e.height;return{width:p,height:b,top:h,right:f+p,bottom:h+b,left:f}}const iK={ignoreTransform:!1};function ju(e,t){t===void 0&&(t=iK);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:p}=Ir(e).getComputedStyle(e);h&&(n=aK(n,h,p))}const{top:r,left:i,width:o,height:l,bottom:u,right:f}=n;return{top:r,left:i,width:o,height:l,bottom:u,right:f}}function iT(e){return ju(e,{ignoreTransform:!0})}function oK(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function sK(e,t){return t===void 0&&(t=Ir(e).getComputedStyle(e)),t.position==="fixed"}function lK(e,t){t===void 0&&(t=Ir(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function oE(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(rE(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!kf(i)||Zk(i)||n.includes(i))return n;const o=Ir(e).getComputedStyle(i);return i!==e&&lK(i,o)&&n.push(i),sK(i,o)?n:r(i.parentNode)}return e?r(e):n}function n2(e){const[t]=oE(e,1);return t??null}function a0(e){return!Ab||!e?null:Eu(e)?e:nE(e)?rE(e)||e===Au(e).scrollingElement?window:kf(e)?e:null:null}function r2(e){return Eu(e)?e.scrollX:e.scrollLeft}function a2(e){return Eu(e)?e.scrollY:e.scrollTop}function Tw(e){return{x:r2(e),y:a2(e)}}var Mn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Mn||(Mn={}));function i2(e){return!Ab||!e?!1:e===document.scrollingElement}function o2(e){const t={x:0,y:0},n=i2(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:l,isRight:u,maxScroll:r,minScroll:t}}const cK={x:.2,y:.2};function uK(e,t,n,r,i){let{top:o,left:l,right:u,bottom:f}=n;r===void 0&&(r=10),i===void 0&&(i=cK);const{isTop:h,isBottom:p,isLeft:b,isRight:g}=o2(e),x={x:0,y:0},E={x:0,y:0},S={height:t.height*i.y,width:t.width*i.x};return!h&&o<=t.top+S.height?(x.y=Mn.Backward,E.y=r*Math.abs((t.top+S.height-o)/S.height)):!p&&f>=t.bottom-S.height&&(x.y=Mn.Forward,E.y=r*Math.abs((t.bottom-S.height-f)/S.height)),!g&&u>=t.right-S.width?(x.x=Mn.Forward,E.x=r*Math.abs((t.right-S.width-u)/S.width)):!b&&l<=t.left+S.width&&(x.x=Mn.Backward,E.x=r*Math.abs((t.left+S.width-l)/S.width)),{direction:x,speed:E}}function dK(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:l}=window;return{top:0,left:0,right:o,bottom:l,width:o,height:l}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function s2(e){return e.reduce((t,n)=>qc(t,Tw(n)),qa)}function fK(e){return e.reduce((t,n)=>t+r2(n),0)}function hK(e){return e.reduce((t,n)=>t+a2(n),0)}function mK(e,t){if(t===void 0&&(t=ju),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);n2(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const pK=[["x",["left","right"],fK],["y",["top","bottom"],hK]];class sE{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=oE(n),i=s2(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,l,u]of pK)for(const f of l)Object.defineProperty(this,f,{get:()=>{const h=u(r),p=i[o]-h;return this.rect[f]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Zd{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function bK(e){const{EventTarget:t}=Ir(e);return e instanceof t?e:Au(e)}function i0(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var ya;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ya||(ya={}));function oT(e){e.preventDefault()}function vK(e){e.stopPropagation()}var ct;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(ct||(ct={}));const l2={start:[ct.Space,ct.Enter],cancel:[ct.Esc],end:[ct.Space,ct.Enter,ct.Tab]},gK=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ct.Right:return{...n,x:n.x+25};case ct.Left:return{...n,x:n.x-25};case ct.Down:return{...n,y:n.y+25};case ct.Up:return{...n,y:n.y-25}}};class c2{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Zd(Au(n)),this.windowListeners=new Zd(Ir(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ya.Resize,this.handleCancel),this.windowListeners.add(ya.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ya.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&mK(r),n(qa)}handleKeyDown(t){if(iE(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=l2,coordinateGetter:l=gK,scrollBehavior:u="smooth"}=i,{code:f}=t;if(o.end.includes(f)){this.handleEnd(t);return}if(o.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:h}=r.current,p=h?{x:h.left,y:h.top}:qa;this.referenceCoordinates||(this.referenceCoordinates=p);const b=l(t,{active:n,context:r.current,currentCoordinates:p});if(b){const g=bp(b,p),x={x:0,y:0},{scrollableAncestors:E}=r.current;for(const S of E){const A=t.code,{isTop:j,isRight:C,isLeft:O,isBottom:T,maxScroll:_,minScroll:P}=o2(S),D=dK(S),L={x:Math.min(A===ct.Right?D.right-D.width/2:D.right,Math.max(A===ct.Right?D.left:D.left+D.width/2,b.x)),y:Math.min(A===ct.Down?D.bottom-D.height/2:D.bottom,Math.max(A===ct.Down?D.top:D.top+D.height/2,b.y))},z=A===ct.Right&&!C||A===ct.Left&&!O,R=A===ct.Down&&!T||A===ct.Up&&!j;if(z&&L.x!==b.x){const q=S.scrollLeft+g.x,U=A===ct.Right&&q<=_.x||A===ct.Left&&q>=P.x;if(U&&!g.y){S.scrollTo({left:q,behavior:u});return}U?x.x=S.scrollLeft-q:x.x=A===ct.Right?S.scrollLeft-_.x:S.scrollLeft-P.x,x.x&&S.scrollBy({left:-x.x,behavior:u});break}else if(R&&L.y!==b.y){const q=S.scrollTop+g.y,U=A===ct.Down&&q<=_.y||A===ct.Up&&q>=P.y;if(U&&!g.x){S.scrollTo({top:q,behavior:u});return}U?x.y=S.scrollTop-q:x.y=A===ct.Down?S.scrollTop-_.y:S.scrollTop-P.y,x.y&&S.scrollBy({top:-x.y,behavior:u});break}}this.handleMove(t,qc(bp(b,this.referenceCoordinates),x))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}c2.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=l2,onActivation:i}=t,{active:o}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const u=o.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function sT(e){return!!(e&&"distance"in e)}function lT(e){return!!(e&&"delay"in e)}class lE{constructor(t,n,r){var i;r===void 0&&(r=bK(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:l}=o;this.props=t,this.events=n,this.document=Au(l),this.documentListeners=new Zd(this.document),this.listeners=new Zd(r),this.windowListeners=new Zd(Ir(l)),this.initialCoordinates=(i=Nw(o))!=null?i:qa,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(ya.Resize,this.handleCancel),this.windowListeners.add(ya.DragStart,oT),this.windowListeners.add(ya.VisibilityChange,this.handleCancel),this.windowListeners.add(ya.ContextMenu,oT),this.documentListeners.add(ya.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(lT(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(sT(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(ya.Click,vK,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ya.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:l,options:{activationConstraint:u}}=o;if(!i)return;const f=(n=Nw(t))!=null?n:qa,h=bp(i,f);if(!r&&u){if(sT(u)){if(u.tolerance!=null&&i0(h,u.tolerance))return this.handleCancel();if(i0(h,u.distance))return this.handleStart()}if(lT(u)&&i0(h,u.tolerance))return this.handleCancel();this.handlePending(u,h);return}t.cancelable&&t.preventDefault(),l(f)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===ct.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const yK={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class cE extends lE{constructor(t){const{event:n}=t,r=Au(n.target);super(t,yK,r)}}cE.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const xK={move:{name:"mousemove"},end:{name:"mouseup"}};var Pw;(function(e){e[e.RightClick=2]="RightClick"})(Pw||(Pw={}));class wK extends lE{constructor(t){super(t,xK,Au(t.event.target))}}wK.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Pw.RightClick?!1:(r==null||r({event:n}),!0)}}];const o0={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class SK extends lE{constructor(t){super(t,o0)}static setup(){return window.addEventListener(o0.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(o0.move.name,t)};function t(){}}}SK.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var Jd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Jd||(Jd={}));var gp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(gp||(gp={}));function EK(e){let{acceleration:t,activator:n=Jd.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:l=5,order:u=gp.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:p,delta:b,threshold:g}=e;const x=jK({delta:b,disabled:!o}),[E,S]=D6(),A=v.useRef({x:0,y:0}),j=v.useRef({x:0,y:0}),C=v.useMemo(()=>{switch(n){case Jd.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case Jd.DraggableRect:return i}},[n,i,f]),O=v.useRef(null),T=v.useCallback(()=>{const P=O.current;if(!P)return;const D=A.current.x*j.current.x,L=A.current.y*j.current.y;P.scrollBy(D,L)},[]),_=v.useMemo(()=>u===gp.TreeOrder?[...h].reverse():h,[u,h]);v.useEffect(()=>{if(!o||!h.length||!C){S();return}for(const P of _){if((r==null?void 0:r(P))===!1)continue;const D=h.indexOf(P),L=p[D];if(!L)continue;const{direction:z,speed:R}=uK(P,L,C,t,g);for(const q of["x","y"])x[q][z[q]]||(R[q]=0,z[q]=0);if(R.x>0||R.y>0){S(),O.current=P,E(T,l),A.current=R,j.current=z;return}}A.current={x:0,y:0},j.current={x:0,y:0},S()},[t,T,r,S,o,l,JSON.stringify(C),JSON.stringify(x),E,h,_,p,JSON.stringify(g)])}const AK={x:{[Mn.Backward]:!1,[Mn.Forward]:!1},y:{[Mn.Backward]:!1,[Mn.Forward]:!1}};function jK(e){let{delta:t,disabled:n}=e;const r=Ow(t);return Lf(i=>{if(n||!r||!i)return AK;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Mn.Backward]:i.x[Mn.Backward]||o.x===-1,[Mn.Forward]:i.x[Mn.Forward]||o.x===1},y:{[Mn.Backward]:i.y[Mn.Backward]||o.y===-1,[Mn.Forward]:i.y[Mn.Forward]||o.y===1}}},[n,t,r])}function CK(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Lf(i=>{var o;return t==null?null:(o=r??i)!=null?o:null},[r,t])}function OK(e,t){return v.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...o]},[]),[e,t])}var lf;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(lf||(lf={}));var _w;(function(e){e.Optimized="optimized"})(_w||(_w={}));const cT=new Map;function NK(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,l]=v.useState(null),{frequency:u,measure:f,strategy:h}=i,p=v.useRef(e),b=A(),g=of(b),x=v.useCallback(function(j){j===void 0&&(j=[]),!g.current&&l(C=>C===null?j:C.concat(j.filter(O=>!C.includes(O))))},[g]),E=v.useRef(null),S=Lf(j=>{if(b&&!n)return cT;if(!j||j===cT||p.current!==e||o!=null){const C=new Map;for(let O of e){if(!O)continue;if(o&&o.length>0&&!o.includes(O.id)&&O.rect.current){C.set(O.id,O.rect.current);continue}const T=O.node.current,_=T?new sE(f(T),T):null;O.rect.current=_,_&&C.set(O.id,_)}return C}return j},[e,o,n,b,f]);return v.useEffect(()=>{p.current=e},[e]),v.useEffect(()=>{b||x()},[n,b]),v.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),v.useEffect(()=>{b||typeof u!="number"||E.current!==null||(E.current=setTimeout(()=>{x(),E.current=null},u))},[u,b,x,...r]),{droppableRects:S,measureDroppableContainers:x,measuringScheduled:o!=null};function A(){switch(h){case lf.Always:return!1;case lf.BeforeDragging:return n;default:return!n}}}function u2(e,t){return Lf(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function TK(e,t){return u2(e,t)}function PK(e){let{callback:t,disabled:n}=e;const r=aE(t),i=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return v.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function jb(e){let{callback:t,disabled:n}=e;const r=aE(t),i=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return v.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function _K(e){return new sE(ju(e),e)}function uT(e,t,n){t===void 0&&(t=_K);const[r,i]=v.useState(null);function o(){i(f=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=f??n)!=null?h:null}const p=t(e);return JSON.stringify(f)===JSON.stringify(p)?f:p})}const l=PK({callback(f){if(e)for(const h of f){const{type:p,target:b}=h;if(p==="childList"&&b instanceof HTMLElement&&b.contains(e)){o();break}}}}),u=jb({callback:o});return pi(()=>{o(),e?(u==null||u.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),l==null||l.disconnect())},[e]),r}function DK(e){const t=u2(e);return t2(e,t)}const dT=[];function MK(e){const t=v.useRef(e),n=Lf(r=>e?r&&r!==dT&&e&&t.current&&e.parentNode===t.current.parentNode?r:oE(e):dT,[e]);return v.useEffect(()=>{t.current=e},[e]),n}function RK(e){const[t,n]=v.useState(null),r=v.useRef(e),i=v.useCallback(o=>{const l=a0(o.target);l&&n(u=>u?(u.set(l,Tw(l)),new Map(u)):null)},[]);return v.useEffect(()=>{const o=r.current;if(e!==o){l(o);const u=e.map(f=>{const h=a0(f);return h?(h.addEventListener("scroll",i,{passive:!0}),[h,Tw(h)]):null}).filter(f=>f!=null);n(u.length?new Map(u):null),r.current=e}return()=>{l(e),l(o)};function l(u){u.forEach(f=>{const h=a0(f);h==null||h.removeEventListener("scroll",i)})}},[i,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,l)=>qc(o,l),qa):s2(e):qa,[e,t])}function fT(e,t){t===void 0&&(t=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},t),v.useEffect(()=>{const r=e!==qa;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?bp(e,n.current):qa}function kK(e){v.useEffect(()=>{if(!Ab)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function LK(e,t){return v.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=l=>{o(l,t)},n},{}),[e,t])}function d2(e){return v.useMemo(()=>e?oK(e):null,[e])}const hT=[];function IK(e,t){t===void 0&&(t=ju);const[n]=e,r=d2(n?Ir(n):null),[i,o]=v.useState(hT);function l(){o(()=>e.length?e.map(f=>i2(f)?r:new sE(t(f),f)):hT)}const u=jb({callback:l});return pi(()=>{u==null||u.disconnect(),l(),e.forEach(f=>u==null?void 0:u.observe(f))},[e]),i}function zK(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return kf(t)?t:e}function UK(e){let{measure:t}=e;const[n,r]=v.useState(null),i=v.useCallback(h=>{for(const{target:p}of h)if(kf(p)){r(b=>{const g=t(p);return b?{...b,width:g.width,height:g.height}:g});break}},[t]),o=jb({callback:i}),l=v.useCallback(h=>{const p=zK(h);o==null||o.disconnect(),p&&(o==null||o.observe(p)),r(p?t(p):null)},[t,o]),[u,f]=pp(l);return v.useMemo(()=>({nodeRef:u,rect:n,setRef:f}),[n,u,f])}const qK=[{sensor:cE,options:{}},{sensor:c2,options:{}}],BK={current:{}},ep={draggable:{measure:iT},droppable:{measure:iT,strategy:lf.WhileDragging,frequency:_w.Optimized},dragOverlay:{measure:ju}};class ef extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const FK={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ef,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:vp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ep,measureDroppableContainers:vp,windowRect:null,measuringScheduled:!1},$K={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:vp,draggableNodes:new Map,over:null,measureDroppableContainers:vp},Cb=v.createContext($K),f2=v.createContext(FK);function KK(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ef}}}function HK(e,t){switch(t.type){case wn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case wn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case wn.DragEnd:case wn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case wn.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new ef(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case wn.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new ef(e.droppable.containers);return l.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:l}}}case wn.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new ef(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function GK(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=v.useContext(Cb),o=Ow(r),l=Ow(n==null?void 0:n.id);return v.useEffect(()=>{if(!t&&!r&&o&&l!=null){if(!iE(o)||document.activeElement===o.target)return;const u=i.get(l);if(!u)return;const{activatorNode:f,node:h}=u;if(!f.current&&!h.current)return;requestAnimationFrame(()=>{for(const p of[f.current,h.current]){if(!p)continue;const b=k6(p);if(b){b.focus();break}}})}},[r,t,i,l,o]),null}function YK(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function WK(e){return v.useMemo(()=>({draggable:{...ep.draggable,...e==null?void 0:e.draggable},droppable:{...ep.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ep.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function QK(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=v.useRef(!1),{x:l,y:u}=typeof i=="boolean"?{x:i,y:i}:i;pi(()=>{if(!l&&!u||!t){o.current=!1;return}if(o.current||!r)return;const h=t==null?void 0:t.node.current;if(!h||h.isConnected===!1)return;const p=n(h),b=t2(p,r);if(l||(b.x=0),u||(b.y=0),o.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){const g=n2(h);g&&g.scrollBy({top:b.y,left:b.x})}},[t,l,u,r,n])}const h2=v.createContext({...qa,scaleX:1,scaleY:1});var ts;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ts||(ts={}));const VK=v.memo(function(t){var n,r,i,o;let{id:l,accessibility:u,autoScroll:f=!0,children:h,sensors:p=qK,collisionDetection:b=J6,measuring:g,modifiers:x,...E}=t;const S=v.useReducer(HK,void 0,KK),[A,j]=S,[C,O]=B6(),[T,_]=v.useState(ts.Uninitialized),P=T===ts.Initialized,{draggable:{active:D,nodes:L,translate:z},droppable:{containers:R}}=A,q=D!=null?L.get(D):null,U=v.useRef({initial:null,translated:null}),re=v.useMemo(()=>{var Rt;return D!=null?{id:D,data:(Rt=q==null?void 0:q.data)!=null?Rt:BK,rect:U}:null},[D,q]),G=v.useRef(null),[ie,K]=v.useState(null),[Z,$]=v.useState(null),ee=of(E,Object.values(E)),pe=If("DndDescribedBy",l),k=v.useMemo(()=>R.getEnabled(),[R]),Q=WK(g),{droppableRects:ce,measureDroppableContainers:fe,measuringScheduled:xe}=NK(k,{dragging:P,dependencies:[z.x,z.y],config:Q.droppable}),Oe=CK(L,D),qe=v.useMemo(()=>Z?Nw(Z):null,[Z]),Be=Va(),he=TK(Oe,Q.draggable.measure);QK({activeNode:D!=null?L.get(D):null,config:Be.layoutShiftCompensation,initialRect:he,measure:Q.draggable.measure});const ue=uT(Oe,Q.draggable.measure,he),Ee=uT(Oe?Oe.parentElement:null),de=v.useRef({activatorEvent:null,active:null,activeNode:Oe,collisionRect:null,collisions:null,droppableRects:ce,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Le=R.getNodeFor((n=de.current.over)==null?void 0:n.id),Me=UK({measure:Q.dragOverlay.measure}),Ie=(r=Me.nodeRef.current)!=null?r:Oe,ut=P?(i=Me.rect)!=null?i:ue:null,Un=!!(Me.nodeRef.current&&Me.rect),qn=DK(Un?null:ue),Ya=d2(Ie?Ir(Ie):null),Xn=MK(P?Le??Oe:null),ja=IK(Xn),Oi=YK(x,{transform:{x:z.x-qn.x,y:z.y-qn.y,scaleX:1,scaleY:1},activatorEvent:Z,active:re,activeNodeRect:ue,containerNodeRect:Ee,draggingNodeRect:ut,over:de.current.over,overlayNodeRect:Me.rect,scrollableAncestors:Xn,scrollableAncestorRects:ja,windowRect:Ya}),zr=qe?qc(qe,z):null,Kt=RK(Xn),Ca=fT(Kt),Eo=fT(Kt,[ue]),Ur=qc(Oi,Ca),Cn=ut?nK(ut,Oi):null,ia=re&&Cn?b({active:re,collisionRect:Cn,droppableRects:ce,droppableContainers:k,pointerCoordinates:zr}):null,Wa=V6(ia,"id"),[qr,Ts]=v.useState(null),Qa=Un?Oi:qc(Oi,Eo),bn=eK(Qa,(o=qr==null?void 0:qr.rect)!=null?o:null,ue),Zn=v.useRef(null),zt=v.useCallback((Rt,At)=>{let{sensor:Ut,options:Ot}=At;if(G.current==null)return;const en=L.get(G.current);if(!en)return;const sn=Rt.nativeEvent,On=new Ut({active:G.current,activeNode:en,event:sn,options:Ot,context:de,onAbort(qt){if(!L.get(qt))return;const{onDragAbort:ur}=ee.current,Nn={id:qt};ur==null||ur(Nn),C({type:"onDragAbort",event:Nn})},onPending(qt,cr,ur,Nn){if(!L.get(qt))return;const{onDragPending:Na}=ee.current,nt={id:qt,constraint:cr,initialCoordinates:ur,offset:Nn};Na==null||Na(nt),C({type:"onDragPending",event:nt})},onStart(qt){const cr=G.current;if(cr==null)return;const ur=L.get(cr);if(!ur)return;const{onDragStart:Nn}=ee.current,Oa={activatorEvent:sn,active:{id:cr,data:ur.data,rect:U}};Vn.unstable_batchedUpdates(()=>{Nn==null||Nn(Oa),_(ts.Initializing),j({type:wn.DragStart,initialCoordinates:qt,active:cr}),C({type:"onDragStart",event:Oa}),K(Zn.current),$(sn)})},onMove(qt){j({type:wn.DragMove,coordinates:qt})},onEnd:Er(wn.DragEnd),onCancel:Er(wn.DragCancel)});Zn.current=On;function Er(qt){return async function(){const{active:ur,collisions:Nn,over:Oa,scrollAdjustedTranslate:Na}=de.current;let nt=null;if(ur&&Na){const{cancelDrop:dr}=ee.current;nt={activatorEvent:sn,active:ur,collisions:Nn,delta:Na,over:Oa},qt===wn.DragEnd&&typeof dr=="function"&&await Promise.resolve(dr(nt))&&(qt=wn.DragCancel)}G.current=null,Vn.unstable_batchedUpdates(()=>{j({type:qt}),_(ts.Uninitialized),Ts(null),K(null),$(null),Zn.current=null;const dr=qt===wn.DragEnd?"onDragEnd":"onDragCancel";if(nt){const Ar=ee.current[dr];Ar==null||Ar(nt),C({type:dr,event:nt})}})}}},[L]),Sr=v.useCallback((Rt,At)=>(Ut,Ot)=>{const en=Ut.nativeEvent,sn=L.get(Ot);if(G.current!==null||!sn||en.dndKit||en.defaultPrevented)return;const On={active:sn};Rt(Ut,At.options,On)===!0&&(en.dndKit={capturedBy:At.sensor},G.current=Ot,zt(Ut,At))},[L,zt]),Ao=OK(p,Sr);kK(p),pi(()=>{ue&&T===ts.Initializing&&_(ts.Initialized)},[ue,T]),v.useEffect(()=>{const{onDragMove:Rt}=ee.current,{active:At,activatorEvent:Ut,collisions:Ot,over:en}=de.current;if(!At||!Ut)return;const sn={active:At,activatorEvent:Ut,collisions:Ot,delta:{x:Ur.x,y:Ur.y},over:en};Vn.unstable_batchedUpdates(()=>{Rt==null||Rt(sn),C({type:"onDragMove",event:sn})})},[Ur.x,Ur.y]),v.useEffect(()=>{const{active:Rt,activatorEvent:At,collisions:Ut,droppableContainers:Ot,scrollAdjustedTranslate:en}=de.current;if(!Rt||G.current==null||!At||!en)return;const{onDragOver:sn}=ee.current,On=Ot.get(Wa),Er=On&&On.rect.current?{id:On.id,rect:On.rect.current,data:On.data,disabled:On.disabled}:null,qt={active:Rt,activatorEvent:At,collisions:Ut,delta:{x:en.x,y:en.y},over:Er};Vn.unstable_batchedUpdates(()=>{Ts(Er),sn==null||sn(qt),C({type:"onDragOver",event:qt})})},[Wa]),pi(()=>{de.current={activatorEvent:Z,active:re,activeNode:Oe,collisionRect:Cn,collisions:ia,droppableRects:ce,draggableNodes:L,draggingNode:Ie,draggingNodeRect:ut,droppableContainers:R,over:qr,scrollableAncestors:Xn,scrollAdjustedTranslate:Ur},U.current={initial:ut,translated:Cn}},[re,Oe,ia,Cn,L,Ie,ut,ce,R,qr,Xn,Ur]),EK({...Be,delta:z,draggingRect:Cn,pointerCoordinates:zr,scrollableAncestors:Xn,scrollableAncestorRects:ja});const Il=v.useMemo(()=>({active:re,activeNode:Oe,activeNodeRect:ue,activatorEvent:Z,collisions:ia,containerNodeRect:Ee,dragOverlay:Me,draggableNodes:L,droppableContainers:R,droppableRects:ce,over:qr,measureDroppableContainers:fe,scrollableAncestors:Xn,scrollableAncestorRects:ja,measuringConfiguration:Q,measuringScheduled:xe,windowRect:Ya}),[re,Oe,ue,Z,ia,Ee,Me,L,R,ce,qr,fe,Xn,ja,Q,xe,Ya]),Ni=v.useMemo(()=>({activatorEvent:Z,activators:Ao,active:re,activeNodeRect:ue,ariaDescribedById:{draggable:pe},dispatch:j,draggableNodes:L,over:qr,measureDroppableContainers:fe}),[Z,Ao,re,ue,j,pe,L,qr,fe]);return Zt.createElement(e2.Provider,{value:O},Zt.createElement(Cb.Provider,{value:Ni},Zt.createElement(f2.Provider,{value:Il},Zt.createElement(h2.Provider,{value:bn},h)),Zt.createElement(GK,{disabled:(u==null?void 0:u.restoreFocus)===!1})),Zt.createElement(K6,{...u,hiddenTextDescribedById:pe}));function Va(){const Rt=(ie==null?void 0:ie.autoScrollEnabled)===!1,At=typeof f=="object"?f.enabled===!1:f===!1,Ut=P&&!Rt&&!At;return typeof f=="object"?{...f,enabled:Ut}:{enabled:Ut}}}),XK=v.createContext(null),mT="button",ZK="Draggable";function JK(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=If(ZK),{activators:l,activatorEvent:u,active:f,activeNodeRect:h,ariaDescribedById:p,draggableNodes:b,over:g}=v.useContext(Cb),{role:x=mT,roleDescription:E="draggable",tabIndex:S=0}=i??{},A=(f==null?void 0:f.id)===t,j=v.useContext(A?h2:XK),[C,O]=pp(),[T,_]=pp(),P=LK(l,t),D=of(n);pi(()=>(b.set(t,{id:t,key:o,node:C,activatorNode:T,data:D}),()=>{const z=b.get(t);z&&z.key===o&&b.delete(t)}),[b,t]);const L=v.useMemo(()=>({role:x,tabIndex:S,"aria-disabled":r,"aria-pressed":A&&x===mT?!0:void 0,"aria-roledescription":E,"aria-describedby":p.draggable}),[r,x,S,A,E,p.draggable]);return{active:f,activatorEvent:u,activeNodeRect:h,attributes:L,isDragging:A,listeners:r?void 0:P,node:C,over:g,setNodeRef:O,setActivatorNodeRef:_,transform:j}}function e8(){return v.useContext(f2)}const t8="Droppable",n8={timeout:25};function r8(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=If(t8),{active:l,dispatch:u,over:f,measureDroppableContainers:h}=v.useContext(Cb),p=v.useRef({disabled:n}),b=v.useRef(!1),g=v.useRef(null),x=v.useRef(null),{disabled:E,updateMeasurementsFor:S,timeout:A}={...n8,...i},j=of(S??r),C=v.useCallback(()=>{if(!b.current){b.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{h(Array.isArray(j.current)?j.current:[j.current]),x.current=null},A)},[A]),O=jb({callback:C,disabled:E||!l}),T=v.useCallback((L,z)=>{O&&(z&&(O.unobserve(z),b.current=!1),L&&O.observe(L))},[O]),[_,P]=pp(T),D=of(t);return v.useEffect(()=>{!O||!_.current||(O.disconnect(),b.current=!1,O.observe(_.current))},[_,O]),v.useEffect(()=>(u({type:wn.RegisterDroppable,element:{id:r,key:o,disabled:n,node:_,rect:g,data:D}}),()=>u({type:wn.UnregisterDroppable,key:o,id:r})),[r]),v.useEffect(()=>{n!==p.current.disabled&&(u({type:wn.SetDroppableDisabled,id:r,key:o,disabled:n}),p.current.disabled=n)},[r,o,n,u]),{active:l,rect:g,isOver:(f==null?void 0:f.id)===r,node:_,over:f,setNodeRef:P}}function uE(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function a8(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Cm(e){return e!==null&&e>=0}function i8(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function o8(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const m2=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=uE(t,r,n),l=t[i],u=o[i];return!u||!l?null:{x:u.left-l.left,y:u.top-l.top,scaleX:u.width/l.width,scaleY:u.height/l.height}},Om={scaleX:1,scaleY:1},s8=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:o,overIndex:l}=e;const u=(t=o[n])!=null?t:r;if(!u)return null;if(i===n){const h=o[l];return h?{x:0,y:n<l?h.top+h.height-(u.top+u.height):h.top-u.top,...Om}:null}const f=l8(o,i,n);return i>n&&i<=l?{x:0,y:-u.height-f,...Om}:i<n&&i>=l?{x:0,y:u.height+f,...Om}:{x:0,y:0,...Om}};function l8(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r?n<t?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const p2="Sortable",b2=Zt.createContext({activeIndex:-1,containerId:p2,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:m2,disabled:{draggable:!1,droppable:!1}});function c8(e){let{children:t,id:n,items:r,strategy:i=m2,disabled:o=!1}=e;const{active:l,dragOverlay:u,droppableRects:f,over:h,measureDroppableContainers:p}=e8(),b=If(p2,n),g=u.rect!==null,x=v.useMemo(()=>r.map(P=>typeof P=="object"&&"id"in P?P.id:P),[r]),E=l!=null,S=l?x.indexOf(l.id):-1,A=h?x.indexOf(h.id):-1,j=v.useRef(x),C=!i8(x,j.current),O=A!==-1&&S===-1||C,T=o8(o);pi(()=>{C&&E&&p(x)},[C,x,E,p]),v.useEffect(()=>{j.current=x},[x]);const _=v.useMemo(()=>({activeIndex:S,containerId:b,disabled:T,disableTransforms:O,items:x,overIndex:A,useDragOverlay:g,sortedRects:a8(x,f),strategy:i}),[S,b,T.draggable,T.droppable,O,x,A,f,g,i]);return Zt.createElement(b2.Provider,{value:_},t)}const u8=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return uE(n,r,i).indexOf(t)},d8=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:l,previousItems:u,previousContainerId:f,transition:h}=e;return!h||!r||u!==o&&i===l?!1:n?!0:l!==i&&t===f},f8={duration:200,easing:"ease"},v2="transform",h8=sf.Transition.toString({property:v2,duration:0,easing:"linear"}),m8={roleDescription:"sortable"};function p8(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,l]=v.useState(null),u=v.useRef(n);return pi(()=>{if(!t&&n!==u.current&&r.current){const f=i.current;if(f){const h=ju(r.current,{ignoreTransform:!0}),p={x:f.left-h.left,y:f.top-h.top,scaleX:f.width/h.width,scaleY:f.height/h.height};(p.x||p.y)&&l(p)}}n!==u.current&&(u.current=n)},[t,n,r,i]),v.useEffect(()=>{o&&l(null)},[o]),o}function b8(e){let{animateLayoutChanges:t=d8,attributes:n,disabled:r,data:i,getNewIndex:o=u8,id:l,strategy:u,resizeObserverConfig:f,transition:h=f8}=e;const{items:p,containerId:b,activeIndex:g,disabled:x,disableTransforms:E,sortedRects:S,overIndex:A,useDragOverlay:j,strategy:C}=v.useContext(b2),O=v8(r,x),T=p.indexOf(l),_=v.useMemo(()=>({sortable:{containerId:b,index:T,items:p},...i}),[b,i,T,p]),P=v.useMemo(()=>p.slice(p.indexOf(l)),[p,l]),{rect:D,node:L,isOver:z,setNodeRef:R}=r8({id:l,data:_,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...f}}),{active:q,activatorEvent:U,activeNodeRect:re,attributes:G,setNodeRef:ie,listeners:K,isDragging:Z,over:$,setActivatorNodeRef:ee,transform:pe}=JK({id:l,data:_,attributes:{...m8,...n},disabled:O.draggable}),k=_6(R,ie),Q=!!q,ce=Q&&!E&&Cm(g)&&Cm(A),fe=!j&&Z,xe=fe&&ce?pe:null,qe=ce?xe??(u??C)({rects:S,activeNodeRect:re,activeIndex:g,overIndex:A,index:T}):null,Be=Cm(g)&&Cm(A)?o({id:l,items:p,activeIndex:g,overIndex:A}):T,he=q==null?void 0:q.id,ue=v.useRef({activeId:he,items:p,newIndex:Be,containerId:b}),Ee=p!==ue.current.items,de=t({active:q,containerId:b,isDragging:Z,isSorting:Q,id:l,index:T,items:p,newIndex:ue.current.newIndex,previousItems:ue.current.items,previousContainerId:ue.current.containerId,transition:h,wasDragging:ue.current.activeId!=null}),Le=p8({disabled:!de,index:T,node:L,rect:D});return v.useEffect(()=>{Q&&ue.current.newIndex!==Be&&(ue.current.newIndex=Be),b!==ue.current.containerId&&(ue.current.containerId=b),p!==ue.current.items&&(ue.current.items=p)},[Q,Be,b,p]),v.useEffect(()=>{if(he===ue.current.activeId)return;if(he!=null&&ue.current.activeId==null){ue.current.activeId=he;return}const Ie=setTimeout(()=>{ue.current.activeId=he},50);return()=>clearTimeout(Ie)},[he]),{active:q,activeIndex:g,attributes:G,data:_,rect:D,index:T,newIndex:Be,items:p,isOver:z,isSorting:Q,isDragging:Z,listeners:K,node:L,overIndex:A,over:$,setNodeRef:k,setActivatorNodeRef:ee,setDroppableNodeRef:R,setDraggableNodeRef:ie,transform:Le??qe,transition:Me()};function Me(){if(Le||Ee&&ue.current.newIndex===T)return h8;if(!(fe&&!iE(U)||!h)&&(Q||de))return sf.Transition.toString({...h,property:v2})}}function v8(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}ct.Down,ct.Right,ct.Up,ct.Left;function g8(){return d.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor","aria-hidden":!0,children:[d.jsx("circle",{cx:"9",cy:"6",r:"1.5"}),d.jsx("circle",{cx:"15",cy:"6",r:"1.5"}),d.jsx("circle",{cx:"9",cy:"12",r:"1.5"}),d.jsx("circle",{cx:"15",cy:"12",r:"1.5"}),d.jsx("circle",{cx:"9",cy:"18",r:"1.5"}),d.jsx("circle",{cx:"15",cy:"18",r:"1.5"})]})}function y8(){return d.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":!0,children:d.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1.5 14a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2L5 6"})})}function x8({id:e,chip:t,onChange:n,onRemove:r}){const{attributes:i,listeners:o,setNodeRef:l,transform:u,transition:f,isDragging:h}=b8({id:e}),p={transform:sf.Transform.toString(u),transition:f,opacity:h?.5:1};return d.jsxs("li",{ref:l,style:p,className:"bb-chip-row",children:[d.jsx("button",{type:"button",className:"bb-chip-handle",...i,...o,"aria-label":"Drag to reorder",children:d.jsx(g8,{})}),d.jsx("input",{className:"bb-input bb-chip-label",value:t.label,onChange:b=>n({...t,label:b.target.value}),placeholder:"Button label","aria-label":"Chip label"}),d.jsx("input",{className:"bb-input bb-chip-message",value:t.message,onChange:b=>n({...t,message:b.target.value}),placeholder:"Message sent when clicked","aria-label":"Chip message"}),d.jsx("button",{type:"button",className:"bb-chip-remove",onClick:r,"aria-label":"Remove chip",children:d.jsx(y8,{})})]})}function w8({chips:e,onChange:t,maxChips:n=6}){const r=G6(H6(cE,{activationConstraint:{distance:4}})),i=h=>{const{active:p,over:b}=h;if(!b||p.id===b.id)return;const g=Number(p.id),x=Number(b.id);t(uE(e,g,x))},o=(h,p)=>{const b=[...e];b[h]=p,t(b)},l=h=>t(e.filter((p,b)=>b!==h)),u=()=>t([...e,{label:"",message:""}]),f=e.map((h,p)=>String(p));return d.jsxs("div",{className:"bb-chips",children:[d.jsx(VK,{sensors:r,collisionDetection:X6,onDragEnd:i,children:d.jsx(c8,{items:f,strategy:s8,children:d.jsx("ul",{className:"bb-chip-list",children:e.map((h,p)=>d.jsx(x8,{id:String(p),chip:h,onChange:b=>o(p,b),onRemove:()=>l(p)},p))})})}),e.length<n&&d.jsx("button",{type:"button",className:"bb-chip-add",onClick:u,children:"+ Add chip"}),d.jsx("p",{className:"bb-field-help",children:"Drag to reorder. Sites with 3+ starter chips get 2.4× more conversations."})]})}function ka({label:e,help:t,htmlFor:n,children:r}){return d.jsxs("div",{className:"bb-field",children:[d.jsx("label",{className:"bb-field-label",htmlFor:n,children:e}),r,t&&d.jsx("p",{className:"bb-field-help",children:t})]})}const S8="png,jpg,jpeg,gif,webp";function E8({label:e="Choose from Media Library",accept:t="image",onSelect:n,className:r}){const i=()=>{var l;if(typeof window>"u"||!((l=window.wp)!=null&&l.media)){alert("WP Media Library isn't available on this page. Paste the URL directly into the field instead.");return}const o=window.wp.media({title:e,button:{text:"Use this file"},library:{type:t},multiple:!1});o.on("uploader:ready",()=>{var f,h;const u=(h=(f=o.uploader)==null?void 0:f.uploader)==null?void 0:h.uploader;u&&(u.settings.filters&&(u.settings.filters.mime_types=[{title:"Images",extensions:S8}]),u.bind("FilesAdded",(p,b)=>{const g=[];for(const x of b){const E=(x.type??"").toLowerCase();(!E.startsWith("image/")||E==="image/svg+xml")&&(g.push(x),p.removeFile(x))}if(g.length){const x=g.map(E=>E.name).join(", ");le.error(g.length===1?`"${x}" isn't an image — only PNG, JPG, GIF, and WebP are allowed.`:`${g.length} files skipped — only PNG, JPG, GIF, and WebP are allowed.`)}}))}),o.on("select",()=>{const u=o.state().get("selection").first().toJSON();if(!(u!=null&&u.url))return;const f=Array.isArray(t)?t:[t],h=(u.mime??"").toLowerCase(),p=(u.type??h.split("/")[0]??"").toLowerCase();if(!f.some(g=>g===p||h.startsWith(`${g}/`))){le.error(`That file is a ${p||"non-image file"} — please choose an image (PNG, JPG, GIF, WebP).`);return}n(u.url,u)}),o.open()};return d.jsx("button",{type:"button",className:r??"bb-btn bb-btn-ghost bb-btn-small",onClick:i,children:"Upload"})}const yc={widgetTitle:30,welcomeMessage:240,placeholderText:50};function s0({value:e,max:t}){const n=(e??"").length,r=n>t,i=!r&&n>=t-Math.max(5,Math.round(t*.1));return d.jsxs("span",{className:`bb-field-counter ${r?"bb-field-counter-over":i?"bb-field-counter-near":""}`,"aria-live":"polite",children:[n," / ",t]})}const A8=["#E84F2A","#0073AA","#16A34A","#9333EA","#0F1419"];function j8({settings:e,save:t,onAdjustCrop:n,onUploaded:r}){const i=Eb(e.avatarTransform);return d.jsxs(Lr,{eyebrow:"Step 01",title:"Branding",children:[d.jsxs(ka,{label:"Widget title",help:"Shown in the chat header. Visitors see this before sending a message.",children:[d.jsx("input",{className:"bb-input",value:e.widgetTitle,maxLength:yc.widgetTitle,onChange:o=>t({widgetTitle:o.target.value}),placeholder:"Chat with us"}),d.jsx(s0,{value:e.widgetTitle,max:yc.widgetTitle})]}),d.jsxs(ka,{label:"Welcome message",help:"First message visitors see when they open the chat.",children:[d.jsx("textarea",{className:"bb-input bb-textarea",rows:2,value:e.welcomeMessage,maxLength:yc.welcomeMessage,onChange:o=>t({welcomeMessage:o.target.value}),placeholder:"Hi! How can I help you today?"}),d.jsx(s0,{value:e.welcomeMessage,max:yc.welcomeMessage})]}),d.jsxs(ka,{label:"Input placeholder",help:"Greyed-out hint inside the message box.",children:[d.jsx("input",{className:"bb-input",value:e.placeholderText,maxLength:yc.placeholderText,onChange:o=>t({placeholderText:o.target.value}),placeholder:"Type your message…"}),d.jsx(s0,{value:e.placeholderText,max:yc.placeholderText})]}),d.jsx(ka,{label:"Primary colour",help:"Button background, accent, and link colour.",children:d.jsxs("div",{className:"bb-color-picker",children:[A8.map(o=>d.jsx("button",{type:"button",className:`bb-color-swatch ${e.primaryColor.toLowerCase()===o.toLowerCase()?"bb-color-swatch-active":""}`,style:{background:o},onClick:()=>t({primaryColor:o}),"aria-label":`Use ${o}`},o)),d.jsx("input",{className:"bb-input bb-color-hex",value:e.primaryColor,onChange:o=>t({primaryColor:o.target.value}),placeholder:"#0073aa","aria-label":"Custom hex"})]})}),d.jsx(ka,{label:"Avatar",help:"PNG, JPG, GIF, or WebP. Drag and zoom to frame after upload.",children:d.jsxs("div",{className:"bb-avatar-row",children:[e.avatarUrl&&(()=>{const o=tE(i,"rounded",36,36);return d.jsx("div",{className:"bb-avatar-thumb-wrap",children:o?d.jsx("div",{className:"bb-avatar-thumb",style:{backgroundImage:`url(${e.avatarUrl})`,backgroundSize:o.backgroundSize,backgroundPosition:o.backgroundPosition,backgroundRepeat:"no-repeat"}}):d.jsx("img",{src:e.avatarUrl,alt:"",className:"bb-avatar-thumb",onError:l=>{l.target.style.display="none"}})})})(),d.jsx("input",{className:"bb-input",value:e.avatarUrl,onChange:o=>{t({avatarUrl:o.target.value}),i&&t({avatarTransform:""})},placeholder:"https://your-site.com/avatar.png"}),d.jsx(E8,{label:"Choose an avatar",accept:"image",onSelect:o=>{t({avatarUrl:o,avatarTransform:""}),r==null||r(o)}}),e.avatarUrl&&d.jsx("button",{type:"button",className:"bb-link-btn bb-avatar-adjust",onClick:()=>n==null?void 0:n(),title:"Adjust how the avatar is framed",children:"Adjust crop"}),e.avatarUrl&&d.jsx("button",{type:"button",className:"bb-link-btn bb-avatar-clear",onClick:()=>t({avatarUrl:"",avatarTransform:""}),title:"Clear avatar",children:"Clear"})]})})]})}function C8({settings:e,save:t}){return d.jsx(Lr,{eyebrow:"Step 02",title:"Conversation",children:d.jsx(ka,{label:"Suggested questions",help:"",children:d.jsx(w8,{chips:[...e.suggestedQuestions],onChange:n=>t({suggestedQuestions:n})})})})}const O8=[{key:"rounded",label:"Rounded"},{key:"pill",label:"Pill"}];function N8({settings:e,save:t,onAdjustCrop:n}){return d.jsxs(Lr,{eyebrow:"Step 03",title:"Appearance",children:[d.jsx(ka,{label:"FAB shape",help:"The shape of the floating chat button. Drag the slider below to dial roundness; pick Pill for an elongated launcher.",children:d.jsxs("div",{className:"bb-shape-row",children:[d.jsx("div",{className:"bb-segmented",children:O8.map(r=>d.jsx("button",{type:"button",className:`bb-seg ${e.widgetShape===r.key?"bb-seg-active":""}`,onClick:()=>t({widgetShape:r.key}),children:r.label},r.key))}),e.avatarUrl&&d.jsx("button",{type:"button",className:"bb-link-btn bb-avatar-adjust",onClick:()=>n==null?void 0:n(),title:"Adjust how the avatar is framed",children:"Adjust crop"})]})}),d.jsx(ka,{label:`Launcher corner radius — ${e.cornerRadius}px`,help:"Corner radius of the FAB launcher. 0 for sharp, 32 for fully rounded. The chat panel keeps a fixed soft edge.",children:d.jsx("input",{type:"range",min:0,max:32,value:e.cornerRadius,onChange:r=>t({cornerRadius:Number(r.target.value)}),className:"bb-slider"})}),d.jsx(ka,{label:"Position",help:"Where the chat bubble sits on the page.",children:d.jsxs("div",{className:"bb-segmented",children:[d.jsx("button",{type:"button",className:`bb-seg ${e.widgetPosition==="bottom-left"?"bb-seg-active":""}`,onClick:()=>t({widgetPosition:"bottom-left"}),children:"Bottom left"}),d.jsx("button",{type:"button",className:`bb-seg ${e.widgetPosition==="bottom-right"?"bb-seg-active":""}`,onClick:()=>t({widgetPosition:"bottom-right"}),children:"Bottom right"})]})}),d.jsx(ka,{label:"Offset from edge",help:"Distance from the corner — bump up if another floating widget is in the way.",children:d.jsxs("div",{className:"bb-offset-row",children:[d.jsxs("label",{className:"bb-offset-field",children:[d.jsx("span",{children:"X (horizontal)"}),d.jsx("input",{type:"number",className:"bb-input bb-input-num",min:0,max:200,step:2,value:e.widgetOffsetX,onChange:r=>t({widgetOffsetX:Math.max(0,Number(r.target.value))})}),d.jsx("span",{className:"bb-offset-unit",children:"px"})]}),d.jsxs("label",{className:"bb-offset-field",children:[d.jsx("span",{children:"Y (vertical)"}),d.jsx("input",{type:"number",className:"bb-input bb-input-num",min:0,max:200,step:2,value:e.widgetOffsetY,onChange:r=>t({widgetOffsetY:Math.max(0,Number(r.target.value))})}),d.jsx("span",{className:"bb-offset-unit",children:"px"})]}),d.jsx("button",{type:"button",className:"bb-link-btn bb-offset-reset",onClick:()=>t({widgetOffsetX:20,widgetOffsetY:20}),title:"Reset to default 20px / 20px",children:"Reset"})]})}),d.jsx(ka,{label:"Nudge / proactive prompt",help:"Show a callout bubble after N seconds of inactivity.",children:d.jsx(_8,{value:e.nudge,onChange:r=>t({nudge:r})})})]})}function T8(e){if(!e)return null;try{const t=JSON.parse(e);return typeof t=="object"&&t!==null?t:null}catch{return null}}function P8(e){const t=T8(e);return{enabled:!!(t!=null&&t.enabled),delaySeconds:Number((t==null?void 0:t.delaySeconds)??(t==null?void 0:t.delay)??8),message:String((t==null?void 0:t.message)??(t==null?void 0:t.simpleText)??"")}}function _8({value:e,onChange:t}){const n=P8(e),r=i=>{const o={...n,...i};t(JSON.stringify(o))};return d.jsxs("div",{className:"bb-json-editor",children:[d.jsxs("label",{className:"bb-toggle-row",children:[d.jsx("input",{type:"checkbox",checked:n.enabled,onChange:i=>r({enabled:i.target.checked})}),d.jsx("span",{children:"Enabled"})]}),d.jsxs("div",{className:"bb-json-editor-grid",children:[d.jsxs("label",{className:"bb-json-editor-field",children:[d.jsx("span",{children:"After"}),d.jsx("input",{type:"number",className:"bb-input bb-input-num",min:1,max:60,value:n.delaySeconds,onChange:i=>r({delaySeconds:Math.max(1,Number(i.target.value))})}),d.jsx("span",{children:"seconds of inactivity"})]}),d.jsxs("label",{className:"bb-json-editor-field bb-json-editor-field-wide",children:[d.jsx("span",{children:"Show this message"}),d.jsx("input",{type:"text",className:"bb-input",value:n.message,onChange:i=>r({message:i.target.value}),placeholder:"Need a hand? I'm here to help."})]})]})]})}const g2=new Set(["look","behaviour"]),D8="look";function pT(){const t=new URL(window.location.href).searchParams.get("sub");return t&&g2.has(t)?t:D8}const l0="bb:sub-change";function y2(){const[e,t]=v.useState(pT);v.useEffect(()=>{const r=()=>t(pT());return window.addEventListener("popstate",r),window.addEventListener(l0,r),()=>{window.removeEventListener("popstate",r),window.removeEventListener(l0,r)}},[]);const n=v.useCallback(r=>{if(!g2.has(r))return;const i=new URL(window.location.href);i.searchParams.get("sub")!==r&&(i.searchParams.set("sub",r),window.history.pushState({},"",i),t(r),window.dispatchEvent(new Event(l0)))},[]);return[e,n]}const c0=[{key:"look",label:"Look & feel",aside:"Changes save as you type"},{key:"behaviour",label:"Behaviour",aside:"How the bot speaks and what it avoids"}];function M8(){const{settings:e,isLoading:t,save:n,isSaving:r,lastSavedAt:i}=ZS(),[o,l]=y2(),[u,f]=v.useState(null);if(t||!e)return d.jsx("div",{className:"bb-skeleton",style:{height:480,marginTop:24,borderRadius:12}});const h=()=>e.avatarUrl&&f(e.avatarUrl),p=c0.find(b=>b.key===o)??c0[0];return d.jsxs(d.Fragment,{children:[d.jsx(k8,{}),d.jsx("nav",{className:"bb-subtab-strip",role:"tablist","aria-label":"Chatbot sub-sections",children:c0.map(b=>d.jsx("button",{role:"tab","aria-selected":o===b.key,className:`bb-subtab ${o===b.key?"bb-subtab-active":""}`,onClick:()=>l(b.key),children:b.label},b.key))}),d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:p.label}),d.jsx(I8,{isSaving:r,lastSavedAt:i,idleCopy:p.aside??null})]}),o==="look"&&d.jsxs("div",{className:"bb-chatbot-grid",children:[d.jsxs("div",{className:"bb-chatbot-main",children:[d.jsx(j8,{settings:e,save:n,onAdjustCrop:h,onUploaded:b=>f(b)}),d.jsx(C8,{settings:e,save:n}),d.jsx(N8,{settings:e,save:n,onAdjustCrop:h})]}),d.jsx("aside",{className:"bb-chatbot-aside",children:d.jsx(P6,{settings:e})})]}),o==="behaviour"&&d.jsx(R8,{settings:e,save:n,isSaving:r}),u&&d.jsx(O6,{imageUrl:u,fabShape:e.widgetShape==="pill"?"pill":"rounded",initial:Eb(e.avatarTransform),onCancel:()=>f(null),onSave:b=>{n({avatarTransform:JSON.stringify(b)}),f(null)}})]})}function R8({settings:e,save:t,isSaving:n}){const r=(e.customInstructions??"").trim().length>0,i=(e.offTopicGuardrails??"").trim().length>0,o=r&&i;return d.jsxs("div",{className:"bb-subpane",children:[d.jsx(L8,{ok:o,okText:"Bot voice and guardrails are set.",nudgeText:!r&&!i?"Add a style note and topics to avoid for safer, on-brand replies.":r?"List topics the bot should refuse for safer replies.":"Add a style note so every reply sounds like you."}),d.jsx(u0,{title:"Bot voice",help:"A short style note that shapes every reply.",value:e.customInstructions??"",placeholder:"be friendly, lean concise, always recommend booking a demo for pricing questions",onSave:l=>t({customInstructions:l}),isSaving:n,saveLabel:"instructions"}),d.jsx(u0,{title:"Off-topic guardrails",help:"Topics the bot must refuse. One per line.",value:e.offTopicGuardrails??"",placeholder:`competitor product comparisons148 `},K6={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function H6(e){let{announcements:t=K6,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=$6}=e;const{announce:o,announcement:l}=q6(),u=If("DndLiveRegion"),[f,h]=v.useState(!1);if(v.useEffect(()=>{h(!0)},[]),B6(v.useMemo(()=>({onDragStart(b){let{active:g}=b;o(t.onDragStart({active:g}))},onDragMove(b){let{active:g,over:x}=b;t.onDragMove&&o(t.onDragMove({active:g,over:x}))},onDragOver(b){let{active:g,over:x}=b;o(t.onDragOver({active:g,over:x}))},onDragEnd(b){let{active:g,over:x}=b;o(t.onDragEnd({active:g,over:x}))},onDragCancel(b){let{active:g,over:x}=b;o(t.onDragCancel({active:g,over:x}))}}),[o,t])),!f)return null;const p=Zt.createElement(Zt.Fragment,null,Zt.createElement(z6,{id:r,value:i.draggable}),Zt.createElement(U6,{id:u,announcement:l}));return n?Vn.createPortal(p,n):p}var wn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(wn||(wn={}));function vp(){}function G6(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Y6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const qa=Object.freeze({x:0,y:0});function W6(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Q6(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function V6(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function X6(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function aT(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Z6=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=aT(t,t.left,t.top),o=[];for(const l of r){const{id:u}=l,f=n.get(u);if(f){const h=W6(aT(f),i);o.push({id:u,data:{droppableContainer:l,value:h}})}}return o.sort(Q6)};function J6(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),l=i-r,u=o-n;if(r<i&&n<o){const f=t.width*t.height,h=e.width*e.height,p=l*u,b=p/(f+h-p);return Number(b.toFixed(4))}return 0}const eK=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:l}=o,u=n.get(l);if(u){const f=J6(u,t);f>0&&i.push({id:l,data:{droppableContainer:o,value:f}})}}return i.sort(V6)};function tK(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function n2(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:qa}function nK(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((l,u)=>({...l,top:l.top+e*u.y,bottom:l.bottom+e*u.y,left:l.left+e*u.x,right:l.right+e*u.x}),{...n})}}const rK=nK(1);function aK(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function iK(e,t,n){const r=aK(t);if(!r)return e;const{scaleX:i,scaleY:o,x:l,y:u}=r,f=e.left-l-(1-i)*parseFloat(n),h=e.top-u-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),p=i?e.width/i:e.width,b=o?e.height/o:e.height;return{width:p,height:b,top:h,right:f+p,bottom:h+b,left:f}}const oK={ignoreTransform:!1};function Cu(e,t){t===void 0&&(t=oK);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:p}=Ir(e).getComputedStyle(e);h&&(n=iK(n,h,p))}const{top:r,left:i,width:o,height:l,bottom:u,right:f}=n;return{top:r,left:i,width:o,height:l,bottom:u,right:f}}function iT(e){return Cu(e,{ignoreTransform:!0})}function sK(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function lK(e,t){return t===void 0&&(t=Ir(e).getComputedStyle(e)),t.position==="fixed"}function cK(e,t){t===void 0&&(t=Ir(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function oE(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(rE(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!kf(i)||Jk(i)||n.includes(i))return n;const o=Ir(e).getComputedStyle(i);return i!==e&&cK(i,o)&&n.push(i),lK(i,o)?n:r(i.parentNode)}return e?r(e):n}function r2(e){const[t]=oE(e,1);return t??null}function a0(e){return!Ab||!e?null:Au(e)?e:nE(e)?rE(e)||e===ju(e).scrollingElement?window:kf(e)?e:null:null}function a2(e){return Au(e)?e.scrollX:e.scrollLeft}function i2(e){return Au(e)?e.scrollY:e.scrollTop}function Tw(e){return{x:a2(e),y:i2(e)}}var Mn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Mn||(Mn={}));function o2(e){return!Ab||!e?!1:e===document.scrollingElement}function s2(e){const t={x:0,y:0},n=o2(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:l,isRight:u,maxScroll:r,minScroll:t}}const uK={x:.2,y:.2};function dK(e,t,n,r,i){let{top:o,left:l,right:u,bottom:f}=n;r===void 0&&(r=10),i===void 0&&(i=uK);const{isTop:h,isBottom:p,isLeft:b,isRight:g}=s2(e),x={x:0,y:0},E={x:0,y:0},S={height:t.height*i.y,width:t.width*i.x};return!h&&o<=t.top+S.height?(x.y=Mn.Backward,E.y=r*Math.abs((t.top+S.height-o)/S.height)):!p&&f>=t.bottom-S.height&&(x.y=Mn.Forward,E.y=r*Math.abs((t.bottom-S.height-f)/S.height)),!g&&u>=t.right-S.width?(x.x=Mn.Forward,E.x=r*Math.abs((t.right-S.width-u)/S.width)):!b&&l<=t.left+S.width&&(x.x=Mn.Backward,E.x=r*Math.abs((t.left+S.width-l)/S.width)),{direction:x,speed:E}}function fK(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:l}=window;return{top:0,left:0,right:o,bottom:l,width:o,height:l}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function l2(e){return e.reduce((t,n)=>qc(t,Tw(n)),qa)}function hK(e){return e.reduce((t,n)=>t+a2(n),0)}function mK(e){return e.reduce((t,n)=>t+i2(n),0)}function pK(e,t){if(t===void 0&&(t=Cu),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);r2(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const bK=[["x",["left","right"],hK],["y",["top","bottom"],mK]];class sE{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=oE(n),i=l2(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,l,u]of bK)for(const f of l)Object.defineProperty(this,f,{get:()=>{const h=u(r),p=i[o]-h;return this.rect[f]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Jd{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function vK(e){const{EventTarget:t}=Ir(e);return e instanceof t?e:ju(e)}function i0(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var ya;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ya||(ya={}));function oT(e){e.preventDefault()}function gK(e){e.stopPropagation()}var ct;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(ct||(ct={}));const c2={start:[ct.Space,ct.Enter],cancel:[ct.Esc],end:[ct.Space,ct.Enter,ct.Tab]},yK=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case ct.Right:return{...n,x:n.x+25};case ct.Left:return{...n,x:n.x-25};case ct.Down:return{...n,y:n.y+25};case ct.Up:return{...n,y:n.y-25}}};class u2{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Jd(ju(n)),this.windowListeners=new Jd(Ir(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ya.Resize,this.handleCancel),this.windowListeners.add(ya.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ya.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&pK(r),n(qa)}handleKeyDown(t){if(iE(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=c2,coordinateGetter:l=yK,scrollBehavior:u="smooth"}=i,{code:f}=t;if(o.end.includes(f)){this.handleEnd(t);return}if(o.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:h}=r.current,p=h?{x:h.left,y:h.top}:qa;this.referenceCoordinates||(this.referenceCoordinates=p);const b=l(t,{active:n,context:r.current,currentCoordinates:p});if(b){const g=bp(b,p),x={x:0,y:0},{scrollableAncestors:E}=r.current;for(const S of E){const A=t.code,{isTop:j,isRight:C,isLeft:O,isBottom:T,maxScroll:_,minScroll:P}=s2(S),D=fK(S),L={x:Math.min(A===ct.Right?D.right-D.width/2:D.right,Math.max(A===ct.Right?D.left:D.left+D.width/2,b.x)),y:Math.min(A===ct.Down?D.bottom-D.height/2:D.bottom,Math.max(A===ct.Down?D.top:D.top+D.height/2,b.y))},z=A===ct.Right&&!C||A===ct.Left&&!O,F=A===ct.Down&&!T||A===ct.Up&&!j;if(z&&L.x!==b.x){const G=S.scrollLeft+g.x,R=A===ct.Right&&G<=_.x||A===ct.Left&&G>=P.x;if(R&&!g.y){S.scrollTo({left:G,behavior:u});return}R?x.x=S.scrollLeft-G:x.x=A===ct.Right?S.scrollLeft-_.x:S.scrollLeft-P.x,x.x&&S.scrollBy({left:-x.x,behavior:u});break}else if(F&&L.y!==b.y){const G=S.scrollTop+g.y,R=A===ct.Down&&G<=_.y||A===ct.Up&&G>=P.y;if(R&&!g.x){S.scrollTo({top:G,behavior:u});return}R?x.y=S.scrollTop-G:x.y=A===ct.Down?S.scrollTop-_.y:S.scrollTop-P.y,x.y&&S.scrollBy({top:-x.y,behavior:u});break}}this.handleMove(t,qc(bp(b,this.referenceCoordinates),x))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}u2.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=c2,onActivation:i}=t,{active:o}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const u=o.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function sT(e){return!!(e&&"distance"in e)}function lT(e){return!!(e&&"delay"in e)}class lE{constructor(t,n,r){var i;r===void 0&&(r=vK(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:l}=o;this.props=t,this.events=n,this.document=ju(l),this.documentListeners=new Jd(this.document),this.listeners=new Jd(r),this.windowListeners=new Jd(Ir(l)),this.initialCoordinates=(i=Nw(o))!=null?i:qa,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(ya.Resize,this.handleCancel),this.windowListeners.add(ya.DragStart,oT),this.windowListeners.add(ya.VisibilityChange,this.handleCancel),this.windowListeners.add(ya.ContextMenu,oT),this.documentListeners.add(ya.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(lT(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(sT(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(ya.Click,gK,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ya.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:l,options:{activationConstraint:u}}=o;if(!i)return;const f=(n=Nw(t))!=null?n:qa,h=bp(i,f);if(!r&&u){if(sT(u)){if(u.tolerance!=null&&i0(h,u.tolerance))return this.handleCancel();if(i0(h,u.distance))return this.handleStart()}if(lT(u)&&i0(h,u.tolerance))return this.handleCancel();this.handlePending(u,h);return}t.cancelable&&t.preventDefault(),l(f)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===ct.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const xK={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class cE extends lE{constructor(t){const{event:n}=t,r=ju(n.target);super(t,xK,r)}}cE.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const wK={move:{name:"mousemove"},end:{name:"mouseup"}};var Pw;(function(e){e[e.RightClick=2]="RightClick"})(Pw||(Pw={}));class SK extends lE{constructor(t){super(t,wK,ju(t.event.target))}}SK.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Pw.RightClick?!1:(r==null||r({event:n}),!0)}}];const o0={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class EK extends lE{constructor(t){super(t,o0)}static setup(){return window.addEventListener(o0.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(o0.move.name,t)};function t(){}}}EK.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var ef;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ef||(ef={}));var gp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(gp||(gp={}));function AK(e){let{acceleration:t,activator:n=ef.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:l=5,order:u=gp.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:p,delta:b,threshold:g}=e;const x=CK({delta:b,disabled:!o}),[E,S]=M6(),A=v.useRef({x:0,y:0}),j=v.useRef({x:0,y:0}),C=v.useMemo(()=>{switch(n){case ef.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case ef.DraggableRect:return i}},[n,i,f]),O=v.useRef(null),T=v.useCallback(()=>{const P=O.current;if(!P)return;const D=A.current.x*j.current.x,L=A.current.y*j.current.y;P.scrollBy(D,L)},[]),_=v.useMemo(()=>u===gp.TreeOrder?[...h].reverse():h,[u,h]);v.useEffect(()=>{if(!o||!h.length||!C){S();return}for(const P of _){if((r==null?void 0:r(P))===!1)continue;const D=h.indexOf(P),L=p[D];if(!L)continue;const{direction:z,speed:F}=dK(P,L,C,t,g);for(const G of["x","y"])x[G][z[G]]||(F[G]=0,z[G]=0);if(F.x>0||F.y>0){S(),O.current=P,E(T,l),A.current=F,j.current=z;return}}A.current={x:0,y:0},j.current={x:0,y:0},S()},[t,T,r,S,o,l,JSON.stringify(C),JSON.stringify(x),E,h,_,p,JSON.stringify(g)])}const jK={x:{[Mn.Backward]:!1,[Mn.Forward]:!1},y:{[Mn.Backward]:!1,[Mn.Forward]:!1}};function CK(e){let{delta:t,disabled:n}=e;const r=Ow(t);return Lf(i=>{if(n||!r||!i)return jK;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Mn.Backward]:i.x[Mn.Backward]||o.x===-1,[Mn.Forward]:i.x[Mn.Forward]||o.x===1},y:{[Mn.Backward]:i.y[Mn.Backward]||o.y===-1,[Mn.Forward]:i.y[Mn.Forward]||o.y===1}}},[n,t,r])}function OK(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Lf(i=>{var o;return t==null?null:(o=r??i)!=null?o:null},[r,t])}function NK(e,t){return v.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...o]},[]),[e,t])}var cf;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(cf||(cf={}));var _w;(function(e){e.Optimized="optimized"})(_w||(_w={}));const cT=new Map;function TK(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,l]=v.useState(null),{frequency:u,measure:f,strategy:h}=i,p=v.useRef(e),b=A(),g=sf(b),x=v.useCallback(function(j){j===void 0&&(j=[]),!g.current&&l(C=>C===null?j:C.concat(j.filter(O=>!C.includes(O))))},[g]),E=v.useRef(null),S=Lf(j=>{if(b&&!n)return cT;if(!j||j===cT||p.current!==e||o!=null){const C=new Map;for(let O of e){if(!O)continue;if(o&&o.length>0&&!o.includes(O.id)&&O.rect.current){C.set(O.id,O.rect.current);continue}const T=O.node.current,_=T?new sE(f(T),T):null;O.rect.current=_,_&&C.set(O.id,_)}return C}return j},[e,o,n,b,f]);return v.useEffect(()=>{p.current=e},[e]),v.useEffect(()=>{b||x()},[n,b]),v.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),v.useEffect(()=>{b||typeof u!="number"||E.current!==null||(E.current=setTimeout(()=>{x(),E.current=null},u))},[u,b,x,...r]),{droppableRects:S,measureDroppableContainers:x,measuringScheduled:o!=null};function A(){switch(h){case cf.Always:return!1;case cf.BeforeDragging:return n;default:return!n}}}function d2(e,t){return Lf(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function PK(e,t){return d2(e,t)}function _K(e){let{callback:t,disabled:n}=e;const r=aE(t),i=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return v.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function jb(e){let{callback:t,disabled:n}=e;const r=aE(t),i=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return v.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function DK(e){return new sE(Cu(e),e)}function uT(e,t,n){t===void 0&&(t=DK);const[r,i]=v.useState(null);function o(){i(f=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=f??n)!=null?h:null}const p=t(e);return JSON.stringify(f)===JSON.stringify(p)?f:p})}const l=_K({callback(f){if(e)for(const h of f){const{type:p,target:b}=h;if(p==="childList"&&b instanceof HTMLElement&&b.contains(e)){o();break}}}}),u=jb({callback:o});return pi(()=>{o(),e?(u==null||u.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),l==null||l.disconnect())},[e]),r}function MK(e){const t=d2(e);return n2(e,t)}const dT=[];function RK(e){const t=v.useRef(e),n=Lf(r=>e?r&&r!==dT&&e&&t.current&&e.parentNode===t.current.parentNode?r:oE(e):dT,[e]);return v.useEffect(()=>{t.current=e},[e]),n}function kK(e){const[t,n]=v.useState(null),r=v.useRef(e),i=v.useCallback(o=>{const l=a0(o.target);l&&n(u=>u?(u.set(l,Tw(l)),new Map(u)):null)},[]);return v.useEffect(()=>{const o=r.current;if(e!==o){l(o);const u=e.map(f=>{const h=a0(f);return h?(h.addEventListener("scroll",i,{passive:!0}),[h,Tw(h)]):null}).filter(f=>f!=null);n(u.length?new Map(u):null),r.current=e}return()=>{l(e),l(o)};function l(u){u.forEach(f=>{const h=a0(f);h==null||h.removeEventListener("scroll",i)})}},[i,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,l)=>qc(o,l),qa):l2(e):qa,[e,t])}function fT(e,t){t===void 0&&(t=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},t),v.useEffect(()=>{const r=e!==qa;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?bp(e,n.current):qa}function LK(e){v.useEffect(()=>{if(!Ab)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function IK(e,t){return v.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=l=>{o(l,t)},n},{}),[e,t])}function f2(e){return v.useMemo(()=>e?sK(e):null,[e])}const hT=[];function zK(e,t){t===void 0&&(t=Cu);const[n]=e,r=f2(n?Ir(n):null),[i,o]=v.useState(hT);function l(){o(()=>e.length?e.map(f=>o2(f)?r:new sE(t(f),f)):hT)}const u=jb({callback:l});return pi(()=>{u==null||u.disconnect(),l(),e.forEach(f=>u==null?void 0:u.observe(f))},[e]),i}function UK(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return kf(t)?t:e}function qK(e){let{measure:t}=e;const[n,r]=v.useState(null),i=v.useCallback(h=>{for(const{target:p}of h)if(kf(p)){r(b=>{const g=t(p);return b?{...b,width:g.width,height:g.height}:g});break}},[t]),o=jb({callback:i}),l=v.useCallback(h=>{const p=UK(h);o==null||o.disconnect(),p&&(o==null||o.observe(p)),r(p?t(p):null)},[t,o]),[u,f]=pp(l);return v.useMemo(()=>({nodeRef:u,rect:n,setRef:f}),[n,u,f])}const BK=[{sensor:cE,options:{}},{sensor:u2,options:{}}],FK={current:{}},ep={draggable:{measure:iT},droppable:{measure:iT,strategy:cf.WhileDragging,frequency:_w.Optimized},dragOverlay:{measure:Cu}};class tf extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const $K={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new tf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:vp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ep,measureDroppableContainers:vp,windowRect:null,measuringScheduled:!1},KK={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:vp,draggableNodes:new Map,over:null,measureDroppableContainers:vp},Cb=v.createContext(KK),h2=v.createContext($K);function HK(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new tf}}}function GK(e,t){switch(t.type){case wn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case wn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case wn.DragEnd:case wn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case wn.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new tf(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case wn.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new tf(e.droppable.containers);return l.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:l}}}case wn.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new tf(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function YK(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=v.useContext(Cb),o=Ow(r),l=Ow(n==null?void 0:n.id);return v.useEffect(()=>{if(!t&&!r&&o&&l!=null){if(!iE(o)||document.activeElement===o.target)return;const u=i.get(l);if(!u)return;const{activatorNode:f,node:h}=u;if(!f.current&&!h.current)return;requestAnimationFrame(()=>{for(const p of[f.current,h.current]){if(!p)continue;const b=L6(p);if(b){b.focus();break}}})}},[r,t,i,l,o]),null}function WK(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function QK(e){return v.useMemo(()=>({draggable:{...ep.draggable,...e==null?void 0:e.draggable},droppable:{...ep.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ep.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function VK(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=v.useRef(!1),{x:l,y:u}=typeof i=="boolean"?{x:i,y:i}:i;pi(()=>{if(!l&&!u||!t){o.current=!1;return}if(o.current||!r)return;const h=t==null?void 0:t.node.current;if(!h||h.isConnected===!1)return;const p=n(h),b=n2(p,r);if(l||(b.x=0),u||(b.y=0),o.current=!0,Math.abs(b.x)>0||Math.abs(b.y)>0){const g=r2(h);g&&g.scrollBy({top:b.y,left:b.x})}},[t,l,u,r,n])}const m2=v.createContext({...qa,scaleX:1,scaleY:1});var ts;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ts||(ts={}));const XK=v.memo(function(t){var n,r,i,o;let{id:l,accessibility:u,autoScroll:f=!0,children:h,sensors:p=BK,collisionDetection:b=eK,measuring:g,modifiers:x,...E}=t;const S=v.useReducer(GK,void 0,HK),[A,j]=S,[C,O]=F6(),[T,_]=v.useState(ts.Uninitialized),P=T===ts.Initialized,{draggable:{active:D,nodes:L,translate:z},droppable:{containers:F}}=A,G=D!=null?L.get(D):null,R=v.useRef({initial:null,translated:null}),J=v.useMemo(()=>{var Rt;return D!=null?{id:D,data:(Rt=G==null?void 0:G.data)!=null?Rt:FK,rect:R}:null},[D,G]),$=v.useRef(null),[ne,K]=v.useState(null),[Z,B]=v.useState(null),te=sf(E,Object.values(E)),pe=If("DndDescribedBy",l),k=v.useMemo(()=>F.getEnabled(),[F]),Q=QK(g),{droppableRects:ce,measureDroppableContainers:fe,measuringScheduled:xe}=TK(k,{dragging:P,dependencies:[z.x,z.y],config:Q.droppable}),Oe=OK(L,D),qe=v.useMemo(()=>Z?Nw(Z):null,[Z]),Be=Va(),he=PK(Oe,Q.draggable.measure);VK({activeNode:D!=null?L.get(D):null,config:Be.layoutShiftCompensation,initialRect:he,measure:Q.draggable.measure});const ue=uT(Oe,Q.draggable.measure,he),Ee=uT(Oe?Oe.parentElement:null),de=v.useRef({activatorEvent:null,active:null,activeNode:Oe,collisionRect:null,collisions:null,droppableRects:ce,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Le=F.getNodeFor((n=de.current.over)==null?void 0:n.id),Me=qK({measure:Q.dragOverlay.measure}),Ie=(r=Me.nodeRef.current)!=null?r:Oe,ut=P?(i=Me.rect)!=null?i:ue:null,Un=!!(Me.nodeRef.current&&Me.rect),qn=MK(Un?null:ue),Ya=f2(Ie?Ir(Ie):null),Xn=RK(P?Le??Oe:null),ja=zK(Xn),Oi=WK(x,{transform:{x:z.x-qn.x,y:z.y-qn.y,scaleX:1,scaleY:1},activatorEvent:Z,active:J,activeNodeRect:ue,containerNodeRect:Ee,draggingNodeRect:ut,over:de.current.over,overlayNodeRect:Me.rect,scrollableAncestors:Xn,scrollableAncestorRects:ja,windowRect:Ya}),zr=qe?qc(qe,z):null,Kt=kK(Xn),Ca=fT(Kt),Eo=fT(Kt,[ue]),Ur=qc(Oi,Ca),Cn=ut?rK(ut,Oi):null,ia=J&&Cn?b({active:J,collisionRect:Cn,droppableRects:ce,droppableContainers:k,pointerCoordinates:zr}):null,Wa=X6(ia,"id"),[qr,Ts]=v.useState(null),Qa=Un?Oi:qc(Oi,Eo),bn=tK(Qa,(o=qr==null?void 0:qr.rect)!=null?o:null,ue),Zn=v.useRef(null),zt=v.useCallback((Rt,At)=>{let{sensor:Ut,options:Ot}=At;if($.current==null)return;const en=L.get($.current);if(!en)return;const sn=Rt.nativeEvent,On=new Ut({active:$.current,activeNode:en,event:sn,options:Ot,context:de,onAbort(qt){if(!L.get(qt))return;const{onDragAbort:ur}=te.current,Nn={id:qt};ur==null||ur(Nn),C({type:"onDragAbort",event:Nn})},onPending(qt,cr,ur,Nn){if(!L.get(qt))return;const{onDragPending:Na}=te.current,nt={id:qt,constraint:cr,initialCoordinates:ur,offset:Nn};Na==null||Na(nt),C({type:"onDragPending",event:nt})},onStart(qt){const cr=$.current;if(cr==null)return;const ur=L.get(cr);if(!ur)return;const{onDragStart:Nn}=te.current,Oa={activatorEvent:sn,active:{id:cr,data:ur.data,rect:R}};Vn.unstable_batchedUpdates(()=>{Nn==null||Nn(Oa),_(ts.Initializing),j({type:wn.DragStart,initialCoordinates:qt,active:cr}),C({type:"onDragStart",event:Oa}),K(Zn.current),B(sn)})},onMove(qt){j({type:wn.DragMove,coordinates:qt})},onEnd:Er(wn.DragEnd),onCancel:Er(wn.DragCancel)});Zn.current=On;function Er(qt){return async function(){const{active:ur,collisions:Nn,over:Oa,scrollAdjustedTranslate:Na}=de.current;let nt=null;if(ur&&Na){const{cancelDrop:dr}=te.current;nt={activatorEvent:sn,active:ur,collisions:Nn,delta:Na,over:Oa},qt===wn.DragEnd&&typeof dr=="function"&&await Promise.resolve(dr(nt))&&(qt=wn.DragCancel)}$.current=null,Vn.unstable_batchedUpdates(()=>{j({type:qt}),_(ts.Uninitialized),Ts(null),K(null),B(null),Zn.current=null;const dr=qt===wn.DragEnd?"onDragEnd":"onDragCancel";if(nt){const Ar=te.current[dr];Ar==null||Ar(nt),C({type:dr,event:nt})}})}}},[L]),Sr=v.useCallback((Rt,At)=>(Ut,Ot)=>{const en=Ut.nativeEvent,sn=L.get(Ot);if($.current!==null||!sn||en.dndKit||en.defaultPrevented)return;const On={active:sn};Rt(Ut,At.options,On)===!0&&(en.dndKit={capturedBy:At.sensor},$.current=Ot,zt(Ut,At))},[L,zt]),Ao=NK(p,Sr);LK(p),pi(()=>{ue&&T===ts.Initializing&&_(ts.Initialized)},[ue,T]),v.useEffect(()=>{const{onDragMove:Rt}=te.current,{active:At,activatorEvent:Ut,collisions:Ot,over:en}=de.current;if(!At||!Ut)return;const sn={active:At,activatorEvent:Ut,collisions:Ot,delta:{x:Ur.x,y:Ur.y},over:en};Vn.unstable_batchedUpdates(()=>{Rt==null||Rt(sn),C({type:"onDragMove",event:sn})})},[Ur.x,Ur.y]),v.useEffect(()=>{const{active:Rt,activatorEvent:At,collisions:Ut,droppableContainers:Ot,scrollAdjustedTranslate:en}=de.current;if(!Rt||$.current==null||!At||!en)return;const{onDragOver:sn}=te.current,On=Ot.get(Wa),Er=On&&On.rect.current?{id:On.id,rect:On.rect.current,data:On.data,disabled:On.disabled}:null,qt={active:Rt,activatorEvent:At,collisions:Ut,delta:{x:en.x,y:en.y},over:Er};Vn.unstable_batchedUpdates(()=>{Ts(Er),sn==null||sn(qt),C({type:"onDragOver",event:qt})})},[Wa]),pi(()=>{de.current={activatorEvent:Z,active:J,activeNode:Oe,collisionRect:Cn,collisions:ia,droppableRects:ce,draggableNodes:L,draggingNode:Ie,draggingNodeRect:ut,droppableContainers:F,over:qr,scrollableAncestors:Xn,scrollAdjustedTranslate:Ur},R.current={initial:ut,translated:Cn}},[J,Oe,ia,Cn,L,Ie,ut,ce,F,qr,Xn,Ur]),AK({...Be,delta:z,draggingRect:Cn,pointerCoordinates:zr,scrollableAncestors:Xn,scrollableAncestorRects:ja});const Il=v.useMemo(()=>({active:J,activeNode:Oe,activeNodeRect:ue,activatorEvent:Z,collisions:ia,containerNodeRect:Ee,dragOverlay:Me,draggableNodes:L,droppableContainers:F,droppableRects:ce,over:qr,measureDroppableContainers:fe,scrollableAncestors:Xn,scrollableAncestorRects:ja,measuringConfiguration:Q,measuringScheduled:xe,windowRect:Ya}),[J,Oe,ue,Z,ia,Ee,Me,L,F,ce,qr,fe,Xn,ja,Q,xe,Ya]),Ni=v.useMemo(()=>({activatorEvent:Z,activators:Ao,active:J,activeNodeRect:ue,ariaDescribedById:{draggable:pe},dispatch:j,draggableNodes:L,over:qr,measureDroppableContainers:fe}),[Z,Ao,J,ue,j,pe,L,qr,fe]);return Zt.createElement(t2.Provider,{value:O},Zt.createElement(Cb.Provider,{value:Ni},Zt.createElement(h2.Provider,{value:Il},Zt.createElement(m2.Provider,{value:bn},h)),Zt.createElement(YK,{disabled:(u==null?void 0:u.restoreFocus)===!1})),Zt.createElement(H6,{...u,hiddenTextDescribedById:pe}));function Va(){const Rt=(ne==null?void 0:ne.autoScrollEnabled)===!1,At=typeof f=="object"?f.enabled===!1:f===!1,Ut=P&&!Rt&&!At;return typeof f=="object"?{...f,enabled:Ut}:{enabled:Ut}}}),ZK=v.createContext(null),mT="button",JK="Draggable";function e8(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=If(JK),{activators:l,activatorEvent:u,active:f,activeNodeRect:h,ariaDescribedById:p,draggableNodes:b,over:g}=v.useContext(Cb),{role:x=mT,roleDescription:E="draggable",tabIndex:S=0}=i??{},A=(f==null?void 0:f.id)===t,j=v.useContext(A?m2:ZK),[C,O]=pp(),[T,_]=pp(),P=IK(l,t),D=sf(n);pi(()=>(b.set(t,{id:t,key:o,node:C,activatorNode:T,data:D}),()=>{const z=b.get(t);z&&z.key===o&&b.delete(t)}),[b,t]);const L=v.useMemo(()=>({role:x,tabIndex:S,"aria-disabled":r,"aria-pressed":A&&x===mT?!0:void 0,"aria-roledescription":E,"aria-describedby":p.draggable}),[r,x,S,A,E,p.draggable]);return{active:f,activatorEvent:u,activeNodeRect:h,attributes:L,isDragging:A,listeners:r?void 0:P,node:C,over:g,setNodeRef:O,setActivatorNodeRef:_,transform:j}}function t8(){return v.useContext(h2)}const n8="Droppable",r8={timeout:25};function a8(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=If(n8),{active:l,dispatch:u,over:f,measureDroppableContainers:h}=v.useContext(Cb),p=v.useRef({disabled:n}),b=v.useRef(!1),g=v.useRef(null),x=v.useRef(null),{disabled:E,updateMeasurementsFor:S,timeout:A}={...r8,...i},j=sf(S??r),C=v.useCallback(()=>{if(!b.current){b.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{h(Array.isArray(j.current)?j.current:[j.current]),x.current=null},A)},[A]),O=jb({callback:C,disabled:E||!l}),T=v.useCallback((L,z)=>{O&&(z&&(O.unobserve(z),b.current=!1),L&&O.observe(L))},[O]),[_,P]=pp(T),D=sf(t);return v.useEffect(()=>{!O||!_.current||(O.disconnect(),b.current=!1,O.observe(_.current))},[_,O]),v.useEffect(()=>(u({type:wn.RegisterDroppable,element:{id:r,key:o,disabled:n,node:_,rect:g,data:D}}),()=>u({type:wn.UnregisterDroppable,key:o,id:r})),[r]),v.useEffect(()=>{n!==p.current.disabled&&(u({type:wn.SetDroppableDisabled,id:r,key:o,disabled:n}),p.current.disabled=n)},[r,o,n,u]),{active:l,rect:g,isOver:(f==null?void 0:f.id)===r,node:_,over:f,setNodeRef:P}}function uE(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function i8(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Cm(e){return e!==null&&e>=0}function o8(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function s8(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const p2=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=uE(t,r,n),l=t[i],u=o[i];return!u||!l?null:{x:u.left-l.left,y:u.top-l.top,scaleX:u.width/l.width,scaleY:u.height/l.height}},Om={scaleX:1,scaleY:1},l8=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:o,overIndex:l}=e;const u=(t=o[n])!=null?t:r;if(!u)return null;if(i===n){const h=o[l];return h?{x:0,y:n<l?h.top+h.height-(u.top+u.height):h.top-u.top,...Om}:null}const f=c8(o,i,n);return i>n&&i<=l?{x:0,y:-u.height-f,...Om}:i<n&&i>=l?{x:0,y:u.height+f,...Om}:{x:0,y:0,...Om}};function c8(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r?n<t?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const b2="Sortable",v2=Zt.createContext({activeIndex:-1,containerId:b2,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:p2,disabled:{draggable:!1,droppable:!1}});function u8(e){let{children:t,id:n,items:r,strategy:i=p2,disabled:o=!1}=e;const{active:l,dragOverlay:u,droppableRects:f,over:h,measureDroppableContainers:p}=t8(),b=If(b2,n),g=u.rect!==null,x=v.useMemo(()=>r.map(P=>typeof P=="object"&&"id"in P?P.id:P),[r]),E=l!=null,S=l?x.indexOf(l.id):-1,A=h?x.indexOf(h.id):-1,j=v.useRef(x),C=!o8(x,j.current),O=A!==-1&&S===-1||C,T=s8(o);pi(()=>{C&&E&&p(x)},[C,x,E,p]),v.useEffect(()=>{j.current=x},[x]);const _=v.useMemo(()=>({activeIndex:S,containerId:b,disabled:T,disableTransforms:O,items:x,overIndex:A,useDragOverlay:g,sortedRects:i8(x,f),strategy:i}),[S,b,T.draggable,T.droppable,O,x,A,f,g,i]);return Zt.createElement(v2.Provider,{value:_},t)}const d8=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return uE(n,r,i).indexOf(t)},f8=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:l,previousItems:u,previousContainerId:f,transition:h}=e;return!h||!r||u!==o&&i===l?!1:n?!0:l!==i&&t===f},h8={duration:200,easing:"ease"},g2="transform",m8=lf.Transition.toString({property:g2,duration:0,easing:"linear"}),p8={roleDescription:"sortable"};function b8(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,l]=v.useState(null),u=v.useRef(n);return pi(()=>{if(!t&&n!==u.current&&r.current){const f=i.current;if(f){const h=Cu(r.current,{ignoreTransform:!0}),p={x:f.left-h.left,y:f.top-h.top,scaleX:f.width/h.width,scaleY:f.height/h.height};(p.x||p.y)&&l(p)}}n!==u.current&&(u.current=n)},[t,n,r,i]),v.useEffect(()=>{o&&l(null)},[o]),o}function v8(e){let{animateLayoutChanges:t=f8,attributes:n,disabled:r,data:i,getNewIndex:o=d8,id:l,strategy:u,resizeObserverConfig:f,transition:h=h8}=e;const{items:p,containerId:b,activeIndex:g,disabled:x,disableTransforms:E,sortedRects:S,overIndex:A,useDragOverlay:j,strategy:C}=v.useContext(v2),O=g8(r,x),T=p.indexOf(l),_=v.useMemo(()=>({sortable:{containerId:b,index:T,items:p},...i}),[b,i,T,p]),P=v.useMemo(()=>p.slice(p.indexOf(l)),[p,l]),{rect:D,node:L,isOver:z,setNodeRef:F}=a8({id:l,data:_,disabled:O.droppable,resizeObserverConfig:{updateMeasurementsFor:P,...f}}),{active:G,activatorEvent:R,activeNodeRect:J,attributes:$,setNodeRef:ne,listeners:K,isDragging:Z,over:B,setActivatorNodeRef:te,transform:pe}=e8({id:l,data:_,attributes:{...p8,...n},disabled:O.draggable}),k=D6(F,ne),Q=!!G,ce=Q&&!E&&Cm(g)&&Cm(A),fe=!j&&Z,xe=fe&&ce?pe:null,qe=ce?xe??(u??C)({rects:S,activeNodeRect:J,activeIndex:g,overIndex:A,index:T}):null,Be=Cm(g)&&Cm(A)?o({id:l,items:p,activeIndex:g,overIndex:A}):T,he=G==null?void 0:G.id,ue=v.useRef({activeId:he,items:p,newIndex:Be,containerId:b}),Ee=p!==ue.current.items,de=t({active:G,containerId:b,isDragging:Z,isSorting:Q,id:l,index:T,items:p,newIndex:ue.current.newIndex,previousItems:ue.current.items,previousContainerId:ue.current.containerId,transition:h,wasDragging:ue.current.activeId!=null}),Le=b8({disabled:!de,index:T,node:L,rect:D});return v.useEffect(()=>{Q&&ue.current.newIndex!==Be&&(ue.current.newIndex=Be),b!==ue.current.containerId&&(ue.current.containerId=b),p!==ue.current.items&&(ue.current.items=p)},[Q,Be,b,p]),v.useEffect(()=>{if(he===ue.current.activeId)return;if(he!=null&&ue.current.activeId==null){ue.current.activeId=he;return}const Ie=setTimeout(()=>{ue.current.activeId=he},50);return()=>clearTimeout(Ie)},[he]),{active:G,activeIndex:g,attributes:$,data:_,rect:D,index:T,newIndex:Be,items:p,isOver:z,isSorting:Q,isDragging:Z,listeners:K,node:L,overIndex:A,over:B,setNodeRef:k,setActivatorNodeRef:te,setDroppableNodeRef:F,setDraggableNodeRef:ne,transform:Le??qe,transition:Me()};function Me(){if(Le||Ee&&ue.current.newIndex===T)return m8;if(!(fe&&!iE(R)||!h)&&(Q||de))return lf.Transition.toString({...h,property:g2})}}function g8(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}ct.Down,ct.Right,ct.Up,ct.Left;function y8(){return d.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"currentColor","aria-hidden":!0,children:[d.jsx("circle",{cx:"9",cy:"6",r:"1.5"}),d.jsx("circle",{cx:"15",cy:"6",r:"1.5"}),d.jsx("circle",{cx:"9",cy:"12",r:"1.5"}),d.jsx("circle",{cx:"15",cy:"12",r:"1.5"}),d.jsx("circle",{cx:"9",cy:"18",r:"1.5"}),d.jsx("circle",{cx:"15",cy:"18",r:"1.5"})]})}function x8(){return d.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":!0,children:d.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1.5 14a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2L5 6"})})}function w8({id:e,chip:t,onChange:n,onRemove:r}){const{attributes:i,listeners:o,setNodeRef:l,transform:u,transition:f,isDragging:h}=v8({id:e}),p={transform:lf.Transform.toString(u),transition:f,opacity:h?.5:1};return d.jsxs("li",{ref:l,style:p,className:"bb-chip-row",children:[d.jsx("button",{type:"button",className:"bb-chip-handle",...i,...o,"aria-label":"Drag to reorder",children:d.jsx(y8,{})}),d.jsx("input",{className:"bb-input bb-chip-label",value:t.label,onChange:b=>n({...t,label:b.target.value}),placeholder:"Button label","aria-label":"Chip label"}),d.jsx("input",{className:"bb-input bb-chip-message",value:t.message,onChange:b=>n({...t,message:b.target.value}),placeholder:"Message sent when clicked","aria-label":"Chip message"}),d.jsx("button",{type:"button",className:"bb-chip-remove",onClick:r,"aria-label":"Remove chip",children:d.jsx(x8,{})})]})}function S8({chips:e,onChange:t,maxChips:n=6}){const r=Y6(G6(cE,{activationConstraint:{distance:4}})),i=h=>{const{active:p,over:b}=h;if(!b||p.id===b.id)return;const g=Number(p.id),x=Number(b.id);t(uE(e,g,x))},o=(h,p)=>{const b=[...e];b[h]=p,t(b)},l=h=>t(e.filter((p,b)=>b!==h)),u=()=>t([...e,{label:"",message:""}]),f=e.map((h,p)=>String(p));return d.jsxs("div",{className:"bb-chips",children:[d.jsx(XK,{sensors:r,collisionDetection:Z6,onDragEnd:i,children:d.jsx(u8,{items:f,strategy:l8,children:d.jsx("ul",{className:"bb-chip-list",children:e.map((h,p)=>d.jsx(w8,{id:String(p),chip:h,onChange:b=>o(p,b),onRemove:()=>l(p)},p))})})}),e.length<n&&d.jsx("button",{type:"button",className:"bb-chip-add",onClick:u,children:"+ Add chip"}),d.jsx("p",{className:"bb-field-help",children:"Drag to reorder. Sites with 3+ starter chips get 2.4× more conversations."})]})}function ka({label:e,help:t,htmlFor:n,children:r}){return d.jsxs("div",{className:"bb-field",children:[d.jsx("label",{className:"bb-field-label",htmlFor:n,children:e}),r,t&&d.jsx("p",{className:"bb-field-help",children:t})]})}const E8="png,jpg,jpeg,gif,webp";function A8({label:e="Choose from Media Library",accept:t="image",onSelect:n,className:r}){const i=()=>{var l;if(typeof window>"u"||!((l=window.wp)!=null&&l.media)){alert("WP Media Library isn't available on this page. Paste the URL directly into the field instead.");return}const o=window.wp.media({title:e,button:{text:"Use this file"},library:{type:t},multiple:!1});o.on("uploader:ready",()=>{var f,h;const u=(h=(f=o.uploader)==null?void 0:f.uploader)==null?void 0:h.uploader;u&&(u.settings.filters&&(u.settings.filters.mime_types=[{title:"Images",extensions:E8}]),u.bind("FilesAdded",(p,b)=>{const g=[];for(const x of b){const E=(x.type??"").toLowerCase();(!E.startsWith("image/")||E==="image/svg+xml")&&(g.push(x),p.removeFile(x))}if(g.length){const x=g.map(E=>E.name).join(", ");le.error(g.length===1?`"${x}" isn't an image — only PNG, JPG, GIF, and WebP are allowed.`:`${g.length} files skipped — only PNG, JPG, GIF, and WebP are allowed.`)}}))}),o.on("select",()=>{const u=o.state().get("selection").first().toJSON();if(!(u!=null&&u.url))return;const f=Array.isArray(t)?t:[t],h=(u.mime??"").toLowerCase(),p=(u.type??h.split("/")[0]??"").toLowerCase();if(!f.some(g=>g===p||h.startsWith(`${g}/`))){le.error(`That file is a ${p||"non-image file"} — please choose an image (PNG, JPG, GIF, WebP).`);return}n(u.url,u)}),o.open()};return d.jsx("button",{type:"button",className:r??"bb-btn bb-btn-ghost bb-btn-small",onClick:i,children:"Upload"})}const yc={widgetTitle:30,welcomeMessage:240,placeholderText:50};function s0({value:e,max:t}){const n=(e??"").length,r=n>t,i=!r&&n>=t-Math.max(5,Math.round(t*.1));return d.jsxs("span",{className:`bb-field-counter ${r?"bb-field-counter-over":i?"bb-field-counter-near":""}`,"aria-live":"polite",children:[n," / ",t]})}const j8=["#E84F2A","#0073AA","#16A34A","#9333EA","#0F1419"];function C8({settings:e,save:t,onAdjustCrop:n,onUploaded:r}){const i=Eb(e.avatarTransform);return d.jsxs(Lr,{eyebrow:"Step 01",title:"Branding",children:[d.jsxs(ka,{label:"Widget title",help:"Shown in the chat header. Visitors see this before sending a message.",children:[d.jsx("input",{className:"bb-input",value:e.widgetTitle,maxLength:yc.widgetTitle,onChange:o=>t({widgetTitle:o.target.value}),placeholder:"Chat with us"}),d.jsx(s0,{value:e.widgetTitle,max:yc.widgetTitle})]}),d.jsxs(ka,{label:"Welcome message",help:"First message visitors see when they open the chat.",children:[d.jsx("textarea",{className:"bb-input bb-textarea",rows:2,value:e.welcomeMessage,maxLength:yc.welcomeMessage,onChange:o=>t({welcomeMessage:o.target.value}),placeholder:"Hi! How can I help you today?"}),d.jsx(s0,{value:e.welcomeMessage,max:yc.welcomeMessage})]}),d.jsxs(ka,{label:"Input placeholder",help:"Greyed-out hint inside the message box.",children:[d.jsx("input",{className:"bb-input",value:e.placeholderText,maxLength:yc.placeholderText,onChange:o=>t({placeholderText:o.target.value}),placeholder:"Type your message…"}),d.jsx(s0,{value:e.placeholderText,max:yc.placeholderText})]}),d.jsx(ka,{label:"Primary colour",help:"Button background, accent, and link colour.",children:d.jsxs("div",{className:"bb-color-picker",children:[j8.map(o=>d.jsx("button",{type:"button",className:`bb-color-swatch ${e.primaryColor.toLowerCase()===o.toLowerCase()?"bb-color-swatch-active":""}`,style:{background:o},onClick:()=>t({primaryColor:o}),"aria-label":`Use ${o}`},o)),d.jsx("input",{className:"bb-input bb-color-hex",value:e.primaryColor,onChange:o=>t({primaryColor:o.target.value}),placeholder:"#0073aa","aria-label":"Custom hex"})]})}),d.jsx(ka,{label:"Avatar",help:"PNG, JPG, GIF, or WebP. Drag and zoom to frame after upload.",children:d.jsxs("div",{className:"bb-avatar-row",children:[e.avatarUrl&&(()=>{const o=tE(i,"rounded",36,36);return d.jsx("div",{className:"bb-avatar-thumb-wrap",children:o?d.jsx("div",{className:"bb-avatar-thumb",style:{backgroundImage:`url(${e.avatarUrl})`,backgroundSize:o.backgroundSize,backgroundPosition:o.backgroundPosition,backgroundRepeat:"no-repeat"}}):d.jsx("img",{src:e.avatarUrl,alt:"",className:"bb-avatar-thumb",onError:l=>{l.target.style.display="none"}})})})(),d.jsx("input",{className:"bb-input",value:e.avatarUrl,onChange:o=>{t({avatarUrl:o.target.value}),i&&t({avatarTransform:""})},placeholder:"https://your-site.com/avatar.png"}),d.jsx(A8,{label:"Choose an avatar",accept:"image",onSelect:o=>{t({avatarUrl:o,avatarTransform:""}),r==null||r(o)}}),e.avatarUrl&&d.jsx("button",{type:"button",className:"bb-link-btn bb-avatar-adjust",onClick:()=>n==null?void 0:n(),title:"Adjust how the avatar is framed",children:"Adjust crop"}),e.avatarUrl&&d.jsx("button",{type:"button",className:"bb-link-btn bb-avatar-clear",onClick:()=>t({avatarUrl:"",avatarTransform:""}),title:"Clear avatar",children:"Clear"})]})})]})}function O8({settings:e,save:t}){return d.jsx(Lr,{eyebrow:"Step 02",title:"Conversation",children:d.jsx(ka,{label:"Suggested questions",help:"",children:d.jsx(S8,{chips:[...e.suggestedQuestions],onChange:n=>t({suggestedQuestions:n})})})})}const N8=[{key:"rounded",label:"Rounded"},{key:"pill",label:"Pill"}];function T8({settings:e,save:t,onAdjustCrop:n}){return d.jsxs(Lr,{eyebrow:"Step 03",title:"Appearance",children:[d.jsx(ka,{label:"FAB shape",help:"The shape of the floating chat button. Drag the slider below to dial roundness; pick Pill for an elongated launcher.",children:d.jsxs("div",{className:"bb-shape-row",children:[d.jsx("div",{className:"bb-segmented",children:N8.map(r=>d.jsx("button",{type:"button",className:`bb-seg ${e.widgetShape===r.key?"bb-seg-active":""}`,onClick:()=>t({widgetShape:r.key}),children:r.label},r.key))}),e.avatarUrl&&d.jsx("button",{type:"button",className:"bb-link-btn bb-avatar-adjust",onClick:()=>n==null?void 0:n(),title:"Adjust how the avatar is framed",children:"Adjust crop"})]})}),d.jsx(ka,{label:`Launcher corner radius — ${e.cornerRadius}px`,help:"Corner radius of the FAB launcher. 0 for sharp, 32 for fully rounded. The chat panel keeps a fixed soft edge.",children:d.jsx("input",{type:"range",min:0,max:32,value:e.cornerRadius,onChange:r=>t({cornerRadius:Number(r.target.value)}),className:"bb-slider"})}),d.jsx(ka,{label:"Position",help:"Where the chat bubble sits on the page.",children:d.jsxs("div",{className:"bb-segmented",children:[d.jsx("button",{type:"button",className:`bb-seg ${e.widgetPosition==="bottom-left"?"bb-seg-active":""}`,onClick:()=>t({widgetPosition:"bottom-left"}),children:"Bottom left"}),d.jsx("button",{type:"button",className:`bb-seg ${e.widgetPosition==="bottom-right"?"bb-seg-active":""}`,onClick:()=>t({widgetPosition:"bottom-right"}),children:"Bottom right"})]})}),d.jsx(ka,{label:"Offset from edge",help:"Distance from the corner — bump up if another floating widget is in the way.",children:d.jsxs("div",{className:"bb-offset-row",children:[d.jsxs("label",{className:"bb-offset-field",children:[d.jsx("span",{children:"X (horizontal)"}),d.jsx("input",{type:"number",className:"bb-input bb-input-num",min:0,max:200,step:2,value:e.widgetOffsetX,onChange:r=>t({widgetOffsetX:Math.max(0,Number(r.target.value))})}),d.jsx("span",{className:"bb-offset-unit",children:"px"})]}),d.jsxs("label",{className:"bb-offset-field",children:[d.jsx("span",{children:"Y (vertical)"}),d.jsx("input",{type:"number",className:"bb-input bb-input-num",min:0,max:200,step:2,value:e.widgetOffsetY,onChange:r=>t({widgetOffsetY:Math.max(0,Number(r.target.value))})}),d.jsx("span",{className:"bb-offset-unit",children:"px"})]}),d.jsx("button",{type:"button",className:"bb-link-btn bb-offset-reset",onClick:()=>t({widgetOffsetX:20,widgetOffsetY:20}),title:"Reset to default 20px / 20px",children:"Reset"})]})}),d.jsx(ka,{label:"Nudge / proactive prompt",help:"Show a callout bubble after N seconds of inactivity.",children:d.jsx(D8,{value:e.nudge,onChange:r=>t({nudge:r})})})]})}function P8(e){if(!e)return null;try{const t=JSON.parse(e);return typeof t=="object"&&t!==null?t:null}catch{return null}}function _8(e){const t=P8(e);return{enabled:!!(t!=null&&t.enabled),delaySeconds:Number((t==null?void 0:t.delaySeconds)??(t==null?void 0:t.delay)??8),message:String((t==null?void 0:t.message)??(t==null?void 0:t.simpleText)??"")}}function D8({value:e,onChange:t}){const n=_8(e),r=i=>{const o={...n,...i};t(JSON.stringify(o))};return d.jsxs("div",{className:"bb-json-editor",children:[d.jsxs("label",{className:"bb-toggle-row",children:[d.jsx("input",{type:"checkbox",checked:n.enabled,onChange:i=>r({enabled:i.target.checked})}),d.jsx("span",{children:"Enabled"})]}),d.jsxs("div",{className:"bb-json-editor-grid",children:[d.jsxs("label",{className:"bb-json-editor-field",children:[d.jsx("span",{children:"After"}),d.jsx("input",{type:"number",className:"bb-input bb-input-num",min:1,max:60,value:n.delaySeconds,onChange:i=>r({delaySeconds:Math.max(1,Number(i.target.value))})}),d.jsx("span",{children:"seconds of inactivity"})]}),d.jsxs("label",{className:"bb-json-editor-field bb-json-editor-field-wide",children:[d.jsx("span",{children:"Show this message"}),d.jsx("input",{type:"text",className:"bb-input",value:n.message,onChange:i=>r({message:i.target.value}),placeholder:"Need a hand? I'm here to help."})]})]})]})}const y2=new Set(["look","behaviour"]),M8="look";function pT(){const t=new URL(window.location.href).searchParams.get("sub");return t&&y2.has(t)?t:M8}const l0="bb:sub-change";function x2(){const[e,t]=v.useState(pT);v.useEffect(()=>{const r=()=>t(pT());return window.addEventListener("popstate",r),window.addEventListener(l0,r),()=>{window.removeEventListener("popstate",r),window.removeEventListener(l0,r)}},[]);const n=v.useCallback(r=>{if(!y2.has(r))return;const i=new URL(window.location.href);i.searchParams.get("sub")!==r&&(i.searchParams.set("sub",r),window.history.pushState({},"",i),t(r),window.dispatchEvent(new Event(l0)))},[]);return[e,n]}const c0=[{key:"look",label:"Look & feel",aside:"Changes save as you type"},{key:"behaviour",label:"Behaviour",aside:"How the bot speaks and what it avoids"}];function R8(){const{settings:e,isLoading:t,save:n,isSaving:r,lastSavedAt:i}=ZS(),[o,l]=x2(),[u,f]=v.useState(null);if(t||!e)return d.jsx("div",{className:"bb-skeleton",style:{height:480,marginTop:24,borderRadius:12}});const h=()=>e.avatarUrl&&f(e.avatarUrl),p=c0.find(b=>b.key===o)??c0[0];return d.jsxs(d.Fragment,{children:[d.jsx(L8,{}),d.jsx("nav",{className:"bb-subtab-strip",role:"tablist","aria-label":"Chatbot sub-sections",children:c0.map(b=>d.jsx("button",{role:"tab","aria-selected":o===b.key,className:`bb-subtab ${o===b.key?"bb-subtab-active":""}`,onClick:()=>l(b.key),children:b.label},b.key))}),d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:p.label}),d.jsx(z8,{isSaving:r,lastSavedAt:i,idleCopy:p.aside??null})]}),o==="look"&&d.jsxs("div",{className:"bb-chatbot-grid",children:[d.jsxs("div",{className:"bb-chatbot-main",children:[d.jsx(C8,{settings:e,save:n,onAdjustCrop:h,onUploaded:b=>f(b)}),d.jsx(O8,{settings:e,save:n}),d.jsx(T8,{settings:e,save:n,onAdjustCrop:h})]}),d.jsx("aside",{className:"bb-chatbot-aside",children:d.jsx(_6,{settings:e})})]}),o==="behaviour"&&d.jsx(k8,{settings:e,save:n,isSaving:r}),u&&d.jsx(N6,{imageUrl:u,fabShape:e.widgetShape==="pill"?"pill":"rounded",initial:Eb(e.avatarTransform),onCancel:()=>f(null),onSave:b=>{n({avatarTransform:JSON.stringify(b)}),f(null)}})]})}function k8({settings:e,save:t,isSaving:n}){const r=(e.customInstructions??"").trim().length>0,i=(e.offTopicGuardrails??"").trim().length>0,o=r&&i;return d.jsxs("div",{className:"bb-subpane",children:[d.jsx(I8,{ok:o,okText:"Bot voice and guardrails are set.",nudgeText:!r&&!i?"Add a style note and topics to avoid for safer, on-brand replies.":r?"List topics the bot should refuse for safer replies.":"Add a style note so every reply sounds like you."}),d.jsx(u0,{title:"Bot voice",help:"A short style note that shapes every reply.",value:e.customInstructions??"",placeholder:"be friendly, lean concise, always recommend booking a demo for pricing questions",onSave:l=>t({customInstructions:l}),isSaving:n,saveLabel:"instructions"}),d.jsx(u0,{title:"Off-topic guardrails",help:"Topics the bot must refuse. One per line.",value:e.offTopicGuardrails??"",placeholder:`competitor product comparisons 149 149 legal advice 150 150 medical advice`,onSave:l=>t({offTopicGuardrails:l}),isSaving:n,saveLabel:"guardrails"}),d.jsx(u0,{title:"Hide widget on these pages",help:"URL paths where the chat bubble shouldn't appear. One per line. Use * for wildcards. Empty = show everywhere.",value:e.hideOnPages??"",placeholder:`/checkout 151 151 /cart 152 152 /thank-you 153 /account/*`,onSave:l=>t({hideOnPages:l}),isSaving:n,saveLabel:"excluded pages"})]})}function k8(){const{enabled:e,pending:t,toggle:n}=t5();return d.jsxs("div",{className:`bb-widget-master ${e?"":"bb-widget-master-off"}`,children:[d.jsxs("div",{className:"bb-widget-master-body",children:[d.jsx("strong",{className:"bb-widget-master-title",children:e?"Widget is live on your site":"Widget is hidden from visitors"}),d.jsx("span",{className:"bb-widget-master-help",children:e?"Visitors see the chat bubble on every page that isn't excluded.":"Turn this back on to show the chat bubble. Useful during a relaunch or maintenance window."})]}),d.jsxs("label",{className:"bb-toggle-switch","aria-label":"Show widget on site",children:[d.jsx("input",{type:"checkbox",checked:e,disabled:t,onChange:r=>n(r.target.checked)}),d.jsx("span",{className:"bb-toggle-switch-track","aria-hidden":"true",children:d.jsx("span",{className:"bb-toggle-switch-thumb"})})]})]})}function L8({ok:e,okText:t,nudgeText:n}){return d.jsxs("div",{className:`bb-status-card ${e?"bb-status-card-ok":"bb-status-card-nudge"}`,children:[d.jsx("span",{className:"bb-status-card-dot","aria-hidden":"true"}),d.jsx("span",{className:"bb-status-card-text",children:e?t:n})]})}function I8({isSaving:e,lastSavedAt:t,idleCopy:n}){const[i,o]=v.useState(!1);return v.useEffect(()=>{if(!t)return;o(!0);const l=setTimeout(()=>o(!1),2e3);return()=>clearTimeout(l)},[t]),e?d.jsx("span",{className:"bb-section-aside bb-save-status bb-save-status-saving",children:"Saving…"}):i?d.jsx("span",{className:"bb-section-aside bb-save-status bb-save-status-saved",children:"Saved ✓"}):n?d.jsx("span",{className:"bb-section-aside",children:n}):null}function u0({title:e,help:t,value:n,placeholder:r,onSave:i,isSaving:o,saveLabel:l}){const[u,f]=v.useState(n),h=v.useRef(!1);v.useEffect(()=>{h.current||(f(n),h.current=!0)},[n]);const p=u!==n;return d.jsxs(Lr,{title:e,children:[d.jsx("p",{className:"bb-field-help",style:{marginTop:0},children:t}),d.jsx("textarea",{className:"bb-input bb-textarea",rows:6,value:u,onChange:b=>f(b.target.value),placeholder:r,maxLength:2e3}),p&&d.jsx("div",{style:{marginTop:12},children:d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",disabled:o,onClick:()=>i(u),children:o?"Saving…":`Save ${l}`})})]})}const _l="bb_devmockapikey0000000000000000",dE=Date.now(),yp=e=>new Date(dE-e*6e4).toISOString(),Zr=e=>new Date(dE-e*60*6e4).toISOString(),_d=e=>new Date(dE-e*24*60*6e4).toISOString(),Bc=[{id:"1",name:"Maria Silva",email:"maria.silva@email.com",phone:"+55 21 9988-1234",message:"Olá, gostaria de saber valores para evento corporativo no Rio em julho.",source:"chat",formId:null,stage:"new",researchSummary:null,suggestedAction:null,conversationId:"c-1",ipAddress:"189.5.12.7",country:"Brazil",city:"Rio de Janeiro",createdAt:yp(3),viewedAt:null,promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null},{id:"2",name:"Ricardo Fontes",email:"ricardo.fontes@empresa.com.br",phone:"+55 11 9555-2233",message:"Quero orçamento para evento corporativo. 200 convidados, julho.",source:"Pedir Orçamento",formId:"f1",stage:"new",researchSummary:null,suggestedAction:null,conversationId:null,ipAddress:"177.33.4.10",country:"Brazil",city:"São Paulo",createdAt:yp(38),viewedAt:null,promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null},{id:"3",name:"João Almeida",email:"j.almeida@hotmail.com",phone:null,message:"Queria saber se vocês cobrem São Paulo, e qual o pacote mínimo.",source:"chat",formId:null,stage:"contacted",researchSummary:"Small wedding planner in SP, 80% Instagram referrals. Likely budget-conscious.",suggestedAction:'Send the "starter package" PDF with the 4-hr option.',conversationId:"c-3",ipAddress:"201.42.99.1",country:"Brazil",city:"São Paulo",createdAt:Zr(2),viewedAt:Zr(1.5),promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null},{id:"4",name:"Camila Rocha",email:"camila@rochaeventos.com.br",phone:"+55 21 9876-1111",message:null,source:"chat",formId:null,stage:"qualified",researchSummary:"Wedding planner with 14 years experience, owns 2 venues in RJ.",suggestedAction:"Offer the partnership rate (15% off) for >5 referrals/yr.",conversationId:"c-4",ipAddress:"189.0.5.4",country:"Brazil",city:"Rio de Janeiro",createdAt:_d(1),viewedAt:Zr(8),promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null},{id:"5",name:"Eduardo Lima",email:"lima.edu@gmail.com",phone:null,message:"Vocês fazem destination weddings?",source:"chat",formId:null,stage:"won",researchSummary:null,suggestedAction:null,conversationId:"c-5",ipAddress:"177.12.3.9",country:"Brazil",city:"Porto Alegre",createdAt:_d(3),viewedAt:_d(2.5),promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null},{id:"6",name:"Bia Cardoso",email:"bia@bcardoso.io",phone:null,message:"Saber mais sobre vocês.",source:"chat",formId:null,stage:"lost",researchSummary:null,suggestedAction:null,conversationId:"c-6",ipAddress:"187.5.5.5",country:"Brazil",city:"Belo Horizonte",createdAt:_d(7),viewedAt:_d(7),promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null}],z8={3:[{id:"a1",type:"note",content:"Replied with starter package PDF.",createdAt:Zr(1.5)},{id:"a2",type:"stage_change",content:"new → contacted",createdAt:Zr(1.4)},{id:"a3",type:"research_complete",content:"AI research finished — see panel.",createdAt:Zr(1.2)}],4:[{id:"a4",type:"note",content:"Connected on LinkedIn after research.",createdAt:Zr(7)},{id:"a5",type:"stage_change",content:"contacted → qualified",createdAt:Zr(5)}]},U8={3:[{id:"e1",subject:"Your starter package · BitBot Events",body:`Olá João,154 155 Obrigado pelo interesse...`,status:"sent",scheduledAt:null,sentAt:Zr(1.5),createdAt:Zr(1.5)}]}, q8={1:[{role:"user",content:"Olá, gostaria de saber valores para evento corporativo no Rio em julho.",createdAt:yp(3)},{role:"assistant",content:"Olá Maria! Temos pacotes a partir de R$ 12.000 para eventos corporativos. Quantos convidados e qual a data?",createdAt:yp(2)}],3:[{role:"user",content:"Queria saber se vocês cobrem São Paulo, e qual o pacote mínimo.",createdAt:Zr(2)},{role:"assistant",content:"Olá João! Cobrimos sim, e nosso pacote inicial é R$ 4.800 para 4 horas. Posso te enviar o PDF detalhado?",createdAt:Zr(2)},{role:"user",content:"Por favor, e-mail j.almeida@hotmail.com",createdAt:Zr(1.95)}]},B8=50;function fE({stage:e="all",search:t="",formId:n=null,country:r=null,via:i=null}={}){var p,b,g;const l=Re().apiKey===_l,u=xb({queryKey:["leads",e,t,n,r,i],initialPageParam:1,queryFn:async({pageParam:x})=>{if(l){const S=Bc.filter(A=>!(e!=="all"&&A.stage!==e||t&&!`${A.name} ${A.email}`.toLowerCase().includes(t.toLowerCase())||n&&A.formId!==n||r&&A.country!==r));return{leads:S,total:S.length,page:x,pageSize:S.length}}const E=await me("GetLeads",{stage:e==="all"?void 0:e,search:t||void 0,formId:n||void 0,country:r||void 0,via:i||void 0,page:x,pageSize:B8});if(!E.success)throw new Error(E.error);return E.data},getNextPageParam:x=>x.page*x.pageSize<x.total?x.page+1:void 0,staleTime:30*1e3,placeholderData:Pf}),f=(((p=u.data)==null?void 0:p.pages)??[]).flatMap(x=>x.leads),h=((g=(b=u.data)==null?void 0:b.pages[0])==null?void 0:g.total)??f.length;return{data:u.data?{leads:f,total:h,page:1,pageSize:f.length}:void 0,leads:f,total:h,isLoading:u.isLoading,isFetchingNextPage:u.isFetchingNextPage,hasNextPage:!!u.hasNextPage,fetchNextPage:()=>u.fetchNextPage()}}function F8({stage:e="all",search:t="",formId:n=null,country:r=null,via:i=null}={}){const l=Re().apiKey===_l;return Et({queryKey:["lead-facets",e,t,n,r,i],queryFn:async()=>{if(l)return{locations:[],via:[]};const u=await me("GetLeadFacets",{stage:e==="all"?void 0:e,search:t||void 0,formId:n||void 0,country:r||void 0,via:i||void 0});return u.success?u.data:{locations:[],via:[]}},staleTime:30*1e3,placeholderData:Pf})}function $8(){const t=Re().apiKey===_l,n={leads:0,forms:0,conversations:0,appointments:0,total:0};return Et({queryKey:["menu-badges"],queryFn:async()=>{if(t){const i=Bc.filter(o=>o.viewedAt===null).length;return{leads:i,forms:0,conversations:0,appointments:0,total:i}}const r=await me("GetMenuBadgeCounts");return r.success?r.data:n},refetchInterval:3e4,refetchIntervalInBackground:!1,staleTime:15e3})}function K8(e){const t=Ne(),r=Re().apiKey===_l;return Et({queryKey:["lead",e],queryFn:async()=>{if(!e)throw new Error("No lead id");if(r){const o=Bc.find(l=>l.id===e);if(!o)throw new Error("Lead not found");return{lead:o,activities:z8[e]??[],emails:U8[e]??[],conversationMessages:q8[e]??[]}}const i=await me("GetLead",{leadId:e});if(!i.success)throw new Error(i.error);return i.data.lead.viewedAt===null&&t.invalidateQueries({queryKey:["unviewed-leads"]}),i.data},enabled:!!e,staleTime:15*1e3,placeholderData:Pf})}function H8(){const e=Ne(),n=Re().apiKey===_l;return je({mutationFn:async r=>{if(n){const o=Bc.findIndex(l=>l.id===r);return o>=0&&(Bc[o]={...Bc[o],promotedFromFormAt:new Date().toISOString()}),{success:!0}}const i=await me("PromoteFormResponseToLead",{leadId:r});if(!i.success)throw new Error(i.error);return i.data},onSuccess:(r,i)=>{le.success("Added to Leads"),e.setQueriesData({queryKey:["leads"]},o=>!o||!o.leads?o:{...o,leads:o.leads.map(l=>l.id===i?{...l,promotedFromFormAt:new Date().toISOString()}:l)}),e.invalidateQueries({queryKey:["leads"]}),e.invalidateQueries({queryKey:["unviewed-leads-count"]})},onError:r=>le.error(r instanceof Error?r.message:"Could not promote")})}function G8(){const e=Ne(),n=Re().apiKey===_l;return je({mutationFn:async({leadId:r})=>{if(n)return await new Promise(o=>setTimeout(o,1500)),{summary:"Wedding planner in São Paulo, ~5 years experience. Active on Instagram (@plannerinha) with 8k followers.",suggestedAction:"Send the partnership rate (15% off, paid yearly).",nextSteps:["Send pricing PDF","Schedule a 20-min discovery call","Add to monthly newsletter"]};const i=await me("RunLeadResearch",{leadId:r});if(!i.success)throw new Error(i.error);return i.data},onSuccess:(r,{leadId:i})=>{le.success("Research complete"),e.invalidateQueries({queryKey:["lead",i]})},onError:r=>le.error(r instanceof Error?r.message:"Research failed")})}function Y8(){const t=Re().apiKey===_l;return je({mutationFn:async({leadId:n})=>{if(t)return await new Promise(i=>setTimeout(i,800)),{subject:"Following up on your enquiry · BitBot Events",body:`Hi there,153 /account/*`,onSave:l=>t({hideOnPages:l}),isSaving:n,saveLabel:"excluded pages"})]})}function L8(){const{enabled:e,pending:t,toggle:n}=n5();return d.jsxs("div",{className:`bb-widget-master ${e?"":"bb-widget-master-off"}`,children:[d.jsxs("div",{className:"bb-widget-master-body",children:[d.jsx("strong",{className:"bb-widget-master-title",children:e?"Widget is live on your site":"Widget is hidden from visitors"}),d.jsx("span",{className:"bb-widget-master-help",children:e?"Visitors see the chat bubble on every page that isn't excluded.":"Turn this back on to show the chat bubble. Useful during a relaunch or maintenance window."})]}),d.jsxs("label",{className:"bb-toggle-switch","aria-label":"Show widget on site",children:[d.jsx("input",{type:"checkbox",checked:e,disabled:t,onChange:r=>n(r.target.checked)}),d.jsx("span",{className:"bb-toggle-switch-track","aria-hidden":"true",children:d.jsx("span",{className:"bb-toggle-switch-thumb"})})]})]})}function I8({ok:e,okText:t,nudgeText:n}){return d.jsxs("div",{className:`bb-status-card ${e?"bb-status-card-ok":"bb-status-card-nudge"}`,children:[d.jsx("span",{className:"bb-status-card-dot","aria-hidden":"true"}),d.jsx("span",{className:"bb-status-card-text",children:e?t:n})]})}function z8({isSaving:e,lastSavedAt:t,idleCopy:n}){const[i,o]=v.useState(!1);return v.useEffect(()=>{if(!t)return;o(!0);const l=setTimeout(()=>o(!1),2e3);return()=>clearTimeout(l)},[t]),e?d.jsx("span",{className:"bb-section-aside bb-save-status bb-save-status-saving",children:"Saving…"}):i?d.jsx("span",{className:"bb-section-aside bb-save-status bb-save-status-saved",children:"Saved ✓"}):n?d.jsx("span",{className:"bb-section-aside",children:n}):null}function u0({title:e,help:t,value:n,placeholder:r,onSave:i,isSaving:o,saveLabel:l}){const[u,f]=v.useState(n),h=v.useRef(!1);v.useEffect(()=>{h.current||(f(n),h.current=!0)},[n]);const p=u!==n;return d.jsxs(Lr,{title:e,children:[d.jsx("p",{className:"bb-field-help",style:{marginTop:0},children:t}),d.jsx("textarea",{className:"bb-input bb-textarea",rows:6,value:u,onChange:b=>f(b.target.value),placeholder:r,maxLength:2e3}),p&&d.jsx("div",{style:{marginTop:12},children:d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",disabled:o,onClick:()=>i(u),children:o?"Saving…":`Save ${l}`})})]})}const _l="bb_devmockapikey0000000000000000",dE=Date.now(),yp=e=>new Date(dE-e*6e4).toISOString(),Zr=e=>new Date(dE-e*60*6e4).toISOString(),Dd=e=>new Date(dE-e*24*60*6e4).toISOString(),Bc=[{id:"1",name:"Maria Silva",email:"maria.silva@email.com",phone:"+55 21 9988-1234",message:"Olá, gostaria de saber valores para evento corporativo no Rio em julho.",source:"chat",formId:null,stage:"new",researchSummary:null,suggestedAction:null,conversationId:"c-1",ipAddress:"189.5.12.7",country:"Brazil",city:"Rio de Janeiro",createdAt:yp(3),viewedAt:null,promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null},{id:"2",name:"Ricardo Fontes",email:"ricardo.fontes@empresa.com.br",phone:"+55 11 9555-2233",message:"Quero orçamento para evento corporativo. 200 convidados, julho.",source:"Pedir Orçamento",formId:"f1",stage:"new",researchSummary:null,suggestedAction:null,conversationId:null,ipAddress:"177.33.4.10",country:"Brazil",city:"São Paulo",createdAt:yp(38),viewedAt:null,promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null},{id:"3",name:"João Almeida",email:"j.almeida@hotmail.com",phone:null,message:"Queria saber se vocês cobrem São Paulo, e qual o pacote mínimo.",source:"chat",formId:null,stage:"contacted",researchSummary:"Small wedding planner in SP, 80% Instagram referrals. Likely budget-conscious.",suggestedAction:'Send the "starter package" PDF with the 4-hr option.',conversationId:"c-3",ipAddress:"201.42.99.1",country:"Brazil",city:"São Paulo",createdAt:Zr(2),viewedAt:Zr(1.5),promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null},{id:"4",name:"Camila Rocha",email:"camila@rochaeventos.com.br",phone:"+55 21 9876-1111",message:null,source:"chat",formId:null,stage:"qualified",researchSummary:"Wedding planner with 14 years experience, owns 2 venues in RJ.",suggestedAction:"Offer the partnership rate (15% off) for >5 referrals/yr.",conversationId:"c-4",ipAddress:"189.0.5.4",country:"Brazil",city:"Rio de Janeiro",createdAt:Dd(1),viewedAt:Zr(8),promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null},{id:"5",name:"Eduardo Lima",email:"lima.edu@gmail.com",phone:null,message:"Vocês fazem destination weddings?",source:"chat",formId:null,stage:"won",researchSummary:null,suggestedAction:null,conversationId:"c-5",ipAddress:"177.12.3.9",country:"Brazil",city:"Porto Alegre",createdAt:Dd(3),viewedAt:Dd(2.5),promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null},{id:"6",name:"Bia Cardoso",email:"bia@bcardoso.io",phone:null,message:"Saber mais sobre vocês.",source:"chat",formId:null,stage:"lost",researchSummary:null,suggestedAction:null,conversationId:"c-6",ipAddress:"187.5.5.5",country:"Brazil",city:"Belo Horizonte",createdAt:Dd(7),viewedAt:Dd(7),promotedFromFormAt:null,zohoLeadId:null,zohoSyncedAt:null,channel:"web_widget",channelProfile:null}],U8={3:[{id:"a1",type:"note",content:"Replied with starter package PDF.",createdAt:Zr(1.5)},{id:"a2",type:"stage_change",content:"new → contacted",createdAt:Zr(1.4)},{id:"a3",type:"research_complete",content:"AI research finished — see panel.",createdAt:Zr(1.2)}],4:[{id:"a4",type:"note",content:"Connected on LinkedIn after research.",createdAt:Zr(7)},{id:"a5",type:"stage_change",content:"contacted → qualified",createdAt:Zr(5)}]},q8={3:[{id:"e1",subject:"Your starter package · BitBot Events",body:`Olá João, 154 155 Obrigado pelo interesse...`,status:"sent",scheduledAt:null,sentAt:Zr(1.5),createdAt:Zr(1.5)}]},B8={1:[{role:"user",content:"Olá, gostaria de saber valores para evento corporativo no Rio em julho.",createdAt:yp(3)},{role:"assistant",content:"Olá Maria! Temos pacotes a partir de R$ 12.000 para eventos corporativos. Quantos convidados e qual a data?",createdAt:yp(2)}],3:[{role:"user",content:"Queria saber se vocês cobrem São Paulo, e qual o pacote mínimo.",createdAt:Zr(2)},{role:"assistant",content:"Olá João! Cobrimos sim, e nosso pacote inicial é R$ 4.800 para 4 horas. Posso te enviar o PDF detalhado?",createdAt:Zr(2)},{role:"user",content:"Por favor, e-mail j.almeida@hotmail.com",createdAt:Zr(1.95)}]},F8=50;function fE({stage:e="all",search:t="",formId:n=null,country:r=null,via:i=null}={}){var p,b,g;const l=Re().apiKey===_l,u=xb({queryKey:["leads",e,t,n,r,i],initialPageParam:1,queryFn:async({pageParam:x})=>{if(l){const S=Bc.filter(A=>!(e!=="all"&&A.stage!==e||t&&!`${A.name} ${A.email}`.toLowerCase().includes(t.toLowerCase())||n&&A.formId!==n||r&&A.country!==r));return{leads:S,total:S.length,page:x,pageSize:S.length}}const E=await me("GetLeads",{stage:e==="all"?void 0:e,search:t||void 0,formId:n||void 0,country:r||void 0,via:i||void 0,page:x,pageSize:F8});if(!E.success)throw new Error(E.error);return E.data},getNextPageParam:x=>x.page*x.pageSize<x.total?x.page+1:void 0,staleTime:30*1e3,placeholderData:Su}),f=(((p=u.data)==null?void 0:p.pages)??[]).flatMap(x=>x.leads),h=((g=(b=u.data)==null?void 0:b.pages[0])==null?void 0:g.total)??f.length;return{data:u.data?{leads:f,total:h,page:1,pageSize:f.length}:void 0,leads:f,total:h,isLoading:u.isLoading,isFetchingNextPage:u.isFetchingNextPage,hasNextPage:!!u.hasNextPage,fetchNextPage:()=>u.fetchNextPage()}}function $8({stage:e="all",search:t="",formId:n=null,country:r=null,via:i=null}={}){const l=Re().apiKey===_l;return Et({queryKey:["lead-facets",e,t,n,r,i],queryFn:async()=>{if(l)return{locations:[],via:[]};const u=await me("GetLeadFacets",{stage:e==="all"?void 0:e,search:t||void 0,formId:n||void 0,country:r||void 0,via:i||void 0});return u.success?u.data:{locations:[],via:[]}},staleTime:30*1e3,placeholderData:Su})}function K8(){const t=Re().apiKey===_l,n={leads:0,forms:0,conversations:0,appointments:0,total:0};return Et({queryKey:["menu-badges"],queryFn:async()=>{if(t){const i=Bc.filter(o=>o.viewedAt===null).length;return{leads:i,forms:0,conversations:0,appointments:0,total:i}}const r=await me("GetMenuBadgeCounts");return r.success?r.data:n},refetchInterval:3e4,refetchIntervalInBackground:!1,staleTime:15e3})}function H8(e){const t=Ne(),r=Re().apiKey===_l;return Et({queryKey:["lead",e],queryFn:async()=>{if(!e)throw new Error("No lead id");if(r){const o=Bc.find(l=>l.id===e);if(!o)throw new Error("Lead not found");return{lead:o,activities:U8[e]??[],emails:q8[e]??[],conversationMessages:B8[e]??[]}}const i=await me("GetLead",{leadId:e});if(!i.success)throw new Error(i.error);return i.data.lead.viewedAt===null&&t.invalidateQueries({queryKey:["unviewed-leads"]}),i.data},enabled:!!e,staleTime:15*1e3,placeholderData:Su})}function G8(){const e=Ne(),n=Re().apiKey===_l;return je({mutationFn:async r=>{if(n){const o=Bc.findIndex(l=>l.id===r);return o>=0&&(Bc[o]={...Bc[o],promotedFromFormAt:new Date().toISOString()}),{success:!0}}const i=await me("PromoteFormResponseToLead",{leadId:r});if(!i.success)throw new Error(i.error);return i.data},onSuccess:(r,i)=>{le.success("Added to Leads"),e.setQueriesData({queryKey:["leads"]},o=>!o||!o.leads?o:{...o,leads:o.leads.map(l=>l.id===i?{...l,promotedFromFormAt:new Date().toISOString()}:l)}),e.invalidateQueries({queryKey:["leads"]}),e.invalidateQueries({queryKey:["unviewed-leads-count"]})},onError:r=>le.error(r instanceof Error?r.message:"Could not promote")})}function Y8(){const e=Ne(),n=Re().apiKey===_l;return je({mutationFn:async({leadId:r})=>{if(n)return await new Promise(o=>setTimeout(o,1500)),{summary:"Wedding planner in São Paulo, ~5 years experience. Active on Instagram (@plannerinha) with 8k followers.",suggestedAction:"Send the partnership rate (15% off, paid yearly).",nextSteps:["Send pricing PDF","Schedule a 20-min discovery call","Add to monthly newsletter"]};const i=await me("RunLeadResearch",{leadId:r});if(!i.success)throw new Error(i.error);return i.data},onSuccess:(r,{leadId:i})=>{le.success("Research complete"),e.invalidateQueries({queryKey:["lead",i]})},onError:r=>le.error(r instanceof Error?r.message:"Research failed")})}function W8(){const t=Re().apiKey===_l;return je({mutationFn:async({leadId:n})=>{if(t)return await new Promise(i=>setTimeout(i,800)),{subject:"Following up on your enquiry · BitBot Events",body:`Hi there, 156 156 157 157 Thanks for reaching out about our events services. I noticed you... 158 158 159 159 Best, 160 The BitBot team`};const r=await me("DraftLeadEmail",{leadId:n});if(!r.success)throw new Error(r.error);return r.data},onSuccess:()=>le.success("Draft generated"),onError:n=>le.error(n instanceof Error?n.message:"Draft failed")})}function W8(){const e=Ne();return je({mutationFn:async({leadId:t})=>{const n=await me("DeleteLead",{leadId:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:()=>{le.success("Lead deleted"),e.invalidateQueries({queryKey:["leads"]}),e.invalidateQueries({queryKey:["lead"]}),e.invalidateQueries({queryKey:["unviewed-leads"]}),e.invalidateQueries({queryKey:["menu-badges"]})},onError:t=>le.error(t instanceof Error?t.message:"Delete failed")})}function Q8(){const e=Ne();return je({mutationFn:async({leadIds:t})=>{const n=await me("DeleteLeads",{leadIds:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:t=>{le.success(`Deleted ${t.leadsDeleted} ${t.leadsDeleted===1?"lead":"leads"}`),e.invalidateQueries({queryKey:["leads"]}),e.invalidateQueries({queryKey:["lead"]}),e.invalidateQueries({queryKey:["unviewed-leads"]}),e.invalidateQueries({queryKey:["menu-badges"]})},onError:t=>le.error(t instanceof Error?t.message:"Delete failed")})}function V8(){const e=Ne();return je({mutationFn:async({leadIds:t})=>{const n=await me("MarkLeadsRead",{leadIds:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:t=>{le.success(`Marked ${t.marked} ${t.marked===1?"lead":"leads"} read`),e.invalidateQueries({queryKey:["leads"]}),e.invalidateQueries({queryKey:["unviewed-leads"]}),e.invalidateQueries({queryKey:["menu-badges"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not mark read")})}const zf="bb_devmockapikey0000000000000000",X8={tier:"premium",trialEndsAt:null,currentPeriodEnd:new Date(Date.now()+27*864e5).toISOString(),isActive:!0,subscriptionStatus:"active",daysRemaining:27};function hE(){const t=Re().apiKey===zf;return Et({queryKey:["subscription"],queryFn:async()=>{if(t)return X8;const n=await me("GetSubscription");if(!n.success)throw new Error(n.error);return n.data},staleTime:300*1e3})}function Z8(){const e=Ne(),n=Re().apiKey===zf;return je({mutationFn:async()=>{if(n)return await new Promise(i=>setTimeout(i,500)),{success:!0,message:"Subscription will end at period end"};const r=await me("CancelSubscription");if(!r.success)throw new Error(r.error);return r.data},onSuccess:r=>{le.success(r.message),e.invalidateQueries({queryKey:["subscription"]}),e.invalidateQueries({queryKey:["plan-status"]})},onError:r=>le.error(r instanceof Error?r.message:"Cancel failed")})}function J8(){const e=Ne(),n=Re().apiKey===zf;return je({mutationFn:async()=>{if(n)return await new Promise(i=>setTimeout(i,500)),{success:!0,message:"Subscription reactivated"};const r=await me("ReactivateSubscription");if(!r.success)throw new Error(r.error);return r.data},onSuccess:r=>{le.success(r.message),e.invalidateQueries({queryKey:["subscription"]})},onError:r=>le.error(r instanceof Error?r.message:"Reactivate failed")})}function eH(){const t=Re().apiKey===zf;return je({mutationFn:async n=>{if(t)return await new Promise(l=>setTimeout(l,400)),{checkoutUrl:"https://checkout.stripe.com/c/test_xxx"};const r=new URL(window.location.href);r.searchParams.set("subscription","success"),r.searchParams.set("swap","1");const i=window.location.href,o=await me("CreateCheckout",{successUrl:r.toString(),cancelUrl:i,tier:n});if(!o.success)throw new Error(o.error);return o.data},onSuccess:n=>{if(n.checkoutUrl){window.location.href=n.checkoutUrl;return}const r=new URL(window.location.href);r.searchParams.set("subscription","success"),r.searchParams.set("swap","1"),window.location.href=r.toString()},onError:n=>le.error(n instanceof Error?n.message:"Could not start checkout")})}function tH(){const t=Re().apiKey===zf;return je({mutationFn:async()=>{if(t)return await new Promise(r=>setTimeout(r,300)),{url:"https://billing.stripe.com/p/login/test_xxx"};const n=await me("GetBillingPortal",{returnUrl:window.location.href});if(!n.success)throw new Error(n.error);return n.data},onSuccess:n=>{window.location.href=n.url},onError:n=>le.error(n instanceof Error?n.message:"Portal failed")})}function kc(e){if(!e)return"";try{return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}catch{return""}}function gs({open:e,onClose:t}){const{data:n}=Ai(),{data:r}=hE(),i=eH(),o=Z8(),l=J8(),[u,f]=v.useState(null);if(v.useEffect(()=>{if(!e)return;const C=O=>{O.key==="Escape"&&t()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[e,t]),!e||!n)return null;const h=n.plan,p=n.accessMode,b=(r==null?void 0:r.currentPeriodEnd)??null,g=(r==null?void 0:r.subscriptionStatus)==="cancelled",x=p==="expired"?"Expired — subscribe to continue":h==="pro"&&g?`Assistant · ends ${kc(b)}`:h==="pro_plus"&&g?`Agent · ends ${kc(b)}`:h==="pro"?`Assistant · active${b?` · renews ${kc(b)}`:""}`:h==="pro_plus"?`Agent · active${b?` · renews ${kc(b)}`:""}`:`Free · ${n.usage.leadsCount} leads · ${n.usage.chatMessagesThisMonth}/${n.limits.chatMessagesPerMonth} chat this month`,E=C=>h===C&&p==="active"&&!g?{label:"Current plan",action:"current",tone:"ghost"}:h===C&&g?{label:`Reactivate ${C==="pro"?"Assistant":"Agent"}`,action:"reactivate",tone:"primary"}:p==="expired"?{label:`Subscribe — ${C==="pro"?"Assistant":"Agent"}`,action:"upgrade",tone:"primary"}:h==="pro_plus"&&C==="pro"?{label:"Downgrade →",action:"downgrade",tone:"danger"}:h==="pro"&&C==="pro_plus"?{label:"Upgrade to Agent →",action:"upgrade",tone:"primary"}:{label:`Upgrade to ${C==="pro"?"Assistant":"Agent"} →`,action:"upgrade",tone:"primary"},S=C=>{const{action:O}=E(C);if(O!=="current"){if(O==="reactivate"){l.mutate();return}if(O==="downgrade"){f(C);return}i.mutate(C)}},A=()=>{u&&(u==="free"?o.mutate():i.mutate(u),f(null))},j=i.isPending||o.isPending||l.isPending;return Vn.createPortal(d.jsxs("div",{className:"bb-modal-backdrop bb-portal-scope",onClick:t,children:[d.jsxs("div",{className:"bb-modal bb-changeplan-modal",onClick:C=>C.stopPropagation(),role:"dialog","aria-modal":"true",children:[d.jsxs("header",{className:"bb-modal-head",children:[d.jsxs("div",{className:"bb-modal-titles",children:[d.jsx("h3",{className:"bb-modal-title",children:"Change plan"}),d.jsx("span",{className:"bb-modal-aside",children:x})]}),d.jsx("button",{className:"bb-modal-close",onClick:t,"aria-label":"Close",children:"×"})]}),d.jsxs("div",{className:"bb-modal-body",children:[d.jsxs("div",{className:"bb-changeplan-grid",children:[d.jsx(bT,{name:"Assistant",price:"$20",tagline:"Everything in Free, plus full access.",features:["Unlimited chat replies","All your captured leads, unlocked","AI post generation (unlimited)","Unlimited topic searches","Unlimited forms","Stage tracking, notes, AI lead research"],button:E("pro"),onClick:()=>S("pro"),disabled:j}),d.jsx(bT,{name:"Agent",price:"$49",tagline:"Everything in Assistant, plus integrations and the AI co-pilot.",features:["Replies on Facebook and Instagram","Sends leads to Zoho CRM","Knows your WooCommerce products, orders & stock","Acts on your behalf — books, updates, follows up","Your own AI co-pilot inside the admin"],button:E("pro_plus"),onClick:()=>S("pro_plus"),disabled:j})]}),(h==="pro"||h==="pro_plus")&&!g&&p==="active"&&d.jsxs("div",{className:"bb-changeplan-cancel",children:[d.jsx("button",{type:"button",className:"bb-changeplan-cancel-link",disabled:j,onClick:()=>f("free"),children:"Cancel and drop to Free →"}),d.jsxs("span",{className:"bb-changeplan-cancel-note",children:["You'll keep paid access until ",kc(b)||"your period ends","."]})]})]})]}),u&&d.jsx(nH,{target:u,currentPlan:h,periodEnd:b,onCancel:()=>f(null),onConfirm:A,pending:j})]}),document.body)}function bT({name:e,price:t,tagline:n,features:r,button:i,onClick:o,disabled:l}){const u=i.tone==="primary"?"bb-btn bb-btn-primary":i.tone==="danger"?"bb-btn bb-btn-ghost bb-changeplan-btn-danger":"bb-btn bb-btn-ghost";return d.jsxs("article",{className:`bb-changeplan-col ${i.action==="current"?"bb-changeplan-col-current":""}`,children:[d.jsxs("header",{children:[d.jsx("h4",{className:"bb-changeplan-name",children:e}),d.jsxs("p",{className:"bb-changeplan-price",children:[t,d.jsx("span",{className:"bb-changeplan-price-sub",children:"/mo"})]}),d.jsx("p",{className:"bb-changeplan-tagline",children:n})]}),d.jsx("ul",{className:"bb-changeplan-features",children:r.map(f=>d.jsx("li",{children:f},f))}),d.jsx("button",{type:"button",className:u,disabled:l||i.action==="current",onClick:o,children:i.label})]})}function nH({target:e,currentPlan:t,periodEnd:n,onCancel:r,onConfirm:i,pending:o}){const l=e==="pro"?"Assistant":e==="free"?"Free":"Agent",u=t==="pro_plus";return Vn.createPortal(d.jsx("div",{className:"bb-modal-backdrop bb-modal-backdrop-stack bb-portal-scope",onClick:r,children:d.jsxs("div",{className:"bb-modal bb-changeplan-confirm",onClick:f=>f.stopPropagation(),role:"dialog","aria-modal":"true",children:[d.jsxs("header",{className:"bb-modal-head",children:[d.jsxs("h3",{className:"bb-modal-title",children:["Switch to ",l,"?"]}),d.jsx("button",{className:"bb-modal-close",onClick:r,"aria-label":"Cancel",children:"×"})]}),d.jsxs("div",{className:"bb-modal-body",children:[d.jsx("p",{className:"bb-changeplan-confirm-lede",children:e==="free"?`You'll keep paid access until ${n?kc(n):"your period ends"}, then drop to Free.`:"Stripe will prorate the difference and apply it to your next invoice."}),u&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"bb-changeplan-confirm-section",children:"These will stop working immediately:"}),d.jsxs("ul",{className:"bb-changeplan-confirm-list",children:[d.jsxs("li",{children:["Replies on Facebook and Instagram ",d.jsx("small",{children:"— inbound threads stay visible in Conversations for manual reply"})]}),d.jsxs("li",{children:["Sending leads to Zoho CRM ",d.jsx("small",{children:"— leads already in Zoho stay; new ones won't push"})]}),d.jsx("li",{children:"Knowing your WooCommerce products & orders"}),d.jsx("li",{children:"Your AI co-pilot inside the admin"})]}),d.jsx("p",{className:"bb-changeplan-confirm-note",children:"Connections stay in your account — re-upgrading restores them in one click, no re-setup."})]}),e==="free"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"bb-changeplan-confirm-section",children:"When your period ends:"}),d.jsxs("ul",{className:"bb-changeplan-confirm-list",children:[d.jsx("li",{children:"Chat capped at 50 replies a month"}),d.jsx("li",{children:"AI post generation turns off"}),d.jsx("li",{children:"Topic research turns off"}),d.jsx("li",{children:"Forms capped at 1"})]}),d.jsx("p",{className:"bb-changeplan-confirm-note",children:"Re-upgrade any time to unlock everything."})]}),d.jsxs("div",{className:"bb-changeplan-confirm-actions",children:[d.jsxs("button",{type:"button",className:"bb-btn bb-btn-ghost",onClick:r,disabled:o,children:["Keep ",t==="pro_plus"?"Agent":"Assistant"]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:i,disabled:o,children:o?"Switching…":`Switch to ${l} →`})]})]})]})}),document.body)}function uu({icon:e,headline:t,body:n,ctaLabel:r,onCta:i}){return d.jsxs("div",{className:"bb-empty-state",children:[e&&d.jsx("div",{className:"bb-empty-icon",children:e}),d.jsx("h4",{className:"bb-empty-headline",children:t}),d.jsx("p",{className:"bb-empty-body",children:n}),d.jsx("button",{className:"bb-btn bb-btn-primary",onClick:i,children:r})]})}let xp=null,rH=0;function bi(e){const t=typeof e=="string"?{message:e}:e;return new Promise(n=>{if(!xp){n(window.confirm(t.message));return}xp({id:++rH,resolve:n,...t})})}function aH({children:e}){const[t,n]=v.useState(null),r=v.useRef(null),i=v.useCallback(o=>{n(l=>(l==null||l.resolve(o),null))},[]);return v.useEffect(()=>(xp=o=>n(l=>(l==null||l.resolve(!1),o)),()=>{xp=null}),[]),v.useEffect(()=>{var l;if(!t)return;(l=r.current)==null||l.focus();const o=u=>{u.key==="Escape"?i(!1):u.key==="Enter"&&i(!0)};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t,i]),d.jsxs(d.Fragment,{children:[e,t&&Vn.createPortal(d.jsx("div",{className:"bb-modal-backdrop bb-portal-scope",onClick:o=>{o.target===o.currentTarget&&i(!1)},children:d.jsxs("div",{className:"bb-modal bb-confirm-modal",role:"alertdialog","aria-modal":"true","aria-labelledby":"bb-confirm-dialog-title",onClick:o=>o.stopPropagation(),children:[d.jsxs("div",{className:"bb-modal-head",children:[d.jsx("div",{className:"bb-modal-titles",children:d.jsx("h2",{id:"bb-confirm-dialog-title",className:"bb-modal-title",children:t.title||"Please confirm"})}),d.jsx("button",{type:"button",className:"bb-modal-close",onClick:()=>i(!1),"aria-label":"Cancel",children:"×"})]}),d.jsx("div",{className:"bb-modal-body",children:d.jsx("p",{className:"bb-confirm-modal-body",children:t.message})}),d.jsxs("div",{className:"bb-confirm-modal-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost",onClick:()=>i(!1),children:t.cancelLabel||"Cancel"}),d.jsx("button",{ref:r,type:"button",className:`bb-btn ${t.danger?"bb-btn-destructive":"bb-btn-primary"}`,onClick:()=>i(!0),children:t.confirmLabel||"Confirm"})]})]})}),document.body)]})}function iH({selectedId:e,onSelect:t}){var ee,pe;const[n,r]=v.useState(""),[i,o]=v.useState(null),[l,u]=v.useState(null),[f,h]=v.useState(!1),{leads:p,total:b,isLoading:g,hasNextPage:x,isFetchingNextPage:E,fetchNextPage:S}=fE({search:n,country:i,via:l}),{data:A}=F8({search:n,country:i,via:l}),{data:j}=Ai(),C=(j==null?void 0:j.plan)==="free",O=Rf(),T=f5(),_=((pe=(ee=O.data)==null?void 0:ee.integration)==null?void 0:pe.status)==="connected",[P,D]=v.useState(new Set),L=W8(),z=Q8(),R=V8(),q=v.useMemo(()=>{const k=new Set;for(const Q of p)P.has(Q.id)&&k.add(Q.id);return k},[p,P]),U=q.size,re=U>0&&U===p.length,G=k=>{const Q=new Set(P);Q.has(k)?Q.delete(k):Q.add(k),D(Q)},ie=()=>{D(re?new Set:new Set(p.map(k=>k.id)))},K=()=>D(new Set),Z=async k=>{k.length===0||!await bi({title:`Delete ${k.length} ${k.length===1?"lead":"leads"}?`,message:`The selected ${k.length===1?"lead will be":"leads will be"} permanently removed from your inbox. This can't be undone.`,confirmLabel:`Delete ${k.length} ${k.length===1?"lead":"leads"}`,danger:!0})||(k.length===1?await L.mutateAsync({leadId:k[0]}).catch(()=>null):await z.mutateAsync({leadIds:k}).catch(()=>null),K())},$=async()=>{U!==0&&(await R.mutateAsync({leadIds:Array.from(q)}).catch(()=>null),K())};return d.jsxs("section",{className:"bb-leads-list",children:[d.jsxs("header",{className:"bb-leads-toolbar",children:[d.jsx("input",{type:"search",className:"bb-input bb-leads-search",placeholder:"Search by name or email",value:n,onChange:k=>r(k.target.value)}),(((A==null?void 0:A.locations.length)??0)>0||((A==null?void 0:A.via.length)??0)>0)&&d.jsxs("div",{className:"bb-leads-filters",children:[((A==null?void 0:A.locations.length)??0)>0&&d.jsxs("select",{className:"bb-input bb-leads-filter",value:i??"",onChange:k=>o(k.target.value||null),"aria-label":"Filter by location",children:[d.jsx("option",{value:"",children:"All locations"}),A.locations.map(k=>d.jsxs("option",{value:k.value,children:[k.value," (",k.count,")"]},k.value))]}),((A==null?void 0:A.via.length)??0)>0&&d.jsxs("select",{className:"bb-input bb-leads-filter",value:l??"",onChange:k=>u(k.target.value||null),"aria-label":"Filter by source",children:[d.jsx("option",{value:"",children:"All sources"}),A.via.map(k=>d.jsxs("option",{value:k.value,children:[k.value," (",k.count,")"]},k.value))]})]}),b>0&&d.jsxs("span",{className:"bb-leads-count",children:[C?null:p.length<b?d.jsxs(d.Fragment,{children:["Showing ",d.jsx("strong",{children:p.length})," of ",b]}):d.jsxs(d.Fragment,{children:[b," ",b===1?"lead":"leads"]}),_&&d.jsx("button",{type:"button",className:"bb-leads-sync-all",onClick:()=>T.mutate(),disabled:T.isPending,title:"Push every lead in this inbox to your Zoho CRM. Duplicates in Zoho are skipped.",children:T.isPending?"Syncing…":"Sync all to Zoho ↗"})]})]}),!g&&U>0&&d.jsxs("div",{className:"bb-conv-bulk-bar",children:[d.jsxs("label",{className:"bb-conv-bulk-select-all",children:[d.jsx("input",{type:"checkbox",checked:re,ref:k=>{k&&(k.indeterminate=U>0&&!re)},onChange:ie,"aria-label":re?"Deselect all":"Select all"}),d.jsx("span",{children:re?`${U} selected (all)`:`${U} selected`})]}),d.jsxs("div",{className:"bb-conv-bulk-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:K,children:"Clear"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:$,disabled:R.isPending,children:R.isPending?"Marking…":"Mark read"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-danger bb-btn-small",onClick:()=>Z(Array.from(q)),disabled:z.isPending,children:`Delete ${U}`})]})]}),d.jsxs("div",{className:"bb-leads-rows",children:[g&&d.jsx("div",{className:"bb-skeleton",style:{height:320,margin:16,borderRadius:8}}),!g&&p.length===0&&(C&&b>0?d.jsx(uu,{headline:`${b} ${b===1?"lead":"leads"} waiting to be unlocked`,body:"Your bot has captured real visitor emails. Upgrade to Assistant to see them, follow up, push to your CRM, and run AI research on each one.",ctaLabel:"Upgrade to view →",onCta:()=>h(!0)}):d.jsx(uu,{headline:"No leads yet",body:"Leads from chat conversations show up here. The chatbot starts capturing emails as soon as visitors ask about pricing, services, or booking.",ctaLabel:"Open the chat to test",onCta:()=>window.open("/","_blank")})),!g&&p.map(k=>{const Q=k.id===e,ce=k.viewedAt===null,fe=q.has(k.id);return d.jsxs("div",{className:`bb-lead-row ${Q?"bb-lead-row-active":""} ${fe?"bb-lead-row-selected":""}`,children:[d.jsx("label",{className:`bb-lead-row-check ${U>0||fe?"bb-lead-row-check-visible":""}`,onClick:xe=>xe.stopPropagation(),children:d.jsx("input",{type:"checkbox",checked:fe,onChange:()=>G(k.id),"aria-label":fe?`Deselect ${k.name||"lead"}`:`Select ${k.name||"lead"}`})}),d.jsxs("button",{className:"bb-lead-row-body",onClick:()=>t(k),children:[d.jsxs("div",{className:"bb-lead-row-top",children:[d.jsxs("div",{className:"bb-lead-row-name",children:[ce&&d.jsx("span",{className:"bb-lead-row-dot","aria-label":"New"}),d.jsx("span",{children:k.name||"(no name)"})]}),d.jsx("span",{className:"bb-lead-row-time",children:ir(k.createdAt)})]}),d.jsx("div",{className:"bb-lead-row-email",children:k.email}),k.message&&d.jsx("div",{className:"bb-lead-row-message",children:mp(k.message,80)}),d.jsxs("div",{className:"bb-lead-row-meta",children:[(()=>{const xe=Hk(k.channel);return k.channel&&k.channel!=="web_widget"?d.jsxs("span",{className:"bb-lead-row-channel",title:`Captured via ${xe.label}`,children:[xe.icon," ",xe.label," ·"]}):null})(),d.jsxs("span",{className:"bb-lead-row-source",children:["via ",Gk(k.source)]}),k.country&&d.jsxs("span",{className:"bb-lead-row-loc",children:["· ",k.city??k.country]}),k.zohoLeadId&&d.jsx("span",{className:"bb-lead-row-zoho",title:"Synced to Zoho CRM",children:"· ✓ Zoho"})]})]}),d.jsx("button",{type:"button",className:"bb-lead-row-delete",title:"Delete this lead","aria-label":`Delete ${k.name||"lead"}`,onClick:xe=>{xe.stopPropagation(),Z([k.id])},children:"🗑"})]},k.id)}),x&&d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-load-more",onClick:()=>S(),disabled:E,children:E?"Loading…":`Load more (${b-p.length} remaining)`})]}),d.jsx(gs,{open:f,onClose:()=>h(!1)})]})}function mE(){return Et({queryKey:["integrations","pipedrive"],queryFn:async()=>{const e=await me("GetPipedriveStatus");if(!e.success)throw new Error(e.error);return e.data},staleTime:6e4})}function oH(){const e=Ne();return je({mutationFn:async({apiToken:t})=>{const n=await me("UpdatePipedriveCredentials",{apiToken:t});if(!n.success)throw new Error(n.error);const r=await me("SetSkillEnabled",{skillName:"pipedrive",enabled:!0});if(!r.success)throw new Error(r.error);return{success:!0}},onSuccess:()=>{le.success("Pipedrive connected"),e.invalidateQueries({queryKey:["integrations","pipedrive"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not connect Pipedrive")})}function sH(){return Et({queryKey:["integrations","pipedrive","auto-sync"],queryFn:async()=>{const e=await me("GetPipedriveAutoSync");if(!e.success)throw new Error(e.error);return e.data.enabled},staleTime:6e4})}function lH(){const e=Ne();return je({mutationFn:async t=>{const n=await me("SetPipedriveAutoSync",{enabled:t});if(!n.success)throw new Error(n.error);return n.data.enabled},onSuccess:t=>{le.success(t?"Auto-sync to Pipedrive turned on":"Auto-sync to Pipedrive turned off"),e.invalidateQueries({queryKey:["integrations","pipedrive","auto-sync"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not update auto-sync")})}function cH(e,t){return Et({queryKey:["leads",e,"pipedrive-state"],queryFn:async()=>{const n=await me("GetPipedriveLeadStateForLead",{leadId:e});if(!n.success)throw new Error(n.error);return n.data.state},enabled:!!e&&t,staleTime:3e4})}function uH(){const e=Ne();return je({mutationFn:async t=>{const n=await me("PushLeadToPipedrive",{leadId:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:()=>{le.success("Lead pushed to Pipedrive"),e.invalidateQueries({queryKey:["leads"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not push lead to Pipedrive")})}function dH(){const e=Ne();return je({mutationFn:async()=>{const t=await me("DisconnectPipedrive");if(!t.success)throw new Error(t.error);const n=await me("SetSkillEnabled",{skillName:"pipedrive",enabled:!1});if(!n.success)throw new Error(n.error);return{success:!0}},onSuccess:()=>{le.success("Pipedrive disconnected"),e.invalidateQueries({queryKey:["integrations","pipedrive"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not disconnect Pipedrive")})}var fH=LS[" useId ".trim().toString()]||(()=>{}),hH=0;function d0(e){const[t,n]=v.useState(fH());return ou(()=>{n(r=>r??String(hH++))},[e]),e||(t?`radix-${t}`:"")}var f0="focusScope.autoFocusOnMount",h0="focusScope.autoFocusOnUnmount",vT={bubbles:!1,cancelable:!0},mH="FocusScope",x2=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,f]=v.useState(null),h=fo(i),p=fo(o),b=v.useRef(null),g=Ua(t,S=>f(S)),x=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let S=function(O){if(x.paused||!u)return;const T=O.target;u.contains(T)?b.current=T:es(b.current,{select:!0})},A=function(O){if(x.paused||!u)return;const T=O.relatedTarget;T!==null&&(u.contains(T)||es(b.current,{select:!0}))},j=function(O){if(document.activeElement===document.body)for(const _ of O)_.removedNodes.length>0&&es(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",A);const C=new MutationObserver(j);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",A),C.disconnect()}}},[r,u,x.paused]),v.useEffect(()=>{if(u){yT.add(x);const S=document.activeElement;if(!u.contains(S)){const j=new CustomEvent(f0,vT);u.addEventListener(f0,h),u.dispatchEvent(j),j.defaultPrevented||(pH(xH(w2(u)),{select:!0}),document.activeElement===S&&es(u))}return()=>{u.removeEventListener(f0,h),setTimeout(()=>{const j=new CustomEvent(h0,vT);u.addEventListener(h0,p),u.dispatchEvent(j),j.defaultPrevented||es(S??document.body,{select:!0}),u.removeEventListener(h0,p),yT.remove(x)},0)}}},[u,h,p,x]);const E=v.useCallback(S=>{if(!n&&!r||x.paused)return;const A=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,j=document.activeElement;if(A&&j){const C=S.currentTarget,[O,T]=bH(C);O&&T?!S.shiftKey&&j===T?(S.preventDefault(),n&&es(O,{select:!0})):S.shiftKey&&j===O&&(S.preventDefault(),n&&es(T,{select:!0})):j===C&&S.preventDefault()}},[n,r,x.paused]);return d.jsx(sr.div,{tabIndex:-1,...l,ref:g,onKeyDown:E})});x2.displayName=mH;function pH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(es(r,{select:t}),document.activeElement!==n)return}function bH(e){const t=w2(e),n=gT(t,e),r=gT(t.reverse(),e);return[n,r]}function w2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gT(e,t){for(const n of e)if(!vH(n,{upTo:t}))return n}function vH(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gH(e){return e instanceof HTMLInputElement&&"select"in e}function es(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gH(e)&&t&&e.select()}}var yT=yH();function yH(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xT(e,t),e.unshift(t)},remove(t){var n;e=xT(e,t),(n=e[0])==null||n.resume()}}}function xT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function xH(e){return e.filter(t=>t.tagName!=="A")}var m0=0;function wH(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??wT()),document.body.insertAdjacentElement("beforeend",e[1]??wT()),m0++,()=>{m0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),m0--}},[])}function wT(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var tp="right-scroll-bar-position",np="width-before-scroll-bar",SH="with-scroll-bars-hidden",EH="--removed-body-scroll-bar-size";function p0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function AH(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var jH=typeof window<"u"?v.useLayoutEffect:v.useEffect,ST=new WeakMap;function CH(e,t){var n=AH(null,function(r){return e.forEach(function(i){return p0(i,r)})});return jH(function(){var r=ST.get(n);if(r){var i=new Set(r),o=new Set(e),l=n.current;i.forEach(function(u){o.has(u)||p0(u,null)}),o.forEach(function(u){i.has(u)||p0(u,l)})}ST.set(n,e)},[e]),n}function OH(e){return e}function NH(e,t){t===void 0&&(t=OH);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(o),l=n}var f=function(){var p=l;l=[],p.forEach(o)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(p){l.push(p),h()},filter:function(p){return l=l.filter(p),n}}}};return i}function TH(e){e===void 0&&(e={});var t=NH(null);return t.options=jt({async:!0,ssr:!1},e),t}var S2=function(e){var t=e.sideCar,n=Xk(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,jt({},n))};S2.isSideCarExport=!0;function PH(e,t){return e.useMedium(t),S2}var E2=TH(),b0=function(){},Ob=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:b0,onWheelCapture:b0,onTouchMoveCapture:b0}),i=r[0],o=r[1],l=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,b=e.shards,g=e.sideCar,x=e.noRelative,E=e.noIsolation,S=e.inert,A=e.allowPinchZoom,j=e.as,C=j===void 0?"div":j,O=e.gapMode,T=Xk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=g,P=CH([n,t]),D=jt(jt({},T),i);return v.createElement(v.Fragment,null,p&&v.createElement(_,{sideCar:E2,removeScrollBar:h,shards:b,noRelative:x,noIsolation:E,inert:S,setCallbacks:o,allowPinchZoom:!!A,lockRef:n,gapMode:O}),l?v.cloneElement(v.Children.only(u),jt(jt({},D),{ref:P})):v.createElement(C,jt({},D,{className:f,ref:P}),u))});Ob.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ob.classNames={fullWidth:np,zeroRight:tp};var _H=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function DH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=_H();return t&&e.setAttribute("nonce",t),e}function MH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function RH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var kH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=DH())&&(MH(t,n),RH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},LH=function(){var e=kH();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},A2=function(){var e=LH(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},IH={left:0,top:0,right:0,gap:0},v0=function(e){return parseInt(e||"",10)||0},zH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[v0(n),v0(r),v0(i)]},UH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return IH;var t=zH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},qH=A2(),Fc="data-scroll-locked",BH=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`161 .`.concat( SH,` {160 The BitBot team`};const r=await me("DraftLeadEmail",{leadId:n});if(!r.success)throw new Error(r.error);return r.data},onSuccess:()=>le.success("Draft generated"),onError:n=>le.error(n instanceof Error?n.message:"Draft failed")})}function Q8(){const e=Ne();return je({mutationFn:async({leadId:t})=>{const n=await me("DeleteLead",{leadId:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:()=>{le.success("Lead deleted"),e.invalidateQueries({queryKey:["leads"]}),e.invalidateQueries({queryKey:["lead"]}),e.invalidateQueries({queryKey:["unviewed-leads"]}),e.invalidateQueries({queryKey:["menu-badges"]})},onError:t=>le.error(t instanceof Error?t.message:"Delete failed")})}function V8(){const e=Ne();return je({mutationFn:async({leadIds:t})=>{const n=await me("DeleteLeads",{leadIds:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:t=>{le.success(`Deleted ${t.leadsDeleted} ${t.leadsDeleted===1?"lead":"leads"}`),e.invalidateQueries({queryKey:["leads"]}),e.invalidateQueries({queryKey:["lead"]}),e.invalidateQueries({queryKey:["unviewed-leads"]}),e.invalidateQueries({queryKey:["menu-badges"]})},onError:t=>le.error(t instanceof Error?t.message:"Delete failed")})}function X8(){const e=Ne();return je({mutationFn:async({leadIds:t})=>{const n=await me("MarkLeadsRead",{leadIds:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:t=>{le.success(`Marked ${t.marked} ${t.marked===1?"lead":"leads"} read`),e.invalidateQueries({queryKey:["leads"]}),e.invalidateQueries({queryKey:["unviewed-leads"]}),e.invalidateQueries({queryKey:["menu-badges"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not mark read")})}const zf="bb_devmockapikey0000000000000000",Z8={tier:"premium",trialEndsAt:null,currentPeriodEnd:new Date(Date.now()+27*864e5).toISOString(),isActive:!0,subscriptionStatus:"active",daysRemaining:27};function hE(){const t=Re().apiKey===zf;return Et({queryKey:["subscription"],queryFn:async()=>{if(t)return Z8;const n=await me("GetSubscription");if(!n.success)throw new Error(n.error);return n.data},staleTime:300*1e3})}function J8(){const e=Ne(),n=Re().apiKey===zf;return je({mutationFn:async()=>{if(n)return await new Promise(i=>setTimeout(i,500)),{success:!0,message:"Subscription will end at period end"};const r=await me("CancelSubscription");if(!r.success)throw new Error(r.error);return r.data},onSuccess:r=>{le.success(r.message),e.invalidateQueries({queryKey:["subscription"]}),e.invalidateQueries({queryKey:["plan-status"]})},onError:r=>le.error(r instanceof Error?r.message:"Cancel failed")})}function eH(){const e=Ne(),n=Re().apiKey===zf;return je({mutationFn:async()=>{if(n)return await new Promise(i=>setTimeout(i,500)),{success:!0,message:"Subscription reactivated"};const r=await me("ReactivateSubscription");if(!r.success)throw new Error(r.error);return r.data},onSuccess:r=>{le.success(r.message),e.invalidateQueries({queryKey:["subscription"]})},onError:r=>le.error(r instanceof Error?r.message:"Reactivate failed")})}function tH(){const t=Re().apiKey===zf;return je({mutationFn:async n=>{if(t)return await new Promise(l=>setTimeout(l,400)),{checkoutUrl:"https://checkout.stripe.com/c/test_xxx"};const r=new URL(window.location.href);r.searchParams.set("subscription","success"),r.searchParams.set("swap","1");const i=window.location.href,o=await me("CreateCheckout",{successUrl:r.toString(),cancelUrl:i,tier:n});if(!o.success)throw new Error(o.error);return o.data},onSuccess:n=>{if(n.checkoutUrl){window.location.href=n.checkoutUrl;return}const r=new URL(window.location.href);r.searchParams.set("subscription","success"),r.searchParams.set("swap","1"),window.location.href=r.toString()},onError:n=>le.error(n instanceof Error?n.message:"Could not start checkout")})}function nH(){const t=Re().apiKey===zf;return je({mutationFn:async()=>{if(t)return await new Promise(r=>setTimeout(r,300)),{url:"https://billing.stripe.com/p/login/test_xxx"};const n=await me("GetBillingPortal",{returnUrl:window.location.href});if(!n.success)throw new Error(n.error);return n.data},onSuccess:n=>{window.location.href=n.url},onError:n=>le.error(n instanceof Error?n.message:"Portal failed")})}function kc(e){if(!e)return"";try{return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}catch{return""}}function gs({open:e,onClose:t}){const{data:n}=Ai(),{data:r}=hE(),i=tH(),o=J8(),l=eH(),[u,f]=v.useState(null);if(v.useEffect(()=>{if(!e)return;const C=O=>{O.key==="Escape"&&t()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[e,t]),!e||!n)return null;const h=n.plan,p=n.accessMode,b=(r==null?void 0:r.currentPeriodEnd)??null,g=(r==null?void 0:r.subscriptionStatus)==="cancelled",x=p==="expired"?"Expired — subscribe to continue":h==="pro"&&g?`Assistant · ends ${kc(b)}`:h==="pro_plus"&&g?`Agent · ends ${kc(b)}`:h==="pro"?`Assistant · active${b?` · renews ${kc(b)}`:""}`:h==="pro_plus"?`Agent · active${b?` · renews ${kc(b)}`:""}`:`Free · ${n.usage.leadsCount} leads · ${n.usage.chatMessagesThisMonth}/${n.limits.chatMessagesPerMonth} chat this month`,E=C=>h===C&&p==="active"&&!g?{label:"Current plan",action:"current",tone:"ghost"}:h===C&&g?{label:`Reactivate ${C==="pro"?"Assistant":"Agent"}`,action:"reactivate",tone:"primary"}:p==="expired"?{label:`Subscribe — ${C==="pro"?"Assistant":"Agent"}`,action:"upgrade",tone:"primary"}:h==="pro_plus"&&C==="pro"?{label:"Downgrade →",action:"downgrade",tone:"danger"}:h==="pro"&&C==="pro_plus"?{label:"Upgrade to Agent →",action:"upgrade",tone:"primary"}:{label:`Upgrade to ${C==="pro"?"Assistant":"Agent"} →`,action:"upgrade",tone:"primary"},S=C=>{const{action:O}=E(C);if(O!=="current"){if(O==="reactivate"){l.mutate();return}if(O==="downgrade"){f(C);return}i.mutate(C)}},A=()=>{u&&(u==="free"?o.mutate():i.mutate(u),f(null))},j=i.isPending||o.isPending||l.isPending;return Vn.createPortal(d.jsxs("div",{className:"bb-modal-backdrop bb-portal-scope",onClick:t,children:[d.jsxs("div",{className:"bb-modal bb-changeplan-modal",onClick:C=>C.stopPropagation(),role:"dialog","aria-modal":"true",children:[d.jsxs("header",{className:"bb-modal-head",children:[d.jsxs("div",{className:"bb-modal-titles",children:[d.jsx("h3",{className:"bb-modal-title",children:"Change plan"}),d.jsx("span",{className:"bb-modal-aside",children:x})]}),d.jsx("button",{className:"bb-modal-close",onClick:t,"aria-label":"Close",children:"×"})]}),d.jsxs("div",{className:"bb-modal-body",children:[d.jsxs("div",{className:"bb-changeplan-grid",children:[d.jsx(bT,{name:"Assistant",price:"$20",tagline:"Everything in Free, plus full access.",features:["Unlimited chat replies","All your captured leads, unlocked","AI post generation (unlimited)","Unlimited topic searches","Unlimited forms","Stage tracking, notes, AI lead research"],button:E("pro"),onClick:()=>S("pro"),disabled:j}),d.jsx(bT,{name:"Agent",price:"$49",tagline:"Everything in Assistant, plus integrations and the AI co-pilot.",features:["Replies on Facebook and Instagram","Sends leads to Zoho CRM","Knows your WooCommerce products, orders & stock","Acts on your behalf — books, updates, follows up","Your own AI co-pilot inside the admin"],button:E("pro_plus"),onClick:()=>S("pro_plus"),disabled:j})]}),(h==="pro"||h==="pro_plus")&&!g&&p==="active"&&d.jsxs("div",{className:"bb-changeplan-cancel",children:[d.jsx("button",{type:"button",className:"bb-changeplan-cancel-link",disabled:j,onClick:()=>f("free"),children:"Cancel and drop to Free →"}),d.jsxs("span",{className:"bb-changeplan-cancel-note",children:["You'll keep paid access until ",kc(b)||"your period ends","."]})]})]})]}),u&&d.jsx(rH,{target:u,currentPlan:h,periodEnd:b,onCancel:()=>f(null),onConfirm:A,pending:j})]}),document.body)}function bT({name:e,price:t,tagline:n,features:r,button:i,onClick:o,disabled:l}){const u=i.tone==="primary"?"bb-btn bb-btn-primary":i.tone==="danger"?"bb-btn bb-btn-ghost bb-changeplan-btn-danger":"bb-btn bb-btn-ghost";return d.jsxs("article",{className:`bb-changeplan-col ${i.action==="current"?"bb-changeplan-col-current":""}`,children:[d.jsxs("header",{children:[d.jsx("h4",{className:"bb-changeplan-name",children:e}),d.jsxs("p",{className:"bb-changeplan-price",children:[t,d.jsx("span",{className:"bb-changeplan-price-sub",children:"/mo"})]}),d.jsx("p",{className:"bb-changeplan-tagline",children:n})]}),d.jsx("ul",{className:"bb-changeplan-features",children:r.map(f=>d.jsx("li",{children:f},f))}),d.jsx("button",{type:"button",className:u,disabled:l||i.action==="current",onClick:o,children:i.label})]})}function rH({target:e,currentPlan:t,periodEnd:n,onCancel:r,onConfirm:i,pending:o}){const l=e==="pro"?"Assistant":e==="free"?"Free":"Agent",u=t==="pro_plus";return Vn.createPortal(d.jsx("div",{className:"bb-modal-backdrop bb-modal-backdrop-stack bb-portal-scope",onClick:r,children:d.jsxs("div",{className:"bb-modal bb-changeplan-confirm",onClick:f=>f.stopPropagation(),role:"dialog","aria-modal":"true",children:[d.jsxs("header",{className:"bb-modal-head",children:[d.jsxs("h3",{className:"bb-modal-title",children:["Switch to ",l,"?"]}),d.jsx("button",{className:"bb-modal-close",onClick:r,"aria-label":"Cancel",children:"×"})]}),d.jsxs("div",{className:"bb-modal-body",children:[d.jsx("p",{className:"bb-changeplan-confirm-lede",children:e==="free"?`You'll keep paid access until ${n?kc(n):"your period ends"}, then drop to Free.`:"Stripe will prorate the difference and apply it to your next invoice."}),u&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"bb-changeplan-confirm-section",children:"These will stop working immediately:"}),d.jsxs("ul",{className:"bb-changeplan-confirm-list",children:[d.jsxs("li",{children:["Replies on Facebook and Instagram ",d.jsx("small",{children:"— inbound threads stay visible in Conversations for manual reply"})]}),d.jsxs("li",{children:["Sending leads to Zoho CRM ",d.jsx("small",{children:"— leads already in Zoho stay; new ones won't push"})]}),d.jsx("li",{children:"Knowing your WooCommerce products & orders"}),d.jsx("li",{children:"Your AI co-pilot inside the admin"})]}),d.jsx("p",{className:"bb-changeplan-confirm-note",children:"Connections stay in your account — re-upgrading restores them in one click, no re-setup."})]}),e==="free"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"bb-changeplan-confirm-section",children:"When your period ends:"}),d.jsxs("ul",{className:"bb-changeplan-confirm-list",children:[d.jsx("li",{children:"Chat capped at 50 replies a month"}),d.jsx("li",{children:"AI post generation turns off"}),d.jsx("li",{children:"Topic research turns off"}),d.jsx("li",{children:"Forms capped at 1"})]}),d.jsx("p",{className:"bb-changeplan-confirm-note",children:"Re-upgrade any time to unlock everything."})]}),d.jsxs("div",{className:"bb-changeplan-confirm-actions",children:[d.jsxs("button",{type:"button",className:"bb-btn bb-btn-ghost",onClick:r,disabled:o,children:["Keep ",t==="pro_plus"?"Agent":"Assistant"]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:i,disabled:o,children:o?"Switching…":`Switch to ${l} →`})]})]})]})}),document.body)}function uu({icon:e,headline:t,body:n,ctaLabel:r,onCta:i}){return d.jsxs("div",{className:"bb-empty-state",children:[e&&d.jsx("div",{className:"bb-empty-icon",children:e}),d.jsx("h4",{className:"bb-empty-headline",children:t}),d.jsx("p",{className:"bb-empty-body",children:n}),d.jsx("button",{className:"bb-btn bb-btn-primary",onClick:i,children:r})]})}let xp=null,aH=0;function bi(e){const t=typeof e=="string"?{message:e}:e;return new Promise(n=>{if(!xp){n(window.confirm(t.message));return}xp({id:++aH,resolve:n,...t})})}function iH({children:e}){const[t,n]=v.useState(null),r=v.useRef(null),i=v.useCallback(o=>{n(l=>(l==null||l.resolve(o),null))},[]);return v.useEffect(()=>(xp=o=>n(l=>(l==null||l.resolve(!1),o)),()=>{xp=null}),[]),v.useEffect(()=>{var l;if(!t)return;(l=r.current)==null||l.focus();const o=u=>{u.key==="Escape"?i(!1):u.key==="Enter"&&i(!0)};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t,i]),d.jsxs(d.Fragment,{children:[e,t&&Vn.createPortal(d.jsx("div",{className:"bb-modal-backdrop bb-portal-scope",onClick:o=>{o.target===o.currentTarget&&i(!1)},children:d.jsxs("div",{className:"bb-modal bb-confirm-modal",role:"alertdialog","aria-modal":"true","aria-labelledby":"bb-confirm-dialog-title",onClick:o=>o.stopPropagation(),children:[d.jsxs("div",{className:"bb-modal-head",children:[d.jsx("div",{className:"bb-modal-titles",children:d.jsx("h2",{id:"bb-confirm-dialog-title",className:"bb-modal-title",children:t.title||"Please confirm"})}),d.jsx("button",{type:"button",className:"bb-modal-close",onClick:()=>i(!1),"aria-label":"Cancel",children:"×"})]}),d.jsx("div",{className:"bb-modal-body",children:d.jsx("p",{className:"bb-confirm-modal-body",children:t.message})}),d.jsxs("div",{className:"bb-confirm-modal-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost",onClick:()=>i(!1),children:t.cancelLabel||"Cancel"}),d.jsx("button",{ref:r,type:"button",className:`bb-btn ${t.danger?"bb-btn-destructive":"bb-btn-primary"}`,onClick:()=>i(!0),children:t.confirmLabel||"Confirm"})]})]})}),document.body)]})}function oH({selectedId:e,onSelect:t}){var te,pe;const[n,r]=v.useState(""),[i,o]=v.useState(null),[l,u]=v.useState(null),[f,h]=v.useState(!1),{leads:p,total:b,isLoading:g,hasNextPage:x,isFetchingNextPage:E,fetchNextPage:S}=fE({search:n,country:i,via:l}),{data:A}=$8({search:n,country:i,via:l}),{data:j}=Ai(),C=(j==null?void 0:j.plan)==="free",O=Rf(),T=h5(),_=((pe=(te=O.data)==null?void 0:te.integration)==null?void 0:pe.status)==="connected",[P,D]=v.useState(new Set),L=Q8(),z=V8(),F=X8(),G=v.useMemo(()=>{const k=new Set;for(const Q of p)P.has(Q.id)&&k.add(Q.id);return k},[p,P]),R=G.size,J=R>0&&R===p.length,$=k=>{const Q=new Set(P);Q.has(k)?Q.delete(k):Q.add(k),D(Q)},ne=()=>{D(J?new Set:new Set(p.map(k=>k.id)))},K=()=>D(new Set),Z=async k=>{k.length===0||!await bi({title:`Delete ${k.length} ${k.length===1?"lead":"leads"}?`,message:`The selected ${k.length===1?"lead will be":"leads will be"} permanently removed from your inbox. This can't be undone.`,confirmLabel:`Delete ${k.length} ${k.length===1?"lead":"leads"}`,danger:!0})||(k.length===1?await L.mutateAsync({leadId:k[0]}).catch(()=>null):await z.mutateAsync({leadIds:k}).catch(()=>null),K())},B=async()=>{R!==0&&(await F.mutateAsync({leadIds:Array.from(G)}).catch(()=>null),K())};return d.jsxs("section",{className:"bb-leads-list",children:[d.jsxs("header",{className:"bb-leads-toolbar",children:[d.jsx("input",{type:"search",className:"bb-input bb-leads-search",placeholder:"Search by name or email",value:n,onChange:k=>r(k.target.value)}),(((A==null?void 0:A.locations.length)??0)>0||((A==null?void 0:A.via.length)??0)>0)&&d.jsxs("div",{className:"bb-leads-filters",children:[((A==null?void 0:A.locations.length)??0)>0&&d.jsxs("select",{className:"bb-input bb-leads-filter",value:i??"",onChange:k=>o(k.target.value||null),"aria-label":"Filter by location",children:[d.jsx("option",{value:"",children:"All locations"}),A.locations.map(k=>d.jsxs("option",{value:k.value,children:[k.value," (",k.count,")"]},k.value))]}),((A==null?void 0:A.via.length)??0)>0&&d.jsxs("select",{className:"bb-input bb-leads-filter",value:l??"",onChange:k=>u(k.target.value||null),"aria-label":"Filter by source",children:[d.jsx("option",{value:"",children:"All sources"}),A.via.map(k=>d.jsxs("option",{value:k.value,children:[k.value," (",k.count,")"]},k.value))]})]}),b>0&&d.jsxs("span",{className:"bb-leads-count",children:[C?null:p.length<b?d.jsxs(d.Fragment,{children:["Showing ",d.jsx("strong",{children:p.length})," of ",b]}):d.jsxs(d.Fragment,{children:[b," ",b===1?"lead":"leads"]}),_&&d.jsx("button",{type:"button",className:"bb-leads-sync-all",onClick:()=>T.mutate(),disabled:T.isPending,title:"Push every lead in this inbox to your Zoho CRM. Duplicates in Zoho are skipped.",children:T.isPending?"Syncing…":"Sync all to Zoho ↗"})]})]}),!g&&R>0&&d.jsxs("div",{className:"bb-conv-bulk-bar",children:[d.jsxs("label",{className:"bb-conv-bulk-select-all",children:[d.jsx("input",{type:"checkbox",checked:J,ref:k=>{k&&(k.indeterminate=R>0&&!J)},onChange:ne,"aria-label":J?"Deselect all":"Select all"}),d.jsx("span",{children:J?`${R} selected (all)`:`${R} selected`})]}),d.jsxs("div",{className:"bb-conv-bulk-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:K,children:"Clear"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:B,disabled:F.isPending,children:F.isPending?"Marking…":"Mark read"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-danger bb-btn-small",onClick:()=>Z(Array.from(G)),disabled:z.isPending,children:`Delete ${R}`})]})]}),d.jsxs("div",{className:"bb-leads-rows",children:[g&&d.jsx("div",{className:"bb-skeleton",style:{height:320,margin:16,borderRadius:8}}),!g&&p.length===0&&(C&&b>0?d.jsx(uu,{headline:`${b} ${b===1?"lead":"leads"} waiting to be unlocked`,body:"Your bot has captured real visitor emails. Upgrade to Assistant to see them, follow up, push to your CRM, and run AI research on each one.",ctaLabel:"Upgrade to view →",onCta:()=>h(!0)}):d.jsx(uu,{headline:"No leads yet",body:"Leads from chat conversations show up here. The chatbot starts capturing emails as soon as visitors ask about pricing, services, or booking.",ctaLabel:"Open the chat to test",onCta:()=>window.open("/","_blank")})),!g&&p.map(k=>{const Q=k.id===e,ce=k.viewedAt===null,fe=G.has(k.id);return d.jsxs("div",{className:`bb-lead-row ${Q?"bb-lead-row-active":""} ${fe?"bb-lead-row-selected":""}`,children:[d.jsx("label",{className:`bb-lead-row-check ${R>0||fe?"bb-lead-row-check-visible":""}`,onClick:xe=>xe.stopPropagation(),children:d.jsx("input",{type:"checkbox",checked:fe,onChange:()=>$(k.id),"aria-label":fe?`Deselect ${k.name||"lead"}`:`Select ${k.name||"lead"}`})}),d.jsxs("button",{className:"bb-lead-row-body",onClick:()=>t(k),children:[d.jsxs("div",{className:"bb-lead-row-top",children:[d.jsxs("div",{className:"bb-lead-row-name",children:[ce&&d.jsx("span",{className:"bb-lead-row-dot","aria-label":"New"}),d.jsx("span",{children:k.name||"(no name)"})]}),d.jsx("span",{className:"bb-lead-row-time",children:ir(k.createdAt)})]}),d.jsx("div",{className:"bb-lead-row-email",children:k.email}),k.message&&d.jsx("div",{className:"bb-lead-row-message",children:mp(k.message,80)}),d.jsxs("div",{className:"bb-lead-row-meta",children:[(()=>{const xe=Gk(k.channel);return k.channel&&k.channel!=="web_widget"?d.jsxs("span",{className:"bb-lead-row-channel",title:`Captured via ${xe.label}`,children:[xe.icon," ",xe.label," ·"]}):null})(),d.jsxs("span",{className:"bb-lead-row-source",children:["via ",Yk(k.source)]}),k.country&&d.jsxs("span",{className:"bb-lead-row-loc",children:["· ",k.city??k.country]}),k.zohoLeadId&&d.jsx("span",{className:"bb-lead-row-zoho",title:"Synced to Zoho CRM",children:"· ✓ Zoho"})]})]}),d.jsx("button",{type:"button",className:"bb-lead-row-delete",title:"Delete this lead","aria-label":`Delete ${k.name||"lead"}`,onClick:xe=>{xe.stopPropagation(),Z([k.id])},children:"🗑"})]},k.id)}),x&&d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-load-more",onClick:()=>S(),disabled:E,children:E?"Loading…":`Load more (${b-p.length} remaining)`})]}),d.jsx(gs,{open:f,onClose:()=>h(!1)})]})}function mE(){return Et({queryKey:["integrations","pipedrive"],queryFn:async()=>{const e=await me("GetPipedriveStatus");if(!e.success)throw new Error(e.error);return e.data},staleTime:6e4})}function sH(){const e=Ne();return je({mutationFn:async({apiToken:t})=>{const n=await me("UpdatePipedriveCredentials",{apiToken:t});if(!n.success)throw new Error(n.error);const r=await me("SetSkillEnabled",{skillName:"pipedrive",enabled:!0});if(!r.success)throw new Error(r.error);return{success:!0}},onSuccess:()=>{le.success("Pipedrive connected"),e.invalidateQueries({queryKey:["integrations","pipedrive"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not connect Pipedrive")})}function lH(){return Et({queryKey:["integrations","pipedrive","auto-sync"],queryFn:async()=>{const e=await me("GetPipedriveAutoSync");if(!e.success)throw new Error(e.error);return e.data.enabled},staleTime:6e4})}function cH(){const e=Ne();return je({mutationFn:async t=>{const n=await me("SetPipedriveAutoSync",{enabled:t});if(!n.success)throw new Error(n.error);return n.data.enabled},onSuccess:t=>{le.success(t?"Auto-sync to Pipedrive turned on":"Auto-sync to Pipedrive turned off"),e.invalidateQueries({queryKey:["integrations","pipedrive","auto-sync"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not update auto-sync")})}function uH(e,t){return Et({queryKey:["leads",e,"pipedrive-state"],queryFn:async()=>{const n=await me("GetPipedriveLeadStateForLead",{leadId:e});if(!n.success)throw new Error(n.error);return n.data.state},enabled:!!e&&t,staleTime:3e4})}function dH(){const e=Ne();return je({mutationFn:async t=>{const n=await me("PushLeadToPipedrive",{leadId:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:()=>{le.success("Lead pushed to Pipedrive"),e.invalidateQueries({queryKey:["leads"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not push lead to Pipedrive")})}function fH(){const e=Ne();return je({mutationFn:async()=>{const t=await me("DisconnectPipedrive");if(!t.success)throw new Error(t.error);const n=await me("SetSkillEnabled",{skillName:"pipedrive",enabled:!1});if(!n.success)throw new Error(n.error);return{success:!0}},onSuccess:()=>{le.success("Pipedrive disconnected"),e.invalidateQueries({queryKey:["integrations","pipedrive"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not disconnect Pipedrive")})}var hH=LS[" useId ".trim().toString()]||(()=>{}),mH=0;function d0(e){const[t,n]=v.useState(hH());return ou(()=>{n(r=>r??String(mH++))},[e]),e||(t?`radix-${t}`:"")}var f0="focusScope.autoFocusOnMount",h0="focusScope.autoFocusOnUnmount",vT={bubbles:!1,cancelable:!0},pH="FocusScope",w2=v.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,f]=v.useState(null),h=fo(i),p=fo(o),b=v.useRef(null),g=Ua(t,S=>f(S)),x=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let S=function(O){if(x.paused||!u)return;const T=O.target;u.contains(T)?b.current=T:es(b.current,{select:!0})},A=function(O){if(x.paused||!u)return;const T=O.relatedTarget;T!==null&&(u.contains(T)||es(b.current,{select:!0}))},j=function(O){if(document.activeElement===document.body)for(const _ of O)_.removedNodes.length>0&&es(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",A);const C=new MutationObserver(j);return u&&C.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",A),C.disconnect()}}},[r,u,x.paused]),v.useEffect(()=>{if(u){yT.add(x);const S=document.activeElement;if(!u.contains(S)){const j=new CustomEvent(f0,vT);u.addEventListener(f0,h),u.dispatchEvent(j),j.defaultPrevented||(bH(wH(S2(u)),{select:!0}),document.activeElement===S&&es(u))}return()=>{u.removeEventListener(f0,h),setTimeout(()=>{const j=new CustomEvent(h0,vT);u.addEventListener(h0,p),u.dispatchEvent(j),j.defaultPrevented||es(S??document.body,{select:!0}),u.removeEventListener(h0,p),yT.remove(x)},0)}}},[u,h,p,x]);const E=v.useCallback(S=>{if(!n&&!r||x.paused)return;const A=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,j=document.activeElement;if(A&&j){const C=S.currentTarget,[O,T]=vH(C);O&&T?!S.shiftKey&&j===T?(S.preventDefault(),n&&es(O,{select:!0})):S.shiftKey&&j===O&&(S.preventDefault(),n&&es(T,{select:!0})):j===C&&S.preventDefault()}},[n,r,x.paused]);return d.jsx(sr.div,{tabIndex:-1,...l,ref:g,onKeyDown:E})});w2.displayName=pH;function bH(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(es(r,{select:t}),document.activeElement!==n)return}function vH(e){const t=S2(e),n=gT(t,e),r=gT(t.reverse(),e);return[n,r]}function S2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function gT(e,t){for(const n of e)if(!gH(n,{upTo:t}))return n}function gH(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function yH(e){return e instanceof HTMLInputElement&&"select"in e}function es(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&yH(e)&&t&&e.select()}}var yT=xH();function xH(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=xT(e,t),e.unshift(t)},remove(t){var n;e=xT(e,t),(n=e[0])==null||n.resume()}}}function xT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function wH(e){return e.filter(t=>t.tagName!=="A")}var m0=0;function SH(){v.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??wT()),document.body.insertAdjacentElement("beforeend",e[1]??wT()),m0++,()=>{m0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),m0--}},[])}function wT(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var tp="right-scroll-bar-position",np="width-before-scroll-bar",EH="with-scroll-bars-hidden",AH="--removed-body-scroll-bar-size";function p0(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function jH(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var CH=typeof window<"u"?v.useLayoutEffect:v.useEffect,ST=new WeakMap;function OH(e,t){var n=jH(null,function(r){return e.forEach(function(i){return p0(i,r)})});return CH(function(){var r=ST.get(n);if(r){var i=new Set(r),o=new Set(e),l=n.current;i.forEach(function(u){o.has(u)||p0(u,null)}),o.forEach(function(u){i.has(u)||p0(u,l)})}ST.set(n,e)},[e]),n}function NH(e){return e}function TH(e,t){t===void 0&&(t=NH);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(o),l=n}var f=function(){var p=l;l=[],p.forEach(o)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(p){l.push(p),h()},filter:function(p){return l=l.filter(p),n}}}};return i}function PH(e){e===void 0&&(e={});var t=TH(null);return t.options=jt({async:!0,ssr:!1},e),t}var E2=function(e){var t=e.sideCar,n=Zk(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,jt({},n))};E2.isSideCarExport=!0;function _H(e,t){return e.useMedium(t),E2}var A2=PH(),b0=function(){},Ob=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:b0,onWheelCapture:b0,onTouchMoveCapture:b0}),i=r[0],o=r[1],l=e.forwardProps,u=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,b=e.shards,g=e.sideCar,x=e.noRelative,E=e.noIsolation,S=e.inert,A=e.allowPinchZoom,j=e.as,C=j===void 0?"div":j,O=e.gapMode,T=Zk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=g,P=OH([n,t]),D=jt(jt({},T),i);return v.createElement(v.Fragment,null,p&&v.createElement(_,{sideCar:A2,removeScrollBar:h,shards:b,noRelative:x,noIsolation:E,inert:S,setCallbacks:o,allowPinchZoom:!!A,lockRef:n,gapMode:O}),l?v.cloneElement(v.Children.only(u),jt(jt({},D),{ref:P})):v.createElement(C,jt({},D,{className:f,ref:P}),u))});Ob.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ob.classNames={fullWidth:np,zeroRight:tp};var DH=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function MH(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=DH();return t&&e.setAttribute("nonce",t),e}function RH(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function kH(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var LH=function(){var e=0,t=null;return{add:function(n){e==0&&(t=MH())&&(RH(t,n),kH(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},IH=function(){var e=LH();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},j2=function(){var e=IH(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},zH={left:0,top:0,right:0,gap:0},v0=function(e){return parseInt(e||"",10)||0},UH=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[v0(n),v0(r),v0(i)]},qH=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zH;var t=UH(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},BH=j2(),Fc="data-scroll-locked",FH=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` 161 .`.concat(EH,` { 162 162 overflow: hidden `).concat(r,`; 163 163 padding-right: `).concat(u,"px ").concat(r,`; … … 193 193 194 194 body[`).concat(Fc,`] { 195 `).concat( EH,": ").concat(u,`px;196 } 197 `)},ET=function(){var e=parseInt(document.body.getAttribute(Fc)||"0",10);return isFinite(e)?e:0}, FH=function(){v.useEffect(function(){return document.body.setAttribute(Fc,(ET()+1).toString()),function(){var e=ET()-1;e<=0?document.body.removeAttribute(Fc):document.body.setAttribute(Fc,e.toString())}},[])},$H=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;FH();var o=v.useMemo(function(){return UH(i)},[i]);return v.createElement(qH,{styles:BH(o,!t,i,n?"":"!important")})},Dw=!1;if(typeof window<"u")try{var Nm=Object.defineProperty({},"passive",{get:function(){return Dw=!0,!0}});window.addEventListener("test",Nm,Nm),window.removeEventListener("test",Nm,Nm)}catch{Dw=!1}var xc=Dw?{passive:!1}:!1,KH=function(e){return e.tagName==="TEXTAREA"},j2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!KH(e)&&n[t]==="visible")},HH=function(e){return j2(e,"overflowY")},GH=function(e){return j2(e,"overflowX")},AT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=C2(e,r);if(i){var o=O2(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},YH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},WH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},C2=function(e,t){return e==="v"?HH(t):GH(t)},O2=function(e,t){return e==="v"?YH(t):WH(t)},QH=function(e,t){return e==="h"&&t==="rtl"?-1:1},VH=function(e,t,n,r,i){var o=QH(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,f=t.contains(u),h=!1,p=l>0,b=0,g=0;do{if(!u)break;var x=O2(e,u),E=x[0],S=x[1],A=x[2],j=S-A-o*E;(E||j)&&C2(e,u)&&(b+=j,g+=E);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(b)<1||!p&&Math.abs(g)<1)&&(h=!0),h},Tm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jT=function(e){return[e.deltaX,e.deltaY]},CT=function(e){return e&&"current"in e?e.current:e},XH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ZH=function(e){return`195 `).concat(AH,": ").concat(u,`px; 196 } 197 `)},ET=function(){var e=parseInt(document.body.getAttribute(Fc)||"0",10);return isFinite(e)?e:0},$H=function(){v.useEffect(function(){return document.body.setAttribute(Fc,(ET()+1).toString()),function(){var e=ET()-1;e<=0?document.body.removeAttribute(Fc):document.body.setAttribute(Fc,e.toString())}},[])},KH=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;$H();var o=v.useMemo(function(){return qH(i)},[i]);return v.createElement(BH,{styles:FH(o,!t,i,n?"":"!important")})},Dw=!1;if(typeof window<"u")try{var Nm=Object.defineProperty({},"passive",{get:function(){return Dw=!0,!0}});window.addEventListener("test",Nm,Nm),window.removeEventListener("test",Nm,Nm)}catch{Dw=!1}var xc=Dw?{passive:!1}:!1,HH=function(e){return e.tagName==="TEXTAREA"},C2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!HH(e)&&n[t]==="visible")},GH=function(e){return C2(e,"overflowY")},YH=function(e){return C2(e,"overflowX")},AT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=O2(e,r);if(i){var o=N2(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},WH=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},QH=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},O2=function(e,t){return e==="v"?GH(t):YH(t)},N2=function(e,t){return e==="v"?WH(t):QH(t)},VH=function(e,t){return e==="h"&&t==="rtl"?-1:1},XH=function(e,t,n,r,i){var o=VH(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,f=t.contains(u),h=!1,p=l>0,b=0,g=0;do{if(!u)break;var x=N2(e,u),E=x[0],S=x[1],A=x[2],j=S-A-o*E;(E||j)&&O2(e,u)&&(b+=j,g+=E);var C=u.parentNode;u=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(b)<1||!p&&Math.abs(g)<1)&&(h=!0),h},Tm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jT=function(e){return[e.deltaX,e.deltaY]},CT=function(e){return e&&"current"in e?e.current:e},ZH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},JH=function(e){return` 198 198 .block-interactivity-`.concat(e,` {pointer-events: none;} 199 199 .allow-interactivity-`).concat(e,` {pointer-events: all;} 200 `)}, JH=0,wc=[];function eG(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(JH++)[0],o=v.useState(A2)[0],l=v.useRef(e);v.useEffect(function(){l.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=a6([e.lockRef.current],(e.shards||[]).map(CT),!0).filter(Boolean);return S.forEach(function(A){return A.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=v.useCallback(function(S,A){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var j=Tm(S),C=n.current,O="deltaX"in S?S.deltaX:C[0]-j[0],T="deltaY"in S?S.deltaY:C[1]-j[1],_,P=S.target,D=Math.abs(O)>Math.abs(T)?"h":"v";if("touches"in S&&D==="h"&&P.type==="range")return!1;var L=window.getSelection(),z=L&&L.anchorNode,R=z?z===P||z.contains(P):!1;if(R)return!1;var q=AT(D,P);if(!q)return!0;if(q?_=D:(_=D==="v"?"h":"v",q=AT(D,P)),!q)return!1;if(!r.current&&"changedTouches"in S&&(O||T)&&(r.current=_),!_)return!0;var U=r.current||_;return VH(U,A,S,U==="h"?O:T)},[]),f=v.useCallback(function(S){var A=S;if(!(!wc.length||wc[wc.length-1]!==o)){var j="deltaY"in A?jT(A):Tm(A),C=t.current.filter(function(_){return _.name===A.type&&(_.target===A.target||A.target===_.shadowParent)&&XH(_.delta,j)})[0];if(C&&C.should){A.cancelable&&A.preventDefault();return}if(!C){var O=(l.current.shards||[]).map(CT).filter(Boolean).filter(function(_){return _.contains(A.target)}),T=O.length>0?u(A,O[0]):!l.current.noIsolation;T&&A.cancelable&&A.preventDefault()}}},[]),h=v.useCallback(function(S,A,j,C){var O={name:S,delta:A,target:j,should:C,shadowParent:tG(j)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(T){return T!==O})},1)},[]),p=v.useCallback(function(S){n.current=Tm(S),r.current=void 0},[]),b=v.useCallback(function(S){h(S.type,jT(S),S.target,u(S,e.lockRef.current))},[]),g=v.useCallback(function(S){h(S.type,Tm(S),S.target,u(S,e.lockRef.current))},[]);v.useEffect(function(){return wc.push(o),e.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:g}),document.addEventListener("wheel",f,xc),document.addEventListener("touchmove",f,xc),document.addEventListener("touchstart",p,xc),function(){wc=wc.filter(function(S){return S!==o}),document.removeEventListener("wheel",f,xc),document.removeEventListener("touchmove",f,xc),document.removeEventListener("touchstart",p,xc)}},[]);var x=e.removeScrollBar,E=e.inert;return v.createElement(v.Fragment,null,E?v.createElement(o,{styles:ZH(i)}):null,x?v.createElement($H,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tG(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nG=PH(E2,eG);var N2=v.forwardRef(function(e,t){return v.createElement(Ob,jt({},e,{ref:t,sideCar:nG}))});N2.classNames=Ob.classNames;var rG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Sc=new WeakMap,Pm=new WeakMap,_m={},g0=0,T2=function(e){return e&&(e.host||T2(e.parentNode))},aG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=T2(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},iG=function(e,t,n,r){var i=aG(t,Array.isArray(e)?e:[e]);_m[n]||(_m[n]=new WeakMap);var o=_m[n],l=[],u=new Set,f=new Set(i),h=function(b){!b||u.has(b)||(u.add(b),h(b.parentNode))};i.forEach(h);var p=function(b){!b||f.has(b)||Array.prototype.forEach.call(b.children,function(g){if(u.has(g))p(g);else try{var x=g.getAttribute(r),E=x!==null&&x!=="false",S=(Sc.get(g)||0)+1,A=(o.get(g)||0)+1;Sc.set(g,S),o.set(g,A),l.push(g),S===1&&E&&Pm.set(g,!0),A===1&&g.setAttribute(n,"true"),E||g.setAttribute(r,"true")}catch(j){console.error("aria-hidden: cannot operate on ",g,j)}})};return p(t),u.clear(),g0++,function(){l.forEach(function(b){var g=Sc.get(b)-1,x=o.get(b)-1;Sc.set(b,g),o.set(b,x),g||(Pm.has(b)||b.removeAttribute(r),Pm.delete(b)),x||b.removeAttribute(n)}),g0--,g0||(Sc=new WeakMap,Sc=new WeakMap,Pm=new WeakMap,_m={})}},oG=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=rG(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),iG(r,i,n,"aria-hidden")):function(){return null}},Nb="Dialog",[P2]=FS(Nb),[sG,$a]=P2(Nb),_2=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,u=v.useRef(null),f=v.useRef(null),[h,p]=Ok({prop:r,defaultProp:i??!1,onChange:o,caller:Nb});return d.jsx(sG,{scope:t,triggerRef:u,contentRef:f,contentId:d0(),titleId:d0(),descriptionId:d0(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(b=>!b),[p]),modal:l,children:n})};_2.displayName=Nb;var D2="DialogTrigger",lG=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=$a(D2,n),o=Ua(t,i.triggerRef);return d.jsx(sr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":vE(i.open),...r,ref:o,onClick:Rn(e.onClick,i.onOpenToggle)})});lG.displayName=D2;var pE="DialogPortal",[cG,M2]=P2(pE,{forceMount:void 0}),R2=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=$a(pE,t);return d.jsx(cG,{scope:t,forceMount:n,children:v.Children.map(r,l=>d.jsx(_f,{present:n||o.open,children:d.jsx(KS,{asChild:!0,container:i,children:l})}))})};R2.displayName=pE;var wp="DialogOverlay",k2=v.forwardRef((e,t)=>{const n=M2(wp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=$a(wp,e.__scopeDialog);return o.modal?d.jsx(_f,{present:r||o.open,children:d.jsx(dG,{...i,ref:t})}):null});k2.displayName=wp;var uG=hp("DialogOverlay.RemoveScroll"),dG=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=$a(wp,n);return d.jsx(N2,{as:uG,allowPinchZoom:!0,shards:[i.contentRef],children:d.jsx(sr.div,{"data-state":vE(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),xl="DialogContent",L2=v.forwardRef((e,t)=>{const n=M2(xl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=$a(xl,e.__scopeDialog);return d.jsx(_f,{present:r||o.open,children:o.modal?d.jsx(fG,{...i,ref:t}):d.jsx(hG,{...i,ref:t})})});L2.displayName=xl;var fG=v.forwardRef((e,t)=>{const n=$a(xl,e.__scopeDialog),r=v.useRef(null),i=Ua(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return oG(o)},[]),d.jsx(I2,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Rn(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Rn(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Rn(e.onFocusOutside,o=>o.preventDefault())})}),hG=v.forwardRef((e,t)=>{const n=$a(xl,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return d.jsx(I2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),I2=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=$a(xl,n),f=v.useRef(null),h=Ua(t,f);return wH(),d.jsxs(d.Fragment,{children:[d.jsx(x2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:d.jsx($S,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":vE(u.open),...l,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(pG,{titleId:u.titleId}),d.jsx(vG,{contentRef:f,descriptionId:u.descriptionId})]})]})}),bE="DialogTitle",z2=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=$a(bE,n);return d.jsx(sr.h2,{id:i.titleId,...r,ref:t})});z2.displayName=bE;var U2="DialogDescription",mG=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=$a(U2,n);return d.jsx(sr.p,{id:i.descriptionId,...r,ref:t})});mG.displayName=U2;var q2="DialogClose",B2=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=$a(q2,n);return d.jsx(sr.button,{type:"button",...r,ref:t,onClick:Rn(e.onClick,()=>i.onOpenChange(!1))})});B2.displayName=q2;function vE(e){return e?"open":"closed"}var F2="DialogTitleWarning",[Nhe,$2]=D4(F2,{contentName:xl,titleName:bE,docsSlug:"dialog"}),pG=({titleId:e})=>{const t=$2(F2),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.200 `)},eG=0,wc=[];function tG(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(eG++)[0],o=v.useState(j2)[0],l=v.useRef(e);v.useEffect(function(){l.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=i6([e.lockRef.current],(e.shards||[]).map(CT),!0).filter(Boolean);return S.forEach(function(A){return A.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(A){return A.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=v.useCallback(function(S,A){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var j=Tm(S),C=n.current,O="deltaX"in S?S.deltaX:C[0]-j[0],T="deltaY"in S?S.deltaY:C[1]-j[1],_,P=S.target,D=Math.abs(O)>Math.abs(T)?"h":"v";if("touches"in S&&D==="h"&&P.type==="range")return!1;var L=window.getSelection(),z=L&&L.anchorNode,F=z?z===P||z.contains(P):!1;if(F)return!1;var G=AT(D,P);if(!G)return!0;if(G?_=D:(_=D==="v"?"h":"v",G=AT(D,P)),!G)return!1;if(!r.current&&"changedTouches"in S&&(O||T)&&(r.current=_),!_)return!0;var R=r.current||_;return XH(R,A,S,R==="h"?O:T)},[]),f=v.useCallback(function(S){var A=S;if(!(!wc.length||wc[wc.length-1]!==o)){var j="deltaY"in A?jT(A):Tm(A),C=t.current.filter(function(_){return _.name===A.type&&(_.target===A.target||A.target===_.shadowParent)&&ZH(_.delta,j)})[0];if(C&&C.should){A.cancelable&&A.preventDefault();return}if(!C){var O=(l.current.shards||[]).map(CT).filter(Boolean).filter(function(_){return _.contains(A.target)}),T=O.length>0?u(A,O[0]):!l.current.noIsolation;T&&A.cancelable&&A.preventDefault()}}},[]),h=v.useCallback(function(S,A,j,C){var O={name:S,delta:A,target:j,should:C,shadowParent:nG(j)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(T){return T!==O})},1)},[]),p=v.useCallback(function(S){n.current=Tm(S),r.current=void 0},[]),b=v.useCallback(function(S){h(S.type,jT(S),S.target,u(S,e.lockRef.current))},[]),g=v.useCallback(function(S){h(S.type,Tm(S),S.target,u(S,e.lockRef.current))},[]);v.useEffect(function(){return wc.push(o),e.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:g}),document.addEventListener("wheel",f,xc),document.addEventListener("touchmove",f,xc),document.addEventListener("touchstart",p,xc),function(){wc=wc.filter(function(S){return S!==o}),document.removeEventListener("wheel",f,xc),document.removeEventListener("touchmove",f,xc),document.removeEventListener("touchstart",p,xc)}},[]);var x=e.removeScrollBar,E=e.inert;return v.createElement(v.Fragment,null,E?v.createElement(o,{styles:JH(i)}):null,x?v.createElement(KH,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function nG(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rG=_H(A2,tG);var T2=v.forwardRef(function(e,t){return v.createElement(Ob,jt({},e,{ref:t,sideCar:rG}))});T2.classNames=Ob.classNames;var aG=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Sc=new WeakMap,Pm=new WeakMap,_m={},g0=0,P2=function(e){return e&&(e.host||P2(e.parentNode))},iG=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=P2(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},oG=function(e,t,n,r){var i=iG(t,Array.isArray(e)?e:[e]);_m[n]||(_m[n]=new WeakMap);var o=_m[n],l=[],u=new Set,f=new Set(i),h=function(b){!b||u.has(b)||(u.add(b),h(b.parentNode))};i.forEach(h);var p=function(b){!b||f.has(b)||Array.prototype.forEach.call(b.children,function(g){if(u.has(g))p(g);else try{var x=g.getAttribute(r),E=x!==null&&x!=="false",S=(Sc.get(g)||0)+1,A=(o.get(g)||0)+1;Sc.set(g,S),o.set(g,A),l.push(g),S===1&&E&&Pm.set(g,!0),A===1&&g.setAttribute(n,"true"),E||g.setAttribute(r,"true")}catch(j){console.error("aria-hidden: cannot operate on ",g,j)}})};return p(t),u.clear(),g0++,function(){l.forEach(function(b){var g=Sc.get(b)-1,x=o.get(b)-1;Sc.set(b,g),o.set(b,x),g||(Pm.has(b)||b.removeAttribute(r),Pm.delete(b)),x||b.removeAttribute(n)}),g0--,g0||(Sc=new WeakMap,Sc=new WeakMap,Pm=new WeakMap,_m={})}},sG=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=aG(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),oG(r,i,n,"aria-hidden")):function(){return null}},Nb="Dialog",[_2]=FS(Nb),[lG,$a]=_2(Nb),D2=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,u=v.useRef(null),f=v.useRef(null),[h,p]=Nk({prop:r,defaultProp:i??!1,onChange:o,caller:Nb});return d.jsx(lG,{scope:t,triggerRef:u,contentRef:f,contentId:d0(),titleId:d0(),descriptionId:d0(),open:h,onOpenChange:p,onOpenToggle:v.useCallback(()=>p(b=>!b),[p]),modal:l,children:n})};D2.displayName=Nb;var M2="DialogTrigger",cG=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=$a(M2,n),o=Ua(t,i.triggerRef);return d.jsx(sr.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":vE(i.open),...r,ref:o,onClick:Rn(e.onClick,i.onOpenToggle)})});cG.displayName=M2;var pE="DialogPortal",[uG,R2]=_2(pE,{forceMount:void 0}),k2=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=$a(pE,t);return d.jsx(uG,{scope:t,forceMount:n,children:v.Children.map(r,l=>d.jsx(_f,{present:n||o.open,children:d.jsx(KS,{asChild:!0,container:i,children:l})}))})};k2.displayName=pE;var wp="DialogOverlay",L2=v.forwardRef((e,t)=>{const n=R2(wp,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=$a(wp,e.__scopeDialog);return o.modal?d.jsx(_f,{present:r||o.open,children:d.jsx(fG,{...i,ref:t})}):null});L2.displayName=wp;var dG=hp("DialogOverlay.RemoveScroll"),fG=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=$a(wp,n);return d.jsx(T2,{as:dG,allowPinchZoom:!0,shards:[i.contentRef],children:d.jsx(sr.div,{"data-state":vE(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),xl="DialogContent",I2=v.forwardRef((e,t)=>{const n=R2(xl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=$a(xl,e.__scopeDialog);return d.jsx(_f,{present:r||o.open,children:o.modal?d.jsx(hG,{...i,ref:t}):d.jsx(mG,{...i,ref:t})})});I2.displayName=xl;var hG=v.forwardRef((e,t)=>{const n=$a(xl,e.__scopeDialog),r=v.useRef(null),i=Ua(t,n.contentRef,r);return v.useEffect(()=>{const o=r.current;if(o)return sG(o)},[]),d.jsx(z2,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Rn(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Rn(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Rn(e.onFocusOutside,o=>o.preventDefault())})}),mG=v.forwardRef((e,t)=>{const n=$a(xl,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return d.jsx(z2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),z2=v.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=$a(xl,n),f=v.useRef(null),h=Ua(t,f);return SH(),d.jsxs(d.Fragment,{children:[d.jsx(w2,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:d.jsx($S,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":vE(u.open),...l,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(bG,{titleId:u.titleId}),d.jsx(gG,{contentRef:f,descriptionId:u.descriptionId})]})]})}),bE="DialogTitle",U2=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=$a(bE,n);return d.jsx(sr.h2,{id:i.titleId,...r,ref:t})});U2.displayName=bE;var q2="DialogDescription",pG=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=$a(q2,n);return d.jsx(sr.p,{id:i.descriptionId,...r,ref:t})});pG.displayName=q2;var B2="DialogClose",F2=v.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=$a(B2,n);return d.jsx(sr.button,{type:"button",...r,ref:t,onClick:Rn(e.onClick,()=>i.onOpenChange(!1))})});F2.displayName=B2;function vE(e){return e?"open":"closed"}var $2="DialogTitleWarning",[Nhe,K2]=M4($2,{contentName:xl,titleName:bE,docsSlug:"dialog"}),bG=({titleId:e})=>{const t=K2($2),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 201 201 202 202 If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 203 203 204 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null}, bG="DialogDescriptionWarning",vG=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$2(bG).contentName}}.`;return v.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Tb=_2,Pb=R2,_b=k2,Db=L2,gE=z2,Mb=B2;function gG({open:e,onOpenChange:t,visitorName:n,messages:r}){const i=document.getElementById("bitbot-admin-root")??void 0;return d.jsx(Tb,{open:e,onOpenChange:t,children:d.jsxs(Pb,{container:i,children:[d.jsx(_b,{className:"bb-lead-chat-overlay"}),d.jsxs(Db,{className:"bb-lead-chat-modal","aria-describedby":void 0,children:[d.jsxs("header",{className:"bb-lead-chat-head",children:[d.jsxs(gE,{className:"bb-lead-chat-title",children:["Chat transcript",d.jsxs("span",{className:"bb-lead-chat-count",children:[r.length," ",r.length===1?"message":"messages"]})]}),d.jsx(Mb,{className:"bb-lead-chat-close","aria-label":"Close",children:"✕"})]}),d.jsx("div",{className:"bb-lead-chat-body",children:r.length===0?d.jsx("p",{className:"bb-field-help",children:"No conversation linked to this lead."}):d.jsx("ol",{className:"bb-transcript",children:r.map((o,l)=>d.jsxs("li",{className:`bb-msg bb-msg-${o.role}`,children:[d.jsx("span",{className:"bb-msg-role",children:o.role==="user"?n||"Visitor":"BitBot"}),d.jsx("p",{className:"bb-msg-body",children:o.content}),d.jsx("span",{className:"bb-msg-time",children:ir(o.createdAt)})]},l))})})]})]})})}function yG(e){const t=e.replace(/[-_]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}function xG({open:e,onOpenChange:t,lead:n}){const r=document.getElementById("bitbot-admin-root")??void 0,i=Object.entries(n.customFields??{}),o=[["Name",n.name||""],["Email",n.email||""],...n.phone?[["Phone",n.phone]]:[],...n.message?[["Message",n.message]]:[]];return d.jsx(Tb,{open:e,onOpenChange:t,children:d.jsxs(Pb,{container:r,children:[d.jsx(_b,{className:"bb-lead-chat-overlay"}),d.jsxs(Db,{className:"bb-lead-chat-modal","aria-describedby":void 0,children:[d.jsxs("header",{className:"bb-lead-chat-head",children:[d.jsxs(gE,{className:"bb-lead-chat-title",children:["Form submission",d.jsx("span",{className:"bb-lead-chat-count",children:ir(n.createdAt)})]}),d.jsx(Mb,{className:"bb-lead-chat-close","aria-label":"Close",children:"✕"})]}),d.jsx("div",{className:"bb-lead-chat-body",children:d.jsxs("dl",{className:"bb-lead-submission",children:[o.map(([l,u])=>d.jsxs("div",{className:"bb-lead-submission-row",children:[d.jsx("dt",{children:l}),d.jsx("dd",{children:u||"—"})]},l)),i.map(([l,u])=>d.jsxs("div",{className:"bb-lead-submission-row",children:[d.jsx("dt",{children:yG(l)}),d.jsx("dd",{children:u||"—"})]},l))]})})]})]})})}function wG({leadId:e,onClose:t}){var L,z,R,q,U,re,G,ie,K,Z,$;const{data:n,isLoading:r}=K8(e),i=G8(),o=Y8(),l=Rf(),u=u5(),f=((z=(L=l.data)==null?void 0:L.integration)==null?void 0:z.status)==="connected",h=!!((R=n==null?void 0:n.lead)!=null&&R.zohoLeadId),p=d5(e,f&&h),b=mE(),g=uH(),x=!!((q=b.data)!=null&&q.configured),E=!!((U=n==null?void 0:n.lead)!=null&&U.pipedrivePersonId),S=cH(e,x&&E),[A,j]=v.useState(null),[C,O]=v.useState(!1),[T,_]=v.useState(!1);if(!e)return d.jsx("aside",{className:"bb-lead-detail bb-lead-detail-empty",children:d.jsxs("div",{className:"bb-lead-detail-placeholder",children:[d.jsx("span",{className:"bb-eyebrow",children:"No lead selected"}),d.jsx("h3",{className:"bb-lead-placeholder-headline",children:"Pick a lead to see the full thread."}),d.jsx("p",{className:"bb-lead-placeholder-body",children:"The detail panel shows AI research, the chat transcript, and lets you draft a follow-up email."})]})});if(r||!n)return d.jsx("aside",{className:"bb-lead-detail",children:d.jsx("div",{className:"bb-skeleton",style:{height:480,margin:20,borderRadius:8}})});const{lead:P,conversationMessages:D}=n;return d.jsxs("aside",{className:"bb-lead-detail",children:[d.jsxs("header",{className:"bb-lead-detail-header",children:[d.jsxs("div",{children:[d.jsx("div",{className:"bb-lead-detail-name",children:P.name||"(no name)"}),d.jsxs("div",{className:"bb-lead-detail-email",children:[d.jsx("a",{href:`mailto:${P.email}`,children:P.email}),P.phone&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("span",{children:P.phone})]})]}),d.jsxs("div",{className:"bb-lead-detail-sub",children:[(()=>{const ee=Hk(P.channel);return P.channel&&P.channel!=="web_widget"?d.jsxs("span",{title:`Captured via ${ee.label}`,children:[ee.icon," ",ee.label," ·"]}):null})(),d.jsxs("span",{children:["via ",Gk(P.source)]}),P.city&&d.jsxs("span",{children:["· ",P.city,", ",P.country]}),d.jsxs("span",{children:["· ",ir(P.createdAt)]}),D.length>0&&d.jsxs("button",{type:"button",className:"bb-lead-detail-chat-chip",onClick:()=>O(!0),children:["View chat (",D.length,")"]}),(P.formId||Object.keys(P.customFields??{}).length>0)&&d.jsx("button",{type:"button",className:"bb-lead-detail-chat-chip",onClick:()=>_(!0),children:"View submission"})]})]}),d.jsx("button",{className:"bb-lead-close",onClick:t,"aria-label":"Close lead",children:"✕"})]}),(f||x)&&d.jsxs("div",{className:"bb-crm-status",children:[f&&d.jsx(OT,{name:"Zoho",synced:h,loading:p.isLoading,error:p.isError,stage:((re=p.data)==null?void 0:re.stage)??null,modifiedAt:((G=p.data)==null?void 0:G.modifiedAt)??null,openUrl:((ie=p.data)==null?void 0:ie.zohoUrl)??null,pushing:u.isPending,onPush:()=>u.mutate(P.id)}),x&&d.jsx(OT,{name:"Pipedrive",synced:E,loading:S.isLoading,error:S.isError,stage:((K=S.data)==null?void 0:K.stage)??null,noStageLabel:"no deal",modifiedAt:((Z=S.data)==null?void 0:Z.modifiedAt)??null,openUrl:(($=S.data)==null?void 0:$.pipedriveUrl)??null,pushing:g.isPending,onPush:()=>g.mutate(P.id)})]}),d.jsx(Lr,{eyebrow:"AI research",title:"Who is this lead?",children:P.researchSummary?d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"bb-lead-research-summary",children:P.researchSummary}),P.suggestedAction&&d.jsxs("div",{className:"bb-lead-research-action",children:[d.jsx("span",{className:"bb-eyebrow",children:"Suggested next step"}),d.jsx("p",{children:P.suggestedAction})]}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>i.mutate({leadId:P.id}),disabled:i.isPending,children:i.isPending?"Re-researching…":"Refresh research"})]}):d.jsxs("div",{className:"bb-lead-research-empty",children:[d.jsx("p",{children:"No research yet. The AI can scan public sources, summarise the lead's profile, and suggest a follow-up."}),d.jsx("button",{className:"bb-btn bb-btn-primary",onClick:()=>i.mutate({leadId:P.id}),disabled:i.isPending,children:i.isPending?"Researching…":"Run AI research"})]})}),d.jsx(Lr,{eyebrow:"Follow-up email",title:A?"Edit draft":"Send a follow-up",titleAction:!A&&d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>o.mutate({leadId:P.id},{onSuccess:j}),disabled:o.isPending,children:o.isPending?"Drafting…":"Draft with AI"}),children:A?d.jsxs("div",{className:"bb-lead-draft",children:[d.jsx("input",{className:"bb-input",value:A.subject,onChange:ee=>j({...A,subject:ee.target.value}),placeholder:"Subject"}),d.jsx("textarea",{className:"bb-input bb-textarea",rows:8,value:A.body,onChange:ee=>j({...A,body:ee.target.value})}),d.jsxs("div",{className:"bb-lead-draft-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>j(null),children:"Cancel"}),d.jsx("a",{className:"bb-btn bb-btn-primary bb-btn-small",href:`mailto:${P.email}?subject=${encodeURIComponent(A.subject)}&body=${encodeURIComponent(A.body)}`,children:"Open in mail client"})]})]}):d.jsx("p",{className:"bb-lead-draft-hint",children:"Generate a personalised follow-up using the AI research and the chat transcript. You can edit before sending."})}),d.jsx(gG,{open:C,onOpenChange:O,visitorName:P.name||"Visitor",messages:D.slice()}),d.jsx(xG,{open:T,onOpenChange:_,lead:P})]})}function OT({name:e,synced:t,loading:n,error:r,stage:i,noStageLabel:o="not set",modifiedAt:l,openUrl:u,pushing:f,onPush:h}){return d.jsxs("div",{className:"bb-crm-row",children:[d.jsx("span",{className:t?"bb-crm-name is-synced":"bb-crm-name",children:t?`✓ ${e}`:e}),t?n?d.jsx("span",{className:"bb-crm-muted",children:"checking…"}):r?d.jsxs("span",{className:"bb-crm-muted",children:["couldn’t reach ",e]}):d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"bb-crm-detail",children:["stage: ",i??o]}),l&&d.jsxs("span",{className:"bb-crm-muted",children:["· ",ir(l)]}),u&&d.jsx("a",{className:"bb-crm-action",href:u,target:"_blank",rel:"noopener noreferrer",children:"Open ↗"})]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"bb-crm-muted",children:"not synced"}),d.jsx("button",{type:"button",className:"bb-crm-action",onClick:h,disabled:f,children:f?"Pushing…":"Push ↗"})]})]})}function SG(){return new URL(window.location.href).searchParams.get("lead")}function EG(e){const t=new URL(window.location.href);e?t.searchParams.set("lead",e):t.searchParams.delete("lead"),window.history.replaceState({},"",t)}function AG(){const[e,t]=v.useState(SG());v.useEffect(()=>{EG(e)},[e]);const n=r=>t(r.id);return d.jsxs(d.Fragment,{children:[d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:"Leads"}),d.jsx("span",{className:"bb-section-aside",children:"Captured from chat. Form submissions live inside each form."})]}),d.jsx(jG,{}),d.jsxs("div",{className:"bb-leads-grid",children:[d.jsx(iH,{selectedId:e,onSelect:n}),d.jsx(wG,{leadId:e,onClose:()=>t(null)})]})]})}function jG(){const{settings:e,save:t,isSaving:n}=ZS(),r=(Re().adminEmail??"").trim(),[i,o]=v.useState((e==null?void 0:e.notificationEmail)??""),[l,u]=v.useState(!1);if(v.useEffect(()=>{l||o((e==null?void 0:e.notificationEmail)??"")},[e==null?void 0:e.notificationEmail,l]),!e)return null;const f=(e.notificationEmail??"").trim(),h=l&&i!==f,p=f.length>0,b=()=>{o(f||r),u(!0)};return d.jsxs("div",{className:"bb-lead-notification-strip",children:[!l&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"bb-lead-notification-summary",children:[d.jsx("strong",{children:"Lead notifications"}),d.jsx("span",{className:"bb-lead-notification-status",children:p?`Emailing ${f}`:"Off — no one gets notified"})]}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:b,children:p?"Change":"Add email"})]}),l&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"bb-lead-notification-edit",children:[d.jsx("strong",{children:"Lead notifications"}),d.jsx("p",{className:"bb-field-help",style:{margin:"4px 0 8px"},children:"We email this address when a new lead lands. Leave blank to skip."}),d.jsx("input",{type:"email",className:"bb-input",value:i,onChange:g=>o(g.target.value),placeholder:"notifications@yourbusiness.com","data-ph-mask":!0,autoFocus:!0})]}),d.jsxs("div",{className:"bb-lead-notification-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",disabled:n||!h,onClick:()=>{t({notificationEmail:i}),u(!1)},children:n?"Saving…":"Save"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>{o(f),u(!1)},children:"Cancel"})]})]})]})}const CG=50;function K2(e=null){var o,l,u,f,h;const t=xb({queryKey:["conversations",e],initialPageParam:1,queryFn:async({pageParam:p})=>{const b=await me("GetConversations",{page:p,pageSize:CG,channel:e||void 0});if(!b.success)throw new Error(b.error);return b.data},getNextPageParam:p=>p.page*p.pageSize<p.total?p.page+1:void 0,refetchInterval:1e4,staleTime:5e3,placeholderData:Pf}),n=(((o=t.data)==null?void 0:o.pages)??[]).flatMap(p=>p.conversations),r=((u=(l=t.data)==null?void 0:l.pages[0])==null?void 0:u.total)??n.length,i=((h=(f=t.data)==null?void 0:f.pages[0])==null?void 0:h.stateCounts)??{all:0,live:0,needs:0,past:0};return{data:n,total:r,stateCounts:i,isLoading:t.isLoading,isFetchingNextPage:t.isFetchingNextPage,hasNextPage:!!t.hasNextPage,fetchNextPage:()=>t.fetchNextPage()}}function OG(){return Et({queryKey:["conversation-facets"],queryFn:async()=>{const e=await me("GetConversationFacets");return e.success?e.data:{channels:[]}},staleTime:3e4,placeholderData:Pf})}function NG(e){const t=Ne(),n=Et({queryKey:["conversation",e],queryFn:async()=>{if(!e)return[];const i=await me("GetLiveChatMessages",{conversationId:e});if(!i.success)throw new Error(i.error);return i.data.messages},enabled:!!e,refetchInterval:5e3,staleTime:2e3}),r=v.useRef(null);return v.useEffect(()=>{e&&n.isSuccess&&r.current!==e&&(r.current=e,t.invalidateQueries({queryKey:["menu-badges"]}))},[e,n.isSuccess,t]),n}function TG(){const e=Ne();return je({mutationFn:async({conversationId:t,opener:n})=>{const r=await me("AdminTakeOverChat",{conversationId:t,...n?{opener:n}:{}});if(!r.success)throw new Error(r.error);return r.data},onSuccess:(t,{conversationId:n})=>{le.success("You're live with the visitor"),e.invalidateQueries({queryKey:["conversations"]}),e.invalidateQueries({queryKey:["conversation",n]}),e.invalidateQueries({queryKey:["live-conversations-count"]})},onError:t=>le.error(t instanceof Error?t.message:"Take-over failed")})}function PG(){const e=Ne();return je({mutationFn:async({conversationId:t,message:n})=>{const r=await me("AdminReplyLive",{conversationId:t,message:n});if(!r.success)throw new Error(r.error);return r.data},onSuccess:(t,{conversationId:n})=>{e.invalidateQueries({queryKey:["conversation",n]}),e.invalidateQueries({queryKey:["conversations"]})},onError:t=>le.error(t instanceof Error?t.message:"Send failed")})}function _G(){const e=Ne();return je({mutationFn:async({conversationId:t})=>{const n=await me("CloseLiveThread",{conversationId:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:(t,{conversationId:n})=>{le.success("Handed back to the bot"),e.invalidateQueries({queryKey:["conversations"]}),e.invalidateQueries({queryKey:["conversation",n]}),e.invalidateQueries({queryKey:["live-conversations-count"]})},onError:t=>le.error(t instanceof Error?t.message:"Close failed")})}function DG(){return je({mutationFn:async({conversationIds:e})=>{const t=await me("CheckConversationLeads",{conversationIds:e});if(!t.success)throw new Error(t.error);return t.data}})}function MG(){const e=Ne();return je({mutationFn:async({conversationIds:t,deleteLeads:n})=>{const r=await me("DeleteConversations",{conversationIds:t,deleteLeads:n});if(!r.success)throw new Error(r.error);return r.data},onSuccess:t=>{const n=[];n.push(`Deleted ${t.conversationsDeleted} ${t.conversationsDeleted===1?"thread":"threads"}`),t.leadsDeleted>0&&n.push(`${t.leadsDeleted} ${t.leadsDeleted===1?"lead":"leads"}`),le.success(n.join(" · ")),e.invalidateQueries({queryKey:["conversations"]}),e.invalidateQueries({queryKey:["leads"]}),e.invalidateQueries({queryKey:["live-conversations-count"]}),e.invalidateQueries({queryKey:["new-conversations-count"]}),e.invalidateQueries({queryKey:["unviewed-leads"]}),e.invalidateQueries({queryKey:["menu-badges"]})},onError:t=>le.error(t instanceof Error?t.message:"Delete failed")})}function RG(){const e=Ne();return je({mutationFn:async({conversationIds:t})=>{const n=await me("MarkConversationsRead",{conversationIds:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:t=>{le.success(`Marked ${t.marked} ${t.marked===1?"thread":"threads"} read`),e.invalidateQueries({queryKey:["conversations"]}),e.invalidateQueries({queryKey:["live-conversations-count"]}),e.invalidateQueries({queryKey:["menu-badges"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not mark read")})}function kG(e){const t=String(e??""),n=[],r=/(https?:\/\/[^\s<>]+)/g;let i=0,o=0,l;for(;(l=r.exec(t))!==null;){l.index>i&&n.push(t.slice(i,l.index));const u=l[1],f=u.replace(/[.,;:!?)\]]+$/,"");n.push(d.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",children:f},o++)),f.length<u.length&&n.push(u.slice(f.length)),i=l.index+u.length}return i<t.length&&n.push(t.slice(i)),n}function yE(e){const t=e.channel==="messenger"||e.channel==="instagram_dm"||e.channel==="email";return e.liveMode?e.unreadAdminCount>0?"needs-human":t?"open":"live-admin":t?"open":e.presence==="present"?"live-bot":e.presence==="idle"?"idle":"ended"}function Mw({channel:e}){return e==="messenger"?d.jsx("span",{className:"bb-conv-channel bb-conv-channel-messenger",title:"Messenger DM",children:"FB"}):e==="instagram_dm"?d.jsx("span",{className:"bb-conv-channel bb-conv-channel-instagram",title:"Instagram DM",children:"IG"}):e==="email"?d.jsx("span",{className:"bb-conv-channel bb-conv-channel-email",title:"Email support",children:"✉"}):null}function H2({state:e}){switch(e){case"live-admin":return d.jsxs("span",{className:"bb-conv-badge bb-conv-badge-admin",children:[d.jsx("span",{className:"bb-conv-badge-dot"}),"Live · You"]});case"live-bot":return d.jsxs("span",{className:"bb-conv-badge bb-conv-badge-bot",children:[d.jsx("span",{className:"bb-conv-badge-dot"}),"Live · Bot"]});case"needs-human":return d.jsxs("span",{className:"bb-conv-badge bb-conv-badge-urgent",children:["Needs reply",d.jsx("span",{className:"bb-conv-badge-arrow",children:"→"})]});case"idle":return d.jsx("span",{className:"bb-conv-badge bb-conv-badge-idle",children:"Idle"});case"ended":return d.jsx("span",{className:"bb-conv-badge bb-conv-badge-past",children:"Ended"});case"open":return d.jsx("span",{className:"bb-conv-badge bb-conv-badge-open",children:"Open"})}}function LG(){return new URL(window.location.href).searchParams.get("conv")}function IG(e){const t=new URL(window.location.href);e?t.searchParams.set("conv",e):t.searchParams.delete("conv"),window.history.replaceState({},"",t)}function zG({conv:e,active:t,onSelect:n,selected:r,onToggleSelect:i,selectionActive:o,onDeleteSingle:l}){const u=yE(e);return d.jsxs("div",{className:`bb-conv-row bb-conv-row-state-${u} ${t?"bb-conv-row-active":""} ${r?"bb-conv-row-selected":""}`,children:[d.jsx("label",{className:`bb-conv-row-check ${o||r?"bb-conv-row-check-visible":""}`,onClick:f=>f.stopPropagation(),children:d.jsx("input",{type:"checkbox",checked:r,onChange:i,"aria-label":r?`Deselect ${e.displayLabel}`:`Select ${e.displayLabel}`})}),d.jsxs("button",{className:"bb-conv-row-body",onClick:n,children:[d.jsxs("div",{className:"bb-conv-row-top",children:[d.jsxs("span",{className:"bb-conv-row-id",children:[!e.viewedAt&&d.jsx("span",{className:"bb-conv-row-newdot",title:"New — not opened yet","aria-label":"New"}),e.displayLabel,d.jsx(Mw,{channel:e.channel})]}),d.jsx("span",{className:"bb-conv-row-time",children:ir(e.lastMessageAt)})]}),(e.visitorCity||e.unreadAdminCount>0)&&d.jsxs("div",{className:"bb-conv-row-mid",children:[e.visitorCity&&d.jsxs("span",{className:"bb-conv-row-muted",children:[e.visitorCity,", ",e.visitorCountry]}),e.unreadAdminCount>0&&d.jsxs("span",{className:"bb-conv-row-unread",children:[e.unreadAdminCount," new"]})]}),d.jsx("div",{className:"bb-conv-row-status",children:d.jsx(H2,{state:u})})]}),d.jsx("button",{type:"button",className:"bb-conv-row-delete",title:"Delete this thread","aria-label":`Delete thread ${e.displayLabel}`,onClick:f=>{f.stopPropagation(),l()},children:"🗑"})]})}function UG(e){switch(e){case"web_widget":return"Web chat";case"messenger":return"Facebook";case"instagram_dm":return"Instagram";case"email":return"Email";default:return e}}function qG(e,t){return t==="all"?!0:t==="live"?e==="live-admin"||e==="live-bot"||e==="open":t==="needs"?e==="needs-human":e==="idle"||e==="ended"}function BG({conv:e}){const{data:t,isLoading:n,error:r}=NG(e.id),i=TG(),o=PG(),l=_G(),{data:u}=Ai(),[f,h]=v.useState(""),[p,b]=v.useState(!1),[g,x]=v.useState("oldest"),E=v.useRef(null),S=yE(e),A=(u==null?void 0:u.plan)==="free";if(v.useEffect(()=>{const O=E.current;O&&(O.scrollTop=g==="newest"?0:O.scrollHeight)},[t==null?void 0:t.length,g]),A)return d.jsxs(d.Fragment,{children:[d.jsx("header",{className:"bb-conv-header",children:d.jsxs("div",{children:[d.jsxs("div",{className:"bb-conv-title-row",children:[d.jsx("h3",{className:"bb-conv-title",children:e.displayLabel}),d.jsx(Mw,{channel:e.channel})]}),d.jsxs("div",{className:"bb-conv-sub",children:["Last message ",ir(e.lastMessageAt)]})]})}),d.jsxs("div",{className:"bb-conv-thread-locked",children:[d.jsx("p",{className:"bb-conv-thread-locked-headline",children:"Transcript locked on Free."}),d.jsx("p",{className:"bb-conv-thread-locked-body",children:"Your bot is talking to visitors. Upgrade to Assistant to read what they're asking, follow up on the leads, and take over live."}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:()=>b(!0),children:"Upgrade to view →"})]}),d.jsx(gs,{open:p,onClose:()=>b(!1)})]});if(n||!t&&!r)return d.jsx("div",{className:"bb-skeleton",style:{height:320,margin:12,borderRadius:8}});if(!t)return d.jsx("div",{className:"bb-inline-error",role:"alert",children:"Couldn't load this thread. Try again."});const j=()=>{f.trim()&&o.mutate({conversationId:e.id,message:f},{onSuccess:()=>h("")})},C=S==="live-bot"||S==="open";return d.jsxs(d.Fragment,{children:[d.jsxs("header",{className:"bb-conv-header",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"bb-conv-title-row",children:[d.jsx("h3",{className:"bb-conv-title",children:e.displayLabel}),d.jsx(Mw,{channel:e.channel}),d.jsx(H2,{state:S})]}),d.jsxs("div",{className:"bb-conv-sub",children:[e.visitorEmail&&d.jsx("a",{href:`mailto:${e.visitorEmail}`,children:e.visitorEmail}),e.visitorEmail&&(e.visitorCity||e.visitorCountry)&&d.jsx(d.Fragment,{children:" · "}),e.visitorCity&&d.jsxs("span",{children:[e.visitorCity,", ",e.visitorCountry]}),d.jsxs("span",{children:[" · ",t.length," messages"]}),t.length>1&&d.jsxs("button",{type:"button",className:"bb-conv-sort",onClick:()=>x(O=>O==="oldest"?"newest":"oldest"),title:"Toggle message order",children:[g==="oldest"?"Oldest first":"Newest first"," ⇅"]})]})]}),C&&d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",disabled:i.isPending,onClick:()=>i.mutate({conversationId:e.id}),children:i.isPending?"Taking over…":"Take over chat →"})]}),d.jsxs("ol",{ref:E,className:"bb-transcript bb-conv-transcript",children:[t.length===0&&d.jsx("li",{className:"bb-conv-empty-thread",children:"No messages yet."}),(g==="newest"?[...t].reverse():t).map((O,T)=>{const _=O.content??"",P=e.channel==="email"&&O.role==="user"?_.match(/^Subject:\s*([^\n]*)\n+([\s\S]*)$/):null;return d.jsxs("li",{className:`bb-msg bb-msg-${O.role}`,children:[d.jsx("span",{className:"bb-msg-role",children:O.role==="user"?e.visitorName??"Visitor":O.role==="admin"?"You":"BitBot"}),P?d.jsxs("div",{className:"bb-msg-body bb-msg-email",children:[P[1].trim()&&d.jsx("div",{className:"bb-msg-email-subject",children:P[1].trim()}),d.jsx("div",{className:"bb-msg-email-text",children:kG(P[2].trim())})]}):d.jsx("p",{className:"bb-msg-body",children:_}),d.jsx("span",{className:"bb-msg-time",children:ir(O.createdAt)})]},O.id??T)})]}),e.liveMode&&d.jsxs("footer",{className:"bb-conv-composer",children:[d.jsx("textarea",{className:"bb-input bb-textarea",rows:3,value:f,onChange:O=>h(O.target.value),placeholder:"Type your reply… The visitor sees this directly.",onKeyDown:O=>{O.key==="Enter"&&(O.metaKey||O.ctrlKey)&&(O.preventDefault(),j())}}),d.jsxs("div",{className:"bb-conv-composer-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",disabled:l.isPending,onClick:()=>l.mutate({conversationId:e.id}),children:l.isPending?"Handing back…":"Hand back to bot"}),d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",disabled:!f.trim()||o.isPending,onClick:j,children:o.isPending?"Sending…":"Send reply (⌘↵)"})]})]})]})}function FG(){const[e,t]=v.useState(LG()),[n,r]=v.useState("all"),[i,o]=v.useState(null),[l,u]=v.useState(new Set),[f,h]=v.useState(null),{data:p,total:b,stateCounts:g,isLoading:x,hasNextPage:E,isFetchingNextPage:S,fetchNextPage:A}=K2(i),{data:j}=OG(),C=DG(),O=MG(),T=RG();v.useEffect(()=>{IG(e)},[e]);const _=p??[],P=v.useMemo(()=>_.filter($=>qG(yE($),n)),[_,n]),D=_.find($=>$.id===e)??null,L=v.useMemo(()=>{const $=new Set;for(const ee of P)l.has(ee.id)&&$.add(ee.id);return $},[P,l]),z=L.size,R=z>0&&z===P.length,q=$=>{const ee=new Set(l);ee.has($)?ee.delete($):ee.add($),u(ee)},U=()=>{u(R?new Set:new Set(P.map($=>$.id)))},re=()=>u(new Set),G=async()=>{const $=Array.from(L);if($.length===0)return;const ee=await C.mutateAsync({conversationIds:$}).catch(()=>null);h({ids:$,linkedLeads:(ee==null?void 0:ee.linked)??[]})},ie=async $=>{f&&(await O.mutateAsync({conversationIds:f.ids,deleteLeads:$}).catch(()=>null),e&&f.ids.includes(e)&&t(null),h(null),re())},K=async()=>{const $=Array.from(L);$.length!==0&&(await T.mutateAsync({conversationIds:$}).catch(()=>null),re())},Z=[{key:"all",label:"All",count:g.all},{key:"live",label:"Live",count:g.live},{key:"needs",label:"Needs reply",count:g.needs,urgent:g.needs>0},{key:"past",label:"Past",count:g.past}];return d.jsxs(d.Fragment,{children:[d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:"Conversations"}),d.jsxs("span",{className:"bb-section-aside",children:[g.live>0&&d.jsxs(d.Fragment,{children:[d.jsx("strong",{children:g.live})," live"]}),g.live>0&&g.needs>0&&d.jsx(d.Fragment,{children:" · "}),g.needs>0&&d.jsxs("span",{className:"bb-conv-aside-urgent",children:[d.jsx("strong",{children:g.needs})," need",g.needs===1?"s":""," reply"]}),(g.live>0||g.needs>0)&&d.jsx(d.Fragment,{children:" · "}),d.jsx("span",{children:_.length<b?d.jsxs(d.Fragment,{children:["Showing ",d.jsx("strong",{children:_.length})," of ",b," threads from the last 30 days"]}):d.jsxs(d.Fragment,{children:[_.length," ",_.length===1?"thread":"threads"," from the last 30 days"]})})]})]}),d.jsxs("div",{className:"bb-conv-grid",children:[d.jsxs("section",{className:"bb-conv-list-card",children:[d.jsx("header",{className:"bb-card-header",children:d.jsxs("h3",{className:"bb-card-title",children:[d.jsx("span",{className:"bb-eyebrow",children:"Threads"}),d.jsx("span",{children:"Live & recent"})]})}),d.jsx("div",{className:"bb-conv-filters",role:"tablist","aria-label":"Conversation filter",children:Z.map($=>{const ee=n===$.key;return d.jsxs("button",{type:"button",role:"tab","aria-selected":ee,className:`bb-conv-filter ${ee?"bb-conv-filter-active":""} ${$.urgent?"bb-conv-filter-urgent":""}`,onClick:()=>r($.key),children:[$.label,d.jsx("span",{className:"bb-conv-filter-count",children:$.count})]},$.key)})}),((j==null?void 0:j.channels.length)??0)>1&&d.jsx("div",{className:"bb-conv-channel-filter-wrap",children:d.jsxs("select",{className:"bb-input bb-conv-channel-filter",value:i??"",onChange:$=>o($.target.value||null),"aria-label":"Filter by channel",children:[d.jsx("option",{value:"",children:"All channels"}),j.channels.map($=>d.jsxs("option",{value:$.value,children:[UG($.value)," (",$.count,")"]},$.value))]})}),d.jsxs("div",{className:"bb-conv-list",children:[x&&d.jsx("div",{className:"bb-skeleton",style:{height:360,margin:12,borderRadius:8}}),!x&&_.length===0&&d.jsx(uu,{headline:"No conversations yet",body:"Once visitors start chatting, every thread shows up here. The list updates every 10 seconds.",ctaLabel:"Test your widget",onCta:()=>window.open("/","_blank")}),!x&&_.length>0&&P.length===0&&d.jsx("div",{className:"bb-conv-filter-empty",children:n==="needs"?"Nothing waiting for a reply — you're all caught up.":n==="live"?"No live conversations.":"Nothing here yet."}),!x&&z>0&&d.jsxs("div",{className:"bb-conv-bulk-bar",children:[d.jsxs("label",{className:"bb-conv-bulk-select-all",children:[d.jsx("input",{type:"checkbox",checked:R,ref:$=>{$&&($.indeterminate=z>0&&!R)},onChange:U,"aria-label":R?"Deselect all":"Select all"}),d.jsx("span",{children:R?`${z} selected (all)`:`${z} selected`})]}),d.jsxs("div",{className:"bb-conv-bulk-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:re,children:"Clear"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:K,disabled:T.isPending,children:T.isPending?"Marking…":"Mark read"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-danger bb-btn-small",onClick:G,disabled:C.isPending||O.isPending,children:C.isPending?"Checking…":`Delete ${z}`})]})]}),!x&&P.map($=>d.jsx(zG,{conv:$,active:$.id===e,onSelect:()=>t($.id),selected:L.has($.id),onToggleSelect:()=>q($.id),selectionActive:z>0,onDeleteSingle:async()=>{const ee=await C.mutateAsync({conversationIds:[$.id]}).catch(()=>null);h({ids:[$.id],linkedLeads:(ee==null?void 0:ee.linked)??[]})}},$.id)),(()=>{const $=n==="live"?Math.max(0,g.live-P.length):n==="needs"?Math.max(0,g.needs-P.length):n==="past"?Math.max(0,g.past-P.length):Math.max(0,b-_.length);return E&&$>0?d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-load-more",onClick:()=>A(),disabled:S,children:S?"Loading…":`Load more (${$} remaining)`}):null})()]})]}),d.jsxs(Lr,{eyebrow:D?D.displayLabel:"No thread selected",title:D?"Transcript":"Pick a conversation",className:"bb-conv-detail-card",children:[!D&&d.jsx("p",{className:"bb-conv-placeholder-body",children:"Choose a thread from the left. Live threads can be taken over so you reply directly while the bot stays out of the way. Idle and ended threads are read-only."}),D&&d.jsx(BG,{conv:D})]})]}),f&&d.jsx($G,{conversationCount:f.ids.length,leadCount:f.linkedLeads.reduce(($,ee)=>$+ee.leadIds.length,0),isBusy:O.isPending,onCancel:()=>h(null),onConfirmKeepLeads:()=>ie(!1),onConfirmDeleteLeads:()=>ie(!0)})]})}function $G({conversationCount:e,leadCount:t,isBusy:n,onCancel:r,onConfirmKeepLeads:i,onConfirmDeleteLeads:o}){return d.jsx("div",{className:"bb-modal-backdrop bb-portal-scope",onClick:r,role:"presentation",children:d.jsxs("div",{className:"bb-modal bb-confirm-modal",onClick:l=>l.stopPropagation(),role:"alertdialog","aria-modal":"true",children:[d.jsxs("header",{className:"bb-modal-head",children:[d.jsx("div",{className:"bb-modal-titles",children:d.jsxs("h2",{className:"bb-modal-title",children:["Delete ",e," ",e===1?"thread":"threads","?"]})}),d.jsx("button",{className:"bb-modal-close",onClick:r,disabled:n,"aria-label":"Cancel",children:"×"})]}),d.jsx("div",{className:"bb-modal-body",children:d.jsx("p",{className:"bb-confirm-modal-body",children:t===0?d.jsxs(d.Fragment,{children:["The selected ",e===1?"thread is":"threads are"," not linked to any leads. All transcripts will be permanently removed."]}):d.jsxs(d.Fragment,{children:["The selected ",e===1?"thread is":"threads are"," linked to"," ",d.jsx("strong",{children:t})," ",t===1?"lead":"leads"," in your inbox. What do you want to do with ",t===1?"it":"them","?"]})})}),d.jsxs("footer",{className:"bb-confirm-modal-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost",onClick:r,disabled:n,children:"Cancel"}),t===0?d.jsx("button",{className:"bb-btn bb-btn-destructive",onClick:i,disabled:n,children:n?"Deleting…":`Delete ${e} ${e===1?"thread":"threads"}`}):d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"bb-btn bb-btn-ghost",onClick:i,disabled:n,children:"Keep leads"}),d.jsx("button",{className:"bb-btn bb-btn-destructive",onClick:o,disabled:n,children:"Delete leads too"})]})]})]})})}const Rb="bb_devmockapikey0000000000000000",Ec=e=>new Date(Date.now()-e*864e5).toISOString(),KG=e=>new Date(Date.now()-e*36e5).toISOString(),y0=[{id:"d-1",title:"5 questions every wedding planner asks before quoting",status:"draft",createdAt:KG(3),scheduledAt:null},{id:"d-2",title:"Destination weddings in Trancoso: the 6-month checklist",status:"scheduled",createdAt:Ec(1),scheduledAt:Ec(-2)},{id:"d-3",title:"How to budget for a 200-guest corporate event",status:"published",createdAt:Ec(4),scheduledAt:Ec(3)},{id:"d-4",title:"Why Pinterest is still the best mood-board tool in 2026",status:"draft",createdAt:Ec(7),scheduledAt:null},{id:"d-5",title:"Sample post — generation failed mid-way",status:"failed",createdAt:Ec(10),scheduledAt:null}],G2={id:"d-1",title:"5 questions every wedding planner asks before quoting",slug:"5-questions-wedding-planner-quoting",content:`## Why these five questions matter204 For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vG="DialogDescriptionWarning",gG=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${K2(vG).contentName}}.`;return v.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Tb=D2,Pb=k2,_b=L2,Db=I2,gE=U2,Mb=F2;function yG({open:e,onOpenChange:t,visitorName:n,messages:r}){const i=document.getElementById("bitbot-admin-root")??void 0;return d.jsx(Tb,{open:e,onOpenChange:t,children:d.jsxs(Pb,{container:i,children:[d.jsx(_b,{className:"bb-lead-chat-overlay"}),d.jsxs(Db,{className:"bb-lead-chat-modal","aria-describedby":void 0,children:[d.jsxs("header",{className:"bb-lead-chat-head",children:[d.jsxs(gE,{className:"bb-lead-chat-title",children:["Chat transcript",d.jsxs("span",{className:"bb-lead-chat-count",children:[r.length," ",r.length===1?"message":"messages"]})]}),d.jsx(Mb,{className:"bb-lead-chat-close","aria-label":"Close",children:"✕"})]}),d.jsx("div",{className:"bb-lead-chat-body",children:r.length===0?d.jsx("p",{className:"bb-field-help",children:"No conversation linked to this lead."}):d.jsx("ol",{className:"bb-transcript",children:r.map((o,l)=>d.jsxs("li",{className:`bb-msg bb-msg-${o.role}`,children:[d.jsx("span",{className:"bb-msg-role",children:o.role==="user"?n||"Visitor":"BitBot"}),d.jsx("p",{className:"bb-msg-body",children:o.content}),d.jsx("span",{className:"bb-msg-time",children:ir(o.createdAt)})]},l))})})]})]})})}function xG(e){const t=e.replace(/[-_]+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}function wG({open:e,onOpenChange:t,lead:n}){const r=document.getElementById("bitbot-admin-root")??void 0,i=Object.entries(n.customFields??{}),o=[["Name",n.name||""],["Email",n.email||""],...n.phone?[["Phone",n.phone]]:[],...n.message?[["Message",n.message]]:[]];return d.jsx(Tb,{open:e,onOpenChange:t,children:d.jsxs(Pb,{container:r,children:[d.jsx(_b,{className:"bb-lead-chat-overlay"}),d.jsxs(Db,{className:"bb-lead-chat-modal","aria-describedby":void 0,children:[d.jsxs("header",{className:"bb-lead-chat-head",children:[d.jsxs(gE,{className:"bb-lead-chat-title",children:["Form submission",d.jsx("span",{className:"bb-lead-chat-count",children:ir(n.createdAt)})]}),d.jsx(Mb,{className:"bb-lead-chat-close","aria-label":"Close",children:"✕"})]}),d.jsx("div",{className:"bb-lead-chat-body",children:d.jsxs("dl",{className:"bb-lead-submission",children:[o.map(([l,u])=>d.jsxs("div",{className:"bb-lead-submission-row",children:[d.jsx("dt",{children:l}),d.jsx("dd",{children:u||"—"})]},l)),i.map(([l,u])=>d.jsxs("div",{className:"bb-lead-submission-row",children:[d.jsx("dt",{children:xG(l)}),d.jsx("dd",{children:u||"—"})]},l))]})})]})]})})}function SG({leadId:e,onClose:t}){var L,z,F,G,R,J,$,ne,K,Z,B;const{data:n,isLoading:r}=H8(e),i=Y8(),o=W8(),l=Rf(),u=d5(),f=((z=(L=l.data)==null?void 0:L.integration)==null?void 0:z.status)==="connected",h=!!((F=n==null?void 0:n.lead)!=null&&F.zohoLeadId),p=f5(e,f&&h),b=mE(),g=dH(),x=!!((G=b.data)!=null&&G.configured),E=!!((R=n==null?void 0:n.lead)!=null&&R.pipedrivePersonId),S=uH(e,x&&E),[A,j]=v.useState(null),[C,O]=v.useState(!1),[T,_]=v.useState(!1);if(!e)return d.jsx("aside",{className:"bb-lead-detail bb-lead-detail-empty",children:d.jsxs("div",{className:"bb-lead-detail-placeholder",children:[d.jsx("span",{className:"bb-eyebrow",children:"No lead selected"}),d.jsx("h3",{className:"bb-lead-placeholder-headline",children:"Pick a lead to see the full thread."}),d.jsx("p",{className:"bb-lead-placeholder-body",children:"The detail panel shows AI research, the chat transcript, and lets you draft a follow-up email."})]})});if(r||!n)return d.jsx("aside",{className:"bb-lead-detail",children:d.jsx("div",{className:"bb-skeleton",style:{height:480,margin:20,borderRadius:8}})});const{lead:P,conversationMessages:D}=n;return d.jsxs("aside",{className:"bb-lead-detail",children:[d.jsxs("header",{className:"bb-lead-detail-header",children:[d.jsxs("div",{children:[d.jsx("div",{className:"bb-lead-detail-name",children:P.name||"(no name)"}),d.jsxs("div",{className:"bb-lead-detail-email",children:[d.jsx("a",{href:`mailto:${P.email}`,children:P.email}),P.phone&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("span",{children:P.phone})]})]}),d.jsxs("div",{className:"bb-lead-detail-sub",children:[(()=>{const te=Gk(P.channel);return P.channel&&P.channel!=="web_widget"?d.jsxs("span",{title:`Captured via ${te.label}`,children:[te.icon," ",te.label," ·"]}):null})(),d.jsxs("span",{children:["via ",Yk(P.source)]}),P.city&&d.jsxs("span",{children:["· ",P.city,", ",P.country]}),d.jsxs("span",{children:["· ",ir(P.createdAt)]}),D.length>0&&d.jsxs("button",{type:"button",className:"bb-lead-detail-chat-chip",onClick:()=>O(!0),children:["View chat (",D.length,")"]}),(P.formId||Object.keys(P.customFields??{}).length>0)&&d.jsx("button",{type:"button",className:"bb-lead-detail-chat-chip",onClick:()=>_(!0),children:"View submission"})]})]}),d.jsx("button",{className:"bb-lead-close",onClick:t,"aria-label":"Close lead",children:"✕"})]}),(f||x)&&d.jsxs("div",{className:"bb-crm-status",children:[f&&d.jsx(OT,{name:"Zoho",synced:h,loading:p.isLoading,error:p.isError,stage:((J=p.data)==null?void 0:J.stage)??null,modifiedAt:(($=p.data)==null?void 0:$.modifiedAt)??null,openUrl:((ne=p.data)==null?void 0:ne.zohoUrl)??null,pushing:u.isPending,onPush:()=>u.mutate(P.id)}),x&&d.jsx(OT,{name:"Pipedrive",synced:E,loading:S.isLoading,error:S.isError,stage:((K=S.data)==null?void 0:K.stage)??null,noStageLabel:"no deal",modifiedAt:((Z=S.data)==null?void 0:Z.modifiedAt)??null,openUrl:((B=S.data)==null?void 0:B.pipedriveUrl)??null,pushing:g.isPending,onPush:()=>g.mutate(P.id)})]}),d.jsx(Lr,{eyebrow:"AI research",title:"Who is this lead?",children:P.researchSummary?d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"bb-lead-research-summary",children:P.researchSummary}),P.suggestedAction&&d.jsxs("div",{className:"bb-lead-research-action",children:[d.jsx("span",{className:"bb-eyebrow",children:"Suggested next step"}),d.jsx("p",{children:P.suggestedAction})]}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>i.mutate({leadId:P.id}),disabled:i.isPending,children:i.isPending?"Re-researching…":"Refresh research"})]}):d.jsxs("div",{className:"bb-lead-research-empty",children:[d.jsx("p",{children:"No research yet. The AI can scan public sources, summarise the lead's profile, and suggest a follow-up."}),d.jsx("button",{className:"bb-btn bb-btn-primary",onClick:()=>i.mutate({leadId:P.id}),disabled:i.isPending,children:i.isPending?"Researching…":"Run AI research"})]})}),d.jsx(Lr,{eyebrow:"Follow-up email",title:A?"Edit draft":"Send a follow-up",titleAction:!A&&d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>o.mutate({leadId:P.id},{onSuccess:j}),disabled:o.isPending,children:o.isPending?"Drafting…":"Draft with AI"}),children:A?d.jsxs("div",{className:"bb-lead-draft",children:[d.jsx("input",{className:"bb-input",value:A.subject,onChange:te=>j({...A,subject:te.target.value}),placeholder:"Subject"}),d.jsx("textarea",{className:"bb-input bb-textarea",rows:8,value:A.body,onChange:te=>j({...A,body:te.target.value})}),d.jsxs("div",{className:"bb-lead-draft-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>j(null),children:"Cancel"}),d.jsx("a",{className:"bb-btn bb-btn-primary bb-btn-small",href:`mailto:${P.email}?subject=${encodeURIComponent(A.subject)}&body=${encodeURIComponent(A.body)}`,children:"Open in mail client"})]})]}):d.jsx("p",{className:"bb-lead-draft-hint",children:"Generate a personalised follow-up using the AI research and the chat transcript. You can edit before sending."})}),d.jsx(yG,{open:C,onOpenChange:O,visitorName:P.name||"Visitor",messages:D.slice()}),d.jsx(wG,{open:T,onOpenChange:_,lead:P})]})}function OT({name:e,synced:t,loading:n,error:r,stage:i,noStageLabel:o="not set",modifiedAt:l,openUrl:u,pushing:f,onPush:h}){return d.jsxs("div",{className:"bb-crm-row",children:[d.jsx("span",{className:t?"bb-crm-name is-synced":"bb-crm-name",children:t?`✓ ${e}`:e}),t?n?d.jsx("span",{className:"bb-crm-muted",children:"checking…"}):r?d.jsxs("span",{className:"bb-crm-muted",children:["couldn’t reach ",e]}):d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"bb-crm-detail",children:["stage: ",i??o]}),l&&d.jsxs("span",{className:"bb-crm-muted",children:["· ",ir(l)]}),u&&d.jsx("a",{className:"bb-crm-action",href:u,target:"_blank",rel:"noopener noreferrer",children:"Open ↗"})]}):d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"bb-crm-muted",children:"not synced"}),d.jsx("button",{type:"button",className:"bb-crm-action",onClick:h,disabled:f,children:f?"Pushing…":"Push ↗"})]})]})}function EG(){return new URL(window.location.href).searchParams.get("lead")}function AG(e){const t=new URL(window.location.href);e?t.searchParams.set("lead",e):t.searchParams.delete("lead"),window.history.replaceState({},"",t)}function jG(){const[e,t]=v.useState(EG());v.useEffect(()=>{AG(e)},[e]);const n=r=>t(r.id);return d.jsxs(d.Fragment,{children:[d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:"Leads"}),d.jsx("span",{className:"bb-section-aside",children:"Captured from chat. Form submissions live inside each form."})]}),d.jsx(CG,{}),d.jsxs("div",{className:"bb-leads-grid",children:[d.jsx(oH,{selectedId:e,onSelect:n}),d.jsx(SG,{leadId:e,onClose:()=>t(null)})]})]})}function CG(){const{settings:e,save:t,isSaving:n}=ZS(),r=(Re().adminEmail??"").trim(),[i,o]=v.useState((e==null?void 0:e.notificationEmail)??""),[l,u]=v.useState(!1);if(v.useEffect(()=>{l||o((e==null?void 0:e.notificationEmail)??"")},[e==null?void 0:e.notificationEmail,l]),!e)return null;const f=(e.notificationEmail??"").trim(),h=l&&i!==f,p=f.length>0,b=()=>{o(f||r),u(!0)};return d.jsxs("div",{className:"bb-lead-notification-strip",children:[!l&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"bb-lead-notification-summary",children:[d.jsx("strong",{children:"Lead notifications"}),d.jsx("span",{className:"bb-lead-notification-status",children:p?`Emailing ${f}`:"Off — no one gets notified"})]}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:b,children:p?"Change":"Add email"})]}),l&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"bb-lead-notification-edit",children:[d.jsx("strong",{children:"Lead notifications"}),d.jsx("p",{className:"bb-field-help",style:{margin:"4px 0 8px"},children:"We email this address when a new lead lands. Leave blank to skip."}),d.jsx("input",{type:"email",className:"bb-input",value:i,onChange:g=>o(g.target.value),placeholder:"notifications@yourbusiness.com","data-ph-mask":!0,autoFocus:!0})]}),d.jsxs("div",{className:"bb-lead-notification-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",disabled:n||!h,onClick:()=>{t({notificationEmail:i}),u(!1)},children:n?"Saving…":"Save"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>{o(f),u(!1)},children:"Cancel"})]})]})]})}const OG=50;function H2(e=null){var o,l,u,f,h;const t=xb({queryKey:["conversations",e],initialPageParam:1,queryFn:async({pageParam:p})=>{const b=await me("GetConversations",{page:p,pageSize:OG,channel:e||void 0});if(!b.success)throw new Error(b.error);return b.data},getNextPageParam:p=>p.page*p.pageSize<p.total?p.page+1:void 0,refetchInterval:1e4,staleTime:5e3,placeholderData:Su}),n=(((o=t.data)==null?void 0:o.pages)??[]).flatMap(p=>p.conversations),r=((u=(l=t.data)==null?void 0:l.pages[0])==null?void 0:u.total)??n.length,i=((h=(f=t.data)==null?void 0:f.pages[0])==null?void 0:h.stateCounts)??{all:0,live:0,needs:0,past:0};return{data:n,total:r,stateCounts:i,isLoading:t.isLoading,isFetchingNextPage:t.isFetchingNextPage,hasNextPage:!!t.hasNextPage,fetchNextPage:()=>t.fetchNextPage()}}function NG(){return Et({queryKey:["conversation-facets"],queryFn:async()=>{const e=await me("GetConversationFacets");return e.success?e.data:{channels:[]}},staleTime:3e4,placeholderData:Su})}function TG(e){const t=Ne(),n=Et({queryKey:["conversation",e],queryFn:async()=>{if(!e)return[];const i=await me("GetLiveChatMessages",{conversationId:e});if(!i.success)throw new Error(i.error);return i.data.messages},enabled:!!e,refetchInterval:5e3,staleTime:2e3}),r=v.useRef(null);return v.useEffect(()=>{e&&n.isSuccess&&r.current!==e&&(r.current=e,t.invalidateQueries({queryKey:["menu-badges"]}))},[e,n.isSuccess,t]),n}function PG(){const e=Ne();return je({mutationFn:async({conversationId:t,opener:n})=>{const r=await me("AdminTakeOverChat",{conversationId:t,...n?{opener:n}:{}});if(!r.success)throw new Error(r.error);return r.data},onSuccess:(t,{conversationId:n})=>{le.success("You're live with the visitor"),e.invalidateQueries({queryKey:["conversations"]}),e.invalidateQueries({queryKey:["conversation",n]}),e.invalidateQueries({queryKey:["live-conversations-count"]})},onError:t=>le.error(t instanceof Error?t.message:"Take-over failed")})}function _G(){const e=Ne();return je({mutationFn:async({conversationId:t,message:n})=>{const r=await me("AdminReplyLive",{conversationId:t,message:n});if(!r.success)throw new Error(r.error);return r.data},onSuccess:(t,{conversationId:n})=>{e.invalidateQueries({queryKey:["conversation",n]}),e.invalidateQueries({queryKey:["conversations"]})},onError:t=>le.error(t instanceof Error?t.message:"Send failed")})}function DG(){const e=Ne();return je({mutationFn:async({conversationId:t})=>{const n=await me("CloseLiveThread",{conversationId:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:(t,{conversationId:n})=>{le.success("Handed back to the bot"),e.invalidateQueries({queryKey:["conversations"]}),e.invalidateQueries({queryKey:["conversation",n]}),e.invalidateQueries({queryKey:["live-conversations-count"]})},onError:t=>le.error(t instanceof Error?t.message:"Close failed")})}function MG(){return je({mutationFn:async({conversationIds:e})=>{const t=await me("CheckConversationLeads",{conversationIds:e});if(!t.success)throw new Error(t.error);return t.data}})}function RG(){const e=Ne();return je({mutationFn:async({conversationIds:t,deleteLeads:n})=>{const r=await me("DeleteConversations",{conversationIds:t,deleteLeads:n});if(!r.success)throw new Error(r.error);return r.data},onSuccess:t=>{const n=[];n.push(`Deleted ${t.conversationsDeleted} ${t.conversationsDeleted===1?"thread":"threads"}`),t.leadsDeleted>0&&n.push(`${t.leadsDeleted} ${t.leadsDeleted===1?"lead":"leads"}`),le.success(n.join(" · ")),e.invalidateQueries({queryKey:["conversations"]}),e.invalidateQueries({queryKey:["leads"]}),e.invalidateQueries({queryKey:["live-conversations-count"]}),e.invalidateQueries({queryKey:["new-conversations-count"]}),e.invalidateQueries({queryKey:["unviewed-leads"]}),e.invalidateQueries({queryKey:["menu-badges"]})},onError:t=>le.error(t instanceof Error?t.message:"Delete failed")})}function kG(){const e=Ne();return je({mutationFn:async({conversationIds:t})=>{const n=await me("MarkConversationsRead",{conversationIds:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:t=>{le.success(`Marked ${t.marked} ${t.marked===1?"thread":"threads"} read`),e.invalidateQueries({queryKey:["conversations"]}),e.invalidateQueries({queryKey:["live-conversations-count"]}),e.invalidateQueries({queryKey:["menu-badges"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not mark read")})}function LG(e){const t=String(e??""),n=[],r=/(https?:\/\/[^\s<>]+)/g;let i=0,o=0,l;for(;(l=r.exec(t))!==null;){l.index>i&&n.push(t.slice(i,l.index));const u=l[1],f=u.replace(/[.,;:!?)\]]+$/,"");n.push(d.jsx("a",{href:f,target:"_blank",rel:"noopener noreferrer",children:f},o++)),f.length<u.length&&n.push(u.slice(f.length)),i=l.index+u.length}return i<t.length&&n.push(t.slice(i)),n}function yE(e){const t=e.channel==="messenger"||e.channel==="instagram_dm"||e.channel==="email";return e.liveMode?e.unreadAdminCount>0?"needs-human":t?"open":"live-admin":t?"open":e.presence==="present"?"live-bot":e.presence==="idle"?"idle":"ended"}function Mw({channel:e}){return e==="messenger"?d.jsx("span",{className:"bb-conv-channel bb-conv-channel-messenger",title:"Messenger DM",children:"FB"}):e==="instagram_dm"?d.jsx("span",{className:"bb-conv-channel bb-conv-channel-instagram",title:"Instagram DM",children:"IG"}):e==="email"?d.jsx("span",{className:"bb-conv-channel bb-conv-channel-email",title:"Email support",children:"✉"}):null}function G2({state:e}){switch(e){case"live-admin":return d.jsxs("span",{className:"bb-conv-badge bb-conv-badge-admin",children:[d.jsx("span",{className:"bb-conv-badge-dot"}),"Live · You"]});case"live-bot":return d.jsxs("span",{className:"bb-conv-badge bb-conv-badge-bot",children:[d.jsx("span",{className:"bb-conv-badge-dot"}),"Live · Bot"]});case"needs-human":return d.jsxs("span",{className:"bb-conv-badge bb-conv-badge-urgent",children:["Needs reply",d.jsx("span",{className:"bb-conv-badge-arrow",children:"→"})]});case"idle":return d.jsx("span",{className:"bb-conv-badge bb-conv-badge-idle",children:"Idle"});case"ended":return d.jsx("span",{className:"bb-conv-badge bb-conv-badge-past",children:"Ended"});case"open":return d.jsx("span",{className:"bb-conv-badge bb-conv-badge-open",children:"Open"})}}function IG(){return new URL(window.location.href).searchParams.get("conv")}function zG(e){const t=new URL(window.location.href);e?t.searchParams.set("conv",e):t.searchParams.delete("conv"),window.history.replaceState({},"",t)}function UG({conv:e,active:t,onSelect:n,selected:r,onToggleSelect:i,selectionActive:o,onDeleteSingle:l}){const u=yE(e);return d.jsxs("div",{className:`bb-conv-row bb-conv-row-state-${u} ${t?"bb-conv-row-active":""} ${r?"bb-conv-row-selected":""}`,children:[d.jsx("label",{className:`bb-conv-row-check ${o||r?"bb-conv-row-check-visible":""}`,onClick:f=>f.stopPropagation(),children:d.jsx("input",{type:"checkbox",checked:r,onChange:i,"aria-label":r?`Deselect ${e.displayLabel}`:`Select ${e.displayLabel}`})}),d.jsxs("button",{className:"bb-conv-row-body",onClick:n,children:[d.jsxs("div",{className:"bb-conv-row-top",children:[d.jsxs("span",{className:"bb-conv-row-id",children:[!e.viewedAt&&d.jsx("span",{className:"bb-conv-row-newdot",title:"New — not opened yet","aria-label":"New"}),e.displayLabel,d.jsx(Mw,{channel:e.channel})]}),d.jsx("span",{className:"bb-conv-row-time",children:ir(e.lastMessageAt)})]}),(e.visitorCity||e.unreadAdminCount>0)&&d.jsxs("div",{className:"bb-conv-row-mid",children:[e.visitorCity&&d.jsxs("span",{className:"bb-conv-row-muted",children:[e.visitorCity,", ",e.visitorCountry]}),e.unreadAdminCount>0&&d.jsxs("span",{className:"bb-conv-row-unread",children:[e.unreadAdminCount," new"]})]}),d.jsx("div",{className:"bb-conv-row-status",children:d.jsx(G2,{state:u})})]}),d.jsx("button",{type:"button",className:"bb-conv-row-delete",title:"Delete this thread","aria-label":`Delete thread ${e.displayLabel}`,onClick:f=>{f.stopPropagation(),l()},children:"🗑"})]})}function qG(e){switch(e){case"web_widget":return"Web chat";case"messenger":return"Facebook";case"instagram_dm":return"Instagram";case"email":return"Email";default:return e}}function BG(e,t){return t==="all"?!0:t==="live"?e==="live-admin"||e==="live-bot"||e==="open":t==="needs"?e==="needs-human":e==="idle"||e==="ended"}function FG({conv:e}){const{data:t,isLoading:n,error:r}=TG(e.id),i=PG(),o=_G(),l=DG(),{data:u}=Ai(),[f,h]=v.useState(""),[p,b]=v.useState(!1),[g,x]=v.useState("oldest"),E=v.useRef(null),S=yE(e),A=(u==null?void 0:u.plan)==="free";if(v.useEffect(()=>{const O=E.current;O&&(O.scrollTop=g==="newest"?0:O.scrollHeight)},[t==null?void 0:t.length,g]),A)return d.jsxs(d.Fragment,{children:[d.jsx("header",{className:"bb-conv-header",children:d.jsxs("div",{children:[d.jsxs("div",{className:"bb-conv-title-row",children:[d.jsx("h3",{className:"bb-conv-title",children:e.displayLabel}),d.jsx(Mw,{channel:e.channel})]}),d.jsxs("div",{className:"bb-conv-sub",children:["Last message ",ir(e.lastMessageAt)]})]})}),d.jsxs("div",{className:"bb-conv-thread-locked",children:[d.jsx("p",{className:"bb-conv-thread-locked-headline",children:"Transcript locked on Free."}),d.jsx("p",{className:"bb-conv-thread-locked-body",children:"Your bot is talking to visitors. Upgrade to Assistant to read what they're asking, follow up on the leads, and take over live."}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:()=>b(!0),children:"Upgrade to view →"})]}),d.jsx(gs,{open:p,onClose:()=>b(!1)})]});if(n||!t&&!r)return d.jsx("div",{className:"bb-skeleton",style:{height:320,margin:12,borderRadius:8}});if(!t)return d.jsx("div",{className:"bb-inline-error",role:"alert",children:"Couldn't load this thread. Try again."});const j=()=>{f.trim()&&o.mutate({conversationId:e.id,message:f},{onSuccess:()=>h("")})},C=S==="live-bot"||S==="open";return d.jsxs(d.Fragment,{children:[d.jsxs("header",{className:"bb-conv-header",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"bb-conv-title-row",children:[d.jsx("h3",{className:"bb-conv-title",children:e.displayLabel}),d.jsx(Mw,{channel:e.channel}),d.jsx(G2,{state:S})]}),d.jsxs("div",{className:"bb-conv-sub",children:[e.visitorEmail&&d.jsx("a",{href:`mailto:${e.visitorEmail}`,children:e.visitorEmail}),e.visitorEmail&&(e.visitorCity||e.visitorCountry)&&d.jsx(d.Fragment,{children:" · "}),e.visitorCity&&d.jsxs("span",{children:[e.visitorCity,", ",e.visitorCountry]}),d.jsxs("span",{children:[" · ",t.length," messages"]}),t.length>1&&d.jsxs("button",{type:"button",className:"bb-conv-sort",onClick:()=>x(O=>O==="oldest"?"newest":"oldest"),title:"Toggle message order",children:[g==="oldest"?"Oldest first":"Newest first"," ⇅"]})]})]}),C&&d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",disabled:i.isPending,onClick:()=>i.mutate({conversationId:e.id}),children:i.isPending?"Taking over…":"Take over chat →"})]}),d.jsxs("ol",{ref:E,className:"bb-transcript bb-conv-transcript",children:[t.length===0&&d.jsx("li",{className:"bb-conv-empty-thread",children:"No messages yet."}),(g==="newest"?[...t].reverse():t).map((O,T)=>{const _=O.content??"",P=e.channel==="email"&&O.role==="user"?_.match(/^Subject:\s*([^\n]*)\n+([\s\S]*)$/):null;return d.jsxs("li",{className:`bb-msg bb-msg-${O.role}`,children:[d.jsx("span",{className:"bb-msg-role",children:O.role==="user"?e.visitorName??"Visitor":O.role==="admin"?"You":"BitBot"}),P?d.jsxs("div",{className:"bb-msg-body bb-msg-email",children:[P[1].trim()&&d.jsx("div",{className:"bb-msg-email-subject",children:P[1].trim()}),d.jsx("div",{className:"bb-msg-email-text",children:LG(P[2].trim())})]}):d.jsx("p",{className:"bb-msg-body",children:_}),d.jsx("span",{className:"bb-msg-time",children:ir(O.createdAt)})]},O.id??T)})]}),e.liveMode&&d.jsxs("footer",{className:"bb-conv-composer",children:[d.jsx("textarea",{className:"bb-input bb-textarea",rows:3,value:f,onChange:O=>h(O.target.value),placeholder:"Type your reply… The visitor sees this directly.",onKeyDown:O=>{O.key==="Enter"&&(O.metaKey||O.ctrlKey)&&(O.preventDefault(),j())}}),d.jsxs("div",{className:"bb-conv-composer-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",disabled:l.isPending,onClick:()=>l.mutate({conversationId:e.id}),children:l.isPending?"Handing back…":"Hand back to bot"}),d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",disabled:!f.trim()||o.isPending,onClick:j,children:o.isPending?"Sending…":"Send reply (⌘↵)"})]})]})]})}function $G(){const[e,t]=v.useState(IG()),[n,r]=v.useState("all"),[i,o]=v.useState(null),[l,u]=v.useState(new Set),[f,h]=v.useState(null),{data:p,total:b,stateCounts:g,isLoading:x,hasNextPage:E,isFetchingNextPage:S,fetchNextPage:A}=H2(i),{data:j}=NG(),C=MG(),O=RG(),T=kG();v.useEffect(()=>{zG(e)},[e]);const _=p??[],P=v.useMemo(()=>_.filter(B=>BG(yE(B),n)),[_,n]),D=_.find(B=>B.id===e)??null,L=v.useMemo(()=>{const B=new Set;for(const te of P)l.has(te.id)&&B.add(te.id);return B},[P,l]),z=L.size,F=z>0&&z===P.length,G=B=>{const te=new Set(l);te.has(B)?te.delete(B):te.add(B),u(te)},R=()=>{u(F?new Set:new Set(P.map(B=>B.id)))},J=()=>u(new Set),$=async()=>{const B=Array.from(L);if(B.length===0)return;const te=await C.mutateAsync({conversationIds:B}).catch(()=>null);h({ids:B,linkedLeads:(te==null?void 0:te.linked)??[]})},ne=async B=>{f&&(await O.mutateAsync({conversationIds:f.ids,deleteLeads:B}).catch(()=>null),e&&f.ids.includes(e)&&t(null),h(null),J())},K=async()=>{const B=Array.from(L);B.length!==0&&(await T.mutateAsync({conversationIds:B}).catch(()=>null),J())},Z=[{key:"all",label:"All",count:g.all},{key:"live",label:"Live",count:g.live},{key:"needs",label:"Needs reply",count:g.needs,urgent:g.needs>0},{key:"past",label:"Past",count:g.past}];return d.jsxs(d.Fragment,{children:[d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:"Conversations"}),d.jsxs("span",{className:"bb-section-aside",children:[g.live>0&&d.jsxs(d.Fragment,{children:[d.jsx("strong",{children:g.live})," live"]}),g.live>0&&g.needs>0&&d.jsx(d.Fragment,{children:" · "}),g.needs>0&&d.jsxs("span",{className:"bb-conv-aside-urgent",children:[d.jsx("strong",{children:g.needs})," need",g.needs===1?"s":""," reply"]}),(g.live>0||g.needs>0)&&d.jsx(d.Fragment,{children:" · "}),d.jsx("span",{children:_.length<b?d.jsxs(d.Fragment,{children:["Showing ",d.jsx("strong",{children:_.length})," of ",b," threads from the last 30 days"]}):d.jsxs(d.Fragment,{children:[_.length," ",_.length===1?"thread":"threads"," from the last 30 days"]})})]})]}),d.jsxs("div",{className:"bb-conv-grid",children:[d.jsxs("section",{className:"bb-conv-list-card",children:[d.jsx("header",{className:"bb-card-header",children:d.jsxs("h3",{className:"bb-card-title",children:[d.jsx("span",{className:"bb-eyebrow",children:"Threads"}),d.jsx("span",{children:"Live & recent"})]})}),d.jsx("div",{className:"bb-conv-filters",role:"tablist","aria-label":"Conversation filter",children:Z.map(B=>{const te=n===B.key;return d.jsxs("button",{type:"button",role:"tab","aria-selected":te,className:`bb-conv-filter ${te?"bb-conv-filter-active":""} ${B.urgent?"bb-conv-filter-urgent":""}`,onClick:()=>r(B.key),children:[B.label,d.jsx("span",{className:"bb-conv-filter-count",children:B.count})]},B.key)})}),((j==null?void 0:j.channels.length)??0)>1&&d.jsx("div",{className:"bb-conv-channel-filter-wrap",children:d.jsxs("select",{className:"bb-input bb-conv-channel-filter",value:i??"",onChange:B=>o(B.target.value||null),"aria-label":"Filter by channel",children:[d.jsx("option",{value:"",children:"All channels"}),j.channels.map(B=>d.jsxs("option",{value:B.value,children:[qG(B.value)," (",B.count,")"]},B.value))]})}),d.jsxs("div",{className:"bb-conv-list",children:[x&&d.jsx("div",{className:"bb-skeleton",style:{height:360,margin:12,borderRadius:8}}),!x&&_.length===0&&d.jsx(uu,{headline:"No conversations yet",body:"Once visitors start chatting, every thread shows up here. The list updates every 10 seconds.",ctaLabel:"Test your widget",onCta:()=>window.open("/","_blank")}),!x&&_.length>0&&P.length===0&&d.jsx("div",{className:"bb-conv-filter-empty",children:n==="needs"?"Nothing waiting for a reply — you're all caught up.":n==="live"?"No live conversations.":"Nothing here yet."}),!x&&z>0&&d.jsxs("div",{className:"bb-conv-bulk-bar",children:[d.jsxs("label",{className:"bb-conv-bulk-select-all",children:[d.jsx("input",{type:"checkbox",checked:F,ref:B=>{B&&(B.indeterminate=z>0&&!F)},onChange:R,"aria-label":F?"Deselect all":"Select all"}),d.jsx("span",{children:F?`${z} selected (all)`:`${z} selected`})]}),d.jsxs("div",{className:"bb-conv-bulk-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:J,children:"Clear"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:K,disabled:T.isPending,children:T.isPending?"Marking…":"Mark read"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-danger bb-btn-small",onClick:$,disabled:C.isPending||O.isPending,children:C.isPending?"Checking…":`Delete ${z}`})]})]}),!x&&P.map(B=>d.jsx(UG,{conv:B,active:B.id===e,onSelect:()=>t(B.id),selected:L.has(B.id),onToggleSelect:()=>G(B.id),selectionActive:z>0,onDeleteSingle:async()=>{const te=await C.mutateAsync({conversationIds:[B.id]}).catch(()=>null);h({ids:[B.id],linkedLeads:(te==null?void 0:te.linked)??[]})}},B.id)),(()=>{const B=n==="live"?Math.max(0,g.live-P.length):n==="needs"?Math.max(0,g.needs-P.length):n==="past"?Math.max(0,g.past-P.length):Math.max(0,b-_.length);return E&&B>0?d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-load-more",onClick:()=>A(),disabled:S,children:S?"Loading…":`Load more (${B} remaining)`}):null})()]})]}),d.jsxs(Lr,{eyebrow:D?D.displayLabel:"No thread selected",title:D?"Transcript":"Pick a conversation",className:"bb-conv-detail-card",children:[!D&&d.jsx("p",{className:"bb-conv-placeholder-body",children:"Choose a thread from the left. Live threads can be taken over so you reply directly while the bot stays out of the way. Idle and ended threads are read-only."}),D&&d.jsx(FG,{conv:D})]})]}),f&&d.jsx(KG,{conversationCount:f.ids.length,leadCount:f.linkedLeads.reduce((B,te)=>B+te.leadIds.length,0),isBusy:O.isPending,onCancel:()=>h(null),onConfirmKeepLeads:()=>ne(!1),onConfirmDeleteLeads:()=>ne(!0)})]})}function KG({conversationCount:e,leadCount:t,isBusy:n,onCancel:r,onConfirmKeepLeads:i,onConfirmDeleteLeads:o}){return d.jsx("div",{className:"bb-modal-backdrop bb-portal-scope",onClick:r,role:"presentation",children:d.jsxs("div",{className:"bb-modal bb-confirm-modal",onClick:l=>l.stopPropagation(),role:"alertdialog","aria-modal":"true",children:[d.jsxs("header",{className:"bb-modal-head",children:[d.jsx("div",{className:"bb-modal-titles",children:d.jsxs("h2",{className:"bb-modal-title",children:["Delete ",e," ",e===1?"thread":"threads","?"]})}),d.jsx("button",{className:"bb-modal-close",onClick:r,disabled:n,"aria-label":"Cancel",children:"×"})]}),d.jsx("div",{className:"bb-modal-body",children:d.jsx("p",{className:"bb-confirm-modal-body",children:t===0?d.jsxs(d.Fragment,{children:["The selected ",e===1?"thread is":"threads are"," not linked to any leads. All transcripts will be permanently removed."]}):d.jsxs(d.Fragment,{children:["The selected ",e===1?"thread is":"threads are"," linked to"," ",d.jsx("strong",{children:t})," ",t===1?"lead":"leads"," in your inbox. What do you want to do with ",t===1?"it":"them","?"]})})}),d.jsxs("footer",{className:"bb-confirm-modal-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost",onClick:r,disabled:n,children:"Cancel"}),t===0?d.jsx("button",{className:"bb-btn bb-btn-destructive",onClick:i,disabled:n,children:n?"Deleting…":`Delete ${e} ${e===1?"thread":"threads"}`}):d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"bb-btn bb-btn-ghost",onClick:i,disabled:n,children:"Keep leads"}),d.jsx("button",{className:"bb-btn bb-btn-destructive",onClick:o,disabled:n,children:"Delete leads too"})]})]})]})})}const Rb="bb_devmockapikey0000000000000000",Ec=e=>new Date(Date.now()-e*864e5).toISOString(),HG=e=>new Date(Date.now()-e*36e5).toISOString(),y0=[{id:"d-1",title:"5 questions every wedding planner asks before quoting",status:"draft",createdAt:HG(3),scheduledAt:null},{id:"d-2",title:"Destination weddings in Trancoso: the 6-month checklist",status:"scheduled",createdAt:Ec(1),scheduledAt:Ec(-2)},{id:"d-3",title:"How to budget for a 200-guest corporate event",status:"published",createdAt:Ec(4),scheduledAt:Ec(3)},{id:"d-4",title:"Why Pinterest is still the best mood-board tool in 2026",status:"draft",createdAt:Ec(7),scheduledAt:null},{id:"d-5",title:"Sample post — generation failed mid-way",status:"failed",createdAt:Ec(10),scheduledAt:null}],Y2={id:"d-1",title:"5 questions every wedding planner asks before quoting",slug:"5-questions-wedding-planner-quoting",content:`## Why these five questions matter 205 205 206 206 Most couples ask "how much" before sharing a single detail about their wedding. The smart planner flips the script. Here are the five questions that change a vague enquiry into a real quote — and a deposit. 207 207 208 208 ### 1. Guest count 209 …`,seoMeta:{metaTitle:"5 questions every wedding planner asks before quoting · BitBot",metaDescription:"A 2-minute framework for wedding planners to qualify enquiries faster and quote with confidence.",keywords:["wedding planner","quote","qualification","discovery questions"],focusKeyphrase:"wedding planner quote"}}, HG=50,Rw="bb_drafts_seen_at",kw="bb:drafts-seen";function GG(){if(typeof window>"u")return 0;const e=window.localStorage.getItem(Rw);if(e)return Number(e);const t=Date.now();return window.localStorage.setItem(Rw,String(t)),t}function YG(){typeof window>"u"||(window.localStorage.setItem(Rw,String(Date.now())),window.dispatchEvent(new Event(kw)))}function WG(e){return window.addEventListener(kw,e),window.addEventListener("storage",e),()=>{window.removeEventListener(kw,e),window.removeEventListener("storage",e)}}function Y2(){const{data:e=[]}=W2(),t=v.useSyncExternalStore(WG,GG,()=>0);return e.filter(n=>new Date(n.createdAt).getTime()>t).length}function W2(){var o,l,u;const t=Re().apiKey===Rb,n=xb({queryKey:["drafts"],initialPageParam:1,queryFn:async({pageParam:f})=>{if(t)return{drafts:y0,total:y0.length,page:f,pageSize:y0.length};const h=await me("GetDrafts",{page:f,pageSize:HG});if(!h.success)throw new Error(h.error);return h.data},getNextPageParam:f=>f.page*f.pageSize<f.total?f.page+1:void 0,staleTime:6e4}),r=(((o=n.data)==null?void 0:o.pages)??[]).flatMap(f=>f.drafts),i=((u=(l=n.data)==null?void 0:l.pages[0])==null?void 0:u.total)??r.length;return{data:r,total:i,isLoading:n.isLoading,isFetchingNextPage:n.isFetchingNextPage,hasNextPage:!!n.hasNextPage,fetchNextPage:()=>n.fetchNextPage()}}function QG(e){const n=Re().apiKey===Rb;return Et({queryKey:["draft",e],queryFn:async()=>{if(!e)throw new Error("No draft id");if(n)return{...G2,id:e};const r=await me("GetDraft",{draftId:e});if(!r.success)throw new Error(r.error);return r.data},enabled:!!e,staleTime:3e4})}function VG(){const e=Ne(),{ajaxUrl:t,ajaxNonce:n}=Re();return je({mutationFn:async r=>{var u;const i=new URLSearchParams({action:"bitbot_publish_draft",nonce:n,draft_id:r.draftId}),l=await(await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i.toString()})).json();if(!l.success){const f=((u=l.data)==null?void 0:u.error)??"Save failed";throw new Error(f)}return l.data},onSuccess:(r,i)=>{e.setQueryData(["draft",i.draftId],o=>o&&{...o,wpPostId:r.post_id}),e.setQueryData(["drafts"],o=>!o||!Array.isArray(o)?o:o.map(l=>l.id===i.draftId?{...l,wpPostId:r.post_id}:l)),e.invalidateQueries({queryKey:["drafts"]}),le.success("Saved to WordPress")},onError:r=>{le.error(r instanceof Error?r.message:"Save failed")}})}function XG(){const e=Ne(),{ajaxUrl:t,ajaxNonce:n}=Re();return je({mutationFn:async r=>{var u;const i=new URLSearchParams({action:"bitbot_delete_draft",nonce:n,draft_id:r}),l=await(await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i.toString()})).json();if(!l.success){const f=((u=l.data)==null?void 0:u.error)??"Delete failed";throw new Error(f)}},onSuccess:(r,i)=>{e.removeQueries({queryKey:["draft",i]}),e.invalidateQueries({queryKey:["drafts"]}),le.success("Draft deleted")},onError:r=>{le.error(r instanceof Error?r.message:"Delete failed")}})}const ZG=".pdf,.png,.jpg,.jpeg,.gif,.webp",JG=10*1024*1024,eY={suggestions:[{topic:"How to price a destination wedding without scaring couples off",reasoning:"Couples Google price ranges before reaching out — owning this answer captures lead intent early.",searchQuery:"destination wedding pricing breakdown",difficulty:"medium"},{topic:"The 6-week timeline most planners get wrong",reasoning:"Existing posts talk about 6-month timelines but skip the 6-week sprint where vendors actually lock in.",searchQuery:"wedding planner six week timeline",difficulty:"easy"},{topic:"Pinterest moodboard → real wedding: what survives the budget cut",reasoning:"Direct continuation of the existing Pinterest post; answers the inevitable follow-up question.",searchQuery:"pinterest wedding ideas budget reality",difficulty:"easy"}],contentGaps:["No content on vendor contracts and cancellation clauses","Pricing strategy posts skip taxes and travel costs","No FAQ on rainy-day backup plans for outdoor venues"],sources:[{title:"How do you price a destination wedding in Trancoso?",subreddit:"r/weddingplanning",url:"https://reddit.com/r/weddingplanning/example1",numComments:47}]};function tY(){const e=Ne(),n=Re().apiKey===Rb;return je({mutationFn:async()=>{if(n)return await new Promise(i=>setTimeout(i,1200)),eY;const r=await me("DiscoverTopics");if(!r.success)throw new Error(r.error);return r.data},onSuccess:()=>{e.invalidateQueries({queryKey:["plan-status"]})},onError:r=>{const i=r instanceof Error?r.message:"Topic discovery failed";/Pro feature|Upgrade to/i.test(i)||le.error(i)}})}function nY(){const e=Ne(),n=Re().apiKey===Rb;return je({mutationFn:async r=>{if(n)return await new Promise(o=>setTimeout(o,2400)),G2;if(r.sourceType==="upload"){const o=r.file;if(!o)throw new Error("Choose a file to generate from.");if(o.size>JG)throw new Error("File is larger than 10MB. Pick a smaller file.");const l=await me("GetUploadUrl",{fileName:o.name});if(!l.success)throw new Error(l.error);if(!(await fetch(l.data.uploadUrl,{method:"PUT",headers:{"Content-Type":o.type||"application/octet-stream"},body:o})).ok)throw new Error("Could not upload the file. Try again.");const f=await me("GeneratePostFromStorage",{storagePath:l.data.storagePath,fileName:o.name,instructions:r.instructions});if(!f.success)throw new Error(f.error);return f.data}const i=await me("GeneratePost",{...r});if(!i.success)throw new Error(i.error);return i.data},onSuccess:()=>{le.success("Draft generated"),e.invalidateQueries({queryKey:["drafts"]}),e.invalidateQueries({queryKey:["plan-status"]})}})}const Q2=new Set(["indexed","faqs","topics","generate","drafts"]),rY="indexed";function NT(){const t=new URL(window.location.href).searchParams.get("sub");return t&&Q2.has(t)?t:rY}const x0="bb:sub-change";function V2(){const[e,t]=v.useState(NT);v.useEffect(()=>{const r=()=>t(NT());return window.addEventListener("popstate",r),window.addEventListener(x0,r),()=>{window.removeEventListener("popstate",r),window.removeEventListener(x0,r)}},[]);const n=v.useCallback(r=>{if(!Q2.has(r))return;const i=new URL(window.location.href);i.searchParams.get("sub")!==r&&(i.searchParams.set("sub",r),window.history.pushState({},"",i),t(r),window.dispatchEvent(new Event(x0)))},[]);return[e,n]}const TT={easy:{label:"Easy",cls:"bb-difficulty-easy"},medium:{label:"Medium",cls:"bb-difficulty-medium"},hard:{label:"Hard",cls:"bb-difficulty-hard"}};function aY({onPickTopic:e}){const t=tY(),[n,r]=v.useState(!1),[i,o]=v.useState(!1),l=t.data,u=t.isPending,f=t.error instanceof Error?t.error.message:null,h=!!f&&/^(ACCESS_PAUSED|TRIAL_EXPIRED)/.test(f),p=!!f&&/free Topic Discovery searches/i.test(f),b=!!f&&/(ASSISTANT_REQUIRED|Pro feature)/i.test(f),g=h||p||b;return d.jsxs("section",{className:"bb-topic-discovery",children:[!l&&!u&&!g&&d.jsxs("div",{className:"bb-topic-discovery-empty",children:[d.jsx("p",{className:"bb-topic-discovery-empty-lede",children:"BitBot scans your indexed pages, checks what your audience is asking, and surfaces the topics worth writing next — plus the gaps your current coverage is missing."}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:()=>t.mutate(),children:"Find topics →"}),d.jsx("p",{className:"bb-topic-discovery-empty-foot",children:"Takes about 15 seconds."}),f&&d.jsx("p",{className:"bb-topic-discovery-error",children:f})]}),p&&d.jsxs("div",{className:"bb-topic-discovery-gate",children:[d.jsxs("div",{children:[d.jsx("strong",{children:"You've used your 3 free Topic Discovery searches."}),d.jsx("p",{children:"Unlimited topic research on Assistant ($20/mo)."})]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>o(!0),children:"Upgrade to Assistant →"})]}),h&&d.jsxs("div",{className:"bb-topic-discovery-gate",children:[d.jsxs("div",{children:[d.jsx("strong",{children:"Your subscription has ended."}),d.jsx("p",{children:"Reactivate to keep using Topic Discovery."})]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>o(!0),children:"Reactivate →"})]}),b&&d.jsxs("div",{className:"bb-topic-discovery-gate",children:[d.jsxs("div",{children:[d.jsx("strong",{children:"Topic Discovery is on Assistant."}),d.jsx("p",{children:"Scans your site + live reader-trend data and ranks the topics worth writing next. Unlimited on Assistant ($20/mo)."})]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>o(!0),children:"Upgrade to Assistant →"})]}),u&&!l&&d.jsxs("div",{className:"bb-topic-discovery-empty",children:[d.jsxs("div",{className:"bb-topic-discovery-pulse","aria-hidden":!0,children:[d.jsx("span",{}),d.jsx("span",{}),d.jsx("span",{})]}),d.jsx("p",{className:"bb-topic-discovery-empty-lede",children:"Reading your indexed pages, then cross-referencing trending questions in your niche…"})]}),l&&d.jsxs("header",{className:"bb-topic-discovery-head",children:[d.jsx("p",{children:"Picked from your indexed content + live reader trends. Refresh for a different angle."}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>t.mutate(),disabled:u,children:u?"Refreshing…":"Refresh"})]}),l&&d.jsxs(d.Fragment,{children:[l.suggestions.length>0&&d.jsxs("div",{className:"bb-topic-suggestions",children:[d.jsxs("div",{className:"bb-topic-suggestions-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Suggested topics"}),l.contentGaps.length>0&&d.jsxs("button",{type:"button",className:`bb-topic-gaps-toggle ${n?"bb-topic-gaps-toggle-active":""}`,"aria-label":n?"Hide content gaps":"Show content gaps","aria-expanded":n,title:n?"Hide content gaps":"Show content gaps — areas your indexed content doesn't cover yet",onClick:()=>r(x=>!x),children:[d.jsx("span",{"aria-hidden":!0,children:"ⓘ"}),d.jsx("span",{className:"bb-topic-gaps-toggle-label",children:n?"Hide gaps":`${l.contentGaps.length} content ${l.contentGaps.length===1?"gap":"gaps"}`})]})]}),n&&l.contentGaps.length>0&&d.jsxs("div",{className:"bb-content-gaps bb-content-gaps-inline",children:[d.jsx("p",{className:"bb-content-gaps-lede",children:"Areas your indexed content doesn't cover yet — pick a suggested topic below that closes one of these."}),d.jsx("ul",{className:"bb-gap-list",children:l.contentGaps.map((x,E)=>d.jsx("li",{className:"bb-gap-item",children:x},E))})]}),d.jsx("ul",{className:"bb-topic-list",children:l.suggestions.map((x,E)=>{const S=TT[(x.difficulty||"").toLowerCase()]??TT.medium;return d.jsxs("li",{className:"bb-topic-item",children:[d.jsxs("div",{className:"bb-topic-item-body",children:[d.jsx("div",{className:"bb-topic-item-title",children:x.topic}),d.jsx("div",{className:"bb-topic-item-reason",children:x.reasoning}),d.jsxs("div",{className:"bb-topic-item-meta",children:[d.jsx("span",{className:`bb-difficulty-pill ${S.cls}`,children:S.label}),x.searchQuery&&d.jsxs("span",{className:"bb-topic-item-query",children:[d.jsx("span",{className:"bb-eyebrow",children:"research"}),d.jsx("code",{children:x.searchQuery})]})]})]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>e(x.topic),children:"Write this →"})]},E)})})]}),l.sources.length>0&&d.jsxs("details",{className:"bb-topic-sources",children:[d.jsxs("summary",{children:[d.jsxs("span",{className:"bb-eyebrow",children:["Sources (",l.sources.length,")"]}),"— Reddit threads the AI considered"]}),d.jsx("ul",{className:"bb-source-list",children:l.sources.map((x,E)=>d.jsxs("li",{children:[d.jsx("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",children:x.title}),d.jsxs("span",{className:"bb-source-meta",children:[x.subreddit," · ",x.numComments," comments"]})]},E))})]})]}),d.jsx(gs,{open:i,onClose:()=>o(!1)})]})}function iY(){return Et({queryKey:["faqs"],queryFn:async()=>{const e=await me("GetFaqs");if(!e.success)throw new Error(e.error);return e.data.faqs},staleTime:30*1e3})}function oY(){const e=Ne();return je({mutationFn:async t=>{const n=await me("CreateFaq",t);if(!n.success)throw new Error(n.error);return n.data.faq},onSuccess:t=>{e.setQueryData(["faqs"],n=>n?[t,...n.filter(r=>r.id!==t.id)]:[t]),e.invalidateQueries({queryKey:["faqs"]}),le.success("FAQ added — the bot will use it on the next chat")},onError:t=>le.error(t instanceof Error?t.message:"Could not add FAQ")})}function sY(){const e=Ne();return je({mutationFn:async t=>{const n=await me("UpdateFaq",t);if(!n.success)throw new Error(n.error);return n.data.faq},onSuccess:t=>{e.setQueryData(["faqs"],n=>n&&n.map(r=>r.id===t.id?t:r)),e.invalidateQueries({queryKey:["faqs"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not update FAQ")})}function lY(){const e=Ne();return je({mutationFn:async t=>{const n=await me("DeleteFaq",{id:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:(t,n)=>{e.setQueryData(["faqs"],r=>r&&r.filter(i=>i.id!==n)),e.invalidateQueries({queryKey:["faqs"]}),le.success("FAQ removed")},onError:t=>le.error(t instanceof Error?t.message:"Could not delete FAQ")})}function cY(){const e=Ne();return je({mutationFn:async t=>{const n=await me("DeleteFaqs",{ids:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:(t,n)=>{e.setQueryData(["faqs"],r=>r&&r.filter(i=>!n.includes(i.id))),e.invalidateQueries({queryKey:["faqs"]}),le.success(`Deleted ${t.faqsDeleted} ${t.faqsDeleted===1?"FAQ":"FAQs"}`)},onError:t=>le.error(t instanceof Error?t.message:"Could not delete FAQs")})}function uY(){return je({mutationFn:async e=>{const t=await me("DraftFaqFromGap",e);if(!t.success)throw new Error(t.error);return t.data.draft},onError:e=>le.error(e instanceof Error?e.message:"Could not draft FAQ")})}function dY(){const e=Ne();return je({mutationFn:async t=>{const n=await me("DismissCoverageGap",{topic:t});if(!n.success)throw new Error(n.error)},onSuccess:()=>{e.invalidateQueries({queryKey:["overview-insights"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not discard suggestion")})}function fY(){const e=Ne();return je({mutationFn:async()=>{const t=await me("ResetDismissedCoverageGaps",{});if(!t.success)throw new Error(t.error)},onSuccess:()=>{e.invalidateQueries({queryKey:["overview-insights"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not reset suggestions")})}function PT({editing:e=null,initialQuestion:t="",initialAnswer:n="",initialSourceTopic:r=null,initialAutoGenerated:i=!1,banner:o=null,onClose:l}){const[u,f]=v.useState((e==null?void 0:e.question)??t),[h,p]=v.useState((e==null?void 0:e.answer)??n),b=oY(),g=sY();v.useEffect(()=>{f((e==null?void 0:e.question)??t)},[e==null?void 0:e.id,t]),v.useEffect(()=>{p((e==null?void 0:e.answer)??n)},[e==null?void 0:e.id,n]);const x=!!e,E=b.isPending||g.isPending,S=()=>{const A=u.trim(),j=h.trim();!A||!j||(x&&e?g.mutate({id:e.id,question:A,answer:j},{onSuccess:()=>l()}):b.mutate({question:A,answer:j,autoGenerated:i,sourceTopic:r},{onSuccess:()=>l()}))};return d.jsxs("div",{className:"bb-faq-composer",children:[o&&d.jsx("div",{className:"bb-faq-composer-hint",children:o}),d.jsxs("label",{className:"bb-faq-field",children:[d.jsx("span",{className:"bb-faq-field-label",children:"Question"}),d.jsx("input",{className:"bb-input",type:"text",value:u,onChange:A=>f(A.target.value),placeholder:"e.g. Do you ship internationally?",maxLength:250,autoFocus:!0})]}),d.jsxs("label",{className:"bb-faq-field",children:[d.jsx("span",{className:"bb-faq-field-label",children:"Answer"}),d.jsx("textarea",{className:"bb-input bb-textarea",rows:4,value:h,onChange:A=>p(A.target.value),placeholder:"2-4 sentences. The bot will use this verbatim.",maxLength:2e3})]}),d.jsxs("div",{className:"bb-faq-composer-actions",children:[d.jsxs("span",{className:"bb-faq-composer-chars",children:[h.length,"/2000"]}),d.jsxs("div",{className:"bb-faq-composer-buttons",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:l,children:x?"Cancel":"Discard"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",disabled:!u.trim()||!h.trim()||E,onClick:S,children:E?"Saving…":x?"Save changes":"Add FAQ →"})]})]})]})}const Dm=20;function hY(){const{data:e,isLoading:t}=iY(),{data:n}=WS(),r=uY(),i=dY(),o=fY(),l=lY(),u=cY(),[f,h]=v.useState(new Set),p=v.useMemo(()=>{const $=e??[],ee=new Set;for(const pe of $)f.has(pe.id)&&ee.add(pe.id);return ee},[e,f]),b=p.size,g=b>0&&b===((e==null?void 0:e.length)??0),x=$=>{h(ee=>{const pe=new Set(ee);return pe.has($)?pe.delete($):pe.add($),pe})},E=()=>{h(g?new Set:new Set((e??[]).map($=>$.id)))},S=()=>h(new Set),A=async()=>{const $=Array.from(p);$.length===0||!await bi({title:`Delete ${$.length} ${$.length===1?"FAQ":"FAQs"}?`,message:`The bot will stop using ${$.length===1?"this answer":"these answers"} immediately. This cannot be undone.`,confirmLabel:`Delete ${$.length}`,danger:!0})||(await u.mutateAsync($).catch(()=>null),S())},j=v.useRef(null),[C,O]=v.useState({mode:"closed"}),[T,_]=v.useState(!1),P=()=>O({mode:"closed"}),D=(e??[]).filter($=>$.active).length,L=D>=Dm,z=()=>{requestAnimationFrame(()=>{var $;($=j.current)==null||$.scrollIntoView({behavior:"smooth",block:"start"})})},R=()=>{O({mode:"new",question:"",answer:"",sourceTopic:null,autoGenerated:!1,banner:null}),z()},q=$=>{O({mode:"edit",faq:$}),z()},U=$=>{r.mutate({topic:$.topic,examples:[$.example].filter(Boolean)},{onSuccess:ee=>{O({mode:"new",question:ee.question,answer:ee.answer,sourceTopic:$.topic,autoGenerated:!0,banner:`Draft generated from a Coverage gap — review carefully before saving. Source: ${$.topic}.`}),_(!1),z()}})};v.useEffect(()=>{const $=()=>{const pe=sessionStorage.getItem("bb-faq-from-gap");if(!pe)return;sessionStorage.removeItem("bb-faq-from-gap");let k;try{k=JSON.parse(pe)}catch{return}k.topic&&U({topic:k.topic,example:k.example})};$();const ee=()=>$();return window.addEventListener("popstate",ee),()=>window.removeEventListener("popstate",ee)},[]);const re=v.useMemo(()=>{const $=(n==null?void 0:n.coverageGaps)??[],ee=new Set((e??[]).map(pe=>(pe.sourceTopic??"").trim().toLowerCase()).filter(Boolean));return $.filter(pe=>!ee.has(pe.topic.trim().toLowerCase()))},[n==null?void 0:n.coverageGaps,e]),G=(n==null?void 0:n.dismissedGapCount)??0,ie=async $=>{await bi({title:"Delete this FAQ?",message:`"${$.question.slice(0,60)}" will be removed. This cannot be undone.`,confirmLabel:"Delete",danger:!0})&&l.mutate($.id)},K=C.mode==="edit"?`Editing FAQ${C.faq.autoGenerated&&C.faq.sourceTopic?` · originally drafted from "${C.faq.sourceTopic}"`:""}`:null,Z=C.mode==="edit"?C.faq.id:null;return d.jsxs("section",{id:"faqs",className:"bb-faq-section",children:[d.jsxs("div",{className:"bb-faq-list-block",children:[(t||((e==null?void 0:e.length)??0)>0)&&d.jsxs("div",{className:"bb-faq-list-head",children:[b>0&&!t&&d.jsxs("label",{className:"bb-faq-select-all",children:[d.jsx("input",{type:"checkbox",checked:g,onChange:E,"aria-label":g?"Deselect all FAQs":"Select all FAQs"}),d.jsx("span",{children:g?"Deselect all":"Select all"})]}),d.jsx("span",{className:"bb-faq-list-aside",children:t?"loading…":`${D} of ${Dm} active · ${(e==null?void 0:e.length)??0} total`})]}),b>0&&d.jsxs("div",{className:"bb-faq-bulk-toolbar",role:"region","aria-label":"Bulk actions",children:[d.jsxs("span",{children:[d.jsx("strong",{children:b})," selected"]}),d.jsxs("div",{className:"bb-faq-bulk-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:S,children:"Clear"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-danger bb-btn-small",onClick:A,disabled:u.isPending,children:u.isPending?"Deleting…":`Delete ${b}`})]})]}),!t&&((e==null?void 0:e.length)??0)===0?d.jsx("p",{className:"bb-faq-empty",children:"No FAQs yet. Add one below, or generate from a coverage gap."}):d.jsx("ul",{className:"bb-faq-list",children:(e??[]).map($=>d.jsxs("li",{className:`bb-faq-row ${Z===$.id?"bb-faq-row-editing":""} ${p.has($.id)?"bb-faq-row-selected":""}`,children:[d.jsxs("div",{className:"bb-faq-row-head",children:[d.jsx("input",{type:"checkbox",className:"bb-faq-row-check",checked:p.has($.id),onChange:()=>x($.id),"aria-label":`Select FAQ: ${$.question.slice(0,60)}`}),d.jsxs("div",{className:"bb-faq-row-meta",children:[$.autoGenerated&&d.jsx("span",{className:"bb-faq-tag bb-faq-tag-auto",children:"Auto"}),d.jsxs("span",{className:"bb-faq-row-time",children:["Added ",ir($.createdAt)]}),$.sourceTopic&&d.jsxs("span",{className:"bb-faq-row-source",title:`Drafted from coverage gap: ${$.sourceTopic}`,children:["· ",$.sourceTopic]})]}),d.jsxs("div",{className:"bb-faq-row-controls",children:[d.jsx("button",{type:"button",className:"bb-faq-row-ctrl",onClick:()=>q($),children:"Edit"}),d.jsx("button",{type:"button",className:"bb-faq-row-ctrl bb-faq-row-ctrl-danger",onClick:()=>ie($),children:"Delete"})]})]}),d.jsx("p",{className:"bb-faq-question",children:$.question}),d.jsx("p",{className:"bb-faq-answer",children:$.answer})]},$.id))}),d.jsxs("div",{className:"bb-faq-add-row",children:[d.jsx("button",{type:"button",className:"bb-faq-pill bb-faq-pill-add",onClick:R,disabled:L,title:L?`Active FAQ limit (${Dm}) reached — edit or delete one to add a new one`:void 0,children:"+ Add FAQ"}),L&&d.jsxs("p",{className:"bb-faq-cap-help",children:["Active FAQ limit reached (",Dm,"). Edit or delete an existing FAQ — or toggle one to inactive — to add a new one."]})]})]}),(re.length>0||G>0)&&d.jsxs("div",{className:"bb-faq-pills-block",children:[d.jsxs("div",{className:"bb-faq-list-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Suggested from coverage gaps"}),d.jsxs("span",{className:"bb-faq-list-aside",children:[re.length>0?`${re.length} unanswered`:"All discarded",G>0&&d.jsx("button",{type:"button",className:"bb-faq-reset-icon",disabled:o.isPending,onClick:()=>o.mutate(),title:"Reset","aria-label":`Reset ${G} discarded suggestion${G===1?"":"s"}`,children:"↺"})]})]}),d.jsx("div",{className:"bb-faq-pills",children:re.slice(0,5).map(($,ee)=>d.jsxs("span",{className:"bb-faq-pill-wrap",children:[d.jsxs("button",{type:"button",className:"bb-faq-pill bb-faq-pill-suggest",disabled:r.isPending||L,onClick:()=>U($),title:L?"FAQ limit reached — edit or delete an existing one first":$.example,children:[$.topic,d.jsx("span",{className:"bb-faq-pill-count",children:$.count})]}),d.jsx("button",{type:"button",className:"bb-faq-pill-discard","aria-label":`Discard suggestion: ${$.topic}`,title:"Discard",disabled:i.isPending,onClick:()=>i.mutate($.topic),children:"×"})]},ee))})]}),C.mode!=="closed"&&d.jsx("div",{ref:j,children:r.isPending?d.jsx("div",{className:"bb-faq-drafting",children:"Drafting from the coverage gap — one sec…"}):C.mode==="edit"?d.jsx(PT,{editing:C.faq,banner:K,onClose:P}):d.jsx(PT,{initialQuestion:C.question,initialAnswer:C.answer,initialSourceTopic:C.sourceTopic,initialAutoGenerated:C.autoGenerated,banner:C.banner,onClose:P})}),C.mode==="closed"&&r.isPending&&d.jsx("div",{className:"bb-faq-drafting",children:"Drafting from the coverage gap — one sec…"}),d.jsx(Mf,{open:T,title:"All coverage gaps",aside:`${re.length} unanswered`,onClose:()=>_(!1),children:d.jsx("ol",{className:"bb-modal-list",children:re.map(($,ee)=>d.jsxs("li",{className:"bb-modal-row",children:[d.jsx("span",{className:"bb-modal-rank",children:ee+1}),d.jsxs("div",{className:"bb-modal-body-col",children:[d.jsx("span",{className:"bb-modal-row-title",children:$.topic}),d.jsxs("span",{className:"bb-modal-row-sub",children:['"',$.example,'" · ',$.count," ",$.count===1?"ask":"asks"]})]}),d.jsx("button",{type:"button",className:"bb-modal-row-action",disabled:r.isPending,onClick:()=>U($),children:"Draft FAQ →"})]},ee))})})]})}const mY="bb_devmockapikey0000000000000000",pY=[{id:"1",url:"https://example.com/",title:"Home",summary:null,enabled:!0,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()},{id:"2",url:"https://example.com/services",title:"Services",summary:null,enabled:!0,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()},{id:"3",url:"https://example.com/services/photography",title:"Photography",summary:null,enabled:!0,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()},{id:"4",url:"https://example.com/services/videography",title:"Videography",summary:null,enabled:!0,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()},{id:"5",url:"https://example.com/about",title:"About us",summary:null,enabled:!0,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()},{id:"6",url:"https://example.com/contact",title:"Contact",summary:null,enabled:!1,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()}],Dd=10;function bY(){const e=Re(),t=Ne(),n=e.apiKey===mY,[r,i]=v.useState(0),[o,l]=v.useState(""),[u,f]=v.useState(!1),{data:h,isLoading:p}=Et({queryKey:["indexed-pages"],queryFn:async()=>{if(n)return pY;const R=await me("GetPages");if(!R.success)throw new Error(R.error);return R.data.pages},staleTime:60*1e3}),[b,g]=v.useState(null),[x,E]=v.useState(new Set),S=(R,q)=>E(U=>{const re=new Set(U);return q?re.add(R):re.delete(R),re}),A=je({mutationFn:async({pageId:R,enabled:q})=>{if(n){await new Promise(re=>setTimeout(re,200));return}const U=await me("TogglePage",{pageId:R,enabled:q});if(!U.success)throw new Error(U.error)},onSuccess:()=>t.invalidateQueries({queryKey:["indexed-pages"]}),onError:R=>le.error(R instanceof Error?R.message:"Toggle failed")}),j=je({mutationFn:async R=>{if(n){await new Promise(U=>setTimeout(U,200));return}const q=await me("RemovePage",{pageId:R});if(!q.success)throw new Error(q.error)},onSuccess:()=>{le.success("Page removed"),t.invalidateQueries({queryKey:["indexed-pages"]})},onError:R=>le.error(R instanceof Error?R.message:"Remove failed")}),C=je({mutationFn:async R=>{if(n)return await new Promise(U=>setTimeout(U,300)),{removed:R.length};const q=await me("RemovePages",{pageIds:R});if(!q.success)throw new Error(q.error);return q.data},onSuccess:R=>{le.success(`Removed ${R.removed} page${R.removed===1?"":"s"}`),E(new Set),t.invalidateQueries({queryKey:["indexed-pages"]}),t.invalidateQueries({queryKey:["sync-status"]})},onError:R=>le.error(R instanceof Error?R.message:"Bulk remove failed")}),O=async()=>{const R=Array.from(x);if(R.length===0)return;await bi({title:`Remove ${R.length} page${R.length===1?"":"s"}?`,message:`This removes ${R.length===1?"it":"them"} from the bot's knowledge and clears their embeddings. This can't be undone.`,confirmLabel:`Remove ${R.length}`,danger:!0})&&C.mutate(R)},T=je({mutationFn:async R=>{var G;if(n){await new Promise(ie=>setTimeout(ie,400));return}const q=new URLSearchParams({action:"bitbot_resync_page",nonce:e.ajaxNonce,page_url:R}),re=await(await fetch(e.ajaxUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:q.toString()})).json();if(!re.success)throw new Error(((G=re.data)==null?void 0:G.error)||"Resync failed")},onSuccess:()=>{le.success("Page resynced"),t.invalidateQueries({queryKey:["indexed-pages"]}),t.invalidateQueries({queryKey:["sync-status"]})},onError:R=>le.error(R instanceof Error?R.message:"Resync failed")}),_=je({mutationFn:async R=>{if(n)return await new Promise(U=>setTimeout(U,600)),{fetched:R.length,embedded:R.length,skippedUnchanged:0,failed:0,errors:[]};const q=await me("IndexUrlList",{urls:R});if(!q.success)throw new Error(q.error);return q.data},onSuccess:R=>{const q=R.fetched+R.skippedUnchanged,U=R.failed>0?`Indexed ${q} URL${q===1?"":"s"}, ${R.failed} failed`:`Indexed ${q} URL${q===1?"":"s"} (${R.embedded} chunks)`;le.success(U),t.invalidateQueries({queryKey:["indexed-pages"]}),t.invalidateQueries({queryKey:["sync-status"]}),f(!1)},onError:R=>le.error(R instanceof Error?R.message:"Could not index URLs")}),P=(h??[]).filter(R=>{var q;return o===""||R.url.toLowerCase().includes(o.toLowerCase())||(((q=R.title)==null?void 0:q.toLowerCase().includes(o.toLowerCase()))??!1)}),D=r*Dd,L=P.slice(D,D+Dd),z=Math.max(1,Math.ceil(P.length/Dd));return!p&&((h==null?void 0:h.length)??0)===0?d.jsxs(d.Fragment,{children:[d.jsx(Lr,{children:d.jsx(uu,{headline:"No pages indexed yet",body:"Run a sync to crawl your site, or paste specific URLs you want the bot to learn.",ctaLabel:"Add URLs",onCta:()=>f(!0)})}),u&&d.jsx(_T,{onCancel:()=>f(!1),onSubmit:R=>_.mutate(R),submitting:_.isPending})]}):d.jsxs(Lr,{titleAction:x.size>0?d.jsxs("div",{className:"bb-pages-actions-row bb-pages-actions-row-bulk",children:[d.jsxs("span",{className:"bb-pages-bulkbar-count",children:[x.size," selected"]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-danger bb-btn-small",onClick:O,disabled:C.isPending,children:C.isPending?"Removing…":`Delete ${x.size}`}),d.jsx("button",{type:"button",className:"bb-link-btn bb-btn-small",onClick:()=>E(new Set),children:"Clear"})]}):d.jsxs("div",{className:"bb-pages-actions-row",children:[d.jsx("input",{type:"search",className:"bb-input bb-pages-search",placeholder:"Filter by URL or title",value:o,onChange:R=>{l(R.target.value),i(0)}}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>f(!0),title:"Add specific URLs (external docs, member pages, etc.) for the bot to learn",children:"+ Add URLs"})]}),noBody:!0,children:[d.jsxs("table",{className:"bb-pages-table",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{className:"bb-pages-check",children:d.jsx("input",{type:"checkbox","aria-label":"Select all on this page",checked:L.length>0&&L.every(R=>x.has(R.id)),ref:R=>{R&&(R.indeterminate=L.some(q=>x.has(q.id))&&!L.every(q=>x.has(q.id)))},onChange:R=>{const q=R.target.checked;E(U=>{const re=new Set(U);return L.forEach(G=>{q?re.add(G.id):re.delete(G.id)}),re})}})}),d.jsx("th",{children:"URL"}),d.jsx("th",{children:"Last crawled"}),d.jsx("th",{children:"Enabled"}),d.jsx("th",{"aria-label":"actions"})]})}),d.jsxs("tbody",{children:[p&&d.jsx("tr",{children:d.jsx("td",{colSpan:5,className:"bb-pages-empty",children:"Loading pages…"})}),!p&&L.length===0&&d.jsx("tr",{children:d.jsxs("td",{colSpan:5,className:"bb-pages-empty",children:['No pages match "',o,'"']})}),!p&&L.map(R=>d.jsxs("tr",{className:x.has(R.id)?"bb-pages-row-selected":void 0,children:[d.jsx("td",{className:"bb-pages-check",children:d.jsx("input",{type:"checkbox","aria-label":`Select ${R.title||R.url}`,checked:x.has(R.id),onChange:q=>S(R.id,q.target.checked)})}),d.jsxs("td",{className:"bb-pages-url",children:[d.jsx("div",{className:"bb-pages-title",children:R.title||"—"}),d.jsxs("a",{className:"bb-pages-href",href:R.url,target:"_blank",rel:"noopener noreferrer",title:"Open page in a new tab",children:[d.jsx("span",{className:"bb-pages-href-text",children:R.url}),d.jsx("span",{className:"bb-pages-href-ext","aria-hidden":"true",children:"↗"})]})]}),d.jsx("td",{className:"bb-pages-time",children:R.lastCrawledAt?ir(R.lastCrawledAt):"—"}),d.jsx("td",{children:d.jsx("span",{className:`bb-pages-status ${R.enabled?"bb-pages-status-on":"bb-pages-status-off"}`,children:R.enabled?"On":"Off"})}),d.jsx("td",{className:"bb-pages-actions",children:d.jsx("button",{className:"bb-link-btn bb-pages-action-trigger",type:"button","aria-label":"Row actions",onClick:q=>{const U=q.currentTarget.getBoundingClientRect();g(re=>(re==null?void 0:re.id)===R.id?null:{id:R.id,anchor:U})},children:"⋯"})})]},R.id))]})]}),P.length>Dd&&d.jsxs("footer",{className:"bb-pages-footer",children:[d.jsxs("span",{children:["Showing ",D+1,"–",Math.min(D+Dd,P.length)," of ",P.length]}),d.jsxs("div",{className:"bb-pages-pager",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>i(R=>Math.max(0,R-1)),disabled:r===0,children:"← Previous"}),d.jsxs("span",{className:"bb-pages-pageno",children:[r+1," / ",z]}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>i(R=>Math.min(z-1,R+1)),disabled:r>=z-1,children:"Next →"})]})]}),u&&d.jsx(_T,{onCancel:()=>f(!1),onSubmit:R=>_.mutate(R),submitting:_.isPending}),b&&(()=>{const R=L.find(q=>q.id===b.id);return R?d.jsx(vY,{anchor:b.anchor,page:R,onClose:()=>g(null),onResync:()=>{g(null),T.mutate(R.url)},onToggle:()=>{g(null),A.mutate({pageId:R.id,enabled:!R.enabled})},onRemove:async()=>{g(null),await bi({title:"Remove this page?",message:`"${R.title||R.url}" will be removed from the bot's knowledge and its embeddings cleared. This can't be undone.`,confirmLabel:"Remove",danger:!0})&&j.mutate(R.id)},resyncing:T.isPending,toggling:A.isPending,removing:j.isPending}):null})()]})}function vY({anchor:e,page:t,onClose:n,onResync:r,onToggle:i,onRemove:o,resyncing:l,toggling:u,removing:f}){const h=e.bottom+4,p=window.innerWidth-e.right;return Vn.createPortal(d.jsxs("div",{className:"bb-portal-scope",children:[d.jsx("div",{className:"bb-pages-action-backdrop",onClick:n}),d.jsxs("div",{className:"bb-pages-action-menu bb-pages-action-menu-portaled",role:"menu",style:{position:"fixed",top:h,right:p},children:[d.jsx("button",{type:"button",role:"menuitem",onClick:r,disabled:l,children:"Resync"}),d.jsx("button",{type:"button",role:"menuitem",onClick:i,disabled:u,children:t.enabled?"Disable":"Enable"}),d.jsx("button",{type:"button",role:"menuitem",className:"bb-pages-action-danger",onClick:o,disabled:f,children:"Remove"})]})]}),document.body)}function _T({onCancel:e,onSubmit:t,submitting:n}){const[r,i]=v.useState(""),o=r.split(/\r?\n/).map(p=>p.trim()).filter(Boolean),l=[],u=[];for(const p of o)try{const b=new URL(p);b.protocol==="http:"||b.protocol==="https:"?l.push(b.toString()):u.push(p)}catch{u.push(p)}const f=()=>{l.length!==0&&t(l)},h=d.jsx("div",{className:"bb-portal-scope bb-avatar-crop-modal-overlay",onClick:p=>{p.target===p.currentTarget&&e()},role:"dialog","aria-modal":"true","aria-label":"Add URLs to bot knowledge",children:d.jsxs("div",{className:"bb-add-urls-modal",children:[d.jsxs("header",{className:"bb-avatar-crop-head",children:[d.jsx("h3",{children:"Teach the bot specific URLs"}),d.jsx("p",{children:"One URL per line. The bot fetches each page, extracts text, and indexes it for chat answers. Useful for external docs, members-only pages, or anything the standard sync misses."})]}),d.jsx("textarea",{className:"bb-input bb-textarea",rows:6,value:r,onChange:p=>i(p.target.value),placeholder:`https://example.com/docs/getting-started210 https://your-knowledge-base.com/article-1`,disabled:n}),d.jsxs("div",{className:"bb-add-urls-meta",children:[l.length>0&&d.jsxs("span",{className:"bb-add-urls-count",children:[l.length," URL",l.length===1?"":"s"," ready"]}),u.length>0&&d.jsxs("span",{className:"bb-add-urls-warn",children:[u.length," line",u.length===1?"":"s"," skipped (not a valid http/https URL)"]})]}),d.jsxs("footer",{className:"bb-avatar-crop-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost",onClick:e,disabled:n,children:"Cancel"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:f,disabled:n||l.length===0,children:n?"Indexing…":`Index ${l.length||""} URL${l.length===1?"":"s"}`})]})]})});return Vn.createPortal(h,document.body)}function DT({status:e,label:t,className:n}){return d.jsxs("span",{className:`bb-status-pill bb-status-pill-${e} ${n??""}`,children:[d.jsx("span",{className:`bb-status-dot bb-status-dot-${e}`,"aria-hidden":!0}),t]})}async function gY(){var o;const{ajaxUrl:e,ajaxNonce:t}=Re(),n=new URLSearchParams({action:"bitbot_sync",nonce:t}),i=await(await fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})).json();if(!i.success){const l=((o=i.data)==null?void 0:o.error)??"Sync failed";throw new Error(l)}return i.data??{}}const yY=5e3;function xY(){const e=Ne(),{data:t}=VS(),{isExpired:n}=Kk(),[r,i]=v.useState(null),o=je({mutationFn:gY,onSuccess:u=>{const f=u.pagesSaved??u.pagesProcessed??u.pagesQueued??0;i({pages:f}),e.invalidateQueries({queryKey:["sync-status"]}),e.invalidateQueries({queryKey:["indexed-pages"]})},onError:u=>le.error(u instanceof Error?u.message:"Sync failed")});if(v.useEffect(()=>{if(!r)return;const u=setTimeout(()=>i(null),yY);return()=>clearTimeout(u)},[r]),o.isPending||(t==null?void 0:t.status)==="syncing")return d.jsx(DT,{status:"syncing",label:"Syncing now"});if(r){const u=r.pages;return d.jsx(DT,{status:"success",label:u>0?`Synced · ${u} ${u===1?"page":"pages"}`:"Synced"})}return d.jsxs("div",{className:"bb-sync-trigger",children:[(t==null?void 0:t.lastSync)&&d.jsxs("span",{className:"bb-sync-trigger-meta",title:new Date(t.lastSync).toLocaleString(),children:["Last synced ",ir(t.lastSync)]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>o.mutate(),disabled:n,title:n?"Reactivate your plan to sync content":void 0,children:"Sync now"})]})}const MT=[{key:"indexed",label:"Indexed pages"},{key:"faqs",label:"FAQs"},{key:"topics",label:"Find Topics",aside:"AI scans your site + reader trends"},{key:"generate",label:"Generate a post",aside:"Each post counts against your monthly quota"},{key:"drafts",label:"Drafts",aside:"Generated content will show here"}],wY={draft:"Draft",scheduled:"Scheduled",published:"Published",failed:"Failed"};function SY({status:e,wpPostId:t}){const n=e==="draft"&&!!t,r=n?"In WordPress":wY[e],i=n?"in-wordpress":e;return d.jsx("span",{className:`bb-draft-status bb-draft-status-${i}`,children:r})}function EY(e,t){const n=e instanceof Error?e.message:String(e??"");return/Failed to fetch URL/i.test(n)?t==="url"?"Couldn't fetch that URL. The page may block bots, time out, or be a PDF. Try a different article URL, or use From a topic.":"Couldn't load the source. Try again, or pick a different source.":/ACCESS_PAUSED|TRIAL_EXPIRED/i.test(n)?"Your subscription has ended. Reactivate to keep generating posts.":/ASSISTANT_REQUIRED|post generation is a pro feature/i.test(n)?"Post generation is on Assistant. Upgrade to keep creating.":/monthly post limit|fair-use/i.test(n)?"You've hit this month's post fair-use ceiling.":/BamlValidationError|Failed to parse LLM response|Failed to generate post from (pdf|image)/i.test(n)?t==="upload"?"Couldn't read that file. Use a PDF with selectable text (not a scan), or paste the content as a topic instead.":"Couldn't turn that source into a post. Try a different source, or use From a topic.":n||"Something went wrong. Try again in a moment."}function AY({prefillTopic:e,onPrefillConsumed:t,composerRef:n}){const[r,i]=v.useState("prompt"),[o,l]=v.useState(""),[u,f]=v.useState(""),[h,p]=v.useState(null),[b,g]=v.useState(!1),x=v.useRef(null),E=nY(),{data:S}=Ai(),A=(S==null?void 0:S.usage.postsThisMonth)??0,j=(S==null?void 0:S.limits.postsPerMonth)??0,C=(S==null?void 0:S.plan)==="free",O=!C&&j>0&&A>=j,T=(S==null?void 0:S.accessMode)==="expired";v.useEffect(()=>{e&&(i("prompt"),l(e),t==null||t())},[e,t]);const _={prompt:'A topic to write about — e.g. "5 questions every wedding planner asks before quoting"',url:"https://example.com/source-article",upload:"Drag a PDF or image here, or click to choose"}[r];return d.jsx("div",{ref:n,children:d.jsxs(Lr,{children:[d.jsx("div",{className:"bb-content-source-tabs",children:["prompt","url","upload"].map(P=>d.jsxs("button",{className:`bb-source-tab ${r===P?"bb-source-tab-active":""}`,onClick:()=>i(P),children:[d.jsx("span",{className:"bb-source-tab-title",children:P==="prompt"?"From a topic":P==="url"?"From a URL":"From an upload"}),d.jsx("span",{className:"bb-source-tab-sub",children:P==="prompt"?"AI writes from a one-line prompt":P==="url"?"Summarise + rewrite an article":"Extract from a PDF or image"})]},P))}),d.jsxs("div",{className:"bb-field",children:[d.jsx("label",{className:"bb-field-label",children:r==="prompt"?"Topic":r==="url"?"Source URL":"File"}),r==="upload"?d.jsxs("div",{className:`bb-upload-zone ${b?"bb-upload-zone-dragging":""} ${h?"bb-upload-zone-filled":""}`,role:"button",tabIndex:0,onClick:()=>{var P;return(P=x.current)==null?void 0:P.click()},onKeyDown:P=>{var D;(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),(D=x.current)==null||D.click())},onDragOver:P=>{P.preventDefault(),g(!0)},onDragLeave:P=>{P.preventDefault(),g(!1)},onDrop:P=>{var L;P.preventDefault(),g(!1);const D=(L=P.dataTransfer.files)==null?void 0:L[0];D&&p(D)},children:[d.jsx("input",{ref:x,type:"file",accept:ZG,className:"bb-upload-input",onChange:P=>{var D;return p(((D=P.target.files)==null?void 0:D[0])??null)}}),h?d.jsxs("div",{className:"bb-upload-file",children:[d.jsx("span",{className:"bb-upload-file-name",children:h.name}),d.jsx("button",{type:"button",className:"bb-upload-file-remove","aria-label":"Remove file",onClick:P=>{P.stopPropagation(),p(null),x.current&&(x.current.value="")},children:"×"})]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{children:_}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",children:"Choose file"})]})]}):d.jsx("input",{className:"bb-input",value:o,onChange:P=>l(P.target.value),placeholder:_})]}),d.jsxs("div",{className:"bb-field",children:[d.jsx("label",{className:"bb-field-label",children:"Tone / instructions (optional)"}),d.jsx("textarea",{className:"bb-input bb-textarea",rows:2,value:u,onChange:P=>f(P.target.value),placeholder:"Friendly, conversational, around 800 words. Always end with a CTA to book a discovery call."}),d.jsx("p",{className:"bb-field-help",children:"Each generated post automatically respects your site's brand voice from the chatbot's Bot Instructions."})]}),O&&!C&&!T&&d.jsx("div",{className:"bb-topic-discovery-gate",children:d.jsxs("div",{children:[d.jsxs("strong",{children:["You've hit this month's post fair-use ceiling (",j,")."]}),d.jsx("p",{children:"Fair-use resets on the 1st. Talk to us for higher limits."})]})}),d.jsx("div",{className:"bb-content-actions",children:d.jsx("button",{className:"bb-btn bb-btn-primary",disabled:E.isPending||C||O||T||(r==="upload"?!h:!o.trim()),onClick:()=>E.mutate({sourceType:r,sourceValue:o,instructions:u||void 0,file:h??void 0},{onSuccess:()=>{p(null),x.current&&(x.current.value="")},onError:P=>le.error(EY(P,r))}),children:E.isPending?"Generating… (~30s)":"Generate draft →"})})]})})}function jY({selectedId:e,onSelect:t,onTryTopic:n}){const{data:r,total:i,isLoading:o,hasNextPage:l,isFetchingNextPage:u,fetchNextPage:f}=W2(),h=r??[];return d.jsxs("section",{className:"bb-drafts-list",children:[!o&&h.length>0&&h.length<i&&d.jsxs("p",{className:"bb-field-help",style:{margin:"0 0 var(--sp-8)"},children:["Showing ",d.jsx("strong",{children:h.length})," of ",i," drafts"]}),o&&d.jsx("div",{className:"bb-skeleton",style:{height:260,borderRadius:8}}),!o&&h.length===0&&d.jsx(uu,{headline:"No drafts yet",body:"Pick a suggested topic and generate your first post.",ctaLabel:"Try a topic",onCta:n}),!o&&h.map(p=>d.jsxs("button",{className:`bb-draft-row ${p.id===e?"bb-draft-row-active":""}`,onClick:()=>t(p.id),children:[d.jsx("div",{className:"bb-draft-row-title",children:mp(p.title,80)}),d.jsxs("div",{className:"bb-draft-row-meta",children:[d.jsx(SY,{status:p.status,wpPostId:p.wpPostId}),d.jsxs("span",{children:["· created ",ir(p.createdAt)]}),p.scheduledAt&&d.jsxs("span",{children:["· scheduled ",ir(p.scheduledAt)]})]})]},p.id)),l&&d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-load-more",onClick:()=>f(),disabled:u,children:u?"Loading…":`Load more (${i-h.length} remaining)`})]})}function CY({draftId:e,onDeleted:t}){const{data:n,isLoading:r}=QG(e),i=VG(),o=XG(),l=Re();return e?r||!n?d.jsx(Lr,{eyebrow:"Draft",title:"Loading…",children:d.jsx("div",{className:"bb-skeleton",style:{height:240,borderRadius:8}})}):d.jsxs(Lr,{eyebrow:"Draft",title:n.title,children:[d.jsxs("div",{className:"bb-field",children:[d.jsx("span",{className:"bb-eyebrow",children:"SEO meta"}),d.jsxs("div",{className:"bb-seo-block",children:[d.jsxs("div",{className:"bb-seo-row",children:[d.jsx("span",{className:"bb-seo-label",children:"Meta title"}),d.jsx("span",{className:"bb-seo-value",children:n.seoMeta.metaTitle})]}),d.jsxs("div",{className:"bb-seo-row",children:[d.jsx("span",{className:"bb-seo-label",children:"Meta description"}),d.jsx("span",{className:"bb-seo-value",children:n.seoMeta.metaDescription})]}),d.jsxs("div",{className:"bb-seo-row",children:[d.jsx("span",{className:"bb-seo-label",children:"Focus keyphrase"}),d.jsx("span",{className:"bb-seo-value",children:n.seoMeta.focusKeyphrase})]}),d.jsxs("div",{className:"bb-seo-row",children:[d.jsx("span",{className:"bb-seo-label",children:"Keywords"}),d.jsx("span",{className:"bb-seo-value",children:n.seoMeta.keywords.map(u=>d.jsx("span",{className:"bb-keyword-chip",children:u},u))})]})]})]}),d.jsxs("div",{className:"bb-field",children:[d.jsx("span",{className:"bb-eyebrow",children:"Body preview"}),d.jsx("div",{className:"bb-draft-body",dangerouslySetInnerHTML:{__html:n.content}})]}),d.jsxs("div",{className:"bb-draft-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small bb-btn-danger",disabled:o.isPending,onClick:async()=>{await bi({title:"Delete this draft?",message:`"${n.title.slice(0,60)}" will be removed from BitBot. The WordPress post (if any) is untouched.`,confirmLabel:"Delete",danger:!0})&&o.mutate(e,{onSuccess:()=>t()})},children:o.isPending?"Deleting…":"Delete"}),n.wpPostId?d.jsx("a",{href:`${l.siteUrl.replace(/\/$/,"")}/wp-admin/post.php?post=${n.wpPostId}&action=edit`,target:"_blank",rel:"noopener noreferrer",className:"bb-btn bb-btn-primary bb-btn-small",children:"Edit in WordPress ↗"}):d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-btn-small",disabled:i.isPending,onClick:()=>i.mutate({draftId:e}),children:i.isPending?"Sending to WordPress…":"Edit in WordPress →"})]})]}):d.jsx(Lr,{eyebrow:"Draft",title:"Pick a post to expand",children:d.jsx("p",{className:"bb-conv-placeholder-body",children:"Each draft has full markdown body + SEO meta. You can edit, schedule for a date/time, or push directly to WordPress as a published post."})})}function OY(){const[e,t]=v.useState(null),[n,r]=v.useState(null),i=v.useRef(null),[o,l]=V2(),{data:u}=Ai(),f=Y2();v.useEffect(()=>{o==="drafts"&&YG()},[o]);const h=x=>{r(x),l("generate")},p=(u==null?void 0:u.plan)??"free",b=p==="free"?MT.filter(x=>x.key!=="drafts"):MT;v.useEffect(()=>{p==="free"&&o==="drafts"&&l("generate")},[p,o,l]);const g=b.find(x=>x.key===o)??b[0];return d.jsxs(d.Fragment,{children:[d.jsx("nav",{className:"bb-subtab-strip",role:"tablist","aria-label":"Knowledgebase sub-sections",children:b.map(x=>d.jsxs("button",{role:"tab","aria-selected":o===x.key,className:`bb-subtab ${o===x.key?"bb-subtab-active":""}`,onClick:()=>l(x.key),children:[x.label,x.key==="drafts"&&f>0&&d.jsx("span",{className:"bb-tab-badge","aria-label":`${f} new drafts`,children:f})]},x.key))}),d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:g.label}),o==="indexed"&&d.jsx(xY,{}),g.aside&&o!=="indexed"&&d.jsx("span",{className:"bb-section-aside",children:g.aside})]}),o==="indexed"&&d.jsx(bY,{}),o==="faqs"&&d.jsx(hY,{}),o==="topics"&&d.jsx(aY,{onPickTopic:h}),o==="generate"&&d.jsx(AY,{prefillTopic:n,onPrefillConsumed:()=>r(null),composerRef:i}),o==="drafts"&&d.jsxs("div",{className:"bb-drafts-grid",children:[d.jsx(jY,{selectedId:e,onSelect:t,onTryTopic:()=>l("topics")}),d.jsx(CY,{draftId:e,onDeleted:()=>t(null)})]})]})}const Dl="bb_devmockapikey0000000000000000",Mm=e=>new Date(Date.now()-e*864e5).toISOString(),ea=[{id:"f-default",name:"Pre-chat form",description:"Captures visitor details before their first reply.",enabled:!0,isDefault:!0,chatGateEnabled:!1,submissionsCount:0,lastSubmissionAt:null,createdAt:Mm(60),fields:[{name:"name",label:"Full name",type:"text",required:!0,placeholder:"Your name"},{name:"email",label:"Email",type:"email",required:!0,placeholder:"you@example.com"},{name:"phone",label:"Phone",type:"phone",required:!1,placeholder:"+1 (555) 000-0000"}]},{id:"f-1",name:"Pedir Orçamento",description:"Quote request — captures event details for corporate enquiries.",enabled:!0,isDefault:!1,chatGateEnabled:!1,submissionsCount:0,lastSubmissionAt:null,createdAt:Mm(30),fields:[{name:"name",label:"Your name",type:"text",required:!0,placeholder:""},{name:"email",label:"Email",type:"email",required:!0,placeholder:""},{name:"event_type",label:"Event type",type:"select",required:!0,options:["Corporate","Wedding","Birthday","Other"]},{name:"guest_count",label:"Guest count",type:"text",required:!1,placeholder:"Approximate"},{name:"date",label:"Preferred date",type:"text",required:!1,placeholder:""},{name:"budget",label:"Budget range",type:"select",required:!1,options:["<5k BRL","5-15k BRL","15-25k BRL","25k+ BRL"]},{name:"message",label:"Anything else?",type:"textarea",required:!1,placeholder:""}]},{id:"f-2",name:"Newsletter",description:"Two-field signup for the monthly events newsletter.",enabled:!0,isDefault:!1,chatGateEnabled:!1,submissionsCount:0,lastSubmissionAt:null,createdAt:Mm(12),fields:[{name:"name",label:"First name",type:"text",required:!0},{name:"email",label:"Email",type:"email",required:!0}]},{id:"f-3",name:"Partner enquiry",description:"For other event vendors who want to refer business.",enabled:!1,isDefault:!1,chatGateEnabled:!1,submissionsCount:0,lastSubmissionAt:null,createdAt:Mm(45),fields:[{name:"name",label:"Your name",type:"text",required:!0},{name:"email",label:"Email",type:"email",required:!0},{name:"company",label:"Company",type:"text",required:!0},{name:"services",label:"Your services",type:"checkbox",required:!1,options:["Photography","Catering","Music","Decor","Venue"]},{name:"pitch",label:"Why us?",type:"textarea",required:!1}]}];function X2(){const t=Re().apiKey===Dl;return Et({queryKey:["forms"],queryFn:async()=>{if(t)return ea;const n=await me("GetForms");if(!n.success)throw new Error(n.error);return n.data.forms},staleTime:15e3,refetchOnWindowFocus:!0})}function NY(){const e=Ne(),n=Re().apiKey===Dl;return je({mutationFn:async r=>{if(n){const o=ea.findIndex(l=>l.id===r);return o>=0&&ea.splice(o,1),{success:!0}}const i=await me("DeleteForm",{formId:r});if(!i.success)throw new Error(i.error);return i.data},onSuccess:()=>{le.success("Form deleted"),e.invalidateQueries({queryKey:["forms"]})},onError:r=>le.error(r instanceof Error?r.message:"Delete failed")})}function TY(){const e=Ne(),n=Re().apiKey===Dl;return je({mutationFn:async r=>{if(n){const o=ea.findIndex(l=>l.id===r.formId);if(o>=0)return ea[o]={...ea[o],name:r.name,fields:r.fields},ea[o];throw new Error("Form not found")}const i=await me("UpdateForm",{formId:r.formId,name:r.name,fields:r.fields});if(!i.success)throw new Error(i.error);return i.data},onSuccess:()=>{le.success("Form saved"),e.invalidateQueries({queryKey:["forms"]})},onError:r=>le.error(r instanceof Error?r.message:"Save failed")})}function PY(){const e=Ne(),t=Re(),n=t.apiKey===Dl;return je({onMutate:async({formId:r,enabled:i})=>{await e.cancelQueries({queryKey:["forms"]});const o=e.getQueryData(["forms"]);return e.setQueryData(["forms"],l=>(l??[]).map(u=>u.id===r?u.isDefault?{...u,enabled:i,chatGateEnabled:i}:{...u,enabled:i}:u)),{previous:o}},mutationFn:async({formId:r,enabled:i})=>{var p,b;if(n){const g=ea.findIndex(x=>x.id===r);return g>=0&&(ea[g]={...ea[g],enabled:i}),ea[g]}const o=e.getQueryData(["forms"]),l=((p=o==null?void 0:o.find(g=>g.id===r))==null?void 0:p.isDefault)===!0,u=me("UpdateForm",{formId:r,enabled:i}),f=l?fetch(t.ajaxUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:"bitbot_set_chat_gate",nonce:t.ajaxNonce,enabled:i?"1":"0"}).toString()}).then(()=>{}).catch(()=>{}):Promise.resolve(),[h]=await Promise.all([u,f]);if(!h.success)throw new Error(h.error);return!l&&((b=h.data)!=null&&b.isDefault)&&await fetch(t.ajaxUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:"bitbot_set_chat_gate",nonce:t.ajaxNonce,enabled:i?"1":"0"}).toString()}).catch(()=>{}),h.data},onSuccess:(r,{enabled:i})=>{le.success(i?"Form enabled":"Form disabled")},onError:(r,i,o)=>{o!=null&&o.previous&&e.setQueryData(["forms"],o.previous),le.error(r instanceof Error?r.message:"Toggle failed")}})}function _Y(){const e=Ne(),n=Re().apiKey===Dl;return je({mutationFn:async r=>{if(n){const o={id:"f-"+Date.now(),name:r.name,description:r.description,fields:r.fields,enabled:!0,isDefault:!1,chatGateEnabled:!1,submissionsCount:0,lastSubmissionAt:null,createdAt:new Date().toISOString()};return ea.push(o),o}const i=await me("CreateForm",r);if(!i.success)throw new Error(i.error);return i.data},onSuccess:()=>{le.success("Form created"),e.invalidateQueries({queryKey:["forms"]})},onError:r=>le.error(r instanceof Error?r.message:"Create failed")})}function DY(){const e=Ne(),t=Re(),n=t.apiKey===Dl;return je({mutationFn:async r=>{var h;if(n){const p=ea.find(b=>b.isDefault);return p&&(p.chatGateEnabled=r),{chatGateEnabled:r,formId:(p==null?void 0:p.id)??""}}const{ajaxUrl:i,ajaxNonce:o}=t,l=new URLSearchParams({action:"bitbot_set_chat_gate",nonce:o,enabled:r?"1":"0"}),f=await(await fetch(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l.toString()})).json();if(!f.success){const p=((h=f.data)==null?void 0:h.error)??"Toggle failed";throw new Error(p)}return f.data},onSuccess:r=>{le.success(r.chatGateEnabled?"Pre-chat form turned on":"Pre-chat form turned off"),e.invalidateQueries({queryKey:["forms"]})},onError:r=>le.error(r instanceof Error?r.message:"Toggle failed")})}function MY(){const t=Re().apiKey===Dl;return je({mutationFn:async n=>{if(t)return await new Promise(i=>setTimeout(i,1800)),{name:"AI-generated form",fields:[{name:"name",label:"Your name",type:"text",required:!0},{name:"email",label:"Email",type:"email",required:!0},{name:"message",label:"Message",type:"textarea",required:!1,placeholder:n.slice(0,80)}]};const r=await me("GenerateForm",{description:n});if(!r.success)throw new Error(r.error);return r.data},onSuccess:()=>le.success("Form generated"),onError:n=>le.error(n instanceof Error?n.message:"Generation failed")})}const RY=[{value:"text",label:"Text"},{value:"email",label:"Email"},{value:"phone",label:"Phone"},{value:"textarea",label:"Long text"},{value:"select",label:"Dropdown"},{value:"radio",label:"Single choice"},{value:"checkbox",label:"Multi-choice"}],Z2=new Set(["select","radio","checkbox"]),kY="Pre-chat form",LY=[{name:"name",label:"Full name",type:"text",required:!0,placeholder:"Your name"},{name:"email",label:"Email",type:"email",required:!0,placeholder:"you@example.com"},{name:"phone",label:"Phone",type:"phone",required:!1,placeholder:"+1 (555) 000-0000"}];function IY(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,40)||"field"}function zY({open:e,form:t,onClose:n}){const[r,i]=v.useState("build"),[o,l]=v.useState(""),[u,f]=v.useState([]),h=TY(),p=Ne();if(v.useEffect(()=>{!e||!t||(l(t.name),f(t.fields.map(E=>({...E}))),i((t.unviewedCount??0)>0?"responses":"build"),p.invalidateQueries({queryKey:["forms"]}),p.invalidateQueries({queryKey:["leads"]}))},[e,t==null?void 0:t.id]),v.useEffect(()=>{!t||r!=="responses"||me("MarkFormResponsesSeen",{formId:t.id}).then(()=>{p.invalidateQueries({queryKey:["menu-badges"]}),p.invalidateQueries({queryKey:["forms"]})})},[r,t,p]),!t)return null;const b=t.name!==o||JSON.stringify(t.fields)!==JSON.stringify(u),g=document.getElementById("bitbot-admin-root")??void 0,x=()=>{if(!o.trim()){le.error("Form name cannot be empty");return}const E=u.filter(S=>S.label.trim().length>0).map(S=>{var A;return{...S,label:S.label.trim(),name:((A=S.name)==null?void 0:A.trim())||IY(S.label),options:Z2.has(S.type)?S.options??[]:void 0}});if(E.length===0){le.error("A form needs at least one field");return}h.mutate({formId:t.id,name:o.trim(),fields:E},{onSuccess:()=>n()})};return d.jsx(Tb,{open:e,onOpenChange:E=>!E&&n(),children:d.jsxs(Pb,{container:g,children:[d.jsx(_b,{className:"bb-form-modal-overlay"}),d.jsxs(Db,{className:"bb-form-modal","aria-describedby":void 0,children:[d.jsxs("header",{className:"bb-form-modal-head",children:[d.jsxs("div",{className:"bb-form-modal-title-row",children:[d.jsx("input",{className:"bb-form-modal-name",value:o,onChange:E=>l(E.target.value),placeholder:"Form name",disabled:r!=="build"}),t.isDefault&&d.jsx("span",{className:"bb-form-default-badge",children:"Default"})]}),d.jsx(Mb,{className:"bb-form-modal-close","aria-label":"Close",children:"✕"})]}),d.jsx(UY,{tab:r,setTab:i,form:t}),d.jsxs("div",{className:"bb-form-modal-body",children:[r==="build"&&d.jsx(qY,{fields:u,onChange:f}),r==="embed"&&d.jsx(FY,{form:t}),r==="responses"&&d.jsx($Y,{form:t})]}),r==="build"&&d.jsxs("footer",{className:"bb-form-modal-foot",children:[d.jsx("button",{className:"bb-btn bb-btn-primary",disabled:!b||h.isPending,onClick:x,children:h.isPending?"Saving…":"Save"}),d.jsx("button",{className:"bb-btn bb-btn-ghost",onClick:n,disabled:h.isPending,children:"Cancel"}),t.isDefault&&d.jsx("button",{className:"bb-link-btn bb-form-modal-reset",type:"button",onClick:async()=>{await bi({title:"Reset the Pre-chat form?",message:"This restores the original Name + Email + Phone fields. Your unsaved changes will be replaced — click Save afterwards to persist.",confirmLabel:"Reset"})&&(l(kY),f(LY.map(S=>({...S}))))},disabled:h.isPending,children:"Reset to defaults"})]})]})]})})}function UY({tab:e,setTab:t,form:n}){const r=n.unviewedCount??0;return d.jsxs("nav",{className:"bb-form-modal-tabs",role:"tablist",children:[d.jsx("button",{role:"tab","aria-selected":e==="build",className:`bb-form-modal-tab ${e==="build"?"bb-form-modal-tab-active":""}`,onClick:()=>t("build"),children:"Build"}),d.jsx("button",{role:"tab","aria-selected":e==="embed",className:`bb-form-modal-tab ${e==="embed"?"bb-form-modal-tab-active":""}`,onClick:()=>t("embed"),children:"Embed"}),d.jsxs("button",{role:"tab","aria-selected":e==="responses",className:`bb-form-modal-tab ${e==="responses"?"bb-form-modal-tab-active":""}`,onClick:()=>t("responses"),children:["Responses",r>0&&e!=="responses"&&d.jsx("span",{className:"bb-form-modal-tab-newdot","aria-label":"new responses",title:"New responses since you last looked"})]})]})}function qY({fields:e,onChange:t}){const n=(l,u)=>{const f=e.slice(),h=l+u;h<0||h>=f.length||([f[l],f[h]]=[f[h],f[l]],t(f))},r=(l,u)=>{t(e.map((f,h)=>h===l?{...f,...u}:f))},i=l=>{t(e.filter((u,f)=>f!==l))},o=()=>{t([...e,{name:"",label:"",type:"text",required:!1,placeholder:""}])};return d.jsxs("div",{className:"bb-form-build-grid",children:[d.jsxs("section",{className:"bb-form-build-editor",children:[d.jsx("h4",{className:"bb-form-build-heading",children:"Fields"}),e.length===0&&d.jsx("p",{className:"bb-field-help",children:"No fields yet. Add one below."}),d.jsx("ul",{className:"bb-form-build-list",children:e.map((l,u)=>d.jsxs("li",{className:"bb-form-build-row",children:[d.jsxs("div",{className:"bb-form-build-row-top",children:[d.jsx("input",{className:"bb-input bb-form-build-label",value:l.label,onChange:f=>r(u,{label:f.target.value}),placeholder:"Field label (e.g. Your name)"}),d.jsx("select",{className:"bb-input bb-form-build-type",value:l.type,onChange:f=>r(u,{type:f.target.value}),children:RY.map(f=>d.jsx("option",{value:f.value,children:f.label},f.value))})]}),d.jsxs("div",{className:"bb-form-build-row-bottom",children:[d.jsxs("label",{className:"bb-form-build-required",children:[d.jsx("input",{type:"checkbox",checked:l.required,onChange:f=>r(u,{required:f.target.checked})}),"Required"]}),d.jsx("button",{className:"bb-link-btn",onClick:()=>n(u,-1),disabled:u===0,"aria-label":"Move up",children:"↑"}),d.jsx("button",{className:"bb-link-btn",onClick:()=>n(u,1),disabled:u===e.length-1,"aria-label":"Move down",children:"↓"}),d.jsx("button",{className:"bb-link-btn bb-form-build-remove",onClick:()=>i(u),"aria-label":"Remove field",children:"Remove"})]}),Z2.has(l.type)&&d.jsx("textarea",{className:"bb-input bb-textarea bb-form-build-options",rows:3,placeholder:`One option per line209 …`,seoMeta:{metaTitle:"5 questions every wedding planner asks before quoting · BitBot",metaDescription:"A 2-minute framework for wedding planners to qualify enquiries faster and quote with confidence.",keywords:["wedding planner","quote","qualification","discovery questions"],focusKeyphrase:"wedding planner quote"}},GG=50,Rw="bb_drafts_seen_at",kw="bb:drafts-seen";function YG(){if(typeof window>"u")return 0;const e=window.localStorage.getItem(Rw);if(e)return Number(e);const t=Date.now();return window.localStorage.setItem(Rw,String(t)),t}function WG(){typeof window>"u"||(window.localStorage.setItem(Rw,String(Date.now())),window.dispatchEvent(new Event(kw)))}function QG(e){return window.addEventListener(kw,e),window.addEventListener("storage",e),()=>{window.removeEventListener(kw,e),window.removeEventListener("storage",e)}}function W2(){const{data:e=[]}=Q2(),t=v.useSyncExternalStore(QG,YG,()=>0);return e.filter(n=>new Date(n.createdAt).getTime()>t).length}function Q2(){var o,l,u;const t=Re().apiKey===Rb,n=xb({queryKey:["drafts"],initialPageParam:1,queryFn:async({pageParam:f})=>{if(t)return{drafts:y0,total:y0.length,page:f,pageSize:y0.length};const h=await me("GetDrafts",{page:f,pageSize:GG});if(!h.success)throw new Error(h.error);return h.data},getNextPageParam:f=>f.page*f.pageSize<f.total?f.page+1:void 0,staleTime:6e4}),r=(((o=n.data)==null?void 0:o.pages)??[]).flatMap(f=>f.drafts),i=((u=(l=n.data)==null?void 0:l.pages[0])==null?void 0:u.total)??r.length;return{data:r,total:i,isLoading:n.isLoading,isFetchingNextPage:n.isFetchingNextPage,hasNextPage:!!n.hasNextPage,fetchNextPage:()=>n.fetchNextPage()}}function VG(e){const n=Re().apiKey===Rb;return Et({queryKey:["draft",e],queryFn:async()=>{if(!e)throw new Error("No draft id");if(n)return{...Y2,id:e};const r=await me("GetDraft",{draftId:e});if(!r.success)throw new Error(r.error);return r.data},enabled:!!e,staleTime:3e4})}function XG(){const e=Ne(),{ajaxUrl:t,ajaxNonce:n}=Re();return je({mutationFn:async r=>{var u;const i=new URLSearchParams({action:"bitbot_publish_draft",nonce:n,draft_id:r.draftId}),l=await(await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i.toString()})).json();if(!l.success){const f=((u=l.data)==null?void 0:u.error)??"Save failed";throw new Error(f)}return l.data},onSuccess:(r,i)=>{e.setQueryData(["draft",i.draftId],o=>o&&{...o,wpPostId:r.post_id}),e.setQueryData(["drafts"],o=>!o||!Array.isArray(o)?o:o.map(l=>l.id===i.draftId?{...l,wpPostId:r.post_id}:l)),e.invalidateQueries({queryKey:["drafts"]}),le.success("Saved to WordPress")},onError:r=>{le.error(r instanceof Error?r.message:"Save failed")}})}function ZG(){const e=Ne(),{ajaxUrl:t,ajaxNonce:n}=Re();return je({mutationFn:async r=>{var u;const i=new URLSearchParams({action:"bitbot_delete_draft",nonce:n,draft_id:r}),l=await(await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i.toString()})).json();if(!l.success){const f=((u=l.data)==null?void 0:u.error)??"Delete failed";throw new Error(f)}},onSuccess:(r,i)=>{e.removeQueries({queryKey:["draft",i]}),e.invalidateQueries({queryKey:["drafts"]}),le.success("Draft deleted")},onError:r=>{le.error(r instanceof Error?r.message:"Delete failed")}})}const JG=".pdf,.png,.jpg,.jpeg,.gif,.webp",eY=10*1024*1024,tY={suggestions:[{topic:"How to price a destination wedding without scaring couples off",reasoning:"Couples Google price ranges before reaching out — owning this answer captures lead intent early.",searchQuery:"destination wedding pricing breakdown",difficulty:"medium"},{topic:"The 6-week timeline most planners get wrong",reasoning:"Existing posts talk about 6-month timelines but skip the 6-week sprint where vendors actually lock in.",searchQuery:"wedding planner six week timeline",difficulty:"easy"},{topic:"Pinterest moodboard → real wedding: what survives the budget cut",reasoning:"Direct continuation of the existing Pinterest post; answers the inevitable follow-up question.",searchQuery:"pinterest wedding ideas budget reality",difficulty:"easy"}],contentGaps:["No content on vendor contracts and cancellation clauses","Pricing strategy posts skip taxes and travel costs","No FAQ on rainy-day backup plans for outdoor venues"],sources:[{title:"How do you price a destination wedding in Trancoso?",subreddit:"r/weddingplanning",url:"https://reddit.com/r/weddingplanning/example1",numComments:47}]};function nY(){const e=Ne(),n=Re().apiKey===Rb;return je({mutationFn:async()=>{if(n)return await new Promise(i=>setTimeout(i,1200)),tY;const r=await me("DiscoverTopics");if(!r.success)throw new Error(r.error);return r.data},onSuccess:()=>{e.invalidateQueries({queryKey:["plan-status"]})},onError:r=>{const i=r instanceof Error?r.message:"Topic discovery failed";/Pro feature|Upgrade to/i.test(i)||le.error(i)}})}function rY(){const e=Ne(),n=Re().apiKey===Rb;return je({mutationFn:async r=>{if(n)return await new Promise(o=>setTimeout(o,2400)),Y2;if(r.sourceType==="upload"){const o=r.file;if(!o)throw new Error("Choose a file to generate from.");if(o.size>eY)throw new Error("File is larger than 10MB. Pick a smaller file.");const l=await me("GetUploadUrl",{fileName:o.name});if(!l.success)throw new Error(l.error);if(!(await fetch(l.data.uploadUrl,{method:"PUT",headers:{"Content-Type":o.type||"application/octet-stream"},body:o})).ok)throw new Error("Could not upload the file. Try again.");const f=await me("GeneratePostFromStorage",{storagePath:l.data.storagePath,fileName:o.name,instructions:r.instructions});if(!f.success)throw new Error(f.error);return f.data}const i=await me("GeneratePost",{...r});if(!i.success)throw new Error(i.error);return i.data},onSuccess:()=>{le.success("Draft generated"),e.invalidateQueries({queryKey:["drafts"]}),e.invalidateQueries({queryKey:["plan-status"]})}})}const V2=new Set(["indexed","faqs","topics","generate","drafts"]),aY="indexed";function NT(){const t=new URL(window.location.href).searchParams.get("sub");return t&&V2.has(t)?t:aY}const x0="bb:sub-change";function X2(){const[e,t]=v.useState(NT);v.useEffect(()=>{const r=()=>t(NT());return window.addEventListener("popstate",r),window.addEventListener(x0,r),()=>{window.removeEventListener("popstate",r),window.removeEventListener(x0,r)}},[]);const n=v.useCallback(r=>{if(!V2.has(r))return;const i=new URL(window.location.href);i.searchParams.get("sub")!==r&&(i.searchParams.set("sub",r),window.history.pushState({},"",i),t(r),window.dispatchEvent(new Event(x0)))},[]);return[e,n]}const TT={easy:{label:"Easy",cls:"bb-difficulty-easy"},medium:{label:"Medium",cls:"bb-difficulty-medium"},hard:{label:"Hard",cls:"bb-difficulty-hard"}};function iY({onPickTopic:e}){const t=nY(),[n,r]=v.useState(!1),[i,o]=v.useState(!1),l=t.data,u=t.isPending,f=t.error instanceof Error?t.error.message:null,h=!!f&&/^(ACCESS_PAUSED|TRIAL_EXPIRED)/.test(f),p=!!f&&/free Topic Discovery searches/i.test(f),b=!!f&&/(ASSISTANT_REQUIRED|Pro feature)/i.test(f),g=h||p||b;return d.jsxs("section",{className:"bb-topic-discovery",children:[!l&&!u&&!g&&d.jsxs("div",{className:"bb-topic-discovery-empty",children:[d.jsx("p",{className:"bb-topic-discovery-empty-lede",children:"BitBot scans your indexed pages, checks what your audience is asking, and surfaces the topics worth writing next — plus the gaps your current coverage is missing."}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:()=>t.mutate(),children:"Find topics →"}),d.jsx("p",{className:"bb-topic-discovery-empty-foot",children:"Takes about 15 seconds."}),f&&d.jsx("p",{className:"bb-topic-discovery-error",children:f})]}),p&&d.jsxs("div",{className:"bb-topic-discovery-gate",children:[d.jsxs("div",{children:[d.jsx("strong",{children:"You've used your 3 free Topic Discovery searches."}),d.jsx("p",{children:"Unlimited topic research on Assistant ($20/mo)."})]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>o(!0),children:"Upgrade to Assistant →"})]}),h&&d.jsxs("div",{className:"bb-topic-discovery-gate",children:[d.jsxs("div",{children:[d.jsx("strong",{children:"Your subscription has ended."}),d.jsx("p",{children:"Reactivate to keep using Topic Discovery."})]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>o(!0),children:"Reactivate →"})]}),b&&d.jsxs("div",{className:"bb-topic-discovery-gate",children:[d.jsxs("div",{children:[d.jsx("strong",{children:"Topic Discovery is on Assistant."}),d.jsx("p",{children:"Scans your site + live reader-trend data and ranks the topics worth writing next. Unlimited on Assistant ($20/mo)."})]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>o(!0),children:"Upgrade to Assistant →"})]}),u&&!l&&d.jsxs("div",{className:"bb-topic-discovery-empty",children:[d.jsxs("div",{className:"bb-topic-discovery-pulse","aria-hidden":!0,children:[d.jsx("span",{}),d.jsx("span",{}),d.jsx("span",{})]}),d.jsx("p",{className:"bb-topic-discovery-empty-lede",children:"Reading your indexed pages, then cross-referencing trending questions in your niche…"})]}),l&&d.jsxs("header",{className:"bb-topic-discovery-head",children:[d.jsx("p",{children:"Picked from your indexed content + live reader trends. Refresh for a different angle."}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>t.mutate(),disabled:u,children:u?"Refreshing…":"Refresh"})]}),l&&d.jsxs(d.Fragment,{children:[l.suggestions.length>0&&d.jsxs("div",{className:"bb-topic-suggestions",children:[d.jsxs("div",{className:"bb-topic-suggestions-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Suggested topics"}),l.contentGaps.length>0&&d.jsxs("button",{type:"button",className:`bb-topic-gaps-toggle ${n?"bb-topic-gaps-toggle-active":""}`,"aria-label":n?"Hide content gaps":"Show content gaps","aria-expanded":n,title:n?"Hide content gaps":"Show content gaps — areas your indexed content doesn't cover yet",onClick:()=>r(x=>!x),children:[d.jsx("span",{"aria-hidden":!0,children:"ⓘ"}),d.jsx("span",{className:"bb-topic-gaps-toggle-label",children:n?"Hide gaps":`${l.contentGaps.length} content ${l.contentGaps.length===1?"gap":"gaps"}`})]})]}),n&&l.contentGaps.length>0&&d.jsxs("div",{className:"bb-content-gaps bb-content-gaps-inline",children:[d.jsx("p",{className:"bb-content-gaps-lede",children:"Areas your indexed content doesn't cover yet — pick a suggested topic below that closes one of these."}),d.jsx("ul",{className:"bb-gap-list",children:l.contentGaps.map((x,E)=>d.jsx("li",{className:"bb-gap-item",children:x},E))})]}),d.jsx("ul",{className:"bb-topic-list",children:l.suggestions.map((x,E)=>{const S=TT[(x.difficulty||"").toLowerCase()]??TT.medium;return d.jsxs("li",{className:"bb-topic-item",children:[d.jsxs("div",{className:"bb-topic-item-body",children:[d.jsx("div",{className:"bb-topic-item-title",children:x.topic}),d.jsx("div",{className:"bb-topic-item-reason",children:x.reasoning}),d.jsxs("div",{className:"bb-topic-item-meta",children:[d.jsx("span",{className:`bb-difficulty-pill ${S.cls}`,children:S.label}),x.searchQuery&&d.jsxs("span",{className:"bb-topic-item-query",children:[d.jsx("span",{className:"bb-eyebrow",children:"research"}),d.jsx("code",{children:x.searchQuery})]})]})]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>e(x.topic),children:"Write this →"})]},E)})})]}),l.sources.length>0&&d.jsxs("details",{className:"bb-topic-sources",children:[d.jsxs("summary",{children:[d.jsxs("span",{className:"bb-eyebrow",children:["Sources (",l.sources.length,")"]}),"— Reddit threads the AI considered"]}),d.jsx("ul",{className:"bb-source-list",children:l.sources.map((x,E)=>d.jsxs("li",{children:[d.jsx("a",{href:x.url,target:"_blank",rel:"noopener noreferrer",children:x.title}),d.jsxs("span",{className:"bb-source-meta",children:[x.subreddit," · ",x.numComments," comments"]})]},E))})]})]}),d.jsx(gs,{open:i,onClose:()=>o(!1)})]})}function oY(){return Et({queryKey:["faqs"],queryFn:async()=>{const e=await me("GetFaqs");if(!e.success)throw new Error(e.error);return e.data.faqs},staleTime:30*1e3})}function sY(){const e=Ne();return je({mutationFn:async t=>{const n=await me("CreateFaq",t);if(!n.success)throw new Error(n.error);return n.data.faq},onSuccess:t=>{e.setQueryData(["faqs"],n=>n?[t,...n.filter(r=>r.id!==t.id)]:[t]),e.invalidateQueries({queryKey:["faqs"]}),le.success("FAQ added — the bot will use it on the next chat")},onError:t=>le.error(t instanceof Error?t.message:"Could not add FAQ")})}function lY(){const e=Ne();return je({mutationFn:async t=>{const n=await me("UpdateFaq",t);if(!n.success)throw new Error(n.error);return n.data.faq},onSuccess:t=>{e.setQueryData(["faqs"],n=>n&&n.map(r=>r.id===t.id?t:r)),e.invalidateQueries({queryKey:["faqs"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not update FAQ")})}function cY(){const e=Ne();return je({mutationFn:async t=>{const n=await me("DeleteFaq",{id:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:(t,n)=>{e.setQueryData(["faqs"],r=>r&&r.filter(i=>i.id!==n)),e.invalidateQueries({queryKey:["faqs"]}),le.success("FAQ removed")},onError:t=>le.error(t instanceof Error?t.message:"Could not delete FAQ")})}function uY(){const e=Ne();return je({mutationFn:async t=>{const n=await me("DeleteFaqs",{ids:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:(t,n)=>{e.setQueryData(["faqs"],r=>r&&r.filter(i=>!n.includes(i.id))),e.invalidateQueries({queryKey:["faqs"]}),le.success(`Deleted ${t.faqsDeleted} ${t.faqsDeleted===1?"FAQ":"FAQs"}`)},onError:t=>le.error(t instanceof Error?t.message:"Could not delete FAQs")})}function dY(){return je({mutationFn:async e=>{const t=await me("DraftFaqFromGap",e);if(!t.success)throw new Error(t.error);return t.data.draft},onError:e=>le.error(e instanceof Error?e.message:"Could not draft FAQ")})}function fY(){const e=Ne();return je({mutationFn:async t=>{const n=await me("DismissCoverageGap",{topic:t});if(!n.success)throw new Error(n.error)},onSuccess:()=>{e.invalidateQueries({queryKey:["overview-insights"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not discard suggestion")})}function hY(){const e=Ne();return je({mutationFn:async()=>{const t=await me("ResetDismissedCoverageGaps",{});if(!t.success)throw new Error(t.error)},onSuccess:()=>{e.invalidateQueries({queryKey:["overview-insights"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not reset suggestions")})}function PT({editing:e=null,initialQuestion:t="",initialAnswer:n="",initialSourceTopic:r=null,initialAutoGenerated:i=!1,banner:o=null,onClose:l}){const[u,f]=v.useState((e==null?void 0:e.question)??t),[h,p]=v.useState((e==null?void 0:e.answer)??n),b=sY(),g=lY();v.useEffect(()=>{f((e==null?void 0:e.question)??t)},[e==null?void 0:e.id,t]),v.useEffect(()=>{p((e==null?void 0:e.answer)??n)},[e==null?void 0:e.id,n]);const x=!!e,E=b.isPending||g.isPending,S=()=>{const A=u.trim(),j=h.trim();!A||!j||(x&&e?g.mutate({id:e.id,question:A,answer:j},{onSuccess:()=>l()}):b.mutate({question:A,answer:j,autoGenerated:i,sourceTopic:r},{onSuccess:()=>l()}))};return d.jsxs("div",{className:"bb-faq-composer",children:[o&&d.jsx("div",{className:"bb-faq-composer-hint",children:o}),d.jsxs("label",{className:"bb-faq-field",children:[d.jsx("span",{className:"bb-faq-field-label",children:"Question"}),d.jsx("input",{className:"bb-input",type:"text",value:u,onChange:A=>f(A.target.value),placeholder:"e.g. Do you ship internationally?",maxLength:250,autoFocus:!0})]}),d.jsxs("label",{className:"bb-faq-field",children:[d.jsx("span",{className:"bb-faq-field-label",children:"Answer"}),d.jsx("textarea",{className:"bb-input bb-textarea",rows:4,value:h,onChange:A=>p(A.target.value),placeholder:"2-4 sentences. The bot will use this verbatim.",maxLength:2e3})]}),d.jsxs("div",{className:"bb-faq-composer-actions",children:[d.jsxs("span",{className:"bb-faq-composer-chars",children:[h.length,"/2000"]}),d.jsxs("div",{className:"bb-faq-composer-buttons",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:l,children:x?"Cancel":"Discard"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",disabled:!u.trim()||!h.trim()||E,onClick:S,children:E?"Saving…":x?"Save changes":"Add FAQ →"})]})]})]})}const Dm=20;function mY(){const{data:e,isLoading:t}=oY(),{data:n}=WS(),r=dY(),i=fY(),o=hY(),l=cY(),u=uY(),[f,h]=v.useState(new Set),p=v.useMemo(()=>{const B=e??[],te=new Set;for(const pe of B)f.has(pe.id)&&te.add(pe.id);return te},[e,f]),b=p.size,g=b>0&&b===((e==null?void 0:e.length)??0),x=B=>{h(te=>{const pe=new Set(te);return pe.has(B)?pe.delete(B):pe.add(B),pe})},E=()=>{h(g?new Set:new Set((e??[]).map(B=>B.id)))},S=()=>h(new Set),A=async()=>{const B=Array.from(p);B.length===0||!await bi({title:`Delete ${B.length} ${B.length===1?"FAQ":"FAQs"}?`,message:`The bot will stop using ${B.length===1?"this answer":"these answers"} immediately. This cannot be undone.`,confirmLabel:`Delete ${B.length}`,danger:!0})||(await u.mutateAsync(B).catch(()=>null),S())},j=v.useRef(null),[C,O]=v.useState({mode:"closed"}),[T,_]=v.useState(!1),P=()=>O({mode:"closed"}),D=(e??[]).filter(B=>B.active).length,L=D>=Dm,z=()=>{requestAnimationFrame(()=>{var B;(B=j.current)==null||B.scrollIntoView({behavior:"smooth",block:"start"})})},F=()=>{O({mode:"new",question:"",answer:"",sourceTopic:null,autoGenerated:!1,banner:null}),z()},G=B=>{O({mode:"edit",faq:B}),z()},R=B=>{r.mutate({topic:B.topic,examples:[B.example].filter(Boolean)},{onSuccess:te=>{O({mode:"new",question:te.question,answer:te.answer,sourceTopic:B.topic,autoGenerated:!0,banner:`Draft generated from a Coverage gap — review carefully before saving. Source: ${B.topic}.`}),_(!1),z()}})};v.useEffect(()=>{const B=()=>{const pe=sessionStorage.getItem("bb-faq-from-gap");if(!pe)return;sessionStorage.removeItem("bb-faq-from-gap");let k;try{k=JSON.parse(pe)}catch{return}k.topic&&R({topic:k.topic,example:k.example})};B();const te=()=>B();return window.addEventListener("popstate",te),()=>window.removeEventListener("popstate",te)},[]);const J=v.useMemo(()=>{const B=(n==null?void 0:n.coverageGaps)??[],te=new Set((e??[]).map(pe=>(pe.sourceTopic??"").trim().toLowerCase()).filter(Boolean));return B.filter(pe=>!te.has(pe.topic.trim().toLowerCase()))},[n==null?void 0:n.coverageGaps,e]),$=(n==null?void 0:n.dismissedGapCount)??0,ne=async B=>{await bi({title:"Delete this FAQ?",message:`"${B.question.slice(0,60)}" will be removed. This cannot be undone.`,confirmLabel:"Delete",danger:!0})&&l.mutate(B.id)},K=C.mode==="edit"?`Editing FAQ${C.faq.autoGenerated&&C.faq.sourceTopic?` · originally drafted from "${C.faq.sourceTopic}"`:""}`:null,Z=C.mode==="edit"?C.faq.id:null;return d.jsxs("section",{id:"faqs",className:"bb-faq-section",children:[d.jsxs("div",{className:"bb-faq-list-block",children:[(t||((e==null?void 0:e.length)??0)>0)&&d.jsxs("div",{className:"bb-faq-list-head",children:[b>0&&!t&&d.jsxs("label",{className:"bb-faq-select-all",children:[d.jsx("input",{type:"checkbox",checked:g,onChange:E,"aria-label":g?"Deselect all FAQs":"Select all FAQs"}),d.jsx("span",{children:g?"Deselect all":"Select all"})]}),d.jsx("span",{className:"bb-faq-list-aside",children:t?"loading…":`${D} of ${Dm} active · ${(e==null?void 0:e.length)??0} total`})]}),b>0&&d.jsxs("div",{className:"bb-faq-bulk-toolbar",role:"region","aria-label":"Bulk actions",children:[d.jsxs("span",{children:[d.jsx("strong",{children:b})," selected"]}),d.jsxs("div",{className:"bb-faq-bulk-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:S,children:"Clear"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-danger bb-btn-small",onClick:A,disabled:u.isPending,children:u.isPending?"Deleting…":`Delete ${b}`})]})]}),!t&&((e==null?void 0:e.length)??0)===0?d.jsx("p",{className:"bb-faq-empty",children:"No FAQs yet. Add one below, or generate from a coverage gap."}):d.jsx("ul",{className:"bb-faq-list",children:(e??[]).map(B=>d.jsxs("li",{className:`bb-faq-row ${Z===B.id?"bb-faq-row-editing":""} ${p.has(B.id)?"bb-faq-row-selected":""}`,children:[d.jsxs("div",{className:"bb-faq-row-head",children:[d.jsx("input",{type:"checkbox",className:"bb-faq-row-check",checked:p.has(B.id),onChange:()=>x(B.id),"aria-label":`Select FAQ: ${B.question.slice(0,60)}`}),d.jsxs("div",{className:"bb-faq-row-meta",children:[B.autoGenerated&&d.jsx("span",{className:"bb-faq-tag bb-faq-tag-auto",children:"Auto"}),d.jsxs("span",{className:"bb-faq-row-time",children:["Added ",ir(B.createdAt)]}),B.sourceTopic&&d.jsxs("span",{className:"bb-faq-row-source",title:`Drafted from coverage gap: ${B.sourceTopic}`,children:["· ",B.sourceTopic]})]}),d.jsxs("div",{className:"bb-faq-row-controls",children:[d.jsx("button",{type:"button",className:"bb-faq-row-ctrl",onClick:()=>G(B),children:"Edit"}),d.jsx("button",{type:"button",className:"bb-faq-row-ctrl bb-faq-row-ctrl-danger",onClick:()=>ne(B),children:"Delete"})]})]}),d.jsx("p",{className:"bb-faq-question",children:B.question}),d.jsx("p",{className:"bb-faq-answer",children:B.answer})]},B.id))}),d.jsxs("div",{className:"bb-faq-add-row",children:[d.jsx("button",{type:"button",className:"bb-faq-pill bb-faq-pill-add",onClick:F,disabled:L,title:L?`Active FAQ limit (${Dm}) reached — edit or delete one to add a new one`:void 0,children:"+ Add FAQ"}),L&&d.jsxs("p",{className:"bb-faq-cap-help",children:["Active FAQ limit reached (",Dm,"). Edit or delete an existing FAQ — or toggle one to inactive — to add a new one."]})]})]}),(J.length>0||$>0)&&d.jsxs("div",{className:"bb-faq-pills-block",children:[d.jsxs("div",{className:"bb-faq-list-head",children:[d.jsx("span",{className:"bb-eyebrow",children:"Suggested from coverage gaps"}),d.jsxs("span",{className:"bb-faq-list-aside",children:[J.length>0?`${J.length} unanswered`:"All discarded",$>0&&d.jsx("button",{type:"button",className:"bb-faq-reset-icon",disabled:o.isPending,onClick:()=>o.mutate(),title:"Reset","aria-label":`Reset ${$} discarded suggestion${$===1?"":"s"}`,children:"↺"})]})]}),d.jsx("div",{className:"bb-faq-pills",children:J.slice(0,5).map((B,te)=>d.jsxs("span",{className:"bb-faq-pill-wrap",children:[d.jsxs("button",{type:"button",className:"bb-faq-pill bb-faq-pill-suggest",disabled:r.isPending||L,onClick:()=>R(B),title:L?"FAQ limit reached — edit or delete an existing one first":B.example,children:[B.topic,d.jsx("span",{className:"bb-faq-pill-count",children:B.count})]}),d.jsx("button",{type:"button",className:"bb-faq-pill-discard","aria-label":`Discard suggestion: ${B.topic}`,title:"Discard",disabled:i.isPending,onClick:()=>i.mutate(B.topic),children:"×"})]},te))})]}),C.mode!=="closed"&&d.jsx("div",{ref:j,children:r.isPending?d.jsx("div",{className:"bb-faq-drafting",children:"Drafting from the coverage gap — one sec…"}):C.mode==="edit"?d.jsx(PT,{editing:C.faq,banner:K,onClose:P}):d.jsx(PT,{initialQuestion:C.question,initialAnswer:C.answer,initialSourceTopic:C.sourceTopic,initialAutoGenerated:C.autoGenerated,banner:C.banner,onClose:P})}),C.mode==="closed"&&r.isPending&&d.jsx("div",{className:"bb-faq-drafting",children:"Drafting from the coverage gap — one sec…"}),d.jsx(Mf,{open:T,title:"All coverage gaps",aside:`${J.length} unanswered`,onClose:()=>_(!1),children:d.jsx("ol",{className:"bb-modal-list",children:J.map((B,te)=>d.jsxs("li",{className:"bb-modal-row",children:[d.jsx("span",{className:"bb-modal-rank",children:te+1}),d.jsxs("div",{className:"bb-modal-body-col",children:[d.jsx("span",{className:"bb-modal-row-title",children:B.topic}),d.jsxs("span",{className:"bb-modal-row-sub",children:['"',B.example,'" · ',B.count," ",B.count===1?"ask":"asks"]})]}),d.jsx("button",{type:"button",className:"bb-modal-row-action",disabled:r.isPending,onClick:()=>R(B),children:"Draft FAQ →"})]},te))})})]})}const pY="bb_devmockapikey0000000000000000",_T=[{id:"1",url:"https://example.com/",title:"Home",summary:null,enabled:!0,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()},{id:"2",url:"https://example.com/services",title:"Services",summary:null,enabled:!0,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()},{id:"3",url:"https://example.com/services/photography",title:"Photography",summary:null,enabled:!0,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()},{id:"4",url:"https://example.com/services/videography",title:"Videography",summary:null,enabled:!0,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()},{id:"5",url:"https://example.com/about",title:"About us",summary:null,enabled:!0,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()},{id:"6",url:"https://example.com/contact",title:"Contact",summary:null,enabled:!1,lastCrawledAt:new Date(Date.now()-14400*1e3).toISOString()}],Md=25;function bY(){const e=Re(),t=Ne(),n=e.apiKey===pY,[r,i]=v.useState(0),[o,l]=v.useState(""),[u,f]=v.useState(""),[h,p]=v.useState(!1);v.useEffect(()=>{const R=setTimeout(()=>{f(o),i(0)},300);return()=>clearTimeout(R)},[o]);const{data:b,isLoading:g}=Et({queryKey:["indexed-pages",r,u],queryFn:async()=>{if(n)return{pages:_T,total:_T.length};const R=await me("GetPages",{page:r+1,pageSize:Md,search:u||void 0});if(!R.success)throw new Error(R.error);return{pages:R.data.pages,total:R.data.total}},placeholderData:Su,staleTime:60*1e3}),[x,E]=v.useState(null),[S,A]=v.useState(new Set),j=(R,J)=>A($=>{const ne=new Set($);return J?ne.add(R):ne.delete(R),ne}),C=je({mutationFn:async({pageId:R,enabled:J})=>{if(n){await new Promise(ne=>setTimeout(ne,200));return}const $=await me("TogglePage",{pageId:R,enabled:J});if(!$.success)throw new Error($.error)},onSuccess:()=>t.invalidateQueries({queryKey:["indexed-pages"]}),onError:R=>le.error(R instanceof Error?R.message:"Toggle failed")}),O=je({mutationFn:async R=>{if(n){await new Promise($=>setTimeout($,200));return}const J=await me("RemovePage",{pageId:R});if(!J.success)throw new Error(J.error)},onSuccess:()=>{le.success("Page removed"),t.invalidateQueries({queryKey:["indexed-pages"]})},onError:R=>le.error(R instanceof Error?R.message:"Remove failed")}),T=je({mutationFn:async R=>{if(n)return await new Promise($=>setTimeout($,300)),{removed:R.length};const J=await me("RemovePages",{pageIds:R});if(!J.success)throw new Error(J.error);return J.data},onSuccess:R=>{le.success(`Removed ${R.removed} page${R.removed===1?"":"s"}`),A(new Set),t.invalidateQueries({queryKey:["indexed-pages"]}),t.invalidateQueries({queryKey:["sync-status"]})},onError:R=>le.error(R instanceof Error?R.message:"Bulk remove failed")}),_=async()=>{const R=Array.from(S);if(R.length===0)return;await bi({title:`Remove ${R.length} page${R.length===1?"":"s"}?`,message:`This removes ${R.length===1?"it":"them"} from the bot's knowledge and clears their embeddings. This can't be undone.`,confirmLabel:`Remove ${R.length}`,danger:!0})&&T.mutate(R)},P=je({mutationFn:async R=>{var K;if(n){await new Promise(Z=>setTimeout(Z,400));return}const J=new URLSearchParams({action:"bitbot_resync_page",nonce:e.ajaxNonce,page_url:R}),ne=await(await fetch(e.ajaxUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:J.toString()})).json();if(!ne.success)throw new Error(((K=ne.data)==null?void 0:K.error)||"Resync failed")},onSuccess:()=>{le.success("Page resynced"),t.invalidateQueries({queryKey:["indexed-pages"]}),t.invalidateQueries({queryKey:["sync-status"]})},onError:R=>le.error(R instanceof Error?R.message:"Resync failed")}),D=je({mutationFn:async R=>{if(n)return await new Promise($=>setTimeout($,600)),{fetched:R.length,embedded:R.length,skippedUnchanged:0,failed:0,errors:[]};const J=await me("IndexUrlList",{urls:R});if(!J.success)throw new Error(J.error);return J.data},onSuccess:R=>{const J=R.fetched+R.skippedUnchanged,$=R.failed>0?`Indexed ${J} URL${J===1?"":"s"}, ${R.failed} failed`:`Indexed ${J} URL${J===1?"":"s"} (${R.embedded} chunks)`;le.success($),t.invalidateQueries({queryKey:["indexed-pages"]}),t.invalidateQueries({queryKey:["sync-status"]}),p(!1)},onError:R=>le.error(R instanceof Error?R.message:"Could not index URLs")}),L=(b==null?void 0:b.pages)??[],z=(b==null?void 0:b.total)??0,F=r*Md,G=Math.max(1,Math.ceil(z/Md));return!g&&z===0&&u===""?d.jsxs(d.Fragment,{children:[d.jsx(Lr,{children:d.jsx(uu,{headline:"No pages indexed yet",body:"Run a sync to crawl your site, or paste specific URLs you want the bot to learn.",ctaLabel:"Add URLs",onCta:()=>p(!0)})}),h&&d.jsx(DT,{onCancel:()=>p(!1),onSubmit:R=>D.mutate(R),submitting:D.isPending})]}):d.jsxs(Lr,{titleAction:S.size>0?d.jsxs("div",{className:"bb-pages-actions-row bb-pages-actions-row-bulk",children:[d.jsxs("span",{className:"bb-pages-bulkbar-count",children:[S.size," selected"]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-danger bb-btn-small",onClick:_,disabled:T.isPending,children:T.isPending?"Removing…":`Delete ${S.size}`}),d.jsx("button",{type:"button",className:"bb-link-btn bb-btn-small",onClick:()=>A(new Set),children:"Clear"})]}):d.jsxs("div",{className:"bb-pages-actions-row",children:[d.jsx("input",{type:"search",className:"bb-input bb-pages-search",placeholder:"Filter by URL or title",value:o,onChange:R=>{l(R.target.value),i(0)}}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>p(!0),title:"Add specific URLs (external docs, member pages, etc.) for the bot to learn",children:"+ Add URLs"})]}),noBody:!0,children:[d.jsxs("table",{className:"bb-pages-table",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{className:"bb-pages-check",children:d.jsx("input",{type:"checkbox","aria-label":"Select all on this page",checked:L.length>0&&L.every(R=>S.has(R.id)),ref:R=>{R&&(R.indeterminate=L.some(J=>S.has(J.id))&&!L.every(J=>S.has(J.id)))},onChange:R=>{const J=R.target.checked;A($=>{const ne=new Set($);return L.forEach(K=>{J?ne.add(K.id):ne.delete(K.id)}),ne})}})}),d.jsx("th",{children:"URL"}),d.jsx("th",{children:"Last crawled"}),d.jsx("th",{children:"Enabled"}),d.jsx("th",{"aria-label":"actions"})]})}),d.jsxs("tbody",{children:[g&&d.jsx("tr",{children:d.jsx("td",{colSpan:5,className:"bb-pages-empty",children:"Loading pages…"})}),!g&&L.length===0&&d.jsx("tr",{children:d.jsxs("td",{colSpan:5,className:"bb-pages-empty",children:['No pages match "',o,'"']})}),!g&&L.map(R=>d.jsxs("tr",{className:S.has(R.id)?"bb-pages-row-selected":void 0,children:[d.jsx("td",{className:"bb-pages-check",children:d.jsx("input",{type:"checkbox","aria-label":`Select ${R.title||R.url}`,checked:S.has(R.id),onChange:J=>j(R.id,J.target.checked)})}),d.jsxs("td",{className:"bb-pages-url",children:[d.jsx("div",{className:"bb-pages-title",children:R.title||"—"}),d.jsxs("a",{className:"bb-pages-href",href:R.url,target:"_blank",rel:"noopener noreferrer",title:"Open page in a new tab",children:[d.jsx("span",{className:"bb-pages-href-text",children:R.url}),d.jsx("span",{className:"bb-pages-href-ext","aria-hidden":"true",children:"↗"})]})]}),d.jsx("td",{className:"bb-pages-time",children:R.lastCrawledAt?ir(R.lastCrawledAt):"—"}),d.jsx("td",{children:d.jsx("span",{className:`bb-pages-status ${R.enabled?"bb-pages-status-on":"bb-pages-status-off"}`,children:R.enabled?"On":"Off"})}),d.jsx("td",{className:"bb-pages-actions",children:d.jsx("button",{className:"bb-link-btn bb-pages-action-trigger",type:"button","aria-label":"Row actions",onClick:J=>{const $=J.currentTarget.getBoundingClientRect();E(ne=>(ne==null?void 0:ne.id)===R.id?null:{id:R.id,anchor:$})},children:"⋯"})})]},R.id))]})]}),z>Md&&d.jsxs("footer",{className:"bb-pages-footer",children:[d.jsxs("span",{children:["Showing ",F+1,"–",Math.min(F+Md,z)," of ",z]}),d.jsxs("div",{className:"bb-pages-pager",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>i(R=>Math.max(0,R-1)),disabled:r===0,children:"← Previous"}),d.jsxs("span",{className:"bb-pages-pageno",children:[r+1," / ",G]}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>i(R=>Math.min(G-1,R+1)),disabled:r>=G-1,children:"Next →"})]})]}),h&&d.jsx(DT,{onCancel:()=>p(!1),onSubmit:R=>D.mutate(R),submitting:D.isPending}),x&&(()=>{const R=L.find(J=>J.id===x.id);return R?d.jsx(vY,{anchor:x.anchor,page:R,onClose:()=>E(null),onResync:()=>{E(null),P.mutate(R.url)},onToggle:()=>{E(null),C.mutate({pageId:R.id,enabled:!R.enabled})},onRemove:async()=>{E(null),await bi({title:"Remove this page?",message:`"${R.title||R.url}" will be removed from the bot's knowledge and its embeddings cleared. This can't be undone.`,confirmLabel:"Remove",danger:!0})&&O.mutate(R.id)},resyncing:P.isPending,toggling:C.isPending,removing:O.isPending}):null})()]})}function vY({anchor:e,page:t,onClose:n,onResync:r,onToggle:i,onRemove:o,resyncing:l,toggling:u,removing:f}){const h=e.bottom+4,p=window.innerWidth-e.right;return Vn.createPortal(d.jsxs("div",{className:"bb-portal-scope",children:[d.jsx("div",{className:"bb-pages-action-backdrop",onClick:n}),d.jsxs("div",{className:"bb-pages-action-menu bb-pages-action-menu-portaled",role:"menu",style:{position:"fixed",top:h,right:p},children:[d.jsx("button",{type:"button",role:"menuitem",onClick:r,disabled:l,children:"Resync"}),d.jsx("button",{type:"button",role:"menuitem",onClick:i,disabled:u,children:t.enabled?"Disable":"Enable"}),d.jsx("button",{type:"button",role:"menuitem",className:"bb-pages-action-danger",onClick:o,disabled:f,children:"Remove"})]})]}),document.body)}function DT({onCancel:e,onSubmit:t,submitting:n}){const[r,i]=v.useState(""),o=r.split(/\r?\n/).map(p=>p.trim()).filter(Boolean),l=[],u=[];for(const p of o)try{const b=new URL(p);b.protocol==="http:"||b.protocol==="https:"?l.push(b.toString()):u.push(p)}catch{u.push(p)}const f=()=>{l.length!==0&&t(l)},h=d.jsx("div",{className:"bb-portal-scope bb-avatar-crop-modal-overlay",onClick:p=>{p.target===p.currentTarget&&e()},role:"dialog","aria-modal":"true","aria-label":"Add URLs to bot knowledge",children:d.jsxs("div",{className:"bb-add-urls-modal",children:[d.jsxs("header",{className:"bb-avatar-crop-head",children:[d.jsx("h3",{children:"Teach the bot specific URLs"}),d.jsx("p",{children:"One URL per line. The bot fetches each page, extracts text, and indexes it for chat answers. Useful for external docs, members-only pages, or anything the standard sync misses."})]}),d.jsx("textarea",{className:"bb-input bb-textarea",rows:6,value:r,onChange:p=>i(p.target.value),placeholder:`https://example.com/docs/getting-started 210 https://your-knowledge-base.com/article-1`,disabled:n}),d.jsxs("div",{className:"bb-add-urls-meta",children:[l.length>0&&d.jsxs("span",{className:"bb-add-urls-count",children:[l.length," URL",l.length===1?"":"s"," ready"]}),u.length>0&&d.jsxs("span",{className:"bb-add-urls-warn",children:[u.length," line",u.length===1?"":"s"," skipped (not a valid http/https URL)"]})]}),d.jsxs("footer",{className:"bb-avatar-crop-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost",onClick:e,disabled:n,children:"Cancel"}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:f,disabled:n||l.length===0,children:n?"Indexing…":`Index ${l.length||""} URL${l.length===1?"":"s"}`})]})]})});return Vn.createPortal(h,document.body)}function MT({status:e,label:t,className:n}){return d.jsxs("span",{className:`bb-status-pill bb-status-pill-${e} ${n??""}`,children:[d.jsx("span",{className:`bb-status-dot bb-status-dot-${e}`,"aria-hidden":!0}),t]})}async function gY(){var o;const{ajaxUrl:e,ajaxNonce:t}=Re(),n=new URLSearchParams({action:"bitbot_sync",nonce:t}),i=await(await fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})).json();if(!i.success){const l=((o=i.data)==null?void 0:o.error)??"Sync failed";throw new Error(l)}return i.data??{}}const yY=5e3;function xY(){const e=Ne(),{data:t}=VS(),{isExpired:n}=Hk(),[r,i]=v.useState(null),o=je({mutationFn:gY,onSuccess:u=>{const f=u.pagesSaved??u.pagesProcessed??u.pagesQueued??0;i({pages:f}),e.invalidateQueries({queryKey:["sync-status"]}),e.invalidateQueries({queryKey:["indexed-pages"]})},onError:u=>le.error(u instanceof Error?u.message:"Sync failed")});if(v.useEffect(()=>{if(!r)return;const u=setTimeout(()=>i(null),yY);return()=>clearTimeout(u)},[r]),o.isPending||(t==null?void 0:t.status)==="syncing")return d.jsx(MT,{status:"syncing",label:"Syncing now"});if(r){const u=r.pages;return d.jsx(MT,{status:"success",label:u>0?`Synced · ${u} ${u===1?"page":"pages"}`:"Synced"})}return d.jsxs("div",{className:"bb-sync-trigger",children:[(t==null?void 0:t.lastSync)&&d.jsxs("span",{className:"bb-sync-trigger-meta",title:new Date(t.lastSync).toLocaleString(),children:["Last synced ",ir(t.lastSync)]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>o.mutate(),disabled:n,title:n?"Reactivate your plan to sync content":void 0,children:"Sync now"})]})}const RT=[{key:"indexed",label:"Indexed pages"},{key:"faqs",label:"FAQs"},{key:"topics",label:"Find Topics",aside:"AI scans your site + reader trends"},{key:"generate",label:"Generate a post",aside:"Each post counts against your monthly quota"},{key:"drafts",label:"Drafts",aside:"Generated content will show here"}],wY={draft:"Draft",scheduled:"Scheduled",published:"Published",failed:"Failed"};function SY({status:e,wpPostId:t}){const n=e==="draft"&&!!t,r=n?"In WordPress":wY[e],i=n?"in-wordpress":e;return d.jsx("span",{className:`bb-draft-status bb-draft-status-${i}`,children:r})}function EY(e,t){const n=e instanceof Error?e.message:String(e??"");return/Failed to fetch URL/i.test(n)?t==="url"?"Couldn't fetch that URL. The page may block bots, time out, or be a PDF. Try a different article URL, or use From a topic.":"Couldn't load the source. Try again, or pick a different source.":/ACCESS_PAUSED|TRIAL_EXPIRED/i.test(n)?"Your subscription has ended. Reactivate to keep generating posts.":/ASSISTANT_REQUIRED|post generation is a pro feature/i.test(n)?"Post generation is on Assistant. Upgrade to keep creating.":/monthly post limit|fair-use/i.test(n)?"You've hit this month's post fair-use ceiling.":/BamlValidationError|Failed to parse LLM response|Failed to generate post from (pdf|image)/i.test(n)?t==="upload"?"Couldn't read that file. Use a PDF with selectable text (not a scan), or paste the content as a topic instead.":"Couldn't turn that source into a post. Try a different source, or use From a topic.":n||"Something went wrong. Try again in a moment."}function AY({prefillTopic:e,onPrefillConsumed:t,composerRef:n}){const[r,i]=v.useState("prompt"),[o,l]=v.useState(""),[u,f]=v.useState(""),[h,p]=v.useState(null),[b,g]=v.useState(!1),x=v.useRef(null),E=rY(),{data:S}=Ai(),A=(S==null?void 0:S.usage.postsThisMonth)??0,j=(S==null?void 0:S.limits.postsPerMonth)??0,C=(S==null?void 0:S.plan)==="free",O=!C&&j>0&&A>=j,T=(S==null?void 0:S.accessMode)==="expired";v.useEffect(()=>{e&&(i("prompt"),l(e),t==null||t())},[e,t]);const _={prompt:'A topic to write about — e.g. "5 questions every wedding planner asks before quoting"',url:"https://example.com/source-article",upload:"Drag a PDF or image here, or click to choose"}[r];return d.jsx("div",{ref:n,children:d.jsxs(Lr,{children:[d.jsx("div",{className:"bb-content-source-tabs",children:["prompt","url","upload"].map(P=>d.jsxs("button",{className:`bb-source-tab ${r===P?"bb-source-tab-active":""}`,onClick:()=>i(P),children:[d.jsx("span",{className:"bb-source-tab-title",children:P==="prompt"?"From a topic":P==="url"?"From a URL":"From an upload"}),d.jsx("span",{className:"bb-source-tab-sub",children:P==="prompt"?"AI writes from a one-line prompt":P==="url"?"Summarise + rewrite an article":"Extract from a PDF or image"})]},P))}),d.jsxs("div",{className:"bb-field",children:[d.jsx("label",{className:"bb-field-label",children:r==="prompt"?"Topic":r==="url"?"Source URL":"File"}),r==="upload"?d.jsxs("div",{className:`bb-upload-zone ${b?"bb-upload-zone-dragging":""} ${h?"bb-upload-zone-filled":""}`,role:"button",tabIndex:0,onClick:()=>{var P;return(P=x.current)==null?void 0:P.click()},onKeyDown:P=>{var D;(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),(D=x.current)==null||D.click())},onDragOver:P=>{P.preventDefault(),g(!0)},onDragLeave:P=>{P.preventDefault(),g(!1)},onDrop:P=>{var L;P.preventDefault(),g(!1);const D=(L=P.dataTransfer.files)==null?void 0:L[0];D&&p(D)},children:[d.jsx("input",{ref:x,type:"file",accept:JG,className:"bb-upload-input",onChange:P=>{var D;return p(((D=P.target.files)==null?void 0:D[0])??null)}}),h?d.jsxs("div",{className:"bb-upload-file",children:[d.jsx("span",{className:"bb-upload-file-name",children:h.name}),d.jsx("button",{type:"button",className:"bb-upload-file-remove","aria-label":"Remove file",onClick:P=>{P.stopPropagation(),p(null),x.current&&(x.current.value="")},children:"×"})]}):d.jsxs(d.Fragment,{children:[d.jsx("p",{children:_}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",children:"Choose file"})]})]}):d.jsx("input",{className:"bb-input",value:o,onChange:P=>l(P.target.value),placeholder:_})]}),d.jsxs("div",{className:"bb-field",children:[d.jsx("label",{className:"bb-field-label",children:"Tone / instructions (optional)"}),d.jsx("textarea",{className:"bb-input bb-textarea",rows:2,value:u,onChange:P=>f(P.target.value),placeholder:"Friendly, conversational, around 800 words. Always end with a CTA to book a discovery call."}),d.jsx("p",{className:"bb-field-help",children:"Each generated post automatically respects your site's brand voice from the chatbot's Bot Instructions."})]}),O&&!C&&!T&&d.jsx("div",{className:"bb-topic-discovery-gate",children:d.jsxs("div",{children:[d.jsxs("strong",{children:["You've hit this month's post fair-use ceiling (",j,")."]}),d.jsx("p",{children:"Fair-use resets on the 1st. Talk to us for higher limits."})]})}),d.jsx("div",{className:"bb-content-actions",children:d.jsx("button",{className:"bb-btn bb-btn-primary",disabled:E.isPending||C||O||T||(r==="upload"?!h:!o.trim()),onClick:()=>E.mutate({sourceType:r,sourceValue:o,instructions:u||void 0,file:h??void 0},{onSuccess:()=>{p(null),x.current&&(x.current.value="")},onError:P=>le.error(EY(P,r))}),children:E.isPending?"Generating… (~30s)":"Generate draft →"})})]})})}function jY({selectedId:e,onSelect:t,onTryTopic:n}){const{data:r,total:i,isLoading:o,hasNextPage:l,isFetchingNextPage:u,fetchNextPage:f}=Q2(),h=r??[];return d.jsxs("section",{className:"bb-drafts-list",children:[!o&&h.length>0&&h.length<i&&d.jsxs("p",{className:"bb-field-help",style:{margin:"0 0 var(--sp-8)"},children:["Showing ",d.jsx("strong",{children:h.length})," of ",i," drafts"]}),o&&d.jsx("div",{className:"bb-skeleton",style:{height:260,borderRadius:8}}),!o&&h.length===0&&d.jsx(uu,{headline:"No drafts yet",body:"Pick a suggested topic and generate your first post.",ctaLabel:"Try a topic",onCta:n}),!o&&h.map(p=>d.jsxs("button",{className:`bb-draft-row ${p.id===e?"bb-draft-row-active":""}`,onClick:()=>t(p.id),children:[d.jsx("div",{className:"bb-draft-row-title",children:mp(p.title,80)}),d.jsxs("div",{className:"bb-draft-row-meta",children:[d.jsx(SY,{status:p.status,wpPostId:p.wpPostId}),d.jsxs("span",{children:["· created ",ir(p.createdAt)]}),p.scheduledAt&&d.jsxs("span",{children:["· scheduled ",ir(p.scheduledAt)]})]})]},p.id)),l&&d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-load-more",onClick:()=>f(),disabled:u,children:u?"Loading…":`Load more (${i-h.length} remaining)`})]})}function CY({draftId:e,onDeleted:t}){const{data:n,isLoading:r}=VG(e),i=XG(),o=ZG(),l=Re();return e?r||!n?d.jsx(Lr,{eyebrow:"Draft",title:"Loading…",children:d.jsx("div",{className:"bb-skeleton",style:{height:240,borderRadius:8}})}):d.jsxs(Lr,{eyebrow:"Draft",title:n.title,children:[d.jsxs("div",{className:"bb-field",children:[d.jsx("span",{className:"bb-eyebrow",children:"SEO meta"}),d.jsxs("div",{className:"bb-seo-block",children:[d.jsxs("div",{className:"bb-seo-row",children:[d.jsx("span",{className:"bb-seo-label",children:"Meta title"}),d.jsx("span",{className:"bb-seo-value",children:n.seoMeta.metaTitle})]}),d.jsxs("div",{className:"bb-seo-row",children:[d.jsx("span",{className:"bb-seo-label",children:"Meta description"}),d.jsx("span",{className:"bb-seo-value",children:n.seoMeta.metaDescription})]}),d.jsxs("div",{className:"bb-seo-row",children:[d.jsx("span",{className:"bb-seo-label",children:"Focus keyphrase"}),d.jsx("span",{className:"bb-seo-value",children:n.seoMeta.focusKeyphrase})]}),d.jsxs("div",{className:"bb-seo-row",children:[d.jsx("span",{className:"bb-seo-label",children:"Keywords"}),d.jsx("span",{className:"bb-seo-value",children:n.seoMeta.keywords.map(u=>d.jsx("span",{className:"bb-keyword-chip",children:u},u))})]})]})]}),d.jsxs("div",{className:"bb-field",children:[d.jsx("span",{className:"bb-eyebrow",children:"Body preview"}),d.jsx("div",{className:"bb-draft-body",dangerouslySetInnerHTML:{__html:n.content}})]}),d.jsxs("div",{className:"bb-draft-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small bb-btn-danger",disabled:o.isPending,onClick:async()=>{await bi({title:"Delete this draft?",message:`"${n.title.slice(0,60)}" will be removed from BitBot. The WordPress post (if any) is untouched.`,confirmLabel:"Delete",danger:!0})&&o.mutate(e,{onSuccess:()=>t()})},children:o.isPending?"Deleting…":"Delete"}),n.wpPostId?d.jsx("a",{href:`${l.siteUrl.replace(/\/$/,"")}/wp-admin/post.php?post=${n.wpPostId}&action=edit`,target:"_blank",rel:"noopener noreferrer",className:"bb-btn bb-btn-primary bb-btn-small",children:"Edit in WordPress ↗"}):d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-btn-small",disabled:i.isPending,onClick:()=>i.mutate({draftId:e}),children:i.isPending?"Sending to WordPress…":"Edit in WordPress →"})]})]}):d.jsx(Lr,{eyebrow:"Draft",title:"Pick a post to expand",children:d.jsx("p",{className:"bb-conv-placeholder-body",children:"Each draft has full markdown body + SEO meta. You can edit, schedule for a date/time, or push directly to WordPress as a published post."})})}function OY(){const[e,t]=v.useState(null),[n,r]=v.useState(null),i=v.useRef(null),[o,l]=X2(),{data:u}=Ai(),f=W2();v.useEffect(()=>{o==="drafts"&&WG()},[o]);const h=x=>{r(x),l("generate")},p=(u==null?void 0:u.plan)??"free",b=p==="free"?RT.filter(x=>x.key!=="drafts"):RT;v.useEffect(()=>{p==="free"&&o==="drafts"&&l("generate")},[p,o,l]);const g=b.find(x=>x.key===o)??b[0];return d.jsxs(d.Fragment,{children:[d.jsx("nav",{className:"bb-subtab-strip",role:"tablist","aria-label":"Knowledgebase sub-sections",children:b.map(x=>d.jsxs("button",{role:"tab","aria-selected":o===x.key,className:`bb-subtab ${o===x.key?"bb-subtab-active":""}`,onClick:()=>l(x.key),children:[x.label,x.key==="drafts"&&f>0&&d.jsx("span",{className:"bb-tab-badge","aria-label":`${f} new drafts`,children:f})]},x.key))}),d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:g.label}),o==="indexed"&&d.jsx(xY,{}),g.aside&&o!=="indexed"&&d.jsx("span",{className:"bb-section-aside",children:g.aside})]}),o==="indexed"&&d.jsx(bY,{}),o==="faqs"&&d.jsx(mY,{}),o==="topics"&&d.jsx(iY,{onPickTopic:h}),o==="generate"&&d.jsx(AY,{prefillTopic:n,onPrefillConsumed:()=>r(null),composerRef:i}),o==="drafts"&&d.jsxs("div",{className:"bb-drafts-grid",children:[d.jsx(jY,{selectedId:e,onSelect:t,onTryTopic:()=>l("topics")}),d.jsx(CY,{draftId:e,onDeleted:()=>t(null)})]})]})}const Dl="bb_devmockapikey0000000000000000",Mm=e=>new Date(Date.now()-e*864e5).toISOString(),ea=[{id:"f-default",name:"Pre-chat form",description:"Captures visitor details before their first reply.",enabled:!0,isDefault:!0,chatGateEnabled:!1,submissionsCount:0,lastSubmissionAt:null,createdAt:Mm(60),fields:[{name:"name",label:"Full name",type:"text",required:!0,placeholder:"Your name"},{name:"email",label:"Email",type:"email",required:!0,placeholder:"you@example.com"},{name:"phone",label:"Phone",type:"phone",required:!1,placeholder:"+1 (555) 000-0000"}]},{id:"f-1",name:"Pedir Orçamento",description:"Quote request — captures event details for corporate enquiries.",enabled:!0,isDefault:!1,chatGateEnabled:!1,submissionsCount:0,lastSubmissionAt:null,createdAt:Mm(30),fields:[{name:"name",label:"Your name",type:"text",required:!0,placeholder:""},{name:"email",label:"Email",type:"email",required:!0,placeholder:""},{name:"event_type",label:"Event type",type:"select",required:!0,options:["Corporate","Wedding","Birthday","Other"]},{name:"guest_count",label:"Guest count",type:"text",required:!1,placeholder:"Approximate"},{name:"date",label:"Preferred date",type:"text",required:!1,placeholder:""},{name:"budget",label:"Budget range",type:"select",required:!1,options:["<5k BRL","5-15k BRL","15-25k BRL","25k+ BRL"]},{name:"message",label:"Anything else?",type:"textarea",required:!1,placeholder:""}]},{id:"f-2",name:"Newsletter",description:"Two-field signup for the monthly events newsletter.",enabled:!0,isDefault:!1,chatGateEnabled:!1,submissionsCount:0,lastSubmissionAt:null,createdAt:Mm(12),fields:[{name:"name",label:"First name",type:"text",required:!0},{name:"email",label:"Email",type:"email",required:!0}]},{id:"f-3",name:"Partner enquiry",description:"For other event vendors who want to refer business.",enabled:!1,isDefault:!1,chatGateEnabled:!1,submissionsCount:0,lastSubmissionAt:null,createdAt:Mm(45),fields:[{name:"name",label:"Your name",type:"text",required:!0},{name:"email",label:"Email",type:"email",required:!0},{name:"company",label:"Company",type:"text",required:!0},{name:"services",label:"Your services",type:"checkbox",required:!1,options:["Photography","Catering","Music","Decor","Venue"]},{name:"pitch",label:"Why us?",type:"textarea",required:!1}]}];function Z2(){const t=Re().apiKey===Dl;return Et({queryKey:["forms"],queryFn:async()=>{if(t)return ea;const n=await me("GetForms");if(!n.success)throw new Error(n.error);return n.data.forms},staleTime:15e3,refetchOnWindowFocus:!0})}function NY(){const e=Ne(),n=Re().apiKey===Dl;return je({mutationFn:async r=>{if(n){const o=ea.findIndex(l=>l.id===r);return o>=0&&ea.splice(o,1),{success:!0}}const i=await me("DeleteForm",{formId:r});if(!i.success)throw new Error(i.error);return i.data},onSuccess:()=>{le.success("Form deleted"),e.invalidateQueries({queryKey:["forms"]})},onError:r=>le.error(r instanceof Error?r.message:"Delete failed")})}function TY(){const e=Ne(),n=Re().apiKey===Dl;return je({mutationFn:async r=>{if(n){const o=ea.findIndex(l=>l.id===r.formId);if(o>=0)return ea[o]={...ea[o],name:r.name,fields:r.fields},ea[o];throw new Error("Form not found")}const i=await me("UpdateForm",{formId:r.formId,name:r.name,fields:r.fields});if(!i.success)throw new Error(i.error);return i.data},onSuccess:()=>{le.success("Form saved"),e.invalidateQueries({queryKey:["forms"]})},onError:r=>le.error(r instanceof Error?r.message:"Save failed")})}function PY(){const e=Ne(),t=Re(),n=t.apiKey===Dl;return je({onMutate:async({formId:r,enabled:i})=>{await e.cancelQueries({queryKey:["forms"]});const o=e.getQueryData(["forms"]);return e.setQueryData(["forms"],l=>(l??[]).map(u=>u.id===r?u.isDefault?{...u,enabled:i,chatGateEnabled:i}:{...u,enabled:i}:u)),{previous:o}},mutationFn:async({formId:r,enabled:i})=>{var p,b;if(n){const g=ea.findIndex(x=>x.id===r);return g>=0&&(ea[g]={...ea[g],enabled:i}),ea[g]}const o=e.getQueryData(["forms"]),l=((p=o==null?void 0:o.find(g=>g.id===r))==null?void 0:p.isDefault)===!0,u=me("UpdateForm",{formId:r,enabled:i}),f=l?fetch(t.ajaxUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:"bitbot_set_chat_gate",nonce:t.ajaxNonce,enabled:i?"1":"0"}).toString()}).then(()=>{}).catch(()=>{}):Promise.resolve(),[h]=await Promise.all([u,f]);if(!h.success)throw new Error(h.error);return!l&&((b=h.data)!=null&&b.isDefault)&&await fetch(t.ajaxUrl,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:"bitbot_set_chat_gate",nonce:t.ajaxNonce,enabled:i?"1":"0"}).toString()}).catch(()=>{}),h.data},onSuccess:(r,{enabled:i})=>{le.success(i?"Form enabled":"Form disabled")},onError:(r,i,o)=>{o!=null&&o.previous&&e.setQueryData(["forms"],o.previous),le.error(r instanceof Error?r.message:"Toggle failed")}})}function _Y(){const e=Ne(),n=Re().apiKey===Dl;return je({mutationFn:async r=>{if(n){const o={id:"f-"+Date.now(),name:r.name,description:r.description,fields:r.fields,enabled:!0,isDefault:!1,chatGateEnabled:!1,submissionsCount:0,lastSubmissionAt:null,createdAt:new Date().toISOString()};return ea.push(o),o}const i=await me("CreateForm",r);if(!i.success)throw new Error(i.error);return i.data},onSuccess:()=>{le.success("Form created"),e.invalidateQueries({queryKey:["forms"]})},onError:r=>le.error(r instanceof Error?r.message:"Create failed")})}function DY(){const e=Ne(),t=Re(),n=t.apiKey===Dl;return je({mutationFn:async r=>{var h;if(n){const p=ea.find(b=>b.isDefault);return p&&(p.chatGateEnabled=r),{chatGateEnabled:r,formId:(p==null?void 0:p.id)??""}}const{ajaxUrl:i,ajaxNonce:o}=t,l=new URLSearchParams({action:"bitbot_set_chat_gate",nonce:o,enabled:r?"1":"0"}),f=await(await fetch(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:l.toString()})).json();if(!f.success){const p=((h=f.data)==null?void 0:h.error)??"Toggle failed";throw new Error(p)}return f.data},onSuccess:r=>{le.success(r.chatGateEnabled?"Pre-chat form turned on":"Pre-chat form turned off"),e.invalidateQueries({queryKey:["forms"]})},onError:r=>le.error(r instanceof Error?r.message:"Toggle failed")})}function MY(){const t=Re().apiKey===Dl;return je({mutationFn:async n=>{if(t)return await new Promise(i=>setTimeout(i,1800)),{name:"AI-generated form",fields:[{name:"name",label:"Your name",type:"text",required:!0},{name:"email",label:"Email",type:"email",required:!0},{name:"message",label:"Message",type:"textarea",required:!1,placeholder:n.slice(0,80)}]};const r=await me("GenerateForm",{description:n});if(!r.success)throw new Error(r.error);return r.data},onSuccess:()=>le.success("Form generated"),onError:n=>le.error(n instanceof Error?n.message:"Generation failed")})}const RY=[{value:"text",label:"Text"},{value:"email",label:"Email"},{value:"phone",label:"Phone"},{value:"textarea",label:"Long text"},{value:"select",label:"Dropdown"},{value:"radio",label:"Single choice"},{value:"checkbox",label:"Multi-choice"}],J2=new Set(["select","radio","checkbox"]),kY="Pre-chat form",LY=[{name:"name",label:"Full name",type:"text",required:!0,placeholder:"Your name"},{name:"email",label:"Email",type:"email",required:!0,placeholder:"you@example.com"},{name:"phone",label:"Phone",type:"phone",required:!1,placeholder:"+1 (555) 000-0000"}];function IY(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,40)||"field"}function zY({open:e,form:t,onClose:n}){const[r,i]=v.useState("build"),[o,l]=v.useState(""),[u,f]=v.useState([]),h=TY(),p=Ne();if(v.useEffect(()=>{!e||!t||(l(t.name),f(t.fields.map(E=>({...E}))),i((t.unviewedCount??0)>0?"responses":"build"),p.invalidateQueries({queryKey:["forms"]}),p.invalidateQueries({queryKey:["leads"]}))},[e,t==null?void 0:t.id]),v.useEffect(()=>{!t||r!=="responses"||me("MarkFormResponsesSeen",{formId:t.id}).then(()=>{p.invalidateQueries({queryKey:["menu-badges"]}),p.invalidateQueries({queryKey:["forms"]})})},[r,t,p]),!t)return null;const b=t.name!==o||JSON.stringify(t.fields)!==JSON.stringify(u),g=document.getElementById("bitbot-admin-root")??void 0,x=()=>{if(!o.trim()){le.error("Form name cannot be empty");return}const E=u.filter(S=>S.label.trim().length>0).map(S=>{var A;return{...S,label:S.label.trim(),name:((A=S.name)==null?void 0:A.trim())||IY(S.label),options:J2.has(S.type)?S.options??[]:void 0}});if(E.length===0){le.error("A form needs at least one field");return}h.mutate({formId:t.id,name:o.trim(),fields:E},{onSuccess:()=>n()})};return d.jsx(Tb,{open:e,onOpenChange:E=>!E&&n(),children:d.jsxs(Pb,{container:g,children:[d.jsx(_b,{className:"bb-form-modal-overlay"}),d.jsxs(Db,{className:"bb-form-modal","aria-describedby":void 0,children:[d.jsxs("header",{className:"bb-form-modal-head",children:[d.jsxs("div",{className:"bb-form-modal-title-row",children:[d.jsx("input",{className:"bb-form-modal-name",value:o,onChange:E=>l(E.target.value),placeholder:"Form name",disabled:r!=="build"}),t.isDefault&&d.jsx("span",{className:"bb-form-default-badge",children:"Default"})]}),d.jsx(Mb,{className:"bb-form-modal-close","aria-label":"Close",children:"✕"})]}),d.jsx(UY,{tab:r,setTab:i,form:t}),d.jsxs("div",{className:"bb-form-modal-body",children:[r==="build"&&d.jsx(qY,{fields:u,onChange:f}),r==="embed"&&d.jsx(FY,{form:t}),r==="responses"&&d.jsx($Y,{form:t})]}),r==="build"&&d.jsxs("footer",{className:"bb-form-modal-foot",children:[d.jsx("button",{className:"bb-btn bb-btn-primary",disabled:!b||h.isPending,onClick:x,children:h.isPending?"Saving…":"Save"}),d.jsx("button",{className:"bb-btn bb-btn-ghost",onClick:n,disabled:h.isPending,children:"Cancel"}),t.isDefault&&d.jsx("button",{className:"bb-link-btn bb-form-modal-reset",type:"button",onClick:async()=>{await bi({title:"Reset the Pre-chat form?",message:"This restores the original Name + Email + Phone fields. Your unsaved changes will be replaced — click Save afterwards to persist.",confirmLabel:"Reset"})&&(l(kY),f(LY.map(S=>({...S}))))},disabled:h.isPending,children:"Reset to defaults"})]})]})]})})}function UY({tab:e,setTab:t,form:n}){const r=n.unviewedCount??0;return d.jsxs("nav",{className:"bb-form-modal-tabs",role:"tablist",children:[d.jsx("button",{role:"tab","aria-selected":e==="build",className:`bb-form-modal-tab ${e==="build"?"bb-form-modal-tab-active":""}`,onClick:()=>t("build"),children:"Build"}),d.jsx("button",{role:"tab","aria-selected":e==="embed",className:`bb-form-modal-tab ${e==="embed"?"bb-form-modal-tab-active":""}`,onClick:()=>t("embed"),children:"Embed"}),d.jsxs("button",{role:"tab","aria-selected":e==="responses",className:`bb-form-modal-tab ${e==="responses"?"bb-form-modal-tab-active":""}`,onClick:()=>t("responses"),children:["Responses",r>0&&e!=="responses"&&d.jsx("span",{className:"bb-form-modal-tab-newdot","aria-label":"new responses",title:"New responses since you last looked"})]})]})}function qY({fields:e,onChange:t}){const n=(l,u)=>{const f=e.slice(),h=l+u;h<0||h>=f.length||([f[l],f[h]]=[f[h],f[l]],t(f))},r=(l,u)=>{t(e.map((f,h)=>h===l?{...f,...u}:f))},i=l=>{t(e.filter((u,f)=>f!==l))},o=()=>{t([...e,{name:"",label:"",type:"text",required:!1,placeholder:""}])};return d.jsxs("div",{className:"bb-form-build-grid",children:[d.jsxs("section",{className:"bb-form-build-editor",children:[d.jsx("h4",{className:"bb-form-build-heading",children:"Fields"}),e.length===0&&d.jsx("p",{className:"bb-field-help",children:"No fields yet. Add one below."}),d.jsx("ul",{className:"bb-form-build-list",children:e.map((l,u)=>d.jsxs("li",{className:"bb-form-build-row",children:[d.jsxs("div",{className:"bb-form-build-row-top",children:[d.jsx("input",{className:"bb-input bb-form-build-label",value:l.label,onChange:f=>r(u,{label:f.target.value}),placeholder:"Field label (e.g. Your name)"}),d.jsx("select",{className:"bb-input bb-form-build-type",value:l.type,onChange:f=>r(u,{type:f.target.value}),children:RY.map(f=>d.jsx("option",{value:f.value,children:f.label},f.value))})]}),d.jsxs("div",{className:"bb-form-build-row-bottom",children:[d.jsxs("label",{className:"bb-form-build-required",children:[d.jsx("input",{type:"checkbox",checked:l.required,onChange:f=>r(u,{required:f.target.checked})}),"Required"]}),d.jsx("button",{className:"bb-link-btn",onClick:()=>n(u,-1),disabled:u===0,"aria-label":"Move up",children:"↑"}),d.jsx("button",{className:"bb-link-btn",onClick:()=>n(u,1),disabled:u===e.length-1,"aria-label":"Move down",children:"↓"}),d.jsx("button",{className:"bb-link-btn bb-form-build-remove",onClick:()=>i(u),"aria-label":"Remove field",children:"Remove"})]}),J2.has(l.type)&&d.jsx("textarea",{className:"bb-input bb-textarea bb-form-build-options",rows:3,placeholder:`One option per line 211 211 Morning 212 212 Afternoon 213 213 Evening`,value:(l.options??[]).join(` 214 214 `),onChange:f=>r(u,{options:f.target.value.split(` 215 `).map(h=>h.trim()).filter(Boolean)})})]},u))}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:o,children:"+ Add field"})]}),d.jsxs("aside",{className:"bb-form-build-preview",children:[d.jsx("h4",{className:"bb-form-build-heading",children:"Live preview"}),d.jsx(BY,{fields:e})]})]})}function BY({fields:e}){return e.length===0?d.jsx("p",{className:"bb-field-help",children:"Preview shows up once you add fields."}):d.jsxs("form",{className:"bb-form-preview",onSubmit:t=>t.preventDefault(),children:[e.map((t,n)=>{var r;return d.jsxs("label",{className:"bb-form-preview-row",children:[d.jsxs("span",{className:"bb-form-preview-label",children:[t.label||"(no label)",t.required&&" *"]}),t.type==="textarea"&&d.jsx("textarea",{className:"bb-input bb-textarea",rows:3,placeholder:t.placeholder,disabled:!0}),t.type==="select"&&d.jsx("select",{className:"bb-input",disabled:!0,children:d.jsx("option",{children:((r=t.options)==null?void 0:r[0])??"Choose…"})}),t.type==="radio"&&d.jsx("div",{className:"bb-form-preview-choices",children:(t.options??[]).slice(0,4).map(i=>d.jsxs("label",{children:[d.jsx("input",{type:"radio",disabled:!0})," ",i]},i))}),t.type==="checkbox"&&d.jsx("div",{className:"bb-form-preview-choices",children:(t.options??[]).slice(0,4).map(i=>d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",disabled:!0})," ",i]},i))}),(t.type==="text"||t.type==="email"||t.type==="phone")&&d.jsx("input",{className:"bb-input",type:t.type==="phone"?"tel":t.type,placeholder:t.placeholder,disabled:!0})]},n)}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-form-preview-submit",disabled:!0,children:"Submit"})]})}function FY({form:e}){const t=Re(),n=`[bitbot_form id="${e.id}"]`,r=`${t.siteUrl.replace(/\/$/,"")}/?bitbot_form_embed=${e.id}`,i=`<iframe src="${r}" width="100%" height="500" style="border:none;"></iframe>`;return d.jsxs("div",{className:"bb-form-embed",children:[d.jsxs("section",{className:"bb-form-embed-section",children:[d.jsx("h4",{className:"bb-form-embed-heading",children:"On this WordPress site"}),d.jsx("p",{className:"bb-field-help",style:{marginTop:0},children:"Paste this shortcode into any post, page, or block where you want the form."}),d.jsx( RT,{value:n,label:"shortcode"})]}),d.jsxs("section",{className:"bb-form-embed-section",children:[d.jsx("h4",{className:"bb-form-embed-heading",children:"Anywhere else on the internet"}),d.jsx("p",{className:"bb-field-help",style:{marginTop:0},children:"Drop this iframe snippet into any HTML page. Submissions land in this dashboard."}),d.jsx(RT,{value:i,label:"iframe snippet"}),d.jsx("p",{className:"bb-form-embed-note",children:d.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:"Preview the public form ↗"})})]})]})}function RT({value:e,label:t}){const[n,r]=v.useState(!1),i=()=>{var o;(o=navigator.clipboard)==null||o.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},()=>le.error("Copy failed"))};return d.jsxs("div",{className:"bb-form-codebox",children:[d.jsx("code",{className:"bb-form-codebox-code",children:e}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:i,"aria-label":`Copy ${t}`,children:n?"Copied ✓":"Copy"})]})}function $Y({form:e}){const[t,n]=v.useState(""),[r,i]=v.useState(!1),{leads:o,total:l,isLoading:u,hasNextPage:f,isFetchingNextPage:h,fetchNextPage:p}=fE({formId:e.id}),{data:b}=Ai(),g=H8(),x=o,E=(b==null?void 0:b.plan)==="free",S=!u&&E&&x.length===0&&l>0,A=v.useMemo(()=>{if(!t.trim())return x;const C=t.toLowerCase();return x.filter(O=>O.name.toLowerCase().includes(C)||O.email.toLowerCase().includes(C)||(O.message??"").toLowerCase().includes(C))},[x,t]),j=()=>{if(x.length===0)return;const C=new Set(["name","email","phone","message"]),O=e.fields.map(R=>R.name).filter(R=>!C.has(R)),P=[["date","name","email","phone","message",...O.map(R=>{var q;return((q=e.fields.find(U=>U.name===R))==null?void 0:q.label)??R})].join(",")];for(const R of x){const q=[new Date(R.createdAt).toISOString(),R.name,R.email,R.phone??"",(R.message??"").replace(/\s+/g," "),...O.map(U=>{var re;return(((re=R.customFields)==null?void 0:re[U])??"").replace(/\s+/g," ")})].map(U=>`"${String(U).replace(/"/g,'""')}"`);P.push(q.join(","))}const D=new Blob([P.join(`216 `)],{type:"text/csv"}),L=URL.createObjectURL(D),z=document.createElement("a");z.href=L,z.download=`${e.name.replace(/[^a-z0-9]+/gi,"_")}_responses.csv`,z.click(),URL.revokeObjectURL(L)};return d.jsxs("div",{className:"bb-form-responses",children:[d.jsxs("div",{className:"bb-form-responses-toolbar",children:[d.jsx("input",{type:"search",className:"bb-input",placeholder:"Search responses",value:t,onChange:C=>n(C.target.value)}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:j,disabled:x.length===0,children:"Export CSV"})]}),u&&d.jsx("div",{className:"bb-skeleton",style:{height:200,borderRadius:8}}),S&&d.jsxs("div",{className:"bb-form-responses-locked",children:[d.jsxs("strong",{children:[l," ",l===1?"response":"responses"," waiting to be unlocked"]}),d.jsx("p",{children:"Your form is capturing real visitor data. Upgrade to Assistant to see names, emails, phone, messages — plus push to your CRM and run AI research on each lead."}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:()=>i(!0),children:"Upgrade to view →"})]}),!u&&!S&&x.length===0&&d.jsx("p",{className:"bb-field-help",children:"No submissions yet. Once this form goes live, responses show up here."}),!u&&x.length>0&&d.jsxs(d.Fragment,{children:[x.length<l&&d.jsxs("p",{className:"bb-field-help",style:{marginTop:0,marginBottom:"var(--sp-8)"},children:["Showing ",d.jsx("strong",{children:x.length})," of ",l," responses"]}),d.jsx(KY,{form:e,rows:A,promote:g}),f&&d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-load-more",onClick:()=>p(),disabled:h,style:{marginTop:"var(--sp-12)"},children:h?"Loading…":`Load more (${l-x.length} remaining)`})]}),d.jsx(gs,{open:r,onClose:()=>i(!1)})]})}function KY({form:e,rows:t,promote:n}){const r=v.useMemo(()=>{const l=new Set;return e.fields.map(u=>u.name).filter(u=>l.has(u)?!1:(l.add(u),!0))},[e.fields]),i=l=>{var u;return((u=e.fields.find(f=>f.name===l))==null?void 0:u.label)??l},o=(l,u)=>{var f;switch(u){case"name":return l.name||"(no name)";case"email":return l.email;case"phone":return l.phone??"";case"message":return mp(l.message??"",80);default:{const h=(f=l.customFields)==null?void 0:f[u];return h?mp(h,80):"—"}}};return d.jsx("div",{className:"bb-form-responses-scroll",children:d.jsxs("table",{className:"bb-form-responses-table",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"When"}),r.map(l=>d.jsx("th",{children:i(l)},l)),d.jsx("th",{})]})}),d.jsx("tbody",{children:t.map(l=>d.jsxs("tr",{children:[d.jsx("td",{title:new Date(l.createdAt).toLocaleString(),children:ir(l.createdAt)}),r.map(u=>d.jsx("td",{children:o(l,u)},u)),d.jsxs("td",{className:"bb-form-responses-actions",children:[l.conversationId||l.promotedFromFormAt?d.jsx("span",{className:"bb-form-responses-leadtag",title:l.conversationId?"Captured during a chat — already in Leads":"Added to Leads",children:l.conversationId?"In Leads · chat":"In Leads"}):d.jsx("button",{type:"button",className:"bb-link-btn",onClick:()=>n.mutate(l.id),disabled:n.isPending,children:"Add to Leads"}),d.jsx("a",{className:"bb-link-btn",href:`mailto:${l.email}?subject=Re: your enquiry`,children:"Reply"})]})]},l.id))})]})})}function HY({form:e}){const t=e.unviewedCount??0;if(e.submissionsCount===0)return d.jsx("span",{className:"bb-form-row-summary",children:"No responses yet"});const n=e.submissionsCount===1?"1 response":`${e.submissionsCount} responses`;return d.jsxs("span",{className:"bb-form-row-summary",children:[n,t>0&&d.jsxs("span",{className:"bb-form-row-newpill","aria-label":`${t} unread ${t===1?"response":"responses"}`,title:`${t} response${t===1?"":"s"} you haven't opened`,children:[t," new"]})]})}function GY({form:e,onOpen:t,onDelete:n,onToggle:r}){const i=o=>l=>{l.stopPropagation(),o()};return d.jsxs("div",{className:`bb-form-row ${e.enabled?"":"bb-form-row-disabled"}`,onClick:()=>t(e),role:"button",tabIndex:0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&t(e)},children:[d.jsxs("div",{className:"bb-form-row-main",children:[d.jsxs("div",{className:"bb-form-row-title",children:[d.jsx("span",{children:e.name}),e.isDefault&&d.jsx("span",{className:"bb-form-row-badge",children:"Default"}),!e.enabled&&d.jsx("span",{className:"bb-form-row-badge bb-form-row-badge-off",children:"Off"})]}),d.jsxs("div",{className:"bb-form-row-meta",children:[d.jsx(HY,{form:e}),d.jsxs("span",{children:["· ",e.fields.length," fields"]}),d.jsxs("span",{children:["· Created ",ir(e.createdAt)]})]}),e.isDefault&&d.jsx("p",{className:"bb-form-row-chatgate-info",children:e.enabled?"Shows before the first chat reply — visitors fill it before the bot speaks.":"Turn this on to ask visitors to fill it before the bot speaks."})]}),d.jsxs("div",{className:"bb-form-row-actions",onClick:o=>o.stopPropagation(),children:[d.jsxs("label",{className:"bb-form-toggle",title:e.enabled?"Disable form":"Enable form",children:[d.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>r(e.id,o.target.checked)}),d.jsx("span",{className:"bb-form-toggle-track",children:d.jsx("span",{className:"bb-form-toggle-thumb"})})]}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:i(()=>t(e)),children:"Open →"}),!e.isDefault&&d.jsx("button",{className:"bb-link-btn bb-form-delete",onClick:i(()=>n(e)),children:"Delete"})]})]})}function YY({onCreated:e,capHit:t,capHint:n}){const[r,i]=v.useState(""),o=MY(),l=_Y(),u=()=>{l.mutate({name:"New form",description:"",fields:[{name:"name",label:"Full name",type:"text",required:!0,placeholder:"Your name"},{name:"email",label:"Email",type:"email",required:!0,placeholder:"you@example.com"}]},{onSuccess:h=>e(h)})},f=async()=>{try{const h=await o.mutateAsync(r);l.mutate({name:h.name,description:r,fields:h.fields},{onSuccess:p=>e(p)})}catch{}};return d.jsxs(Lr,{eyebrow:"Create a form",title:"Describe it, or start blank",children:[d.jsx("textarea",{className:"bb-input bb-textarea",rows:3,value:r,onChange:h=>i(h.target.value),placeholder:'e.g. "Wedding venue tour booking — date, guest count, preferred time."',disabled:t}),d.jsx("p",{className:"bb-field-help",children:"AI picks the right field types and marks required fields. Or skip the description and start with a blank Name + Email form."}),d.jsxs("div",{className:"bb-content-actions",style:{gap:"var(--sp-8)"},children:[d.jsx("button",{className:"bb-btn bb-btn-primary",disabled:t||o.isPending||l.isPending||!r.trim(),onClick:f,title:t?n??void 0:void 0,children:o.isPending?"Generating…":l.isPending?"Creating…":"Generate with AI →"}),d.jsx("button",{className:"bb-btn bb-btn-ghost",disabled:t||o.isPending||l.isPending,onClick:u,title:t?n??void 0:void 0,children:l.isPending?"Creating…":"Start blank"})]}),t&&n&&d.jsx("p",{className:"bb-field-help",style:{marginTop:"var(--sp-8)",color:"var(--ink-500)"},children:n})]})}function WY(){const{data:e,isLoading:t}= X2(),n=NY(),r=PY(),i=DY(),{data:o}=Ai(),[l,u]=v.useState(null),f=(e??[]).find(x=>x.id===l)??null;v.useEffect(()=>{if(!e||i.isPending)return;const x=e.find(E=>E.isDefault);x&&x.enabled!==x.chatGateEnabled&&i.mutate(x.enabled)},[e]);const h=(e??[]).length,p=(o==null?void 0:o.limits.maxForms)??0,b=p>0&&h>=p,g=b?`You're at ${p} form${p===1?"":"s"}. Delete one or upgrade for unlimited forms.`:null;return d.jsxs(d.Fragment,{children:[d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:"Your forms"}),d.jsxs("span",{className:"bb-section-aside",children:[(e??[]).length," total · ",(e??[]).filter(x=>x.enabled).length," active"]})]}),d.jsxs("div",{className:"bb-forms-grid",children:[d.jsxs("div",{className:"bb-forms-main",children:[t&&d.jsx("div",{className:"bb-skeleton",style:{height:320,borderRadius:12}}),!t&&(e??[]).length===0&&d.jsx(uu,{headline:"No forms yet",body:"Create a form on the right. AI builds it from a one-line description, or start with a blank Name + Email form.",ctaLabel:"Create a form",onCta:()=>{}}),!t&&(e??[]).map(x=>d.jsx(GY,{form:x,onOpen:E=>u(E.id),onDelete:async E=>{await bi({title:`Delete "${E.name}"?`,message:E.submissionsCount>0?`The form stops accepting submissions and is removed from your site. Its ${E.submissionsCount} ${E.submissionsCount===1?"response goes":"responses go"} too. Export ${E.submissionsCount===1?"it":"them"} or add to Leads first to keep ${E.submissionsCount===1?"it":"them"}.`:"The form stops accepting submissions and is removed from your site. This cannot be undone.",confirmLabel:"Delete form",danger:!0})&&n.mutate(E.id)},onToggle:(E,S)=>r.mutate({formId:E,enabled:S})},x.id))]}),d.jsx("aside",{className:"bb-forms-aside",children:d.jsx(YY,{onCreated:x=>u(x.id),capHit:b,capHint:g})})]}),d.jsx(zY,{open:l!==null,form:f,onClose:()=>u(null)})]})}function J2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=J2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=J2(e))&&(r&&(r+=" "),r+=t);return r}var QY=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function xE(e){if(typeof e!="string")return!1;var t=QY;return t.includes(e)}var VY=["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"],XY=new Set(VY);function eL(e){return typeof e!="string"?!1:XY.has(e)}function tL(e){return typeof e=="string"&&e.startsWith("data-")}function yr(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(eL(n)||tL(n))&&(t[n]=e[n]);return t}function wl(e){if(e==null)return null;if(v.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return yr(t)}return typeof e=="object"&&!Array.isArray(e)?yr(e):null}function or(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(eL(n)||tL(n)||xE(n))&&(t[n]=e[n]);return t}function ZY(e){return e==null?null:v.isValidElement(e)?or(e.props):typeof e=="object"&&!Array.isArray(e)?or(e):null}var JY=["children","width","height","viewBox","className","style","title","desc"];function Lw(){return Lw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lw.apply(null,arguments)}function eW(e,t){if(e==null)return{};var n,r,i=tW(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function tW(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var wE=v.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:o,className:l,style:u,title:f,desc:h}=e,p=eW(e,JY),b=o||{width:r,height:i,x:0,y:0},g=rt("recharts-surface",l);return v.createElement("svg",Lw({},or(p),{className:g,width:r,height:i,style:u,viewBox:"".concat(b.x," ").concat(b.y," ").concat(b.width," ").concat(b.height),ref:t}),v.createElement("title",null,f),v.createElement("desc",null,h),n)}),nW=["children","className"];function Iw(){return Iw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iw.apply(null,arguments)}function rW(e,t){if(e==null)return{};var n,r,i=aW(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function aW(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ft=v.forwardRef((e,t)=>{var{children:n,className:r}=e,i=rW(e,nW),o=rt("recharts-layer",r);return v.createElement("g",Iw({className:o},or(i),{ref:t}),n)}),nL=v.createContext(null),iW=()=>v.useContext(nL);function Ct(e){return function(){return e}}const rL=Math.cos,Sp=Math.sin,Ka=Math.sqrt,Ep=Math.PI,kb=2*Ep,zw=Math.PI,Uw=2*zw,Zs=1e-6,oW=Uw-Zs;function aL(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function sW(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return aL;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class lW{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?aL:sW(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+l}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let l=this._x1,u=this._y1,f=r-t,h=i-n,p=l-t,b=u-n,g=p*p+b*b;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Zs)if(!(Math.abs(b*f-h*p)>Zs)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-l,E=i-u,S=f*f+h*h,A=x*x+E*E,j=Math.sqrt(S),C=Math.sqrt(g),O=o*Math.tan((zw-Math.acos((S+g-A)/(2*j*C)))/2),T=O/C,_=O/j;Math.abs(T-1)>Zs&&this._append`L${t+T*p},${n+T*b}`,this._append`A${o},${o},0,0,${+(b*x>p*E)},${this._x1=t+_*f},${this._y1=n+_*h}`}}arc(t,n,r,i,o,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(i),f=r*Math.sin(i),h=t+u,p=n+f,b=1^l,g=l?i-o:o-i;this._x1===null?this._append`M${h},${p}`:(Math.abs(this._x1-h)>Zs||Math.abs(this._y1-p)>Zs)&&this._append`L${h},${p}`,r&&(g<0&&(g=g%Uw+Uw),g>oW?this._append`A${r},${r},0,1,${b},${t-u},${n-f}A${r},${r},0,1,${b},${this._x1=h},${this._y1=p}`:g>Zs&&this._append`A${r},${r},0,${+(g>=zw)},${b},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function SE(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new lW(t)}function EE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function iL(e){this._context=e}iL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Lb(e){return new iL(e)}function oL(e){return e[0]}function sL(e){return e[1]}function lL(e,t){var n=Ct(!0),r=null,i=Lb,o=null,l=SE(u);e=typeof e=="function"?e:e===void 0?oL:Ct(e),t=typeof t=="function"?t:t===void 0?sL:Ct(t);function u(f){var h,p=(f=EE(f)).length,b,g=!1,x;for(r==null&&(o=i(x=l())),h=0;h<=p;++h)!(h<p&&n(b=f[h],h,f))===g&&((g=!g)?o.lineStart():o.lineEnd()),g&&o.point(+e(b,h,f),+t(b,h,f));if(x)return o=null,x+""||null}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ct(+f),u):e},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ct(+f),u):t},u.defined=function(f){return arguments.length?(n=typeof f=="function"?f:Ct(!!f),u):n},u.curve=function(f){return arguments.length?(i=f,r!=null&&(o=i(r)),u):i},u.context=function(f){return arguments.length?(f==null?r=o=null:o=i(r=f),u):r},u}function Rm(e,t,n){var r=null,i=Ct(!0),o=null,l=Lb,u=null,f=SE(h);e=typeof e=="function"?e:e===void 0?oL:Ct(+e),t=typeof t=="function"?t:Ct(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?sL:Ct(+n);function h(b){var g,x,E,S=(b=EE(b)).length,A,j=!1,C,O=new Array(S),T=new Array(S);for(o==null&&(u=l(C=f())),g=0;g<=S;++g){if(!(g<S&&i(A=b[g],g,b))===j)if(j=!j)x=g,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),E=g-1;E>=x;--E)u.point(O[E],T[E]);u.lineEnd(),u.areaEnd()}j&&(O[g]=+e(A,g,b),T[g]=+t(A,g,b),u.point(r?+r(A,g,b):O[g],n?+n(A,g,b):T[g]))}if(C)return u=null,C+""||null}function p(){return lL().defined(i).curve(l).context(o)}return h.x=function(b){return arguments.length?(e=typeof b=="function"?b:Ct(+b),r=null,h):e},h.x0=function(b){return arguments.length?(e=typeof b=="function"?b:Ct(+b),h):e},h.x1=function(b){return arguments.length?(r=b==null?null:typeof b=="function"?b:Ct(+b),h):r},h.y=function(b){return arguments.length?(t=typeof b=="function"?b:Ct(+b),n=null,h):t},h.y0=function(b){return arguments.length?(t=typeof b=="function"?b:Ct(+b),h):t},h.y1=function(b){return arguments.length?(n=b==null?null:typeof b=="function"?b:Ct(+b),h):n},h.lineX0=h.lineY0=function(){return p().x(e).y(t)},h.lineY1=function(){return p().x(e).y(n)},h.lineX1=function(){return p().x(r).y(t)},h.defined=function(b){return arguments.length?(i=typeof b=="function"?b:Ct(!!b),h):i},h.curve=function(b){return arguments.length?(l=b,o!=null&&(u=l(o)),h):l},h.context=function(b){return arguments.length?(b==null?o=u=null:u=l(o=b),h):o},h}class cL{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function cW(e){return new cL(e,!0)}function uW(e){return new cL(e,!1)}const AE={draw(e,t){const n=Ka(t/Ep);e.moveTo(n,0),e.arc(0,0,n,0,kb)}},dW={draw(e,t){const n=Ka(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},uL=Ka(1/3),fW=uL*2,hW={draw(e,t){const n=Ka(t/fW),r=n*uL;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},mW={draw(e,t){const n=Ka(t),r=-n/2;e.rect(r,r,n,n)}},pW=.8908130915292852,dL=Sp(Ep/10)/Sp(7*Ep/10),bW=Sp(kb/10)*dL,vW=-rL(kb/10)*dL,gW={draw(e,t){const n=Ka(t*pW),r=bW*n,i=vW*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const l=kb*o/5,u=rL(l),f=Sp(l);e.lineTo(f*n,-u*n),e.lineTo(u*r-f*i,f*r+u*i)}e.closePath()}},w0=Ka(3),yW={draw(e,t){const n=-Ka(t/(w0*3));e.moveTo(0,n*2),e.lineTo(-w0*n,-n),e.lineTo(w0*n,-n),e.closePath()}},ma=-.5,pa=Ka(3)/2,qw=1/Ka(12),xW=(qw/2+1)*3,wW={draw(e,t){const n=Ka(t/xW),r=n/2,i=n*qw,o=r,l=n*qw+n,u=-o,f=l;e.moveTo(r,i),e.lineTo(o,l),e.lineTo(u,f),e.lineTo(ma*r-pa*i,pa*r+ma*i),e.lineTo(ma*o-pa*l,pa*o+ma*l),e.lineTo(ma*u-pa*f,pa*u+ma*f),e.lineTo(ma*r+pa*i,ma*i-pa*r),e.lineTo(ma*o+pa*l,ma*l-pa*o),e.lineTo(ma*u+pa*f,ma*f-pa*u),e.closePath()}};function SW(e,t){let n=null,r=SE(i);e=typeof e=="function"?e:Ct(e||AE),t=typeof t=="function"?t:Ct(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:Ct(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:Ct(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Ap(){}function jp(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function fL(e){this._context=e}fL.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:jp(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:jp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function EW(e){return new fL(e)}function hL(e){this._context=e}hL.prototype={areaStart:Ap,areaEnd:Ap,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:jp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AW(e){return new hL(e)}function mL(e){this._context=e}mL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:jp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jW(e){return new mL(e)}function pL(e){this._context=e}pL.prototype={areaStart:Ap,areaEnd:Ap,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function CW(e){return new pL(e)}function kT(e){return e<0?-1:1}function LT(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),u=(o*i+l*r)/(r+i);return(kT(o)+kT(l))*Math.min(Math.abs(o),Math.abs(l),.5*Math.abs(u))||0}function IT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function S0(e,t,n){var r=e._x0,i=e._y0,o=e._x1,l=e._y1,u=(o-r)/3;e._context.bezierCurveTo(r+u,i+u*t,o-u,l-u*n,o,l)}function Cp(e){this._context=e}Cp.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:S0(this,this._t0,IT(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,S0(this,IT(this,n=LT(this,e,t)),n);break;default:S0(this,this._t0,n=LT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function bL(e){this._context=new vL(e)}(bL.prototype=Object.create(Cp.prototype)).point=function(e,t){Cp.prototype.point.call(this,t,e)};function vL(e){this._context=e}vL.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function OW(e){return new Cp(e)}function NW(e){return new bL(e)}function gL(e){this._context=e}gL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=zT(e),i=zT(t),o=0,l=1;l<n;++o,++l)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function zT(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),l=new Array(n);for(i[0]=0,o[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function TW(e){return new gL(e)}function Ib(e,t){this._context=e,this._t=t}Ib.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function PW(e){return new Ib(e,.5)}function _W(e){return new Ib(e,0)}function DW(e){return new Ib(e,1)}function Sl(e,t){if((l=e.length)>1)for(var n=1,r,i,o=e[t[0]],l,u=o.length;n<l;++n)for(i=o,o=e[t[n]],r=0;r<u;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Bw(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function MW(e,t){return e[t]}function RW(e){const t=[];return t.key=e,t}function kW(){var e=Ct([]),t=Bw,n=Sl,r=MW;function i(o){var l=Array.from(e.apply(this,arguments),RW),u,f=l.length,h=-1,p;for(const b of o)for(u=0,++h;u<f;++u)(l[u][h]=[0,+r(b,l[u].key,h,o)]).data=b;for(u=0,p=EE(t(l));u<f;++u)l[p[u]].index=u;return n(l,p),l}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:Ct(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:Ct(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Bw:typeof o=="function"?o:Ct(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Sl,i):n},i}function LW(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,l;i<o;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}Sl(e,t)}}function IW(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var l=0,u=0;l<i;++l)u+=e[l][n][1]||0;r[n][1]+=r[n][0]=-u/2}Sl(e,t)}}function zW(e,t){if(!(!((l=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,l;r<o;++r){for(var u=0,f=0,h=0;u<l;++u){for(var p=e[t[u]],b=p[r][1]||0,g=p[r-1][1]||0,x=(b-g)/2,E=0;E<u;++E){var S=e[t[E]],A=S[r][1]||0,j=S[r-1][1]||0;x+=A-j}f+=b,h+=x*b}i[r-1][1]+=i[r-1][0]=n,f&&(n-=h/f)}i[r-1][1]+=i[r-1][0]=n,Sl(e,t)}}var E0={},A0={},UT;function UW(){if(UT)return A0;UT=1;function e(t){return t==="__proto__"}return A0.isUnsafeProperty=e,A0}var j0={},qT;function yL(){if(qT)return j0;qT=1;function e(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}return j0.isDeepKey=e,j0}var C0={},BT;function jE(){if(BT)return C0;BT=1;function e(t){var n;return typeof t=="string"||typeof t=="symbol"?t:Object.is((n=t==null?void 0:t.valueOf)==null?void 0:n.call(t),-0)?"-0":String(t)}return C0.toKey=e,C0}var O0={},N0={},FT;function qW(){if(FT)return N0;FT=1;function e(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(e).join(",");const n=String(t);return n==="0"&&Object.is(Number(t),-0)?"-0":n}return N0.toString=e,N0}var $T;function CE(){if($T)return O0;$T=1;const e=jE(),t=qW();function n(r){if(Array.isArray(r))return r.map(e.toKey);if(typeof r=="symbol")return[r];r=t.toString(r);const i=[],o=r.length;if(o===0)return i;let l=0,u="",f="",h=!1;for(r.charCodeAt(0)===46&&(i.push(""),l++);l<o;){const p=r[l];f?p==="\\"&&l+1<o?(l++,u+=r[l]):p===f?f="":u+=p:h?p==='"'||p==="'"?f=p:p==="]"?(h=!1,i.push(u),u=""):u+=p:p==="["?(h=!0,u&&(i.push(u),u="")):p==="."?u&&(i.push(u),u=""):u+=p,l++}return u&&i.push(u),i}return O0.toPath=n,O0}var KT;function OE(){if(KT)return E0;KT=1;const e=UW(),t=yL(),n=jE(),r=CE();function i(l,u,f){if(l==null)return f;switch(typeof u){case"string":{if(e.isUnsafeProperty(u))return f;const h=l[u];return h===void 0?t.isDeepKey(u)?i(l,r.toPath(u),f):f:h}case"number":case"symbol":{typeof u=="number"&&(u=n.toKey(u));const h=l[u];return h===void 0?f:h}default:{if(Array.isArray(u))return o(l,u,f);if(Object.is(u==null?void 0:u.valueOf(),-0)?u="-0":u=String(u),e.isUnsafeProperty(u))return f;const h=l[u];return h===void 0?f:h}}}function o(l,u,f){if(u.length===0)return f;let h=l;for(let p=0;p<u.length;p++){if(h==null||e.isUnsafeProperty(u[p]))return f;h=h[u[p]]}return h===void 0?f:h}return E0.get=i,E0}var T0,HT;function BW(){return HT||(HT=1,T0=OE().get),T0}var FW=BW();const El=Ei(FW);var $W=4;function ms(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$W,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Xt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,o,l)=>{var u=n[l-1];return typeof u=="string"?i+u+o:u!==void 0?i+ms(u)+o:i+o},"")}var kn=e=>e===0?0:e>0?1:-1,Ba=e=>typeof e=="number"&&e!=+e,Al=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ye=e=>(typeof e=="number"||e instanceof Number)&&!Ba(e),vi=e=>ye(e)||typeof e=="string",KW=0,cf=e=>{var t=++KW;return"".concat(e||"").concat(t)},ar=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ye(t)&&typeof t!="string")return r;var o;if(Al(t)){if(n==null)return r;var l=t.indexOf("%");o=n*parseFloat(t.slice(0,l))/100}else o=+t;return Ba(o)&&(o=r),i&&n!=null&&o>n&&(o=n),o},xL=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function dt(e,t,n){return ye(e)&&ye(t)?ms(e+n*(t-e)):t}function wL(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):El(r,t))===n)}var Mt=e=>e===null||typeof e>"u",Uf=e=>Mt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Rr(e){return e!=null}function Es(){}var HW=["type","size","sizeType"];function Fw(){return Fw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fw.apply(null,arguments)}function GT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function YT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GT(Object(n),!0).forEach(function(r){GW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GW(e,t,n){return(t=YW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YW(e){var t=WW(e,"string");return typeof t=="symbol"?t:t+""}function WW(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QW(e,t){if(e==null)return{};var n,r,i=VW(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function VW(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var SL={symbolCircle:AE,symbolCross:dW,symbolDiamond:hW,symbolSquare:mW,symbolStar:gW,symbolTriangle:yW,symbolWye:wW},XW=Math.PI/180,ZW=e=>{var t="symbol".concat(Uf(e));return SL[t]||AE},JW=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*XW;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},e9=(e,t)=>{SL["symbol".concat(Uf(e))]=t},NE=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=QW(e,HW),o=YT(YT({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var u=()=>{var g=ZW(l),x=SW().type(g).size(JW(n,r,l)),E=x();if(E!==null)return E},{className:f,cx:h,cy:p}=o,b=or(o);return ye(h)&&ye(p)&&ye(n)?v.createElement("path",Fw({},b,{className:rt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:u()})):null};NE.registerSymbol=e9;var EL=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,TE=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(v.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{xE(i)&&typeof n[i]=="function"&&(r[i]=(o=>n[i](n,o)))}),r},t9=(e,t,n)=>r=>(e(t,n,r),null),qf=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var o=e[i];xE(i)&&typeof o=="function"&&(r||(r={}),r[i]=t9(o,t,n))}),r};function WT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function n9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WT(Object(n),!0).forEach(function(r){r9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r9(e,t,n){return(t=a9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a9(e){var t=i9(e,"string");return typeof t=="symbol"?t:t+""}function i9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function on(e,t){var n=n9({},e),r=t,i=Object.keys(t),o=i.reduce((l,u)=>(l[u]===void 0&&r[u]!==void 0&&(l[u]=r[u]),l),n);return o}function Op(){return Op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Op.apply(null,arguments)}function QT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function AL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QT(Object(n),!0).forEach(function(r){o9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o9(e,t,n){return(t=s9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s9(e){var t=l9(e,"string");return typeof t=="symbol"?t:t+""}function l9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var va=32,c9={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function u9(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function d9(e){var{data:t,iconType:n,inactiveColor:r}=e,i=va/2,o=va/6,l=va/3,u=t.inactive?r:t.color,f=n??t.type;if(f==="none")return null;if(f==="plainline")return v.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:u9(t.payload),x1:0,y1:i,x2:va,y2:i,className:"recharts-legend-icon"});if(f==="line")return v.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(i,"h").concat(l,`215 `).map(h=>h.trim()).filter(Boolean)})})]},u))}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:o,children:"+ Add field"})]}),d.jsxs("aside",{className:"bb-form-build-preview",children:[d.jsx("h4",{className:"bb-form-build-heading",children:"Live preview"}),d.jsx(BY,{fields:e})]})]})}function BY({fields:e}){return e.length===0?d.jsx("p",{className:"bb-field-help",children:"Preview shows up once you add fields."}):d.jsxs("form",{className:"bb-form-preview",onSubmit:t=>t.preventDefault(),children:[e.map((t,n)=>{var r;return d.jsxs("label",{className:"bb-form-preview-row",children:[d.jsxs("span",{className:"bb-form-preview-label",children:[t.label||"(no label)",t.required&&" *"]}),t.type==="textarea"&&d.jsx("textarea",{className:"bb-input bb-textarea",rows:3,placeholder:t.placeholder,disabled:!0}),t.type==="select"&&d.jsx("select",{className:"bb-input",disabled:!0,children:d.jsx("option",{children:((r=t.options)==null?void 0:r[0])??"Choose…"})}),t.type==="radio"&&d.jsx("div",{className:"bb-form-preview-choices",children:(t.options??[]).slice(0,4).map(i=>d.jsxs("label",{children:[d.jsx("input",{type:"radio",disabled:!0})," ",i]},i))}),t.type==="checkbox"&&d.jsx("div",{className:"bb-form-preview-choices",children:(t.options??[]).slice(0,4).map(i=>d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",disabled:!0})," ",i]},i))}),(t.type==="text"||t.type==="email"||t.type==="phone")&&d.jsx("input",{className:"bb-input",type:t.type==="phone"?"tel":t.type,placeholder:t.placeholder,disabled:!0})]},n)}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-form-preview-submit",disabled:!0,children:"Submit"})]})}function FY({form:e}){const t=Re(),n=`[bitbot_form id="${e.id}"]`,r=`${t.siteUrl.replace(/\/$/,"")}/?bitbot_form_embed=${e.id}`,i=`<iframe src="${r}" width="100%" height="500" style="border:none;"></iframe>`;return d.jsxs("div",{className:"bb-form-embed",children:[d.jsxs("section",{className:"bb-form-embed-section",children:[d.jsx("h4",{className:"bb-form-embed-heading",children:"On this WordPress site"}),d.jsx("p",{className:"bb-field-help",style:{marginTop:0},children:"Paste this shortcode into any post, page, or block where you want the form."}),d.jsx(kT,{value:n,label:"shortcode"})]}),d.jsxs("section",{className:"bb-form-embed-section",children:[d.jsx("h4",{className:"bb-form-embed-heading",children:"Anywhere else on the internet"}),d.jsx("p",{className:"bb-field-help",style:{marginTop:0},children:"Drop this iframe snippet into any HTML page. Submissions land in this dashboard."}),d.jsx(kT,{value:i,label:"iframe snippet"}),d.jsx("p",{className:"bb-form-embed-note",children:d.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:"Preview the public form ↗"})})]})]})}function kT({value:e,label:t}){const[n,r]=v.useState(!1),i=()=>{var o;(o=navigator.clipboard)==null||o.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),2e3)},()=>le.error("Copy failed"))};return d.jsxs("div",{className:"bb-form-codebox",children:[d.jsx("code",{className:"bb-form-codebox-code",children:e}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:i,"aria-label":`Copy ${t}`,children:n?"Copied ✓":"Copy"})]})}function $Y({form:e}){const[t,n]=v.useState(""),[r,i]=v.useState(!1),{leads:o,total:l,isLoading:u,hasNextPage:f,isFetchingNextPage:h,fetchNextPage:p}=fE({formId:e.id}),{data:b}=Ai(),g=G8(),x=o,E=(b==null?void 0:b.plan)==="free",S=!u&&E&&x.length===0&&l>0,A=v.useMemo(()=>{if(!t.trim())return x;const C=t.toLowerCase();return x.filter(O=>O.name.toLowerCase().includes(C)||O.email.toLowerCase().includes(C)||(O.message??"").toLowerCase().includes(C))},[x,t]),j=()=>{if(x.length===0)return;const C=new Set(["name","email","phone","message"]),O=e.fields.map(F=>F.name).filter(F=>!C.has(F)),P=[["date","name","email","phone","message",...O.map(F=>{var G;return((G=e.fields.find(R=>R.name===F))==null?void 0:G.label)??F})].join(",")];for(const F of x){const G=[new Date(F.createdAt).toISOString(),F.name,F.email,F.phone??"",(F.message??"").replace(/\s+/g," "),...O.map(R=>{var J;return(((J=F.customFields)==null?void 0:J[R])??"").replace(/\s+/g," ")})].map(R=>`"${String(R).replace(/"/g,'""')}"`);P.push(G.join(","))}const D=new Blob([P.join(` 216 `)],{type:"text/csv"}),L=URL.createObjectURL(D),z=document.createElement("a");z.href=L,z.download=`${e.name.replace(/[^a-z0-9]+/gi,"_")}_responses.csv`,z.click(),URL.revokeObjectURL(L)};return d.jsxs("div",{className:"bb-form-responses",children:[d.jsxs("div",{className:"bb-form-responses-toolbar",children:[d.jsx("input",{type:"search",className:"bb-input",placeholder:"Search responses",value:t,onChange:C=>n(C.target.value)}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:j,disabled:x.length===0,children:"Export CSV"})]}),u&&d.jsx("div",{className:"bb-skeleton",style:{height:200,borderRadius:8}}),S&&d.jsxs("div",{className:"bb-form-responses-locked",children:[d.jsxs("strong",{children:[l," ",l===1?"response":"responses"," waiting to be unlocked"]}),d.jsx("p",{children:"Your form is capturing real visitor data. Upgrade to Assistant to see names, emails, phone, messages — plus push to your CRM and run AI research on each lead."}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:()=>i(!0),children:"Upgrade to view →"})]}),!u&&!S&&x.length===0&&d.jsx("p",{className:"bb-field-help",children:"No submissions yet. Once this form goes live, responses show up here."}),!u&&x.length>0&&d.jsxs(d.Fragment,{children:[x.length<l&&d.jsxs("p",{className:"bb-field-help",style:{marginTop:0,marginBottom:"var(--sp-8)"},children:["Showing ",d.jsx("strong",{children:x.length})," of ",l," responses"]}),d.jsx(KY,{form:e,rows:A,promote:g}),f&&d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-load-more",onClick:()=>p(),disabled:h,style:{marginTop:"var(--sp-12)"},children:h?"Loading…":`Load more (${l-x.length} remaining)`})]}),d.jsx(gs,{open:r,onClose:()=>i(!1)})]})}function KY({form:e,rows:t,promote:n}){const r=v.useMemo(()=>{const l=new Set;return e.fields.map(u=>u.name).filter(u=>l.has(u)?!1:(l.add(u),!0))},[e.fields]),i=l=>{var u;return((u=e.fields.find(f=>f.name===l))==null?void 0:u.label)??l},o=(l,u)=>{var f;switch(u){case"name":return l.name||"(no name)";case"email":return l.email;case"phone":return l.phone??"";case"message":return mp(l.message??"",80);default:{const h=(f=l.customFields)==null?void 0:f[u];return h?mp(h,80):"—"}}};return d.jsx("div",{className:"bb-form-responses-scroll",children:d.jsxs("table",{className:"bb-form-responses-table",children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"When"}),r.map(l=>d.jsx("th",{children:i(l)},l)),d.jsx("th",{})]})}),d.jsx("tbody",{children:t.map(l=>d.jsxs("tr",{children:[d.jsx("td",{title:new Date(l.createdAt).toLocaleString(),children:ir(l.createdAt)}),r.map(u=>d.jsx("td",{children:o(l,u)},u)),d.jsxs("td",{className:"bb-form-responses-actions",children:[l.conversationId||l.promotedFromFormAt?d.jsx("span",{className:"bb-form-responses-leadtag",title:l.conversationId?"Captured during a chat — already in Leads":"Added to Leads",children:l.conversationId?"In Leads · chat":"In Leads"}):d.jsx("button",{type:"button",className:"bb-link-btn",onClick:()=>n.mutate(l.id),disabled:n.isPending,children:"Add to Leads"}),d.jsx("a",{className:"bb-link-btn",href:`mailto:${l.email}?subject=Re: your enquiry`,children:"Reply"})]})]},l.id))})]})})}function HY({form:e}){const t=e.unviewedCount??0;if(e.submissionsCount===0)return d.jsx("span",{className:"bb-form-row-summary",children:"No responses yet"});const n=e.submissionsCount===1?"1 response":`${e.submissionsCount} responses`;return d.jsxs("span",{className:"bb-form-row-summary",children:[n,t>0&&d.jsxs("span",{className:"bb-form-row-newpill","aria-label":`${t} unread ${t===1?"response":"responses"}`,title:`${t} response${t===1?"":"s"} you haven't opened`,children:[t," new"]})]})}function GY({form:e,onOpen:t,onDelete:n,onToggle:r}){const i=o=>l=>{l.stopPropagation(),o()};return d.jsxs("div",{className:`bb-form-row ${e.enabled?"":"bb-form-row-disabled"}`,onClick:()=>t(e),role:"button",tabIndex:0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&t(e)},children:[d.jsxs("div",{className:"bb-form-row-main",children:[d.jsxs("div",{className:"bb-form-row-title",children:[d.jsx("span",{children:e.name}),e.isDefault&&d.jsx("span",{className:"bb-form-row-badge",children:"Default"}),!e.enabled&&d.jsx("span",{className:"bb-form-row-badge bb-form-row-badge-off",children:"Off"})]}),d.jsxs("div",{className:"bb-form-row-meta",children:[d.jsx(HY,{form:e}),d.jsxs("span",{children:["· ",e.fields.length," fields"]}),d.jsxs("span",{children:["· Created ",ir(e.createdAt)]})]}),e.isDefault&&d.jsx("p",{className:"bb-form-row-chatgate-info",children:e.enabled?"Shows before the first chat reply — visitors fill it before the bot speaks.":"Turn this on to ask visitors to fill it before the bot speaks."})]}),d.jsxs("div",{className:"bb-form-row-actions",onClick:o=>o.stopPropagation(),children:[d.jsxs("label",{className:"bb-form-toggle",title:e.enabled?"Disable form":"Enable form",children:[d.jsx("input",{type:"checkbox",checked:e.enabled,onChange:o=>r(e.id,o.target.checked)}),d.jsx("span",{className:"bb-form-toggle-track",children:d.jsx("span",{className:"bb-form-toggle-thumb"})})]}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:i(()=>t(e)),children:"Open →"}),!e.isDefault&&d.jsx("button",{className:"bb-link-btn bb-form-delete",onClick:i(()=>n(e)),children:"Delete"})]})]})}function YY({onCreated:e,capHit:t,capHint:n}){const[r,i]=v.useState(""),o=MY(),l=_Y(),u=()=>{l.mutate({name:"New form",description:"",fields:[{name:"name",label:"Full name",type:"text",required:!0,placeholder:"Your name"},{name:"email",label:"Email",type:"email",required:!0,placeholder:"you@example.com"}]},{onSuccess:h=>e(h)})},f=async()=>{try{const h=await o.mutateAsync(r);l.mutate({name:h.name,description:r,fields:h.fields},{onSuccess:p=>e(p)})}catch{}};return d.jsxs(Lr,{eyebrow:"Create a form",title:"Describe it, or start blank",children:[d.jsx("textarea",{className:"bb-input bb-textarea",rows:3,value:r,onChange:h=>i(h.target.value),placeholder:'e.g. "Wedding venue tour booking — date, guest count, preferred time."',disabled:t}),d.jsx("p",{className:"bb-field-help",children:"AI picks the right field types and marks required fields. Or skip the description and start with a blank Name + Email form."}),d.jsxs("div",{className:"bb-content-actions",style:{gap:"var(--sp-8)"},children:[d.jsx("button",{className:"bb-btn bb-btn-primary",disabled:t||o.isPending||l.isPending||!r.trim(),onClick:f,title:t?n??void 0:void 0,children:o.isPending?"Generating…":l.isPending?"Creating…":"Generate with AI →"}),d.jsx("button",{className:"bb-btn bb-btn-ghost",disabled:t||o.isPending||l.isPending,onClick:u,title:t?n??void 0:void 0,children:l.isPending?"Creating…":"Start blank"})]}),t&&n&&d.jsx("p",{className:"bb-field-help",style:{marginTop:"var(--sp-8)",color:"var(--ink-500)"},children:n})]})}function WY(){const{data:e,isLoading:t}=Z2(),n=NY(),r=PY(),i=DY(),{data:o}=Ai(),[l,u]=v.useState(null),f=(e??[]).find(x=>x.id===l)??null;v.useEffect(()=>{if(!e||i.isPending)return;const x=e.find(E=>E.isDefault);x&&x.enabled!==x.chatGateEnabled&&i.mutate(x.enabled)},[e]);const h=(e??[]).length,p=(o==null?void 0:o.limits.maxForms)??0,b=p>0&&h>=p,g=b?`You're at ${p} form${p===1?"":"s"}. Delete one or upgrade for unlimited forms.`:null;return d.jsxs(d.Fragment,{children:[d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:"Your forms"}),d.jsxs("span",{className:"bb-section-aside",children:[(e??[]).length," total · ",(e??[]).filter(x=>x.enabled).length," active"]})]}),d.jsxs("div",{className:"bb-forms-grid",children:[d.jsxs("div",{className:"bb-forms-main",children:[t&&d.jsx("div",{className:"bb-skeleton",style:{height:320,borderRadius:12}}),!t&&(e??[]).length===0&&d.jsx(uu,{headline:"No forms yet",body:"Create a form on the right. AI builds it from a one-line description, or start with a blank Name + Email form.",ctaLabel:"Create a form",onCta:()=>{}}),!t&&(e??[]).map(x=>d.jsx(GY,{form:x,onOpen:E=>u(E.id),onDelete:async E=>{await bi({title:`Delete "${E.name}"?`,message:E.submissionsCount>0?`The form stops accepting submissions and is removed from your site. Its ${E.submissionsCount} ${E.submissionsCount===1?"response goes":"responses go"} too. Export ${E.submissionsCount===1?"it":"them"} or add to Leads first to keep ${E.submissionsCount===1?"it":"them"}.`:"The form stops accepting submissions and is removed from your site. This cannot be undone.",confirmLabel:"Delete form",danger:!0})&&n.mutate(E.id)},onToggle:(E,S)=>r.mutate({formId:E,enabled:S})},x.id))]}),d.jsx("aside",{className:"bb-forms-aside",children:d.jsx(YY,{onCreated:x=>u(x.id),capHit:b,capHint:g})})]}),d.jsx(zY,{open:l!==null,form:f,onClose:()=>u(null)})]})}function eL(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=eL(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=eL(e))&&(r&&(r+=" "),r+=t);return r}var QY=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function xE(e){if(typeof e!="string")return!1;var t=QY;return t.includes(e)}var VY=["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"],XY=new Set(VY);function tL(e){return typeof e!="string"?!1:XY.has(e)}function nL(e){return typeof e=="string"&&e.startsWith("data-")}function yr(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(tL(n)||nL(n))&&(t[n]=e[n]);return t}function wl(e){if(e==null)return null;if(v.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return yr(t)}return typeof e=="object"&&!Array.isArray(e)?yr(e):null}function or(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(tL(n)||nL(n)||xE(n))&&(t[n]=e[n]);return t}function ZY(e){return e==null?null:v.isValidElement(e)?or(e.props):typeof e=="object"&&!Array.isArray(e)?or(e):null}var JY=["children","width","height","viewBox","className","style","title","desc"];function Lw(){return Lw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lw.apply(null,arguments)}function eW(e,t){if(e==null)return{};var n,r,i=tW(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function tW(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var wE=v.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:o,className:l,style:u,title:f,desc:h}=e,p=eW(e,JY),b=o||{width:r,height:i,x:0,y:0},g=rt("recharts-surface",l);return v.createElement("svg",Lw({},or(p),{className:g,width:r,height:i,style:u,viewBox:"".concat(b.x," ").concat(b.y," ").concat(b.width," ").concat(b.height),ref:t}),v.createElement("title",null,f),v.createElement("desc",null,h),n)}),nW=["children","className"];function Iw(){return Iw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Iw.apply(null,arguments)}function rW(e,t){if(e==null)return{};var n,r,i=aW(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function aW(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ft=v.forwardRef((e,t)=>{var{children:n,className:r}=e,i=rW(e,nW),o=rt("recharts-layer",r);return v.createElement("g",Iw({className:o},or(i),{ref:t}),n)}),rL=v.createContext(null),iW=()=>v.useContext(rL);function Ct(e){return function(){return e}}const aL=Math.cos,Sp=Math.sin,Ka=Math.sqrt,Ep=Math.PI,kb=2*Ep,zw=Math.PI,Uw=2*zw,Zs=1e-6,oW=Uw-Zs;function iL(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function sW(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return iL;const n=10**t;return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class lW{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?iL:sW(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+l}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let l=this._x1,u=this._y1,f=r-t,h=i-n,p=l-t,b=u-n,g=p*p+b*b;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Zs)if(!(Math.abs(b*f-h*p)>Zs)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-l,E=i-u,S=f*f+h*h,A=x*x+E*E,j=Math.sqrt(S),C=Math.sqrt(g),O=o*Math.tan((zw-Math.acos((S+g-A)/(2*j*C)))/2),T=O/C,_=O/j;Math.abs(T-1)>Zs&&this._append`L${t+T*p},${n+T*b}`,this._append`A${o},${o},0,0,${+(b*x>p*E)},${this._x1=t+_*f},${this._y1=n+_*h}`}}arc(t,n,r,i,o,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(i),f=r*Math.sin(i),h=t+u,p=n+f,b=1^l,g=l?i-o:o-i;this._x1===null?this._append`M${h},${p}`:(Math.abs(this._x1-h)>Zs||Math.abs(this._y1-p)>Zs)&&this._append`L${h},${p}`,r&&(g<0&&(g=g%Uw+Uw),g>oW?this._append`A${r},${r},0,1,${b},${t-u},${n-f}A${r},${r},0,1,${b},${this._x1=h},${this._y1=p}`:g>Zs&&this._append`A${r},${r},0,${+(g>=zw)},${b},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function SE(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new lW(t)}function EE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oL(e){this._context=e}oL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Lb(e){return new oL(e)}function sL(e){return e[0]}function lL(e){return e[1]}function cL(e,t){var n=Ct(!0),r=null,i=Lb,o=null,l=SE(u);e=typeof e=="function"?e:e===void 0?sL:Ct(e),t=typeof t=="function"?t:t===void 0?lL:Ct(t);function u(f){var h,p=(f=EE(f)).length,b,g=!1,x;for(r==null&&(o=i(x=l())),h=0;h<=p;++h)!(h<p&&n(b=f[h],h,f))===g&&((g=!g)?o.lineStart():o.lineEnd()),g&&o.point(+e(b,h,f),+t(b,h,f));if(x)return o=null,x+""||null}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ct(+f),u):e},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ct(+f),u):t},u.defined=function(f){return arguments.length?(n=typeof f=="function"?f:Ct(!!f),u):n},u.curve=function(f){return arguments.length?(i=f,r!=null&&(o=i(r)),u):i},u.context=function(f){return arguments.length?(f==null?r=o=null:o=i(r=f),u):r},u}function Rm(e,t,n){var r=null,i=Ct(!0),o=null,l=Lb,u=null,f=SE(h);e=typeof e=="function"?e:e===void 0?sL:Ct(+e),t=typeof t=="function"?t:Ct(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?lL:Ct(+n);function h(b){var g,x,E,S=(b=EE(b)).length,A,j=!1,C,O=new Array(S),T=new Array(S);for(o==null&&(u=l(C=f())),g=0;g<=S;++g){if(!(g<S&&i(A=b[g],g,b))===j)if(j=!j)x=g,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),E=g-1;E>=x;--E)u.point(O[E],T[E]);u.lineEnd(),u.areaEnd()}j&&(O[g]=+e(A,g,b),T[g]=+t(A,g,b),u.point(r?+r(A,g,b):O[g],n?+n(A,g,b):T[g]))}if(C)return u=null,C+""||null}function p(){return cL().defined(i).curve(l).context(o)}return h.x=function(b){return arguments.length?(e=typeof b=="function"?b:Ct(+b),r=null,h):e},h.x0=function(b){return arguments.length?(e=typeof b=="function"?b:Ct(+b),h):e},h.x1=function(b){return arguments.length?(r=b==null?null:typeof b=="function"?b:Ct(+b),h):r},h.y=function(b){return arguments.length?(t=typeof b=="function"?b:Ct(+b),n=null,h):t},h.y0=function(b){return arguments.length?(t=typeof b=="function"?b:Ct(+b),h):t},h.y1=function(b){return arguments.length?(n=b==null?null:typeof b=="function"?b:Ct(+b),h):n},h.lineX0=h.lineY0=function(){return p().x(e).y(t)},h.lineY1=function(){return p().x(e).y(n)},h.lineX1=function(){return p().x(r).y(t)},h.defined=function(b){return arguments.length?(i=typeof b=="function"?b:Ct(!!b),h):i},h.curve=function(b){return arguments.length?(l=b,o!=null&&(u=l(o)),h):l},h.context=function(b){return arguments.length?(b==null?o=u=null:u=l(o=b),h):o},h}class uL{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function cW(e){return new uL(e,!0)}function uW(e){return new uL(e,!1)}const AE={draw(e,t){const n=Ka(t/Ep);e.moveTo(n,0),e.arc(0,0,n,0,kb)}},dW={draw(e,t){const n=Ka(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},dL=Ka(1/3),fW=dL*2,hW={draw(e,t){const n=Ka(t/fW),r=n*dL;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},mW={draw(e,t){const n=Ka(t),r=-n/2;e.rect(r,r,n,n)}},pW=.8908130915292852,fL=Sp(Ep/10)/Sp(7*Ep/10),bW=Sp(kb/10)*fL,vW=-aL(kb/10)*fL,gW={draw(e,t){const n=Ka(t*pW),r=bW*n,i=vW*n;e.moveTo(0,-n),e.lineTo(r,i);for(let o=1;o<5;++o){const l=kb*o/5,u=aL(l),f=Sp(l);e.lineTo(f*n,-u*n),e.lineTo(u*r-f*i,f*r+u*i)}e.closePath()}},w0=Ka(3),yW={draw(e,t){const n=-Ka(t/(w0*3));e.moveTo(0,n*2),e.lineTo(-w0*n,-n),e.lineTo(w0*n,-n),e.closePath()}},ma=-.5,pa=Ka(3)/2,qw=1/Ka(12),xW=(qw/2+1)*3,wW={draw(e,t){const n=Ka(t/xW),r=n/2,i=n*qw,o=r,l=n*qw+n,u=-o,f=l;e.moveTo(r,i),e.lineTo(o,l),e.lineTo(u,f),e.lineTo(ma*r-pa*i,pa*r+ma*i),e.lineTo(ma*o-pa*l,pa*o+ma*l),e.lineTo(ma*u-pa*f,pa*u+ma*f),e.lineTo(ma*r+pa*i,ma*i-pa*r),e.lineTo(ma*o+pa*l,ma*l-pa*o),e.lineTo(ma*u+pa*f,ma*f-pa*u),e.closePath()}};function SW(e,t){let n=null,r=SE(i);e=typeof e=="function"?e:Ct(e||AE),t=typeof t=="function"?t:Ct(t===void 0?64:+t);function i(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:Ct(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:Ct(+o),i):t},i.context=function(o){return arguments.length?(n=o??null,i):n},i}function Ap(){}function jp(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function hL(e){this._context=e}hL.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:jp(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:jp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function EW(e){return new hL(e)}function mL(e){this._context=e}mL.prototype={areaStart:Ap,areaEnd:Ap,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:jp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AW(e){return new mL(e)}function pL(e){this._context=e}pL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:jp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jW(e){return new pL(e)}function bL(e){this._context=e}bL.prototype={areaStart:Ap,areaEnd:Ap,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function CW(e){return new bL(e)}function LT(e){return e<0?-1:1}function IT(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),u=(o*i+l*r)/(r+i);return(LT(o)+LT(l))*Math.min(Math.abs(o),Math.abs(l),.5*Math.abs(u))||0}function zT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function S0(e,t,n){var r=e._x0,i=e._y0,o=e._x1,l=e._y1,u=(o-r)/3;e._context.bezierCurveTo(r+u,i+u*t,o-u,l-u*n,o,l)}function Cp(e){this._context=e}Cp.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:S0(this,this._t0,zT(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,S0(this,zT(this,n=IT(this,e,t)),n);break;default:S0(this,this._t0,n=IT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function vL(e){this._context=new gL(e)}(vL.prototype=Object.create(Cp.prototype)).point=function(e,t){Cp.prototype.point.call(this,t,e)};function gL(e){this._context=e}gL.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function OW(e){return new Cp(e)}function NW(e){return new vL(e)}function yL(e){this._context=e}yL.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=UT(e),i=UT(t),o=0,l=1;l<n;++o,++l)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[l],t[l]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function UT(e){var t,n=e.length-1,r,i=new Array(n),o=new Array(n),l=new Array(n);for(i[0]=0,o[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,o[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,o[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/o[t-1],o[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/o[n-1],t=n-2;t>=0;--t)i[t]=(l[t]-i[t+1])/o[t];for(o[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function TW(e){return new yL(e)}function Ib(e,t){this._context=e,this._t=t}Ib.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function PW(e){return new Ib(e,.5)}function _W(e){return new Ib(e,0)}function DW(e){return new Ib(e,1)}function Sl(e,t){if((l=e.length)>1)for(var n=1,r,i,o=e[t[0]],l,u=o.length;n<l;++n)for(i=o,o=e[t[n]],r=0;r<u;++r)o[r][1]+=o[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Bw(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function MW(e,t){return e[t]}function RW(e){const t=[];return t.key=e,t}function kW(){var e=Ct([]),t=Bw,n=Sl,r=MW;function i(o){var l=Array.from(e.apply(this,arguments),RW),u,f=l.length,h=-1,p;for(const b of o)for(u=0,++h;u<f;++u)(l[u][h]=[0,+r(b,l[u].key,h,o)]).data=b;for(u=0,p=EE(t(l));u<f;++u)l[p[u]].index=u;return n(l,p),l}return i.keys=function(o){return arguments.length?(e=typeof o=="function"?o:Ct(Array.from(o)),i):e},i.value=function(o){return arguments.length?(r=typeof o=="function"?o:Ct(+o),i):r},i.order=function(o){return arguments.length?(t=o==null?Bw:typeof o=="function"?o:Ct(Array.from(o)),i):t},i.offset=function(o){return arguments.length?(n=o??Sl,i):n},i}function LW(e,t){if((r=e.length)>0){for(var n,r,i=0,o=e[0].length,l;i<o;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}Sl(e,t)}}function IW(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,o=r.length;n<o;++n){for(var l=0,u=0;l<i;++l)u+=e[l][n][1]||0;r[n][1]+=r[n][0]=-u/2}Sl(e,t)}}function zW(e,t){if(!(!((l=e.length)>0)||!((o=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,o,l;r<o;++r){for(var u=0,f=0,h=0;u<l;++u){for(var p=e[t[u]],b=p[r][1]||0,g=p[r-1][1]||0,x=(b-g)/2,E=0;E<u;++E){var S=e[t[E]],A=S[r][1]||0,j=S[r-1][1]||0;x+=A-j}f+=b,h+=x*b}i[r-1][1]+=i[r-1][0]=n,f&&(n-=h/f)}i[r-1][1]+=i[r-1][0]=n,Sl(e,t)}}var E0={},A0={},qT;function UW(){if(qT)return A0;qT=1;function e(t){return t==="__proto__"}return A0.isUnsafeProperty=e,A0}var j0={},BT;function xL(){if(BT)return j0;BT=1;function e(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}return j0.isDeepKey=e,j0}var C0={},FT;function jE(){if(FT)return C0;FT=1;function e(t){var n;return typeof t=="string"||typeof t=="symbol"?t:Object.is((n=t==null?void 0:t.valueOf)==null?void 0:n.call(t),-0)?"-0":String(t)}return C0.toKey=e,C0}var O0={},N0={},$T;function qW(){if($T)return N0;$T=1;function e(t){if(t==null)return"";if(typeof t=="string")return t;if(Array.isArray(t))return t.map(e).join(",");const n=String(t);return n==="0"&&Object.is(Number(t),-0)?"-0":n}return N0.toString=e,N0}var KT;function CE(){if(KT)return O0;KT=1;const e=jE(),t=qW();function n(r){if(Array.isArray(r))return r.map(e.toKey);if(typeof r=="symbol")return[r];r=t.toString(r);const i=[],o=r.length;if(o===0)return i;let l=0,u="",f="",h=!1;for(r.charCodeAt(0)===46&&(i.push(""),l++);l<o;){const p=r[l];f?p==="\\"&&l+1<o?(l++,u+=r[l]):p===f?f="":u+=p:h?p==='"'||p==="'"?f=p:p==="]"?(h=!1,i.push(u),u=""):u+=p:p==="["?(h=!0,u&&(i.push(u),u="")):p==="."?u&&(i.push(u),u=""):u+=p,l++}return u&&i.push(u),i}return O0.toPath=n,O0}var HT;function OE(){if(HT)return E0;HT=1;const e=UW(),t=xL(),n=jE(),r=CE();function i(l,u,f){if(l==null)return f;switch(typeof u){case"string":{if(e.isUnsafeProperty(u))return f;const h=l[u];return h===void 0?t.isDeepKey(u)?i(l,r.toPath(u),f):f:h}case"number":case"symbol":{typeof u=="number"&&(u=n.toKey(u));const h=l[u];return h===void 0?f:h}default:{if(Array.isArray(u))return o(l,u,f);if(Object.is(u==null?void 0:u.valueOf(),-0)?u="-0":u=String(u),e.isUnsafeProperty(u))return f;const h=l[u];return h===void 0?f:h}}}function o(l,u,f){if(u.length===0)return f;let h=l;for(let p=0;p<u.length;p++){if(h==null||e.isUnsafeProperty(u[p]))return f;h=h[u[p]]}return h===void 0?f:h}return E0.get=i,E0}var T0,GT;function BW(){return GT||(GT=1,T0=OE().get),T0}var FW=BW();const El=Ei(FW);var $W=4;function ms(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$W,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Xt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,o,l)=>{var u=n[l-1];return typeof u=="string"?i+u+o:u!==void 0?i+ms(u)+o:i+o},"")}var kn=e=>e===0?0:e>0?1:-1,Ba=e=>typeof e=="number"&&e!=+e,Al=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ye=e=>(typeof e=="number"||e instanceof Number)&&!Ba(e),vi=e=>ye(e)||typeof e=="string",KW=0,uf=e=>{var t=++KW;return"".concat(e||"").concat(t)},ar=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ye(t)&&typeof t!="string")return r;var o;if(Al(t)){if(n==null)return r;var l=t.indexOf("%");o=n*parseFloat(t.slice(0,l))/100}else o=+t;return Ba(o)&&(o=r),i&&n!=null&&o>n&&(o=n),o},wL=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function dt(e,t,n){return ye(e)&&ye(t)?ms(e+n*(t-e)):t}function SL(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):El(r,t))===n)}var Mt=e=>e===null||typeof e>"u",Uf=e=>Mt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Rr(e){return e!=null}function Es(){}var HW=["type","size","sizeType"];function Fw(){return Fw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fw.apply(null,arguments)}function YT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YT(Object(n),!0).forEach(function(r){GW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GW(e,t,n){return(t=YW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YW(e){var t=WW(e,"string");return typeof t=="symbol"?t:t+""}function WW(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QW(e,t){if(e==null)return{};var n,r,i=VW(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function VW(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var EL={symbolCircle:AE,symbolCross:dW,symbolDiamond:hW,symbolSquare:mW,symbolStar:gW,symbolTriangle:yW,symbolWye:wW},XW=Math.PI/180,ZW=e=>{var t="symbol".concat(Uf(e));return EL[t]||AE},JW=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*XW;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},e9=(e,t)=>{EL["symbol".concat(Uf(e))]=t},NE=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=QW(e,HW),o=WT(WT({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var u=()=>{var g=ZW(l),x=SW().type(g).size(JW(n,r,l)),E=x();if(E!==null)return E},{className:f,cx:h,cy:p}=o,b=or(o);return ye(h)&&ye(p)&&ye(n)?v.createElement("path",Fw({},b,{className:rt("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:u()})):null};NE.registerSymbol=e9;var AL=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,TE=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(v.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{xE(i)&&typeof n[i]=="function"&&(r[i]=(o=>n[i](n,o)))}),r},t9=(e,t,n)=>r=>(e(t,n,r),null),qf=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var o=e[i];xE(i)&&typeof o=="function"&&(r||(r={}),r[i]=t9(o,t,n))}),r};function QT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function n9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QT(Object(n),!0).forEach(function(r){r9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r9(e,t,n){return(t=a9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a9(e){var t=i9(e,"string");return typeof t=="symbol"?t:t+""}function i9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function on(e,t){var n=n9({},e),r=t,i=Object.keys(t),o=i.reduce((l,u)=>(l[u]===void 0&&r[u]!==void 0&&(l[u]=r[u]),l),n);return o}function Op(){return Op=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Op.apply(null,arguments)}function VT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VT(Object(n),!0).forEach(function(r){o9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o9(e,t,n){return(t=s9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s9(e){var t=l9(e,"string");return typeof t=="symbol"?t:t+""}function l9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var va=32,c9={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function u9(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function d9(e){var{data:t,iconType:n,inactiveColor:r}=e,i=va/2,o=va/6,l=va/3,u=t.inactive?r:t.color,f=n??t.type;if(f==="none")return null;if(f==="plainline")return v.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:u9(t.payload),x1:0,y1:i,x2:va,y2:i,className:"recharts-legend-icon"});if(f==="line")return v.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(i,"h").concat(l,` 217 217 A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(i,` 218 218 H`).concat(va,"M").concat(2*l,",").concat(i,` 219 A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(f==="rect")return v.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(va/8,"h").concat(va,"v").concat(va*3/4,"h").concat(-va,"z"),className:"recharts-legend-icon"});if(v.isValidElement(t.legendIcon)){var h= AL({},t);return delete h.legendIcon,v.cloneElement(t.legendIcon,h)}return v.createElement(NE,{fill:u,cx:i,cy:i,size:va,sizeType:"diameter",type:f})}function f9(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:o,iconType:l,labelStyle:u}=e,f={x:0,y:0,width:va,height:va},h={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((b,g)=>{var x=b.formatter||i,E=rt({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:b.inactive});if(b.type==="none")return null;var S=typeof u=="object"?AL({},u):{};S.color=b.inactive?o:S.color||b.color;var A=x?x(b.value,b,g):b.value;return v.createElement("li",Op({className:E,style:h,key:"legend-item-".concat(g)},qf(e,b,g)),v.createElement(wE,{width:n,height:n,viewBox:f,style:p,"aria-label":"".concat(b.value," legend icon")},v.createElement(d9,{data:b,iconType:l,inactiveColor:o})),v.createElement("span",{className:"recharts-legend-item-text",style:S},A))})}var h9=e=>{var t=on(e,c9),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var o={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return v.createElement("ul",{className:"recharts-default-legend",style:o},v.createElement(f9,Op({},t,{payload:n})))},P0={},_0={},VT;function m9(){if(VT)return _0;VT=1;function e(t,n){const r=new Map;for(let i=0;i<t.length;i++){const o=t[i],l=n(o,i,t);r.has(l)||r.set(l,o)}return Array.from(r.values())}return _0.uniqBy=e,_0}var D0={},XT;function p9(){if(XT)return D0;XT=1;function e(t,n){return function(...r){return t.apply(this,r.slice(0,n))}}return D0.ary=e,D0}var M0={},ZT;function jL(){if(ZT)return M0;ZT=1;function e(t){return t}return M0.identity=e,M0}var R0={},k0={},JT;function b9(){if(JT)return k0;JT=1;const e=OE();function t(n){return function(r){return e.get(r,n)}}return k0.property=t,k0}var L0={},I0={},Md={},z0={},eP;function CL(){if(eP)return z0;eP=1;function e(t){return t==null||typeof t!="object"&&typeof t!="function"}return z0.isPrimitive=e,z0}var U0={},tP;function v9(){if(tP)return U0;tP=1;function e(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}return U0.isTypedArray=e,U0}var q0={},nP;function g9(){if(nP)return q0;nP=1;function e(t){return Object.getOwnPropertySymbols(t).filter(n=>Object.prototype.propertyIsEnumerable.call(t,n))}return q0.getSymbols=e,q0}var B0={},rP;function PE(){if(rP)return B0;rP=1;function e(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}return B0.getTag=e,B0}var gt={},aP;function OL(){if(aP)return gt;aP=1;const e="[object RegExp]",t="[object String]",n="[object Number]",r="[object Boolean]",i="[object Arguments]",o="[object Symbol]",l="[object Date]",u="[object Map]",f="[object Set]",h="[object Array]",p="[object Function]",b="[object ArrayBuffer]",g="[object Object]",x="[object Error]",E="[object DataView]",S="[object Uint8Array]",A="[object Uint8ClampedArray]",j="[object Uint16Array]",C="[object Uint32Array]",O="[object BigUint64Array]",T="[object Int8Array]",_="[object Int16Array]",P="[object Int32Array]",D="[object BigInt64Array]",L="[object Float32Array]",z="[object Float64Array]";return gt.argumentsTag=i,gt.arrayBufferTag=b,gt.arrayTag=h,gt.bigInt64ArrayTag=D,gt.bigUint64ArrayTag=O,gt.booleanTag=r,gt.dataViewTag=E,gt.dateTag=l,gt.errorTag=x,gt.float32ArrayTag=L,gt.float64ArrayTag=z,gt.functionTag=p,gt.int16ArrayTag=_,gt.int32ArrayTag=P,gt.int8ArrayTag=T,gt.mapTag=u,gt.numberTag=n,gt.objectTag=g,gt.regexpTag=e,gt.setTag=f,gt.stringTag=t,gt.symbolTag=o,gt.uint16ArrayTag=j,gt.uint32ArrayTag=C,gt.uint8ArrayTag=S,gt.uint8ClampedArrayTag=A,gt}var F0={},$0={},iP;function y9(){if(iP)return $0;iP=1;const e=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof rN=="object"&&rN||(function(){return this})()||Function("return this")();return $0.globalThis_=e,$0}var oP;function x9(){if(oP)return F0;oP=1;const e=y9();function t(n){return typeof e.globalThis_.Buffer<"u"&&e.globalThis_.Buffer.isBuffer(n)}return F0.isBuffer=t,F0}var sP;function NL(){if(sP)return Md;sP=1;const e=CL(),t=v9(),n=g9(),r=PE(),i=OL(),o=x9();function l(p,b){return u(p,void 0,p,new Map,b)}function u(p,b,g,x=new Map,E=void 0){const S=E==null?void 0:E(p,b,g,x);if(S!==void 0)return S;if(e.isPrimitive(p))return p;if(x.has(p))return x.get(p);if(Array.isArray(p)){const A=new Array(p.length);x.set(p,A);for(let j=0;j<p.length;j++)A[j]=u(p[j],j,g,x,E);return Object.hasOwn(p,"index")&&(A.index=p.index),Object.hasOwn(p,"input")&&(A.input=p.input),A}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const A=new RegExp(p.source,p.flags);return A.lastIndex=p.lastIndex,A}if(p instanceof Map){const A=new Map;x.set(p,A);for(const[j,C]of p)A.set(j,u(C,j,g,x,E));return A}if(p instanceof Set){const A=new Set;x.set(p,A);for(const j of p)A.add(u(j,void 0,g,x,E));return A}if(o.isBuffer(p))return p.subarray();if(t.isTypedArray(p)){const A=new(Object.getPrototypeOf(p)).constructor(p.length);x.set(p,A);for(let j=0;j<p.length;j++)A[j]=u(p[j],j,g,x,E);return A}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const A=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return x.set(p,A),f(A,p,g,x,E),A}if(typeof File<"u"&&p instanceof File){const A=new File([p],p.name,{type:p.type});return x.set(p,A),f(A,p,g,x,E),A}if(typeof Blob<"u"&&p instanceof Blob){const A=new Blob([p],{type:p.type});return x.set(p,A),f(A,p,g,x,E),A}if(p instanceof Error){const A=structuredClone(p);return x.set(p,A),A.message=p.message,A.name=p.name,A.stack=p.stack,A.cause=p.cause,A.constructor=p.constructor,f(A,p,g,x,E),A}if(p instanceof Boolean){const A=new Boolean(p.valueOf());return x.set(p,A),f(A,p,g,x,E),A}if(p instanceof Number){const A=new Number(p.valueOf());return x.set(p,A),f(A,p,g,x,E),A}if(p instanceof String){const A=new String(p.valueOf());return x.set(p,A),f(A,p,g,x,E),A}if(typeof p=="object"&&h(p)){const A=Object.create(Object.getPrototypeOf(p));return x.set(p,A),f(A,p,g,x,E),A}return p}function f(p,b,g=p,x,E){const S=[...Object.keys(b),...n.getSymbols(b)];for(let A=0;A<S.length;A++){const j=S[A],C=Object.getOwnPropertyDescriptor(p,j);(C==null||C.writable)&&(p[j]=u(b[j],j,g,x,E))}}function h(p){switch(r.getTag(p)){case i.argumentsTag:case i.arrayTag:case i.arrayBufferTag:case i.dataViewTag:case i.booleanTag:case i.dateTag:case i.float32ArrayTag:case i.float64ArrayTag:case i.int8ArrayTag:case i.int16ArrayTag:case i.int32ArrayTag:case i.mapTag:case i.numberTag:case i.objectTag:case i.regexpTag:case i.setTag:case i.stringTag:case i.symbolTag:case i.uint8ArrayTag:case i.uint8ClampedArrayTag:case i.uint16ArrayTag:case i.uint32ArrayTag:return!0;default:return!1}}return Md.cloneDeepWith=l,Md.cloneDeepWithImpl=u,Md.copyProperties=f,Md}var lP;function w9(){if(lP)return I0;lP=1;const e=NL();function t(n){return e.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}return I0.cloneDeep=t,I0}var K0={},H0={},G0={},cP;function TL(){if(cP)return G0;cP=1;function e(t,n){return t===n||Number.isNaN(t)&&Number.isNaN(n)}return G0.isEqualsSameValueZero=e,G0}var Y0={},uP;function PL(){if(uP)return Y0;uP=1;function e(t){return t!==null&&(typeof t=="object"||typeof t=="function")}return Y0.isObject=e,Y0}var dP;function S9(){if(dP)return H0;dP=1;const e=CL(),t=TL(),n=PL();function r(h,p,b){return typeof b!="function"?r(h,p,()=>{}):i(h,p,function g(x,E,S,A,j,C){const O=b(x,E,S,A,j,C);return O!==void 0?!!O:i(x,E,g,C)},new Map)}function i(h,p,b,g){if(p===h)return!0;switch(typeof p){case"object":return o(h,p,b,g);case"function":return Object.keys(p).length>0?i(h,{...p},b,g):t.isEqualsSameValueZero(h,p);default:return n.isObject(h)?typeof p=="string"?p==="":!0:t.isEqualsSameValueZero(h,p)}}function o(h,p,b,g){if(p==null)return!0;if(Array.isArray(p))return u(h,p,b,g);if(p instanceof Map)return l(h,p,b,g);if(p instanceof Set)return f(h,p,b,g);const x=Object.keys(p);if(h==null||e.isPrimitive(h))return x.length===0;if(x.length===0)return!0;if(g!=null&&g.has(p))return g.get(p)===h;g==null||g.set(p,h);try{for(let E=0;E<x.length;E++){const S=x[E];if(!e.isPrimitive(h)&&!(S in h)||p[S]===void 0&&h[S]!==void 0||p[S]===null&&h[S]!==null||!b(h[S],p[S],S,h,p,g))return!1}return!0}finally{g==null||g.delete(p)}}function l(h,p,b,g){if(p.size===0)return!0;if(!(h instanceof Map))return!1;for(const[x,E]of p.entries())if(b(h.get(x),E,x,h,p,g)===!1)return!1;return!0}function u(h,p,b,g){if(p.length===0)return!0;if(!Array.isArray(h))return!1;const x=new Set;for(let E=0;E<p.length;E++){const S=p[E];let A=!1;for(let j=0;j<h.length;j++){if(x.has(j))continue;const C=h[j];let O=!1;if(b(C,S,E,h,p,g)&&(O=!0),O){x.add(j),A=!0;break}}if(!A)return!1}return!0}function f(h,p,b,g){return p.size===0?!0:h instanceof Set?u([...h],[...p],b,g):!1}return H0.isMatchWith=r,H0}var fP;function _L(){if(fP)return K0;fP=1;const e=S9();function t(n,r){return e.isMatchWith(n,r,()=>{})}return K0.isMatch=t,K0}var hP;function E9(){if(hP)return L0;hP=1;const e=w9(),t=_L();function n(r){return r=e.cloneDeep(r),i=>t.isMatch(i,r)}return L0.matches=n,L0}var W0={},Q0={},V0={},mP;function A9(){if(mP)return V0;mP=1;const e=PE(),t=OL(),n=NL();function r(i,o){return n.cloneDeepWith(i,(l,u,f,h)=>{const p=o==null?void 0:o(l,u,f,h);if(p!==void 0)return p;if(typeof i=="object"){if(e.getTag(i)==="[object Object]"&&typeof i.constructor!="function"){const b={};return h.set(i,b),n.copyProperties(b,i,f,h),b}switch(Object.prototype.toString.call(i)){case t.numberTag:case t.stringTag:case t.booleanTag:{const b=new i.constructor(i==null?void 0:i.valueOf());return n.copyProperties(b,i),b}case t.argumentsTag:{const b={};return n.copyProperties(b,i),b.length=i.length,b[Symbol.iterator]=i[Symbol.iterator],b}default:return}}})}return V0.cloneDeepWith=r,V0}var pP;function j9(){if(pP)return Q0;pP=1;const e=A9();function t(n){return e.cloneDeepWith(n)}return Q0.cloneDeep=t,Q0}var X0={},Z0={},bP;function DL(){if(bP)return Z0;bP=1;const e=/^(?:0|[1-9]\d*)$/;function t(n,r=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<r;case"symbol":return!1;case"string":return e.test(n)}}return Z0.isIndex=t,Z0}var J0={},vP;function C9(){if(vP)return J0;vP=1;const e=PE();function t(n){return n!==null&&typeof n=="object"&&e.getTag(n)==="[object Arguments]"}return J0.isArguments=t,J0}var gP;function O9(){if(gP)return X0;gP=1;const e=yL(),t=CE(),n=DL(),r=C9();function i(o,l){let u;if(Array.isArray(l)?u=l:typeof l=="string"&&e.isDeepKey(l)&&(o==null?void 0:o[l])==null?u=t.toPath(l):u=[l],u.length===0)return!1;let f=o;for(let h=0;h<u.length;h++){const p=u[h];if((f==null||!Object.hasOwn(f,p))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(p)&&p<f.length))return!1;f=f[p]}return!0}return X0.has=i,X0}var yP;function N9(){if(yP)return W0;yP=1;const e=jE(),t=OE(),n=_L(),r=j9(),i=O9();function o(l,u){switch(typeof l){case"object":Object.is(l==null?void 0:l.valueOf(),-0)&&(l="-0");break;case"number":l=e.toKey(l);break}return u=r.cloneDeep(u),function(f){const h=t.get(f,l);return h===void 0?i.has(f,l):u===void 0?h===void 0:n.isMatch(h,u)}}return W0.matchesProperty=o,W0}var xP;function T9(){if(xP)return R0;xP=1;const e=jL(),t=b9(),n=E9(),r=N9();function i(o){if(o==null)return e.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?r.matchesProperty(o[0],o[1]):n.matches(o);case"string":case"symbol":case"number":return t.property(o)}}return R0.iteratee=i,R0}var ex={},tx={},nx={},wP;function P9(){if(wP)return nx;wP=1;function e(t){return Number.isSafeInteger(t)&&t>=0}return nx.isLength=e,nx}var SP;function ML(){if(SP)return tx;SP=1;const e=P9();function t(n){return n!=null&&typeof n!="function"&&e.isLength(n.length)}return tx.isArrayLike=t,tx}var rx={},EP;function _9(){if(EP)return rx;EP=1;function e(t){return typeof t=="object"&&t!==null}return rx.isObjectLike=e,rx}var AP;function D9(){if(AP)return ex;AP=1;const e=ML(),t=_9();function n(r){return t.isObjectLike(r)&&e.isArrayLike(r)}return ex.isArrayLikeObject=n,ex}var jP;function M9(){if(jP)return P0;jP=1;const e=m9(),t=p9(),n=jL(),r=T9(),i=D9();function o(l,u=n.identity){return i.isArrayLikeObject(l)?e.uniqBy(Array.from(l),t.ary(r.iteratee(u),1)):[]}return P0.uniqBy=o,P0}var ax,CP;function R9(){return CP||(CP=1,ax=M9().uniqBy),ax}var k9=R9();const OP=Ei(k9);function RL(e,t,n){return t===!0?OP(e,n):typeof t=="function"?OP(e,t):e}var ix={exports:{}},ox={},sx={exports:{}},lx={};/**219 A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(f==="rect")return v.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(va/8,"h").concat(va,"v").concat(va*3/4,"h").concat(-va,"z"),className:"recharts-legend-icon"});if(v.isValidElement(t.legendIcon)){var h=jL({},t);return delete h.legendIcon,v.cloneElement(t.legendIcon,h)}return v.createElement(NE,{fill:u,cx:i,cy:i,size:va,sizeType:"diameter",type:f})}function f9(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:o,iconType:l,labelStyle:u}=e,f={x:0,y:0,width:va,height:va},h={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((b,g)=>{var x=b.formatter||i,E=rt({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:b.inactive});if(b.type==="none")return null;var S=typeof u=="object"?jL({},u):{};S.color=b.inactive?o:S.color||b.color;var A=x?x(b.value,b,g):b.value;return v.createElement("li",Op({className:E,style:h,key:"legend-item-".concat(g)},qf(e,b,g)),v.createElement(wE,{width:n,height:n,viewBox:f,style:p,"aria-label":"".concat(b.value," legend icon")},v.createElement(d9,{data:b,iconType:l,inactiveColor:o})),v.createElement("span",{className:"recharts-legend-item-text",style:S},A))})}var h9=e=>{var t=on(e,c9),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var o={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return v.createElement("ul",{className:"recharts-default-legend",style:o},v.createElement(f9,Op({},t,{payload:n})))},P0={},_0={},XT;function m9(){if(XT)return _0;XT=1;function e(t,n){const r=new Map;for(let i=0;i<t.length;i++){const o=t[i],l=n(o,i,t);r.has(l)||r.set(l,o)}return Array.from(r.values())}return _0.uniqBy=e,_0}var D0={},ZT;function p9(){if(ZT)return D0;ZT=1;function e(t,n){return function(...r){return t.apply(this,r.slice(0,n))}}return D0.ary=e,D0}var M0={},JT;function CL(){if(JT)return M0;JT=1;function e(t){return t}return M0.identity=e,M0}var R0={},k0={},eP;function b9(){if(eP)return k0;eP=1;const e=OE();function t(n){return function(r){return e.get(r,n)}}return k0.property=t,k0}var L0={},I0={},Rd={},z0={},tP;function OL(){if(tP)return z0;tP=1;function e(t){return t==null||typeof t!="object"&&typeof t!="function"}return z0.isPrimitive=e,z0}var U0={},nP;function v9(){if(nP)return U0;nP=1;function e(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}return U0.isTypedArray=e,U0}var q0={},rP;function g9(){if(rP)return q0;rP=1;function e(t){return Object.getOwnPropertySymbols(t).filter(n=>Object.prototype.propertyIsEnumerable.call(t,n))}return q0.getSymbols=e,q0}var B0={},aP;function PE(){if(aP)return B0;aP=1;function e(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}return B0.getTag=e,B0}var gt={},iP;function NL(){if(iP)return gt;iP=1;const e="[object RegExp]",t="[object String]",n="[object Number]",r="[object Boolean]",i="[object Arguments]",o="[object Symbol]",l="[object Date]",u="[object Map]",f="[object Set]",h="[object Array]",p="[object Function]",b="[object ArrayBuffer]",g="[object Object]",x="[object Error]",E="[object DataView]",S="[object Uint8Array]",A="[object Uint8ClampedArray]",j="[object Uint16Array]",C="[object Uint32Array]",O="[object BigUint64Array]",T="[object Int8Array]",_="[object Int16Array]",P="[object Int32Array]",D="[object BigInt64Array]",L="[object Float32Array]",z="[object Float64Array]";return gt.argumentsTag=i,gt.arrayBufferTag=b,gt.arrayTag=h,gt.bigInt64ArrayTag=D,gt.bigUint64ArrayTag=O,gt.booleanTag=r,gt.dataViewTag=E,gt.dateTag=l,gt.errorTag=x,gt.float32ArrayTag=L,gt.float64ArrayTag=z,gt.functionTag=p,gt.int16ArrayTag=_,gt.int32ArrayTag=P,gt.int8ArrayTag=T,gt.mapTag=u,gt.numberTag=n,gt.objectTag=g,gt.regexpTag=e,gt.setTag=f,gt.stringTag=t,gt.symbolTag=o,gt.uint16ArrayTag=j,gt.uint32ArrayTag=C,gt.uint8ArrayTag=S,gt.uint8ClampedArrayTag=A,gt}var F0={},$0={},oP;function y9(){if(oP)return $0;oP=1;const e=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof rN=="object"&&rN||(function(){return this})()||Function("return this")();return $0.globalThis_=e,$0}var sP;function x9(){if(sP)return F0;sP=1;const e=y9();function t(n){return typeof e.globalThis_.Buffer<"u"&&e.globalThis_.Buffer.isBuffer(n)}return F0.isBuffer=t,F0}var lP;function TL(){if(lP)return Rd;lP=1;const e=OL(),t=v9(),n=g9(),r=PE(),i=NL(),o=x9();function l(p,b){return u(p,void 0,p,new Map,b)}function u(p,b,g,x=new Map,E=void 0){const S=E==null?void 0:E(p,b,g,x);if(S!==void 0)return S;if(e.isPrimitive(p))return p;if(x.has(p))return x.get(p);if(Array.isArray(p)){const A=new Array(p.length);x.set(p,A);for(let j=0;j<p.length;j++)A[j]=u(p[j],j,g,x,E);return Object.hasOwn(p,"index")&&(A.index=p.index),Object.hasOwn(p,"input")&&(A.input=p.input),A}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const A=new RegExp(p.source,p.flags);return A.lastIndex=p.lastIndex,A}if(p instanceof Map){const A=new Map;x.set(p,A);for(const[j,C]of p)A.set(j,u(C,j,g,x,E));return A}if(p instanceof Set){const A=new Set;x.set(p,A);for(const j of p)A.add(u(j,void 0,g,x,E));return A}if(o.isBuffer(p))return p.subarray();if(t.isTypedArray(p)){const A=new(Object.getPrototypeOf(p)).constructor(p.length);x.set(p,A);for(let j=0;j<p.length;j++)A[j]=u(p[j],j,g,x,E);return A}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const A=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return x.set(p,A),f(A,p,g,x,E),A}if(typeof File<"u"&&p instanceof File){const A=new File([p],p.name,{type:p.type});return x.set(p,A),f(A,p,g,x,E),A}if(typeof Blob<"u"&&p instanceof Blob){const A=new Blob([p],{type:p.type});return x.set(p,A),f(A,p,g,x,E),A}if(p instanceof Error){const A=structuredClone(p);return x.set(p,A),A.message=p.message,A.name=p.name,A.stack=p.stack,A.cause=p.cause,A.constructor=p.constructor,f(A,p,g,x,E),A}if(p instanceof Boolean){const A=new Boolean(p.valueOf());return x.set(p,A),f(A,p,g,x,E),A}if(p instanceof Number){const A=new Number(p.valueOf());return x.set(p,A),f(A,p,g,x,E),A}if(p instanceof String){const A=new String(p.valueOf());return x.set(p,A),f(A,p,g,x,E),A}if(typeof p=="object"&&h(p)){const A=Object.create(Object.getPrototypeOf(p));return x.set(p,A),f(A,p,g,x,E),A}return p}function f(p,b,g=p,x,E){const S=[...Object.keys(b),...n.getSymbols(b)];for(let A=0;A<S.length;A++){const j=S[A],C=Object.getOwnPropertyDescriptor(p,j);(C==null||C.writable)&&(p[j]=u(b[j],j,g,x,E))}}function h(p){switch(r.getTag(p)){case i.argumentsTag:case i.arrayTag:case i.arrayBufferTag:case i.dataViewTag:case i.booleanTag:case i.dateTag:case i.float32ArrayTag:case i.float64ArrayTag:case i.int8ArrayTag:case i.int16ArrayTag:case i.int32ArrayTag:case i.mapTag:case i.numberTag:case i.objectTag:case i.regexpTag:case i.setTag:case i.stringTag:case i.symbolTag:case i.uint8ArrayTag:case i.uint8ClampedArrayTag:case i.uint16ArrayTag:case i.uint32ArrayTag:return!0;default:return!1}}return Rd.cloneDeepWith=l,Rd.cloneDeepWithImpl=u,Rd.copyProperties=f,Rd}var cP;function w9(){if(cP)return I0;cP=1;const e=TL();function t(n){return e.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}return I0.cloneDeep=t,I0}var K0={},H0={},G0={},uP;function PL(){if(uP)return G0;uP=1;function e(t,n){return t===n||Number.isNaN(t)&&Number.isNaN(n)}return G0.isEqualsSameValueZero=e,G0}var Y0={},dP;function _L(){if(dP)return Y0;dP=1;function e(t){return t!==null&&(typeof t=="object"||typeof t=="function")}return Y0.isObject=e,Y0}var fP;function S9(){if(fP)return H0;fP=1;const e=OL(),t=PL(),n=_L();function r(h,p,b){return typeof b!="function"?r(h,p,()=>{}):i(h,p,function g(x,E,S,A,j,C){const O=b(x,E,S,A,j,C);return O!==void 0?!!O:i(x,E,g,C)},new Map)}function i(h,p,b,g){if(p===h)return!0;switch(typeof p){case"object":return o(h,p,b,g);case"function":return Object.keys(p).length>0?i(h,{...p},b,g):t.isEqualsSameValueZero(h,p);default:return n.isObject(h)?typeof p=="string"?p==="":!0:t.isEqualsSameValueZero(h,p)}}function o(h,p,b,g){if(p==null)return!0;if(Array.isArray(p))return u(h,p,b,g);if(p instanceof Map)return l(h,p,b,g);if(p instanceof Set)return f(h,p,b,g);const x=Object.keys(p);if(h==null||e.isPrimitive(h))return x.length===0;if(x.length===0)return!0;if(g!=null&&g.has(p))return g.get(p)===h;g==null||g.set(p,h);try{for(let E=0;E<x.length;E++){const S=x[E];if(!e.isPrimitive(h)&&!(S in h)||p[S]===void 0&&h[S]!==void 0||p[S]===null&&h[S]!==null||!b(h[S],p[S],S,h,p,g))return!1}return!0}finally{g==null||g.delete(p)}}function l(h,p,b,g){if(p.size===0)return!0;if(!(h instanceof Map))return!1;for(const[x,E]of p.entries())if(b(h.get(x),E,x,h,p,g)===!1)return!1;return!0}function u(h,p,b,g){if(p.length===0)return!0;if(!Array.isArray(h))return!1;const x=new Set;for(let E=0;E<p.length;E++){const S=p[E];let A=!1;for(let j=0;j<h.length;j++){if(x.has(j))continue;const C=h[j];let O=!1;if(b(C,S,E,h,p,g)&&(O=!0),O){x.add(j),A=!0;break}}if(!A)return!1}return!0}function f(h,p,b,g){return p.size===0?!0:h instanceof Set?u([...h],[...p],b,g):!1}return H0.isMatchWith=r,H0}var hP;function DL(){if(hP)return K0;hP=1;const e=S9();function t(n,r){return e.isMatchWith(n,r,()=>{})}return K0.isMatch=t,K0}var mP;function E9(){if(mP)return L0;mP=1;const e=w9(),t=DL();function n(r){return r=e.cloneDeep(r),i=>t.isMatch(i,r)}return L0.matches=n,L0}var W0={},Q0={},V0={},pP;function A9(){if(pP)return V0;pP=1;const e=PE(),t=NL(),n=TL();function r(i,o){return n.cloneDeepWith(i,(l,u,f,h)=>{const p=o==null?void 0:o(l,u,f,h);if(p!==void 0)return p;if(typeof i=="object"){if(e.getTag(i)==="[object Object]"&&typeof i.constructor!="function"){const b={};return h.set(i,b),n.copyProperties(b,i,f,h),b}switch(Object.prototype.toString.call(i)){case t.numberTag:case t.stringTag:case t.booleanTag:{const b=new i.constructor(i==null?void 0:i.valueOf());return n.copyProperties(b,i),b}case t.argumentsTag:{const b={};return n.copyProperties(b,i),b.length=i.length,b[Symbol.iterator]=i[Symbol.iterator],b}default:return}}})}return V0.cloneDeepWith=r,V0}var bP;function j9(){if(bP)return Q0;bP=1;const e=A9();function t(n){return e.cloneDeepWith(n)}return Q0.cloneDeep=t,Q0}var X0={},Z0={},vP;function ML(){if(vP)return Z0;vP=1;const e=/^(?:0|[1-9]\d*)$/;function t(n,r=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<r;case"symbol":return!1;case"string":return e.test(n)}}return Z0.isIndex=t,Z0}var J0={},gP;function C9(){if(gP)return J0;gP=1;const e=PE();function t(n){return n!==null&&typeof n=="object"&&e.getTag(n)==="[object Arguments]"}return J0.isArguments=t,J0}var yP;function O9(){if(yP)return X0;yP=1;const e=xL(),t=CE(),n=ML(),r=C9();function i(o,l){let u;if(Array.isArray(l)?u=l:typeof l=="string"&&e.isDeepKey(l)&&(o==null?void 0:o[l])==null?u=t.toPath(l):u=[l],u.length===0)return!1;let f=o;for(let h=0;h<u.length;h++){const p=u[h];if((f==null||!Object.hasOwn(f,p))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(p)&&p<f.length))return!1;f=f[p]}return!0}return X0.has=i,X0}var xP;function N9(){if(xP)return W0;xP=1;const e=jE(),t=OE(),n=DL(),r=j9(),i=O9();function o(l,u){switch(typeof l){case"object":Object.is(l==null?void 0:l.valueOf(),-0)&&(l="-0");break;case"number":l=e.toKey(l);break}return u=r.cloneDeep(u),function(f){const h=t.get(f,l);return h===void 0?i.has(f,l):u===void 0?h===void 0:n.isMatch(h,u)}}return W0.matchesProperty=o,W0}var wP;function T9(){if(wP)return R0;wP=1;const e=CL(),t=b9(),n=E9(),r=N9();function i(o){if(o==null)return e.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?r.matchesProperty(o[0],o[1]):n.matches(o);case"string":case"symbol":case"number":return t.property(o)}}return R0.iteratee=i,R0}var ex={},tx={},nx={},SP;function P9(){if(SP)return nx;SP=1;function e(t){return Number.isSafeInteger(t)&&t>=0}return nx.isLength=e,nx}var EP;function RL(){if(EP)return tx;EP=1;const e=P9();function t(n){return n!=null&&typeof n!="function"&&e.isLength(n.length)}return tx.isArrayLike=t,tx}var rx={},AP;function _9(){if(AP)return rx;AP=1;function e(t){return typeof t=="object"&&t!==null}return rx.isObjectLike=e,rx}var jP;function D9(){if(jP)return ex;jP=1;const e=RL(),t=_9();function n(r){return t.isObjectLike(r)&&e.isArrayLike(r)}return ex.isArrayLikeObject=n,ex}var CP;function M9(){if(CP)return P0;CP=1;const e=m9(),t=p9(),n=CL(),r=T9(),i=D9();function o(l,u=n.identity){return i.isArrayLikeObject(l)?e.uniqBy(Array.from(l),t.ary(r.iteratee(u),1)):[]}return P0.uniqBy=o,P0}var ax,OP;function R9(){return OP||(OP=1,ax=M9().uniqBy),ax}var k9=R9();const NP=Ei(k9);function kL(e,t,n){return t===!0?NP(e,n):typeof t=="function"?NP(e,t):e}var ix={exports:{}},ox={},sx={exports:{}},lx={};/** 220 220 * @license React 221 221 * use-sync-external-store-shim.production.js … … 225 225 * This source code is licensed under the MIT license found in the 226 226 * LICENSE file in the root directory of this source tree. 227 */var NP;function L9(){if(NP)return lx;NP=1;var e=xu();function t(b,g){return b===g&&(b!==0||1/b===1/g)||b!==b&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(b,g){var x=g(),E=r({inst:{value:x,getSnapshot:g}}),S=E[0].inst,A=E[1];return o(function(){S.value=x,S.getSnapshot=g,f(S)&&A({inst:S})},[b,x,g]),i(function(){return f(S)&&A({inst:S}),b(function(){f(S)&&A({inst:S})})},[b]),l(x),x}function f(b){var g=b.getSnapshot;b=b.value;try{var x=g();return!n(b,x)}catch{return!0}}function h(b,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return lx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,lx}var TP;function I9(){return TP||(TP=1,sx.exports=L9()),sx.exports}/**227 */var TP;function L9(){if(TP)return lx;TP=1;var e=xu();function t(b,g){return b===g&&(b!==0||1/b===1/g)||b!==b&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(b,g){var x=g(),E=r({inst:{value:x,getSnapshot:g}}),S=E[0].inst,A=E[1];return o(function(){S.value=x,S.getSnapshot=g,f(S)&&A({inst:S})},[b,x,g]),i(function(){return f(S)&&A({inst:S}),b(function(){f(S)&&A({inst:S})})},[b]),l(x),x}function f(b){var g=b.getSnapshot;b=b.value;try{var x=g();return!n(b,x)}catch{return!0}}function h(b,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return lx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,lx}var PP;function I9(){return PP||(PP=1,sx.exports=L9()),sx.exports}/** 228 228 * @license React 229 229 * use-sync-external-store-shim/with-selector.production.js … … 233 233 * This source code is licensed under the MIT license found in the 234 234 * LICENSE file in the root directory of this source tree. 235 */var PP;function z9(){if(PP)return ox;PP=1;var e=xu(),t=I9();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,u=e.useMemo,f=e.useDebugValue;return ox.useSyncExternalStoreWithSelector=function(h,p,b,g,x){var E=o(null);if(E.current===null){var S={hasValue:!1,value:null};E.current=S}else S=E.current;E=u(function(){function j(P){if(!C){if(C=!0,O=P,P=g(P),x!==void 0&&S.hasValue){var D=S.value;if(x(D,P))return T=D}return T=P}if(D=T,r(O,P))return D;var L=g(P);return x!==void 0&&x(D,L)?(O=P,D):(O=P,T=L)}var C=!1,O,T,_=b===void 0?null:b;return[function(){return j(p())},_===null?void 0:function(){return j(_())}]},[p,b,g,x]);var A=i(h,E[0],E[1]);return l(function(){S.hasValue=!0,S.value=A},[A]),f(A),A},ox}var _P;function U9(){return _P||(_P=1,ix.exports=z9()),ix.exports}var q9=U9(),_E=v.createContext(null),B9=e=>e,xt=()=>{var e=v.useContext(_E);return e?e.store.dispatch:B9},rp=()=>{},F9=()=>rp,$9=(e,t)=>e===t;function we(e){var t=v.useContext(_E),n=v.useMemo(()=>t?r=>{if(r!=null)return e(r)}:rp,[t,e]);return q9.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:F9,t?t.store.getState:rp,t?t.store.getState:rp,n,$9)}function K9(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function H9(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function G9(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var DP=e=>Array.isArray(e)?e:[e];function Y9(e){const t=Array.isArray(e[0])?e[0]:e;return G9(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function W9(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Q9=class{constructor(e){this.value=e}deref(){return this.value}},V9=typeof WeakRef<"u"?WeakRef:Q9,X9=0,MP=1;function km(){return{s:X9,v:void 0,o:null,p:null}}function kL(e,t={}){let n=km();const{resultEqualityCheck:r}=t;let i,o=0;function l(){var b;let u=n;const{length:f}=arguments;for(let g=0,x=f;g<x;g++){const E=arguments[g];if(typeof E=="function"||typeof E=="object"&&E!==null){let S=u.o;S===null&&(u.o=S=new WeakMap);const A=S.get(E);A===void 0?(u=km(),S.set(E,u)):u=A}else{let S=u.p;S===null&&(u.p=S=new Map);const A=S.get(E);A===void 0?(u=km(),S.set(E,u)):u=A}}const h=u;let p;if(u.s===MP)p=u.v;else if(p=e.apply(null,arguments),o++,r){const g=((b=i==null?void 0:i.deref)==null?void 0:b.call(i))??i;g!=null&&r(g,p)&&(p=g,o!==0&&o--),i=typeof p=="object"&&p!==null||typeof p=="function"?new V9(p):p}return h.s=MP,h.v=p,p}return l.clearCache=()=>{n=km(),l.resetResultsCount()},l.resultsCount=()=>o,l.resetResultsCount=()=>{o=0},l}function Z9(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,l=0,u,f={},h=i.pop();typeof h=="object"&&(f=h,h=i.pop()),K9(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const p={...n,...f},{memoize:b,memoizeOptions:g=[],argsMemoize:x=kL,argsMemoizeOptions:E=[]}=p,S=DP(g),A=DP(E),j=Y9(i),C=b(function(){return o++,h.apply(null,arguments)},...S),O=x(function(){l++;const _=W9(j,arguments);return u=C.apply(null,_),u},...A);return Object.assign(O,{resultFunc:h,memoizedResultFunc:C,dependencies:j,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>u,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:b,argsMemoize:x})};return Object.assign(r,{withTypes:()=>r}),r}var W=Z9(kL),J9=Object.assign((e,t=W)=>{H9(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((l,u,f)=>(l[n[f]]=u,l),{}))},{withTypes:()=>J9}),cx={},ux={},RP;function e7(){if(RP)return ux;RP=1;function e(t,n=1){const r=[],i=Math.floor(n),o=(l,u)=>{for(let f=0;f<l.length;f++){const h=l[f];Array.isArray(h)&&u<i?o(h,u+1):r.push(h)}};return o(t,0),r}return ux.flatten=e,ux}var dx={},kP;function LL(){if(kP)return dx;kP=1;const e=TL(),t=ML(),n=PL(),r=DL();function i(o,l,u){return n.isObject(u)&&(typeof l=="number"&&t.isArrayLike(u)&&r.isIndex(l)&&l<u.length||typeof l=="string"&&l in u)?e.isEqualsSameValueZero(u[l],o):!1}return dx.isIterateeCall=i,dx}var fx={},hx={},LP;function t7(){if(LP)return hx;LP=1;function e(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const t=(n,r,i)=>{if(n!==r){const o=e(n),l=e(r);if(o===l&&o===0){if(n<r)return i==="desc"?1:-1;if(n>r)return i==="desc"?-1:1}return i==="desc"?l-o:o-l}return 0};return hx.compareValues=t,hx}var mx={},px={},IP;function IL(){if(IP)return px;IP=1;function e(t){return typeof t=="symbol"||t instanceof Symbol}return px.isSymbol=e,px}var zP;function n7(){if(zP)return mx;zP=1;const e=IL(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function r(i,o){return Array.isArray(i)?!1:typeof i=="number"||typeof i=="boolean"||i==null||e.isSymbol(i)?!0:typeof i=="string"&&(n.test(i)||!t.test(i))||o!=null&&Object.hasOwn(o,i)}return mx.isKey=r,mx}var UP;function r7(){if(UP)return fx;UP=1;const e=CE(),t=t7(),n=n7();function r(i,o,l,u){if(i==null)return[];l=u?void 0:l,Array.isArray(i)||(i=Object.values(i)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(b=>String(b));const f=(b,g)=>{let x=b;for(let E=0;E<g.length&&x!=null;++E)x=x[g[E]];return x},h=(b,g)=>g==null||b==null?g:typeof b=="object"&&"key"in b?Object.hasOwn(g,b.key)?g[b.key]:f(g,b.path):typeof b=="function"?b(g):Array.isArray(b)?f(g,b):typeof g=="object"?g[b]:g,p=o.map(b=>(Array.isArray(b)&&b.length===1&&(b=b[0]),b==null||typeof b=="function"||Array.isArray(b)||n.isKey(b)?b:{key:b,path:e.toPath(b)}));return i.map(b=>({original:b,criteria:p.map(g=>h(g,b))})).slice().sort((b,g)=>{for(let x=0;x<p.length;x++){const E=t.compareValues(b.criteria[x],g.criteria[x],l[x]);if(E!==0)return E}return 0}).map(b=>b.original)}return fx.orderBy=r,fx}var qP;function a7(){if(qP)return cx;qP=1;const e=e7(),t=LL(),n=r7();function r(i,...o){const l=o.length;return l>1&&t.isIterateeCall(i,o[0],o[1])?o=[]:l>2&&t.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),n.orderBy(i,e.flatten(o),["asc"])}return cx.sortBy=r,cx}var bx,BP;function i7(){return BP||(BP=1,bx=a7().sortBy),bx}var o7=i7();const zb=Ei(o7);var zL=e=>e.legend.settings,s7=e=>e.legend.size,l7=e=>e.legend.payload,c7=W([l7,zL],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?zb(r,n):r});function u7(){return we(c7)}var Lm=1;function UL(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=v.useState({height:0,left:0,top:0,width:0}),r=v.useCallback(i=>{if(i!=null){var o=i.getBoundingClientRect(),l={height:o.height,left:o.left,top:o.top,width:o.width};(Math.abs(l.height-t.height)>Lm||Math.abs(l.left-t.left)>Lm||Math.abs(l.top-t.top)>Lm||Math.abs(l.width-t.width)>Lm)&&n({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Yn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var d7=typeof Symbol=="function"&&Symbol.observable||"@@observable",FP=d7,vx=()=>Math.random().toString(36).substring(7).split("").join("."),f7={INIT:`@@redux/INIT${vx()}`,REPLACE:`@@redux/REPLACE${vx()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${vx()}`},Np=f7;function DE(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function qL(e,t,n){if(typeof e!="function")throw new Error(Yn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Yn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Yn(1));return n(qL)(e,t)}let r=e,i=t,o=new Map,l=o,u=0,f=!1;function h(){l===o&&(l=new Map,o.forEach((A,j)=>{l.set(j,A)}))}function p(){if(f)throw new Error(Yn(3));return i}function b(A){if(typeof A!="function")throw new Error(Yn(4));if(f)throw new Error(Yn(5));let j=!0;h();const C=u++;return l.set(C,A),function(){if(j){if(f)throw new Error(Yn(6));j=!1,h(),l.delete(C),o=null}}}function g(A){if(!DE(A))throw new Error(Yn(7));if(typeof A.type>"u")throw new Error(Yn(8));if(typeof A.type!="string")throw new Error(Yn(17));if(f)throw new Error(Yn(9));try{f=!0,i=r(i,A)}finally{f=!1}return(o=l).forEach(C=>{C()}),A}function x(A){if(typeof A!="function")throw new Error(Yn(10));r=A,g({type:Np.REPLACE})}function E(){const A=b;return{subscribe(j){if(typeof j!="object"||j===null)throw new Error(Yn(11));function C(){const T=j;T.next&&T.next(p())}return C(),{unsubscribe:A(C)}},[FP](){return this}}}return g({type:Np.INIT}),{dispatch:g,subscribe:b,getState:p,replaceReducer:x,[FP]:E}}function h7(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Np.INIT})>"u")throw new Error(Yn(12));if(typeof n(void 0,{type:Np.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Yn(13))})}function BL(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const l=t[o];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{h7(n)}catch(o){i=o}return function(l={},u){if(i)throw i;let f=!1;const h={};for(let p=0;p<r.length;p++){const b=r[p],g=n[b],x=l[b],E=g(x,u);if(typeof E>"u")throw u&&u.type,new Error(Yn(14));h[b]=E,f=f||E!==x}return f=f||r.length!==Object.keys(l).length,f?h:l}}function Tp(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function m7(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(Yn(15))};const l={getState:i.getState,dispatch:(f,...h)=>o(f,...h)},u=e.map(f=>f(l));return o=Tp(...u)(i.dispatch),{...i,dispatch:o}}}function FL(e){return DE(e)&&"type"in e&&typeof e.type=="string"}var $L=Symbol.for("immer-nothing"),$P=Symbol.for("immer-draftable"),xr=Symbol.for("immer-state");function La(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ta=Object,du=ta.getPrototypeOf,Pp="constructor",Ub="prototype",$w="configurable",_p="enumerable",ap="writable",uf="value",ho=e=>!!e&&!!e[xr];function Fa(e){var t;return e?KL(e)||Bb(e)||!!e[$P]||!!((t=e[Pp])!=null&&t[$P])||Fb(e)||$b(e):!1}var p7=ta[Ub][Pp].toString(),KP=new WeakMap;function KL(e){if(!e||!ME(e))return!1;const t=du(e);if(t===null||t===ta[Ub])return!0;const n=ta.hasOwnProperty.call(t,Pp)&&t[Pp];if(n===Object)return!0;if(!Lc(n))return!1;let r=KP.get(n);return r===void 0&&(r=Function.toString.call(n),KP.set(n,r)),r===p7}function qb(e,t,n=!0){Bf(e)===0?(n?Reflect.ownKeys(e):ta.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Bf(e){const t=e[xr];return t?t.type_:Bb(e)?1:Fb(e)?2:$b(e)?3:0}var HP=(e,t,n=Bf(e))=>n===2?e.has(t):ta[Ub].hasOwnProperty.call(e,t),Kw=(e,t,n=Bf(e))=>n===2?e.get(t):e[t],Dp=(e,t,n,r=Bf(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function b7(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Bb=Array.isArray,Fb=e=>e instanceof Map,$b=e=>e instanceof Set,ME=e=>typeof e=="object",Lc=e=>typeof e=="function",gx=e=>typeof e=="boolean";function v7(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var eo=e=>e.copy_||e.base_,RE=e=>e.modified_?e.copy_:e.base_;function Hw(e,t){if(Fb(e))return new Map(e);if($b(e))return new Set(e);if(Bb(e))return Array[Ub].slice.call(e);const n=KL(e);if(t===!0||t==="class_only"&&!n){const r=ta.getOwnPropertyDescriptors(e);delete r[xr];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const l=i[o],u=r[l];u[ap]===!1&&(u[ap]=!0,u[$w]=!0),(u.get||u.set)&&(r[l]={[$w]:!0,[ap]:!0,[_p]:u[_p],[uf]:e[l]})}return ta.create(du(e),r)}else{const r=du(e);if(r!==null&&n)return{...e};const i=ta.create(r);return ta.assign(i,e)}}function kE(e,t=!1){return Kb(e)||ho(e)||!Fa(e)||(Bf(e)>1&&ta.defineProperties(e,{set:Im,add:Im,clear:Im,delete:Im}),ta.freeze(e),t&&qb(e,(n,r)=>{kE(r,!0)},!1)),e}function g7(){La(2)}var Im={[uf]:g7};function Kb(e){return e===null||!ME(e)?!0:ta.isFrozen(e)}var Mp="MapSet",Gw="Patches",GP="ArrayMethods",HL={};function jl(e){const t=HL[e];return t||La(0,e),t}var YP=e=>!!HL[e],df,GL=()=>df,y7=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:YP(Mp)?jl(Mp):void 0,arrayMethodsPlugin_:YP(GP)?jl(GP):void 0});function WP(e,t){t&&(e.patchPlugin_=jl(Gw),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yw(e){Ww(e),e.drafts_.forEach(x7),e.drafts_=null}function Ww(e){e===df&&(df=e.parent_)}var QP=e=>df=y7(df,e);function x7(e){const t=e[xr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function VP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[xr].modified_&&(Yw(t),La(4)),Fa(e)&&(e=XP(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[xr].base_,e,t)}else e=XP(t,n);return w7(t,e,!0),Yw(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==$L?e:void 0}function XP(e,t){if(Kb(t))return t;const n=t[xr];if(!n)return Rp(t,e.handledSet_,e);if(!Hb(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);QL(n,e)}return n.copy_}function w7(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&kE(t,n)}function YL(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Hb=(e,t)=>e.scope_===t,S7=[];function WL(e,t,n,r){const i=eo(e),o=e.type_;if(r!==void 0&&Kw(i,r,o)===t){Dp(i,r,n,o);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;qb(i,(f,h)=>{if(ho(h)){const p=u.get(h)||[];p.push(f),u.set(h,p)}})}const l=e.draftLocations_.get(t)??S7;for(const u of l)Dp(i,u,n,o)}function E7(e,t,n){e.callbacks_.push(function(i){var u;const o=t;if(!o||!Hb(o,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(o);const l=RE(o);WL(e,o.draft_??o,l,n),QL(o,i)})}function QL(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const o=i.getPath(e);o&&i.generatePatches_(e,o,t)}YL(e)}}function A7(e,t,n){const{scope_:r}=e;if(ho(n)){const i=n[xr];Hb(i,r)&&i.callbacks_.push(function(){ip(e);const l=RE(i);WL(e,n,l,t)})}else Fa(n)&&e.callbacks_.push(function(){const o=eo(e);e.type_===3?o.has(n)&&Rp(n,r.handledSet_,r):Kw(o,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Rp(Kw(e.copy_,t,e.type_),r.handledSet_,r)})}function Rp(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ho(e)||t.has(e)||!Fa(e)||Kb(e)||(t.add(e),qb(e,(r,i)=>{if(ho(i)){const o=i[xr];if(Hb(o,n)){const l=RE(o);Dp(e,r,l,e.type_),YL(o)}}else Fa(i)&&Rp(i,t,n)})),e}function j7(e,t){const n=Bb(e),r={type_:n?1:0,scope_:t?t.scope_:GL(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,o=kp;n&&(i=[r],o=ff);const{revoke:l,proxy:u}=Proxy.revocable(i,o);return r.draft_=u,r.revoke_=l,[u,r]}var kp={get(e,t){if(t===xr)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=eo(e);if(!HP(i,t,e.type_))return C7(e,i,t);const o=i[t];if(e.finalized_||!Fa(o)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&v7(t))return o;if(o===yx(e.base_,t)){ip(e);const l=e.type_===1?+t:t,u=Vw(e.scope_,o,e,l);return e.copy_[l]=u}return o},has(e,t){return t in eo(e)},ownKeys(e){return Reflect.ownKeys(eo(e))},set(e,t,n){const r=VL(eo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=yx(eo(e),t),o=i==null?void 0:i[xr];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(b7(n,i)&&(n!==void 0||HP(e.base_,t,e.type_)))return!0;ip(e),Qw(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),A7(e,t,n)),!0},deleteProperty(e,t){return ip(e),yx(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Qw(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=eo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[ap]:!0,[$w]:e.type_!==1||t!=="length",[_p]:r[_p],[uf]:n[t]}},defineProperty(){La(11)},getPrototypeOf(e){return du(e.base_)},setPrototypeOf(){La(12)}},ff={};for(let e in kp){let t=kp[e];ff[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ff.deleteProperty=function(e,t){return ff.set.call(this,e,t,void 0)};ff.set=function(e,t,n){return kp.set.call(this,e[0],t,n,e[0])};function yx(e,t){const n=e[xr];return(n?eo(n):e)[t]}function C7(e,t,n){var i;const r=VL(t,n);return r?uf in r?r[uf]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function VL(e,t){if(!(t in e))return;let n=du(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=du(n)}}function Qw(e){e.modified_||(e.modified_=!0,e.parent_&&Qw(e.parent_))}function ip(e){e.copy_||(e.assigned_=new Map,e.copy_=Hw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var O7=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Lc(n)&&!Lc(r)){const l=r;r=n;const u=this;return function(h=l,...p){return u.produce(h,b=>r.call(this,b,...p))}}Lc(r)||La(6),i!==void 0&&!Lc(i)&&La(7);let o;if(Fa(n)){const l=QP(this),u=Vw(l,n,void 0);let f=!0;try{o=r(u),f=!1}finally{f?Yw(l):Ww(l)}return WP(l,i),VP(o,l)}else if(!n||!ME(n)){if(o=r(n),o===void 0&&(o=n),o===$L&&(o=void 0),this.autoFreeze_&&kE(o,!0),i){const l=[],u=[];jl(Gw).generateReplacementPatches_(n,o,{patches_:l,inversePatches_:u}),i(l,u)}return o}else La(1,n)},this.produceWithPatches=(n,r)=>{if(Lc(n))return(u,...f)=>this.produceWithPatches(u,h=>n(h,...f));let i,o;return[this.produce(n,r,(u,f)=>{i=u,o=f}),i,o]},gx(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),gx(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),gx(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Fa(t)||La(8),ho(t)&&(t=xa(t));const n=QP(this),r=Vw(n,t,void 0);return r[xr].isManual_=!0,Ww(n),r}finishDraft(t,n){const r=t&&t[xr];(!r||!r.isManual_)&&La(9);const{scope_:i}=r;return WP(i,n),VP(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const o=n[r];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}r>-1&&(n=n.slice(r+1));const i=jl(Gw).applyPatches_;return ho(t)?i(t,n):this.produce(t,o=>i(o,n))}};function Vw(e,t,n,r){const[i,o]=Fb(t)?jl(Mp).proxyMap_(t,n):$b(t)?jl(Mp).proxySet_(t,n):j7(t,n);return((n==null?void 0:n.scope_)??GL()).drafts_.push(i),o.callbacks_=(n==null?void 0:n.callbacks_)??[],o.key_=r,n&&r!==void 0?E7(n,o,r):o.callbacks_.push(function(f){var p;(p=f.mapSetPlugin_)==null||p.fixSetContents(o);const{patchPlugin_:h}=f;o.modified_&&h&&h.generatePatches_(o,[],f)}),i}function xa(e){return ho(e)||La(10,e),XL(e)}function XL(e){if(!Fa(e)||Kb(e))return e;const t=e[xr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Hw(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Hw(e,!0);return qb(n,(i,o)=>{Dp(n,i,XL(o))},r),t&&(t.finalized_=!1),n}var N7=new O7,ZL=N7.produce;function JL(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var T7=JL(),P7=JL,_7=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Tp:Tp.apply(null,arguments)};function ra(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(na(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>FL(r)&&r.type===e,n}var eI=class Wd extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Wd.prototype)}static get[Symbol.species](){return Wd}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Wd(...t[0].concat(this)):new Wd(...t.concat(this))}};function ZP(e){return Fa(e)?ZL(e,()=>{}):e}function zm(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function D7(e){return typeof e=="boolean"}var M7=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let l=new eI;return n&&(D7(n)?l.push(T7):l.push(P7(n.extraArgument))),l},tI="RTK_autoBatch",_t=()=>e=>({payload:e,meta:{[tI]:!0}}),JP=e=>t=>{setTimeout(t,e)},R7=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(o),clearTimeout(l),n())},o=e(i),l=setTimeout(i,t)},nI=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,l=!1;const u=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?R7(window.requestAnimationFrame,100):JP(10):e.type==="callback"?e.queueNotification:JP(e.timeout),h=()=>{l=!1,o&&(o=!1,u.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const b=()=>i&&p(),g=r.subscribe(b);return u.add(p),()=>{g(),u.delete(p)}},dispatch(p){var b;try{return i=!((b=p==null?void 0:p.meta)!=null&&b[tI]),o=!i,o&&(l||(l=!0,f(h))),r.dispatch(p)}finally{i=!0}}})},k7=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new eI(e);return r&&i.push(nI(typeof r=="object"?r:void 0)),i};function L7(e){const t=M7(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:o=void 0,enhancers:l=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(DE(n))u=BL(n);else throw new Error(na(1));let f;typeof r=="function"?f=r(t):f=t();let h=Tp;i&&(h=_7({trace:!1,...typeof i=="object"&&i}));const p=m7(...f),b=k7(p);let g=typeof l=="function"?l(b):b();const x=h(...g);return qL(u,o,x)}function rI(e){const t={},n=[];let r;const i={addCase(o,l){const u=typeof o=="string"?o:o.type;if(!u)throw new Error(na(28));if(u in t)throw new Error(na(29));return t[u]=l,i},addAsyncThunk(o,l){return l.pending&&(t[o.pending.type]=l.pending),l.rejected&&(t[o.rejected.type]=l.rejected),l.fulfilled&&(t[o.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:o.settled,reducer:l.settled}),i},addMatcher(o,l){return n.push({matcher:o,reducer:l}),i},addDefaultCase(o){return r=o,i}};return e(i),[t,n,r]}function I7(e){return typeof e=="function"}function z7(e,t){let[n,r,i]=rI(t),o;if(I7(e))o=()=>ZP(e());else{const u=ZP(e);o=()=>u}function l(u=o(),f){let h=[n[f.type],...r.filter(({matcher:p})=>p(f)).map(({reducer:p})=>p)];return h.filter(p=>!!p).length===0&&(h=[i]),h.reduce((p,b)=>{if(b)if(ho(p)){const x=b(p,f);return x===void 0?p:x}else{if(Fa(p))return ZL(p,g=>b(g,f));{const g=b(p,f);if(g===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return p},u)}return l.getInitialState=o,l}var U7="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",q7=(e=21)=>{let t="",n=e;for(;n--;)t+=U7[Math.random()*64|0];return t},B7=Symbol.for("rtk-slice-createasyncthunk");function F7(e,t){return`${e}/${t}`}function $7({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[B7];return function(i){const{name:o,reducerPath:l=o}=i;if(!o)throw new Error(na(11));const u=(typeof i.reducers=="function"?i.reducers(H7()):i.reducers)||{},f=Object.keys(u),h={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(T,_){const P=typeof T=="string"?T:T.type;if(!P)throw new Error(na(12));if(P in h.sliceCaseReducersByType)throw new Error(na(13));return h.sliceCaseReducersByType[P]=_,p},addMatcher(T,_){return h.sliceMatchers.push({matcher:T,reducer:_}),p},exposeAction(T,_){return h.actionCreators[T]=_,p},exposeCaseReducer(T,_){return h.sliceCaseReducersByName[T]=_,p}};f.forEach(T=>{const _=u[T],P={reducerName:T,type:F7(o,T),createNotation:typeof i.reducers=="function"};Y7(_)?Q7(P,_,p,t):G7(P,_,p)});function b(){const[T={},_=[],P=void 0]=typeof i.extraReducers=="function"?rI(i.extraReducers):[i.extraReducers],D={...T,...h.sliceCaseReducersByType};return z7(i.initialState,L=>{for(let z in D)L.addCase(z,D[z]);for(let z of h.sliceMatchers)L.addMatcher(z.matcher,z.reducer);for(let z of _)L.addMatcher(z.matcher,z.reducer);P&&L.addDefaultCase(P)})}const g=T=>T,x=new Map,E=new WeakMap;let S;function A(T,_){return S||(S=b()),S(T,_)}function j(){return S||(S=b()),S.getInitialState()}function C(T,_=!1){function P(L){let z=L[T];return typeof z>"u"&&_&&(z=zm(E,P,j)),z}function D(L=g){const z=zm(x,_,()=>new WeakMap);return zm(z,L,()=>{const R={};for(const[q,U]of Object.entries(i.selectors??{}))R[q]=K7(U,L,()=>zm(E,L,j),_);return R})}return{reducerPath:T,getSelectors:D,get selectors(){return D(P)},selectSlice:P}}const O={name:o,reducer:A,actions:h.actionCreators,caseReducers:h.sliceCaseReducersByName,getInitialState:j,...C(l),injectInto(T,{reducerPath:_,...P}={}){const D=_??l;return T.inject({reducerPath:D,reducer:A},P),{...O,...C(D,!0)}}};return O}}function K7(e,t,n,r){function i(o,...l){let u=t(o);return typeof u>"u"&&r&&(u=n()),e(u,...l)}return i.unwrapped=e,i}var lr=$7();function H7(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function G7({type:e,reducerName:t,createNotation:n},r,i){let o,l;if("reducer"in r){if(n&&!W7(r))throw new Error(na(17));o=r.reducer,l=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,l?ra(e,l):ra(e))}function Y7(e){return e._reducerDefinitionType==="asyncThunk"}function W7(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Q7({type:e,reducerName:t},n,r,i){if(!i)throw new Error(na(18));const{payloadCreator:o,fulfilled:l,pending:u,rejected:f,settled:h,options:p}=n,b=i(e,o,p);r.exposeAction(t,b),l&&r.addCase(b.fulfilled,l),u&&r.addCase(b.pending,u),f&&r.addCase(b.rejected,f),h&&r.addMatcher(b.settled,h),r.exposeCaseReducer(t,{fulfilled:l||Um,pending:u||Um,rejected:f||Um,settled:h||Um})}function Um(){}var V7="task",aI="listener",iI="completed",LE="cancelled",X7=`task-${LE}`,Z7=`task-${iI}`,Xw=`${aI}-${LE}`,J7=`${aI}-${iI}`,Gb=class{constructor(e){Gs(this,"code");Gs(this,"name","TaskAbortError");Gs(this,"message");this.code=e,this.message=`${V7} ${LE} (reason: ${e})`}},IE=(e,t)=>{if(typeof e!="function")throw new TypeError(na(32))},Lp=()=>{},oI=(e,t=Lp)=>(e.catch(t),e),sI=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),pl=e=>{if(e.aborted)throw new Gb(e.reason)};function lI(e,t){let n=Lp;return new Promise((r,i)=>{const o=()=>i(new Gb(e.reason));if(e.aborted){o();return}n=sI(e,o),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Lp})}var eQ=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Gb?"cancelled":"rejected",error:n}}finally{t==null||t()}},Ip=e=>t=>oI(lI(e,t).then(n=>(pl(e),n))),cI=e=>{const t=Ip(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:$c}=Object,e_={},Yb="listenerMiddleware",tQ=(e,t)=>{const n=r=>sI(e,()=>r.abort(e.reason));return(r,i)=>{IE(r);const o=new AbortController;n(o);const l=eQ(async()=>{pl(e),pl(o.signal);const u=await r({pause:Ip(o.signal),delay:cI(o.signal),signal:o.signal});return pl(o.signal),u},()=>o.abort(Z7));return i!=null&&i.autoJoin&&t.push(l.catch(Lp)),{result:Ip(e)(l),cancel(){o.abort(X7)}}}},nQ=(e,t)=>{const n=async(r,i)=>{pl(t);let o=()=>{};const u=[new Promise((f,h)=>{let p=e({predicate:r,effect:(b,g)=>{g.unsubscribe(),f([b,g.getState(),g.getOriginalState()])}});o=()=>{p(),h()}})];i!=null&&u.push(new Promise(f=>setTimeout(f,i,null)));try{const f=await lI(t,Promise.race(u));return pl(t),f}finally{o()}};return((r,i)=>oI(n(r,i)))},uI=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:o}=e;if(t)i=ra(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(na(21));return IE(o),{predicate:i,type:t,effect:o}},dI=$c(e=>{const{type:t,predicate:n,effect:r}=uI(e);return{id:q7(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(na(22))}}},{withTypes:()=>dI}),t_=(e,t)=>{const{type:n,effect:r,predicate:i}=uI(t);return Array.from(e.values()).find(o=>(typeof n=="string"?o.type===n:o.predicate===i)&&o.effect===r)},Zw=e=>{e.pending.forEach(t=>{t.abort(Xw)})},rQ=(e,t)=>()=>{for(const n of t.keys())Zw(n);e.clear()},n_=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},fI=$c(ra(`${Yb}/add`),{withTypes:()=>fI}),aQ=ra(`${Yb}/removeAll`),hI=$c(ra(`${Yb}/remove`),{withTypes:()=>hI}),iQ=(...e)=>{console.error(`${Yb}/error`,...e)},Ff=(e={})=>{const t=new Map,n=new Map,r=x=>{const E=n.get(x)??0;n.set(x,E+1)},i=x=>{const E=n.get(x)??1;E===1?n.delete(x):n.set(x,E-1)},{extra:o,onError:l=iQ}=e;IE(l);const u=x=>(x.unsubscribe=()=>t.delete(x.id),t.set(x.id,x),E=>{x.unsubscribe(),E!=null&&E.cancelActive&&Zw(x)}),f=(x=>{const E=t_(t,x)??dI(x);return u(E)});$c(f,{withTypes:()=>f});const h=x=>{const E=t_(t,x);return E&&(E.unsubscribe(),x.cancelActive&&Zw(E)),!!E};$c(h,{withTypes:()=>h});const p=async(x,E,S,A)=>{const j=new AbortController,C=nQ(f,j.signal),O=[];try{x.pending.add(j),r(x),await Promise.resolve(x.effect(E,$c({},S,{getOriginalState:A,condition:(T,_)=>C(T,_).then(Boolean),take:C,delay:cI(j.signal),pause:Ip(j.signal),extra:o,signal:j.signal,fork:tQ(j.signal,O),unsubscribe:x.unsubscribe,subscribe:()=>{t.set(x.id,x)},cancelActiveListeners:()=>{x.pending.forEach((T,_,P)=>{T!==j&&(T.abort(Xw),P.delete(T))})},cancel:()=>{j.abort(Xw),x.pending.delete(j)},throwIfCancelled:()=>{pl(j.signal)}})))}catch(T){T instanceof Gb||n_(l,T,{raisedBy:"effect"})}finally{await Promise.all(O),j.abort(J7),i(x),x.pending.delete(j)}},b=rQ(t,n);return{middleware:x=>E=>S=>{if(!FL(S))return E(S);if(fI.match(S))return f(S.payload);if(aQ.match(S)){b();return}if(hI.match(S))return h(S.payload);let A=x.getState();const j=()=>{if(A===e_)throw new Error(na(23));return A};let C;try{if(C=E(S),t.size>0){const O=x.getState(),T=Array.from(t.values());for(const _ of T){let P=!1;try{P=_.predicate(S,O,A)}catch(D){P=!1,n_(l,D,{raisedBy:"predicate"})}P&&p(_,S,x,j)}}}finally{A=e_}return C},startListening:f,stopListening:h,clearListeners:b}};function na(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var oQ={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},mI=lr({name:"chartLayout",initialState:oQ,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,o;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:sQ,setLayout:lQ,setChartSize:cQ,setScale:uQ}=mI.actions,dQ=mI.reducer;function pI(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Ye(e){return Number.isFinite(e)}function gi(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function r_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ic(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r_(Object(n),!0).forEach(function(r){fQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fQ(e,t,n){return(t=hQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hQ(e){var t=mQ(e,"string");return typeof t=="symbol"?t:t+""}function mQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ot(e,t,n){return Mt(e)||Mt(t)?n:vi(t)?El(e,t,n):typeof t=="function"?t(e):n}var pQ=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:o,verticalAlign:l,layout:u}=t;if((u==="vertical"||u==="horizontal"&&l==="middle")&&o!=="center"&&ye(e[o]))return Ic(Ic({},e),{},{[o]:e[o]+(r||0)});if((u==="horizontal"||u==="vertical"&&o==="center")&&l!=="middle"&&ye(e[l]))return Ic(Ic({},e),{},{[l]:e[l]+(i||0)})}return e},Ha=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",bI=(e,t,n,r)=>{if(r)return e.map(u=>u.coordinate);var i,o,l=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===n&&(o=!0),u.coordinate));return i||l.push(t),o||l.push(n),l},vI=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:o,scale:l,realScaleType:u,isCategorical:f,categoricalDomain:h,tickCount:p,ticks:b,niceTicks:g,axisType:x}=e;if(!l)return null;var E=u==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,S=i==="category"&&l.bandwidth?l.bandwidth()/E:0;if(S=x==="angleAxis"&&o&&o.length>=2?kn(o[0]-o[1])*2*S:S,b||g){var A=(b||g||[]).map((j,C)=>{var O=r?r.indexOf(j):j,T=l.map(O);return Ye(T)?{coordinate:T+S,value:j,offset:S,index:C}:null}).filter(Rr);return A}return f&&h?h.map((j,C)=>{var O=l.map(j);return Ye(O)?{coordinate:O+S,value:j,index:C,offset:S}:null}).filter(Rr):l.ticks&&p!=null?l.ticks(p).map((j,C)=>{var O=l.map(j);return Ye(O)?{coordinate:O+S,value:j,index:C,offset:S}:null}).filter(Rr):l.domain().map((j,C)=>{var O=l.map(j);return Ye(O)?{coordinate:O+S,value:r?r[j]:j,index:C,offset:S}:null}).filter(Rr)},bQ=(e,t)=>{if(!t||t.length!==2||!ye(t[0])||!ye(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!ye(e[0])||e[0]<n)&&(i[0]=n),(!ye(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},vQ=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var o=0,l=0,u=0;u<n;++u){var f=e[u],h=f==null?void 0:f[i];if(h!=null){var p=h[1],b=h[0],g=Ba(p)?b:p;g>=0?(h[0]=o,o+=g,h[1]=o):(h[0]=l,l+=g,h[1]=l)}}}},gQ=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var o=0,l=0;l<n;++l){var u=e[l],f=u==null?void 0:u[i];if(f!=null){var h=Ba(f[1])?f[0]:f[1];h>=0?(f[0]=o,o+=h,f[1]=o):(f[0]=0,f[1]=0)}}}},yQ={sign:vQ,expand:LW,none:Sl,silhouette:IW,wiggle:zW,positive:gQ},xQ=(e,t,n)=>{var r,i=(r=yQ[n])!==null&&r!==void 0?r:Sl,o=kW().keys(t).value((u,f)=>Number(ot(u,f,0))).order(Bw).offset(i),l=o(e);return l.forEach((u,f)=>{u.forEach((h,p)=>{var b=ot(e[p],t[f],0);Array.isArray(b)&&b.length===2&&ye(b[0])&&ye(b[1])&&(h[0]=b[0],h[1]=b[1])})}),l};function gI(e){return e==null?void 0:String(e)}function zp(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:o,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Mt(i[t.dataKey])){var u=wL(n,"value",i[t.dataKey]);if(u)return u.coordinate+r/2}return n!=null&&n[o]?n[o].coordinate+r/2:null}var f=ot(i,Mt(l)?t.dataKey:l),h=t.scale.map(f);return ye(h)?h:null}var a_=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:o,index:l}=e;if(t.type==="category")return n[l]?n[l].coordinate+r:null;var u=ot(o,t.dataKey,t.scale.domain()[l]);if(Mt(u))return null;var f=t.scale.map(u);return ye(f)?f-i/2+r:null},wQ=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},SQ=e=>{var t=e.flat(2).filter(ye);return[Math.min(...t),Math.max(...t)]},EQ=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],AQ=(e,t,n)=>{if(e!=null)return EQ(Object.keys(e).reduce((r,i)=>{var o=e[i];if(!o)return r;var{stackedData:l}=o,u=l.reduce((f,h)=>{var p=pI(h,t,n),b=SQ(p);return!Ye(b[0])||!Ye(b[1])?f:[Math.min(f[0],b[0]),Math.max(f[1],b[1])]},[1/0,-1/0]);return[Math.min(u[0],r[0]),Math.max(u[1],r[1])]},[1/0,-1/0]))},i_=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,o_=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ys=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=zb(t,p=>p.coordinate),o=1/0,l=1,u=i.length;l<u;l++){var f=i[l],h=i[l-1];o=Math.min(((f==null?void 0:f.coordinate)||0)-((h==null?void 0:h.coordinate)||0),o)}return o===1/0?0:o}return n?void 0:0};function s_(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:o}=e;return Ic(Ic({},t),{},{dataKey:n,payload:r,value:i,name:o})}function As(e,t){if(e)return String(e);if(typeof t=="string")return t}var jQ=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},CQ=(e,t)=>t==="centric"?e.angle:e.radius,vo=e=>e.layout.width,go=e=>e.layout.height,OQ=e=>e.layout.scale,yI=e=>e.layout.margin,Wb=W(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Qb=W(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),xI="data-recharts-item-index",wI="data-recharts-item-id",$f=60;function l_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?l_(Object(n),!0).forEach(function(r){NQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NQ(e,t,n){return(t=TQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TQ(e){var t=PQ(e,"string");return typeof t=="symbol"?t:t+""}function PQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _Q=e=>e.brush.height;function DQ(e){var t=Qb(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:$f;return n+i}return n},0)}function MQ(e){var t=Qb(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:$f;return n+i}return n},0)}function RQ(e){var t=Wb(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function kQ(e){var t=Wb(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var En=W([vo,go,yI,_Q,DQ,MQ,RQ,kQ,zL,s7],(e,t,n,r,i,o,l,u,f,h)=>{var p={left:(n.left||0)+i,right:(n.right||0)+o},b={top:(n.top||0)+l,bottom:(n.bottom||0)+u},g=qm(qm({},b),p),x=g.bottom;g.bottom+=r,g=pQ(g,f,h);var E=e-g.left-g.right,S=t-g.top-g.bottom;return qm(qm({brushBottom:x},g),{},{width:Math.max(E,0),height:Math.max(S,0)})}),LQ=W(En,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),zE=W(vo,go,(e,t)=>({x:0,y:0,width:e,height:t})),IQ=v.createContext(null),Ln=()=>v.useContext(IQ)!=null,Vb=e=>e.brush,Xb=W([Vb,En,yI],(e,t,n)=>({height:e.height,x:ye(e.x)?e.x:t.left,y:ye(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:ye(e.width)?e.width:t.width})),xx={},wx={},Sx={},c_;function zQ(){if(c_)return Sx;c_=1;function e(t,n,{signal:r,edges:i}={}){let o,l=null;const u=i!=null&&i.includes("leading"),f=i==null||i.includes("trailing"),h=()=>{l!==null&&(t.apply(o,l),o=void 0,l=null)},p=()=>{f&&h(),E()};let b=null;const g=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,p()},n)},x=()=>{b!==null&&(clearTimeout(b),b=null)},E=()=>{x(),o=void 0,l=null},S=()=>{h()},A=function(...j){if(r!=null&&r.aborted)return;o=this,l=j;const C=b==null;g(),u&&C&&h()};return A.schedule=g,A.cancel=E,A.flush=S,r==null||r.addEventListener("abort",E,{once:!0}),A}return Sx.debounce=e,Sx}var u_;function UQ(){if(u_)return wx;u_=1;const e=zQ();function t(n,r=0,i={}){typeof i!="object"&&(i={});const{leading:o=!1,trailing:l=!0,maxWait:u}=i,f=Array(2);o&&(f[0]="leading"),l&&(f[1]="trailing");let h,p=null;const b=e.debounce(function(...E){h=n.apply(this,E),p=null},r,{edges:f}),g=function(...E){return u!=null&&(p===null&&(p=Date.now()),Date.now()-p>=u)?(h=n.apply(this,E),p=Date.now(),b.cancel(),b.schedule(),h):(b.apply(this,E),h)},x=()=>(b.flush(),h);return g.cancel=b.cancel,g.flush=x,g}return wx.debounce=t,wx}var d_;function qQ(){if(d_)return xx;d_=1;const e=UQ();function t(n,r=0,i={}){const{leading:o=!0,trailing:l=!0}=i;return e.debounce(n,r,{leading:o,maxWait:r,trailing:l})}return xx.throttle=t,xx}var Ex,f_;function BQ(){return f_||(f_=1,Ex=qQ().throttle),Ex}var FQ=BQ();const $Q=Ei(FQ);var Up=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},di={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},SI=(e,t,n)=>{var{width:r=di.width,height:i=di.height,aspect:o,maxHeight:l}=n,u=Al(r)?e:Number(r),f=Al(i)?t:Number(i);return o&&o>0&&(u?f=u/o:f&&(u=f*o),l&&f!=null&&f>l&&(f=l)),{calculatedWidth:u,calculatedHeight:f}},KQ={width:0,height:0,overflow:"visible"},HQ={width:0,overflowX:"visible"},GQ={height:0,overflowY:"visible"},YQ={},WQ=e=>{var{width:t,height:n}=e,r=Al(t),i=Al(n);return r&&i?KQ:r?HQ:i?GQ:YQ};function QQ(e){var{width:t,height:n,aspect:r}=e,i=t,o=n;return i===void 0&&o===void 0?(i=di.width,o=di.height):i===void 0?i=r&&r>0?void 0:di.width:o===void 0&&(o=r&&r>0?void 0:di.height),{width:i,height:o}}function Jw(){return Jw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jw.apply(null,arguments)}function h_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function m_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?h_(Object(n),!0).forEach(function(r){VQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VQ(e,t,n){return(t=XQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XQ(e){var t=ZQ(e,"string");return typeof t=="symbol"?t:t+""}function ZQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EI=v.createContext(di.initialDimension);function JQ(e){return gi(e.width)&&gi(e.height)}function AI(e){var{children:t,width:n,height:r}=e,i=v.useMemo(()=>({width:n,height:r}),[n,r]);return JQ(i)?v.createElement(EI.Provider,{value:i},t):null}var UE=()=>v.useContext(EI),eV=v.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=di.initialDimension,width:i,height:o,minWidth:l=di.minWidth,minHeight:u,maxHeight:f,children:h,debounce:p=di.debounce,id:b,className:g,onResize:x,style:E={}}=e,S=v.useRef(null),A=v.useRef();A.current=x,v.useImperativeHandle(t,()=>S.current);var[j,C]=v.useState({containerWidth:r.width,containerHeight:r.height}),O=v.useCallback((L,z)=>{C(R=>{var q=Math.round(L),U=Math.round(z);return R.containerWidth===q&&R.containerHeight===U?R:{containerWidth:q,containerHeight:U}})},[]);v.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return Es;var L=U=>{var re,G=U[0];if(G!=null){var{width:ie,height:K}=G.contentRect;O(ie,K),(re=A.current)===null||re===void 0||re.call(A,ie,K)}};p>0&&(L=$Q(L,p,{trailing:!0,leading:!1}));var z=new ResizeObserver(L),{width:R,height:q}=S.current.getBoundingClientRect();return O(R,q),z.observe(S.current),()=>{z.disconnect()}},[O,p]);var{containerWidth:T,containerHeight:_}=j;Up(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:P,calculatedHeight:D}=SI(T,_,{width:i,height:o,aspect:n,maxHeight:f});return Up(P!=null&&P>0||D!=null&&D>0,`The width(%s) and height(%s) of chart should be greater than 0,235 */var _P;function z9(){if(_P)return ox;_P=1;var e=xu(),t=I9();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,u=e.useMemo,f=e.useDebugValue;return ox.useSyncExternalStoreWithSelector=function(h,p,b,g,x){var E=o(null);if(E.current===null){var S={hasValue:!1,value:null};E.current=S}else S=E.current;E=u(function(){function j(P){if(!C){if(C=!0,O=P,P=g(P),x!==void 0&&S.hasValue){var D=S.value;if(x(D,P))return T=D}return T=P}if(D=T,r(O,P))return D;var L=g(P);return x!==void 0&&x(D,L)?(O=P,D):(O=P,T=L)}var C=!1,O,T,_=b===void 0?null:b;return[function(){return j(p())},_===null?void 0:function(){return j(_())}]},[p,b,g,x]);var A=i(h,E[0],E[1]);return l(function(){S.hasValue=!0,S.value=A},[A]),f(A),A},ox}var DP;function U9(){return DP||(DP=1,ix.exports=z9()),ix.exports}var q9=U9(),_E=v.createContext(null),B9=e=>e,xt=()=>{var e=v.useContext(_E);return e?e.store.dispatch:B9},rp=()=>{},F9=()=>rp,$9=(e,t)=>e===t;function we(e){var t=v.useContext(_E),n=v.useMemo(()=>t?r=>{if(r!=null)return e(r)}:rp,[t,e]);return q9.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:F9,t?t.store.getState:rp,t?t.store.getState:rp,n,$9)}function K9(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function H9(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function G9(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var MP=e=>Array.isArray(e)?e:[e];function Y9(e){const t=Array.isArray(e[0])?e[0]:e;return G9(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function W9(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Q9=class{constructor(e){this.value=e}deref(){return this.value}},V9=typeof WeakRef<"u"?WeakRef:Q9,X9=0,RP=1;function km(){return{s:X9,v:void 0,o:null,p:null}}function LL(e,t={}){let n=km();const{resultEqualityCheck:r}=t;let i,o=0;function l(){var b;let u=n;const{length:f}=arguments;for(let g=0,x=f;g<x;g++){const E=arguments[g];if(typeof E=="function"||typeof E=="object"&&E!==null){let S=u.o;S===null&&(u.o=S=new WeakMap);const A=S.get(E);A===void 0?(u=km(),S.set(E,u)):u=A}else{let S=u.p;S===null&&(u.p=S=new Map);const A=S.get(E);A===void 0?(u=km(),S.set(E,u)):u=A}}const h=u;let p;if(u.s===RP)p=u.v;else if(p=e.apply(null,arguments),o++,r){const g=((b=i==null?void 0:i.deref)==null?void 0:b.call(i))??i;g!=null&&r(g,p)&&(p=g,o!==0&&o--),i=typeof p=="object"&&p!==null||typeof p=="function"?new V9(p):p}return h.s=RP,h.v=p,p}return l.clearCache=()=>{n=km(),l.resetResultsCount()},l.resultsCount=()=>o,l.resetResultsCount=()=>{o=0},l}function Z9(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,l=0,u,f={},h=i.pop();typeof h=="object"&&(f=h,h=i.pop()),K9(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const p={...n,...f},{memoize:b,memoizeOptions:g=[],argsMemoize:x=LL,argsMemoizeOptions:E=[]}=p,S=MP(g),A=MP(E),j=Y9(i),C=b(function(){return o++,h.apply(null,arguments)},...S),O=x(function(){l++;const _=W9(j,arguments);return u=C.apply(null,_),u},...A);return Object.assign(O,{resultFunc:h,memoizedResultFunc:C,dependencies:j,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>u,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:b,argsMemoize:x})};return Object.assign(r,{withTypes:()=>r}),r}var W=Z9(LL),J9=Object.assign((e,t=W)=>{H9(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((l,u,f)=>(l[n[f]]=u,l),{}))},{withTypes:()=>J9}),cx={},ux={},kP;function e7(){if(kP)return ux;kP=1;function e(t,n=1){const r=[],i=Math.floor(n),o=(l,u)=>{for(let f=0;f<l.length;f++){const h=l[f];Array.isArray(h)&&u<i?o(h,u+1):r.push(h)}};return o(t,0),r}return ux.flatten=e,ux}var dx={},LP;function IL(){if(LP)return dx;LP=1;const e=PL(),t=RL(),n=_L(),r=ML();function i(o,l,u){return n.isObject(u)&&(typeof l=="number"&&t.isArrayLike(u)&&r.isIndex(l)&&l<u.length||typeof l=="string"&&l in u)?e.isEqualsSameValueZero(u[l],o):!1}return dx.isIterateeCall=i,dx}var fx={},hx={},IP;function t7(){if(IP)return hx;IP=1;function e(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const t=(n,r,i)=>{if(n!==r){const o=e(n),l=e(r);if(o===l&&o===0){if(n<r)return i==="desc"?1:-1;if(n>r)return i==="desc"?-1:1}return i==="desc"?l-o:o-l}return 0};return hx.compareValues=t,hx}var mx={},px={},zP;function zL(){if(zP)return px;zP=1;function e(t){return typeof t=="symbol"||t instanceof Symbol}return px.isSymbol=e,px}var UP;function n7(){if(UP)return mx;UP=1;const e=zL(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function r(i,o){return Array.isArray(i)?!1:typeof i=="number"||typeof i=="boolean"||i==null||e.isSymbol(i)?!0:typeof i=="string"&&(n.test(i)||!t.test(i))||o!=null&&Object.hasOwn(o,i)}return mx.isKey=r,mx}var qP;function r7(){if(qP)return fx;qP=1;const e=CE(),t=t7(),n=n7();function r(i,o,l,u){if(i==null)return[];l=u?void 0:l,Array.isArray(i)||(i=Object.values(i)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(b=>String(b));const f=(b,g)=>{let x=b;for(let E=0;E<g.length&&x!=null;++E)x=x[g[E]];return x},h=(b,g)=>g==null||b==null?g:typeof b=="object"&&"key"in b?Object.hasOwn(g,b.key)?g[b.key]:f(g,b.path):typeof b=="function"?b(g):Array.isArray(b)?f(g,b):typeof g=="object"?g[b]:g,p=o.map(b=>(Array.isArray(b)&&b.length===1&&(b=b[0]),b==null||typeof b=="function"||Array.isArray(b)||n.isKey(b)?b:{key:b,path:e.toPath(b)}));return i.map(b=>({original:b,criteria:p.map(g=>h(g,b))})).slice().sort((b,g)=>{for(let x=0;x<p.length;x++){const E=t.compareValues(b.criteria[x],g.criteria[x],l[x]);if(E!==0)return E}return 0}).map(b=>b.original)}return fx.orderBy=r,fx}var BP;function a7(){if(BP)return cx;BP=1;const e=e7(),t=IL(),n=r7();function r(i,...o){const l=o.length;return l>1&&t.isIterateeCall(i,o[0],o[1])?o=[]:l>2&&t.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),n.orderBy(i,e.flatten(o),["asc"])}return cx.sortBy=r,cx}var bx,FP;function i7(){return FP||(FP=1,bx=a7().sortBy),bx}var o7=i7();const zb=Ei(o7);var UL=e=>e.legend.settings,s7=e=>e.legend.size,l7=e=>e.legend.payload,c7=W([l7,UL],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?zb(r,n):r});function u7(){return we(c7)}var Lm=1;function qL(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=v.useState({height:0,left:0,top:0,width:0}),r=v.useCallback(i=>{if(i!=null){var o=i.getBoundingClientRect(),l={height:o.height,left:o.left,top:o.top,width:o.width};(Math.abs(l.height-t.height)>Lm||Math.abs(l.left-t.left)>Lm||Math.abs(l.top-t.top)>Lm||Math.abs(l.width-t.width)>Lm)&&n({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Yn(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var d7=typeof Symbol=="function"&&Symbol.observable||"@@observable",$P=d7,vx=()=>Math.random().toString(36).substring(7).split("").join("."),f7={INIT:`@@redux/INIT${vx()}`,REPLACE:`@@redux/REPLACE${vx()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${vx()}`},Np=f7;function DE(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function BL(e,t,n){if(typeof e!="function")throw new Error(Yn(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Yn(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Yn(1));return n(BL)(e,t)}let r=e,i=t,o=new Map,l=o,u=0,f=!1;function h(){l===o&&(l=new Map,o.forEach((A,j)=>{l.set(j,A)}))}function p(){if(f)throw new Error(Yn(3));return i}function b(A){if(typeof A!="function")throw new Error(Yn(4));if(f)throw new Error(Yn(5));let j=!0;h();const C=u++;return l.set(C,A),function(){if(j){if(f)throw new Error(Yn(6));j=!1,h(),l.delete(C),o=null}}}function g(A){if(!DE(A))throw new Error(Yn(7));if(typeof A.type>"u")throw new Error(Yn(8));if(typeof A.type!="string")throw new Error(Yn(17));if(f)throw new Error(Yn(9));try{f=!0,i=r(i,A)}finally{f=!1}return(o=l).forEach(C=>{C()}),A}function x(A){if(typeof A!="function")throw new Error(Yn(10));r=A,g({type:Np.REPLACE})}function E(){const A=b;return{subscribe(j){if(typeof j!="object"||j===null)throw new Error(Yn(11));function C(){const T=j;T.next&&T.next(p())}return C(),{unsubscribe:A(C)}},[$P](){return this}}}return g({type:Np.INIT}),{dispatch:g,subscribe:b,getState:p,replaceReducer:x,[$P]:E}}function h7(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Np.INIT})>"u")throw new Error(Yn(12));if(typeof n(void 0,{type:Np.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Yn(13))})}function FL(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const l=t[o];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{h7(n)}catch(o){i=o}return function(l={},u){if(i)throw i;let f=!1;const h={};for(let p=0;p<r.length;p++){const b=r[p],g=n[b],x=l[b],E=g(x,u);if(typeof E>"u")throw u&&u.type,new Error(Yn(14));h[b]=E,f=f||E!==x}return f=f||r.length!==Object.keys(l).length,f?h:l}}function Tp(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function m7(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(Yn(15))};const l={getState:i.getState,dispatch:(f,...h)=>o(f,...h)},u=e.map(f=>f(l));return o=Tp(...u)(i.dispatch),{...i,dispatch:o}}}function $L(e){return DE(e)&&"type"in e&&typeof e.type=="string"}var KL=Symbol.for("immer-nothing"),KP=Symbol.for("immer-draftable"),xr=Symbol.for("immer-state");function La(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ta=Object,du=ta.getPrototypeOf,Pp="constructor",Ub="prototype",$w="configurable",_p="enumerable",ap="writable",df="value",ho=e=>!!e&&!!e[xr];function Fa(e){var t;return e?HL(e)||Bb(e)||!!e[KP]||!!((t=e[Pp])!=null&&t[KP])||Fb(e)||$b(e):!1}var p7=ta[Ub][Pp].toString(),HP=new WeakMap;function HL(e){if(!e||!ME(e))return!1;const t=du(e);if(t===null||t===ta[Ub])return!0;const n=ta.hasOwnProperty.call(t,Pp)&&t[Pp];if(n===Object)return!0;if(!Lc(n))return!1;let r=HP.get(n);return r===void 0&&(r=Function.toString.call(n),HP.set(n,r)),r===p7}function qb(e,t,n=!0){Bf(e)===0?(n?Reflect.ownKeys(e):ta.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Bf(e){const t=e[xr];return t?t.type_:Bb(e)?1:Fb(e)?2:$b(e)?3:0}var GP=(e,t,n=Bf(e))=>n===2?e.has(t):ta[Ub].hasOwnProperty.call(e,t),Kw=(e,t,n=Bf(e))=>n===2?e.get(t):e[t],Dp=(e,t,n,r=Bf(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function b7(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Bb=Array.isArray,Fb=e=>e instanceof Map,$b=e=>e instanceof Set,ME=e=>typeof e=="object",Lc=e=>typeof e=="function",gx=e=>typeof e=="boolean";function v7(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var eo=e=>e.copy_||e.base_,RE=e=>e.modified_?e.copy_:e.base_;function Hw(e,t){if(Fb(e))return new Map(e);if($b(e))return new Set(e);if(Bb(e))return Array[Ub].slice.call(e);const n=HL(e);if(t===!0||t==="class_only"&&!n){const r=ta.getOwnPropertyDescriptors(e);delete r[xr];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const l=i[o],u=r[l];u[ap]===!1&&(u[ap]=!0,u[$w]=!0),(u.get||u.set)&&(r[l]={[$w]:!0,[ap]:!0,[_p]:u[_p],[df]:e[l]})}return ta.create(du(e),r)}else{const r=du(e);if(r!==null&&n)return{...e};const i=ta.create(r);return ta.assign(i,e)}}function kE(e,t=!1){return Kb(e)||ho(e)||!Fa(e)||(Bf(e)>1&&ta.defineProperties(e,{set:Im,add:Im,clear:Im,delete:Im}),ta.freeze(e),t&&qb(e,(n,r)=>{kE(r,!0)},!1)),e}function g7(){La(2)}var Im={[df]:g7};function Kb(e){return e===null||!ME(e)?!0:ta.isFrozen(e)}var Mp="MapSet",Gw="Patches",YP="ArrayMethods",GL={};function jl(e){const t=GL[e];return t||La(0,e),t}var WP=e=>!!GL[e],ff,YL=()=>ff,y7=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:WP(Mp)?jl(Mp):void 0,arrayMethodsPlugin_:WP(YP)?jl(YP):void 0});function QP(e,t){t&&(e.patchPlugin_=jl(Gw),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Yw(e){Ww(e),e.drafts_.forEach(x7),e.drafts_=null}function Ww(e){e===ff&&(ff=e.parent_)}var VP=e=>ff=y7(ff,e);function x7(e){const t=e[xr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function XP(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[xr].modified_&&(Yw(t),La(4)),Fa(e)&&(e=ZP(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[xr].base_,e,t)}else e=ZP(t,n);return w7(t,e,!0),Yw(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==KL?e:void 0}function ZP(e,t){if(Kb(t))return t;const n=t[xr];if(!n)return Rp(t,e.handledSet_,e);if(!Hb(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);VL(n,e)}return n.copy_}function w7(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&kE(t,n)}function WL(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Hb=(e,t)=>e.scope_===t,S7=[];function QL(e,t,n,r){const i=eo(e),o=e.type_;if(r!==void 0&&Kw(i,r,o)===t){Dp(i,r,n,o);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;qb(i,(f,h)=>{if(ho(h)){const p=u.get(h)||[];p.push(f),u.set(h,p)}})}const l=e.draftLocations_.get(t)??S7;for(const u of l)Dp(i,u,n,o)}function E7(e,t,n){e.callbacks_.push(function(i){var u;const o=t;if(!o||!Hb(o,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(o);const l=RE(o);QL(e,o.draft_??o,l,n),VL(o,i)})}function VL(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const o=i.getPath(e);o&&i.generatePatches_(e,o,t)}WL(e)}}function A7(e,t,n){const{scope_:r}=e;if(ho(n)){const i=n[xr];Hb(i,r)&&i.callbacks_.push(function(){ip(e);const l=RE(i);QL(e,n,l,t)})}else Fa(n)&&e.callbacks_.push(function(){const o=eo(e);e.type_===3?o.has(n)&&Rp(n,r.handledSet_,r):Kw(o,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Rp(Kw(e.copy_,t,e.type_),r.handledSet_,r)})}function Rp(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ho(e)||t.has(e)||!Fa(e)||Kb(e)||(t.add(e),qb(e,(r,i)=>{if(ho(i)){const o=i[xr];if(Hb(o,n)){const l=RE(o);Dp(e,r,l,e.type_),WL(o)}}else Fa(i)&&Rp(i,t,n)})),e}function j7(e,t){const n=Bb(e),r={type_:n?1:0,scope_:t?t.scope_:YL(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,o=kp;n&&(i=[r],o=hf);const{revoke:l,proxy:u}=Proxy.revocable(i,o);return r.draft_=u,r.revoke_=l,[u,r]}var kp={get(e,t){if(t===xr)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=eo(e);if(!GP(i,t,e.type_))return C7(e,i,t);const o=i[t];if(e.finalized_||!Fa(o)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&v7(t))return o;if(o===yx(e.base_,t)){ip(e);const l=e.type_===1?+t:t,u=Vw(e.scope_,o,e,l);return e.copy_[l]=u}return o},has(e,t){return t in eo(e)},ownKeys(e){return Reflect.ownKeys(eo(e))},set(e,t,n){const r=XL(eo(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=yx(eo(e),t),o=i==null?void 0:i[xr];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(b7(n,i)&&(n!==void 0||GP(e.base_,t,e.type_)))return!0;ip(e),Qw(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),A7(e,t,n)),!0},deleteProperty(e,t){return ip(e),yx(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Qw(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=eo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[ap]:!0,[$w]:e.type_!==1||t!=="length",[_p]:r[_p],[df]:n[t]}},defineProperty(){La(11)},getPrototypeOf(e){return du(e.base_)},setPrototypeOf(){La(12)}},hf={};for(let e in kp){let t=kp[e];hf[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}hf.deleteProperty=function(e,t){return hf.set.call(this,e,t,void 0)};hf.set=function(e,t,n){return kp.set.call(this,e[0],t,n,e[0])};function yx(e,t){const n=e[xr];return(n?eo(n):e)[t]}function C7(e,t,n){var i;const r=XL(t,n);return r?df in r?r[df]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function XL(e,t){if(!(t in e))return;let n=du(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=du(n)}}function Qw(e){e.modified_||(e.modified_=!0,e.parent_&&Qw(e.parent_))}function ip(e){e.copy_||(e.assigned_=new Map,e.copy_=Hw(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var O7=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Lc(n)&&!Lc(r)){const l=r;r=n;const u=this;return function(h=l,...p){return u.produce(h,b=>r.call(this,b,...p))}}Lc(r)||La(6),i!==void 0&&!Lc(i)&&La(7);let o;if(Fa(n)){const l=VP(this),u=Vw(l,n,void 0);let f=!0;try{o=r(u),f=!1}finally{f?Yw(l):Ww(l)}return QP(l,i),XP(o,l)}else if(!n||!ME(n)){if(o=r(n),o===void 0&&(o=n),o===KL&&(o=void 0),this.autoFreeze_&&kE(o,!0),i){const l=[],u=[];jl(Gw).generateReplacementPatches_(n,o,{patches_:l,inversePatches_:u}),i(l,u)}return o}else La(1,n)},this.produceWithPatches=(n,r)=>{if(Lc(n))return(u,...f)=>this.produceWithPatches(u,h=>n(h,...f));let i,o;return[this.produce(n,r,(u,f)=>{i=u,o=f}),i,o]},gx(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),gx(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),gx(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Fa(t)||La(8),ho(t)&&(t=xa(t));const n=VP(this),r=Vw(n,t,void 0);return r[xr].isManual_=!0,Ww(n),r}finishDraft(t,n){const r=t&&t[xr];(!r||!r.isManual_)&&La(9);const{scope_:i}=r;return QP(i,n),XP(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const o=n[r];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}r>-1&&(n=n.slice(r+1));const i=jl(Gw).applyPatches_;return ho(t)?i(t,n):this.produce(t,o=>i(o,n))}};function Vw(e,t,n,r){const[i,o]=Fb(t)?jl(Mp).proxyMap_(t,n):$b(t)?jl(Mp).proxySet_(t,n):j7(t,n);return((n==null?void 0:n.scope_)??YL()).drafts_.push(i),o.callbacks_=(n==null?void 0:n.callbacks_)??[],o.key_=r,n&&r!==void 0?E7(n,o,r):o.callbacks_.push(function(f){var p;(p=f.mapSetPlugin_)==null||p.fixSetContents(o);const{patchPlugin_:h}=f;o.modified_&&h&&h.generatePatches_(o,[],f)}),i}function xa(e){return ho(e)||La(10,e),ZL(e)}function ZL(e){if(!Fa(e)||Kb(e))return e;const t=e[xr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Hw(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Hw(e,!0);return qb(n,(i,o)=>{Dp(n,i,ZL(o))},r),t&&(t.finalized_=!1),n}var N7=new O7,JL=N7.produce;function eI(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var T7=eI(),P7=eI,_7=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Tp:Tp.apply(null,arguments)};function ra(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(na(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>$L(r)&&r.type===e,n}var tI=class Qd extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Qd.prototype)}static get[Symbol.species](){return Qd}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Qd(...t[0].concat(this)):new Qd(...t.concat(this))}};function JP(e){return Fa(e)?JL(e,()=>{}):e}function zm(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function D7(e){return typeof e=="boolean"}var M7=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let l=new tI;return n&&(D7(n)?l.push(T7):l.push(P7(n.extraArgument))),l},nI="RTK_autoBatch",_t=()=>e=>({payload:e,meta:{[nI]:!0}}),e_=e=>t=>{setTimeout(t,e)},R7=(e,t)=>n=>{let r=!1;const i=()=>{r||(r=!0,cancelAnimationFrame(o),clearTimeout(l),n())},o=e(i),l=setTimeout(i,t)},rI=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,l=!1;const u=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?R7(window.requestAnimationFrame,100):e_(10):e.type==="callback"?e.queueNotification:e_(e.timeout),h=()=>{l=!1,o&&(o=!1,u.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const b=()=>i&&p(),g=r.subscribe(b);return u.add(p),()=>{g(),u.delete(p)}},dispatch(p){var b;try{return i=!((b=p==null?void 0:p.meta)!=null&&b[nI]),o=!i,o&&(l||(l=!0,f(h))),r.dispatch(p)}finally{i=!0}}})},k7=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new tI(e);return r&&i.push(rI(typeof r=="object"?r:void 0)),i};function L7(e){const t=M7(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:o=void 0,enhancers:l=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(DE(n))u=FL(n);else throw new Error(na(1));let f;typeof r=="function"?f=r(t):f=t();let h=Tp;i&&(h=_7({trace:!1,...typeof i=="object"&&i}));const p=m7(...f),b=k7(p);let g=typeof l=="function"?l(b):b();const x=h(...g);return BL(u,o,x)}function aI(e){const t={},n=[];let r;const i={addCase(o,l){const u=typeof o=="string"?o:o.type;if(!u)throw new Error(na(28));if(u in t)throw new Error(na(29));return t[u]=l,i},addAsyncThunk(o,l){return l.pending&&(t[o.pending.type]=l.pending),l.rejected&&(t[o.rejected.type]=l.rejected),l.fulfilled&&(t[o.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:o.settled,reducer:l.settled}),i},addMatcher(o,l){return n.push({matcher:o,reducer:l}),i},addDefaultCase(o){return r=o,i}};return e(i),[t,n,r]}function I7(e){return typeof e=="function"}function z7(e,t){let[n,r,i]=aI(t),o;if(I7(e))o=()=>JP(e());else{const u=JP(e);o=()=>u}function l(u=o(),f){let h=[n[f.type],...r.filter(({matcher:p})=>p(f)).map(({reducer:p})=>p)];return h.filter(p=>!!p).length===0&&(h=[i]),h.reduce((p,b)=>{if(b)if(ho(p)){const x=b(p,f);return x===void 0?p:x}else{if(Fa(p))return JL(p,g=>b(g,f));{const g=b(p,f);if(g===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return p},u)}return l.getInitialState=o,l}var U7="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",q7=(e=21)=>{let t="",n=e;for(;n--;)t+=U7[Math.random()*64|0];return t},B7=Symbol.for("rtk-slice-createasyncthunk");function F7(e,t){return`${e}/${t}`}function $7({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[B7];return function(i){const{name:o,reducerPath:l=o}=i;if(!o)throw new Error(na(11));const u=(typeof i.reducers=="function"?i.reducers(H7()):i.reducers)||{},f=Object.keys(u),h={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(T,_){const P=typeof T=="string"?T:T.type;if(!P)throw new Error(na(12));if(P in h.sliceCaseReducersByType)throw new Error(na(13));return h.sliceCaseReducersByType[P]=_,p},addMatcher(T,_){return h.sliceMatchers.push({matcher:T,reducer:_}),p},exposeAction(T,_){return h.actionCreators[T]=_,p},exposeCaseReducer(T,_){return h.sliceCaseReducersByName[T]=_,p}};f.forEach(T=>{const _=u[T],P={reducerName:T,type:F7(o,T),createNotation:typeof i.reducers=="function"};Y7(_)?Q7(P,_,p,t):G7(P,_,p)});function b(){const[T={},_=[],P=void 0]=typeof i.extraReducers=="function"?aI(i.extraReducers):[i.extraReducers],D={...T,...h.sliceCaseReducersByType};return z7(i.initialState,L=>{for(let z in D)L.addCase(z,D[z]);for(let z of h.sliceMatchers)L.addMatcher(z.matcher,z.reducer);for(let z of _)L.addMatcher(z.matcher,z.reducer);P&&L.addDefaultCase(P)})}const g=T=>T,x=new Map,E=new WeakMap;let S;function A(T,_){return S||(S=b()),S(T,_)}function j(){return S||(S=b()),S.getInitialState()}function C(T,_=!1){function P(L){let z=L[T];return typeof z>"u"&&_&&(z=zm(E,P,j)),z}function D(L=g){const z=zm(x,_,()=>new WeakMap);return zm(z,L,()=>{const F={};for(const[G,R]of Object.entries(i.selectors??{}))F[G]=K7(R,L,()=>zm(E,L,j),_);return F})}return{reducerPath:T,getSelectors:D,get selectors(){return D(P)},selectSlice:P}}const O={name:o,reducer:A,actions:h.actionCreators,caseReducers:h.sliceCaseReducersByName,getInitialState:j,...C(l),injectInto(T,{reducerPath:_,...P}={}){const D=_??l;return T.inject({reducerPath:D,reducer:A},P),{...O,...C(D,!0)}}};return O}}function K7(e,t,n,r){function i(o,...l){let u=t(o);return typeof u>"u"&&r&&(u=n()),e(u,...l)}return i.unwrapped=e,i}var lr=$7();function H7(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function G7({type:e,reducerName:t,createNotation:n},r,i){let o,l;if("reducer"in r){if(n&&!W7(r))throw new Error(na(17));o=r.reducer,l=r.prepare}else o=r;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,l?ra(e,l):ra(e))}function Y7(e){return e._reducerDefinitionType==="asyncThunk"}function W7(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Q7({type:e,reducerName:t},n,r,i){if(!i)throw new Error(na(18));const{payloadCreator:o,fulfilled:l,pending:u,rejected:f,settled:h,options:p}=n,b=i(e,o,p);r.exposeAction(t,b),l&&r.addCase(b.fulfilled,l),u&&r.addCase(b.pending,u),f&&r.addCase(b.rejected,f),h&&r.addMatcher(b.settled,h),r.exposeCaseReducer(t,{fulfilled:l||Um,pending:u||Um,rejected:f||Um,settled:h||Um})}function Um(){}var V7="task",iI="listener",oI="completed",LE="cancelled",X7=`task-${LE}`,Z7=`task-${oI}`,Xw=`${iI}-${LE}`,J7=`${iI}-${oI}`,Gb=class{constructor(e){Gs(this,"code");Gs(this,"name","TaskAbortError");Gs(this,"message");this.code=e,this.message=`${V7} ${LE} (reason: ${e})`}},IE=(e,t)=>{if(typeof e!="function")throw new TypeError(na(32))},Lp=()=>{},sI=(e,t=Lp)=>(e.catch(t),e),lI=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),pl=e=>{if(e.aborted)throw new Gb(e.reason)};function cI(e,t){let n=Lp;return new Promise((r,i)=>{const o=()=>i(new Gb(e.reason));if(e.aborted){o();return}n=lI(e,o),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Lp})}var eQ=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Gb?"cancelled":"rejected",error:n}}finally{t==null||t()}},Ip=e=>t=>sI(cI(e,t).then(n=>(pl(e),n))),uI=e=>{const t=Ip(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:$c}=Object,t_={},Yb="listenerMiddleware",tQ=(e,t)=>{const n=r=>lI(e,()=>r.abort(e.reason));return(r,i)=>{IE(r);const o=new AbortController;n(o);const l=eQ(async()=>{pl(e),pl(o.signal);const u=await r({pause:Ip(o.signal),delay:uI(o.signal),signal:o.signal});return pl(o.signal),u},()=>o.abort(Z7));return i!=null&&i.autoJoin&&t.push(l.catch(Lp)),{result:Ip(e)(l),cancel(){o.abort(X7)}}}},nQ=(e,t)=>{const n=async(r,i)=>{pl(t);let o=()=>{};const u=[new Promise((f,h)=>{let p=e({predicate:r,effect:(b,g)=>{g.unsubscribe(),f([b,g.getState(),g.getOriginalState()])}});o=()=>{p(),h()}})];i!=null&&u.push(new Promise(f=>setTimeout(f,i,null)));try{const f=await cI(t,Promise.race(u));return pl(t),f}finally{o()}};return((r,i)=>sI(n(r,i)))},dI=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:o}=e;if(t)i=ra(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(na(21));return IE(o),{predicate:i,type:t,effect:o}},fI=$c(e=>{const{type:t,predicate:n,effect:r}=dI(e);return{id:q7(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(na(22))}}},{withTypes:()=>fI}),n_=(e,t)=>{const{type:n,effect:r,predicate:i}=dI(t);return Array.from(e.values()).find(o=>(typeof n=="string"?o.type===n:o.predicate===i)&&o.effect===r)},Zw=e=>{e.pending.forEach(t=>{t.abort(Xw)})},rQ=(e,t)=>()=>{for(const n of t.keys())Zw(n);e.clear()},r_=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},hI=$c(ra(`${Yb}/add`),{withTypes:()=>hI}),aQ=ra(`${Yb}/removeAll`),mI=$c(ra(`${Yb}/remove`),{withTypes:()=>mI}),iQ=(...e)=>{console.error(`${Yb}/error`,...e)},Ff=(e={})=>{const t=new Map,n=new Map,r=x=>{const E=n.get(x)??0;n.set(x,E+1)},i=x=>{const E=n.get(x)??1;E===1?n.delete(x):n.set(x,E-1)},{extra:o,onError:l=iQ}=e;IE(l);const u=x=>(x.unsubscribe=()=>t.delete(x.id),t.set(x.id,x),E=>{x.unsubscribe(),E!=null&&E.cancelActive&&Zw(x)}),f=(x=>{const E=n_(t,x)??fI(x);return u(E)});$c(f,{withTypes:()=>f});const h=x=>{const E=n_(t,x);return E&&(E.unsubscribe(),x.cancelActive&&Zw(E)),!!E};$c(h,{withTypes:()=>h});const p=async(x,E,S,A)=>{const j=new AbortController,C=nQ(f,j.signal),O=[];try{x.pending.add(j),r(x),await Promise.resolve(x.effect(E,$c({},S,{getOriginalState:A,condition:(T,_)=>C(T,_).then(Boolean),take:C,delay:uI(j.signal),pause:Ip(j.signal),extra:o,signal:j.signal,fork:tQ(j.signal,O),unsubscribe:x.unsubscribe,subscribe:()=>{t.set(x.id,x)},cancelActiveListeners:()=>{x.pending.forEach((T,_,P)=>{T!==j&&(T.abort(Xw),P.delete(T))})},cancel:()=>{j.abort(Xw),x.pending.delete(j)},throwIfCancelled:()=>{pl(j.signal)}})))}catch(T){T instanceof Gb||r_(l,T,{raisedBy:"effect"})}finally{await Promise.all(O),j.abort(J7),i(x),x.pending.delete(j)}},b=rQ(t,n);return{middleware:x=>E=>S=>{if(!$L(S))return E(S);if(hI.match(S))return f(S.payload);if(aQ.match(S)){b();return}if(mI.match(S))return h(S.payload);let A=x.getState();const j=()=>{if(A===t_)throw new Error(na(23));return A};let C;try{if(C=E(S),t.size>0){const O=x.getState(),T=Array.from(t.values());for(const _ of T){let P=!1;try{P=_.predicate(S,O,A)}catch(D){P=!1,r_(l,D,{raisedBy:"predicate"})}P&&p(_,S,x,j)}}}finally{A=t_}return C},startListening:f,stopListening:h,clearListeners:b}};function na(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var oQ={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},pI=lr({name:"chartLayout",initialState:oQ,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,o;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:sQ,setLayout:lQ,setChartSize:cQ,setScale:uQ}=pI.actions,dQ=pI.reducer;function bI(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function Ye(e){return Number.isFinite(e)}function gi(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function a_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ic(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a_(Object(n),!0).forEach(function(r){fQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fQ(e,t,n){return(t=hQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hQ(e){var t=mQ(e,"string");return typeof t=="symbol"?t:t+""}function mQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ot(e,t,n){return Mt(e)||Mt(t)?n:vi(t)?El(e,t,n):typeof t=="function"?t(e):n}var pQ=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:o,verticalAlign:l,layout:u}=t;if((u==="vertical"||u==="horizontal"&&l==="middle")&&o!=="center"&&ye(e[o]))return Ic(Ic({},e),{},{[o]:e[o]+(r||0)});if((u==="horizontal"||u==="vertical"&&o==="center")&&l!=="middle"&&ye(e[l]))return Ic(Ic({},e),{},{[l]:e[l]+(i||0)})}return e},Ha=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",vI=(e,t,n,r)=>{if(r)return e.map(u=>u.coordinate);var i,o,l=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===n&&(o=!0),u.coordinate));return i||l.push(t),o||l.push(n),l},gI=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:o,scale:l,realScaleType:u,isCategorical:f,categoricalDomain:h,tickCount:p,ticks:b,niceTicks:g,axisType:x}=e;if(!l)return null;var E=u==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,S=i==="category"&&l.bandwidth?l.bandwidth()/E:0;if(S=x==="angleAxis"&&o&&o.length>=2?kn(o[0]-o[1])*2*S:S,b||g){var A=(b||g||[]).map((j,C)=>{var O=r?r.indexOf(j):j,T=l.map(O);return Ye(T)?{coordinate:T+S,value:j,offset:S,index:C}:null}).filter(Rr);return A}return f&&h?h.map((j,C)=>{var O=l.map(j);return Ye(O)?{coordinate:O+S,value:j,index:C,offset:S}:null}).filter(Rr):l.ticks&&p!=null?l.ticks(p).map((j,C)=>{var O=l.map(j);return Ye(O)?{coordinate:O+S,value:j,index:C,offset:S}:null}).filter(Rr):l.domain().map((j,C)=>{var O=l.map(j);return Ye(O)?{coordinate:O+S,value:r?r[j]:j,index:C,offset:S}:null}).filter(Rr)},bQ=(e,t)=>{if(!t||t.length!==2||!ye(t[0])||!ye(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!ye(e[0])||e[0]<n)&&(i[0]=n),(!ye(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},vQ=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var o=0,l=0,u=0;u<n;++u){var f=e[u],h=f==null?void 0:f[i];if(h!=null){var p=h[1],b=h[0],g=Ba(p)?b:p;g>=0?(h[0]=o,o+=g,h[1]=o):(h[0]=l,l+=g,h[1]=l)}}}},gQ=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var o=0,l=0;l<n;++l){var u=e[l],f=u==null?void 0:u[i];if(f!=null){var h=Ba(f[1])?f[0]:f[1];h>=0?(f[0]=o,o+=h,f[1]=o):(f[0]=0,f[1]=0)}}}},yQ={sign:vQ,expand:LW,none:Sl,silhouette:IW,wiggle:zW,positive:gQ},xQ=(e,t,n)=>{var r,i=(r=yQ[n])!==null&&r!==void 0?r:Sl,o=kW().keys(t).value((u,f)=>Number(ot(u,f,0))).order(Bw).offset(i),l=o(e);return l.forEach((u,f)=>{u.forEach((h,p)=>{var b=ot(e[p],t[f],0);Array.isArray(b)&&b.length===2&&ye(b[0])&&ye(b[1])&&(h[0]=b[0],h[1]=b[1])})}),l};function yI(e){return e==null?void 0:String(e)}function zp(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:o,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Mt(i[t.dataKey])){var u=SL(n,"value",i[t.dataKey]);if(u)return u.coordinate+r/2}return n!=null&&n[o]?n[o].coordinate+r/2:null}var f=ot(i,Mt(l)?t.dataKey:l),h=t.scale.map(f);return ye(h)?h:null}var i_=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:o,index:l}=e;if(t.type==="category")return n[l]?n[l].coordinate+r:null;var u=ot(o,t.dataKey,t.scale.domain()[l]);if(Mt(u))return null;var f=t.scale.map(u);return ye(f)?f-i/2+r:null},wQ=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},SQ=e=>{var t=e.flat(2).filter(ye);return[Math.min(...t),Math.max(...t)]},EQ=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],AQ=(e,t,n)=>{if(e!=null)return EQ(Object.keys(e).reduce((r,i)=>{var o=e[i];if(!o)return r;var{stackedData:l}=o,u=l.reduce((f,h)=>{var p=bI(h,t,n),b=SQ(p);return!Ye(b[0])||!Ye(b[1])?f:[Math.min(f[0],b[0]),Math.max(f[1],b[1])]},[1/0,-1/0]);return[Math.min(u[0],r[0]),Math.max(u[1],r[1])]},[1/0,-1/0]))},o_=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,s_=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ys=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=zb(t,p=>p.coordinate),o=1/0,l=1,u=i.length;l<u;l++){var f=i[l],h=i[l-1];o=Math.min(((f==null?void 0:f.coordinate)||0)-((h==null?void 0:h.coordinate)||0),o)}return o===1/0?0:o}return n?void 0:0};function l_(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:o}=e;return Ic(Ic({},t),{},{dataKey:n,payload:r,value:i,name:o})}function As(e,t){if(e)return String(e);if(typeof t=="string")return t}var jQ=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},CQ=(e,t)=>t==="centric"?e.angle:e.radius,vo=e=>e.layout.width,go=e=>e.layout.height,OQ=e=>e.layout.scale,xI=e=>e.layout.margin,Wb=W(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Qb=W(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),wI="data-recharts-item-index",SI="data-recharts-item-id",$f=60;function c_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c_(Object(n),!0).forEach(function(r){NQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NQ(e,t,n){return(t=TQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TQ(e){var t=PQ(e,"string");return typeof t=="symbol"?t:t+""}function PQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _Q=e=>e.brush.height;function DQ(e){var t=Qb(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:$f;return n+i}return n},0)}function MQ(e){var t=Qb(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:$f;return n+i}return n},0)}function RQ(e){var t=Wb(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function kQ(e){var t=Wb(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var En=W([vo,go,xI,_Q,DQ,MQ,RQ,kQ,UL,s7],(e,t,n,r,i,o,l,u,f,h)=>{var p={left:(n.left||0)+i,right:(n.right||0)+o},b={top:(n.top||0)+l,bottom:(n.bottom||0)+u},g=qm(qm({},b),p),x=g.bottom;g.bottom+=r,g=pQ(g,f,h);var E=e-g.left-g.right,S=t-g.top-g.bottom;return qm(qm({brushBottom:x},g),{},{width:Math.max(E,0),height:Math.max(S,0)})}),LQ=W(En,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),zE=W(vo,go,(e,t)=>({x:0,y:0,width:e,height:t})),IQ=v.createContext(null),Ln=()=>v.useContext(IQ)!=null,Vb=e=>e.brush,Xb=W([Vb,En,xI],(e,t,n)=>({height:e.height,x:ye(e.x)?e.x:t.left,y:ye(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:ye(e.width)?e.width:t.width})),xx={},wx={},Sx={},u_;function zQ(){if(u_)return Sx;u_=1;function e(t,n,{signal:r,edges:i}={}){let o,l=null;const u=i!=null&&i.includes("leading"),f=i==null||i.includes("trailing"),h=()=>{l!==null&&(t.apply(o,l),o=void 0,l=null)},p=()=>{f&&h(),E()};let b=null;const g=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,p()},n)},x=()=>{b!==null&&(clearTimeout(b),b=null)},E=()=>{x(),o=void 0,l=null},S=()=>{h()},A=function(...j){if(r!=null&&r.aborted)return;o=this,l=j;const C=b==null;g(),u&&C&&h()};return A.schedule=g,A.cancel=E,A.flush=S,r==null||r.addEventListener("abort",E,{once:!0}),A}return Sx.debounce=e,Sx}var d_;function UQ(){if(d_)return wx;d_=1;const e=zQ();function t(n,r=0,i={}){typeof i!="object"&&(i={});const{leading:o=!1,trailing:l=!0,maxWait:u}=i,f=Array(2);o&&(f[0]="leading"),l&&(f[1]="trailing");let h,p=null;const b=e.debounce(function(...E){h=n.apply(this,E),p=null},r,{edges:f}),g=function(...E){return u!=null&&(p===null&&(p=Date.now()),Date.now()-p>=u)?(h=n.apply(this,E),p=Date.now(),b.cancel(),b.schedule(),h):(b.apply(this,E),h)},x=()=>(b.flush(),h);return g.cancel=b.cancel,g.flush=x,g}return wx.debounce=t,wx}var f_;function qQ(){if(f_)return xx;f_=1;const e=UQ();function t(n,r=0,i={}){const{leading:o=!0,trailing:l=!0}=i;return e.debounce(n,r,{leading:o,maxWait:r,trailing:l})}return xx.throttle=t,xx}var Ex,h_;function BQ(){return h_||(h_=1,Ex=qQ().throttle),Ex}var FQ=BQ();const $Q=Ei(FQ);var Up=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},di={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},EI=(e,t,n)=>{var{width:r=di.width,height:i=di.height,aspect:o,maxHeight:l}=n,u=Al(r)?e:Number(r),f=Al(i)?t:Number(i);return o&&o>0&&(u?f=u/o:f&&(u=f*o),l&&f!=null&&f>l&&(f=l)),{calculatedWidth:u,calculatedHeight:f}},KQ={width:0,height:0,overflow:"visible"},HQ={width:0,overflowX:"visible"},GQ={height:0,overflowY:"visible"},YQ={},WQ=e=>{var{width:t,height:n}=e,r=Al(t),i=Al(n);return r&&i?KQ:r?HQ:i?GQ:YQ};function QQ(e){var{width:t,height:n,aspect:r}=e,i=t,o=n;return i===void 0&&o===void 0?(i=di.width,o=di.height):i===void 0?i=r&&r>0?void 0:di.width:o===void 0&&(o=r&&r>0?void 0:di.height),{width:i,height:o}}function Jw(){return Jw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jw.apply(null,arguments)}function m_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function p_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m_(Object(n),!0).forEach(function(r){VQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VQ(e,t,n){return(t=XQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XQ(e){var t=ZQ(e,"string");return typeof t=="symbol"?t:t+""}function ZQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var AI=v.createContext(di.initialDimension);function JQ(e){return gi(e.width)&&gi(e.height)}function jI(e){var{children:t,width:n,height:r}=e,i=v.useMemo(()=>({width:n,height:r}),[n,r]);return JQ(i)?v.createElement(AI.Provider,{value:i},t):null}var UE=()=>v.useContext(AI),eV=v.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=di.initialDimension,width:i,height:o,minWidth:l=di.minWidth,minHeight:u,maxHeight:f,children:h,debounce:p=di.debounce,id:b,className:g,onResize:x,style:E={}}=e,S=v.useRef(null),A=v.useRef();A.current=x,v.useImperativeHandle(t,()=>S.current);var[j,C]=v.useState({containerWidth:r.width,containerHeight:r.height}),O=v.useCallback((L,z)=>{C(F=>{var G=Math.round(L),R=Math.round(z);return F.containerWidth===G&&F.containerHeight===R?F:{containerWidth:G,containerHeight:R}})},[]);v.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return Es;var L=R=>{var J,$=R[0];if($!=null){var{width:ne,height:K}=$.contentRect;O(ne,K),(J=A.current)===null||J===void 0||J.call(A,ne,K)}};p>0&&(L=$Q(L,p,{trailing:!0,leading:!1}));var z=new ResizeObserver(L),{width:F,height:G}=S.current.getBoundingClientRect();return O(F,G),z.observe(S.current),()=>{z.disconnect()}},[O,p]);var{containerWidth:T,containerHeight:_}=j;Up(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:P,calculatedHeight:D}=EI(T,_,{width:i,height:o,aspect:n,maxHeight:f});return Up(P!=null&&P>0||D!=null&&D>0,`The width(%s) and height(%s) of chart should be greater than 0, 236 236 please check the style of container, or the props width(%s) and height(%s), 237 237 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 238 height and width.`,P,D,i,o,l,u,n),v.createElement("div",{id:b?"".concat(b):void 0,className:rt("recharts-responsive-container",g),style: m_(m_({},E),{},{width:i,height:o,minWidth:l,minHeight:u,maxHeight:f}),ref:S},v.createElement("div",{style:WQ({width:i,height:o})},v.createElement(AI,{width:P,height:D},h)))}),tV=v.forwardRef((e,t)=>{var n=UE();if(gi(n.width)&&gi(n.height))return e.children;var{width:r,height:i}=QQ({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:o,calculatedHeight:l}=SI(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return ye(o)&&ye(l)?v.createElement(AI,{width:o,height:l},e.children):v.createElement(eV,Jw({},e,{width:r,height:i,ref:t}))});function qE(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Zb=()=>{var e,t=Ln(),n=we(LQ),r=we(Xb),i=(e=we(Vb))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},nV={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},jI=()=>{var e;return(e=we(En))!==null&&e!==void 0?e:nV},BE=()=>we(vo),FE=()=>we(go),rV=()=>we(e=>e.layout.margin),tt=e=>e.layout.layoutType,js=()=>we(tt),$E=()=>{var e=js();if(e==="horizontal"||e==="vertical")return e},CI=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},aV=()=>{var e=js();return e!==void 0},Kf=e=>{var t=xt(),n=Ln(),{width:r,height:i}=e,o=UE(),l=r,u=i;return o&&(l=o.width>0?o.width:r,u=o.height>0?o.height:i),v.useEffect(()=>{!n&&gi(l)&&gi(u)&&t(cQ({width:l,height:u}))},[t,n,l,u]),null},OI=Symbol.for("immer-nothing"),p_=Symbol.for("immer-draftable"),aa=Symbol.for("immer-state");function Ia(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var hf=Object.getPrototypeOf;function fu(e){return!!e&&!!e[aa]}function Cl(e){var t;return e?NI(e)||Array.isArray(e)||!!e[p_]||!!((t=e.constructor)!=null&&t[p_])||Hf(e)||ev(e):!1}var iV=Object.prototype.constructor.toString(),b_=new WeakMap;function NI(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=b_.get(n);return r===void 0&&(r=Function.toString.call(n),b_.set(n,r)),r===iV}function qp(e,t,n=!0){Jb(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Jb(e){const t=e[aa];return t?t.type_:Array.isArray(e)?1:Hf(e)?2:ev(e)?3:0}function eS(e,t){return Jb(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function TI(e,t,n){const r=Jb(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function oV(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Hf(e){return e instanceof Map}function ev(e){return e instanceof Set}function Js(e){return e.copy_||e.base_}function tS(e,t){if(Hf(e))return new Map(e);if(ev(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=NI(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[aa];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const l=i[o],u=r[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(hf(e),r)}else{const r=hf(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function KE(e,t=!1){return tv(e)||fu(e)||!Cl(e)||(Jb(e)>1&&Object.defineProperties(e,{set:Bm,add:Bm,clear:Bm,delete:Bm}),Object.freeze(e),t&&Object.values(e).forEach(n=>KE(n,!0))),e}function sV(){Ia(2)}var Bm={value:sV};function tv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var lV={};function Ol(e){const t=lV[e];return t||Ia(0,e),t}var mf;function PI(){return mf}function cV(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function v_(e,t){t&&(Ol("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function nS(e){rS(e),e.drafts_.forEach(uV),e.drafts_=null}function rS(e){e===mf&&(mf=e.parent_)}function g_(e){return mf=cV(mf,e)}function uV(e){const t=e[aa];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function y_(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[aa].modified_&&(nS(t),Ia(4)),Cl(e)&&(e=Bp(t,e),t.parent_||Fp(t,e)),t.patches_&&Ol("Patches").generateReplacementPatches_(n[aa].base_,e,t.patches_,t.inversePatches_)):e=Bp(t,n,[]),nS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==OI?e:void 0}function Bp(e,t,n){if(tv(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[aa];if(!i)return qp(t,(o,l)=>x_(e,i,t,o,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Fp(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const o=i.copy_;let l=o,u=!1;i.type_===3&&(l=new Set(o),o.clear(),u=!0),qp(l,(f,h)=>x_(e,i,o,f,h,n,u),r),Fp(e,o,!1),n&&e.patches_&&Ol("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function x_(e,t,n,r,i,o,l){if(i==null||typeof i!="object"&&!l)return;const u=tv(i);if(!(u&&!l)){if(fu(i)){const f=o&&t&&t.type_!==3&&!eS(t.assigned_,r)?o.concat(r):void 0,h=Bp(e,i,f);if(TI(n,r,h),fu(h))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(Cl(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;Bp(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Hf(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Fp(e,i)}}}function Fp(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&KE(t,n)}function dV(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:PI(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=HE;n&&(i=[r],o=pf);const{revoke:l,proxy:u}=Proxy.revocable(i,o);return r.draft_=u,r.revoke_=l,u}var HE={get(e,t){if(t===aa)return e;const n=Js(e);if(!eS(n,t))return fV(e,n,t);const r=n[t];return e.finalized_||!Cl(r)?r:r===Ax(e.base_,t)?(jx(e),e.copy_[t]=iS(r,e)):r},has(e,t){return t in Js(e)},ownKeys(e){return Reflect.ownKeys(Js(e))},set(e,t,n){const r=_I(Js(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Ax(Js(e),t),o=i==null?void 0:i[aa];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(oV(n,i)&&(n!==void 0||eS(e.base_,t)))return!0;jx(e),aS(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Ax(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,jx(e),aS(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Js(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Ia(11)},getPrototypeOf(e){return hf(e.base_)},setPrototypeOf(){Ia(12)}},pf={};qp(HE,(e,t)=>{pf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});pf.deleteProperty=function(e,t){return pf.set.call(this,e,t,void 0)};pf.set=function(e,t,n){return HE.set.call(this,e[0],t,n,e[0])};function Ax(e,t){const n=e[aa];return(n?Js(n):e)[t]}function fV(e,t,n){var i;const r=_I(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function _I(e,t){if(!(t in e))return;let n=hf(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=hf(n)}}function aS(e){e.modified_||(e.modified_=!0,e.parent_&&aS(e.parent_))}function jx(e){e.copy_||(e.copy_=tS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var hV=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const l=this;return function(f=o,...h){return l.produce(f,p=>n.call(this,p,...h))}}typeof n!="function"&&Ia(6),r!==void 0&&typeof r!="function"&&Ia(7);let i;if(Cl(t)){const o=g_(this),l=iS(t,void 0);let u=!0;try{i=n(l),u=!1}finally{u?nS(o):rS(o)}return v_(o,r),y_(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===OI&&(i=void 0),this.autoFreeze_&&KE(i,!0),r){const o=[],l=[];Ol("Patches").generateReplacementPatches_(t,i,o,l),r(o,l)}return i}else Ia(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...u)=>this.produceWithPatches(l,f=>t(f,...u));let r,i;return[this.produce(t,n,(l,u)=>{r=l,i=u}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Cl(e)||Ia(8),fu(e)&&(e=mV(e));const t=g_(this),n=iS(e,void 0);return n[aa].isManual_=!0,rS(t),n}finishDraft(e,t){const n=e&&e[aa];(!n||!n.isManual_)&&Ia(9);const{scope_:r}=n;return v_(r,t),y_(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Ol("Patches").applyPatches_;return fu(e)?r(e,t):this.produce(e,i=>r(i,t))}};function iS(e,t){const n=Hf(e)?Ol("MapSet").proxyMap_(e,t):ev(e)?Ol("MapSet").proxySet_(e,t):dV(e,t);return(t?t.scope_:PI()).drafts_.push(n),n}function mV(e){return fu(e)||Ia(10,e),DI(e)}function DI(e){if(!Cl(e)||tv(e))return e;const t=e[aa];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=tS(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=tS(e,!0);return qp(n,(i,o)=>{TI(n,i,DI(o))},r),t&&(t.finalized_=!1),n}var pV=new hV;pV.produce;var bV={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},MI=lr({name:"legend",initialState:bV,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:_t()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xa(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:_t()},removeLegendPayload:{reducer(e,t){var n=xa(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:_t()}}}),{setLegendSize:w_,setLegendSettings:vV,addLegendPayload:RI,replaceLegendPayload:kI,removeLegendPayload:LI}=MI.actions,gV=MI.reducer,Cx={exports:{}},Ox={};/**238 height and width.`,P,D,i,o,l,u,n),v.createElement("div",{id:b?"".concat(b):void 0,className:rt("recharts-responsive-container",g),style:p_(p_({},E),{},{width:i,height:o,minWidth:l,minHeight:u,maxHeight:f}),ref:S},v.createElement("div",{style:WQ({width:i,height:o})},v.createElement(jI,{width:P,height:D},h)))}),tV=v.forwardRef((e,t)=>{var n=UE();if(gi(n.width)&&gi(n.height))return e.children;var{width:r,height:i}=QQ({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:o,calculatedHeight:l}=EI(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return ye(o)&&ye(l)?v.createElement(jI,{width:o,height:l},e.children):v.createElement(eV,Jw({},e,{width:r,height:i,ref:t}))});function qE(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Zb=()=>{var e,t=Ln(),n=we(LQ),r=we(Xb),i=(e=we(Vb))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},nV={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},CI=()=>{var e;return(e=we(En))!==null&&e!==void 0?e:nV},BE=()=>we(vo),FE=()=>we(go),rV=()=>we(e=>e.layout.margin),tt=e=>e.layout.layoutType,js=()=>we(tt),$E=()=>{var e=js();if(e==="horizontal"||e==="vertical")return e},OI=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},aV=()=>{var e=js();return e!==void 0},Kf=e=>{var t=xt(),n=Ln(),{width:r,height:i}=e,o=UE(),l=r,u=i;return o&&(l=o.width>0?o.width:r,u=o.height>0?o.height:i),v.useEffect(()=>{!n&&gi(l)&&gi(u)&&t(cQ({width:l,height:u}))},[t,n,l,u]),null},NI=Symbol.for("immer-nothing"),b_=Symbol.for("immer-draftable"),aa=Symbol.for("immer-state");function Ia(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var mf=Object.getPrototypeOf;function fu(e){return!!e&&!!e[aa]}function Cl(e){var t;return e?TI(e)||Array.isArray(e)||!!e[b_]||!!((t=e.constructor)!=null&&t[b_])||Hf(e)||ev(e):!1}var iV=Object.prototype.constructor.toString(),v_=new WeakMap;function TI(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=v_.get(n);return r===void 0&&(r=Function.toString.call(n),v_.set(n,r)),r===iV}function qp(e,t,n=!0){Jb(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Jb(e){const t=e[aa];return t?t.type_:Array.isArray(e)?1:Hf(e)?2:ev(e)?3:0}function eS(e,t){return Jb(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function PI(e,t,n){const r=Jb(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function oV(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Hf(e){return e instanceof Map}function ev(e){return e instanceof Set}function Js(e){return e.copy_||e.base_}function tS(e,t){if(Hf(e))return new Map(e);if(ev(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=TI(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[aa];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const l=i[o],u=r[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(mf(e),r)}else{const r=mf(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function KE(e,t=!1){return tv(e)||fu(e)||!Cl(e)||(Jb(e)>1&&Object.defineProperties(e,{set:Bm,add:Bm,clear:Bm,delete:Bm}),Object.freeze(e),t&&Object.values(e).forEach(n=>KE(n,!0))),e}function sV(){Ia(2)}var Bm={value:sV};function tv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var lV={};function Ol(e){const t=lV[e];return t||Ia(0,e),t}var pf;function _I(){return pf}function cV(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function g_(e,t){t&&(Ol("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function nS(e){rS(e),e.drafts_.forEach(uV),e.drafts_=null}function rS(e){e===pf&&(pf=e.parent_)}function y_(e){return pf=cV(pf,e)}function uV(e){const t=e[aa];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function x_(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[aa].modified_&&(nS(t),Ia(4)),Cl(e)&&(e=Bp(t,e),t.parent_||Fp(t,e)),t.patches_&&Ol("Patches").generateReplacementPatches_(n[aa].base_,e,t.patches_,t.inversePatches_)):e=Bp(t,n,[]),nS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==NI?e:void 0}function Bp(e,t,n){if(tv(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[aa];if(!i)return qp(t,(o,l)=>w_(e,i,t,o,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Fp(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const o=i.copy_;let l=o,u=!1;i.type_===3&&(l=new Set(o),o.clear(),u=!0),qp(l,(f,h)=>w_(e,i,o,f,h,n,u),r),Fp(e,o,!1),n&&e.patches_&&Ol("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function w_(e,t,n,r,i,o,l){if(i==null||typeof i!="object"&&!l)return;const u=tv(i);if(!(u&&!l)){if(fu(i)){const f=o&&t&&t.type_!==3&&!eS(t.assigned_,r)?o.concat(r):void 0,h=Bp(e,i,f);if(PI(n,r,h),fu(h))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(Cl(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;Bp(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Hf(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Fp(e,i)}}}function Fp(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&KE(t,n)}function dV(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:_I(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=HE;n&&(i=[r],o=bf);const{revoke:l,proxy:u}=Proxy.revocable(i,o);return r.draft_=u,r.revoke_=l,u}var HE={get(e,t){if(t===aa)return e;const n=Js(e);if(!eS(n,t))return fV(e,n,t);const r=n[t];return e.finalized_||!Cl(r)?r:r===Ax(e.base_,t)?(jx(e),e.copy_[t]=iS(r,e)):r},has(e,t){return t in Js(e)},ownKeys(e){return Reflect.ownKeys(Js(e))},set(e,t,n){const r=DI(Js(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Ax(Js(e),t),o=i==null?void 0:i[aa];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(oV(n,i)&&(n!==void 0||eS(e.base_,t)))return!0;jx(e),aS(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Ax(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,jx(e),aS(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Js(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Ia(11)},getPrototypeOf(e){return mf(e.base_)},setPrototypeOf(){Ia(12)}},bf={};qp(HE,(e,t)=>{bf[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});bf.deleteProperty=function(e,t){return bf.set.call(this,e,t,void 0)};bf.set=function(e,t,n){return HE.set.call(this,e[0],t,n,e[0])};function Ax(e,t){const n=e[aa];return(n?Js(n):e)[t]}function fV(e,t,n){var i;const r=DI(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function DI(e,t){if(!(t in e))return;let n=mf(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=mf(n)}}function aS(e){e.modified_||(e.modified_=!0,e.parent_&&aS(e.parent_))}function jx(e){e.copy_||(e.copy_=tS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var hV=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const l=this;return function(f=o,...h){return l.produce(f,p=>n.call(this,p,...h))}}typeof n!="function"&&Ia(6),r!==void 0&&typeof r!="function"&&Ia(7);let i;if(Cl(t)){const o=y_(this),l=iS(t,void 0);let u=!0;try{i=n(l),u=!1}finally{u?nS(o):rS(o)}return g_(o,r),x_(i,o)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===NI&&(i=void 0),this.autoFreeze_&&KE(i,!0),r){const o=[],l=[];Ol("Patches").generateReplacementPatches_(t,i,o,l),r(o,l)}return i}else Ia(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...u)=>this.produceWithPatches(l,f=>t(f,...u));let r,i;return[this.produce(t,n,(l,u)=>{r=l,i=u}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Cl(e)||Ia(8),fu(e)&&(e=mV(e));const t=y_(this),n=iS(e,void 0);return n[aa].isManual_=!0,rS(t),n}finishDraft(e,t){const n=e&&e[aa];(!n||!n.isManual_)&&Ia(9);const{scope_:r}=n;return g_(r,t),x_(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Ol("Patches").applyPatches_;return fu(e)?r(e,t):this.produce(e,i=>r(i,t))}};function iS(e,t){const n=Hf(e)?Ol("MapSet").proxyMap_(e,t):ev(e)?Ol("MapSet").proxySet_(e,t):dV(e,t);return(t?t.scope_:_I()).drafts_.push(n),n}function mV(e){return fu(e)||Ia(10,e),MI(e)}function MI(e){if(!Cl(e)||tv(e))return e;const t=e[aa];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=tS(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=tS(e,!0);return qp(n,(i,o)=>{PI(n,i,MI(o))},r),t&&(t.finalized_=!1),n}var pV=new hV;pV.produce;var bV={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},RI=lr({name:"legend",initialState:bV,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:_t()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xa(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:_t()},removeLegendPayload:{reducer(e,t){var n=xa(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:_t()}}}),{setLegendSize:S_,setLegendSettings:vV,addLegendPayload:kI,replaceLegendPayload:LI,removeLegendPayload:II}=RI.actions,gV=RI.reducer,Cx={exports:{}},Ox={};/** 239 239 * @license React 240 240 * use-sync-external-store-with-selector.production.js … … 244 244 * This source code is licensed under the MIT license found in the 245 245 * LICENSE file in the root directory of this source tree. 246 */var S_;function yV(){if(S_)return Ox;S_=1;var e=xu();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,o=e.useEffect,l=e.useMemo,u=e.useDebugValue;return Ox.useSyncExternalStoreWithSelector=function(f,h,p,b,g){var x=i(null);if(x.current===null){var E={hasValue:!1,value:null};x.current=E}else E=x.current;x=l(function(){function A(_){if(!j){if(j=!0,C=_,_=b(_),g!==void 0&&E.hasValue){var P=E.value;if(g(P,_))return O=P}return O=_}if(P=O,n(C,_))return P;var D=b(_);return g!==void 0&&g(P,D)?(C=_,P):(C=_,O=D)}var j=!1,C,O,T=p===void 0?null:p;return[function(){return A(h())},T===null?void 0:function(){return A(T())}]},[h,p,b,g]);var S=r(f,x[0],x[1]);return o(function(){E.hasValue=!0,E.value=S},[S]),u(S),S},Ox}var E_;function xV(){return E_||(E_=1,Cx.exports=yV()),Cx.exports}xV();function wV(e){e()}function SV(){let e=null,t=null;return{clear(){e=null,t=null},notify(){wV(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var A_={notify(){},get:()=>[]};function EV(e,t){let n,r=A_,i=0,o=!1;function l(S){p();const A=r.subscribe(S);let j=!1;return()=>{j||(j=!0,A(),b())}}function u(){r.notify()}function f(){E.onStateChange&&E.onStateChange()}function h(){return o}function p(){i++,n||(n=e.subscribe(f),r=SV())}function b(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=A_)}function g(){o||(o=!0,p())}function x(){o&&(o=!1,b())}const E={addNestedSub:l,notifyNestedSubs:u,handleChangeWrapper:f,isSubscribed:h,trySubscribe:g,tryUnsubscribe:x,getListeners:()=>r};return E}var AV=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jV=AV(),CV=()=>typeof navigator<"u"&&navigator.product==="ReactNative",OV=CV(),NV=()=>jV||OV?v.useLayoutEffect:v.useEffect,TV=NV();function j_(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function PV(e,t){if(j_(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!j_(e[n[i]],t[n[i]]))return!1;return!0}var Nx=Symbol.for("react-redux-context"),Tx=typeof globalThis<"u"?globalThis:{};function _V(){if(!v.createContext)return{};const e=Tx[Nx]??(Tx[Nx]=new Map);let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var DV=_V();function MV(e){const{children:t,context:n,serverState:r,store:i}=e,o=v.useMemo(()=>{const f=EV(i);return{store:i,subscription:f,getServerState:r?()=>r:void 0}},[i,r]),l=v.useMemo(()=>i.getState(),[i]);TV(()=>{const{subscription:f}=o;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),l!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[o,l]);const u=n||DV;return v.createElement(u.Provider,{value:o},t)}var RV=MV,kV=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function LV(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Ml(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(kV.has(r)){if(e[r]==null&&t[r]==null)continue;if(!PV(e[r],t[r]))return!1}else if(!LV(e[r],t[r]))return!1;return!0}var IV=["contextPayload"];function oS(){return oS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oS.apply(null,arguments)}function C_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C_(Object(n),!0).forEach(function(r){zV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zV(e,t,n){return(t=UV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UV(e){var t=qV(e,"string");return typeof t=="symbol"?t:t+""}function qV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BV(e,t){if(e==null)return{};var n,r,i=FV(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function FV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function $V(e){return e.value}function KV(e){var{contextPayload:t}=e,n=BV(e,IV),r=RL(t,e.payloadUniqBy,$V),i=hu(hu({},n),{},{payload:r});return v.isValidElement(e.content)?v.cloneElement(e.content,i):typeof e.content=="function"?v.createElement(e.content,i):v.createElement(h9,i)}function HV(e,t,n,r,i,o){var{layout:l,align:u,verticalAlign:f}=t,h,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(u==="center"&&l==="vertical"?h={left:((r||0)-o.width)/2}:h=u==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(f==="middle"?p={top:((i||0)-o.height)/2}:p=f==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),hu(hu({},h),p)}function GV(e){var t=xt();return v.useEffect(()=>{t(vV(e))},[t,e]),null}function YV(e){var t=xt();return v.useEffect(()=>(t(w_(e)),()=>{t(w_({width:0,height:0}))}),[t,e]),null}function WV(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var QV={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function VV(e){var t=on(e,QV),n=u7(),r=iW(),i=rV(),{width:o,height:l,wrapperStyle:u,portal:f}=t,[h,p]=UL([n]),b=BE(),g=FE();if(b==null||g==null)return null;var x=b-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),E=WV(t.layout,l,o,x),S=f?u:hu(hu({position:"absolute",width:(E==null?void 0:E.width)||o||"auto",height:(E==null?void 0:E.height)||l||"auto"},HV(u,t,i,b,g,h)),u),A=f??r;if(A==null||n==null)return null;var j=v.createElement("div",{className:"recharts-legend-wrapper",style:S,ref:p},v.createElement(GV,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!f&&v.createElement(YV,{width:h.width,height:h.height}),v.createElement(KV,oS({},t,E,{margin:i,chartWidth:b,chartHeight:g,contextPayload:n})));return Vn.createPortal(j,A)}var Qd=v.memo(VV,Ml);Qd.displayName="Legend";function sS(){return sS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sS.apply(null,arguments)}function O_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O_(Object(n),!0).forEach(function(r){XV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XV(e,t,n){return(t=ZV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZV(e){var t=JV(e,"string");return typeof t=="symbol"?t:t+""}function JV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eX(e){return Array.isArray(e)&&vi(e[0])&&vi(e[1])?e.join(" ~ "):e}var Ac={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function tX(e,t){return t==null?e:zb(e,t)}var nX=e=>{var{separator:t=Ac.separator,contentStyle:n,itemStyle:r,labelStyle:i=Ac.labelStyle,payload:o,formatter:l,itemSorter:u,wrapperClassName:f,labelClassName:h,label:p,labelFormatter:b,accessibilityLayer:g=Ac.accessibilityLayer}=e,x=()=>{if(o&&o.length){var _={padding:0,margin:0},P=tX(o,u),D=P.map((L,z)=>{if(!L||L.type==="none")return null;var R=L.formatter||l||eX,{value:q,name:U}=L,re=q,G=U;if(R){var ie=R(q,U,L,z,o);if(Array.isArray(ie))[re,G]=ie;else if(ie!=null)re=ie;else return null}var K=Rd(Rd({},Ac.itemStyle),{},{color:L.color||Ac.itemStyle.color},r);return v.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:K},vi(G)?v.createElement("span",{className:"recharts-tooltip-item-name"},G):null,vi(G)?v.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,v.createElement("span",{className:"recharts-tooltip-item-value"},re),v.createElement("span",{className:"recharts-tooltip-item-unit"},L.unit||""))});return v.createElement("ul",{className:"recharts-tooltip-item-list",style:_},D)}return null},E=Rd(Rd({},Ac.contentStyle),n),S=Rd({margin:0},i),A=!Mt(p),j=A?p:"",C=rt("recharts-default-tooltip",f),O=rt("recharts-tooltip-label",h);A&&b&&o!==void 0&&o!==null&&(j=b(p,o));var T=g?{role:"status","aria-live":"assertive"}:{};return v.createElement("div",sS({className:C,style:E},T),v.createElement("p",{className:O,style:S},v.isValidElement(j)?j:"".concat(j)),x())},kd="recharts-tooltip-wrapper",rX={visibility:"hidden"};function aX(e){var{coordinate:t,translateX:n,translateY:r}=e;return rt(kd,{["".concat(kd,"-right")]:ye(n)&&t&&ye(t.x)&&n>=t.x,["".concat(kd,"-left")]:ye(n)&&t&&ye(t.x)&&n<t.x,["".concat(kd,"-bottom")]:ye(r)&&t&&ye(t.y)&&r>=t.y,["".concat(kd,"-top")]:ye(r)&&t&&ye(t.y)&&r<t.y})}function N_(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:o,reverseDirection:l,tooltipDimension:u,viewBox:f,viewBoxDimension:h}=e;if(o&&ye(o[r]))return o[r];var p=n[r]-u-(i>0?i:0),b=n[r]+i;if(t[r])return l[r]?p:b;var g=f[r];if(g==null)return 0;if(l[r]){var x=p,E=g;return x<E?Math.max(b,g):Math.max(p,g)}if(h==null)return 0;var S=b+u,A=g+h;return S>A?Math.max(p,g):Math.max(b,g)}function iX(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function oX(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:o,reverseDirection:l,tooltipBox:u,useTranslate3d:f,viewBox:h}=e,p,b,g;return u.height>0&&u.width>0&&n?(b=N_({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:o,reverseDirection:l,tooltipDimension:u.width,viewBox:h,viewBoxDimension:h.width}),g=N_({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:o,reverseDirection:l,tooltipDimension:u.height,viewBox:h,viewBoxDimension:h.height}),p=iX({translateX:b,translateY:g,useTranslate3d:f})):p=rX,{cssProperties:p,cssClasses:aX({translateX:b,translateY:g,coordinate:n})}}var sX=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Gf={isSsr:sX()};function II(){var[e,t]=v.useState(()=>Gf.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return v.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function T_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?T_(Object(n),!0).forEach(function(r){lX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):T_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lX(e,t,n){return(t=cX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cX(e){var t=uX(e,"string");return typeof t=="symbol"?t:t+""}function uX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dX(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function fX(e){var t,n,r,i,o,l,u=II(),[f,h]=v.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));v.useEffect(()=>{var E=S=>{if(S.key==="Escape"){var A,j,C,O;h({dismissed:!0,dismissedAtCoordinate:{x:(A=(j=e.coordinate)===null||j===void 0?void 0:j.x)!==null&&A!==void 0?A:0,y:(C=(O=e.coordinate)===null||O===void 0?void 0:O.y)!==null&&C!==void 0?C:0}})}};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),f.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==f.dismissedAtCoordinate.x||((o=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&o!==void 0?o:0)!==f.dismissedAtCoordinate.y)&&h(jc(jc({},f),{},{dismissed:!1}));var{cssClasses:p,cssProperties:b}=oX({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),g=e.hasPortalFromProps?{}:jc(jc({transition:dX({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},b),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),x=jc(jc({},g),{},{visibility:!f.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return v.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:x,ref:e.innerRef},e.children)}var hX=v.memo(fX),zI=()=>{var e;return(e=we(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function lS(){return lS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lS.apply(null,arguments)}function P_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function __(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P_(Object(n),!0).forEach(function(r){mX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mX(e,t,n){return(t=pX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pX(e){var t=bX(e,"string");return typeof t=="symbol"?t:t+""}function bX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var D_={curveBasisClosed:AW,curveBasisOpen:jW,curveBasis:EW,curveBumpX:cW,curveBumpY:uW,curveLinearClosed:CW,curveLinear:Lb,curveMonotoneX:OW,curveMonotoneY:NW,curveNatural:TW,curveStep:PW,curveStepAfter:DW,curveStepBefore:_W},$p=e=>Ye(e.x)&&Ye(e.y),M_=e=>e.base!=null&&$p(e.base)&&$p(e),Ld=e=>e.x,Id=e=>e.y,vX=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Uf(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=D_["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return D_[n]||Lb},R_={connectNulls:!1,type:"linear"},gX=e=>{var{type:t=R_.type,points:n=[],baseLine:r,layout:i,connectNulls:o=R_.connectNulls}=e,l=vX(t,i),u=o?n.filter($p):n;if(Array.isArray(r)){var f,h=n.map((E,S)=>__(__({},E),{},{base:r[S]}));i==="vertical"?f=Rm().y(Id).x1(Ld).x0(E=>E.base.x):f=Rm().x(Ld).y1(Id).y0(E=>E.base.y);var p=f.defined(M_).curve(l),b=o?h.filter(M_):h;return p(b)}var g;i==="vertical"&&ye(r)?g=Rm().y(Id).x1(Ld).x0(r):ye(r)?g=Rm().x(Ld).y1(Id).y0(r):g=lL().x(Ld).y(Id);var x=g.defined($p).curve(l);return x(u)},Kc=e=>{var{className:t,points:n,path:r,pathRef:i}=e,o=js();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},u=n&&n.length?gX(l):r;return v.createElement("path",lS({},yr(e),TE(e),{className:rt("recharts-curve",t),d:u===null?void 0:u,ref:i}))},yX=["x","y","top","left","width","height","className"];function cS(){return cS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cS.apply(null,arguments)}function k_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k_(Object(n),!0).forEach(function(r){wX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wX(e,t,n){return(t=SX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SX(e){var t=EX(e,"string");return typeof t=="symbol"?t:t+""}function EX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AX(e,t){if(e==null)return{};var n,r,i=jX(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var CX=(e,t,n,r,i,o)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(o,",").concat(t,"h").concat(n),OX=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:o=0,height:l=0,className:u}=e,f=AX(e,yX),h=xX({x:t,y:n,top:r,left:i,width:o,height:l},f);return!ye(t)||!ye(n)||!ye(o)||!ye(l)||!ye(r)||!ye(i)?null:v.createElement("path",cS({},or(h),{className:rt("recharts-cross",u),d:CX(t,n,o,l,r,i)}))};function NX(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function L_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function I_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L_(Object(n),!0).forEach(function(r){TX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TX(e,t,n){return(t=PX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PX(e){var t=_X(e,"string");return typeof t=="symbol"?t:t+""}function _X(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var DX=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),UI=(e,t,n)=>e.map(r=>"".concat(DX(r)," ").concat(t,"ms ").concat(n)).join(","),MX=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),bf=(e,t)=>Object.keys(t).reduce((n,r)=>I_(I_({},n),{},{[r]:e(r,t[r])}),{});function z_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z_(Object(n),!0).forEach(function(r){RX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RX(e,t,n){return(t=kX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kX(e){var t=LX(e,"string");return typeof t=="symbol"?t:t+""}function LX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kp=(e,t,n)=>e+(t-e)*n,uS=e=>{var{from:t,to:n}=e;return t!==n},qI=(e,t,n)=>{var r=bf((i,o)=>{if(uS(o)){var[l,u]=e(o.from,o.to,o.velocity);return xn(xn({},o),{},{from:l,velocity:u})}return o},t);return n<1?bf((i,o)=>uS(o)&&r[i]!=null?xn(xn({},o),{},{velocity:Kp(o.velocity,r[i].velocity,n),from:Kp(o.from,r[i].from,n)}):o,t):qI(e,r,n-1)};function IX(e,t,n,r,i,o){var l,u=r.reduce((g,x)=>xn(xn({},g),{},{[x]:{from:e[x],velocity:0,to:t[x]}}),{}),f=()=>bf((g,x)=>x.from,u),h=()=>!Object.values(u).filter(uS).length,p=null,b=g=>{l||(l=g);var x=g-l,E=x/n.dt;u=qI(n,u,E),i(xn(xn(xn({},e),t),f())),l=g,h()||(p=o.setTimeout(b))};return()=>(p=o.setTimeout(b),()=>{var g;(g=p)===null||g===void 0||g()})}function zX(e,t,n,r,i,o,l){var u=null,f=i.reduce((b,g)=>{var x=e[g],E=t[g];return x==null||E==null?b:xn(xn({},b),{},{[g]:[x,E]})},{}),h,p=b=>{h||(h=b);var g=(b-h)/r,x=bf((S,A)=>Kp(...A,n(g)),f);if(o(xn(xn(xn({},e),t),x)),g<1)u=l.setTimeout(p);else{var E=bf((S,A)=>Kp(...A,n(1)),f);o(xn(xn(xn({},e),t),E))}};return()=>(u=l.setTimeout(p),()=>{var b;(b=u)===null||b===void 0||b()})}const UX=(e,t,n,r,i,o)=>{var l=MX(e,t);return n==null?()=>(i(xn(xn({},e),t)),()=>{}):n.isStepper===!0?IX(e,t,n,l,i,o):zX(e,t,n,r,l,i,o)};var Hp=1e-4,BI=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],FI=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),U_=(e,t)=>n=>{var r=BI(e,t);return FI(r,n)},qX=(e,t)=>n=>{var r=BI(e,t),i=[...r.map((o,l)=>o*l).slice(1),0];return FI(i,n)},BX=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(o=>parseFloat(o));return[i[0],i[1],i[2],i[3]]},FX=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=BX(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},$X=(e,t,n,r)=>{var i=U_(e,n),o=U_(t,r),l=qX(e,n),u=h=>h>1?1:h<0?0:h,f=h=>{for(var p=h>1?1:h,b=p,g=0;g<8;++g){var x=i(b)-p,E=l(b);if(Math.abs(x-p)<Hp||E<Hp)return o(b);b=u(b-x/E)}return o(b)};return f.isStepper=!1,f},q_=function(){return $X(...FX(...arguments))},KX=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,o=(l,u,f)=>{var h=-(l-u)*n,p=f*r,b=f+(h-p)*i/1e3,g=f*i/1e3+l;return Math.abs(g-u)<Hp&&Math.abs(b)<Hp?[u,0]:[g,b]};return o.isStepper=!0,o.dt=i,o},HX=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return q_(e);case"spring":return KX();default:if(e.split("(")[0]==="cubic-bezier")return q_(e)}return typeof e=="function"?e:null};function GX(e){var t,n=()=>null,r=!1,i=null,o=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var u=l,[f,...h]=u;if(typeof f=="number"){i=e.setTimeout(o.bind(null,h),f);return}o(f),i=e.setTimeout(o.bind(null,h));return}typeof l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),o(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class YX{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,o=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(o))};return i=requestAnimationFrame(o),()=>{i!=null&&cancelAnimationFrame(i)}}}function WX(){return GX(new YX)}var QX=v.createContext(WX);function VX(e,t){var n=v.useContext(QX);return v.useMemo(()=>t??n(e),[e,t,n])}var XX={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},B_={t:0},Px={t:1};function Cu(e){var t=on(e,XX),{isActive:n,canBegin:r,duration:i,easing:o,begin:l,onAnimationEnd:u,onAnimationStart:f,children:h}=t,p=II(),b=n==="auto"?!Gf.isSsr&&!p:n,g=VX(t.animationId,t.animationManager),[x,E]=v.useState(b?B_:Px),S=v.useRef(null);return v.useEffect(()=>{b||E(Px)},[b]),v.useEffect(()=>{if(!b||!r)return Es;var A=UX(B_,Px,HX(o),i,E,g.getTimeoutController()),j=()=>{S.current=A()};return g.start([f,l,j,i,u]),()=>{g.stop(),S.current&&S.current(),u()}},[b,r,i,o,l,f,u,g]),h(x.t)}function Ou(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=v.useRef(cf(t)),r=v.useRef(e);return r.current!==e&&(n.current=cf(t),r.current=e),n.current}var ZX=["radius"],JX=["radius"],F_,$_,K_,H_,G_,Y_,W_,Q_,V_,X_;function Z_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function J_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z_(Object(n),!0).forEach(function(r){eZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eZ(e,t,n){return(t=tZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tZ(e){var t=nZ(e,"string");return typeof t=="symbol"?t:t+""}function nZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gp.apply(null,arguments)}function eD(e,t){if(e==null)return{};var n,r,i=rZ(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function rZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ri(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var tD=(e,t,n,r,i)=>{var o=ms(n),l=ms(r),u=Math.min(Math.abs(o)/2,Math.abs(l)/2),f=l>=0?1:-1,h=o>=0?1:-1,p=l>=0&&o>=0||l<0&&o<0?1:0,b;if(u>0&&Array.isArray(i)){for(var g=[0,0,0,0],x=0,E=4;x<E;x++){var S,A=(S=i[x])!==null&&S!==void 0?S:0;g[x]=A>u?u:A}b=Xt(F_||(F_=ri(["M",",",""])),e,t+f*g[0]),g[0]>0&&(b+=Xt($_||($_=ri(["A ",",",",0,0,",",",",",""])),g[0],g[0],p,e+h*g[0],t)),b+=Xt(K_||(K_=ri(["L ",",",""])),e+n-h*g[1],t),g[1]>0&&(b+=Xt(H_||(H_=ri(["A ",",",",0,0,",`,247 `,",",""])),g[1],g[1],p,e+n,t+f*g[1])),b+=Xt( G_||(G_=ri(["L ",",",""])),e+n,t+r-f*g[2]),g[2]>0&&(b+=Xt(Y_||(Y_=ri(["A ",",",",0,0,",`,248 `,",",""])),g[2],g[2],p,e+n-h*g[2],t+r)),b+=Xt( W_||(W_=ri(["L ",",",""])),e+h*g[3],t+r),g[3]>0&&(b+=Xt(Q_||(Q_=ri(["A ",",",",0,0,",`,249 `,",",""])),g[3],g[3],p,e,t+r-f*g[3])),b+="Z"}else if(u>0&&i===+i&&i>0){var j=Math.min(u,i);b=Xt( V_||(V_=ri(["M ",",",`246 */var E_;function yV(){if(E_)return Ox;E_=1;var e=xu();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,o=e.useEffect,l=e.useMemo,u=e.useDebugValue;return Ox.useSyncExternalStoreWithSelector=function(f,h,p,b,g){var x=i(null);if(x.current===null){var E={hasValue:!1,value:null};x.current=E}else E=x.current;x=l(function(){function A(_){if(!j){if(j=!0,C=_,_=b(_),g!==void 0&&E.hasValue){var P=E.value;if(g(P,_))return O=P}return O=_}if(P=O,n(C,_))return P;var D=b(_);return g!==void 0&&g(P,D)?(C=_,P):(C=_,O=D)}var j=!1,C,O,T=p===void 0?null:p;return[function(){return A(h())},T===null?void 0:function(){return A(T())}]},[h,p,b,g]);var S=r(f,x[0],x[1]);return o(function(){E.hasValue=!0,E.value=S},[S]),u(S),S},Ox}var A_;function xV(){return A_||(A_=1,Cx.exports=yV()),Cx.exports}xV();function wV(e){e()}function SV(){let e=null,t=null;return{clear(){e=null,t=null},notify(){wV(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var j_={notify(){},get:()=>[]};function EV(e,t){let n,r=j_,i=0,o=!1;function l(S){p();const A=r.subscribe(S);let j=!1;return()=>{j||(j=!0,A(),b())}}function u(){r.notify()}function f(){E.onStateChange&&E.onStateChange()}function h(){return o}function p(){i++,n||(n=e.subscribe(f),r=SV())}function b(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=j_)}function g(){o||(o=!0,p())}function x(){o&&(o=!1,b())}const E={addNestedSub:l,notifyNestedSubs:u,handleChangeWrapper:f,isSubscribed:h,trySubscribe:g,tryUnsubscribe:x,getListeners:()=>r};return E}var AV=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jV=AV(),CV=()=>typeof navigator<"u"&&navigator.product==="ReactNative",OV=CV(),NV=()=>jV||OV?v.useLayoutEffect:v.useEffect,TV=NV();function C_(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function PV(e,t){if(C_(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!C_(e[n[i]],t[n[i]]))return!1;return!0}var Nx=Symbol.for("react-redux-context"),Tx=typeof globalThis<"u"?globalThis:{};function _V(){if(!v.createContext)return{};const e=Tx[Nx]??(Tx[Nx]=new Map);let t=e.get(v.createContext);return t||(t=v.createContext(null),e.set(v.createContext,t)),t}var DV=_V();function MV(e){const{children:t,context:n,serverState:r,store:i}=e,o=v.useMemo(()=>{const f=EV(i);return{store:i,subscription:f,getServerState:r?()=>r:void 0}},[i,r]),l=v.useMemo(()=>i.getState(),[i]);TV(()=>{const{subscription:f}=o;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),l!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[o,l]);const u=n||DV;return v.createElement(u.Provider,{value:o},t)}var RV=MV,kV=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function LV(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Ml(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(kV.has(r)){if(e[r]==null&&t[r]==null)continue;if(!PV(e[r],t[r]))return!1}else if(!LV(e[r],t[r]))return!1;return!0}var IV=["contextPayload"];function oS(){return oS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oS.apply(null,arguments)}function O_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O_(Object(n),!0).forEach(function(r){zV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zV(e,t,n){return(t=UV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UV(e){var t=qV(e,"string");return typeof t=="symbol"?t:t+""}function qV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BV(e,t){if(e==null)return{};var n,r,i=FV(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function FV(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function $V(e){return e.value}function KV(e){var{contextPayload:t}=e,n=BV(e,IV),r=kL(t,e.payloadUniqBy,$V),i=hu(hu({},n),{},{payload:r});return v.isValidElement(e.content)?v.cloneElement(e.content,i):typeof e.content=="function"?v.createElement(e.content,i):v.createElement(h9,i)}function HV(e,t,n,r,i,o){var{layout:l,align:u,verticalAlign:f}=t,h,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(u==="center"&&l==="vertical"?h={left:((r||0)-o.width)/2}:h=u==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(f==="middle"?p={top:((i||0)-o.height)/2}:p=f==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),hu(hu({},h),p)}function GV(e){var t=xt();return v.useEffect(()=>{t(vV(e))},[t,e]),null}function YV(e){var t=xt();return v.useEffect(()=>(t(S_(e)),()=>{t(S_({width:0,height:0}))}),[t,e]),null}function WV(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var QV={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function VV(e){var t=on(e,QV),n=u7(),r=iW(),i=rV(),{width:o,height:l,wrapperStyle:u,portal:f}=t,[h,p]=qL([n]),b=BE(),g=FE();if(b==null||g==null)return null;var x=b-((i==null?void 0:i.left)||0)-((i==null?void 0:i.right)||0),E=WV(t.layout,l,o,x),S=f?u:hu(hu({position:"absolute",width:(E==null?void 0:E.width)||o||"auto",height:(E==null?void 0:E.height)||l||"auto"},HV(u,t,i,b,g,h)),u),A=f??r;if(A==null||n==null)return null;var j=v.createElement("div",{className:"recharts-legend-wrapper",style:S,ref:p},v.createElement(GV,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!f&&v.createElement(YV,{width:h.width,height:h.height}),v.createElement(KV,oS({},t,E,{margin:i,chartWidth:b,chartHeight:g,contextPayload:n})));return Vn.createPortal(j,A)}var Vd=v.memo(VV,Ml);Vd.displayName="Legend";function sS(){return sS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sS.apply(null,arguments)}function N_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N_(Object(n),!0).forEach(function(r){XV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XV(e,t,n){return(t=ZV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZV(e){var t=JV(e,"string");return typeof t=="symbol"?t:t+""}function JV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eX(e){return Array.isArray(e)&&vi(e[0])&&vi(e[1])?e.join(" ~ "):e}var Ac={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function tX(e,t){return t==null?e:zb(e,t)}var nX=e=>{var{separator:t=Ac.separator,contentStyle:n,itemStyle:r,labelStyle:i=Ac.labelStyle,payload:o,formatter:l,itemSorter:u,wrapperClassName:f,labelClassName:h,label:p,labelFormatter:b,accessibilityLayer:g=Ac.accessibilityLayer}=e,x=()=>{if(o&&o.length){var _={padding:0,margin:0},P=tX(o,u),D=P.map((L,z)=>{if(!L||L.type==="none")return null;var F=L.formatter||l||eX,{value:G,name:R}=L,J=G,$=R;if(F){var ne=F(G,R,L,z,o);if(Array.isArray(ne))[J,$]=ne;else if(ne!=null)J=ne;else return null}var K=kd(kd({},Ac.itemStyle),{},{color:L.color||Ac.itemStyle.color},r);return v.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:K},vi($)?v.createElement("span",{className:"recharts-tooltip-item-name"},$):null,vi($)?v.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,v.createElement("span",{className:"recharts-tooltip-item-value"},J),v.createElement("span",{className:"recharts-tooltip-item-unit"},L.unit||""))});return v.createElement("ul",{className:"recharts-tooltip-item-list",style:_},D)}return null},E=kd(kd({},Ac.contentStyle),n),S=kd({margin:0},i),A=!Mt(p),j=A?p:"",C=rt("recharts-default-tooltip",f),O=rt("recharts-tooltip-label",h);A&&b&&o!==void 0&&o!==null&&(j=b(p,o));var T=g?{role:"status","aria-live":"assertive"}:{};return v.createElement("div",sS({className:C,style:E},T),v.createElement("p",{className:O,style:S},v.isValidElement(j)?j:"".concat(j)),x())},Ld="recharts-tooltip-wrapper",rX={visibility:"hidden"};function aX(e){var{coordinate:t,translateX:n,translateY:r}=e;return rt(Ld,{["".concat(Ld,"-right")]:ye(n)&&t&&ye(t.x)&&n>=t.x,["".concat(Ld,"-left")]:ye(n)&&t&&ye(t.x)&&n<t.x,["".concat(Ld,"-bottom")]:ye(r)&&t&&ye(t.y)&&r>=t.y,["".concat(Ld,"-top")]:ye(r)&&t&&ye(t.y)&&r<t.y})}function T_(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:o,reverseDirection:l,tooltipDimension:u,viewBox:f,viewBoxDimension:h}=e;if(o&&ye(o[r]))return o[r];var p=n[r]-u-(i>0?i:0),b=n[r]+i;if(t[r])return l[r]?p:b;var g=f[r];if(g==null)return 0;if(l[r]){var x=p,E=g;return x<E?Math.max(b,g):Math.max(p,g)}if(h==null)return 0;var S=b+u,A=g+h;return S>A?Math.max(p,g):Math.max(b,g)}function iX(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function oX(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:o,reverseDirection:l,tooltipBox:u,useTranslate3d:f,viewBox:h}=e,p,b,g;return u.height>0&&u.width>0&&n?(b=T_({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:o,reverseDirection:l,tooltipDimension:u.width,viewBox:h,viewBoxDimension:h.width}),g=T_({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:o,reverseDirection:l,tooltipDimension:u.height,viewBox:h,viewBoxDimension:h.height}),p=iX({translateX:b,translateY:g,useTranslate3d:f})):p=rX,{cssProperties:p,cssClasses:aX({translateX:b,translateY:g,coordinate:n})}}var sX=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Gf={isSsr:sX()};function zI(){var[e,t]=v.useState(()=>Gf.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return v.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function P_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P_(Object(n),!0).forEach(function(r){lX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lX(e,t,n){return(t=cX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cX(e){var t=uX(e,"string");return typeof t=="symbol"?t:t+""}function uX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dX(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function fX(e){var t,n,r,i,o,l,u=zI(),[f,h]=v.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));v.useEffect(()=>{var E=S=>{if(S.key==="Escape"){var A,j,C,O;h({dismissed:!0,dismissedAtCoordinate:{x:(A=(j=e.coordinate)===null||j===void 0?void 0:j.x)!==null&&A!==void 0?A:0,y:(C=(O=e.coordinate)===null||O===void 0?void 0:O.y)!==null&&C!==void 0?C:0}})}};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),f.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==f.dismissedAtCoordinate.x||((o=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&o!==void 0?o:0)!==f.dismissedAtCoordinate.y)&&h(jc(jc({},f),{},{dismissed:!1}));var{cssClasses:p,cssProperties:b}=oX({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),g=e.hasPortalFromProps?{}:jc(jc({transition:dX({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},b),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),x=jc(jc({},g),{},{visibility:!f.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return v.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:x,ref:e.innerRef},e.children)}var hX=v.memo(fX),UI=()=>{var e;return(e=we(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function lS(){return lS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lS.apply(null,arguments)}function __(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function D_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?__(Object(n),!0).forEach(function(r){mX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):__(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mX(e,t,n){return(t=pX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pX(e){var t=bX(e,"string");return typeof t=="symbol"?t:t+""}function bX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var M_={curveBasisClosed:AW,curveBasisOpen:jW,curveBasis:EW,curveBumpX:cW,curveBumpY:uW,curveLinearClosed:CW,curveLinear:Lb,curveMonotoneX:OW,curveMonotoneY:NW,curveNatural:TW,curveStep:PW,curveStepAfter:DW,curveStepBefore:_W},$p=e=>Ye(e.x)&&Ye(e.y),R_=e=>e.base!=null&&$p(e.base)&&$p(e),Id=e=>e.x,zd=e=>e.y,vX=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Uf(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=M_["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return M_[n]||Lb},k_={connectNulls:!1,type:"linear"},gX=e=>{var{type:t=k_.type,points:n=[],baseLine:r,layout:i,connectNulls:o=k_.connectNulls}=e,l=vX(t,i),u=o?n.filter($p):n;if(Array.isArray(r)){var f,h=n.map((E,S)=>D_(D_({},E),{},{base:r[S]}));i==="vertical"?f=Rm().y(zd).x1(Id).x0(E=>E.base.x):f=Rm().x(Id).y1(zd).y0(E=>E.base.y);var p=f.defined(R_).curve(l),b=o?h.filter(R_):h;return p(b)}var g;i==="vertical"&&ye(r)?g=Rm().y(zd).x1(Id).x0(r):ye(r)?g=Rm().x(Id).y1(zd).y0(r):g=cL().x(Id).y(zd);var x=g.defined($p).curve(l);return x(u)},Kc=e=>{var{className:t,points:n,path:r,pathRef:i}=e,o=js();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},u=n&&n.length?gX(l):r;return v.createElement("path",lS({},yr(e),TE(e),{className:rt("recharts-curve",t),d:u===null?void 0:u,ref:i}))},yX=["x","y","top","left","width","height","className"];function cS(){return cS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cS.apply(null,arguments)}function L_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xX(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L_(Object(n),!0).forEach(function(r){wX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wX(e,t,n){return(t=SX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SX(e){var t=EX(e,"string");return typeof t=="symbol"?t:t+""}function EX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function AX(e,t){if(e==null)return{};var n,r,i=jX(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function jX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var CX=(e,t,n,r,i,o)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(o,",").concat(t,"h").concat(n),OX=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:o=0,height:l=0,className:u}=e,f=AX(e,yX),h=xX({x:t,y:n,top:r,left:i,width:o,height:l},f);return!ye(t)||!ye(n)||!ye(o)||!ye(l)||!ye(r)||!ye(i)?null:v.createElement("path",cS({},or(h),{className:rt("recharts-cross",u),d:CX(t,n,o,l,r,i)}))};function NX(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function I_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function z_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?I_(Object(n),!0).forEach(function(r){TX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):I_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TX(e,t,n){return(t=PX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PX(e){var t=_X(e,"string");return typeof t=="symbol"?t:t+""}function _X(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var DX=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),qI=(e,t,n)=>e.map(r=>"".concat(DX(r)," ").concat(t,"ms ").concat(n)).join(","),MX=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),vf=(e,t)=>Object.keys(t).reduce((n,r)=>z_(z_({},n),{},{[r]:e(r,t[r])}),{});function U_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U_(Object(n),!0).forEach(function(r){RX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function RX(e,t,n){return(t=kX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kX(e){var t=LX(e,"string");return typeof t=="symbol"?t:t+""}function LX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Kp=(e,t,n)=>e+(t-e)*n,uS=e=>{var{from:t,to:n}=e;return t!==n},BI=(e,t,n)=>{var r=vf((i,o)=>{if(uS(o)){var[l,u]=e(o.from,o.to,o.velocity);return xn(xn({},o),{},{from:l,velocity:u})}return o},t);return n<1?vf((i,o)=>uS(o)&&r[i]!=null?xn(xn({},o),{},{velocity:Kp(o.velocity,r[i].velocity,n),from:Kp(o.from,r[i].from,n)}):o,t):BI(e,r,n-1)};function IX(e,t,n,r,i,o){var l,u=r.reduce((g,x)=>xn(xn({},g),{},{[x]:{from:e[x],velocity:0,to:t[x]}}),{}),f=()=>vf((g,x)=>x.from,u),h=()=>!Object.values(u).filter(uS).length,p=null,b=g=>{l||(l=g);var x=g-l,E=x/n.dt;u=BI(n,u,E),i(xn(xn(xn({},e),t),f())),l=g,h()||(p=o.setTimeout(b))};return()=>(p=o.setTimeout(b),()=>{var g;(g=p)===null||g===void 0||g()})}function zX(e,t,n,r,i,o,l){var u=null,f=i.reduce((b,g)=>{var x=e[g],E=t[g];return x==null||E==null?b:xn(xn({},b),{},{[g]:[x,E]})},{}),h,p=b=>{h||(h=b);var g=(b-h)/r,x=vf((S,A)=>Kp(...A,n(g)),f);if(o(xn(xn(xn({},e),t),x)),g<1)u=l.setTimeout(p);else{var E=vf((S,A)=>Kp(...A,n(1)),f);o(xn(xn(xn({},e),t),E))}};return()=>(u=l.setTimeout(p),()=>{var b;(b=u)===null||b===void 0||b()})}const UX=(e,t,n,r,i,o)=>{var l=MX(e,t);return n==null?()=>(i(xn(xn({},e),t)),()=>{}):n.isStepper===!0?IX(e,t,n,l,i,o):zX(e,t,n,r,l,i,o)};var Hp=1e-4,FI=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],$I=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),q_=(e,t)=>n=>{var r=FI(e,t);return $I(r,n)},qX=(e,t)=>n=>{var r=FI(e,t),i=[...r.map((o,l)=>o*l).slice(1),0];return $I(i,n)},BX=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(o=>parseFloat(o));return[i[0],i[1],i[2],i[3]]},FX=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=BX(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},$X=(e,t,n,r)=>{var i=q_(e,n),o=q_(t,r),l=qX(e,n),u=h=>h>1?1:h<0?0:h,f=h=>{for(var p=h>1?1:h,b=p,g=0;g<8;++g){var x=i(b)-p,E=l(b);if(Math.abs(x-p)<Hp||E<Hp)return o(b);b=u(b-x/E)}return o(b)};return f.isStepper=!1,f},B_=function(){return $X(...FX(...arguments))},KX=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,o=(l,u,f)=>{var h=-(l-u)*n,p=f*r,b=f+(h-p)*i/1e3,g=f*i/1e3+l;return Math.abs(g-u)<Hp&&Math.abs(b)<Hp?[u,0]:[g,b]};return o.isStepper=!0,o.dt=i,o},HX=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return B_(e);case"spring":return KX();default:if(e.split("(")[0]==="cubic-bezier")return B_(e)}return typeof e=="function"?e:null};function GX(e){var t,n=()=>null,r=!1,i=null,o=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var u=l,[f,...h]=u;if(typeof f=="number"){i=e.setTimeout(o.bind(null,h),f);return}o(f),i=e.setTimeout(o.bind(null,h));return}typeof l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),o(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class YX{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,o=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(o))};return i=requestAnimationFrame(o),()=>{i!=null&&cancelAnimationFrame(i)}}}function WX(){return GX(new YX)}var QX=v.createContext(WX);function VX(e,t){var n=v.useContext(QX);return v.useMemo(()=>t??n(e),[e,t,n])}var XX={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},F_={t:0},Px={t:1};function Ou(e){var t=on(e,XX),{isActive:n,canBegin:r,duration:i,easing:o,begin:l,onAnimationEnd:u,onAnimationStart:f,children:h}=t,p=zI(),b=n==="auto"?!Gf.isSsr&&!p:n,g=VX(t.animationId,t.animationManager),[x,E]=v.useState(b?F_:Px),S=v.useRef(null);return v.useEffect(()=>{b||E(Px)},[b]),v.useEffect(()=>{if(!b||!r)return Es;var A=UX(F_,Px,HX(o),i,E,g.getTimeoutController()),j=()=>{S.current=A()};return g.start([f,l,j,i,u]),()=>{g.stop(),S.current&&S.current(),u()}},[b,r,i,o,l,f,u,g]),h(x.t)}function Nu(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=v.useRef(uf(t)),r=v.useRef(e);return r.current!==e&&(n.current=uf(t),r.current=e),n.current}var ZX=["radius"],JX=["radius"],$_,K_,H_,G_,Y_,W_,Q_,V_,X_,Z_;function J_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J_(Object(n),!0).forEach(function(r){eZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eZ(e,t,n){return(t=tZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tZ(e){var t=nZ(e,"string");return typeof t=="symbol"?t:t+""}function nZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gp.apply(null,arguments)}function tD(e,t){if(e==null)return{};var n,r,i=rZ(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function rZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ri(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var nD=(e,t,n,r,i)=>{var o=ms(n),l=ms(r),u=Math.min(Math.abs(o)/2,Math.abs(l)/2),f=l>=0?1:-1,h=o>=0?1:-1,p=l>=0&&o>=0||l<0&&o<0?1:0,b;if(u>0&&Array.isArray(i)){for(var g=[0,0,0,0],x=0,E=4;x<E;x++){var S,A=(S=i[x])!==null&&S!==void 0?S:0;g[x]=A>u?u:A}b=Xt($_||($_=ri(["M",",",""])),e,t+f*g[0]),g[0]>0&&(b+=Xt(K_||(K_=ri(["A ",",",",0,0,",",",",",""])),g[0],g[0],p,e+h*g[0],t)),b+=Xt(H_||(H_=ri(["L ",",",""])),e+n-h*g[1],t),g[1]>0&&(b+=Xt(G_||(G_=ri(["A ",",",",0,0,",`, 247 `,",",""])),g[1],g[1],p,e+n,t+f*g[1])),b+=Xt(Y_||(Y_=ri(["L ",",",""])),e+n,t+r-f*g[2]),g[2]>0&&(b+=Xt(W_||(W_=ri(["A ",",",",0,0,",`, 248 `,",",""])),g[2],g[2],p,e+n-h*g[2],t+r)),b+=Xt(Q_||(Q_=ri(["L ",",",""])),e+h*g[3],t+r),g[3]>0&&(b+=Xt(V_||(V_=ri(["A ",",",",0,0,",`, 249 `,",",""])),g[3],g[3],p,e,t+r-f*g[3])),b+="Z"}else if(u>0&&i===+i&&i>0){var j=Math.min(u,i);b=Xt(X_||(X_=ri(["M ",",",` 250 250 A `,",",",0,0,",",",",",` 251 251 L `,",",` … … 254 254 A `,",",",0,0,",",",",",` 255 255 L `,",",` 256 A `,",",",0,0,",",",","," Z"])),e,t+f*j,j,j,p,e+h*j,t,e+n-h*j,t,j,j,p,e+n,t+f*j,e+n,t+r-f*j,j,j,p,e+n-h*j,t+r,e+h*j,t+r,j,j,p,e,t+r-f*j)}else b=Xt( X_||(X_=ri(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return b},nD={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$I=e=>{var t=on(e,nD),n=v.useRef(null),[r,i]=v.useState(-1);v.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var Z=n.current.getTotalLength();Z&&i(Z)}catch{}},[]);var{x:o,y:l,width:u,height:f,radius:h,className:p}=t,{animationEasing:b,animationDuration:g,animationBegin:x,isAnimationActive:E,isUpdateAnimationActive:S}=t,A=v.useRef(u),j=v.useRef(f),C=v.useRef(o),O=v.useRef(l),T=v.useMemo(()=>({x:o,y:l,width:u,height:f,radius:h}),[o,l,u,f,h]),_=Ou(T,"rectangle-");if(o!==+o||l!==+l||u!==+u||f!==+f||u===0||f===0)return null;var P=rt("recharts-rectangle",p);if(!S){var D=or(t),{radius:L}=D,z=eD(D,ZX);return v.createElement("path",Gp({},z,{x:ms(o),y:ms(l),width:ms(u),height:ms(f),radius:typeof h=="number"?h:void 0,className:P,d:tD(o,l,u,f,h)}))}var R=A.current,q=j.current,U=C.current,re=O.current,G="0px ".concat(r===-1?1:r,"px"),ie="".concat(r,"px ").concat(r,"px"),K=UI(["strokeDasharray"],g,typeof b=="string"?b:nD.animationEasing);return v.createElement(Cu,{animationId:_,key:_,canBegin:r>0,duration:g,easing:b,isActive:S,begin:x},Z=>{var $=dt(R,u,Z),ee=dt(q,f,Z),pe=dt(U,o,Z),k=dt(re,l,Z);n.current&&(A.current=$,j.current=ee,C.current=pe,O.current=k);var Q;E?Z>0?Q={transition:K,strokeDasharray:ie}:Q={strokeDasharray:G}:Q={strokeDasharray:ie};var ce=or(t),{radius:fe}=ce,xe=eD(ce,JX);return v.createElement("path",Gp({},xe,{radius:typeof h=="number"?h:void 0,className:P,d:tD(pe,k,$,ee,h),ref:n,style:J_(J_({},Q),t.style)}))})};function rD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rD(Object(n),!0).forEach(function(r){aZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aZ(e,t,n){return(t=iZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iZ(e){var t=oZ(e,"string");return typeof t=="symbol"?t:t+""}function oZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yp=Math.PI/180,sZ=e=>e*180/Math.PI,hn=(e,t,n,r)=>({x:e+Math.cos(-Yp*r)*n,y:t+Math.sin(-Yp*r)*n}),KI=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},lZ=(e,t)=>{var{x:n,y:r}=e,{x:i,y:o}=t;return Math.sqrt((n-i)**2+(r-o)**2)},cZ=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:o}=t,l=lZ({x:n,y:r},{x:i,y:o});if(l<=0)return{radius:l,angle:0};var u=(n-i)/l,f=Math.acos(u);return r>o&&(f=2*Math.PI-f),{radius:l,angle:sZ(f),angleInRadian:f}},uZ=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),o=Math.min(r,i);return{startAngle:t-o*360,endAngle:n-o*360}},dZ=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),o=Math.floor(r/360),l=Math.min(i,o);return e+l*360},fZ=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:o}=cZ({x:n,y:r},t),{innerRadius:l,outerRadius:u}=t;if(i<l||i>u||i===0)return null;var{startAngle:f,endAngle:h}=uZ(t),p=o,b;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;b=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;b=p>=h&&p<=f}return b?aD(aD({},t),{},{radius:i,angle:dZ(p,t)}):null};function HI(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:o}=e,l=hn(t,n,r,i),u=hn(t,n,r,o);return{points:[l,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:o}}var iD,oD,sD,lD,cD,uD,dD;function dS(){return dS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dS.apply(null,arguments)}function nl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var hZ=(e,t)=>{var n=kn(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Fm=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:o,isExternal:l,cornerRadius:u,cornerIsExternal:f}=e,h=u*(l?1:-1)+r,p=Math.asin(u/h)/Yp,b=f?i:i+o*p,g=hn(t,n,h,b),x=hn(t,n,r,b),E=f?i-o*p:i,S=hn(t,n,h*Math.cos(p*Yp),E);return{center:g,circleTangency:x,lineTangency:S,theta:p}},GI=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:o,endAngle:l}=e,u=hZ(o,l),f=o+u,h=hn(t,n,i,o),p=hn(t,n,i,f),b=Xt(iD||(iD=nl(["M ",",",`256 A `,",",",0,0,",",",","," Z"])),e,t+f*j,j,j,p,e+h*j,t,e+n-h*j,t,j,j,p,e+n,t+f*j,e+n,t+r-f*j,j,j,p,e+n-h*j,t+r,e+h*j,t+r,j,j,p,e,t+r-f*j)}else b=Xt(Z_||(Z_=ri(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return b},rD={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},KI=e=>{var t=on(e,rD),n=v.useRef(null),[r,i]=v.useState(-1);v.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var Z=n.current.getTotalLength();Z&&i(Z)}catch{}},[]);var{x:o,y:l,width:u,height:f,radius:h,className:p}=t,{animationEasing:b,animationDuration:g,animationBegin:x,isAnimationActive:E,isUpdateAnimationActive:S}=t,A=v.useRef(u),j=v.useRef(f),C=v.useRef(o),O=v.useRef(l),T=v.useMemo(()=>({x:o,y:l,width:u,height:f,radius:h}),[o,l,u,f,h]),_=Nu(T,"rectangle-");if(o!==+o||l!==+l||u!==+u||f!==+f||u===0||f===0)return null;var P=rt("recharts-rectangle",p);if(!S){var D=or(t),{radius:L}=D,z=tD(D,ZX);return v.createElement("path",Gp({},z,{x:ms(o),y:ms(l),width:ms(u),height:ms(f),radius:typeof h=="number"?h:void 0,className:P,d:nD(o,l,u,f,h)}))}var F=A.current,G=j.current,R=C.current,J=O.current,$="0px ".concat(r===-1?1:r,"px"),ne="".concat(r,"px ").concat(r,"px"),K=qI(["strokeDasharray"],g,typeof b=="string"?b:rD.animationEasing);return v.createElement(Ou,{animationId:_,key:_,canBegin:r>0,duration:g,easing:b,isActive:S,begin:x},Z=>{var B=dt(F,u,Z),te=dt(G,f,Z),pe=dt(R,o,Z),k=dt(J,l,Z);n.current&&(A.current=B,j.current=te,C.current=pe,O.current=k);var Q;E?Z>0?Q={transition:K,strokeDasharray:ne}:Q={strokeDasharray:$}:Q={strokeDasharray:ne};var ce=or(t),{radius:fe}=ce,xe=tD(ce,JX);return v.createElement("path",Gp({},xe,{radius:typeof h=="number"?h:void 0,className:P,d:nD(pe,k,B,te,h),ref:n,style:eD(eD({},Q),t.style)}))})};function aD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function iD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aD(Object(n),!0).forEach(function(r){aZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aZ(e,t,n){return(t=iZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iZ(e){var t=oZ(e,"string");return typeof t=="symbol"?t:t+""}function oZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yp=Math.PI/180,sZ=e=>e*180/Math.PI,hn=(e,t,n,r)=>({x:e+Math.cos(-Yp*r)*n,y:t+Math.sin(-Yp*r)*n}),HI=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},lZ=(e,t)=>{var{x:n,y:r}=e,{x:i,y:o}=t;return Math.sqrt((n-i)**2+(r-o)**2)},cZ=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:o}=t,l=lZ({x:n,y:r},{x:i,y:o});if(l<=0)return{radius:l,angle:0};var u=(n-i)/l,f=Math.acos(u);return r>o&&(f=2*Math.PI-f),{radius:l,angle:sZ(f),angleInRadian:f}},uZ=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),o=Math.min(r,i);return{startAngle:t-o*360,endAngle:n-o*360}},dZ=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),o=Math.floor(r/360),l=Math.min(i,o);return e+l*360},fZ=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:o}=cZ({x:n,y:r},t),{innerRadius:l,outerRadius:u}=t;if(i<l||i>u||i===0)return null;var{startAngle:f,endAngle:h}=uZ(t),p=o,b;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;b=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;b=p>=h&&p<=f}return b?iD(iD({},t),{},{radius:i,angle:dZ(p,t)}):null};function GI(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:o}=e,l=hn(t,n,r,i),u=hn(t,n,r,o);return{points:[l,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:o}}var oD,sD,lD,cD,uD,dD,fD;function dS(){return dS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dS.apply(null,arguments)}function nl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var hZ=(e,t)=>{var n=kn(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Fm=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:o,isExternal:l,cornerRadius:u,cornerIsExternal:f}=e,h=u*(l?1:-1)+r,p=Math.asin(u/h)/Yp,b=f?i:i+o*p,g=hn(t,n,h,b),x=hn(t,n,r,b),E=f?i-o*p:i,S=hn(t,n,h*Math.cos(p*Yp),E);return{center:g,circleTangency:x,lineTangency:S,theta:p}},YI=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:o,endAngle:l}=e,u=hZ(o,l),f=o+u,h=hn(t,n,i,o),p=hn(t,n,i,f),b=Xt(oD||(oD=nl(["M ",",",` 257 257 A `,",",`,0, 258 258 `,",",`, 259 259 `,",",` 260 `])),h.x,h.y,i,i,+(Math.abs(u)>180),+(o>f),p.x,p.y);if(r>0){var g=hn(t,n,r,o),x=hn(t,n,r,f);b+=Xt( oD||(oD=nl(["L ",",",`260 `])),h.x,h.y,i,i,+(Math.abs(u)>180),+(o>f),p.x,p.y);if(r>0){var g=hn(t,n,r,o),x=hn(t,n,r,f);b+=Xt(sD||(sD=nl(["L ",",",` 261 261 A `,",",`,0, 262 262 `,",",`, 263 `,","," Z"])),x.x,x.y,r,r,+(Math.abs(u)>180),+(o<=f),g.x,g.y)}else b+=Xt( sD||(sD=nl(["L ",","," Z"])),t,n);return b},mZ=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:h}=e,p=kn(h-f),{circleTangency:b,lineTangency:g,theta:x}=Fm({cx:t,cy:n,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:u}),{circleTangency:E,lineTangency:S,theta:A}=Fm({cx:t,cy:n,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:u}),j=u?Math.abs(f-h):Math.abs(f-h)-x-A;if(j<0)return l?Xt(lD||(lD=nl(["M ",",",`263 `,","," Z"])),x.x,x.y,r,r,+(Math.abs(u)>180),+(o<=f),g.x,g.y)}else b+=Xt(lD||(lD=nl(["L ",","," Z"])),t,n);return b},mZ=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:h}=e,p=kn(h-f),{circleTangency:b,lineTangency:g,theta:x}=Fm({cx:t,cy:n,radius:i,angle:f,sign:p,cornerRadius:o,cornerIsExternal:u}),{circleTangency:E,lineTangency:S,theta:A}=Fm({cx:t,cy:n,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:u}),j=u?Math.abs(f-h):Math.abs(f-h)-x-A;if(j<0)return l?Xt(cD||(cD=nl(["M ",",",` 264 264 a`,",",",0,0,1,",`,0 265 265 a`,",",",0,0,1,",`,0 266 `])),g.x,g.y,o,o,o*2,o,o,-o*2): GI({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:f,endAngle:h});var C=Xt(cD||(cD=nl(["M ",",",`266 `])),g.x,g.y,o,o,o*2,o,o,-o*2):YI({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:f,endAngle:h});var C=Xt(uD||(uD=nl(["M ",",",` 267 267 A`,",",",0,0,",",",",",` 268 268 A`,",",",0,",",",",",",",` 269 269 A`,",",",0,0,",",",",",` 270 `])),g.x,g.y,o,o,+(p<0),b.x,b.y,i,i,+(j>180),+(p<0),E.x,E.y,o,o,+(p<0),S.x,S.y);if(r>0){var{circleTangency:O,lineTangency:T,theta:_}=Fm({cx:t,cy:n,radius:r,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),{circleTangency:P,lineTangency:D,theta:L}=Fm({cx:t,cy:n,radius:r,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),z=u?Math.abs(f-h):Math.abs(f-h)-_-L;if(z<0&&o===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=Xt( uD||(uD=nl(["L",",",`270 `])),g.x,g.y,o,o,+(p<0),b.x,b.y,i,i,+(j>180),+(p<0),E.x,E.y,o,o,+(p<0),S.x,S.y);if(r>0){var{circleTangency:O,lineTangency:T,theta:_}=Fm({cx:t,cy:n,radius:r,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),{circleTangency:P,lineTangency:D,theta:L}=Fm({cx:t,cy:n,radius:r,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),z=u?Math.abs(f-h):Math.abs(f-h)-_-L;if(z<0&&o===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=Xt(dD||(dD=nl(["L",",",` 271 271 A`,",",",0,0,",",",",",` 272 272 A`,",",",0,",",",",",",",` 273 A`,",",",0,0,",",",",","Z"])),D.x,D.y,o,o,+(p<0),P.x,P.y,r,r,+(z>180),+(p>0),O.x,O.y,o,o,+(p<0),T.x,T.y)}else C+=Xt( dD||(dD=nl(["L",",","Z"])),t,n);return C},pZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},YI=e=>{var t=on(e,pZ),{cx:n,cy:r,innerRadius:i,outerRadius:o,cornerRadius:l,forceCornerRadius:u,cornerIsExternal:f,startAngle:h,endAngle:p,className:b}=t;if(o<i||h===p)return null;var g=rt("recharts-sector",b),x=o-i,E=ar(l,x,0,!0),S;return E>0&&Math.abs(h-p)<360?S=mZ({cx:n,cy:r,innerRadius:i,outerRadius:o,cornerRadius:Math.min(E,x/2),forceCornerRadius:u,cornerIsExternal:f,startAngle:h,endAngle:p}):S=GI({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),v.createElement("path",dS({},or(t),{className:g,d:S}))};function bZ(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(EL(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:o,outerRadius:l,angle:u}=t,f=hn(r,i,o,u),h=hn(r,i,l,u);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return HI(t)}}var _x={},Dx={},Mx={},fD;function vZ(){if(fD)return Mx;fD=1;const e=IL();function t(n){return e.isSymbol(n)?NaN:Number(n)}return Mx.toNumber=t,Mx}var hD;function gZ(){if(hD)return Dx;hD=1;const e=vZ();function t(n){return n?(n=e.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}return Dx.toFinite=t,Dx}var mD;function yZ(){if(mD)return _x;mD=1;const e=gZ(),t=LL();function n(r,i,o){o&&typeof o!="number"&&t.isIterateeCall(r,i,o)&&(i=o=void 0),r=e.toFinite(r),i===void 0?(i=r,r=0):i=e.toFinite(i),o=o===void 0?r<i?1:-1:e.toFinite(o);const l=Math.max(Math.ceil((i-r)/(o||1)),0),u=new Array(l);for(let f=0;f<l;f++)u[f]=r,r+=o;return u}return _x.range=n,_x}var Rx,pD;function xZ(){return pD||(pD=1,Rx=yZ().range),Rx}var wZ=xZ();const WI=Ei(wZ);var Ga=e=>e.chartData,Yf=W([Ga],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Wf=(e,t,n,r)=>r?Yf(e):Ga(e),QI=(e,t,n)=>n?Yf(e):Ga(e),SZ=W([Wf],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),EZ=W([Yf],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),AZ=W([Ga],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function hi(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Ye(t)&&Ye(n))return!0}return!1}function bD(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function VI(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,o;if(Ye(n))i=n;else if(typeof n=="function")return;if(Ye(r))o=r;else if(typeof r=="function")return;var l=[i,o];if(hi(l))return l}}function jZ(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(hi(r))return bD(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,o]=e,l,u;if(i==="auto")t!=null&&(l=Math.min(...t));else if(ye(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&i_.test(i)){var f=i_.exec(i);if(f==null||f[1]==null||t==null)l=void 0;else{var h=+f[1];l=t[0]-h}}else l=t==null?void 0:t[0];if(o==="auto")t!=null&&(u=Math.max(...t));else if(ye(o))u=o;else if(typeof o=="function")try{t!=null&&(u=o(t==null?void 0:t[1]))}catch{}else if(typeof o=="string"&&o_.test(o)){var p=o_.exec(o);if(p==null||p[1]==null||t==null)u=void 0;else{var b=+p[1];u=t[1]+b}}else u=t==null?void 0:t[1];var g=[l,u];if(hi(g))return t==null?g:bD(g,t,n)}}}var Nu=1e9,CZ={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},YE,It=!0,Ea="[DecimalError] ",bl=Ea+"Invalid argument: ",GE=Ea+"Exponent out of range: ",Tu=Math.floor,el=Math.pow,OZ=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Jr,Dn=1e7,Dt=7,XI=9007199254740991,Wp=Tu(XI/Dt),Se={};Se.absoluteValue=Se.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Se.comparedTo=Se.cmp=function(e){var t,n,r,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};Se.decimalPlaces=Se.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Dt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Se.dividedBy=Se.div=function(e){return lo(this,new this.constructor(e))};Se.dividedToIntegerBy=Se.idiv=function(e){var t=this,n=t.constructor;return St(lo(t,new n(e),0,1),n.precision)};Se.equals=Se.eq=function(e){return!this.cmp(e)};Se.exponent=function(){return mn(this)};Se.greaterThan=Se.gt=function(e){return this.cmp(e)>0};Se.greaterThanOrEqualTo=Se.gte=function(e){return this.cmp(e)>=0};Se.isInteger=Se.isint=function(){return this.e>this.d.length-2};Se.isNegative=Se.isneg=function(){return this.s<0};Se.isPositive=Se.ispos=function(){return this.s>0};Se.isZero=function(){return this.s===0};Se.lessThan=Se.lt=function(e){return this.cmp(e)<0};Se.lessThanOrEqualTo=Se.lte=function(e){return this.cmp(e)<1};Se.logarithm=Se.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Jr))throw Error(Ea+"NaN");if(n.s<1)throw Error(Ea+(n.s?"NaN":"-Infinity"));return n.eq(Jr)?new r(0):(It=!1,t=lo(vf(n,o),vf(e,o),o),It=!0,St(t,i))};Se.minus=Se.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ez(t,e):ZI(t,(e.s=-e.s,e))};Se.modulo=Se.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Ea+"NaN");return n.s?(It=!1,t=lo(n,e,0,1).times(e),It=!0,n.minus(t)):St(new r(n),i)};Se.naturalExponential=Se.exp=function(){return JI(this)};Se.naturalLogarithm=Se.ln=function(){return vf(this)};Se.negated=Se.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Se.plus=Se.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ZI(t,e):ez(t,(e.s=-e.s,e))};Se.precision=Se.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(bl+e);if(t=mn(i)+1,r=i.d.length-1,n=r*Dt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Se.squareRoot=Se.sqrt=function(){var e,t,n,r,i,o,l,u=this,f=u.constructor;if(u.s<1){if(!u.s)return new f(0);throw Error(Ea+"NaN")}for(e=mn(u),It=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=fi(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Tu((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new f(t)):r=new f(i.toString()),n=f.precision,i=l=n+3;;)if(o=r,r=o.plus(lo(u,o,l+2)).times(.5),fi(o.d).slice(0,l)===(t=fi(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(St(o,n+1,0),o.times(o).eq(u)){r=o;break}}else if(t!="9999")break;l+=4}return It=!0,St(r,n)};Se.times=Se.mul=function(e){var t,n,r,i,o,l,u,f,h,p=this,b=p.constructor,g=p.d,x=(e=new b(e)).d;if(!p.s||!e.s)return new b(0);for(e.s*=p.s,n=p.e+e.e,f=g.length,h=x.length,f<h&&(o=g,g=x,x=o,l=f,f=h,h=l),o=[],l=f+h,r=l;r--;)o.push(0);for(r=h;--r>=0;){for(t=0,i=f+r;i>r;)u=o[i]+x[r]*g[i-r-1]+t,o[i--]=u%Dn|0,t=u/Dn|0;o[i]=(o[i]+t)%Dn|0}for(;!o[--l];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,It?St(e,b.precision):e};Se.toDecimalPlaces=Se.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(yi(e,0,Nu),t===void 0?t=r.rounding:yi(t,0,8),St(n,e+mn(n)+1,t))};Se.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Nl(r,!0):(yi(e,0,Nu),t===void 0?t=i.rounding:yi(t,0,8),r=St(new i(r),e+1,t),n=Nl(r,!0,e+1)),n};Se.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?Nl(i):(yi(e,0,Nu),t===void 0?t=o.rounding:yi(t,0,8),r=St(new o(i),e+mn(i)+1,t),n=Nl(r.abs(),!1,e+mn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Se.toInteger=Se.toint=function(){var e=this,t=e.constructor;return St(new t(e),mn(e)+1,t.rounding)};Se.toNumber=function(){return+this};Se.toPower=Se.pow=function(e){var t,n,r,i,o,l,u=this,f=u.constructor,h=12,p=+(e=new f(e));if(!e.s)return new f(Jr);if(u=new f(u),!u.s){if(e.s<1)throw Error(Ea+"Infinity");return u}if(u.eq(Jr))return u;if(r=f.precision,e.eq(Jr))return St(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,o=u.s,l){if((n=p<0?-p:p)<=XI){for(i=new f(Jr),t=Math.ceil(r/Dt+4),It=!1;n%2&&(i=i.times(u),gD(i.d,t)),n=Tu(n/2),n!==0;)u=u.times(u),gD(u.d,t);return It=!0,e.s<0?new f(Jr).div(i):St(i,r)}}else if(o<0)throw Error(Ea+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,It=!1,i=e.times(vf(u,r+h)),It=!0,i=JI(i),i.s=o,i};Se.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=mn(i),r=Nl(i,n<=o.toExpNeg||n>=o.toExpPos)):(yi(e,1,Nu),t===void 0?t=o.rounding:yi(t,0,8),i=St(new o(i),e,t),n=mn(i),r=Nl(i,e<=n||n<=o.toExpNeg,e)),r};Se.toSignificantDigits=Se.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(yi(e,1,Nu),t===void 0?t=r.rounding:yi(t,0,8)),St(new r(n),e,t)};Se.toString=Se.valueOf=Se.val=Se.toJSON=Se[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=mn(e),n=e.constructor;return Nl(e,t<=n.toExpNeg||t>=n.toExpPos)};function ZI(e,t){var n,r,i,o,l,u,f,h,p=e.constructor,b=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),It?St(t,b):t;if(f=e.d,h=t.d,l=e.e,i=t.e,f=f.slice(),o=l-i,o){for(o<0?(r=f,o=-o,u=h.length):(r=h,i=l,u=f.length),l=Math.ceil(b/Dt),u=l>u?l+1:u+1,o>u&&(o=u,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(u=f.length,o=h.length,u-o<0&&(o=u,r=h,h=f,f=r),n=0;o;)n=(f[--o]=f[o]+h[o]+n)/Dn|0,f[o]%=Dn;for(n&&(f.unshift(n),++i),u=f.length;f[--u]==0;)f.pop();return t.d=f,t.e=i,It?St(t,b):t}function yi(e,t,n){if(e!==~~e||e<t||e>n)throw Error(bl+e)}function fi(e){var t,n,r,i=e.length-1,o="",l=e[0];if(i>0){for(o+=l,t=1;t<i;t++)r=e[t]+"",n=Dt-r.length,n&&(o+=ns(n)),o+=r;l=e[t],r=l+"",n=Dt-r.length,n&&(o+=ns(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return o+l}var lo=(function(){function e(r,i){var o,l=0,u=r.length;for(r=r.slice();u--;)o=r[u]*i+l,r[u]=o%Dn|0,l=o/Dn|0;return l&&r.unshift(l),r}function t(r,i,o,l){var u,f;if(o!=l)f=o>l?1:-1;else for(u=f=0;u<o;u++)if(r[u]!=i[u]){f=r[u]>i[u]?1:-1;break}return f}function n(r,i,o){for(var l=0;o--;)r[o]-=l,l=r[o]<i[o]?1:0,r[o]=l*Dn+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,l){var u,f,h,p,b,g,x,E,S,A,j,C,O,T,_,P,D,L,z=r.constructor,R=r.s==i.s?1:-1,q=r.d,U=i.d;if(!r.s)return new z(r);if(!i.s)throw Error(Ea+"Division by zero");for(f=r.e-i.e,D=U.length,_=q.length,x=new z(R),E=x.d=[],h=0;U[h]==(q[h]||0);)++h;if(U[h]>(q[h]||0)&&--f,o==null?C=o=z.precision:l?C=o+(mn(r)-mn(i))+1:C=o,C<0)return new z(0);if(C=C/Dt+2|0,h=0,D==1)for(p=0,U=U[0],C++;(h<_||p)&&C--;h++)O=p*Dn+(q[h]||0),E[h]=O/U|0,p=O%U|0;else{for(p=Dn/(U[0]+1)|0,p>1&&(U=e(U,p),q=e(q,p),D=U.length,_=q.length),T=D,S=q.slice(0,D),A=S.length;A<D;)S[A++]=0;L=U.slice(),L.unshift(0),P=U[0],U[1]>=Dn/2&&++P;do p=0,u=t(U,S,D,A),u<0?(j=S[0],D!=A&&(j=j*Dn+(S[1]||0)),p=j/P|0,p>1?(p>=Dn&&(p=Dn-1),b=e(U,p),g=b.length,A=S.length,u=t(b,S,g,A),u==1&&(p--,n(b,D<g?L:U,g))):(p==0&&(u=p=1),b=U.slice()),g=b.length,g<A&&b.unshift(0),n(S,b,A),u==-1&&(A=S.length,u=t(U,S,D,A),u<1&&(p++,n(S,D<A?L:U,A))),A=S.length):u===0&&(p++,S=[0]),E[h++]=p,u&&S[0]?S[A++]=q[T]||0:(S=[q[T]],A=1);while((T++<_||S[0]!==void 0)&&C--)}return E[0]||E.shift(),x.e=f,St(x,l?o+mn(x)+1:o)}})();function JI(e,t){var n,r,i,o,l,u,f=0,h=0,p=e.constructor,b=p.precision;if(mn(e)>16)throw Error(GE+mn(e));if(!e.s)return new p(Jr);for(It=!1,u=b,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),h+=5;for(r=Math.log(el(2,h))/Math.LN10*2+5|0,u+=r,n=i=o=new p(Jr),p.precision=u;;){if(i=St(i.times(e),u),n=n.times(++f),l=o.plus(lo(i,n,u)),fi(l.d).slice(0,u)===fi(o.d).slice(0,u)){for(;h--;)o=St(o.times(o),u);return p.precision=b,t==null?(It=!0,St(o,b)):o}o=l}}function mn(e){for(var t=e.e*Dt,n=e.d[0];n>=10;n/=10)t++;return t}function kx(e,t,n){if(t>e.LN10.sd())throw It=!0,n&&(e.precision=n),Error(Ea+"LN10 precision limit exceeded");return St(new e(e.LN10),t)}function ns(e){for(var t="";e--;)t+="0";return t}function vf(e,t){var n,r,i,o,l,u,f,h,p,b=1,g=10,x=e,E=x.d,S=x.constructor,A=S.precision;if(x.s<1)throw Error(Ea+(x.s?"NaN":"-Infinity"));if(x.eq(Jr))return new S(0);if(t==null?(It=!1,h=A):h=t,x.eq(10))return t==null&&(It=!0),kx(S,h);if(h+=g,S.precision=h,n=fi(E),r=n.charAt(0),o=mn(x),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=fi(x.d),r=n.charAt(0),b++;o=mn(x),r>1?(x=new S("0."+n),o++):x=new S(r+"."+n.slice(1))}else return f=kx(S,h+2,A).times(o+""),x=vf(new S(r+"."+n.slice(1)),h-g).plus(f),S.precision=A,t==null?(It=!0,St(x,A)):x;for(u=l=x=lo(x.minus(Jr),x.plus(Jr),h),p=St(x.times(x),h),i=3;;){if(l=St(l.times(p),h),f=u.plus(lo(l,new S(i),h)),fi(f.d).slice(0,h)===fi(u.d).slice(0,h))return u=u.times(2),o!==0&&(u=u.plus(kx(S,h+2,A).times(o+""))),u=lo(u,new S(b),h),S.precision=A,t==null?(It=!0,St(u,A)):u;u=f,i+=2}}function vD(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Tu(n/Dt),e.d=[],r=(n+1)%Dt,n<0&&(r+=Dt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Dt;r<i;)e.d.push(+t.slice(r,r+=Dt));t=t.slice(r),r=Dt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),It&&(e.e>Wp||e.e<-Wp))throw Error(GE+n)}else e.s=0,e.e=0,e.d=[0];return e}function St(e,t,n){var r,i,o,l,u,f,h,p,b=e.d;for(l=1,o=b[0];o>=10;o/=10)l++;if(r=t-l,r<0)r+=Dt,i=t,h=b[p=0];else{if(p=Math.ceil((r+1)/Dt),o=b.length,p>=o)return e;for(h=o=b[p],l=1;o>=10;o/=10)l++;r%=Dt,i=r-Dt+l}if(n!==void 0&&(o=el(10,l-i-1),u=h/o%10|0,f=t<0||b[p+1]!==void 0||h%o,f=n<4?(u||f)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||f||n==6&&(r>0?i>0?h/el(10,l-i):0:b[p-1])%10&1||n==(e.s<0?8:7))),t<1||!b[0])return f?(o=mn(e),b.length=1,t=t-o-1,b[0]=el(10,(Dt-t%Dt)%Dt),e.e=Tu(-t/Dt)||0):(b.length=1,b[0]=e.e=e.s=0),e;if(r==0?(b.length=p,o=1,p--):(b.length=p+1,o=el(10,Dt-r),b[p]=i>0?(h/el(10,l-i)%el(10,i)|0)*o:0),f)for(;;)if(p==0){(b[0]+=o)==Dn&&(b[0]=1,++e.e);break}else{if(b[p]+=o,b[p]!=Dn)break;b[p--]=0,o=1}for(r=b.length;b[--r]===0;)b.pop();if(It&&(e.e>Wp||e.e<-Wp))throw Error(GE+mn(e));return e}function ez(e,t){var n,r,i,o,l,u,f,h,p,b,g=e.constructor,x=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),It?St(t,x):t;if(f=e.d,b=t.d,r=t.e,h=e.e,f=f.slice(),l=h-r,l){for(p=l<0,p?(n=f,l=-l,u=b.length):(n=b,r=h,u=f.length),i=Math.max(Math.ceil(x/Dt),u)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=f.length,u=b.length,p=i<u,p&&(u=i),i=0;i<u;i++)if(f[i]!=b[i]){p=f[i]<b[i];break}l=0}for(p&&(n=f,f=b,b=n,t.s=-t.s),u=f.length,i=b.length-u;i>0;--i)f[u++]=0;for(i=b.length;i>l;){if(f[--i]<b[i]){for(o=i;o&&f[--o]===0;)f[o]=Dn-1;--f[o],f[i]+=Dn}f[i]-=b[i]}for(;f[--u]===0;)f.pop();for(;f[0]===0;f.shift())--r;return f[0]?(t.d=f,t.e=r,It?St(t,x):t):new g(0)}function Nl(e,t,n){var r,i=mn(e),o=fi(e.d),l=o.length;return t?(n&&(r=n-l)>0?o=o.charAt(0)+"."+o.slice(1)+ns(r):l>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+ns(-i-1)+o,n&&(r=n-l)>0&&(o+=ns(r))):i>=l?(o+=ns(i+1-l),n&&(r=n-i-1)>0&&(o=o+"."+ns(r))):((r=i+1)<l&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(o+="."),o+=ns(r))),e.s<0?"-"+o:o}function gD(e,t){if(e.length>t)return e.length=t,!0}function tz(e){var t,n,r;function i(o){var l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,o instanceof i){l.s=o.s,l.e=o.e,l.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(bl+o);if(o>0)l.s=1;else if(o<0)o=-o,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(o===~~o&&o<1e7){l.e=0,l.d=[o];return}return vD(l,o.toString())}else if(typeof o!="string")throw Error(bl+o);if(o.charCodeAt(0)===45?(o=o.slice(1),l.s=-1):l.s=1,OZ.test(o))vD(l,o);else throw Error(bl+o)}if(i.prototype=Se,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=tz,i.config=i.set=NZ,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function NZ(e){if(!e||typeof e!="object")throw Error(Ea+"Object expected");var t,n,r,i=["precision",1,Nu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Tu(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(bl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(bl+n+": "+r);return this}var YE=tz(CZ);Jr=new YE(1);const et=YE;function nz(e){var t;return e===0?t=1:t=Math.floor(new et(e).abs().log(10).toNumber())+1,t}function rz(e,t,n){for(var r=new et(e),i=0,o=[];r.lt(t)&&i<1e5;)o.push(r.toNumber()),r=r.add(n),i++;return o}var az=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},WE=(e,t,n)=>{if(e.lte(0))return new et(0);var r=nz(e.toNumber()),i=new et(10).pow(r),o=e.div(i),l=r!==1?.05:.1,u=new et(Math.ceil(o.div(l).toNumber())).add(n).mul(l),f=u.mul(i);return t?new et(f.toNumber()):new et(Math.ceil(f.toNumber()))},iz=(e,t,n)=>{var r;if(e.lte(0))return new et(0);var i=[1,2,2.5,5],o=e.toNumber(),l=Math.floor(new et(o).abs().log(10).toNumber()),u=new et(10).pow(l),f=e.div(u).toNumber(),h=i.findIndex(x=>x>=f-1e-10);if(h===-1&&(u=u.mul(10),h=0),h+=n,h>=i.length){var p=Math.floor(h/i.length);h%=i.length,u=u.mul(new et(10).pow(p))}var b=(r=i[h])!==null&&r!==void 0?r:1,g=new et(b).mul(u);return t?g:new et(Math.ceil(g.toNumber()))},TZ=(e,t,n)=>{var r=new et(1),i=new et(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new et(10).pow(nz(e)-1),i=new et(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new et(Math.floor(e)))}else e===0?i=new et(Math.floor((t-1)/2)):n||(i=new et(Math.floor(e)));for(var l=Math.floor((t-1)/2),u=[],f=0;f<t;f++)u.push(i.add(new et(f-l).mul(r)).toNumber());return u},oz=function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:WE;if(!Number.isFinite((n-t)/(r-1)))return{step:new et(0),tickMin:new et(0),tickMax:new et(0)};var u=l(new et(n).sub(t).div(r-1),i,o),f;t<=0&&n>=0?f=new et(0):(f=new et(t).add(n).div(2),f=f.sub(new et(f).mod(u)));var h=Math.ceil(f.sub(t).div(u).toNumber()),p=Math.ceil(new et(n).sub(f).div(u).toNumber()),b=h+p+1;return b>r?oz(t,n,r,i,o+1,l):(b<r&&(p=n>0?p+(r-b):p,h=n>0?h:h+(r-b)),{step:u,tickMin:f.sub(new et(h).mul(u)),tickMax:f.add(new et(p).mul(u))})},yD=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",u=Math.max(i,2),[f,h]=az([n,r]);if(f===-1/0||h===1/0){var p=h===1/0?[f,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),h];return n>r?p.reverse():p}if(f===h)return TZ(f,i,o);var b=l==="snap125"?iz:WE,{step:g,tickMin:x,tickMax:E}=oz(f,h,u,o,0,b),S=rz(x,E.add(new et(.1).mul(g)),g);return n>r?S.reverse():S},xD=function(t,n){var[r,i]=t,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[u,f]=az([r,i]);if(u===-1/0||f===1/0)return[r,i];if(u===f)return[u];var h=l==="snap125"?iz:WE,p=Math.max(n,2),b=h(new et(f).sub(u).div(p-1),o,0),g=[...rz(new et(u),new et(f),b),f];return o===!1&&(g=g.map(x=>Math.round(x))),r>i?g.reverse():g},sz=e=>e.rootProps.maxBarSize,PZ=e=>e.rootProps.barGap,lz=e=>e.rootProps.barCategoryGap,_Z=e=>e.rootProps.barSize,Qf=e=>e.rootProps.stackOffset,cz=e=>e.rootProps.reverseStackOrder,QE=e=>e.options.chartName,VE=e=>e.rootProps.syncId,uz=e=>e.rootProps.syncMethod,XE=e=>e.options.eventEmitter,DZ=e=>e.rootProps.baseValue,an={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Ws={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},ai={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},nv=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function rv(e,t,n){if(n!=="auto")return n;if(e!=null)return Ha(e,t)?"category":"number"}function wD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wD(Object(n),!0).forEach(function(r){MZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MZ(e,t,n){return(t=RZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RZ(e){var t=kZ(e,"string");return typeof t=="symbol"?t:t+""}function kZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var SD={allowDataOverflow:Ws.allowDataOverflow,allowDecimals:Ws.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Ws.angleAxisId,includeHidden:!1,name:void 0,reversed:Ws.reversed,scale:Ws.scale,tick:Ws.tick,tickCount:void 0,ticks:void 0,type:Ws.type,unit:void 0,niceTicks:"auto"},ED={allowDataOverflow:ai.allowDataOverflow,allowDecimals:ai.allowDecimals,allowDuplicatedCategory:ai.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:ai.radiusAxisId,includeHidden:ai.includeHidden,name:void 0,reversed:ai.reversed,scale:ai.scale,tick:ai.tick,tickCount:ai.tickCount,ticks:void 0,type:ai.type,unit:void 0,niceTicks:"auto"},LZ=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},ZE=W([LZ,CI],(e,t)=>{var n;if(e!=null)return e;var r=(n=rv(t,"angleAxis",SD.type))!==null&&n!==void 0?n:"category";return Qp(Qp({},SD),{},{type:r})}),IZ=(e,t)=>e.polarAxis.radiusAxis[t],JE=W([IZ,CI],(e,t)=>{var n;if(e!=null)return e;var r=(n=rv(t,"radiusAxis",ED.type))!==null&&n!==void 0?n:"category";return Qp(Qp({},ED),{},{type:r})}),av=e=>e.polarOptions,eA=W([vo,go,En],KI),dz=W([av,eA],(e,t)=>{if(e!=null)return ar(e.innerRadius,t,0)}),fz=W([av,eA],(e,t)=>{if(e!=null)return ar(e.outerRadius,t,t*.8)}),zZ=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},hz=W([av],zZ);W([ZE,hz],nv);var mz=W([eA,dz,fz],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});W([JE,mz],nv);var pz=W([tt,av,dz,fz,vo,go],(e,t,n,r,i,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:u,startAngle:f,endAngle:h}=t;return{cx:ar(l,i,i/2),cy:ar(u,o,o/2),innerRadius:n,outerRadius:r,startAngle:f,endAngle:h,clockWise:!1}}}),$t=(e,t)=>t,Vf=(e,t,n)=>n;function iv(e){return e==null?void 0:e.id}function bz(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:o}=n,l=new Map;return e.forEach(u=>{var f,h=(f=u.data)!==null&&f!==void 0?f:r;if(!(h==null||h.length===0)){var p=iv(u);h.forEach((b,g)=>{var x=o==null||i?g:String(ot(b,o,null)),E=ot(b,u.dataKey,0),S;l.has(x)?S=l.get(x):S={},Object.assign(S,{[p]:E}),l.set(x,S)})}}),Array.from(l.values())}function ov(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var sv=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function lv(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function UZ(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var In=e=>{var t=tt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Pu=e=>e.tooltip.settings.axisId;function tA(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(o){function l(){return o.apply(this,arguments)}return l.toString=function(){return o.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(o){var l=i[0],u=i[1];return l<=u?o>=l&&o<=u:o>=u&&o<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?o=>t.call(e,o):void 0,map:(o,l)=>{var u=e(o);if(u!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var f=e.bandwidth();switch(l.position){case"middle":u+=f/2;break;case"end":u+=f;break}}return u}}}}}var vz=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!hi(t)){for(var n,r,i=0;i<t.length;i++){var o=t[i];Ye(o)&&((n===void 0||o<n)&&(n=o),(r===void 0||o>r)&&(r=o))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function bs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function qZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function nA(e){let t,n,r;e.length!==2?(t=bs,n=(u,f)=>bs(e(u),f),r=(u,f)=>e(u)-f):(t=e===bs||e===qZ?e:BZ,n=e,r=e);function i(u,f,h=0,p=u.length){if(h<p){if(t(f,f)!==0)return p;do{const b=h+p>>>1;n(u[b],f)<0?h=b+1:p=b}while(h<p)}return h}function o(u,f,h=0,p=u.length){if(h<p){if(t(f,f)!==0)return p;do{const b=h+p>>>1;n(u[b],f)<=0?h=b+1:p=b}while(h<p)}return h}function l(u,f,h=0,p=u.length){const b=i(u,f,h,p-1);return b>h&&r(u[b-1],f)>-r(u[b],f)?b-1:b}return{left:i,center:l,right:o}}function BZ(){return 0}function gz(e){return e===null?NaN:+e}function*FZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const $Z=nA(bs),Xf=$Z.right;nA(gz).center;class AD extends Map{constructor(t,n=GZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(jD(this,t))}has(t){return super.has(jD(this,t))}set(t,n){return super.set(KZ(this,t),n)}delete(t){return super.delete(HZ(this,t))}}function jD({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function KZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function HZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function GZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function YZ(e=bs){if(e===bs)return yz;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function yz(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const WZ=Math.sqrt(50),QZ=Math.sqrt(10),VZ=Math.sqrt(2);function Vp(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),l=o>=WZ?10:o>=QZ?5:o>=VZ?2:1;let u,f,h;return i<0?(h=Math.pow(10,-i)/l,u=Math.round(e*h),f=Math.round(t*h),u/h<e&&++u,f/h>t&&--f,h=-h):(h=Math.pow(10,i)*l,u=Math.round(e/h),f=Math.round(t/h),u*h<e&&++u,f*h>t&&--f),f<u&&.5<=n&&n<2?Vp(e,t,n*2):[u,f,h]}function fS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,l]=r?Vp(t,e,n):Vp(e,t,n);if(!(o>=i))return[];const u=o-i+1,f=new Array(u);if(r)if(l<0)for(let h=0;h<u;++h)f[h]=(o-h)/-l;else for(let h=0;h<u;++h)f[h]=(o-h)*l;else if(l<0)for(let h=0;h<u;++h)f[h]=(i+h)/-l;else for(let h=0;h<u;++h)f[h]=(i+h)*l;return f}function hS(e,t,n){return t=+t,e=+e,n=+n,Vp(e,t,n)[2]}function mS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?hS(t,e,n):hS(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function CD(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function OD(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function xz(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?yz:YZ(i);r>n;){if(r-n>600){const f=r-n+1,h=t-n+1,p=Math.log(f),b=.5*Math.exp(2*p/3),g=.5*Math.sqrt(p*b*(f-b)/f)*(h-f/2<0?-1:1),x=Math.max(n,Math.floor(t-h*b/f+g)),E=Math.min(r,Math.floor(t+(f-h)*b/f+g));xz(e,t,x,E,i)}const o=e[t];let l=n,u=r;for(zd(e,n,t),i(e[r],o)>0&&zd(e,n,r);l<u;){for(zd(e,l,u),++l,--u;i(e[l],o)<0;)++l;for(;i(e[u],o)>0;)--u}i(e[n],o)===0?zd(e,n,u):(++u,zd(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function zd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function XZ(e,t,n){if(e=Float64Array.from(FZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return OD(e);if(t>=1)return CD(e);var r,i=(r-1)*t,o=Math.floor(i),l=CD(xz(e,o).subarray(0,o+1)),u=OD(e.subarray(o+1));return l+(u-l)*(i-o)}}function ZZ(e,t,n=gz){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),l=+n(e[o],o,e),u=+n(e[o+1],o+1,e);return l+(u-l)*(i-o)}}function JZ(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Aa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function yo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const pS=Symbol("implicit");function rA(){var e=new AD,t=[],n=[],r=pS;function i(o){let l=e.get(o);if(l===void 0){if(r!==pS)return r;e.set(o,l=t.push(o)-1)}return n[l%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new AD;for(const l of o)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return rA(t,n).unknown(r)},Aa.apply(i,arguments),i}function aA(){var e=rA().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,l,u=!1,f=0,h=0,p=.5;delete e.unknown;function b(){var g=t().length,x=i<r,E=x?i:r,S=x?r:i;o=(S-E)/Math.max(1,g-f+h*2),u&&(o=Math.floor(o)),E+=(S-E-o*(g-f))*p,l=o*(1-f),u&&(E=Math.round(E),l=Math.round(l));var A=JZ(g).map(function(j){return E+o*j});return n(x?A.reverse():A)}return e.domain=function(g){return arguments.length?(t(g),b()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,b()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,u=!0,b()},e.bandwidth=function(){return l},e.step=function(){return o},e.round=function(g){return arguments.length?(u=!!g,b()):u},e.padding=function(g){return arguments.length?(f=Math.min(1,h=+g),b()):f},e.paddingInner=function(g){return arguments.length?(f=Math.min(1,g),b()):f},e.paddingOuter=function(g){return arguments.length?(h=+g,b()):h},e.align=function(g){return arguments.length?(p=Math.max(0,Math.min(1,g)),b()):p},e.copy=function(){return aA(t(),[r,i]).round(u).paddingInner(f).paddingOuter(h).align(p)},Aa.apply(b(),arguments)}function wz(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return wz(t())},e}function eJ(){return wz(aA.apply(null,arguments).paddingInner(1))}function iA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Sz(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Zf(){}var gf=.7,Xp=1/gf,Hc="\\s*([+-]?\\d+)\\s*",yf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tJ=/^#([0-9a-f]{3,8})$/,nJ=new RegExp(`^rgb\\(${Hc},${Hc},${Hc}\\)$`),rJ=new RegExp(`^rgb\\(${mi},${mi},${mi}\\)$`),aJ=new RegExp(`^rgba\\(${Hc},${Hc},${Hc},${yf}\\)$`),iJ=new RegExp(`^rgba\\(${mi},${mi},${mi},${yf}\\)$`),oJ=new RegExp(`^hsl\\(${yf},${mi},${mi}\\)$`),sJ=new RegExp(`^hsla\\(${yf},${mi},${mi},${yf}\\)$`),ND={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};iA(Zf,xf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:TD,formatHex:TD,formatHex8:lJ,formatHsl:cJ,formatRgb:PD,toString:PD});function TD(){return this.rgb().formatHex()}function lJ(){return this.rgb().formatHex8()}function cJ(){return Ez(this).formatHsl()}function PD(){return this.rgb().formatRgb()}function xf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=tJ.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?_D(t):n===3?new kr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$m(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$m(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=nJ.exec(e))?new kr(t[1],t[2],t[3],1):(t=rJ.exec(e))?new kr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=aJ.exec(e))?$m(t[1],t[2],t[3],t[4]):(t=iJ.exec(e))?$m(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=oJ.exec(e))?RD(t[1],t[2]/100,t[3]/100,1):(t=sJ.exec(e))?RD(t[1],t[2]/100,t[3]/100,t[4]):ND.hasOwnProperty(e)?_D(ND[e]):e==="transparent"?new kr(NaN,NaN,NaN,0):null}function _D(e){return new kr(e>>16&255,e>>8&255,e&255,1)}function $m(e,t,n,r){return r<=0&&(e=t=n=NaN),new kr(e,t,n,r)}function uJ(e){return e instanceof Zf||(e=xf(e)),e?(e=e.rgb(),new kr(e.r,e.g,e.b,e.opacity)):new kr}function bS(e,t,n,r){return arguments.length===1?uJ(e):new kr(e,t,n,r??1)}function kr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}iA(kr,bS,Sz(Zf,{brighter(e){return e=e==null?Xp:Math.pow(Xp,e),new kr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?gf:Math.pow(gf,e),new kr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kr(vl(this.r),vl(this.g),vl(this.b),Zp(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:DD,formatHex:DD,formatHex8:dJ,formatRgb:MD,toString:MD}));function DD(){return`#${rl(this.r)}${rl(this.g)}${rl(this.b)}`}function dJ(){return`#${rl(this.r)}${rl(this.g)}${rl(this.b)}${rl((isNaN(this.opacity)?1:this.opacity)*255)}`}function MD(){const e=Zp(this.opacity);return`${e===1?"rgb(":"rgba("}${vl(this.r)}, ${vl(this.g)}, ${vl(this.b)}${e===1?")":`, ${e})`}`}function Zp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function vl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rl(e){return e=vl(e),(e<16?"0":"")+e.toString(16)}function RD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new za(e,t,n,r)}function Ez(e){if(e instanceof za)return new za(e.h,e.s,e.l,e.opacity);if(e instanceof Zf||(e=xf(e)),!e)return new za;if(e instanceof za)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,u=o-i,f=(o+i)/2;return u?(t===o?l=(n-r)/u+(n<r)*6:n===o?l=(r-t)/u+2:l=(t-n)/u+4,u/=f<.5?o+i:2-o-i,l*=60):u=f>0&&f<1?0:l,new za(l,u,f,e.opacity)}function fJ(e,t,n,r){return arguments.length===1?Ez(e):new za(e,t,n,r??1)}function za(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}iA(za,fJ,Sz(Zf,{brighter(e){return e=e==null?Xp:Math.pow(Xp,e),new za(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?gf:Math.pow(gf,e),new za(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new kr(Lx(e>=240?e-240:e+120,i,r),Lx(e,i,r),Lx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new za(kD(this.h),Km(this.s),Km(this.l),Zp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Zp(this.opacity);return`${e===1?"hsl(":"hsla("}${kD(this.h)}, ${Km(this.s)*100}%, ${Km(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kD(e){return e=(e||0)%360,e<0?e+360:e}function Km(e){return Math.max(0,Math.min(1,e||0))}function Lx(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const oA=e=>()=>e;function hJ(e,t){return function(n){return e+n*t}}function mJ(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function pJ(e){return(e=+e)==1?Az:function(t,n){return n-t?mJ(t,n,e):oA(isNaN(t)?n:t)}}function Az(e,t){var n=t-e;return n?hJ(e,n):oA(isNaN(e)?t:e)}const LD=(function e(t){var n=pJ(t);function r(i,o){var l=n((i=bS(i)).r,(o=bS(o)).r),u=n(i.g,o.g),f=n(i.b,o.b),h=Az(i.opacity,o.opacity);return function(p){return i.r=l(p),i.g=u(p),i.b=f(p),i.opacity=h(p),i+""}}return r.gamma=e,r})(1);function bJ(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function vJ(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gJ(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),l;for(l=0;l<r;++l)i[l]=_u(e[l],t[l]);for(;l<n;++l)o[l]=t[l];return function(u){for(l=0;l<r;++l)o[l]=i[l](u);return o}}function yJ(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Jp(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xJ(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=_u(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var vS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ix=new RegExp(vS.source,"g");function wJ(e){return function(){return e}}function SJ(e){return function(t){return e(t)+""}}function EJ(e,t){var n=vS.lastIndex=Ix.lastIndex=0,r,i,o,l=-1,u=[],f=[];for(e=e+"",t=t+"";(r=vS.exec(e))&&(i=Ix.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),u[l]?u[l]+=o:u[++l]=o),(r=r[0])===(i=i[0])?u[l]?u[l]+=i:u[++l]=i:(u[++l]=null,f.push({i:l,x:Jp(r,i)})),n=Ix.lastIndex;return n<t.length&&(o=t.slice(n),u[l]?u[l]+=o:u[++l]=o),u.length<2?f[0]?SJ(f[0].x):wJ(t):(t=f.length,function(h){for(var p=0,b;p<t;++p)u[(b=f[p]).i]=b.x(h);return u.join("")})}function _u(e,t){var n=typeof t,r;return t==null||n==="boolean"?oA(t):(n==="number"?Jp:n==="string"?(r=xf(t))?(t=r,LD):EJ:t instanceof xf?LD:t instanceof Date?yJ:vJ(t)?bJ:Array.isArray(t)?gJ:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?xJ:Jp)(e,t)}function sA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function AJ(e,t){t===void 0&&(t=e,e=_u);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(l){var u=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return o[u](l-u)}}function jJ(e){return function(){return e}}function eb(e){return+e}var ID=[0,1];function vr(e){return e}function gS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:jJ(isNaN(t)?NaN:.5)}function CJ(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function OJ(e,t,n){var r=e[0],i=e[1],o=t[0],l=t[1];return i<r?(r=gS(i,r),o=n(l,o)):(r=gS(r,i),o=n(o,l)),function(u){return o(r(u))}}function NJ(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=gS(e[l],e[l+1]),o[l]=n(t[l],t[l+1]);return function(u){var f=Xf(e,u,1,r)-1;return o[f](i[f](u))}}function Jf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function cv(){var e=ID,t=ID,n=_u,r,i,o,l=vr,u,f,h;function p(){var g=Math.min(e.length,t.length);return l!==vr&&(l=CJ(e[0],e[g-1])),u=g>2?NJ:OJ,f=h=null,b}function b(g){return g==null||isNaN(g=+g)?o:(f||(f=u(e.map(r),t,n)))(r(l(g)))}return b.invert=function(g){return l(i((h||(h=u(t,e.map(r),Jp)))(g)))},b.domain=function(g){return arguments.length?(e=Array.from(g,eb),p()):e.slice()},b.range=function(g){return arguments.length?(t=Array.from(g),p()):t.slice()},b.rangeRound=function(g){return t=Array.from(g),n=sA,p()},b.clamp=function(g){return arguments.length?(l=g?!0:vr,p()):l!==vr},b.interpolate=function(g){return arguments.length?(n=g,p()):n},b.unknown=function(g){return arguments.length?(o=g,b):o},function(g,x){return r=g,i=x,p()}}function lA(){return cv()(vr,vr)}function TJ(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function tb(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function mu(e){return e=tb(Math.abs(e)),e?e[1]:NaN}function PJ(e,t){return function(n,r){for(var i=n.length,o=[],l=0,u=e[0],f=0;i>0&&u>0&&(f+u+1>r&&(u=Math.max(1,r-f)),o.push(n.substring(i-=u,i+u)),!((f+=u+1)>r));)u=e[l=(l+1)%e.length];return o.reverse().join(t)}}function _J(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var DJ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wf(e){if(!(t=DJ.exec(e)))throw new Error("invalid format: "+e);var t;return new cA({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}wf.prototype=cA.prototype;function cA(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}cA.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 MJ(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var nb;function RJ(e,t){var n=tb(e,t);if(!n)return nb=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(nb=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return o===l?r:o>l?r+new Array(o-l+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+tb(e,Math.max(0,t+o-1))[0]}function zD(e,t){var n=tb(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const UD={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:TJ,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>zD(e*100,t),r:zD,s:RJ,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function qD(e){return e}var BD=Array.prototype.map,FD=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kJ(e){var t=e.grouping===void 0||e.thousands===void 0?qD:PJ(BD.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?qD:_J(BD.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(b,g){b=wf(b);var x=b.fill,E=b.align,S=b.sign,A=b.symbol,j=b.zero,C=b.width,O=b.comma,T=b.precision,_=b.trim,P=b.type;P==="n"?(O=!0,P="g"):UD[P]||(T===void 0&&(T=12),_=!0,P="g"),(j||x==="0"&&E==="=")&&(j=!0,x="0",E="=");var D=(g&&g.prefix!==void 0?g.prefix:"")+(A==="$"?n:A==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),L=(A==="$"?r:/[%p]/.test(P)?l:"")+(g&&g.suffix!==void 0?g.suffix:""),z=UD[P],R=/[defgprs%]/.test(P);T=T===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function q(U){var re=D,G=L,ie,K,Z;if(P==="c")G=z(U)+G,U="";else{U=+U;var $=U<0||1/U<0;if(U=isNaN(U)?f:z(Math.abs(U),T),_&&(U=MJ(U)),$&&+U==0&&S!=="+"&&($=!1),re=($?S==="("?S:u:S==="-"||S==="("?"":S)+re,G=(P==="s"&&!isNaN(U)&&nb!==void 0?FD[8+nb/3]:"")+G+($&&S==="("?")":""),R){for(ie=-1,K=U.length;++ie<K;)if(Z=U.charCodeAt(ie),48>Z||Z>57){G=(Z===46?i+U.slice(ie+1):U.slice(ie))+G,U=U.slice(0,ie);break}}}O&&!j&&(U=t(U,1/0));var ee=re.length+U.length+G.length,pe=ee<C?new Array(C-ee+1).join(x):"";switch(O&&j&&(U=t(pe+U,pe.length?C-G.length:1/0),pe=""),E){case"<":U=re+U+G+pe;break;case"=":U=re+pe+U+G;break;case"^":U=pe.slice(0,ee=pe.length>>1)+re+U+G+pe.slice(ee);break;default:U=pe+re+U+G;break}return o(U)}return q.toString=function(){return b+""},q}function p(b,g){var x=Math.max(-8,Math.min(8,Math.floor(mu(g)/3)))*3,E=Math.pow(10,-x),S=h((b=wf(b),b.type="f",b),{suffix:FD[8+x/3]});return function(A){return S(E*A)}}return{format:h,formatPrefix:p}}var Hm,uA,jz;LJ({thousands:",",grouping:[3],currency:["$",""]});function LJ(e){return Hm=kJ(e),uA=Hm.format,jz=Hm.formatPrefix,Hm}function IJ(e){return Math.max(0,-mu(Math.abs(e)))}function zJ(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(mu(t)/3)))*3-mu(Math.abs(e)))}function UJ(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,mu(t)-mu(e))+1}function Cz(e,t,n,r){var i=mS(e,t,n),o;switch(r=wf(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=zJ(i,l))&&(r.precision=o),jz(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=UJ(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=IJ(i))&&(r.precision=o-(r.type==="%")*2);break}}return uA(r)}function Cs(e){var t=e.domain;return e.ticks=function(n){var r=t();return fS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Cz(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,l=r[i],u=r[o],f,h,p=10;for(u<l&&(h=l,l=u,u=h,h=i,i=o,o=h);p-- >0;){if(h=hS(l,u,n),h===f)return r[i]=l,r[o]=u,t(r);if(h>0)l=Math.floor(l/h)*h,u=Math.ceil(u/h)*h;else if(h<0)l=Math.ceil(l*h)/h,u=Math.floor(u*h)/h;else break;f=h}return e},e}function Oz(){var e=lA();return e.copy=function(){return Jf(e,Oz())},Aa.apply(e,arguments),Cs(e)}function Nz(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,eb),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Nz(e).unknown(t)},e=arguments.length?Array.from(e,eb):[0,1],Cs(n)}function Tz(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],l;return o<i&&(l=n,n=r,r=l,l=i,i=o,o=l),e[n]=t.floor(i),e[r]=t.ceil(o),e}function $D(e){return Math.log(e)}function KD(e){return Math.exp(e)}function qJ(e){return-Math.log(-e)}function BJ(e){return-Math.exp(-e)}function FJ(e){return isFinite(e)?+("1e"+e):e<0?0:e}function $J(e){return e===10?FJ:e===Math.E?Math.exp:t=>Math.pow(e,t)}function KJ(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function HD(e){return(t,n)=>-e(-t,n)}function dA(e){const t=e($D,KD),n=t.domain;let r=10,i,o;function l(){return i=KJ(r),o=$J(r),n()[0]<0?(i=HD(i),o=HD(o),e(qJ,BJ)):e($D,KD),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const f=n();let h=f[0],p=f[f.length-1];const b=p<h;b&&([h,p]=[p,h]);let g=i(h),x=i(p),E,S;const A=u==null?10:+u;let j=[];if(!(r%1)&&x-g<A){if(g=Math.floor(g),x=Math.ceil(x),h>0){for(;g<=x;++g)for(E=1;E<r;++E)if(S=g<0?E/o(-g):E*o(g),!(S<h)){if(S>p)break;j.push(S)}}else for(;g<=x;++g)for(E=r-1;E>=1;--E)if(S=g>0?E/o(-g):E*o(g),!(S<h)){if(S>p)break;j.push(S)}j.length*2<A&&(j=fS(h,p,A))}else j=fS(g,x,Math.min(x-g,A)).map(o);return b?j.reverse():j},t.tickFormat=(u,f)=>{if(u==null&&(u=10),f==null&&(f=r===10?"s":","),typeof f!="function"&&(!(r%1)&&(f=wf(f)).precision==null&&(f.trim=!0),f=uA(f)),u===1/0)return f;const h=Math.max(1,r*u/t.ticks().length);return p=>{let b=p/o(Math.round(i(p)));return b*r<r-.5&&(b*=r),b<=h?f(p):""}},t.nice=()=>n(Tz(n(),{floor:u=>o(Math.floor(i(u))),ceil:u=>o(Math.ceil(i(u)))})),t}function Pz(){const e=dA(cv()).domain([1,10]);return e.copy=()=>Jf(e,Pz()).base(e.base()),Aa.apply(e,arguments),e}function GD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function YD(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function fA(e){var t=1,n=e(GD(t),YD(t));return n.constant=function(r){return arguments.length?e(GD(t=+r),YD(t)):t},Cs(n)}function _z(){var e=fA(cv());return e.copy=function(){return Jf(e,_z()).constant(e.constant())},Aa.apply(e,arguments)}function WD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function HJ(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function GJ(e){return e<0?-e*e:e*e}function hA(e){var t=e(vr,vr),n=1;function r(){return n===1?e(vr,vr):n===.5?e(HJ,GJ):e(WD(n),WD(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Cs(t)}function mA(){var e=hA(cv());return e.copy=function(){return Jf(e,mA()).exponent(e.exponent())},Aa.apply(e,arguments),e}function YJ(){return mA.apply(null,arguments).exponent(.5)}function QD(e){return Math.sign(e)*e*e}function WJ(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Dz(){var e=lA(),t=[0,1],n=!1,r;function i(o){var l=WJ(e(o));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(o){return e.invert(QD(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,eb)).map(QD)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Dz(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Aa.apply(i,arguments),Cs(i)}function Mz(){var e=[],t=[],n=[],r;function i(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l<u;)n[l-1]=ZZ(e,l/u);return o}function o(l){return l==null||isNaN(l=+l)?r:t[Xf(n,l)]}return o.invertExtent=function(l){var u=t.indexOf(l);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},o.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let u of l)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(bs),i()},o.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},o.unknown=function(l){return arguments.length?(r=l,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return Mz().domain(e).range(t).unknown(r)},Aa.apply(o,arguments)}function Rz(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function l(f){return f!=null&&f<=f?i[Xf(r,f,0,n)]:o}function u(){var f=-1;for(r=new Array(n);++f<n;)r[f]=((f+1)*t-(f-n)*e)/(n+1);return l}return l.domain=function(f){return arguments.length?([e,t]=f,e=+e,t=+t,u()):[e,t]},l.range=function(f){return arguments.length?(n=(i=Array.from(f)).length-1,u()):i.slice()},l.invertExtent=function(f){var h=i.indexOf(f);return h<0?[NaN,NaN]:h<1?[e,r[0]]:h>=n?[r[n-1],t]:[r[h-1],r[h]]},l.unknown=function(f){return arguments.length&&(o=f),l},l.thresholds=function(){return r.slice()},l.copy=function(){return Rz().domain([e,t]).range(i).unknown(o)},Aa.apply(Cs(l),arguments)}function kz(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[Xf(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var l=t.indexOf(o);return[e[l-1],e[l]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return kz().domain(e).range(t).unknown(n)},Aa.apply(i,arguments)}const zx=new Date,Ux=new Date;function An(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const l=i(o),u=i.ceil(o);return o-l<u-o?l:u},i.offset=(o,l)=>(t(o=new Date(+o),l==null?1:Math.floor(l)),o),i.range=(o,l,u)=>{const f=[];if(o=i.ceil(o),u=u==null?1:Math.floor(u),!(o<l)||!(u>0))return f;let h;do f.push(h=new Date(+o)),t(o,u),e(o);while(h<o&&o<l);return f},i.filter=o=>An(l=>{if(l>=l)for(;e(l),!o(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!o(l););else for(;--u>=0;)for(;t(l,1),!o(l););}),n&&(i.count=(o,l)=>(zx.setTime(+o),Ux.setTime(+l),e(zx),e(Ux),Math.floor(n(zx,Ux))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?l=>r(l)%o===0:l=>i.count(0,l)%o===0):i)),i}const rb=An(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);rb.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?An(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):rb);rb.range;const oo=1e3,wa=oo*60,so=wa*60,mo=so*24,pA=mo*7,VD=mo*30,qx=mo*365,al=An(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*oo)},(e,t)=>(t-e)/oo,e=>e.getUTCSeconds());al.range;const bA=An(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*oo)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getMinutes());bA.range;const vA=An(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getUTCMinutes());vA.range;const gA=An(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*oo-e.getMinutes()*wa)},(e,t)=>{e.setTime(+e+t*so)},(e,t)=>(t-e)/so,e=>e.getHours());gA.range;const yA=An(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*so)},(e,t)=>(t-e)/so,e=>e.getUTCHours());yA.range;const eh=An(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wa)/mo,e=>e.getDate()-1);eh.range;const uv=An(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mo,e=>e.getUTCDate()-1);uv.range;const Lz=An(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mo,e=>Math.floor(e/mo));Lz.range;function Rl(e){return An(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*wa)/pA)}const dv=Rl(0),ab=Rl(1),QJ=Rl(2),VJ=Rl(3),pu=Rl(4),XJ=Rl(5),ZJ=Rl(6);dv.range;ab.range;QJ.range;VJ.range;pu.range;XJ.range;ZJ.range;function kl(e){return An(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/pA)}const fv=kl(0),ib=kl(1),JJ=kl(2),eee=kl(3),bu=kl(4),tee=kl(5),nee=kl(6);fv.range;ib.range;JJ.range;eee.range;bu.range;tee.range;nee.range;const xA=An(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());xA.range;const wA=An(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());wA.range;const po=An(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());po.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:An(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});po.range;const bo=An(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());bo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:An(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});bo.range;function Iz(e,t,n,r,i,o){const l=[[al,1,oo],[al,5,5*oo],[al,15,15*oo],[al,30,30*oo],[o,1,wa],[o,5,5*wa],[o,15,15*wa],[o,30,30*wa],[i,1,so],[i,3,3*so],[i,6,6*so],[i,12,12*so],[r,1,mo],[r,2,2*mo],[n,1,pA],[t,1,VD],[t,3,3*VD],[e,1,qx]];function u(h,p,b){const g=p<h;g&&([h,p]=[p,h]);const x=b&&typeof b.range=="function"?b:f(h,p,b),E=x?x.range(h,+p+1):[];return g?E.reverse():E}function f(h,p,b){const g=Math.abs(p-h)/b,x=nA(([,,A])=>A).right(l,g);if(x===l.length)return e.every(mS(h/qx,p/qx,b));if(x===0)return rb.every(Math.max(mS(h,p,b),1));const[E,S]=l[g/l[x-1][2]<l[x][2]/g?x-1:x];return E.every(S)}return[u,f]}const[ree,aee]=Iz(bo,wA,fv,Lz,yA,vA),[iee,oee]=Iz(po,xA,dv,eh,gA,bA);function Bx(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Fx(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Ud(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function see(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,l=e.shortDays,u=e.months,f=e.shortMonths,h=qd(i),p=Bd(i),b=qd(o),g=Bd(o),x=qd(l),E=Bd(l),S=qd(u),A=Bd(u),j=qd(f),C=Bd(f),O={a:Z,A:$,b:ee,B:pe,c:null,d:nM,e:nM,f:Pee,g:qee,G:Fee,H:Oee,I:Nee,j:Tee,L:zz,m:_ee,M:Dee,p:k,q:Q,Q:iM,s:oM,S:Mee,u:Ree,U:kee,V:Lee,w:Iee,W:zee,x:null,X:null,y:Uee,Y:Bee,Z:$ee,"%":aM},T={a:ce,A:fe,b:xe,B:Oe,c:null,d:rM,e:rM,f:Yee,g:rte,G:ite,H:Kee,I:Hee,j:Gee,L:qz,m:Wee,M:Qee,p:qe,q:Be,Q:iM,s:oM,S:Vee,u:Xee,U:Zee,V:Jee,w:ete,W:tte,x:null,X:null,y:nte,Y:ate,Z:ote,"%":aM},_={a:R,A:q,b:U,B:re,c:G,d:eM,e:eM,f:Eee,g:JD,G:ZD,H:tM,I:tM,j:yee,L:See,m:gee,M:xee,p:z,q:vee,Q:jee,s:Cee,S:wee,u:fee,U:hee,V:mee,w:dee,W:pee,x:ie,X:K,y:JD,Y:ZD,Z:bee,"%":Aee};O.x=P(n,O),O.X=P(r,O),O.c=P(t,O),T.x=P(n,T),T.X=P(r,T),T.c=P(t,T);function P(he,ue){return function(Ee){var de=[],Le=-1,Me=0,Ie=he.length,ut,Un,qn;for(Ee instanceof Date||(Ee=new Date(+Ee));++Le<Ie;)he.charCodeAt(Le)===37&&(de.push(he.slice(Me,Le)),(Un=XD[ut=he.charAt(++Le)])!=null?ut=he.charAt(++Le):Un=ut==="e"?" ":"0",(qn=ue[ut])&&(ut=qn(Ee,Un)),de.push(ut),Me=Le+1);return de.push(he.slice(Me,Le)),de.join("")}}function D(he,ue){return function(Ee){var de=Ud(1900,void 0,1),Le=L(de,he,Ee+="",0),Me,Ie;if(Le!=Ee.length)return null;if("Q"in de)return new Date(de.Q);if("s"in de)return new Date(de.s*1e3+("L"in de?de.L:0));if(ue&&!("Z"in de)&&(de.Z=0),"p"in de&&(de.H=de.H%12+de.p*12),de.m===void 0&&(de.m="q"in de?de.q:0),"V"in de){if(de.V<1||de.V>53)return null;"w"in de||(de.w=1),"Z"in de?(Me=Fx(Ud(de.y,0,1)),Ie=Me.getUTCDay(),Me=Ie>4||Ie===0?ib.ceil(Me):ib(Me),Me=uv.offset(Me,(de.V-1)*7),de.y=Me.getUTCFullYear(),de.m=Me.getUTCMonth(),de.d=Me.getUTCDate()+(de.w+6)%7):(Me=Bx(Ud(de.y,0,1)),Ie=Me.getDay(),Me=Ie>4||Ie===0?ab.ceil(Me):ab(Me),Me=eh.offset(Me,(de.V-1)*7),de.y=Me.getFullYear(),de.m=Me.getMonth(),de.d=Me.getDate()+(de.w+6)%7)}else("W"in de||"U"in de)&&("w"in de||(de.w="u"in de?de.u%7:"W"in de?1:0),Ie="Z"in de?Fx(Ud(de.y,0,1)).getUTCDay():Bx(Ud(de.y,0,1)).getDay(),de.m=0,de.d="W"in de?(de.w+6)%7+de.W*7-(Ie+5)%7:de.w+de.U*7-(Ie+6)%7);return"Z"in de?(de.H+=de.Z/100|0,de.M+=de.Z%100,Fx(de)):Bx(de)}}function L(he,ue,Ee,de){for(var Le=0,Me=ue.length,Ie=Ee.length,ut,Un;Le<Me;){if(de>=Ie)return-1;if(ut=ue.charCodeAt(Le++),ut===37){if(ut=ue.charAt(Le++),Un=_[ut in XD?ue.charAt(Le++):ut],!Un||(de=Un(he,Ee,de))<0)return-1}else if(ut!=Ee.charCodeAt(de++))return-1}return de}function z(he,ue,Ee){var de=h.exec(ue.slice(Ee));return de?(he.p=p.get(de[0].toLowerCase()),Ee+de[0].length):-1}function R(he,ue,Ee){var de=x.exec(ue.slice(Ee));return de?(he.w=E.get(de[0].toLowerCase()),Ee+de[0].length):-1}function q(he,ue,Ee){var de=b.exec(ue.slice(Ee));return de?(he.w=g.get(de[0].toLowerCase()),Ee+de[0].length):-1}function U(he,ue,Ee){var de=j.exec(ue.slice(Ee));return de?(he.m=C.get(de[0].toLowerCase()),Ee+de[0].length):-1}function re(he,ue,Ee){var de=S.exec(ue.slice(Ee));return de?(he.m=A.get(de[0].toLowerCase()),Ee+de[0].length):-1}function G(he,ue,Ee){return L(he,t,ue,Ee)}function ie(he,ue,Ee){return L(he,n,ue,Ee)}function K(he,ue,Ee){return L(he,r,ue,Ee)}function Z(he){return l[he.getDay()]}function $(he){return o[he.getDay()]}function ee(he){return f[he.getMonth()]}function pe(he){return u[he.getMonth()]}function k(he){return i[+(he.getHours()>=12)]}function Q(he){return 1+~~(he.getMonth()/3)}function ce(he){return l[he.getUTCDay()]}function fe(he){return o[he.getUTCDay()]}function xe(he){return f[he.getUTCMonth()]}function Oe(he){return u[he.getUTCMonth()]}function qe(he){return i[+(he.getUTCHours()>=12)]}function Be(he){return 1+~~(he.getUTCMonth()/3)}return{format:function(he){var ue=P(he+="",O);return ue.toString=function(){return he},ue},parse:function(he){var ue=D(he+="",!1);return ue.toString=function(){return he},ue},utcFormat:function(he){var ue=P(he+="",T);return ue.toString=function(){return he},ue},utcParse:function(he){var ue=D(he+="",!0);return ue.toString=function(){return he},ue}}}var XD={"-":"",_:" ",0:"0"},zn=/^\s*\d+/,lee=/^%/,cee=/[\\^$*+?|[\]().{}]/g;function st(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function uee(e){return e.replace(cee,"\\$&")}function qd(e){return new RegExp("^(?:"+e.map(uee).join("|")+")","i")}function Bd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function dee(e,t,n){var r=zn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function fee(e,t,n){var r=zn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function hee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function mee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function pee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ZD(e,t,n){var r=zn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function JD(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bee(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function vee(e,t,n){var r=zn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function gee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function eM(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function yee(e,t,n){var r=zn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function tM(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function xee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function wee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function See(e,t,n){var r=zn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Eee(e,t,n){var r=zn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Aee(e,t,n){var r=lee.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function jee(e,t,n){var r=zn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Cee(e,t,n){var r=zn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function nM(e,t){return st(e.getDate(),t,2)}function Oee(e,t){return st(e.getHours(),t,2)}function Nee(e,t){return st(e.getHours()%12||12,t,2)}function Tee(e,t){return st(1+eh.count(po(e),e),t,3)}function zz(e,t){return st(e.getMilliseconds(),t,3)}function Pee(e,t){return zz(e,t)+"000"}function _ee(e,t){return st(e.getMonth()+1,t,2)}function Dee(e,t){return st(e.getMinutes(),t,2)}function Mee(e,t){return st(e.getSeconds(),t,2)}function Ree(e){var t=e.getDay();return t===0?7:t}function kee(e,t){return st(dv.count(po(e)-1,e),t,2)}function Uz(e){var t=e.getDay();return t>=4||t===0?pu(e):pu.ceil(e)}function Lee(e,t){return e=Uz(e),st(pu.count(po(e),e)+(po(e).getDay()===4),t,2)}function Iee(e){return e.getDay()}function zee(e,t){return st(ab.count(po(e)-1,e),t,2)}function Uee(e,t){return st(e.getFullYear()%100,t,2)}function qee(e,t){return e=Uz(e),st(e.getFullYear()%100,t,2)}function Bee(e,t){return st(e.getFullYear()%1e4,t,4)}function Fee(e,t){var n=e.getDay();return e=n>=4||n===0?pu(e):pu.ceil(e),st(e.getFullYear()%1e4,t,4)}function $ee(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+st(t/60|0,"0",2)+st(t%60,"0",2)}function rM(e,t){return st(e.getUTCDate(),t,2)}function Kee(e,t){return st(e.getUTCHours(),t,2)}function Hee(e,t){return st(e.getUTCHours()%12||12,t,2)}function Gee(e,t){return st(1+uv.count(bo(e),e),t,3)}function qz(e,t){return st(e.getUTCMilliseconds(),t,3)}function Yee(e,t){return qz(e,t)+"000"}function Wee(e,t){return st(e.getUTCMonth()+1,t,2)}function Qee(e,t){return st(e.getUTCMinutes(),t,2)}function Vee(e,t){return st(e.getUTCSeconds(),t,2)}function Xee(e){var t=e.getUTCDay();return t===0?7:t}function Zee(e,t){return st(fv.count(bo(e)-1,e),t,2)}function Bz(e){var t=e.getUTCDay();return t>=4||t===0?bu(e):bu.ceil(e)}function Jee(e,t){return e=Bz(e),st(bu.count(bo(e),e)+(bo(e).getUTCDay()===4),t,2)}function ete(e){return e.getUTCDay()}function tte(e,t){return st(ib.count(bo(e)-1,e),t,2)}function nte(e,t){return st(e.getUTCFullYear()%100,t,2)}function rte(e,t){return e=Bz(e),st(e.getUTCFullYear()%100,t,2)}function ate(e,t){return st(e.getUTCFullYear()%1e4,t,4)}function ite(e,t){var n=e.getUTCDay();return e=n>=4||n===0?bu(e):bu.ceil(e),st(e.getUTCFullYear()%1e4,t,4)}function ote(){return"+0000"}function aM(){return"%"}function iM(e){return+e}function oM(e){return Math.floor(+e/1e3)}var Cc,Fz,$z;ste({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 ste(e){return Cc=see(e),Fz=Cc.format,Cc.parse,$z=Cc.utcFormat,Cc.utcParse,Cc}function lte(e){return new Date(e)}function cte(e){return e instanceof Date?+e:+new Date(+e)}function SA(e,t,n,r,i,o,l,u,f,h){var p=lA(),b=p.invert,g=p.domain,x=h(".%L"),E=h(":%S"),S=h("%I:%M"),A=h("%I %p"),j=h("%a %d"),C=h("%b %d"),O=h("%B"),T=h("%Y");function _(P){return(f(P)<P?x:u(P)<P?E:l(P)<P?S:o(P)<P?A:r(P)<P?i(P)<P?j:C:n(P)<P?O:T)(P)}return p.invert=function(P){return new Date(b(P))},p.domain=function(P){return arguments.length?g(Array.from(P,cte)):g().map(lte)},p.ticks=function(P){var D=g();return e(D[0],D[D.length-1],P??10)},p.tickFormat=function(P,D){return D==null?_:h(D)},p.nice=function(P){var D=g();return(!P||typeof P.range!="function")&&(P=t(D[0],D[D.length-1],P??10)),P?g(Tz(D,P)):p},p.copy=function(){return Jf(p,SA(e,t,n,r,i,o,l,u,f,h))},p}function ute(){return Aa.apply(SA(iee,oee,po,xA,dv,eh,gA,bA,al,Fz).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function dte(){return Aa.apply(SA(ree,aee,bo,wA,fv,uv,yA,vA,al,$z).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function hv(){var e=0,t=1,n,r,i,o,l=vr,u=!1,f;function h(b){return b==null||isNaN(b=+b)?f:l(i===0?.5:(b=(o(b)-n)*i,u?Math.max(0,Math.min(1,b)):b))}h.domain=function(b){return arguments.length?([e,t]=b,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),h):[e,t]},h.clamp=function(b){return arguments.length?(u=!!b,h):u},h.interpolator=function(b){return arguments.length?(l=b,h):l};function p(b){return function(g){var x,E;return arguments.length?([x,E]=g,l=b(x,E),h):[l(0),l(1)]}}return h.range=p(_u),h.rangeRound=p(sA),h.unknown=function(b){return arguments.length?(f=b,h):f},function(b){return o=b,n=b(e),r=b(t),i=n===r?0:1/(r-n),h}}function Os(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Kz(){var e=Cs(hv()(vr));return e.copy=function(){return Os(e,Kz())},yo.apply(e,arguments)}function Hz(){var e=dA(hv()).domain([1,10]);return e.copy=function(){return Os(e,Hz()).base(e.base())},yo.apply(e,arguments)}function Gz(){var e=fA(hv());return e.copy=function(){return Os(e,Gz()).constant(e.constant())},yo.apply(e,arguments)}function EA(){var e=hA(hv());return e.copy=function(){return Os(e,EA()).exponent(e.exponent())},yo.apply(e,arguments)}function fte(){return EA.apply(null,arguments).exponent(.5)}function Yz(){var e=[],t=vr;function n(r){if(r!=null&&!isNaN(r=+r))return t((Xf(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(bs),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>XZ(e,o/r))},n.copy=function(){return Yz(t).domain(e)},yo.apply(n,arguments)}function mv(){var e=0,t=.5,n=1,r=1,i,o,l,u,f,h=vr,p,b=!1,g;function x(S){return isNaN(S=+S)?g:(S=.5+((S=+p(S))-o)*(r*S<r*o?u:f),h(b?Math.max(0,Math.min(1,S)):S))}x.domain=function(S){return arguments.length?([e,t,n]=S,i=p(e=+e),o=p(t=+t),l=p(n=+n),u=i===o?0:.5/(o-i),f=o===l?0:.5/(l-o),r=o<i?-1:1,x):[e,t,n]},x.clamp=function(S){return arguments.length?(b=!!S,x):b},x.interpolator=function(S){return arguments.length?(h=S,x):h};function E(S){return function(A){var j,C,O;return arguments.length?([j,C,O]=A,h=AJ(S,[j,C,O]),x):[h(0),h(.5),h(1)]}}return x.range=E(_u),x.rangeRound=E(sA),x.unknown=function(S){return arguments.length?(g=S,x):g},function(S){return p=S,i=S(e),o=S(t),l=S(n),u=i===o?0:.5/(o-i),f=o===l?0:.5/(l-o),r=o<i?-1:1,x}}function Wz(){var e=Cs(mv()(vr));return e.copy=function(){return Os(e,Wz())},yo.apply(e,arguments)}function Qz(){var e=dA(mv()).domain([.1,1,10]);return e.copy=function(){return Os(e,Qz()).base(e.base())},yo.apply(e,arguments)}function Vz(){var e=fA(mv());return e.copy=function(){return Os(e,Vz()).constant(e.constant())},yo.apply(e,arguments)}function AA(){var e=hA(mv());return e.copy=function(){return Os(e,AA()).exponent(e.exponent())},yo.apply(e,arguments)}function hte(){return AA.apply(null,arguments).exponent(.5)}const Xz=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:aA,scaleDiverging:Wz,scaleDivergingLog:Qz,scaleDivergingPow:AA,scaleDivergingSqrt:hte,scaleDivergingSymlog:Vz,scaleIdentity:Nz,scaleImplicit:pS,scaleLinear:Oz,scaleLog:Pz,scaleOrdinal:rA,scalePoint:eJ,scalePow:mA,scaleQuantile:Mz,scaleQuantize:Rz,scaleRadial:Dz,scaleSequential:Kz,scaleSequentialLog:Hz,scaleSequentialPow:EA,scaleSequentialQuantile:Yz,scaleSequentialSqrt:fte,scaleSequentialSymlog:Gz,scaleSqrt:YJ,scaleSymlog:_z,scaleThreshold:kz,scaleTime:ute,scaleUtc:dte,tickFormat:Cz},Symbol.toStringTag,{value:"Module"}));function mte(e){var t=Xz;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(Uf(e));if(n in t&&typeof t[n]=="function")return t[n]()}function sM(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=mte(e);if(r!=null)return r.domain(t).range(n),r}}function jA(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?sM(e.scale,n,r):sM(t,n,r)}function pte(e){return"scale".concat(Uf(e))}function bte(e){return pte(e)in Xz}var Zz=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return bte(r)?r:"point"}};function vte(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var o=Math.floor((n+r)/2);(i?e[o]<t:e[o]>t)?n=o+1:r=o}return n}function Jz(e,t){if(e){var n=t??e.domain(),r=n.map(o=>{var l;return(l=e(o))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return o=>{var l,u,f=vte(r,o);if(f<=0)return n[0];if(f>=n.length)return n[n.length-1];var h=(l=r[f-1])!==null&&l!==void 0?l:0,p=(u=r[f])!==null&&u!==void 0?u:0;return Math.abs(o-h)<=Math.abs(o-p)?n[f-1]:n[f]}}}function gte(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):Jz(e,void 0)}function lM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ob(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lM(Object(n),!0).forEach(function(r){yte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yte(e,t,n){return(t=xte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xte(e){var t=wte(e,"string");return typeof t=="symbol"?t:t+""}function wte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yS=[0,"auto"],gn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},eU=(e,t)=>e.cartesianAxis.xAxis[t],xo=(e,t)=>{var n=eU(e,t);return n??gn},yn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:yS,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:$f},tU=(e,t)=>e.cartesianAxis.yAxis[t],wo=(e,t)=>{var n=tU(e,t);return n??yn},Ste={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},CA=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Ste},Jt=(e,t,n)=>{switch(t){case"xAxis":return xo(e,n);case"yAxis":return wo(e,n);case"zAxis":return CA(e,n);case"angleAxis":return ZE(e,n);case"radiusAxis":return JE(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Ete=(e,t,n)=>{switch(t){case"xAxis":return xo(e,n);case"yAxis":return wo(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Du=(e,t,n)=>{switch(t){case"xAxis":return xo(e,n);case"yAxis":return wo(e,n);case"angleAxis":return ZE(e,n);case"radiusAxis":return JE(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},nU=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function OA(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var th=e=>e.graphicalItems.cartesianItems,Ate=W([$t,Vf],OA),NA=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Mu=W([th,Jt,Ate],NA,{memoizeOptions:{resultEqualityCheck:lv}}),rU=W([Mu],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(ov)),aU=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),jte=W([Mu],aU),TA=e=>e.map(t=>t.data).filter(Boolean).flat(1),Cte=W([Mu],e=>e.some(t=>!t.data)),iU=W([Mu],TA,{memoizeOptions:{resultEqualityCheck:lv}}),PA=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},_A=W([iU,Wf],PA),oU=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:ot(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:ot(i,r)}))):e.map(r=>({value:r})),sU=(e,t,n,r,i,o)=>{var{chartData:l=[],dataStartIndex:u,dataEndIndex:f}=r,h=oU(e,t,n);if(i&&(t==null?void 0:t.dataKey)!=null&&o.length>0){var p=l.slice(u,f+1),b=p.map(g=>({value:ot(g,t.dataKey)})).filter(g=>g.value!=null);return[...b,...h]}return h},nh=W([_A,Jt,Mu,Wf,Cte,iU],sU);function Gc(e){if(vi(e)||e instanceof Date){var t=Number(e);if(Ye(t))return t}}function cM(e){if(Array.isArray(e)){var t=[Gc(e[0]),Gc(e[1])];return hi(t)?t:void 0}var n=Gc(e);if(n!=null)return[n,n]}function xi(e){return e.map(Gc).filter(Rr)}function Ote(e,t){var n=Gc(e),r=Gc(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Nte=W([nh],e=>e==null?void 0:e.map(t=>t.value).sort(Ote));function lU(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Tte(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!Ba(t))r=t;else if(Array.isArray(t)){var i=xi(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:xi(n.flatMap(o=>{var l=ot(e,o.dataKey),u,f;if(Array.isArray(l)?[u,f]=l:u=f=l,!(!Ye(u)||!Ye(f)))return[r-u,r+f]}))}var jn=e=>{var t=In(e),n=Pu(e);return Du(e,t,n)},vu=W([jn],e=>e==null?void 0:e.dataKey),Pte=W([rU,Wf,jn],bz),cU=(e,t,n,r)=>{var i={},o=t.reduce((l,u)=>{if(u.stackId==null)return l;var f=l[u.stackId];return f==null&&(f=[]),f.push(u),l[u.stackId]=f,l},i);return Object.fromEntries(Object.entries(o).map(l=>{var[u,f]=l,h=r?[...f].reverse():f,p=h.map(iv);return[u,{stackedData:xQ(e,p,n),graphicalItems:h}]}))},sb=W([Pte,rU,Qf,cz],cU),uU=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:o}=t;if(r==null&&n!=="zAxis"){var l=AQ(e,i,o);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},_te=W([Jt],e=>e.allowDataOverflow),DA=e=>{var t;if(e==null||!("domain"in e))return yS;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=xi(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:yS},MA=W([Jt],DA),RA=W([MA,_te],VI),Dte=W([sb,Ga,$t,RA],uU,{memoizeOptions:{resultEqualityCheck:sv}}),pv=e=>e.errorBars,Mte=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>lU(n,r)),lb=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var o=i.flat(),l=Math.min(...o),u=Math.max(...o);return[l,u]}},kA=function(t,n,r,i,o){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],u,f;if(r.length>0&&r.forEach(h=>{var p,b=h.data!=null?[...h.data]:l,g=(p=i[h.id])===null||p===void 0?void 0:p.filter(x=>lU(o,x));b.forEach(x=>{var E,S=ot(x,(E=n.dataKey)!==null&&E!==void 0?E:h.dataKey),A=Tte(x,S,g);if(A.length>=2){var j=Math.min(...A),C=Math.max(...A);(u==null||j<u)&&(u=j),(f==null||C>f)&&(f=C)}var O=cM(S);O!=null&&(u=u==null?O[0]:Math.min(u,O[0]),f=f==null?O[1]:Math.max(f,O[1]))})}),(n==null?void 0:n.dataKey)!=null&&r.length===0&&t.forEach(h=>{var p=cM(ot(h,n.dataKey));p!=null&&(u=u==null?p[0]:Math.min(u,p[0]),f=f==null?p[1]:Math.max(f,p[1]))}),Ye(u)&&Ye(f))return[u,f]},Rte=W([_A,Jt,jte,pv,$t,SZ],kA,{memoizeOptions:{resultEqualityCheck:sv}});function kte(e){var{value:t}=e;if(vi(t)||t instanceof Date)return t}var Lte=(e,t,n)=>{var r=e.map(kte).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&xL(r))?WI(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},dU=e=>e.referenceElements.dots,Ru=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Ite=W([dU,$t,Vf],Ru),fU=e=>e.referenceElements.areas,zte=W([fU,$t,Vf],Ru),hU=e=>e.referenceElements.lines,Ute=W([hU,$t,Vf],Ru),mU=(e,t)=>{if(e!=null){var n=xi(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},qte=W(Ite,$t,mU),pU=(e,t)=>{if(e!=null){var n=xi(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Bte=W([zte,$t],pU);function Fte(e){var t;if(e.x!=null)return xi([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:xi(n)}function $te(e){var t;if(e.y!=null)return xi([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:xi(n)}var bU=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Fte(r):$te(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Kte=W([Ute,$t],bU),Hte=W(qte,Kte,Bte,(e,t,n)=>lb(e,n,t)),LA=(e,t,n,r,i,o,l,u)=>{if(n!=null)return n;var f=l==="vertical"&&u==="xAxis"||l==="horizontal"&&u==="yAxis",h=f?lb(r,o,i):lb(o,i);return jZ(t,h,e.allowDataOverflow)},Gte=W([Jt,MA,RA,Dte,Rte,Hte,tt,$t],LA,{memoizeOptions:{resultEqualityCheck:sv}}),Yte=[0,1],IA=(e,t,n,r,i,o,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:u,type:f}=e,h=Ha(t,o);if(h&&u==null){var p;return WI(0,(p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)}return f==="category"?Lte(r,e,h):i==="expand"&&!h?Yte:l}},zA=W([Jt,tt,_A,nh,Qf,$t,Gte],IA),Ns=W([Jt,nU,QE],Zz),UA=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=DA(t),o=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&hi(e)){if(o)return yD(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return xD(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(o&&hi(e))return yD(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&hi(e))return xD(e,t.tickCount,t.allowDecimals,"adaptive")}}},qA=W([zA,Du,Ns],UA),BA=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&hi(t)&&Array.isArray(n)&&n.length>0){var i,o,l=t[0],u=(i=n[0])!==null&&i!==void 0?i:0,f=t[1],h=(o=n[n.length-1])!==null&&o!==void 0?o:0;return[Math.min(l,u),Math.max(f,h)]}return t},Wte=W([Jt,zA,qA,$t],BA),Qte=W(nh,Jt,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(xi(e.map(b=>b.value))).sort((b,g)=>b-g),i=r[0],o=r[r.length-1];if(i==null||o==null)return 1/0;var l=o-i;if(l===0)return 1/0;for(var u=0;u<r.length-1;u++){var f=r[u],h=r[u+1];if(!(f==null||h==null)){var p=h-f;n=Math.min(n,p)}}return n/l}}),vU=W(Qte,tt,lz,En,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Ye(e))return 0;var o=t==="vertical"?r.height:r.width;if(i==="gap")return e*o/2;if(i==="no-gap"){var l=ar(n,e*o),u=e*o/2;return u-l-(u-l)/o*l}return 0}),Vte=(e,t,n)=>{var r=xo(e,t);return r==null||typeof r.padding!="string"?0:vU(e,"xAxis",t,n,r.padding)},Xte=(e,t,n)=>{var r=wo(e,t);return r==null||typeof r.padding!="string"?0:vU(e,"yAxis",t,n,r.padding)},Zte=W(xo,Vte,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),Jte=W(wo,Xte,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),ene=W([En,Zte,Xb,Vb,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:o}=r;return i?[o.left,n.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),tne=W([En,tt,Jte,Xb,Vb,(e,t,n)=>n],(e,t,n,r,i,o)=>{var{padding:l}=i;return o?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),rh=(e,t,n,r)=>{var i;switch(t){case"xAxis":return ene(e,n,r);case"yAxis":return tne(e,n,r);case"zAxis":return(i=CA(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return hz(e);case"radiusAxis":return mz(e,n);default:return}},gU=W([Jt,rh],nv),nne=W([Ns,Wte],vz),FA=W([Jt,Ns,nne,gU],jA),yU=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:o}=n,l=Ha(e,r);if(l&&(i==="number"||o!=="auto"))return t.map(u=>u.value)}},$A=W([tt,nh,Du,$t],yU),bv=W([FA],tA);W([FA],gte);W([FA,Nte],Jz);W([Mu,pv,$t],Mte);function xU(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var vv=(e,t)=>t,gv=(e,t,n)=>n,rne=W(Wb,vv,gv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(xU)),ane=W(Qb,vv,gv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(xU)),wU=(e,t)=>({width:e.width,height:t.height}),ine=(e,t)=>{var n=typeof t.width=="number"?t.width:$f;return{width:n,height:e.height}},SU=W(En,xo,wU),one=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},sne=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},lne=W(go,En,rne,vv,gv,(e,t,n,r,i)=>{var o={},l;return n.forEach(u=>{var f=wU(t,u);l==null&&(l=one(t,r,e));var h=r==="top"&&!i||r==="bottom"&&i;o[u.id]=l-Number(h)*f.height,l+=(h?-1:1)*f.height}),o}),cne=W(vo,En,ane,vv,gv,(e,t,n,r,i)=>{var o={},l;return n.forEach(u=>{var f=ine(t,u);l==null&&(l=sne(t,r,e));var h=r==="left"&&!i||r==="right"&&i;o[u.id]=l-Number(h)*f.width,l+=(h?-1:1)*f.width}),o}),une=(e,t)=>{var n=xo(e,t);if(n!=null)return lne(e,n.orientation,n.mirror)},dne=W([En,xo,une,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),fne=(e,t)=>{var n=wo(e,t);if(n!=null)return cne(e,n.orientation,n.mirror)},hne=W([En,wo,fne,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),EU=W(En,wo,(e,t)=>{var n=typeof t.width=="number"?t.width:$f;return{width:n,height:e.height}}),uM=(e,t,n)=>{switch(t){case"xAxis":return SU(e,n).width;case"yAxis":return EU(e,n).height;default:return}},AU=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:o,dataKey:l}=n,u=Ha(e,r),f=t.map(p=>p.value),h=f.filter(p=>p!=null);if(l&&u&&o==="category"&&i&&xL(h))return f}},KA=W([tt,nh,Jt,$t],AU),dM=W([tt,Ete,Ns,bv,KA,$A,rh,qA,$t],(e,t,n,r,i,o,l,u,f)=>{if(t!=null){var h=Ha(e,f);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:f,categoricalDomain:o,duplicateDomain:i,isCategorical:h,niceTicks:u,range:l,realScaleType:n,scale:r}}}),mne=(e,t,n,r,i,o,l,u,f)=>{if(!(t==null||r==null)){var h=Ha(e,f),{type:p,ticks:b,tickCount:g}=t,x=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,E=p==="category"&&r.bandwidth?r.bandwidth()/x:0;E=f==="angleAxis"&&o!=null&&o.length>=2?kn(o[0]-o[1])*2*E:E;var S=b||i;return S?S.map((A,j)=>{var C=l?l.indexOf(A):A,O=r.map(C);return Ye(O)?{index:j,coordinate:O+E,value:A,offset:E}:null}).filter(Rr):h&&u?u.map((A,j)=>{var C=r.map(A);return Ye(C)?{coordinate:C+E,value:A,index:j,offset:E}:null}).filter(Rr):r.ticks?r.ticks(g).map((A,j)=>{var C=r.map(A);return Ye(C)?{coordinate:C+E,value:A,index:j,offset:E}:null}).filter(Rr):r.domain().map((A,j)=>{var C=r.map(A);return Ye(C)?{coordinate:C+E,value:l?l[A]:A,index:j,offset:E}:null}).filter(Rr)}},jU=W([tt,Du,Ns,bv,qA,rh,KA,$A,$t],mne),pne=(e,t,n,r,i,o,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=Ha(e,l),{tickCount:f}=t,h=0;return h=l==="angleAxis"&&(r==null?void 0:r.length)>=2?kn(r[0]-r[1])*2*h:h,u&&o?o.map((p,b)=>{var g=n.map(p);return Ye(g)?{coordinate:g+h,value:p,index:b,offset:h}:null}).filter(Rr):n.ticks?n.ticks(f).map((p,b)=>{var g=n.map(p);return Ye(g)?{coordinate:g+h,value:p,index:b,offset:h}:null}).filter(Rr):n.domain().map((p,b)=>{var g=n.map(p);return Ye(g)?{coordinate:g+h,value:i?i[p]:p,index:b,offset:h}:null}).filter(Rr)}},wi=W([tt,Du,bv,rh,KA,$A,$t],pne),Si=W(Jt,bv,(e,t)=>{if(!(e==null||t==null))return ob(ob({},e),{},{scale:t})}),bne=W([Jt,Ns,zA,gU],jA),vne=W([bne],tA);W((e,t,n)=>CA(e,n),vne,(e,t)=>{if(!(e==null||t==null))return ob(ob({},e),{},{scale:t})});var gne=W([tt,Wb,Qb],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),yne=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};W([yne],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var o of e){var l=Math.abs(o.coordinate-t);l<r&&(r=l,i=o)}return(n=i)===null||n===void 0?void 0:n.value}});var CU=e=>e.options.defaultTooltipEventType,OU=e=>e.options.validateTooltipEventTypes;function NU(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function ah(e,t){var n=CU(e),r=OU(e);return NU(t,n,r)}function xne(e){return we(t=>ah(t,e))}var TU=(e,t)=>{var n,r=Number(t);if(!(Ba(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},wne=e=>e.tooltip.settings,as={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Sne={itemInteraction:{click:as,hover:as},axisInteraction:{click:as,hover:as},keyboardInteraction:as,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},PU=lr({name:"tooltip",initialState:Sne,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:_t()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xa(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:_t()},removeTooltipEntrySettings:{reducer(e,t){var n=xa(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:_t()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:Ene,replaceTooltipEntrySettings:Ane,removeTooltipEntrySettings:jne,setTooltipSettingsState:Cne,setActiveMouseOverItemIndex:_U,mouseLeaveItem:One,mouseLeaveChart:DU,setActiveClickItemIndex:Nne,setMouseOverAxisIndex:MU,setMouseClickAxisIndex:Tne,setSyncInteraction:Vd,setKeyboardInteraction:cb}=PU.actions,Pne=PU.reducer;function fM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fM(Object(n),!0).forEach(function(r){_ne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ne(e,t,n){return(t=Dne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dne(e){var t=Mne(e,"string");return typeof t=="symbol"?t:t+""}function Mne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rne(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function kne(e){return e.index!=null}var RU=(e,t,n,r)=>{if(t==null)return as;var i=Rne(e,t,n);if(i==null)return as;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if(kne(i)){if(o)return Gm(Gm({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Gm(Gm({},as),{},{coordinate:i.coordinate})};function Lne(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function Ine(e,t){var n=Lne(e),r=t[0],i=t[1];if(n===void 0)return!1;var o=Math.min(r,i),l=Math.max(r,i);return n>=o&&n<=l}function zne(e,t,n){if(n==null||t==null)return!0;var r=ot(e,t);return r==null||!hi(n)?!0:Ine(r,n)}var tf=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var o=Number(i);if(!Ye(o))return i;var l=0,u=1/0;t.length>0&&(u=t.length-1);var f=Math.max(l,Math.min(o,u)),h=t[f];return h==null||zne(h,n,r)?String(f):null},kU=(e,t,n,r,i,o,l)=>{if(o!=null){var u=l[0],f=u==null?void 0:u.getPosition(o);if(f!=null)return f;var h=i==null?void 0:i[Number(o)];if(h)switch(n){case"horizontal":return{x:h.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:h.coordinate}}}},LU=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(l=>{var u;return((u=l.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},IU=e=>e.options.tooltipPayloadSearcher,ku=e=>e.tooltip;function hM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hM(Object(n),!0).forEach(function(r){Une(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Une(e,t,n){return(t=qne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qne(e){var t=Bne(e,"string");return typeof t=="symbol"?t:t+""}function Bne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fne(e){if(typeof e=="string"||typeof e=="number")return e}function $ne(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Kne(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function pM(e){if(typeof e=="string")return e}function Hne(e){if(!(e==null||typeof e!="object")){var t="name"in e?Fne(e.name):void 0,n="unit"in e?$ne(e.unit):void 0,r="dataKey"in e?Kne(e.dataKey):void 0,i="payload"in e?e.payload:void 0,o="color"in e?pM(e.color):void 0,l="fill"in e?pM(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:o,fill:l}}}function Gne(e,t){return e??t}var zU=(e,t,n,r,i,o,l)=>{if(!(t==null||o==null)){var{chartData:u,computedData:f,dataStartIndex:h,dataEndIndex:p}=n,b=[];return e.reduce((g,x)=>{var E,{dataDefinedOnItem:S,settings:A}=x,j=Gne(S,u),C=Array.isArray(j)?pI(j,h,p):j,O=(E=A==null?void 0:A.dataKey)!==null&&E!==void 0?E:r,T=A==null?void 0:A.nameKey,_;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&l==="axis"?_=wL(C,r,i):_=o(C,t,f,T),Array.isArray(_))_.forEach(D=>{var L,z,R=Hne(D),q=R==null?void 0:R.name,U=R==null?void 0:R.dataKey,re=R==null?void 0:R.payload,G=mM(mM({},A),{},{name:q,unit:R==null?void 0:R.unit,color:(L=R==null?void 0:R.color)!==null&&L!==void 0?L:A==null?void 0:A.color,fill:(z=R==null?void 0:R.fill)!==null&&z!==void 0?z:A==null?void 0:A.fill});g.push(s_({tooltipEntrySettings:G,dataKey:U,payload:re,value:ot(re,U),name:q==null?void 0:String(q)}))});else{var P;g.push(s_({tooltipEntrySettings:A,dataKey:O,payload:_,value:ot(_,O),name:(P=ot(_,T))!==null&&P!==void 0?P:A==null?void 0:A.name}))}return g},b)}},HA=W([jn,nU,QE],Zz),Yne=W([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Wne=W([In,Pu],OA),Ll=W([Yne,jn,Wne],NA,{memoizeOptions:{resultEqualityCheck:lv}}),Qne=W([Ll],e=>e.filter(ov)),UU=W([Ll],TA,{memoizeOptions:{resultEqualityCheck:lv}}),Vne=W([Ll],e=>e.some(t=>!t.data)),Tl=W([UU,Ga],PA),Xne=W([Qne,Ga,jn],bz),GA=W([Tl,jn,Ll,Ga,Vne,UU],sU),qU=W([jn],DA),Zne=W([jn],e=>e.allowDataOverflow),BU=W([qU,Zne],VI),Jne=W([Ll],e=>e.filter(ov)),ere=W([Xne,Jne,Qf,cz],cU),tre=W([ere,Ga,In,BU],uU),nre=W([Ll],aU),rre=W([Tl,jn,nre,pv,In,AZ],kA,{memoizeOptions:{resultEqualityCheck:sv}}),are=W([dU,In,Pu],Ru),ire=W([are,In],mU),ore=W([fU,In,Pu],Ru),sre=W([ore,In],pU),lre=W([hU,In,Pu],Ru),cre=W([lre,In],bU),ure=W([ire,cre,sre],lb),dre=W([jn,qU,BU,tre,rre,ure,tt,In],LA),gu=W([jn,tt,Tl,GA,Qf,In,dre],IA),fre=W([gu,jn,HA],UA),hre=W([jn,gu,fre,In],BA),FU=e=>{var t=In(e),n=Pu(e),r=!1;return rh(e,t,n,r)},$U=W([jn,FU],nv),mre=W([jn,HA,hre,$U],jA),KU=W([mre],tA),pre=W([tt,GA,jn,In],AU),bre=W([tt,GA,jn,In],yU),vre=(e,t,n,r,i,o,l,u)=>{if(t){var{type:f}=t,h=Ha(e,u);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,b=f==="category"&&r.bandwidth?r.bandwidth()/p:0;return b=u==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?kn(i[0]-i[1])*2*b:b,h&&l?l.map((g,x)=>{var E=r.map(g);return Ye(E)?{coordinate:E+b,value:g,index:x,offset:b}:null}).filter(Rr):r.domain().map((g,x)=>{var E=r.map(g);return Ye(E)?{coordinate:E+b,value:o?o[g]:g,index:x,offset:b}:null}).filter(Rr)}}},So=W([tt,jn,HA,KU,FU,pre,bre,In],vre),YA=W([CU,OU,wne],(e,t,n)=>NU(n.shared,e,t)),HU=e=>e.tooltip.settings.trigger,WA=e=>e.tooltip.settings.defaultIndex,ih=W([ku,YA,HU,WA],RU),xs=W([ih,Tl,vu,gu],tf),GU=W([So,xs],TU),QA=W([ih],e=>{if(e)return e.dataKey}),YU=W([ih],e=>{if(e)return e.graphicalItemId}),WU=W([ku,YA,HU,WA],LU),gre=W([vo,go,tt,En,So,WA,WU],kU),yre=W([ih,gre],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),xre=W([ih],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),wre=W([WU,xs,Ga,vu,GU,IU,YA],zU),Sre=W([wre],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function bM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bM(Object(n),!0).forEach(function(r){Ere(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ere(e,t,n){return(t=Are(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Are(e){var t=jre(e,"string");return typeof t=="symbol"?t:t+""}function jre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Cre=()=>we(jn),Ore=()=>{var e=Cre(),t=we(So),n=we(KU);return ys(!e||!n?void 0:vM(vM({},e),{},{scale:n}),t)};function gM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Oc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gM(Object(n),!0).forEach(function(r){Nre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nre(e,t,n){return(t=Tre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tre(e){var t=Pre(e,"string");return typeof t=="symbol"?t:t+""}function Pre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _re=(e,t,n,r)=>{var i=t.find(o=>o&&o.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},Dre=(e,t,n,r)=>{var i=t.find(h=>h&&h.index===n);if(i){if(e==="centric"){var o=i.coordinate,{radius:l}=r;return Oc(Oc(Oc({},r),hn(r.cx,r.cy,l,o)),{},{angle:o,radius:l})}var u=i.coordinate,{angle:f}=r;return Oc(Oc(Oc({},r),hn(r.cx,r.cy,u,f)),{},{angle:f,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Mre(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var QU=(e,t,n,r,i)=>{var o,l=(o=t==null?void 0:t.length)!==null&&o!==void 0?o:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u<l;u++){var f,h,p,b,g,x=u>0?(f=n[u-1])===null||f===void 0?void 0:f.coordinate:(h=n[l-1])===null||h===void 0?void 0:h.coordinate,E=(p=n[u])===null||p===void 0?void 0:p.coordinate,S=u>=l-1?(b=n[0])===null||b===void 0?void 0:b.coordinate:(g=n[u+1])===null||g===void 0?void 0:g.coordinate,A=void 0;if(!(x==null||E==null||S==null))if(kn(E-x)!==kn(S-E)){var j=[];if(kn(S-E)===kn(i[1]-i[0])){A=S;var C=E+i[1]-i[0];j[0]=Math.min(C,(C+x)/2),j[1]=Math.max(C,(C+x)/2)}else{A=x;var O=S+i[1]-i[0];j[0]=Math.min(E,(O+E)/2),j[1]=Math.max(E,(O+E)/2)}var T=[Math.min(E,(A+E)/2),Math.max(E,(A+E)/2)];if(e>T[0]&&e<=T[1]||e>=j[0]&&e<=j[1]){var _;return(_=n[u])===null||_===void 0?void 0:_.index}}else{var P=Math.min(x,S),D=Math.max(x,S);if(e>(P+E)/2&&e<=(D+E)/2){var L;return(L=n[u])===null||L===void 0?void 0:L.index}}}else if(t)for(var z=0;z<l;z++){var R=t[z];if(R!=null){var q=t[z+1],U=t[z-1];if(z===0&&q!=null&&e<=(R.coordinate+q.coordinate)/2||z===l-1&&U!=null&&e>(R.coordinate+U.coordinate)/2||z>0&&z<l-1&&U!=null&&q!=null&&e>(R.coordinate+U.coordinate)/2&&e<=(R.coordinate+q.coordinate)/2)return R.index}}return-1},VU=()=>we(QE),VA=(e,t)=>t,XU=(e,t,n)=>n,XA=(e,t,n,r)=>r,Rre=W(So,e=>zb(e,t=>t.coordinate)),ZA=W([ku,VA,XU,XA],RU),JA=W([ZA,Tl,vu,gu],tf),kre=(e,t,n)=>{if(t!=null){var r=ku(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},ZU=W([ku,VA,XU,XA],LU),ub=W([vo,go,tt,En,So,XA,ZU],kU),Lre=W([ZA,ub],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),JU=W([So,JA],TU),Ire=W([ZU,JA,Ga,vu,JU,IU,VA],zU),zre=W([ZA,JA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Ure=(e,t,n,r,i,o,l)=>{if(!(!e||!n||!r||!i)&&Mre(e,l)){var u=jQ(e,t),f=QU(u,o,i,n,r),h=_re(t,i,f,e);return{activeIndex:String(f),activeCoordinate:h}}},qre=(e,t,n,r,i,o,l)=>{if(!(!e||!r||!i||!o||!n)){var u=fZ(e,n);if(u){var f=CQ(u,t),h=QU(f,l,o,r,i),p=Dre(t,o,h,u);return{activeIndex:String(h),activeCoordinate:p}}}},Bre=(e,t,n,r,i,o,l,u)=>{if(!(!e||!t||!r||!i||!o))return t==="horizontal"||t==="vertical"?Ure(e,t,r,i,o,l,u):qre(e,t,n,r,i,o,l)},Fre=W(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),$re=W(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(an)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:UZ}});function yM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yM(Object(n),!0).forEach(function(r){Kre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kre(e,t,n){return(t=Hre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hre(e){var t=Gre(e,"string");return typeof t=="symbol"?t:t+""}function Gre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yre={},Wre={zIndexMap:Object.values(an).reduce((e,t)=>xM(xM({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Yre)},Qre=new Set(Object.values(an));function Vre(e){return Qre.has(e)}var e3=lr({name:"zIndex",initialState:Wre,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:_t()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Vre(n)&&delete e.zIndexMap[n])},prepare:_t()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:_t()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:_t()}}}),{registerZIndexPortal:Xre,unregisterZIndexPortal:$x,registerZIndexPortalElement:Zre,unregisterZIndexPortalElement:Jre}=e3.actions,eae=e3.reducer;function wr(e){var{zIndex:t,children:n}=e,r=aV(),i=r&&t!==void 0&&t!==0,o=Ln(),l=v.useRef(void 0),u=v.useRef(new Set),f=xt(),h=we(b=>Fre(b,t,o));if(v.useLayoutEffect(()=>{if(!i){var b=u.current;b.forEach(x=>{f($x({zIndex:x}))}),b.clear(),l.current=void 0;return}if(u.current.has(t)||(f(Xre({zIndex:t})),u.current.add(t)),h){l.current=h;var g=u.current;g.forEach(x=>{x!==t&&(f($x({zIndex:x})),g.delete(x))})}},[f,t,i,h]),v.useLayoutEffect(()=>{var b=u.current;return()=>{b.forEach(g=>{f($x({zIndex:g}))}),b.clear()}},[f]),!i)return n;var p=h??l.current;return p?Vn.createPortal(n,p):null}function xS(){return xS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xS.apply(null,arguments)}function wM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ym(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wM(Object(n),!0).forEach(function(r){tae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tae(e,t,n){return(t=nae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nae(e){var t=rae(e,"string");return typeof t=="symbol"?t:t+""}function rae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aae(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return v.isValidElement(t)?v.cloneElement(t,r):v.createElement(n,r)}function iae(e){var t,{coordinate:n,payload:r,index:i,offset:o,tooltipAxisBandSize:l,layout:u,cursor:f,tooltipEventType:h,chartName:p}=e,b=n,g=r,x=i;if(!f||!b||p!=="ScatterChart"&&h!=="axis")return null;var E,S,A;if(p==="ScatterChart")E=b,S=OX,A=an.cursorLine;else if(p==="BarChart")E=NX(u,b,o,l),S=$I,A=an.cursorRectangle;else if(u==="radial"&&EL(b)){var{cx:j,cy:C,radius:O,startAngle:T,endAngle:_}=HI(b);E={cx:j,cy:C,startAngle:T,endAngle:_,innerRadius:O,outerRadius:O},S=YI,A=an.cursorLine}else E={points:bZ(u,b,o)},S=Kc,A=an.cursorLine;var P=typeof f=="object"&&"className"in f?f.className:void 0,D=Ym(Ym(Ym(Ym({stroke:"#ccc",pointerEvents:"none"},o),E),wl(f)),{},{payload:g,payloadIndex:x,className:rt("recharts-tooltip-cursor",P)});return v.createElement(wr,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:A},v.createElement(aae,{cursor:f,cursorComp:S,cursorProps:D}))}function oae(e){var t=Ore(),n=jI(),r=js(),i=VU();return t==null||n==null||r==null||i==null?null:v.createElement(iae,xS({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var t3=v.createContext(null),sae=()=>v.useContext(t3),Kx={exports:{}},SM;function lae(){return SM||(SM=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(f,h,p){this.fn=f,this.context=h,this.once=p||!1}function o(f,h,p,b,g){if(typeof p!="function")throw new TypeError("The listener must be a function");var x=new i(p,b||f,g),E=n?n+h:h;return f._events[E]?f._events[E].fn?f._events[E]=[f._events[E],x]:f._events[E].push(x):(f._events[E]=x,f._eventsCount++),f}function l(f,h){--f._eventsCount===0?f._events=new r:delete f._events[h]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],p,b;if(this._eventsCount===0)return h;for(b in p=this._events)t.call(p,b)&&h.push(n?b.slice(1):b);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},u.prototype.listeners=function(h){var p=n?n+h:h,b=this._events[p];if(!b)return[];if(b.fn)return[b.fn];for(var g=0,x=b.length,E=new Array(x);g<x;g++)E[g]=b[g].fn;return E},u.prototype.listenerCount=function(h){var p=n?n+h:h,b=this._events[p];return b?b.fn?1:b.length:0},u.prototype.emit=function(h,p,b,g,x,E){var S=n?n+h:h;if(!this._events[S])return!1;var A=this._events[S],j=arguments.length,C,O;if(A.fn){switch(A.once&&this.removeListener(h,A.fn,void 0,!0),j){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,p),!0;case 3:return A.fn.call(A.context,p,b),!0;case 4:return A.fn.call(A.context,p,b,g),!0;case 5:return A.fn.call(A.context,p,b,g,x),!0;case 6:return A.fn.call(A.context,p,b,g,x,E),!0}for(O=1,C=new Array(j-1);O<j;O++)C[O-1]=arguments[O];A.fn.apply(A.context,C)}else{var T=A.length,_;for(O=0;O<T;O++)switch(A[O].once&&this.removeListener(h,A[O].fn,void 0,!0),j){case 1:A[O].fn.call(A[O].context);break;case 2:A[O].fn.call(A[O].context,p);break;case 3:A[O].fn.call(A[O].context,p,b);break;case 4:A[O].fn.call(A[O].context,p,b,g);break;default:if(!C)for(_=1,C=new Array(j-1);_<j;_++)C[_-1]=arguments[_];A[O].fn.apply(A[O].context,C)}}return!0},u.prototype.on=function(h,p,b){return o(this,h,p,b,!1)},u.prototype.once=function(h,p,b){return o(this,h,p,b,!0)},u.prototype.removeListener=function(h,p,b,g){var x=n?n+h:h;if(!this._events[x])return this;if(!p)return l(this,x),this;var E=this._events[x];if(E.fn)E.fn===p&&(!g||E.once)&&(!b||E.context===b)&&l(this,x);else{for(var S=0,A=[],j=E.length;S<j;S++)(E[S].fn!==p||g&&!E[S].once||b&&E[S].context!==b)&&A.push(E[S]);A.length?this._events[x]=A.length===1?A[0]:A:l(this,x)}return this},u.prototype.removeAllListeners=function(h){var p;return h?(p=n?n+h:h,this._events[p]&&l(this,p)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(Kx)),Kx.exports}var cae=lae();const uae=Ei(cae);var Sf=new uae,wS="recharts.syncEvent.tooltip",EM="recharts.syncEvent.brush",yv=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Ba(n))return e[n]}},dae={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},n3=lr({name:"options",initialState:dae,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),fae=n3.reducer,{createEventEmitter:hae}=n3.actions;function mae(e){return e.tooltip.syncInteraction}var pae={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},r3=lr({name:"chartData",initialState:pae,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:AM,setDataStartEndIndexes:bae,setComputedData:Phe}=r3.actions,vae=r3.reducer,gae=["x","y"];function jM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jM(Object(n),!0).forEach(function(r){yae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yae(e,t,n){return(t=xae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xae(e){var t=wae(e,"string");return typeof t=="symbol"?t:t+""}function wae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sae(e,t){if(e==null)return{};var n,r,i=Eae(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Eae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Aae(){var e=we(VE),t=we(XE),n=xt(),r=we(uz),i=we(So),o=js(),l=Zb(),u=we(f=>f.rootProps.className);v.useEffect(()=>{if(e==null)return Es;var f=(h,p,b)=>{if(t!==b&&e===h){if(p.payload.active===!1){n(Vd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var g;if(l&&p!==null&&p!==void 0&&(g=p.payload)!==null&&g!==void 0&&g.coordinate&&p.payload.sourceViewBox){var x=p.payload.coordinate,{x:E,y:S}=x,A=Sae(x,gae),{x:j,y:C,width:O,height:T}=p.payload.sourceViewBox,_=Nc(Nc({},A),{},{x:l.x+(O?(E-j)/O:0)*l.width,y:l.y+(T?(S-C)/T:0)*l.height});n(Nc(Nc({},p),{},{payload:Nc(Nc({},p.payload),{},{coordinate:_})}))}else n(p);return}if(i!=null){var P;if(typeof r=="function"){var D={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},L=r(i,D);P=i[L]}else r==="value"&&(P=i.find(K=>String(K.value)===p.payload.label));var{coordinate:z}=p.payload;if(z==null||l==null){n(Vd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(P==null){n(Vd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:R,y:q}=z,U=Math.min(R,l.x+l.width),re=Math.min(q,l.y+l.height),G={x:o==="horizontal"?P.coordinate:U,y:o==="horizontal"?re:P.coordinate},ie=Vd({active:p.payload.active,coordinate:G,dataKey:p.payload.dataKey,index:String(P.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(ie)}}};return Sf.on(wS,f),()=>{Sf.off(wS,f)}},[u,n,t,e,r,i,o,l])}function jae(){var e=we(VE),t=we(XE),n=xt();v.useEffect(()=>{if(e==null)return Es;var r=(i,o,l)=>{t!==l&&e===i&&n(bae(o))};return Sf.on(EM,r),()=>{Sf.off(EM,r)}},[n,t,e])}function Cae(){var e=xt();v.useEffect(()=>{e(hae())},[e]),Aae(),jae()}function Oae(e,t,n,r,i,o){var l=we(E=>kre(E,e,t)),u=we(YU),f=we(XE),h=we(VE),p=we(uz),b=we(mae),g=(b==null?void 0:b.sourceViewBox)!=null,x=Zb();v.useEffect(()=>{if(!g&&h!=null&&f!=null){var E=Vd({active:o,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:x,graphicalItemId:u});Sf.emit(wS,h,E,f)}},[g,n,l,u,i,r,f,h,p,o,x])}function CM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CM(Object(n),!0).forEach(function(r){Nae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nae(e,t,n){return(t=Tae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tae(e){var t=Pae(e,"string");return typeof t=="symbol"?t:t+""}function Pae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _ae(e){return e.dataKey}function Dae(e,t){return v.isValidElement(e)?v.cloneElement(e,t):typeof e=="function"?v.createElement(e,t):v.createElement(nX,t)}var NM=[],Mae={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function Wm(e){var t,n,r=on(e,Mae),{active:i,allowEscapeViewBox:o,animationDuration:l,animationEasing:u,content:f,filterNull:h,isAnimationActive:p,offset:b,payloadUniqBy:g,position:x,reverseDirection:E,useTranslate3d:S,wrapperStyle:A,cursor:j,shared:C,trigger:O,defaultIndex:T,portal:_,axisId:P}=r,D=xt(),L=typeof T=="number"?String(T):T;v.useEffect(()=>{D(Cne({shared:C,trigger:O,axisId:P,active:i,defaultIndex:L}))},[D,C,O,P,i,L]);var z=Zb(),R=zI(),q=xne(C),{activeIndex:U,isActive:re}=(t=we(Be=>zre(Be,q,O,L)))!==null&&t!==void 0?t:{},G=we(Be=>Ire(Be,q,O,L)),ie=we(Be=>JU(Be,q,O,L)),K=we(Be=>Lre(Be,q,O,L)),Z=G,$=sae(),ee=(n=i??re)!==null&&n!==void 0?n:!1,[pe,k]=UL([Z,ee]),Q=q==="axis"?ie:void 0;Oae(q,O,K,Q,U,ee);var ce=_??$;if(ce==null||z==null||q==null)return null;var fe=Z??NM;ee||(fe=NM),h&&fe.length&&(fe=RL(fe.filter(Be=>Be.value!=null&&(Be.hide!==!0||r.includeHidden)),g,_ae));var xe=fe.length>0,Oe=OM(OM({},r),{},{payload:fe,label:Q,active:ee,activeIndex:U,coordinate:K,accessibilityLayer:R}),qe=v.createElement(hX,{allowEscapeViewBox:o,animationDuration:l,animationEasing:u,isAnimationActive:p,active:ee,coordinate:K,hasPayload:xe,offset:b,position:x,reverseDirection:E,useTranslate3d:S,viewBox:z,wrapperStyle:A,lastBoundingBox:pe,innerRef:k,hasPortalFromProps:!!_},Dae(f,Oe));return v.createElement(v.Fragment,null,Vn.createPortal(qe,ce),ee&&v.createElement(oae,{cursor:j,tooltipEventType:q,coordinate:K,payload:fe,index:U}))}var yu=e=>null;yu.displayName="Cell";function Rae(e,t,n){return(t=kae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kae(e){var t=Lae(e,"string");return typeof t=="symbol"?t:t+""}function Lae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Iae{constructor(t){Rae(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function TM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TM(Object(n),!0).forEach(function(r){Uae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uae(e,t,n){return(t=qae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qae(e){var t=Bae(e,"string");return typeof t=="symbol"?t:t+""}function Bae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fae={cacheSize:2e3,enableCache:!0},a3=zae({},Fae),PM=new Iae(a3.cacheSize),$ae={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},_M="recharts_measurement_span";function Kae(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",o=t.fontStyle||"",l=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(o,"|").concat(l,"|").concat(u)}var DM=(e,t)=>{try{var n=document.getElementById(_M);n||(n=document.createElement("span"),n.setAttribute("id",_M),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,$ae,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},nf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Gf.isSsr)return{width:0,height:0};if(!a3.enableCache)return DM(t,n);var r=Kae(t,n),i=PM.get(r);if(i)return i;var o=DM(t,n);return PM.set(r,o),o},i3;function Hae(e,t,n){return(t=Gae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gae(e){var t=Yae(e,"string");return typeof t=="symbol"?t:t+""}function Yae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,RM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Wae=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Qae=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Vae={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Xae=["cm","mm","pt","pc","in","Q","px"];function Zae(e){return Xae.includes(e)}var zc="NaN";function Jae(e,t){return e*Vae[t]}class Wn{static parse(t){var n,[,r,i]=(n=Qae.exec(t))!==null&&n!==void 0?n:[];return r==null?Wn.NaN:new Wn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Ba(t)&&(this.unit=""),n!==""&&!Wae.test(n)&&(this.num=NaN,this.unit=""),Zae(n)&&(this.num=Jae(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Wn(NaN,""):new Wn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Wn(NaN,""):new Wn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Wn(NaN,""):new Wn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Wn(NaN,""):new Wn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Ba(this.num)}}i3=Wn;Hae(Wn,"NaN",new i3(NaN,""));function o3(e){if(e==null||e.includes(zc))return zc;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,o]=(n=MM.exec(t))!==null&&n!==void 0?n:[],l=Wn.parse(r??""),u=Wn.parse(o??""),f=i==="*"?l.multiply(u):l.divide(u);if(f.isNaN())return zc;t=t.replace(MM,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,[,p,b,g]=(h=RM.exec(t))!==null&&h!==void 0?h:[],x=Wn.parse(p??""),E=Wn.parse(g??""),S=b==="+"?x.add(E):x.subtract(E);if(S.isNaN())return zc;t=t.replace(RM,S.toString())}return t}var kM=/\(([^()]*)\)/;function eie(e){for(var t=e,n;(n=kM.exec(t))!=null;){var[,r]=n;t=t.replace(kM,o3(r))}return t}function tie(e){var t=e.replace(/\s+/g,"");return t=eie(t),t=o3(t),t}function nie(e){try{return tie(e)}catch{return zc}}function Hx(e){var t=nie(e.slice(5,-1));return t===zc?"":t}var rie=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],aie=["dx","dy","angle","className","breakAll"];function SS(){return SS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SS.apply(null,arguments)}function LM(e,t){if(e==null)return{};var n,r,i=iie(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function iie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var s3=/[ \f\n\r\t\v\u2028\u2029]+/,l3=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Mt(t)||(n?i=t.toString().split(""):i=t.toString().split(s3));var o=i.map(u=>({word:u,width:nf(u,r).width})),l=n?0:nf(" ",r).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}};function c3(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function oie(e){return Mt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var u3=(e,t,n,r)=>e.reduce((i,o)=>{var{word:l,width:u}=o,f=i[i.length-1];if(f&&u!=null&&(t==null||r||f.width+u+n<Number(t)))f.words.push(l),f.width+=u+n;else{var h={words:[l],width:u};i.push(h)}return i},[]),d3=e=>e.reduce((t,n)=>t.width>n.width?t:n),sie="…",IM=(e,t,n,r,i,o,l,u)=>{var f=e.slice(0,t),h=l3({breakAll:n,style:r,children:f+sie});if(!h)return[!1,[]];var p=u3(h.wordsWithComputedWidth,o,l,u),b=p.length>i||d3(p).width>Number(o);return[b,p]},lie=(e,t,n,r,i)=>{var{maxLines:o,children:l,style:u,breakAll:f}=e,h=ye(o),p=String(l),b=u3(t,r,n,i);if(!h||i)return b;var g=b.length>o||d3(b).width>Number(r);if(!g)return b;for(var x=0,E=p.length-1,S=0,A;x<=E&&S<=p.length-1;){var j=Math.floor((x+E)/2),C=j-1,[O,T]=IM(p,C,f,u,o,r,n,i),[_]=IM(p,j,f,u,o,r,n,i);if(!O&&!_&&(x=j+1),O&&_&&(E=j-1),!O&&_){A=T;break}S++}return A||b},zM=e=>{var t=Mt(e)?[]:e.toString().split(s3);return[{words:t,width:void 0}]},cie=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:o,maxLines:l}=e;if((t||n)&&!Gf.isSsr){var u,f,h=l3({breakAll:o,children:r,style:i});if(h){var{wordsWithComputedWidth:p,spaceWidth:b}=h;u=p,f=b}else return zM(r);return lie({breakAll:o,children:r,maxLines:l,style:i},u,f,t,!!n)}return zM(r)},f3="#808080",uie={angle:0,breakAll:!1,capHeight:"0.71em",fill:f3,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},xv=v.forwardRef((e,t)=>{var n=on(e,uie),{x:r,y:i,lineHeight:o,capHeight:l,fill:u,scaleToFit:f,textAnchor:h,verticalAnchor:p}=n,b=LM(n,rie),g=v.useMemo(()=>cie({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]),{dx:x,dy:E,angle:S,className:A,breakAll:j}=b,C=LM(b,aie);if(!vi(r)||!vi(i)||g.length===0)return null;var O=Number(r)+(ye(x)?x:0),T=Number(i)+(ye(E)?E:0);if(!Ye(O)||!Ye(T))return null;var _;switch(p){case"start":_=Hx("calc(".concat(l,")"));break;case"middle":_=Hx("calc(".concat((g.length-1)/2," * -").concat(o," + (").concat(l," / 2))"));break;default:_=Hx("calc(".concat(g.length-1," * -").concat(o,")"));break}var P=[],D=g[0];if(f&&D!=null){var L=D.width,{width:z}=b;P.push("scale(".concat(ye(z)&&ye(L)?z/L:1,")"))}return S&&P.push("rotate(".concat(S,", ").concat(O,", ").concat(T,")")),P.length&&(C.transform=P.join(" ")),v.createElement("text",SS({},or(C),{ref:t,x:O,y:T,className:rt("recharts-text",A),textAnchor:h,fill:u.includes("url")?f3:u}),g.map((R,q)=>{var U=R.words.join(j?"":" ");return v.createElement("tspan",{x:O,dy:q===0?_:o,key:"".concat(U,"-").concat(q)},U)}))});xv.displayName="Text";function UM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ii(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UM(Object(n),!0).forEach(function(r){die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function die(e,t,n){return(t=fie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fie(e){var t=hie(e,"string");return typeof t=="symbol"?t:t+""}function hie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mie=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:o,y:l,height:u,upperWidth:f,lowerWidth:h}=qE(t),p=o,b=o+(f-h)/2,g=(p+b)/2,x=(f+h)/2,E=p+f/2,S=u>=0?1:-1,A=S*r,j=S>0?"end":"start",C=S>0?"start":"end",O=f>=0?1:-1,T=O*r,_=O>0?"end":"start",P=O>0?"start":"end",D=i;if(n==="top"){var L={x:p+f/2,y:l-A,horizontalAnchor:"middle",verticalAnchor:j};return D&&(L.height=Math.max(l-D.y,0),L.width=f),L}if(n==="bottom"){var z={x:b+h/2,y:l+u+A,horizontalAnchor:"middle",verticalAnchor:C};return D&&(z.height=Math.max(D.y+D.height-(l+u),0),z.width=h),z}if(n==="left"){var R={x:g-T,y:l+u/2,horizontalAnchor:_,verticalAnchor:"middle"};return D&&(R.width=Math.max(R.x-D.x,0),R.height=u),R}if(n==="right"){var q={x:g+x+T,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"};return D&&(q.width=Math.max(D.x+D.width-q.x,0),q.height=u),q}var U=D?{width:x,height:u}:{};return n==="insideLeft"?ii({x:g+T,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"},U):n==="insideRight"?ii({x:g+x-T,y:l+u/2,horizontalAnchor:_,verticalAnchor:"middle"},U):n==="insideTop"?ii({x:p+f/2,y:l+A,horizontalAnchor:"middle",verticalAnchor:C},U):n==="insideBottom"?ii({x:b+h/2,y:l+u-A,horizontalAnchor:"middle",verticalAnchor:j},U):n==="insideTopLeft"?ii({x:p+T,y:l+A,horizontalAnchor:P,verticalAnchor:C},U):n==="insideTopRight"?ii({x:p+f-T,y:l+A,horizontalAnchor:_,verticalAnchor:C},U):n==="insideBottomLeft"?ii({x:b+T,y:l+u-A,horizontalAnchor:P,verticalAnchor:j},U):n==="insideBottomRight"?ii({x:b+h-T,y:l+u-A,horizontalAnchor:_,verticalAnchor:j},U):n&&typeof n=="object"&&(ye(n.x)||Al(n.x))&&(ye(n.y)||Al(n.y))?ii({x:o+ar(n.x,x),y:l+ar(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},U):ii({x:E,y:l+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},U)},pie=["labelRef"],bie=["content"];function qM(e,t){if(e==null)return{};var n,r,i=vie(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function BM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BM(Object(n),!0).forEach(function(r){gie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gie(e,t,n){return(t=yie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yie(e){var t=xie(e,"string");return typeof t=="symbol"?t:t+""}function xie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function io(){return io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},io.apply(null,arguments)}var h3=v.createContext(null),wie=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:o,height:l,children:u}=e,f=v.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:o,height:l}),[t,n,r,i,o,l]);return v.createElement(h3.Provider,{value:f},u)},m3=()=>{var e=v.useContext(h3),t=Zb();return e||(t?qE(t):void 0)},Sie=v.createContext(null),Eie=()=>{var e=v.useContext(Sie),t=we(pz);return e||t},Aie=e=>{var{value:t,formatter:n}=e,r=Mt(e.children)?t:e.children;return typeof n=="function"?n(r):r},ej=e=>e!=null&&typeof e=="function",jie=(e,t)=>{var n=kn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Cie=(e,t,n,r,i)=>{var{offset:o,className:l}=e,{cx:u,cy:f,innerRadius:h,outerRadius:p,startAngle:b,endAngle:g,clockWise:x}=i,E=(h+p)/2,S=jie(b,g),A=S>=0?1:-1,j,C;switch(t){case"insideStart":j=b+A*o,C=x;break;case"insideEnd":j=g-A*o,C=!x;break;case"end":j=g+A*o,C=x;break;default:throw new Error("Unsupported position ".concat(t))}C=S<=0?C:!C;var O=hn(u,f,E,j),T=hn(u,f,E,j+(C?1:-1)*359),_="M".concat(O.x,",").concat(O.y,`273 A`,",",",0,0,",",",",","Z"])),D.x,D.y,o,o,+(p<0),P.x,P.y,r,r,+(z>180),+(p>0),O.x,O.y,o,o,+(p<0),T.x,T.y)}else C+=Xt(fD||(fD=nl(["L",",","Z"])),t,n);return C},pZ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},WI=e=>{var t=on(e,pZ),{cx:n,cy:r,innerRadius:i,outerRadius:o,cornerRadius:l,forceCornerRadius:u,cornerIsExternal:f,startAngle:h,endAngle:p,className:b}=t;if(o<i||h===p)return null;var g=rt("recharts-sector",b),x=o-i,E=ar(l,x,0,!0),S;return E>0&&Math.abs(h-p)<360?S=mZ({cx:n,cy:r,innerRadius:i,outerRadius:o,cornerRadius:Math.min(E,x/2),forceCornerRadius:u,cornerIsExternal:f,startAngle:h,endAngle:p}):S=YI({cx:n,cy:r,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),v.createElement("path",dS({},or(t),{className:g,d:S}))};function bZ(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(AL(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:o,outerRadius:l,angle:u}=t,f=hn(r,i,o,u),h=hn(r,i,l,u);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return GI(t)}}var _x={},Dx={},Mx={},hD;function vZ(){if(hD)return Mx;hD=1;const e=zL();function t(n){return e.isSymbol(n)?NaN:Number(n)}return Mx.toNumber=t,Mx}var mD;function gZ(){if(mD)return Dx;mD=1;const e=vZ();function t(n){return n?(n=e.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}return Dx.toFinite=t,Dx}var pD;function yZ(){if(pD)return _x;pD=1;const e=gZ(),t=IL();function n(r,i,o){o&&typeof o!="number"&&t.isIterateeCall(r,i,o)&&(i=o=void 0),r=e.toFinite(r),i===void 0?(i=r,r=0):i=e.toFinite(i),o=o===void 0?r<i?1:-1:e.toFinite(o);const l=Math.max(Math.ceil((i-r)/(o||1)),0),u=new Array(l);for(let f=0;f<l;f++)u[f]=r,r+=o;return u}return _x.range=n,_x}var Rx,bD;function xZ(){return bD||(bD=1,Rx=yZ().range),Rx}var wZ=xZ();const QI=Ei(wZ);var Ga=e=>e.chartData,Yf=W([Ga],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Wf=(e,t,n,r)=>r?Yf(e):Ga(e),VI=(e,t,n)=>n?Yf(e):Ga(e),SZ=W([Wf],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),EZ=W([Yf],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]}),AZ=W([Ga],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function hi(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(Ye(t)&&Ye(n))return!0}return!1}function vD(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function XI(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,o;if(Ye(n))i=n;else if(typeof n=="function")return;if(Ye(r))o=r;else if(typeof r=="function")return;var l=[i,o];if(hi(l))return l}}function jZ(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(hi(r))return vD(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,o]=e,l,u;if(i==="auto")t!=null&&(l=Math.min(...t));else if(ye(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&o_.test(i)){var f=o_.exec(i);if(f==null||f[1]==null||t==null)l=void 0;else{var h=+f[1];l=t[0]-h}}else l=t==null?void 0:t[0];if(o==="auto")t!=null&&(u=Math.max(...t));else if(ye(o))u=o;else if(typeof o=="function")try{t!=null&&(u=o(t==null?void 0:t[1]))}catch{}else if(typeof o=="string"&&s_.test(o)){var p=s_.exec(o);if(p==null||p[1]==null||t==null)u=void 0;else{var b=+p[1];u=t[1]+b}}else u=t==null?void 0:t[1];var g=[l,u];if(hi(g))return t==null?g:vD(g,t,n)}}}var Tu=1e9,CZ={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},YE,It=!0,Ea="[DecimalError] ",bl=Ea+"Invalid argument: ",GE=Ea+"Exponent out of range: ",Pu=Math.floor,el=Math.pow,OZ=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Jr,Dn=1e7,Dt=7,ZI=9007199254740991,Wp=Pu(ZI/Dt),Se={};Se.absoluteValue=Se.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Se.comparedTo=Se.cmp=function(e){var t,n,r,i,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(r=o.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===i?0:r>i^o.s<0?1:-1};Se.decimalPlaces=Se.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Dt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Se.dividedBy=Se.div=function(e){return lo(this,new this.constructor(e))};Se.dividedToIntegerBy=Se.idiv=function(e){var t=this,n=t.constructor;return St(lo(t,new n(e),0,1),n.precision)};Se.equals=Se.eq=function(e){return!this.cmp(e)};Se.exponent=function(){return mn(this)};Se.greaterThan=Se.gt=function(e){return this.cmp(e)>0};Se.greaterThanOrEqualTo=Se.gte=function(e){return this.cmp(e)>=0};Se.isInteger=Se.isint=function(){return this.e>this.d.length-2};Se.isNegative=Se.isneg=function(){return this.s<0};Se.isPositive=Se.ispos=function(){return this.s>0};Se.isZero=function(){return this.s===0};Se.lessThan=Se.lt=function(e){return this.cmp(e)<0};Se.lessThanOrEqualTo=Se.lte=function(e){return this.cmp(e)<1};Se.logarithm=Se.log=function(e){var t,n=this,r=n.constructor,i=r.precision,o=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Jr))throw Error(Ea+"NaN");if(n.s<1)throw Error(Ea+(n.s?"NaN":"-Infinity"));return n.eq(Jr)?new r(0):(It=!1,t=lo(gf(n,o),gf(e,o),o),It=!0,St(t,i))};Se.minus=Se.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?tz(t,e):JI(t,(e.s=-e.s,e))};Se.modulo=Se.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Ea+"NaN");return n.s?(It=!1,t=lo(n,e,0,1).times(e),It=!0,n.minus(t)):St(new r(n),i)};Se.naturalExponential=Se.exp=function(){return ez(this)};Se.naturalLogarithm=Se.ln=function(){return gf(this)};Se.negated=Se.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Se.plus=Se.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?JI(t,e):tz(t,(e.s=-e.s,e))};Se.precision=Se.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(bl+e);if(t=mn(i)+1,r=i.d.length-1,n=r*Dt+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Se.squareRoot=Se.sqrt=function(){var e,t,n,r,i,o,l,u=this,f=u.constructor;if(u.s<1){if(!u.s)return new f(0);throw Error(Ea+"NaN")}for(e=mn(u),It=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=fi(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Pu((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new f(t)):r=new f(i.toString()),n=f.precision,i=l=n+3;;)if(o=r,r=o.plus(lo(u,o,l+2)).times(.5),fi(o.d).slice(0,l)===(t=fi(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(St(o,n+1,0),o.times(o).eq(u)){r=o;break}}else if(t!="9999")break;l+=4}return It=!0,St(r,n)};Se.times=Se.mul=function(e){var t,n,r,i,o,l,u,f,h,p=this,b=p.constructor,g=p.d,x=(e=new b(e)).d;if(!p.s||!e.s)return new b(0);for(e.s*=p.s,n=p.e+e.e,f=g.length,h=x.length,f<h&&(o=g,g=x,x=o,l=f,f=h,h=l),o=[],l=f+h,r=l;r--;)o.push(0);for(r=h;--r>=0;){for(t=0,i=f+r;i>r;)u=o[i]+x[r]*g[i-r-1]+t,o[i--]=u%Dn|0,t=u/Dn|0;o[i]=(o[i]+t)%Dn|0}for(;!o[--l];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,It?St(e,b.precision):e};Se.toDecimalPlaces=Se.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(yi(e,0,Tu),t===void 0?t=r.rounding:yi(t,0,8),St(n,e+mn(n)+1,t))};Se.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=Nl(r,!0):(yi(e,0,Tu),t===void 0?t=i.rounding:yi(t,0,8),r=St(new i(r),e+1,t),n=Nl(r,!0,e+1)),n};Se.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?Nl(i):(yi(e,0,Tu),t===void 0?t=o.rounding:yi(t,0,8),r=St(new o(i),e+mn(i)+1,t),n=Nl(r.abs(),!1,e+mn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Se.toInteger=Se.toint=function(){var e=this,t=e.constructor;return St(new t(e),mn(e)+1,t.rounding)};Se.toNumber=function(){return+this};Se.toPower=Se.pow=function(e){var t,n,r,i,o,l,u=this,f=u.constructor,h=12,p=+(e=new f(e));if(!e.s)return new f(Jr);if(u=new f(u),!u.s){if(e.s<1)throw Error(Ea+"Infinity");return u}if(u.eq(Jr))return u;if(r=f.precision,e.eq(Jr))return St(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,o=u.s,l){if((n=p<0?-p:p)<=ZI){for(i=new f(Jr),t=Math.ceil(r/Dt+4),It=!1;n%2&&(i=i.times(u),yD(i.d,t)),n=Pu(n/2),n!==0;)u=u.times(u),yD(u.d,t);return It=!0,e.s<0?new f(Jr).div(i):St(i,r)}}else if(o<0)throw Error(Ea+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,It=!1,i=e.times(gf(u,r+h)),It=!0,i=ez(i),i.s=o,i};Se.toPrecision=function(e,t){var n,r,i=this,o=i.constructor;return e===void 0?(n=mn(i),r=Nl(i,n<=o.toExpNeg||n>=o.toExpPos)):(yi(e,1,Tu),t===void 0?t=o.rounding:yi(t,0,8),i=St(new o(i),e,t),n=mn(i),r=Nl(i,e<=n||n<=o.toExpNeg,e)),r};Se.toSignificantDigits=Se.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(yi(e,1,Tu),t===void 0?t=r.rounding:yi(t,0,8)),St(new r(n),e,t)};Se.toString=Se.valueOf=Se.val=Se.toJSON=Se[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=mn(e),n=e.constructor;return Nl(e,t<=n.toExpNeg||t>=n.toExpPos)};function JI(e,t){var n,r,i,o,l,u,f,h,p=e.constructor,b=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),It?St(t,b):t;if(f=e.d,h=t.d,l=e.e,i=t.e,f=f.slice(),o=l-i,o){for(o<0?(r=f,o=-o,u=h.length):(r=h,i=l,u=f.length),l=Math.ceil(b/Dt),u=l>u?l+1:u+1,o>u&&(o=u,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(u=f.length,o=h.length,u-o<0&&(o=u,r=h,h=f,f=r),n=0;o;)n=(f[--o]=f[o]+h[o]+n)/Dn|0,f[o]%=Dn;for(n&&(f.unshift(n),++i),u=f.length;f[--u]==0;)f.pop();return t.d=f,t.e=i,It?St(t,b):t}function yi(e,t,n){if(e!==~~e||e<t||e>n)throw Error(bl+e)}function fi(e){var t,n,r,i=e.length-1,o="",l=e[0];if(i>0){for(o+=l,t=1;t<i;t++)r=e[t]+"",n=Dt-r.length,n&&(o+=ns(n)),o+=r;l=e[t],r=l+"",n=Dt-r.length,n&&(o+=ns(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return o+l}var lo=(function(){function e(r,i){var o,l=0,u=r.length;for(r=r.slice();u--;)o=r[u]*i+l,r[u]=o%Dn|0,l=o/Dn|0;return l&&r.unshift(l),r}function t(r,i,o,l){var u,f;if(o!=l)f=o>l?1:-1;else for(u=f=0;u<o;u++)if(r[u]!=i[u]){f=r[u]>i[u]?1:-1;break}return f}function n(r,i,o){for(var l=0;o--;)r[o]-=l,l=r[o]<i[o]?1:0,r[o]=l*Dn+r[o]-i[o];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,o,l){var u,f,h,p,b,g,x,E,S,A,j,C,O,T,_,P,D,L,z=r.constructor,F=r.s==i.s?1:-1,G=r.d,R=i.d;if(!r.s)return new z(r);if(!i.s)throw Error(Ea+"Division by zero");for(f=r.e-i.e,D=R.length,_=G.length,x=new z(F),E=x.d=[],h=0;R[h]==(G[h]||0);)++h;if(R[h]>(G[h]||0)&&--f,o==null?C=o=z.precision:l?C=o+(mn(r)-mn(i))+1:C=o,C<0)return new z(0);if(C=C/Dt+2|0,h=0,D==1)for(p=0,R=R[0],C++;(h<_||p)&&C--;h++)O=p*Dn+(G[h]||0),E[h]=O/R|0,p=O%R|0;else{for(p=Dn/(R[0]+1)|0,p>1&&(R=e(R,p),G=e(G,p),D=R.length,_=G.length),T=D,S=G.slice(0,D),A=S.length;A<D;)S[A++]=0;L=R.slice(),L.unshift(0),P=R[0],R[1]>=Dn/2&&++P;do p=0,u=t(R,S,D,A),u<0?(j=S[0],D!=A&&(j=j*Dn+(S[1]||0)),p=j/P|0,p>1?(p>=Dn&&(p=Dn-1),b=e(R,p),g=b.length,A=S.length,u=t(b,S,g,A),u==1&&(p--,n(b,D<g?L:R,g))):(p==0&&(u=p=1),b=R.slice()),g=b.length,g<A&&b.unshift(0),n(S,b,A),u==-1&&(A=S.length,u=t(R,S,D,A),u<1&&(p++,n(S,D<A?L:R,A))),A=S.length):u===0&&(p++,S=[0]),E[h++]=p,u&&S[0]?S[A++]=G[T]||0:(S=[G[T]],A=1);while((T++<_||S[0]!==void 0)&&C--)}return E[0]||E.shift(),x.e=f,St(x,l?o+mn(x)+1:o)}})();function ez(e,t){var n,r,i,o,l,u,f=0,h=0,p=e.constructor,b=p.precision;if(mn(e)>16)throw Error(GE+mn(e));if(!e.s)return new p(Jr);for(It=!1,u=b,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),h+=5;for(r=Math.log(el(2,h))/Math.LN10*2+5|0,u+=r,n=i=o=new p(Jr),p.precision=u;;){if(i=St(i.times(e),u),n=n.times(++f),l=o.plus(lo(i,n,u)),fi(l.d).slice(0,u)===fi(o.d).slice(0,u)){for(;h--;)o=St(o.times(o),u);return p.precision=b,t==null?(It=!0,St(o,b)):o}o=l}}function mn(e){for(var t=e.e*Dt,n=e.d[0];n>=10;n/=10)t++;return t}function kx(e,t,n){if(t>e.LN10.sd())throw It=!0,n&&(e.precision=n),Error(Ea+"LN10 precision limit exceeded");return St(new e(e.LN10),t)}function ns(e){for(var t="";e--;)t+="0";return t}function gf(e,t){var n,r,i,o,l,u,f,h,p,b=1,g=10,x=e,E=x.d,S=x.constructor,A=S.precision;if(x.s<1)throw Error(Ea+(x.s?"NaN":"-Infinity"));if(x.eq(Jr))return new S(0);if(t==null?(It=!1,h=A):h=t,x.eq(10))return t==null&&(It=!0),kx(S,h);if(h+=g,S.precision=h,n=fi(E),r=n.charAt(0),o=mn(x),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=fi(x.d),r=n.charAt(0),b++;o=mn(x),r>1?(x=new S("0."+n),o++):x=new S(r+"."+n.slice(1))}else return f=kx(S,h+2,A).times(o+""),x=gf(new S(r+"."+n.slice(1)),h-g).plus(f),S.precision=A,t==null?(It=!0,St(x,A)):x;for(u=l=x=lo(x.minus(Jr),x.plus(Jr),h),p=St(x.times(x),h),i=3;;){if(l=St(l.times(p),h),f=u.plus(lo(l,new S(i),h)),fi(f.d).slice(0,h)===fi(u.d).slice(0,h))return u=u.times(2),o!==0&&(u=u.plus(kx(S,h+2,A).times(o+""))),u=lo(u,new S(b),h),S.precision=A,t==null?(It=!0,St(u,A)):u;u=f,i+=2}}function gD(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=Pu(n/Dt),e.d=[],r=(n+1)%Dt,n<0&&(r+=Dt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=Dt;r<i;)e.d.push(+t.slice(r,r+=Dt));t=t.slice(r),r=Dt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),It&&(e.e>Wp||e.e<-Wp))throw Error(GE+n)}else e.s=0,e.e=0,e.d=[0];return e}function St(e,t,n){var r,i,o,l,u,f,h,p,b=e.d;for(l=1,o=b[0];o>=10;o/=10)l++;if(r=t-l,r<0)r+=Dt,i=t,h=b[p=0];else{if(p=Math.ceil((r+1)/Dt),o=b.length,p>=o)return e;for(h=o=b[p],l=1;o>=10;o/=10)l++;r%=Dt,i=r-Dt+l}if(n!==void 0&&(o=el(10,l-i-1),u=h/o%10|0,f=t<0||b[p+1]!==void 0||h%o,f=n<4?(u||f)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||f||n==6&&(r>0?i>0?h/el(10,l-i):0:b[p-1])%10&1||n==(e.s<0?8:7))),t<1||!b[0])return f?(o=mn(e),b.length=1,t=t-o-1,b[0]=el(10,(Dt-t%Dt)%Dt),e.e=Pu(-t/Dt)||0):(b.length=1,b[0]=e.e=e.s=0),e;if(r==0?(b.length=p,o=1,p--):(b.length=p+1,o=el(10,Dt-r),b[p]=i>0?(h/el(10,l-i)%el(10,i)|0)*o:0),f)for(;;)if(p==0){(b[0]+=o)==Dn&&(b[0]=1,++e.e);break}else{if(b[p]+=o,b[p]!=Dn)break;b[p--]=0,o=1}for(r=b.length;b[--r]===0;)b.pop();if(It&&(e.e>Wp||e.e<-Wp))throw Error(GE+mn(e));return e}function tz(e,t){var n,r,i,o,l,u,f,h,p,b,g=e.constructor,x=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),It?St(t,x):t;if(f=e.d,b=t.d,r=t.e,h=e.e,f=f.slice(),l=h-r,l){for(p=l<0,p?(n=f,l=-l,u=b.length):(n=b,r=h,u=f.length),i=Math.max(Math.ceil(x/Dt),u)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=f.length,u=b.length,p=i<u,p&&(u=i),i=0;i<u;i++)if(f[i]!=b[i]){p=f[i]<b[i];break}l=0}for(p&&(n=f,f=b,b=n,t.s=-t.s),u=f.length,i=b.length-u;i>0;--i)f[u++]=0;for(i=b.length;i>l;){if(f[--i]<b[i]){for(o=i;o&&f[--o]===0;)f[o]=Dn-1;--f[o],f[i]+=Dn}f[i]-=b[i]}for(;f[--u]===0;)f.pop();for(;f[0]===0;f.shift())--r;return f[0]?(t.d=f,t.e=r,It?St(t,x):t):new g(0)}function Nl(e,t,n){var r,i=mn(e),o=fi(e.d),l=o.length;return t?(n&&(r=n-l)>0?o=o.charAt(0)+"."+o.slice(1)+ns(r):l>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+ns(-i-1)+o,n&&(r=n-l)>0&&(o+=ns(r))):i>=l?(o+=ns(i+1-l),n&&(r=n-i-1)>0&&(o=o+"."+ns(r))):((r=i+1)<l&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(o+="."),o+=ns(r))),e.s<0?"-"+o:o}function yD(e,t){if(e.length>t)return e.length=t,!0}function nz(e){var t,n,r;function i(o){var l=this;if(!(l instanceof i))return new i(o);if(l.constructor=i,o instanceof i){l.s=o.s,l.e=o.e,l.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(bl+o);if(o>0)l.s=1;else if(o<0)o=-o,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(o===~~o&&o<1e7){l.e=0,l.d=[o];return}return gD(l,o.toString())}else if(typeof o!="string")throw Error(bl+o);if(o.charCodeAt(0)===45?(o=o.slice(1),l.s=-1):l.s=1,OZ.test(o))gD(l,o);else throw Error(bl+o)}if(i.prototype=Se,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=nz,i.config=i.set=NZ,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function NZ(e){if(!e||typeof e!="object")throw Error(Ea+"Object expected");var t,n,r,i=["precision",1,Tu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(Pu(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(bl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(bl+n+": "+r);return this}var YE=nz(CZ);Jr=new YE(1);const et=YE;function rz(e){var t;return e===0?t=1:t=Math.floor(new et(e).abs().log(10).toNumber())+1,t}function az(e,t,n){for(var r=new et(e),i=0,o=[];r.lt(t)&&i<1e5;)o.push(r.toNumber()),r=r.add(n),i++;return o}var iz=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},WE=(e,t,n)=>{if(e.lte(0))return new et(0);var r=rz(e.toNumber()),i=new et(10).pow(r),o=e.div(i),l=r!==1?.05:.1,u=new et(Math.ceil(o.div(l).toNumber())).add(n).mul(l),f=u.mul(i);return t?new et(f.toNumber()):new et(Math.ceil(f.toNumber()))},oz=(e,t,n)=>{var r;if(e.lte(0))return new et(0);var i=[1,2,2.5,5],o=e.toNumber(),l=Math.floor(new et(o).abs().log(10).toNumber()),u=new et(10).pow(l),f=e.div(u).toNumber(),h=i.findIndex(x=>x>=f-1e-10);if(h===-1&&(u=u.mul(10),h=0),h+=n,h>=i.length){var p=Math.floor(h/i.length);h%=i.length,u=u.mul(new et(10).pow(p))}var b=(r=i[h])!==null&&r!==void 0?r:1,g=new et(b).mul(u);return t?g:new et(Math.ceil(g.toNumber()))},TZ=(e,t,n)=>{var r=new et(1),i=new et(e);if(!i.isint()&&n){var o=Math.abs(e);o<1?(r=new et(10).pow(rz(e)-1),i=new et(Math.floor(i.div(r).toNumber())).mul(r)):o>1&&(i=new et(Math.floor(e)))}else e===0?i=new et(Math.floor((t-1)/2)):n||(i=new et(Math.floor(e)));for(var l=Math.floor((t-1)/2),u=[],f=0;f<t;f++)u.push(i.add(new et(f-l).mul(r)).toNumber());return u},sz=function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:WE;if(!Number.isFinite((n-t)/(r-1)))return{step:new et(0),tickMin:new et(0),tickMax:new et(0)};var u=l(new et(n).sub(t).div(r-1),i,o),f;t<=0&&n>=0?f=new et(0):(f=new et(t).add(n).div(2),f=f.sub(new et(f).mod(u)));var h=Math.ceil(f.sub(t).div(u).toNumber()),p=Math.ceil(new et(n).sub(f).div(u).toNumber()),b=h+p+1;return b>r?sz(t,n,r,i,o+1,l):(b<r&&(p=n>0?p+(r-b):p,h=n>0?h:h+(r-b)),{step:u,tickMin:f.sub(new et(h).mul(u)),tickMax:f.add(new et(p).mul(u))})},xD=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",u=Math.max(i,2),[f,h]=iz([n,r]);if(f===-1/0||h===1/0){var p=h===1/0?[f,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),h];return n>r?p.reverse():p}if(f===h)return TZ(f,i,o);var b=l==="snap125"?oz:WE,{step:g,tickMin:x,tickMax:E}=sz(f,h,u,o,0,b),S=az(x,E.add(new et(.1).mul(g)),g);return n>r?S.reverse():S},wD=function(t,n){var[r,i]=t,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[u,f]=iz([r,i]);if(u===-1/0||f===1/0)return[r,i];if(u===f)return[u];var h=l==="snap125"?oz:WE,p=Math.max(n,2),b=h(new et(f).sub(u).div(p-1),o,0),g=[...az(new et(u),new et(f),b),f];return o===!1&&(g=g.map(x=>Math.round(x))),r>i?g.reverse():g},lz=e=>e.rootProps.maxBarSize,PZ=e=>e.rootProps.barGap,cz=e=>e.rootProps.barCategoryGap,_Z=e=>e.rootProps.barSize,Qf=e=>e.rootProps.stackOffset,uz=e=>e.rootProps.reverseStackOrder,QE=e=>e.options.chartName,VE=e=>e.rootProps.syncId,dz=e=>e.rootProps.syncMethod,XE=e=>e.options.eventEmitter,DZ=e=>e.rootProps.baseValue,an={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Ws={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},ai={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},nv=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function rv(e,t,n){if(n!=="auto")return n;if(e!=null)return Ha(e,t)?"category":"number"}function SD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SD(Object(n),!0).forEach(function(r){MZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MZ(e,t,n){return(t=RZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RZ(e){var t=kZ(e,"string");return typeof t=="symbol"?t:t+""}function kZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ED={allowDataOverflow:Ws.allowDataOverflow,allowDecimals:Ws.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Ws.angleAxisId,includeHidden:!1,name:void 0,reversed:Ws.reversed,scale:Ws.scale,tick:Ws.tick,tickCount:void 0,ticks:void 0,type:Ws.type,unit:void 0,niceTicks:"auto"},AD={allowDataOverflow:ai.allowDataOverflow,allowDecimals:ai.allowDecimals,allowDuplicatedCategory:ai.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:ai.radiusAxisId,includeHidden:ai.includeHidden,name:void 0,reversed:ai.reversed,scale:ai.scale,tick:ai.tick,tickCount:ai.tickCount,ticks:void 0,type:ai.type,unit:void 0,niceTicks:"auto"},LZ=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},ZE=W([LZ,OI],(e,t)=>{var n;if(e!=null)return e;var r=(n=rv(t,"angleAxis",ED.type))!==null&&n!==void 0?n:"category";return Qp(Qp({},ED),{},{type:r})}),IZ=(e,t)=>e.polarAxis.radiusAxis[t],JE=W([IZ,OI],(e,t)=>{var n;if(e!=null)return e;var r=(n=rv(t,"radiusAxis",AD.type))!==null&&n!==void 0?n:"category";return Qp(Qp({},AD),{},{type:r})}),av=e=>e.polarOptions,eA=W([vo,go,En],HI),fz=W([av,eA],(e,t)=>{if(e!=null)return ar(e.innerRadius,t,0)}),hz=W([av,eA],(e,t)=>{if(e!=null)return ar(e.outerRadius,t,t*.8)}),zZ=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},mz=W([av],zZ);W([ZE,mz],nv);var pz=W([eA,fz,hz],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});W([JE,pz],nv);var bz=W([tt,av,fz,hz,vo,go],(e,t,n,r,i,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:u,startAngle:f,endAngle:h}=t;return{cx:ar(l,i,i/2),cy:ar(u,o,o/2),innerRadius:n,outerRadius:r,startAngle:f,endAngle:h,clockWise:!1}}}),$t=(e,t)=>t,Vf=(e,t,n)=>n;function iv(e){return e==null?void 0:e.id}function vz(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:o}=n,l=new Map;return e.forEach(u=>{var f,h=(f=u.data)!==null&&f!==void 0?f:r;if(!(h==null||h.length===0)){var p=iv(u);h.forEach((b,g)=>{var x=o==null||i?g:String(ot(b,o,null)),E=ot(b,u.dataKey,0),S;l.has(x)?S=l.get(x):S={},Object.assign(S,{[p]:E}),l.set(x,S)})}}),Array.from(l.values())}function ov(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var sv=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function lv(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function UZ(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var In=e=>{var t=tt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},_u=e=>e.tooltip.settings.axisId;function tA(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(o){function l(){return o.apply(this,arguments)}return l.toString=function(){return o.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(o){var l=i[0],u=i[1];return l<=u?o>=l&&o<=u:o>=u&&o<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?o=>t.call(e,o):void 0,map:(o,l)=>{var u=e(o);if(u!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var f=e.bandwidth();switch(l.position){case"middle":u+=f/2;break;case"end":u+=f;break}}return u}}}}}var gz=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!hi(t)){for(var n,r,i=0;i<t.length;i++){var o=t[i];Ye(o)&&((n===void 0||o<n)&&(n=o),(r===void 0||o>r)&&(r=o))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function bs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function qZ(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function nA(e){let t,n,r;e.length!==2?(t=bs,n=(u,f)=>bs(e(u),f),r=(u,f)=>e(u)-f):(t=e===bs||e===qZ?e:BZ,n=e,r=e);function i(u,f,h=0,p=u.length){if(h<p){if(t(f,f)!==0)return p;do{const b=h+p>>>1;n(u[b],f)<0?h=b+1:p=b}while(h<p)}return h}function o(u,f,h=0,p=u.length){if(h<p){if(t(f,f)!==0)return p;do{const b=h+p>>>1;n(u[b],f)<=0?h=b+1:p=b}while(h<p)}return h}function l(u,f,h=0,p=u.length){const b=i(u,f,h,p-1);return b>h&&r(u[b-1],f)>-r(u[b],f)?b-1:b}return{left:i,center:l,right:o}}function BZ(){return 0}function yz(e){return e===null?NaN:+e}function*FZ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const $Z=nA(bs),Xf=$Z.right;nA(yz).center;class jD extends Map{constructor(t,n=GZ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(CD(this,t))}has(t){return super.has(CD(this,t))}set(t,n){return super.set(KZ(this,t),n)}delete(t){return super.delete(HZ(this,t))}}function CD({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function KZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function HZ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function GZ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function YZ(e=bs){if(e===bs)return xz;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function xz(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const WZ=Math.sqrt(50),QZ=Math.sqrt(10),VZ=Math.sqrt(2);function Vp(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),l=o>=WZ?10:o>=QZ?5:o>=VZ?2:1;let u,f,h;return i<0?(h=Math.pow(10,-i)/l,u=Math.round(e*h),f=Math.round(t*h),u/h<e&&++u,f/h>t&&--f,h=-h):(h=Math.pow(10,i)*l,u=Math.round(e/h),f=Math.round(t/h),u*h<e&&++u,f*h>t&&--f),f<u&&.5<=n&&n<2?Vp(e,t,n*2):[u,f,h]}function fS(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,l]=r?Vp(t,e,n):Vp(e,t,n);if(!(o>=i))return[];const u=o-i+1,f=new Array(u);if(r)if(l<0)for(let h=0;h<u;++h)f[h]=(o-h)/-l;else for(let h=0;h<u;++h)f[h]=(o-h)*l;else if(l<0)for(let h=0;h<u;++h)f[h]=(i+h)/-l;else for(let h=0;h<u;++h)f[h]=(i+h)*l;return f}function hS(e,t,n){return t=+t,e=+e,n=+n,Vp(e,t,n)[2]}function mS(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?hS(t,e,n):hS(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function OD(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function ND(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function wz(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?xz:YZ(i);r>n;){if(r-n>600){const f=r-n+1,h=t-n+1,p=Math.log(f),b=.5*Math.exp(2*p/3),g=.5*Math.sqrt(p*b*(f-b)/f)*(h-f/2<0?-1:1),x=Math.max(n,Math.floor(t-h*b/f+g)),E=Math.min(r,Math.floor(t+(f-h)*b/f+g));wz(e,t,x,E,i)}const o=e[t];let l=n,u=r;for(Ud(e,n,t),i(e[r],o)>0&&Ud(e,n,r);l<u;){for(Ud(e,l,u),++l,--u;i(e[l],o)<0;)++l;for(;i(e[u],o)>0;)--u}i(e[n],o)===0?Ud(e,n,u):(++u,Ud(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Ud(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function XZ(e,t,n){if(e=Float64Array.from(FZ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return ND(e);if(t>=1)return OD(e);var r,i=(r-1)*t,o=Math.floor(i),l=OD(wz(e,o).subarray(0,o+1)),u=ND(e.subarray(o+1));return l+(u-l)*(i-o)}}function ZZ(e,t,n=yz){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,o=Math.floor(i),l=+n(e[o],o,e),u=+n(e[o+1],o+1,e);return l+(u-l)*(i-o)}}function JZ(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Aa(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function yo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const pS=Symbol("implicit");function rA(){var e=new jD,t=[],n=[],r=pS;function i(o){let l=e.get(o);if(l===void 0){if(r!==pS)return r;e.set(o,l=t.push(o)-1)}return n[l%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new jD;for(const l of o)e.has(l)||e.set(l,t.push(l)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return rA(t,n).unknown(r)},Aa.apply(i,arguments),i}function aA(){var e=rA().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,l,u=!1,f=0,h=0,p=.5;delete e.unknown;function b(){var g=t().length,x=i<r,E=x?i:r,S=x?r:i;o=(S-E)/Math.max(1,g-f+h*2),u&&(o=Math.floor(o)),E+=(S-E-o*(g-f))*p,l=o*(1-f),u&&(E=Math.round(E),l=Math.round(l));var A=JZ(g).map(function(j){return E+o*j});return n(x?A.reverse():A)}return e.domain=function(g){return arguments.length?(t(g),b()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,b()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,u=!0,b()},e.bandwidth=function(){return l},e.step=function(){return o},e.round=function(g){return arguments.length?(u=!!g,b()):u},e.padding=function(g){return arguments.length?(f=Math.min(1,h=+g),b()):f},e.paddingInner=function(g){return arguments.length?(f=Math.min(1,g),b()):f},e.paddingOuter=function(g){return arguments.length?(h=+g,b()):h},e.align=function(g){return arguments.length?(p=Math.max(0,Math.min(1,g)),b()):p},e.copy=function(){return aA(t(),[r,i]).round(u).paddingInner(f).paddingOuter(h).align(p)},Aa.apply(b(),arguments)}function Sz(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Sz(t())},e}function eJ(){return Sz(aA.apply(null,arguments).paddingInner(1))}function iA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ez(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Zf(){}var yf=.7,Xp=1/yf,Hc="\\s*([+-]?\\d+)\\s*",xf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tJ=/^#([0-9a-f]{3,8})$/,nJ=new RegExp(`^rgb\\(${Hc},${Hc},${Hc}\\)$`),rJ=new RegExp(`^rgb\\(${mi},${mi},${mi}\\)$`),aJ=new RegExp(`^rgba\\(${Hc},${Hc},${Hc},${xf}\\)$`),iJ=new RegExp(`^rgba\\(${mi},${mi},${mi},${xf}\\)$`),oJ=new RegExp(`^hsl\\(${xf},${mi},${mi}\\)$`),sJ=new RegExp(`^hsla\\(${xf},${mi},${mi},${xf}\\)$`),TD={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};iA(Zf,wf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:PD,formatHex:PD,formatHex8:lJ,formatHsl:cJ,formatRgb:_D,toString:_D});function PD(){return this.rgb().formatHex()}function lJ(){return this.rgb().formatHex8()}function cJ(){return Az(this).formatHsl()}function _D(){return this.rgb().formatRgb()}function wf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=tJ.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?DD(t):n===3?new kr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$m(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$m(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=nJ.exec(e))?new kr(t[1],t[2],t[3],1):(t=rJ.exec(e))?new kr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=aJ.exec(e))?$m(t[1],t[2],t[3],t[4]):(t=iJ.exec(e))?$m(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=oJ.exec(e))?kD(t[1],t[2]/100,t[3]/100,1):(t=sJ.exec(e))?kD(t[1],t[2]/100,t[3]/100,t[4]):TD.hasOwnProperty(e)?DD(TD[e]):e==="transparent"?new kr(NaN,NaN,NaN,0):null}function DD(e){return new kr(e>>16&255,e>>8&255,e&255,1)}function $m(e,t,n,r){return r<=0&&(e=t=n=NaN),new kr(e,t,n,r)}function uJ(e){return e instanceof Zf||(e=wf(e)),e?(e=e.rgb(),new kr(e.r,e.g,e.b,e.opacity)):new kr}function bS(e,t,n,r){return arguments.length===1?uJ(e):new kr(e,t,n,r??1)}function kr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}iA(kr,bS,Ez(Zf,{brighter(e){return e=e==null?Xp:Math.pow(Xp,e),new kr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?yf:Math.pow(yf,e),new kr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kr(vl(this.r),vl(this.g),vl(this.b),Zp(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:MD,formatHex:MD,formatHex8:dJ,formatRgb:RD,toString:RD}));function MD(){return`#${rl(this.r)}${rl(this.g)}${rl(this.b)}`}function dJ(){return`#${rl(this.r)}${rl(this.g)}${rl(this.b)}${rl((isNaN(this.opacity)?1:this.opacity)*255)}`}function RD(){const e=Zp(this.opacity);return`${e===1?"rgb(":"rgba("}${vl(this.r)}, ${vl(this.g)}, ${vl(this.b)}${e===1?")":`, ${e})`}`}function Zp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function vl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rl(e){return e=vl(e),(e<16?"0":"")+e.toString(16)}function kD(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new za(e,t,n,r)}function Az(e){if(e instanceof za)return new za(e.h,e.s,e.l,e.opacity);if(e instanceof Zf||(e=wf(e)),!e)return new za;if(e instanceof za)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,u=o-i,f=(o+i)/2;return u?(t===o?l=(n-r)/u+(n<r)*6:n===o?l=(r-t)/u+2:l=(t-n)/u+4,u/=f<.5?o+i:2-o-i,l*=60):u=f>0&&f<1?0:l,new za(l,u,f,e.opacity)}function fJ(e,t,n,r){return arguments.length===1?Az(e):new za(e,t,n,r??1)}function za(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}iA(za,fJ,Ez(Zf,{brighter(e){return e=e==null?Xp:Math.pow(Xp,e),new za(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?yf:Math.pow(yf,e),new za(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new kr(Lx(e>=240?e-240:e+120,i,r),Lx(e,i,r),Lx(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new za(LD(this.h),Km(this.s),Km(this.l),Zp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Zp(this.opacity);return`${e===1?"hsl(":"hsla("}${LD(this.h)}, ${Km(this.s)*100}%, ${Km(this.l)*100}%${e===1?")":`, ${e})`}`}}));function LD(e){return e=(e||0)%360,e<0?e+360:e}function Km(e){return Math.max(0,Math.min(1,e||0))}function Lx(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const oA=e=>()=>e;function hJ(e,t){return function(n){return e+n*t}}function mJ(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function pJ(e){return(e=+e)==1?jz:function(t,n){return n-t?mJ(t,n,e):oA(isNaN(t)?n:t)}}function jz(e,t){var n=t-e;return n?hJ(e,n):oA(isNaN(e)?t:e)}const ID=(function e(t){var n=pJ(t);function r(i,o){var l=n((i=bS(i)).r,(o=bS(o)).r),u=n(i.g,o.g),f=n(i.b,o.b),h=jz(i.opacity,o.opacity);return function(p){return i.r=l(p),i.g=u(p),i.b=f(p),i.opacity=h(p),i+""}}return r.gamma=e,r})(1);function bJ(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function vJ(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function gJ(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),l;for(l=0;l<r;++l)i[l]=Du(e[l],t[l]);for(;l<n;++l)o[l]=t[l];return function(u){for(l=0;l<r;++l)o[l]=i[l](u);return o}}function yJ(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Jp(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xJ(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Du(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var vS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ix=new RegExp(vS.source,"g");function wJ(e){return function(){return e}}function SJ(e){return function(t){return e(t)+""}}function EJ(e,t){var n=vS.lastIndex=Ix.lastIndex=0,r,i,o,l=-1,u=[],f=[];for(e=e+"",t=t+"";(r=vS.exec(e))&&(i=Ix.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),u[l]?u[l]+=o:u[++l]=o),(r=r[0])===(i=i[0])?u[l]?u[l]+=i:u[++l]=i:(u[++l]=null,f.push({i:l,x:Jp(r,i)})),n=Ix.lastIndex;return n<t.length&&(o=t.slice(n),u[l]?u[l]+=o:u[++l]=o),u.length<2?f[0]?SJ(f[0].x):wJ(t):(t=f.length,function(h){for(var p=0,b;p<t;++p)u[(b=f[p]).i]=b.x(h);return u.join("")})}function Du(e,t){var n=typeof t,r;return t==null||n==="boolean"?oA(t):(n==="number"?Jp:n==="string"?(r=wf(t))?(t=r,ID):EJ:t instanceof wf?ID:t instanceof Date?yJ:vJ(t)?bJ:Array.isArray(t)?gJ:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?xJ:Jp)(e,t)}function sA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function AJ(e,t){t===void 0&&(t=e,e=Du);for(var n=0,r=t.length-1,i=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(i,i=t[++n]);return function(l){var u=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return o[u](l-u)}}function jJ(e){return function(){return e}}function eb(e){return+e}var zD=[0,1];function vr(e){return e}function gS(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:jJ(isNaN(t)?NaN:.5)}function CJ(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function OJ(e,t,n){var r=e[0],i=e[1],o=t[0],l=t[1];return i<r?(r=gS(i,r),o=n(l,o)):(r=gS(r,i),o=n(o,l)),function(u){return o(r(u))}}function NJ(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=gS(e[l],e[l+1]),o[l]=n(t[l],t[l+1]);return function(u){var f=Xf(e,u,1,r)-1;return o[f](i[f](u))}}function Jf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function cv(){var e=zD,t=zD,n=Du,r,i,o,l=vr,u,f,h;function p(){var g=Math.min(e.length,t.length);return l!==vr&&(l=CJ(e[0],e[g-1])),u=g>2?NJ:OJ,f=h=null,b}function b(g){return g==null||isNaN(g=+g)?o:(f||(f=u(e.map(r),t,n)))(r(l(g)))}return b.invert=function(g){return l(i((h||(h=u(t,e.map(r),Jp)))(g)))},b.domain=function(g){return arguments.length?(e=Array.from(g,eb),p()):e.slice()},b.range=function(g){return arguments.length?(t=Array.from(g),p()):t.slice()},b.rangeRound=function(g){return t=Array.from(g),n=sA,p()},b.clamp=function(g){return arguments.length?(l=g?!0:vr,p()):l!==vr},b.interpolate=function(g){return arguments.length?(n=g,p()):n},b.unknown=function(g){return arguments.length?(o=g,b):o},function(g,x){return r=g,i=x,p()}}function lA(){return cv()(vr,vr)}function TJ(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function tb(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function mu(e){return e=tb(Math.abs(e)),e?e[1]:NaN}function PJ(e,t){return function(n,r){for(var i=n.length,o=[],l=0,u=e[0],f=0;i>0&&u>0&&(f+u+1>r&&(u=Math.max(1,r-f)),o.push(n.substring(i-=u,i+u)),!((f+=u+1)>r));)u=e[l=(l+1)%e.length];return o.reverse().join(t)}}function _J(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var DJ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Sf(e){if(!(t=DJ.exec(e)))throw new Error("invalid format: "+e);var t;return new cA({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Sf.prototype=cA.prototype;function cA(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}cA.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 MJ(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var nb;function RJ(e,t){var n=tb(e,t);if(!n)return nb=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(nb=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return o===l?r:o>l?r+new Array(o-l+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+tb(e,Math.max(0,t+o-1))[0]}function UD(e,t){var n=tb(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const qD={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:TJ,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>UD(e*100,t),r:UD,s:RJ,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function BD(e){return e}var FD=Array.prototype.map,$D=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kJ(e){var t=e.grouping===void 0||e.thousands===void 0?BD:PJ(FD.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?BD:_J(FD.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(b,g){b=Sf(b);var x=b.fill,E=b.align,S=b.sign,A=b.symbol,j=b.zero,C=b.width,O=b.comma,T=b.precision,_=b.trim,P=b.type;P==="n"?(O=!0,P="g"):qD[P]||(T===void 0&&(T=12),_=!0,P="g"),(j||x==="0"&&E==="=")&&(j=!0,x="0",E="=");var D=(g&&g.prefix!==void 0?g.prefix:"")+(A==="$"?n:A==="#"&&/[boxX]/.test(P)?"0"+P.toLowerCase():""),L=(A==="$"?r:/[%p]/.test(P)?l:"")+(g&&g.suffix!==void 0?g.suffix:""),z=qD[P],F=/[defgprs%]/.test(P);T=T===void 0?6:/[gprs]/.test(P)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function G(R){var J=D,$=L,ne,K,Z;if(P==="c")$=z(R)+$,R="";else{R=+R;var B=R<0||1/R<0;if(R=isNaN(R)?f:z(Math.abs(R),T),_&&(R=MJ(R)),B&&+R==0&&S!=="+"&&(B=!1),J=(B?S==="("?S:u:S==="-"||S==="("?"":S)+J,$=(P==="s"&&!isNaN(R)&&nb!==void 0?$D[8+nb/3]:"")+$+(B&&S==="("?")":""),F){for(ne=-1,K=R.length;++ne<K;)if(Z=R.charCodeAt(ne),48>Z||Z>57){$=(Z===46?i+R.slice(ne+1):R.slice(ne))+$,R=R.slice(0,ne);break}}}O&&!j&&(R=t(R,1/0));var te=J.length+R.length+$.length,pe=te<C?new Array(C-te+1).join(x):"";switch(O&&j&&(R=t(pe+R,pe.length?C-$.length:1/0),pe=""),E){case"<":R=J+R+$+pe;break;case"=":R=J+pe+R+$;break;case"^":R=pe.slice(0,te=pe.length>>1)+J+R+$+pe.slice(te);break;default:R=pe+J+R+$;break}return o(R)}return G.toString=function(){return b+""},G}function p(b,g){var x=Math.max(-8,Math.min(8,Math.floor(mu(g)/3)))*3,E=Math.pow(10,-x),S=h((b=Sf(b),b.type="f",b),{suffix:$D[8+x/3]});return function(A){return S(E*A)}}return{format:h,formatPrefix:p}}var Hm,uA,Cz;LJ({thousands:",",grouping:[3],currency:["$",""]});function LJ(e){return Hm=kJ(e),uA=Hm.format,Cz=Hm.formatPrefix,Hm}function IJ(e){return Math.max(0,-mu(Math.abs(e)))}function zJ(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(mu(t)/3)))*3-mu(Math.abs(e)))}function UJ(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,mu(t)-mu(e))+1}function Oz(e,t,n,r){var i=mS(e,t,n),o;switch(r=Sf(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=zJ(i,l))&&(r.precision=o),Cz(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=UJ(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=IJ(i))&&(r.precision=o-(r.type==="%")*2);break}}return uA(r)}function Cs(e){var t=e.domain;return e.ticks=function(n){var r=t();return fS(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return Oz(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,o=r.length-1,l=r[i],u=r[o],f,h,p=10;for(u<l&&(h=l,l=u,u=h,h=i,i=o,o=h);p-- >0;){if(h=hS(l,u,n),h===f)return r[i]=l,r[o]=u,t(r);if(h>0)l=Math.floor(l/h)*h,u=Math.ceil(u/h)*h;else if(h<0)l=Math.ceil(l*h)/h,u=Math.floor(u*h)/h;else break;f=h}return e},e}function Nz(){var e=lA();return e.copy=function(){return Jf(e,Nz())},Aa.apply(e,arguments),Cs(e)}function Tz(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,eb),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return Tz(e).unknown(t)},e=arguments.length?Array.from(e,eb):[0,1],Cs(n)}function Pz(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],o=e[r],l;return o<i&&(l=n,n=r,r=l,l=i,i=o,o=l),e[n]=t.floor(i),e[r]=t.ceil(o),e}function KD(e){return Math.log(e)}function HD(e){return Math.exp(e)}function qJ(e){return-Math.log(-e)}function BJ(e){return-Math.exp(-e)}function FJ(e){return isFinite(e)?+("1e"+e):e<0?0:e}function $J(e){return e===10?FJ:e===Math.E?Math.exp:t=>Math.pow(e,t)}function KJ(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function GD(e){return(t,n)=>-e(-t,n)}function dA(e){const t=e(KD,HD),n=t.domain;let r=10,i,o;function l(){return i=KJ(r),o=$J(r),n()[0]<0?(i=GD(i),o=GD(o),e(qJ,BJ)):e(KD,HD),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const f=n();let h=f[0],p=f[f.length-1];const b=p<h;b&&([h,p]=[p,h]);let g=i(h),x=i(p),E,S;const A=u==null?10:+u;let j=[];if(!(r%1)&&x-g<A){if(g=Math.floor(g),x=Math.ceil(x),h>0){for(;g<=x;++g)for(E=1;E<r;++E)if(S=g<0?E/o(-g):E*o(g),!(S<h)){if(S>p)break;j.push(S)}}else for(;g<=x;++g)for(E=r-1;E>=1;--E)if(S=g>0?E/o(-g):E*o(g),!(S<h)){if(S>p)break;j.push(S)}j.length*2<A&&(j=fS(h,p,A))}else j=fS(g,x,Math.min(x-g,A)).map(o);return b?j.reverse():j},t.tickFormat=(u,f)=>{if(u==null&&(u=10),f==null&&(f=r===10?"s":","),typeof f!="function"&&(!(r%1)&&(f=Sf(f)).precision==null&&(f.trim=!0),f=uA(f)),u===1/0)return f;const h=Math.max(1,r*u/t.ticks().length);return p=>{let b=p/o(Math.round(i(p)));return b*r<r-.5&&(b*=r),b<=h?f(p):""}},t.nice=()=>n(Pz(n(),{floor:u=>o(Math.floor(i(u))),ceil:u=>o(Math.ceil(i(u)))})),t}function _z(){const e=dA(cv()).domain([1,10]);return e.copy=()=>Jf(e,_z()).base(e.base()),Aa.apply(e,arguments),e}function YD(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function WD(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function fA(e){var t=1,n=e(YD(t),WD(t));return n.constant=function(r){return arguments.length?e(YD(t=+r),WD(t)):t},Cs(n)}function Dz(){var e=fA(cv());return e.copy=function(){return Jf(e,Dz()).constant(e.constant())},Aa.apply(e,arguments)}function QD(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function HJ(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function GJ(e){return e<0?-e*e:e*e}function hA(e){var t=e(vr,vr),n=1;function r(){return n===1?e(vr,vr):n===.5?e(HJ,GJ):e(QD(n),QD(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Cs(t)}function mA(){var e=hA(cv());return e.copy=function(){return Jf(e,mA()).exponent(e.exponent())},Aa.apply(e,arguments),e}function YJ(){return mA.apply(null,arguments).exponent(.5)}function VD(e){return Math.sign(e)*e*e}function WJ(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Mz(){var e=lA(),t=[0,1],n=!1,r;function i(o){var l=WJ(e(o));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(o){return e.invert(VD(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,eb)).map(VD)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(n=!!o,i):n},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return Mz(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Aa.apply(i,arguments),Cs(i)}function Rz(){var e=[],t=[],n=[],r;function i(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l<u;)n[l-1]=ZZ(e,l/u);return o}function o(l){return l==null||isNaN(l=+l)?r:t[Xf(n,l)]}return o.invertExtent=function(l){var u=t.indexOf(l);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},o.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let u of l)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(bs),i()},o.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},o.unknown=function(l){return arguments.length?(r=l,o):r},o.quantiles=function(){return n.slice()},o.copy=function(){return Rz().domain(e).range(t).unknown(r)},Aa.apply(o,arguments)}function kz(){var e=0,t=1,n=1,r=[.5],i=[0,1],o;function l(f){return f!=null&&f<=f?i[Xf(r,f,0,n)]:o}function u(){var f=-1;for(r=new Array(n);++f<n;)r[f]=((f+1)*t-(f-n)*e)/(n+1);return l}return l.domain=function(f){return arguments.length?([e,t]=f,e=+e,t=+t,u()):[e,t]},l.range=function(f){return arguments.length?(n=(i=Array.from(f)).length-1,u()):i.slice()},l.invertExtent=function(f){var h=i.indexOf(f);return h<0?[NaN,NaN]:h<1?[e,r[0]]:h>=n?[r[n-1],t]:[r[h-1],r[h]]},l.unknown=function(f){return arguments.length&&(o=f),l},l.thresholds=function(){return r.slice()},l.copy=function(){return kz().domain([e,t]).range(i).unknown(o)},Aa.apply(Cs(l),arguments)}function Lz(){var e=[.5],t=[0,1],n,r=1;function i(o){return o!=null&&o<=o?t[Xf(e,o,0,r)]:n}return i.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var l=t.indexOf(o);return[e[l-1],e[l]]},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return Lz().domain(e).range(t).unknown(n)},Aa.apply(i,arguments)}const zx=new Date,Ux=new Date;function An(e,t,n,r){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const l=i(o),u=i.ceil(o);return o-l<u-o?l:u},i.offset=(o,l)=>(t(o=new Date(+o),l==null?1:Math.floor(l)),o),i.range=(o,l,u)=>{const f=[];if(o=i.ceil(o),u=u==null?1:Math.floor(u),!(o<l)||!(u>0))return f;let h;do f.push(h=new Date(+o)),t(o,u),e(o);while(h<o&&o<l);return f},i.filter=o=>An(l=>{if(l>=l)for(;e(l),!o(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!o(l););else for(;--u>=0;)for(;t(l,1),!o(l););}),n&&(i.count=(o,l)=>(zx.setTime(+o),Ux.setTime(+l),e(zx),e(Ux),Math.floor(n(zx,Ux))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(r?l=>r(l)%o===0:l=>i.count(0,l)%o===0):i)),i}const rb=An(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);rb.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?An(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):rb);rb.range;const oo=1e3,wa=oo*60,so=wa*60,mo=so*24,pA=mo*7,XD=mo*30,qx=mo*365,al=An(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*oo)},(e,t)=>(t-e)/oo,e=>e.getUTCSeconds());al.range;const bA=An(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*oo)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getMinutes());bA.range;const vA=An(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*wa)},(e,t)=>(t-e)/wa,e=>e.getUTCMinutes());vA.range;const gA=An(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*oo-e.getMinutes()*wa)},(e,t)=>{e.setTime(+e+t*so)},(e,t)=>(t-e)/so,e=>e.getHours());gA.range;const yA=An(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*so)},(e,t)=>(t-e)/so,e=>e.getUTCHours());yA.range;const eh=An(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wa)/mo,e=>e.getDate()-1);eh.range;const uv=An(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mo,e=>e.getUTCDate()-1);uv.range;const Iz=An(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/mo,e=>Math.floor(e/mo));Iz.range;function Rl(e){return An(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*wa)/pA)}const dv=Rl(0),ab=Rl(1),QJ=Rl(2),VJ=Rl(3),pu=Rl(4),XJ=Rl(5),ZJ=Rl(6);dv.range;ab.range;QJ.range;VJ.range;pu.range;XJ.range;ZJ.range;function kl(e){return An(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/pA)}const fv=kl(0),ib=kl(1),JJ=kl(2),eee=kl(3),bu=kl(4),tee=kl(5),nee=kl(6);fv.range;ib.range;JJ.range;eee.range;bu.range;tee.range;nee.range;const xA=An(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());xA.range;const wA=An(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());wA.range;const po=An(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());po.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:An(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});po.range;const bo=An(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());bo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:An(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});bo.range;function zz(e,t,n,r,i,o){const l=[[al,1,oo],[al,5,5*oo],[al,15,15*oo],[al,30,30*oo],[o,1,wa],[o,5,5*wa],[o,15,15*wa],[o,30,30*wa],[i,1,so],[i,3,3*so],[i,6,6*so],[i,12,12*so],[r,1,mo],[r,2,2*mo],[n,1,pA],[t,1,XD],[t,3,3*XD],[e,1,qx]];function u(h,p,b){const g=p<h;g&&([h,p]=[p,h]);const x=b&&typeof b.range=="function"?b:f(h,p,b),E=x?x.range(h,+p+1):[];return g?E.reverse():E}function f(h,p,b){const g=Math.abs(p-h)/b,x=nA(([,,A])=>A).right(l,g);if(x===l.length)return e.every(mS(h/qx,p/qx,b));if(x===0)return rb.every(Math.max(mS(h,p,b),1));const[E,S]=l[g/l[x-1][2]<l[x][2]/g?x-1:x];return E.every(S)}return[u,f]}const[ree,aee]=zz(bo,wA,fv,Iz,yA,vA),[iee,oee]=zz(po,xA,dv,eh,gA,bA);function Bx(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Fx(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function qd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function see(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,l=e.shortDays,u=e.months,f=e.shortMonths,h=Bd(i),p=Fd(i),b=Bd(o),g=Fd(o),x=Bd(l),E=Fd(l),S=Bd(u),A=Fd(u),j=Bd(f),C=Fd(f),O={a:Z,A:B,b:te,B:pe,c:null,d:rM,e:rM,f:Pee,g:qee,G:Fee,H:Oee,I:Nee,j:Tee,L:Uz,m:_ee,M:Dee,p:k,q:Q,Q:oM,s:sM,S:Mee,u:Ree,U:kee,V:Lee,w:Iee,W:zee,x:null,X:null,y:Uee,Y:Bee,Z:$ee,"%":iM},T={a:ce,A:fe,b:xe,B:Oe,c:null,d:aM,e:aM,f:Yee,g:rte,G:ite,H:Kee,I:Hee,j:Gee,L:Bz,m:Wee,M:Qee,p:qe,q:Be,Q:oM,s:sM,S:Vee,u:Xee,U:Zee,V:Jee,w:ete,W:tte,x:null,X:null,y:nte,Y:ate,Z:ote,"%":iM},_={a:F,A:G,b:R,B:J,c:$,d:tM,e:tM,f:Eee,g:eM,G:JD,H:nM,I:nM,j:yee,L:See,m:gee,M:xee,p:z,q:vee,Q:jee,s:Cee,S:wee,u:fee,U:hee,V:mee,w:dee,W:pee,x:ne,X:K,y:eM,Y:JD,Z:bee,"%":Aee};O.x=P(n,O),O.X=P(r,O),O.c=P(t,O),T.x=P(n,T),T.X=P(r,T),T.c=P(t,T);function P(he,ue){return function(Ee){var de=[],Le=-1,Me=0,Ie=he.length,ut,Un,qn;for(Ee instanceof Date||(Ee=new Date(+Ee));++Le<Ie;)he.charCodeAt(Le)===37&&(de.push(he.slice(Me,Le)),(Un=ZD[ut=he.charAt(++Le)])!=null?ut=he.charAt(++Le):Un=ut==="e"?" ":"0",(qn=ue[ut])&&(ut=qn(Ee,Un)),de.push(ut),Me=Le+1);return de.push(he.slice(Me,Le)),de.join("")}}function D(he,ue){return function(Ee){var de=qd(1900,void 0,1),Le=L(de,he,Ee+="",0),Me,Ie;if(Le!=Ee.length)return null;if("Q"in de)return new Date(de.Q);if("s"in de)return new Date(de.s*1e3+("L"in de?de.L:0));if(ue&&!("Z"in de)&&(de.Z=0),"p"in de&&(de.H=de.H%12+de.p*12),de.m===void 0&&(de.m="q"in de?de.q:0),"V"in de){if(de.V<1||de.V>53)return null;"w"in de||(de.w=1),"Z"in de?(Me=Fx(qd(de.y,0,1)),Ie=Me.getUTCDay(),Me=Ie>4||Ie===0?ib.ceil(Me):ib(Me),Me=uv.offset(Me,(de.V-1)*7),de.y=Me.getUTCFullYear(),de.m=Me.getUTCMonth(),de.d=Me.getUTCDate()+(de.w+6)%7):(Me=Bx(qd(de.y,0,1)),Ie=Me.getDay(),Me=Ie>4||Ie===0?ab.ceil(Me):ab(Me),Me=eh.offset(Me,(de.V-1)*7),de.y=Me.getFullYear(),de.m=Me.getMonth(),de.d=Me.getDate()+(de.w+6)%7)}else("W"in de||"U"in de)&&("w"in de||(de.w="u"in de?de.u%7:"W"in de?1:0),Ie="Z"in de?Fx(qd(de.y,0,1)).getUTCDay():Bx(qd(de.y,0,1)).getDay(),de.m=0,de.d="W"in de?(de.w+6)%7+de.W*7-(Ie+5)%7:de.w+de.U*7-(Ie+6)%7);return"Z"in de?(de.H+=de.Z/100|0,de.M+=de.Z%100,Fx(de)):Bx(de)}}function L(he,ue,Ee,de){for(var Le=0,Me=ue.length,Ie=Ee.length,ut,Un;Le<Me;){if(de>=Ie)return-1;if(ut=ue.charCodeAt(Le++),ut===37){if(ut=ue.charAt(Le++),Un=_[ut in ZD?ue.charAt(Le++):ut],!Un||(de=Un(he,Ee,de))<0)return-1}else if(ut!=Ee.charCodeAt(de++))return-1}return de}function z(he,ue,Ee){var de=h.exec(ue.slice(Ee));return de?(he.p=p.get(de[0].toLowerCase()),Ee+de[0].length):-1}function F(he,ue,Ee){var de=x.exec(ue.slice(Ee));return de?(he.w=E.get(de[0].toLowerCase()),Ee+de[0].length):-1}function G(he,ue,Ee){var de=b.exec(ue.slice(Ee));return de?(he.w=g.get(de[0].toLowerCase()),Ee+de[0].length):-1}function R(he,ue,Ee){var de=j.exec(ue.slice(Ee));return de?(he.m=C.get(de[0].toLowerCase()),Ee+de[0].length):-1}function J(he,ue,Ee){var de=S.exec(ue.slice(Ee));return de?(he.m=A.get(de[0].toLowerCase()),Ee+de[0].length):-1}function $(he,ue,Ee){return L(he,t,ue,Ee)}function ne(he,ue,Ee){return L(he,n,ue,Ee)}function K(he,ue,Ee){return L(he,r,ue,Ee)}function Z(he){return l[he.getDay()]}function B(he){return o[he.getDay()]}function te(he){return f[he.getMonth()]}function pe(he){return u[he.getMonth()]}function k(he){return i[+(he.getHours()>=12)]}function Q(he){return 1+~~(he.getMonth()/3)}function ce(he){return l[he.getUTCDay()]}function fe(he){return o[he.getUTCDay()]}function xe(he){return f[he.getUTCMonth()]}function Oe(he){return u[he.getUTCMonth()]}function qe(he){return i[+(he.getUTCHours()>=12)]}function Be(he){return 1+~~(he.getUTCMonth()/3)}return{format:function(he){var ue=P(he+="",O);return ue.toString=function(){return he},ue},parse:function(he){var ue=D(he+="",!1);return ue.toString=function(){return he},ue},utcFormat:function(he){var ue=P(he+="",T);return ue.toString=function(){return he},ue},utcParse:function(he){var ue=D(he+="",!0);return ue.toString=function(){return he},ue}}}var ZD={"-":"",_:" ",0:"0"},zn=/^\s*\d+/,lee=/^%/,cee=/[\\^$*+?|[\]().{}]/g;function st(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function uee(e){return e.replace(cee,"\\$&")}function Bd(e){return new RegExp("^(?:"+e.map(uee).join("|")+")","i")}function Fd(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function dee(e,t,n){var r=zn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function fee(e,t,n){var r=zn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function hee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function mee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function pee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function JD(e,t,n){var r=zn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function eM(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bee(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function vee(e,t,n){var r=zn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function gee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function tM(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function yee(e,t,n){var r=zn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function nM(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function xee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function wee(e,t,n){var r=zn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function See(e,t,n){var r=zn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Eee(e,t,n){var r=zn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Aee(e,t,n){var r=lee.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function jee(e,t,n){var r=zn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Cee(e,t,n){var r=zn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function rM(e,t){return st(e.getDate(),t,2)}function Oee(e,t){return st(e.getHours(),t,2)}function Nee(e,t){return st(e.getHours()%12||12,t,2)}function Tee(e,t){return st(1+eh.count(po(e),e),t,3)}function Uz(e,t){return st(e.getMilliseconds(),t,3)}function Pee(e,t){return Uz(e,t)+"000"}function _ee(e,t){return st(e.getMonth()+1,t,2)}function Dee(e,t){return st(e.getMinutes(),t,2)}function Mee(e,t){return st(e.getSeconds(),t,2)}function Ree(e){var t=e.getDay();return t===0?7:t}function kee(e,t){return st(dv.count(po(e)-1,e),t,2)}function qz(e){var t=e.getDay();return t>=4||t===0?pu(e):pu.ceil(e)}function Lee(e,t){return e=qz(e),st(pu.count(po(e),e)+(po(e).getDay()===4),t,2)}function Iee(e){return e.getDay()}function zee(e,t){return st(ab.count(po(e)-1,e),t,2)}function Uee(e,t){return st(e.getFullYear()%100,t,2)}function qee(e,t){return e=qz(e),st(e.getFullYear()%100,t,2)}function Bee(e,t){return st(e.getFullYear()%1e4,t,4)}function Fee(e,t){var n=e.getDay();return e=n>=4||n===0?pu(e):pu.ceil(e),st(e.getFullYear()%1e4,t,4)}function $ee(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+st(t/60|0,"0",2)+st(t%60,"0",2)}function aM(e,t){return st(e.getUTCDate(),t,2)}function Kee(e,t){return st(e.getUTCHours(),t,2)}function Hee(e,t){return st(e.getUTCHours()%12||12,t,2)}function Gee(e,t){return st(1+uv.count(bo(e),e),t,3)}function Bz(e,t){return st(e.getUTCMilliseconds(),t,3)}function Yee(e,t){return Bz(e,t)+"000"}function Wee(e,t){return st(e.getUTCMonth()+1,t,2)}function Qee(e,t){return st(e.getUTCMinutes(),t,2)}function Vee(e,t){return st(e.getUTCSeconds(),t,2)}function Xee(e){var t=e.getUTCDay();return t===0?7:t}function Zee(e,t){return st(fv.count(bo(e)-1,e),t,2)}function Fz(e){var t=e.getUTCDay();return t>=4||t===0?bu(e):bu.ceil(e)}function Jee(e,t){return e=Fz(e),st(bu.count(bo(e),e)+(bo(e).getUTCDay()===4),t,2)}function ete(e){return e.getUTCDay()}function tte(e,t){return st(ib.count(bo(e)-1,e),t,2)}function nte(e,t){return st(e.getUTCFullYear()%100,t,2)}function rte(e,t){return e=Fz(e),st(e.getUTCFullYear()%100,t,2)}function ate(e,t){return st(e.getUTCFullYear()%1e4,t,4)}function ite(e,t){var n=e.getUTCDay();return e=n>=4||n===0?bu(e):bu.ceil(e),st(e.getUTCFullYear()%1e4,t,4)}function ote(){return"+0000"}function iM(){return"%"}function oM(e){return+e}function sM(e){return Math.floor(+e/1e3)}var Cc,$z,Kz;ste({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 ste(e){return Cc=see(e),$z=Cc.format,Cc.parse,Kz=Cc.utcFormat,Cc.utcParse,Cc}function lte(e){return new Date(e)}function cte(e){return e instanceof Date?+e:+new Date(+e)}function SA(e,t,n,r,i,o,l,u,f,h){var p=lA(),b=p.invert,g=p.domain,x=h(".%L"),E=h(":%S"),S=h("%I:%M"),A=h("%I %p"),j=h("%a %d"),C=h("%b %d"),O=h("%B"),T=h("%Y");function _(P){return(f(P)<P?x:u(P)<P?E:l(P)<P?S:o(P)<P?A:r(P)<P?i(P)<P?j:C:n(P)<P?O:T)(P)}return p.invert=function(P){return new Date(b(P))},p.domain=function(P){return arguments.length?g(Array.from(P,cte)):g().map(lte)},p.ticks=function(P){var D=g();return e(D[0],D[D.length-1],P??10)},p.tickFormat=function(P,D){return D==null?_:h(D)},p.nice=function(P){var D=g();return(!P||typeof P.range!="function")&&(P=t(D[0],D[D.length-1],P??10)),P?g(Pz(D,P)):p},p.copy=function(){return Jf(p,SA(e,t,n,r,i,o,l,u,f,h))},p}function ute(){return Aa.apply(SA(iee,oee,po,xA,dv,eh,gA,bA,al,$z).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function dte(){return Aa.apply(SA(ree,aee,bo,wA,fv,uv,yA,vA,al,Kz).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function hv(){var e=0,t=1,n,r,i,o,l=vr,u=!1,f;function h(b){return b==null||isNaN(b=+b)?f:l(i===0?.5:(b=(o(b)-n)*i,u?Math.max(0,Math.min(1,b)):b))}h.domain=function(b){return arguments.length?([e,t]=b,n=o(e=+e),r=o(t=+t),i=n===r?0:1/(r-n),h):[e,t]},h.clamp=function(b){return arguments.length?(u=!!b,h):u},h.interpolator=function(b){return arguments.length?(l=b,h):l};function p(b){return function(g){var x,E;return arguments.length?([x,E]=g,l=b(x,E),h):[l(0),l(1)]}}return h.range=p(Du),h.rangeRound=p(sA),h.unknown=function(b){return arguments.length?(f=b,h):f},function(b){return o=b,n=b(e),r=b(t),i=n===r?0:1/(r-n),h}}function Os(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Hz(){var e=Cs(hv()(vr));return e.copy=function(){return Os(e,Hz())},yo.apply(e,arguments)}function Gz(){var e=dA(hv()).domain([1,10]);return e.copy=function(){return Os(e,Gz()).base(e.base())},yo.apply(e,arguments)}function Yz(){var e=fA(hv());return e.copy=function(){return Os(e,Yz()).constant(e.constant())},yo.apply(e,arguments)}function EA(){var e=hA(hv());return e.copy=function(){return Os(e,EA()).exponent(e.exponent())},yo.apply(e,arguments)}function fte(){return EA.apply(null,arguments).exponent(.5)}function Wz(){var e=[],t=vr;function n(r){if(r!=null&&!isNaN(r=+r))return t((Xf(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(bs),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,o)=>XZ(e,o/r))},n.copy=function(){return Wz(t).domain(e)},yo.apply(n,arguments)}function mv(){var e=0,t=.5,n=1,r=1,i,o,l,u,f,h=vr,p,b=!1,g;function x(S){return isNaN(S=+S)?g:(S=.5+((S=+p(S))-o)*(r*S<r*o?u:f),h(b?Math.max(0,Math.min(1,S)):S))}x.domain=function(S){return arguments.length?([e,t,n]=S,i=p(e=+e),o=p(t=+t),l=p(n=+n),u=i===o?0:.5/(o-i),f=o===l?0:.5/(l-o),r=o<i?-1:1,x):[e,t,n]},x.clamp=function(S){return arguments.length?(b=!!S,x):b},x.interpolator=function(S){return arguments.length?(h=S,x):h};function E(S){return function(A){var j,C,O;return arguments.length?([j,C,O]=A,h=AJ(S,[j,C,O]),x):[h(0),h(.5),h(1)]}}return x.range=E(Du),x.rangeRound=E(sA),x.unknown=function(S){return arguments.length?(g=S,x):g},function(S){return p=S,i=S(e),o=S(t),l=S(n),u=i===o?0:.5/(o-i),f=o===l?0:.5/(l-o),r=o<i?-1:1,x}}function Qz(){var e=Cs(mv()(vr));return e.copy=function(){return Os(e,Qz())},yo.apply(e,arguments)}function Vz(){var e=dA(mv()).domain([.1,1,10]);return e.copy=function(){return Os(e,Vz()).base(e.base())},yo.apply(e,arguments)}function Xz(){var e=fA(mv());return e.copy=function(){return Os(e,Xz()).constant(e.constant())},yo.apply(e,arguments)}function AA(){var e=hA(mv());return e.copy=function(){return Os(e,AA()).exponent(e.exponent())},yo.apply(e,arguments)}function hte(){return AA.apply(null,arguments).exponent(.5)}const Zz=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:aA,scaleDiverging:Qz,scaleDivergingLog:Vz,scaleDivergingPow:AA,scaleDivergingSqrt:hte,scaleDivergingSymlog:Xz,scaleIdentity:Tz,scaleImplicit:pS,scaleLinear:Nz,scaleLog:_z,scaleOrdinal:rA,scalePoint:eJ,scalePow:mA,scaleQuantile:Rz,scaleQuantize:kz,scaleRadial:Mz,scaleSequential:Hz,scaleSequentialLog:Gz,scaleSequentialPow:EA,scaleSequentialQuantile:Wz,scaleSequentialSqrt:fte,scaleSequentialSymlog:Yz,scaleSqrt:YJ,scaleSymlog:Dz,scaleThreshold:Lz,scaleTime:ute,scaleUtc:dte,tickFormat:Oz},Symbol.toStringTag,{value:"Module"}));function mte(e){var t=Zz;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(Uf(e));if(n in t&&typeof t[n]=="function")return t[n]()}function lM(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=mte(e);if(r!=null)return r.domain(t).range(n),r}}function jA(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?lM(e.scale,n,r):lM(t,n,r)}function pte(e){return"scale".concat(Uf(e))}function bte(e){return pte(e)in Zz}var Jz=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return bte(r)?r:"point"}};function vte(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var o=Math.floor((n+r)/2);(i?e[o]<t:e[o]>t)?n=o+1:r=o}return n}function eU(e,t){if(e){var n=t??e.domain(),r=n.map(o=>{var l;return(l=e(o))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return o=>{var l,u,f=vte(r,o);if(f<=0)return n[0];if(f>=n.length)return n[n.length-1];var h=(l=r[f-1])!==null&&l!==void 0?l:0,p=(u=r[f])!==null&&u!==void 0?u:0;return Math.abs(o-h)<=Math.abs(o-p)?n[f-1]:n[f]}}}function gte(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):eU(e,void 0)}function cM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ob(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cM(Object(n),!0).forEach(function(r){yte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yte(e,t,n){return(t=xte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xte(e){var t=wte(e,"string");return typeof t=="symbol"?t:t+""}function wte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yS=[0,"auto"],gn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},tU=(e,t)=>e.cartesianAxis.xAxis[t],xo=(e,t)=>{var n=tU(e,t);return n??gn},yn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:yS,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:$f},nU=(e,t)=>e.cartesianAxis.yAxis[t],wo=(e,t)=>{var n=nU(e,t);return n??yn},Ste={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},CA=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??Ste},Jt=(e,t,n)=>{switch(t){case"xAxis":return xo(e,n);case"yAxis":return wo(e,n);case"zAxis":return CA(e,n);case"angleAxis":return ZE(e,n);case"radiusAxis":return JE(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Ete=(e,t,n)=>{switch(t){case"xAxis":return xo(e,n);case"yAxis":return wo(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Mu=(e,t,n)=>{switch(t){case"xAxis":return xo(e,n);case"yAxis":return wo(e,n);case"angleAxis":return ZE(e,n);case"radiusAxis":return JE(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},rU=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function OA(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var th=e=>e.graphicalItems.cartesianItems,Ate=W([$t,Vf],OA),NA=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Ru=W([th,Jt,Ate],NA,{memoizeOptions:{resultEqualityCheck:lv}}),aU=W([Ru],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(ov)),iU=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),jte=W([Ru],iU),TA=e=>e.map(t=>t.data).filter(Boolean).flat(1),Cte=W([Ru],e=>e.some(t=>!t.data)),oU=W([Ru],TA,{memoizeOptions:{resultEqualityCheck:lv}}),PA=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},_A=W([oU,Wf],PA),sU=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:ot(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:ot(i,r)}))):e.map(r=>({value:r})),lU=(e,t,n,r,i,o)=>{var{chartData:l=[],dataStartIndex:u,dataEndIndex:f}=r,h=sU(e,t,n);if(i&&(t==null?void 0:t.dataKey)!=null&&o.length>0){var p=l.slice(u,f+1),b=p.map(g=>({value:ot(g,t.dataKey)})).filter(g=>g.value!=null);return[...b,...h]}return h},nh=W([_A,Jt,Ru,Wf,Cte,oU],lU);function Gc(e){if(vi(e)||e instanceof Date){var t=Number(e);if(Ye(t))return t}}function uM(e){if(Array.isArray(e)){var t=[Gc(e[0]),Gc(e[1])];return hi(t)?t:void 0}var n=Gc(e);if(n!=null)return[n,n]}function xi(e){return e.map(Gc).filter(Rr)}function Ote(e,t){var n=Gc(e),r=Gc(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Nte=W([nh],e=>e==null?void 0:e.map(t=>t.value).sort(Ote));function cU(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Tte(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!Ba(t))r=t;else if(Array.isArray(t)){var i=xi(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:xi(n.flatMap(o=>{var l=ot(e,o.dataKey),u,f;if(Array.isArray(l)?[u,f]=l:u=f=l,!(!Ye(u)||!Ye(f)))return[r-u,r+f]}))}var jn=e=>{var t=In(e),n=_u(e);return Mu(e,t,n)},vu=W([jn],e=>e==null?void 0:e.dataKey),Pte=W([aU,Wf,jn],vz),uU=(e,t,n,r)=>{var i={},o=t.reduce((l,u)=>{if(u.stackId==null)return l;var f=l[u.stackId];return f==null&&(f=[]),f.push(u),l[u.stackId]=f,l},i);return Object.fromEntries(Object.entries(o).map(l=>{var[u,f]=l,h=r?[...f].reverse():f,p=h.map(iv);return[u,{stackedData:xQ(e,p,n),graphicalItems:h}]}))},sb=W([Pte,aU,Qf,uz],uU),dU=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:o}=t;if(r==null&&n!=="zAxis"){var l=AQ(e,i,o);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},_te=W([Jt],e=>e.allowDataOverflow),DA=e=>{var t;if(e==null||!("domain"in e))return yS;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=xi(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:yS},MA=W([Jt],DA),RA=W([MA,_te],XI),Dte=W([sb,Ga,$t,RA],dU,{memoizeOptions:{resultEqualityCheck:sv}}),pv=e=>e.errorBars,Mte=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>cU(n,r)),lb=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var o=i.flat(),l=Math.min(...o),u=Math.max(...o);return[l,u]}},kA=function(t,n,r,i,o){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],u,f;if(r.length>0&&r.forEach(h=>{var p,b=h.data!=null?[...h.data]:l,g=(p=i[h.id])===null||p===void 0?void 0:p.filter(x=>cU(o,x));b.forEach(x=>{var E,S=ot(x,(E=n.dataKey)!==null&&E!==void 0?E:h.dataKey),A=Tte(x,S,g);if(A.length>=2){var j=Math.min(...A),C=Math.max(...A);(u==null||j<u)&&(u=j),(f==null||C>f)&&(f=C)}var O=uM(S);O!=null&&(u=u==null?O[0]:Math.min(u,O[0]),f=f==null?O[1]:Math.max(f,O[1]))})}),(n==null?void 0:n.dataKey)!=null&&r.length===0&&t.forEach(h=>{var p=uM(ot(h,n.dataKey));p!=null&&(u=u==null?p[0]:Math.min(u,p[0]),f=f==null?p[1]:Math.max(f,p[1]))}),Ye(u)&&Ye(f))return[u,f]},Rte=W([_A,Jt,jte,pv,$t,SZ],kA,{memoizeOptions:{resultEqualityCheck:sv}});function kte(e){var{value:t}=e;if(vi(t)||t instanceof Date)return t}var Lte=(e,t,n)=>{var r=e.map(kte).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&wL(r))?QI(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},fU=e=>e.referenceElements.dots,ku=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Ite=W([fU,$t,Vf],ku),hU=e=>e.referenceElements.areas,zte=W([hU,$t,Vf],ku),mU=e=>e.referenceElements.lines,Ute=W([mU,$t,Vf],ku),pU=(e,t)=>{if(e!=null){var n=xi(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},qte=W(Ite,$t,pU),bU=(e,t)=>{if(e!=null){var n=xi(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Bte=W([zte,$t],bU);function Fte(e){var t;if(e.x!=null)return xi([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:xi(n)}function $te(e){var t;if(e.y!=null)return xi([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:xi(n)}var vU=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Fte(r):$te(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Kte=W([Ute,$t],vU),Hte=W(qte,Kte,Bte,(e,t,n)=>lb(e,n,t)),LA=(e,t,n,r,i,o,l,u)=>{if(n!=null)return n;var f=l==="vertical"&&u==="xAxis"||l==="horizontal"&&u==="yAxis",h=f?lb(r,o,i):lb(o,i);return jZ(t,h,e.allowDataOverflow)},Gte=W([Jt,MA,RA,Dte,Rte,Hte,tt,$t],LA,{memoizeOptions:{resultEqualityCheck:sv}}),Yte=[0,1],IA=(e,t,n,r,i,o,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:u,type:f}=e,h=Ha(t,o);if(h&&u==null){var p;return QI(0,(p=n==null?void 0:n.length)!==null&&p!==void 0?p:0)}return f==="category"?Lte(r,e,h):i==="expand"&&!h?Yte:l}},zA=W([Jt,tt,_A,nh,Qf,$t,Gte],IA),Ns=W([Jt,rU,QE],Jz),UA=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=DA(t),o=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&hi(e)){if(o)return xD(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return wD(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(o&&hi(e))return xD(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&hi(e))return wD(e,t.tickCount,t.allowDecimals,"adaptive")}}},qA=W([zA,Mu,Ns],UA),BA=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&hi(t)&&Array.isArray(n)&&n.length>0){var i,o,l=t[0],u=(i=n[0])!==null&&i!==void 0?i:0,f=t[1],h=(o=n[n.length-1])!==null&&o!==void 0?o:0;return[Math.min(l,u),Math.max(f,h)]}return t},Wte=W([Jt,zA,qA,$t],BA),Qte=W(nh,Jt,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(xi(e.map(b=>b.value))).sort((b,g)=>b-g),i=r[0],o=r[r.length-1];if(i==null||o==null)return 1/0;var l=o-i;if(l===0)return 1/0;for(var u=0;u<r.length-1;u++){var f=r[u],h=r[u+1];if(!(f==null||h==null)){var p=h-f;n=Math.min(n,p)}}return n/l}}),gU=W(Qte,tt,cz,En,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!Ye(e))return 0;var o=t==="vertical"?r.height:r.width;if(i==="gap")return e*o/2;if(i==="no-gap"){var l=ar(n,e*o),u=e*o/2;return u-l-(u-l)/o*l}return 0}),Vte=(e,t,n)=>{var r=xo(e,t);return r==null||typeof r.padding!="string"?0:gU(e,"xAxis",t,n,r.padding)},Xte=(e,t,n)=>{var r=wo(e,t);return r==null||typeof r.padding!="string"?0:gU(e,"yAxis",t,n,r.padding)},Zte=W(xo,Vte,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),Jte=W(wo,Xte,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),ene=W([En,Zte,Xb,Vb,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:o}=r;return i?[o.left,n.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),tne=W([En,tt,Jte,Xb,Vb,(e,t,n)=>n],(e,t,n,r,i,o)=>{var{padding:l}=i;return o?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),rh=(e,t,n,r)=>{var i;switch(t){case"xAxis":return ene(e,n,r);case"yAxis":return tne(e,n,r);case"zAxis":return(i=CA(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return mz(e);case"radiusAxis":return pz(e,n);default:return}},yU=W([Jt,rh],nv),nne=W([Ns,Wte],gz),FA=W([Jt,Ns,nne,yU],jA),xU=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:o}=n,l=Ha(e,r);if(l&&(i==="number"||o!=="auto"))return t.map(u=>u.value)}},$A=W([tt,nh,Mu,$t],xU),bv=W([FA],tA);W([FA],gte);W([FA,Nte],eU);W([Ru,pv,$t],Mte);function wU(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var vv=(e,t)=>t,gv=(e,t,n)=>n,rne=W(Wb,vv,gv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(wU)),ane=W(Qb,vv,gv,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(wU)),SU=(e,t)=>({width:e.width,height:t.height}),ine=(e,t)=>{var n=typeof t.width=="number"?t.width:$f;return{width:n,height:e.height}},EU=W(En,xo,SU),one=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},sne=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},lne=W(go,En,rne,vv,gv,(e,t,n,r,i)=>{var o={},l;return n.forEach(u=>{var f=SU(t,u);l==null&&(l=one(t,r,e));var h=r==="top"&&!i||r==="bottom"&&i;o[u.id]=l-Number(h)*f.height,l+=(h?-1:1)*f.height}),o}),cne=W(vo,En,ane,vv,gv,(e,t,n,r,i)=>{var o={},l;return n.forEach(u=>{var f=ine(t,u);l==null&&(l=sne(t,r,e));var h=r==="left"&&!i||r==="right"&&i;o[u.id]=l-Number(h)*f.width,l+=(h?-1:1)*f.width}),o}),une=(e,t)=>{var n=xo(e,t);if(n!=null)return lne(e,n.orientation,n.mirror)},dne=W([En,xo,une,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),fne=(e,t)=>{var n=wo(e,t);if(n!=null)return cne(e,n.orientation,n.mirror)},hne=W([En,wo,fne,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),AU=W(En,wo,(e,t)=>{var n=typeof t.width=="number"?t.width:$f;return{width:n,height:e.height}}),dM=(e,t,n)=>{switch(t){case"xAxis":return EU(e,n).width;case"yAxis":return AU(e,n).height;default:return}},jU=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:o,dataKey:l}=n,u=Ha(e,r),f=t.map(p=>p.value),h=f.filter(p=>p!=null);if(l&&u&&o==="category"&&i&&wL(h))return f}},KA=W([tt,nh,Jt,$t],jU),fM=W([tt,Ete,Ns,bv,KA,$A,rh,qA,$t],(e,t,n,r,i,o,l,u,f)=>{if(t!=null){var h=Ha(e,f);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:f,categoricalDomain:o,duplicateDomain:i,isCategorical:h,niceTicks:u,range:l,realScaleType:n,scale:r}}}),mne=(e,t,n,r,i,o,l,u,f)=>{if(!(t==null||r==null)){var h=Ha(e,f),{type:p,ticks:b,tickCount:g}=t,x=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,E=p==="category"&&r.bandwidth?r.bandwidth()/x:0;E=f==="angleAxis"&&o!=null&&o.length>=2?kn(o[0]-o[1])*2*E:E;var S=b||i;return S?S.map((A,j)=>{var C=l?l.indexOf(A):A,O=r.map(C);return Ye(O)?{index:j,coordinate:O+E,value:A,offset:E}:null}).filter(Rr):h&&u?u.map((A,j)=>{var C=r.map(A);return Ye(C)?{coordinate:C+E,value:A,index:j,offset:E}:null}).filter(Rr):r.ticks?r.ticks(g).map((A,j)=>{var C=r.map(A);return Ye(C)?{coordinate:C+E,value:A,index:j,offset:E}:null}).filter(Rr):r.domain().map((A,j)=>{var C=r.map(A);return Ye(C)?{coordinate:C+E,value:l?l[A]:A,index:j,offset:E}:null}).filter(Rr)}},CU=W([tt,Mu,Ns,bv,qA,rh,KA,$A,$t],mne),pne=(e,t,n,r,i,o,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=Ha(e,l),{tickCount:f}=t,h=0;return h=l==="angleAxis"&&(r==null?void 0:r.length)>=2?kn(r[0]-r[1])*2*h:h,u&&o?o.map((p,b)=>{var g=n.map(p);return Ye(g)?{coordinate:g+h,value:p,index:b,offset:h}:null}).filter(Rr):n.ticks?n.ticks(f).map((p,b)=>{var g=n.map(p);return Ye(g)?{coordinate:g+h,value:p,index:b,offset:h}:null}).filter(Rr):n.domain().map((p,b)=>{var g=n.map(p);return Ye(g)?{coordinate:g+h,value:i?i[p]:p,index:b,offset:h}:null}).filter(Rr)}},wi=W([tt,Mu,bv,rh,KA,$A,$t],pne),Si=W(Jt,bv,(e,t)=>{if(!(e==null||t==null))return ob(ob({},e),{},{scale:t})}),bne=W([Jt,Ns,zA,yU],jA),vne=W([bne],tA);W((e,t,n)=>CA(e,n),vne,(e,t)=>{if(!(e==null||t==null))return ob(ob({},e),{},{scale:t})});var gne=W([tt,Wb,Qb],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),yne=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};W([yne],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var o of e){var l=Math.abs(o.coordinate-t);l<r&&(r=l,i=o)}return(n=i)===null||n===void 0?void 0:n.value}});var OU=e=>e.options.defaultTooltipEventType,NU=e=>e.options.validateTooltipEventTypes;function TU(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function ah(e,t){var n=OU(e),r=NU(e);return TU(t,n,r)}function xne(e){return we(t=>ah(t,e))}var PU=(e,t)=>{var n,r=Number(t);if(!(Ba(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},wne=e=>e.tooltip.settings,as={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},Sne={itemInteraction:{click:as,hover:as},axisInteraction:{click:as,hover:as},keyboardInteraction:as,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},_U=lr({name:"tooltip",initialState:Sne,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:_t()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xa(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:_t()},removeTooltipEntrySettings:{reducer(e,t){var n=xa(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:_t()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:Ene,replaceTooltipEntrySettings:Ane,removeTooltipEntrySettings:jne,setTooltipSettingsState:Cne,setActiveMouseOverItemIndex:DU,mouseLeaveItem:One,mouseLeaveChart:MU,setActiveClickItemIndex:Nne,setMouseOverAxisIndex:RU,setMouseClickAxisIndex:Tne,setSyncInteraction:Xd,setKeyboardInteraction:cb}=_U.actions,Pne=_U.reducer;function hM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hM(Object(n),!0).forEach(function(r){_ne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _ne(e,t,n){return(t=Dne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dne(e){var t=Mne(e,"string");return typeof t=="symbol"?t:t+""}function Mne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rne(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function kne(e){return e.index!=null}var kU=(e,t,n,r)=>{if(t==null)return as;var i=Rne(e,t,n);if(i==null)return as;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if(kne(i)){if(o)return Gm(Gm({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Gm(Gm({},as),{},{coordinate:i.coordinate})};function Lne(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function Ine(e,t){var n=Lne(e),r=t[0],i=t[1];if(n===void 0)return!1;var o=Math.min(r,i),l=Math.max(r,i);return n>=o&&n<=l}function zne(e,t,n){if(n==null||t==null)return!0;var r=ot(e,t);return r==null||!hi(n)?!0:Ine(r,n)}var nf=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var o=Number(i);if(!Ye(o))return i;var l=0,u=1/0;t.length>0&&(u=t.length-1);var f=Math.max(l,Math.min(o,u)),h=t[f];return h==null||zne(h,n,r)?String(f):null},LU=(e,t,n,r,i,o,l)=>{if(o!=null){var u=l[0],f=u==null?void 0:u.getPosition(o);if(f!=null)return f;var h=i==null?void 0:i[Number(o)];if(h)switch(n){case"horizontal":return{x:h.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:h.coordinate}}}},IU=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(l=>{var u;return((u=l.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},zU=e=>e.options.tooltipPayloadSearcher,Lu=e=>e.tooltip;function mM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mM(Object(n),!0).forEach(function(r){Une(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Une(e,t,n){return(t=qne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qne(e){var t=Bne(e,"string");return typeof t=="symbol"?t:t+""}function Bne(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fne(e){if(typeof e=="string"||typeof e=="number")return e}function $ne(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Kne(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function bM(e){if(typeof e=="string")return e}function Hne(e){if(!(e==null||typeof e!="object")){var t="name"in e?Fne(e.name):void 0,n="unit"in e?$ne(e.unit):void 0,r="dataKey"in e?Kne(e.dataKey):void 0,i="payload"in e?e.payload:void 0,o="color"in e?bM(e.color):void 0,l="fill"in e?bM(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:o,fill:l}}}function Gne(e,t){return e??t}var UU=(e,t,n,r,i,o,l)=>{if(!(t==null||o==null)){var{chartData:u,computedData:f,dataStartIndex:h,dataEndIndex:p}=n,b=[];return e.reduce((g,x)=>{var E,{dataDefinedOnItem:S,settings:A}=x,j=Gne(S,u),C=Array.isArray(j)?bI(j,h,p):j,O=(E=A==null?void 0:A.dataKey)!==null&&E!==void 0?E:r,T=A==null?void 0:A.nameKey,_;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&l==="axis"?_=SL(C,r,i):_=o(C,t,f,T),Array.isArray(_))_.forEach(D=>{var L,z,F=Hne(D),G=F==null?void 0:F.name,R=F==null?void 0:F.dataKey,J=F==null?void 0:F.payload,$=pM(pM({},A),{},{name:G,unit:F==null?void 0:F.unit,color:(L=F==null?void 0:F.color)!==null&&L!==void 0?L:A==null?void 0:A.color,fill:(z=F==null?void 0:F.fill)!==null&&z!==void 0?z:A==null?void 0:A.fill});g.push(l_({tooltipEntrySettings:$,dataKey:R,payload:J,value:ot(J,R),name:G==null?void 0:String(G)}))});else{var P;g.push(l_({tooltipEntrySettings:A,dataKey:O,payload:_,value:ot(_,O),name:(P=ot(_,T))!==null&&P!==void 0?P:A==null?void 0:A.name}))}return g},b)}},HA=W([jn,rU,QE],Jz),Yne=W([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),Wne=W([In,_u],OA),Ll=W([Yne,jn,Wne],NA,{memoizeOptions:{resultEqualityCheck:lv}}),Qne=W([Ll],e=>e.filter(ov)),qU=W([Ll],TA,{memoizeOptions:{resultEqualityCheck:lv}}),Vne=W([Ll],e=>e.some(t=>!t.data)),Tl=W([qU,Ga],PA),Xne=W([Qne,Ga,jn],vz),GA=W([Tl,jn,Ll,Ga,Vne,qU],lU),BU=W([jn],DA),Zne=W([jn],e=>e.allowDataOverflow),FU=W([BU,Zne],XI),Jne=W([Ll],e=>e.filter(ov)),ere=W([Xne,Jne,Qf,uz],uU),tre=W([ere,Ga,In,FU],dU),nre=W([Ll],iU),rre=W([Tl,jn,nre,pv,In,AZ],kA,{memoizeOptions:{resultEqualityCheck:sv}}),are=W([fU,In,_u],ku),ire=W([are,In],pU),ore=W([hU,In,_u],ku),sre=W([ore,In],bU),lre=W([mU,In,_u],ku),cre=W([lre,In],vU),ure=W([ire,cre,sre],lb),dre=W([jn,BU,FU,tre,rre,ure,tt,In],LA),gu=W([jn,tt,Tl,GA,Qf,In,dre],IA),fre=W([gu,jn,HA],UA),hre=W([jn,gu,fre,In],BA),$U=e=>{var t=In(e),n=_u(e),r=!1;return rh(e,t,n,r)},KU=W([jn,$U],nv),mre=W([jn,HA,hre,KU],jA),HU=W([mre],tA),pre=W([tt,GA,jn,In],jU),bre=W([tt,GA,jn,In],xU),vre=(e,t,n,r,i,o,l,u)=>{if(t){var{type:f}=t,h=Ha(e,u);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,b=f==="category"&&r.bandwidth?r.bandwidth()/p:0;return b=u==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?kn(i[0]-i[1])*2*b:b,h&&l?l.map((g,x)=>{var E=r.map(g);return Ye(E)?{coordinate:E+b,value:g,index:x,offset:b}:null}).filter(Rr):r.domain().map((g,x)=>{var E=r.map(g);return Ye(E)?{coordinate:E+b,value:o?o[g]:g,index:x,offset:b}:null}).filter(Rr)}}},So=W([tt,jn,HA,HU,$U,pre,bre,In],vre),YA=W([OU,NU,wne],(e,t,n)=>TU(n.shared,e,t)),GU=e=>e.tooltip.settings.trigger,WA=e=>e.tooltip.settings.defaultIndex,ih=W([Lu,YA,GU,WA],kU),xs=W([ih,Tl,vu,gu],nf),YU=W([So,xs],PU),QA=W([ih],e=>{if(e)return e.dataKey}),WU=W([ih],e=>{if(e)return e.graphicalItemId}),QU=W([Lu,YA,GU,WA],IU),gre=W([vo,go,tt,En,So,WA,QU],LU),yre=W([ih,gre],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),xre=W([ih],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),wre=W([QU,xs,Ga,vu,YU,zU,YA],UU),Sre=W([wre],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function vM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vM(Object(n),!0).forEach(function(r){Ere(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ere(e,t,n){return(t=Are(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Are(e){var t=jre(e,"string");return typeof t=="symbol"?t:t+""}function jre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Cre=()=>we(jn),Ore=()=>{var e=Cre(),t=we(So),n=we(HU);return ys(!e||!n?void 0:gM(gM({},e),{},{scale:n}),t)};function yM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Oc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yM(Object(n),!0).forEach(function(r){Nre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nre(e,t,n){return(t=Tre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tre(e){var t=Pre(e,"string");return typeof t=="symbol"?t:t+""}function Pre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _re=(e,t,n,r)=>{var i=t.find(o=>o&&o.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},Dre=(e,t,n,r)=>{var i=t.find(h=>h&&h.index===n);if(i){if(e==="centric"){var o=i.coordinate,{radius:l}=r;return Oc(Oc(Oc({},r),hn(r.cx,r.cy,l,o)),{},{angle:o,radius:l})}var u=i.coordinate,{angle:f}=r;return Oc(Oc(Oc({},r),hn(r.cx,r.cy,u,f)),{},{angle:f,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Mre(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var VU=(e,t,n,r,i)=>{var o,l=(o=t==null?void 0:t.length)!==null&&o!==void 0?o:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u<l;u++){var f,h,p,b,g,x=u>0?(f=n[u-1])===null||f===void 0?void 0:f.coordinate:(h=n[l-1])===null||h===void 0?void 0:h.coordinate,E=(p=n[u])===null||p===void 0?void 0:p.coordinate,S=u>=l-1?(b=n[0])===null||b===void 0?void 0:b.coordinate:(g=n[u+1])===null||g===void 0?void 0:g.coordinate,A=void 0;if(!(x==null||E==null||S==null))if(kn(E-x)!==kn(S-E)){var j=[];if(kn(S-E)===kn(i[1]-i[0])){A=S;var C=E+i[1]-i[0];j[0]=Math.min(C,(C+x)/2),j[1]=Math.max(C,(C+x)/2)}else{A=x;var O=S+i[1]-i[0];j[0]=Math.min(E,(O+E)/2),j[1]=Math.max(E,(O+E)/2)}var T=[Math.min(E,(A+E)/2),Math.max(E,(A+E)/2)];if(e>T[0]&&e<=T[1]||e>=j[0]&&e<=j[1]){var _;return(_=n[u])===null||_===void 0?void 0:_.index}}else{var P=Math.min(x,S),D=Math.max(x,S);if(e>(P+E)/2&&e<=(D+E)/2){var L;return(L=n[u])===null||L===void 0?void 0:L.index}}}else if(t)for(var z=0;z<l;z++){var F=t[z];if(F!=null){var G=t[z+1],R=t[z-1];if(z===0&&G!=null&&e<=(F.coordinate+G.coordinate)/2||z===l-1&&R!=null&&e>(F.coordinate+R.coordinate)/2||z>0&&z<l-1&&R!=null&&G!=null&&e>(F.coordinate+R.coordinate)/2&&e<=(F.coordinate+G.coordinate)/2)return F.index}}return-1},XU=()=>we(QE),VA=(e,t)=>t,ZU=(e,t,n)=>n,XA=(e,t,n,r)=>r,Rre=W(So,e=>zb(e,t=>t.coordinate)),ZA=W([Lu,VA,ZU,XA],kU),JA=W([ZA,Tl,vu,gu],nf),kre=(e,t,n)=>{if(t!=null){var r=Lu(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},JU=W([Lu,VA,ZU,XA],IU),ub=W([vo,go,tt,En,So,XA,JU],LU),Lre=W([ZA,ub],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),e3=W([So,JA],PU),Ire=W([JU,JA,Ga,vu,e3,zU,VA],UU),zre=W([ZA,JA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Ure=(e,t,n,r,i,o,l)=>{if(!(!e||!n||!r||!i)&&Mre(e,l)){var u=jQ(e,t),f=VU(u,o,i,n,r),h=_re(t,i,f,e);return{activeIndex:String(f),activeCoordinate:h}}},qre=(e,t,n,r,i,o,l)=>{if(!(!e||!r||!i||!o||!n)){var u=fZ(e,n);if(u){var f=CQ(u,t),h=VU(f,l,o,r,i),p=Dre(t,o,h,u);return{activeIndex:String(h),activeCoordinate:p}}}},Bre=(e,t,n,r,i,o,l,u)=>{if(!(!e||!t||!r||!i||!o))return t==="horizontal"||t==="vertical"?Ure(e,t,r,i,o,l,u):qre(e,t,n,r,i,o,l)},Fre=W(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),$re=W(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(an)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:UZ}});function xM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xM(Object(n),!0).forEach(function(r){Kre(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kre(e,t,n){return(t=Hre(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hre(e){var t=Gre(e,"string");return typeof t=="symbol"?t:t+""}function Gre(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yre={},Wre={zIndexMap:Object.values(an).reduce((e,t)=>wM(wM({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Yre)},Qre=new Set(Object.values(an));function Vre(e){return Qre.has(e)}var t3=lr({name:"zIndex",initialState:Wre,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:_t()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Vre(n)&&delete e.zIndexMap[n])},prepare:_t()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:_t()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:_t()}}}),{registerZIndexPortal:Xre,unregisterZIndexPortal:$x,registerZIndexPortalElement:Zre,unregisterZIndexPortalElement:Jre}=t3.actions,eae=t3.reducer;function wr(e){var{zIndex:t,children:n}=e,r=aV(),i=r&&t!==void 0&&t!==0,o=Ln(),l=v.useRef(void 0),u=v.useRef(new Set),f=xt(),h=we(b=>Fre(b,t,o));if(v.useLayoutEffect(()=>{if(!i){var b=u.current;b.forEach(x=>{f($x({zIndex:x}))}),b.clear(),l.current=void 0;return}if(u.current.has(t)||(f(Xre({zIndex:t})),u.current.add(t)),h){l.current=h;var g=u.current;g.forEach(x=>{x!==t&&(f($x({zIndex:x})),g.delete(x))})}},[f,t,i,h]),v.useLayoutEffect(()=>{var b=u.current;return()=>{b.forEach(g=>{f($x({zIndex:g}))}),b.clear()}},[f]),!i)return n;var p=h??l.current;return p?Vn.createPortal(n,p):null}function xS(){return xS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xS.apply(null,arguments)}function SM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ym(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SM(Object(n),!0).forEach(function(r){tae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tae(e,t,n){return(t=nae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nae(e){var t=rae(e,"string");return typeof t=="symbol"?t:t+""}function rae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aae(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return v.isValidElement(t)?v.cloneElement(t,r):v.createElement(n,r)}function iae(e){var t,{coordinate:n,payload:r,index:i,offset:o,tooltipAxisBandSize:l,layout:u,cursor:f,tooltipEventType:h,chartName:p}=e,b=n,g=r,x=i;if(!f||!b||p!=="ScatterChart"&&h!=="axis")return null;var E,S,A;if(p==="ScatterChart")E=b,S=OX,A=an.cursorLine;else if(p==="BarChart")E=NX(u,b,o,l),S=KI,A=an.cursorRectangle;else if(u==="radial"&&AL(b)){var{cx:j,cy:C,radius:O,startAngle:T,endAngle:_}=GI(b);E={cx:j,cy:C,startAngle:T,endAngle:_,innerRadius:O,outerRadius:O},S=WI,A=an.cursorLine}else E={points:bZ(u,b,o)},S=Kc,A=an.cursorLine;var P=typeof f=="object"&&"className"in f?f.className:void 0,D=Ym(Ym(Ym(Ym({stroke:"#ccc",pointerEvents:"none"},o),E),wl(f)),{},{payload:g,payloadIndex:x,className:rt("recharts-tooltip-cursor",P)});return v.createElement(wr,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:A},v.createElement(aae,{cursor:f,cursorComp:S,cursorProps:D}))}function oae(e){var t=Ore(),n=CI(),r=js(),i=XU();return t==null||n==null||r==null||i==null?null:v.createElement(iae,xS({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var n3=v.createContext(null),sae=()=>v.useContext(n3),Kx={exports:{}},EM;function lae(){return EM||(EM=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(f,h,p){this.fn=f,this.context=h,this.once=p||!1}function o(f,h,p,b,g){if(typeof p!="function")throw new TypeError("The listener must be a function");var x=new i(p,b||f,g),E=n?n+h:h;return f._events[E]?f._events[E].fn?f._events[E]=[f._events[E],x]:f._events[E].push(x):(f._events[E]=x,f._eventsCount++),f}function l(f,h){--f._eventsCount===0?f._events=new r:delete f._events[h]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],p,b;if(this._eventsCount===0)return h;for(b in p=this._events)t.call(p,b)&&h.push(n?b.slice(1):b);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},u.prototype.listeners=function(h){var p=n?n+h:h,b=this._events[p];if(!b)return[];if(b.fn)return[b.fn];for(var g=0,x=b.length,E=new Array(x);g<x;g++)E[g]=b[g].fn;return E},u.prototype.listenerCount=function(h){var p=n?n+h:h,b=this._events[p];return b?b.fn?1:b.length:0},u.prototype.emit=function(h,p,b,g,x,E){var S=n?n+h:h;if(!this._events[S])return!1;var A=this._events[S],j=arguments.length,C,O;if(A.fn){switch(A.once&&this.removeListener(h,A.fn,void 0,!0),j){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,p),!0;case 3:return A.fn.call(A.context,p,b),!0;case 4:return A.fn.call(A.context,p,b,g),!0;case 5:return A.fn.call(A.context,p,b,g,x),!0;case 6:return A.fn.call(A.context,p,b,g,x,E),!0}for(O=1,C=new Array(j-1);O<j;O++)C[O-1]=arguments[O];A.fn.apply(A.context,C)}else{var T=A.length,_;for(O=0;O<T;O++)switch(A[O].once&&this.removeListener(h,A[O].fn,void 0,!0),j){case 1:A[O].fn.call(A[O].context);break;case 2:A[O].fn.call(A[O].context,p);break;case 3:A[O].fn.call(A[O].context,p,b);break;case 4:A[O].fn.call(A[O].context,p,b,g);break;default:if(!C)for(_=1,C=new Array(j-1);_<j;_++)C[_-1]=arguments[_];A[O].fn.apply(A[O].context,C)}}return!0},u.prototype.on=function(h,p,b){return o(this,h,p,b,!1)},u.prototype.once=function(h,p,b){return o(this,h,p,b,!0)},u.prototype.removeListener=function(h,p,b,g){var x=n?n+h:h;if(!this._events[x])return this;if(!p)return l(this,x),this;var E=this._events[x];if(E.fn)E.fn===p&&(!g||E.once)&&(!b||E.context===b)&&l(this,x);else{for(var S=0,A=[],j=E.length;S<j;S++)(E[S].fn!==p||g&&!E[S].once||b&&E[S].context!==b)&&A.push(E[S]);A.length?this._events[x]=A.length===1?A[0]:A:l(this,x)}return this},u.prototype.removeAllListeners=function(h){var p;return h?(p=n?n+h:h,this._events[p]&&l(this,p)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(Kx)),Kx.exports}var cae=lae();const uae=Ei(cae);var Ef=new uae,wS="recharts.syncEvent.tooltip",AM="recharts.syncEvent.brush",yv=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Ba(n))return e[n]}},dae={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},r3=lr({name:"options",initialState:dae,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),fae=r3.reducer,{createEventEmitter:hae}=r3.actions;function mae(e){return e.tooltip.syncInteraction}var pae={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},a3=lr({name:"chartData",initialState:pae,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:jM,setDataStartEndIndexes:bae,setComputedData:Phe}=a3.actions,vae=a3.reducer,gae=["x","y"];function CM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CM(Object(n),!0).forEach(function(r){yae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yae(e,t,n){return(t=xae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xae(e){var t=wae(e,"string");return typeof t=="symbol"?t:t+""}function wae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sae(e,t){if(e==null)return{};var n,r,i=Eae(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Eae(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Aae(){var e=we(VE),t=we(XE),n=xt(),r=we(dz),i=we(So),o=js(),l=Zb(),u=we(f=>f.rootProps.className);v.useEffect(()=>{if(e==null)return Es;var f=(h,p,b)=>{if(t!==b&&e===h){if(p.payload.active===!1){n(Xd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var g;if(l&&p!==null&&p!==void 0&&(g=p.payload)!==null&&g!==void 0&&g.coordinate&&p.payload.sourceViewBox){var x=p.payload.coordinate,{x:E,y:S}=x,A=Sae(x,gae),{x:j,y:C,width:O,height:T}=p.payload.sourceViewBox,_=Nc(Nc({},A),{},{x:l.x+(O?(E-j)/O:0)*l.width,y:l.y+(T?(S-C)/T:0)*l.height});n(Nc(Nc({},p),{},{payload:Nc(Nc({},p.payload),{},{coordinate:_})}))}else n(p);return}if(i!=null){var P;if(typeof r=="function"){var D={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},L=r(i,D);P=i[L]}else r==="value"&&(P=i.find(K=>String(K.value)===p.payload.label));var{coordinate:z}=p.payload;if(z==null||l==null){n(Xd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(P==null){n(Xd({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:F,y:G}=z,R=Math.min(F,l.x+l.width),J=Math.min(G,l.y+l.height),$={x:o==="horizontal"?P.coordinate:R,y:o==="horizontal"?J:P.coordinate},ne=Xd({active:p.payload.active,coordinate:$,dataKey:p.payload.dataKey,index:String(P.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(ne)}}};return Ef.on(wS,f),()=>{Ef.off(wS,f)}},[u,n,t,e,r,i,o,l])}function jae(){var e=we(VE),t=we(XE),n=xt();v.useEffect(()=>{if(e==null)return Es;var r=(i,o,l)=>{t!==l&&e===i&&n(bae(o))};return Ef.on(AM,r),()=>{Ef.off(AM,r)}},[n,t,e])}function Cae(){var e=xt();v.useEffect(()=>{e(hae())},[e]),Aae(),jae()}function Oae(e,t,n,r,i,o){var l=we(E=>kre(E,e,t)),u=we(WU),f=we(XE),h=we(VE),p=we(dz),b=we(mae),g=(b==null?void 0:b.sourceViewBox)!=null,x=Zb();v.useEffect(()=>{if(!g&&h!=null&&f!=null){var E=Xd({active:o,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:x,graphicalItemId:u});Ef.emit(wS,h,E,f)}},[g,n,l,u,i,r,f,h,p,o,x])}function OM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OM(Object(n),!0).forEach(function(r){Nae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nae(e,t,n){return(t=Tae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tae(e){var t=Pae(e,"string");return typeof t=="symbol"?t:t+""}function Pae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _ae(e){return e.dataKey}function Dae(e,t){return v.isValidElement(e)?v.cloneElement(e,t):typeof e=="function"?v.createElement(e,t):v.createElement(nX,t)}var TM=[],Mae={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function Wm(e){var t,n,r=on(e,Mae),{active:i,allowEscapeViewBox:o,animationDuration:l,animationEasing:u,content:f,filterNull:h,isAnimationActive:p,offset:b,payloadUniqBy:g,position:x,reverseDirection:E,useTranslate3d:S,wrapperStyle:A,cursor:j,shared:C,trigger:O,defaultIndex:T,portal:_,axisId:P}=r,D=xt(),L=typeof T=="number"?String(T):T;v.useEffect(()=>{D(Cne({shared:C,trigger:O,axisId:P,active:i,defaultIndex:L}))},[D,C,O,P,i,L]);var z=Zb(),F=UI(),G=xne(C),{activeIndex:R,isActive:J}=(t=we(Be=>zre(Be,G,O,L)))!==null&&t!==void 0?t:{},$=we(Be=>Ire(Be,G,O,L)),ne=we(Be=>e3(Be,G,O,L)),K=we(Be=>Lre(Be,G,O,L)),Z=$,B=sae(),te=(n=i??J)!==null&&n!==void 0?n:!1,[pe,k]=qL([Z,te]),Q=G==="axis"?ne:void 0;Oae(G,O,K,Q,R,te);var ce=_??B;if(ce==null||z==null||G==null)return null;var fe=Z??TM;te||(fe=TM),h&&fe.length&&(fe=kL(fe.filter(Be=>Be.value!=null&&(Be.hide!==!0||r.includeHidden)),g,_ae));var xe=fe.length>0,Oe=NM(NM({},r),{},{payload:fe,label:Q,active:te,activeIndex:R,coordinate:K,accessibilityLayer:F}),qe=v.createElement(hX,{allowEscapeViewBox:o,animationDuration:l,animationEasing:u,isAnimationActive:p,active:te,coordinate:K,hasPayload:xe,offset:b,position:x,reverseDirection:E,useTranslate3d:S,viewBox:z,wrapperStyle:A,lastBoundingBox:pe,innerRef:k,hasPortalFromProps:!!_},Dae(f,Oe));return v.createElement(v.Fragment,null,Vn.createPortal(qe,ce),te&&v.createElement(oae,{cursor:j,tooltipEventType:G,coordinate:K,payload:fe,index:R}))}var yu=e=>null;yu.displayName="Cell";function Rae(e,t,n){return(t=kae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kae(e){var t=Lae(e,"string");return typeof t=="symbol"?t:t+""}function Lae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Iae{constructor(t){Rae(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function PM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PM(Object(n),!0).forEach(function(r){Uae(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uae(e,t,n){return(t=qae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qae(e){var t=Bae(e,"string");return typeof t=="symbol"?t:t+""}function Bae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Fae={cacheSize:2e3,enableCache:!0},i3=zae({},Fae),_M=new Iae(i3.cacheSize),$ae={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},DM="recharts_measurement_span";function Kae(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",o=t.fontStyle||"",l=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(o,"|").concat(l,"|").concat(u)}var MM=(e,t)=>{try{var n=document.getElementById(DM);n||(n=document.createElement("span"),n.setAttribute("id",DM),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,$ae,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},rf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Gf.isSsr)return{width:0,height:0};if(!i3.enableCache)return MM(t,n);var r=Kae(t,n),i=_M.get(r);if(i)return i;var o=MM(t,n);return _M.set(r,o),o},o3;function Hae(e,t,n){return(t=Gae(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gae(e){var t=Yae(e,"string");return typeof t=="symbol"?t:t+""}function Yae(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var RM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,kM=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Wae=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,Qae=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Vae={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Xae=["cm","mm","pt","pc","in","Q","px"];function Zae(e){return Xae.includes(e)}var zc="NaN";function Jae(e,t){return e*Vae[t]}class Wn{static parse(t){var n,[,r,i]=(n=Qae.exec(t))!==null&&n!==void 0?n:[];return r==null?Wn.NaN:new Wn(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Ba(t)&&(this.unit=""),n!==""&&!Wae.test(n)&&(this.num=NaN,this.unit=""),Zae(n)&&(this.num=Jae(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Wn(NaN,""):new Wn(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Wn(NaN,""):new Wn(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Wn(NaN,""):new Wn(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Wn(NaN,""):new Wn(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Ba(this.num)}}o3=Wn;Hae(Wn,"NaN",new o3(NaN,""));function s3(e){if(e==null||e.includes(zc))return zc;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,o]=(n=RM.exec(t))!==null&&n!==void 0?n:[],l=Wn.parse(r??""),u=Wn.parse(o??""),f=i==="*"?l.multiply(u):l.divide(u);if(f.isNaN())return zc;t=t.replace(RM,f.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var h,[,p,b,g]=(h=kM.exec(t))!==null&&h!==void 0?h:[],x=Wn.parse(p??""),E=Wn.parse(g??""),S=b==="+"?x.add(E):x.subtract(E);if(S.isNaN())return zc;t=t.replace(kM,S.toString())}return t}var LM=/\(([^()]*)\)/;function eie(e){for(var t=e,n;(n=LM.exec(t))!=null;){var[,r]=n;t=t.replace(LM,s3(r))}return t}function tie(e){var t=e.replace(/\s+/g,"");return t=eie(t),t=s3(t),t}function nie(e){try{return tie(e)}catch{return zc}}function Hx(e){var t=nie(e.slice(5,-1));return t===zc?"":t}var rie=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],aie=["dx","dy","angle","className","breakAll"];function SS(){return SS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SS.apply(null,arguments)}function IM(e,t){if(e==null)return{};var n,r,i=iie(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function iie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var l3=/[ \f\n\r\t\v\u2028\u2029]+/,c3=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Mt(t)||(n?i=t.toString().split(""):i=t.toString().split(l3));var o=i.map(u=>({word:u,width:rf(u,r).width})),l=n?0:rf(" ",r).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}};function u3(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function oie(e){return Mt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var d3=(e,t,n,r)=>e.reduce((i,o)=>{var{word:l,width:u}=o,f=i[i.length-1];if(f&&u!=null&&(t==null||r||f.width+u+n<Number(t)))f.words.push(l),f.width+=u+n;else{var h={words:[l],width:u};i.push(h)}return i},[]),f3=e=>e.reduce((t,n)=>t.width>n.width?t:n),sie="…",zM=(e,t,n,r,i,o,l,u)=>{var f=e.slice(0,t),h=c3({breakAll:n,style:r,children:f+sie});if(!h)return[!1,[]];var p=d3(h.wordsWithComputedWidth,o,l,u),b=p.length>i||f3(p).width>Number(o);return[b,p]},lie=(e,t,n,r,i)=>{var{maxLines:o,children:l,style:u,breakAll:f}=e,h=ye(o),p=String(l),b=d3(t,r,n,i);if(!h||i)return b;var g=b.length>o||f3(b).width>Number(r);if(!g)return b;for(var x=0,E=p.length-1,S=0,A;x<=E&&S<=p.length-1;){var j=Math.floor((x+E)/2),C=j-1,[O,T]=zM(p,C,f,u,o,r,n,i),[_]=zM(p,j,f,u,o,r,n,i);if(!O&&!_&&(x=j+1),O&&_&&(E=j-1),!O&&_){A=T;break}S++}return A||b},UM=e=>{var t=Mt(e)?[]:e.toString().split(l3);return[{words:t,width:void 0}]},cie=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:o,maxLines:l}=e;if((t||n)&&!Gf.isSsr){var u,f,h=c3({breakAll:o,children:r,style:i});if(h){var{wordsWithComputedWidth:p,spaceWidth:b}=h;u=p,f=b}else return UM(r);return lie({breakAll:o,children:r,maxLines:l,style:i},u,f,t,!!n)}return UM(r)},h3="#808080",uie={angle:0,breakAll:!1,capHeight:"0.71em",fill:h3,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},xv=v.forwardRef((e,t)=>{var n=on(e,uie),{x:r,y:i,lineHeight:o,capHeight:l,fill:u,scaleToFit:f,textAnchor:h,verticalAnchor:p}=n,b=IM(n,rie),g=v.useMemo(()=>cie({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]),{dx:x,dy:E,angle:S,className:A,breakAll:j}=b,C=IM(b,aie);if(!vi(r)||!vi(i)||g.length===0)return null;var O=Number(r)+(ye(x)?x:0),T=Number(i)+(ye(E)?E:0);if(!Ye(O)||!Ye(T))return null;var _;switch(p){case"start":_=Hx("calc(".concat(l,")"));break;case"middle":_=Hx("calc(".concat((g.length-1)/2," * -").concat(o," + (").concat(l," / 2))"));break;default:_=Hx("calc(".concat(g.length-1," * -").concat(o,")"));break}var P=[],D=g[0];if(f&&D!=null){var L=D.width,{width:z}=b;P.push("scale(".concat(ye(z)&&ye(L)?z/L:1,")"))}return S&&P.push("rotate(".concat(S,", ").concat(O,", ").concat(T,")")),P.length&&(C.transform=P.join(" ")),v.createElement("text",SS({},or(C),{ref:t,x:O,y:T,className:rt("recharts-text",A),textAnchor:h,fill:u.includes("url")?h3:u}),g.map((F,G)=>{var R=F.words.join(j?"":" ");return v.createElement("tspan",{x:O,dy:G===0?_:o,key:"".concat(R,"-").concat(G)},R)}))});xv.displayName="Text";function qM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ii(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qM(Object(n),!0).forEach(function(r){die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function die(e,t,n){return(t=fie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fie(e){var t=hie(e,"string");return typeof t=="symbol"?t:t+""}function hie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mie=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:o,y:l,height:u,upperWidth:f,lowerWidth:h}=qE(t),p=o,b=o+(f-h)/2,g=(p+b)/2,x=(f+h)/2,E=p+f/2,S=u>=0?1:-1,A=S*r,j=S>0?"end":"start",C=S>0?"start":"end",O=f>=0?1:-1,T=O*r,_=O>0?"end":"start",P=O>0?"start":"end",D=i;if(n==="top"){var L={x:p+f/2,y:l-A,horizontalAnchor:"middle",verticalAnchor:j};return D&&(L.height=Math.max(l-D.y,0),L.width=f),L}if(n==="bottom"){var z={x:b+h/2,y:l+u+A,horizontalAnchor:"middle",verticalAnchor:C};return D&&(z.height=Math.max(D.y+D.height-(l+u),0),z.width=h),z}if(n==="left"){var F={x:g-T,y:l+u/2,horizontalAnchor:_,verticalAnchor:"middle"};return D&&(F.width=Math.max(F.x-D.x,0),F.height=u),F}if(n==="right"){var G={x:g+x+T,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"};return D&&(G.width=Math.max(D.x+D.width-G.x,0),G.height=u),G}var R=D?{width:x,height:u}:{};return n==="insideLeft"?ii({x:g+T,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"},R):n==="insideRight"?ii({x:g+x-T,y:l+u/2,horizontalAnchor:_,verticalAnchor:"middle"},R):n==="insideTop"?ii({x:p+f/2,y:l+A,horizontalAnchor:"middle",verticalAnchor:C},R):n==="insideBottom"?ii({x:b+h/2,y:l+u-A,horizontalAnchor:"middle",verticalAnchor:j},R):n==="insideTopLeft"?ii({x:p+T,y:l+A,horizontalAnchor:P,verticalAnchor:C},R):n==="insideTopRight"?ii({x:p+f-T,y:l+A,horizontalAnchor:_,verticalAnchor:C},R):n==="insideBottomLeft"?ii({x:b+T,y:l+u-A,horizontalAnchor:P,verticalAnchor:j},R):n==="insideBottomRight"?ii({x:b+h-T,y:l+u-A,horizontalAnchor:_,verticalAnchor:j},R):n&&typeof n=="object"&&(ye(n.x)||Al(n.x))&&(ye(n.y)||Al(n.y))?ii({x:o+ar(n.x,x),y:l+ar(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},R):ii({x:E,y:l+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},pie=["labelRef"],bie=["content"];function BM(e,t){if(e==null)return{};var n,r,i=vie(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function FM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FM(Object(n),!0).forEach(function(r){gie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gie(e,t,n){return(t=yie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yie(e){var t=xie(e,"string");return typeof t=="symbol"?t:t+""}function xie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function io(){return io=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},io.apply(null,arguments)}var m3=v.createContext(null),wie=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:o,height:l,children:u}=e,f=v.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:o,height:l}),[t,n,r,i,o,l]);return v.createElement(m3.Provider,{value:f},u)},p3=()=>{var e=v.useContext(m3),t=Zb();return e||(t?qE(t):void 0)},Sie=v.createContext(null),Eie=()=>{var e=v.useContext(Sie),t=we(bz);return e||t},Aie=e=>{var{value:t,formatter:n}=e,r=Mt(e.children)?t:e.children;return typeof n=="function"?n(r):r},ej=e=>e!=null&&typeof e=="function",jie=(e,t)=>{var n=kn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Cie=(e,t,n,r,i)=>{var{offset:o,className:l}=e,{cx:u,cy:f,innerRadius:h,outerRadius:p,startAngle:b,endAngle:g,clockWise:x}=i,E=(h+p)/2,S=jie(b,g),A=S>=0?1:-1,j,C;switch(t){case"insideStart":j=b+A*o,C=x;break;case"insideEnd":j=g-A*o,C=!x;break;case"end":j=g+A*o,C=x;break;default:throw new Error("Unsupported position ".concat(t))}C=S<=0?C:!C;var O=hn(u,f,E,j),T=hn(u,f,E,j+(C?1:-1)*359),_="M".concat(O.x,",").concat(O.y,` 274 274 A`).concat(E,",").concat(E,",0,1,").concat(C?0:1,`, 275 `).concat(T.x,",").concat(T.y),P=Mt(e.id)? cf("recharts-radial-line-"):e.id;return v.createElement("text",io({},r,{dominantBaseline:"central",className:rt("recharts-radial-bar-label",l)}),v.createElement("defs",null,v.createElement("path",{id:P,d:_})),v.createElement("textPath",{xlinkHref:"#".concat(P)},n))},Oie=(e,t,n)=>{var{cx:r,cy:i,innerRadius:o,outerRadius:l,startAngle:u,endAngle:f}=e,h=(u+f)/2;if(n==="outside"){var{x:p,y:b}=hn(r,i,l+t,h);return{x:p,y:b,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var g=(o+l)/2,{x,y:E}=hn(r,i,g,h);return{x,y:E,textAnchor:"middle",verticalAnchor:"middle"}},op=e=>e!=null&&"cx"in e&&ye(e.cx),Nie={angle:0,offset:5,zIndex:an.label,position:"middle",textBreakAll:!1};function Tie(e){if(!op(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function rs(e){var t=on(e,Nie),{viewBox:n,parentViewBox:r,position:i,value:o,children:l,content:u,className:f="",textBreakAll:h,labelRef:p}=t,b=Eie(),g=m3(),x=i==="center"?g:b??g,E,S,A;n==null?E=x:op(n)?E=n:E=qE(n);var j=Tie(E);if(!E||Mt(o)&&Mt(l)&&!v.isValidElement(u)&&typeof u!="function")return null;var C=Xd(Xd({},t),{},{viewBox:E});if(v.isValidElement(u)){var{labelRef:O}=C,T=qM(C,pie);return v.cloneElement(u,T)}if(typeof u=="function"){var{content:_}=C,P=qM(C,bie);if(S=v.createElement(u,P),v.isValidElement(S))return S}else S=Aie(t);var D=or(t);if(op(E)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Cie(t,i,S,D,E);A=Oie(E,t.offset,t.position)}else{if(!j)return null;var L=mie({viewBox:j,position:i,offset:t.offset,parentViewBox:op(r)?void 0:r});A=Xd(Xd({x:L.x,y:L.y,textAnchor:L.horizontalAnchor,verticalAnchor:L.verticalAnchor},L.width!==void 0?{width:L.width}:{}),L.height!==void 0?{height:L.height}:{})}return v.createElement(wr,{zIndex:t.zIndex},v.createElement(xv,io({ref:p,className:rt("recharts-label",f)},D,A,{textAnchor:c3(D.textAnchor)?D.textAnchor:A.textAnchor,breakAll:h}),S))}rs.displayName="Label";var Pie=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?v.createElement(rs,io({key:"label-implicit"},r)):vi(e)?v.createElement(rs,io({key:"label-implicit",value:e},r)):v.isValidElement(e)?e.type===rs?v.cloneElement(e,Xd({key:"label-implicit"},r)):v.createElement(rs,io({key:"label-implicit",content:e},r)):ej(e)?v.createElement(rs,io({key:"label-implicit",content:e},r)):e&&typeof e=="object"?v.createElement(rs,io({},e,{key:"label-implicit"},r)):null};function _ie(e){var{label:t,labelRef:n}=e,r=m3();return Pie(t,r,n)||null}var Die=["valueAccessor"],Mie=["dataKey","clockWise","id","textBreakAll","zIndex"];function db(){return db=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},db.apply(null,arguments)}function FM(e,t){if(e==null)return{};var n,r,i=Rie(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Rie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var kie=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(oie(t))return t},p3=v.createContext(void 0),tj=p3.Provider,b3=v.createContext(void 0),Lie=b3.Provider;function Iie(){return v.useContext(p3)}function zie(){return v.useContext(b3)}function sp(e){var{valueAccessor:t=kie}=e,n=FM(e,Die),{dataKey:r,clockWise:i,id:o,textBreakAll:l,zIndex:u}=n,f=FM(n,Mie),h=Iie(),p=zie(),b=h||p;return!b||!b.length?null:v.createElement(wr,{zIndex:u??an.label},v.createElement(Ft,{className:"recharts-label-list"},b.map((g,x)=>{var E,S=Mt(r)?t(g,x):ot(g.payload,r),A=Mt(o)?{}:{id:"".concat(o,"-").concat(x)};return v.createElement(rs,db({key:"label-".concat(x)},or(g),f,A,{fill:(E=n.fill)!==null&&E!==void 0?E:g.fill,parentViewBox:g.parentViewBox,value:S,textBreakAll:l,viewBox:g.viewBox,index:x,zIndex:0}))})))}sp.displayName="LabelList";function wv(e){var{label:t}=e;return t?t===!0?v.createElement(sp,{key:"labelList-implicit"}):v.isValidElement(t)||ej(t)?v.createElement(sp,{key:"labelList-implicit",content:t}):typeof t=="object"?v.createElement(sp,db({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function ES(){return ES=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ES.apply(null,arguments)}var v3=e=>{var{cx:t,cy:n,r,className:i}=e,o=rt("recharts-dot",i);return ye(t)&&ye(n)&&ye(r)?v.createElement("circle",ES({},yr(e),TE(e),{className:o,cx:t,cy:n,r})):null},g3=e=>e.graphicalItems.polarItems,Uie=W([$t,Vf],OA),Sv=W([g3,Jt,Uie],NA),qie=W([Sv],TA),Ev=W([qie,Yf],PA),Bie=W([Ev,Jt,Sv],oU);W([Ev,Jt,Sv],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var o,l=ot(r,(o=t.dataKey)!==null&&o!==void 0?o:i.dataKey);return{value:l,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:ot(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var $M=()=>{},Fie=W([Ev,Jt,Sv,pv,$t,EZ],kA),$ie=W([Jt,MA,RA,$M,Fie,$M,tt,$t],LA),y3=W([Jt,tt,Ev,Bie,Qf,$t,$ie],IA),Kie=W([y3,Du,Ns],UA),Hie=W([Jt,y3,Kie,$t],BA);W([Ns,Hie],vz);var Gie={radiusAxis:{},angleAxis:{}},x3=lr({name:"polarAxis",initialState:Gie,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:_he,removeRadiusAxis:Dhe,addAngleAxis:Mhe,removeAngleAxis:Rhe}=x3.actions,Yie=x3.reducer;function w3(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function KM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function HM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KM(Object(n),!0).forEach(function(r){Wie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wie(e,t,n){return(t=Qie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qie(e){var t=Vie(e,"string");return typeof t=="symbol"?t:t+""}function Vie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xie=(e,t)=>t,nj=W([g3,Xie],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),Zie=[],rj=(e,t,n)=>(n==null?void 0:n.length)===0?Zie:n,S3=W([Yf,nj,rj],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i;if((t==null?void 0:t.data)!=null&&t.data.length>0?i=t.data:i=r,(!i||!i.length)&&n!=null&&(i=n.map(o=>HM(HM({},t.presentationProps),o.props))),i!=null)return i}}),Jie=W([S3,nj,rj],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var o,l=ot(r,t.nameKey,t.name),u;return n!=null&&(o=n[i])!==null&&o!==void 0&&(o=o.props)!==null&&o!==void 0&&o.fill?u=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?u=r.fill:u=t.fill,{value:As(l,t.dataKey),color:u,payload:r,type:t.legendType}})}),eoe=W([S3,nj,rj,En],(e,t,n,r)=>{if(!(t==null||e==null))return ase({offset:r,pieSettings:t,displayedData:e,cells:n})}),Gx={exports:{}},yt={};/**275 `).concat(T.x,",").concat(T.y),P=Mt(e.id)?uf("recharts-radial-line-"):e.id;return v.createElement("text",io({},r,{dominantBaseline:"central",className:rt("recharts-radial-bar-label",l)}),v.createElement("defs",null,v.createElement("path",{id:P,d:_})),v.createElement("textPath",{xlinkHref:"#".concat(P)},n))},Oie=(e,t,n)=>{var{cx:r,cy:i,innerRadius:o,outerRadius:l,startAngle:u,endAngle:f}=e,h=(u+f)/2;if(n==="outside"){var{x:p,y:b}=hn(r,i,l+t,h);return{x:p,y:b,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var g=(o+l)/2,{x,y:E}=hn(r,i,g,h);return{x,y:E,textAnchor:"middle",verticalAnchor:"middle"}},op=e=>e!=null&&"cx"in e&&ye(e.cx),Nie={angle:0,offset:5,zIndex:an.label,position:"middle",textBreakAll:!1};function Tie(e){if(!op(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function rs(e){var t=on(e,Nie),{viewBox:n,parentViewBox:r,position:i,value:o,children:l,content:u,className:f="",textBreakAll:h,labelRef:p}=t,b=Eie(),g=p3(),x=i==="center"?g:b??g,E,S,A;n==null?E=x:op(n)?E=n:E=qE(n);var j=Tie(E);if(!E||Mt(o)&&Mt(l)&&!v.isValidElement(u)&&typeof u!="function")return null;var C=Zd(Zd({},t),{},{viewBox:E});if(v.isValidElement(u)){var{labelRef:O}=C,T=BM(C,pie);return v.cloneElement(u,T)}if(typeof u=="function"){var{content:_}=C,P=BM(C,bie);if(S=v.createElement(u,P),v.isValidElement(S))return S}else S=Aie(t);var D=or(t);if(op(E)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Cie(t,i,S,D,E);A=Oie(E,t.offset,t.position)}else{if(!j)return null;var L=mie({viewBox:j,position:i,offset:t.offset,parentViewBox:op(r)?void 0:r});A=Zd(Zd({x:L.x,y:L.y,textAnchor:L.horizontalAnchor,verticalAnchor:L.verticalAnchor},L.width!==void 0?{width:L.width}:{}),L.height!==void 0?{height:L.height}:{})}return v.createElement(wr,{zIndex:t.zIndex},v.createElement(xv,io({ref:p,className:rt("recharts-label",f)},D,A,{textAnchor:u3(D.textAnchor)?D.textAnchor:A.textAnchor,breakAll:h}),S))}rs.displayName="Label";var Pie=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?v.createElement(rs,io({key:"label-implicit"},r)):vi(e)?v.createElement(rs,io({key:"label-implicit",value:e},r)):v.isValidElement(e)?e.type===rs?v.cloneElement(e,Zd({key:"label-implicit"},r)):v.createElement(rs,io({key:"label-implicit",content:e},r)):ej(e)?v.createElement(rs,io({key:"label-implicit",content:e},r)):e&&typeof e=="object"?v.createElement(rs,io({},e,{key:"label-implicit"},r)):null};function _ie(e){var{label:t,labelRef:n}=e,r=p3();return Pie(t,r,n)||null}var Die=["valueAccessor"],Mie=["dataKey","clockWise","id","textBreakAll","zIndex"];function db(){return db=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},db.apply(null,arguments)}function $M(e,t){if(e==null)return{};var n,r,i=Rie(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Rie(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var kie=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(oie(t))return t},b3=v.createContext(void 0),tj=b3.Provider,v3=v.createContext(void 0),Lie=v3.Provider;function Iie(){return v.useContext(b3)}function zie(){return v.useContext(v3)}function sp(e){var{valueAccessor:t=kie}=e,n=$M(e,Die),{dataKey:r,clockWise:i,id:o,textBreakAll:l,zIndex:u}=n,f=$M(n,Mie),h=Iie(),p=zie(),b=h||p;return!b||!b.length?null:v.createElement(wr,{zIndex:u??an.label},v.createElement(Ft,{className:"recharts-label-list"},b.map((g,x)=>{var E,S=Mt(r)?t(g,x):ot(g.payload,r),A=Mt(o)?{}:{id:"".concat(o,"-").concat(x)};return v.createElement(rs,db({key:"label-".concat(x)},or(g),f,A,{fill:(E=n.fill)!==null&&E!==void 0?E:g.fill,parentViewBox:g.parentViewBox,value:S,textBreakAll:l,viewBox:g.viewBox,index:x,zIndex:0}))})))}sp.displayName="LabelList";function wv(e){var{label:t}=e;return t?t===!0?v.createElement(sp,{key:"labelList-implicit"}):v.isValidElement(t)||ej(t)?v.createElement(sp,{key:"labelList-implicit",content:t}):typeof t=="object"?v.createElement(sp,db({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function ES(){return ES=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ES.apply(null,arguments)}var g3=e=>{var{cx:t,cy:n,r,className:i}=e,o=rt("recharts-dot",i);return ye(t)&&ye(n)&&ye(r)?v.createElement("circle",ES({},yr(e),TE(e),{className:o,cx:t,cy:n,r})):null},y3=e=>e.graphicalItems.polarItems,Uie=W([$t,Vf],OA),Sv=W([y3,Jt,Uie],NA),qie=W([Sv],TA),Ev=W([qie,Yf],PA),Bie=W([Ev,Jt,Sv],sU);W([Ev,Jt,Sv],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var o,l=ot(r,(o=t.dataKey)!==null&&o!==void 0?o:i.dataKey);return{value:l,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:ot(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var KM=()=>{},Fie=W([Ev,Jt,Sv,pv,$t,EZ],kA),$ie=W([Jt,MA,RA,KM,Fie,KM,tt,$t],LA),x3=W([Jt,tt,Ev,Bie,Qf,$t,$ie],IA),Kie=W([x3,Mu,Ns],UA),Hie=W([Jt,x3,Kie,$t],BA);W([Ns,Hie],gz);var Gie={radiusAxis:{},angleAxis:{}},w3=lr({name:"polarAxis",initialState:Gie,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:_he,removeRadiusAxis:Dhe,addAngleAxis:Mhe,removeAngleAxis:Rhe}=w3.actions,Yie=w3.reducer;function S3(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function HM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function GM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HM(Object(n),!0).forEach(function(r){Wie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Wie(e,t,n){return(t=Qie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qie(e){var t=Vie(e,"string");return typeof t=="symbol"?t:t+""}function Vie(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xie=(e,t)=>t,nj=W([y3,Xie],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),Zie=[],rj=(e,t,n)=>(n==null?void 0:n.length)===0?Zie:n,E3=W([Yf,nj,rj],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i;if((t==null?void 0:t.data)!=null&&t.data.length>0?i=t.data:i=r,(!i||!i.length)&&n!=null&&(i=n.map(o=>GM(GM({},t.presentationProps),o.props))),i!=null)return i}}),Jie=W([E3,nj,rj],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var o,l=ot(r,t.nameKey,t.name),u;return n!=null&&(o=n[i])!==null&&o!==void 0&&(o=o.props)!==null&&o!==void 0&&o.fill?u=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?u=r.fill:u=t.fill,{value:As(l,t.dataKey),color:u,payload:r,type:t.legendType}})}),eoe=W([E3,nj,rj,En],(e,t,n,r)=>{if(!(t==null||e==null))return ase({offset:r,pieSettings:t,displayedData:e,cells:n})}),Gx={exports:{}},yt={};/** 276 276 * @license React 277 277 * react-is.production.js … … 281 281 * This source code is licensed under the MIT license found in the 282 282 * LICENSE file in the root directory of this source tree. 283 */var GM;function toe(){if(GM)return yt;GM=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function E(S){if(typeof S=="object"&&S!==null){var A=S.$$typeof;switch(A){case e:switch(S=S.type,S){case n:case i:case r:case f:case h:case g:return S;default:switch(S=S&&S.$$typeof,S){case l:case u:case b:case p:return S;case o:return S;default:return A}}case t:return A}}}return yt.ContextConsumer=o,yt.ContextProvider=l,yt.Element=e,yt.ForwardRef=u,yt.Fragment=n,yt.Lazy=b,yt.Memo=p,yt.Portal=t,yt.Profiler=i,yt.StrictMode=r,yt.Suspense=f,yt.SuspenseList=h,yt.isContextConsumer=function(S){return E(S)===o},yt.isContextProvider=function(S){return E(S)===l},yt.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},yt.isForwardRef=function(S){return E(S)===u},yt.isFragment=function(S){return E(S)===n},yt.isLazy=function(S){return E(S)===b},yt.isMemo=function(S){return E(S)===p},yt.isPortal=function(S){return E(S)===t},yt.isProfiler=function(S){return E(S)===i},yt.isStrictMode=function(S){return E(S)===r},yt.isSuspense=function(S){return E(S)===f},yt.isSuspenseList=function(S){return E(S)===h},yt.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===n||S===i||S===r||S===f||S===h||typeof S=="object"&&S!==null&&(S.$$typeof===b||S.$$typeof===p||S.$$typeof===l||S.$$typeof===o||S.$$typeof===u||S.$$typeof===x||S.getModuleId!==void 0)},yt.typeOf=E,yt}var YM;function noe(){return YM||(YM=1,Gx.exports=toe()),Gx.exports}var roe=noe(),WM=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",QM=null,Yx=null,E3=e=>{if(e===QM&&Array.isArray(Yx))return Yx;var t=[];return v.Children.forEach(e,n=>{Mt(n)||(roe.isFragment(n)?t=t.concat(E3(n.props.children)):t.push(n))}),Yx=t,QM=e,t};function aj(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>WM(i)):r=[WM(t)],E3(e).forEach(i=>{var o=El(i,"type.displayName")||El(i,"type.name");o&&r.indexOf(o)!==-1&&n.push(i)}),n}var ij=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,Wx={},VM;function aoe(){if(VM)return Wx;VM=1;function e(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const i=t[Symbol.toStringTag];return i==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${i}]`}let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n}return Wx.isPlainObject=e,Wx}var Qx,XM;function ioe(){return XM||(XM=1,Qx=aoe().isPlainObject),Qx}var ooe=ioe();const soe=Ei(ooe);var ZM,JM,eR,tR,nR;function rR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function aR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rR(Object(n),!0).forEach(function(r){loe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function loe(e,t,n){return(t=coe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function coe(e){var t=uoe(e,"string");return typeof t=="symbol"?t:t+""}function uoe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fb(){return fb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fb.apply(null,arguments)}function Fd(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var iR=(e,t,n,r,i)=>{var o=n-r,l;return l=Xt(ZM||(ZM=Fd(["M ",",",""])),e,t),l+=Xt(JM||(JM=Fd(["L ",",",""])),e+n,t),l+=Xt(eR||(eR=Fd(["L ",",",""])),e+n-o/2,t+i),l+=Xt(tR||(tR=Fd(["L ",",",""])),e+n-o/2-r,t+i),l+=Xt(nR||(nR=Fd(["L ",","," Z"])),e,t),l},doe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},foe=e=>{var t=on(e,doe),{x:n,y:r,upperWidth:i,lowerWidth:o,height:l,className:u}=t,{animationEasing:f,animationDuration:h,animationBegin:p,isUpdateAnimationActive:b}=t,g=v.useRef(null),[x,E]=v.useState(-1),S=v.useRef(i),A=v.useRef(o),j=v.useRef(l),C=v.useRef(n),O=v.useRef(r),T=Ou(e,"trapezoid-");if(v.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var G=g.current.getTotalLength();G&&E(G)}catch{}},[]),n!==+n||r!==+r||i!==+i||o!==+o||l!==+l||i===0&&o===0||l===0)return null;var _=rt("recharts-trapezoid",u);if(!b)return v.createElement("g",null,v.createElement("path",fb({},or(t),{className:_,d:iR(n,r,i,o,l)})));var P=S.current,D=A.current,L=j.current,z=C.current,R=O.current,q="0px ".concat(x===-1?1:x,"px"),U="".concat(x,"px ").concat(x,"px"),re=UI(["strokeDasharray"],h,f);return v.createElement(Cu,{animationId:T,key:T,canBegin:x>0,duration:h,easing:f,isActive:b,begin:p},G=>{var ie=dt(P,i,G),K=dt(D,o,G),Z=dt(L,l,G),$=dt(z,n,G),ee=dt(R,r,G);g.current&&(S.current=ie,A.current=K,j.current=Z,C.current=$,O.current=ee);var pe=G>0?{transition:re,strokeDasharray:U}:{strokeDasharray:q};return v.createElement("path",fb({},or(t),{className:_,d:iR($,ee,ie,K,Z),ref:g,style:aR(aR({},pe),t.style)}))})},hoe=["option","shapeType","activeClassName","inActiveClassName"];function moe(e,t){if(e==null)return{};var n,r,i=poe(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function poe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function oR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oR(Object(n),!0).forEach(function(r){boe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function boe(e,t,n){return(t=voe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function voe(e){var t=goe(e,"string");return typeof t=="symbol"?t:t+""}function goe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yoe(e,t){return hb(hb({},t),e)}function xoe(e,t){return e==="symbols"}function sR(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return v.createElement($I,n);case"trapezoid":return v.createElement(foe,n);case"sector":return v.createElement(YI,n);case"symbols":if(xoe(t))return v.createElement(NE,n);break;case"curve":return v.createElement(Kc,n);default:return null}}function woe(e){return v.isValidElement(e)?e.props:e}function oj(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,o=moe(e,hoe),l;if(v.isValidElement(t))l=v.cloneElement(t,hb(hb({},o),woe(t)));else if(typeof t=="function")l=t(o,o.index);else if(soe(t)&&typeof t!="boolean"){var u=yoe(t,o);l=v.createElement(sR,{shapeType:n,elementProps:u})}else{var f=o;l=v.createElement(sR,{shapeType:n,elementProps:f})}return o.isActive?v.createElement(Ft,{className:r},l):v.createElement(Ft,{className:i},l)}var sj=(e,t,n)=>{var r=xt();return(i,o)=>l=>{e==null||e(i,o,l),r(_U({activeIndex:String(o),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},lj=e=>{var t=xt();return(n,r)=>i=>{e==null||e(n,r,i),t(One())}},cj=(e,t,n)=>{var r=xt();return(i,o)=>l=>{e==null||e(i,o,l),r(Nne({activeIndex:String(o),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function Av(e){var{tooltipEntrySettings:t}=e,n=xt(),r=Ln(),i=v.useRef(null);return v.useLayoutEffect(()=>{r||(i.current===null?n(Ene(t)):i.current!==t&&n(Ane({prev:i.current,next:t})),i.current=t)},[t,n,r]),v.useLayoutEffect(()=>()=>{i.current&&(n(jne(i.current)),i.current=null)},[n]),null}function uj(e){var{legendPayload:t}=e,n=xt(),r=Ln(),i=v.useRef(null);return v.useLayoutEffect(()=>{r||(i.current===null?n(RI(t)):i.current!==t&&n(kI({prev:i.current,next:t})),i.current=t)},[n,r,t]),v.useLayoutEffect(()=>()=>{i.current&&(n(LI(i.current)),i.current=null)},[n]),null}function Soe(e){var{legendPayload:t}=e,n=xt(),r=we(tt),i=v.useRef(null);return v.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(RI(t)):i.current!==t&&n(kI({prev:i.current,next:t})),i.current=t)},[n,r,t]),v.useLayoutEffect(()=>()=>{i.current&&(n(LI(i.current)),i.current=null)},[n]),null}var Vx,Eoe=()=>{var[e]=v.useState(()=>cf("uid-"));return e},Aoe=(Vx=LS.useId)!==null&&Vx!==void 0?Vx:Eoe;function joe(e,t){var n=Aoe();return t||(e?"".concat(e,"-").concat(n):n)}var Coe=v.createContext(void 0),jv=e=>{var{id:t,type:n,children:r}=e,i=joe("recharts-".concat(n),t);return v.createElement(Coe.Provider,{value:i},r(i))},Ooe={cartesianItems:[],polarItems:[]},A3=lr({name:"graphicalItems",initialState:Ooe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:_t()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xa(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:_t()},removeCartesianGraphicalItem:{reducer(e,t){var n=xa(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:_t()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:_t()},removePolarGraphicalItem:{reducer(e,t){var n=xa(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:_t()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xa(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:_t()}}}),{addCartesianGraphicalItem:Noe,replaceCartesianGraphicalItem:Toe,removeCartesianGraphicalItem:Poe,addPolarGraphicalItem:_oe,removePolarGraphicalItem:Doe,replacePolarGraphicalItem:Moe}=A3.actions,Roe=A3.reducer,koe=e=>{var t=xt(),n=v.useRef(null);return v.useLayoutEffect(()=>{n.current===null?t(Noe(e)):n.current!==e&&t(Toe({prev:n.current,next:e})),n.current=e},[t,e]),v.useLayoutEffect(()=>()=>{n.current&&(t(Poe(n.current)),n.current=null)},[t]),null},dj=v.memo(koe),Loe=e=>{var t=xt(),n=v.useRef(null);return v.useLayoutEffect(()=>{n.current===null?t(_oe(e)):n.current!==e&&t(Moe({prev:n.current,next:e})),n.current=e},[t,e]),v.useLayoutEffect(()=>()=>{n.current&&(t(Doe(n.current)),n.current=null)},[t]),null},Ioe=v.memo(Loe),zoe=["key"],Uoe=["onMouseEnter","onClick","onMouseLeave"],qoe=["id"],Boe=["id"];function ws(){return ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ws.apply(null,arguments)}function Cv(e,t){if(e==null)return{};var n,r,i=Foe(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Foe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function lR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lR(Object(n),!0).forEach(function(r){$oe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $oe(e,t,n){return(t=Koe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Koe(e){var t=Hoe(e,"string");return typeof t=="symbol"?t:t+""}function Hoe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Goe(e){var t=v.useMemo(()=>aj(e.children,yu),[e.children]),n=we(r=>Jie(r,e.id,t));return n==null?null:v.createElement(Soe,{legendPayload:n})}function Yoe(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(v.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var{fill:r}=e;return typeof r=="string"?r:void 0}}var Woe=v.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:o,fill:l,name:u,hide:f,tooltipType:h,id:p,activeShape:b}=e,g=Yoe(b),x=r.map(S=>{var A=S.tooltipPayload;return g==null||A==null?A:A.map(j=>Lt(Lt({},j),{},{color:g,fill:g}))}),E={dataDefinedOnItem:x,getPosition:S=>{var A;return(A=r[Number(S)])===null||A===void 0?void 0:A.tooltipPosition},settings:{stroke:i,strokeWidth:o,fill:l,dataKey:t,nameKey:n,name:As(u,t),hide:f,type:h,color:l,unit:"",graphicalItemId:p}};return v.createElement(Av,{tooltipEntrySettings:E})}),Qoe=(e,t)=>e>t?"start":e<t?"end":"middle",Voe=(e,t,n)=>ar(typeof t=="function"?t(e):t,n,n*.8),Xoe=(e,t,n)=>{var{top:r,left:i,width:o,height:l}=t,u=KI(o,l),f=i+ar(e.cx,o,o/2),h=r+ar(e.cy,l,l/2),p=ar(e.innerRadius,u,0),b=Voe(n,e.outerRadius,u),g=e.maxRadius||Math.sqrt(o*o+l*l)/2;return{cx:f,cy:h,innerRadius:p,outerRadius:b,maxRadius:g}},Zoe=(e,t)=>{var n=kn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Joe=(e,t)=>{if(v.isValidElement(e))return v.cloneElement(e,t);if(typeof e=="function")return e(t);var n=rt("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=Cv(t,zoe);return v.createElement(Kc,ws({},i,{type:"linear",className:n}))},ese=(e,t,n)=>{if(v.isValidElement(e))return v.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),v.isValidElement(r)))return r;var i=rt("recharts-pie-label-text",w3(e));return v.createElement(xv,ws({},t,{alignmentBaseline:"middle",className:i}),r)};function tse(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:o,dataKey:l}=n;if(!r||!i||!t)return null;var u=yr(n),f=wl(i),h=wl(o),p=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,b=t.map((g,x)=>{var E=(g.startAngle+g.endAngle)/2,S=hn(g.cx,g.cy,g.outerRadius+p,E),A=Lt(Lt(Lt(Lt({},u),g),{},{stroke:"none"},f),{},{index:x,textAnchor:Qoe(S.x,g.cx)},S),j=Lt(Lt(Lt(Lt({},u),g),{},{fill:"none",stroke:g.fill},h),{},{index:x,points:[hn(g.cx,g.cy,g.outerRadius,E),S],key:"line"});return v.createElement(wr,{zIndex:an.label,key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(x)},v.createElement(Ft,null,o&&Joe(o,j),ese(i,A,ot(g,l))))});return v.createElement(Ft,{className:"recharts-pie-labels"},b)}function nse(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?v.createElement(wv,{label:i}):v.createElement(tse,{sectors:t,props:n,showLabels:r})}function rse(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:o,id:l}=e,u=we(xs),f=we(QA),h=we(YU),{onMouseEnter:p,onClick:b,onMouseLeave:g}=i,x=Cv(i,Uoe),E=sj(p,i.dataKey,l),S=lj(g),A=cj(b,i.dataKey,l);return t==null||t.length===0?null:v.createElement(v.Fragment,null,t.map((j,C)=>{if((j==null?void 0:j.startAngle)===0&&(j==null?void 0:j.endAngle)===0&&t.length!==1)return null;var O=h==null||h===l,T=String(C)===u&&(f==null||i.dataKey===f)&&O,_=u?r:null,P=n&&T?n:_,D=Lt(Lt({},j),{},{stroke:j.stroke,tabIndex:-1,[xI]:C,[wI]:l});return v.createElement(Ft,ws({key:"sector-".concat(j==null?void 0:j.startAngle,"-").concat(j==null?void 0:j.endAngle,"-").concat(j.midAngle,"-").concat(C),tabIndex:-1,className:"recharts-pie-sector"},qf(x,j,C),{onMouseEnter:E(j,C),onMouseLeave:S(j,C),onClick:A(j,C)}),v.createElement(oj,ws({option:o??P,index:C,shapeType:"sector",isActive:T},D)))}))}function ase(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:o}=e,{cornerRadius:l,startAngle:u,endAngle:f,dataKey:h,nameKey:p,tooltipType:b}=n,g=Math.abs(n.minAngle),x=Zoe(u,f),E=Math.abs(x),S=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,A=r.filter(L=>ot(L,h,0)!==0).length,j=(E>=360?A:A-1)*S,C=r.reduce((L,z)=>{var R=ot(z,h,0);return L+(ye(R)?R:0)},0),O=g>0&&C>0&&r.some(L=>{var z=ot(L,h,0),R=(ye(z)?z:0)/C;return z!==0&&R*E<g}),T=O?g:0,_=E-A*T-j,P;if(C>0){var D;P=r.map((L,z)=>{var R=ot(L,h,0),q=ot(L,p,z),U=Xoe(n,o,L),re=(ye(R)?R:0)/C,G,ie=Lt(Lt({},L),i&&i[z]&&i[z].props),K=ie!=null&&"fill"in ie&&typeof ie.fill=="string"?ie.fill:n.fill;z?G=D.endAngle+kn(x)*S*(R!==0?1:0):G=u;var Z=G+kn(x)*((R!==0?T:0)+re*_),$=(G+Z)/2,ee=(U.innerRadius+U.outerRadius)/2,pe=[{name:q,value:R,payload:ie,dataKey:h,type:b,color:K,fill:K,graphicalItemId:n.id}],k=hn(U.cx,U.cy,ee,$);return D=Lt(Lt(Lt(Lt({},n.presentationProps),{},{percent:re,cornerRadius:typeof l=="string"?parseFloat(l):l,name:q,tooltipPayload:pe,midAngle:$,middleRadius:ee,tooltipPosition:k},ie),U),{},{value:R,dataKey:h,startAngle:G,endAngle:Z,payload:ie,paddingAngle:R!==0?kn(x)*S:0}),D})}return P}function ise(e){var{showLabels:t,sectors:n,children:r}=e,i=v.useMemo(()=>!t||!n?[]:n.map(o=>({value:o.value,payload:o.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:o.cx,cy:o.cy,innerRadius:o.innerRadius,outerRadius:o.outerRadius,startAngle:o.startAngle,endAngle:o.endAngle,clockWise:!1},fill:o.fill})),[n,t]);return v.createElement(Lie,{value:t?i:void 0},r)}function ose(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:o,animationBegin:l,animationDuration:u,animationEasing:f,activeShape:h,inactiveShape:p,onAnimationStart:b,onAnimationEnd:g}=t,x=Ou(t,"recharts-pie-"),E=n.current,[S,A]=v.useState(!1),j=v.useCallback(()=>{typeof g=="function"&&g(),A(!1)},[g]),C=v.useCallback(()=>{typeof b=="function"&&b(),A(!0)},[b]);return v.createElement(ise,{showLabels:!S,sectors:i},v.createElement(Cu,{animationId:x,begin:l,duration:u,isActive:o,easing:f,onAnimationStart:C,onAnimationEnd:j,key:x},O=>{var T,_=[],P=i&&i[0],D=(T=P==null?void 0:P.startAngle)!==null&&T!==void 0?T:0;return i==null||i.forEach((L,z)=>{var R=E&&E[z],q=z>0?El(L,"paddingAngle",0):0;if(R){var U=dt(R.endAngle-R.startAngle,L.endAngle-L.startAngle,O),re=Lt(Lt({},L),{},{startAngle:D+q,endAngle:D+U+q});_.push(re),D=re.endAngle}else{var{endAngle:G,startAngle:ie}=L,K=dt(0,G-ie,O),Z=Lt(Lt({},L),{},{startAngle:D+q,endAngle:D+K+q});_.push(Z),D=Z.endAngle}}),n.current=_,v.createElement(Ft,null,v.createElement(rse,{sectors:_,activeShape:h,inactiveShape:p,allOtherPieProps:t,shape:t.shape,id:r}))}),v.createElement(nse,{showLabels:!S,sectors:i,props:t}),t.children)}var sse={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:an.area};function lse(e){var{id:t}=e,n=Cv(e,qoe),{hide:r,className:i,rootTabIndex:o}=e,l=v.useMemo(()=>aj(e.children,yu),[e.children]),u=we(p=>eoe(p,t,l)),f=v.useRef(null),h=rt("recharts-pie",i);return r||u==null?(f.current=null,v.createElement(Ft,{tabIndex:o,className:h})):v.createElement(wr,{zIndex:e.zIndex},v.createElement(Woe,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:u,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),v.createElement(Ft,{tabIndex:o,className:h},v.createElement(ose,{props:Lt(Lt({},n),{},{sectors:u}),previousSectorsRef:f,id:t})))}function cse(e){var t=on(e,sse),{id:n}=t,r=Cv(t,Boe),i=yr(r);return v.createElement(jv,{id:n,type:"pie"},o=>v.createElement(v.Fragment,null,v.createElement(Ioe,{type:"pie",id:o,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),v.createElement(Goe,ws({},r,{id:o})),v.createElement(lse,ws({},r,{id:o}))))}var j3=cse;j3.displayName="Pie";var use=["points"];function cR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cR(Object(n),!0).forEach(function(r){dse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dse(e,t,n){return(t=fse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fse(e){var t=hse(e,"string");return typeof t=="symbol"?t:t+""}function hse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mb(){return mb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mb.apply(null,arguments)}function mse(e,t){if(e==null)return{};var n,r,i=pse(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function pse(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function bse(e){var{option:t,dotProps:n,className:r}=e;if(v.isValidElement(t))return v.cloneElement(t,n);if(typeof t=="function")return t(n);var i=rt(r,typeof t!="boolean"?t.className:""),o=n??{},{points:l}=o,u=mse(o,use);return v.createElement(v3,mb({},u,{className:i}))}function vse(e,t){return e==null?!1:t?!0:e.length===1}function C3(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:o,baseProps:l,needClip:u,clipPathId:f,zIndex:h=an.scatter}=e;if(!vse(t,n))return null;var p=ij(n),b=ZY(n),g=t.map((E,S)=>{var A,j,C=Xx(Xx(Xx({r:3},l),b),{},{index:S,cx:(A=E.x)!==null&&A!==void 0?A:void 0,cy:(j=E.y)!==null&&j!==void 0?j:void 0,dataKey:o,value:E.value,payload:E.payload,points:t});return v.createElement(bse,{key:"dot-".concat(S),option:n,dotProps:C,className:i})}),x={};return u&&f!=null&&(x.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(f,")")),v.createElement(wr,{zIndex:h},v.createElement(Ft,mb({className:r},x),g))}function uR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uR(Object(n),!0).forEach(function(r){gse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gse(e,t,n){return(t=yse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yse(e){var t=xse(e,"string");return typeof t=="symbol"?t:t+""}function xse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var O3=0,wse={xAxis:{},yAxis:{},zAxis:{}},N3=lr({name:"cartesianAxis",initialState:wse,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:_t()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:_t()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:_t()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:_t()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:_t()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:_t()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:_t()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:_t()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:_t()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var o,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((o=l[0])!==null&&o!==void 0?o:0))<=1)return;var u=[...l,r].slice(-3);e.yAxis[n]=dR(dR({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:Sse,replaceXAxis:Ese,removeXAxis:Ase,addYAxis:jse,replaceYAxis:Cse,removeYAxis:Ose,addZAxis:khe,replaceZAxis:Lhe,removeZAxis:Ihe,updateYAxisWidth:Nse}=N3.actions,Tse=N3.reducer,Pse=W([En],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),_se=W([Pse,vo,go],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),Ov=()=>we(_se),Dse=()=>we(Sre);function fR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fR(Object(n),!0).forEach(function(r){Mse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mse(e,t,n){return(t=Rse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rse(e){var t=kse(e,"string");return typeof t=="symbol"?t:t+""}function kse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lse=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:o,clipPath:l}=e;if(i===!1||t.x==null||t.y==null)return null;var u={index:n,dataKey:o,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=Zx(Zx(Zx({},u),wl(i)),TE(i)),h;return v.isValidElement(i)?h=v.cloneElement(i,f):typeof i=="function"?h=i(f):h=v.createElement(v3,f),v.createElement(Ft,{className:"recharts-active-dot",clipPath:l},h)};function AS(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:o,zIndex:l=an.activeDot}=e,u=we(xs),f=Dse();if(t==null||f==null)return null;var h=t.find(p=>f.includes(p.payload));return Mt(h)?null:v.createElement(wr,{zIndex:l},v.createElement(Lse,{point:h,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:o}))}var hR=(e,t,n)=>{var r=n??e;if(!Mt(r))return ar(r,t,0)},Ise=(e,t,n)=>{var r={},i=e.filter(ov),o=e.filter(h=>h.stackId==null),l=i.reduce((h,p)=>{var b=h[p.stackId];return b==null&&(b=[]),b.push(p),h[p.stackId]=b,h},r),u=Object.entries(l).map(h=>{var p,[b,g]=h,x=g.map(S=>S.dataKey),E=hR(t,n,(p=g[0])===null||p===void 0?void 0:p.barSize);return{stackId:b,dataKeys:x,barSize:E}}),f=o.map(h=>{var p=[h.dataKey].filter(g=>g!=null),b=hR(t,n,h.barSize);return{stackId:void 0,dataKeys:p,barSize:b}});return[...u,...f]};function mR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mR(Object(n),!0).forEach(function(r){zse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zse(e,t,n){return(t=Use(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Use(e){var t=qse(e,"string");return typeof t=="symbol"?t:t+""}function qse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bse(e,t,n,r,i){var o,l=r.length;if(!(l<1)){var u=ar(e,n,0,!0),f,h=[];if(Ye((o=r[0])===null||o===void 0?void 0:o.barSize)){var p=!1,b=n/l,g=r.reduce((C,O)=>C+(O.barSize||0),0);g+=(l-1)*u,g>=n&&(g-=(l-1)*u,u=0),g>=n&&b>0&&(p=!0,b*=.9,g=l*b);var x=(n-g)/2>>0,E={offset:x-u,size:0};f=r.reduce((C,O)=>{var T,_={stackId:O.stackId,dataKeys:O.dataKeys,position:{offset:E.offset+E.size+u,size:p?b:(T=O.barSize)!==null&&T!==void 0?T:0}},P=[...C,_];return E=_.position,P},h)}else{var S=ar(t,n,0,!0);n-2*S-(l-1)*u<=0&&(u=0);var A=(n-2*S-(l-1)*u)/l;A>1&&(A>>=0);var j=Ye(i)?Math.min(A,i):A;f=r.reduce((C,O,T)=>[...C,{stackId:O.stackId,dataKeys:O.dataKeys,position:{offset:S+(A+u)*T+(A-j)/2,size:j}}],h)}return f}}var Fse=(e,t,n,r,i,o,l)=>{var u=Mt(l)?t:l,f=Bse(n,r,i!==o?i:o,e,u);return i!==o&&f!=null&&(f=f.map(h=>Qm(Qm({},h),{},{position:Qm(Qm({},h.position),{},{offset:h.position.offset-i/2})}))),f},$se=(e,t)=>{var n=iv(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:o}=i;if(o)return o.find(l=>l.key===n)}}}},Kse=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function Hse(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Ye(e.zIndex)?e.zIndex:t}var T3=e=>{var{chartData:t}=e,n=xt(),r=Ln();return v.useEffect(()=>r?()=>{}:(n(AM(t)),()=>{n(AM(void 0))}),[t,n,r]),null},pR={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},P3=lr({name:"brush",initialState:pR,reducers:{setBrushSettings(e,t){return t.payload==null?pR:t.payload}}}),{setBrushSettings:zhe}=P3.actions,Gse=P3.reducer;function Yse(e){return(e%180+180)%180}var Wse=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Yse(i),l=o*Math.PI/180,u=Math.atan(r/n),f=l>u&&l<Math.PI-u?r/Math.sin(l):n/Math.cos(l);return Math.abs(f)},Qse={dots:[],areas:[],lines:[]},_3=lr({name:"referenceElements",initialState:Qse,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=xa(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=xa(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=xa(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Uhe,removeDot:qhe,addArea:Bhe,removeArea:Fhe,addLine:$he,removeLine:Khe}=_3.actions,Vse=_3.reducer,Xse=v.createContext(void 0),Zse=e=>{var{children:t}=e,[n]=v.useState("".concat(cf("recharts"),"-clip")),r=Ov();if(r==null)return null;var{x:i,y:o,width:l,height:u}=r;return v.createElement(Xse.Provider,{value:n},v.createElement("defs",null,v.createElement("clipPath",{id:n},v.createElement("rect",{x:i,y:o,height:u,width:l}))),t)};function D3(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function Jse(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Wse(r,n)}function ele(e,t,n){var r=n==="width",{x:i,y:o,width:l,height:u}=e;return t===1?{start:r?i:o,end:r?i+l:o+u}:{start:r?i+l:o+u,end:r?i:o}}function Ef(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function tle(e,t){return D3(e,t+1)}function nle(e,t,n,r,i){for(var o=(r||[]).slice(),{start:l,end:u}=t,f=0,h=1,p=l,b=function(){var E=r==null?void 0:r[f];if(E===void 0)return{v:D3(r,h)};var S=f,A,j=()=>(A===void 0&&(A=n(E,S)),A),C=E.coordinate,O=f===0||Ef(e,C,j,p,u);O||(f=0,p=l,h+=1),O&&(p=C+e*(j()/2+i),f+=h)},g;h<=o.length;)if(g=b(),g)return g.v;return[]}function rle(e,t,n,r,i){var o=(r||[]).slice(),l=o.length;if(l===0)return[];for(var{start:u,end:f}=t,h=1;h<=l;h++){for(var p=(l-1)%h,b=u,g=!0,x=function(){var T=r[S];if(T==null)return 0;var _=S,P,D=()=>(P===void 0&&(P=n(T,_)),P),L=T.coordinate,z=S===p||Ef(e,L,D,b,f);if(!z)return g=!1,1;z&&(b=L+e*(D()/2+i))},E,S=p;S<l&&(E=x(),!(E!==0&&E===1));S+=h);if(g){for(var A=[],j=p;j<l;j+=h){var C=r[j];C!=null&&A.push(C)}return A}}return[]}function bR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bR(Object(n),!0).forEach(function(r){ale(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ale(e,t,n){return(t=ile(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ile(e){var t=ole(e,"string");return typeof t=="symbol"?t:t+""}function ole(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sle(e,t,n,r,i){for(var o=(r||[]).slice(),l=o.length,{start:u}=t,{end:f}=t,h=function(g){var x=o[g];if(x==null)return 1;var E=x,S,A=()=>(S===void 0&&(S=n(x,g)),S);if(g===l-1){var j=e*(E.coordinate+e*A()/2-f);o[g]=E=nr(nr({},E),{},{tickCoord:j>0?E.coordinate-j*e:E.coordinate})}else o[g]=E=nr(nr({},E),{},{tickCoord:E.coordinate});if(E.tickCoord!=null){var C=Ef(e,E.tickCoord,A,u,f);C&&(f=E.tickCoord-e*(A()/2+i),o[g]=nr(nr({},E),{},{isShow:!0}))}},p=l-1;p>=0;p--)h(p);return o}function lle(e,t,n,r,i,o){var l=(r||[]).slice(),u=l.length,{start:f,end:h}=t;if(o){var p=r[u-1];if(p!=null){var b=n(p,u-1),g=e*(p.coordinate+e*b/2-h);if(l[u-1]=p=nr(nr({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate}),p.tickCoord!=null){var x=Ef(e,p.tickCoord,()=>b,f,h);x&&(h=p.tickCoord-e*(b/2+i),l[u-1]=nr(nr({},p),{},{isShow:!0}))}}}for(var E=o?u-1:u,S=function(C){var O=l[C];if(O==null)return 1;var T=O,_,P=()=>(_===void 0&&(_=n(O,C)),_);if(C===0){var D=e*(T.coordinate-e*P()/2-f);l[C]=T=nr(nr({},T),{},{tickCoord:D<0?T.coordinate-D*e:T.coordinate})}else l[C]=T=nr(nr({},T),{},{tickCoord:T.coordinate});if(T.tickCoord!=null){var L=Ef(e,T.tickCoord,P,f,h);L&&(f=T.tickCoord+e*(P()/2+i),l[C]=nr(nr({},T),{},{isShow:!0}))}},A=0;A<E;A++)S(A);return l}function fj(e,t,n){var{tick:r,ticks:i,viewBox:o,minTickGap:l,orientation:u,interval:f,tickFormatter:h,unit:p,angle:b}=e;if(!i||!i.length||!r)return[];if(ye(f)||Gf.isSsr){var g;return(g=tle(i,ye(f)?f:0))!==null&&g!==void 0?g:[]}var x=[],E=u==="top"||u==="bottom"?"width":"height",S=p&&E==="width"?nf(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},A=(_,P)=>{var D=typeof h=="function"?h(_.value,P):_.value;return E==="width"?Jse(nf(D,{fontSize:t,letterSpacing:n}),S,b):nf(D,{fontSize:t,letterSpacing:n})[E]},j=i[0],C=i[1],O=i.length>=2&&j!=null&&C!=null?kn(C.coordinate-j.coordinate):1,T=ele(o,O,E);return f==="equidistantPreserveStart"?nle(O,T,A,i,l):f==="equidistantPreserveEnd"?rle(O,T,A,i,l):(f==="preserveStart"||f==="preserveStartEnd"?x=lle(O,T,A,i,l,f==="preserveStartEnd"):x=sle(O,T,A,i,l),x.filter(_=>_.isShow))}var cle=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:o=0}=e,l=0;if(t){Array.from(t).forEach(p=>{if(p){var b=p.getBoundingClientRect();b.width>l&&(l=b.width)}});var u=n?n.getBoundingClientRect().width:0,f=i+o,h=l+f+u+(n?r:0);return Math.round(h)}return 0},ule={xAxis:{},yAxis:{}},M3=lr({name:"renderedTicks",initialState:ule,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:dle,removeRenderedTicks:fle}=M3.actions,hle=M3.reducer,mle=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function ple(e,t){if(e==null)return{};var n,r,i=ble(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ble(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Pl(){return Pl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pl.apply(null,arguments)}function vR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vR(Object(n),!0).forEach(function(r){vle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vle(e,t,n){return(t=gle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gle(e){var t=yle(e,"string");return typeof t=="symbol"?t:t+""}function yle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var co={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:an.axis};function xle(e){var{x:t,y:n,width:r,height:i,orientation:o,mirror:l,axisLine:u,otherSvgProps:f}=e;if(!u)return null;var h=Vt(Vt(Vt({},f),yr(u)),{},{fill:"none"});if(o==="top"||o==="bottom"){var p=+(o==="top"&&!l||o==="bottom"&&l);h=Vt(Vt({},h),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var b=+(o==="left"&&!l||o==="right"&&l);h=Vt(Vt({},h),{},{x1:t+b*r,y1:n,x2:t+b*r,y2:n+i})}return v.createElement("line",Pl({},h,{className:rt("recharts-cartesian-axis-line",El(u,"className"))}))}function wle(e,t,n,r,i,o,l,u,f){var h,p,b,g,x,E,S=u?-1:1,A=e.tickSize||l,j=ye(e.tickCoord)?e.tickCoord:e.coordinate;switch(o){case"top":h=p=e.coordinate,g=n+ +!u*i,b=g-S*A,E=b-S*f,x=j;break;case"left":b=g=e.coordinate,p=t+ +!u*r,h=p-S*A,x=h-S*f,E=j;break;case"right":b=g=e.coordinate,p=t+ +u*r,h=p+S*A,x=h+S*f,E=j;break;default:h=p=e.coordinate,g=n+ +u*i,b=g+S*A,E=b+S*f,x=j;break}return{line:{x1:h,y1:b,x2:p,y2:g},tick:{x,y:E}}}function Sle(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function Ele(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Ale(e){var{option:t,tickProps:n,value:r}=e,i,o=rt(n.className,"recharts-cartesian-axis-tick-value");if(v.isValidElement(t))i=v.cloneElement(t,Vt(Vt({},n),{},{className:o}));else if(typeof t=="function")i=t(Vt(Vt({},n),{},{className:o}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=rt(l,w3(t))),i=v.createElement(xv,Pl({},n,{className:l}),r)}return i}function jle(e){var{ticks:t,axisType:n,axisId:r}=e,i=xt();return v.useEffect(()=>{if(r==null||n==null)return Es;var o=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(dle({ticks:o,axisId:r,axisType:n})),()=>{i(fle({axisId:r,axisType:n}))}},[i,t,r,n]),null}var Cle=v.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:o,tickFormatter:l,unit:u,padding:f,tickTextProps:h,orientation:p,mirror:b,x:g,y:x,width:E,height:S,tickSize:A,tickMargin:j,fontSize:C,letterSpacing:O,getTicksConfig:T,events:_,axisType:P,axisId:D}=e,L=fj(Vt(Vt({},T),{},{ticks:n}),C,O),z=yr(T),R=wl(r),q=c3(z.textAnchor)?z.textAnchor:Sle(p,b),U=Ele(p,b),re={};typeof i=="object"&&(re=i);var G=Vt(Vt({},z),{},{fill:"none"},re),ie=L.map($=>Vt({entry:$},wle($,g,x,E,S,p,A,b,j))),K=ie.map($=>{var{entry:ee,line:pe}=$;return v.createElement(Ft,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(ee.value,"-").concat(ee.coordinate,"-").concat(ee.tickCoord)},i&&v.createElement("line",Pl({},G,pe,{className:rt("recharts-cartesian-axis-tick-line",El(i,"className"))})))}),Z=ie.map(($,ee)=>{var pe,k,{entry:Q,tick:ce}=$,fe=Vt(Vt(Vt(Vt({verticalAnchor:U},z),{},{textAnchor:q,stroke:"none",fill:o},ce),{},{index:ee,payload:Q,visibleTicksCount:L.length,tickFormatter:l,padding:f},h),{},{angle:(pe=(k=h==null?void 0:h.angle)!==null&&k!==void 0?k:z.angle)!==null&&pe!==void 0?pe:0}),xe=Vt(Vt({},fe),R);return v.createElement(Ft,Pl({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},qf(_,Q,ee)),r&&v.createElement(Ale,{option:r,tickProps:xe,value:"".concat(typeof l=="function"?l(Q.value,ee):Q.value).concat(u||"")}))});return v.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(P,"-ticks")},v.createElement(jle,{ticks:L,axisId:D,axisType:P}),Z.length>0&&v.createElement(wr,{zIndex:an.label},v.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(P,"-tick-labels"),ref:t},Z)),K.length>0&&v.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(P,"-tick-lines")},K))}),Ole=v.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:o,hide:l,ticks:u,axisType:f,axisId:h}=e,p=ple(e,mle),[b,g]=v.useState(""),[x,E]=v.useState(""),S=v.useRef(null);v.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var j;return cle({ticks:S.current,label:(j=e.labelRef)===null||j===void 0?void 0:j.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var A=v.useCallback(j=>{if(j){var C=j.getElementsByClassName("recharts-cartesian-axis-tick-value");S.current=C;var O=C[0];if(O){var T=window.getComputedStyle(O),_=T.fontSize,P=T.letterSpacing;(_!==b||P!==x)&&(g(_),E(P))}}},[b,x]);return l||r!=null&&r<=0||i!=null&&i<=0?null:v.createElement(wr,{zIndex:e.zIndex},v.createElement(Ft,{className:rt("recharts-cartesian-axis",o)},v.createElement(xle,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:yr(e)}),v.createElement(Cle,{ref:A,axisType:f,events:p,fontSize:b,getTicksConfig:e,height:e.height,letterSpacing:x,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),v.createElement(wie,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},v.createElement(_ie,{label:e.label,labelRef:e.labelRef}),e.children)))}),hj=v.forwardRef((e,t)=>{var n=on(e,co);return v.createElement(Ole,Pl({},n,{ref:t}))});hj.displayName="CartesianAxis";var Nle=["x1","y1","x2","y2","key"],Tle=["offset"],Ple=["xAxisId","yAxisId"],_le=["xAxisId","yAxisId"];function gR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gR(Object(n),!0).forEach(function(r){Dle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dle(e,t,n){return(t=Mle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mle(e){var t=Rle(e,"string");return typeof t=="symbol"?t:t+""}function Rle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function il(){return il=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},il.apply(null,arguments)}function pb(e,t){if(e==null)return{};var n,r,i=kle(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Lle=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:o,height:l,ry:u}=e;return v.createElement("rect",{x:r,y:i,ry:u,width:o,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function R3(e){var{option:t,lineItemProps:n}=e,r;if(v.isValidElement(t))r=v.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:o,y1:l,x2:u,y2:f,key:h}=n,p=pb(n,Nle),b=(i=yr(p))!==null&&i!==void 0?i:{},{offset:g}=b,x=pb(b,Tle);r=v.createElement("line",il({},x,{x1:o,y1:l,x2:u,y2:f,fill:"none",key:h}))}return r}function Ile(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:o,yAxisId:l}=e,u=pb(e,Ple),f=i.map((h,p)=>{var b=rr(rr({},u),{},{x1:t,y1:h,x2:t+n,y2:h,key:"line-".concat(p),index:p});return v.createElement(R3,{key:"line-".concat(p),option:r,lineItemProps:b})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},f)}function zle(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:o,yAxisId:l}=e,u=pb(e,_le),f=i.map((h,p)=>{var b=rr(rr({},u),{},{x1:h,y1:t,x2:h,y2:t+n,key:"line-".concat(p),index:p});return v.createElement(R3,{option:r,lineItemProps:b,key:"line-".concat(p)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},f)}function Ule(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:o,height:l,horizontalPoints:u,horizontal:f=!0}=e;if(!f||!t||!t.length||u==null)return null;var h=u.map(b=>Math.round(b+i-i)).sort((b,g)=>b-g);i!==h[0]&&h.unshift(0);var p=h.map((b,g)=>{var x=h[g+1],E=x==null,S=E?i+l-b:x-b;if(S<=0)return null;var A=g%t.length;return v.createElement("rect",{key:"react-".concat(g),y:b,x:r,height:S,width:o,stroke:"none",fill:t[A],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function qle(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:o,width:l,height:u,verticalPoints:f}=e;if(!t||!n||!n.length)return null;var h=f.map(b=>Math.round(b+i-i)).sort((b,g)=>b-g);i!==h[0]&&h.unshift(0);var p=h.map((b,g)=>{var x=h[g+1],E=x==null,S=E?i+l-b:x-b;if(S<=0)return null;var A=g%n.length;return v.createElement("rect",{key:"react-".concat(g),x:b,y:o,width:S,height:u,stroke:"none",fill:n[A],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Ble=(e,t)=>{var{xAxis:n,width:r,height:i,offset:o}=e;return bI(fj(rr(rr(rr({},co),n),{},{ticks:vI(n),viewBox:{x:0,y:0,width:r,height:i}})),o.left,o.left+o.width,t)},Fle=(e,t)=>{var{yAxis:n,width:r,height:i,offset:o}=e;return bI(fj(rr(rr(rr({},co),n),{},{ticks:vI(n),viewBox:{x:0,y:0,width:r,height:i}})),o.top,o.top+o.height,t)},$le={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:an.grid};function lp(e){var t=BE(),n=FE(),r=jI(),i=rr(rr({},on(e,$le)),{},{x:ye(e.x)?e.x:r.left,y:ye(e.y)?e.y:r.top,width:ye(e.width)?e.width:r.width,height:ye(e.height)?e.height:r.height}),{xAxisId:o,yAxisId:l,x:u,y:f,width:h,height:p,syncWithTicks:b,horizontalValues:g,verticalValues:x}=i,E=Ln(),S=we(z=>dM(z,"xAxis",o,E)),A=we(z=>dM(z,"yAxis",l,E));if(!gi(h)||!gi(p)||!ye(u)||!ye(f))return null;var j=i.verticalCoordinatesGenerator||Ble,C=i.horizontalCoordinatesGenerator||Fle,{horizontalPoints:O,verticalPoints:T}=i;if((!O||!O.length)&&typeof C=="function"){var _=g&&g.length,P=C({yAxis:A?rr(rr({},A),{},{ticks:_?g:A.ticks}):void 0,width:t??h,height:n??p,offset:r},_?!0:b);Up(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(O=P)}if((!T||!T.length)&&typeof j=="function"){var D=x&&x.length,L=j({xAxis:S?rr(rr({},S),{},{ticks:D?x:S.ticks}):void 0,width:t??h,height:n??p,offset:r},D?!0:b);Up(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof L,"]")),Array.isArray(L)&&(T=L)}return v.createElement(wr,{zIndex:i.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(Lle,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),v.createElement(Ule,il({},i,{horizontalPoints:O})),v.createElement(qle,il({},i,{verticalPoints:T})),v.createElement(Ile,il({},i,{offset:r,horizontalPoints:O,xAxis:S,yAxis:A})),v.createElement(zle,il({},i,{offset:r,verticalPoints:T,xAxis:S,yAxis:A}))))}lp.displayName="CartesianGrid";var Kle={},k3=lr({name:"errorBars",initialState:Kle,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(o=>o.dataKey===r.dataKey&&o.direction===r.direction?i:o))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:Hhe,replaceErrorBar:Ghe,removeErrorBar:Yhe}=k3.actions,Hle=k3.reducer,Gle=["children"];function Yle(e,t){if(e==null)return{};var n,r,i=Wle(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Wle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Qle={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Vle=v.createContext(Qle);function L3(e){var{children:t}=e,n=Yle(e,Gle);return v.createElement(Vle.Provider,{value:n},t)}function Nv(e,t){var n,r,i=we(h=>xo(h,e)),o=we(h=>wo(h,t)),l=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:gn.allowDataOverflow,u=(r=o==null?void 0:o.allowDataOverflow)!==null&&r!==void 0?r:yn.allowDataOverflow,f=l||u;return{needClip:f,needClipX:l,needClipY:u}}function mj(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=Ov(),{needClipX:o,needClipY:l,needClip:u}=Nv(t,n);if(!u||!i)return null;var{x:f,y:h,width:p,height:b}=i;return v.createElement("clipPath",{id:"clipPath-".concat(r)},v.createElement("rect",{x:o?f:f-p/2,y:l?h:h-b/2,width:o?p:p*2,height:l?b:b*2}))}var I3=(e,t,n,r)=>Si(e,"xAxis",t,r),z3=(e,t,n,r)=>wi(e,"xAxis",t,r),U3=(e,t,n,r)=>Si(e,"yAxis",n,r),q3=(e,t,n,r)=>wi(e,"yAxis",n,r),Xle=W([tt,I3,U3,z3,q3],(e,t,n,r,i)=>Ha(e,"xAxis")?ys(t,r,!1):ys(n,i,!1)),Zle=(e,t,n,r,i)=>i;function Jle(e){return e.type==="line"}var ece=W([th,Zle],(e,t)=>e.filter(Jle).find(n=>n.id===t)),tce=W([tt,I3,U3,z3,q3,ece,Xle,Wf],(e,t,n,r,i,o,l,u)=>{var{chartData:f,dataStartIndex:h,dataEndIndex:p}=u;if(!(o==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:b,data:g}=o,x;if(g!=null&&g.length>0?x=g:x=f==null?void 0:f.slice(h,p+1),x!=null)return wce({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:b,bandSize:l,displayedData:x})}});function B3(e){var t=wl(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:o}=t,l=Number(i),u=Number(o);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(u)||u<0)&&(u=r),{r:l,strokeWidth:u}}return{r:n,strokeWidth:r}}var nce=["id"],rce=["type","layout","connectNulls","needClip","shape"],ace=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Af(){return Af=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Af.apply(null,arguments)}function yR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ui(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yR(Object(n),!0).forEach(function(r){ice(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ice(e,t,n){return(t=oce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oce(e){var t=sce(e,"string");return typeof t=="symbol"?t:t+""}function sce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pj(e,t){if(e==null)return{};var n,r,i=lce(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function lce(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var cce=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:o}=e;return[{inactive:o,dataKey:t,type:i,color:r,value:As(n,t),payload:e}]},uce=v.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:o,name:l,hide:u,unit:f,tooltipType:h,id:p}=e,b={dataDefinedOnItem:n,getPosition:Es,settings:{stroke:r,strokeWidth:i,fill:o,dataKey:t,nameKey:void 0,name:As(l,t),hide:u,type:h,color:r,unit:f,graphicalItemId:p}};return v.createElement(Av,{tooltipEntrySettings:b})}),F3=(e,t)=>"".concat(t,"px ").concat(e,"px");function dce(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var fce=(e,t,n)=>{var r=n.reduce((g,x)=>g+x,0);if(!r)return F3(t,e);for(var i=Math.floor(e/r),o=e%r,l=[],u=0,f=0;u<n.length;f+=(h=n[u])!==null&&h!==void 0?h:0,++u){var h,p=n[u];if(p!=null&&f+p>o){l=[...n.slice(0,u),o-f];break}}var b=l.length%2===0?[0,t]:[t];return[...dce(n,i),...l,...b].map(g=>"".concat(g,"px")).join(", ")};function hce(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:o,needClip:l}=r,{id:u}=r,f=pj(r,nce),h=yr(f);return v.createElement(C3,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:o,baseProps:h,needClip:l,clipPathId:t})}function mce(e){var{showLabels:t,children:n,points:r}=e,i=v.useMemo(()=>r==null?void 0:r.map(o=>{var l,u,f={x:(l=o.x)!==null&&l!==void 0?l:0,y:(u=o.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ui(ui({},f),{},{value:o.value,payload:o.payload,viewBox:f,parentViewBox:void 0,fill:void 0})}),[r]);return v.createElement(tj,{value:t?i:void 0},n)}function xR(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:o}=e,{type:l,layout:u,connectNulls:f,needClip:h,shape:p}=o,b=pj(o,rce),g=ui(ui({},or(b)),{},{fill:"none",className:"recharts-line-curve",clipPath:h?"url(#clipPath-".concat(t,")"):void 0,points:r,type:l,layout:u,connectNulls:f,strokeDasharray:i??o.strokeDasharray});return v.createElement(v.Fragment,null,(r==null?void 0:r.length)>1&&v.createElement(oj,Af({shapeType:"curve",option:p},g,{pathRef:n})),v.createElement(hce,{points:r,clipPathId:t,props:o}))}function pce(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function bce(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:o}=e,{points:l,strokeDasharray:u,isAnimationActive:f,animationBegin:h,animationDuration:p,animationEasing:b,animateNewValues:g,width:x,height:E,onAnimationEnd:S,onAnimationStart:A}=n,j=i.current,C=Ou(l,"recharts-line-"),O=v.useRef(C),[T,_]=v.useState(!1),P=!T,D=v.useCallback(()=>{typeof S=="function"&&S(),_(!1)},[S]),L=v.useCallback(()=>{typeof A=="function"&&A(),_(!0)},[A]),z=pce(r.current),R=v.useRef(0);O.current!==C&&(R.current=o.current,O.current=C);var q=R.current;return v.createElement(mce,{points:l,showLabels:P},n.children,v.createElement(Cu,{animationId:C,begin:h,duration:p,isActive:f,easing:b,onAnimationEnd:D,onAnimationStart:L,key:C},U=>{var re=dt(q,z+q,U),G=Math.min(re,z),ie;if(f)if(u){var K="".concat(u).split(/[,\s]+/gim).map(ee=>parseFloat(ee));ie=fce(G,z,K)}else ie=F3(z,G);else ie=u==null?void 0:String(u);if(U>0&&z>0&&(i.current=l,o.current=Math.max(o.current,G)),j){var Z=j.length/l.length,$=U===1?l:l.map((ee,pe)=>{var k=Math.floor(pe*Z);if(j[k]){var Q=j[k];return ui(ui({},ee),{},{x:dt(Q.x,ee.x,U),y:dt(Q.y,ee.y,U)})}return g?ui(ui({},ee),{},{x:dt(x*2,ee.x,U),y:dt(E/2,ee.y,U)}):ui(ui({},ee),{},{x:ee.x,y:ee.y})});return i.current=$,v.createElement(xR,{props:n,points:$,clipPathId:t,pathRef:r,strokeDasharray:ie})}return v.createElement(xR,{props:n,points:l,clipPathId:t,pathRef:r,strokeDasharray:ie})}),v.createElement(wv,{label:n.label}))}function vce(e){var{clipPathId:t,props:n}=e,r=v.useRef(null),i=v.useRef(0),o=v.useRef(null);return v.createElement(bce,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:o})}var gce=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:ot(e.payload,t)}};class yce extends v.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:o,yAxisId:l,top:u,left:f,width:h,height:p,id:b,needClip:g,zIndex:x}=this.props;if(t)return null;var E=rt("recharts-line",i),S=b,{r:A,strokeWidth:j}=B3(n),C=ij(n),O=A*2+j,T=g?"url(#clipPath-".concat(C?"":"dots-").concat(S,")"):void 0;return v.createElement(wr,{zIndex:x},v.createElement(Ft,{className:E},g&&v.createElement("defs",null,v.createElement(mj,{clipPathId:S,xAxisId:o,yAxisId:l}),!C&&v.createElement("clipPath",{id:"clipPath-dots-".concat(S)},v.createElement("rect",{x:f-O/2,y:u-O/2,width:h+O,height:p+O}))),v.createElement(L3,{xAxisId:o,yAxisId:l,data:r,dataPointFormatter:gce,errorBarOffset:0},v.createElement(vce,{props:this.props,clipPathId:S}))),v.createElement(AS,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:T}))}}var $3={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:an.line,type:"linear"};function xce(e){var t=on(e,$3),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:o,animationEasing:l,connectNulls:u,dot:f,hide:h,isAnimationActive:p,label:b,legendType:g,xAxisId:x,yAxisId:E,id:S}=t,A=pj(t,ace),{needClip:j}=Nv(x,E),C=Ov(),O=js(),T=Ln(),_=we(R=>tce(R,x,E,T,S));if(O!=="horizontal"&&O!=="vertical"||_==null||C==null)return null;var{height:P,width:D,x:L,y:z}=C;return v.createElement(yce,Af({},A,{id:S,connectNulls:u,dot:f,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:o,animationEasing:l,isAnimationActive:p,hide:h,label:b,legendType:g,xAxisId:x,yAxisId:E,points:_,layout:O,height:P,width:D,left:L,top:z,needClip:j}))}function wce(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:o,dataKey:l,bandSize:u,displayedData:f}=e;return f.map((h,p)=>{var b=ot(h,l);if(t==="horizontal"){var g=zp({axis:n,ticks:i,bandSize:u,entry:h,index:p}),x=Mt(b)?null:r.scale.map(b);return{x:g,y:x??null,value:b,payload:h}}var E=Mt(b)?null:n.scale.map(b),S=zp({axis:r,ticks:o,bandSize:u,entry:h,index:p});return E==null||S==null?null:{x:E,y:S,value:b,payload:h}}).filter(Boolean)}function Sce(e){var t=on(e,$3),n=Ln();return v.createElement(jv,{id:t.id,type:"line"},r=>v.createElement(v.Fragment,null,v.createElement(uj,{legendPayload:cce(t)}),v.createElement(uce,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),v.createElement(dj,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),v.createElement(xce,Af({},t,{id:r}))))}var K3=v.memo(Sce,Ml);K3.displayName="Line";function ji(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:O3}function Ci(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:O3}var H3=(e,t,n)=>Si(e,"xAxis",ji(e,t),n),G3=(e,t,n)=>wi(e,"xAxis",ji(e,t),n),Y3=(e,t,n)=>Si(e,"yAxis",Ci(e,t),n),W3=(e,t,n)=>wi(e,"yAxis",Ci(e,t),n),Ece=W([tt,H3,Y3,G3,W3],(e,t,n,r,i)=>Ha(e,"xAxis")?ys(t,r,!1):ys(n,i,!1)),Ace=(e,t)=>t,Q3=W([th,Ace],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),V3=e=>{var t=tt(e),n=Ha(t,"xAxis");return n?"yAxis":"xAxis"},jce=(e,t)=>{var n=V3(e);return n==="yAxis"?Ci(e,t):ji(e,t)},Cce=(e,t,n)=>sb(e,V3(e),jce(e,t),n),Oce=W([Q3,Cce],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=iv(e);if(!(r==null||i==null)){var o=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=o==null?void 0:o.find(u=>u.key===i);if(l!=null)return l.map(u=>[u[0],u[1]])}}}),Nce=W([tt,H3,Y3,G3,W3,Oce,QI,Ece,Q3,DZ],(e,t,n,r,i,o,l,u,f,h)=>{var{chartData:p,dataStartIndex:b,dataEndIndex:g}=l;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||u==null)){var{data:x}=f,E;if(x&&x.length>0?E=x:E=p==null?void 0:p.slice(b,g+1),E!=null)return Wce({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:b,areaSettings:f,stackedData:o,displayedData:E,chartBaseValue:h,bandSize:u})}}),Tce=["id"],Pce=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function gl(){return gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gl.apply(null,arguments)}function X3(e,t){if(e==null)return{};var n,r,i=_ce(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _ce(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function wR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Uc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wR(Object(n),!0).forEach(function(r){Dce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dce(e,t,n){return(t=Mce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mce(e){var t=Rce(e,"string");return typeof t=="symbol"?t:t+""}function Rce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bb(e,t){return e&&e!=="none"?e:t}var kce=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:o,hide:l}=e;return[{inactive:l,dataKey:t,type:o,color:bb(r,i),value:As(n,t),payload:e}]},Lce=v.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:o,name:l,hide:u,unit:f,tooltipType:h,id:p}=e,b={dataDefinedOnItem:n,getPosition:Es,settings:{stroke:r,strokeWidth:i,fill:o,dataKey:t,nameKey:void 0,name:As(l,t),hide:u,type:h,color:bb(r,o),unit:f,graphicalItemId:p}};return v.createElement(Av,{tooltipEntrySettings:b})});function Ice(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:o,dataKey:l}=r,u=yr(r);return v.createElement(C3,{points:n,dot:o,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:u,needClip:i,clipPathId:t})}function zce(e){var{showLabels:t,children:n,points:r}=e,i=r.map(o=>{var l,u,f={x:(l=o.x)!==null&&l!==void 0?l:0,y:(u=o.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Uc(Uc({},f),{},{value:o.value,payload:o.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return v.createElement(tj,{value:t?i:void 0},n)}function SR(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:o}=e,{layout:l,type:u,stroke:f,connectNulls:h,isRange:p}=o,{id:b}=o,g=X3(o,Tce),x=yr(g),E=or(g);return v.createElement(v.Fragment,null,(t==null?void 0:t.length)>1&&v.createElement(Ft,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},v.createElement(Kc,gl({},E,{id:b,points:t,connectNulls:h,type:u,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),f!=="none"&&v.createElement(Kc,gl({},x,{className:"recharts-area-curve",layout:l,type:u,connectNulls:h,fill:"none",points:t})),f!=="none"&&p&&Array.isArray(n)&&v.createElement(Kc,gl({},x,{className:"recharts-area-curve",layout:l,type:u,connectNulls:h,fill:"none",points:n}))),v.createElement(Ice,{points:t,props:g,clipPathId:i}))}function Uce(e){var t,n,{alpha:r,baseLine:i,points:o,strokeWidth:l}=e,u=(t=o[0])===null||t===void 0?void 0:t.y,f=(n=o[o.length-1])===null||n===void 0?void 0:n.y;if(!Ye(u)||!Ye(f))return null;var h=r*Math.abs(u-f),p=Math.max(...o.map(b=>b.x||0));return ye(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(b=>b.x||0),p)),ye(p)?v.createElement("rect",{x:0,y:u<f?u:u-h,width:p+(l?parseInt("".concat(l),10):1),height:Math.floor(h)}):null}function qce(e){var t,n,{alpha:r,baseLine:i,points:o,strokeWidth:l}=e,u=(t=o[0])===null||t===void 0?void 0:t.x,f=(n=o[o.length-1])===null||n===void 0?void 0:n.x;if(!Ye(u)||!Ye(f))return null;var h=r*Math.abs(u-f),p=Math.max(...o.map(b=>b.y||0));return ye(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(b=>b.y||0),p)),ye(p)?v.createElement("rect",{x:u<f?u:u-h,y:0,width:h,height:Math.floor(p+(l?parseInt("".concat(l),10):1))}):null}function Bce(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:o}=e;return n==="vertical"?v.createElement(Uce,{alpha:t,points:r,baseLine:i,strokeWidth:o}):v.createElement(qce,{alpha:t,points:r,baseLine:i,strokeWidth:o})}function Fce(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:o}=e,{points:l,baseLine:u,isAnimationActive:f,animationBegin:h,animationDuration:p,animationEasing:b,onAnimationStart:g,onAnimationEnd:x}=r,E=v.useMemo(()=>({points:l,baseLine:u}),[l,u]),S=Ou(E,"recharts-area-"),A=$E(),[j,C]=v.useState(!1),O=!j,T=v.useCallback(()=>{typeof x=="function"&&x(),C(!1)},[x]),_=v.useCallback(()=>{typeof g=="function"&&g(),C(!0)},[g]);if(A==null)return null;var P=i.current,D=o.current;return v.createElement(zce,{showLabels:O,points:l},r.children,v.createElement(Cu,{animationId:S,begin:h,duration:p,isActive:f,easing:b,onAnimationEnd:T,onAnimationStart:_,key:S},L=>{if(P){var z=P.length/l.length,R=L===1?l:l.map((U,re)=>{var G=Math.floor(re*z);if(P[G]){var ie=P[G];return Uc(Uc({},U),{},{x:dt(ie.x,U.x,L),y:dt(ie.y,U.y,L)})}return U}),q;return ye(u)?q=dt(D,u,L):Mt(u)||Ba(u)?q=dt(D,0,L):q=u.map((U,re)=>{var G=Math.floor(re*z);if(Array.isArray(D)&&D[G]){var ie=D[G];return Uc(Uc({},U),{},{x:dt(ie.x,U.x,L),y:dt(ie.y,U.y,L)})}return U}),L>0&&(i.current=R,o.current=q),v.createElement(SR,{points:R,baseLine:q,needClip:t,clipPathId:n,props:r})}return L>0&&(i.current=l,o.current=u),v.createElement(Ft,null,f&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(n)},v.createElement(Bce,{alpha:L,points:l,baseLine:u,layout:A,strokeWidth:r.strokeWidth}))),v.createElement(Ft,{clipPath:"url(#animationClipPath-".concat(n,")")},v.createElement(SR,{points:l,baseLine:u,needClip:t,clipPathId:n,props:r})))}),v.createElement(wv,{label:r.label}))}function $ce(e){var{needClip:t,clipPathId:n,props:r}=e,i=v.useRef(null),o=v.useRef();return v.createElement(Fce,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:o})}class Kce extends v.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:o,left:l,needClip:u,xAxisId:f,yAxisId:h,width:p,height:b,id:g,baseLine:x,zIndex:E}=this.props;if(t)return null;var S=rt("recharts-area",i),A=g,{r:j,strokeWidth:C}=B3(n),O=ij(n),T=j*2+C,_=u?"url(#clipPath-".concat(O?"":"dots-").concat(A,")"):void 0;return v.createElement(wr,{zIndex:E},v.createElement(Ft,{className:S},u&&v.createElement("defs",null,v.createElement(mj,{clipPathId:A,xAxisId:f,yAxisId:h}),!O&&v.createElement("clipPath",{id:"clipPath-dots-".concat(A)},v.createElement("rect",{x:l-T/2,y:o-T/2,width:p+T,height:b+T}))),v.createElement($ce,{needClip:u,clipPathId:A,props:this.props})),v.createElement(AS,{points:r,mainColor:bb(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:_}),this.props.isRange&&Array.isArray(x)&&v.createElement(AS,{points:x,mainColor:bb(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:_}))}}var Hce={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:an.area};function Gce(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:o,connectNulls:l,dot:u,fill:f,fillOpacity:h,hide:p,isAnimationActive:b,legendType:g,stroke:x,xAxisId:E,yAxisId:S}=e,A=X3(e,Pce),j=js(),C=VU(),{needClip:O}=Nv(E,S),T=Ln(),{points:_,isRange:P,baseLine:D}=(t=we(re=>Nce(re,e.id,T)))!==null&&t!==void 0?t:{},L=Ov();if(j!=="horizontal"&&j!=="vertical"||L==null||C!=="AreaChart"&&C!=="ComposedChart")return null;var{height:z,width:R,x:q,y:U}=L;return!_||!_.length?null:v.createElement(Kce,gl({},A,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:o,baseLine:D,connectNulls:l,dot:u,fill:f,fillOpacity:h,height:z,hide:p,layout:j,isAnimationActive:b,isRange:P,legendType:g,needClip:O,points:_,stroke:x,width:R,left:q,top:U,xAxisId:E,yAxisId:S}))}var Yce=(e,t,n,r,i)=>{var o=n??t;if(ye(o))return o;var l=e==="horizontal"?i:r,u=l.scale.domain();if(l.type==="number"){var f=Math.max(u[0],u[1]),h=Math.min(u[0],u[1]);return o==="dataMin"?h:o==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return o==="dataMin"?u[0]:o==="dataMax"?u[1]:u[0]};function Wce(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:o,chartBaseValue:l,xAxis:u,yAxis:f,displayedData:h,dataStartIndex:p,xAxisTicks:b,yAxisTicks:g,bandSize:x}=e,E=i&&i.length,S=Yce(o,l,n,u,f),A=o==="horizontal",j=!1,C=h.map((T,_)=>{var P,D,L,z;if(E)z=i[p+_];else{var R=ot(T,r);Array.isArray(R)?(z=R,j=!0):z=[S,R]}var q=(P=(D=z)===null||D===void 0?void 0:D[1])!==null&&P!==void 0?P:null,U=q==null||E&&!t&&ot(T,r)==null;if(A){var re;return{x:zp({axis:u,ticks:b,bandSize:x,entry:T,index:_}),y:U?null:(re=f.scale.map(q))!==null&&re!==void 0?re:null,value:z,payload:T}}return{x:U?null:(L=u.scale.map(q))!==null&&L!==void 0?L:null,y:zp({axis:f,ticks:g,bandSize:x,entry:T,index:_}),value:z,payload:T}}),O;return E||j?O=C.map(T=>{var _,P=Array.isArray(T.value)?T.value[0]:null;if(A){var D;return{x:T.x,y:P!=null&&T.y!=null&&(D=f.scale.map(P))!==null&&D!==void 0?D:null,payload:T.payload}}return{x:P!=null&&(_=u.scale.map(P))!==null&&_!==void 0?_:null,y:T.y,payload:T.payload}}):O=A?f.scale.map(S):u.scale.map(S),{points:C,baseLine:O??0,isRange:j}}function Qce(e){var t=on(e,Hce),n=Ln();return v.createElement(jv,{id:t.id,type:"area"},r=>v.createElement(v.Fragment,null,v.createElement(uj,{legendPayload:kce(t)}),v.createElement(Lce,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),v.createElement(dj,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:gI(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),v.createElement(Gce,gl({},t,{id:r}))))}var Z3=v.memo(Qce,Ml);Z3.displayName="Area";var Vce="Invariant failed";function Xce(e,t){throw new Error(Vce)}function jS(){return jS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jS.apply(null,arguments)}function bj(e){return v.createElement(oj,jS({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var Zce=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(ye(t))return t;var o=ye(r)||Mt(r);return o?t(r,i):(o||Xce(),n)}},Jce=(e,t,n)=>n,eue=(e,t)=>t,oh=W([th,eue],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),tue=W([oh],e=>e==null?void 0:e.maxBarSize),nue=(e,t,n,r)=>r,rue=W([tt,th,ji,Ci,Jce],(e,t,n,r,i)=>t.filter(o=>e==="horizontal"?o.xAxisId===n:o.yAxisId===r).filter(o=>o.isPanorama===i).filter(o=>o.hide===!1).filter(o=>o.type==="bar")),aue=(e,t,n)=>{var r=tt(e),i=ji(e,t),o=Ci(e,t);if(!(i==null||o==null))return r==="horizontal"?sb(e,"yAxis",o,n):sb(e,"xAxis",i,n)},iue=(e,t)=>{var n=tt(e),r=ji(e,t),i=Ci(e,t);if(!(r==null||i==null))return n==="horizontal"?uM(e,"xAxis",r):uM(e,"yAxis",i)},oue=W([rue,_Z,iue],Ise),sue=(e,t,n)=>{var r,i,o=oh(e,t);if(o==null)return 0;var l=ji(e,t),u=Ci(e,t);if(l==null||u==null)return 0;var f=tt(e),h=sz(e),{maxBarSize:p}=o,b=Mt(p)?h:p,g,x;return f==="horizontal"?(g=Si(e,"xAxis",l,n),x=wi(e,"xAxis",l,n)):(g=Si(e,"yAxis",u,n),x=wi(e,"yAxis",u,n)),(r=(i=ys(g,x,!0))!==null&&i!==void 0?i:b)!==null&&r!==void 0?r:0},J3=(e,t,n)=>{var r=tt(e),i=ji(e,t),o=Ci(e,t);if(!(i==null||o==null)){var l,u;return r==="horizontal"?(l=Si(e,"xAxis",i,n),u=wi(e,"xAxis",i,n)):(l=Si(e,"yAxis",o,n),u=wi(e,"yAxis",o,n)),ys(l,u)}},lue=W([oue,sz,PZ,lz,sue,J3,tue],Fse),cue=(e,t,n)=>{var r=ji(e,t);if(r!=null)return Si(e,"xAxis",r,n)},uue=(e,t,n)=>{var r=Ci(e,t);if(r!=null)return Si(e,"yAxis",r,n)},due=(e,t,n)=>{var r=ji(e,t);if(r!=null)return wi(e,"xAxis",r,n)},fue=(e,t,n)=>{var r=Ci(e,t);if(r!=null)return wi(e,"yAxis",r,n)},hue=W([lue,oh],Kse),mue=W([aue,oh],$se),pue=W([En,zE,cue,uue,due,fue,hue,tt,QI,J3,mue,oh,nue],(e,t,n,r,i,o,l,u,f,h,p,b,g)=>{var{chartData:x,dataStartIndex:E,dataEndIndex:S}=f;if(!(b==null||l==null||t==null||u!=="horizontal"&&u!=="vertical"||n==null||r==null||i==null||o==null||h==null)){var{data:A}=b,j;if(A!=null&&A.length>0?j=A:j=x==null?void 0:x.slice(E,S+1),j!=null)return $ue({layout:u,barSettings:b,pos:l,parentViewBox:t,bandSize:h,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:o,stackedData:p,displayedData:j,offset:e,cells:g,dataStartIndex:E})}}),bue=["index"];function CS(){return CS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CS.apply(null,arguments)}function vue(e,t){if(e==null)return{};var n,r,i=gue(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var eq=v.createContext(void 0),yue=e=>{var t=v.useContext(eq);if(t!=null)return t.stackId;if(e!=null)return gI(e)},xue=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),wue=e=>{var t=v.useContext(eq);if(t!=null){var{stackId:n}=t;return"url(#".concat(xue(n,e),")")}},tq=e=>{var{index:t}=e,n=vue(e,bue),r=wue(t);return v.createElement(Ft,CS({className:"recharts-bar-stack-layer",clipPath:r},n))},Sue=["onMouseEnter","onMouseLeave","onClick"],Eue=["value","background","tooltipPosition"],Aue=["id"],jue=["onMouseEnter","onClick","onMouseLeave"];function Ss(){return Ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ss.apply(null,arguments)}function ER(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ER(Object(n),!0).forEach(function(r){Cue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ER(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cue(e,t,n){return(t=Oue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oue(e){var t=Nue(e,"string");return typeof t=="symbol"?t:t+""}function Nue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vb(e,t){if(e==null)return{};var n,r,i=Tue(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Tue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Pue=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:o}=e;return[{inactive:o,dataKey:t,type:i,color:r,value:As(n,t),payload:e}]},_ue=v.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:o,hide:l,unit:u,tooltipType:f,id:h}=e,p={dataDefinedOnItem:void 0,getPosition:Es,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:As(o,t),hide:l,type:f,color:i,unit:u,graphicalItemId:h}};return v.createElement(Av,{tooltipEntrySettings:p})});function Due(e){var t=we(xs),{data:n,dataKey:r,background:i,allOtherBarProps:o}=e,{onMouseEnter:l,onMouseLeave:u,onClick:f}=o,h=vb(o,Sue),p=sj(l,r,o.id),b=lj(u),g=cj(f,r,o.id);if(!i||n==null)return null;var x=wl(i);return v.createElement(wr,{zIndex:Hse(i,an.barBackground)},n.map((E,S)=>{var{value:A,background:j,tooltipPosition:C}=E,O=vb(E,Eue);if(!j)return null;var T=p(E,S),_=b(E,S),P=g(E,S),D=br(br(br(br(br({option:i,isActive:String(S)===t},O),{},{fill:"#eee"},j),x),qf(h,E,S)),{},{onMouseEnter:T,onMouseLeave:_,onClick:P,dataKey:r,index:S,className:"recharts-bar-background-rectangle"});return v.createElement(bj,Ss({key:"background-bar-".concat(S)},D))}))}function Mue(e){var{showLabels:t,children:n,rects:r}=e,i=r==null?void 0:r.map(o=>{var l={x:o.x,y:o.y,width:o.width,lowerWidth:o.width,upperWidth:o.width,height:o.height};return br(br({},l),{},{value:o.value,payload:o.payload,parentViewBox:o.parentViewBox,viewBox:l,fill:o.fill})});return v.createElement(tj,{value:t?i:void 0},n)}function Rue(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:o,dataKey:l}=e,u=we(xs),f=we(QA),h=n&&String(i.originalDataIndex)===u&&(f==null||l===f),[p,b]=v.useState(!1),[g,x]=v.useState(!1);v.useEffect(()=>{var O;return h?(b(!0),O=requestAnimationFrame(()=>{x(!0)})):x(!1),()=>{cancelAnimationFrame(O)}},[h]);var E=v.useCallback(()=>{h||b(!1)},[h]),S=h&&g,A=h||p,j;h?n===!0?j=t:j=n:j=t;var C=v.createElement(bj,Ss({},r,{name:String(r.name)},i,{isActive:S,option:j,index:o,dataKey:l,onTransitionEnd:E}));return A?v.createElement(wr,{zIndex:an.activeBar},v.createElement(tq,{index:i.originalDataIndex},C)):C}function kue(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:o}=e;return v.createElement(bj,Ss({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:o}))}function Lue(e){var t,{data:n,props:r}=e,i=(t=yr(r))!==null&&t!==void 0?t:{},{id:o}=i,l=vb(i,Aue),{shape:u,dataKey:f,activeBar:h}=r,{onMouseEnter:p,onClick:b,onMouseLeave:g}=r,x=vb(r,jue),E=sj(p,f,o),S=lj(g),A=cj(b,f,o);return n?v.createElement(v.Fragment,null,n.map((j,C)=>v.createElement(tq,Ss({index:j.originalDataIndex,key:"rectangle-".concat(j==null?void 0:j.x,"-").concat(j==null?void 0:j.y,"-").concat(j==null?void 0:j.value,"-").concat(C),className:"recharts-bar-rectangle"},qf(x,j,C),{onMouseEnter:E(j,C),onMouseLeave:S(j,C),onClick:A(j,C)}),h?v.createElement(Rue,{shape:u,activeBar:h,baseProps:l,entry:j,index:C,dataKey:f}):v.createElement(kue,{shape:u,baseProps:l,entry:j,index:C,dataKey:f})))):null}function Iue(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:o,animationBegin:l,animationDuration:u,animationEasing:f,onAnimationEnd:h,onAnimationStart:p}=t,b=n.current,g=Ou(t,"recharts-bar-"),[x,E]=v.useState(!1),S=!x,A=v.useCallback(()=>{typeof h=="function"&&h(),E(!1)},[h]),j=v.useCallback(()=>{typeof p=="function"&&p(),E(!0)},[p]);return v.createElement(Mue,{showLabels:S,rects:r},v.createElement(Cu,{animationId:g,begin:l,duration:u,isActive:o,easing:f,onAnimationEnd:A,onAnimationStart:j,key:g},C=>{var O=C===1?r:r==null?void 0:r.map((T,_)=>{var P=b&&b[_];if(P)return br(br({},T),{},{x:dt(P.x,T.x,C),y:dt(P.y,T.y,C),width:dt(P.width,T.width,C),height:dt(P.height,T.height,C)});if(i==="horizontal"){var D=dt(0,T.height,C),L=dt(T.stackedBarStart,T.y,C);return br(br({},T),{},{y:L,height:D})}var z=dt(0,T.width,C),R=dt(T.stackedBarStart,T.x,C);return br(br({},T),{},{width:z,x:R})});return C>0&&(n.current=O??null),O==null?null:v.createElement(Ft,null,v.createElement(Lue,{props:t,data:O}))}),v.createElement(wv,{label:t.label}),t.children)}function zue(e){var t=v.useRef(null);return v.createElement(Iue,{previousRectanglesRef:t,props:e})}var nq=0,Uue=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:ot(e,t)}};class que extends v.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:o,yAxisId:l,needClip:u,background:f,id:h}=this.props;if(t||n==null)return null;var p=rt("recharts-bar",i),b=h;return v.createElement(Ft,{className:p,id:h},u&&v.createElement("defs",null,v.createElement(mj,{clipPathId:b,xAxisId:o,yAxisId:l})),v.createElement(Ft,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(b,")"):void 0},v.createElement(Due,{data:n,dataKey:r,background:f,allOtherBarProps:this.props}),v.createElement(zue,this.props)))}}var Bue={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:nq,xAxisId:0,yAxisId:0,zIndex:an.bar};function Fue(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:o,activeBar:l,animationBegin:u,animationDuration:f,animationEasing:h,isAnimationActive:p}=e,{needClip:b}=Nv(t,n),g=js(),x=Ln(),E=aj(e.children,yu),S=we(C=>pue(C,e.id,x,E));if(g!=="vertical"&&g!=="horizontal")return null;var A,j=S==null?void 0:S[0];return j==null||j.height==null||j.width==null?A=0:A=g==="vertical"?j.height/2:j.width/2,v.createElement(L3,{xAxisId:t,yAxisId:n,data:S,dataPointFormatter:Uue,errorBarOffset:A},v.createElement(que,Ss({},e,{layout:g,needClip:b,data:S,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:o,activeBar:l,animationBegin:u,animationDuration:f,animationEasing:h,isAnimationActive:p})))}function $ue(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:o,bandSize:l,xAxis:u,yAxis:f,xAxisTicks:h,yAxisTicks:p,stackedData:b,displayedData:g,offset:x,cells:E,parentViewBox:S,dataStartIndex:A}=e,j=t==="horizontal"?f:u,C=b?j.scale.domain():null,O=wQ({numericAxis:j}),T=j.scale.map(O);return g.map((_,P)=>{var D,L,z,R,q,U;if(b){var re=b[P+A];if(re==null)return null;D=bQ(re,C)}else D=ot(_,n),Array.isArray(D)||(D=[O,D]);var G=Zce(r,nq)(D[1],P);if(t==="horizontal"){var ie,K=f.scale.map(D[0]),Z=f.scale.map(D[1]);if(K==null||Z==null)return null;L=a_({axis:u,ticks:h,bandSize:l,offset:o.offset,entry:_,index:P}),z=(ie=Z??K)!==null&&ie!==void 0?ie:void 0,R=o.size;var $=K-Z;if(q=Ba($)?0:$,U={x:L,y:x.top,width:R,height:x.height},Math.abs(G)>0&&Math.abs(q)<Math.abs(G)){var ee=kn(q||G)*(Math.abs(G)-Math.abs(q));z-=ee,q+=ee}}else{var pe=u.scale.map(D[0]),k=u.scale.map(D[1]);if(pe==null||k==null)return null;if(L=pe,z=a_({axis:f,ticks:p,bandSize:l,offset:o.offset,entry:_,index:P}),R=k-pe,q=o.size,U={x:x.left,y:z,width:x.width,height:q},Math.abs(G)>0&&Math.abs(R)<Math.abs(G)){var Q=kn(R||G)*(Math.abs(G)-Math.abs(R));R+=Q}}if(L==null||z==null||R==null||q==null||!i&&(R===0||q===0))return null;var ce=br(br({},_),{},{stackedBarStart:T,x:L,y:z,width:R,height:q,value:b?D:D[1],payload:_,background:U,tooltipPosition:{x:L+R/2,y:z+q/2},parentViewBox:S,originalDataIndex:P},E&&E[P]&&E[P].props);return ce}).filter(Boolean)}function Kue(e){var t=on(e,Bue),n=yue(t.stackId),r=Ln();return v.createElement(jv,{id:t.id,type:"bar"},i=>v.createElement(v.Fragment,null,v.createElement(uj,{legendPayload:Pue(t)}),v.createElement(_ue,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),v.createElement(dj,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),v.createElement(wr,{zIndex:t.zIndex},v.createElement(Fue,Ss({},t,{id:i})))))}var rq=v.memo(Kue,Ml);rq.displayName="Bar";var Hue=["domain","range"],Gue=["domain","range"];function AR(e,t){if(e==null)return{};var n,r,i=Yue(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function jR(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function aq(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=AR(e,Hue),{domain:o,range:l}=t,u=AR(t,Gue);return!jR(n,o)||!jR(r,l)?!1:Ml(i,u)}var Wue=["type"],Que=["dangerouslySetInnerHTML","ticks","scale"],Vue=["id","scale"];function OS(){return OS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OS.apply(null,arguments)}function CR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function OR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CR(Object(n),!0).forEach(function(r){Xue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xue(e,t,n){return(t=Zue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zue(e){var t=Jue(e,"string");return typeof t=="symbol"?t:t+""}function Jue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NS(e,t){if(e==null)return{};var n,r,i=ede(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ede(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function tde(e){var t=xt(),n=v.useRef(null),r=$E(),{type:i}=e,o=NS(e,Wue),l=rv(r,"xAxis",i),u=v.useMemo(()=>{if(l!=null)return OR(OR({},o),{},{type:l})},[o,l]);return v.useLayoutEffect(()=>{u!=null&&(n.current===null?t(Sse(u)):n.current!==u&&t(Ese({prev:n.current,next:u})),n.current=u)},[u,t]),v.useLayoutEffect(()=>()=>{n.current&&(t(Ase(n.current)),n.current=null)},[t]),null}var nde=e=>{var{xAxisId:t,className:n}=e,r=we(zE),i=Ln(),o="xAxis",l=we(j=>jU(j,o,t,i)),u=we(j=>SU(j,t)),f=we(j=>dne(j,t)),h=we(j=>eU(j,t));if(u==null||f==null||h==null)return null;var{dangerouslySetInnerHTML:p,ticks:b,scale:g}=e,x=NS(e,Que),{id:E,scale:S}=h,A=NS(h,Vue);return v.createElement(hj,OS({},x,A,{x:f.x,y:f.y,width:u.width,height:u.height,className:rt("recharts-".concat(o," ").concat(o),n),viewBox:r,ticks:l,axisType:o,axisId:t}))},rde={allowDataOverflow:gn.allowDataOverflow,allowDecimals:gn.allowDecimals,allowDuplicatedCategory:gn.allowDuplicatedCategory,angle:gn.angle,axisLine:co.axisLine,height:gn.height,hide:!1,includeHidden:gn.includeHidden,interval:gn.interval,label:!1,minTickGap:gn.minTickGap,mirror:gn.mirror,orientation:gn.orientation,padding:gn.padding,reversed:gn.reversed,scale:gn.scale,tick:gn.tick,tickCount:gn.tickCount,tickLine:co.tickLine,tickSize:co.tickSize,type:gn.type,niceTicks:gn.niceTicks,xAxisId:0},ade=e=>{var t=on(e,rde);return v.createElement(v.Fragment,null,v.createElement(tde,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),v.createElement(nde,t))},cp=v.memo(ade,aq);cp.displayName="XAxis";var ide=["type"],ode=["dangerouslySetInnerHTML","ticks","scale"],sde=["id","scale"];function TS(){return TS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TS.apply(null,arguments)}function NR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function TR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NR(Object(n),!0).forEach(function(r){lde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lde(e,t,n){return(t=cde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cde(e){var t=ude(e,"string");return typeof t=="symbol"?t:t+""}function ude(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PS(e,t){if(e==null)return{};var n,r,i=dde(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dde(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function fde(e){var t=xt(),n=v.useRef(null),r=$E(),{type:i}=e,o=PS(e,ide),l=rv(r,"yAxis",i),u=v.useMemo(()=>{if(l!=null)return TR(TR({},o),{},{type:l})},[l,o]);return v.useLayoutEffect(()=>{u!=null&&(n.current===null?t(jse(u)):n.current!==u&&t(Cse({prev:n.current,next:u})),n.current=u)},[u,t]),v.useLayoutEffect(()=>()=>{n.current&&(t(Ose(n.current)),n.current=null)},[t]),null}function hde(e){var{yAxisId:t,className:n,width:r,label:i}=e,o=v.useRef(null),l=v.useRef(null),u=we(zE),f=Ln(),h=xt(),p="yAxis",b=we(P=>EU(P,t)),g=we(P=>hne(P,t)),x=we(P=>jU(P,p,t,f)),E=we(P=>tU(P,t));if(v.useLayoutEffect(()=>{if(!(r!=="auto"||!b||ej(i)||v.isValidElement(i)||E==null)){var P=o.current;if(P){var D=P.getCalculatedWidth();Math.round(b.width)!==Math.round(D)&&h(Nse({id:t,width:D}))}}},[x,b,h,i,t,r,E]),b==null||g==null||E==null)return null;var{dangerouslySetInnerHTML:S,ticks:A,scale:j}=e,C=PS(e,ode),{id:O,scale:T}=E,_=PS(E,sde);return v.createElement(hj,TS({},C,_,{ref:o,labelRef:l,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:b.width,height:b.height,className:rt("recharts-".concat(p," ").concat(p),n),viewBox:u,ticks:x,axisType:p,axisId:t}))}var mde={allowDataOverflow:yn.allowDataOverflow,allowDecimals:yn.allowDecimals,allowDuplicatedCategory:yn.allowDuplicatedCategory,angle:yn.angle,axisLine:co.axisLine,hide:!1,includeHidden:yn.includeHidden,interval:yn.interval,label:!1,minTickGap:yn.minTickGap,mirror:yn.mirror,orientation:yn.orientation,padding:yn.padding,reversed:yn.reversed,scale:yn.scale,tick:yn.tick,tickCount:yn.tickCount,tickLine:co.tickLine,tickSize:co.tickSize,type:yn.type,niceTicks:yn.niceTicks,width:yn.width,yAxisId:0},pde=e=>{var t=on(e,mde);return v.createElement(v.Fragment,null,v.createElement(fde,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),v.createElement(hde,t))},up=v.memo(pde,aq);up.displayName="YAxis";var bde=(e,t)=>t,vj=W([bde,tt,pz,In,$U,So,Rre,En],Bre);function vde(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function gj(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(vde(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var o=e.currentTarget;n=o.offsetWidth>0?t.width/o.offsetWidth:1,r=o.offsetHeight>0?t.height/o.offsetHeight:1}var l=(u,f)=>({relativeX:Math.round((u-t.left)/n),relativeY:Math.round((f-t.top)/r)});return"touches"in e?Array.from(e.touches).map(u=>l(u.clientX,u.clientY)):l(e.clientX,e.clientY)}var iq=ra("mouseClick"),oq=Ff();oq.startListening({actionCreator:iq,effect:(e,t)=>{var n=e.payload,r=vj(t.getState(),gj(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(Tne({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var _S=ra("mouseMove"),sq=Ff(),Tc=null,Qs=null,Jx=null;sq.startListening({actionCreator:_S,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:o}=r.eventSettings,l=o==="all"||(o==null?void 0:o.includes("mousemove"));Tc!==null&&(cancelAnimationFrame(Tc),Tc=null),Qs!==null&&(typeof i!="number"||!l)&&(clearTimeout(Qs),Qs=null),Jx=gj(n);var u=()=>{var f=t.getState(),h=ah(f,f.tooltip.settings.shared);if(!Jx){Tc=null,Qs=null;return}if(h==="axis"){var p=vj(f,Jx);(p==null?void 0:p.activeIndex)!=null?t.dispatch(MU({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(DU())}Tc=null,Qs=null};if(!l){u();return}i==="raf"?Tc=requestAnimationFrame(u):typeof i=="number"&&Qs===null&&(Qs=setTimeout(u,i))}});function gde(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var PR={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},lq=lr({name:"rootProps",initialState:PR,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:PR.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),yde=lq.reducer,{updateOptions:xde}=lq.actions,wde=null,Sde={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},cq=lr({name:"polarOptions",initialState:wde,reducers:Sde}),{updatePolarOptions:Ede}=cq.actions,Ade=cq.reducer,uq=ra("keyDown"),dq=ra("focus"),fq=ra("blur"),Tv=Ff(),Pc=null,Vs=null,Vm=null;Tv.startListening({actionCreator:uq,effect:(e,t)=>{Vm=e.payload,Pc!==null&&(cancelAnimationFrame(Pc),Pc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,o=i==="all"||i.includes("keydown");Vs!==null&&(typeof r!="number"||!o)&&(clearTimeout(Vs),Vs=null);var l=()=>{try{var u=t.getState(),f=u.rootProps.accessibilityLayer!==!1;if(!f)return;var{keyboardInteraction:h}=u.tooltip,p=Vm;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var b=tf(h,Tl(u),vu(u),gu(u)),g=b==null?-1:Number(b),x=!Number.isFinite(g)||g<0,E=So(u),S=Tl(u),A=ah(u,u.tooltip.settings.shared);if(p==="Enter"){if(x)return;var j=ub(u,A,"hover",String(h.index));t.dispatch(cb({active:!h.active,activeIndex:h.index,activeCoordinate:j}));return}var C=gne(u),O=C==="left-to-right"?1:-1,T=p==="ArrowRight"?1:-1,_;if(x){var P=vu(u),D=gu(u),L=T*O,z=G=>({active:!1,index:String(G),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(_=-1,L>0){for(var R=0;R<S.length;R++)if(tf(z(R),S,P,D)!=null){_=R;break}}else for(var q=S.length-1;q>=0;q--)if(tf(z(q),S,P,D)!=null){_=q;break}if(_<0)return}else{_=g+T*O;var U=(E==null?void 0:E.length)||S.length;if(U===0||_>=U||_<0)return}var re=ub(u,A,"hover",String(_));t.dispatch(cb({active:!0,activeIndex:_.toString(),activeCoordinate:re}))}finally{Pc=null,Vs=null}};if(!o){l();return}r==="raf"?Pc=requestAnimationFrame(l):typeof r=="number"&&Vs===null&&(l(),Vm=null,Vs=setTimeout(()=>{Vm?l():(Vs=null,Pc=null)},r))}});Tv.startListening({actionCreator:dq,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var o="0",l=ah(n,n.tooltip.settings.shared),u=ub(n,l,"hover",String(o));t.dispatch(cb({active:!0,activeIndex:o,activeCoordinate:u}))}}}});Tv.startListening({actionCreator:fq,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(cb({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function hq(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var ba=ra("externalEvent"),mq=Ff(),Xm=new Map,$d=new Map,ew=new Map;mq.startListening({actionCreator:ba,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,o=hq(r);ew.set(i,{handler:n,reactEvent:o});var l=Xm.get(i);l!==void 0&&(cancelAnimationFrame(l),Xm.delete(i));var u=t.getState(),{throttleDelay:f,throttledEvents:h}=u.eventSettings,p=h,b=p==="all"||(p==null?void 0:p.includes(i)),g=$d.get(i);g!==void 0&&(typeof f!="number"||!b)&&(clearTimeout(g),$d.delete(i));var x=()=>{var A=ew.get(i);try{if(!A)return;var{handler:j,reactEvent:C}=A,O=t.getState(),T={activeCoordinate:yre(O),activeDataKey:QA(O),activeIndex:xs(O),activeLabel:GU(O),activeTooltipIndex:xs(O),isTooltipActive:xre(O)};j&&j(T,C)}finally{Xm.delete(i),$d.delete(i),ew.delete(i)}};if(!b){x();return}if(f==="raf"){var E=requestAnimationFrame(x);Xm.set(i,E)}else if(typeof f=="number"){if(!$d.has(i)){x();var S=setTimeout(x,f);$d.set(i,S)}}else x()}}});var jde=W([ku],e=>e.tooltipItemPayloads),Cde=W([jde,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(o=>o.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),pq=ra("touchMove"),bq=Ff(),Xs=null,Zo=null,_R=null,Kd=null;bq.startListening({actionCreator:pq,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Kd=hq(n);var r=t.getState(),{throttleDelay:i,throttledEvents:o}=r.eventSettings,l=o==="all"||o.includes("touchmove");Xs!==null&&(cancelAnimationFrame(Xs),Xs=null),Zo!==null&&(typeof i!="number"||!l)&&(clearTimeout(Zo),Zo=null),_R=Array.from(n.touches).map(f=>gj({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var u=()=>{if(Kd!=null){var f=t.getState(),h=ah(f,f.tooltip.settings.shared);if(h==="axis"){var p,b=(p=_R)===null||p===void 0?void 0:p[0];if(b==null){Xs=null,Zo=null;return}var g=vj(f,b);(g==null?void 0:g.activeIndex)!=null&&t.dispatch(MU({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(h==="item"){var x,E=Kd.touches[0];if(document.elementFromPoint==null||E==null)return;var S=document.elementFromPoint(E.clientX,E.clientY);if(!S||!S.getAttribute)return;var A=S.getAttribute(xI),j=(x=S.getAttribute(wI))!==null&&x!==void 0?x:void 0,C=Ll(f).find(_=>_.id===j);if(A==null||C==null||j==null)return;var{dataKey:O}=C,T=Cde(f,A,j);t.dispatch(_U({activeDataKey:O,activeIndex:A,activeCoordinate:T,activeGraphicalItemId:j}))}Xs=null,Zo=null}};if(!l){u();return}i==="raf"?Xs=requestAnimationFrame(u):typeof i=="number"&&Zo===null&&(u(),Kd=null,Zo=setTimeout(()=>{Kd?u():(Zo=null,Xs=null)},i))}}});var yj={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},vq=lr({name:"eventSettings",initialState:yj,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Ode}=vq.actions,Nde=vq.reducer,Tde=BL({brush:Gse,cartesianAxis:Tse,chartData:vae,errorBars:Hle,eventSettings:Nde,graphicalItems:Roe,layout:dQ,legend:gV,options:fae,polarAxis:Yie,polarOptions:Ade,referenceElements:Vse,renderedTicks:hle,rootProps:yde,tooltip:Pne,zIndex:eae}),Pde=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return L7({reducer:Tde,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([oq.middleware,sq.middleware,Tv.middleware,mq.middleware,bq.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(nI({type:"raf"}))},devTools:{serialize:{replacer:gde},name:"recharts-".concat(n)}})};function gq(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Ln(),o=v.useRef(null);if(i)return n;o.current==null&&(o.current=Pde(t,r));var l=_E;return v.createElement(RV,{context:l,store:o.current},n)}function _de(e){var{layout:t,margin:n}=e,r=xt(),i=Ln();return v.useEffect(()=>{i||(r(lQ(t)),r(sQ(n)))},[r,i,t,n]),null}var yq=v.memo(_de,Ml);function xq(e){var t=xt();return v.useEffect(()=>{t(xde(e))},[t,e]),null}var Dde=e=>{var t=xt();return v.useEffect(()=>{t(Ode(e))},[t,e]),null},wq=v.memo(Dde,Ml);function DR(e){var{zIndex:t,isPanorama:n}=e,r=v.useRef(null),i=xt();return v.useLayoutEffect(()=>(r.current&&i(Zre({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Jre({zIndex:t,isPanorama:n}))}),[i,t,n]),v.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function MR(e){var{children:t,isPanorama:n}=e,r=we($re);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),o=r.filter(l=>l>0);return v.createElement(v.Fragment,null,i.map(l=>v.createElement(DR,{key:l,zIndex:l,isPanorama:n})),t,o.map(l=>v.createElement(DR,{key:l,zIndex:l,isPanorama:n})))}var Mde=["children"];function Rde(e,t){if(e==null)return{};var n,r,i=kde(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kde(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gb(){return gb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gb.apply(null,arguments)}var Lde={width:"100%",height:"100%",display:"block"},Ide=v.forwardRef((e,t)=>{var n=BE(),r=FE(),i=zI();if(!gi(n)||!gi(r))return null;var{children:o,otherAttributes:l,title:u,desc:f}=e,h,p;return l!=null&&(typeof l.tabIndex=="number"?h=l.tabIndex:h=i?0:void 0,typeof l.role=="string"?p=l.role:p=i?"application":void 0),v.createElement(wE,gb({},l,{title:u,desc:f,role:p,tabIndex:h,width:n,height:r,style:Lde,ref:t}),o)}),zde=e=>{var{children:t}=e,n=we(Xb);if(!n)return null;var{width:r,height:i,y:o,x:l}=n;return v.createElement(wE,{width:r,height:i,x:l,y:o},t)},RR=v.forwardRef((e,t)=>{var{children:n}=e,r=Rde(e,Mde),i=Ln();return i?v.createElement(zde,null,v.createElement(MR,{isPanorama:!0},n)):v.createElement(Ide,gb({ref:t},r),v.createElement(MR,{isPanorama:!1},n))});function Ude(){var e=xt(),[t,n]=v.useState(null),r=we(OQ);return v.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),o=i.width/t.offsetWidth;Ye(o)&&o!==r&&e(uQ(o))}},[t,e,r]),n}function kR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qde(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(r){Bde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bde(e,t,n){return(t=Fde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fde(e){var t=$de(e,"string");return typeof t=="symbol"?t:t+""}function $de(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vs(){return vs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vs.apply(null,arguments)}var Kde=()=>(Cae(),null);function yb(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Hde=v.forwardRef((e,t)=>{var n,r,i=v.useRef(null),[o,l]=v.useState({containerWidth:yb((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:yb((r=e.style)===null||r===void 0?void 0:r.height)}),u=v.useCallback((h,p)=>{l(b=>{var g=Math.round(h),x=Math.round(p);return b.containerWidth===g&&b.containerHeight===x?b:{containerWidth:g,containerHeight:x}})},[]),f=v.useCallback(h=>{if(typeof t=="function"&&t(h),i.current!=null&&(i.current.disconnect(),i.current=null),h!=null&&typeof ResizeObserver<"u"){var{width:p,height:b}=h.getBoundingClientRect();u(p,b);var g=E=>{var S=E[0];if(S!=null){var{width:A,height:j}=S.contentRect;u(A,j)}},x=new ResizeObserver(g);x.observe(h),i.current=x}},[t,u]);return v.useEffect(()=>()=>{var h=i.current;h!=null&&h.disconnect()},[u]),v.createElement(v.Fragment,null,v.createElement(Kf,{width:o.containerWidth,height:o.containerHeight}),v.createElement("div",vs({ref:f},e)))}),Gde=v.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,o]=v.useState({containerWidth:yb(n),containerHeight:yb(r)}),l=v.useCallback((f,h)=>{o(p=>{var b=Math.round(f),g=Math.round(h);return p.containerWidth===b&&p.containerHeight===g?p:{containerWidth:b,containerHeight:g}})},[]),u=v.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null){var{width:h,height:p}=f.getBoundingClientRect();l(h,p)}},[t,l]);return v.createElement(v.Fragment,null,v.createElement(Kf,{width:i.containerWidth,height:i.containerHeight}),v.createElement("div",vs({ref:u},e)))}),Yde=v.forwardRef((e,t)=>{var{width:n,height:r}=e;return v.createElement(v.Fragment,null,v.createElement(Kf,{width:n,height:r}),v.createElement("div",vs({ref:t},e)))}),Wde=v.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?v.createElement(Gde,vs({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?v.createElement(Yde,vs({},e,{width:n,height:r,ref:t})):v.createElement(v.Fragment,null,v.createElement(Kf,{width:n,height:r}),v.createElement("div",vs({ref:t},e)))});function Qde(e){return e?Hde:Wde}var Vde=v.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:o,onContextMenu:l,onDoubleClick:u,onMouseDown:f,onMouseEnter:h,onMouseLeave:p,onMouseMove:b,onMouseUp:g,onTouchEnd:x,onTouchMove:E,onTouchStart:S,style:A,width:j,responsive:C,dispatchTouchEvents:O=!0}=e,T=v.useRef(null),_=xt(),[P,D]=v.useState(null),[L,z]=v.useState(null),R=Ude(),q=UE(),U=(q==null?void 0:q.width)>0?q.width:j,re=(q==null?void 0:q.height)>0?q.height:i,G=v.useCallback(ue=>{R(ue),typeof t=="function"&&t(ue),D(ue),z(ue),ue!=null&&(T.current=ue)},[R,t,D,z]),ie=v.useCallback(ue=>{_(iq(ue)),_(ba({handler:o,reactEvent:ue}))},[_,o]),K=v.useCallback(ue=>{_(_S(ue)),_(ba({handler:h,reactEvent:ue}))},[_,h]),Z=v.useCallback(ue=>{_(DU()),_(ba({handler:p,reactEvent:ue}))},[_,p]),$=v.useCallback(ue=>{_(_S(ue)),_(ba({handler:b,reactEvent:ue}))},[_,b]),ee=v.useCallback(()=>{_(dq())},[_]),pe=v.useCallback(()=>{_(fq())},[_]),k=v.useCallback(ue=>{_(uq(ue.key))},[_]),Q=v.useCallback(ue=>{_(ba({handler:l,reactEvent:ue}))},[_,l]),ce=v.useCallback(ue=>{_(ba({handler:u,reactEvent:ue}))},[_,u]),fe=v.useCallback(ue=>{_(ba({handler:f,reactEvent:ue}))},[_,f]),xe=v.useCallback(ue=>{_(ba({handler:g,reactEvent:ue}))},[_,g]),Oe=v.useCallback(ue=>{_(ba({handler:S,reactEvent:ue}))},[_,S]),qe=v.useCallback(ue=>{O&&_(pq(ue)),_(ba({handler:E,reactEvent:ue}))},[_,O,E]),Be=v.useCallback(ue=>{_(ba({handler:x,reactEvent:ue}))},[_,x]),he=Qde(C);return v.createElement(t3.Provider,{value:P},v.createElement(nL.Provider,{value:L},v.createElement(he,{width:U??(A==null?void 0:A.width),height:re??(A==null?void 0:A.height),className:rt("recharts-wrapper",r),style:qde({position:"relative",cursor:"default",width:U,height:re},A),onClick:ie,onContextMenu:Q,onDoubleClick:ce,onFocus:ee,onBlur:pe,onKeyDown:k,onMouseDown:fe,onMouseEnter:K,onMouseLeave:Z,onMouseMove:$,onMouseUp:xe,onTouchEnd:Be,onTouchMove:qe,onTouchStart:Oe,ref:G},v.createElement(Kde,null),n)))}),Xde=["width","height","responsive","children","className","style","compact","title","desc"];function Zde(e,t){if(e==null)return{};var n,r,i=Jde(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jde(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Sq=v.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:o,className:l,style:u,compact:f,title:h,desc:p}=e,b=Zde(e,Xde),g=yr(b);return f?v.createElement(v.Fragment,null,v.createElement(Kf,{width:n,height:r}),v.createElement(RR,{otherAttributes:g,title:h,desc:p},o)):v.createElement(Vde,{className:l,style:u,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},v.createElement(RR,{otherAttributes:g,title:h,desc:p,ref:t},v.createElement(Zse,null,o)))});function DS(){return DS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DS.apply(null,arguments)}function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function efe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LR(Object(n),!0).forEach(function(r){tfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tfe(e,t,n){return(t=nfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nfe(e){var t=rfe(e,"string");return typeof t=="symbol"?t:t+""}function rfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var afe={top:5,right:5,bottom:5,left:5},ife=efe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:afe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},yj),xj=v.forwardRef(function(t,n){var r,i=on(t.categoricalChartProps,ife),{chartName:o,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,categoricalChartProps:h}=t,p={chartName:o,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return v.createElement(gq,{preloadedState:{options:p},reduxStoreName:(r=h.id)!==null&&r!==void 0?r:o},v.createElement(T3,{chartData:h.data}),v.createElement(yq,{layout:i.layout,margin:i.margin}),v.createElement(wq,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),v.createElement(xq,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),v.createElement(Sq,DS({},i,{ref:n})))}),ofe=["axis"],sfe=v.forwardRef((e,t)=>v.createElement(xj,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:ofe,tooltipPayloadSearcher:yv,categoricalChartProps:e,ref:t})),lfe=["axis","item"],cfe=v.forwardRef((e,t)=>v.createElement(xj,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:lfe,tooltipPayloadSearcher:yv,categoricalChartProps:e,ref:t}));function ufe(e){var t=xt();return v.useEffect(()=>{t(Ede(e))},[t,e]),null}var dfe=["layout"];function MS(){return MS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MS.apply(null,arguments)}function ffe(e,t){if(e==null)return{};var n,r,i=hfe(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hfe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function IR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mfe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IR(Object(n),!0).forEach(function(r){pfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pfe(e,t,n){return(t=bfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bfe(e){var t=vfe(e,"string");return typeof t=="symbol"?t:t+""}function vfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gfe={top:5,right:5,bottom:5,left:5},Eq=mfe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:gfe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},yj),yfe=v.forwardRef(function(t,n){var r,i=on(t.categoricalChartProps,Eq),{layout:o}=i,l=ffe(i,dfe),{chartName:u,defaultTooltipEventType:f,validateTooltipEventTypes:h,tooltipPayloadSearcher:p}=t,b={chartName:u,defaultTooltipEventType:f,validateTooltipEventTypes:h,tooltipPayloadSearcher:p,eventEmitter:void 0};return v.createElement(gq,{preloadedState:{options:b},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:u},v.createElement(T3,{chartData:i.data}),v.createElement(yq,{layout:o,margin:i.margin}),v.createElement(wq,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),v.createElement(xq,{baseValue:void 0,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),v.createElement(ufe,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),v.createElement(Sq,MS({},l,{ref:n})))});function zR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function UR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zR(Object(n),!0).forEach(function(r){xfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xfe(e,t,n){return(t=wfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wfe(e){var t=Sfe(e,"string");return typeof t=="symbol"?t:t+""}function Sfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Efe=["item"],Afe=UR(UR({},Eq),{},{layout:"centric",startAngle:0,endAngle:360}),jfe=v.forwardRef((e,t)=>{var n=on(e,Afe);return v.createElement(yfe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Efe,tooltipPayloadSearcher:yv,categoricalChartProps:n,ref:t})}),Cfe=["axis"],Ofe=v.forwardRef((e,t)=>v.createElement(xj,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Cfe,tooltipPayloadSearcher:yv,categoricalChartProps:e,ref:t}));const _r=["#5b6cff","#10b981","#f59e0b","#ec4899","#06b6d4","#8b5cf6","#ef4444"],_c="#9ca3af",Hd="#e5e7eb";function Zm({active:e,payload:t,label:n}){return!e||!t||t.length===0?null:d.jsxs("div",{className:"bb-adminchat-chart-tooltip",children:[n!==void 0&&n!==""?d.jsx("div",{className:"bb-adminchat-chart-tooltip-label",children:n}):null,t.map((r,i)=>d.jsxs("div",{className:"bb-adminchat-chart-tooltip-row",children:[d.jsx("span",{className:"bb-adminchat-chart-tooltip-dot",style:{background:r.color}}),d.jsx("span",{className:"bb-adminchat-chart-tooltip-name",children:r.name}),d.jsx("span",{className:"bb-adminchat-chart-tooltip-value",children:r.value})]},i))]})}function Aq({artifact:e}){const{chartKind:t,xKey:n,yKeys:r,data:i,title:o}=e;if(!Array.isArray(i)||i.length===0)return d.jsxs("div",{className:"bb-adminchat-chart bb-adminchat-chart-empty-state",children:[d.jsx("div",{className:"bb-adminchat-chart-empty-icon","aria-hidden":!0,children:"◌"}),d.jsx("div",{className:"bb-adminchat-chart-empty-text",children:"No data yet."})]});const l=i.length<=1,u={top:10,right:14,left:4,bottom:6},f=t==="pie"?360:t==="bar"&&i.length<=3?460:t==="bar"&&i.length<=6?620:null,h=t==="pie"?240:i.length<=3?220:260,p=f?{maxWidth:f,marginLeft:0,marginRight:"auto"}:{};return d.jsxs("div",{className:"bb-adminchat-chart",style:p,children:[o?d.jsx("div",{className:"bb-adminchat-chart-title",children:o}):null,d.jsx("div",{className:"bb-adminchat-chart-canvas",children:d.jsx(tV,{width:"100%",height:h,children:t==="line"?d.jsxs(sfe,{data:i,margin:u,children:[d.jsx(lp,{stroke:Hd,strokeDasharray:"2 6",vertical:!1}),d.jsx(cp,{dataKey:n,stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,tickMargin:8}),d.jsx(up,{stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,width:32}),d.jsx(Wm,{content:d.jsx(Zm,{}),cursor:{stroke:Hd}}),r.length>1?d.jsx(Qd,{wrapperStyle:{fontSize:12,paddingTop:8}}):null,r.map((b,g)=>d.jsx(K3,{type:"monotone",dataKey:b,stroke:_r[g%_r.length],strokeWidth:2.5,dot:i.length<=30?{r:3,strokeWidth:0,fill:_r[g%_r.length]}:!1,activeDot:{r:5,strokeWidth:2,stroke:"#fff"},isAnimationActive:!1},b))]}):t==="area"?d.jsxs(Ofe,{data:i,margin:u,children:[d.jsx("defs",{children:r.map((b,g)=>{const x=_r[g%_r.length];return d.jsxs("linearGradient",{id:`bb-area-grad-${g}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[d.jsx("stop",{offset:"0%",stopColor:x,stopOpacity:.35}),d.jsx("stop",{offset:"100%",stopColor:x,stopOpacity:.02})]},b)})}),d.jsx(lp,{stroke:Hd,strokeDasharray:"2 6",vertical:!1}),d.jsx(cp,{dataKey:n,stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,tickMargin:8}),d.jsx(up,{stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,width:32}),d.jsx(Wm,{content:d.jsx(Zm,{}),cursor:{stroke:Hd}}),r.length>1?d.jsx(Qd,{wrapperStyle:{fontSize:12,paddingTop:8}}):null,r.map((b,g)=>d.jsx(Z3,{type:"monotone",dataKey:b,stackId:"1",stroke:_r[g%_r.length],strokeWidth:2,fill:`url(#bb-area-grad-${g})`,isAnimationActive:!1},b))]}):t==="bar"?d.jsxs(cfe,{data:i,margin:u,barCategoryGap:"22%",children:[d.jsx(lp,{stroke:Hd,strokeDasharray:"2 6",vertical:!1}),d.jsx(cp,{dataKey:n,stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,tickMargin:8,hide:l}),d.jsx(up,{stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,width:32}),d.jsx(Wm,{content:d.jsx(Zm,{}),cursor:{fill:"rgba(91, 108, 255, 0.06)"}}),r.length>1?d.jsx(Qd,{wrapperStyle:{fontSize:12,paddingTop:8}}):null,r.map((b,g)=>d.jsx(rq,{dataKey:b,fill:_r[g%_r.length],radius:[6,6,0,0],isAnimationActive:!1,children:r.length===1?i.map((x,E)=>d.jsx(yu,{fill:_r[E%_r.length]},E)):null},b))]}):d.jsxs(jfe,{children:[d.jsx(Wm,{content:d.jsx(Zm,{})}),d.jsx(j3,{data:i,dataKey:r[0],nameKey:n,cx:"50%",cy:"50%",innerRadius:55,outerRadius:95,paddingAngle:2,stroke:"#fff",strokeWidth:2,isAnimationActive:!1,children:i.map((b,g)=>d.jsx(yu,{fill:_r[g%_r.length]},g))}),d.jsx(Qd,{wrapperStyle:{fontSize:12,paddingTop:8},iconType:"circle",iconSize:8})]})})})]})}const Nfe=25;function Tfe(){var r,i,o;const e=xb({queryKey:["admin-chat","conversations"],queryFn:async({pageParam:l})=>{const u=await me("AdminChatListConversations",{page:l,pageSize:Nfe});if(!u.success)throw new Error(u.error);return u.data},initialPageParam:1,getNextPageParam:l=>l.page*l.pageSize<l.total?l.page+1:void 0,refetchInterval:3e4,staleTime:1e4}),t=((r=e.data)==null?void 0:r.pages.flatMap(l=>l.conversations))??[],n=((o=(i=e.data)==null?void 0:i.pages[0])==null?void 0:o.total)??0;return{...e,conversations:t,total:n,hasMore:!!e.hasNextPage,isFetchingMore:e.isFetchingNextPage,loadMore:()=>{e.hasNextPage&&!e.isFetchingNextPage&&e.fetchNextPage()}}}function Pfe(e){return Et({queryKey:["admin-chat","conversation",e],queryFn:async()=>{if(!e)return null;const t=await me("AdminChatGetConversation",{conversationId:e});if(!t.success)throw new Error(t.error);return t.data},enabled:!!e,refetchInterval:!1,staleTime:3e3})}function _fe(){const e=Ne();return je({mutationFn:async({conversationId:t,message:n})=>{const r=await me("AdminChatSend",{conversationId:t,message:n});if(!r.success)throw new Error(r.error);return r.data},onSuccess:t=>{e.invalidateQueries({queryKey:["admin-chat","conversations"]}),e.invalidateQueries({queryKey:["admin-chat","conversation",t.conversationId]})},onError:t=>le.error(t instanceof Error?t.message:"Send failed")})}function Dfe(){const e=Ne();return je({mutationFn:async({conversationId:t})=>{const n=await me("AdminChatDelete",{conversationId:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:()=>{le.success("Conversation deleted"),e.invalidateQueries({queryKey:["admin-chat"]})},onError:t=>le.error(t instanceof Error?t.message:"Delete failed")})}const RS={status:"idle",tools:[],text:"",lastSequence:0};function Mfe(e,t){switch(t.type){case"reset":return RS;case"connecting":return{...RS,status:"streaming"};case"event":{const n=Math.max(e.lastSequence,t.sequence);switch(t.kind){case"tool_call_started":return e.tools.some(r=>r.startedAt===t.sequence)?{...e,lastSequence:n}:{...e,status:"streaming",lastSequence:n,tools:[...e.tools,{startedAt:t.sequence,toolName:t.payload.tool,status:"in_progress"}]};case"tool_call_completed":{const r=[...e.tools].reverse().findIndex(l=>l.toolName===t.payload.tool&&l.status==="in_progress");if(r===-1)return{...e,lastSequence:n};const i=e.tools.length-1-r,o={...e.tools[i],status:t.payload.ok?"ok":"error",error:t.payload.error,artifact:t.payload.artifact};return{...e,lastSequence:n,tools:[...e.tools.slice(0,i),o,...e.tools.slice(i+1)]}}case"assistant_text":return{...e,status:"streaming",lastSequence:n,text:e.text+t.payload.delta};case"done":return{...e,status:"done",lastSequence:n};case"error":return{...e,status:"error",lastSequence:n,error:t.payload.message}}return e}case"connection_error":return{...e,status:"error",error:t.message}}}function Rfe(e){const[t,n]=v.useReducer(Mfe,RS);return v.useEffect(()=>{if(!e)return;let r=!1;n({type:"connecting"});let i;try{i=Re()}catch(f){n({type:"connection_error",message:f instanceof Error?f.message:"config missing"});return}let o;try{const f=new URL(`/api/admin-chat/stream/${encodeURIComponent(e.conversationId)}`,i.apiUrl);f.searchParams.set("since",String(e.sinceSequence)),f.searchParams.set("apiKey",i.apiKey),o=f.toString()}catch(f){n({type:"connection_error",message:f instanceof Error?f.message:"invalid apiUrl"});return}const l=new EventSource(o),u=f=>h=>{if(r)return;const p=parseInt(h.lastEventId,10)||0;let b={};try{h.data&&(b=JSON.parse(h.data))}catch{return}n({type:"event",sequence:p,kind:f,payload:b})};return l.addEventListener("tool_call_started",u("tool_call_started")),l.addEventListener("tool_call_completed",u("tool_call_completed")),l.addEventListener("assistant_text",u("assistant_text")),l.addEventListener("done",u("done")),l.addEventListener("error",u("error")),l.onerror=()=>{r||l.readyState===EventSource.CLOSED&&n({type:"connection_error",message:"stream connection lost"})},()=>{r=!0,l.close(),n({type:"reset"})}},[e==null?void 0:e.conversationId,e==null?void 0:e.sinceSequence]),t}function qR({open:e,title:t,onClose:n,children:r,headerAction:i}){return v.useEffect(()=>{if(!e)return;const o=l=>{l.key==="Escape"&&n()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[e,n]),d.jsxs(d.Fragment,{children:[d.jsx("div",{className:`bb-agent-drawer-scrim ${e?"bb-agent-drawer-scrim-open":""}`,onClick:n,"aria-hidden":!e}),d.jsxs("aside",{className:`bb-agent-drawer ${e?"bb-agent-drawer-open":""}`,role:"dialog","aria-label":t,"aria-hidden":!e,children:[d.jsxs("header",{className:"bb-agent-drawer-head",children:[d.jsx("h3",{className:"bb-agent-drawer-title",children:t}),d.jsxs("div",{className:"bb-agent-drawer-head-actions",children:[i,d.jsx("button",{type:"button",className:"bb-agent-drawer-close",onClick:n,"aria-label":"Close",children:"✕"})]})]}),d.jsx("div",{className:"bb-agent-drawer-body",children:r})]})]})}function kfe(e){const t=new Date(e).getTime(),n=Date.now()-t;return n<6e4?"just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:`${Math.floor(n/864e5)}d ago`}function Lfe({conversations:e,total:t,hasMore:n,isLoadingMore:r,onLoadMore:i,activeId:o,onSelect:l,onDelete:u,onDeleteBulk:f}){const[h,p]=v.useState(new Set),b=v.useMemo(()=>{const j=new Set;for(const C of e)h.has(C.id)&&j.add(C.id);return j},[e,h]),g=b.size,x=g>0&&g===e.length,E=j=>{const C=new Set(b);C.has(j)?C.delete(j):C.add(j),p(C)},S=()=>{p(x?new Set:new Set(e.map(j=>j.id)))},A=()=>p(new Set);return e.length===0?d.jsx("p",{className:"bb-adminchat-rail-empty",children:"No conversations yet. Close this and type a message below to start one."}):d.jsxs("div",{className:"bb-history-drawer",children:[d.jsxs("div",{className:"bb-history-toolbar",children:[d.jsxs("label",{className:"bb-history-toolbar-select",children:[d.jsx("input",{type:"checkbox",checked:x,ref:j=>{j&&(j.indeterminate=g>0&&!x)},onChange:S,"aria-label":x?"Deselect all":"Select all"}),d.jsx("span",{children:g>0?`${g} selected`:n?`${e.length} of ${t}`:`${e.length} conversation${e.length===1?"":"s"}`})]}),g>0&&d.jsxs("div",{className:"bb-history-toolbar-actions",children:[d.jsx("button",{type:"button",className:"bb-history-toolbar-clear",onClick:A,children:"Clear"}),d.jsxs("button",{type:"button",className:"bb-history-toolbar-delete",onClick:()=>f(Array.from(b)),children:["Delete ",g]})]})]}),d.jsxs("div",{className:"bb-adminchat-rail-list",children:[e.map(j=>{const C=b.has(j.id);return d.jsxs("div",{className:`bb-adminchat-conv ${j.id===o?"bb-adminchat-conv-active":""} ${C?"bb-adminchat-conv-checked":""}`,onClick:()=>l(j.id),role:"button",tabIndex:0,onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),l(j.id))},children:[d.jsx("input",{type:"checkbox",className:"bb-adminchat-conv-check",checked:C,onClick:O=>O.stopPropagation(),onChange:()=>E(j.id),"aria-label":C?"Deselect conversation":"Select conversation"}),d.jsxs("div",{className:"bb-adminchat-conv-body",children:[d.jsx("div",{className:"bb-adminchat-conv-title",children:j.title??"Untitled conversation"}),d.jsxs("div",{className:"bb-adminchat-conv-meta",children:[d.jsxs("span",{children:[j.messageCount," msg"]}),d.jsx("span",{className:"bb-adminchat-conv-sep",children:"·"}),d.jsx("span",{children:kfe(j.lastMessageAt)})]})]}),d.jsx("button",{type:"button",className:"bb-adminchat-conv-archive",onClick:O=>{O.stopPropagation(),u(j.id)},title:"Delete conversation","aria-label":"Delete conversation",children:"🗑"})]},j.id)}),n&&d.jsx("div",{className:"bb-history-loadmore",children:d.jsx("button",{type:"button",className:"bb-history-loadmore-btn",onClick:i,disabled:r,children:r?"Loading…":`Load more (${t-e.length} remaining)`})})]})]})}function jq(){return Et({queryKey:["integrations","search-console"],queryFn:async()=>{const e=await me("GetSearchConsoleIntegration");if(!e.success)throw new Error(e.error);return e.data},staleTime:6e4})}function Ife(){return je({mutationFn:async()=>{const e=await me("StartSearchConsoleOAuth");if(!e.success)throw new Error(e.error);return e.data},onError:e=>le.error(e instanceof Error?e.message:"Could not start sign-in")})}function zfe(){const e=Ne();return je({mutationFn:async({property:t})=>{const n=await me("SelectSearchConsoleProperty",{property:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:()=>{le.success("Search Console connected"),e.invalidateQueries({queryKey:["integrations","search-console"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not link property")})}function Ufe(){const e=Ne();return je({mutationFn:async()=>{const t=await me("DisconnectSearchConsole");if(!t.success)throw new Error(t.error);return t.data},onSuccess:()=>{le.success("Search Console disconnected"),e.invalidateQueries({queryKey:["integrations","search-console"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not disconnect Search Console")})}const BR={path:"M12 0C5.24 0 0 4.952 0 11.64c0 3.499 1.434 6.521 3.769 8.61a.96.96 0 0 1 .323.683l.065 2.135a.96.96 0 0 0 1.347.85l2.381-1.053a.96.96 0 0 1 .641-.046A13 13 0 0 0 12 23.28c6.76 0 12-4.952 12-11.64S18.76 0 12 0m6.806 7.44c.522-.03.971.567.63 1.094l-4.178 6.457a.707.707 0 0 1-.977.208l-3.87-2.504a.44.44 0 0 0-.49.007l-4.363 3.01c-.637.438-1.415-.317-.995-.966l4.179-6.457a.706.706 0 0 1 .977-.21l3.87 2.505c.15.097.344.094.491-.007l4.362-3.008a.7.7 0 0 1 .364-.13",hex:"0866FF"},qfe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACHklEQVR4AWKgFXBoAFRfBhDNRAEAPu5+P4FJKKgREGm2VZF03VKUdG0E0IAiLCgpadVuAbYQFJVUW5FBxLocIMAIITiEaPHUltUtXvcuPWvq6eq96PHB4b7v3r173gGHFH2Yl5S8bgIRPiWv+aL5EY71EBXgkpQcsMQfkzEDnWzky8BJkpfOBpOALvPGRHkJ+HXQfXqylOksiEs5EQu+BqAaICn3QZsB8G8HuDZlh2dPlr0JfxjRFktt/VpA80Eg5EkGgDcZgG80xBZh7fgFdM9csw3w7vvnsbgsoGb03KJx6opNgDvhD2IpIQDROpelH2C+68xXA+pDl9QC8KLDQnIARly6pxfgTcii3YCOBfCHA6DGOYxTPoh4Vnl58rAtyDoAi4sqnyqqAiwlu1MJY5PdbAMKGuc0VF4vk1sUNhzwxtcMz4bbYef2EJsALCcEINZCEv2A4okgYiE5wGJ4dYBugKEKcTsBkdkeugGmRLMTsDsm0g14SvNbpICnwwosx+vAXgD5RPR48m/CkhHI9rtxwPRi748CfJG89sH3LwBSwN10nSXX+1pg3/rgjwLE8lOxoXGuosoTA4yj//DW34Q3pG8HRHMpgpwUwQN9vyrsSQb07wZ0mVOPft0+lRtpzlU45pzG66LMGKe8bpEW4tC8XnY40VAMomElrFePnr+jPQx0U/pK5CGFju5Y/JmcYzgIW++vy/HmEyfImY8XZOkOdzPDZqcAAAAASUVORK5CYII=",Bfe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABXWlDQ1BJQ0MgUHJvZmlsZQAAKJF1kEsoRGEYhh8ORhpZUCTlLGSFGNLshIWUxRiUy+rMmWuNmd85R7KR68KKLGSJjY01S5KNnVIWoqwtKRum4zszNC756u17env/v7cPSv2GUukyHWYzjhUeGtAnp6Z13xMV1FBPI5ph2qo/FBpB5mv/nNdbSrx90+79tRpcvjprzh6MWl3a2srSxd/8j6mKxmxT9ruoxVSWAyXShtCCozxWwnWWlBJe9zhR4D2PIwU+zmfGw4PC58K6mTSiwo/CbZFvfuIbz6bnzc8OXnt/LDMxJrtS1IRNmCEG/sn05DODZFEsYpEiQRIHnX5xFGliwsNkMOmgTThAp6jXu+3vmxW97D4En0HbKnqRXTjdhIa7otciuZoNOLlUhmXkLU1UGk/B8xFUT0HttZx2xo53Bwrt/X1Q/uC6L63g24bcjuu+Hbhu7lAe38P53AcLDmT0xSwuwwAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAAD4/042AAAJdElEQVRoBc1afXAUZxl/3nd375IcgQZKS5HPkkid0BQai0gBU5kyUAq12jLO2DpTderQUf9QGQoGPadUmP5HtWNbZ9QZq2PbabG2WCdQyDc4JlBDaQslRKSln5CA5OPudvf19+zennd7e8eGU8Iz2dvd9332+X6e99l3I+h/AA/WdxmzyufNVlKfL0ndCpI3Eck5guR1SpFQwv5AkN0rSPUooTqUoEPJj4+fiB+pTZbKXpRCYNuSZL3UtTW2LVZIorlCiIlMT3kHXwAEuDAjj5lSagBTR4VUe2xlvZRo+Vl3nOK2gzzKH49m6Meeu1dpJz6wVpKQ6yFwgyYpBiuTnT7CEGKFNBx8tmwahsotZNtPXTWk7fp2t0iFoeHhjEqBrQ3JRYbSf4SH79CEkCaEZuFLARYARmA6CuHVZCnr0c0tRltYmqEUiNefrojGrt0ghfwBLFdpwtklyh0onwFFLFsNIWt2kHl228aOyf8ORMwavKgCWxf3z9T1CU/oUqy2RhEmWTxGdclhpbuK7E5qyfVb9pb1FiNQVIHtyxI3CmE8g3CpS11SihVjXXyOvWEr9XZSmPc3Nke6CmEXVCAt/AsQvuZyC+8Jy55AxToJJe4ppESgAtuXDM8QWnSXFGIex/tYghtOdEzJxOpNzWXH/bJAx1zghBUy+kvE/JgLz5KxAaHEp4WKPB1vUONypcVy6R+IxiZv0KS4I2n5Z8bunkNYF+K2MmVv8UuRE0LbvpC8RZL+GpaYSl6YriTg6oQ2Zdi0E6s2t5W3eLJlPPBUvTJIGXEk7RUnPAvLCyZW/nKEdzze0FeWp0D/eGuFFLRyrJPWEyzozLLB4g1Rc+oab97xQLxhn64s+RBWWTnqyMkJQo9s1vli81momW6vyDOojOg9tIfitUci/KijgGHdWseacW+TBxgzh7CojGCGS6rvsAfd+aDewkYhSKEZUAk8hoPpBPVOCjRToGNjnky0E3jGZH4BgOYPesrFkYmzb+FpnX+k0NaibFYkWTg/QIGFXye6YRlRpCJXADbUMJi93Uz0+osgrGEgbT0LPWVFJdGi7xDNqINwoH20lajrWS+eXUYsvIbnFn6TqHoxeCC6z31E1PMK0XG0dNJw8bxftrEhRCQljLtx2aHHaxVcoVaATh6wFWqWEa34bt5UzsDseqIkLMhMjXJQA7Eozl9+jGgmXm08mD7Pxet+3sXjcRuvNCsbiRZkoprourlQ5vNEv19P9O4bUNAJFo8K6OMSXljOa5akqsQsQeKGoLKpEAKTav77YLGrOUtBNG19DpXPfjVXeO/ZaryvOR0/cFPAq8Zz87OE9/B0xMZVM1zPeWPemZtKMKsxKiZVy6gUC8C4KkgBCSLvv46YhCIXgwgszvLbiOEJU6HAPcFPGFEXj81oIDwWP5C+96EPw6On/+GGl2/KySMkc4yUWKST0pYITmXWygcamJ06RPSnHxPVrnLdzgJM+wxik+M9G1y/Osm34CtE46qyJ7Ou03zY+nV3Ek2vzZrLujy0k+iTPvDMax7SSKCjaXKpDrPdGFQZPFoS8ffWHhy7YV3kxKTZRN96DjHuVwDmt5G4E6cR3czpVQScHIkhwe8PRjr7PtHffgcB4dVCwHZAu41NBBJz0kYphEs6KoMOYhqYslcKgQUFb15HFJtQCAPjUJRzpG4t0bXX5+OxLO2/IrpwBl52amQ+Do84Ia/ETISSnFLMA8GP549aqCZV05GQEKwYKORIBRRciCQPgr4uojdehcFQsoPCOvsZlP9xHP2wSenAllv4Dbf2F6PG7UD9Awg1JLofkvBg8xOwLnC8iubH8d/ryrY/FFJOLdULV88kmjU/l3wCAnkLmjdThRyZMte7yz0ffInovZ4iiZuLTtjBGJTYNcOOWelwDRSoGJ9Lp2cX0cDp3LHJCLPxzvZX7vjAh0jc3yLHMn1m7rz/Do0nSSn+KSWJnrDu8hMpdn/hHARCMgqOrRDQ/mui8x/ntw6FHnWMbqvD0qJUZ6nhE8Tk4ItE/afCCXQSi+Xhl8MlboYXNFDSbpMilTqITbFz7JJQEMKiHA7df4RAHA4XwTexdrQ8iVxBdQobCYyHRB8SKnVAVk+rPAEmR8MowKvvELrP4YHiqh54BnX8EzBBjbvQXxz3ECx/EqWT15mwwLLC6Mf1sopjct3zIolt791hHMDt8iAE60GdLgRH9hFxG6Bj0VNQoAcCFoJT6DRbfxE+cT06bu239m1oEoN8TSll/dlUaiSMC3mB2f8bHAgR9gZHCB9D54k6/0D0l0fce6bFIfRmE1HTDiQoVlbGY+Dyeng30Qs/JBrBdV5f5aIF/rKh0UIg8AhZll7EnA8Usfm7IlK7PcwuHPcyFt6wqj6FzvNqUIFkAxBw4F3Xmk5zyNTTwK1D5RQsXtdgHl48jxA8cwrMYb5i7YL3fPaZN7psW7WVx3pv/96rNYlM5Gy/zbxL2tpO9BhhK5/TvHH7zMBvTs7bk2dmd9j9BRfG42aPleVQ9L+kZKMXu+bvCvgo8rWHW3X4Gzw95PfK+v6Kre3XWMOwwAJz8vHhWDJIeCaGcQ6TTFOIDvdSgGWzlOqIpDRkmQsZcX8Od1gq8VN4YDBMLngELteZQwXrVYKkFf/+foGvOi5kFODbxvbydss2H9czgZXGugJOrvXtJzc1G3uyxclRgCf0cv1RE6HE+/NXChgIP8jUKSLnfuKXKdDWj3xRzYlYhO11mjvWO3VseXwj6MMHtNUbW8VbfgUC7bxlr+hNiaH7+OPCaJLaT7zUe+aNknkaVee+IOGZfqACPNHYHOuyaPheLBpHxyKcmCdbHj3/uodbjU6WKQgKKsDIm1pif0+q5BoosTeCOLwc1YljmnmhXLabdurOzW1GR5Dg3lhRBRhpS2vZO0Mj/XenbPsx9EzD/09vcMhIoRIpy9zRb51fu7kt+qYnaKFzYBIXQt7WkGrQSGtEQi3njpA3WgutXYVo+MdZgPSHbqbVinqzdWOLgU4pHIxKASb5+CoVHRpM3iUo8iC+rC/FpnCEX8Lx5+yYhWHLociux+sgl0cTkncqsp9ODH60M949FZ1TeBi1Ah5pfHDTI8L8nLTklxTJ5QivGuzRjON59op/q5I95jGDsoNI0F5J1l7g7hw5c+zApf7nikfTk+uSzrxL7Gy0Yq9SYLsPIXYTXjhmCdIchbBdfYGk/S+o1oNOtk1ptD8SOfvOhqYp2AEtDf4D3GhcWooaw70AAAAASUVORK5CYII=",Ffe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABXWlDQ1BJQ0MgUHJvZmlsZQAAKJF1kEsoRGEYhh8ORhpZUCTlLGSFGNLshIWUxRiUy+rMmWuNmd85R7KR68KKLGSJjY01S5KNnVIWoqwtKRum4zszNC756u17env/v7cPSv2GUukyHWYzjhUeGtAnp6Z13xMV1FBPI5ph2qo/FBpB5mv/nNdbSrx90+79tRpcvjprzh6MWl3a2srSxd/8j6mKxmxT9ruoxVSWAyXShtCCozxWwnWWlBJe9zhR4D2PIwU+zmfGw4PC58K6mTSiwo/CbZFvfuIbz6bnzc8OXnt/LDMxJrtS1IRNmCEG/sn05DODZFEsYpEiQRIHnX5xFGliwsNkMOmgTThAp6jXu+3vmxW97D4En0HbKnqRXTjdhIa7otciuZoNOLlUhmXkLU1UGk/B8xFUT0HttZx2xo53Bwrt/X1Q/uC6L63g24bcjuu+Hbhu7lAe38P53AcLDmT0xSwuwwAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAAD4/042AAAJuUlEQVRoBdVaa2wU1xX+7syu3zZ2IDiFUB4G1+FV8TBgcEJIQxuTUlRFCQLUNG2TEqnkUdFQkUaqf6RKQktUFalqRF4qTVJKFcU4TVqwcEkw5RGqgkpjDA4EYZNEGBs/dtfenZl+Z5bJer0z+wC7Sq+0OzP3nnvud+4959xzz4zCcJTa23MQ7CuDqVfCh2plYTZMazKUdUOUvdYBzTprWeoEDKMJGo4iN78VtX8PXe/w6poZ3AsdkxdWQtdWKdO8E0qVQ6GIP8Diz5S/QUVjg9NmoZtEpy2l7YVm1qHl8FHsgjGIOu3bzAWonZGFUMFKjvCwUqoausqxwZqssYaA9oKhOKzGRhHKsEKWZR2AiReQ17sbtScHvLq51WcmwE8X3wbdfIoqsjw6OFGnidltcLtOEOiUhitGVnthak/juYPvedIPaUhPgE1LCqFHnlRQjxJ4HiIy3SNQfLYgAS7kNtrTL7ClqSfVKHoqAvy4aqrKMncoTbufs+RP0O2UDDIgiNqNX/n0agWzEpUT/oFDFy4n45B8BTYtmA9d36F0VCA8QrPuhc6vwTLRjIjxHWw58oEXmbcANnhtl9LUpOtTGRlCfiZ13OId1eTqM2+SF6qUZVrnYJj3egnhLsATi8ugG+8oXSuPB69gGXQSZoQDD+5K81ME5stirVNPWjMMRPpJG6ChjoJP83NCqdYG67V80vvpfX1sT+IJRAjDbIGhr8AvD7YOldgZLVZfe3uBCgXrONod8Woj4ENYMWk+ykdzUayo2xYGBgE0d5xG4/kPYdmAWBvuRkVxKWqmL8eyybMwung8sn3Z6Al2ou1SG/a0HkbDmUNo77sC+AspSAxCwh3ViRO5z8rJXcXNr3dwu4gfX0KBp6j3Q8ALCUcwuvDY4nvw9Tl3xffhkxEx8GLTn/Bw/TMo1H3YsPQH2Lj0uwQ+JoFWKtZVr8a5Tz/GrxpfxsvH3kJQcfU0D58i9icT2h/8GbtuHswwvsfmBbcqpdGFwT+YKHovAvRh9cxvoHxceUKzpmmYP2kW2i6cwqPV6/D48geRl5OXQDe4origGCtmLkN5USkaWhoQNHWuhNiISxEtVWoubh33Pg60nXcoYgI8UpMNf2i7rfdDwwCbWgToxdpZNa4COAyXlC3EgqnznMe0rjNuvgWT8ktR/599MGgnnkVno4mJmDN7J46csXU4Jm7+5W9SwmXxRjuUlcWVjMk8tFWeRxeVuFWnrFtddQ8emHs3rAFRcQ+D4AZqYyzovNthGEXzwjw/OvVfK11NSbpRWWFUlc5Anp6NK4EelBQWC0OHV8L19CfnsP3ADuw6sgv7m/ejJxRG2ZgJNLFE05POFWOn4rV/vY2QQS/npUo6AygDY3B/6Rt4+6IZHX3TwkUE38hgLCeZR5OZybUGGFV0o+qm6ah/7M/IynJf8j8efhOP7H4Ol8TLMHiKFh0rp83FS2ufx43FY6/WxV++//uNeOV4A5Q/N77BeRLESoUsw1qGLYcPRVVIxyo7qnTGcYgTrhYCyo8e5COIsNdC459nj+PBN3+OSwMGVE4JVPYN9g/Zo1DfchQP7XwS/WH3oHNlxVJuC9w37A0vAUB0y5AIWDDbVDyM2NGlq+EmMrCXjH9aEtV56eAO9IUJXpfVkVmJ/riTABRo96mDaPywKZE5a6aNr0Be9mjeJTkeECsh3Ali1+yTFFBO6x6W0h3oxb6PW+i3xYUK8PgiO7UcG/Y074lvuPo0vmgsJuaN4i6eTACbuFywa+RXyeksTPsw4jpsrLIr0IW2vjbqqbuh2kLRG1643OkmH3frLOT7Ob+M5DyLzIBSPP3plQw0eKoa1sKBkw0uY1H9jCT40oZjoZqqrM12Wem0eQwlLMotxo154yiElwpwdhnkjSmkivF2aBkIhxFkrOfpRp0O9iJgtgbTnJzU9zsd0rwW5xXhjgnTGHwFBYV7L67QorIq17aLPZ/hfEBcb/IN08ZM7LQBdTX14cov80pifmDRGmRpjP9tVYoJIb7DCvdi3k0349uzl7vybm5vRk9/B2HFggRXQqkk9jSoPLt7Niz5ykI8X/M4siNdDA16YEVCBN4HhDoxZ3QpXl3zG0gg51Z2n9xLYDlsSvRgbvQ+TtNlSuIe87r1SLPuR1/7IWaOm4HXju5Ee1c3CrI1VE2Zj7WV93EXdh+upb0V9acP0YGJAGkUYvcR/Dm60THDaQfO0EtvWQL5mXQ5Em57mYTQi2d8tmEbOkJBhhEFUuOwcb9KTslSZzWeU48nY+zeO7NaTfI+MVNw7bx9/+t45cQ+gudRMxV44SD4LfMEjZhZsWEs3cFenL/UnhHHF/e/gSfefZ7n5jRVx+FO7NzImGg1rR6qklN9XddAuB/fe30jGk++l3Iiz1z8COv/8BM8VP8sk6XiENP0KYLVsroFu8/OEoeCLew/L1n8lK5UOYz1WzsvoebVDbhr6gLcN7MGFV+agvz8Eo5poS/QidbPzuOd5kb8tfUoPu1jnjerIJWGxQ8vcpo4Ldh9POWHrM1Veyk8BUhhOPFsXJ/EGP16FvqRhbqWD1B36gB8Ph2ar5gTxn0gchkRSU2qbAZ82VBZheST4bg0YE7GXsEeXTODKW5miTObBlf8sUous/LnEGAJIloRBnjKCjMfFNFGccZ5RuCBJaoyGYIXTResBupksKgAZZFj3DSb7CxxDMIw3dnzTrAUSH7Rdbh23vRoNlZiFiZRAdYfC/PutzTmDKfj2nFcc0/BKFgF8+cCyF1vyV+oV41MO8jTF7NImlEwEqsDMIZ227v93BNquQoBrrXT/sW5CiYbGzEK1qslJoBUPHPkfe5u23jAd9o9r0Khu+SIdAkZRqIQk42NGAezTzz35eQ9jVCwEn7NJT/qdFV23rfjSgf8fr9TaW/vXb3ddBLDcdyKsSUWO7kLwTakuE+1Z3rd6W0hT/Phy7n5CZ7XoI19xHAiMlz+QPQ+o/S6gzHFCw55WcEw06GOv1I495mJJ0v5JOBTvODwPrc1tbVj8Ti+lNZuU77EcFs8umxErr+UyNIgcF4xGeYar7czwsVbAGkVIeZP+JvSrem02Cm0Iqkd2SJLJ67ctBoQUuuw9fC/kw2YXADpKW8JF098i1YkGYy5FGTk3lQKcL6Poq/fCsO3AVsPfiIVyUpmqiovujW+6Ab+z150D54C+dQgUPAtbufrGdsM36cGwO+Q01s/sp8aDBZEPvYo58ceJj/2sEzmSNQ02nX6H3tYVoulaQ1M0dXh7P/yY4/BQjj3n39uwzyrri/hW/avwtIm0RIlzczCz22UeY5R2HGGwfRsxrB9bvNfoyKHgWAuXx4AAAAASUVORK5CYII=",$fe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABXWlDQ1BJQ0MgUHJvZmlsZQAAKJF1kEsoRGEYhh8ORhpZUCTlLGSFGNLshIWUxRiUy+rMmWuNmd85R7KR68KKLGSJjY01S5KNnVIWoqwtKRum4zszNC756u17env/v7cPSv2GUukyHWYzjhUeGtAnp6Z13xMV1FBPI5ph2qo/FBpB5mv/nNdbSrx90+79tRpcvjprzh6MWl3a2srSxd/8j6mKxmxT9ruoxVSWAyXShtCCozxWwnWWlBJe9zhR4D2PIwU+zmfGw4PC58K6mTSiwo/CbZFvfuIbz6bnzc8OXnt/LDMxJrtS1IRNmCEG/sn05DODZFEsYpEiQRIHnX5xFGliwsNkMOmgTThAp6jXu+3vmxW97D4En0HbKnqRXTjdhIa7otciuZoNOLlUhmXkLU1UGk/B8xFUT0HttZx2xo53Bwrt/X1Q/uC6L63g24bcjuu+Hbhu7lAe38P53AcLDmT0xSwuwwAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAAD4/042AAAKE0lEQVRoBe1Ye3BU1Rk/37m7SzYJDu9AeIXd2A4y2iK20od1LLZK82AQw7RSR6d2gIZsAK2URHHSsSDR6UBepINTC6V2SmiFkIQC1Ymi09Epth0pVjC7SRAFKiRq3rv3ntPft5tNNpvdTfA/Z/ZkNvfcc77363z3CJEcSQskLZC0QNICSQt8gS1A1yN7tuewWyljoZAyWxBlCKEnCKUH8H5ZCPW+1Oa5lqqV3kQ0swqbZkqbXCS09SUSlKlJpwlBAa3FVRLaawr5nmuq8/yrZXeZieiE98ZU4Jafn0jrGvAvF1rcT0SLBYkpmNtAIISrgzNNJEwI0QGh/oXnofRPbcffOXBPT5gRP93Fjd8EeA3wZ+PVPrgXlkFjYmH/M6y/q6U47Df9Rz6sue/aIFzMRxg55qbL03i30LSFSN8KwhJW10JrCSEDePrB0YIaBmAc8IYd+wrr0EUoEDytyXjOV7n8lTDxBZ6GIhjh11Cgl4XF+gDowtIEmsKBOZTCfwE+IIq190C/0jvldJ0oK2OaowZgRo9sz7EJlrAeJ5KFEGhCyNgIFUFnQPl1Q8p3lFQfSWH1qYB2KmmbTUrfQlLcAdFvBmc74Jj2AGm9e5J/1q63994W4PAhQzzKZiCh/mmRbrfZHF3CVA6EUoYW6iah6NvAXALciSCgAMhGO2iatO1CbW5ntLSjFMhc25CakkLPAekByBAAAGSg12D1PdY059/byu7qjyYSfp+zuc7pMFO/hfefge+dQFVQhMNtv+pKK2nbFx83TEOUNdtcnf2LSZlrtZC5oGOAvwPObRYBxzrvb+753xAsJiMVALL7Ws9OxPBPYUU/nr0wwrOT/ZnPswUjERPNl6w9be9IubIWmm+B4imIKw6NA3pq+i8SGSCaJkL4Pqw9jd8MSGqDIidTrdRHzu65qzsMO0KBBUWNjwCwXHIMa9GlpeFBDB8LA1/vEwLkgE4NjJGKOLALLfer7tSt4/LEILP5GxpuNaR4HoaYx95E+NV4q3OfDMsypIC7sD5b2YyjUtM0MDMRpR5fdc5fwoCf95ld3LRCaV0BRqnIQoTT9Xsi23N0qRLG7xFOk6CECXoPtFXnvcoywdiDQxrroN0sAHBV2Tde4bnMuguPZ2etP5y1qKAO1WjkaKnMqVeKNoJuL5hxxXmQrnWXzymoc46EjP/WUpX/pta6HNEBO9AEKal4UdnZIK+gAlnr/5qFbEfCcFnUFyx/f1V8cqGdRYV16QiRTT0DgZNCmiek3XGiN8N5FGFYEI3bVpNTL0mNUMI+w7mTkz4aNt57wN77R+TkW/ACAkR8o/da6+0MG1SAbNYyzFHGBNfjP7fvXXUpHiFeZ+F7ZWo1pr/E78tQfgpCYzpq/Nck6doFxY3bULeHvQuglsp8KBHhCUkP2k3nzqyHm1OwPea4uGt1H6rSPvgAYooU8MplpEEm+o5QQaJu02+NmbT9lPYTJOZK4IMofQKjAIdLregHdQvPTa6OJU+JgjqDmYRHMJyiPGFM7C7PKhufEjJgnAL9i6CHiNJf5/CVOLRuQGhlh5jodnuXPWEvw+eEIr0KQnL/0oMGYr2vOm+N73LP/Uqrp0ALBUCbpKnINSvtScwBOjza4AkVoYRCTsirvTvHo8TgGfAfUMOZKeZ0+/2Z0nL0TQYH9DfoPoT4oOXFH3AvEnfYDJqJOJsJSxjwwlu+2tyXg8CHVlut1fm/Be0n8ENPo3HQas+C4qaSWEoEw4moB/0Jzhf9sHGtd21cppEbWvn4FZ5P05acJSngcCCuuI/h4ErYODGiwyb9ALTww5++oSAqTLxVOfvghdKQEmTBKo8GlRiVEzn1pNRmEOkDa1biIUTDdOaRaMDOV0P7WkKMyYM5EEYZ6e7wauRzzlTnZUXiPNIdRqAlb2ekFUfu85yVgECPo98xARRUIpgTUUp4q/OOgMZLUMKG1m2WttSN0bQSvhuGkNruZ4tydwlHEKpJ4sF9OnJgL3CCXSSQtro8RzdFY/mq8l6ER7dAEYQTIZyQE5zYUTmBM/9TeAtgWlqGCrfY0eSG3tETTQu9kCJLdErD7+wEo45gK4zjmpN6CDrOpL0y7xhYbkfQDXrQKHEVN22MBmcl4IVSnC3DShQ3lYXrf7bnyE3Yy0UIwRjiM2XKD6JpjHon6Qquad1DhrokW6qQtCTeHwSch+LiHoUUYwFhUgm3/wqmC1UZLUpdGxpHecJblb8P1kdOhJSAtdfbA6mHXUUNLyhh+xPW58GbDvz+dqE2pzUGq6El9/qXZqAwLMICWNOHTrPvUtCCWqs3sMbr6TgscoYwxpj4KnMqALIDvV/IE5JKYoVTMLFJlHBOgIedDzx4fCU0z0TYpiAHTtuFYzuUYyHiDmW3fwd4cwEANP2Ps3tWd4cY6zQuhVdAEB8QtGpuUX1mXCpRG76q3N0QCuHEgcxmoNJY4eStzN1vEv0YIK+Azcd4fgLB23Eg1Sirb8256u9/xPjxBp/YCLWHmAFg+kmrRoYNKtBas6ydF6C+gaSabydjVGWJR5jXfVX5uyHMDs4JQl0Ak9KsGIndXpnbDK+tJsv6Hlr1e800uhuHYGnbntW4FEg8KL1rDQJnKeRnW72Jxha/QavxBMnrxkfAUexOhwSW1kZxa/XyQ7w33uEqatoI8k/AEIOhoJ8JeWi8FGLDZW08crtUtgOQLdhOg8caeLSZoUMhhAmS2Ytv4GfBmxs6A4Wh3OU5Pu58YGJowStQjbeDAUjwNziV8Ic8733eMd9zbDGErwHBySgXduTR78LCM80hBfjFe6nrD/DCCzAfEk2moX3fs6CwoShWn8/wsUZQCaWgBNuBXSy3oeLs+Oqm5kmx4BOtuTc0rDSEdQAw8yE8PinFyynWxGcicYJMIhe4WXNOoHIowQkXQNlCUNMpra3agGPgDW5rI+Hjzd2eJuSR4r4IVZQMtA1n8L8GBetEsHTHQ+Tv8o6er+A2gD+w8mABAz9YXryGk2tda8WKK5GooxTgTeQDrlXUY3DPBiiSAiAoj9OaxBkcpKdGXqsYuFYRs6VSi1EepyrTqm6tXXGO6bg8TT8C5tPQYQoSnG8oEFd0HpcVr+MG6d9jXqvwvROsB+sf9Bu2bRd33dvBdCNHTAXCAO6iY98FM7QD4jYwH/tiCx0iZKzCCfxYmAYS+2ZgboUiyyA8fwaCVDDPLMwTXGzBXFrhgJUVvis9BwW63TDNyGdCBRhwCUKq0yGX49KpABZejCXul2z4hXAhDrPCfxxSolNIVeKryB95GYCO1Z2RfidC4IewwlLU/gx4hZXhwXQYnyfDV4tC1xvCOIJw+5j34o0xFYhEnLe50WUzrYUoUjdCgOHLXaIrcPR53NC927Z7eVskTvR8btHJTLscWIiaPny5q3C5S7jclZbPVLb/Xs/lbjT95HvSAkkLJC2QtEDSAl8oC/wfscRvqQNdGeYAAAAASUVORK5CYII=",Dc=22,Kfe={"search-console":qfe,woocommerce:Bfe,pipedrive:Ffe,"zoho-crm":$fe};function Cq({id:e}){const t=Kfe[e];return t?d.jsx("img",{src:t,width:Dc,height:Dc,alt:"","aria-hidden":"true",style:{objectFit:"contain",borderRadius:4}}):e==="messenger"?d.jsx("svg",{width:Dc,height:Dc,viewBox:"0 0 24 24",role:"img","aria-hidden":"true",fill:`#${BR.hex}`,children:d.jsx("path",{d:BR.path})}):d.jsxs("svg",{width:Dc,height:Dc,viewBox:"0 0 24 24",role:"img","aria-hidden":"true",fill:"none",stroke:"#6b6b6b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M22 12h-6l-2 3h-4l-2-3H2"}),d.jsx("path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"})]})}function Qn({id:e,children:t}){return d.jsxs("span",{className:"bb-int-configure-titlerow",children:[d.jsx(Cq,{id:e}),d.jsx("h3",{className:"bb-int-configure-title",children:t})]})}function Hfe({onClose:e}){const t=Ne(),{data:n,isLoading:r}=jq(),i=Ife(),o=zfe(),l=Ufe(),[u,f]=v.useState(null),[h,p]=v.useState(null),[b,g]=v.useState(!1),[x,E]=v.useState(null),S=(n==null?void 0:n.integration)??null,A=(n==null?void 0:n.oauthAvailable)??!1;v.useEffect(()=>{const O=T=>{var P;const _=T.data;!_||_.type!=="bitbot:gsc-oauth-complete"||(g(!1),_.ok?(E(null),t.invalidateQueries({queryKey:["integrations","search-console"]}),Array.isArray((P=_.data)==null?void 0:P.properties)&&f(_.data.properties)):E(typeof _.error=="string"?_.error:"Sign-in failed."))};return window.addEventListener("message",O),()=>window.removeEventListener("message",O)},[t]),v.useEffect(()=>{if(!(S&&S.status!=="connected"&&S.accountEmail&&!u))return;let T=!1;return(async()=>{const _=await me("ListSearchConsoleProperties");T||_.success&&f(_.data.properties)})(),()=>{T=!0}},[S,u]);const j=async()=>{E(null);const O=await i.mutateAsync().catch(z=>(E(z instanceof Error?z.message:"Could not start sign-in"),null));if(!(O!=null&&O.url))return;const T=520,_=640,P=window.screenX+(window.outerWidth-T)/2,D=window.screenY+(window.outerHeight-_)/2;if(!window.open(O.url,"bitbot-gsc-oauth",`width=${T},height=${_},left=${P},top=${D},menubar=no,toolbar=no`)){E("Popup was blocked. Allow popups for this site and try again.");return}g(!0)},C=async O=>{p(O);try{await o.mutateAsync({property:O})}finally{p(null)}};return!A&&!S?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"search-console",children:"Google Search Console"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-error",children:"Search Console isn't set up on the server yet. Ask the BitBot team to finish the OAuth configuration."})]}):r?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"search-console",children:"Google Search Console"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"})]}):(S==null?void 0:S.status)==="connected"&&S.property?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"search-console",children:"Google Search Console"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsxs("div",{className:"bb-int-configure-connected",children:[d.jsxs("div",{className:"bb-int-status-line",children:[d.jsx("span",{className:"bb-int-status bb-int-status-connected",children:"Connected"}),S.accountEmail&&d.jsx("span",{className:"bb-int-configure-prop",children:S.accountEmail})]}),d.jsxs("p",{className:"bb-int-configure-body",children:["Linked property: ",d.jsx("strong",{children:S.property})]}),d.jsx("p",{className:"bb-int-configure-body",children:"The agent can now answer questions about your organic search performance using live Search Console data."}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Disconnecting…":"Disconnect"})})]})]}):S!=null&&S.accountEmail&&u?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"search-console",children:"Google Search Console"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsxs("p",{className:"bb-int-configure-body",children:["Signed in as ",d.jsx("strong",{children:S.accountEmail}),". Pick which property the agent should query for this site."]}),u.length===0?d.jsx("p",{className:"bb-int-configure-error",children:"This Google account doesn't have access to any Search Console properties. Verify a property first, then come back."}):d.jsx("ul",{className:"bb-int-property-list",children:u.map(O=>d.jsxs("li",{className:"bb-int-property-item",children:[d.jsxs("div",{className:"bb-int-property-meta",children:[d.jsx("span",{className:"bb-int-property-url",children:O.siteUrl}),d.jsx("span",{className:"bb-int-property-perm",children:O.permissionLevel})]}),d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>C(O.siteUrl),disabled:h!==null,children:h===O.siteUrl?"Linking…":"Use this"})]},O.siteUrl))}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>l.mutate(),disabled:l.isPending,children:"Sign out of Google"})})]}):d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"search-console",children:"Google Search Console"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Sign in with the Google account that owns this site's Search Console property. We'll ask only for read-only access to your search analytics."}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:j,disabled:i.isPending||b,children:b?"Waiting for Google…":"Sign in with Google"})}),x&&d.jsx("p",{className:"bb-int-configure-error",children:x}),(S==null?void 0:S.lastErrorMessage)&&d.jsxs("p",{className:"bb-int-configure-error",children:["Last attempt: ",S.lastErrorMessage]})]})}function Gfe({onClose:e}){const{data:t,isLoading:n}=eE(),r=a5(),i=i5(),[o,l]=v.useState(!1),[u,f]=v.useState(""),[h,p]=v.useState(""),b=!!(t!=null&&t.configured),g=!b||o,x=S=>{S.preventDefault(),!(!u.trim()||!h.trim())&&r.mutate({consumerKey:u.trim(),consumerSecret:h.trim()},{onSuccess:()=>{l(!1),f(""),p("")}})},E=()=>{i.mutate(void 0,{onSuccess:()=>{l(!1),f(""),p("")}})};return n?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("header",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"woocommerce",children:"WooCommerce"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"})]}):d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("header",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"woocommerce",children:"WooCommerce"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsxs("div",{className:"bb-int-configure-body",children:[b&&!o?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:"WooCommerce is connected. The agent can answer product, stock, and order questions from your real store data."}),d.jsxs("div",{className:"bb-int-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>l(!0),children:"Rotate credentials"}),d.jsx("button",{className:"bb-btn bb-btn-danger bb-btn-small",onClick:E,disabled:i.isPending,children:i.isPending?"Disconnecting…":"Disconnect"})]})]}):null,g?d.jsxs("form",{onSubmit:x,children:[d.jsxs("p",{children:["In your WordPress admin, go to"," ",d.jsx("strong",{children:"WooCommerce → Settings → Advanced → REST API"}),", click"," ",d.jsx("strong",{children:"Add key"}),", give it read permissions, and paste the consumer key + secret below."]}),d.jsxs("label",{className:"bb-field",children:[d.jsx("span",{children:"Consumer key"}),d.jsx("input",{type:"text",value:u,onChange:S=>f(S.target.value),placeholder:"ck_...",autoComplete:"off",spellCheck:!1})]}),d.jsxs("label",{className:"bb-field",children:[d.jsx("span",{children:"Consumer secret"}),d.jsx("input",{type:"password",value:h,onChange:S=>p(S.target.value),placeholder:"cs_...",autoComplete:"off"})]}),d.jsxs("div",{className:"bb-int-actions",children:[o&&d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>{l(!1),f(""),p("")},children:"Cancel"}),d.jsx("button",{type:"submit",className:"bb-btn bb-btn-primary bb-btn-small",disabled:r.isPending||!u.trim()||!h.trim(),children:r.isPending?"Saving…":b?"Update":"Connect"})]})]}):null]})]})}function Yfe({onClose:e}){const t=Ne(),{data:n,isLoading:r}=Rf(),i=o5(),o=s5(),[l,u]=v.useState(!1),[f,h]=v.useState(null),p=(n==null?void 0:n.integration)??null,b=(n==null?void 0:n.oauthAvailable)??!1,g=l5(),x=c5();v.useEffect(()=>{const S=A=>{const j=A.data;!j||j.type!=="bitbot:zoho-oauth-complete"||(u(!1),j.ok?(h(null),t.invalidateQueries({queryKey:["integrations","zoho"]})):h(typeof j.error=="string"?j.error:"Sign-in failed."))};return window.addEventListener("message",S),()=>window.removeEventListener("message",S)},[t]);const E=async()=>{h(null);const S=await i.mutateAsync().catch(_=>(h(_ instanceof Error?_.message:"Could not start sign-in"),null));if(!(S!=null&&S.url))return;const A=520,j=640,C=window.screenX+(window.outerWidth-A)/2,O=window.screenY+(window.outerHeight-j)/2;if(!window.open(S.url,"bitbot-zoho-oauth",`width=${A},height=${j},left=${C},top=${O},menubar=no,toolbar=no`)){h("Popup was blocked. Allow popups for this site and try again.");return}u(!0)};return!b&&!p?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"zoho-crm",children:"Zoho CRM"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-error",children:"Zoho isn't set up on the server yet. Ask the BitBot team to finish the OAuth configuration."})]}):r?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"zoho-crm",children:"Zoho CRM"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"})]}):(p==null?void 0:p.status)==="connected"?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"zoho-crm",children:"Zoho CRM"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsxs("div",{className:"bb-int-configure-connected",children:[d.jsxs("div",{className:"bb-int-status-line",children:[d.jsx("span",{className:"bb-int-status bb-int-status-connected",children:"Connected"}),p.accountEmail&&d.jsx("span",{className:"bb-int-configure-prop",children:p.accountEmail})]}),d.jsx("p",{className:"bb-int-configure-body",children:"The agent can read your Zoho pipeline. Use Push to Zoho on a lead to send it across, or turn on auto-sync below."}),d.jsxs("label",{className:"bb-int-toggle-row",children:[d.jsx("input",{type:"checkbox",checked:g.data===!0,disabled:g.isLoading||x.isPending,onChange:S=>x.mutate(S.target.checked)}),d.jsx("span",{children:"Auto-sync new leads to Zoho"})]}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>o.mutate(),disabled:o.isPending,children:o.isPending?"Disconnecting…":"Disconnect"})})]})]}):d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"zoho-crm",children:"Zoho CRM"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Sign in with the Zoho account that owns this site's CRM. We'll ask for access to your Leads, Contacts, and Deals so the agent can read your pipeline and push new BitBot leads in for you."}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:E,disabled:i.isPending||l,children:l?"Waiting for Zoho…":"Connect Zoho"})}),f&&d.jsx("p",{className:"bb-int-configure-error",children:f}),(p==null?void 0:p.lastErrorMessage)&&d.jsxs("p",{className:"bb-int-configure-error",children:["Last attempt: ",p.lastErrorMessage]})]})}function Wfe({onClose:e}){const{data:t,isLoading:n}=mE(),r=oH(),i=dH(),o=sH(),l=lH(),[u,f]=v.useState(!1),[h,p]=v.useState(""),b=!!(t!=null&&t.configured),g=!b||u,x=S=>{S.preventDefault(),h.trim()&&r.mutate({apiToken:h.trim()},{onSuccess:()=>{f(!1),p("")}})},E=()=>{i.mutate(void 0,{onSuccess:()=>{f(!1),p("")}})};return n?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("header",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"pipedrive",children:"Pipedrive"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"})]}):d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("header",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"pipedrive",children:"Pipedrive"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsxs("div",{className:"bb-int-configure-body",children:[b&&!u?d.jsxs(d.Fragment,{children:[d.jsxs("p",{children:["Pipedrive is connected",t!=null&&t.companyName?d.jsxs(d.Fragment,{children:[" to ",d.jsx("strong",{children:t.companyName})]}):null,t!=null&&t.accountName?d.jsxs(d.Fragment,{children:[" (",t.accountName,")"]}):null,". The agent can answer questions about your people and deals, and push captured leads into Pipedrive."]}),d.jsxs("label",{className:"bb-int-toggle-row",children:[d.jsx("input",{type:"checkbox",checked:o.data===!0,disabled:o.isLoading||l.isPending,onChange:S=>l.mutate(S.target.checked)}),d.jsx("span",{children:"Auto-sync new leads to Pipedrive"})]}),d.jsxs("div",{className:"bb-int-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>f(!0),children:"Replace token"}),d.jsx("button",{className:"bb-btn bb-btn-danger bb-btn-small",onClick:E,disabled:i.isPending,children:i.isPending?"Disconnecting…":"Disconnect"})]})]}):null,g?d.jsxs("form",{onSubmit:x,children:[d.jsxs("p",{children:["In Pipedrive, go to ",d.jsx("strong",{children:"Settings → Personal preferences → API"}),", copy your personal API token, and paste it below. We only need read access plus the ability to create people and deals."]}),d.jsxs("label",{className:"bb-field",children:[d.jsx("span",{children:"API token"}),d.jsx("input",{type:"password",value:h,onChange:S=>p(S.target.value),placeholder:"Your Pipedrive API token",autoComplete:"off",spellCheck:!1})]}),d.jsxs("div",{className:"bb-int-actions",children:[u&&d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>{f(!1),p("")},children:"Cancel"}),d.jsx("button",{type:"submit",className:"bb-btn bb-btn-primary bb-btn-small",disabled:r.isPending||!h.trim(),children:r.isPending?"Connecting…":b?"Update":"Connect"})]})]}):null]})]})}function Qfe({onClose:e}){const t=Ne(),{data:n,isLoading:r}=JS(),i=n5(),o=r5(),[l,u]=v.useState(!1),[f,h]=v.useState(null),p=(n==null?void 0:n.integration)??null,b=(n==null?void 0:n.oauthAvailable)??!1;v.useEffect(()=>{const E=S=>{const A=S.data;!A||A.type!=="bitbot:meta-oauth-complete"||(u(!1),A.ok?(h(null),t.invalidateQueries({queryKey:["integrations","meta"]})):h(typeof A.error=="string"?A.error:"Sign-in failed."))};return window.addEventListener("message",E),()=>window.removeEventListener("message",E)},[t]);const g=async()=>{h(null);const E=await i.mutateAsync().catch(T=>(h(T instanceof Error?T.message:"Could not start sign-in"),null));if(!(E!=null&&E.url))return;const S=600,A=700,j=window.screenX+(window.outerWidth-S)/2,C=window.screenY+(window.outerHeight-A)/2;if(!window.open(E.url,"bitbot-meta-oauth",`width=${S},height=${A},left=${j},top=${C},menubar=no,toolbar=no`)){h("Popup was blocked. Allow popups for this site and try again.");return}u(!0)};if(!b&&!p)return d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"messenger",children:"Facebook Messenger"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-error",children:"Meta isn't set up on the server yet. Ask the BitBot team to finish configuration."})]});if(r)return d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"messenger",children:"Facebook Messenger"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"})]});const x=(p==null?void 0:p.status)==="connected"&&p.pages.length>0;return d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"messenger",children:"Facebook Messenger"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),x&&d.jsxs("div",{className:"bb-int-configure-connected",children:[d.jsxs("div",{className:"bb-int-status-line",children:[d.jsx("span",{className:"bb-int-status bb-int-status-connected",children:"Connected"}),p.accountEmail&&d.jsx("span",{className:"bb-int-configure-prop",children:p.accountEmail})]}),d.jsx("p",{className:"bb-int-configure-body",children:"The visitor agent answers Messenger DMs using the same RAG + skills it uses on your website."}),d.jsx("ul",{className:"bb-int-page-list",children:p.pages.map(E=>d.jsxs("li",{className:"bb-int-page-item",children:[d.jsx("span",{className:"bb-int-page-name",children:E.pageName}),d.jsx("span",{className:"bb-int-page-channels",children:"💬 Messenger"})]},E.pageId))}),d.jsxs("div",{className:"bb-int-configure-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:g,disabled:i.isPending||l,children:l?"Waiting for Facebook…":"Connect another Page"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>o.mutate(),disabled:o.isPending,children:o.isPending?"Disconnecting…":"Disconnect"})]})]}),!x&&d.jsxs(d.Fragment,{children:[(p==null?void 0:p.status)==="error"?d.jsx("p",{className:"bb-int-configure-body",children:"Your connection stopped working. Facebook invalidated the Page token (usually a password change, the app being removed, or lost Page access). Reconnect to restore Messenger replies."}):d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"bb-int-configure-body",children:"Connect the Facebook Page you want the agent to answer Messenger DMs on:"}),d.jsxs("ol",{className:"bb-int-configure-steps",children:[d.jsx("li",{children:"Click Connect Facebook Page below."}),d.jsx("li",{children:"Sign in with the Facebook account that manages your Page."}),d.jsx("li",{children:"Choose the Page BitBot should answer DMs on."}),d.jsx("li",{children:"Done. New Messenger DMs get the same answers your website chat gives."})]}),d.jsx("p",{className:"bb-int-configure-help",children:"You need to be an admin of a published Facebook Page."})]}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:g,disabled:i.isPending||l,children:l?"Waiting for Facebook…":(p==null?void 0:p.status)==="error"?"Reconnect Facebook Page":"Connect Facebook Page"})})]}),f&&d.jsxs("p",{className:"bb-int-configure-error",children:[f,f.toLowerCase().includes("development")||f.toLowerCase().includes("not active")?d.jsxs(d.Fragment,{children:[" ","This usually means your Facebook account hasn't been added as a Tester on our Meta app yet. Email"," ",d.jsx("a",{href:"mailto:support@youami.ai?subject=BitBot%20Messenger%20early%20access",children:"support@youami.ai"})," ","with your Page name — we'll add you within a day."]}):null]}),(p==null?void 0:p.lastErrorMessage)&&d.jsxs("p",{className:"bb-int-configure-error",children:["Last attempt: ",p.lastErrorMessage]})]})}function Vfe(){return Et({queryKey:["support-inbox"],queryFn:async()=>{const e=await me("EnsureSupportInbox");if(!e.success)throw new Error(e.error);return e.data},staleTime:300*1e3})}function Xfe(){const e=Ne();return je({mutationFn:async t=>{const n=await me("SetSupportAutoSend",{autoSend:t});if(!n.success)throw new Error(n.error)},onSuccess:()=>e.invalidateQueries({queryKey:["support-inbox"]})})}function Zfe({onClose:e}){const{data:t,isLoading:n}=Vfe(),r=Xfe(),[i,o]=v.useState(!1),l=async()=>{if(t!=null&&t.address)try{await navigator.clipboard.writeText(t.address),o(!0),setTimeout(()=>o(!1),1500)}catch{}};return d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"support-inbox",children:"AI Support Inbox"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),n&&d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"}),t&&d.jsxs("div",{className:"bb-support-setup",children:[d.jsxs("div",{className:"bb-support-addr",children:[d.jsx("code",{className:"bb-support-addr-value",children:t.address}),d.jsx("button",{className:"bb-support-copy-icon",onClick:l,title:"Copy address","aria-label":"Copy support address",children:i?"✓":"⧉"})]}),d.jsxs("label",{className:"bb-support-autosend",children:[d.jsx("input",{type:"checkbox",checked:t.autoSend,onChange:u=>r.mutate(u.target.checked)}),d.jsxs("span",{children:["Send replies automatically",d.jsx("span",{className:"bb-field-help",children:t.autoSend?"On — answers customers itself; risky ones still wait for you.":"Off — drafts a reply and flags it for you."})]})]}),d.jsxs("ol",{className:"bb-support-highlights",children:[d.jsxs("li",{children:[d.jsx("span",{className:"bb-support-hl-num",children:"1"}),d.jsxs("span",{children:[d.jsx("strong",{children:"Use it as your support email"})," — put the address above on your site. Customers email it, the agent answers from it."]})]}),d.jsxs("li",{children:[d.jsx("span",{className:"bb-support-hl-num",children:"2"}),d.jsxs("span",{children:[d.jsx("strong",{children:"You"})," can email it too to run actions or get reports — your Agent co-pilot, by email."]})]})]})]})]})}const Jfe=[{id:"support-inbox",name:"AI Support Inbox",category:"Channels",description:"A support email address the agent runs as L1 support — it reads the customer email, looks up the order, replies to the easy ones, and escalates the rest to you. Just forward your support@ address to it. No Gmail connection needed.",connection:"available",icon:"📥"},{id:"messenger",name:"Facebook Messenger",category:"Channels",description:"Connect your Facebook Page so the agent answers Messenger DMs with the same answers, skills, and lead capture it uses on your website.",connection:"available",icon:"📨"},{id:"woocommerce",name:"WooCommerce",category:"Commerce",description:"Bot answers product, stock, and shipping questions from your real store data.",connection:"available",icon:"🛒"},{id:"zoho-crm",name:"Zoho CRM",category:"Productivity",description:'Push every captured lead into your Zoho CRM. The agent can also read your pipeline to answer "any open deals with X?" questions.',connection:"available",icon:"📇"},{id:"pipedrive",name:"Pipedrive",category:"Productivity",description:'Push captured leads into Pipedrive as people + deals. The agent can also read your pipeline to answer "what deals does X have?" questions.',connection:"available",icon:"🟢"},{id:"search-console",name:"Google Search Console",category:"Analytics",description:"Surface top search queries and click-through rates next to the FAQ gaps the bot already tracks.",connection:"available",icon:"🔎"}],ehe=["Channels","Commerce","Productivity","Analytics"],the=new Set(["messenger"]);function nhe({connection:e,comingSoon:t}){if(t)return d.jsx("span",{className:"bb-int-status bb-int-status-coming-soon",children:"Coming soon"});const n=e==="connected"?"Connected":"Available";return d.jsx("span",{className:`bb-int-status bb-int-status-${e}`,children:n})}function rhe(){var f,h,p,b,g,x,E,S;const[e,t]=v.useState(null),n=jq(),r=eE(),i=Rf(),o=JS(),l=mE(),u={"search-console":((h=(f=n.data)==null?void 0:f.integration)==null?void 0:h.status)==="connected"?"connected":"available",woocommerce:(p=r.data)!=null&&p.configured?"connected":"available","zoho-crm":((g=(b=i.data)==null?void 0:b.integration)==null?void 0:g.status)==="connected"?"connected":"available",messenger:((E=(x=o.data)==null?void 0:x.integration)==null?void 0:E.status)==="connected"?"connected":"available",pipedrive:(S=l.data)!=null&&S.configured?"connected":"available"};return e==="search-console"?d.jsx(Hfe,{onClose:()=>t(null)}):e==="woocommerce"?d.jsx(Gfe,{onClose:()=>t(null)}):e==="zoho-crm"?d.jsx(Yfe,{onClose:()=>t(null)}):e==="pipedrive"?d.jsx(Wfe,{onClose:()=>t(null)}):e==="messenger"?d.jsx(Qfe,{onClose:()=>t(null)}):e==="support-inbox"?d.jsx(Zfe,{onClose:()=>t(null)}):d.jsxs("div",{className:"bb-int-drawer",children:[d.jsx("p",{className:"bb-int-drawer-intro",children:"Each integration extends what the bot can do in conversations. Turn the ones you need on; the rest stay quiet."}),ehe.map(A=>{const j=Jfe.filter(C=>C.category===A);return j.length===0?null:d.jsxs("section",{className:"bb-int-section bb-int-section-drawer",children:[d.jsxs("header",{className:"bb-int-section-head",children:[d.jsx("h3",{className:"bb-int-section-title",children:A}),d.jsx("span",{className:"bb-int-section-count",children:j.length})]}),d.jsx("div",{className:"bb-int-grid bb-int-grid-drawer",children:j.map(C=>{const O=the.has(C.id),T=u[C.id]??C.connection,_=!O&&(C.id==="search-console"||C.id==="woocommerce"||C.id==="zoho-crm"||C.id==="pipedrive"||C.id==="support-inbox");return d.jsxs("article",{className:"bb-int-card",children:[d.jsxs("div",{className:"bb-int-head",children:[d.jsx("span",{className:"bb-int-icon","aria-hidden":!0,children:d.jsx(Cq,{id:C.id})}),d.jsxs("div",{className:"bb-int-titles",children:[d.jsx("h4",{className:"bb-int-name",children:C.name}),d.jsx("span",{className:"bb-int-cat",children:C.category})]}),d.jsx(nhe,{connection:T,comingSoon:O})]}),d.jsx("p",{className:"bb-int-body",children:C.description}),d.jsx("div",{className:"bb-int-actions",children:O?d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",disabled:!0,children:"Coming soon"}):C.id==="support-inbox"?d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>t(C.id),children:"Learn more →"}):T==="connected"?d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>_&&t(C.id),disabled:!_,children:"Configure →"}):d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>_&&t(C.id),disabled:!_,children:"Enable →"})})]},C.id)})})]},A)}),d.jsxs("div",{className:"bb-int-suggest",children:[d.jsx("h4",{children:"Want more?"}),d.jsx("p",{children:"Need something not listed? Tell us — requested integrations ship within a sprint when there's clear demand."}),d.jsx("a",{className:"bb-btn bb-btn-ghost bb-btn-small",href:"mailto:support@youami.ai",children:"Email support"})]})]})}function ahe(e){const t=new Date(e).getTime(),n=Date.now()-t;return n<6e4?"just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:`${Math.floor(n/864e5)}d ago`}function Mc(e){const t=[],n=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\*[^*]+\*)|(\[[^\]]+\]\([^)]+\))/g;let r=0,i,o=0;for(;(i=n.exec(e))!==null;){i.index>r&&t.push(e.slice(r,i.index));const l=i[0];if(l.startsWith("`"))t.push(d.jsx("code",{children:l.slice(1,-1)},o++));else if(l.startsWith("**"))t.push(d.jsx("strong",{children:l.slice(2,-2)},o++));else if(l.startsWith("*"))t.push(d.jsx("em",{children:l.slice(1,-1)},o++));else if(l.startsWith("[")){const u=l.indexOf("]("),f=l.slice(1,u),h=l.slice(u+2,-1).trim(),p=/^(https?:|mailto:|\/|#|\?|[A-Za-z0-9._~-])/i.test(h)?h:"#";t.push(d.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",children:f},o++))}r=i.index+l.length}return r<e.length&&t.push(e.slice(r)),t}function Oq(e){const t=e.replace(/\r\n/g,`283 */var YM;function toe(){if(YM)return yt;YM=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),g=Symbol.for("react.view_transition"),x=Symbol.for("react.client.reference");function E(S){if(typeof S=="object"&&S!==null){var A=S.$$typeof;switch(A){case e:switch(S=S.type,S){case n:case i:case r:case f:case h:case g:return S;default:switch(S=S&&S.$$typeof,S){case l:case u:case b:case p:return S;case o:return S;default:return A}}case t:return A}}}return yt.ContextConsumer=o,yt.ContextProvider=l,yt.Element=e,yt.ForwardRef=u,yt.Fragment=n,yt.Lazy=b,yt.Memo=p,yt.Portal=t,yt.Profiler=i,yt.StrictMode=r,yt.Suspense=f,yt.SuspenseList=h,yt.isContextConsumer=function(S){return E(S)===o},yt.isContextProvider=function(S){return E(S)===l},yt.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},yt.isForwardRef=function(S){return E(S)===u},yt.isFragment=function(S){return E(S)===n},yt.isLazy=function(S){return E(S)===b},yt.isMemo=function(S){return E(S)===p},yt.isPortal=function(S){return E(S)===t},yt.isProfiler=function(S){return E(S)===i},yt.isStrictMode=function(S){return E(S)===r},yt.isSuspense=function(S){return E(S)===f},yt.isSuspenseList=function(S){return E(S)===h},yt.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===n||S===i||S===r||S===f||S===h||typeof S=="object"&&S!==null&&(S.$$typeof===b||S.$$typeof===p||S.$$typeof===l||S.$$typeof===o||S.$$typeof===u||S.$$typeof===x||S.getModuleId!==void 0)},yt.typeOf=E,yt}var WM;function noe(){return WM||(WM=1,Gx.exports=toe()),Gx.exports}var roe=noe(),QM=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",VM=null,Yx=null,A3=e=>{if(e===VM&&Array.isArray(Yx))return Yx;var t=[];return v.Children.forEach(e,n=>{Mt(n)||(roe.isFragment(n)?t=t.concat(A3(n.props.children)):t.push(n))}),Yx=t,VM=e,t};function aj(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>QM(i)):r=[QM(t)],A3(e).forEach(i=>{var o=El(i,"type.displayName")||El(i,"type.name");o&&r.indexOf(o)!==-1&&n.push(i)}),n}var ij=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,Wx={},XM;function aoe(){if(XM)return Wx;XM=1;function e(t){var r;if(typeof t!="object"||t==null)return!1;if(Object.getPrototypeOf(t)===null)return!0;if(Object.prototype.toString.call(t)!=="[object Object]"){const i=t[Symbol.toStringTag];return i==null||!((r=Object.getOwnPropertyDescriptor(t,Symbol.toStringTag))!=null&&r.writable)?!1:t.toString()===`[object ${i}]`}let n=t;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n}return Wx.isPlainObject=e,Wx}var Qx,ZM;function ioe(){return ZM||(ZM=1,Qx=aoe().isPlainObject),Qx}var ooe=ioe();const soe=Ei(ooe);var JM,eR,tR,nR,rR;function aR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function iR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aR(Object(n),!0).forEach(function(r){loe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function loe(e,t,n){return(t=coe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function coe(e){var t=uoe(e,"string");return typeof t=="symbol"?t:t+""}function uoe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fb(){return fb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fb.apply(null,arguments)}function $d(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var oR=(e,t,n,r,i)=>{var o=n-r,l;return l=Xt(JM||(JM=$d(["M ",",",""])),e,t),l+=Xt(eR||(eR=$d(["L ",",",""])),e+n,t),l+=Xt(tR||(tR=$d(["L ",",",""])),e+n-o/2,t+i),l+=Xt(nR||(nR=$d(["L ",",",""])),e+n-o/2-r,t+i),l+=Xt(rR||(rR=$d(["L ",","," Z"])),e,t),l},doe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},foe=e=>{var t=on(e,doe),{x:n,y:r,upperWidth:i,lowerWidth:o,height:l,className:u}=t,{animationEasing:f,animationDuration:h,animationBegin:p,isUpdateAnimationActive:b}=t,g=v.useRef(null),[x,E]=v.useState(-1),S=v.useRef(i),A=v.useRef(o),j=v.useRef(l),C=v.useRef(n),O=v.useRef(r),T=Nu(e,"trapezoid-");if(v.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var $=g.current.getTotalLength();$&&E($)}catch{}},[]),n!==+n||r!==+r||i!==+i||o!==+o||l!==+l||i===0&&o===0||l===0)return null;var _=rt("recharts-trapezoid",u);if(!b)return v.createElement("g",null,v.createElement("path",fb({},or(t),{className:_,d:oR(n,r,i,o,l)})));var P=S.current,D=A.current,L=j.current,z=C.current,F=O.current,G="0px ".concat(x===-1?1:x,"px"),R="".concat(x,"px ").concat(x,"px"),J=qI(["strokeDasharray"],h,f);return v.createElement(Ou,{animationId:T,key:T,canBegin:x>0,duration:h,easing:f,isActive:b,begin:p},$=>{var ne=dt(P,i,$),K=dt(D,o,$),Z=dt(L,l,$),B=dt(z,n,$),te=dt(F,r,$);g.current&&(S.current=ne,A.current=K,j.current=Z,C.current=B,O.current=te);var pe=$>0?{transition:J,strokeDasharray:R}:{strokeDasharray:G};return v.createElement("path",fb({},or(t),{className:_,d:oR(B,te,ne,K,Z),ref:g,style:iR(iR({},pe),t.style)}))})},hoe=["option","shapeType","activeClassName","inActiveClassName"];function moe(e,t){if(e==null)return{};var n,r,i=poe(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function poe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function sR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sR(Object(n),!0).forEach(function(r){boe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function boe(e,t,n){return(t=voe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function voe(e){var t=goe(e,"string");return typeof t=="symbol"?t:t+""}function goe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yoe(e,t){return hb(hb({},t),e)}function xoe(e,t){return e==="symbols"}function lR(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return v.createElement(KI,n);case"trapezoid":return v.createElement(foe,n);case"sector":return v.createElement(WI,n);case"symbols":if(xoe(t))return v.createElement(NE,n);break;case"curve":return v.createElement(Kc,n);default:return null}}function woe(e){return v.isValidElement(e)?e.props:e}function oj(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,o=moe(e,hoe),l;if(v.isValidElement(t))l=v.cloneElement(t,hb(hb({},o),woe(t)));else if(typeof t=="function")l=t(o,o.index);else if(soe(t)&&typeof t!="boolean"){var u=yoe(t,o);l=v.createElement(lR,{shapeType:n,elementProps:u})}else{var f=o;l=v.createElement(lR,{shapeType:n,elementProps:f})}return o.isActive?v.createElement(Ft,{className:r},l):v.createElement(Ft,{className:i},l)}var sj=(e,t,n)=>{var r=xt();return(i,o)=>l=>{e==null||e(i,o,l),r(DU({activeIndex:String(o),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},lj=e=>{var t=xt();return(n,r)=>i=>{e==null||e(n,r,i),t(One())}},cj=(e,t,n)=>{var r=xt();return(i,o)=>l=>{e==null||e(i,o,l),r(Nne({activeIndex:String(o),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function Av(e){var{tooltipEntrySettings:t}=e,n=xt(),r=Ln(),i=v.useRef(null);return v.useLayoutEffect(()=>{r||(i.current===null?n(Ene(t)):i.current!==t&&n(Ane({prev:i.current,next:t})),i.current=t)},[t,n,r]),v.useLayoutEffect(()=>()=>{i.current&&(n(jne(i.current)),i.current=null)},[n]),null}function uj(e){var{legendPayload:t}=e,n=xt(),r=Ln(),i=v.useRef(null);return v.useLayoutEffect(()=>{r||(i.current===null?n(kI(t)):i.current!==t&&n(LI({prev:i.current,next:t})),i.current=t)},[n,r,t]),v.useLayoutEffect(()=>()=>{i.current&&(n(II(i.current)),i.current=null)},[n]),null}function Soe(e){var{legendPayload:t}=e,n=xt(),r=we(tt),i=v.useRef(null);return v.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(kI(t)):i.current!==t&&n(LI({prev:i.current,next:t})),i.current=t)},[n,r,t]),v.useLayoutEffect(()=>()=>{i.current&&(n(II(i.current)),i.current=null)},[n]),null}var Vx,Eoe=()=>{var[e]=v.useState(()=>uf("uid-"));return e},Aoe=(Vx=LS.useId)!==null&&Vx!==void 0?Vx:Eoe;function joe(e,t){var n=Aoe();return t||(e?"".concat(e,"-").concat(n):n)}var Coe=v.createContext(void 0),jv=e=>{var{id:t,type:n,children:r}=e,i=joe("recharts-".concat(n),t);return v.createElement(Coe.Provider,{value:i},r(i))},Ooe={cartesianItems:[],polarItems:[]},j3=lr({name:"graphicalItems",initialState:Ooe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:_t()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xa(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:_t()},removeCartesianGraphicalItem:{reducer(e,t){var n=xa(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:_t()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:_t()},removePolarGraphicalItem:{reducer(e,t){var n=xa(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:_t()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=xa(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:_t()}}}),{addCartesianGraphicalItem:Noe,replaceCartesianGraphicalItem:Toe,removeCartesianGraphicalItem:Poe,addPolarGraphicalItem:_oe,removePolarGraphicalItem:Doe,replacePolarGraphicalItem:Moe}=j3.actions,Roe=j3.reducer,koe=e=>{var t=xt(),n=v.useRef(null);return v.useLayoutEffect(()=>{n.current===null?t(Noe(e)):n.current!==e&&t(Toe({prev:n.current,next:e})),n.current=e},[t,e]),v.useLayoutEffect(()=>()=>{n.current&&(t(Poe(n.current)),n.current=null)},[t]),null},dj=v.memo(koe),Loe=e=>{var t=xt(),n=v.useRef(null);return v.useLayoutEffect(()=>{n.current===null?t(_oe(e)):n.current!==e&&t(Moe({prev:n.current,next:e})),n.current=e},[t,e]),v.useLayoutEffect(()=>()=>{n.current&&(t(Doe(n.current)),n.current=null)},[t]),null},Ioe=v.memo(Loe),zoe=["key"],Uoe=["onMouseEnter","onClick","onMouseLeave"],qoe=["id"],Boe=["id"];function ws(){return ws=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ws.apply(null,arguments)}function Cv(e,t){if(e==null)return{};var n,r,i=Foe(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Foe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function cR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cR(Object(n),!0).forEach(function(r){$oe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $oe(e,t,n){return(t=Koe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Koe(e){var t=Hoe(e,"string");return typeof t=="symbol"?t:t+""}function Hoe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Goe(e){var t=v.useMemo(()=>aj(e.children,yu),[e.children]),n=we(r=>Jie(r,e.id,t));return n==null?null:v.createElement(Soe,{legendPayload:n})}function Yoe(e){if(!(e==null||typeof e=="boolean"||typeof e=="function")){if(v.isValidElement(e)){var t,n=(t=e.props)===null||t===void 0?void 0:t.fill;return typeof n=="string"?n:void 0}var{fill:r}=e;return typeof r=="string"?r:void 0}}var Woe=v.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:o,fill:l,name:u,hide:f,tooltipType:h,id:p,activeShape:b}=e,g=Yoe(b),x=r.map(S=>{var A=S.tooltipPayload;return g==null||A==null?A:A.map(j=>Lt(Lt({},j),{},{color:g,fill:g}))}),E={dataDefinedOnItem:x,getPosition:S=>{var A;return(A=r[Number(S)])===null||A===void 0?void 0:A.tooltipPosition},settings:{stroke:i,strokeWidth:o,fill:l,dataKey:t,nameKey:n,name:As(u,t),hide:f,type:h,color:l,unit:"",graphicalItemId:p}};return v.createElement(Av,{tooltipEntrySettings:E})}),Qoe=(e,t)=>e>t?"start":e<t?"end":"middle",Voe=(e,t,n)=>ar(typeof t=="function"?t(e):t,n,n*.8),Xoe=(e,t,n)=>{var{top:r,left:i,width:o,height:l}=t,u=HI(o,l),f=i+ar(e.cx,o,o/2),h=r+ar(e.cy,l,l/2),p=ar(e.innerRadius,u,0),b=Voe(n,e.outerRadius,u),g=e.maxRadius||Math.sqrt(o*o+l*l)/2;return{cx:f,cy:h,innerRadius:p,outerRadius:b,maxRadius:g}},Zoe=(e,t)=>{var n=kn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Joe=(e,t)=>{if(v.isValidElement(e))return v.cloneElement(e,t);if(typeof e=="function")return e(t);var n=rt("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=Cv(t,zoe);return v.createElement(Kc,ws({},i,{type:"linear",className:n}))},ese=(e,t,n)=>{if(v.isValidElement(e))return v.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),v.isValidElement(r)))return r;var i=rt("recharts-pie-label-text",S3(e));return v.createElement(xv,ws({},t,{alignmentBaseline:"middle",className:i}),r)};function tse(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:o,dataKey:l}=n;if(!r||!i||!t)return null;var u=yr(n),f=wl(i),h=wl(o),p=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,b=t.map((g,x)=>{var E=(g.startAngle+g.endAngle)/2,S=hn(g.cx,g.cy,g.outerRadius+p,E),A=Lt(Lt(Lt(Lt({},u),g),{},{stroke:"none"},f),{},{index:x,textAnchor:Qoe(S.x,g.cx)},S),j=Lt(Lt(Lt(Lt({},u),g),{},{fill:"none",stroke:g.fill},h),{},{index:x,points:[hn(g.cx,g.cy,g.outerRadius,E),S],key:"line"});return v.createElement(wr,{zIndex:an.label,key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(x)},v.createElement(Ft,null,o&&Joe(o,j),ese(i,A,ot(g,l))))});return v.createElement(Ft,{className:"recharts-pie-labels"},b)}function nse(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?v.createElement(wv,{label:i}):v.createElement(tse,{sectors:t,props:n,showLabels:r})}function rse(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:o,id:l}=e,u=we(xs),f=we(QA),h=we(WU),{onMouseEnter:p,onClick:b,onMouseLeave:g}=i,x=Cv(i,Uoe),E=sj(p,i.dataKey,l),S=lj(g),A=cj(b,i.dataKey,l);return t==null||t.length===0?null:v.createElement(v.Fragment,null,t.map((j,C)=>{if((j==null?void 0:j.startAngle)===0&&(j==null?void 0:j.endAngle)===0&&t.length!==1)return null;var O=h==null||h===l,T=String(C)===u&&(f==null||i.dataKey===f)&&O,_=u?r:null,P=n&&T?n:_,D=Lt(Lt({},j),{},{stroke:j.stroke,tabIndex:-1,[wI]:C,[SI]:l});return v.createElement(Ft,ws({key:"sector-".concat(j==null?void 0:j.startAngle,"-").concat(j==null?void 0:j.endAngle,"-").concat(j.midAngle,"-").concat(C),tabIndex:-1,className:"recharts-pie-sector"},qf(x,j,C),{onMouseEnter:E(j,C),onMouseLeave:S(j,C),onClick:A(j,C)}),v.createElement(oj,ws({option:o??P,index:C,shapeType:"sector",isActive:T},D)))}))}function ase(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:o}=e,{cornerRadius:l,startAngle:u,endAngle:f,dataKey:h,nameKey:p,tooltipType:b}=n,g=Math.abs(n.minAngle),x=Zoe(u,f),E=Math.abs(x),S=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,A=r.filter(L=>ot(L,h,0)!==0).length,j=(E>=360?A:A-1)*S,C=r.reduce((L,z)=>{var F=ot(z,h,0);return L+(ye(F)?F:0)},0),O=g>0&&C>0&&r.some(L=>{var z=ot(L,h,0),F=(ye(z)?z:0)/C;return z!==0&&F*E<g}),T=O?g:0,_=E-A*T-j,P;if(C>0){var D;P=r.map((L,z)=>{var F=ot(L,h,0),G=ot(L,p,z),R=Xoe(n,o,L),J=(ye(F)?F:0)/C,$,ne=Lt(Lt({},L),i&&i[z]&&i[z].props),K=ne!=null&&"fill"in ne&&typeof ne.fill=="string"?ne.fill:n.fill;z?$=D.endAngle+kn(x)*S*(F!==0?1:0):$=u;var Z=$+kn(x)*((F!==0?T:0)+J*_),B=($+Z)/2,te=(R.innerRadius+R.outerRadius)/2,pe=[{name:G,value:F,payload:ne,dataKey:h,type:b,color:K,fill:K,graphicalItemId:n.id}],k=hn(R.cx,R.cy,te,B);return D=Lt(Lt(Lt(Lt({},n.presentationProps),{},{percent:J,cornerRadius:typeof l=="string"?parseFloat(l):l,name:G,tooltipPayload:pe,midAngle:B,middleRadius:te,tooltipPosition:k},ne),R),{},{value:F,dataKey:h,startAngle:$,endAngle:Z,payload:ne,paddingAngle:F!==0?kn(x)*S:0}),D})}return P}function ise(e){var{showLabels:t,sectors:n,children:r}=e,i=v.useMemo(()=>!t||!n?[]:n.map(o=>({value:o.value,payload:o.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:o.cx,cy:o.cy,innerRadius:o.innerRadius,outerRadius:o.outerRadius,startAngle:o.startAngle,endAngle:o.endAngle,clockWise:!1},fill:o.fill})),[n,t]);return v.createElement(Lie,{value:t?i:void 0},r)}function ose(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:o,animationBegin:l,animationDuration:u,animationEasing:f,activeShape:h,inactiveShape:p,onAnimationStart:b,onAnimationEnd:g}=t,x=Nu(t,"recharts-pie-"),E=n.current,[S,A]=v.useState(!1),j=v.useCallback(()=>{typeof g=="function"&&g(),A(!1)},[g]),C=v.useCallback(()=>{typeof b=="function"&&b(),A(!0)},[b]);return v.createElement(ise,{showLabels:!S,sectors:i},v.createElement(Ou,{animationId:x,begin:l,duration:u,isActive:o,easing:f,onAnimationStart:C,onAnimationEnd:j,key:x},O=>{var T,_=[],P=i&&i[0],D=(T=P==null?void 0:P.startAngle)!==null&&T!==void 0?T:0;return i==null||i.forEach((L,z)=>{var F=E&&E[z],G=z>0?El(L,"paddingAngle",0):0;if(F){var R=dt(F.endAngle-F.startAngle,L.endAngle-L.startAngle,O),J=Lt(Lt({},L),{},{startAngle:D+G,endAngle:D+R+G});_.push(J),D=J.endAngle}else{var{endAngle:$,startAngle:ne}=L,K=dt(0,$-ne,O),Z=Lt(Lt({},L),{},{startAngle:D+G,endAngle:D+K+G});_.push(Z),D=Z.endAngle}}),n.current=_,v.createElement(Ft,null,v.createElement(rse,{sectors:_,activeShape:h,inactiveShape:p,allOtherPieProps:t,shape:t.shape,id:r}))}),v.createElement(nse,{showLabels:!S,sectors:i,props:t}),t.children)}var sse={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:an.area};function lse(e){var{id:t}=e,n=Cv(e,qoe),{hide:r,className:i,rootTabIndex:o}=e,l=v.useMemo(()=>aj(e.children,yu),[e.children]),u=we(p=>eoe(p,t,l)),f=v.useRef(null),h=rt("recharts-pie",i);return r||u==null?(f.current=null,v.createElement(Ft,{tabIndex:o,className:h})):v.createElement(wr,{zIndex:e.zIndex},v.createElement(Woe,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:u,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t,activeShape:e.activeShape}),v.createElement(Ft,{tabIndex:o,className:h},v.createElement(ose,{props:Lt(Lt({},n),{},{sectors:u}),previousSectorsRef:f,id:t})))}function cse(e){var t=on(e,sse),{id:n}=t,r=Cv(t,Boe),i=yr(r);return v.createElement(jv,{id:n,type:"pie"},o=>v.createElement(v.Fragment,null,v.createElement(Ioe,{type:"pie",id:o,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),v.createElement(Goe,ws({},r,{id:o})),v.createElement(lse,ws({},r,{id:o}))))}var C3=cse;C3.displayName="Pie";var use=["points"];function uR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Xx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uR(Object(n),!0).forEach(function(r){dse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dse(e,t,n){return(t=fse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fse(e){var t=hse(e,"string");return typeof t=="symbol"?t:t+""}function hse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mb(){return mb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mb.apply(null,arguments)}function mse(e,t){if(e==null)return{};var n,r,i=pse(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function pse(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function bse(e){var{option:t,dotProps:n,className:r}=e;if(v.isValidElement(t))return v.cloneElement(t,n);if(typeof t=="function")return t(n);var i=rt(r,typeof t!="boolean"?t.className:""),o=n??{},{points:l}=o,u=mse(o,use);return v.createElement(g3,mb({},u,{className:i}))}function vse(e,t){return e==null?!1:t?!0:e.length===1}function O3(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:o,baseProps:l,needClip:u,clipPathId:f,zIndex:h=an.scatter}=e;if(!vse(t,n))return null;var p=ij(n),b=ZY(n),g=t.map((E,S)=>{var A,j,C=Xx(Xx(Xx({r:3},l),b),{},{index:S,cx:(A=E.x)!==null&&A!==void 0?A:void 0,cy:(j=E.y)!==null&&j!==void 0?j:void 0,dataKey:o,value:E.value,payload:E.payload,points:t});return v.createElement(bse,{key:"dot-".concat(S),option:n,dotProps:C,className:i})}),x={};return u&&f!=null&&(x.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(f,")")),v.createElement(wr,{zIndex:h},v.createElement(Ft,mb({className:r},x),g))}function dR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dR(Object(n),!0).forEach(function(r){gse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gse(e,t,n){return(t=yse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yse(e){var t=xse(e,"string");return typeof t=="symbol"?t:t+""}function xse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var N3=0,wse={xAxis:{},yAxis:{},zAxis:{}},T3=lr({name:"cartesianAxis",initialState:wse,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:_t()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:_t()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:_t()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:_t()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:_t()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:_t()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:_t()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:_t()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:_t()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var o,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((o=l[0])!==null&&o!==void 0?o:0))<=1)return;var u=[...l,r].slice(-3);e.yAxis[n]=fR(fR({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:Sse,replaceXAxis:Ese,removeXAxis:Ase,addYAxis:jse,replaceYAxis:Cse,removeYAxis:Ose,addZAxis:khe,replaceZAxis:Lhe,removeZAxis:Ihe,updateYAxisWidth:Nse}=T3.actions,Tse=T3.reducer,Pse=W([En],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),_se=W([Pse,vo,go],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),Ov=()=>we(_se),Dse=()=>we(Sre);function hR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hR(Object(n),!0).forEach(function(r){Mse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mse(e,t,n){return(t=Rse(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rse(e){var t=kse(e,"string");return typeof t=="symbol"?t:t+""}function kse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lse=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:o,clipPath:l}=e;if(i===!1||t.x==null||t.y==null)return null;var u={index:n,dataKey:o,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=Zx(Zx(Zx({},u),wl(i)),TE(i)),h;return v.isValidElement(i)?h=v.cloneElement(i,f):typeof i=="function"?h=i(f):h=v.createElement(g3,f),v.createElement(Ft,{className:"recharts-active-dot",clipPath:l},h)};function AS(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:o,zIndex:l=an.activeDot}=e,u=we(xs),f=Dse();if(t==null||f==null)return null;var h=t.find(p=>f.includes(p.payload));return Mt(h)?null:v.createElement(wr,{zIndex:l},v.createElement(Lse,{point:h,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:o}))}var mR=(e,t,n)=>{var r=n??e;if(!Mt(r))return ar(r,t,0)},Ise=(e,t,n)=>{var r={},i=e.filter(ov),o=e.filter(h=>h.stackId==null),l=i.reduce((h,p)=>{var b=h[p.stackId];return b==null&&(b=[]),b.push(p),h[p.stackId]=b,h},r),u=Object.entries(l).map(h=>{var p,[b,g]=h,x=g.map(S=>S.dataKey),E=mR(t,n,(p=g[0])===null||p===void 0?void 0:p.barSize);return{stackId:b,dataKeys:x,barSize:E}}),f=o.map(h=>{var p=[h.dataKey].filter(g=>g!=null),b=mR(t,n,h.barSize);return{stackId:void 0,dataKeys:p,barSize:b}});return[...u,...f]};function pR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pR(Object(n),!0).forEach(function(r){zse(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zse(e,t,n){return(t=Use(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Use(e){var t=qse(e,"string");return typeof t=="symbol"?t:t+""}function qse(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bse(e,t,n,r,i){var o,l=r.length;if(!(l<1)){var u=ar(e,n,0,!0),f,h=[];if(Ye((o=r[0])===null||o===void 0?void 0:o.barSize)){var p=!1,b=n/l,g=r.reduce((C,O)=>C+(O.barSize||0),0);g+=(l-1)*u,g>=n&&(g-=(l-1)*u,u=0),g>=n&&b>0&&(p=!0,b*=.9,g=l*b);var x=(n-g)/2>>0,E={offset:x-u,size:0};f=r.reduce((C,O)=>{var T,_={stackId:O.stackId,dataKeys:O.dataKeys,position:{offset:E.offset+E.size+u,size:p?b:(T=O.barSize)!==null&&T!==void 0?T:0}},P=[...C,_];return E=_.position,P},h)}else{var S=ar(t,n,0,!0);n-2*S-(l-1)*u<=0&&(u=0);var A=(n-2*S-(l-1)*u)/l;A>1&&(A>>=0);var j=Ye(i)?Math.min(A,i):A;f=r.reduce((C,O,T)=>[...C,{stackId:O.stackId,dataKeys:O.dataKeys,position:{offset:S+(A+u)*T+(A-j)/2,size:j}}],h)}return f}}var Fse=(e,t,n,r,i,o,l)=>{var u=Mt(l)?t:l,f=Bse(n,r,i!==o?i:o,e,u);return i!==o&&f!=null&&(f=f.map(h=>Qm(Qm({},h),{},{position:Qm(Qm({},h.position),{},{offset:h.position.offset-i/2})}))),f},$se=(e,t)=>{var n=iv(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:o}=i;if(o)return o.find(l=>l.key===n)}}}},Kse=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function Hse(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&Ye(e.zIndex)?e.zIndex:t}var P3=e=>{var{chartData:t}=e,n=xt(),r=Ln();return v.useEffect(()=>r?()=>{}:(n(jM(t)),()=>{n(jM(void 0))}),[t,n,r]),null},bR={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},_3=lr({name:"brush",initialState:bR,reducers:{setBrushSettings(e,t){return t.payload==null?bR:t.payload}}}),{setBrushSettings:zhe}=_3.actions,Gse=_3.reducer;function Yse(e){return(e%180+180)%180}var Wse=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=Yse(i),l=o*Math.PI/180,u=Math.atan(r/n),f=l>u&&l<Math.PI-u?r/Math.sin(l):n/Math.cos(l);return Math.abs(f)},Qse={dots:[],areas:[],lines:[]},D3=lr({name:"referenceElements",initialState:Qse,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=xa(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=xa(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=xa(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Uhe,removeDot:qhe,addArea:Bhe,removeArea:Fhe,addLine:$he,removeLine:Khe}=D3.actions,Vse=D3.reducer,Xse=v.createContext(void 0),Zse=e=>{var{children:t}=e,[n]=v.useState("".concat(uf("recharts"),"-clip")),r=Ov();if(r==null)return null;var{x:i,y:o,width:l,height:u}=r;return v.createElement(Xse.Provider,{value:n},v.createElement("defs",null,v.createElement("clipPath",{id:n},v.createElement("rect",{x:i,y:o,height:u,width:l}))),t)};function M3(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function Jse(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Wse(r,n)}function ele(e,t,n){var r=n==="width",{x:i,y:o,width:l,height:u}=e;return t===1?{start:r?i:o,end:r?i+l:o+u}:{start:r?i+l:o+u,end:r?i:o}}function Af(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function tle(e,t){return M3(e,t+1)}function nle(e,t,n,r,i){for(var o=(r||[]).slice(),{start:l,end:u}=t,f=0,h=1,p=l,b=function(){var E=r==null?void 0:r[f];if(E===void 0)return{v:M3(r,h)};var S=f,A,j=()=>(A===void 0&&(A=n(E,S)),A),C=E.coordinate,O=f===0||Af(e,C,j,p,u);O||(f=0,p=l,h+=1),O&&(p=C+e*(j()/2+i),f+=h)},g;h<=o.length;)if(g=b(),g)return g.v;return[]}function rle(e,t,n,r,i){var o=(r||[]).slice(),l=o.length;if(l===0)return[];for(var{start:u,end:f}=t,h=1;h<=l;h++){for(var p=(l-1)%h,b=u,g=!0,x=function(){var T=r[S];if(T==null)return 0;var _=S,P,D=()=>(P===void 0&&(P=n(T,_)),P),L=T.coordinate,z=S===p||Af(e,L,D,b,f);if(!z)return g=!1,1;z&&(b=L+e*(D()/2+i))},E,S=p;S<l&&(E=x(),!(E!==0&&E===1));S+=h);if(g){for(var A=[],j=p;j<l;j+=h){var C=r[j];C!=null&&A.push(C)}return A}}return[]}function vR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vR(Object(n),!0).forEach(function(r){ale(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ale(e,t,n){return(t=ile(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ile(e){var t=ole(e,"string");return typeof t=="symbol"?t:t+""}function ole(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sle(e,t,n,r,i){for(var o=(r||[]).slice(),l=o.length,{start:u}=t,{end:f}=t,h=function(g){var x=o[g];if(x==null)return 1;var E=x,S,A=()=>(S===void 0&&(S=n(x,g)),S);if(g===l-1){var j=e*(E.coordinate+e*A()/2-f);o[g]=E=nr(nr({},E),{},{tickCoord:j>0?E.coordinate-j*e:E.coordinate})}else o[g]=E=nr(nr({},E),{},{tickCoord:E.coordinate});if(E.tickCoord!=null){var C=Af(e,E.tickCoord,A,u,f);C&&(f=E.tickCoord-e*(A()/2+i),o[g]=nr(nr({},E),{},{isShow:!0}))}},p=l-1;p>=0;p--)h(p);return o}function lle(e,t,n,r,i,o){var l=(r||[]).slice(),u=l.length,{start:f,end:h}=t;if(o){var p=r[u-1];if(p!=null){var b=n(p,u-1),g=e*(p.coordinate+e*b/2-h);if(l[u-1]=p=nr(nr({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate}),p.tickCoord!=null){var x=Af(e,p.tickCoord,()=>b,f,h);x&&(h=p.tickCoord-e*(b/2+i),l[u-1]=nr(nr({},p),{},{isShow:!0}))}}}for(var E=o?u-1:u,S=function(C){var O=l[C];if(O==null)return 1;var T=O,_,P=()=>(_===void 0&&(_=n(O,C)),_);if(C===0){var D=e*(T.coordinate-e*P()/2-f);l[C]=T=nr(nr({},T),{},{tickCoord:D<0?T.coordinate-D*e:T.coordinate})}else l[C]=T=nr(nr({},T),{},{tickCoord:T.coordinate});if(T.tickCoord!=null){var L=Af(e,T.tickCoord,P,f,h);L&&(f=T.tickCoord+e*(P()/2+i),l[C]=nr(nr({},T),{},{isShow:!0}))}},A=0;A<E;A++)S(A);return l}function fj(e,t,n){var{tick:r,ticks:i,viewBox:o,minTickGap:l,orientation:u,interval:f,tickFormatter:h,unit:p,angle:b}=e;if(!i||!i.length||!r)return[];if(ye(f)||Gf.isSsr){var g;return(g=tle(i,ye(f)?f:0))!==null&&g!==void 0?g:[]}var x=[],E=u==="top"||u==="bottom"?"width":"height",S=p&&E==="width"?rf(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},A=(_,P)=>{var D=typeof h=="function"?h(_.value,P):_.value;return E==="width"?Jse(rf(D,{fontSize:t,letterSpacing:n}),S,b):rf(D,{fontSize:t,letterSpacing:n})[E]},j=i[0],C=i[1],O=i.length>=2&&j!=null&&C!=null?kn(C.coordinate-j.coordinate):1,T=ele(o,O,E);return f==="equidistantPreserveStart"?nle(O,T,A,i,l):f==="equidistantPreserveEnd"?rle(O,T,A,i,l):(f==="preserveStart"||f==="preserveStartEnd"?x=lle(O,T,A,i,l,f==="preserveStartEnd"):x=sle(O,T,A,i,l),x.filter(_=>_.isShow))}var cle=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:o=0}=e,l=0;if(t){Array.from(t).forEach(p=>{if(p){var b=p.getBoundingClientRect();b.width>l&&(l=b.width)}});var u=n?n.getBoundingClientRect().width:0,f=i+o,h=l+f+u+(n?r:0);return Math.round(h)}return 0},ule={xAxis:{},yAxis:{}},R3=lr({name:"renderedTicks",initialState:ule,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:dle,removeRenderedTicks:fle}=R3.actions,hle=R3.reducer,mle=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function ple(e,t){if(e==null)return{};var n,r,i=ble(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ble(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Pl(){return Pl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pl.apply(null,arguments)}function gR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gR(Object(n),!0).forEach(function(r){vle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vle(e,t,n){return(t=gle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gle(e){var t=yle(e,"string");return typeof t=="symbol"?t:t+""}function yle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var co={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:an.axis};function xle(e){var{x:t,y:n,width:r,height:i,orientation:o,mirror:l,axisLine:u,otherSvgProps:f}=e;if(!u)return null;var h=Vt(Vt(Vt({},f),yr(u)),{},{fill:"none"});if(o==="top"||o==="bottom"){var p=+(o==="top"&&!l||o==="bottom"&&l);h=Vt(Vt({},h),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var b=+(o==="left"&&!l||o==="right"&&l);h=Vt(Vt({},h),{},{x1:t+b*r,y1:n,x2:t+b*r,y2:n+i})}return v.createElement("line",Pl({},h,{className:rt("recharts-cartesian-axis-line",El(u,"className"))}))}function wle(e,t,n,r,i,o,l,u,f){var h,p,b,g,x,E,S=u?-1:1,A=e.tickSize||l,j=ye(e.tickCoord)?e.tickCoord:e.coordinate;switch(o){case"top":h=p=e.coordinate,g=n+ +!u*i,b=g-S*A,E=b-S*f,x=j;break;case"left":b=g=e.coordinate,p=t+ +!u*r,h=p-S*A,x=h-S*f,E=j;break;case"right":b=g=e.coordinate,p=t+ +u*r,h=p+S*A,x=h+S*f,E=j;break;default:h=p=e.coordinate,g=n+ +u*i,b=g+S*A,E=b+S*f,x=j;break}return{line:{x1:h,y1:b,x2:p,y2:g},tick:{x,y:E}}}function Sle(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function Ele(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Ale(e){var{option:t,tickProps:n,value:r}=e,i,o=rt(n.className,"recharts-cartesian-axis-tick-value");if(v.isValidElement(t))i=v.cloneElement(t,Vt(Vt({},n),{},{className:o}));else if(typeof t=="function")i=t(Vt(Vt({},n),{},{className:o}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=rt(l,S3(t))),i=v.createElement(xv,Pl({},n,{className:l}),r)}return i}function jle(e){var{ticks:t,axisType:n,axisId:r}=e,i=xt();return v.useEffect(()=>{if(r==null||n==null)return Es;var o=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(dle({ticks:o,axisId:r,axisType:n})),()=>{i(fle({axisId:r,axisType:n}))}},[i,t,r,n]),null}var Cle=v.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:o,tickFormatter:l,unit:u,padding:f,tickTextProps:h,orientation:p,mirror:b,x:g,y:x,width:E,height:S,tickSize:A,tickMargin:j,fontSize:C,letterSpacing:O,getTicksConfig:T,events:_,axisType:P,axisId:D}=e,L=fj(Vt(Vt({},T),{},{ticks:n}),C,O),z=yr(T),F=wl(r),G=u3(z.textAnchor)?z.textAnchor:Sle(p,b),R=Ele(p,b),J={};typeof i=="object"&&(J=i);var $=Vt(Vt({},z),{},{fill:"none"},J),ne=L.map(B=>Vt({entry:B},wle(B,g,x,E,S,p,A,b,j))),K=ne.map(B=>{var{entry:te,line:pe}=B;return v.createElement(Ft,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(te.value,"-").concat(te.coordinate,"-").concat(te.tickCoord)},i&&v.createElement("line",Pl({},$,pe,{className:rt("recharts-cartesian-axis-tick-line",El(i,"className"))})))}),Z=ne.map((B,te)=>{var pe,k,{entry:Q,tick:ce}=B,fe=Vt(Vt(Vt(Vt({verticalAnchor:R},z),{},{textAnchor:G,stroke:"none",fill:o},ce),{},{index:te,payload:Q,visibleTicksCount:L.length,tickFormatter:l,padding:f},h),{},{angle:(pe=(k=h==null?void 0:h.angle)!==null&&k!==void 0?k:z.angle)!==null&&pe!==void 0?pe:0}),xe=Vt(Vt({},fe),F);return v.createElement(Ft,Pl({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},qf(_,Q,te)),r&&v.createElement(Ale,{option:r,tickProps:xe,value:"".concat(typeof l=="function"?l(Q.value,te):Q.value).concat(u||"")}))});return v.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(P,"-ticks")},v.createElement(jle,{ticks:L,axisId:D,axisType:P}),Z.length>0&&v.createElement(wr,{zIndex:an.label},v.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(P,"-tick-labels"),ref:t},Z)),K.length>0&&v.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(P,"-tick-lines")},K))}),Ole=v.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:o,hide:l,ticks:u,axisType:f,axisId:h}=e,p=ple(e,mle),[b,g]=v.useState(""),[x,E]=v.useState(""),S=v.useRef(null);v.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var j;return cle({ticks:S.current,label:(j=e.labelRef)===null||j===void 0?void 0:j.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var A=v.useCallback(j=>{if(j){var C=j.getElementsByClassName("recharts-cartesian-axis-tick-value");S.current=C;var O=C[0];if(O){var T=window.getComputedStyle(O),_=T.fontSize,P=T.letterSpacing;(_!==b||P!==x)&&(g(_),E(P))}}},[b,x]);return l||r!=null&&r<=0||i!=null&&i<=0?null:v.createElement(wr,{zIndex:e.zIndex},v.createElement(Ft,{className:rt("recharts-cartesian-axis",o)},v.createElement(xle,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:yr(e)}),v.createElement(Cle,{ref:A,axisType:f,events:p,fontSize:b,getTicksConfig:e,height:e.height,letterSpacing:x,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),v.createElement(wie,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},v.createElement(_ie,{label:e.label,labelRef:e.labelRef}),e.children)))}),hj=v.forwardRef((e,t)=>{var n=on(e,co);return v.createElement(Ole,Pl({},n,{ref:t}))});hj.displayName="CartesianAxis";var Nle=["x1","y1","x2","y2","key"],Tle=["offset"],Ple=["xAxisId","yAxisId"],_le=["xAxisId","yAxisId"];function yR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yR(Object(n),!0).forEach(function(r){Dle(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dle(e,t,n){return(t=Mle(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mle(e){var t=Rle(e,"string");return typeof t=="symbol"?t:t+""}function Rle(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function il(){return il=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},il.apply(null,arguments)}function pb(e,t){if(e==null)return{};var n,r,i=kle(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Lle=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:o,height:l,ry:u}=e;return v.createElement("rect",{x:r,y:i,ry:u,width:o,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function k3(e){var{option:t,lineItemProps:n}=e,r;if(v.isValidElement(t))r=v.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:o,y1:l,x2:u,y2:f,key:h}=n,p=pb(n,Nle),b=(i=yr(p))!==null&&i!==void 0?i:{},{offset:g}=b,x=pb(b,Tle);r=v.createElement("line",il({},x,{x1:o,y1:l,x2:u,y2:f,fill:"none",key:h}))}return r}function Ile(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:o,yAxisId:l}=e,u=pb(e,Ple),f=i.map((h,p)=>{var b=rr(rr({},u),{},{x1:t,y1:h,x2:t+n,y2:h,key:"line-".concat(p),index:p});return v.createElement(k3,{key:"line-".concat(p),option:r,lineItemProps:b})});return v.createElement("g",{className:"recharts-cartesian-grid-horizontal"},f)}function zle(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:o,yAxisId:l}=e,u=pb(e,_le),f=i.map((h,p)=>{var b=rr(rr({},u),{},{x1:h,y1:t,x2:h,y2:t+n,key:"line-".concat(p),index:p});return v.createElement(k3,{option:r,lineItemProps:b,key:"line-".concat(p)})});return v.createElement("g",{className:"recharts-cartesian-grid-vertical"},f)}function Ule(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:o,height:l,horizontalPoints:u,horizontal:f=!0}=e;if(!f||!t||!t.length||u==null)return null;var h=u.map(b=>Math.round(b+i-i)).sort((b,g)=>b-g);i!==h[0]&&h.unshift(0);var p=h.map((b,g)=>{var x=h[g+1],E=x==null,S=E?i+l-b:x-b;if(S<=0)return null;var A=g%t.length;return v.createElement("rect",{key:"react-".concat(g),y:b,x:r,height:S,width:o,stroke:"none",fill:t[A],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function qle(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:o,width:l,height:u,verticalPoints:f}=e;if(!t||!n||!n.length)return null;var h=f.map(b=>Math.round(b+i-i)).sort((b,g)=>b-g);i!==h[0]&&h.unshift(0);var p=h.map((b,g)=>{var x=h[g+1],E=x==null,S=E?i+l-b:x-b;if(S<=0)return null;var A=g%n.length;return v.createElement("rect",{key:"react-".concat(g),x:b,y:o,width:S,height:u,stroke:"none",fill:n[A],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return v.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Ble=(e,t)=>{var{xAxis:n,width:r,height:i,offset:o}=e;return vI(fj(rr(rr(rr({},co),n),{},{ticks:gI(n),viewBox:{x:0,y:0,width:r,height:i}})),o.left,o.left+o.width,t)},Fle=(e,t)=>{var{yAxis:n,width:r,height:i,offset:o}=e;return vI(fj(rr(rr(rr({},co),n),{},{ticks:gI(n),viewBox:{x:0,y:0,width:r,height:i}})),o.top,o.top+o.height,t)},$le={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:an.grid};function lp(e){var t=BE(),n=FE(),r=CI(),i=rr(rr({},on(e,$le)),{},{x:ye(e.x)?e.x:r.left,y:ye(e.y)?e.y:r.top,width:ye(e.width)?e.width:r.width,height:ye(e.height)?e.height:r.height}),{xAxisId:o,yAxisId:l,x:u,y:f,width:h,height:p,syncWithTicks:b,horizontalValues:g,verticalValues:x}=i,E=Ln(),S=we(z=>fM(z,"xAxis",o,E)),A=we(z=>fM(z,"yAxis",l,E));if(!gi(h)||!gi(p)||!ye(u)||!ye(f))return null;var j=i.verticalCoordinatesGenerator||Ble,C=i.horizontalCoordinatesGenerator||Fle,{horizontalPoints:O,verticalPoints:T}=i;if((!O||!O.length)&&typeof C=="function"){var _=g&&g.length,P=C({yAxis:A?rr(rr({},A),{},{ticks:_?g:A.ticks}):void 0,width:t??h,height:n??p,offset:r},_?!0:b);Up(Array.isArray(P),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof P,"]")),Array.isArray(P)&&(O=P)}if((!T||!T.length)&&typeof j=="function"){var D=x&&x.length,L=j({xAxis:S?rr(rr({},S),{},{ticks:D?x:S.ticks}):void 0,width:t??h,height:n??p,offset:r},D?!0:b);Up(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof L,"]")),Array.isArray(L)&&(T=L)}return v.createElement(wr,{zIndex:i.zIndex},v.createElement("g",{className:"recharts-cartesian-grid"},v.createElement(Lle,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),v.createElement(Ule,il({},i,{horizontalPoints:O})),v.createElement(qle,il({},i,{verticalPoints:T})),v.createElement(Ile,il({},i,{offset:r,horizontalPoints:O,xAxis:S,yAxis:A})),v.createElement(zle,il({},i,{offset:r,verticalPoints:T,xAxis:S,yAxis:A}))))}lp.displayName="CartesianGrid";var Kle={},L3=lr({name:"errorBars",initialState:Kle,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(o=>o.dataKey===r.dataKey&&o.direction===r.direction?i:o))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:Hhe,replaceErrorBar:Ghe,removeErrorBar:Yhe}=L3.actions,Hle=L3.reducer,Gle=["children"];function Yle(e,t){if(e==null)return{};var n,r,i=Wle(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Wle(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Qle={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Vle=v.createContext(Qle);function I3(e){var{children:t}=e,n=Yle(e,Gle);return v.createElement(Vle.Provider,{value:n},t)}function Nv(e,t){var n,r,i=we(h=>xo(h,e)),o=we(h=>wo(h,t)),l=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:gn.allowDataOverflow,u=(r=o==null?void 0:o.allowDataOverflow)!==null&&r!==void 0?r:yn.allowDataOverflow,f=l||u;return{needClip:f,needClipX:l,needClipY:u}}function mj(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=Ov(),{needClipX:o,needClipY:l,needClip:u}=Nv(t,n);if(!u||!i)return null;var{x:f,y:h,width:p,height:b}=i;return v.createElement("clipPath",{id:"clipPath-".concat(r)},v.createElement("rect",{x:o?f:f-p/2,y:l?h:h-b/2,width:o?p:p*2,height:l?b:b*2}))}var z3=(e,t,n,r)=>Si(e,"xAxis",t,r),U3=(e,t,n,r)=>wi(e,"xAxis",t,r),q3=(e,t,n,r)=>Si(e,"yAxis",n,r),B3=(e,t,n,r)=>wi(e,"yAxis",n,r),Xle=W([tt,z3,q3,U3,B3],(e,t,n,r,i)=>Ha(e,"xAxis")?ys(t,r,!1):ys(n,i,!1)),Zle=(e,t,n,r,i)=>i;function Jle(e){return e.type==="line"}var ece=W([th,Zle],(e,t)=>e.filter(Jle).find(n=>n.id===t)),tce=W([tt,z3,q3,U3,B3,ece,Xle,Wf],(e,t,n,r,i,o,l,u)=>{var{chartData:f,dataStartIndex:h,dataEndIndex:p}=u;if(!(o==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:b,data:g}=o,x;if(g!=null&&g.length>0?x=g:x=f==null?void 0:f.slice(h,p+1),x!=null)return wce({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:b,bandSize:l,displayedData:x})}});function F3(e){var t=wl(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:o}=t,l=Number(i),u=Number(o);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(u)||u<0)&&(u=r),{r:l,strokeWidth:u}}return{r:n,strokeWidth:r}}var nce=["id"],rce=["type","layout","connectNulls","needClip","shape"],ace=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function jf(){return jf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jf.apply(null,arguments)}function xR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ui(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xR(Object(n),!0).forEach(function(r){ice(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ice(e,t,n){return(t=oce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oce(e){var t=sce(e,"string");return typeof t=="symbol"?t:t+""}function sce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pj(e,t){if(e==null)return{};var n,r,i=lce(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function lce(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var cce=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:o}=e;return[{inactive:o,dataKey:t,type:i,color:r,value:As(n,t),payload:e}]},uce=v.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:o,name:l,hide:u,unit:f,tooltipType:h,id:p}=e,b={dataDefinedOnItem:n,getPosition:Es,settings:{stroke:r,strokeWidth:i,fill:o,dataKey:t,nameKey:void 0,name:As(l,t),hide:u,type:h,color:r,unit:f,graphicalItemId:p}};return v.createElement(Av,{tooltipEntrySettings:b})}),$3=(e,t)=>"".concat(t,"px ").concat(e,"px");function dce(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var fce=(e,t,n)=>{var r=n.reduce((g,x)=>g+x,0);if(!r)return $3(t,e);for(var i=Math.floor(e/r),o=e%r,l=[],u=0,f=0;u<n.length;f+=(h=n[u])!==null&&h!==void 0?h:0,++u){var h,p=n[u];if(p!=null&&f+p>o){l=[...n.slice(0,u),o-f];break}}var b=l.length%2===0?[0,t]:[t];return[...dce(n,i),...l,...b].map(g=>"".concat(g,"px")).join(", ")};function hce(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:o,needClip:l}=r,{id:u}=r,f=pj(r,nce),h=yr(f);return v.createElement(O3,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:o,baseProps:h,needClip:l,clipPathId:t})}function mce(e){var{showLabels:t,children:n,points:r}=e,i=v.useMemo(()=>r==null?void 0:r.map(o=>{var l,u,f={x:(l=o.x)!==null&&l!==void 0?l:0,y:(u=o.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ui(ui({},f),{},{value:o.value,payload:o.payload,viewBox:f,parentViewBox:void 0,fill:void 0})}),[r]);return v.createElement(tj,{value:t?i:void 0},n)}function wR(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:o}=e,{type:l,layout:u,connectNulls:f,needClip:h,shape:p}=o,b=pj(o,rce),g=ui(ui({},or(b)),{},{fill:"none",className:"recharts-line-curve",clipPath:h?"url(#clipPath-".concat(t,")"):void 0,points:r,type:l,layout:u,connectNulls:f,strokeDasharray:i??o.strokeDasharray});return v.createElement(v.Fragment,null,(r==null?void 0:r.length)>1&&v.createElement(oj,jf({shapeType:"curve",option:p},g,{pathRef:n})),v.createElement(hce,{points:r,clipPathId:t,props:o}))}function pce(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function bce(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:o}=e,{points:l,strokeDasharray:u,isAnimationActive:f,animationBegin:h,animationDuration:p,animationEasing:b,animateNewValues:g,width:x,height:E,onAnimationEnd:S,onAnimationStart:A}=n,j=i.current,C=Nu(l,"recharts-line-"),O=v.useRef(C),[T,_]=v.useState(!1),P=!T,D=v.useCallback(()=>{typeof S=="function"&&S(),_(!1)},[S]),L=v.useCallback(()=>{typeof A=="function"&&A(),_(!0)},[A]),z=pce(r.current),F=v.useRef(0);O.current!==C&&(F.current=o.current,O.current=C);var G=F.current;return v.createElement(mce,{points:l,showLabels:P},n.children,v.createElement(Ou,{animationId:C,begin:h,duration:p,isActive:f,easing:b,onAnimationEnd:D,onAnimationStart:L,key:C},R=>{var J=dt(G,z+G,R),$=Math.min(J,z),ne;if(f)if(u){var K="".concat(u).split(/[,\s]+/gim).map(te=>parseFloat(te));ne=fce($,z,K)}else ne=$3(z,$);else ne=u==null?void 0:String(u);if(R>0&&z>0&&(i.current=l,o.current=Math.max(o.current,$)),j){var Z=j.length/l.length,B=R===1?l:l.map((te,pe)=>{var k=Math.floor(pe*Z);if(j[k]){var Q=j[k];return ui(ui({},te),{},{x:dt(Q.x,te.x,R),y:dt(Q.y,te.y,R)})}return g?ui(ui({},te),{},{x:dt(x*2,te.x,R),y:dt(E/2,te.y,R)}):ui(ui({},te),{},{x:te.x,y:te.y})});return i.current=B,v.createElement(wR,{props:n,points:B,clipPathId:t,pathRef:r,strokeDasharray:ne})}return v.createElement(wR,{props:n,points:l,clipPathId:t,pathRef:r,strokeDasharray:ne})}),v.createElement(wv,{label:n.label}))}function vce(e){var{clipPathId:t,props:n}=e,r=v.useRef(null),i=v.useRef(0),o=v.useRef(null);return v.createElement(bce,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:o})}var gce=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:ot(e.payload,t)}};class yce extends v.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:o,yAxisId:l,top:u,left:f,width:h,height:p,id:b,needClip:g,zIndex:x}=this.props;if(t)return null;var E=rt("recharts-line",i),S=b,{r:A,strokeWidth:j}=F3(n),C=ij(n),O=A*2+j,T=g?"url(#clipPath-".concat(C?"":"dots-").concat(S,")"):void 0;return v.createElement(wr,{zIndex:x},v.createElement(Ft,{className:E},g&&v.createElement("defs",null,v.createElement(mj,{clipPathId:S,xAxisId:o,yAxisId:l}),!C&&v.createElement("clipPath",{id:"clipPath-dots-".concat(S)},v.createElement("rect",{x:f-O/2,y:u-O/2,width:h+O,height:p+O}))),v.createElement(I3,{xAxisId:o,yAxisId:l,data:r,dataPointFormatter:gce,errorBarOffset:0},v.createElement(vce,{props:this.props,clipPathId:S}))),v.createElement(AS,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:T}))}}var K3={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:an.line,type:"linear"};function xce(e){var t=on(e,K3),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:o,animationEasing:l,connectNulls:u,dot:f,hide:h,isAnimationActive:p,label:b,legendType:g,xAxisId:x,yAxisId:E,id:S}=t,A=pj(t,ace),{needClip:j}=Nv(x,E),C=Ov(),O=js(),T=Ln(),_=we(F=>tce(F,x,E,T,S));if(O!=="horizontal"&&O!=="vertical"||_==null||C==null)return null;var{height:P,width:D,x:L,y:z}=C;return v.createElement(yce,jf({},A,{id:S,connectNulls:u,dot:f,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:o,animationEasing:l,isAnimationActive:p,hide:h,label:b,legendType:g,xAxisId:x,yAxisId:E,points:_,layout:O,height:P,width:D,left:L,top:z,needClip:j}))}function wce(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:o,dataKey:l,bandSize:u,displayedData:f}=e;return f.map((h,p)=>{var b=ot(h,l);if(t==="horizontal"){var g=zp({axis:n,ticks:i,bandSize:u,entry:h,index:p}),x=Mt(b)?null:r.scale.map(b);return{x:g,y:x??null,value:b,payload:h}}var E=Mt(b)?null:n.scale.map(b),S=zp({axis:r,ticks:o,bandSize:u,entry:h,index:p});return E==null||S==null?null:{x:E,y:S,value:b,payload:h}}).filter(Boolean)}function Sce(e){var t=on(e,K3),n=Ln();return v.createElement(jv,{id:t.id,type:"line"},r=>v.createElement(v.Fragment,null,v.createElement(uj,{legendPayload:cce(t)}),v.createElement(uce,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),v.createElement(dj,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),v.createElement(xce,jf({},t,{id:r}))))}var H3=v.memo(Sce,Ml);H3.displayName="Line";function ji(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:N3}function Ci(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:N3}var G3=(e,t,n)=>Si(e,"xAxis",ji(e,t),n),Y3=(e,t,n)=>wi(e,"xAxis",ji(e,t),n),W3=(e,t,n)=>Si(e,"yAxis",Ci(e,t),n),Q3=(e,t,n)=>wi(e,"yAxis",Ci(e,t),n),Ece=W([tt,G3,W3,Y3,Q3],(e,t,n,r,i)=>Ha(e,"xAxis")?ys(t,r,!1):ys(n,i,!1)),Ace=(e,t)=>t,V3=W([th,Ace],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),X3=e=>{var t=tt(e),n=Ha(t,"xAxis");return n?"yAxis":"xAxis"},jce=(e,t)=>{var n=X3(e);return n==="yAxis"?Ci(e,t):ji(e,t)},Cce=(e,t,n)=>sb(e,X3(e),jce(e,t),n),Oce=W([V3,Cce],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=iv(e);if(!(r==null||i==null)){var o=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=o==null?void 0:o.find(u=>u.key===i);if(l!=null)return l.map(u=>[u[0],u[1]])}}}),Nce=W([tt,G3,W3,Y3,Q3,Oce,VI,Ece,V3,DZ],(e,t,n,r,i,o,l,u,f,h)=>{var{chartData:p,dataStartIndex:b,dataEndIndex:g}=l;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||u==null)){var{data:x}=f,E;if(x&&x.length>0?E=x:E=p==null?void 0:p.slice(b,g+1),E!=null)return Wce({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:b,areaSettings:f,stackedData:o,displayedData:E,chartBaseValue:h,bandSize:u})}}),Tce=["id"],Pce=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function gl(){return gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gl.apply(null,arguments)}function Z3(e,t){if(e==null)return{};var n,r,i=_ce(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function _ce(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function SR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Uc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SR(Object(n),!0).forEach(function(r){Dce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dce(e,t,n){return(t=Mce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mce(e){var t=Rce(e,"string");return typeof t=="symbol"?t:t+""}function Rce(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bb(e,t){return e&&e!=="none"?e:t}var kce=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:o,hide:l}=e;return[{inactive:l,dataKey:t,type:o,color:bb(r,i),value:As(n,t),payload:e}]},Lce=v.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:o,name:l,hide:u,unit:f,tooltipType:h,id:p}=e,b={dataDefinedOnItem:n,getPosition:Es,settings:{stroke:r,strokeWidth:i,fill:o,dataKey:t,nameKey:void 0,name:As(l,t),hide:u,type:h,color:bb(r,o),unit:f,graphicalItemId:p}};return v.createElement(Av,{tooltipEntrySettings:b})});function Ice(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:o,dataKey:l}=r,u=yr(r);return v.createElement(O3,{points:n,dot:o,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:u,needClip:i,clipPathId:t})}function zce(e){var{showLabels:t,children:n,points:r}=e,i=r.map(o=>{var l,u,f={x:(l=o.x)!==null&&l!==void 0?l:0,y:(u=o.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Uc(Uc({},f),{},{value:o.value,payload:o.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return v.createElement(tj,{value:t?i:void 0},n)}function ER(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:o}=e,{layout:l,type:u,stroke:f,connectNulls:h,isRange:p}=o,{id:b}=o,g=Z3(o,Tce),x=yr(g),E=or(g);return v.createElement(v.Fragment,null,(t==null?void 0:t.length)>1&&v.createElement(Ft,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},v.createElement(Kc,gl({},E,{id:b,points:t,connectNulls:h,type:u,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),f!=="none"&&v.createElement(Kc,gl({},x,{className:"recharts-area-curve",layout:l,type:u,connectNulls:h,fill:"none",points:t})),f!=="none"&&p&&Array.isArray(n)&&v.createElement(Kc,gl({},x,{className:"recharts-area-curve",layout:l,type:u,connectNulls:h,fill:"none",points:n}))),v.createElement(Ice,{points:t,props:g,clipPathId:i}))}function Uce(e){var t,n,{alpha:r,baseLine:i,points:o,strokeWidth:l}=e,u=(t=o[0])===null||t===void 0?void 0:t.y,f=(n=o[o.length-1])===null||n===void 0?void 0:n.y;if(!Ye(u)||!Ye(f))return null;var h=r*Math.abs(u-f),p=Math.max(...o.map(b=>b.x||0));return ye(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(b=>b.x||0),p)),ye(p)?v.createElement("rect",{x:0,y:u<f?u:u-h,width:p+(l?parseInt("".concat(l),10):1),height:Math.floor(h)}):null}function qce(e){var t,n,{alpha:r,baseLine:i,points:o,strokeWidth:l}=e,u=(t=o[0])===null||t===void 0?void 0:t.x,f=(n=o[o.length-1])===null||n===void 0?void 0:n.x;if(!Ye(u)||!Ye(f))return null;var h=r*Math.abs(u-f),p=Math.max(...o.map(b=>b.y||0));return ye(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(b=>b.y||0),p)),ye(p)?v.createElement("rect",{x:u<f?u:u-h,y:0,width:h,height:Math.floor(p+(l?parseInt("".concat(l),10):1))}):null}function Bce(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:o}=e;return n==="vertical"?v.createElement(Uce,{alpha:t,points:r,baseLine:i,strokeWidth:o}):v.createElement(qce,{alpha:t,points:r,baseLine:i,strokeWidth:o})}function Fce(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:o}=e,{points:l,baseLine:u,isAnimationActive:f,animationBegin:h,animationDuration:p,animationEasing:b,onAnimationStart:g,onAnimationEnd:x}=r,E=v.useMemo(()=>({points:l,baseLine:u}),[l,u]),S=Nu(E,"recharts-area-"),A=$E(),[j,C]=v.useState(!1),O=!j,T=v.useCallback(()=>{typeof x=="function"&&x(),C(!1)},[x]),_=v.useCallback(()=>{typeof g=="function"&&g(),C(!0)},[g]);if(A==null)return null;var P=i.current,D=o.current;return v.createElement(zce,{showLabels:O,points:l},r.children,v.createElement(Ou,{animationId:S,begin:h,duration:p,isActive:f,easing:b,onAnimationEnd:T,onAnimationStart:_,key:S},L=>{if(P){var z=P.length/l.length,F=L===1?l:l.map((R,J)=>{var $=Math.floor(J*z);if(P[$]){var ne=P[$];return Uc(Uc({},R),{},{x:dt(ne.x,R.x,L),y:dt(ne.y,R.y,L)})}return R}),G;return ye(u)?G=dt(D,u,L):Mt(u)||Ba(u)?G=dt(D,0,L):G=u.map((R,J)=>{var $=Math.floor(J*z);if(Array.isArray(D)&&D[$]){var ne=D[$];return Uc(Uc({},R),{},{x:dt(ne.x,R.x,L),y:dt(ne.y,R.y,L)})}return R}),L>0&&(i.current=F,o.current=G),v.createElement(ER,{points:F,baseLine:G,needClip:t,clipPathId:n,props:r})}return L>0&&(i.current=l,o.current=u),v.createElement(Ft,null,f&&v.createElement("defs",null,v.createElement("clipPath",{id:"animationClipPath-".concat(n)},v.createElement(Bce,{alpha:L,points:l,baseLine:u,layout:A,strokeWidth:r.strokeWidth}))),v.createElement(Ft,{clipPath:"url(#animationClipPath-".concat(n,")")},v.createElement(ER,{points:l,baseLine:u,needClip:t,clipPathId:n,props:r})))}),v.createElement(wv,{label:r.label}))}function $ce(e){var{needClip:t,clipPathId:n,props:r}=e,i=v.useRef(null),o=v.useRef();return v.createElement(Fce,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:o})}class Kce extends v.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:o,left:l,needClip:u,xAxisId:f,yAxisId:h,width:p,height:b,id:g,baseLine:x,zIndex:E}=this.props;if(t)return null;var S=rt("recharts-area",i),A=g,{r:j,strokeWidth:C}=F3(n),O=ij(n),T=j*2+C,_=u?"url(#clipPath-".concat(O?"":"dots-").concat(A,")"):void 0;return v.createElement(wr,{zIndex:E},v.createElement(Ft,{className:S},u&&v.createElement("defs",null,v.createElement(mj,{clipPathId:A,xAxisId:f,yAxisId:h}),!O&&v.createElement("clipPath",{id:"clipPath-dots-".concat(A)},v.createElement("rect",{x:l-T/2,y:o-T/2,width:p+T,height:b+T}))),v.createElement($ce,{needClip:u,clipPathId:A,props:this.props})),v.createElement(AS,{points:r,mainColor:bb(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:_}),this.props.isRange&&Array.isArray(x)&&v.createElement(AS,{points:x,mainColor:bb(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:_}))}}var Hce={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:an.area};function Gce(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:o,connectNulls:l,dot:u,fill:f,fillOpacity:h,hide:p,isAnimationActive:b,legendType:g,stroke:x,xAxisId:E,yAxisId:S}=e,A=Z3(e,Pce),j=js(),C=XU(),{needClip:O}=Nv(E,S),T=Ln(),{points:_,isRange:P,baseLine:D}=(t=we(J=>Nce(J,e.id,T)))!==null&&t!==void 0?t:{},L=Ov();if(j!=="horizontal"&&j!=="vertical"||L==null||C!=="AreaChart"&&C!=="ComposedChart")return null;var{height:z,width:F,x:G,y:R}=L;return!_||!_.length?null:v.createElement(Kce,gl({},A,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:o,baseLine:D,connectNulls:l,dot:u,fill:f,fillOpacity:h,height:z,hide:p,layout:j,isAnimationActive:b,isRange:P,legendType:g,needClip:O,points:_,stroke:x,width:F,left:G,top:R,xAxisId:E,yAxisId:S}))}var Yce=(e,t,n,r,i)=>{var o=n??t;if(ye(o))return o;var l=e==="horizontal"?i:r,u=l.scale.domain();if(l.type==="number"){var f=Math.max(u[0],u[1]),h=Math.min(u[0],u[1]);return o==="dataMin"?h:o==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return o==="dataMin"?u[0]:o==="dataMax"?u[1]:u[0]};function Wce(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:o,chartBaseValue:l,xAxis:u,yAxis:f,displayedData:h,dataStartIndex:p,xAxisTicks:b,yAxisTicks:g,bandSize:x}=e,E=i&&i.length,S=Yce(o,l,n,u,f),A=o==="horizontal",j=!1,C=h.map((T,_)=>{var P,D,L,z;if(E)z=i[p+_];else{var F=ot(T,r);Array.isArray(F)?(z=F,j=!0):z=[S,F]}var G=(P=(D=z)===null||D===void 0?void 0:D[1])!==null&&P!==void 0?P:null,R=G==null||E&&!t&&ot(T,r)==null;if(A){var J;return{x:zp({axis:u,ticks:b,bandSize:x,entry:T,index:_}),y:R?null:(J=f.scale.map(G))!==null&&J!==void 0?J:null,value:z,payload:T}}return{x:R?null:(L=u.scale.map(G))!==null&&L!==void 0?L:null,y:zp({axis:f,ticks:g,bandSize:x,entry:T,index:_}),value:z,payload:T}}),O;return E||j?O=C.map(T=>{var _,P=Array.isArray(T.value)?T.value[0]:null;if(A){var D;return{x:T.x,y:P!=null&&T.y!=null&&(D=f.scale.map(P))!==null&&D!==void 0?D:null,payload:T.payload}}return{x:P!=null&&(_=u.scale.map(P))!==null&&_!==void 0?_:null,y:T.y,payload:T.payload}}):O=A?f.scale.map(S):u.scale.map(S),{points:C,baseLine:O??0,isRange:j}}function Qce(e){var t=on(e,Hce),n=Ln();return v.createElement(jv,{id:t.id,type:"area"},r=>v.createElement(v.Fragment,null,v.createElement(uj,{legendPayload:kce(t)}),v.createElement(Lce,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),v.createElement(dj,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:yI(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),v.createElement(Gce,gl({},t,{id:r}))))}var J3=v.memo(Qce,Ml);J3.displayName="Area";var Vce="Invariant failed";function Xce(e,t){throw new Error(Vce)}function jS(){return jS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jS.apply(null,arguments)}function bj(e){return v.createElement(oj,jS({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var Zce=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(ye(t))return t;var o=ye(r)||Mt(r);return o?t(r,i):(o||Xce(),n)}},Jce=(e,t,n)=>n,eue=(e,t)=>t,oh=W([th,eue],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),tue=W([oh],e=>e==null?void 0:e.maxBarSize),nue=(e,t,n,r)=>r,rue=W([tt,th,ji,Ci,Jce],(e,t,n,r,i)=>t.filter(o=>e==="horizontal"?o.xAxisId===n:o.yAxisId===r).filter(o=>o.isPanorama===i).filter(o=>o.hide===!1).filter(o=>o.type==="bar")),aue=(e,t,n)=>{var r=tt(e),i=ji(e,t),o=Ci(e,t);if(!(i==null||o==null))return r==="horizontal"?sb(e,"yAxis",o,n):sb(e,"xAxis",i,n)},iue=(e,t)=>{var n=tt(e),r=ji(e,t),i=Ci(e,t);if(!(r==null||i==null))return n==="horizontal"?dM(e,"xAxis",r):dM(e,"yAxis",i)},oue=W([rue,_Z,iue],Ise),sue=(e,t,n)=>{var r,i,o=oh(e,t);if(o==null)return 0;var l=ji(e,t),u=Ci(e,t);if(l==null||u==null)return 0;var f=tt(e),h=lz(e),{maxBarSize:p}=o,b=Mt(p)?h:p,g,x;return f==="horizontal"?(g=Si(e,"xAxis",l,n),x=wi(e,"xAxis",l,n)):(g=Si(e,"yAxis",u,n),x=wi(e,"yAxis",u,n)),(r=(i=ys(g,x,!0))!==null&&i!==void 0?i:b)!==null&&r!==void 0?r:0},eq=(e,t,n)=>{var r=tt(e),i=ji(e,t),o=Ci(e,t);if(!(i==null||o==null)){var l,u;return r==="horizontal"?(l=Si(e,"xAxis",i,n),u=wi(e,"xAxis",i,n)):(l=Si(e,"yAxis",o,n),u=wi(e,"yAxis",o,n)),ys(l,u)}},lue=W([oue,lz,PZ,cz,sue,eq,tue],Fse),cue=(e,t,n)=>{var r=ji(e,t);if(r!=null)return Si(e,"xAxis",r,n)},uue=(e,t,n)=>{var r=Ci(e,t);if(r!=null)return Si(e,"yAxis",r,n)},due=(e,t,n)=>{var r=ji(e,t);if(r!=null)return wi(e,"xAxis",r,n)},fue=(e,t,n)=>{var r=Ci(e,t);if(r!=null)return wi(e,"yAxis",r,n)},hue=W([lue,oh],Kse),mue=W([aue,oh],$se),pue=W([En,zE,cue,uue,due,fue,hue,tt,VI,eq,mue,oh,nue],(e,t,n,r,i,o,l,u,f,h,p,b,g)=>{var{chartData:x,dataStartIndex:E,dataEndIndex:S}=f;if(!(b==null||l==null||t==null||u!=="horizontal"&&u!=="vertical"||n==null||r==null||i==null||o==null||h==null)){var{data:A}=b,j;if(A!=null&&A.length>0?j=A:j=x==null?void 0:x.slice(E,S+1),j!=null)return $ue({layout:u,barSettings:b,pos:l,parentViewBox:t,bandSize:h,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:o,stackedData:p,displayedData:j,offset:e,cells:g,dataStartIndex:E})}}),bue=["index"];function CS(){return CS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CS.apply(null,arguments)}function vue(e,t){if(e==null)return{};var n,r,i=gue(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var tq=v.createContext(void 0),yue=e=>{var t=v.useContext(tq);if(t!=null)return t.stackId;if(e!=null)return yI(e)},xue=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),wue=e=>{var t=v.useContext(tq);if(t!=null){var{stackId:n}=t;return"url(#".concat(xue(n,e),")")}},nq=e=>{var{index:t}=e,n=vue(e,bue),r=wue(t);return v.createElement(Ft,CS({className:"recharts-bar-stack-layer",clipPath:r},n))},Sue=["onMouseEnter","onMouseLeave","onClick"],Eue=["value","background","tooltipPosition"],Aue=["id"],jue=["onMouseEnter","onClick","onMouseLeave"];function Ss(){return Ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ss.apply(null,arguments)}function AR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AR(Object(n),!0).forEach(function(r){Cue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cue(e,t,n){return(t=Oue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oue(e){var t=Nue(e,"string");return typeof t=="symbol"?t:t+""}function Nue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vb(e,t){if(e==null)return{};var n,r,i=Tue(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Tue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Pue=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:o}=e;return[{inactive:o,dataKey:t,type:i,color:r,value:As(n,t),payload:e}]},_ue=v.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:o,hide:l,unit:u,tooltipType:f,id:h}=e,p={dataDefinedOnItem:void 0,getPosition:Es,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:As(o,t),hide:l,type:f,color:i,unit:u,graphicalItemId:h}};return v.createElement(Av,{tooltipEntrySettings:p})});function Due(e){var t=we(xs),{data:n,dataKey:r,background:i,allOtherBarProps:o}=e,{onMouseEnter:l,onMouseLeave:u,onClick:f}=o,h=vb(o,Sue),p=sj(l,r,o.id),b=lj(u),g=cj(f,r,o.id);if(!i||n==null)return null;var x=wl(i);return v.createElement(wr,{zIndex:Hse(i,an.barBackground)},n.map((E,S)=>{var{value:A,background:j,tooltipPosition:C}=E,O=vb(E,Eue);if(!j)return null;var T=p(E,S),_=b(E,S),P=g(E,S),D=br(br(br(br(br({option:i,isActive:String(S)===t},O),{},{fill:"#eee"},j),x),qf(h,E,S)),{},{onMouseEnter:T,onMouseLeave:_,onClick:P,dataKey:r,index:S,className:"recharts-bar-background-rectangle"});return v.createElement(bj,Ss({key:"background-bar-".concat(S)},D))}))}function Mue(e){var{showLabels:t,children:n,rects:r}=e,i=r==null?void 0:r.map(o=>{var l={x:o.x,y:o.y,width:o.width,lowerWidth:o.width,upperWidth:o.width,height:o.height};return br(br({},l),{},{value:o.value,payload:o.payload,parentViewBox:o.parentViewBox,viewBox:l,fill:o.fill})});return v.createElement(tj,{value:t?i:void 0},n)}function Rue(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:o,dataKey:l}=e,u=we(xs),f=we(QA),h=n&&String(i.originalDataIndex)===u&&(f==null||l===f),[p,b]=v.useState(!1),[g,x]=v.useState(!1);v.useEffect(()=>{var O;return h?(b(!0),O=requestAnimationFrame(()=>{x(!0)})):x(!1),()=>{cancelAnimationFrame(O)}},[h]);var E=v.useCallback(()=>{h||b(!1)},[h]),S=h&&g,A=h||p,j;h?n===!0?j=t:j=n:j=t;var C=v.createElement(bj,Ss({},r,{name:String(r.name)},i,{isActive:S,option:j,index:o,dataKey:l,onTransitionEnd:E}));return A?v.createElement(wr,{zIndex:an.activeBar},v.createElement(nq,{index:i.originalDataIndex},C)):C}function kue(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:o}=e;return v.createElement(bj,Ss({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:o}))}function Lue(e){var t,{data:n,props:r}=e,i=(t=yr(r))!==null&&t!==void 0?t:{},{id:o}=i,l=vb(i,Aue),{shape:u,dataKey:f,activeBar:h}=r,{onMouseEnter:p,onClick:b,onMouseLeave:g}=r,x=vb(r,jue),E=sj(p,f,o),S=lj(g),A=cj(b,f,o);return n?v.createElement(v.Fragment,null,n.map((j,C)=>v.createElement(nq,Ss({index:j.originalDataIndex,key:"rectangle-".concat(j==null?void 0:j.x,"-").concat(j==null?void 0:j.y,"-").concat(j==null?void 0:j.value,"-").concat(C),className:"recharts-bar-rectangle"},qf(x,j,C),{onMouseEnter:E(j,C),onMouseLeave:S(j,C),onClick:A(j,C)}),h?v.createElement(Rue,{shape:u,activeBar:h,baseProps:l,entry:j,index:C,dataKey:f}):v.createElement(kue,{shape:u,baseProps:l,entry:j,index:C,dataKey:f})))):null}function Iue(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:o,animationBegin:l,animationDuration:u,animationEasing:f,onAnimationEnd:h,onAnimationStart:p}=t,b=n.current,g=Nu(t,"recharts-bar-"),[x,E]=v.useState(!1),S=!x,A=v.useCallback(()=>{typeof h=="function"&&h(),E(!1)},[h]),j=v.useCallback(()=>{typeof p=="function"&&p(),E(!0)},[p]);return v.createElement(Mue,{showLabels:S,rects:r},v.createElement(Ou,{animationId:g,begin:l,duration:u,isActive:o,easing:f,onAnimationEnd:A,onAnimationStart:j,key:g},C=>{var O=C===1?r:r==null?void 0:r.map((T,_)=>{var P=b&&b[_];if(P)return br(br({},T),{},{x:dt(P.x,T.x,C),y:dt(P.y,T.y,C),width:dt(P.width,T.width,C),height:dt(P.height,T.height,C)});if(i==="horizontal"){var D=dt(0,T.height,C),L=dt(T.stackedBarStart,T.y,C);return br(br({},T),{},{y:L,height:D})}var z=dt(0,T.width,C),F=dt(T.stackedBarStart,T.x,C);return br(br({},T),{},{width:z,x:F})});return C>0&&(n.current=O??null),O==null?null:v.createElement(Ft,null,v.createElement(Lue,{props:t,data:O}))}),v.createElement(wv,{label:t.label}),t.children)}function zue(e){var t=v.useRef(null);return v.createElement(Iue,{previousRectanglesRef:t,props:e})}var rq=0,Uue=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:ot(e,t)}};class que extends v.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:o,yAxisId:l,needClip:u,background:f,id:h}=this.props;if(t||n==null)return null;var p=rt("recharts-bar",i),b=h;return v.createElement(Ft,{className:p,id:h},u&&v.createElement("defs",null,v.createElement(mj,{clipPathId:b,xAxisId:o,yAxisId:l})),v.createElement(Ft,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(b,")"):void 0},v.createElement(Due,{data:n,dataKey:r,background:f,allOtherBarProps:this.props}),v.createElement(zue,this.props)))}}var Bue={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:rq,xAxisId:0,yAxisId:0,zIndex:an.bar};function Fue(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:o,activeBar:l,animationBegin:u,animationDuration:f,animationEasing:h,isAnimationActive:p}=e,{needClip:b}=Nv(t,n),g=js(),x=Ln(),E=aj(e.children,yu),S=we(C=>pue(C,e.id,x,E));if(g!=="vertical"&&g!=="horizontal")return null;var A,j=S==null?void 0:S[0];return j==null||j.height==null||j.width==null?A=0:A=g==="vertical"?j.height/2:j.width/2,v.createElement(I3,{xAxisId:t,yAxisId:n,data:S,dataPointFormatter:Uue,errorBarOffset:A},v.createElement(que,Ss({},e,{layout:g,needClip:b,data:S,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:o,activeBar:l,animationBegin:u,animationDuration:f,animationEasing:h,isAnimationActive:p})))}function $ue(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:o,bandSize:l,xAxis:u,yAxis:f,xAxisTicks:h,yAxisTicks:p,stackedData:b,displayedData:g,offset:x,cells:E,parentViewBox:S,dataStartIndex:A}=e,j=t==="horizontal"?f:u,C=b?j.scale.domain():null,O=wQ({numericAxis:j}),T=j.scale.map(O);return g.map((_,P)=>{var D,L,z,F,G,R;if(b){var J=b[P+A];if(J==null)return null;D=bQ(J,C)}else D=ot(_,n),Array.isArray(D)||(D=[O,D]);var $=Zce(r,rq)(D[1],P);if(t==="horizontal"){var ne,K=f.scale.map(D[0]),Z=f.scale.map(D[1]);if(K==null||Z==null)return null;L=i_({axis:u,ticks:h,bandSize:l,offset:o.offset,entry:_,index:P}),z=(ne=Z??K)!==null&&ne!==void 0?ne:void 0,F=o.size;var B=K-Z;if(G=Ba(B)?0:B,R={x:L,y:x.top,width:F,height:x.height},Math.abs($)>0&&Math.abs(G)<Math.abs($)){var te=kn(G||$)*(Math.abs($)-Math.abs(G));z-=te,G+=te}}else{var pe=u.scale.map(D[0]),k=u.scale.map(D[1]);if(pe==null||k==null)return null;if(L=pe,z=i_({axis:f,ticks:p,bandSize:l,offset:o.offset,entry:_,index:P}),F=k-pe,G=o.size,R={x:x.left,y:z,width:x.width,height:G},Math.abs($)>0&&Math.abs(F)<Math.abs($)){var Q=kn(F||$)*(Math.abs($)-Math.abs(F));F+=Q}}if(L==null||z==null||F==null||G==null||!i&&(F===0||G===0))return null;var ce=br(br({},_),{},{stackedBarStart:T,x:L,y:z,width:F,height:G,value:b?D:D[1],payload:_,background:R,tooltipPosition:{x:L+F/2,y:z+G/2},parentViewBox:S,originalDataIndex:P},E&&E[P]&&E[P].props);return ce}).filter(Boolean)}function Kue(e){var t=on(e,Bue),n=yue(t.stackId),r=Ln();return v.createElement(jv,{id:t.id,type:"bar"},i=>v.createElement(v.Fragment,null,v.createElement(uj,{legendPayload:Pue(t)}),v.createElement(_ue,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),v.createElement(dj,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),v.createElement(wr,{zIndex:t.zIndex},v.createElement(Fue,Ss({},t,{id:i})))))}var aq=v.memo(Kue,Ml);aq.displayName="Bar";var Hue=["domain","range"],Gue=["domain","range"];function jR(e,t){if(e==null)return{};var n,r,i=Yue(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yue(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function CR(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function iq(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=jR(e,Hue),{domain:o,range:l}=t,u=jR(t,Gue);return!CR(n,o)||!CR(r,l)?!1:Ml(i,u)}var Wue=["type"],Que=["dangerouslySetInnerHTML","ticks","scale"],Vue=["id","scale"];function OS(){return OS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},OS.apply(null,arguments)}function OR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function NR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OR(Object(n),!0).forEach(function(r){Xue(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xue(e,t,n){return(t=Zue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zue(e){var t=Jue(e,"string");return typeof t=="symbol"?t:t+""}function Jue(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NS(e,t){if(e==null)return{};var n,r,i=ede(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ede(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function tde(e){var t=xt(),n=v.useRef(null),r=$E(),{type:i}=e,o=NS(e,Wue),l=rv(r,"xAxis",i),u=v.useMemo(()=>{if(l!=null)return NR(NR({},o),{},{type:l})},[o,l]);return v.useLayoutEffect(()=>{u!=null&&(n.current===null?t(Sse(u)):n.current!==u&&t(Ese({prev:n.current,next:u})),n.current=u)},[u,t]),v.useLayoutEffect(()=>()=>{n.current&&(t(Ase(n.current)),n.current=null)},[t]),null}var nde=e=>{var{xAxisId:t,className:n}=e,r=we(zE),i=Ln(),o="xAxis",l=we(j=>CU(j,o,t,i)),u=we(j=>EU(j,t)),f=we(j=>dne(j,t)),h=we(j=>tU(j,t));if(u==null||f==null||h==null)return null;var{dangerouslySetInnerHTML:p,ticks:b,scale:g}=e,x=NS(e,Que),{id:E,scale:S}=h,A=NS(h,Vue);return v.createElement(hj,OS({},x,A,{x:f.x,y:f.y,width:u.width,height:u.height,className:rt("recharts-".concat(o," ").concat(o),n),viewBox:r,ticks:l,axisType:o,axisId:t}))},rde={allowDataOverflow:gn.allowDataOverflow,allowDecimals:gn.allowDecimals,allowDuplicatedCategory:gn.allowDuplicatedCategory,angle:gn.angle,axisLine:co.axisLine,height:gn.height,hide:!1,includeHidden:gn.includeHidden,interval:gn.interval,label:!1,minTickGap:gn.minTickGap,mirror:gn.mirror,orientation:gn.orientation,padding:gn.padding,reversed:gn.reversed,scale:gn.scale,tick:gn.tick,tickCount:gn.tickCount,tickLine:co.tickLine,tickSize:co.tickSize,type:gn.type,niceTicks:gn.niceTicks,xAxisId:0},ade=e=>{var t=on(e,rde);return v.createElement(v.Fragment,null,v.createElement(tde,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),v.createElement(nde,t))},cp=v.memo(ade,iq);cp.displayName="XAxis";var ide=["type"],ode=["dangerouslySetInnerHTML","ticks","scale"],sde=["id","scale"];function TS(){return TS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TS.apply(null,arguments)}function TR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function PR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TR(Object(n),!0).forEach(function(r){lde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lde(e,t,n){return(t=cde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cde(e){var t=ude(e,"string");return typeof t=="symbol"?t:t+""}function ude(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PS(e,t){if(e==null)return{};var n,r,i=dde(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function dde(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function fde(e){var t=xt(),n=v.useRef(null),r=$E(),{type:i}=e,o=PS(e,ide),l=rv(r,"yAxis",i),u=v.useMemo(()=>{if(l!=null)return PR(PR({},o),{},{type:l})},[l,o]);return v.useLayoutEffect(()=>{u!=null&&(n.current===null?t(jse(u)):n.current!==u&&t(Cse({prev:n.current,next:u})),n.current=u)},[u,t]),v.useLayoutEffect(()=>()=>{n.current&&(t(Ose(n.current)),n.current=null)},[t]),null}function hde(e){var{yAxisId:t,className:n,width:r,label:i}=e,o=v.useRef(null),l=v.useRef(null),u=we(zE),f=Ln(),h=xt(),p="yAxis",b=we(P=>AU(P,t)),g=we(P=>hne(P,t)),x=we(P=>CU(P,p,t,f)),E=we(P=>nU(P,t));if(v.useLayoutEffect(()=>{if(!(r!=="auto"||!b||ej(i)||v.isValidElement(i)||E==null)){var P=o.current;if(P){var D=P.getCalculatedWidth();Math.round(b.width)!==Math.round(D)&&h(Nse({id:t,width:D}))}}},[x,b,h,i,t,r,E]),b==null||g==null||E==null)return null;var{dangerouslySetInnerHTML:S,ticks:A,scale:j}=e,C=PS(e,ode),{id:O,scale:T}=E,_=PS(E,sde);return v.createElement(hj,TS({},C,_,{ref:o,labelRef:l,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:b.width,height:b.height,className:rt("recharts-".concat(p," ").concat(p),n),viewBox:u,ticks:x,axisType:p,axisId:t}))}var mde={allowDataOverflow:yn.allowDataOverflow,allowDecimals:yn.allowDecimals,allowDuplicatedCategory:yn.allowDuplicatedCategory,angle:yn.angle,axisLine:co.axisLine,hide:!1,includeHidden:yn.includeHidden,interval:yn.interval,label:!1,minTickGap:yn.minTickGap,mirror:yn.mirror,orientation:yn.orientation,padding:yn.padding,reversed:yn.reversed,scale:yn.scale,tick:yn.tick,tickCount:yn.tickCount,tickLine:co.tickLine,tickSize:co.tickSize,type:yn.type,niceTicks:yn.niceTicks,width:yn.width,yAxisId:0},pde=e=>{var t=on(e,mde);return v.createElement(v.Fragment,null,v.createElement(fde,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),v.createElement(hde,t))},up=v.memo(pde,iq);up.displayName="YAxis";var bde=(e,t)=>t,vj=W([bde,tt,bz,In,KU,So,Rre,En],Bre);function vde(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function gj(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(vde(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var o=e.currentTarget;n=o.offsetWidth>0?t.width/o.offsetWidth:1,r=o.offsetHeight>0?t.height/o.offsetHeight:1}var l=(u,f)=>({relativeX:Math.round((u-t.left)/n),relativeY:Math.round((f-t.top)/r)});return"touches"in e?Array.from(e.touches).map(u=>l(u.clientX,u.clientY)):l(e.clientX,e.clientY)}var oq=ra("mouseClick"),sq=Ff();sq.startListening({actionCreator:oq,effect:(e,t)=>{var n=e.payload,r=vj(t.getState(),gj(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(Tne({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var _S=ra("mouseMove"),lq=Ff(),Tc=null,Qs=null,Jx=null;lq.startListening({actionCreator:_S,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:o}=r.eventSettings,l=o==="all"||(o==null?void 0:o.includes("mousemove"));Tc!==null&&(cancelAnimationFrame(Tc),Tc=null),Qs!==null&&(typeof i!="number"||!l)&&(clearTimeout(Qs),Qs=null),Jx=gj(n);var u=()=>{var f=t.getState(),h=ah(f,f.tooltip.settings.shared);if(!Jx){Tc=null,Qs=null;return}if(h==="axis"){var p=vj(f,Jx);(p==null?void 0:p.activeIndex)!=null?t.dispatch(RU({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(MU())}Tc=null,Qs=null};if(!l){u();return}i==="raf"?Tc=requestAnimationFrame(u):typeof i=="number"&&Qs===null&&(Qs=setTimeout(u,i))}});function gde(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var _R={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},cq=lr({name:"rootProps",initialState:_R,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:_R.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),yde=cq.reducer,{updateOptions:xde}=cq.actions,wde=null,Sde={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},uq=lr({name:"polarOptions",initialState:wde,reducers:Sde}),{updatePolarOptions:Ede}=uq.actions,Ade=uq.reducer,dq=ra("keyDown"),fq=ra("focus"),hq=ra("blur"),Tv=Ff(),Pc=null,Vs=null,Vm=null;Tv.startListening({actionCreator:dq,effect:(e,t)=>{Vm=e.payload,Pc!==null&&(cancelAnimationFrame(Pc),Pc=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,o=i==="all"||i.includes("keydown");Vs!==null&&(typeof r!="number"||!o)&&(clearTimeout(Vs),Vs=null);var l=()=>{try{var u=t.getState(),f=u.rootProps.accessibilityLayer!==!1;if(!f)return;var{keyboardInteraction:h}=u.tooltip,p=Vm;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var b=nf(h,Tl(u),vu(u),gu(u)),g=b==null?-1:Number(b),x=!Number.isFinite(g)||g<0,E=So(u),S=Tl(u),A=ah(u,u.tooltip.settings.shared);if(p==="Enter"){if(x)return;var j=ub(u,A,"hover",String(h.index));t.dispatch(cb({active:!h.active,activeIndex:h.index,activeCoordinate:j}));return}var C=gne(u),O=C==="left-to-right"?1:-1,T=p==="ArrowRight"?1:-1,_;if(x){var P=vu(u),D=gu(u),L=T*O,z=$=>({active:!1,index:String($),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(_=-1,L>0){for(var F=0;F<S.length;F++)if(nf(z(F),S,P,D)!=null){_=F;break}}else for(var G=S.length-1;G>=0;G--)if(nf(z(G),S,P,D)!=null){_=G;break}if(_<0)return}else{_=g+T*O;var R=(E==null?void 0:E.length)||S.length;if(R===0||_>=R||_<0)return}var J=ub(u,A,"hover",String(_));t.dispatch(cb({active:!0,activeIndex:_.toString(),activeCoordinate:J}))}finally{Pc=null,Vs=null}};if(!o){l();return}r==="raf"?Pc=requestAnimationFrame(l):typeof r=="number"&&Vs===null&&(l(),Vm=null,Vs=setTimeout(()=>{Vm?l():(Vs=null,Pc=null)},r))}});Tv.startListening({actionCreator:fq,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var o="0",l=ah(n,n.tooltip.settings.shared),u=ub(n,l,"hover",String(o));t.dispatch(cb({active:!0,activeIndex:o,activeCoordinate:u}))}}}});Tv.startListening({actionCreator:hq,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(cb({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function mq(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var ba=ra("externalEvent"),pq=Ff(),Xm=new Map,Kd=new Map,ew=new Map;pq.startListening({actionCreator:ba,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,o=mq(r);ew.set(i,{handler:n,reactEvent:o});var l=Xm.get(i);l!==void 0&&(cancelAnimationFrame(l),Xm.delete(i));var u=t.getState(),{throttleDelay:f,throttledEvents:h}=u.eventSettings,p=h,b=p==="all"||(p==null?void 0:p.includes(i)),g=Kd.get(i);g!==void 0&&(typeof f!="number"||!b)&&(clearTimeout(g),Kd.delete(i));var x=()=>{var A=ew.get(i);try{if(!A)return;var{handler:j,reactEvent:C}=A,O=t.getState(),T={activeCoordinate:yre(O),activeDataKey:QA(O),activeIndex:xs(O),activeLabel:YU(O),activeTooltipIndex:xs(O),isTooltipActive:xre(O)};j&&j(T,C)}finally{Xm.delete(i),Kd.delete(i),ew.delete(i)}};if(!b){x();return}if(f==="raf"){var E=requestAnimationFrame(x);Xm.set(i,E)}else if(typeof f=="number"){if(!Kd.has(i)){x();var S=setTimeout(x,f);Kd.set(i,S)}}else x()}}});var jde=W([Lu],e=>e.tooltipItemPayloads),Cde=W([jde,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(o=>o.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),bq=ra("touchMove"),vq=Ff(),Xs=null,Zo=null,DR=null,Hd=null;vq.startListening({actionCreator:bq,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Hd=mq(n);var r=t.getState(),{throttleDelay:i,throttledEvents:o}=r.eventSettings,l=o==="all"||o.includes("touchmove");Xs!==null&&(cancelAnimationFrame(Xs),Xs=null),Zo!==null&&(typeof i!="number"||!l)&&(clearTimeout(Zo),Zo=null),DR=Array.from(n.touches).map(f=>gj({clientX:f.clientX,clientY:f.clientY,currentTarget:n.currentTarget}));var u=()=>{if(Hd!=null){var f=t.getState(),h=ah(f,f.tooltip.settings.shared);if(h==="axis"){var p,b=(p=DR)===null||p===void 0?void 0:p[0];if(b==null){Xs=null,Zo=null;return}var g=vj(f,b);(g==null?void 0:g.activeIndex)!=null&&t.dispatch(RU({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(h==="item"){var x,E=Hd.touches[0];if(document.elementFromPoint==null||E==null)return;var S=document.elementFromPoint(E.clientX,E.clientY);if(!S||!S.getAttribute)return;var A=S.getAttribute(wI),j=(x=S.getAttribute(SI))!==null&&x!==void 0?x:void 0,C=Ll(f).find(_=>_.id===j);if(A==null||C==null||j==null)return;var{dataKey:O}=C,T=Cde(f,A,j);t.dispatch(DU({activeDataKey:O,activeIndex:A,activeCoordinate:T,activeGraphicalItemId:j}))}Xs=null,Zo=null}};if(!l){u();return}i==="raf"?Xs=requestAnimationFrame(u):typeof i=="number"&&Zo===null&&(u(),Hd=null,Zo=setTimeout(()=>{Hd?u():(Zo=null,Xs=null)},i))}}});var yj={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},gq=lr({name:"eventSettings",initialState:yj,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:Ode}=gq.actions,Nde=gq.reducer,Tde=FL({brush:Gse,cartesianAxis:Tse,chartData:vae,errorBars:Hle,eventSettings:Nde,graphicalItems:Roe,layout:dQ,legend:gV,options:fae,polarAxis:Yie,polarOptions:Ade,referenceElements:Vse,renderedTicks:hle,rootProps:yde,tooltip:Pne,zIndex:eae}),Pde=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return L7({reducer:Tde,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([sq.middleware,lq.middleware,Tv.middleware,pq.middleware,vq.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(rI({type:"raf"}))},devTools:{serialize:{replacer:gde},name:"recharts-".concat(n)}})};function yq(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Ln(),o=v.useRef(null);if(i)return n;o.current==null&&(o.current=Pde(t,r));var l=_E;return v.createElement(RV,{context:l,store:o.current},n)}function _de(e){var{layout:t,margin:n}=e,r=xt(),i=Ln();return v.useEffect(()=>{i||(r(lQ(t)),r(sQ(n)))},[r,i,t,n]),null}var xq=v.memo(_de,Ml);function wq(e){var t=xt();return v.useEffect(()=>{t(xde(e))},[t,e]),null}var Dde=e=>{var t=xt();return v.useEffect(()=>{t(Ode(e))},[t,e]),null},Sq=v.memo(Dde,Ml);function MR(e){var{zIndex:t,isPanorama:n}=e,r=v.useRef(null),i=xt();return v.useLayoutEffect(()=>(r.current&&i(Zre({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Jre({zIndex:t,isPanorama:n}))}),[i,t,n]),v.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function RR(e){var{children:t,isPanorama:n}=e,r=we($re);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),o=r.filter(l=>l>0);return v.createElement(v.Fragment,null,i.map(l=>v.createElement(MR,{key:l,zIndex:l,isPanorama:n})),t,o.map(l=>v.createElement(MR,{key:l,zIndex:l,isPanorama:n})))}var Mde=["children"];function Rde(e,t){if(e==null)return{};var n,r,i=kde(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kde(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function gb(){return gb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gb.apply(null,arguments)}var Lde={width:"100%",height:"100%",display:"block"},Ide=v.forwardRef((e,t)=>{var n=BE(),r=FE(),i=UI();if(!gi(n)||!gi(r))return null;var{children:o,otherAttributes:l,title:u,desc:f}=e,h,p;return l!=null&&(typeof l.tabIndex=="number"?h=l.tabIndex:h=i?0:void 0,typeof l.role=="string"?p=l.role:p=i?"application":void 0),v.createElement(wE,gb({},l,{title:u,desc:f,role:p,tabIndex:h,width:n,height:r,style:Lde,ref:t}),o)}),zde=e=>{var{children:t}=e,n=we(Xb);if(!n)return null;var{width:r,height:i,y:o,x:l}=n;return v.createElement(wE,{width:r,height:i,x:l,y:o},t)},kR=v.forwardRef((e,t)=>{var{children:n}=e,r=Rde(e,Mde),i=Ln();return i?v.createElement(zde,null,v.createElement(RR,{isPanorama:!0},n)):v.createElement(Ide,gb({ref:t},r),v.createElement(RR,{isPanorama:!1},n))});function Ude(){var e=xt(),[t,n]=v.useState(null),r=we(OQ);return v.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),o=i.width/t.offsetWidth;Ye(o)&&o!==r&&e(uQ(o))}},[t,e,r]),n}function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qde(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LR(Object(n),!0).forEach(function(r){Bde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bde(e,t,n){return(t=Fde(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Fde(e){var t=$de(e,"string");return typeof t=="symbol"?t:t+""}function $de(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vs(){return vs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vs.apply(null,arguments)}var Kde=()=>(Cae(),null);function yb(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var Hde=v.forwardRef((e,t)=>{var n,r,i=v.useRef(null),[o,l]=v.useState({containerWidth:yb((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:yb((r=e.style)===null||r===void 0?void 0:r.height)}),u=v.useCallback((h,p)=>{l(b=>{var g=Math.round(h),x=Math.round(p);return b.containerWidth===g&&b.containerHeight===x?b:{containerWidth:g,containerHeight:x}})},[]),f=v.useCallback(h=>{if(typeof t=="function"&&t(h),i.current!=null&&(i.current.disconnect(),i.current=null),h!=null&&typeof ResizeObserver<"u"){var{width:p,height:b}=h.getBoundingClientRect();u(p,b);var g=E=>{var S=E[0];if(S!=null){var{width:A,height:j}=S.contentRect;u(A,j)}},x=new ResizeObserver(g);x.observe(h),i.current=x}},[t,u]);return v.useEffect(()=>()=>{var h=i.current;h!=null&&h.disconnect()},[u]),v.createElement(v.Fragment,null,v.createElement(Kf,{width:o.containerWidth,height:o.containerHeight}),v.createElement("div",vs({ref:f},e)))}),Gde=v.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,o]=v.useState({containerWidth:yb(n),containerHeight:yb(r)}),l=v.useCallback((f,h)=>{o(p=>{var b=Math.round(f),g=Math.round(h);return p.containerWidth===b&&p.containerHeight===g?p:{containerWidth:b,containerHeight:g}})},[]),u=v.useCallback(f=>{if(typeof t=="function"&&t(f),f!=null){var{width:h,height:p}=f.getBoundingClientRect();l(h,p)}},[t,l]);return v.createElement(v.Fragment,null,v.createElement(Kf,{width:i.containerWidth,height:i.containerHeight}),v.createElement("div",vs({ref:u},e)))}),Yde=v.forwardRef((e,t)=>{var{width:n,height:r}=e;return v.createElement(v.Fragment,null,v.createElement(Kf,{width:n,height:r}),v.createElement("div",vs({ref:t},e)))}),Wde=v.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?v.createElement(Gde,vs({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?v.createElement(Yde,vs({},e,{width:n,height:r,ref:t})):v.createElement(v.Fragment,null,v.createElement(Kf,{width:n,height:r}),v.createElement("div",vs({ref:t},e)))});function Qde(e){return e?Hde:Wde}var Vde=v.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:o,onContextMenu:l,onDoubleClick:u,onMouseDown:f,onMouseEnter:h,onMouseLeave:p,onMouseMove:b,onMouseUp:g,onTouchEnd:x,onTouchMove:E,onTouchStart:S,style:A,width:j,responsive:C,dispatchTouchEvents:O=!0}=e,T=v.useRef(null),_=xt(),[P,D]=v.useState(null),[L,z]=v.useState(null),F=Ude(),G=UE(),R=(G==null?void 0:G.width)>0?G.width:j,J=(G==null?void 0:G.height)>0?G.height:i,$=v.useCallback(ue=>{F(ue),typeof t=="function"&&t(ue),D(ue),z(ue),ue!=null&&(T.current=ue)},[F,t,D,z]),ne=v.useCallback(ue=>{_(oq(ue)),_(ba({handler:o,reactEvent:ue}))},[_,o]),K=v.useCallback(ue=>{_(_S(ue)),_(ba({handler:h,reactEvent:ue}))},[_,h]),Z=v.useCallback(ue=>{_(MU()),_(ba({handler:p,reactEvent:ue}))},[_,p]),B=v.useCallback(ue=>{_(_S(ue)),_(ba({handler:b,reactEvent:ue}))},[_,b]),te=v.useCallback(()=>{_(fq())},[_]),pe=v.useCallback(()=>{_(hq())},[_]),k=v.useCallback(ue=>{_(dq(ue.key))},[_]),Q=v.useCallback(ue=>{_(ba({handler:l,reactEvent:ue}))},[_,l]),ce=v.useCallback(ue=>{_(ba({handler:u,reactEvent:ue}))},[_,u]),fe=v.useCallback(ue=>{_(ba({handler:f,reactEvent:ue}))},[_,f]),xe=v.useCallback(ue=>{_(ba({handler:g,reactEvent:ue}))},[_,g]),Oe=v.useCallback(ue=>{_(ba({handler:S,reactEvent:ue}))},[_,S]),qe=v.useCallback(ue=>{O&&_(bq(ue)),_(ba({handler:E,reactEvent:ue}))},[_,O,E]),Be=v.useCallback(ue=>{_(ba({handler:x,reactEvent:ue}))},[_,x]),he=Qde(C);return v.createElement(n3.Provider,{value:P},v.createElement(rL.Provider,{value:L},v.createElement(he,{width:R??(A==null?void 0:A.width),height:J??(A==null?void 0:A.height),className:rt("recharts-wrapper",r),style:qde({position:"relative",cursor:"default",width:R,height:J},A),onClick:ne,onContextMenu:Q,onDoubleClick:ce,onFocus:te,onBlur:pe,onKeyDown:k,onMouseDown:fe,onMouseEnter:K,onMouseLeave:Z,onMouseMove:B,onMouseUp:xe,onTouchEnd:Be,onTouchMove:qe,onTouchStart:Oe,ref:$},v.createElement(Kde,null),n)))}),Xde=["width","height","responsive","children","className","style","compact","title","desc"];function Zde(e,t){if(e==null)return{};var n,r,i=Jde(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jde(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Eq=v.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:o,className:l,style:u,compact:f,title:h,desc:p}=e,b=Zde(e,Xde),g=yr(b);return f?v.createElement(v.Fragment,null,v.createElement(Kf,{width:n,height:r}),v.createElement(kR,{otherAttributes:g,title:h,desc:p},o)):v.createElement(Vde,{className:l,style:u,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},v.createElement(kR,{otherAttributes:g,title:h,desc:p,ref:t},v.createElement(Zse,null,o)))});function DS(){return DS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DS.apply(null,arguments)}function IR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function efe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IR(Object(n),!0).forEach(function(r){tfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tfe(e,t,n){return(t=nfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nfe(e){var t=rfe(e,"string");return typeof t=="symbol"?t:t+""}function rfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var afe={top:5,right:5,bottom:5,left:5},ife=efe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:afe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},yj),xj=v.forwardRef(function(t,n){var r,i=on(t.categoricalChartProps,ife),{chartName:o,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,categoricalChartProps:h}=t,p={chartName:o,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return v.createElement(yq,{preloadedState:{options:p},reduxStoreName:(r=h.id)!==null&&r!==void 0?r:o},v.createElement(P3,{chartData:h.data}),v.createElement(xq,{layout:i.layout,margin:i.margin}),v.createElement(Sq,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),v.createElement(wq,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),v.createElement(Eq,DS({},i,{ref:n})))}),ofe=["axis"],sfe=v.forwardRef((e,t)=>v.createElement(xj,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:ofe,tooltipPayloadSearcher:yv,categoricalChartProps:e,ref:t})),lfe=["axis","item"],cfe=v.forwardRef((e,t)=>v.createElement(xj,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:lfe,tooltipPayloadSearcher:yv,categoricalChartProps:e,ref:t}));function ufe(e){var t=xt();return v.useEffect(()=>{t(Ede(e))},[t,e]),null}var dfe=["layout"];function MS(){return MS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},MS.apply(null,arguments)}function ffe(e,t){if(e==null)return{};var n,r,i=hfe(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hfe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function zR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mfe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zR(Object(n),!0).forEach(function(r){pfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pfe(e,t,n){return(t=bfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bfe(e){var t=vfe(e,"string");return typeof t=="symbol"?t:t+""}function vfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gfe={top:5,right:5,bottom:5,left:5},Aq=mfe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:gfe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},yj),yfe=v.forwardRef(function(t,n){var r,i=on(t.categoricalChartProps,Aq),{layout:o}=i,l=ffe(i,dfe),{chartName:u,defaultTooltipEventType:f,validateTooltipEventTypes:h,tooltipPayloadSearcher:p}=t,b={chartName:u,defaultTooltipEventType:f,validateTooltipEventTypes:h,tooltipPayloadSearcher:p,eventEmitter:void 0};return v.createElement(yq,{preloadedState:{options:b},reduxStoreName:(r=i.id)!==null&&r!==void 0?r:u},v.createElement(P3,{chartData:i.data}),v.createElement(xq,{layout:o,margin:i.margin}),v.createElement(Sq,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),v.createElement(wq,{baseValue:void 0,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),v.createElement(ufe,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),v.createElement(Eq,MS({},l,{ref:n})))});function UR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UR(Object(n),!0).forEach(function(r){xfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xfe(e,t,n){return(t=wfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wfe(e){var t=Sfe(e,"string");return typeof t=="symbol"?t:t+""}function Sfe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Efe=["item"],Afe=qR(qR({},Aq),{},{layout:"centric",startAngle:0,endAngle:360}),jfe=v.forwardRef((e,t)=>{var n=on(e,Afe);return v.createElement(yfe,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Efe,tooltipPayloadSearcher:yv,categoricalChartProps:n,ref:t})}),Cfe=["axis"],Ofe=v.forwardRef((e,t)=>v.createElement(xj,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Cfe,tooltipPayloadSearcher:yv,categoricalChartProps:e,ref:t}));const _r=["#5b6cff","#10b981","#f59e0b","#ec4899","#06b6d4","#8b5cf6","#ef4444"],_c="#9ca3af",Gd="#e5e7eb";function Zm({active:e,payload:t,label:n}){return!e||!t||t.length===0?null:d.jsxs("div",{className:"bb-adminchat-chart-tooltip",children:[n!==void 0&&n!==""?d.jsx("div",{className:"bb-adminchat-chart-tooltip-label",children:n}):null,t.map((r,i)=>d.jsxs("div",{className:"bb-adminchat-chart-tooltip-row",children:[d.jsx("span",{className:"bb-adminchat-chart-tooltip-dot",style:{background:r.color}}),d.jsx("span",{className:"bb-adminchat-chart-tooltip-name",children:r.name}),d.jsx("span",{className:"bb-adminchat-chart-tooltip-value",children:r.value})]},i))]})}function jq({artifact:e}){const{chartKind:t,xKey:n,yKeys:r,data:i,title:o}=e;if(!Array.isArray(i)||i.length===0)return d.jsxs("div",{className:"bb-adminchat-chart bb-adminchat-chart-empty-state",children:[d.jsx("div",{className:"bb-adminchat-chart-empty-icon","aria-hidden":!0,children:"◌"}),d.jsx("div",{className:"bb-adminchat-chart-empty-text",children:"No data yet."})]});const l=i.length<=1,u={top:10,right:14,left:4,bottom:6},f=t==="pie"?360:t==="bar"&&i.length<=3?460:t==="bar"&&i.length<=6?620:null,h=t==="pie"?240:i.length<=3?220:260,p=f?{maxWidth:f,marginLeft:0,marginRight:"auto"}:{};return d.jsxs("div",{className:"bb-adminchat-chart",style:p,children:[o?d.jsx("div",{className:"bb-adminchat-chart-title",children:o}):null,d.jsx("div",{className:"bb-adminchat-chart-canvas",children:d.jsx(tV,{width:"100%",height:h,children:t==="line"?d.jsxs(sfe,{data:i,margin:u,children:[d.jsx(lp,{stroke:Gd,strokeDasharray:"2 6",vertical:!1}),d.jsx(cp,{dataKey:n,stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,tickMargin:8}),d.jsx(up,{stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,width:32}),d.jsx(Wm,{content:d.jsx(Zm,{}),cursor:{stroke:Gd}}),r.length>1?d.jsx(Vd,{wrapperStyle:{fontSize:12,paddingTop:8}}):null,r.map((b,g)=>d.jsx(H3,{type:"monotone",dataKey:b,stroke:_r[g%_r.length],strokeWidth:2.5,dot:i.length<=30?{r:3,strokeWidth:0,fill:_r[g%_r.length]}:!1,activeDot:{r:5,strokeWidth:2,stroke:"#fff"},isAnimationActive:!1},b))]}):t==="area"?d.jsxs(Ofe,{data:i,margin:u,children:[d.jsx("defs",{children:r.map((b,g)=>{const x=_r[g%_r.length];return d.jsxs("linearGradient",{id:`bb-area-grad-${g}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[d.jsx("stop",{offset:"0%",stopColor:x,stopOpacity:.35}),d.jsx("stop",{offset:"100%",stopColor:x,stopOpacity:.02})]},b)})}),d.jsx(lp,{stroke:Gd,strokeDasharray:"2 6",vertical:!1}),d.jsx(cp,{dataKey:n,stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,tickMargin:8}),d.jsx(up,{stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,width:32}),d.jsx(Wm,{content:d.jsx(Zm,{}),cursor:{stroke:Gd}}),r.length>1?d.jsx(Vd,{wrapperStyle:{fontSize:12,paddingTop:8}}):null,r.map((b,g)=>d.jsx(J3,{type:"monotone",dataKey:b,stackId:"1",stroke:_r[g%_r.length],strokeWidth:2,fill:`url(#bb-area-grad-${g})`,isAnimationActive:!1},b))]}):t==="bar"?d.jsxs(cfe,{data:i,margin:u,barCategoryGap:"22%",children:[d.jsx(lp,{stroke:Gd,strokeDasharray:"2 6",vertical:!1}),d.jsx(cp,{dataKey:n,stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,tickMargin:8,hide:l}),d.jsx(up,{stroke:_c,fontSize:11,tickLine:!1,axisLine:!1,width:32}),d.jsx(Wm,{content:d.jsx(Zm,{}),cursor:{fill:"rgba(91, 108, 255, 0.06)"}}),r.length>1?d.jsx(Vd,{wrapperStyle:{fontSize:12,paddingTop:8}}):null,r.map((b,g)=>d.jsx(aq,{dataKey:b,fill:_r[g%_r.length],radius:[6,6,0,0],isAnimationActive:!1,children:r.length===1?i.map((x,E)=>d.jsx(yu,{fill:_r[E%_r.length]},E)):null},b))]}):d.jsxs(jfe,{children:[d.jsx(Wm,{content:d.jsx(Zm,{})}),d.jsx(C3,{data:i,dataKey:r[0],nameKey:n,cx:"50%",cy:"50%",innerRadius:55,outerRadius:95,paddingAngle:2,stroke:"#fff",strokeWidth:2,isAnimationActive:!1,children:i.map((b,g)=>d.jsx(yu,{fill:_r[g%_r.length]},g))}),d.jsx(Vd,{wrapperStyle:{fontSize:12,paddingTop:8},iconType:"circle",iconSize:8})]})})})]})}const Nfe=25;function Tfe(){var r,i,o;const e=xb({queryKey:["admin-chat","conversations"],queryFn:async({pageParam:l})=>{const u=await me("AdminChatListConversations",{page:l,pageSize:Nfe});if(!u.success)throw new Error(u.error);return u.data},initialPageParam:1,getNextPageParam:l=>l.page*l.pageSize<l.total?l.page+1:void 0,refetchInterval:3e4,staleTime:1e4}),t=((r=e.data)==null?void 0:r.pages.flatMap(l=>l.conversations))??[],n=((o=(i=e.data)==null?void 0:i.pages[0])==null?void 0:o.total)??0;return{...e,conversations:t,total:n,hasMore:!!e.hasNextPage,isFetchingMore:e.isFetchingNextPage,loadMore:()=>{e.hasNextPage&&!e.isFetchingNextPage&&e.fetchNextPage()}}}function Pfe(e){return Et({queryKey:["admin-chat","conversation",e],queryFn:async()=>{if(!e)return null;const t=await me("AdminChatGetConversation",{conversationId:e});if(!t.success)throw new Error(t.error);return t.data},enabled:!!e,refetchInterval:!1,staleTime:3e3})}function _fe(){const e=Ne();return je({mutationFn:async({conversationId:t,message:n})=>{const r=await me("AdminChatSend",{conversationId:t,message:n});if(!r.success)throw new Error(r.error);return r.data},onSuccess:t=>{e.invalidateQueries({queryKey:["admin-chat","conversations"]}),e.invalidateQueries({queryKey:["admin-chat","conversation",t.conversationId]})},onError:t=>le.error(t instanceof Error?t.message:"Send failed")})}function Dfe(){const e=Ne();return je({mutationFn:async({conversationId:t})=>{const n=await me("AdminChatDelete",{conversationId:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:()=>{le.success("Conversation deleted"),e.invalidateQueries({queryKey:["admin-chat"]})},onError:t=>le.error(t instanceof Error?t.message:"Delete failed")})}const RS={status:"idle",tools:[],text:"",lastSequence:0};function Mfe(e,t){switch(t.type){case"reset":return RS;case"connecting":return{...RS,status:"streaming"};case"event":{const n=Math.max(e.lastSequence,t.sequence);switch(t.kind){case"tool_call_started":return e.tools.some(r=>r.startedAt===t.sequence)?{...e,lastSequence:n}:{...e,status:"streaming",lastSequence:n,tools:[...e.tools,{startedAt:t.sequence,toolName:t.payload.tool,status:"in_progress"}]};case"tool_call_completed":{const r=[...e.tools].reverse().findIndex(l=>l.toolName===t.payload.tool&&l.status==="in_progress");if(r===-1)return{...e,lastSequence:n};const i=e.tools.length-1-r,o={...e.tools[i],status:t.payload.ok?"ok":"error",error:t.payload.error,artifact:t.payload.artifact};return{...e,lastSequence:n,tools:[...e.tools.slice(0,i),o,...e.tools.slice(i+1)]}}case"assistant_text":return{...e,status:"streaming",lastSequence:n,text:e.text+t.payload.delta};case"done":return{...e,status:"done",lastSequence:n};case"error":return{...e,status:"error",lastSequence:n,error:t.payload.message}}return e}case"connection_error":return{...e,status:"error",error:t.message}}}function Rfe(e){const[t,n]=v.useReducer(Mfe,RS);return v.useEffect(()=>{if(!e)return;let r=!1;n({type:"connecting"});let i;try{i=Re()}catch(f){n({type:"connection_error",message:f instanceof Error?f.message:"config missing"});return}let o;try{const f=new URL(`/api/admin-chat/stream/${encodeURIComponent(e.conversationId)}`,i.apiUrl);f.searchParams.set("since",String(e.sinceSequence)),f.searchParams.set("apiKey",i.apiKey),o=f.toString()}catch(f){n({type:"connection_error",message:f instanceof Error?f.message:"invalid apiUrl"});return}const l=new EventSource(o),u=f=>h=>{if(r)return;const p=parseInt(h.lastEventId,10)||0;let b={};try{h.data&&(b=JSON.parse(h.data))}catch{return}n({type:"event",sequence:p,kind:f,payload:b})};return l.addEventListener("tool_call_started",u("tool_call_started")),l.addEventListener("tool_call_completed",u("tool_call_completed")),l.addEventListener("assistant_text",u("assistant_text")),l.addEventListener("done",u("done")),l.addEventListener("error",u("error")),l.onerror=()=>{r||l.readyState===EventSource.CLOSED&&n({type:"connection_error",message:"stream connection lost"})},()=>{r=!0,l.close(),n({type:"reset"})}},[e==null?void 0:e.conversationId,e==null?void 0:e.sinceSequence]),t}function BR({open:e,title:t,onClose:n,children:r,headerAction:i}){return v.useEffect(()=>{if(!e)return;const o=l=>{l.key==="Escape"&&n()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[e,n]),d.jsxs(d.Fragment,{children:[d.jsx("div",{className:`bb-agent-drawer-scrim ${e?"bb-agent-drawer-scrim-open":""}`,onClick:n,"aria-hidden":!e}),d.jsxs("aside",{className:`bb-agent-drawer ${e?"bb-agent-drawer-open":""}`,role:"dialog","aria-label":t,"aria-hidden":!e,children:[d.jsxs("header",{className:"bb-agent-drawer-head",children:[d.jsx("h3",{className:"bb-agent-drawer-title",children:t}),d.jsxs("div",{className:"bb-agent-drawer-head-actions",children:[i,d.jsx("button",{type:"button",className:"bb-agent-drawer-close",onClick:n,"aria-label":"Close",children:"✕"})]})]}),d.jsx("div",{className:"bb-agent-drawer-body",children:r})]})]})}function kfe(e){const t=new Date(e).getTime(),n=Date.now()-t;return n<6e4?"just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:`${Math.floor(n/864e5)}d ago`}function Lfe({conversations:e,total:t,hasMore:n,isLoadingMore:r,onLoadMore:i,activeId:o,onSelect:l,onDelete:u,onDeleteBulk:f}){const[h,p]=v.useState(new Set),b=v.useMemo(()=>{const j=new Set;for(const C of e)h.has(C.id)&&j.add(C.id);return j},[e,h]),g=b.size,x=g>0&&g===e.length,E=j=>{const C=new Set(b);C.has(j)?C.delete(j):C.add(j),p(C)},S=()=>{p(x?new Set:new Set(e.map(j=>j.id)))},A=()=>p(new Set);return e.length===0?d.jsx("p",{className:"bb-adminchat-rail-empty",children:"No conversations yet. Close this and type a message below to start one."}):d.jsxs("div",{className:"bb-history-drawer",children:[d.jsxs("div",{className:"bb-history-toolbar",children:[d.jsxs("label",{className:"bb-history-toolbar-select",children:[d.jsx("input",{type:"checkbox",checked:x,ref:j=>{j&&(j.indeterminate=g>0&&!x)},onChange:S,"aria-label":x?"Deselect all":"Select all"}),d.jsx("span",{children:g>0?`${g} selected`:n?`${e.length} of ${t}`:`${e.length} conversation${e.length===1?"":"s"}`})]}),g>0&&d.jsxs("div",{className:"bb-history-toolbar-actions",children:[d.jsx("button",{type:"button",className:"bb-history-toolbar-clear",onClick:A,children:"Clear"}),d.jsxs("button",{type:"button",className:"bb-history-toolbar-delete",onClick:()=>f(Array.from(b)),children:["Delete ",g]})]})]}),d.jsxs("div",{className:"bb-adminchat-rail-list",children:[e.map(j=>{const C=b.has(j.id);return d.jsxs("div",{className:`bb-adminchat-conv ${j.id===o?"bb-adminchat-conv-active":""} ${C?"bb-adminchat-conv-checked":""}`,onClick:()=>l(j.id),role:"button",tabIndex:0,onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),l(j.id))},children:[d.jsx("input",{type:"checkbox",className:"bb-adminchat-conv-check",checked:C,onClick:O=>O.stopPropagation(),onChange:()=>E(j.id),"aria-label":C?"Deselect conversation":"Select conversation"}),d.jsxs("div",{className:"bb-adminchat-conv-body",children:[d.jsx("div",{className:"bb-adminchat-conv-title",children:j.title??"Untitled conversation"}),d.jsxs("div",{className:"bb-adminchat-conv-meta",children:[d.jsxs("span",{children:[j.messageCount," msg"]}),d.jsx("span",{className:"bb-adminchat-conv-sep",children:"·"}),d.jsx("span",{children:kfe(j.lastMessageAt)})]})]}),d.jsx("button",{type:"button",className:"bb-adminchat-conv-archive",onClick:O=>{O.stopPropagation(),u(j.id)},title:"Delete conversation","aria-label":"Delete conversation",children:"🗑"})]},j.id)}),n&&d.jsx("div",{className:"bb-history-loadmore",children:d.jsx("button",{type:"button",className:"bb-history-loadmore-btn",onClick:i,disabled:r,children:r?"Loading…":`Load more (${t-e.length} remaining)`})})]})]})}function Cq(){return Et({queryKey:["integrations","search-console"],queryFn:async()=>{const e=await me("GetSearchConsoleIntegration");if(!e.success)throw new Error(e.error);return e.data},staleTime:6e4})}function Ife(){return je({mutationFn:async()=>{const e=await me("StartSearchConsoleOAuth");if(!e.success)throw new Error(e.error);return e.data},onError:e=>le.error(e instanceof Error?e.message:"Could not start sign-in")})}function zfe(){const e=Ne();return je({mutationFn:async({property:t})=>{const n=await me("SelectSearchConsoleProperty",{property:t});if(!n.success)throw new Error(n.error);return n.data},onSuccess:()=>{le.success("Search Console connected"),e.invalidateQueries({queryKey:["integrations","search-console"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not link property")})}function Ufe(){const e=Ne();return je({mutationFn:async()=>{const t=await me("DisconnectSearchConsole");if(!t.success)throw new Error(t.error);return t.data},onSuccess:()=>{le.success("Search Console disconnected"),e.invalidateQueries({queryKey:["integrations","search-console"]})},onError:t=>le.error(t instanceof Error?t.message:"Could not disconnect Search Console")})}const FR={path:"M12 0C5.24 0 0 4.952 0 11.64c0 3.499 1.434 6.521 3.769 8.61a.96.96 0 0 1 .323.683l.065 2.135a.96.96 0 0 0 1.347.85l2.381-1.053a.96.96 0 0 1 .641-.046A13 13 0 0 0 12 23.28c6.76 0 12-4.952 12-11.64S18.76 0 12 0m6.806 7.44c.522-.03.971.567.63 1.094l-4.178 6.457a.707.707 0 0 1-.977.208l-3.87-2.504a.44.44 0 0 0-.49.007l-4.363 3.01c-.637.438-1.415-.317-.995-.966l4.179-6.457a.706.706 0 0 1 .977-.21l3.87 2.505c.15.097.344.094.491-.007l4.362-3.008a.7.7 0 0 1 .364-.13",hex:"0866FF"},qfe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACHklEQVR4AWKgFXBoAFRfBhDNRAEAPu5+P4FJKKgREGm2VZF03VKUdG0E0IAiLCgpadVuAbYQFJVUW5FBxLocIMAIITiEaPHUltUtXvcuPWvq6eq96PHB4b7v3r173gGHFH2Yl5S8bgIRPiWv+aL5EY71EBXgkpQcsMQfkzEDnWzky8BJkpfOBpOALvPGRHkJ+HXQfXqylOksiEs5EQu+BqAaICn3QZsB8G8HuDZlh2dPlr0JfxjRFktt/VpA80Eg5EkGgDcZgG80xBZh7fgFdM9csw3w7vvnsbgsoGb03KJx6opNgDvhD2IpIQDROpelH2C+68xXA+pDl9QC8KLDQnIARly6pxfgTcii3YCOBfCHA6DGOYxTPoh4Vnl58rAtyDoAi4sqnyqqAiwlu1MJY5PdbAMKGuc0VF4vk1sUNhzwxtcMz4bbYef2EJsALCcEINZCEv2A4okgYiE5wGJ4dYBugKEKcTsBkdkeugGmRLMTsDsm0g14SvNbpICnwwosx+vAXgD5RPR48m/CkhHI9rtxwPRi748CfJG89sH3LwBSwN10nSXX+1pg3/rgjwLE8lOxoXGuosoTA4yj//DW34Q3pG8HRHMpgpwUwQN9vyrsSQb07wZ0mVOPft0+lRtpzlU45pzG66LMGKe8bpEW4tC8XnY40VAMomElrFePnr+jPQx0U/pK5CGFju5Y/JmcYzgIW++vy/HmEyfImY8XZOkOdzPDZqcAAAAASUVORK5CYII=",Bfe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABXWlDQ1BJQ0MgUHJvZmlsZQAAKJF1kEsoRGEYhh8ORhpZUCTlLGSFGNLshIWUxRiUy+rMmWuNmd85R7KR68KKLGSJjY01S5KNnVIWoqwtKRum4zszNC756u17env/v7cPSv2GUukyHWYzjhUeGtAnp6Z13xMV1FBPI5ph2qo/FBpB5mv/nNdbSrx90+79tRpcvjprzh6MWl3a2srSxd/8j6mKxmxT9ruoxVSWAyXShtCCozxWwnWWlBJe9zhR4D2PIwU+zmfGw4PC58K6mTSiwo/CbZFvfuIbz6bnzc8OXnt/LDMxJrtS1IRNmCEG/sn05DODZFEsYpEiQRIHnX5xFGliwsNkMOmgTThAp6jXu+3vmxW97D4En0HbKnqRXTjdhIa7otciuZoNOLlUhmXkLU1UGk/B8xFUT0HttZx2xo53Bwrt/X1Q/uC6L63g24bcjuu+Hbhu7lAe38P53AcLDmT0xSwuwwAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAAD4/042AAAJdElEQVRoBc1afXAUZxl/3nd375IcgQZKS5HPkkid0BQai0gBU5kyUAq12jLO2DpTderQUf9QGQoGPadUmP5HtWNbZ9QZq2PbabG2WCdQyDc4JlBDaQslRKSln5CA5OPudvf19+zennd7e8eGU8Iz2dvd9332+X6e99l3I+h/AA/WdxmzyufNVlKfL0ndCpI3Eck5guR1SpFQwv5AkN0rSPUooTqUoEPJj4+fiB+pTZbKXpRCYNuSZL3UtTW2LVZIorlCiIlMT3kHXwAEuDAjj5lSagBTR4VUe2xlvZRo+Vl3nOK2gzzKH49m6Meeu1dpJz6wVpKQ6yFwgyYpBiuTnT7CEGKFNBx8tmwahsotZNtPXTWk7fp2t0iFoeHhjEqBrQ3JRYbSf4SH79CEkCaEZuFLARYARmA6CuHVZCnr0c0tRltYmqEUiNefrojGrt0ghfwBLFdpwtklyh0onwFFLFsNIWt2kHl228aOyf8ORMwavKgCWxf3z9T1CU/oUqy2RhEmWTxGdclhpbuK7E5qyfVb9pb1FiNQVIHtyxI3CmE8g3CpS11SihVjXXyOvWEr9XZSmPc3Nke6CmEXVCAt/AsQvuZyC+8Jy55AxToJJe4ppESgAtuXDM8QWnSXFGIex/tYghtOdEzJxOpNzWXH/bJAx1zghBUy+kvE/JgLz5KxAaHEp4WKPB1vUONypcVy6R+IxiZv0KS4I2n5Z8bunkNYF+K2MmVv8UuRE0LbvpC8RZL+GpaYSl6YriTg6oQ2Zdi0E6s2t5W3eLJlPPBUvTJIGXEk7RUnPAvLCyZW/nKEdzze0FeWp0D/eGuFFLRyrJPWEyzozLLB4g1Rc+oab97xQLxhn64s+RBWWTnqyMkJQo9s1vli81momW6vyDOojOg9tIfitUci/KijgGHdWseacW+TBxgzh7CojGCGS6rvsAfd+aDewkYhSKEZUAk8hoPpBPVOCjRToGNjnky0E3jGZH4BgOYPesrFkYmzb+FpnX+k0NaibFYkWTg/QIGFXye6YRlRpCJXADbUMJi93Uz0+osgrGEgbT0LPWVFJdGi7xDNqINwoH20lajrWS+eXUYsvIbnFn6TqHoxeCC6z31E1PMK0XG0dNJw8bxftrEhRCQljLtx2aHHaxVcoVaATh6wFWqWEa34bt5UzsDseqIkLMhMjXJQA7Eozl9+jGgmXm08mD7Pxet+3sXjcRuvNCsbiRZkoprourlQ5vNEv19P9O4bUNAJFo8K6OMSXljOa5akqsQsQeKGoLKpEAKTav77YLGrOUtBNG19DpXPfjVXeO/ZaryvOR0/cFPAq8Zz87OE9/B0xMZVM1zPeWPemZtKMKsxKiZVy6gUC8C4KkgBCSLvv46YhCIXgwgszvLbiOEJU6HAPcFPGFEXj81oIDwWP5C+96EPw6On/+GGl2/KySMkc4yUWKST0pYITmXWygcamJ06RPSnHxPVrnLdzgJM+wxik+M9G1y/Osm34CtE46qyJ7Ou03zY+nV3Ek2vzZrLujy0k+iTPvDMax7SSKCjaXKpDrPdGFQZPFoS8ffWHhy7YV3kxKTZRN96DjHuVwDmt5G4E6cR3czpVQScHIkhwe8PRjr7PtHffgcB4dVCwHZAu41NBBJz0kYphEs6KoMOYhqYslcKgQUFb15HFJtQCAPjUJRzpG4t0bXX5+OxLO2/IrpwBl52amQ+Do84Ia/ETISSnFLMA8GP549aqCZV05GQEKwYKORIBRRciCQPgr4uojdehcFQsoPCOvsZlP9xHP2wSenAllv4Dbf2F6PG7UD9Awg1JLofkvBg8xOwLnC8iubH8d/ryrY/FFJOLdULV88kmjU/l3wCAnkLmjdThRyZMte7yz0ffInovZ4iiZuLTtjBGJTYNcOOWelwDRSoGJ9Lp2cX0cDp3LHJCLPxzvZX7vjAh0jc3yLHMn1m7rz/Do0nSSn+KSWJnrDu8hMpdn/hHARCMgqOrRDQ/mui8x/ntw6FHnWMbqvD0qJUZ6nhE8Tk4ItE/afCCXQSi+Xhl8MlboYXNFDSbpMilTqITbFz7JJQEMKiHA7df4RAHA4XwTexdrQ8iVxBdQobCYyHRB8SKnVAVk+rPAEmR8MowKvvELrP4YHiqh54BnX8EzBBjbvQXxz3ECx/EqWT15mwwLLC6Mf1sopjct3zIolt791hHMDt8iAE60GdLgRH9hFxG6Bj0VNQoAcCFoJT6DRbfxE+cT06bu239m1oEoN8TSll/dlUaiSMC3mB2f8bHAgR9gZHCB9D54k6/0D0l0fce6bFIfRmE1HTDiQoVlbGY+Dyeng30Qs/JBrBdV5f5aIF/rKh0UIg8AhZll7EnA8Usfm7IlK7PcwuHPcyFt6wqj6FzvNqUIFkAxBw4F3Xmk5zyNTTwK1D5RQsXtdgHl48jxA8cwrMYb5i7YL3fPaZN7psW7WVx3pv/96rNYlM5Gy/zbxL2tpO9BhhK5/TvHH7zMBvTs7bk2dmd9j9BRfG42aPleVQ9L+kZKMXu+bvCvgo8rWHW3X4Gzw95PfK+v6Kre3XWMOwwAJz8vHhWDJIeCaGcQ6TTFOIDvdSgGWzlOqIpDRkmQsZcX8Od1gq8VN4YDBMLngELteZQwXrVYKkFf/+foGvOi5kFODbxvbydss2H9czgZXGugJOrvXtJzc1G3uyxclRgCf0cv1RE6HE+/NXChgIP8jUKSLnfuKXKdDWj3xRzYlYhO11mjvWO3VseXwj6MMHtNUbW8VbfgUC7bxlr+hNiaH7+OPCaJLaT7zUe+aNknkaVee+IOGZfqACPNHYHOuyaPheLBpHxyKcmCdbHj3/uodbjU6WKQgKKsDIm1pif0+q5BoosTeCOLwc1YljmnmhXLabdurOzW1GR5Dg3lhRBRhpS2vZO0Mj/XenbPsx9EzD/09vcMhIoRIpy9zRb51fu7kt+qYnaKFzYBIXQt7WkGrQSGtEQi3njpA3WgutXYVo+MdZgPSHbqbVinqzdWOLgU4pHIxKASb5+CoVHRpM3iUo8iC+rC/FpnCEX8Lx5+yYhWHLociux+sgl0cTkncqsp9ODH60M949FZ1TeBi1Ah5pfHDTI8L8nLTklxTJ5QivGuzRjON59op/q5I95jGDsoNI0F5J1l7g7hw5c+zApf7nikfTk+uSzrxL7Gy0Yq9SYLsPIXYTXjhmCdIchbBdfYGk/S+o1oNOtk1ptD8SOfvOhqYp2AEtDf4D3GhcWooaw70AAAAASUVORK5CYII=",Ffe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABXWlDQ1BJQ0MgUHJvZmlsZQAAKJF1kEsoRGEYhh8ORhpZUCTlLGSFGNLshIWUxRiUy+rMmWuNmd85R7KR68KKLGSJjY01S5KNnVIWoqwtKRum4zszNC756u17env/v7cPSv2GUukyHWYzjhUeGtAnp6Z13xMV1FBPI5ph2qo/FBpB5mv/nNdbSrx90+79tRpcvjprzh6MWl3a2srSxd/8j6mKxmxT9ruoxVSWAyXShtCCozxWwnWWlBJe9zhR4D2PIwU+zmfGw4PC58K6mTSiwo/CbZFvfuIbz6bnzc8OXnt/LDMxJrtS1IRNmCEG/sn05DODZFEsYpEiQRIHnX5xFGliwsNkMOmgTThAp6jXu+3vmxW97D4En0HbKnqRXTjdhIa7otciuZoNOLlUhmXkLU1UGk/B8xFUT0HttZx2xo53Bwrt/X1Q/uC6L63g24bcjuu+Hbhu7lAe38P53AcLDmT0xSwuwwAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAAD4/042AAAJuUlEQVRoBdVaa2wU1xX+7syu3zZ2IDiFUB4G1+FV8TBgcEJIQxuTUlRFCQLUNG2TEqnkUdFQkUaqf6RKQktUFalqRF4qTVJKFcU4TVqwcEkw5RGqgkpjDA4EYZNEGBs/dtfenZl+Z5bJer0z+wC7Sq+0OzP3nnvud+4959xzz4zCcJTa23MQ7CuDqVfCh2plYTZMazKUdUOUvdYBzTprWeoEDKMJGo4iN78VtX8PXe/w6poZ3AsdkxdWQtdWKdO8E0qVQ6GIP8Diz5S/QUVjg9NmoZtEpy2l7YVm1qHl8FHsgjGIOu3bzAWonZGFUMFKjvCwUqoausqxwZqssYaA9oKhOKzGRhHKsEKWZR2AiReQ17sbtScHvLq51WcmwE8X3wbdfIoqsjw6OFGnidltcLtOEOiUhitGVnthak/juYPvedIPaUhPgE1LCqFHnlRQjxJ4HiIy3SNQfLYgAS7kNtrTL7ClqSfVKHoqAvy4aqrKMncoTbufs+RP0O2UDDIgiNqNX/n0agWzEpUT/oFDFy4n45B8BTYtmA9d36F0VCA8QrPuhc6vwTLRjIjxHWw58oEXmbcANnhtl9LUpOtTGRlCfiZ13OId1eTqM2+SF6qUZVrnYJj3egnhLsATi8ugG+8oXSuPB69gGXQSZoQDD+5K81ME5stirVNPWjMMRPpJG6ChjoJP83NCqdYG67V80vvpfX1sT+IJRAjDbIGhr8AvD7YOldgZLVZfe3uBCgXrONod8Woj4ENYMWk+ykdzUayo2xYGBgE0d5xG4/kPYdmAWBvuRkVxKWqmL8eyybMwung8sn3Z6Al2ou1SG/a0HkbDmUNo77sC+AspSAxCwh3ViRO5z8rJXcXNr3dwu4gfX0KBp6j3Q8ALCUcwuvDY4nvw9Tl3xffhkxEx8GLTn/Bw/TMo1H3YsPQH2Lj0uwQ+JoFWKtZVr8a5Tz/GrxpfxsvH3kJQcfU0D58i9icT2h/8GbtuHswwvsfmBbcqpdGFwT+YKHovAvRh9cxvoHxceUKzpmmYP2kW2i6cwqPV6/D48geRl5OXQDe4origGCtmLkN5USkaWhoQNHWuhNiISxEtVWoubh33Pg60nXcoYgI8UpMNf2i7rfdDwwCbWgToxdpZNa4COAyXlC3EgqnznMe0rjNuvgWT8ktR/599MGgnnkVno4mJmDN7J46csXU4Jm7+5W9SwmXxRjuUlcWVjMk8tFWeRxeVuFWnrFtddQ8emHs3rAFRcQ+D4AZqYyzovNthGEXzwjw/OvVfK11NSbpRWWFUlc5Anp6NK4EelBQWC0OHV8L19CfnsP3ADuw6sgv7m/ejJxRG2ZgJNLFE05POFWOn4rV/vY2QQS/npUo6AygDY3B/6Rt4+6IZHX3TwkUE38hgLCeZR5OZybUGGFV0o+qm6ah/7M/IynJf8j8efhOP7H4Ol8TLMHiKFh0rp83FS2ufx43FY6/WxV++//uNeOV4A5Q/N77BeRLESoUsw1qGLYcPRVVIxyo7qnTGcYgTrhYCyo8e5COIsNdC459nj+PBN3+OSwMGVE4JVPYN9g/Zo1DfchQP7XwS/WH3oHNlxVJuC9w37A0vAUB0y5AIWDDbVDyM2NGlq+EmMrCXjH9aEtV56eAO9IUJXpfVkVmJ/riTABRo96mDaPywKZE5a6aNr0Be9mjeJTkeECsh3Ali1+yTFFBO6x6W0h3oxb6PW+i3xYUK8PgiO7UcG/Y074lvuPo0vmgsJuaN4i6eTACbuFywa+RXyeksTPsw4jpsrLIr0IW2vjbqqbuh2kLRG1643OkmH3frLOT7Ob+M5DyLzIBSPP3plQw0eKoa1sKBkw0uY1H9jCT40oZjoZqqrM12Wem0eQwlLMotxo154yiElwpwdhnkjSmkivF2aBkIhxFkrOfpRp0O9iJgtgbTnJzU9zsd0rwW5xXhjgnTGHwFBYV7L67QorIq17aLPZ/hfEBcb/IN08ZM7LQBdTX14cov80pifmDRGmRpjP9tVYoJIb7DCvdi3k0349uzl7vybm5vRk9/B2HFggRXQqkk9jSoPLt7Niz5ykI8X/M4siNdDA16YEVCBN4HhDoxZ3QpXl3zG0gg51Z2n9xLYDlsSvRgbvQ+TtNlSuIe87r1SLPuR1/7IWaOm4HXju5Ee1c3CrI1VE2Zj7WV93EXdh+upb0V9acP0YGJAGkUYvcR/Dm60THDaQfO0EtvWQL5mXQ5Em57mYTQi2d8tmEbOkJBhhEFUuOwcb9KTslSZzWeU48nY+zeO7NaTfI+MVNw7bx9/+t45cQ+gudRMxV44SD4LfMEjZhZsWEs3cFenL/UnhHHF/e/gSfefZ7n5jRVx+FO7NzImGg1rR6qklN9XddAuB/fe30jGk++l3Iiz1z8COv/8BM8VP8sk6XiENP0KYLVsroFu8/OEoeCLew/L1n8lK5UOYz1WzsvoebVDbhr6gLcN7MGFV+agvz8Eo5poS/QidbPzuOd5kb8tfUoPu1jnjerIJWGxQ8vcpo4Ldh9POWHrM1Veyk8BUhhOPFsXJ/EGP16FvqRhbqWD1B36gB8Ph2ar5gTxn0gchkRSU2qbAZ82VBZheST4bg0YE7GXsEeXTODKW5miTObBlf8sUous/LnEGAJIloRBnjKCjMfFNFGccZ5RuCBJaoyGYIXTResBupksKgAZZFj3DSb7CxxDMIw3dnzTrAUSH7Rdbh23vRoNlZiFiZRAdYfC/PutzTmDKfj2nFcc0/BKFgF8+cCyF1vyV+oV41MO8jTF7NImlEwEqsDMIZ227v93BNquQoBrrXT/sW5CiYbGzEK1qslJoBUPHPkfe5u23jAd9o9r0Khu+SIdAkZRqIQk42NGAezTzz35eQ9jVCwEn7NJT/qdFV23rfjSgf8fr9TaW/vXb3ddBLDcdyKsSUWO7kLwTakuE+1Z3rd6W0hT/Phy7n5CZ7XoI19xHAiMlz+QPQ+o/S6gzHFCw55WcEw06GOv1I495mJJ0v5JOBTvODwPrc1tbVj8Ti+lNZuU77EcFs8umxErr+UyNIgcF4xGeYar7czwsVbAGkVIeZP+JvSrem02Cm0Iqkd2SJLJ67ctBoQUuuw9fC/kw2YXADpKW8JF098i1YkGYy5FGTk3lQKcL6Poq/fCsO3AVsPfiIVyUpmqiovujW+6Ab+z150D54C+dQgUPAtbufrGdsM36cGwO+Q01s/sp8aDBZEPvYo58ceJj/2sEzmSNQ02nX6H3tYVoulaQ1M0dXh7P/yY4/BQjj3n39uwzyrri/hW/avwtIm0RIlzczCz22UeY5R2HGGwfRsxrB9bvNfoyKHgWAuXx4AAAAASUVORK5CYII=",$fe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABXWlDQ1BJQ0MgUHJvZmlsZQAAKJF1kEsoRGEYhh8ORhpZUCTlLGSFGNLshIWUxRiUy+rMmWuNmd85R7KR68KKLGSJjY01S5KNnVIWoqwtKRum4zszNC756u17env/v7cPSv2GUukyHWYzjhUeGtAnp6Z13xMV1FBPI5ph2qo/FBpB5mv/nNdbSrx90+79tRpcvjprzh6MWl3a2srSxd/8j6mKxmxT9ruoxVSWAyXShtCCozxWwnWWlBJe9zhR4D2PIwU+zmfGw4PC58K6mTSiwo/CbZFvfuIbz6bnzc8OXnt/LDMxJrtS1IRNmCEG/sn05DODZFEsYpEiQRIHnX5xFGliwsNkMOmgTThAp6jXu+3vmxW97D4En0HbKnqRXTjdhIa7otciuZoNOLlUhmXkLU1UGk/B8xFUT0HttZx2xo53Bwrt/X1Q/uC6L63g24bcjuu+Hbhu7lAe38P53AcLDmT0xSwuwwAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAMKADAAQAAAABAAAAMAAAAAD4/042AAAKE0lEQVRoBe1Ye3BU1Rk/37m7SzYJDu9AeIXd2A4y2iK20od1LLZK82AQw7RSR6d2gIZsAK2URHHSsSDR6UBepINTC6V2SmiFkIQC1Ymi09Epth0pVjC7SRAFKiRq3rv3ntPft5tNNpvdTfA/Z/ZkNvfcc77363z3CJEcSQskLZC0QNICSQt8gS1A1yN7tuewWyljoZAyWxBlCKEnCKUH8H5ZCPW+1Oa5lqqV3kQ0swqbZkqbXCS09SUSlKlJpwlBAa3FVRLaawr5nmuq8/yrZXeZieiE98ZU4Jafn0jrGvAvF1rcT0SLBYkpmNtAIISrgzNNJEwI0QGh/oXnofRPbcffOXBPT5gRP93Fjd8EeA3wZ+PVPrgXlkFjYmH/M6y/q6U47Df9Rz6sue/aIFzMRxg55qbL03i30LSFSN8KwhJW10JrCSEDePrB0YIaBmAc8IYd+wrr0EUoEDytyXjOV7n8lTDxBZ6GIhjh11Cgl4XF+gDowtIEmsKBOZTCfwE+IIq190C/0jvldJ0oK2OaowZgRo9sz7EJlrAeJ5KFEGhCyNgIFUFnQPl1Q8p3lFQfSWH1qYB2KmmbTUrfQlLcAdFvBmc74Jj2AGm9e5J/1q63994W4PAhQzzKZiCh/mmRbrfZHF3CVA6EUoYW6iah6NvAXALciSCgAMhGO2iatO1CbW5ntLSjFMhc25CakkLPAekByBAAAGSg12D1PdY059/byu7qjyYSfp+zuc7pMFO/hfefge+dQFVQhMNtv+pKK2nbFx83TEOUNdtcnf2LSZlrtZC5oGOAvwPObRYBxzrvb+753xAsJiMVALL7Ws9OxPBPYUU/nr0wwrOT/ZnPswUjERPNl6w9be9IubIWmm+B4imIKw6NA3pq+i8SGSCaJkL4Pqw9jd8MSGqDIidTrdRHzu65qzsMO0KBBUWNjwCwXHIMa9GlpeFBDB8LA1/vEwLkgE4NjJGKOLALLfer7tSt4/LEILP5GxpuNaR4HoaYx95E+NV4q3OfDMsypIC7sD5b2YyjUtM0MDMRpR5fdc5fwoCf95ld3LRCaV0BRqnIQoTT9Xsi23N0qRLG7xFOk6CECXoPtFXnvcoywdiDQxrroN0sAHBV2Tde4bnMuguPZ2etP5y1qKAO1WjkaKnMqVeKNoJuL5hxxXmQrnWXzymoc46EjP/WUpX/pta6HNEBO9AEKal4UdnZIK+gAlnr/5qFbEfCcFnUFyx/f1V8cqGdRYV16QiRTT0DgZNCmiek3XGiN8N5FGFYEI3bVpNTL0mNUMI+w7mTkz4aNt57wN77R+TkW/ACAkR8o/da6+0MG1SAbNYyzFHGBNfjP7fvXXUpHiFeZ+F7ZWo1pr/E78tQfgpCYzpq/Nck6doFxY3bULeHvQuglsp8KBHhCUkP2k3nzqyHm1OwPea4uGt1H6rSPvgAYooU8MplpEEm+o5QQaJu02+NmbT9lPYTJOZK4IMofQKjAIdLregHdQvPTa6OJU+JgjqDmYRHMJyiPGFM7C7PKhufEjJgnAL9i6CHiNJf5/CVOLRuQGhlh5jodnuXPWEvw+eEIr0KQnL/0oMGYr2vOm+N73LP/Uqrp0ALBUCbpKnINSvtScwBOjza4AkVoYRCTsirvTvHo8TgGfAfUMOZKeZ0+/2Z0nL0TQYH9DfoPoT4oOXFH3AvEnfYDJqJOJsJSxjwwlu+2tyXg8CHVlut1fm/Be0n8ENPo3HQas+C4qaSWEoEw4moB/0Jzhf9sHGtd21cppEbWvn4FZ5P05acJSngcCCuuI/h4ErYODGiwyb9ALTww5++oSAqTLxVOfvghdKQEmTBKo8GlRiVEzn1pNRmEOkDa1biIUTDdOaRaMDOV0P7WkKMyYM5EEYZ6e7wauRzzlTnZUXiPNIdRqAlb2ekFUfu85yVgECPo98xARRUIpgTUUp4q/OOgMZLUMKG1m2WttSN0bQSvhuGkNruZ4tydwlHEKpJ4sF9OnJgL3CCXSSQtro8RzdFY/mq8l6ER7dAEYQTIZyQE5zYUTmBM/9TeAtgWlqGCrfY0eSG3tETTQu9kCJLdErD7+wEo45gK4zjmpN6CDrOpL0y7xhYbkfQDXrQKHEVN22MBmcl4IVSnC3DShQ3lYXrf7bnyE3Yy0UIwRjiM2XKD6JpjHon6Qquad1DhrokW6qQtCTeHwSch+LiHoUUYwFhUgm3/wqmC1UZLUpdGxpHecJblb8P1kdOhJSAtdfbA6mHXUUNLyhh+xPW58GbDvz+dqE2pzUGq6El9/qXZqAwLMICWNOHTrPvUtCCWqs3sMbr6TgscoYwxpj4KnMqALIDvV/IE5JKYoVTMLFJlHBOgIedDzx4fCU0z0TYpiAHTtuFYzuUYyHiDmW3fwd4cwEANP2Ps3tWd4cY6zQuhVdAEB8QtGpuUX1mXCpRG76q3N0QCuHEgcxmoNJY4eStzN1vEv0YIK+Azcd4fgLB23Eg1Sirb8256u9/xPjxBp/YCLWHmAFg+kmrRoYNKtBas6ydF6C+gaSabydjVGWJR5jXfVX5uyHMDs4JQl0Ak9KsGIndXpnbDK+tJsv6Hlr1e800uhuHYGnbntW4FEg8KL1rDQJnKeRnW72Jxha/QavxBMnrxkfAUexOhwSW1kZxa/XyQ7w33uEqatoI8k/AEIOhoJ8JeWi8FGLDZW08crtUtgOQLdhOg8caeLSZoUMhhAmS2Ytv4GfBmxs6A4Wh3OU5Pu58YGJowStQjbeDAUjwNziV8Ic8733eMd9zbDGErwHBySgXduTR78LCM80hBfjFe6nrD/DCCzAfEk2moX3fs6CwoShWn8/wsUZQCaWgBNuBXSy3oeLs+Oqm5kmx4BOtuTc0rDSEdQAw8yE8PinFyynWxGcicYJMIhe4WXNOoHIowQkXQNlCUNMpra3agGPgDW5rI+Hjzd2eJuSR4r4IVZQMtA1n8L8GBetEsHTHQ+Tv8o6er+A2gD+w8mABAz9YXryGk2tda8WKK5GooxTgTeQDrlXUY3DPBiiSAiAoj9OaxBkcpKdGXqsYuFYRs6VSi1EepyrTqm6tXXGO6bg8TT8C5tPQYQoSnG8oEFd0HpcVr+MG6d9jXqvwvROsB+sf9Bu2bRd33dvBdCNHTAXCAO6iY98FM7QD4jYwH/tiCx0iZKzCCfxYmAYS+2ZgboUiyyA8fwaCVDDPLMwTXGzBXFrhgJUVvis9BwW63TDNyGdCBRhwCUKq0yGX49KpABZejCXul2z4hXAhDrPCfxxSolNIVeKryB95GYCO1Z2RfidC4IewwlLU/gx4hZXhwXQYnyfDV4tC1xvCOIJw+5j34o0xFYhEnLe50WUzrYUoUjdCgOHLXaIrcPR53NC927Z7eVskTvR8btHJTLscWIiaPny5q3C5S7jclZbPVLb/Xs/lbjT95HvSAkkLJC2QtEDSAl8oC/wfscRvqQNdGeYAAAAASUVORK5CYII=",Dc=22,Kfe={"search-console":qfe,woocommerce:Bfe,pipedrive:Ffe,"zoho-crm":$fe};function Oq({id:e}){const t=Kfe[e];return t?d.jsx("img",{src:t,width:Dc,height:Dc,alt:"","aria-hidden":"true",style:{objectFit:"contain",borderRadius:4}}):e==="messenger"?d.jsx("svg",{width:Dc,height:Dc,viewBox:"0 0 24 24",role:"img","aria-hidden":"true",fill:`#${FR.hex}`,children:d.jsx("path",{d:FR.path})}):d.jsxs("svg",{width:Dc,height:Dc,viewBox:"0 0 24 24",role:"img","aria-hidden":"true",fill:"none",stroke:"#6b6b6b",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[d.jsx("path",{d:"M22 12h-6l-2 3h-4l-2-3H2"}),d.jsx("path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"})]})}function Qn({id:e,children:t}){return d.jsxs("span",{className:"bb-int-configure-titlerow",children:[d.jsx(Oq,{id:e}),d.jsx("h3",{className:"bb-int-configure-title",children:t})]})}function Hfe({onClose:e}){const t=Ne(),{data:n,isLoading:r}=Cq(),i=Ife(),o=zfe(),l=Ufe(),[u,f]=v.useState(null),[h,p]=v.useState(null),[b,g]=v.useState(!1),[x,E]=v.useState(null),S=(n==null?void 0:n.integration)??null,A=(n==null?void 0:n.oauthAvailable)??!1;v.useEffect(()=>{const O=T=>{var P;const _=T.data;!_||_.type!=="bitbot:gsc-oauth-complete"||(g(!1),_.ok?(E(null),t.invalidateQueries({queryKey:["integrations","search-console"]}),Array.isArray((P=_.data)==null?void 0:P.properties)&&f(_.data.properties)):E(typeof _.error=="string"?_.error:"Sign-in failed."))};return window.addEventListener("message",O),()=>window.removeEventListener("message",O)},[t]),v.useEffect(()=>{if(!(S&&S.status!=="connected"&&S.accountEmail&&!u))return;let T=!1;return(async()=>{const _=await me("ListSearchConsoleProperties");T||_.success&&f(_.data.properties)})(),()=>{T=!0}},[S,u]);const j=async()=>{E(null);const O=await i.mutateAsync().catch(z=>(E(z instanceof Error?z.message:"Could not start sign-in"),null));if(!(O!=null&&O.url))return;const T=520,_=640,P=window.screenX+(window.outerWidth-T)/2,D=window.screenY+(window.outerHeight-_)/2;if(!window.open(O.url,"bitbot-gsc-oauth",`width=${T},height=${_},left=${P},top=${D},menubar=no,toolbar=no`)){E("Popup was blocked. Allow popups for this site and try again.");return}g(!0)},C=async O=>{p(O);try{await o.mutateAsync({property:O})}finally{p(null)}};return!A&&!S?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"search-console",children:"Google Search Console"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-error",children:"Search Console isn't set up on the server yet. Ask the BitBot team to finish the OAuth configuration."})]}):r?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"search-console",children:"Google Search Console"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"})]}):(S==null?void 0:S.status)==="connected"&&S.property?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"search-console",children:"Google Search Console"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsxs("div",{className:"bb-int-configure-connected",children:[d.jsxs("div",{className:"bb-int-status-line",children:[d.jsx("span",{className:"bb-int-status bb-int-status-connected",children:"Connected"}),S.accountEmail&&d.jsx("span",{className:"bb-int-configure-prop",children:S.accountEmail})]}),d.jsxs("p",{className:"bb-int-configure-body",children:["Linked property: ",d.jsx("strong",{children:S.property})]}),d.jsx("p",{className:"bb-int-configure-body",children:"The agent can now answer questions about your organic search performance using live Search Console data."}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?"Disconnecting…":"Disconnect"})})]})]}):S!=null&&S.accountEmail&&u?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"search-console",children:"Google Search Console"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsxs("p",{className:"bb-int-configure-body",children:["Signed in as ",d.jsx("strong",{children:S.accountEmail}),". Pick which property the agent should query for this site."]}),u.length===0?d.jsx("p",{className:"bb-int-configure-error",children:"This Google account doesn't have access to any Search Console properties. Verify a property first, then come back."}):d.jsx("ul",{className:"bb-int-property-list",children:u.map(O=>d.jsxs("li",{className:"bb-int-property-item",children:[d.jsxs("div",{className:"bb-int-property-meta",children:[d.jsx("span",{className:"bb-int-property-url",children:O.siteUrl}),d.jsx("span",{className:"bb-int-property-perm",children:O.permissionLevel})]}),d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>C(O.siteUrl),disabled:h!==null,children:h===O.siteUrl?"Linking…":"Use this"})]},O.siteUrl))}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>l.mutate(),disabled:l.isPending,children:"Sign out of Google"})})]}):d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"search-console",children:"Google Search Console"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Sign in with the Google account that owns this site's Search Console property. We'll ask only for read-only access to your search analytics."}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:j,disabled:i.isPending||b,children:b?"Waiting for Google…":"Sign in with Google"})}),x&&d.jsx("p",{className:"bb-int-configure-error",children:x}),(S==null?void 0:S.lastErrorMessage)&&d.jsxs("p",{className:"bb-int-configure-error",children:["Last attempt: ",S.lastErrorMessage]})]})}function Gfe({onClose:e}){const{data:t,isLoading:n}=eE(),r=i5(),i=o5(),[o,l]=v.useState(!1),[u,f]=v.useState(""),[h,p]=v.useState(""),b=!!(t!=null&&t.configured),g=!b||o,x=S=>{S.preventDefault(),!(!u.trim()||!h.trim())&&r.mutate({consumerKey:u.trim(),consumerSecret:h.trim()},{onSuccess:()=>{l(!1),f(""),p("")}})},E=()=>{i.mutate(void 0,{onSuccess:()=>{l(!1),f(""),p("")}})};return n?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("header",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"woocommerce",children:"WooCommerce"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"})]}):d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("header",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"woocommerce",children:"WooCommerce"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsxs("div",{className:"bb-int-configure-body",children:[b&&!o?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:"WooCommerce is connected. The agent can answer product, stock, and order questions from your real store data."}),d.jsxs("div",{className:"bb-int-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>l(!0),children:"Rotate credentials"}),d.jsx("button",{className:"bb-btn bb-btn-danger bb-btn-small",onClick:E,disabled:i.isPending,children:i.isPending?"Disconnecting…":"Disconnect"})]})]}):null,g?d.jsxs("form",{onSubmit:x,children:[d.jsxs("p",{children:["In your WordPress admin, go to"," ",d.jsx("strong",{children:"WooCommerce → Settings → Advanced → REST API"}),", click"," ",d.jsx("strong",{children:"Add key"}),", give it read permissions, and paste the consumer key + secret below."]}),d.jsxs("label",{className:"bb-field",children:[d.jsx("span",{children:"Consumer key"}),d.jsx("input",{type:"text",value:u,onChange:S=>f(S.target.value),placeholder:"ck_...",autoComplete:"off",spellCheck:!1})]}),d.jsxs("label",{className:"bb-field",children:[d.jsx("span",{children:"Consumer secret"}),d.jsx("input",{type:"password",value:h,onChange:S=>p(S.target.value),placeholder:"cs_...",autoComplete:"off"})]}),d.jsxs("div",{className:"bb-int-actions",children:[o&&d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>{l(!1),f(""),p("")},children:"Cancel"}),d.jsx("button",{type:"submit",className:"bb-btn bb-btn-primary bb-btn-small",disabled:r.isPending||!u.trim()||!h.trim(),children:r.isPending?"Saving…":b?"Update":"Connect"})]})]}):null]})]})}function Yfe({onClose:e}){const t=Ne(),{data:n,isLoading:r}=Rf(),i=s5(),o=l5(),[l,u]=v.useState(!1),[f,h]=v.useState(null),p=(n==null?void 0:n.integration)??null,b=(n==null?void 0:n.oauthAvailable)??!1,g=c5(),x=u5();v.useEffect(()=>{const S=A=>{const j=A.data;!j||j.type!=="bitbot:zoho-oauth-complete"||(u(!1),j.ok?(h(null),t.invalidateQueries({queryKey:["integrations","zoho"]})):h(typeof j.error=="string"?j.error:"Sign-in failed."))};return window.addEventListener("message",S),()=>window.removeEventListener("message",S)},[t]);const E=async()=>{h(null);const S=await i.mutateAsync().catch(_=>(h(_ instanceof Error?_.message:"Could not start sign-in"),null));if(!(S!=null&&S.url))return;const A=520,j=640,C=window.screenX+(window.outerWidth-A)/2,O=window.screenY+(window.outerHeight-j)/2;if(!window.open(S.url,"bitbot-zoho-oauth",`width=${A},height=${j},left=${C},top=${O},menubar=no,toolbar=no`)){h("Popup was blocked. Allow popups for this site and try again.");return}u(!0)};return!b&&!p?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"zoho-crm",children:"Zoho CRM"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-error",children:"Zoho isn't set up on the server yet. Ask the BitBot team to finish the OAuth configuration."})]}):r?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"zoho-crm",children:"Zoho CRM"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"})]}):(p==null?void 0:p.status)==="connected"?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"zoho-crm",children:"Zoho CRM"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsxs("div",{className:"bb-int-configure-connected",children:[d.jsxs("div",{className:"bb-int-status-line",children:[d.jsx("span",{className:"bb-int-status bb-int-status-connected",children:"Connected"}),p.accountEmail&&d.jsx("span",{className:"bb-int-configure-prop",children:p.accountEmail})]}),d.jsx("p",{className:"bb-int-configure-body",children:"The agent can read your Zoho pipeline. Use Push to Zoho on a lead to send it across, or turn on auto-sync below."}),d.jsxs("label",{className:"bb-int-toggle-row",children:[d.jsx("input",{type:"checkbox",checked:g.data===!0,disabled:g.isLoading||x.isPending,onChange:S=>x.mutate(S.target.checked)}),d.jsx("span",{children:"Auto-sync new leads to Zoho"})]}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>o.mutate(),disabled:o.isPending,children:o.isPending?"Disconnecting…":"Disconnect"})})]})]}):d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"zoho-crm",children:"Zoho CRM"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Sign in with the Zoho account that owns this site's CRM. We'll ask for access to your Leads, Contacts, and Deals so the agent can read your pipeline and push new BitBot leads in for you."}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:E,disabled:i.isPending||l,children:l?"Waiting for Zoho…":"Connect Zoho"})}),f&&d.jsx("p",{className:"bb-int-configure-error",children:f}),(p==null?void 0:p.lastErrorMessage)&&d.jsxs("p",{className:"bb-int-configure-error",children:["Last attempt: ",p.lastErrorMessage]})]})}function Wfe({onClose:e}){const{data:t,isLoading:n}=mE(),r=sH(),i=fH(),o=lH(),l=cH(),[u,f]=v.useState(!1),[h,p]=v.useState(""),b=!!(t!=null&&t.configured),g=!b||u,x=S=>{S.preventDefault(),h.trim()&&r.mutate({apiToken:h.trim()},{onSuccess:()=>{f(!1),p("")}})},E=()=>{i.mutate(void 0,{onSuccess:()=>{f(!1),p("")}})};return n?d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("header",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"pipedrive",children:"Pipedrive"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"})]}):d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("header",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"pipedrive",children:"Pipedrive"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsxs("div",{className:"bb-int-configure-body",children:[b&&!u?d.jsxs(d.Fragment,{children:[d.jsxs("p",{children:["Pipedrive is connected",t!=null&&t.companyName?d.jsxs(d.Fragment,{children:[" to ",d.jsx("strong",{children:t.companyName})]}):null,t!=null&&t.accountName?d.jsxs(d.Fragment,{children:[" (",t.accountName,")"]}):null,". The agent can answer questions about your people and deals, and push captured leads into Pipedrive."]}),d.jsxs("label",{className:"bb-int-toggle-row",children:[d.jsx("input",{type:"checkbox",checked:o.data===!0,disabled:o.isLoading||l.isPending,onChange:S=>l.mutate(S.target.checked)}),d.jsx("span",{children:"Auto-sync new leads to Pipedrive"})]}),d.jsxs("div",{className:"bb-int-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>f(!0),children:"Replace token"}),d.jsx("button",{className:"bb-btn bb-btn-danger bb-btn-small",onClick:E,disabled:i.isPending,children:i.isPending?"Disconnecting…":"Disconnect"})]})]}):null,g?d.jsxs("form",{onSubmit:x,children:[d.jsxs("p",{children:["In Pipedrive, go to ",d.jsx("strong",{children:"Settings → Personal preferences → API"}),", copy your personal API token, and paste it below. We only need read access plus the ability to create people and deals."]}),d.jsxs("label",{className:"bb-field",children:[d.jsx("span",{children:"API token"}),d.jsx("input",{type:"password",value:h,onChange:S=>p(S.target.value),placeholder:"Your Pipedrive API token",autoComplete:"off",spellCheck:!1})]}),d.jsxs("div",{className:"bb-int-actions",children:[u&&d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>{f(!1),p("")},children:"Cancel"}),d.jsx("button",{type:"submit",className:"bb-btn bb-btn-primary bb-btn-small",disabled:r.isPending||!h.trim(),children:r.isPending?"Connecting…":b?"Update":"Connect"})]})]}):null]})]})}function Qfe({onClose:e}){const t=Ne(),{data:n,isLoading:r}=JS(),i=r5(),o=a5(),[l,u]=v.useState(!1),[f,h]=v.useState(null),p=(n==null?void 0:n.integration)??null,b=(n==null?void 0:n.oauthAvailable)??!1;v.useEffect(()=>{const E=S=>{const A=S.data;!A||A.type!=="bitbot:meta-oauth-complete"||(u(!1),A.ok?(h(null),t.invalidateQueries({queryKey:["integrations","meta"]})):h(typeof A.error=="string"?A.error:"Sign-in failed."))};return window.addEventListener("message",E),()=>window.removeEventListener("message",E)},[t]);const g=async()=>{h(null);const E=await i.mutateAsync().catch(T=>(h(T instanceof Error?T.message:"Could not start sign-in"),null));if(!(E!=null&&E.url))return;const S=600,A=700,j=window.screenX+(window.outerWidth-S)/2,C=window.screenY+(window.outerHeight-A)/2;if(!window.open(E.url,"bitbot-meta-oauth",`width=${S},height=${A},left=${j},top=${C},menubar=no,toolbar=no`)){h("Popup was blocked. Allow popups for this site and try again.");return}u(!0)};if(!b&&!p)return d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"messenger",children:"Facebook Messenger"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-error",children:"Meta isn't set up on the server yet. Ask the BitBot team to finish configuration."})]});if(r)return d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"messenger",children:"Facebook Messenger"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"})]});const x=(p==null?void 0:p.status)==="connected"&&p.pages.length>0;return d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"messenger",children:"Facebook Messenger"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),x&&d.jsxs("div",{className:"bb-int-configure-connected",children:[d.jsxs("div",{className:"bb-int-status-line",children:[d.jsx("span",{className:"bb-int-status bb-int-status-connected",children:"Connected"}),p.accountEmail&&d.jsx("span",{className:"bb-int-configure-prop",children:p.accountEmail})]}),d.jsx("p",{className:"bb-int-configure-body",children:"The visitor agent answers Messenger DMs using the same RAG + skills it uses on your website."}),d.jsx("ul",{className:"bb-int-page-list",children:p.pages.map(E=>d.jsxs("li",{className:"bb-int-page-item",children:[d.jsx("span",{className:"bb-int-page-name",children:E.pageName}),d.jsx("span",{className:"bb-int-page-channels",children:"💬 Messenger"})]},E.pageId))}),d.jsxs("div",{className:"bb-int-configure-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:g,disabled:i.isPending||l,children:l?"Waiting for Facebook…":"Connect another Page"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>o.mutate(),disabled:o.isPending,children:o.isPending?"Disconnecting…":"Disconnect"})]})]}),!x&&d.jsxs(d.Fragment,{children:[(p==null?void 0:p.status)==="error"?d.jsx("p",{className:"bb-int-configure-body",children:"Your connection stopped working. Facebook invalidated the Page token (usually a password change, the app being removed, or lost Page access). Reconnect to restore Messenger replies."}):d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"bb-int-configure-body",children:"Connect the Facebook Page you want the agent to answer Messenger DMs on:"}),d.jsxs("ol",{className:"bb-int-configure-steps",children:[d.jsx("li",{children:"Click Connect Facebook Page below."}),d.jsx("li",{children:"Sign in with the Facebook account that manages your Page."}),d.jsx("li",{children:"Choose the Page BitBot should answer DMs on."}),d.jsx("li",{children:"Done. New Messenger DMs get the same answers your website chat gives."})]}),d.jsx("p",{className:"bb-int-configure-help",children:"You need to be an admin of a published Facebook Page."})]}),d.jsx("div",{className:"bb-int-configure-actions",children:d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:g,disabled:i.isPending||l,children:l?"Waiting for Facebook…":(p==null?void 0:p.status)==="error"?"Reconnect Facebook Page":"Connect Facebook Page"})})]}),f&&d.jsxs("p",{className:"bb-int-configure-error",children:[f,f.toLowerCase().includes("development")||f.toLowerCase().includes("not active")?d.jsxs(d.Fragment,{children:[" ","This usually means your Facebook account hasn't been added as a Tester on our Meta app yet. Email"," ",d.jsx("a",{href:"mailto:support@youami.ai?subject=BitBot%20Messenger%20early%20access",children:"support@youami.ai"})," ","with your Page name — we'll add you within a day."]}):null]}),(p==null?void 0:p.lastErrorMessage)&&d.jsxs("p",{className:"bb-int-configure-error",children:["Last attempt: ",p.lastErrorMessage]})]})}function Vfe(){return Et({queryKey:["support-inbox"],queryFn:async()=>{const e=await me("EnsureSupportInbox");if(!e.success)throw new Error(e.error);return e.data},staleTime:300*1e3})}function Xfe(){const e=Ne();return je({mutationFn:async t=>{const n=await me("SetSupportAutoSend",{autoSend:t});if(!n.success)throw new Error(n.error)},onSuccess:()=>e.invalidateQueries({queryKey:["support-inbox"]})})}function Zfe({onClose:e}){const{data:t,isLoading:n}=Vfe(),r=Xfe(),[i,o]=v.useState(!1),l=async()=>{if(t!=null&&t.address)try{await navigator.clipboard.writeText(t.address),o(!0),setTimeout(()=>o(!1),1500)}catch{}};return d.jsxs("div",{className:"bb-int-configure",children:[d.jsxs("div",{className:"bb-int-configure-head",children:[d.jsx(Qn,{id:"support-inbox",children:"AI Support Inbox"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:e,children:"Close"})]}),n&&d.jsx("p",{className:"bb-int-configure-body",children:"Loading…"}),t&&d.jsxs("div",{className:"bb-support-setup",children:[d.jsxs("div",{className:"bb-support-addr",children:[d.jsx("code",{className:"bb-support-addr-value",children:t.address}),d.jsx("button",{className:"bb-support-copy-icon",onClick:l,title:"Copy address","aria-label":"Copy support address",children:i?"✓":"⧉"})]}),d.jsxs("label",{className:"bb-support-autosend",children:[d.jsx("input",{type:"checkbox",checked:t.autoSend,onChange:u=>r.mutate(u.target.checked)}),d.jsxs("span",{children:["Send replies automatically",d.jsx("span",{className:"bb-field-help",children:t.autoSend?"On — answers customers itself; risky ones still wait for you.":"Off — drafts a reply and flags it for you."})]})]}),d.jsxs("ol",{className:"bb-support-highlights",children:[d.jsxs("li",{children:[d.jsx("span",{className:"bb-support-hl-num",children:"1"}),d.jsxs("span",{children:[d.jsx("strong",{children:"Use it as your support email"})," — put the address above on your site. Customers email it, the agent answers from it."]})]}),d.jsxs("li",{children:[d.jsx("span",{className:"bb-support-hl-num",children:"2"}),d.jsxs("span",{children:[d.jsx("strong",{children:"You"})," can email it too to run actions or get reports — your Agent co-pilot, by email."]})]})]})]})]})}const Jfe=[{id:"support-inbox",name:"AI Support Inbox",category:"Channels",description:"A support email address the agent runs as L1 support — it reads the customer email, looks up the order, replies to the easy ones, and escalates the rest to you. Just forward your support@ address to it. No Gmail connection needed.",connection:"available",icon:"📥"},{id:"messenger",name:"Facebook Messenger",category:"Channels",description:"Connect your Facebook Page so the agent answers Messenger DMs with the same answers, skills, and lead capture it uses on your website.",connection:"available",icon:"📨"},{id:"woocommerce",name:"WooCommerce",category:"Commerce",description:"Bot answers product, stock, and shipping questions from your real store data.",connection:"available",icon:"🛒"},{id:"zoho-crm",name:"Zoho CRM",category:"Productivity",description:'Push every captured lead into your Zoho CRM. The agent can also read your pipeline to answer "any open deals with X?" questions.',connection:"available",icon:"📇"},{id:"pipedrive",name:"Pipedrive",category:"Productivity",description:'Push captured leads into Pipedrive as people + deals. The agent can also read your pipeline to answer "what deals does X have?" questions.',connection:"available",icon:"🟢"},{id:"search-console",name:"Google Search Console",category:"Analytics",description:"Surface top search queries and click-through rates next to the FAQ gaps the bot already tracks.",connection:"available",icon:"🔎"}],ehe=["Channels","Commerce","Productivity","Analytics"],the=new Set(["messenger"]);function nhe({connection:e,comingSoon:t}){if(t)return d.jsx("span",{className:"bb-int-status bb-int-status-coming-soon",children:"Coming soon"});const n=e==="connected"?"Connected":"Available";return d.jsx("span",{className:`bb-int-status bb-int-status-${e}`,children:n})}function rhe(){var f,h,p,b,g,x,E,S;const[e,t]=v.useState(null),n=Cq(),r=eE(),i=Rf(),o=JS(),l=mE(),u={"search-console":((h=(f=n.data)==null?void 0:f.integration)==null?void 0:h.status)==="connected"?"connected":"available",woocommerce:(p=r.data)!=null&&p.configured?"connected":"available","zoho-crm":((g=(b=i.data)==null?void 0:b.integration)==null?void 0:g.status)==="connected"?"connected":"available",messenger:((E=(x=o.data)==null?void 0:x.integration)==null?void 0:E.status)==="connected"?"connected":"available",pipedrive:(S=l.data)!=null&&S.configured?"connected":"available"};return e==="search-console"?d.jsx(Hfe,{onClose:()=>t(null)}):e==="woocommerce"?d.jsx(Gfe,{onClose:()=>t(null)}):e==="zoho-crm"?d.jsx(Yfe,{onClose:()=>t(null)}):e==="pipedrive"?d.jsx(Wfe,{onClose:()=>t(null)}):e==="messenger"?d.jsx(Qfe,{onClose:()=>t(null)}):e==="support-inbox"?d.jsx(Zfe,{onClose:()=>t(null)}):d.jsxs("div",{className:"bb-int-drawer",children:[d.jsx("p",{className:"bb-int-drawer-intro",children:"Each integration extends what the bot can do in conversations. Turn the ones you need on; the rest stay quiet."}),ehe.map(A=>{const j=Jfe.filter(C=>C.category===A);return j.length===0?null:d.jsxs("section",{className:"bb-int-section bb-int-section-drawer",children:[d.jsxs("header",{className:"bb-int-section-head",children:[d.jsx("h3",{className:"bb-int-section-title",children:A}),d.jsx("span",{className:"bb-int-section-count",children:j.length})]}),d.jsx("div",{className:"bb-int-grid bb-int-grid-drawer",children:j.map(C=>{const O=the.has(C.id),T=u[C.id]??C.connection,_=!O&&(C.id==="search-console"||C.id==="woocommerce"||C.id==="zoho-crm"||C.id==="pipedrive"||C.id==="support-inbox");return d.jsxs("article",{className:"bb-int-card",children:[d.jsxs("div",{className:"bb-int-head",children:[d.jsx("span",{className:"bb-int-icon","aria-hidden":!0,children:d.jsx(Oq,{id:C.id})}),d.jsxs("div",{className:"bb-int-titles",children:[d.jsx("h4",{className:"bb-int-name",children:C.name}),d.jsx("span",{className:"bb-int-cat",children:C.category})]}),d.jsx(nhe,{connection:T,comingSoon:O})]}),d.jsx("p",{className:"bb-int-body",children:C.description}),d.jsx("div",{className:"bb-int-actions",children:O?d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",disabled:!0,children:"Coming soon"}):C.id==="support-inbox"?d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>t(C.id),children:"Learn more →"}):T==="connected"?d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>_&&t(C.id),disabled:!_,children:"Configure →"}):d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>_&&t(C.id),disabled:!_,children:"Enable →"})})]},C.id)})})]},A)}),d.jsxs("div",{className:"bb-int-suggest",children:[d.jsx("h4",{children:"Want more?"}),d.jsx("p",{children:"Need something not listed? Tell us — requested integrations ship within a sprint when there's clear demand."}),d.jsx("a",{className:"bb-btn bb-btn-ghost bb-btn-small",href:"mailto:support@youami.ai",children:"Email support"})]})]})}function ahe(e){const t=new Date(e).getTime(),n=Date.now()-t;return n<6e4?"just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:`${Math.floor(n/864e5)}d ago`}function Mc(e){const t=[],n=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\*[^*]+\*)|(\[[^\]]+\]\([^)]+\))/g;let r=0,i,o=0;for(;(i=n.exec(e))!==null;){i.index>r&&t.push(e.slice(r,i.index));const l=i[0];if(l.startsWith("`"))t.push(d.jsx("code",{children:l.slice(1,-1)},o++));else if(l.startsWith("**"))t.push(d.jsx("strong",{children:l.slice(2,-2)},o++));else if(l.startsWith("*"))t.push(d.jsx("em",{children:l.slice(1,-1)},o++));else if(l.startsWith("[")){const u=l.indexOf("]("),f=l.slice(1,u),h=l.slice(u+2,-1).trim(),p=/^(https?:|mailto:|\/|#|\?|[A-Za-z0-9._~-])/i.test(h)?h:"#";t.push(d.jsx("a",{href:p,target:"_blank",rel:"noopener noreferrer",children:f},o++))}r=i.index+l.length}return r<e.length&&t.push(e.slice(r)),t}function Nq(e){const t=e.replace(/\r\n/g,` 284 284 `).split(` 285 285 `),n=[];let r=0,i=0;for(;r<t.length;){const o=t[r];if(/^```/.test(o)){const f=[];for(r++;r<t.length&&!/^```/.test(t[r]);)f.push(t[r]),r++;r<t.length&&r++,n.push(d.jsx("pre",{children:d.jsx("code",{children:f.join(` 286 `)})},i++));continue}const l=/^(#{1,4})\s+(.*)$/.exec(o);if(l){const f=l[1].length,h=l[2],p=`h${f}`;n.push(d.jsx(p,{children:Mc(h)},i++)),r++;continue}if(/^\s*[-*]\s+/.test(o)){const f=[];for(;r<t.length&&/^\s*[-*]\s+/.test(t[r]);){const h=t[r].replace(/^\s*[-*]\s+/,"");f.push(d.jsx("li",{children:Mc(h)},f.length)),r++}n.push(d.jsx("ul",{children:f},i++));continue}if(/^\s*\d+\.\s+/.test(o)){const f=[];for(;r<t.length&&/^\s*\d+\.\s+/.test(t[r]);){const h=t[r].replace(/^\s*\d+\.\s+/,"");f.push(d.jsx("li",{children:Mc(h)},f.length)),r++}n.push(d.jsx("ol",{children:f},i++));continue}if(/^\s*\|.*\|\s*$/.test(o)&&r+1<t.length&&/^\s*\|[\s|:-]+\|\s*$/.test(t[r+1])){const f=b=>b.trim().replace(/^\||\|$/g,"").split("|").map(g=>g.trim()),h=f(o);r+=2;const p=[];for(;r<t.length&&/^\s*\|.*\|\s*$/.test(t[r]);)p.push(f(t[r])),r++;n.push(d.jsxs("table",{className:"bb-md-table",children:[d.jsx("thead",{children:d.jsx("tr",{children:h.map((b,g)=>d.jsx("th",{children:Mc(b)},g))})}),d.jsx("tbody",{children:p.map((b,g)=>d.jsx("tr",{children:b.map((x,E)=>d.jsx("td",{children:Mc(x)},E))},g))})]},i++));continue}if(o.trim()===""){r++;continue}const u=[o];for(r++;r<t.length&&t[r].trim()!==""&&!/^```|^#{1,4}\s+|^\s*[-*]\s+|^\s*\d+\.\s+|^\s*\|.*\|\s*$/.test(t[r]);)u.push(t[r]),r++;n.push(d.jsx("p",{children:Mc(u.join(" "))},i++))}return d.jsx(d.Fragment,{children:n})}function ihe({stream:e}){const t=e.tools.filter(i=>!!XS(i.toolName)),n=e.tools.filter(i=>i.artifact&&i.artifact.kind==="chart"),r=e.status==="done"&&t.every(i=>i.status!=="in_progress");return d.jsxs("div",{className:"bb-adminchat-streaming",children:[t.length>0&&d.jsxs("div",{className:"bb-adminchat-tool-group",children:[d.jsx("div",{className:"bb-adminchat-tool-group-header",children:r?"✓ Done":"Working…"}),t.map(i=>d.jsx(ohe,{tool:i},i.startedAt))]}),n.map(i=>d.jsx( Aq,{artifact:i.artifact},`chart-${i.startedAt}`)),(e.text||e.status==="streaming")&&d.jsx("div",{className:"bb-adminchat-bubble bb-adminchat-bubble-assistant bb-adminchat-bubble-streaming",children:d.jsx("div",{className:"bb-adminchat-bubble-body",children:e.text?d.jsx("div",{className:"bb-md",children:Oq(e.text)}):d.jsxs("span",{className:"bb-adminchat-typing",children:[d.jsx("i",{}),d.jsx("i",{}),d.jsx("i",{})]})})}),e.status==="error"&&e.error&&d.jsxs("div",{className:"bb-adminchat-stream-error",children:["⚠ ",e.error]})]})}function ohe({tool:e}){const t=XS(e.toolName);if(!t)return null;const n=e.status==="in_progress"?"⚙":e.status==="ok"?"✓":"✗";return d.jsxs("div",{className:`bb-adminchat-tool bb-adminchat-tool-${e.status}`,children:[d.jsx("span",{className:"bb-adminchat-tool-icon","aria-hidden":!0,children:n}),d.jsxs("span",{children:[t,e.status==="in_progress"?"…":""]}),e.status==="error"&&e.error&&d.jsx("span",{className:"bb-adminchat-tool-error",title:e.error,children:"—"})]})}function she(e){if(!e||typeof e!="object")return!1;const t=e;return t.kind==="chart"&&typeof t.chartKind=="string"&&typeof t.xKey=="string"&&Array.isArray(t.yKeys)&&Array.isArray(t.data)}function lhe({msg:e}){if(e.role==="tool"){const t=XS(e.toolName);if(!t)return null;const n=she(e.artifacts)?e.artifacts:null;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"bb-adminchat-tool",children:[d.jsx("span",{className:"bb-adminchat-tool-icon","aria-hidden":!0,children:"⚙"}),d.jsx("span",{children:t})]}),n?d.jsx(Aq,{artifact:n}):null]})}return d.jsxs("div",{className:`bb-adminchat-bubble bb-adminchat-bubble-${e.role}`,children:[d.jsx("div",{className:"bb-adminchat-bubble-body",children:e.role==="assistant"?d.jsx("div",{className:"bb-md",children:Oq(e.content)}):e.content}),d.jsx("div",{className:"bb-adminchat-bubble-time",children:ahe(e.sentAt)})]})}const che=["What can you do for me?","How are you different from the visitor bot?","What integrations do you support?","What tasks can I delegate to you?"];function uhe(){const[e,t]=v.useState(null),[n,r]=v.useState(""),[i,o]=v.useState(null),[l,u]=v.useState(null),[f,h]=v.useState(null),p=v.useRef(null),b=v.useRef(null),g=v.useRef(!1),x=Ne(),{conversations:E,total:S,hasMore:A,isFetchingMore:j,loadMore:C,isSuccess:O}=Tfe(),{data:T}=Pfe(e),_=_fe(),P=Dfe(),D=Rfe(f),L=v.useRef(null);v.useEffect(()=>{g.current||O&&(e===null&&E.length>0&&t(E[0].id),g.current=!0)},[e,E,O]);const z=v.useMemo(()=>(T==null?void 0:T.messages)??[],[T]);v.useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[z.length,_.isPending]);const R=G=>{if(!G.trim()||_.isPending)return;const ie=G.trim();u(ie),_.mutate({conversationId:e,message:ie},{onSuccess:K=>{e||t(K.conversationId),h({conversationId:K.conversationId,sinceSequence:K.sinceSequence})},onError:()=>{u(null)}})},q=()=>{const G=n.trim();G&&(r(""),R(G))};v.useEffect(()=>{l&&z.some(G=>G.role==="user"&&G.content===l)&&u(null)},[z,l]),v.useEffect(()=>{f?L.current=z.length:L.current=null},[f]),v.useEffect(()=>{if(!f||D.status!=="done"&&D.status!=="error")return;let G=!1,ie=0;const K=async()=>{G||(ie+=1,await x.invalidateQueries({queryKey:["admin-chat","conversation",f.conversationId]}),ie<15&&setTimeout(K,800))};return K(),x.invalidateQueries({queryKey:["drafts"]}),x.invalidateQueries({queryKey:["faqs"]}),x.invalidateQueries({queryKey:["leads"]}),x.invalidateQueries({queryKey:["unviewed-leads"]}),()=>{G=!0}},[D.status,f,x]),v.useEffect(()=>{var G;if(f&&L.current!==null&&!(z.length<=L.current)){for(let ie=z.length-1;ie>=L.current;ie--)if(((G=z[ie])==null?void 0:G.role)==="assistant"){h(null);return}}},[z,f]);const U=()=>{t(null),r(""),i==="history"&&o(null)},re=v.useMemo(()=>{var G;return e?((G=E.find(ie=>ie.id===e))==null?void 0:G.title)??(T==null?void 0:T.summary.title)??null:null},[e,E,T]);return d.jsxs("div",{className:"bb-agent-surface",children:[d.jsxs("header",{className:"bb-agent-actionbar",children:[d.jsxs("div",{className:"bb-agent-actionbar-left",children:[d.jsxs("button",{type:"button",className:"bb-agent-action bb-agent-action-primary",onClick:U,title:"Start a new chat",children:[d.jsx("span",{className:"bb-agent-action-glyph",children:"+"}),d.jsx("span",{children:"New chat"})]}),d.jsxs("button",{type:"button",className:"bb-agent-action",onClick:()=>o("history"),children:[d.jsx("span",{className:"bb-agent-action-glyph",children:"⌖"}),d.jsx("span",{children:"History"}),E.length>0&&d.jsx("span",{className:"bb-agent-action-count",children:E.length})]})]}),d.jsx("div",{className:"bb-agent-actionbar-mid",children:re&&d.jsx("span",{className:"bb-agent-active-title",title:re,children:re})}),d.jsx("div",{className:"bb-agent-actionbar-right",children:d.jsxs("button",{type:"button",className:"bb-agent-action",onClick:()=>o("integrations"),children:[d.jsx("span",{className:"bb-agent-action-glyph",children:"⚙"}),d.jsx("span",{children:"Integrations"})]})})]}),d.jsxs("div",{className:"bb-agent-transcript",ref:p,children:[z.length===0&&!l?d.jsxs("div",{className:"bb-agent-empty",children:[d.jsx("h4",{children:"Talk to your bot"}),d.jsx("p",{children:"This is your private chat with BitBot. Ask it anything about your site, your leads, or your content — it has every tool the visitor bot has, plus admin-only ones once you turn integrations on."}),d.jsxs("div",{className:"bb-agent-starters",children:[d.jsx("div",{className:"bb-agent-starters-label",children:"Try one of these to get started"}),d.jsx("div",{className:"bb-agent-starters-grid",children:che.map(G=>d.jsxs("button",{type:"button",className:"bb-agent-starter",disabled:_.isPending,onClick:()=>R(G),children:[d.jsx("span",{className:"bb-agent-starter-arrow","aria-hidden":!0,children:"→"}),d.jsx("span",{className:"bb-agent-starter-label",children:G})]},G))})]})]}):d.jsxs(d.Fragment,{children:[z.map(G=>d.jsx(lhe,{msg:G},G.id)),l&&d.jsxs("div",{className:"bb-adminchat-bubble bb-adminchat-bubble-user",children:[d.jsx("div",{className:"bb-adminchat-bubble-body",children:l}),d.jsx("div",{className:"bb-adminchat-bubble-time",children:"just now"})]}),f&&(D.status==="streaming"||D.tools.length>0||D.text)&&d.jsx(ihe,{stream:D})]}),_.isPending&&D.status!=="streaming"&&d.jsx("div",{className:"bb-adminchat-pending",children:d.jsxs("span",{className:"bb-adminchat-typing",children:[d.jsx("i",{}),d.jsx("i",{}),d.jsx("i",{})]})})]}),d.jsxs("div",{className:"bb-agent-composer",children:[d.jsx("textarea",{ref:b,className:"bb-adminchat-input",value:n,onChange:G=>r(G.target.value),placeholder:"Type a message…",rows:2,onKeyDown:G=>{G.key==="Enter"&&!G.shiftKey&&(G.preventDefault(),q())}}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",disabled:!n.trim()||_.isPending,onClick:q,children:_.isPending?"Sending…":"Send"})]}),d.jsx(qR,{open:i==="history",title:"Recent chats",onClose:()=>o(null),headerAction:d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:U,children:"+ New"}),children:d.jsx(Lfe,{conversations:E,total:S,hasMore:A,isLoadingMore:j,onLoadMore:C,activeId:e,onSelect:G=>{t(G),o(null)},onDelete:async G=>{await bi({title:"Delete this conversation?",message:"This permanently removes the conversation. This cannot be undone.",confirmLabel:"Delete",danger:!0})&&P.mutate({conversationId:G},{onSuccess:()=>{var K;if(G===e){const Z=((K=E.find($=>$.id!==G))==null?void 0:K.id)??null;t(Z)}}})},onDeleteBulk:async G=>{var Z;if(G.length===0||!await bi({title:G.length===1?"Delete this conversation?":`Delete ${G.length} conversations?`,message:"This permanently removes them. This cannot be undone.",confirmLabel:G.length===1?"Delete":`Delete ${G.length}`,danger:!0}))return;const K=new Set(G);if(e&&K.has(e)){const $=((Z=E.find(ee=>!K.has(ee.id)))==null?void 0:Z.id)??null;t($)}for(const $ of G)P.mutate({conversationId:$})}})}),d.jsx(qR,{open:i==="integrations",title:"Integrations",onClose:()=>o(null),children:i==="integrations"&&d.jsx(rhe,{})})]})}const dhe=[{title:"Private chat",body:"A back-unit chat tab where you talk to your own bot — separate from visitors, with admin-only tools.",glyph:"◐"},{title:"Integrations",body:"Facebook Messenger, WooCommerce, Zoho CRM, Google Search Console. The bot reaches into the tools you already run on.",glyph:"⚙"},{title:"Background tasks",body:"Ask once, walk away. The bot researches leads, drafts follow-ups, and surfaces what needs your attention.",glyph:"◫"}];function fhe(){const[e,t]=v.useState(!1);return d.jsxs("section",{className:"bb-agent-pitch",children:[d.jsxs("header",{className:"bb-agent-pitch-head",children:[d.jsx("h2",{className:"bb-agent-pitch-title",children:"Your bot, on autopilot."}),d.jsx("p",{className:"bb-agent-pitch-sub",children:"A private chat for the admin. Tools the visitor bot can't touch. Background work the bot does for you while you focus on your business."})]}),d.jsx("div",{className:"bb-agent-pitch-grid",children:dhe.map(n=>d.jsxs("article",{className:"bb-agent-pitch-cap",children:[d.jsx("span",{className:"bb-agent-pitch-glyph","aria-hidden":!0,children:n.glyph}),d.jsx("h3",{className:"bb-agent-pitch-cap-title",children:n.title}),d.jsx("p",{className:"bb-agent-pitch-cap-body",children:n.body})]},n.title))}),d.jsxs("footer",{className:"bb-agent-pitch-foot",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-agent-pitch-cta",onClick:()=>t(!0),children:"Get Agent — $49/mo"}),d.jsx("span",{className:"bb-agent-pitch-note",children:"Cancel any time. No setup."})]}),d.jsx(gs,{open:e,onClose:()=>t(!1)})]})}function hhe(){const e=Re();return P4(e.plan)?d.jsxs(d.Fragment,{children:[d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:"Agent"}),d.jsx("span",{className:"bb-section-aside",children:"Your private chat with BitBot — and everything it can do for you"})]}),d.jsx(uhe,{})]}):d.jsx(fhe,{})}function FR(e){return e?new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}):"—"}function mhe({open:e,onOpenChange:t}){const n=Re(),{data:r,isLoading:i}=hE(),o=tH(),[l,u]=v.useState(!1),f=document.getElementById("bitbot-admin-root")??void 0;return d.jsx(Tb,{open:e,onOpenChange:t,children:d.jsxs(Pb,{container:f,children:[d.jsx(_b,{className:"bb-drawer-overlay"}),d.jsxs(Db,{className:"bb-drawer","aria-describedby":void 0,children:[d.jsxs("header",{className:"bb-drawer-header",children:[d.jsx(gE,{className:"bb-drawer-title",children:"Account"}),d.jsx(Mb,{className:"bb-drawer-close","aria-label":"Close",children:"✕"})]}),d.jsxs("div",{className:"bb-drawer-body",children:[d.jsxs("section",{className:"bb-drawer-section",children:[d.jsx("span",{className:"bb-eyebrow",children:"Subscription"}),i||!r?d.jsx("div",{className:"bb-skeleton",style:{height:100,borderRadius:8}}):(()=>{const h=n.plan==="free",p=h?null:r.subscriptionStatus==="cancelled"?"ending":r.subscriptionStatus;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"bb-account-tier",children:[d.jsx("span",{className:"bb-account-tier-name",children:wk(n.plan)}),p&&d.jsx("span",{className:`bb-account-status bb-account-status-${r.subscriptionStatus}`,children:p})]}),d.jsxs("dl",{className:"bb-account-meta",children:[h&&d.jsxs(d.Fragment,{children:[d.jsx("dt",{children:"Plan"}),d.jsx("dd",{children:"Free forever · upgrade to unlock leads, AI posts, and integrations"})]}),!h&&r.subscriptionStatus==="active"&&d.jsxs(d.Fragment,{children:[d.jsx("dt",{children:"Next bill"}),d.jsx("dd",{children:FR(r.currentPeriodEnd)})]}),!h&&r.subscriptionStatus==="cancelled"&&d.jsxs(d.Fragment,{children:[d.jsx("dt",{children:"Access until"}),d.jsx("dd",{children:FR(r.currentPeriodEnd)})]})]})]})})()]}),r&&d.jsxs("section",{className:"bb-drawer-section",children:[d.jsx("span",{className:"bb-eyebrow",children:"Billing"}),d.jsxs("div",{className:"bb-account-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>u(!0),children:n.plan==="free"?"Upgrade →":"Change plan →"}),n.plan!=="free"&&d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",disabled:o.isPending,onClick:()=>o.mutate(),children:o.isPending?"Opening…":"Manage card · view invoices →"})]})]}),d.jsxs("section",{className:"bb-drawer-section bb-drawer-footer-section",children:[d.jsx("span",{className:"bb-eyebrow",children:"Site"}),d.jsxs("dl",{className:"bb-account-meta",children:[d.jsx("dt",{children:"Domain"}),d.jsx("dd",{children:(()=>{try{return new URL(n.siteUrl).host}catch{return n.siteUrl}})()}),d.jsx("dt",{children:"Plugin version"}),d.jsx("dd",{children:n.pluginVersion})]}),d.jsxs("p",{className:"bb-account-help",children:["Questions? Email ",d.jsx("a",{href:"mailto:support@youami.ai",children:"support@youami.ai"}),"."]})]})]}),d.jsx(gs,{open:l,onClose:()=>u(!1)})]})]})})}function phe(){const{ajaxUrl:e,ajaxNonce:t}=Re();return je({mutationFn:async()=>{var o;const n=new URLSearchParams({action:"bitbot_reconnect",nonce:t}),i=await(await fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})).json();if(!i.success){const l=((o=i.data)==null?void 0:o.error)??"Reconnect failed";throw new Error(l)}return i.data}})}function tw({label:e,used:t,cap:n,lockedHint:r}){if(r)return d.jsxs("div",{className:"bb-meter bb-meter-locked",children:[d.jsx("div",{className:"bb-meter-label",children:e}),d.jsxs("div",{className:"bb-meter-values",children:[d.jsx("span",{className:"bb-meter-used",children:Hy(t)}),d.jsx("span",{className:"bb-meter-locked-hint",children:r})]})]});const i=n===null||n===0||n===1/0||n<0||n>1e6,o=i?0:Math.min(100,Math.max(0,t/n*100)),l=i?"ok":o>90?"danger":o>75?"warn":"ok";return d.jsxs("div",{className:"bb-meter",children:[d.jsx("div",{className:"bb-meter-label",children:e}),d.jsxs("div",{className:"bb-meter-values",children:[d.jsx("span",{className:"bb-meter-used",children:Hy(t)}),d.jsx("span",{className:"bb-meter-sep",children:"/"}),d.jsx("span",{className:"bb-meter-cap",children:i?"∞":Hy(n)})]}),!i&&d.jsx("div",{className:`bb-meter-bar bb-meter-bar-${l}`,children:d.jsx("div",{className:"bb-meter-fill",style:{width:`${o}%`}})})]})}function $R(e){if(!e)return"";try{return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch{return""}}function nw(e){return e==="pro_plus"?"$49":e==="pro"?"$20":"$0"}function bhe(e,t,n){return e==="overview"?!1:n==="free"?e==="chatbot"||e==="content"&&(t==="indexed"||t==="faqs"):!0}function vhe(e){const{tab:t,contentSub:n,plan:r,accessMode:i,usage:o,limits:l,subscriptionStatus:u,periodEnd:f}=e,h=t==="overview"?"meters":"message";if(i==="expired")return{tone:"critical",badgeLabel:"Expired",badgeKind:"expired",headline:"Your subscription has ended.",sub:"Past leads, drafts, and conversations are safe. Reactivate to start using BitBot again.",layout:h,priceLabel:nw(r),ctaLabel:"Reactivate →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&l.chatMessagesPerMonth>0&&o.chatMessagesThisMonth>=l.chatMessagesPerMonth)return{tone:"critical",badgeLabel:"Free",badgeKind:"warn",headline:"Visitors aren't getting answers.",sub:`You've used all ${l.chatMessagesPerMonth} chat replies this month. The widget hides until next month or you upgrade.`,layout:h,priceLabel:"$0",ctaLabel:"Upgrade for unlimited →",ctaOpensModal:!0,showFineprint:!1};if((r==="pro"||r==="pro_plus")&&u==="cancelled"&&f){const g=r==="pro_plus"?"Agent":"Assistant";return{tone:"warn",badgeLabel:g,badgeKind:"warn",headline:`${g} ends ${$R(f)}.`,sub:"Reactivate before then to keep everything running. After the period ends you'll drop to Free.",layout:h,priceLabel:nw(r),ctaLabel:"Reactivate →",ctaOpensModal:!0,showFineprint:!1}}if(bhe(t,n,r))return null;if(r==="free"&&t==="content"&&n==="topics"&&o.topicCreditsThisMonth>=3)return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:"Topic Discovery limit reached.",sub:"You've used your 3 free topic searches. Upgrade to Assistant for unlimited research + AI post drafts.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to Assistant →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&t==="content"&&n==="generate")return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:"AI post generation is on Assistant.",sub:"Outline → draft → polish in one click. Unlimited posts, edit in WordPress, your site's brand voice baked in.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to Assistant →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&t==="content"&&n==="drafts")return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:"Drafts live on Assistant.",sub:"Generate, edit, and push to WordPress directly from BitBot. Free doesn't include the AI writer.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to Assistant →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&t==="forms"&&l.maxForms>0&&o.formsCount>=l.maxForms)return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:`${o.formsCount} of ${l.maxForms} form${l.maxForms===1?"":"s"} used.`,sub:"Edit the form you have any time. Unlimited forms + AI-generated form schemas on Assistant.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to Assistant →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&t==="leads"&&o.leadsCount>0)return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:`${o.leadsCount} ${o.leadsCount===1?"lead":"leads"} waiting to be unlocked.`,sub:"Your bot has captured real visitor emails. Upgrade to Assistant to see them, follow up, push to your CRM, and run AI research.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to view →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&t==="conversations"&&o.chatMessagesThisMonth>0)return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:"Transcripts locked on Free.",sub:"Your bot is talking to visitors. Upgrade to Assistant to read what they're asking, follow up on leads, and take over live.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to Assistant →",ctaOpensModal:!0,showFineprint:!1};if(r==="pro"&&l.chatMessagesPerMonth>0&&o.chatMessagesThisMonth>=l.chatMessagesPerMonth*.8)return{tone:"warn",badgeLabel:"Assistant",badgeKind:"assistant",headline:`${Math.max(0,l.chatMessagesPerMonth-o.chatMessagesThisMonth)} of ${l.chatMessagesPerMonth.toLocaleString()} chat replies left this month.`,sub:"Heads up on the Pro fair-use ceiling. Resets on the 1st. Email support@youami.ai for higher limits.",layout:h,priceLabel:nw(r),ctaLabel:"Change plan →",ctaOpensModal:!0,showFineprint:!1};if(r==="pro_plus")return null;if(r==="pro"){const g=$R(f);return{tone:"assistant",badgeLabel:"Assistant",badgeKind:"assistant",headline:"Assistant active.",sub:g?`Your bot, your voice — no limits. Next bill: ${g}.`:"Your bot, your voice — no limits.",layout:h,priceLabel:"$20",ctaLabel:"Change plan →",ctaOpensModal:!0,showFineprint:!1}}const p={overview:{headline:"Free forever.",sub:"Your bot is live. Upgrade to unlock leads, AI posts, and integrations."},chatbot:{headline:"Tune your bot — free on every plan.",sub:"Voice, instructions, look & feel — all editable. Upgrade unlocks the rest of BitBot."},content:{headline:"Free forever.",sub:"Index pages and curate FAQs on Free. AI topic research, post drafts, and scheduling are on Assistant."},forms:{headline:"Free forever.",sub:"One form on Free. Upgrade to Assistant for unlimited forms and AI form generation."},leads:{headline:"Free forever.",sub:"Your bot will start capturing visitor emails as soon as they share them. Upgrade to view + follow up."},conversations:{headline:"Free forever.",sub:"Once visitors start chatting, threads land here. Upgrade to read transcripts and take over live."},integrations:{headline:"Integrations are on Agent.",sub:"Replies on Facebook + Instagram, push to Zoho CRM, knows your WooCommerce products. From $49/mo."}},b=p[t]??p.overview;return{tone:"free",badgeLabel:"Free",badgeKind:"free",headline:b.headline,sub:b.sub,layout:h,priceLabel:"$0",ctaLabel:t==="integrations"?"Upgrade to Agent →":"Upgrade →",ctaOpensModal:!0,showFineprint:!0}}function ghe(e){return e==="cancelled"||e==="canceled"?"cancelled":e==="expired"?"expired":e==="trialing"?"trialing":"active"}function yhe(){const{data:e,isLoading:t,isError:n}=Ai(),{data:r}=hE(),[i]=xk(),[o]=V2();y2();const[l,u]=v.useState(!1);if(n)return null;if(t||!e)return d.jsx("div",{className:"bb-plancard bb-plancard-skeleton",children:d.jsx("div",{className:"bb-skeleton",style:{height:120}})});const f=vhe({tab:i,contentSub:i==="content"?o:null,plan:e.plan,accessMode:e.accessMode,usage:{chatMessagesThisMonth:e.usage.chatMessagesThisMonth,topicCreditsThisMonth:e.usage.topicCreditsThisMonth,postsThisMonth:e.usage.postsThisMonth,leadsCount:e.usage.leadsCount,formsCount:e.usage.formsCount},limits:{chatMessagesPerMonth:e.limits.chatMessagesPerMonth,topicCreditsPerMonth:e.limits.topicCreditsPerMonth,postsPerMonth:e.limits.postsPerMonth,maxLeads:e.limits.maxLeads,maxForms:e.limits.maxForms},subscriptionStatus:ghe(r==null?void 0:r.subscriptionStatus),periodEnd:(r==null?void 0:r.currentPeriodEnd)??null});if(!f)return d.jsx(gs,{open:l,onClose:()=>u(!1)});const h=f.layout==="message";return d.jsxs(d.Fragment,{children:[d.jsxs("article",{className:`bb-plancard bb-plancard-${f.tone}${h?" bb-plancard-message":""}`,"aria-label":`Plan: ${f.badgeLabel}`,children:[d.jsxs("span",{className:"bb-plancard-monogram","aria-hidden":!0,children:["b",d.jsx("span",{className:"bb-plancard-dot",children:"."})]}),d.jsxs("div",{className:"bb-plancard-id",children:[d.jsx("span",{className:`bb-tier-badge bb-tier-badge-${f.badgeKind}`,children:f.badgeLabel}),d.jsx("h2",{className:"bb-plancard-headline",children:f.headline}),d.jsx("p",{className:"bb-plancard-sub",children:f.sub})]}),f.layout==="meters"&&d.jsxs("div",{className:"bb-plancard-meters",children:[d.jsx(tw,{label:"Chat queries",used:e.usage.chatMessagesThisMonth,cap:e.limits.chatMessagesPerMonth}),d.jsx(tw,{label:"Topic searches",used:e.usage.topicCreditsThisMonth,cap:e.limits.topicCreditsPerMonth}),d.jsx(tw,{label:"Leads",used:e.usage.leadsCount,cap:e.limits.maxLeads,lockedHint:e.plan==="free"?"Upgrade to view":void 0})]}),d.jsxs("div",{className:"bb-plancard-cta",children:[d.jsxs("div",{className:"bb-plancard-price",children:[f.priceLabel,d.jsx("span",{className:"bb-plancard-price-sub",children:"/mo"})]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:()=>{f.ctaOpensModal&&u(!0)},children:f.ctaLabel}),f.showFineprint&&d.jsx("p",{className:"bb-plancard-fineprint",children:"cancel any time"})]})]}),d.jsx(gs,{open:l,onClose:()=>u(!1)})]})}class Nq extends v.Component{constructor(){super(...arguments);Gs(this,"state",{err:null,diagnostics:null});Gs(this,"reset",()=>this.setState({err:null,diagnostics:null}));Gs(this,"copyDiagnostics",()=>{var n;this.state.diagnostics&&((n=navigator.clipboard)==null||n.writeText(this.state.diagnostics).catch(()=>{alert(this.state.diagnostics)}))})}static getDerivedStateFromError(n){return{err:n}}componentDidCatch(n,r){const i=(()=>{try{return Re()}catch{return null}})();R$(n,{boundary:this.props.boundary,component_stack:r.componentStack,plan:i==null?void 0:i.plan,plugin_version:i==null?void 0:i.pluginVersion}),this.setState({diagnostics:["BitBot diagnostics","------------------",`Where: ${this.props.boundary}`,`When: ${new Date().toISOString()}`,`Plan: ${(i==null?void 0:i.plan)??"unknown"}`,`Plugin: ${(i==null?void 0:i.pluginVersion)??"unknown"}`,`Domain: ${(()=>{try{return new URL((i==null?void 0:i.siteUrl)??"").host}catch{return""}})()}`,`URL: ${typeof window<"u"?window.location.href:""}`,`User-agent: ${typeof navigator<"u"?navigator.userAgent:""}`,"",`Error: ${n.name}: ${n.message}`,"","Stack:",n.stack??"(no stack)","","Component stack:",r.componentStack??"(no component stack)"].join(`287 `)})}render(){return this.state.err?this.props.fallback?this.props.fallback(this.state.err,this.reset):d.jsxs("section",{className:"bb-card bb-errbound",role:"alert",children:[d.jsx("header",{className:"bb-card-header",children:d.jsxs("h3",{className:"bb-card-title",children:[d.jsx("span",{className:"bb-eyebrow",children:"Something broke"}),d.jsx("span",{children:"This panel hit an error"})]})}),d.jsxs("div",{className:"bb-card-body",children:[d.jsx("p",{className:"bb-errbound-body",children:`Don't worry — the rest of the admin is fine. The error has been logged automatically. You can keep using the other tabs while we investigate, or click "Try again" to retry this view.`}),d.jsxs("pre",{className:"bb-errbound-message",children:[this.state.err.name,": ",this.state.err.message]}),d.jsxs("div",{className:"bb-errbound-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:this.copyDiagnostics,children:"Copy diagnostics"}),d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:this.reset,children:"Try again"})]})]})]}):this.props.children}}function xhe(){return X2(),fE(),K2(),null}function whe(){const[e,t]=v.useState(!1);return v.useEffect(()=>{const n=setTimeout(()=>t(!0),600);return()=>clearTimeout(n)},[]),e?d.jsx(xhe,{}):null}function She(e){return!e||e.length<12?e||"—":`${e.slice(0,6)}…${e.slice(-4)}`}const KR={overview:"Overview",chatbot:"Chatbot",content:"Knowledgebase",forms:"Forms",leads:"Leads",conversations:"Conversations",integrations:"Agent"},Ehe=["overview","chatbot","leads","conversations","content","forms","integrations"];function Ahe(){var A;const[e,t]=xk(),[n,r]=v.useState(!1),i=Re(),o=Ne(),l=phe(),[u,f]=v.useState(!1),[h,p]=v.useState(null);v.useEffect(()=>{const j=C=>{const O=C.detail;p((O==null?void 0:O.error)||"Invalid API key")};return window.addEventListener(Ew,j),()=>window.removeEventListener(Ew,j)},[]);const b=()=>{l.mutate(void 0,{onSuccess:()=>{f(!1),setTimeout(()=>window.location.reload(),600)}})};v.useEffect(()=>{const j=new URL(window.location.href),C=j.searchParams.get("subscription");C&&(C==="success"?(o.invalidateQueries({queryKey:["plan-status"]}),o.invalidateQueries({queryKey:["subscription"]}),le.success("Payment successful — welcome to your new plan.")):C==="cancelled"&&le.info("Checkout cancelled — no charge made."),j.searchParams.delete("subscription"),j.searchParams.delete("swap"),window.history.replaceState({},"",j.toString()))},[o]);const{data:g}=$8(),x=Y2(),E={leads:(g==null?void 0:g.leads)??0,conversations:(g==null?void 0:g.conversations)??0,forms:(g==null?void 0:g.forms)??0,content:x},S=(()=>{try{return new URL(i.siteUrl).host}catch{return i.siteUrl}})();return d.jsxs("div",{className:"bb-app",children:[d.jsxs("header",{className:"bb-brandbar",children:[d.jsxs("div",{className:"bb-brandbar-left",children:[d.jsxs("span",{className:"bb-brandmark",children:["b",d.jsx("span",{className:"bb-brandmark-dot",children:"."})]}),d.jsxs("div",{className:"bb-brandbar-meta",children:[d.jsx("div",{className:"bb-brandbar-title",children:"BitBot"}),d.jsxs("div",{className:"bb-brandbar-sub",children:[d.jsxs("span",{className:"bb-brandbar-key",children:[d.jsx("span",{className:"bb-brandbar-keylabel",children:"API key"}),d.jsx("code",{title:`API key for ${S}`,children:She(i.apiKey)}),d.jsx("button",{type:"button",className:"bb-brandbar-iconbtn bb-brandbar-regen",onClick:()=>f(j=>!j),title:"Regenerate API key","aria-label":"Regenerate API key",children:"↻"})]}),d.jsx("span",{className:"bb-brandbar-sep",children:"·"}),d.jsxs("span",{children:["Plugin ",i.pluginVersion]})]})]})]}),d.jsx("div",{className:"bb-brandbar-right",children:d.jsxs("button",{className:"bb-pill bb-pill-tier bb-pill-account",onClick:()=>r(!0),"aria-label":"Open account drawer",children:[wk(i.plan)," ",d.jsx("span",{className:"bb-pill-account-caret",children:"⌃"})]})})]}),h&&!l.isSuccess&&d.jsxs("div",{className:"bb-regen-bar bb-regen-bar-error",role:"alert",children:[d.jsxs("span",{className:"bb-regen-text",children:[d.jsx("strong",{children:"BitBot can’t connect."})," The server didn’t recognise this site’s API key, so nothing can load. Regenerate the key to reconnect.",d.jsxs("span",{className:"bb-regen-error",children:[" ",h]})]}),d.jsx("span",{className:"bb-regen-actions",children:d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:b,disabled:l.isPending,children:l.isPending?"Reconnecting…":"Regenerate API key & reconnect"})})]}),u&&d.jsxs("div",{className:"bb-regen-bar",children:[d.jsxs("span",{className:"bb-regen-text",children:["Issue a ",d.jsx("strong",{children:"new API key"})," and reconnect this site? Use this only if the bot isn’t loading or won’t connect.",l.isError&&d.jsxs("span",{className:"bb-regen-error",children:[" ",((A=l.error)==null?void 0:A.message)||"Reconnect failed."]})]}),d.jsxs("span",{className:"bb-regen-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:b,disabled:l.isPending,children:l.isPending?"Reconnecting…":"Regenerate & reconnect"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>f(!1),disabled:l.isPending,children:"Cancel"})]})]}),d.jsx(mhe,{open:n,onOpenChange:r}),d.jsx(whe,{}),d.jsx("nav",{className:"bb-tabstrip",role:"tablist","aria-label":"BitBot sections",children:Object.keys(KR).map(j=>{const C=Ehe.includes(j),O=e===j;return d.jsxs("button",{role:"tab","aria-selected":O,disabled:!C,className:`bb-tab ${O?"bb-tab-active":""} ${C?"":"bb-tab-disabled"}`,onClick:()=>{C&&(t(j),Ra("tab_changed",{from:e,to:j}))},children:[KR[j],(E[j]??0)>0&&d.jsx("span",{className:"bb-tab-badge","aria-label":`${E[j]} new`,children:E[j]}),!C&&d.jsx("span",{className:"bb-tab-soon",children:"SOON"})]},j)})}),d.jsxs("main",{className:"bb-container",children:[e!=="integrations"&&d.jsx(yhe,{}),d.jsxs(Nq,{boundary:e,children:[e==="overview"&&d.jsx(n6,{}),e==="chatbot"&&d.jsx(M8,{}),e==="content"&&d.jsx(OY,{}),e==="forms"&&d.jsx(WY,{}),e==="leads"&&d.jsx(AG,{}),e==="conversations"&&d.jsx(FG,{}),e==="integrations"&&d.jsx(hhe,{})]},e)]}),d.jsxs("footer",{className:"bb-footer",children:[d.jsx("span",{children:"BitBot · "}),d.jsx("a",{href:"https://youami.ai/docs",target:"_blank",rel:"noopener noreferrer",children:"Documentation"}),d.jsx("span",{className:"bb-brandbar-sep",children:"·"}),d.jsx("a",{href:"https://youami.ai/support",target:"_blank",rel:"noopener noreferrer",children:"Support"})]})]})}const jhe=new g4({defaultOptions:{queries:{staleTime:60*1e3,gcTime:600*1e3,refetchOnWindowFocus:!1,retry:1}}}),HR=document.getElementById("bitbot-admin-root");HR?(M$(),Ra("admin_loaded",{initial_tab:new URL(window.location.href).searchParams.get("tab")??"overview"}),HF.createRoot(HR).render(d.jsx(v.StrictMode,{children:d.jsx(Nq,{boundary:"root",children:d.jsx(y4,{client:jhe,children:d.jsx(T$,{children:d.jsx(aH,{children:d.jsx(Ahe,{})})})})})}))):console.error("[BitBot] #bitbot-admin-root not found — admin SPA cannot mount");286 `)})},i++));continue}const l=/^(#{1,4})\s+(.*)$/.exec(o);if(l){const f=l[1].length,h=l[2],p=`h${f}`;n.push(d.jsx(p,{children:Mc(h)},i++)),r++;continue}if(/^\s*[-*]\s+/.test(o)){const f=[];for(;r<t.length&&/^\s*[-*]\s+/.test(t[r]);){const h=t[r].replace(/^\s*[-*]\s+/,"");f.push(d.jsx("li",{children:Mc(h)},f.length)),r++}n.push(d.jsx("ul",{children:f},i++));continue}if(/^\s*\d+\.\s+/.test(o)){const f=[];for(;r<t.length&&/^\s*\d+\.\s+/.test(t[r]);){const h=t[r].replace(/^\s*\d+\.\s+/,"");f.push(d.jsx("li",{children:Mc(h)},f.length)),r++}n.push(d.jsx("ol",{children:f},i++));continue}if(/^\s*\|.*\|\s*$/.test(o)&&r+1<t.length&&/^\s*\|[\s|:-]+\|\s*$/.test(t[r+1])){const f=b=>b.trim().replace(/^\||\|$/g,"").split("|").map(g=>g.trim()),h=f(o);r+=2;const p=[];for(;r<t.length&&/^\s*\|.*\|\s*$/.test(t[r]);)p.push(f(t[r])),r++;n.push(d.jsxs("table",{className:"bb-md-table",children:[d.jsx("thead",{children:d.jsx("tr",{children:h.map((b,g)=>d.jsx("th",{children:Mc(b)},g))})}),d.jsx("tbody",{children:p.map((b,g)=>d.jsx("tr",{children:b.map((x,E)=>d.jsx("td",{children:Mc(x)},E))},g))})]},i++));continue}if(o.trim()===""){r++;continue}const u=[o];for(r++;r<t.length&&t[r].trim()!==""&&!/^```|^#{1,4}\s+|^\s*[-*]\s+|^\s*\d+\.\s+|^\s*\|.*\|\s*$/.test(t[r]);)u.push(t[r]),r++;n.push(d.jsx("p",{children:Mc(u.join(" "))},i++))}return d.jsx(d.Fragment,{children:n})}function ihe({stream:e}){const t=e.tools.filter(i=>!!XS(i.toolName)),n=e.tools.filter(i=>i.artifact&&i.artifact.kind==="chart"),r=e.status==="done"&&t.every(i=>i.status!=="in_progress");return d.jsxs("div",{className:"bb-adminchat-streaming",children:[t.length>0&&d.jsxs("div",{className:"bb-adminchat-tool-group",children:[d.jsx("div",{className:"bb-adminchat-tool-group-header",children:r?"✓ Done":"Working…"}),t.map(i=>d.jsx(ohe,{tool:i},i.startedAt))]}),n.map(i=>d.jsx(jq,{artifact:i.artifact},`chart-${i.startedAt}`)),(e.text||e.status==="streaming")&&d.jsx("div",{className:"bb-adminchat-bubble bb-adminchat-bubble-assistant bb-adminchat-bubble-streaming",children:d.jsx("div",{className:"bb-adminchat-bubble-body",children:e.text?d.jsx("div",{className:"bb-md",children:Nq(e.text)}):d.jsxs("span",{className:"bb-adminchat-typing",children:[d.jsx("i",{}),d.jsx("i",{}),d.jsx("i",{})]})})}),e.status==="error"&&e.error&&d.jsxs("div",{className:"bb-adminchat-stream-error",children:["⚠ ",e.error]})]})}function ohe({tool:e}){const t=XS(e.toolName);if(!t)return null;const n=e.status==="in_progress"?"⚙":e.status==="ok"?"✓":"✗";return d.jsxs("div",{className:`bb-adminchat-tool bb-adminchat-tool-${e.status}`,children:[d.jsx("span",{className:"bb-adminchat-tool-icon","aria-hidden":!0,children:n}),d.jsxs("span",{children:[t,e.status==="in_progress"?"…":""]}),e.status==="error"&&e.error&&d.jsx("span",{className:"bb-adminchat-tool-error",title:e.error,children:"—"})]})}function she(e){if(!e||typeof e!="object")return!1;const t=e;return t.kind==="chart"&&typeof t.chartKind=="string"&&typeof t.xKey=="string"&&Array.isArray(t.yKeys)&&Array.isArray(t.data)}function lhe({msg:e}){if(e.role==="tool"){const t=XS(e.toolName);if(!t)return null;const n=she(e.artifacts)?e.artifacts:null;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"bb-adminchat-tool",children:[d.jsx("span",{className:"bb-adminchat-tool-icon","aria-hidden":!0,children:"⚙"}),d.jsx("span",{children:t})]}),n?d.jsx(jq,{artifact:n}):null]})}return d.jsxs("div",{className:`bb-adminchat-bubble bb-adminchat-bubble-${e.role}`,children:[d.jsx("div",{className:"bb-adminchat-bubble-body",children:e.role==="assistant"?d.jsx("div",{className:"bb-md",children:Nq(e.content)}):e.content}),d.jsx("div",{className:"bb-adminchat-bubble-time",children:ahe(e.sentAt)})]})}const che=["What can you do for me?","How are you different from the visitor bot?","What integrations do you support?","What tasks can I delegate to you?"];function uhe(){const[e,t]=v.useState(null),[n,r]=v.useState(""),[i,o]=v.useState(null),[l,u]=v.useState(null),[f,h]=v.useState(null),p=v.useRef(null),b=v.useRef(null),g=v.useRef(!1),x=Ne(),{conversations:E,total:S,hasMore:A,isFetchingMore:j,loadMore:C,isSuccess:O}=Tfe(),{data:T}=Pfe(e),_=_fe(),P=Dfe(),D=Rfe(f),L=v.useRef(null);v.useEffect(()=>{g.current||O&&(e===null&&E.length>0&&t(E[0].id),g.current=!0)},[e,E,O]);const z=v.useMemo(()=>(T==null?void 0:T.messages)??[],[T]);v.useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[z.length,_.isPending]);const F=$=>{if(!$.trim()||_.isPending)return;const ne=$.trim();u(ne),_.mutate({conversationId:e,message:ne},{onSuccess:K=>{e||t(K.conversationId),h({conversationId:K.conversationId,sinceSequence:K.sinceSequence})},onError:()=>{u(null)}})},G=()=>{const $=n.trim();$&&(r(""),F($))};v.useEffect(()=>{l&&z.some($=>$.role==="user"&&$.content===l)&&u(null)},[z,l]),v.useEffect(()=>{f?L.current=z.length:L.current=null},[f]),v.useEffect(()=>{if(!f||D.status!=="done"&&D.status!=="error")return;let $=!1,ne=0;const K=async()=>{$||(ne+=1,await x.invalidateQueries({queryKey:["admin-chat","conversation",f.conversationId]}),ne<15&&setTimeout(K,800))};return K(),x.invalidateQueries({queryKey:["drafts"]}),x.invalidateQueries({queryKey:["faqs"]}),x.invalidateQueries({queryKey:["leads"]}),x.invalidateQueries({queryKey:["unviewed-leads"]}),()=>{$=!0}},[D.status,f,x]),v.useEffect(()=>{var $;if(f&&L.current!==null&&!(z.length<=L.current)){for(let ne=z.length-1;ne>=L.current;ne--)if((($=z[ne])==null?void 0:$.role)==="assistant"){h(null);return}}},[z,f]);const R=()=>{t(null),r(""),i==="history"&&o(null)},J=v.useMemo(()=>{var $;return e?(($=E.find(ne=>ne.id===e))==null?void 0:$.title)??(T==null?void 0:T.summary.title)??null:null},[e,E,T]);return d.jsxs("div",{className:"bb-agent-surface",children:[d.jsxs("header",{className:"bb-agent-actionbar",children:[d.jsxs("div",{className:"bb-agent-actionbar-left",children:[d.jsxs("button",{type:"button",className:"bb-agent-action bb-agent-action-primary",onClick:R,title:"Start a new chat",children:[d.jsx("span",{className:"bb-agent-action-glyph",children:"+"}),d.jsx("span",{children:"New chat"})]}),d.jsxs("button",{type:"button",className:"bb-agent-action",onClick:()=>o("history"),children:[d.jsx("span",{className:"bb-agent-action-glyph",children:"⌖"}),d.jsx("span",{children:"History"}),E.length>0&&d.jsx("span",{className:"bb-agent-action-count",children:E.length})]})]}),d.jsx("div",{className:"bb-agent-actionbar-mid",children:J&&d.jsx("span",{className:"bb-agent-active-title",title:J,children:J})}),d.jsx("div",{className:"bb-agent-actionbar-right",children:d.jsxs("button",{type:"button",className:"bb-agent-action",onClick:()=>o("integrations"),children:[d.jsx("span",{className:"bb-agent-action-glyph",children:"⚙"}),d.jsx("span",{children:"Integrations"})]})})]}),d.jsxs("div",{className:"bb-agent-transcript",ref:p,children:[z.length===0&&!l?d.jsxs("div",{className:"bb-agent-empty",children:[d.jsx("h4",{children:"Talk to your bot"}),d.jsx("p",{children:"This is your private chat with BitBot. Ask it anything about your site, your leads, or your content — it has every tool the visitor bot has, plus admin-only ones once you turn integrations on."}),d.jsxs("div",{className:"bb-agent-starters",children:[d.jsx("div",{className:"bb-agent-starters-label",children:"Try one of these to get started"}),d.jsx("div",{className:"bb-agent-starters-grid",children:che.map($=>d.jsxs("button",{type:"button",className:"bb-agent-starter",disabled:_.isPending,onClick:()=>F($),children:[d.jsx("span",{className:"bb-agent-starter-arrow","aria-hidden":!0,children:"→"}),d.jsx("span",{className:"bb-agent-starter-label",children:$})]},$))})]})]}):d.jsxs(d.Fragment,{children:[z.map($=>d.jsx(lhe,{msg:$},$.id)),l&&d.jsxs("div",{className:"bb-adminchat-bubble bb-adminchat-bubble-user",children:[d.jsx("div",{className:"bb-adminchat-bubble-body",children:l}),d.jsx("div",{className:"bb-adminchat-bubble-time",children:"just now"})]}),f&&(D.status==="streaming"||D.tools.length>0||D.text)&&d.jsx(ihe,{stream:D})]}),_.isPending&&D.status!=="streaming"&&d.jsx("div",{className:"bb-adminchat-pending",children:d.jsxs("span",{className:"bb-adminchat-typing",children:[d.jsx("i",{}),d.jsx("i",{}),d.jsx("i",{})]})})]}),d.jsxs("div",{className:"bb-agent-composer",children:[d.jsx("textarea",{ref:b,className:"bb-adminchat-input",value:n,onChange:$=>r($.target.value),placeholder:"Type a message…",rows:2,onKeyDown:$=>{$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),G())}}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",disabled:!n.trim()||_.isPending,onClick:G,children:_.isPending?"Sending…":"Send"})]}),d.jsx(BR,{open:i==="history",title:"Recent chats",onClose:()=>o(null),headerAction:d.jsx("button",{type:"button",className:"bb-btn bb-btn-ghost bb-btn-small",onClick:R,children:"+ New"}),children:d.jsx(Lfe,{conversations:E,total:S,hasMore:A,isLoadingMore:j,onLoadMore:C,activeId:e,onSelect:$=>{t($),o(null)},onDelete:async $=>{await bi({title:"Delete this conversation?",message:"This permanently removes the conversation. This cannot be undone.",confirmLabel:"Delete",danger:!0})&&P.mutate({conversationId:$},{onSuccess:()=>{var K;if($===e){const Z=((K=E.find(B=>B.id!==$))==null?void 0:K.id)??null;t(Z)}}})},onDeleteBulk:async $=>{var Z;if($.length===0||!await bi({title:$.length===1?"Delete this conversation?":`Delete ${$.length} conversations?`,message:"This permanently removes them. This cannot be undone.",confirmLabel:$.length===1?"Delete":`Delete ${$.length}`,danger:!0}))return;const K=new Set($);if(e&&K.has(e)){const B=((Z=E.find(te=>!K.has(te.id)))==null?void 0:Z.id)??null;t(B)}for(const B of $)P.mutate({conversationId:B})}})}),d.jsx(BR,{open:i==="integrations",title:"Integrations",onClose:()=>o(null),children:i==="integrations"&&d.jsx(rhe,{})})]})}const dhe=[{title:"Private chat",body:"A back-unit chat tab where you talk to your own bot — separate from visitors, with admin-only tools.",glyph:"◐"},{title:"Integrations",body:"Facebook Messenger, WooCommerce, Zoho CRM, Google Search Console. The bot reaches into the tools you already run on.",glyph:"⚙"},{title:"Background tasks",body:"Ask once, walk away. The bot researches leads, drafts follow-ups, and surfaces what needs your attention.",glyph:"◫"}];function fhe(){const[e,t]=v.useState(!1);return d.jsxs("section",{className:"bb-agent-pitch",children:[d.jsxs("header",{className:"bb-agent-pitch-head",children:[d.jsx("h2",{className:"bb-agent-pitch-title",children:"Your bot, on autopilot."}),d.jsx("p",{className:"bb-agent-pitch-sub",children:"A private chat for the admin. Tools the visitor bot can't touch. Background work the bot does for you while you focus on your business."})]}),d.jsx("div",{className:"bb-agent-pitch-grid",children:dhe.map(n=>d.jsxs("article",{className:"bb-agent-pitch-cap",children:[d.jsx("span",{className:"bb-agent-pitch-glyph","aria-hidden":!0,children:n.glyph}),d.jsx("h3",{className:"bb-agent-pitch-cap-title",children:n.title}),d.jsx("p",{className:"bb-agent-pitch-cap-body",children:n.body})]},n.title))}),d.jsxs("footer",{className:"bb-agent-pitch-foot",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-agent-pitch-cta",onClick:()=>t(!0),children:"Get Agent — $49/mo"}),d.jsx("span",{className:"bb-agent-pitch-note",children:"Cancel any time. No setup."})]}),d.jsx(gs,{open:e,onClose:()=>t(!1)})]})}function hhe(){const e=Re();return _4(e.plan)?d.jsxs(d.Fragment,{children:[d.jsxs("header",{className:"bb-section-head",children:[d.jsx("h2",{className:"bb-section-title",children:"Agent"}),d.jsx("span",{className:"bb-section-aside",children:"Your private chat with BitBot — and everything it can do for you"})]}),d.jsx(uhe,{})]}):d.jsx(fhe,{})}function $R(e){return e?new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}):"—"}function mhe({open:e,onOpenChange:t}){const n=Re(),{data:r,isLoading:i}=hE(),o=nH(),[l,u]=v.useState(!1),f=document.getElementById("bitbot-admin-root")??void 0;return d.jsx(Tb,{open:e,onOpenChange:t,children:d.jsxs(Pb,{container:f,children:[d.jsx(_b,{className:"bb-drawer-overlay"}),d.jsxs(Db,{className:"bb-drawer","aria-describedby":void 0,children:[d.jsxs("header",{className:"bb-drawer-header",children:[d.jsx(gE,{className:"bb-drawer-title",children:"Account"}),d.jsx(Mb,{className:"bb-drawer-close","aria-label":"Close",children:"✕"})]}),d.jsxs("div",{className:"bb-drawer-body",children:[d.jsxs("section",{className:"bb-drawer-section",children:[d.jsx("span",{className:"bb-eyebrow",children:"Subscription"}),i||!r?d.jsx("div",{className:"bb-skeleton",style:{height:100,borderRadius:8}}):(()=>{const h=n.plan==="free",p=h?null:r.subscriptionStatus==="cancelled"?"ending":r.subscriptionStatus;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"bb-account-tier",children:[d.jsx("span",{className:"bb-account-tier-name",children:Sk(n.plan)}),p&&d.jsx("span",{className:`bb-account-status bb-account-status-${r.subscriptionStatus}`,children:p})]}),d.jsxs("dl",{className:"bb-account-meta",children:[h&&d.jsxs(d.Fragment,{children:[d.jsx("dt",{children:"Plan"}),d.jsx("dd",{children:"Free forever · upgrade to unlock leads, AI posts, and integrations"})]}),!h&&r.subscriptionStatus==="active"&&d.jsxs(d.Fragment,{children:[d.jsx("dt",{children:"Next bill"}),d.jsx("dd",{children:$R(r.currentPeriodEnd)})]}),!h&&r.subscriptionStatus==="cancelled"&&d.jsxs(d.Fragment,{children:[d.jsx("dt",{children:"Access until"}),d.jsx("dd",{children:$R(r.currentPeriodEnd)})]})]})]})})()]}),r&&d.jsxs("section",{className:"bb-drawer-section",children:[d.jsx("span",{className:"bb-eyebrow",children:"Billing"}),d.jsxs("div",{className:"bb-account-actions",children:[d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary bb-btn-small",onClick:()=>u(!0),children:n.plan==="free"?"Upgrade →":"Change plan →"}),n.plan!=="free"&&d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",disabled:o.isPending,onClick:()=>o.mutate(),children:o.isPending?"Opening…":"Manage card · view invoices →"})]})]}),d.jsxs("section",{className:"bb-drawer-section bb-drawer-footer-section",children:[d.jsx("span",{className:"bb-eyebrow",children:"Site"}),d.jsxs("dl",{className:"bb-account-meta",children:[d.jsx("dt",{children:"Domain"}),d.jsx("dd",{children:(()=>{try{return new URL(n.siteUrl).host}catch{return n.siteUrl}})()}),d.jsx("dt",{children:"Plugin version"}),d.jsx("dd",{children:n.pluginVersion})]}),d.jsxs("p",{className:"bb-account-help",children:["Questions? Email ",d.jsx("a",{href:"mailto:support@youami.ai",children:"support@youami.ai"}),"."]})]})]}),d.jsx(gs,{open:l,onClose:()=>u(!1)})]})]})})}function phe(){const{ajaxUrl:e,ajaxNonce:t}=Re();return je({mutationFn:async()=>{var o;const n=new URLSearchParams({action:"bitbot_reconnect",nonce:t}),i=await(await fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})).json();if(!i.success){const l=((o=i.data)==null?void 0:o.error)??"Reconnect failed";throw new Error(l)}return i.data}})}function tw({label:e,used:t,cap:n,lockedHint:r}){if(r)return d.jsxs("div",{className:"bb-meter bb-meter-locked",children:[d.jsx("div",{className:"bb-meter-label",children:e}),d.jsxs("div",{className:"bb-meter-values",children:[d.jsx("span",{className:"bb-meter-used",children:Hy(t)}),d.jsx("span",{className:"bb-meter-locked-hint",children:r})]})]});const i=n===null||n===0||n===1/0||n<0||n>1e6,o=i?0:Math.min(100,Math.max(0,t/n*100)),l=i?"ok":o>90?"danger":o>75?"warn":"ok";return d.jsxs("div",{className:"bb-meter",children:[d.jsx("div",{className:"bb-meter-label",children:e}),d.jsxs("div",{className:"bb-meter-values",children:[d.jsx("span",{className:"bb-meter-used",children:Hy(t)}),d.jsx("span",{className:"bb-meter-sep",children:"/"}),d.jsx("span",{className:"bb-meter-cap",children:i?"∞":Hy(n)})]}),!i&&d.jsx("div",{className:`bb-meter-bar bb-meter-bar-${l}`,children:d.jsx("div",{className:"bb-meter-fill",style:{width:`${o}%`}})})]})}function KR(e){if(!e)return"";try{return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}catch{return""}}function nw(e){return e==="pro_plus"?"$49":e==="pro"?"$20":"$0"}function bhe(e,t,n){return e==="overview"?!1:n==="free"?e==="chatbot"||e==="content"&&(t==="indexed"||t==="faqs"):!0}function vhe(e){const{tab:t,contentSub:n,plan:r,accessMode:i,usage:o,limits:l,subscriptionStatus:u,periodEnd:f}=e,h=t==="overview"?"meters":"message";if(i==="expired")return{tone:"critical",badgeLabel:"Expired",badgeKind:"expired",headline:"Your subscription has ended.",sub:"Past leads, drafts, and conversations are safe. Reactivate to start using BitBot again.",layout:h,priceLabel:nw(r),ctaLabel:"Reactivate →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&l.chatMessagesPerMonth>0&&o.chatMessagesThisMonth>=l.chatMessagesPerMonth)return{tone:"critical",badgeLabel:"Free",badgeKind:"warn",headline:"Visitors aren't getting answers.",sub:`You've used all ${l.chatMessagesPerMonth} chat replies this month. The widget hides until next month or you upgrade.`,layout:h,priceLabel:"$0",ctaLabel:"Upgrade for unlimited →",ctaOpensModal:!0,showFineprint:!1};if((r==="pro"||r==="pro_plus")&&u==="cancelled"&&f){const g=r==="pro_plus"?"Agent":"Assistant";return{tone:"warn",badgeLabel:g,badgeKind:"warn",headline:`${g} ends ${KR(f)}.`,sub:"Reactivate before then to keep everything running. After the period ends you'll drop to Free.",layout:h,priceLabel:nw(r),ctaLabel:"Reactivate →",ctaOpensModal:!0,showFineprint:!1}}if(bhe(t,n,r))return null;if(r==="free"&&t==="content"&&n==="topics"&&o.topicCreditsThisMonth>=3)return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:"Topic Discovery limit reached.",sub:"You've used your 3 free topic searches. Upgrade to Assistant for unlimited research + AI post drafts.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to Assistant →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&t==="content"&&n==="generate")return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:"AI post generation is on Assistant.",sub:"Outline → draft → polish in one click. Unlimited posts, edit in WordPress, your site's brand voice baked in.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to Assistant →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&t==="content"&&n==="drafts")return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:"Drafts live on Assistant.",sub:"Generate, edit, and push to WordPress directly from BitBot. Free doesn't include the AI writer.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to Assistant →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&t==="forms"&&l.maxForms>0&&o.formsCount>=l.maxForms)return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:`${o.formsCount} of ${l.maxForms} form${l.maxForms===1?"":"s"} used.`,sub:"Edit the form you have any time. Unlimited forms + AI-generated form schemas on Assistant.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to Assistant →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&t==="leads"&&o.leadsCount>0)return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:`${o.leadsCount} ${o.leadsCount===1?"lead":"leads"} waiting to be unlocked.`,sub:"Your bot has captured real visitor emails. Upgrade to Assistant to see them, follow up, push to your CRM, and run AI research.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to view →",ctaOpensModal:!0,showFineprint:!1};if(r==="free"&&t==="conversations"&&o.chatMessagesThisMonth>0)return{tone:"warn",badgeLabel:"Free",badgeKind:"free",headline:"Transcripts locked on Free.",sub:"Your bot is talking to visitors. Upgrade to Assistant to read what they're asking, follow up on leads, and take over live.",layout:h,priceLabel:"$0",ctaLabel:"Upgrade to Assistant →",ctaOpensModal:!0,showFineprint:!1};if(r==="pro"&&l.chatMessagesPerMonth>0&&o.chatMessagesThisMonth>=l.chatMessagesPerMonth*.8)return{tone:"warn",badgeLabel:"Assistant",badgeKind:"assistant",headline:`${Math.max(0,l.chatMessagesPerMonth-o.chatMessagesThisMonth)} of ${l.chatMessagesPerMonth.toLocaleString()} chat replies left this month.`,sub:"Heads up on the Pro fair-use ceiling. Resets on the 1st. Email support@youami.ai for higher limits.",layout:h,priceLabel:nw(r),ctaLabel:"Change plan →",ctaOpensModal:!0,showFineprint:!1};if(r==="pro_plus")return null;if(r==="pro"){const g=KR(f);return{tone:"assistant",badgeLabel:"Assistant",badgeKind:"assistant",headline:"Assistant active.",sub:g?`Your bot, your voice — no limits. Next bill: ${g}.`:"Your bot, your voice — no limits.",layout:h,priceLabel:"$20",ctaLabel:"Change plan →",ctaOpensModal:!0,showFineprint:!1}}const p={overview:{headline:"Free forever.",sub:"Your bot is live. Upgrade to unlock leads, AI posts, and integrations."},chatbot:{headline:"Tune your bot — free on every plan.",sub:"Voice, instructions, look & feel — all editable. Upgrade unlocks the rest of BitBot."},content:{headline:"Free forever.",sub:"Index pages and curate FAQs on Free. AI topic research, post drafts, and scheduling are on Assistant."},forms:{headline:"Free forever.",sub:"One form on Free. Upgrade to Assistant for unlimited forms and AI form generation."},leads:{headline:"Free forever.",sub:"Your bot will start capturing visitor emails as soon as they share them. Upgrade to view + follow up."},conversations:{headline:"Free forever.",sub:"Once visitors start chatting, threads land here. Upgrade to read transcripts and take over live."},integrations:{headline:"Integrations are on Agent.",sub:"Replies on Facebook + Instagram, push to Zoho CRM, knows your WooCommerce products. From $49/mo."}},b=p[t]??p.overview;return{tone:"free",badgeLabel:"Free",badgeKind:"free",headline:b.headline,sub:b.sub,layout:h,priceLabel:"$0",ctaLabel:t==="integrations"?"Upgrade to Agent →":"Upgrade →",ctaOpensModal:!0,showFineprint:!0}}function ghe(e){return e==="cancelled"||e==="canceled"?"cancelled":e==="expired"?"expired":e==="trialing"?"trialing":"active"}function yhe(){const{data:e,isLoading:t,isError:n}=Ai(),{data:r}=hE(),[i]=wk(),[o]=X2();x2();const[l,u]=v.useState(!1);if(n)return null;if(t||!e)return d.jsx("div",{className:"bb-plancard bb-plancard-skeleton",children:d.jsx("div",{className:"bb-skeleton",style:{height:120}})});const f=vhe({tab:i,contentSub:i==="content"?o:null,plan:e.plan,accessMode:e.accessMode,usage:{chatMessagesThisMonth:e.usage.chatMessagesThisMonth,topicCreditsThisMonth:e.usage.topicCreditsThisMonth,postsThisMonth:e.usage.postsThisMonth,leadsCount:e.usage.leadsCount,formsCount:e.usage.formsCount},limits:{chatMessagesPerMonth:e.limits.chatMessagesPerMonth,topicCreditsPerMonth:e.limits.topicCreditsPerMonth,postsPerMonth:e.limits.postsPerMonth,maxLeads:e.limits.maxLeads,maxForms:e.limits.maxForms},subscriptionStatus:ghe(r==null?void 0:r.subscriptionStatus),periodEnd:(r==null?void 0:r.currentPeriodEnd)??null});if(!f)return d.jsx(gs,{open:l,onClose:()=>u(!1)});const h=f.layout==="message";return d.jsxs(d.Fragment,{children:[d.jsxs("article",{className:`bb-plancard bb-plancard-${f.tone}${h?" bb-plancard-message":""}`,"aria-label":`Plan: ${f.badgeLabel}`,children:[d.jsxs("span",{className:"bb-plancard-monogram","aria-hidden":!0,children:["b",d.jsx("span",{className:"bb-plancard-dot",children:"."})]}),d.jsxs("div",{className:"bb-plancard-id",children:[d.jsx("span",{className:`bb-tier-badge bb-tier-badge-${f.badgeKind}`,children:f.badgeLabel}),d.jsx("h2",{className:"bb-plancard-headline",children:f.headline}),d.jsx("p",{className:"bb-plancard-sub",children:f.sub})]}),f.layout==="meters"&&d.jsxs("div",{className:"bb-plancard-meters",children:[d.jsx(tw,{label:"Chat queries",used:e.usage.chatMessagesThisMonth,cap:e.limits.chatMessagesPerMonth}),d.jsx(tw,{label:"Topic searches",used:e.usage.topicCreditsThisMonth,cap:e.limits.topicCreditsPerMonth}),d.jsx(tw,{label:"Leads",used:e.usage.leadsCount,cap:e.limits.maxLeads,lockedHint:e.plan==="free"?"Upgrade to view":void 0})]}),d.jsxs("div",{className:"bb-plancard-cta",children:[d.jsxs("div",{className:"bb-plancard-price",children:[f.priceLabel,d.jsx("span",{className:"bb-plancard-price-sub",children:"/mo"})]}),d.jsx("button",{type:"button",className:"bb-btn bb-btn-primary",onClick:()=>{f.ctaOpensModal&&u(!0)},children:f.ctaLabel}),f.showFineprint&&d.jsx("p",{className:"bb-plancard-fineprint",children:"cancel any time"})]})]}),d.jsx(gs,{open:l,onClose:()=>u(!1)})]})}class Tq extends v.Component{constructor(){super(...arguments);Gs(this,"state",{err:null,diagnostics:null});Gs(this,"reset",()=>this.setState({err:null,diagnostics:null}));Gs(this,"copyDiagnostics",()=>{var n;this.state.diagnostics&&((n=navigator.clipboard)==null||n.writeText(this.state.diagnostics).catch(()=>{alert(this.state.diagnostics)}))})}static getDerivedStateFromError(n){return{err:n}}componentDidCatch(n,r){const i=(()=>{try{return Re()}catch{return null}})();k$(n,{boundary:this.props.boundary,component_stack:r.componentStack,plan:i==null?void 0:i.plan,plugin_version:i==null?void 0:i.pluginVersion}),this.setState({diagnostics:["BitBot diagnostics","------------------",`Where: ${this.props.boundary}`,`When: ${new Date().toISOString()}`,`Plan: ${(i==null?void 0:i.plan)??"unknown"}`,`Plugin: ${(i==null?void 0:i.pluginVersion)??"unknown"}`,`Domain: ${(()=>{try{return new URL((i==null?void 0:i.siteUrl)??"").host}catch{return""}})()}`,`URL: ${typeof window<"u"?window.location.href:""}`,`User-agent: ${typeof navigator<"u"?navigator.userAgent:""}`,"",`Error: ${n.name}: ${n.message}`,"","Stack:",n.stack??"(no stack)","","Component stack:",r.componentStack??"(no component stack)"].join(` 287 `)})}render(){return this.state.err?this.props.fallback?this.props.fallback(this.state.err,this.reset):d.jsxs("section",{className:"bb-card bb-errbound",role:"alert",children:[d.jsx("header",{className:"bb-card-header",children:d.jsxs("h3",{className:"bb-card-title",children:[d.jsx("span",{className:"bb-eyebrow",children:"Something broke"}),d.jsx("span",{children:"This panel hit an error"})]})}),d.jsxs("div",{className:"bb-card-body",children:[d.jsx("p",{className:"bb-errbound-body",children:`Don't worry — the rest of the admin is fine. The error has been logged automatically. You can keep using the other tabs while we investigate, or click "Try again" to retry this view.`}),d.jsxs("pre",{className:"bb-errbound-message",children:[this.state.err.name,": ",this.state.err.message]}),d.jsxs("div",{className:"bb-errbound-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:this.copyDiagnostics,children:"Copy diagnostics"}),d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:this.reset,children:"Try again"})]})]})]}):this.props.children}}function xhe(){return Z2(),fE(),H2(),null}function whe(){const[e,t]=v.useState(!1);return v.useEffect(()=>{const n=setTimeout(()=>t(!0),600);return()=>clearTimeout(n)},[]),e?d.jsx(xhe,{}):null}function She(e){return!e||e.length<12?e||"—":`${e.slice(0,6)}…${e.slice(-4)}`}const HR={overview:"Overview",chatbot:"Chatbot",content:"Knowledgebase",forms:"Forms",leads:"Leads",conversations:"Conversations",integrations:"Agent"},Ehe=["overview","chatbot","leads","conversations","content","forms","integrations"];function Ahe(){var A;const[e,t]=wk(),[n,r]=v.useState(!1),i=Re(),o=Ne(),l=phe(),[u,f]=v.useState(!1),[h,p]=v.useState(null);v.useEffect(()=>{const j=C=>{const O=C.detail;p((O==null?void 0:O.error)||"Invalid API key")};return window.addEventListener(Ew,j),()=>window.removeEventListener(Ew,j)},[]);const b=()=>{l.mutate(void 0,{onSuccess:()=>{f(!1),setTimeout(()=>window.location.reload(),600)}})};v.useEffect(()=>{const j=new URL(window.location.href),C=j.searchParams.get("subscription");C&&(C==="success"?(o.invalidateQueries({queryKey:["plan-status"]}),o.invalidateQueries({queryKey:["subscription"]}),le.success("Payment successful — welcome to your new plan.")):C==="cancelled"&&le.info("Checkout cancelled — no charge made."),j.searchParams.delete("subscription"),j.searchParams.delete("swap"),window.history.replaceState({},"",j.toString()))},[o]);const{data:g}=K8(),x=W2(),E={leads:(g==null?void 0:g.leads)??0,conversations:(g==null?void 0:g.conversations)??0,forms:(g==null?void 0:g.forms)??0,content:x},S=(()=>{try{return new URL(i.siteUrl).host}catch{return i.siteUrl}})();return d.jsxs("div",{className:"bb-app",children:[d.jsxs("header",{className:"bb-brandbar",children:[d.jsxs("div",{className:"bb-brandbar-left",children:[d.jsxs("span",{className:"bb-brandmark",children:["b",d.jsx("span",{className:"bb-brandmark-dot",children:"."})]}),d.jsxs("div",{className:"bb-brandbar-meta",children:[d.jsx("div",{className:"bb-brandbar-title",children:"BitBot"}),d.jsxs("div",{className:"bb-brandbar-sub",children:[d.jsxs("span",{className:"bb-brandbar-key",children:[d.jsx("span",{className:"bb-brandbar-keylabel",children:"API key"}),d.jsx("code",{title:`API key for ${S}`,children:She(i.apiKey)}),d.jsx("button",{type:"button",className:"bb-brandbar-iconbtn bb-brandbar-regen",onClick:()=>f(j=>!j),title:"Regenerate API key","aria-label":"Regenerate API key",children:"↻"})]}),d.jsx("span",{className:"bb-brandbar-sep",children:"·"}),d.jsxs("span",{children:["Plugin ",i.pluginVersion]})]})]})]}),d.jsx("div",{className:"bb-brandbar-right",children:d.jsxs("button",{className:"bb-pill bb-pill-tier bb-pill-account",onClick:()=>r(!0),"aria-label":"Open account drawer",children:[Sk(i.plan)," ",d.jsx("span",{className:"bb-pill-account-caret",children:"⌃"})]})})]}),h&&!l.isSuccess&&d.jsxs("div",{className:"bb-regen-bar bb-regen-bar-error",role:"alert",children:[d.jsxs("span",{className:"bb-regen-text",children:[d.jsx("strong",{children:"BitBot can’t connect."})," The server didn’t recognise this site’s API key, so nothing can load. Regenerate the key to reconnect.",d.jsxs("span",{className:"bb-regen-error",children:[" ",h]})]}),d.jsx("span",{className:"bb-regen-actions",children:d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:b,disabled:l.isPending,children:l.isPending?"Reconnecting…":"Regenerate API key & reconnect"})})]}),u&&d.jsxs("div",{className:"bb-regen-bar",children:[d.jsxs("span",{className:"bb-regen-text",children:["Issue a ",d.jsx("strong",{children:"new API key"})," and reconnect this site? Use this only if the bot isn’t loading or won’t connect.",l.isError&&d.jsxs("span",{className:"bb-regen-error",children:[" ",((A=l.error)==null?void 0:A.message)||"Reconnect failed."]})]}),d.jsxs("span",{className:"bb-regen-actions",children:[d.jsx("button",{className:"bb-btn bb-btn-primary bb-btn-small",onClick:b,disabled:l.isPending,children:l.isPending?"Reconnecting…":"Regenerate & reconnect"}),d.jsx("button",{className:"bb-btn bb-btn-ghost bb-btn-small",onClick:()=>f(!1),disabled:l.isPending,children:"Cancel"})]})]}),d.jsx(mhe,{open:n,onOpenChange:r}),d.jsx(whe,{}),d.jsx("nav",{className:"bb-tabstrip",role:"tablist","aria-label":"BitBot sections",children:Object.keys(HR).map(j=>{const C=Ehe.includes(j),O=e===j;return d.jsxs("button",{role:"tab","aria-selected":O,disabled:!C,className:`bb-tab ${O?"bb-tab-active":""} ${C?"":"bb-tab-disabled"}`,onClick:()=>{C&&(t(j),Ra("tab_changed",{from:e,to:j}))},children:[HR[j],(E[j]??0)>0&&d.jsx("span",{className:"bb-tab-badge","aria-label":`${E[j]} new`,children:E[j]}),!C&&d.jsx("span",{className:"bb-tab-soon",children:"SOON"})]},j)})}),d.jsxs("main",{className:"bb-container",children:[e!=="integrations"&&d.jsx(yhe,{}),d.jsxs(Tq,{boundary:e,children:[e==="overview"&&d.jsx(r6,{}),e==="chatbot"&&d.jsx(R8,{}),e==="content"&&d.jsx(OY,{}),e==="forms"&&d.jsx(WY,{}),e==="leads"&&d.jsx(jG,{}),e==="conversations"&&d.jsx($G,{}),e==="integrations"&&d.jsx(hhe,{})]},e)]}),d.jsxs("footer",{className:"bb-footer",children:[d.jsx("span",{children:"BitBot · "}),d.jsx("a",{href:"https://youami.ai/docs",target:"_blank",rel:"noopener noreferrer",children:"Documentation"}),d.jsx("span",{className:"bb-brandbar-sep",children:"·"}),d.jsx("a",{href:"https://youami.ai/support",target:"_blank",rel:"noopener noreferrer",children:"Support"})]})]})}const jhe=new y4({defaultOptions:{queries:{staleTime:60*1e3,gcTime:600*1e3,refetchOnWindowFocus:!1,retry:1}}}),GR=document.getElementById("bitbot-admin-root");GR?(R$(),Ra("admin_loaded",{initial_tab:new URL(window.location.href).searchParams.get("tab")??"overview"}),GF.createRoot(GR).render(d.jsx(v.StrictMode,{children:d.jsx(Tq,{boundary:"root",children:d.jsx(x4,{client:jhe,children:d.jsx(P$,{children:d.jsx(iH,{children:d.jsx(Ahe,{})})})})})}))):console.error("[BitBot] #bitbot-admin-root not found — admin SPA cannot mount"); -
bitbot/trunk/bitbot.php
r3576181 r3576222 12 12 * Plugin URI: https://youami.ai 13 13 * Description: AI-powered multilingual chatbot that helps visitors navigate your website in any language, plus AI content generation. 14 * Version: 2.0. 114 * Version: 2.0.2 15 15 * Requires at least: 5.8 16 16 * Requires PHP: 7.4 … … 46 46 47 47 // Plugin constants 48 define( 'BITBOT_VERSION', '2.0. 1' );48 define( 'BITBOT_VERSION', '2.0.2' ); 49 49 define( 'BITBOT_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 50 50 define( 'BITBOT_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
bitbot/trunk/readme.txt
r3576181 r3576222 6 6 Tested up to: 7.0 7 7 Requires PHP: 7.4 8 Stable tag: 2.0. 18 Stable tag: 2.0.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 154 154 155 155 == Changelog == 156 157 = 2.0.2 = 158 *Release Date - 18 June 2026* 159 160 * Performance improvements for large page libraries, plus minor fixes. 156 161 157 162 = 2.0.1 = … … 267 272 == Upgrade Notice == 268 273 274 = 2.0.2 = 275 Performance improvements for large page libraries, plus minor fixes. 276 269 277 = 2.0.1 = 270 278 Minor UI polish and small fixes.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)