Files
cannaiq/frontend/dist/assets/index-TpSq-kLx.js
Kelly 66e07b2009 fix(monitor): remove non-existent worker columns from job_run_logs query
The job_run_logs table tracks scheduled job orchestration, not individual
worker jobs. Worker info (worker_id, worker_hostname) belongs on
dispensary_crawl_jobs, not job_run_logs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-03 18:45:05 -07:00

417 lines
768 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var Pk=Object.defineProperty;var _k=(e,t,r)=>t in e?Pk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ho=(e,t,r)=>_k(e,typeof t!="symbol"?t+"":t,r);function Ck(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();function Tr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sv={exports:{}},kc={},Nv={exports:{}},ie={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ks=Symbol.for("react.element"),Ak=Symbol.for("react.portal"),Ok=Symbol.for("react.fragment"),Ek=Symbol.for("react.strict_mode"),Dk=Symbol.for("react.profiler"),Tk=Symbol.for("react.provider"),Mk=Symbol.for("react.context"),Ik=Symbol.for("react.forward_ref"),$k=Symbol.for("react.suspense"),Lk=Symbol.for("react.memo"),zk=Symbol.for("react.lazy"),dg=Symbol.iterator;function Rk(e){return e===null||typeof e!="object"?null:(e=dg&&e[dg]||e["@@iterator"],typeof e=="function"?e:null)}var kv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Pv=Object.assign,_v={};function va(e,t,r){this.props=e,this.context=t,this.refs=_v,this.updater=r||kv}va.prototype.isReactComponent={};va.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};va.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Cv(){}Cv.prototype=va.prototype;function Pp(e,t,r){this.props=e,this.context=t,this.refs=_v,this.updater=r||kv}var _p=Pp.prototype=new Cv;_p.constructor=Pp;Pv(_p,va.prototype);_p.isPureReactComponent=!0;var fg=Array.isArray,Av=Object.prototype.hasOwnProperty,Cp={current:null},Ov={key:!0,ref:!0,__self:!0,__source:!0};function Ev(e,t,r){var n,i={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Av.call(t,n)&&!Ov.hasOwnProperty(n)&&(i[n]=t[n]);var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];i.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)i[n]===void 0&&(i[n]=l[n]);return{$$typeof:Ks,type:e,key:s,ref:o,props:i,_owner:Cp.current}}function Bk(e,t){return{$$typeof:Ks,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ap(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ks}function Fk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var pg=/\/+/g;function Iu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Fk(""+e.key):t.toString(36)}function Yo(e,t,r,n,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Ks:case Ak:o=!0}}if(o)return o=e,i=i(o),e=n===""?"."+Iu(o,0):n,fg(i)?(r="",e!=null&&(r=e.replace(pg,"$&/")+"/"),Yo(i,t,r,"",function(d){return d})):i!=null&&(Ap(i)&&(i=Bk(i,r+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(pg,"$&/")+"/")+e)),t.push(i)),1;if(o=0,n=n===""?".":n+":",fg(e))for(var l=0;l<e.length;l++){s=e[l];var c=n+Iu(s,l);o+=Yo(s,t,r,c,i)}else if(c=Rk(e),typeof c=="function")for(e=c.call(e),l=0;!(s=e.next()).done;)s=s.value,c=n+Iu(s,l++),o+=Yo(s,t,r,c,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function mo(e,t,r){if(e==null)return e;var n=[],i=0;return Yo(e,n,"","",function(s){return t.call(r,s,i++)}),n}function Wk(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var xt={current:null},Go={transition:null},Uk={ReactCurrentDispatcher:xt,ReactCurrentBatchConfig:Go,ReactCurrentOwner:Cp};function Dv(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:mo,forEach:function(e,t,r){mo(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return mo(e,function(){t++}),t},toArray:function(e){return mo(e,function(t){return t})||[]},only:function(e){if(!Ap(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=va;ie.Fragment=Ok;ie.Profiler=Dk;ie.PureComponent=Pp;ie.StrictMode=Ek;ie.Suspense=$k;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Uk;ie.act=Dv;ie.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=Pv({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Cp.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Av.call(t,c)&&!Ov.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];n.children=l}return{$$typeof:Ks,type:e.type,key:i,ref:s,props:n,_owner:o}};ie.createContext=function(e){return e={$$typeof:Mk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Tk,_context:e},e.Consumer=e};ie.createElement=Ev;ie.createFactory=function(e){var t=Ev.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:Ik,render:e}};ie.isValidElement=Ap;ie.lazy=function(e){return{$$typeof:zk,_payload:{_status:-1,_result:e},_init:Wk}};ie.memo=function(e,t){return{$$typeof:Lk,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=Go.transition;Go.transition={};try{e()}finally{Go.transition=t}};ie.unstable_act=Dv;ie.useCallback=function(e,t){return xt.current.useCallback(e,t)};ie.useContext=function(e){return xt.current.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e){return xt.current.useDeferredValue(e)};ie.useEffect=function(e,t){return xt.current.useEffect(e,t)};ie.useId=function(){return xt.current.useId()};ie.useImperativeHandle=function(e,t,r){return xt.current.useImperativeHandle(e,t,r)};ie.useInsertionEffect=function(e,t){return xt.current.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return xt.current.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return xt.current.useMemo(e,t)};ie.useReducer=function(e,t,r){return xt.current.useReducer(e,t,r)};ie.useRef=function(e){return xt.current.useRef(e)};ie.useState=function(e){return xt.current.useState(e)};ie.useSyncExternalStore=function(e,t,r){return xt.current.useSyncExternalStore(e,t,r)};ie.useTransition=function(){return xt.current.useTransition()};ie.version="18.3.1";Nv.exports=ie;var h=Nv.exports;const fs=Tr(h),Tv=Ck({__proto__:null,default:fs},[h]);/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var qk=h,Hk=Symbol.for("react.element"),Kk=Symbol.for("react.fragment"),Vk=Object.prototype.hasOwnProperty,Yk=qk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Gk={key:!0,ref:!0,__self:!0,__source:!0};function Mv(e,t,r){var n,i={},s=null,o=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)Vk.call(t,n)&&!Gk.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:Hk,type:e,key:s,ref:o,props:i,_owner:Yk.current}}kc.Fragment=Kk;kc.jsx=Mv;kc.jsxs=Mv;Sv.exports=kc;var a=Sv.exports,Od={},Iv={exports:{}},Ut={},$v={exports:{}},Lv={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/(function(e){function t(O,k){var L=O.length;O.push(k);e:for(;0<L;){var U=L-1>>>1,H=O[U];if(0<i(H,k))O[U]=k,O[L]=H,L=U;else break e}}function r(O){return O.length===0?null:O[0]}function n(O){if(O.length===0)return null;var k=O[0],L=O.pop();if(L!==k){O[0]=L;e:for(var U=0,H=O.length,te=H>>>1;U<te;){var re=2*(U+1)-1,we=O[re],A=re+1,J=O[A];if(0>i(we,L))A<H&&0>i(J,we)?(O[U]=J,O[A]=L,U=A):(O[U]=we,O[re]=L,U=re);else if(A<H&&0>i(J,L))O[U]=J,O[A]=L,U=A;else break e}}return k}function i(O,k){var L=O.sortIndex-k.sortIndex;return L!==0?L:O.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,f=null,p=3,m=!1,x=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(O){for(var k=r(d);k!==null;){if(k.callback===null)n(d);else if(k.startTime<=O)n(d),k.sortIndex=k.expirationTime,t(c,k);else break;k=r(d)}}function w(O){if(g=!1,y(O),!x)if(r(c)!==null)x=!0,E(S);else{var k=r(d);k!==null&&D(w,k.startTime-O)}}function S(O,k){x=!1,g&&(g=!1,v(_),_=-1),m=!0;var L=p;try{for(y(k),f=r(c);f!==null&&(!(f.expirationTime>k)||O&&!M());){var U=f.callback;if(typeof U=="function"){f.callback=null,p=f.priorityLevel;var H=U(f.expirationTime<=k);k=e.unstable_now(),typeof H=="function"?f.callback=H:f===r(c)&&n(c),y(k)}else n(c);f=r(c)}if(f!==null)var te=!0;else{var re=r(d);re!==null&&D(w,re.startTime-k),te=!1}return te}finally{f=null,p=L,m=!1}}var N=!1,P=null,_=-1,T=5,$=-1;function M(){return!(e.unstable_now()-$<T)}function C(){if(P!==null){var O=e.unstable_now();$=O;var k=!0;try{k=P(!0,O)}finally{k?R():(N=!1,P=null)}}else N=!1}var R;if(typeof j=="function")R=function(){j(C)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,Z=q.port2;q.port1.onmessage=C,R=function(){Z.postMessage(null)}}else R=function(){b(C,0)};function E(O){P=O,N||(N=!0,R())}function D(O,k){_=b(function(){O(e.unstable_now())},k)}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(O){O.callback=null},e.unstable_continueExecution=function(){x||m||(x=!0,E(S))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(O){switch(p){case 1:case 2:case 3:var k=3;break;default:k=p}var L=p;p=k;try{return O()}finally{p=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,k){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var L=p;p=O;try{return k()}finally{p=L}},e.unstable_scheduleCallback=function(O,k,L){var U=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?U+L:U):L=U,O){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=L+H,O={id:u++,callback:k,priorityLevel:O,startTime:L,expirationTime:H,sortIndex:-1},L>U?(O.sortIndex=L,t(d,O),r(c)===null&&O===r(d)&&(g?(v(_),_=-1):g=!0,D(w,L-U))):(O.sortIndex=H,t(c,O),x||m||(x=!0,E(S))),O},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(O){var k=p;return function(){var L=p;p=k;try{return O.apply(this,arguments)}finally{p=L}}}})(Lv);$v.exports=Lv;var Zk=$v.exports;/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Xk=h,Ft=Zk;function F(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var zv=new Set,ps={};function ki(e,t){aa(e,t),aa(e+"Capture",t)}function aa(e,t){for(ps[e]=t,e=0;e<t.length;e++)zv.add(t[e])}var Yr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ed=Object.prototype.hasOwnProperty,Jk=/^[: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]*$/,hg={},mg={};function Qk(e){return Ed.call(mg,e)?!0:Ed.call(hg,e)?!1:Jk.test(e)?mg[e]=!0:(hg[e]=!0,!1)}function eP(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tP(e,t,r,n){if(t===null||typeof t>"u"||eP(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function yt(e,t,r,n,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){tt[e]=new yt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];tt[t]=new yt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){tt[e]=new yt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){tt[e]=new yt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){tt[e]=new yt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){tt[e]=new yt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){tt[e]=new yt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){tt[e]=new yt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){tt[e]=new yt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Op=/[\-:]([a-z])/g;function Ep(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Op,Ep);tt[t]=new yt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Op,Ep);tt[t]=new yt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Op,Ep);tt[t]=new yt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){tt[e]=new yt(e,1,!1,e.toLowerCase(),null,!1,!1)});tt.xlinkHref=new yt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){tt[e]=new yt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Dp(e,t,r,n){var i=tt.hasOwnProperty(t)?tt[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(tP(t,r,i,n)&&(r=null),n||i===null?Qk(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var sn=Xk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,go=Symbol.for("react.element"),$i=Symbol.for("react.portal"),Li=Symbol.for("react.fragment"),Tp=Symbol.for("react.strict_mode"),Dd=Symbol.for("react.profiler"),Rv=Symbol.for("react.provider"),Bv=Symbol.for("react.context"),Mp=Symbol.for("react.forward_ref"),Td=Symbol.for("react.suspense"),Md=Symbol.for("react.suspense_list"),Ip=Symbol.for("react.memo"),mn=Symbol.for("react.lazy"),Fv=Symbol.for("react.offscreen"),gg=Symbol.iterator;function Ma(e){return e===null||typeof e!="object"?null:(e=gg&&e[gg]||e["@@iterator"],typeof e=="function"?e:null)}var ke=Object.assign,$u;function Ga(e){if($u===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);$u=t&&t[1]||""}return`
`+$u+e}var Lu=!1;function zu(e,t){if(!e||Lu)return"";Lu=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var n=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){n=d}e.call(t.prototype)}else{try{throw Error()}catch(d){n=d}e()}}catch(d){if(d&&n&&typeof d.stack=="string"){for(var i=d.stack.split(`
`),s=n.stack.split(`
`),o=i.length-1,l=s.length-1;1<=o&&0<=l&&i[o]!==s[l];)l--;for(;1<=o&&0<=l;o--,l--)if(i[o]!==s[l]){if(o!==1||l!==1)do if(o--,l--,0>l||i[o]!==s[l]){var c=`
`+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{Lu=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ga(e):""}function rP(e){switch(e.tag){case 5:return Ga(e.type);case 16:return Ga("Lazy");case 13:return Ga("Suspense");case 19:return Ga("SuspenseList");case 0:case 2:case 15:return e=zu(e.type,!1),e;case 11:return e=zu(e.type.render,!1),e;case 1:return e=zu(e.type,!0),e;default:return""}}function Id(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Li:return"Fragment";case $i:return"Portal";case Dd:return"Profiler";case Tp:return"StrictMode";case Td:return"Suspense";case Md:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Bv:return(e.displayName||"Context")+".Consumer";case Rv:return(e._context.displayName||"Context")+".Provider";case Mp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ip:return t=e.displayName||null,t!==null?t:Id(e.type)||"Memo";case mn:t=e._payload,e=e._init;try{return Id(e(t))}catch{}}return null}function nP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Id(t);case 8:return t===Tp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function In(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iP(e){var t=Wv(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function xo(e){e._valueTracker||(e._valueTracker=iP(e))}function Uv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Wv(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function ul(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function $d(e,t){var r=t.checked;return ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function xg(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=In(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function qv(e,t){t=t.checked,t!=null&&Dp(e,"checked",t,!1)}function Ld(e,t){qv(e,t);var r=In(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zd(e,t.type,r):t.hasOwnProperty("defaultValue")&&zd(e,t.type,In(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yg(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function zd(e,t,r){(t!=="number"||ul(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Za=Array.isArray;function Xi(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+In(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Rd(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return ke({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function vg(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(F(92));if(Za(r)){if(1<r.length)throw Error(F(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:In(r)}}function Hv(e,t){var r=In(t.value),n=In(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function bg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Kv(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Bd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Kv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var yo,Vv=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(yo=yo||document.createElement("div"),yo.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=yo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function hs(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ts={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},aP=["Webkit","ms","Moz","O"];Object.keys(ts).forEach(function(e){aP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ts[t]=ts[e]})});function Yv(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ts.hasOwnProperty(e)&&ts[e]?(""+t).trim():t+"px"}function Gv(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=Yv(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var sP=ke({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Fd(e,t){if(t){if(sP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function Wd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 Ud=null;function $p(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qd=null,Ji=null,Qi=null;function jg(e){if(e=Gs(e)){if(typeof qd!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Oc(t),qd(e.stateNode,e.type,t))}}function Zv(e){Ji?Qi?Qi.push(e):Qi=[e]:Ji=e}function Xv(){if(Ji){var e=Ji,t=Qi;if(Qi=Ji=null,jg(e),t)for(e=0;e<t.length;e++)jg(t[e])}}function Jv(e,t){return e(t)}function Qv(){}var Ru=!1;function eb(e,t,r){if(Ru)return e(t,r);Ru=!0;try{return Jv(e,t,r)}finally{Ru=!1,(Ji!==null||Qi!==null)&&(Qv(),Xv())}}function ms(e,t){var r=e.stateNode;if(r===null)return null;var n=Oc(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(F(231,t,typeof r));return r}var Hd=!1;if(Yr)try{var Ia={};Object.defineProperty(Ia,"passive",{get:function(){Hd=!0}}),window.addEventListener("test",Ia,Ia),window.removeEventListener("test",Ia,Ia)}catch{Hd=!1}function oP(e,t,r,n,i,s,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(u){this.onError(u)}}var rs=!1,dl=null,fl=!1,Kd=null,lP={onError:function(e){rs=!0,dl=e}};function cP(e,t,r,n,i,s,o,l,c){rs=!1,dl=null,oP.apply(lP,arguments)}function uP(e,t,r,n,i,s,o,l,c){if(cP.apply(this,arguments),rs){if(rs){var d=dl;rs=!1,dl=null}else throw Error(F(198));fl||(fl=!0,Kd=d)}}function Pi(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function tb(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function wg(e){if(Pi(e)!==e)throw Error(F(188))}function dP(e){var t=e.alternate;if(!t){if(t=Pi(e),t===null)throw Error(F(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var s=i.alternate;if(s===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===r)return wg(i),e;if(s===n)return wg(i),t;s=s.sibling}throw Error(F(188))}if(r.return!==n.return)r=i,n=s;else{for(var o=!1,l=i.child;l;){if(l===r){o=!0,r=i,n=s;break}if(l===n){o=!0,n=i,r=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===r){o=!0,r=s,n=i;break}if(l===n){o=!0,n=s,r=i;break}l=l.sibling}if(!o)throw Error(F(189))}}if(r.alternate!==n)throw Error(F(190))}if(r.tag!==3)throw Error(F(188));return r.stateNode.current===r?e:t}function rb(e){return e=dP(e),e!==null?nb(e):null}function nb(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=nb(e);if(t!==null)return t;e=e.sibling}return null}var ib=Ft.unstable_scheduleCallback,Sg=Ft.unstable_cancelCallback,fP=Ft.unstable_shouldYield,pP=Ft.unstable_requestPaint,Ae=Ft.unstable_now,hP=Ft.unstable_getCurrentPriorityLevel,Lp=Ft.unstable_ImmediatePriority,ab=Ft.unstable_UserBlockingPriority,pl=Ft.unstable_NormalPriority,mP=Ft.unstable_LowPriority,sb=Ft.unstable_IdlePriority,Pc=null,kr=null;function gP(e){if(kr&&typeof kr.onCommitFiberRoot=="function")try{kr.onCommitFiberRoot(Pc,e,void 0,(e.current.flags&128)===128)}catch{}}var hr=Math.clz32?Math.clz32:vP,xP=Math.log,yP=Math.LN2;function vP(e){return e>>>=0,e===0?32:31-(xP(e)/yP|0)|0}var vo=64,bo=4194304;function Xa(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function hl(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~i;l!==0?n=Xa(l):(s&=o,s!==0&&(n=Xa(s)))}else o=r&~i,o!==0?n=Xa(o):s!==0&&(n=Xa(s));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-hr(t),i=1<<r,n|=e[r],t&=~i;return n}function bP(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jP(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-hr(s),l=1<<o,c=i[o];c===-1?(!(l&r)||l&n)&&(i[o]=bP(l,t)):c<=t&&(e.expiredLanes|=l),s&=~l}}function Vd(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ob(){var e=vo;return vo<<=1,!(vo&4194240)&&(vo=64),e}function Bu(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Vs(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-hr(t),e[t]=r}function wP(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-hr(r),s=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~s}}function zp(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-hr(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var le=0;function lb(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var cb,Rp,ub,db,fb,Yd=!1,jo=[],kn=null,Pn=null,_n=null,gs=new Map,xs=new Map,vn=[],SP="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ng(e,t){switch(e){case"focusin":case"focusout":kn=null;break;case"dragenter":case"dragleave":Pn=null;break;case"mouseover":case"mouseout":_n=null;break;case"pointerover":case"pointerout":gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xs.delete(t.pointerId)}}function $a(e,t,r,n,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Gs(t),t!==null&&Rp(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function NP(e,t,r,n,i){switch(t){case"focusin":return kn=$a(kn,e,t,r,n,i),!0;case"dragenter":return Pn=$a(Pn,e,t,r,n,i),!0;case"mouseover":return _n=$a(_n,e,t,r,n,i),!0;case"pointerover":var s=i.pointerId;return gs.set(s,$a(gs.get(s)||null,e,t,r,n,i)),!0;case"gotpointercapture":return s=i.pointerId,xs.set(s,$a(xs.get(s)||null,e,t,r,n,i)),!0}return!1}function pb(e){var t=ei(e.target);if(t!==null){var r=Pi(t);if(r!==null){if(t=r.tag,t===13){if(t=tb(r),t!==null){e.blockedOn=t,fb(e.priority,function(){ub(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Zo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Gd(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Ud=n,r.target.dispatchEvent(n),Ud=null}else return t=Gs(r),t!==null&&Rp(t),e.blockedOn=r,!1;t.shift()}return!0}function kg(e,t,r){Zo(e)&&r.delete(t)}function kP(){Yd=!1,kn!==null&&Zo(kn)&&(kn=null),Pn!==null&&Zo(Pn)&&(Pn=null),_n!==null&&Zo(_n)&&(_n=null),gs.forEach(kg),xs.forEach(kg)}function La(e,t){e.blockedOn===t&&(e.blockedOn=null,Yd||(Yd=!0,Ft.unstable_scheduleCallback(Ft.unstable_NormalPriority,kP)))}function ys(e){function t(i){return La(i,e)}if(0<jo.length){La(jo[0],e);for(var r=1;r<jo.length;r++){var n=jo[r];n.blockedOn===e&&(n.blockedOn=null)}}for(kn!==null&&La(kn,e),Pn!==null&&La(Pn,e),_n!==null&&La(_n,e),gs.forEach(t),xs.forEach(t),r=0;r<vn.length;r++)n=vn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<vn.length&&(r=vn[0],r.blockedOn===null);)pb(r),r.blockedOn===null&&vn.shift()}var ea=sn.ReactCurrentBatchConfig,ml=!0;function PP(e,t,r,n){var i=le,s=ea.transition;ea.transition=null;try{le=1,Bp(e,t,r,n)}finally{le=i,ea.transition=s}}function _P(e,t,r,n){var i=le,s=ea.transition;ea.transition=null;try{le=4,Bp(e,t,r,n)}finally{le=i,ea.transition=s}}function Bp(e,t,r,n){if(ml){var i=Gd(e,t,r,n);if(i===null)Zu(e,t,n,gl,r),Ng(e,n);else if(NP(i,e,t,r,n))n.stopPropagation();else if(Ng(e,n),t&4&&-1<SP.indexOf(e)){for(;i!==null;){var s=Gs(i);if(s!==null&&cb(s),s=Gd(e,t,r,n),s===null&&Zu(e,t,n,gl,r),s===i)break;i=s}i!==null&&n.stopPropagation()}else Zu(e,t,n,null,r)}}var gl=null;function Gd(e,t,r,n){if(gl=null,e=$p(n),e=ei(e),e!==null)if(t=Pi(e),t===null)e=null;else if(r=t.tag,r===13){if(e=tb(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return gl=e,null}function hb(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(hP()){case Lp:return 1;case ab:return 4;case pl:case mP:return 16;case sb:return 536870912;default:return 16}default:return 16}}var wn=null,Fp=null,Xo=null;function mb(){if(Xo)return Xo;var e,t=Fp,r=t.length,n,i="value"in wn?wn.value:wn.textContent,s=i.length;for(e=0;e<r&&t[e]===i[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===i[s-n];n++);return Xo=i.slice(e,1<n?1-n:void 0)}function Jo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function wo(){return!0}function Pg(){return!1}function qt(e){function t(r,n,i,s,o){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?wo:Pg,this.isPropagationStopped=Pg,this}return ke(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=wo)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=wo)},persist:function(){},isPersistent:wo}),t}var ba={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wp=qt(ba),Ys=ke({},ba,{view:0,detail:0}),CP=qt(Ys),Fu,Wu,za,_c=ke({},Ys,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Up,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==za&&(za&&e.type==="mousemove"?(Fu=e.screenX-za.screenX,Wu=e.screenY-za.screenY):Wu=Fu=0,za=e),Fu)},movementY:function(e){return"movementY"in e?e.movementY:Wu}}),_g=qt(_c),AP=ke({},_c,{dataTransfer:0}),OP=qt(AP),EP=ke({},Ys,{relatedTarget:0}),Uu=qt(EP),DP=ke({},ba,{animationName:0,elapsedTime:0,pseudoElement:0}),TP=qt(DP),MP=ke({},ba,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),IP=qt(MP),$P=ke({},ba,{data:0}),Cg=qt($P),LP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zP={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"},RP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function BP(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=RP[e])?!!t[e]:!1}function Up(){return BP}var FP=ke({},Ys,{key:function(e){if(e.key){var t=LP[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Jo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Up,charCode:function(e){return e.type==="keypress"?Jo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Jo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),WP=qt(FP),UP=ke({},_c,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ag=qt(UP),qP=ke({},Ys,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Up}),HP=qt(qP),KP=ke({},ba,{propertyName:0,elapsedTime:0,pseudoElement:0}),VP=qt(KP),YP=ke({},_c,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),GP=qt(YP),ZP=[9,13,27,32],qp=Yr&&"CompositionEvent"in window,ns=null;Yr&&"documentMode"in document&&(ns=document.documentMode);var XP=Yr&&"TextEvent"in window&&!ns,gb=Yr&&(!qp||ns&&8<ns&&11>=ns),Og=" ",Eg=!1;function xb(e,t){switch(e){case"keyup":return ZP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zi=!1;function JP(e,t){switch(e){case"compositionend":return yb(t);case"keypress":return t.which!==32?null:(Eg=!0,Og);case"textInput":return e=t.data,e===Og&&Eg?null:e;default:return null}}function QP(e,t){if(zi)return e==="compositionend"||!qp&&xb(e,t)?(e=mb(),Xo=Fp=wn=null,zi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return gb&&t.locale!=="ko"?null:t.data;default:return null}}var e_={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 Dg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!e_[e.type]:t==="textarea"}function vb(e,t,r,n){Zv(n),t=xl(t,"onChange"),0<t.length&&(r=new Wp("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var is=null,vs=null;function t_(e){Ob(e,0)}function Cc(e){var t=Fi(e);if(Uv(t))return e}function r_(e,t){if(e==="change")return t}var bb=!1;if(Yr){var qu;if(Yr){var Hu="oninput"in document;if(!Hu){var Tg=document.createElement("div");Tg.setAttribute("oninput","return;"),Hu=typeof Tg.oninput=="function"}qu=Hu}else qu=!1;bb=qu&&(!document.documentMode||9<document.documentMode)}function Mg(){is&&(is.detachEvent("onpropertychange",jb),vs=is=null)}function jb(e){if(e.propertyName==="value"&&Cc(vs)){var t=[];vb(t,vs,e,$p(e)),eb(t_,t)}}function n_(e,t,r){e==="focusin"?(Mg(),is=t,vs=r,is.attachEvent("onpropertychange",jb)):e==="focusout"&&Mg()}function i_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Cc(vs)}function a_(e,t){if(e==="click")return Cc(t)}function s_(e,t){if(e==="input"||e==="change")return Cc(t)}function o_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gr=typeof Object.is=="function"?Object.is:o_;function bs(e,t){if(gr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!Ed.call(t,i)||!gr(e[i],t[i]))return!1}return!0}function Ig(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function $g(e,t){var r=Ig(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ig(r)}}function wb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sb(){for(var e=window,t=ul();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ul(e.document)}return t}function Hp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function l_(e){var t=Sb(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&wb(r.ownerDocument.documentElement,r)){if(n!==null&&Hp(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=$g(r,s);var o=$g(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var c_=Yr&&"documentMode"in document&&11>=document.documentMode,Ri=null,Zd=null,as=null,Xd=!1;function Lg(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Xd||Ri==null||Ri!==ul(n)||(n=Ri,"selectionStart"in n&&Hp(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),as&&bs(as,n)||(as=n,n=xl(Zd,"onSelect"),0<n.length&&(t=new Wp("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ri)))}function So(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Bi={animationend:So("Animation","AnimationEnd"),animationiteration:So("Animation","AnimationIteration"),animationstart:So("Animation","AnimationStart"),transitionend:So("Transition","TransitionEnd")},Ku={},Nb={};Yr&&(Nb=document.createElement("div").style,"AnimationEvent"in window||(delete Bi.animationend.animation,delete Bi.animationiteration.animation,delete Bi.animationstart.animation),"TransitionEvent"in window||delete Bi.transitionend.transition);function Ac(e){if(Ku[e])return Ku[e];if(!Bi[e])return e;var t=Bi[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Nb)return Ku[e]=t[r];return e}var kb=Ac("animationend"),Pb=Ac("animationiteration"),_b=Ac("animationstart"),Cb=Ac("transitionend"),Ab=new Map,zg="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Bn(e,t){Ab.set(e,t),ki(t,[e])}for(var Vu=0;Vu<zg.length;Vu++){var Yu=zg[Vu],u_=Yu.toLowerCase(),d_=Yu[0].toUpperCase()+Yu.slice(1);Bn(u_,"on"+d_)}Bn(kb,"onAnimationEnd");Bn(Pb,"onAnimationIteration");Bn(_b,"onAnimationStart");Bn("dblclick","onDoubleClick");Bn("focusin","onFocus");Bn("focusout","onBlur");Bn(Cb,"onTransitionEnd");aa("onMouseEnter",["mouseout","mouseover"]);aa("onMouseLeave",["mouseout","mouseover"]);aa("onPointerEnter",["pointerout","pointerover"]);aa("onPointerLeave",["pointerout","pointerover"]);ki("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ki("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ki("onBeforeInput",["compositionend","keypress","textInput","paste"]);ki("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ki("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ki("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ja="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(" "),f_=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ja));function Rg(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,uP(n,t,void 0,e),e.currentTarget=null}function Ob(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var s=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==s&&i.isPropagationStopped())break e;Rg(i,l,d),s=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==s&&i.isPropagationStopped())break e;Rg(i,l,d),s=c}}}if(fl)throw e=Kd,fl=!1,Kd=null,e}function ge(e,t){var r=t[rf];r===void 0&&(r=t[rf]=new Set);var n=e+"__bubble";r.has(n)||(Eb(t,e,2,!1),r.add(n))}function Gu(e,t,r){var n=0;t&&(n|=4),Eb(r,e,n,t)}var No="_reactListening"+Math.random().toString(36).slice(2);function js(e){if(!e[No]){e[No]=!0,zv.forEach(function(r){r!=="selectionchange"&&(f_.has(r)||Gu(r,!1,e),Gu(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[No]||(t[No]=!0,Gu("selectionchange",!1,t))}}function Eb(e,t,r,n){switch(hb(t)){case 1:var i=PP;break;case 4:i=_P;break;default:i=Bp}r=i.bind(null,t,r,e),i=void 0,!Hd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Zu(e,t,r,n,i){var s=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;l!==null;){if(o=ei(l),o===null)return;if(c=o.tag,c===5||c===6){n=s=o;continue e}l=l.parentNode}}n=n.return}eb(function(){var d=s,u=$p(r),f=[];e:{var p=Ab.get(e);if(p!==void 0){var m=Wp,x=e;switch(e){case"keypress":if(Jo(r)===0)break e;case"keydown":case"keyup":m=WP;break;case"focusin":x="focus",m=Uu;break;case"focusout":x="blur",m=Uu;break;case"beforeblur":case"afterblur":m=Uu;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=_g;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=OP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=HP;break;case kb:case Pb:case _b:m=TP;break;case Cb:m=VP;break;case"scroll":m=CP;break;case"wheel":m=GP;break;case"copy":case"cut":case"paste":m=IP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Ag}var g=(t&4)!==0,b=!g&&e==="scroll",v=g?p!==null?p+"Capture":null:p;g=[];for(var j=d,y;j!==null;){y=j;var w=y.stateNode;if(y.tag===5&&w!==null&&(y=w,v!==null&&(w=ms(j,v),w!=null&&g.push(ws(j,w,y)))),b)break;j=j.return}0<g.length&&(p=new m(p,x,null,r,u),f.push({event:p,listeners:g}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&r!==Ud&&(x=r.relatedTarget||r.fromElement)&&(ei(x)||x[Gr]))break e;if((m||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,m?(x=r.relatedTarget||r.toElement,m=d,x=x?ei(x):null,x!==null&&(b=Pi(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(m=null,x=d),m!==x)){if(g=_g,w="onMouseLeave",v="onMouseEnter",j="mouse",(e==="pointerout"||e==="pointerover")&&(g=Ag,w="onPointerLeave",v="onPointerEnter",j="pointer"),b=m==null?p:Fi(m),y=x==null?p:Fi(x),p=new g(w,j+"leave",m,r,u),p.target=b,p.relatedTarget=y,w=null,ei(u)===d&&(g=new g(v,j+"enter",x,r,u),g.target=y,g.relatedTarget=b,w=g),b=w,m&&x)t:{for(g=m,v=x,j=0,y=g;y;y=Ei(y))j++;for(y=0,w=v;w;w=Ei(w))y++;for(;0<j-y;)g=Ei(g),j--;for(;0<y-j;)v=Ei(v),y--;for(;j--;){if(g===v||v!==null&&g===v.alternate)break t;g=Ei(g),v=Ei(v)}g=null}else g=null;m!==null&&Bg(f,p,m,g,!1),x!==null&&b!==null&&Bg(f,b,x,g,!0)}}e:{if(p=d?Fi(d):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var S=r_;else if(Dg(p))if(bb)S=s_;else{S=i_;var N=n_}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=a_);if(S&&(S=S(e,d))){vb(f,S,r,u);break e}N&&N(e,p,d),e==="focusout"&&(N=p._wrapperState)&&N.controlled&&p.type==="number"&&zd(p,"number",p.value)}switch(N=d?Fi(d):window,e){case"focusin":(Dg(N)||N.contentEditable==="true")&&(Ri=N,Zd=d,as=null);break;case"focusout":as=Zd=Ri=null;break;case"mousedown":Xd=!0;break;case"contextmenu":case"mouseup":case"dragend":Xd=!1,Lg(f,r,u);break;case"selectionchange":if(c_)break;case"keydown":case"keyup":Lg(f,r,u)}var P;if(qp)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else zi?xb(e,r)&&(_="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(_="onCompositionStart");_&&(gb&&r.locale!=="ko"&&(zi||_!=="onCompositionStart"?_==="onCompositionEnd"&&zi&&(P=mb()):(wn=u,Fp="value"in wn?wn.value:wn.textContent,zi=!0)),N=xl(d,_),0<N.length&&(_=new Cg(_,e,null,r,u),f.push({event:_,listeners:N}),P?_.data=P:(P=yb(r),P!==null&&(_.data=P)))),(P=XP?JP(e,r):QP(e,r))&&(d=xl(d,"onBeforeInput"),0<d.length&&(u=new Cg("onBeforeInput","beforeinput",null,r,u),f.push({event:u,listeners:d}),u.data=P))}Ob(f,t)})}function ws(e,t,r){return{instance:e,listener:t,currentTarget:r}}function xl(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=ms(e,r),s!=null&&n.unshift(ws(e,s,i)),s=ms(e,t),s!=null&&n.push(ws(e,s,i))),e=e.return}return n}function Ei(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Bg(e,t,r,n,i){for(var s=t._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,d=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&d!==null&&(l=d,i?(c=ms(r,s),c!=null&&o.unshift(ws(r,c,l))):i||(c=ms(r,s),c!=null&&o.push(ws(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var p_=/\r\n?/g,h_=/\u0000|\uFFFD/g;function Fg(e){return(typeof e=="string"?e:""+e).replace(p_,`
`).replace(h_,"")}function ko(e,t,r){if(t=Fg(t),Fg(e)!==t&&r)throw Error(F(425))}function yl(){}var Jd=null,Qd=null;function ef(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tf=typeof setTimeout=="function"?setTimeout:void 0,m_=typeof clearTimeout=="function"?clearTimeout:void 0,Wg=typeof Promise=="function"?Promise:void 0,g_=typeof queueMicrotask=="function"?queueMicrotask:typeof Wg<"u"?function(e){return Wg.resolve(null).then(e).catch(x_)}:tf;function x_(e){setTimeout(function(){throw e})}function Xu(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),ys(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);ys(t)}function Cn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Ug(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var ja=Math.random().toString(36).slice(2),Sr="__reactFiber$"+ja,Ss="__reactProps$"+ja,Gr="__reactContainer$"+ja,rf="__reactEvents$"+ja,y_="__reactListeners$"+ja,v_="__reactHandles$"+ja;function ei(e){var t=e[Sr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Gr]||r[Sr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ug(e);e!==null;){if(r=e[Sr])return r;e=Ug(e)}return t}e=r,r=e.parentNode}return null}function Gs(e){return e=e[Sr]||e[Gr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function Oc(e){return e[Ss]||null}var nf=[],Wi=-1;function Fn(e){return{current:e}}function ye(e){0>Wi||(e.current=nf[Wi],nf[Wi]=null,Wi--)}function me(e,t){Wi++,nf[Wi]=e.current,e.current=t}var $n={},ct=Fn($n),kt=Fn(!1),pi=$n;function sa(e,t){var r=e.type.contextTypes;if(!r)return $n;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Pt(e){return e=e.childContextTypes,e!=null}function vl(){ye(kt),ye(ct)}function qg(e,t,r){if(ct.current!==$n)throw Error(F(168));me(ct,t),me(kt,r)}function Db(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(F(108,nP(e)||"Unknown",i));return ke({},r,n)}function bl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$n,pi=ct.current,me(ct,e),me(kt,kt.current),!0}function Hg(e,t,r){var n=e.stateNode;if(!n)throw Error(F(169));r?(e=Db(e,t,pi),n.__reactInternalMemoizedMergedChildContext=e,ye(kt),ye(ct),me(ct,e)):ye(kt),me(kt,r)}var Lr=null,Ec=!1,Ju=!1;function Tb(e){Lr===null?Lr=[e]:Lr.push(e)}function b_(e){Ec=!0,Tb(e)}function Wn(){if(!Ju&&Lr!==null){Ju=!0;var e=0,t=le;try{var r=Lr;for(le=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Lr=null,Ec=!1}catch(i){throw Lr!==null&&(Lr=Lr.slice(e+1)),ib(Lp,Wn),i}finally{le=t,Ju=!1}}return null}var Ui=[],qi=0,jl=null,wl=0,Yt=[],Gt=0,hi=null,Br=1,Fr="";function Gn(e,t){Ui[qi++]=wl,Ui[qi++]=jl,jl=e,wl=t}function Mb(e,t,r){Yt[Gt++]=Br,Yt[Gt++]=Fr,Yt[Gt++]=hi,hi=e;var n=Br;e=Fr;var i=32-hr(n)-1;n&=~(1<<i),r+=1;var s=32-hr(t)+i;if(30<s){var o=i-i%5;s=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Br=1<<32-hr(t)+i|r<<i|n,Fr=s+e}else Br=1<<s|r<<i|n,Fr=e}function Kp(e){e.return!==null&&(Gn(e,1),Mb(e,1,0))}function Vp(e){for(;e===jl;)jl=Ui[--qi],Ui[qi]=null,wl=Ui[--qi],Ui[qi]=null;for(;e===hi;)hi=Yt[--Gt],Yt[Gt]=null,Fr=Yt[--Gt],Yt[Gt]=null,Br=Yt[--Gt],Yt[Gt]=null}var Rt=null,zt=null,be=!1,dr=null;function Ib(e,t){var r=Zt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Kg(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Rt=e,zt=Cn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Rt=e,zt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=hi!==null?{id:Br,overflow:Fr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Zt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Rt=e,zt=null,!0):!1;default:return!1}}function af(e){return(e.mode&1)!==0&&(e.flags&128)===0}function sf(e){if(be){var t=zt;if(t){var r=t;if(!Kg(e,t)){if(af(e))throw Error(F(418));t=Cn(r.nextSibling);var n=Rt;t&&Kg(e,t)?Ib(n,r):(e.flags=e.flags&-4097|2,be=!1,Rt=e)}}else{if(af(e))throw Error(F(418));e.flags=e.flags&-4097|2,be=!1,Rt=e}}}function Vg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Rt=e}function Po(e){if(e!==Rt)return!1;if(!be)return Vg(e),be=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ef(e.type,e.memoizedProps)),t&&(t=zt)){if(af(e))throw $b(),Error(F(418));for(;t;)Ib(e,t),t=Cn(t.nextSibling)}if(Vg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){zt=Cn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}zt=null}}else zt=Rt?Cn(e.stateNode.nextSibling):null;return!0}function $b(){for(var e=zt;e;)e=Cn(e.nextSibling)}function oa(){zt=Rt=null,be=!1}function Yp(e){dr===null?dr=[e]:dr.push(e)}var j_=sn.ReactCurrentBatchConfig;function Ra(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(F(309));var n=r.stateNode}if(!n)throw Error(F(147,e));var i=n,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var l=i.refs;o===null?delete l[s]:l[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(F(284));if(!r._owner)throw Error(F(290,e))}return e}function _o(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Yg(e){var t=e._init;return t(e._payload)}function Lb(e){function t(v,j){if(e){var y=v.deletions;y===null?(v.deletions=[j],v.flags|=16):y.push(j)}}function r(v,j){if(!e)return null;for(;j!==null;)t(v,j),j=j.sibling;return null}function n(v,j){for(v=new Map;j!==null;)j.key!==null?v.set(j.key,j):v.set(j.index,j),j=j.sibling;return v}function i(v,j){return v=Dn(v,j),v.index=0,v.sibling=null,v}function s(v,j,y){return v.index=y,e?(y=v.alternate,y!==null?(y=y.index,y<j?(v.flags|=2,j):y):(v.flags|=2,j)):(v.flags|=1048576,j)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,j,y,w){return j===null||j.tag!==6?(j=ad(y,v.mode,w),j.return=v,j):(j=i(j,y),j.return=v,j)}function c(v,j,y,w){var S=y.type;return S===Li?u(v,j,y.props.children,w,y.key):j!==null&&(j.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===mn&&Yg(S)===j.type)?(w=i(j,y.props),w.ref=Ra(v,j,y),w.return=v,w):(w=al(y.type,y.key,y.props,null,v.mode,w),w.ref=Ra(v,j,y),w.return=v,w)}function d(v,j,y,w){return j===null||j.tag!==4||j.stateNode.containerInfo!==y.containerInfo||j.stateNode.implementation!==y.implementation?(j=sd(y,v.mode,w),j.return=v,j):(j=i(j,y.children||[]),j.return=v,j)}function u(v,j,y,w,S){return j===null||j.tag!==7?(j=oi(y,v.mode,w,S),j.return=v,j):(j=i(j,y),j.return=v,j)}function f(v,j,y){if(typeof j=="string"&&j!==""||typeof j=="number")return j=ad(""+j,v.mode,y),j.return=v,j;if(typeof j=="object"&&j!==null){switch(j.$$typeof){case go:return y=al(j.type,j.key,j.props,null,v.mode,y),y.ref=Ra(v,null,j),y.return=v,y;case $i:return j=sd(j,v.mode,y),j.return=v,j;case mn:var w=j._init;return f(v,w(j._payload),y)}if(Za(j)||Ma(j))return j=oi(j,v.mode,y,null),j.return=v,j;_o(v,j)}return null}function p(v,j,y,w){var S=j!==null?j.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return S!==null?null:l(v,j,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case go:return y.key===S?c(v,j,y,w):null;case $i:return y.key===S?d(v,j,y,w):null;case mn:return S=y._init,p(v,j,S(y._payload),w)}if(Za(y)||Ma(y))return S!==null?null:u(v,j,y,w,null);_o(v,y)}return null}function m(v,j,y,w,S){if(typeof w=="string"&&w!==""||typeof w=="number")return v=v.get(y)||null,l(j,v,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case go:return v=v.get(w.key===null?y:w.key)||null,c(j,v,w,S);case $i:return v=v.get(w.key===null?y:w.key)||null,d(j,v,w,S);case mn:var N=w._init;return m(v,j,y,N(w._payload),S)}if(Za(w)||Ma(w))return v=v.get(y)||null,u(j,v,w,S,null);_o(j,w)}return null}function x(v,j,y,w){for(var S=null,N=null,P=j,_=j=0,T=null;P!==null&&_<y.length;_++){P.index>_?(T=P,P=null):T=P.sibling;var $=p(v,P,y[_],w);if($===null){P===null&&(P=T);break}e&&P&&$.alternate===null&&t(v,P),j=s($,j,_),N===null?S=$:N.sibling=$,N=$,P=T}if(_===y.length)return r(v,P),be&&Gn(v,_),S;if(P===null){for(;_<y.length;_++)P=f(v,y[_],w),P!==null&&(j=s(P,j,_),N===null?S=P:N.sibling=P,N=P);return be&&Gn(v,_),S}for(P=n(v,P);_<y.length;_++)T=m(P,v,_,y[_],w),T!==null&&(e&&T.alternate!==null&&P.delete(T.key===null?_:T.key),j=s(T,j,_),N===null?S=T:N.sibling=T,N=T);return e&&P.forEach(function(M){return t(v,M)}),be&&Gn(v,_),S}function g(v,j,y,w){var S=Ma(y);if(typeof S!="function")throw Error(F(150));if(y=S.call(y),y==null)throw Error(F(151));for(var N=S=null,P=j,_=j=0,T=null,$=y.next();P!==null&&!$.done;_++,$=y.next()){P.index>_?(T=P,P=null):T=P.sibling;var M=p(v,P,$.value,w);if(M===null){P===null&&(P=T);break}e&&P&&M.alternate===null&&t(v,P),j=s(M,j,_),N===null?S=M:N.sibling=M,N=M,P=T}if($.done)return r(v,P),be&&Gn(v,_),S;if(P===null){for(;!$.done;_++,$=y.next())$=f(v,$.value,w),$!==null&&(j=s($,j,_),N===null?S=$:N.sibling=$,N=$);return be&&Gn(v,_),S}for(P=n(v,P);!$.done;_++,$=y.next())$=m(P,v,_,$.value,w),$!==null&&(e&&$.alternate!==null&&P.delete($.key===null?_:$.key),j=s($,j,_),N===null?S=$:N.sibling=$,N=$);return e&&P.forEach(function(C){return t(v,C)}),be&&Gn(v,_),S}function b(v,j,y,w){if(typeof y=="object"&&y!==null&&y.type===Li&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case go:e:{for(var S=y.key,N=j;N!==null;){if(N.key===S){if(S=y.type,S===Li){if(N.tag===7){r(v,N.sibling),j=i(N,y.props.children),j.return=v,v=j;break e}}else if(N.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===mn&&Yg(S)===N.type){r(v,N.sibling),j=i(N,y.props),j.ref=Ra(v,N,y),j.return=v,v=j;break e}r(v,N);break}else t(v,N);N=N.sibling}y.type===Li?(j=oi(y.props.children,v.mode,w,y.key),j.return=v,v=j):(w=al(y.type,y.key,y.props,null,v.mode,w),w.ref=Ra(v,j,y),w.return=v,v=w)}return o(v);case $i:e:{for(N=y.key;j!==null;){if(j.key===N)if(j.tag===4&&j.stateNode.containerInfo===y.containerInfo&&j.stateNode.implementation===y.implementation){r(v,j.sibling),j=i(j,y.children||[]),j.return=v,v=j;break e}else{r(v,j);break}else t(v,j);j=j.sibling}j=sd(y,v.mode,w),j.return=v,v=j}return o(v);case mn:return N=y._init,b(v,j,N(y._payload),w)}if(Za(y))return x(v,j,y,w);if(Ma(y))return g(v,j,y,w);_o(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,j!==null&&j.tag===6?(r(v,j.sibling),j=i(j,y),j.return=v,v=j):(r(v,j),j=ad(y,v.mode,w),j.return=v,v=j),o(v)):r(v,j)}return b}var la=Lb(!0),zb=Lb(!1),Sl=Fn(null),Nl=null,Hi=null,Gp=null;function Zp(){Gp=Hi=Nl=null}function Xp(e){var t=Sl.current;ye(Sl),e._currentValue=t}function of(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ta(e,t){Nl=e,Gp=Hi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(St=!0),e.firstContext=null)}function tr(e){var t=e._currentValue;if(Gp!==e)if(e={context:e,memoizedValue:t,next:null},Hi===null){if(Nl===null)throw Error(F(308));Hi=e,Nl.dependencies={lanes:0,firstContext:e}}else Hi=Hi.next=e;return t}var ti=null;function Jp(e){ti===null?ti=[e]:ti.push(e)}function Rb(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Jp(t)):(r.next=i.next,i.next=r),t.interleaved=r,Zr(e,n)}function Zr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var gn=!1;function Qp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Bb(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function qr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function An(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ae&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Zr(e,r)}return i=n.interleaved,i===null?(t.next=t,Jp(n)):(t.next=i.next,i.next=t),n.interleaved=t,Zr(e,r)}function Qo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,zp(e,r)}}function Gg(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=t:s=s.next=t}else i=s=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function kl(e,t,r,n){var i=e.updateQueue;gn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?s=d:o.next=d,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(s!==null){var f=i.baseState;o=0,u=d=c=null,l=s;do{var p=l.lane,m=l.eventTime;if((n&p)===p){u!==null&&(u=u.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,g=l;switch(p=t,m=r,g.tag){case 1:if(x=g.payload,typeof x=="function"){f=x.call(m,f,p);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,p=typeof x=="function"?x.call(m,f,p):x,p==null)break e;f=ke({},f,p);break e;case 2:gn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[l]:p.push(l))}else m={eventTime:m,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=m,c=f):u=u.next=m,o|=p;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;p=l,l=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(u===null&&(c=f),i.baseState=c,i.firstBaseUpdate=d,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);gi|=o,e.lanes=o,e.memoizedState=f}}function Zg(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(F(191,i));i.call(n)}}}var Zs={},Pr=Fn(Zs),Ns=Fn(Zs),ks=Fn(Zs);function ri(e){if(e===Zs)throw Error(F(174));return e}function eh(e,t){switch(me(ks,t),me(Ns,e),me(Pr,Zs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Bd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Bd(t,e)}ye(Pr),me(Pr,t)}function ca(){ye(Pr),ye(Ns),ye(ks)}function Fb(e){ri(ks.current);var t=ri(Pr.current),r=Bd(t,e.type);t!==r&&(me(Ns,e),me(Pr,r))}function th(e){Ns.current===e&&(ye(Pr),ye(Ns))}var Se=Fn(0);function Pl(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Qu=[];function rh(){for(var e=0;e<Qu.length;e++)Qu[e]._workInProgressVersionPrimary=null;Qu.length=0}var el=sn.ReactCurrentDispatcher,ed=sn.ReactCurrentBatchConfig,mi=0,Ne=null,Ie=null,He=null,_l=!1,ss=!1,Ps=0,w_=0;function nt(){throw Error(F(321))}function nh(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!gr(e[r],t[r]))return!1;return!0}function ih(e,t,r,n,i,s){if(mi=s,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,el.current=e===null||e.memoizedState===null?P_:__,e=r(n,i),ss){s=0;do{if(ss=!1,Ps=0,25<=s)throw Error(F(301));s+=1,He=Ie=null,t.updateQueue=null,el.current=C_,e=r(n,i)}while(ss)}if(el.current=Cl,t=Ie!==null&&Ie.next!==null,mi=0,He=Ie=Ne=null,_l=!1,t)throw Error(F(300));return e}function ah(){var e=Ps!==0;return Ps=0,e}function jr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return He===null?Ne.memoizedState=He=e:He=He.next=e,He}function rr(){if(Ie===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=Ie.next;var t=He===null?Ne.memoizedState:He.next;if(t!==null)He=t,Ie=e;else{if(e===null)throw Error(F(310));Ie=e,e={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},He===null?Ne.memoizedState=He=e:He=He.next=e}return He}function _s(e,t){return typeof t=="function"?t(e):t}function td(e){var t=rr(),r=t.queue;if(r===null)throw Error(F(311));r.lastRenderedReducer=e;var n=Ie,i=n.baseQueue,s=r.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}n.baseQueue=i=s,r.pending=null}if(i!==null){s=i.next,n=n.baseState;var l=o=null,c=null,d=s;do{var u=d.lane;if((mi&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),n=d.hasEagerState?d.eagerState:e(n,d.action);else{var f={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=f,o=n):c=c.next=f,Ne.lanes|=u,gi|=u}d=d.next}while(d!==null&&d!==s);c===null?o=n:c.next=l,gr(n,t.memoizedState)||(St=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do s=i.lane,Ne.lanes|=s,gi|=s,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function rd(e){var t=rr(),r=t.queue;if(r===null)throw Error(F(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,s=t.memoizedState;if(i!==null){r.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);gr(s,t.memoizedState)||(St=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),r.lastRenderedState=s}return[s,n]}function Wb(){}function Ub(e,t){var r=Ne,n=rr(),i=t(),s=!gr(n.memoizedState,i);if(s&&(n.memoizedState=i,St=!0),n=n.queue,sh(Kb.bind(null,r,n,e),[e]),n.getSnapshot!==t||s||He!==null&&He.memoizedState.tag&1){if(r.flags|=2048,Cs(9,Hb.bind(null,r,n,i,t),void 0,null),Ke===null)throw Error(F(349));mi&30||qb(r,t,i)}return i}function qb(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Hb(e,t,r,n){t.value=r,t.getSnapshot=n,Vb(t)&&Yb(e)}function Kb(e,t,r){return r(function(){Vb(t)&&Yb(e)})}function Vb(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!gr(e,r)}catch{return!0}}function Yb(e){var t=Zr(e,1);t!==null&&mr(t,e,1,-1)}function Xg(e){var t=jr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:e},t.queue=e,e=e.dispatch=k_.bind(null,Ne,e),[t.memoizedState,e]}function Cs(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Ne.updateQueue,t===null?(t={lastEffect:null,stores:null},Ne.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function Gb(){return rr().memoizedState}function tl(e,t,r,n){var i=jr();Ne.flags|=e,i.memoizedState=Cs(1|t,r,void 0,n===void 0?null:n)}function Dc(e,t,r,n){var i=rr();n=n===void 0?null:n;var s=void 0;if(Ie!==null){var o=Ie.memoizedState;if(s=o.destroy,n!==null&&nh(n,o.deps)){i.memoizedState=Cs(t,r,s,n);return}}Ne.flags|=e,i.memoizedState=Cs(1|t,r,s,n)}function Jg(e,t){return tl(8390656,8,e,t)}function sh(e,t){return Dc(2048,8,e,t)}function Zb(e,t){return Dc(4,2,e,t)}function Xb(e,t){return Dc(4,4,e,t)}function Jb(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Qb(e,t,r){return r=r!=null?r.concat([e]):null,Dc(4,4,Jb.bind(null,t,e),r)}function oh(){}function e1(e,t){var r=rr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&nh(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function t1(e,t){var r=rr();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&nh(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function r1(e,t,r){return mi&21?(gr(r,t)||(r=ob(),Ne.lanes|=r,gi|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,St=!0),e.memoizedState=r)}function S_(e,t){var r=le;le=r!==0&&4>r?r:4,e(!0);var n=ed.transition;ed.transition={};try{e(!1),t()}finally{le=r,ed.transition=n}}function n1(){return rr().memoizedState}function N_(e,t,r){var n=En(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},i1(e))a1(t,r);else if(r=Rb(e,t,r,n),r!==null){var i=gt();mr(r,e,n,i),s1(r,t,n)}}function k_(e,t,r){var n=En(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(i1(e))a1(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,l=s(o,r);if(i.hasEagerState=!0,i.eagerState=l,gr(l,o)){var c=t.interleaved;c===null?(i.next=i,Jp(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}r=Rb(e,t,i,n),r!==null&&(i=gt(),mr(r,e,n,i),s1(r,t,n))}}function i1(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function a1(e,t){ss=_l=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function s1(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,zp(e,r)}}var Cl={readContext:tr,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useInsertionEffect:nt,useLayoutEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useMutableSource:nt,useSyncExternalStore:nt,useId:nt,unstable_isNewReconciler:!1},P_={readContext:tr,useCallback:function(e,t){return jr().memoizedState=[e,t===void 0?null:t],e},useContext:tr,useEffect:Jg,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,tl(4194308,4,Jb.bind(null,t,e),r)},useLayoutEffect:function(e,t){return tl(4194308,4,e,t)},useInsertionEffect:function(e,t){return tl(4,2,e,t)},useMemo:function(e,t){var r=jr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=jr();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=N_.bind(null,Ne,e),[n.memoizedState,e]},useRef:function(e){var t=jr();return e={current:e},t.memoizedState=e},useState:Xg,useDebugValue:oh,useDeferredValue:function(e){return jr().memoizedState=e},useTransition:function(){var e=Xg(!1),t=e[0];return e=S_.bind(null,e[1]),jr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ne,i=jr();if(be){if(r===void 0)throw Error(F(407));r=r()}else{if(r=t(),Ke===null)throw Error(F(349));mi&30||qb(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,Jg(Kb.bind(null,n,s,e),[e]),n.flags|=2048,Cs(9,Hb.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=jr(),t=Ke.identifierPrefix;if(be){var r=Fr,n=Br;r=(n&~(1<<32-hr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ps++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=w_++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},__={readContext:tr,useCallback:e1,useContext:tr,useEffect:sh,useImperativeHandle:Qb,useInsertionEffect:Zb,useLayoutEffect:Xb,useMemo:t1,useReducer:td,useRef:Gb,useState:function(){return td(_s)},useDebugValue:oh,useDeferredValue:function(e){var t=rr();return r1(t,Ie.memoizedState,e)},useTransition:function(){var e=td(_s)[0],t=rr().memoizedState;return[e,t]},useMutableSource:Wb,useSyncExternalStore:Ub,useId:n1,unstable_isNewReconciler:!1},C_={readContext:tr,useCallback:e1,useContext:tr,useEffect:sh,useImperativeHandle:Qb,useInsertionEffect:Zb,useLayoutEffect:Xb,useMemo:t1,useReducer:rd,useRef:Gb,useState:function(){return rd(_s)},useDebugValue:oh,useDeferredValue:function(e){var t=rr();return Ie===null?t.memoizedState=e:r1(t,Ie.memoizedState,e)},useTransition:function(){var e=rd(_s)[0],t=rr().memoizedState;return[e,t]},useMutableSource:Wb,useSyncExternalStore:Ub,useId:n1,unstable_isNewReconciler:!1};function cr(e,t){if(e&&e.defaultProps){t=ke({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function lf(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ke({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Tc={isMounted:function(e){return(e=e._reactInternals)?Pi(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=gt(),i=En(e),s=qr(n,i);s.payload=t,r!=null&&(s.callback=r),t=An(e,s,i),t!==null&&(mr(t,e,i,n),Qo(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=gt(),i=En(e),s=qr(n,i);s.tag=1,s.payload=t,r!=null&&(s.callback=r),t=An(e,s,i),t!==null&&(mr(t,e,i,n),Qo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=gt(),n=En(e),i=qr(r,n);i.tag=2,t!=null&&(i.callback=t),t=An(e,i,n),t!==null&&(mr(t,e,n,r),Qo(t,e,n))}};function Qg(e,t,r,n,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,o):t.prototype&&t.prototype.isPureReactComponent?!bs(r,n)||!bs(i,s):!0}function o1(e,t,r){var n=!1,i=$n,s=t.contextType;return typeof s=="object"&&s!==null?s=tr(s):(i=Pt(t)?pi:ct.current,n=t.contextTypes,s=(n=n!=null)?sa(e,i):$n),t=new t(r,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Tc,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function ex(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Tc.enqueueReplaceState(t,t.state,null)}function cf(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},Qp(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=tr(s):(s=Pt(t)?pi:ct.current,i.context=sa(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(lf(e,t,s,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Tc.enqueueReplaceState(i,i.state,null),kl(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function ua(e,t){try{var r="",n=t;do r+=rP(n),n=n.return;while(n);var i=r}catch(s){i=`
Error generating stack: `+s.message+`
`+s.stack}return{value:e,source:t,stack:i,digest:null}}function nd(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function uf(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var A_=typeof WeakMap=="function"?WeakMap:Map;function l1(e,t,r){r=qr(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Ol||(Ol=!0,bf=n),uf(e,t)},r}function c1(e,t,r){r=qr(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){uf(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(r.callback=function(){uf(e,t),typeof n!="function"&&(On===null?On=new Set([this]):On.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function tx(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new A_;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=U_.bind(null,e,t,r),t.then(e,e))}function rx(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function nx(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=qr(-1,1),t.tag=2,An(r,t,1))),r.lanes|=1),e)}var O_=sn.ReactCurrentOwner,St=!1;function ht(e,t,r,n){t.child=e===null?zb(t,null,r,n):la(t,e.child,r,n)}function ix(e,t,r,n,i){r=r.render;var s=t.ref;return ta(t,i),n=ih(e,t,r,n,s,i),r=ah(),e!==null&&!St?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Xr(e,t,i)):(be&&r&&Kp(t),t.flags|=1,ht(e,t,n,i),t.child)}function ax(e,t,r,n,i){if(e===null){var s=r.type;return typeof s=="function"&&!mh(s)&&s.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=s,u1(e,t,s,n,i)):(e=al(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(r=r.compare,r=r!==null?r:bs,r(o,n)&&e.ref===t.ref)return Xr(e,t,i)}return t.flags|=1,e=Dn(s,n),e.ref=t.ref,e.return=t,t.child=e}function u1(e,t,r,n,i){if(e!==null){var s=e.memoizedProps;if(bs(s,n)&&e.ref===t.ref)if(St=!1,t.pendingProps=n=s,(e.lanes&i)!==0)e.flags&131072&&(St=!0);else return t.lanes=e.lanes,Xr(e,t,i)}return df(e,t,r,n,i)}function d1(e,t,r){var n=t.pendingProps,i=n.children,s=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(Vi,It),It|=r;else{if(!(r&1073741824))return e=s!==null?s.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,me(Vi,It),It|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=s!==null?s.baseLanes:r,me(Vi,It),It|=n}else s!==null?(n=s.baseLanes|r,t.memoizedState=null):n=r,me(Vi,It),It|=n;return ht(e,t,i,r),t.child}function f1(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function df(e,t,r,n,i){var s=Pt(r)?pi:ct.current;return s=sa(t,s),ta(t,i),r=ih(e,t,r,n,s,i),n=ah(),e!==null&&!St?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Xr(e,t,i)):(be&&n&&Kp(t),t.flags|=1,ht(e,t,r,i),t.child)}function sx(e,t,r,n,i){if(Pt(r)){var s=!0;bl(t)}else s=!1;if(ta(t,i),t.stateNode===null)rl(e,t),o1(t,r,n),cf(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,d=r.contextType;typeof d=="object"&&d!==null?d=tr(d):(d=Pt(r)?pi:ct.current,d=sa(t,d));var u=r.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==d)&&ex(t,o,n,d),gn=!1;var p=t.memoizedState;o.state=p,kl(t,n,o,i),c=t.memoizedState,l!==n||p!==c||kt.current||gn?(typeof u=="function"&&(lf(t,r,u,n),c=t.memoizedState),(l=gn||Qg(t,r,l,n,p,c,d))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),o.props=n,o.state=c,o.context=d,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,Bb(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:cr(t.type,l),o.props=d,f=t.pendingProps,p=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=tr(c):(c=Pt(r)?pi:ct.current,c=sa(t,c));var m=r.getDerivedStateFromProps;(u=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||p!==c)&&ex(t,o,n,c),gn=!1,p=t.memoizedState,o.state=p,kl(t,n,o,i);var x=t.memoizedState;l!==f||p!==x||kt.current||gn?(typeof m=="function"&&(lf(t,r,m,n),x=t.memoizedState),(d=gn||Qg(t,r,d,n,p,x,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,x,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,x,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=x),o.props=n,o.state=x,o.context=c,n=d):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),n=!1)}return ff(e,t,r,n,s,i)}function ff(e,t,r,n,i,s){f1(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&Hg(t,r,!1),Xr(e,t,s);n=t.stateNode,O_.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=la(t,e.child,null,s),t.child=la(t,null,l,s)):ht(e,t,l,s),t.memoizedState=n.state,i&&Hg(t,r,!0),t.child}function p1(e){var t=e.stateNode;t.pendingContext?qg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&qg(e,t.context,!1),eh(e,t.containerInfo)}function ox(e,t,r,n,i){return oa(),Yp(i),t.flags|=256,ht(e,t,r,n),t.child}var pf={dehydrated:null,treeContext:null,retryLane:0};function hf(e){return{baseLanes:e,cachePool:null,transitions:null}}function h1(e,t,r){var n=t.pendingProps,i=Se.current,s=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(i&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),me(Se,i&1),e===null)return sf(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,s?(n=t.mode,s=t.child,o={mode:"hidden",children:o},!(n&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=$c(o,n,0,null),e=oi(e,n,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=hf(r),t.memoizedState=pf,e):lh(t,o));if(i=e.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return E_(e,t,o,n,l,i,r);if(s){s=n.fallback,o=t.mode,i=e.child,l=i.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Dn(i,c),n.subtreeFlags=i.subtreeFlags&14680064),l!==null?s=Dn(l,s):(s=oi(s,o,r,null),s.flags|=2),s.return=t,n.return=t,n.sibling=s,t.child=n,n=s,s=t.child,o=e.child.memoizedState,o=o===null?hf(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~r,t.memoizedState=pf,n}return s=e.child,e=s.sibling,n=Dn(s,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function lh(e,t){return t=$c({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Co(e,t,r,n){return n!==null&&Yp(n),la(t,e.child,null,r),e=lh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function E_(e,t,r,n,i,s,o){if(r)return t.flags&256?(t.flags&=-257,n=nd(Error(F(422))),Co(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=n.fallback,i=t.mode,n=$c({mode:"visible",children:n.children},i,0,null),s=oi(s,i,o,null),s.flags|=2,n.return=t,s.return=t,n.sibling=s,t.child=n,t.mode&1&&la(t,e.child,null,o),t.child.memoizedState=hf(o),t.memoizedState=pf,s);if(!(t.mode&1))return Co(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var l=n.dgst;return n=l,s=Error(F(419)),n=nd(s,n,void 0),Co(e,t,o,n)}if(l=(o&e.childLanes)!==0,St||l){if(n=Ke,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Zr(e,i),mr(n,e,i,-1))}return hh(),n=nd(Error(F(421))),Co(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=q_.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,zt=Cn(i.nextSibling),Rt=t,be=!0,dr=null,e!==null&&(Yt[Gt++]=Br,Yt[Gt++]=Fr,Yt[Gt++]=hi,Br=e.id,Fr=e.overflow,hi=t),t=lh(t,n.children),t.flags|=4096,t)}function lx(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),of(e.return,t,r)}function id(e,t,r,n,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=n,s.tail=r,s.tailMode=i)}function m1(e,t,r){var n=t.pendingProps,i=n.revealOrder,s=n.tail;if(ht(e,t,n.children,r),n=Se.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&lx(e,r,t);else if(e.tag===19)lx(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(me(Se,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Pl(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),id(t,!1,i,r,s);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Pl(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}id(t,!0,r,null,s);break;case"together":id(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Xr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),gi|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,r=Dn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Dn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function D_(e,t,r){switch(t.tag){case 3:p1(t),oa();break;case 5:Fb(t);break;case 1:Pt(t.type)&&bl(t);break;case 4:eh(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;me(Sl,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(me(Se,Se.current&1),t.flags|=128,null):r&t.child.childLanes?h1(e,t,r):(me(Se,Se.current&1),e=Xr(e,t,r),e!==null?e.sibling:null);me(Se,Se.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return m1(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),me(Se,Se.current),n)break;return null;case 22:case 23:return t.lanes=0,d1(e,t,r)}return Xr(e,t,r)}var g1,mf,x1,y1;g1=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};mf=function(){};x1=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,ri(Pr.current);var s=null;switch(r){case"input":i=$d(e,i),n=$d(e,n),s=[];break;case"select":i=ke({},i,{value:void 0}),n=ke({},n,{value:void 0}),s=[];break;case"textarea":i=Rd(e,i),n=Rd(e,n),s=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=yl)}Fd(r,n);var o;r=null;for(d in i)if(!n.hasOwnProperty(d)&&i.hasOwnProperty(d)&&i[d]!=null)if(d==="style"){var l=i[d];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ps.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in n){var c=n[d];if(l=i!=null?i[d]:void 0,n.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(s||(s=[]),s.push(d,r)),r=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(s=s||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(ps.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&ge("scroll",e),s||l===c||(s=[])):(s=s||[]).push(d,c))}r&&(s=s||[]).push("style",r);var d=s;(t.updateQueue=d)&&(t.flags|=4)}};y1=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ba(e,t){if(!be)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function T_(e,t,r){var n=t.pendingProps;switch(Vp(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return Pt(t.type)&&vl(),it(t),null;case 3:return n=t.stateNode,ca(),ye(kt),ye(ct),rh(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Po(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,dr!==null&&(Sf(dr),dr=null))),mf(e,t),it(t),null;case 5:th(t);var i=ri(ks.current);if(r=t.type,e!==null&&t.stateNode!=null)x1(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(F(166));return it(t),null}if(e=ri(Pr.current),Po(t)){n=t.stateNode,r=t.type;var s=t.memoizedProps;switch(n[Sr]=t,n[Ss]=s,e=(t.mode&1)!==0,r){case"dialog":ge("cancel",n),ge("close",n);break;case"iframe":case"object":case"embed":ge("load",n);break;case"video":case"audio":for(i=0;i<Ja.length;i++)ge(Ja[i],n);break;case"source":ge("error",n);break;case"img":case"image":case"link":ge("error",n),ge("load",n);break;case"details":ge("toggle",n);break;case"input":xg(n,s),ge("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!s.multiple},ge("invalid",n);break;case"textarea":vg(n,s),ge("invalid",n)}Fd(r,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="children"?typeof l=="string"?n.textContent!==l&&(s.suppressHydrationWarning!==!0&&ko(n.textContent,l,e),i=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&ko(n.textContent,l,e),i=["children",""+l]):ps.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&ge("scroll",n)}switch(r){case"input":xo(n),yg(n,s,!0);break;case"textarea":xo(n),bg(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=yl)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Kv(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Sr]=t,e[Ss]=n,g1(e,t,!1,!1),t.stateNode=e;e:{switch(o=Wd(r,n),r){case"dialog":ge("cancel",e),ge("close",e),i=n;break;case"iframe":case"object":case"embed":ge("load",e),i=n;break;case"video":case"audio":for(i=0;i<Ja.length;i++)ge(Ja[i],e);i=n;break;case"source":ge("error",e),i=n;break;case"img":case"image":case"link":ge("error",e),ge("load",e),i=n;break;case"details":ge("toggle",e),i=n;break;case"input":xg(e,n),i=$d(e,n),ge("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=ke({},n,{value:void 0}),ge("invalid",e);break;case"textarea":vg(e,n),i=Rd(e,n),ge("invalid",e);break;default:i=n}Fd(r,i),l=i;for(s in l)if(l.hasOwnProperty(s)){var c=l[s];s==="style"?Gv(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Vv(e,c)):s==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&hs(e,c):typeof c=="number"&&hs(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(ps.hasOwnProperty(s)?c!=null&&s==="onScroll"&&ge("scroll",e):c!=null&&Dp(e,s,c,o))}switch(r){case"input":xo(e),yg(e,n,!1);break;case"textarea":xo(e),bg(e);break;case"option":n.value!=null&&e.setAttribute("value",""+In(n.value));break;case"select":e.multiple=!!n.multiple,s=n.value,s!=null?Xi(e,!!n.multiple,s,!1):n.defaultValue!=null&&Xi(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=yl)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return it(t),null;case 6:if(e&&t.stateNode!=null)y1(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(F(166));if(r=ri(ks.current),ri(Pr.current),Po(t)){if(n=t.stateNode,r=t.memoizedProps,n[Sr]=t,(s=n.nodeValue!==r)&&(e=Rt,e!==null))switch(e.tag){case 3:ko(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ko(n.nodeValue,r,(e.mode&1)!==0)}s&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Sr]=t,t.stateNode=n}return it(t),null;case 13:if(ye(Se),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(be&&zt!==null&&t.mode&1&&!(t.flags&128))$b(),oa(),t.flags|=98560,s=!1;else if(s=Po(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(F(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(F(317));s[Sr]=t}else oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;it(t),s=!1}else dr!==null&&(Sf(dr),dr=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||Se.current&1?ze===0&&(ze=3):hh())),t.updateQueue!==null&&(t.flags|=4),it(t),null);case 4:return ca(),mf(e,t),e===null&&js(t.stateNode.containerInfo),it(t),null;case 10:return Xp(t.type._context),it(t),null;case 17:return Pt(t.type)&&vl(),it(t),null;case 19:if(ye(Se),s=t.memoizedState,s===null)return it(t),null;if(n=(t.flags&128)!==0,o=s.rendering,o===null)if(n)Ba(s,!1);else{if(ze!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Pl(e),o!==null){for(t.flags|=128,Ba(s,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)s=r,e=n,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return me(Se,Se.current&1|2),t.child}e=e.sibling}s.tail!==null&&Ae()>da&&(t.flags|=128,n=!0,Ba(s,!1),t.lanes=4194304)}else{if(!n)if(e=Pl(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ba(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!be)return it(t),null}else 2*Ae()-s.renderingStartTime>da&&r!==1073741824&&(t.flags|=128,n=!0,Ba(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(r=s.last,r!==null?r.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ae(),t.sibling=null,r=Se.current,me(Se,n?r&1|2:r&1),t):(it(t),null);case 22:case 23:return ph(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?It&1073741824&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function M_(e,t){switch(Vp(t),t.tag){case 1:return Pt(t.type)&&vl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ca(),ye(kt),ye(ct),rh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return th(t),null;case 13:if(ye(Se),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ye(Se),null;case 4:return ca(),null;case 10:return Xp(t.type._context),null;case 22:case 23:return ph(),null;case 24:return null;default:return null}}var Ao=!1,st=!1,I_=typeof WeakSet=="function"?WeakSet:Set,K=null;function Ki(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Pe(e,t,n)}else r.current=null}function gf(e,t,r){try{r()}catch(n){Pe(e,t,n)}}var cx=!1;function $_(e,t){if(Jd=ml,e=Sb(),Hp(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,d=0,u=0,f=e,p=null;t:for(;;){for(var m;f!==r||i!==0&&f.nodeType!==3||(l=o+i),f!==s||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===r&&++d===i&&(l=o),p===s&&++u===n&&(c=o),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Qd={focusedElem:e,selectionRange:r},ml=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var g=x.memoizedProps,b=x.memoizedState,v=t.stateNode,j=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:cr(t.type,g),b);v.__reactInternalSnapshotBeforeUpdate=j}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(w){Pe(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return x=cx,cx=!1,x}function os(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&gf(t,r,s)}i=i.next}while(i!==n)}}function Mc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function xf(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function v1(e){var t=e.alternate;t!==null&&(e.alternate=null,v1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Sr],delete t[Ss],delete t[rf],delete t[y_],delete t[v_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function b1(e){return e.tag===5||e.tag===3||e.tag===4}function ux(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||b1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function yf(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=yl));else if(n!==4&&(e=e.child,e!==null))for(yf(e,t,r),e=e.sibling;e!==null;)yf(e,t,r),e=e.sibling}function vf(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(vf(e,t,r),e=e.sibling;e!==null;)vf(e,t,r),e=e.sibling}var Xe=null,ur=!1;function hn(e,t,r){for(r=r.child;r!==null;)j1(e,t,r),r=r.sibling}function j1(e,t,r){if(kr&&typeof kr.onCommitFiberUnmount=="function")try{kr.onCommitFiberUnmount(Pc,r)}catch{}switch(r.tag){case 5:st||Ki(r,t);case 6:var n=Xe,i=ur;Xe=null,hn(e,t,r),Xe=n,ur=i,Xe!==null&&(ur?(e=Xe,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Xe.removeChild(r.stateNode));break;case 18:Xe!==null&&(ur?(e=Xe,r=r.stateNode,e.nodeType===8?Xu(e.parentNode,r):e.nodeType===1&&Xu(e,r),ys(e)):Xu(Xe,r.stateNode));break;case 4:n=Xe,i=ur,Xe=r.stateNode.containerInfo,ur=!0,hn(e,t,r),Xe=n,ur=i;break;case 0:case 11:case 14:case 15:if(!st&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&gf(r,t,o),i=i.next}while(i!==n)}hn(e,t,r);break;case 1:if(!st&&(Ki(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Pe(r,t,l)}hn(e,t,r);break;case 21:hn(e,t,r);break;case 22:r.mode&1?(st=(n=st)||r.memoizedState!==null,hn(e,t,r),st=n):hn(e,t,r);break;default:hn(e,t,r)}}function dx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new I_),t.forEach(function(n){var i=H_.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function lr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var s=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Xe=l.stateNode,ur=!1;break e;case 3:Xe=l.stateNode.containerInfo,ur=!0;break e;case 4:Xe=l.stateNode.containerInfo,ur=!0;break e}l=l.return}if(Xe===null)throw Error(F(160));j1(s,o,i),Xe=null,ur=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(d){Pe(i,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)w1(t,e),t=t.sibling}function w1(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(lr(t,e),br(e),n&4){try{os(3,e,e.return),Mc(3,e)}catch(g){Pe(e,e.return,g)}try{os(5,e,e.return)}catch(g){Pe(e,e.return,g)}}break;case 1:lr(t,e),br(e),n&512&&r!==null&&Ki(r,r.return);break;case 5:if(lr(t,e),br(e),n&512&&r!==null&&Ki(r,r.return),e.flags&32){var i=e.stateNode;try{hs(i,"")}catch(g){Pe(e,e.return,g)}}if(n&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=r!==null?r.memoizedProps:s,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&qv(i,s),Wd(l,o);var d=Wd(l,s);for(o=0;o<c.length;o+=2){var u=c[o],f=c[o+1];u==="style"?Gv(i,f):u==="dangerouslySetInnerHTML"?Vv(i,f):u==="children"?hs(i,f):Dp(i,u,f,d)}switch(l){case"input":Ld(i,s);break;case"textarea":Hv(i,s);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var m=s.value;m!=null?Xi(i,!!s.multiple,m,!1):p!==!!s.multiple&&(s.defaultValue!=null?Xi(i,!!s.multiple,s.defaultValue,!0):Xi(i,!!s.multiple,s.multiple?[]:"",!1))}i[Ss]=s}catch(g){Pe(e,e.return,g)}}break;case 6:if(lr(t,e),br(e),n&4){if(e.stateNode===null)throw Error(F(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(g){Pe(e,e.return,g)}}break;case 3:if(lr(t,e),br(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ys(t.containerInfo)}catch(g){Pe(e,e.return,g)}break;case 4:lr(t,e),br(e);break;case 13:lr(t,e),br(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(dh=Ae())),n&4&&dx(e);break;case 22:if(u=r!==null&&r.memoizedState!==null,e.mode&1?(st=(d=st)||u,lr(t,e),st=d):lr(t,e),br(e),n&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(K=e,u=e.child;u!==null;){for(f=K=u;K!==null;){switch(p=K,m=p.child,p.tag){case 0:case 11:case 14:case 15:os(4,p,p.return);break;case 1:Ki(p,p.return);var x=p.stateNode;if(typeof x.componentWillUnmount=="function"){n=p,r=p.return;try{t=n,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(g){Pe(n,r,g)}}break;case 5:Ki(p,p.return);break;case 22:if(p.memoizedState!==null){px(f);continue}}m!==null?(m.return=p,K=m):px(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{i=f.stateNode,d?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Yv("display",o))}catch(g){Pe(e,e.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(g){Pe(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:lr(t,e),br(e),n&4&&dx(e);break;case 21:break;default:lr(t,e),br(e)}}function br(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(b1(r)){var n=r;break e}r=r.return}throw Error(F(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(hs(i,""),n.flags&=-33);var s=ux(e);vf(e,s,i);break;case 3:case 4:var o=n.stateNode.containerInfo,l=ux(e);yf(e,l,o);break;default:throw Error(F(161))}}catch(c){Pe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function L_(e,t,r){K=e,S1(e)}function S1(e,t,r){for(var n=(e.mode&1)!==0;K!==null;){var i=K,s=i.child;if(i.tag===22&&n){var o=i.memoizedState!==null||Ao;if(!o){var l=i.alternate,c=l!==null&&l.memoizedState!==null||st;l=Ao;var d=st;if(Ao=o,(st=c)&&!d)for(K=i;K!==null;)o=K,c=o.child,o.tag===22&&o.memoizedState!==null?hx(i):c!==null?(c.return=o,K=c):hx(i);for(;s!==null;)K=s,S1(s),s=s.sibling;K=i,Ao=l,st=d}fx(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,K=s):fx(e)}}function fx(e){for(;K!==null;){var t=K;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:st||Mc(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!st)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:cr(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Zg(t,s,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Zg(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&ys(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}st||t.flags&512&&xf(t)}catch(p){Pe(t,t.return,p)}}if(t===e){K=null;break}if(r=t.sibling,r!==null){r.return=t.return,K=r;break}K=t.return}}function px(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var r=t.sibling;if(r!==null){r.return=t.return,K=r;break}K=t.return}}function hx(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Mc(4,t)}catch(c){Pe(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(c){Pe(t,i,c)}}var s=t.return;try{xf(t)}catch(c){Pe(t,s,c)}break;case 5:var o=t.return;try{xf(t)}catch(c){Pe(t,o,c)}}}catch(c){Pe(t,t.return,c)}if(t===e){K=null;break}var l=t.sibling;if(l!==null){l.return=t.return,K=l;break}K=t.return}}var z_=Math.ceil,Al=sn.ReactCurrentDispatcher,ch=sn.ReactCurrentOwner,er=sn.ReactCurrentBatchConfig,ae=0,Ke=null,Te=null,Qe=0,It=0,Vi=Fn(0),ze=0,As=null,gi=0,Ic=0,uh=0,ls=null,wt=null,dh=0,da=1/0,$r=null,Ol=!1,bf=null,On=null,Oo=!1,Sn=null,El=0,cs=0,jf=null,nl=-1,il=0;function gt(){return ae&6?Ae():nl!==-1?nl:nl=Ae()}function En(e){return e.mode&1?ae&2&&Qe!==0?Qe&-Qe:j_.transition!==null?(il===0&&(il=ob()),il):(e=le,e!==0||(e=window.event,e=e===void 0?16:hb(e.type)),e):1}function mr(e,t,r,n){if(50<cs)throw cs=0,jf=null,Error(F(185));Vs(e,r,n),(!(ae&2)||e!==Ke)&&(e===Ke&&(!(ae&2)&&(Ic|=r),ze===4&&bn(e,Qe)),_t(e,n),r===1&&ae===0&&!(t.mode&1)&&(da=Ae()+500,Ec&&Wn()))}function _t(e,t){var r=e.callbackNode;jP(e,t);var n=hl(e,e===Ke?Qe:0);if(n===0)r!==null&&Sg(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Sg(r),t===1)e.tag===0?b_(mx.bind(null,e)):Tb(mx.bind(null,e)),g_(function(){!(ae&6)&&Wn()}),r=null;else{switch(lb(n)){case 1:r=Lp;break;case 4:r=ab;break;case 16:r=pl;break;case 536870912:r=sb;break;default:r=pl}r=E1(r,N1.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function N1(e,t){if(nl=-1,il=0,ae&6)throw Error(F(327));var r=e.callbackNode;if(ra()&&e.callbackNode!==r)return null;var n=hl(e,e===Ke?Qe:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Dl(e,n);else{t=n;var i=ae;ae|=2;var s=P1();(Ke!==e||Qe!==t)&&($r=null,da=Ae()+500,si(e,t));do try{F_();break}catch(l){k1(e,l)}while(!0);Zp(),Al.current=s,ae=i,Te!==null?t=0:(Ke=null,Qe=0,t=ze)}if(t!==0){if(t===2&&(i=Vd(e),i!==0&&(n=i,t=wf(e,i))),t===1)throw r=As,si(e,0),bn(e,n),_t(e,Ae()),r;if(t===6)bn(e,n);else{if(i=e.current.alternate,!(n&30)&&!R_(i)&&(t=Dl(e,n),t===2&&(s=Vd(e),s!==0&&(n=s,t=wf(e,s))),t===1))throw r=As,si(e,0),bn(e,n),_t(e,Ae()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(F(345));case 2:Zn(e,wt,$r);break;case 3:if(bn(e,n),(n&130023424)===n&&(t=dh+500-Ae(),10<t)){if(hl(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){gt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=tf(Zn.bind(null,e,wt,$r),t);break}Zn(e,wt,$r);break;case 4:if(bn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var o=31-hr(n);s=1<<o,o=t[o],o>i&&(i=o),n&=~s}if(n=i,n=Ae()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*z_(n/1960))-n,10<n){e.timeoutHandle=tf(Zn.bind(null,e,wt,$r),n);break}Zn(e,wt,$r);break;case 5:Zn(e,wt,$r);break;default:throw Error(F(329))}}}return _t(e,Ae()),e.callbackNode===r?N1.bind(null,e):null}function wf(e,t){var r=ls;return e.current.memoizedState.isDehydrated&&(si(e,t).flags|=256),e=Dl(e,t),e!==2&&(t=wt,wt=r,t!==null&&Sf(t)),e}function Sf(e){wt===null?wt=e:wt.push.apply(wt,e)}function R_(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],s=i.getSnapshot;i=i.value;try{if(!gr(s(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bn(e,t){for(t&=~uh,t&=~Ic,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-hr(t),n=1<<r;e[r]=-1,t&=~n}}function mx(e){if(ae&6)throw Error(F(327));ra();var t=hl(e,0);if(!(t&1))return _t(e,Ae()),null;var r=Dl(e,t);if(e.tag!==0&&r===2){var n=Vd(e);n!==0&&(t=n,r=wf(e,n))}if(r===1)throw r=As,si(e,0),bn(e,t),_t(e,Ae()),r;if(r===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Zn(e,wt,$r),_t(e,Ae()),null}function fh(e,t){var r=ae;ae|=1;try{return e(t)}finally{ae=r,ae===0&&(da=Ae()+500,Ec&&Wn())}}function xi(e){Sn!==null&&Sn.tag===0&&!(ae&6)&&ra();var t=ae;ae|=1;var r=er.transition,n=le;try{if(er.transition=null,le=1,e)return e()}finally{le=n,er.transition=r,ae=t,!(ae&6)&&Wn()}}function ph(){It=Vi.current,ye(Vi)}function si(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,m_(r)),Te!==null)for(r=Te.return;r!==null;){var n=r;switch(Vp(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&vl();break;case 3:ca(),ye(kt),ye(ct),rh();break;case 5:th(n);break;case 4:ca();break;case 13:ye(Se);break;case 19:ye(Se);break;case 10:Xp(n.type._context);break;case 22:case 23:ph()}r=r.return}if(Ke=e,Te=e=Dn(e.current,null),Qe=It=t,ze=0,As=null,uh=Ic=gi=0,wt=ls=null,ti!==null){for(t=0;t<ti.length;t++)if(r=ti[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,s=r.pending;if(s!==null){var o=s.next;s.next=i,n.next=o}r.pending=n}ti=null}return e}function k1(e,t){do{var r=Te;try{if(Zp(),el.current=Cl,_l){for(var n=Ne.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}_l=!1}if(mi=0,He=Ie=Ne=null,ss=!1,Ps=0,ch.current=null,r===null||r.return===null){ze=1,As=t,Te=null;break}e:{var s=e,o=r.return,l=r,c=t;if(t=Qe,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=rx(o);if(m!==null){m.flags&=-257,nx(m,o,l,s,t),m.mode&1&&tx(s,d,t),t=m,c=d;var x=t.updateQueue;if(x===null){var g=new Set;g.add(c),t.updateQueue=g}else x.add(c);break e}else{if(!(t&1)){tx(s,d,t),hh();break e}c=Error(F(426))}}else if(be&&l.mode&1){var b=rx(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),nx(b,o,l,s,t),Yp(ua(c,l));break e}}s=c=ua(c,l),ze!==4&&(ze=2),ls===null?ls=[s]:ls.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var v=l1(s,c,t);Gg(s,v);break e;case 1:l=c;var j=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof j.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(On===null||!On.has(y)))){s.flags|=65536,t&=-t,s.lanes|=t;var w=c1(s,l,t);Gg(s,w);break e}}s=s.return}while(s!==null)}C1(r)}catch(S){t=S,Te===r&&r!==null&&(Te=r=r.return);continue}break}while(!0)}function P1(){var e=Al.current;return Al.current=Cl,e===null?Cl:e}function hh(){(ze===0||ze===3||ze===2)&&(ze=4),Ke===null||!(gi&268435455)&&!(Ic&268435455)||bn(Ke,Qe)}function Dl(e,t){var r=ae;ae|=2;var n=P1();(Ke!==e||Qe!==t)&&($r=null,si(e,t));do try{B_();break}catch(i){k1(e,i)}while(!0);if(Zp(),ae=r,Al.current=n,Te!==null)throw Error(F(261));return Ke=null,Qe=0,ze}function B_(){for(;Te!==null;)_1(Te)}function F_(){for(;Te!==null&&!fP();)_1(Te)}function _1(e){var t=O1(e.alternate,e,It);e.memoizedProps=e.pendingProps,t===null?C1(e):Te=t,ch.current=null}function C1(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=M_(r,t),r!==null){r.flags&=32767,Te=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ze=6,Te=null;return}}else if(r=T_(r,t,It),r!==null){Te=r;return}if(t=t.sibling,t!==null){Te=t;return}Te=t=e}while(t!==null);ze===0&&(ze=5)}function Zn(e,t,r){var n=le,i=er.transition;try{er.transition=null,le=1,W_(e,t,r,n)}finally{er.transition=i,le=n}return null}function W_(e,t,r,n){do ra();while(Sn!==null);if(ae&6)throw Error(F(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(F(177));e.callbackNode=null,e.callbackPriority=0;var s=r.lanes|r.childLanes;if(wP(e,s),e===Ke&&(Te=Ke=null,Qe=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Oo||(Oo=!0,E1(pl,function(){return ra(),null})),s=(r.flags&15990)!==0,r.subtreeFlags&15990||s){s=er.transition,er.transition=null;var o=le;le=1;var l=ae;ae|=4,ch.current=null,$_(e,r),w1(r,e),l_(Qd),ml=!!Jd,Qd=Jd=null,e.current=r,L_(r),pP(),ae=l,le=o,er.transition=s}else e.current=r;if(Oo&&(Oo=!1,Sn=e,El=i),s=e.pendingLanes,s===0&&(On=null),gP(r.stateNode),_t(e,Ae()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Ol)throw Ol=!1,e=bf,bf=null,e;return El&1&&e.tag!==0&&ra(),s=e.pendingLanes,s&1?e===jf?cs++:(cs=0,jf=e):cs=0,Wn(),null}function ra(){if(Sn!==null){var e=lb(El),t=er.transition,r=le;try{if(er.transition=null,le=16>e?16:e,Sn===null)var n=!1;else{if(e=Sn,Sn=null,El=0,ae&6)throw Error(F(331));var i=ae;for(ae|=4,K=e.current;K!==null;){var s=K,o=s.child;if(K.flags&16){var l=s.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(K=d;K!==null;){var u=K;switch(u.tag){case 0:case 11:case 15:os(8,u,s)}var f=u.child;if(f!==null)f.return=u,K=f;else for(;K!==null;){u=K;var p=u.sibling,m=u.return;if(v1(u),u===d){K=null;break}if(p!==null){p.return=m,K=p;break}K=m}}}var x=s.alternate;if(x!==null){var g=x.child;if(g!==null){x.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}K=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,K=o;else e:for(;K!==null;){if(s=K,s.flags&2048)switch(s.tag){case 0:case 11:case 15:os(9,s,s.return)}var v=s.sibling;if(v!==null){v.return=s.return,K=v;break e}K=s.return}}var j=e.current;for(K=j;K!==null;){o=K;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,K=y;else e:for(o=j;K!==null;){if(l=K,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Mc(9,l)}}catch(S){Pe(l,l.return,S)}if(l===o){K=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,K=w;break e}K=l.return}}if(ae=i,Wn(),kr&&typeof kr.onPostCommitFiberRoot=="function")try{kr.onPostCommitFiberRoot(Pc,e)}catch{}n=!0}return n}finally{le=r,er.transition=t}}return!1}function gx(e,t,r){t=ua(r,t),t=l1(e,t,1),e=An(e,t,1),t=gt(),e!==null&&(Vs(e,1,t),_t(e,t))}function Pe(e,t,r){if(e.tag===3)gx(e,e,r);else for(;t!==null;){if(t.tag===3){gx(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(On===null||!On.has(n))){e=ua(r,e),e=c1(t,e,1),t=An(t,e,1),e=gt(),t!==null&&(Vs(t,1,e),_t(t,e));break}}t=t.return}}function U_(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=gt(),e.pingedLanes|=e.suspendedLanes&r,Ke===e&&(Qe&r)===r&&(ze===4||ze===3&&(Qe&130023424)===Qe&&500>Ae()-dh?si(e,0):uh|=r),_t(e,t)}function A1(e,t){t===0&&(e.mode&1?(t=bo,bo<<=1,!(bo&130023424)&&(bo=4194304)):t=1);var r=gt();e=Zr(e,t),e!==null&&(Vs(e,t,r),_t(e,r))}function q_(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),A1(e,r)}function H_(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(F(314))}n!==null&&n.delete(t),A1(e,r)}var O1;O1=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||kt.current)St=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return St=!1,D_(e,t,r);St=!!(e.flags&131072)}else St=!1,be&&t.flags&1048576&&Mb(t,wl,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;rl(e,t),e=t.pendingProps;var i=sa(t,ct.current);ta(t,r),i=ih(null,t,n,e,i,r);var s=ah();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Pt(n)?(s=!0,bl(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Qp(t),i.updater=Tc,t.stateNode=i,i._reactInternals=t,cf(t,n,e,r),t=ff(null,t,n,!0,s,r)):(t.tag=0,be&&s&&Kp(t),ht(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(rl(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=V_(n),e=cr(n,e),i){case 0:t=df(null,t,n,e,r);break e;case 1:t=sx(null,t,n,e,r);break e;case 11:t=ix(null,t,n,e,r);break e;case 14:t=ax(null,t,n,cr(n.type,e),r);break e}throw Error(F(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cr(n,i),df(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cr(n,i),sx(e,t,n,i,r);case 3:e:{if(p1(t),e===null)throw Error(F(387));n=t.pendingProps,s=t.memoizedState,i=s.element,Bb(e,t),kl(t,n,null,r);var o=t.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=ua(Error(F(423)),t),t=ox(e,t,n,r,i);break e}else if(n!==i){i=ua(Error(F(424)),t),t=ox(e,t,n,r,i);break e}else for(zt=Cn(t.stateNode.containerInfo.firstChild),Rt=t,be=!0,dr=null,r=zb(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(oa(),n===i){t=Xr(e,t,r);break e}ht(e,t,n,r)}t=t.child}return t;case 5:return Fb(t),e===null&&sf(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,ef(n,i)?o=null:s!==null&&ef(n,s)&&(t.flags|=32),f1(e,t),ht(e,t,o,r),t.child;case 6:return e===null&&sf(t),null;case 13:return h1(e,t,r);case 4:return eh(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=la(t,null,n,r):ht(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cr(n,i),ix(e,t,n,i,r);case 7:return ht(e,t,t.pendingProps,r),t.child;case 8:return ht(e,t,t.pendingProps.children,r),t.child;case 12:return ht(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,me(Sl,n._currentValue),n._currentValue=o,s!==null)if(gr(s.value,o)){if(s.children===i.children&&!kt.current){t=Xr(e,t,r);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=qr(-1,r&-r),c.tag=2;var d=s.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),of(s.return,r,t),l.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(F(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),of(o,r,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}ht(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ta(t,r),i=tr(i),n=n(i),t.flags|=1,ht(e,t,n,r),t.child;case 14:return n=t.type,i=cr(n,t.pendingProps),i=cr(n.type,i),ax(e,t,n,i,r);case 15:return u1(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:cr(n,i),rl(e,t),t.tag=1,Pt(n)?(e=!0,bl(t)):e=!1,ta(t,r),o1(t,n,i),cf(t,n,i,r),ff(null,t,n,!0,e,r);case 19:return m1(e,t,r);case 22:return d1(e,t,r)}throw Error(F(156,t.tag))};function E1(e,t){return ib(e,t)}function K_(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zt(e,t,r,n){return new K_(e,t,r,n)}function mh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function V_(e){if(typeof e=="function")return mh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Mp)return 11;if(e===Ip)return 14}return 2}function Dn(e,t){var r=e.alternate;return r===null?(r=Zt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function al(e,t,r,n,i,s){var o=2;if(n=e,typeof e=="function")mh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Li:return oi(r.children,i,s,t);case Tp:o=8,i|=8;break;case Dd:return e=Zt(12,r,t,i|2),e.elementType=Dd,e.lanes=s,e;case Td:return e=Zt(13,r,t,i),e.elementType=Td,e.lanes=s,e;case Md:return e=Zt(19,r,t,i),e.elementType=Md,e.lanes=s,e;case Fv:return $c(r,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Rv:o=10;break e;case Bv:o=9;break e;case Mp:o=11;break e;case Ip:o=14;break e;case mn:o=16,n=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Zt(o,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function oi(e,t,r,n){return e=Zt(7,e,n,t),e.lanes=r,e}function $c(e,t,r,n){return e=Zt(22,e,n,t),e.elementType=Fv,e.lanes=r,e.stateNode={isHidden:!1},e}function ad(e,t,r){return e=Zt(6,e,null,t),e.lanes=r,e}function sd(e,t,r){return t=Zt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Y_(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bu(0),this.expirationTimes=Bu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bu(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function gh(e,t,r,n,i,s,o,l,c){return e=new Y_(e,t,r,l,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Zt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qp(s),e}function G_(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$i,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function D1(e){if(!e)return $n;e=e._reactInternals;e:{if(Pi(e)!==e||e.tag!==1)throw Error(F(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Pt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(F(171))}if(e.tag===1){var r=e.type;if(Pt(r))return Db(e,r,t)}return t}function T1(e,t,r,n,i,s,o,l,c){return e=gh(r,n,!0,e,i,s,o,l,c),e.context=D1(null),r=e.current,n=gt(),i=En(r),s=qr(n,i),s.callback=t??null,An(r,s,i),e.current.lanes=i,Vs(e,i,n),_t(e,n),e}function Lc(e,t,r,n){var i=t.current,s=gt(),o=En(i);return r=D1(r),t.context===null?t.context=r:t.pendingContext=r,t=qr(s,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=An(i,t,o),e!==null&&(mr(e,i,o,s),Qo(e,i,o)),o}function Tl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function xx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function xh(e,t){xx(e,t),(e=e.alternate)&&xx(e,t)}function Z_(){return null}var M1=typeof reportError=="function"?reportError:function(e){console.error(e)};function yh(e){this._internalRoot=e}zc.prototype.render=yh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));Lc(e,t,null,null)};zc.prototype.unmount=yh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xi(function(){Lc(null,e,null,null)}),t[Gr]=null}};function zc(e){this._internalRoot=e}zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=db();e={blockedOn:null,target:e,priority:t};for(var r=0;r<vn.length&&t!==0&&t<vn[r].priority;r++);vn.splice(r,0,e),r===0&&pb(e)}};function vh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Rc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function yx(){}function X_(e,t,r,n,i){if(i){if(typeof n=="function"){var s=n;n=function(){var d=Tl(o);s.call(d)}}var o=T1(t,n,e,0,null,!1,!1,"",yx);return e._reactRootContainer=o,e[Gr]=o.current,js(e.nodeType===8?e.parentNode:e),xi(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var l=n;n=function(){var d=Tl(c);l.call(d)}}var c=gh(e,0,!1,null,null,!1,!1,"",yx);return e._reactRootContainer=c,e[Gr]=c.current,js(e.nodeType===8?e.parentNode:e),xi(function(){Lc(t,c,r,n)}),c}function Bc(e,t,r,n,i){var s=r._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var l=i;i=function(){var c=Tl(o);l.call(c)}}Lc(t,o,e,i)}else o=X_(r,t,e,i,n);return Tl(o)}cb=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Xa(t.pendingLanes);r!==0&&(zp(t,r|1),_t(t,Ae()),!(ae&6)&&(da=Ae()+500,Wn()))}break;case 13:xi(function(){var n=Zr(e,1);if(n!==null){var i=gt();mr(n,e,1,i)}}),xh(e,1)}};Rp=function(e){if(e.tag===13){var t=Zr(e,134217728);if(t!==null){var r=gt();mr(t,e,134217728,r)}xh(e,134217728)}};ub=function(e){if(e.tag===13){var t=En(e),r=Zr(e,t);if(r!==null){var n=gt();mr(r,e,t,n)}xh(e,t)}};db=function(){return le};fb=function(e,t){var r=le;try{return le=e,t()}finally{le=r}};qd=function(e,t,r){switch(t){case"input":if(Ld(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=Oc(n);if(!i)throw Error(F(90));Uv(n),Ld(n,i)}}}break;case"textarea":Hv(e,r);break;case"select":t=r.value,t!=null&&Xi(e,!!r.multiple,t,!1)}};Jv=fh;Qv=xi;var J_={usingClientEntryPoint:!1,Events:[Gs,Fi,Oc,Zv,Xv,fh]},Fa={findFiberByHostInstance:ei,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Q_={bundleType:Fa.bundleType,version:Fa.version,rendererPackageName:Fa.rendererPackageName,rendererConfig:Fa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:sn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=rb(e),e===null?null:e.stateNode},findFiberByHostInstance:Fa.findFiberByHostInstance||Z_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eo.isDisabled&&Eo.supportsFiber)try{Pc=Eo.inject(Q_),kr=Eo}catch{}}Ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=J_;Ut.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vh(t))throw Error(F(200));return G_(e,t,null,r)};Ut.createRoot=function(e,t){if(!vh(e))throw Error(F(299));var r=!1,n="",i=M1;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=gh(e,1,!1,null,null,r,!1,n,i),e[Gr]=t.current,js(e.nodeType===8?e.parentNode:e),new yh(t)};Ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(F(188)):(e=Object.keys(e).join(","),Error(F(268,e)));return e=rb(t),e=e===null?null:e.stateNode,e};Ut.flushSync=function(e){return xi(e)};Ut.hydrate=function(e,t,r){if(!Rc(t))throw Error(F(200));return Bc(null,e,t,!0,r)};Ut.hydrateRoot=function(e,t,r){if(!vh(e))throw Error(F(405));var n=r!=null&&r.hydratedSources||null,i=!1,s="",o=M1;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(s=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=T1(t,null,e,1,r??null,i,!1,s,o),e[Gr]=t.current,js(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new zc(t)};Ut.render=function(e,t,r){if(!Rc(t))throw Error(F(200));return Bc(null,e,t,!1,r)};Ut.unmountComponentAtNode=function(e){if(!Rc(e))throw Error(F(40));return e._reactRootContainer?(xi(function(){Bc(null,null,e,!1,function(){e._reactRootContainer=null,e[Gr]=null})}),!0):!1};Ut.unstable_batchedUpdates=fh;Ut.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Rc(r))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return Bc(e,t,r,!1,n)};Ut.version="18.3.1-next-f1338f8080-20240426";function I1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(I1)}catch(e){console.error(e)}}I1(),Iv.exports=Ut;var bh=Iv.exports,vx=bh;Od.createRoot=vx.createRoot,Od.hydrateRoot=vx.hydrateRoot;/**
* @remix-run/router v1.23.1
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Os(){return Os=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Os.apply(this,arguments)}var Nn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Nn||(Nn={}));const bx="popstate";function eC(e){e===void 0&&(e={});function t(n,i){let{pathname:s,search:o,hash:l}=n.location;return Nf("",{pathname:s,search:o,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function r(n,i){return typeof i=="string"?i:Ml(i)}return rC(t,r,null,e)}function Oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function jh(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function tC(){return Math.random().toString(36).substr(2,8)}function jx(e,t){return{usr:e.state,key:e.key,idx:t}}function Nf(e,t,r,n){return r===void 0&&(r=null),Os({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?wa(t):t,{state:r,key:t&&t.key||n||tC()})}function Ml(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function wa(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function rC(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:s=!1}=n,o=i.history,l=Nn.Pop,c=null,d=u();d==null&&(d=0,o.replaceState(Os({},o.state,{idx:d}),""));function u(){return(o.state||{idx:null}).idx}function f(){l=Nn.Pop;let b=u(),v=b==null?null:b-d;d=b,c&&c({action:l,location:g.location,delta:v})}function p(b,v){l=Nn.Push;let j=Nf(g.location,b,v);d=u()+1;let y=jx(j,d),w=g.createHref(j);try{o.pushState(y,"",w)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(w)}s&&c&&c({action:l,location:g.location,delta:1})}function m(b,v){l=Nn.Replace;let j=Nf(g.location,b,v);d=u();let y=jx(j,d),w=g.createHref(j);o.replaceState(y,"",w),s&&c&&c({action:l,location:g.location,delta:0})}function x(b){let v=i.location.origin!=="null"?i.location.origin:i.location.href,j=typeof b=="string"?b:Ml(b);return j=j.replace(/ $/,"%20"),Oe(v,"No window.location.(origin|href) available to create URL for href: "+j),new URL(j,v)}let g={get action(){return l},get location(){return e(i,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(bx,f),c=b,()=>{i.removeEventListener(bx,f),c=null}},createHref(b){return t(i,b)},createURL:x,encodeLocation(b){let v=x(b);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:m,go(b){return o.go(b)}};return g}var wx;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(wx||(wx={}));function nC(e,t,r){return r===void 0&&(r="/"),iC(e,t,r)}function iC(e,t,r,n){let i=typeof t=="string"?wa(t):t,s=wh(i.pathname||"/",r);if(s==null)return null;let o=$1(e);aC(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=xC(s);l=hC(o[c],d)}return l}function $1(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let i=(s,o,l)=>{let c={relativePath:l===void 0?s.path||"":l,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};c.relativePath.startsWith("/")&&(Oe(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let d=Tn([n,c.relativePath]),u=r.concat(c);s.children&&s.children.length>0&&(Oe(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),$1(s.children,t,u,d)),!(s.path==null&&!s.index)&&t.push({path:d,score:fC(d,s.index),routesMeta:u})};return e.forEach((s,o)=>{var l;if(s.path===""||!((l=s.path)!=null&&l.includes("?")))i(s,o);else for(let c of L1(s.path))i(s,o,c)}),t}function L1(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return i?[s,""]:[s];let o=L1(n.join("/")),l=[];return l.push(...o.map(c=>c===""?s:[s,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function aC(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:pC(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const sC=/^:[\w-]+$/,oC=3,lC=2,cC=1,uC=10,dC=-2,Sx=e=>e==="*";function fC(e,t){let r=e.split("/"),n=r.length;return r.some(Sx)&&(n+=dC),t&&(n+=lC),r.filter(i=>!Sx(i)).reduce((i,s)=>i+(sC.test(s)?oC:s===""?cC:uC),n)}function pC(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function hC(e,t,r){let{routesMeta:n}=e,i={},s="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],d=l===n.length-1,u=s==="/"?t:t.slice(s.length)||"/",f=mC({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),p=c.route;if(!f)return null;Object.assign(i,f.params),o.push({params:i,pathname:Tn([s,f.pathname]),pathnameBase:wC(Tn([s,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(s=Tn([s,f.pathnameBase]))}return o}function mC(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=gC(e.path,e.caseSensitive,e.end),i=t.match(r);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:n.reduce((d,u,f)=>{let{paramName:p,isOptional:m}=u;if(p==="*"){let g=l[f]||"";o=s.slice(0,s.length-g.length).replace(/(.)\/+$/,"$1")}const x=l[f];return m&&!x?d[p]=void 0:d[p]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:s,pathnameBase:o,pattern:e}}function gC(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),jh(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function xC(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return jh(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function wh(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const yC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vC=e=>yC.test(e);function bC(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?wa(e):e,s;if(r)if(vC(r))s=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),jh(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?s=Nx(r.substring(1),"/"):s=Nx(r,t)}else s=t;return{pathname:s,search:SC(n),hash:NC(i)}}function Nx(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function od(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function jC(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Sh(e,t){let r=jC(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Nh(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=wa(e):(i=Os({},e),Oe(!i.pathname||!i.pathname.includes("?"),od("?","pathname","search",i)),Oe(!i.pathname||!i.pathname.includes("#"),od("#","pathname","hash",i)),Oe(!i.search||!i.search.includes("#"),od("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,l;if(o==null)l=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;i.pathname=p.join("/")}l=f>=0?t[f]:"/"}let c=bC(i,l),d=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Tn=e=>e.join("/").replace(/\/\/+/g,"/"),wC=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),SC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,NC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function kC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const z1=["post","put","patch","delete"];new Set(z1);const PC=["get",...z1];new Set(PC);/**
* React Router v6.30.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Es(){return Es=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Es.apply(this,arguments)}const kh=h.createContext(null),_C=h.createContext(null),Un=h.createContext(null),Fc=h.createContext(null),on=h.createContext({outlet:null,matches:[],isDataRoute:!1}),R1=h.createContext(null);function CC(e,t){let{relative:r}=t===void 0?{}:t;Sa()||Oe(!1);let{basename:n,navigator:i}=h.useContext(Un),{hash:s,pathname:o,search:l}=F1(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:Tn([n,o])),i.createHref({pathname:c,search:l,hash:s})}function Sa(){return h.useContext(Fc)!=null}function _i(){return Sa()||Oe(!1),h.useContext(Fc).location}function B1(e){h.useContext(Un).static||h.useLayoutEffect(e)}function dt(){let{isDataRoute:e}=h.useContext(on);return e?FC():AC()}function AC(){Sa()||Oe(!1);let e=h.useContext(kh),{basename:t,future:r,navigator:n}=h.useContext(Un),{matches:i}=h.useContext(on),{pathname:s}=_i(),o=JSON.stringify(Sh(i,r.v7_relativeSplatPath)),l=h.useRef(!1);return B1(()=>{l.current=!0}),h.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let f=Nh(d,JSON.parse(o),s,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Tn([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,s,e])}function Na(){let{matches:e}=h.useContext(on),t=e[e.length-1];return t?t.params:{}}function F1(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=h.useContext(Un),{matches:i}=h.useContext(on),{pathname:s}=_i(),o=JSON.stringify(Sh(i,n.v7_relativeSplatPath));return h.useMemo(()=>Nh(e,JSON.parse(o),s,r==="path"),[e,o,s,r])}function OC(e,t){return EC(e,t)}function EC(e,t,r,n){Sa()||Oe(!1);let{navigator:i}=h.useContext(Un),{matches:s}=h.useContext(on),o=s[s.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=_i(),u;if(t){var f;let b=typeof t=="string"?wa(t):t;c==="/"||(f=b.pathname)!=null&&f.startsWith(c)||Oe(!1),u=b}else u=d;let p=u.pathname||"/",m=p;if(c!=="/"){let b=c.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(b.length).join("/")}let x=nC(e,{pathname:m}),g=$C(x&&x.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Tn([c,i.encodeLocation?i.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Tn([c,i.encodeLocation?i.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),s,r,n);return t&&g?h.createElement(Fc.Provider,{value:{location:Es({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Nn.Pop}},g):g}function DC(){let e=BC(),t=kC(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),r?h.createElement("pre",{style:i},r):null,null)}const TC=h.createElement(DC,null);class MC extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?h.createElement(on.Provider,{value:this.props.routeContext},h.createElement(R1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function IC(e){let{routeContext:t,match:r,children:n}=e,i=h.useContext(kh);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),h.createElement(on.Provider,{value:t},n)}function $C(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var s;if(!r)return null;if(r.errors)e=r.matches;else if((s=n)!=null&&s.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(i=r)==null?void 0:i.errors;if(l!=null){let u=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);u>=0||Oe(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let u=0;u<o.length;u++){let f=o[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(d=u),f.route.id){let{loaderData:p,errors:m}=r,x=f.route.loader&&p[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||x){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((u,f,p)=>{let m,x=!1,g=null,b=null;r&&(m=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||TC,c&&(d<0&&p===0?(WC("route-fallback"),x=!0,b=null):d===p&&(x=!0,b=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,p+1)),j=()=>{let y;return m?y=g:x?y=b:f.route.Component?y=h.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=u,h.createElement(IC,{match:f,routeContext:{outlet:u,matches:v,isDataRoute:r!=null},children:y})};return r&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?h.createElement(MC,{location:r.location,revalidation:r.revalidation,component:g,error:m,children:j(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):j()},null)}var W1=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(W1||{}),U1=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(U1||{});function LC(e){let t=h.useContext(kh);return t||Oe(!1),t}function zC(e){let t=h.useContext(_C);return t||Oe(!1),t}function RC(e){let t=h.useContext(on);return t||Oe(!1),t}function q1(e){let t=RC(),r=t.matches[t.matches.length-1];return r.route.id||Oe(!1),r.route.id}function BC(){var e;let t=h.useContext(R1),r=zC(),n=q1();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function FC(){let{router:e}=LC(W1.UseNavigateStable),t=q1(U1.UseNavigateStable),r=h.useRef(!1);return B1(()=>{r.current=!0}),h.useCallback(function(i,s){s===void 0&&(s={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Es({fromRouteId:t},s)))},[e,t])}const kx={};function WC(e,t,r){kx[e]||(kx[e]=!0)}function UC(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function H1(e){let{to:t,replace:r,state:n,relative:i}=e;Sa()||Oe(!1);let{future:s,static:o}=h.useContext(Un),{matches:l}=h.useContext(on),{pathname:c}=_i(),d=dt(),u=Nh(t,Sh(l,s.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(u);return h.useEffect(()=>d(JSON.parse(f),{replace:r,state:n,relative:i}),[d,f,i,r,n]),null}function de(e){Oe(!1)}function qC(e){let{basename:t="/",children:r=null,location:n,navigationType:i=Nn.Pop,navigator:s,static:o=!1,future:l}=e;Sa()&&Oe(!1);let c=t.replace(/^\/*/,"/"),d=h.useMemo(()=>({basename:c,navigator:s,static:o,future:Es({v7_relativeSplatPath:!1},l)}),[c,l,s,o]);typeof n=="string"&&(n=wa(n));let{pathname:u="/",search:f="",hash:p="",state:m=null,key:x="default"}=n,g=h.useMemo(()=>{let b=wh(u,c);return b==null?null:{location:{pathname:b,search:f,hash:p,state:m,key:x},navigationType:i}},[c,u,f,p,m,x,i]);return g==null?null:h.createElement(Un.Provider,{value:d},h.createElement(Fc.Provider,{children:r,value:g}))}function HC(e){let{children:t,location:r}=e;return OC(kf(t),r)}new Promise(()=>{});function kf(e,t){t===void 0&&(t=[]);let r=[];return h.Children.forEach(e,(n,i)=>{if(!h.isValidElement(n))return;let s=[...t,i];if(n.type===h.Fragment){r.push.apply(r,kf(n.props.children,s));return}n.type!==de&&Oe(!1),!n.props.index||!n.props.children||Oe(!1);let o={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=kf(n.props.children,s)),r.push(o)}),r}/**
* React Router DOM v6.30.2
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Pf(){return Pf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pf.apply(this,arguments)}function KC(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,s;for(s=0;s<n.length;s++)i=n[s],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function VC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function YC(e,t){return e.button===0&&(!t||t==="_self")&&!VC(e)}function _f(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function GC(e,t){let r=_f(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(s=>{r.append(i,s)})}),r}const ZC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],XC="6";try{window.__reactRouterVersion=XC}catch{}const JC="startTransition",Px=Tv[JC];function QC(e){let{basename:t,children:r,future:n,window:i}=e,s=h.useRef();s.current==null&&(s.current=eC({window:i,v5Compat:!0}));let o=s.current,[l,c]=h.useState({action:o.action,location:o.location}),{v7_startTransition:d}=n||{},u=h.useCallback(f=>{d&&Px?Px(()=>c(f)):c(f)},[c,d]);return h.useLayoutEffect(()=>o.listen(u),[o,u]),h.useEffect(()=>UC(n),[n]),h.createElement(qC,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const eA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,K1=h.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:s,replace:o,state:l,target:c,to:d,preventScrollReset:u,viewTransition:f}=t,p=KC(t,ZC),{basename:m}=h.useContext(Un),x,g=!1;if(typeof d=="string"&&tA.test(d)&&(x=d,eA))try{let y=new URL(window.location.href),w=d.startsWith("//")?new URL(y.protocol+d):new URL(d),S=wh(w.pathname,m);w.origin===y.origin&&S!=null?d=S+w.search+w.hash:g=!0}catch{}let b=CC(d,{relative:i}),v=rA(d,{replace:o,state:l,target:c,preventScrollReset:u,relative:i,viewTransition:f});function j(y){n&&n(y),y.defaultPrevented||v(y)}return h.createElement("a",Pf({},p,{href:x||b,onClick:g||s?n:j,ref:r,target:c}))});var _x;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(_x||(_x={}));var Cx;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Cx||(Cx={}));function rA(e,t){let{target:r,replace:n,state:i,preventScrollReset:s,relative:o,viewTransition:l}=t===void 0?{}:t,c=dt(),d=_i(),u=F1(e,{relative:o});return h.useCallback(f=>{if(YC(f,r)){f.preventDefault();let p=n!==void 0?n:Ml(d)===Ml(u);c(e,{replace:p,state:i,preventScrollReset:s,relative:o,viewTransition:l})}},[d,c,u,n,i,r,e,s,o,l])}function nA(e){let t=h.useRef(_f(e)),r=h.useRef(!1),n=_i(),i=h.useMemo(()=>GC(n.search,r.current?null:t.current),[n.search]),s=dt(),o=h.useCallback((l,c)=>{const d=_f(typeof l=="function"?l(i):l);r.current=!0,s("?"+d,c)},[s,i]);return[i,o]}const iA={},Ax=e=>{let t;const r=new Set,n=(u,f)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const m=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(x=>x(t,m))}},i=()=>t,c={setState:n,getState:i,getInitialState:()=>d,subscribe:u=>(r.add(u),()=>r.delete(u)),destroy:()=>{(iA?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},d=t=e(n,i,c);return c},aA=e=>e?Ax(e):Ax;var V1={exports:{}},Y1={},G1={exports:{}},Z1={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var fa=h;function sA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oA=typeof Object.is=="function"?Object.is:sA,lA=fa.useState,cA=fa.useEffect,uA=fa.useLayoutEffect,dA=fa.useDebugValue;function fA(e,t){var r=t(),n=lA({inst:{value:r,getSnapshot:t}}),i=n[0].inst,s=n[1];return uA(function(){i.value=r,i.getSnapshot=t,ld(i)&&s({inst:i})},[e,r,t]),cA(function(){return ld(i)&&s({inst:i}),e(function(){ld(i)&&s({inst:i})})},[e]),dA(r),r}function ld(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!oA(e,r)}catch{return!0}}function pA(e,t){return t()}var hA=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?pA:fA;Z1.useSyncExternalStore=fa.useSyncExternalStore!==void 0?fa.useSyncExternalStore:hA;G1.exports=Z1;var mA=G1.exports;/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Wc=h,gA=mA;function xA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yA=typeof Object.is=="function"?Object.is:xA,vA=gA.useSyncExternalStore,bA=Wc.useRef,jA=Wc.useEffect,wA=Wc.useMemo,SA=Wc.useDebugValue;Y1.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var s=bA(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=wA(function(){function c(m){if(!d){if(d=!0,u=m,m=n(m),i!==void 0&&o.hasValue){var x=o.value;if(i(x,m))return f=x}return f=m}if(x=f,yA(u,m))return x;var g=n(m);return i!==void 0&&i(x,g)?(u=m,x):(u=m,f=g)}var d=!1,u,f,p=r===void 0?null:r;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,r,n,i]);var l=vA(e,s[0],s[1]);return jA(function(){o.hasValue=!0,o.value=l},[l]),SA(l),l};V1.exports=Y1;var X1=V1.exports;const NA=Tr(X1),J1={},{useDebugValue:kA}=fs,{useSyncExternalStoreWithSelector:PA}=NA;let Ox=!1;const _A=e=>e;function CA(e,t=_A,r){(J1?"production":void 0)!=="production"&&r&&!Ox&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ox=!0);const n=PA(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return kA(n),n}const Ex=e=>{(J1?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?aA(e):e,r=(n,i)=>CA(t,n,i);return Object.assign(r,t),r},AA=e=>e?Ex(e):Ex,OA="https://dispos.crawlsy.com";class EA{constructor(t){ho(this,"baseUrl");this.baseUrl=t}getHeaders(){const t=localStorage.getItem("token");return{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{}}}async request(t,r){const n=`${this.baseUrl}${t}`,i=await fetch(n,{...r,headers:{...this.getHeaders(),...r==null?void 0:r.headers}});if(!i.ok){const s=await i.json().catch(()=>({error:"Request failed"}));throw new Error(s.error||`HTTP ${i.status}`)}return i.json()}async login(t,r){return this.request("/api/auth/login",{method:"POST",body:JSON.stringify({email:t,password:r})})}async getMe(){return this.request("/api/auth/me")}async getDashboardStats(){return this.request("/api/dashboard/stats")}async getDashboardActivity(){return this.request("/api/dashboard/activity")}async getStores(){return this.request("/api/stores")}async getStore(t){return this.request(`/api/stores/${t}`)}async createStore(t){return this.request("/api/stores",{method:"POST",body:JSON.stringify(t)})}async updateStore(t,r){return this.request(`/api/stores/${t}`,{method:"PUT",body:JSON.stringify(r)})}async getDispensaries(){return this.request("/api/dispensaries")}async getDispensary(t){return this.request(`/api/dispensaries/${t}`)}async updateDispensary(t,r){return this.request(`/api/dispensaries/${t}`,{method:"PUT",body:JSON.stringify(r)})}async deleteStore(t){return this.request(`/api/stores/${t}`,{method:"DELETE"})}async scrapeStore(t,r,n){return this.request(`/api/stores/${t}/scrape`,{method:"POST",body:JSON.stringify({parallel:r,userAgent:n})})}async downloadStoreImages(t){return this.request(`/api/stores/${t}/download-images`,{method:"POST"})}async discoverStoreCategories(t){return this.request(`/api/stores/${t}/discover-categories`,{method:"POST"})}async debugScrapeStore(t){return this.request(`/api/stores/${t}/debug-scrape`,{method:"POST"})}async getStoreBrands(t){return this.request(`/api/stores/${t}/brands`)}async getStoreSpecials(t,r){const n=r?`?date=${r}`:"";return this.request(`/api/stores/${t}/specials${n}`)}async getCategories(t){const r=t?`?store_id=${t}`:"";return this.request(`/api/categories${r}`)}async getCategoryTree(t){return this.request(`/api/categories/tree?store_id=${t}`)}async getProducts(t){const r=new URLSearchParams(t).toString();return this.request(`/api/products${r?`?${r}`:""}`)}async getProduct(t){return this.request(`/api/products/${t}`)}async getCampaigns(){return this.request("/api/campaigns")}async getCampaign(t){return this.request(`/api/campaigns/${t}`)}async createCampaign(t){return this.request("/api/campaigns",{method:"POST",body:JSON.stringify(t)})}async updateCampaign(t,r){return this.request(`/api/campaigns/${t}`,{method:"PUT",body:JSON.stringify(r)})}async deleteCampaign(t){return this.request(`/api/campaigns/${t}`,{method:"DELETE"})}async addProductToCampaign(t,r,n){return this.request(`/api/campaigns/${t}/products`,{method:"POST",body:JSON.stringify({product_id:r,display_order:n})})}async removeProductFromCampaign(t,r){return this.request(`/api/campaigns/${t}/products/${r}`,{method:"DELETE"})}async getAnalyticsOverview(t){return this.request(`/api/analytics/overview${t?`?days=${t}`:""}`)}async getProductAnalytics(t,r){return this.request(`/api/analytics/products/${t}${r?`?days=${r}`:""}`)}async getCampaignAnalytics(t,r){return this.request(`/api/analytics/campaigns/${t}${r?`?days=${r}`:""}`)}async getSettings(){return this.request("/api/settings")}async updateSetting(t,r){return this.request(`/api/settings/${t}`,{method:"PUT",body:JSON.stringify({value:r})})}async updateSettings(t){return this.request("/api/settings",{method:"PUT",body:JSON.stringify({settings:t})})}async getProxies(){return this.request("/api/proxies")}async getProxy(t){return this.request(`/api/proxies/${t}`)}async addProxy(t){return this.request("/api/proxies",{method:"POST",body:JSON.stringify(t)})}async addProxiesBulk(t){return this.request("/api/proxies/bulk",{method:"POST",body:JSON.stringify({proxies:t})})}async testProxy(t){return this.request(`/api/proxies/${t}/test`,{method:"POST"})}async testAllProxies(){return this.request("/api/proxies/test-all",{method:"POST"})}async getProxyTestJob(t){return this.request(`/api/proxies/test-job/${t}`)}async getActiveProxyTestJob(){return this.request("/api/proxies/test-job")}async cancelProxyTestJob(t){return this.request(`/api/proxies/test-job/${t}/cancel`,{method:"POST"})}async updateProxy(t,r){return this.request(`/api/proxies/${t}`,{method:"PUT",body:JSON.stringify(r)})}async deleteProxy(t){return this.request(`/api/proxies/${t}`,{method:"DELETE"})}async updateProxyLocations(){return this.request("/api/proxies/update-locations",{method:"POST"})}async getLogs(t,r,n){const i=new URLSearchParams;return t&&i.append("limit",t.toString()),r&&i.append("level",r),n&&i.append("category",n),this.request(`/api/logs?${i.toString()}`)}async clearLogs(){return this.request("/api/logs",{method:"DELETE"})}async getActiveScrapers(){return this.request("/api/scraper-monitor/active")}async getScraperHistory(t){const r=t?`?store_id=${t}`:"";return this.request(`/api/scraper-monitor/history${r}`)}async getJobStats(t){const r=t?`?dispensary_id=${t}`:"";return this.request(`/api/scraper-monitor/jobs/stats${r}`)}async getActiveJobs(t){const r=t?`?dispensary_id=${t}`:"";return this.request(`/api/scraper-monitor/jobs/active${r}`)}async getRecentJobs(t){const r=new URLSearchParams;t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.dispensaryId&&r.append("dispensary_id",t.dispensaryId.toString()),t!=null&&t.status&&r.append("status",t.status);const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/scraper-monitor/jobs/recent${n}`)}async getWorkerStats(t){const r=t?`?dispensary_id=${t}`:"";return this.request(`/api/scraper-monitor/jobs/workers${r}`)}async getAZMonitorActiveJobs(){return this.request("/api/az/monitor/active-jobs")}async getAZMonitorRecentJobs(t){const r=t?`?limit=${t}`:"";return this.request(`/api/az/monitor/recent-jobs${r}`)}async getAZMonitorErrors(t){const r=new URLSearchParams;t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.hours&&r.append("hours",t.hours.toString());const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/az/monitor/errors${n}`)}async getAZMonitorSummary(){return this.request("/api/az/monitor/summary")}async getChanges(t){const r=t?`?status=${t}`:"";return this.request(`/api/changes${r}`)}async getChangeStats(){return this.request("/api/changes/stats")}async approveChange(t){return this.request(`/api/changes/${t}/approve`,{method:"POST"})}async rejectChange(t,r){return this.request(`/api/changes/${t}/reject`,{method:"POST",body:JSON.stringify({reason:r})})}async getDispensaryProducts(t,r){const n=r?`?category=${r}`:"";return this.request(`/api/dispensaries/${t}/products${n}`)}async getDispensaryBrands(t){return this.request(`/api/dispensaries/${t}/brands`)}async getDispensarySpecials(t){return this.request(`/api/dispensaries/${t}/specials`)}async getApiPermissions(){return this.request("/api/api-permissions")}async getApiPermissionDispensaries(){return this.request("/api/api-permissions/dispensaries")}async createApiPermission(t){return this.request("/api/api-permissions",{method:"POST",body:JSON.stringify(t)})}async updateApiPermission(t,r){return this.request(`/api/api-permissions/${t}`,{method:"PUT",body:JSON.stringify(r)})}async toggleApiPermission(t){return this.request(`/api/api-permissions/${t}/toggle`,{method:"PATCH"})}async deleteApiPermission(t){return this.request(`/api/api-permissions/${t}`,{method:"DELETE"})}async getGlobalSchedule(){return this.request("/api/schedule/global")}async updateGlobalSchedule(t,r){return this.request(`/api/schedule/global/${t}`,{method:"PUT",body:JSON.stringify(r)})}async getStoreSchedules(){return this.request("/api/schedule/stores")}async getStoreSchedule(t){return this.request(`/api/schedule/stores/${t}`)}async updateStoreSchedule(t,r){return this.request(`/api/schedule/stores/${t}`,{method:"PUT",body:JSON.stringify(r)})}async getDispensarySchedules(t){const r=new URLSearchParams;t!=null&&t.state&&r.append("state",t.state),t!=null&&t.search&&r.append("search",t.search);const n=r.toString();return this.request(`/api/schedule/dispensaries${n?`?${n}`:""}`)}async getDispensarySchedule(t){return this.request(`/api/schedule/dispensaries/${t}`)}async updateDispensarySchedule(t,r){return this.request(`/api/schedule/dispensaries/${t}`,{method:"PUT",body:JSON.stringify(r)})}async getDispensaryCrawlJobs(t){const r=t?`?limit=${t}`:"";return this.request(`/api/schedule/dispensary-jobs${r}`)}async triggerDispensaryCrawl(t){return this.request(`/api/schedule/trigger/dispensary/${t}`,{method:"POST"})}async resolvePlatformId(t){return this.request(`/api/schedule/dispensaries/${t}/resolve-platform-id`,{method:"POST"})}async detectMenuType(t){return this.request(`/api/schedule/dispensaries/${t}/detect-menu-type`,{method:"POST"})}async refreshDetection(t){return this.request(`/api/schedule/dispensaries/${t}/refresh-detection`,{method:"POST"})}async toggleDispensarySchedule(t,r){return this.request(`/api/schedule/dispensaries/${t}/toggle-active`,{method:"PUT",body:JSON.stringify({is_active:r})})}async deleteDispensarySchedule(t){return this.request(`/api/schedule/dispensaries/${t}/schedule`,{method:"DELETE"})}async getCrawlJobs(t){const r=t?`?limit=${t}`:"";return this.request(`/api/schedule/jobs${r}`)}async getStoreCrawlJobs(t,r){const n=r?`?limit=${r}`:"";return this.request(`/api/schedule/jobs/store/${t}${n}`)}async cancelCrawlJob(t){return this.request(`/api/schedule/jobs/${t}/cancel`,{method:"POST"})}async triggerStoreCrawl(t){return this.request(`/api/schedule/trigger/store/${t}`,{method:"POST"})}async triggerAllCrawls(){return this.request("/api/schedule/trigger/all",{method:"POST"})}async restartScheduler(){return this.request("/api/schedule/restart",{method:"POST"})}async getVersion(){return this.request("/api/version")}async getDutchieAZDashboard(){return this.request("/api/az/dashboard")}async getDutchieAZSchedules(){return this.request("/api/az/admin/schedules")}async getDutchieAZSchedule(t){return this.request(`/api/az/admin/schedules/${t}`)}async createDutchieAZSchedule(t){return this.request("/api/az/admin/schedules",{method:"POST",body:JSON.stringify(t)})}async updateDutchieAZSchedule(t,r){return this.request(`/api/az/admin/schedules/${t}`,{method:"PUT",body:JSON.stringify(r)})}async deleteDutchieAZSchedule(t){return this.request(`/api/az/admin/schedules/${t}`,{method:"DELETE"})}async triggerDutchieAZSchedule(t){return this.request(`/api/az/admin/schedules/${t}/trigger`,{method:"POST"})}async initDutchieAZSchedules(){return this.request("/api/az/admin/schedules/init",{method:"POST"})}async getDutchieAZScheduleLogs(t,r,n){const i=new URLSearchParams;r&&i.append("limit",r.toString()),n&&i.append("offset",n.toString());const s=i.toString()?`?${i.toString()}`:"";return this.request(`/api/az/admin/schedules/${t}/logs${s}`)}async getDutchieAZRunLogs(t){const r=new URLSearchParams;t!=null&&t.scheduleId&&r.append("scheduleId",t.scheduleId.toString()),t!=null&&t.jobName&&r.append("jobName",t.jobName),t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.offset&&r.append("offset",t.offset.toString());const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/az/admin/run-logs${n}`)}async getDutchieAZSchedulerStatus(){return this.request("/api/az/admin/scheduler/status")}async startDutchieAZScheduler(){return this.request("/api/az/admin/scheduler/start",{method:"POST"})}async stopDutchieAZScheduler(){return this.request("/api/az/admin/scheduler/stop",{method:"POST"})}async triggerDutchieAZImmediateCrawl(){return this.request("/api/az/admin/scheduler/trigger",{method:"POST"})}async getDutchieAZStores(t){const r=new URLSearchParams;t!=null&&t.city&&r.append("city",t.city),(t==null?void 0:t.hasPlatformId)!==void 0&&r.append("hasPlatformId",String(t.hasPlatformId)),t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.offset&&r.append("offset",t.offset.toString());const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/az/stores${n}`)}async getDutchieAZStore(t){return this.request(`/api/az/stores/${t}`)}async getDutchieAZStoreSummary(t){return this.request(`/api/az/stores/${t}/summary`)}async getDutchieAZStoreProducts(t,r){const n=new URLSearchParams;r!=null&&r.stockStatus&&n.append("stockStatus",r.stockStatus),r!=null&&r.type&&n.append("type",r.type),r!=null&&r.subcategory&&n.append("subcategory",r.subcategory),r!=null&&r.brandName&&n.append("brandName",r.brandName),r!=null&&r.search&&n.append("search",r.search),r!=null&&r.limit&&n.append("limit",r.limit.toString()),r!=null&&r.offset&&n.append("offset",r.offset.toString());const i=n.toString()?`?${n.toString()}`:"";return this.request(`/api/az/stores/${t}/products${i}`)}async getDutchieAZStoreBrands(t){return this.request(`/api/az/stores/${t}/brands`)}async getDutchieAZStoreCategories(t){return this.request(`/api/az/stores/${t}/categories`)}async getDutchieAZBrands(t){const r=new URLSearchParams;t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.offset&&r.append("offset",t.offset.toString());const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/az/brands${n}`)}async getDutchieAZCategories(){return this.request("/api/az/categories")}async getDutchieAZDebugSummary(){return this.request("/api/az/debug/summary")}async getDutchieAZDebugStore(t){return this.request(`/api/az/debug/store/${t}`)}async triggerDutchieAZCrawl(t,r){return this.request(`/api/az/admin/crawl/${t}`,{method:"POST",body:JSON.stringify(r||{})})}async getDetectionStats(){return this.request("/api/az/admin/detection/stats")}async getDispensariesNeedingDetection(t){const r=new URLSearchParams;t!=null&&t.state&&r.append("state",t.state),t!=null&&t.limit&&r.append("limit",t.limit.toString());const n=r.toString()?`?${r.toString()}`:"";return this.request(`/api/az/admin/detection/pending${n}`)}async detectDispensary(t){return this.request(`/api/az/admin/detection/detect/${t}`,{method:"POST"})}async detectAllDispensaries(t){return this.request("/api/az/admin/detection/detect-all",{method:"POST",body:JSON.stringify(t||{})})}async triggerMenuDetectionJob(){return this.request("/api/az/admin/detection/trigger",{method:"POST"})}}const B=new EA(OA),Ph=AA(e=>({user:null,token:localStorage.getItem("token"),isAuthenticated:!!localStorage.getItem("token"),login:async(t,r)=>{const n=await B.login(t,r);localStorage.setItem("token",n.token),e({user:n.user,token:n.token,isAuthenticated:!0})},logout:()=>{localStorage.removeItem("token"),e({user:null,token:null,isAuthenticated:!1})},checkAuth:async()=>{try{const t=await B.getMe();e({user:t.user,isAuthenticated:!0})}catch{localStorage.removeItem("token"),e({user:null,token:null,isAuthenticated:!1})}}}));function DA(){const[e,t]=h.useState("admin@example.com"),[r,n]=h.useState("password"),[i,s]=h.useState(""),[o,l]=h.useState(!1),c=dt(),d=Ph(f=>f.login),u=async f=>{f.preventDefault(),s(""),l(!0);try{await d(e,r),c("/")}catch(p){s(p.message||"Login failed")}finally{l(!1)}};return a.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)"},children:a.jsxs("div",{style:{background:"white",padding:"40px",borderRadius:"12px",boxShadow:"0 10px 40px rgba(0,0,0,0.2)",width:"100%",maxWidth:"400px"},children:[a.jsx("h1",{style:{marginBottom:"10px",fontSize:"28px"},children:"Dutchie Menus"}),a.jsx("p",{style:{color:"#666",marginBottom:"30px"},children:"Admin Dashboard"}),i&&a.jsx("div",{style:{background:"#fee",color:"#c33",padding:"12px",borderRadius:"6px",marginBottom:"20px",fontSize:"14px"},children:i}),a.jsxs("form",{onSubmit:u,children:[a.jsxs("div",{style:{marginBottom:"20px"},children:[a.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"500"},children:"Email"}),a.jsx("input",{type:"email",value:e,onChange:f=>t(f.target.value),required:!0,style:{width:"100%",padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px"}})]}),a.jsxs("div",{style:{marginBottom:"25px"},children:[a.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"500"},children:"Password"}),a.jsx("input",{type:"password",value:r,onChange:f=>n(f.target.value),required:!0,style:{width:"100%",padding:"12px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px"}})]}),a.jsx("button",{type:"submit",disabled:o,style:{width:"100%",padding:"14px",background:o?"#999":"#667eea",color:"white",border:"none",borderRadius:"6px",cursor:o?"not-allowed":"pointer",fontSize:"16px",fontWeight:"500",transition:"background 0.2s"},children:o?"Logging in...":"Login"})]})]})})}/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const TA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),MA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),Dx=e=>{const t=MA(e);return t.charAt(0).toUpperCase()+t.slice(1)},Q1=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),IA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var $A={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const LA=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:o,...l},c)=>h.createElement("svg",{ref:c,...$A,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Q1("lucide",i),...!s&&!IA(l)&&{"aria-hidden":"true"},...l},[...o.map(([d,u])=>h.createElement(d,u)),...Array.isArray(s)?s:[s]]));/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Q=(e,t)=>{const r=h.forwardRef(({className:n,...i},s)=>h.createElement(LA,{ref:s,iconNode:t,className:Q1(`lucide-${TA(Dx(e))}`,`lucide-${e}`,n),...i}));return r.displayName=Dx(e),r};/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zA=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Ds=Q("activity",zA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const RA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],_h=Q("arrow-left",RA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const BA=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],Ln=Q("building-2",BA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const FA=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],WA=Q("building",FA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const UA=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Ch=Q("calendar",UA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qA=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],HA=Q("chart-column",qA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const KA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ej=Q("chevron-down",KA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const VA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Cf=Q("chevron-right",VA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const YA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Uc=Q("circle-alert",YA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const GA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],_r=Q("circle-check-big",GA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ZA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Hr=Q("circle-x",ZA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const XA=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],xr=Q("clock",XA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const JA=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],QA=Q("dollar-sign",JA);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eO=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Jr=Q("external-link",eO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tO=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],rO=Q("eye",tO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nO=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],iO=Q("file-text",nO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aO=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],sO=Q("folder-open",aO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oO=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],lO=Q("image",oO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cO=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],uO=Q("key",cO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dO=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],Tx=Q("layers",dO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fO=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],pO=Q("layout-dashboard",fO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hO=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],mO=Q("log-out",hO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gO=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],tj=Q("mail",gO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xO=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],yi=Q("map-pin",xO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yO=[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]],vO=Q("mouse-pointer",yO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bO=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Ct=Q("package",bO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jO=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],wO=Q("pencil",jO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const SO=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Ah=Q("phone",SO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const NO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Af=Q("plus",NO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kO=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Xt=Q("refresh-cw",kO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const PO=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],_O=Q("save",PO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const CO=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],AO=Q("search",CO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const OO=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],EO=Q("settings",OO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const DO=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],sl=Q("shield",DO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const TO=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]],Il=Q("store",TO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const MO=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Cr=Q("tag",MO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const IO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],rj=Q("target",IO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $O=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Mx=Q("toggle-left",$O);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const LO=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Ix=Q("toggle-right",LO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zO=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],RO=Q("trash-2",zO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const BO=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],FO=Q("trending-down",BO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const WO=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],zn=Q("trending-up",WO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const UO=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],nj=Q("triangle-alert",UO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qO=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],HO=Q("upload",qO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const KO=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],VO=Q("wrench",KO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const YO=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ij=Q("x",YO);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const GO=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],$x=Q("zap",GO);function Ge({to:e,icon:t,label:r,isActive:n}){return a.jsxs("a",{href:e,className:`flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${n?"bg-blue-50 text-blue-600":"text-gray-700 hover:bg-gray-50"}`,children:[a.jsx("span",{className:"flex-shrink-0",children:t}),a.jsx("span",{children:r})]})}function Do({title:e,children:t}){return a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"px-3 mb-2",children:a.jsx("h3",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider",children:e})}),t]})}function X({children:e}){const t=dt(),r=_i(),{user:n,logout:i}=Ph(),[s,o]=h.useState(null);h.useEffect(()=>{(async()=>{try{const u=await B.getVersion();o(u)}catch(u){console.error("Failed to fetch version info:",u)}})()},[]);const l=()=>{i(),t("/login")},c=(d,u=!0)=>u?r.pathname===d:r.pathname.startsWith(d);return a.jsxs("div",{className:"flex min-h-screen bg-gray-50",children:[a.jsxs("div",{className:"w-64 bg-white border-r border-gray-200 flex flex-col",style:{position:"sticky",top:0,height:"100vh",overflowY:"auto"},children:[a.jsxs("div",{className:"px-6 py-5 border-b border-gray-200",children:[a.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Dutchie Analytics"}),a.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:n==null?void 0:n.email})]}),a.jsxs("nav",{className:"flex-1 px-3 py-4 space-y-6",children:[a.jsxs(Do,{title:"Main",children:[a.jsx(Ge,{to:"/",icon:a.jsx(pO,{className:"w-4 h-4"}),label:"Dashboard",isActive:c("/",!0)}),a.jsx(Ge,{to:"/dispensaries",icon:a.jsx(Ln,{className:"w-4 h-4"}),label:"Dispensaries",isActive:c("/dispensaries")}),a.jsx(Ge,{to:"/categories",icon:a.jsx(sO,{className:"w-4 h-4"}),label:"Categories",isActive:c("/categories")}),a.jsx(Ge,{to:"/products",icon:a.jsx(Ct,{className:"w-4 h-4"}),label:"Products",isActive:c("/products")}),a.jsx(Ge,{to:"/campaigns",icon:a.jsx(rj,{className:"w-4 h-4"}),label:"Campaigns",isActive:c("/campaigns")}),a.jsx(Ge,{to:"/analytics",icon:a.jsx(zn,{className:"w-4 h-4"}),label:"Analytics",isActive:c("/analytics")})]}),a.jsxs(Do,{title:"AZ Data",children:[a.jsx(Ge,{to:"/wholesale-analytics",icon:a.jsx(zn,{className:"w-4 h-4"}),label:"Wholesale Analytics",isActive:c("/wholesale-analytics")}),a.jsx(Ge,{to:"/az",icon:a.jsx(Il,{className:"w-4 h-4"}),label:"AZ Stores",isActive:c("/az",!1)}),a.jsx(Ge,{to:"/az-schedule",icon:a.jsx(Ch,{className:"w-4 h-4"}),label:"AZ Schedule",isActive:c("/az-schedule")})]}),a.jsxs(Do,{title:"Scraper",children:[a.jsx(Ge,{to:"/scraper-tools",icon:a.jsx(VO,{className:"w-4 h-4"}),label:"Tools",isActive:c("/scraper-tools")}),a.jsx(Ge,{to:"/scraper-schedule",icon:a.jsx(xr,{className:"w-4 h-4"}),label:"Schedule",isActive:c("/scraper-schedule")}),a.jsx(Ge,{to:"/scraper-monitor",icon:a.jsx(Ds,{className:"w-4 h-4"}),label:"Monitor",isActive:c("/scraper-monitor")})]}),a.jsxs(Do,{title:"System",children:[a.jsx(Ge,{to:"/changes",icon:a.jsx(_r,{className:"w-4 h-4"}),label:"Change Approval",isActive:c("/changes")}),a.jsx(Ge,{to:"/api-permissions",icon:a.jsx(uO,{className:"w-4 h-4"}),label:"API Permissions",isActive:c("/api-permissions")}),a.jsx(Ge,{to:"/proxies",icon:a.jsx(sl,{className:"w-4 h-4"}),label:"Proxies",isActive:c("/proxies")}),a.jsx(Ge,{to:"/logs",icon:a.jsx(iO,{className:"w-4 h-4"}),label:"Logs",isActive:c("/logs")}),a.jsx(Ge,{to:"/settings",icon:a.jsx(EO,{className:"w-4 h-4"}),label:"Settings",isActive:c("/settings")})]})]}),a.jsx("div",{className:"px-3 py-4 border-t border-gray-200",children:a.jsxs("button",{onClick:l,className:"w-full flex items-center gap-3 px-3 py-2 rounded-lg text-sm font-medium text-red-600 hover:bg-red-50 transition-colors",children:[a.jsx(mO,{className:"w-4 h-4"}),a.jsx("span",{children:"Logout"})]})}),s&&a.jsxs("div",{className:"px-3 py-2 border-t border-gray-200 bg-gray-50",children:[a.jsxs("p",{className:"text-xs text-gray-500 text-center",children:[s.build_version," (",s.git_sha.slice(0,7),")"]}),a.jsx("p",{className:"text-xs text-gray-400 text-center mt-0.5",children:s.image_tag})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",children:a.jsx("div",{className:"max-w-7xl mx-auto px-8 py-8",children:e})})]})}function aj(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=aj(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ce(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=aj(e))&&(n&&(n+=" "),n+=t);return n}var ZO=["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 Oh(e){if(typeof e!="string")return!1;var t=ZO;return t.includes(e)}var XO=["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"];function sj(e){if(typeof e!="string")return!1;var t=XO;return t.includes(e)}function oj(e){return typeof e=="string"&&e.startsWith("data-")}function nr(e){var t=Object.entries(e).filter(r=>{var[n]=r;return sj(n)||oj(n)});return Object.fromEntries(t)}function qc(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return nr(t)}return typeof e=="object"&&!Array.isArray(e)?nr(e):null}function ut(e){var t=Object.entries(e).filter(r=>{var[n]=r;return sj(n)||oj(n)||Oh(n)});return Object.fromEntries(t)}function JO(e){return e==null?null:h.isValidElement(e)?ut(e.props):typeof e=="object"&&!Array.isArray(e)?ut(e):null}var QO=["children","width","height","viewBox","className","style","title","desc"];function Of(){return Of=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Of.apply(null,arguments)}function e6(e,t){if(e==null)return{};var r,n,i=t6(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function t6(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var lj=h.forwardRef((e,t)=>{var{children:r,width:n,height:i,viewBox:s,className:o,style:l,title:c,desc:d}=e,u=e6(e,QO),f=s||{width:n,height:i,x:0,y:0},p=ce("recharts-surface",o);return h.createElement("svg",Of({},ut(u),{className:p,width:n,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),h.createElement("title",null,c),h.createElement("desc",null,d),r)}),r6=["children","className"];function Ef(){return Ef=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ef.apply(null,arguments)}function n6(e,t){if(e==null)return{};var r,n,i=i6(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i6(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var ir=h.forwardRef((e,t)=>{var{children:r,className:n}=e,i=n6(e,r6),s=ce("recharts-layer",n);return h.createElement("g",Ef({className:s},ut(i),{ref:t}),r)}),a6=h.createContext(null);function he(e){return function(){return e}}const cj=Math.cos,$l=Math.sin,vr=Math.sqrt,Ll=Math.PI,Hc=2*Ll,Df=Math.PI,Tf=2*Df,Xn=1e-6,s6=Tf-Xn;function uj(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function o6(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return uj;const r=10**t;return function(n){this._+=n[0];for(let i=1,s=n.length;i<s;++i)this._+=Math.round(arguments[i]*r)/r+n[i]}}class l6{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?uj:o6(t)}moveTo(t,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,r){this._append`L${this._x1=+t},${this._y1=+r}`}quadraticCurveTo(t,r,n,i){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+i}`}bezierCurveTo(t,r,n,i,s,o){this._append`C${+t},${+r},${+n},${+i},${this._x1=+s},${this._y1=+o}`}arcTo(t,r,n,i,s){if(t=+t,r=+r,n=+n,i=+i,s=+s,s<0)throw new Error(`negative radius: ${s}`);let o=this._x1,l=this._y1,c=n-t,d=i-r,u=o-t,f=l-r,p=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(p>Xn)if(!(Math.abs(f*c-d*u)>Xn)||!s)this._append`L${this._x1=t},${this._y1=r}`;else{let m=n-o,x=i-l,g=c*c+d*d,b=m*m+x*x,v=Math.sqrt(g),j=Math.sqrt(p),y=s*Math.tan((Df-Math.acos((g+p-b)/(2*v*j)))/2),w=y/j,S=y/v;Math.abs(w-1)>Xn&&this._append`L${t+w*u},${r+w*f}`,this._append`A${s},${s},0,0,${+(f*m>u*x)},${this._x1=t+S*c},${this._y1=r+S*d}`}}arc(t,r,n,i,s,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(i),c=n*Math.sin(i),d=t+l,u=r+c,f=1^o,p=o?i-s:s-i;this._x1===null?this._append`M${d},${u}`:(Math.abs(this._x1-d)>Xn||Math.abs(this._y1-u)>Xn)&&this._append`L${d},${u}`,n&&(p<0&&(p=p%Tf+Tf),p>s6?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=d},${this._y1=u}`:p>Xn&&this._append`A${n},${n},0,${+(p>=Df)},${f},${this._x1=t+n*Math.cos(s)},${this._y1=r+n*Math.sin(s)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Eh(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new l6(t)}function Dh(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dj(e){this._context=e}dj.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 Kc(e){return new dj(e)}function fj(e){return e[0]}function pj(e){return e[1]}function hj(e,t){var r=he(!0),n=null,i=Kc,s=null,o=Eh(l);e=typeof e=="function"?e:e===void 0?fj:he(e),t=typeof t=="function"?t:t===void 0?pj:he(t);function l(c){var d,u=(c=Dh(c)).length,f,p=!1,m;for(n==null&&(s=i(m=o())),d=0;d<=u;++d)!(d<u&&r(f=c[d],d,c))===p&&((p=!p)?s.lineStart():s.lineEnd()),p&&s.point(+e(f,d,c),+t(f,d,c));if(m)return s=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:he(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:he(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:he(!!c),l):r},l.curve=function(c){return arguments.length?(i=c,n!=null&&(s=i(n)),l):i},l.context=function(c){return arguments.length?(c==null?n=s=null:s=i(n=c),l):n},l}function To(e,t,r){var n=null,i=he(!0),s=null,o=Kc,l=null,c=Eh(d);e=typeof e=="function"?e:e===void 0?fj:he(+e),t=typeof t=="function"?t:he(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?pj:he(+r);function d(f){var p,m,x,g=(f=Dh(f)).length,b,v=!1,j,y=new Array(g),w=new Array(g);for(s==null&&(l=o(j=c())),p=0;p<=g;++p){if(!(p<g&&i(b=f[p],p,f))===v)if(v=!v)m=p,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=p-1;x>=m;--x)l.point(y[x],w[x]);l.lineEnd(),l.areaEnd()}v&&(y[p]=+e(b,p,f),w[p]=+t(b,p,f),l.point(n?+n(b,p,f):y[p],r?+r(b,p,f):w[p]))}if(j)return l=null,j+""||null}function u(){return hj().defined(i).curve(o).context(s)}return d.x=function(f){return arguments.length?(e=typeof f=="function"?f:he(+f),n=null,d):e},d.x0=function(f){return arguments.length?(e=typeof f=="function"?f:he(+f),d):e},d.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:he(+f),d):n},d.y=function(f){return arguments.length?(t=typeof f=="function"?f:he(+f),r=null,d):t},d.y0=function(f){return arguments.length?(t=typeof f=="function"?f:he(+f),d):t},d.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:he(+f),d):r},d.lineX0=d.lineY0=function(){return u().x(e).y(t)},d.lineY1=function(){return u().x(e).y(r)},d.lineX1=function(){return u().x(n).y(t)},d.defined=function(f){return arguments.length?(i=typeof f=="function"?f:he(!!f),d):i},d.curve=function(f){return arguments.length?(o=f,s!=null&&(l=o(s)),d):o},d.context=function(f){return arguments.length?(f==null?s=l=null:l=o(s=f),d):s},d}class mj{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function c6(e){return new mj(e,!0)}function u6(e){return new mj(e,!1)}const Th={draw(e,t){const r=vr(t/Ll);e.moveTo(r,0),e.arc(0,0,r,0,Hc)}},d6={draw(e,t){const r=vr(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},gj=vr(1/3),f6=gj*2,p6={draw(e,t){const r=vr(t/f6),n=r*gj;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},h6={draw(e,t){const r=vr(t),n=-r/2;e.rect(n,n,r,r)}},m6=.8908130915292852,xj=$l(Ll/10)/$l(7*Ll/10),g6=$l(Hc/10)*xj,x6=-cj(Hc/10)*xj,y6={draw(e,t){const r=vr(t*m6),n=g6*r,i=x6*r;e.moveTo(0,-r),e.lineTo(n,i);for(let s=1;s<5;++s){const o=Hc*s/5,l=cj(o),c=$l(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*i,c*n+l*i)}e.closePath()}},cd=vr(3),v6={draw(e,t){const r=-vr(t/(cd*3));e.moveTo(0,r*2),e.lineTo(-cd*r,-r),e.lineTo(cd*r,-r),e.closePath()}},Ht=-.5,Kt=vr(3)/2,Mf=1/vr(12),b6=(Mf/2+1)*3,j6={draw(e,t){const r=vr(t/b6),n=r/2,i=r*Mf,s=n,o=r*Mf+r,l=-s,c=o;e.moveTo(n,i),e.lineTo(s,o),e.lineTo(l,c),e.lineTo(Ht*n-Kt*i,Kt*n+Ht*i),e.lineTo(Ht*s-Kt*o,Kt*s+Ht*o),e.lineTo(Ht*l-Kt*c,Kt*l+Ht*c),e.lineTo(Ht*n+Kt*i,Ht*i-Kt*n),e.lineTo(Ht*s+Kt*o,Ht*o-Kt*s),e.lineTo(Ht*l+Kt*c,Ht*c-Kt*l),e.closePath()}};function w6(e,t){let r=null,n=Eh(i);e=typeof e=="function"?e:he(e||Th),t=typeof t=="function"?t:he(t===void 0?64:+t);function i(){let s;if(r||(r=s=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),s)return r=null,s+""||null}return i.type=function(s){return arguments.length?(e=typeof s=="function"?s:he(s),i):e},i.size=function(s){return arguments.length?(t=typeof s=="function"?s:he(+s),i):t},i.context=function(s){return arguments.length?(r=s??null,i):r},i}function zl(){}function Rl(e,t,r){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+r)/6)}function yj(e){this._context=e}yj.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:Rl(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:Rl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function S6(e){return new yj(e)}function vj(e){this._context=e}vj.prototype={areaStart:zl,areaEnd:zl,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:Rl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function N6(e){return new vj(e)}function bj(e){this._context=e}bj.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Rl(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function k6(e){return new bj(e)}function jj(e){this._context=e}jj.prototype={areaStart:zl,areaEnd:zl,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 P6(e){return new jj(e)}function Lx(e){return e<0?-1:1}function zx(e,t,r){var n=e._x1-e._x0,i=t-e._x1,s=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),l=(s*i+o*n)/(n+i);return(Lx(s)+Lx(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(l))||0}function Rx(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function ud(e,t,r){var n=e._x0,i=e._y0,s=e._x1,o=e._y1,l=(s-n)/3;e._context.bezierCurveTo(n+l,i+l*t,s-l,o-l*r,s,o)}function Bl(e){this._context=e}Bl.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:ud(this,this._t0,Rx(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 r=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,ud(this,Rx(this,r=zx(this,e,t)),r);break;default:ud(this,this._t0,r=zx(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function wj(e){this._context=new Sj(e)}(wj.prototype=Object.create(Bl.prototype)).point=function(e,t){Bl.prototype.point.call(this,t,e)};function Sj(e){this._context=e}Sj.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,r,n,i,s){this._context.bezierCurveTo(t,e,n,r,s,i)}};function _6(e){return new Bl(e)}function C6(e){return new wj(e)}function Nj(e){this._context=e}Nj.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Bx(e),i=Bx(t),s=0,o=1;o<r;++s,++o)this._context.bezierCurveTo(n[0][s],i[0][s],n[1][s],i[1][s],e[o],t[o]);(this._line||this._line!==0&&r===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 Bx(e){var t,r=e.length-1,n,i=new Array(r),s=new Array(r),o=new Array(r);for(i[0]=0,s[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,s[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,s[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/s[t-1],s[t]-=n,o[t]-=n*o[t-1];for(i[r-1]=o[r-1]/s[r-1],t=r-2;t>=0;--t)i[t]=(o[t]-i[t+1])/s[t];for(s[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)s[t]=2*e[t+1]-i[t+1];return[i,s]}function A6(e){return new Nj(e)}function Vc(e,t){this._context=e,this._t=t}Vc.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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function O6(e){return new Vc(e,.5)}function E6(e){return new Vc(e,0)}function D6(e){return new Vc(e,1)}function pa(e,t){if((o=e.length)>1)for(var r=1,n,i,s=e[t[0]],o,l=s.length;r<o;++r)for(i=s,s=e[t[r]],n=0;n<l;++n)s[n][1]+=s[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function If(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function T6(e,t){return e[t]}function M6(e){const t=[];return t.key=e,t}function I6(){var e=he([]),t=If,r=pa,n=T6;function i(s){var o=Array.from(e.apply(this,arguments),M6),l,c=o.length,d=-1,u;for(const f of s)for(l=0,++d;l<c;++l)(o[l][d]=[0,+n(f,o[l].key,d,s)]).data=f;for(l=0,u=Dh(t(o));l<c;++l)o[u[l]].index=l;return r(o,u),o}return i.keys=function(s){return arguments.length?(e=typeof s=="function"?s:he(Array.from(s)),i):e},i.value=function(s){return arguments.length?(n=typeof s=="function"?s:he(+s),i):n},i.order=function(s){return arguments.length?(t=s==null?If:typeof s=="function"?s:he(Array.from(s)),i):t},i.offset=function(s){return arguments.length?(r=s??pa,i):r},i}function $6(e,t){if((n=e.length)>0){for(var r,n,i=0,s=e[0].length,o;i<s;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}pa(e,t)}}function L6(e,t){if((i=e.length)>0){for(var r=0,n=e[t[0]],i,s=n.length;r<s;++r){for(var o=0,l=0;o<i;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}pa(e,t)}}function z6(e,t){if(!(!((o=e.length)>0)||!((s=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,s,o;n<s;++n){for(var l=0,c=0,d=0;l<o;++l){for(var u=e[t[l]],f=u[n][1]||0,p=u[n-1][1]||0,m=(f-p)/2,x=0;x<l;++x){var g=e[t[x]],b=g[n][1]||0,v=g[n-1][1]||0;m+=b-v}c+=f,d+=m*f}i[n-1][1]+=i[n-1][0]=r,c&&(r-=d/c)}i[n-1][1]+=i[n-1][0]=r,pa(e,t)}}var Yc={},kj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==="__proto__"}e.isUnsafeProperty=t})(kj);var Mh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){switch(typeof r){case"number":case"symbol":return!1;case"string":return r.includes(".")||r.includes("[")||r.includes("]")}}e.isDeepKey=t})(Mh);var Gc={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var n;return typeof r=="string"||typeof r=="symbol"?r:Object.is((n=r==null?void 0:r.valueOf)==null?void 0:n.call(r),-0)?"-0":String(r)}e.toKey=t})(Gc);var Zc={},Pj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){if(r==null)return"";if(typeof r=="string")return r;if(Array.isArray(r))return r.map(t).join(",");const n=String(r);return n==="0"&&Object.is(Number(r),-0)?"-0":n}e.toString=t})(Pj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Pj,r=Gc;function n(i){if(Array.isArray(i))return i.map(r.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const s=[],o=i.length;if(o===0)return s;let l=0,c="",d="",u=!1;for(i.charCodeAt(0)===46&&(s.push(""),l++);l<o;){const f=i[l];d?f==="\\"&&l+1<o?(l++,c+=i[l]):f===d?d="":c+=f:u?f==='"'||f==="'"?d=f:f==="]"?(u=!1,s.push(c),c=""):c+=f:f==="["?(u=!0,c&&(s.push(c),c="")):f==="."?c&&(s.push(c),c=""):c+=f,l++}return c&&s.push(c),s}e.toPath=n})(Zc);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kj,r=Mh,n=Gc,i=Zc;function s(l,c,d){if(l==null)return d;switch(typeof c){case"string":{if(t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?r.isDeepKey(c)?s(l,i.toPath(c),d):d:u}case"number":case"symbol":{typeof c=="number"&&(c=n.toKey(c));const u=l[c];return u===void 0?d:u}default:{if(Array.isArray(c))return o(l,c,d);if(Object.is(c==null?void 0:c.valueOf(),-0)?c="-0":c=String(c),t.isUnsafeProperty(c))return d;const u=l[c];return u===void 0?d:u}}}function o(l,c,d){if(c.length===0)return d;let u=l;for(let f=0;f<c.length;f++){if(u==null||t.isUnsafeProperty(c[f]))return d;u=u[c[f]]}return u===void 0?d:u}e.get=s})(Yc);var R6=Yc.get;const Xc=Tr(R6);var Jt=e=>e===0?0:e>0?1:-1,yr=e=>typeof e=="number"&&e!=+e,Qr=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Y=e=>(typeof e=="number"||e instanceof Number)&&!yr(e),Or=e=>Y(e)||typeof e=="string",B6=0,Ts=e=>{var t=++B6;return"".concat(e||"").concat(t)},Rn=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Y(t)&&typeof t!="string")return n;var s;if(Qr(t)){if(r==null)return n;var o=t.indexOf("%");s=r*parseFloat(t.slice(0,o))/100}else s=+t;return yr(s)&&(s=n),i&&r!=null&&s>r&&(s=r),s},_j=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++)if(!r[e[n]])r[e[n]]=!0;else return!0;return!1};function De(e,t,r){return Y(e)&&Y(t)?e+r*(t-e):t}function Cj(e,t,r){if(!(!e||!e.length))return e.find(n=>n&&(typeof t=="function"?t(n):Xc(n,t))===r)}var Re=e=>e===null||typeof e>"u",Xs=e=>Re(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function F6(e){return e!=null}function ka(){}var W6=["type","size","sizeType"];function $f(){return $f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$f.apply(null,arguments)}function Fx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fx(Object(r),!0).forEach(function(n){U6(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fx(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function U6(e,t,r){return(t=q6(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q6(e){var t=H6(e,"string");return typeof t=="symbol"?t:t+""}function H6(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K6(e,t){if(e==null)return{};var r,n,i=V6(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function V6(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Aj={symbolCircle:Th,symbolCross:d6,symbolDiamond:p6,symbolSquare:h6,symbolStar:y6,symbolTriangle:v6,symbolWye:j6},Y6=Math.PI/180,G6=e=>{var t="symbol".concat(Xs(e));return Aj[t]||Th},Z6=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*Y6;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**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}},X6=(e,t)=>{Aj["symbol".concat(Xs(e))]=t},Oj=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,i=K6(e,W6),s=Wx(Wx({},i),{},{type:t,size:r,sizeType:n}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var p=G6(o),m=w6().type(p).size(Z6(r,n,o)),x=m();if(x!==null)return x},{className:c,cx:d,cy:u}=s,f=ut(s);return Y(d)&&Y(u)&&Y(r)?h.createElement("path",$f({},f,{className:ce("recharts-symbols",c),transform:"translate(".concat(d,", ").concat(u,")"),d:l()})):null};Oj.registerSymbol=X6;var Ej=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Ih=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(h.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Oh(i)&&(n[i]=s=>r[i](r,s))}),n},J6=(e,t,r)=>n=>(e(t,r,n),null),Q6=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var s=e[i];Oh(i)&&typeof s=="function"&&(n||(n={}),n[i]=J6(s,t,r))}),n};function Ux(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function e4(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ux(Object(r),!0).forEach(function(n){t4(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ux(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function t4(e,t,r){return(t=r4(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r4(e){var t=n4(e,"string");return typeof t=="symbol"?t:t+""}function n4(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ft(e,t){var r=e4({},e),n=t,i=Object.keys(t),s=i.reduce((o,l)=>(o[l]===void 0&&n[l]!==void 0&&(o[l]=n[l]),o),r);return s}var Dj={},Tj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const i=new Map;for(let s=0;s<r.length;s++){const o=r[s],l=n(o);i.has(l)||i.set(l,o)}return Array.from(i.values())}e.uniqBy=t})(Tj);var $h={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r}e.identity=t})($h);var Mj={},Jc={},Ij={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Number.isSafeInteger(r)&&r>=0}e.isLength=t})(Ij);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ij;function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(Jc);var $j={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})($j);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Jc,r=$j;function n(i){return r.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=n})(Mj);var Lj={},zj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Yc;function r(n){return function(i){return t.get(i,n)}}e.property=r})(zj);var Rj={},Lh={},Bj={},zh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(zh);var Rh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(Rh);var Bh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return r===n||Number.isNaN(r)&&Number.isNaN(n)}e.eq=t})(Bh);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zh,r=Rh,n=Bh;function i(u,f,p){return typeof p!="function"?i(u,f,()=>{}):s(u,f,function m(x,g,b,v,j,y){const w=p(x,g,b,v,j,y);return w!==void 0?!!w:s(x,g,m,y)},new Map)}function s(u,f,p,m){if(f===u)return!0;switch(typeof f){case"object":return o(u,f,p,m);case"function":return Object.keys(f).length>0?s(u,{...f},p,m):n.eq(u,f);default:return t.isObject(u)?typeof f=="string"?f==="":!0:n.eq(u,f)}}function o(u,f,p,m){if(f==null)return!0;if(Array.isArray(f))return c(u,f,p,m);if(f instanceof Map)return l(u,f,p,m);if(f instanceof Set)return d(u,f,p,m);const x=Object.keys(f);if(u==null)return x.length===0;if(x.length===0)return!0;if(m!=null&&m.has(f))return m.get(f)===u;m==null||m.set(f,u);try{for(let g=0;g<x.length;g++){const b=x[g];if(!r.isPrimitive(u)&&!(b in u)||f[b]===void 0&&u[b]!==void 0||f[b]===null&&u[b]!==null||!p(u[b],f[b],b,u,f,m))return!1}return!0}finally{m==null||m.delete(f)}}function l(u,f,p,m){if(f.size===0)return!0;if(!(u instanceof Map))return!1;for(const[x,g]of f.entries()){const b=u.get(x);if(p(b,g,x,u,f,m)===!1)return!1}return!0}function c(u,f,p,m){if(f.length===0)return!0;if(!Array.isArray(u))return!1;const x=new Set;for(let g=0;g<f.length;g++){const b=f[g];let v=!1;for(let j=0;j<u.length;j++){if(x.has(j))continue;const y=u[j];let w=!1;if(p(y,b,g,u,f,m)&&(w=!0),w){x.add(j),v=!0;break}}if(!v)return!1}return!0}function d(u,f,p,m){return f.size===0?!0:u instanceof Set?c([...u],[...f],p,m):!1}e.isMatchWith=i,e.isSetMatch=d})(Bj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bj;function r(n,i){return t.isMatchWith(n,i,()=>{})}e.isMatch=r})(Lh);var Fj={},Fh={},Wj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}e.getSymbols=t})(Wj);var Wh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t})(Wh);var Uh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",n="[object Number]",i="[object Boolean]",s="[object Arguments]",o="[object Symbol]",l="[object Date]",c="[object Map]",d="[object Set]",u="[object Array]",f="[object Function]",p="[object ArrayBuffer]",m="[object Object]",x="[object Error]",g="[object DataView]",b="[object Uint8Array]",v="[object Uint8ClampedArray]",j="[object Uint16Array]",y="[object Uint32Array]",w="[object BigUint64Array]",S="[object Int8Array]",N="[object Int16Array]",P="[object Int32Array]",_="[object BigInt64Array]",T="[object Float32Array]",$="[object Float64Array]";e.argumentsTag=s,e.arrayBufferTag=p,e.arrayTag=u,e.bigInt64ArrayTag=_,e.bigUint64ArrayTag=w,e.booleanTag=i,e.dataViewTag=g,e.dateTag=l,e.errorTag=x,e.float32ArrayTag=T,e.float64ArrayTag=$,e.functionTag=f,e.int16ArrayTag=N,e.int32ArrayTag=P,e.int8ArrayTag=S,e.mapTag=c,e.numberTag=n,e.objectTag=m,e.regexpTag=t,e.setTag=d,e.stringTag=r,e.symbolTag=o,e.uint16ArrayTag=j,e.uint32ArrayTag=y,e.uint8ArrayTag=b,e.uint8ClampedArrayTag=v})(Uh);var Uj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})(Uj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wj,r=Wh,n=Uh,i=Rh,s=Uj;function o(u,f){return l(u,void 0,u,new Map,f)}function l(u,f,p,m=new Map,x=void 0){const g=x==null?void 0:x(u,f,p,m);if(g!==void 0)return g;if(i.isPrimitive(u))return u;if(m.has(u))return m.get(u);if(Array.isArray(u)){const b=new Array(u.length);m.set(u,b);for(let v=0;v<u.length;v++)b[v]=l(u[v],v,p,m,x);return Object.hasOwn(u,"index")&&(b.index=u.index),Object.hasOwn(u,"input")&&(b.input=u.input),b}if(u instanceof Date)return new Date(u.getTime());if(u instanceof RegExp){const b=new RegExp(u.source,u.flags);return b.lastIndex=u.lastIndex,b}if(u instanceof Map){const b=new Map;m.set(u,b);for(const[v,j]of u)b.set(v,l(j,v,p,m,x));return b}if(u instanceof Set){const b=new Set;m.set(u,b);for(const v of u)b.add(l(v,void 0,p,m,x));return b}if(typeof Buffer<"u"&&Buffer.isBuffer(u))return u.subarray();if(s.isTypedArray(u)){const b=new(Object.getPrototypeOf(u)).constructor(u.length);m.set(u,b);for(let v=0;v<u.length;v++)b[v]=l(u[v],v,p,m,x);return b}if(u instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&u instanceof SharedArrayBuffer)return u.slice(0);if(u instanceof DataView){const b=new DataView(u.buffer.slice(0),u.byteOffset,u.byteLength);return m.set(u,b),c(b,u,p,m,x),b}if(typeof File<"u"&&u instanceof File){const b=new File([u],u.name,{type:u.type});return m.set(u,b),c(b,u,p,m,x),b}if(typeof Blob<"u"&&u instanceof Blob){const b=new Blob([u],{type:u.type});return m.set(u,b),c(b,u,p,m,x),b}if(u instanceof Error){const b=new u.constructor;return m.set(u,b),b.message=u.message,b.name=u.name,b.stack=u.stack,b.cause=u.cause,c(b,u,p,m,x),b}if(u instanceof Boolean){const b=new Boolean(u.valueOf());return m.set(u,b),c(b,u,p,m,x),b}if(u instanceof Number){const b=new Number(u.valueOf());return m.set(u,b),c(b,u,p,m,x),b}if(u instanceof String){const b=new String(u.valueOf());return m.set(u,b),c(b,u,p,m,x),b}if(typeof u=="object"&&d(u)){const b=Object.create(Object.getPrototypeOf(u));return m.set(u,b),c(b,u,p,m,x),b}return u}function c(u,f,p=u,m,x){const g=[...Object.keys(f),...t.getSymbols(f)];for(let b=0;b<g.length;b++){const v=g[b],j=Object.getOwnPropertyDescriptor(u,v);(j==null||j.writable)&&(u[v]=l(f[v],v,p,m,x))}}function d(u){switch(r.getTag(u)){case n.argumentsTag:case n.arrayTag:case n.arrayBufferTag:case n.dataViewTag:case n.booleanTag:case n.dateTag:case n.float32ArrayTag:case n.float64ArrayTag:case n.int8ArrayTag:case n.int16ArrayTag:case n.int32ArrayTag:case n.mapTag:case n.numberTag:case n.objectTag:case n.regexpTag:case n.setTag:case n.stringTag:case n.symbolTag:case n.uint8ArrayTag:case n.uint8ClampedArrayTag:case n.uint16ArrayTag:case n.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=l,e.copyProperties=c})(Fh);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Fh;function r(n){return t.cloneDeepWithImpl(n,void 0,n,new Map,void 0)}e.cloneDeep=r})(Fj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lh,r=Fj;function n(i){return i=r.cloneDeep(i),s=>t.isMatch(s,i)}e.matches=n})(Rj);var qj={},Hj={},Kj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Fh,r=Uh;function n(i,s){return t.cloneDeepWith(i,(o,l,c,d)=>{const u=s==null?void 0:s(o,l,c,d);if(u!==void 0)return u;if(typeof i=="object")switch(Object.prototype.toString.call(i)){case r.numberTag:case r.stringTag:case r.booleanTag:{const f=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(f,i),f}case r.argumentsTag:{const f={};return t.copyProperties(f,i),f.length=i.length,f[Symbol.iterator]=i[Symbol.iterator],f}default:return}})}e.cloneDeepWith=n})(Kj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kj;function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(Hj);var Vj={},qh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(n,i=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<i;case"symbol":return!1;case"string":return t.test(n)}}e.isIndex=r})(qh);var Yj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Wh;function r(n){return n!==null&&typeof n=="object"&&t.getTag(n)==="[object Arguments]"}e.isArguments=r})(Yj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Mh,r=qh,n=Yj,i=Zc;function s(o,l){let c;if(Array.isArray(l)?c=l:typeof l=="string"&&t.isDeepKey(l)&&(o==null?void 0:o[l])==null?c=i.toPath(l):c=[l],c.length===0)return!1;let d=o;for(let u=0;u<c.length;u++){const f=c[u];if((d==null||!Object.hasOwn(d,f))&&!((Array.isArray(d)||n.isArguments(d))&&r.isIndex(f)&&f<d.length))return!1;d=d[f]}return!0}e.has=s})(Vj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lh,r=Gc,n=Hj,i=Yc,s=Vj;function o(l,c){switch(typeof l){case"object":{Object.is(l==null?void 0:l.valueOf(),-0)&&(l="-0");break}case"number":{l=r.toKey(l);break}}return c=n.cloneDeep(c),function(d){const u=i.get(d,l);return u===void 0?s.has(d,l):c===void 0?u===void 0:t.isMatch(u,c)}}e.matchesProperty=o})(qj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$h,r=zj,n=Rj,i=qj;function s(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?i.matchesProperty(o[0],o[1]):n.matches(o);case"string":case"symbol":case"number":return r.property(o)}}e.iteratee=s})(Lj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tj,r=$h,n=Mj,i=Lj;function s(o,l=r.identity){return n.isArrayLikeObject(o)?t.uniqBy(Array.from(o),i.iteratee(l)):[]}e.uniqBy=s})(Dj);var i4=Dj.uniqBy;const qx=Tr(i4);function a4(e,t,r){return t===!0?qx(e,r):typeof t=="function"?qx(e,t):e}var Hh=h.createContext(null),s4=e=>e,Ve=()=>{var e=h.useContext(Hh);return e?e.store.dispatch:s4},ol=()=>{},o4=()=>ol,l4=(e,t)=>e===t;function G(e){var t=h.useContext(Hh);return X1.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:o4,t?t.store.getState:ol,t?t.store.getState:ol,t?e:ol,l4)}function c4(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function u4(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function d4(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Hx=e=>Array.isArray(e)?e:[e];function f4(e){const t=Array.isArray(e[0])?e[0]:e;return d4(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function p4(e,t){const r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}var h4=class{constructor(e){this.value=e}deref(){return this.value}},m4=typeof WeakRef<"u"?WeakRef:h4,g4=0,Kx=1;function Mo(){return{s:g4,v:void 0,o:null,p:null}}function Gj(e,t={}){let r=Mo();const{resultEqualityCheck:n}=t;let i,s=0;function o(){var f;let l=r;const{length:c}=arguments;for(let p=0,m=c;p<m;p++){const x=arguments[p];if(typeof x=="function"||typeof x=="object"&&x!==null){let g=l.o;g===null&&(l.o=g=new WeakMap);const b=g.get(x);b===void 0?(l=Mo(),g.set(x,l)):l=b}else{let g=l.p;g===null&&(l.p=g=new Map);const b=g.get(x);b===void 0?(l=Mo(),g.set(x,l)):l=b}}const d=l;let u;if(l.s===Kx)u=l.v;else if(u=e.apply(null,arguments),s++,n){const p=((f=i==null?void 0:i.deref)==null?void 0:f.call(i))??i;p!=null&&n(p,u)&&(u=p,s!==0&&s--),i=typeof u=="object"&&u!==null||typeof u=="function"?new m4(u):u}return d.s=Kx,d.v=u,u}return o.clearCache=()=>{r=Mo(),o.resetResultsCount()},o.resultsCount=()=>s,o.resetResultsCount=()=>{s=0},o}function x4(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let s=0,o=0,l,c={},d=i.pop();typeof d=="object"&&(c=d,d=i.pop()),c4(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const u={...r,...c},{memoize:f,memoizeOptions:p=[],argsMemoize:m=Gj,argsMemoizeOptions:x=[]}=u,g=Hx(p),b=Hx(x),v=f4(i),j=f(function(){return s++,d.apply(null,arguments)},...g),y=m(function(){o++;const S=p4(v,arguments);return l=j.apply(null,S),l},...b);return Object.assign(y,{resultFunc:d,memoizedResultFunc:j,dependencies:v,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:m})};return Object.assign(n,{withTypes:()=>n}),n}var I=x4(Gj),y4=Object.assign((e,t=I)=>{u4(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(s=>e[s]);return t(n,(...s)=>s.reduce((o,l,c)=>(o[r[c]]=l,o),{}))},{withTypes:()=>y4}),Zj={},Xj={},Jj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const r=(n,i,s)=>{if(n!==i){const o=t(n),l=t(i);if(o===l&&o===0){if(n<i)return s==="desc"?1:-1;if(n>i)return s==="desc"?-1:1}return s==="desc"?l-o:o-l}return 0};e.compareValues=r})(Jj);var Qj={},Kh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(Kh);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kh,r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(s,o){return Array.isArray(s)?!1:typeof s=="number"||typeof s=="boolean"||s==null||t.isSymbol(s)?!0:typeof s=="string"&&(n.test(s)||!r.test(s))||o!=null&&Object.hasOwn(o,s)}e.isKey=i})(Qj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Jj,r=Qj,n=Zc;function i(s,o,l,c){if(s==null)return[];l=c?void 0:l,Array.isArray(s)||(s=Object.values(s)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(m=>String(m));const d=(m,x)=>{let g=m;for(let b=0;b<x.length&&g!=null;++b)g=g[x[b]];return g},u=(m,x)=>x==null||m==null?x:typeof m=="object"&&"key"in m?Object.hasOwn(x,m.key)?x[m.key]:d(x,m.path):typeof m=="function"?m(x):Array.isArray(m)?d(x,m):typeof x=="object"?x[m]:x,f=o.map(m=>(Array.isArray(m)&&m.length===1&&(m=m[0]),m==null||typeof m=="function"||Array.isArray(m)||r.isKey(m)?m:{key:m,path:n.toPath(m)}));return s.map(m=>({original:m,criteria:f.map(x=>u(x,m))})).slice().sort((m,x)=>{for(let g=0;g<f.length;g++){const b=t.compareValues(m.criteria[g],x.criteria[g],l[g]);if(b!==0)return b}return 0}).map(m=>m.original)}e.orderBy=i})(Xj);var ew={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n=1){const i=[],s=Math.floor(n),o=(l,c)=>{for(let d=0;d<l.length;d++){const u=l[d];Array.isArray(u)&&c<s?o(u,c+1):i.push(u)}};return o(r,0),i}e.flatten=t})(ew);var Vh={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qh,r=Jc,n=zh,i=Bh;function s(o,l,c){return n.isObject(c)&&(typeof l=="number"&&r.isArrayLike(c)&&t.isIndex(l)&&l<c.length||typeof l=="string"&&l in c)?i.eq(c[l],o):!1}e.isIterateeCall=s})(Vh);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Xj,r=ew,n=Vh;function i(s,...o){const l=o.length;return l>1&&n.isIterateeCall(s,o[0],o[1])?o=[]:l>2&&n.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(s,r.flatten(o),["asc"])}e.sortBy=i})(Zj);var v4=Zj.sortBy;const Qc=Tr(v4);var tw=e=>e.legend.settings,b4=e=>e.legend.size,j4=e=>e.legend.payload;I([j4,tw],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?Qc(n,r):n});var Io=1;function w4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=h.useState({height:0,left:0,top:0,width:0}),n=h.useCallback(i=>{if(i!=null){var s=i.getBoundingClientRect(),o={height:s.height,left:s.left,top:s.top,width:s.width};(Math.abs(o.height-t.height)>Io||Math.abs(o.left-t.left)>Io||Math.abs(o.top-t.top)>Io||Math.abs(o.width-t.width)>Io)&&r({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,n]}function Ze(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 S4=typeof Symbol=="function"&&Symbol.observable||"@@observable",Vx=S4,dd=()=>Math.random().toString(36).substring(7).split("").join("."),N4={INIT:`@@redux/INIT${dd()}`,REPLACE:`@@redux/REPLACE${dd()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${dd()}`},Fl=N4;function Yh(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 rw(e,t,r){if(typeof e!="function")throw new Error(Ze(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ze(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ze(1));return r(rw)(e,t)}let n=e,i=t,s=new Map,o=s,l=0,c=!1;function d(){o===s&&(o=new Map,s.forEach((b,v)=>{o.set(v,b)}))}function u(){if(c)throw new Error(Ze(3));return i}function f(b){if(typeof b!="function")throw new Error(Ze(4));if(c)throw new Error(Ze(5));let v=!0;d();const j=l++;return o.set(j,b),function(){if(v){if(c)throw new Error(Ze(6));v=!1,d(),o.delete(j),s=null}}}function p(b){if(!Yh(b))throw new Error(Ze(7));if(typeof b.type>"u")throw new Error(Ze(8));if(typeof b.type!="string")throw new Error(Ze(17));if(c)throw new Error(Ze(9));try{c=!0,i=n(i,b)}finally{c=!1}return(s=o).forEach(j=>{j()}),b}function m(b){if(typeof b!="function")throw new Error(Ze(10));n=b,p({type:Fl.REPLACE})}function x(){const b=f;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(Ze(11));function j(){const w=v;w.next&&w.next(u())}return j(),{unsubscribe:b(j)}},[Vx](){return this}}}return p({type:Fl.INIT}),{dispatch:p,subscribe:f,getState:u,replaceReducer:m,[Vx]:x}}function k4(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Fl.INIT})>"u")throw new Error(Ze(12));if(typeof r(void 0,{type:Fl.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ze(13))})}function nw(e){const t=Object.keys(e),r={};for(let s=0;s<t.length;s++){const o=t[s];typeof e[o]=="function"&&(r[o]=e[o])}const n=Object.keys(r);let i;try{k4(r)}catch(s){i=s}return function(o={},l){if(i)throw i;let c=!1;const d={};for(let u=0;u<n.length;u++){const f=n[u],p=r[f],m=o[f],x=p(m,l);if(typeof x>"u")throw l&&l.type,new Error(Ze(14));d[f]=x,c=c||x!==m}return c=c||n.length!==Object.keys(o).length,c?d:o}}function Wl(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function P4(...e){return t=>(r,n)=>{const i=t(r,n);let s=()=>{throw new Error(Ze(15))};const o={getState:i.getState,dispatch:(c,...d)=>s(c,...d)},l=e.map(c=>c(o));return s=Wl(...l)(i.dispatch),{...i,dispatch:s}}}function iw(e){return Yh(e)&&"type"in e&&typeof e.type=="string"}var aw=Symbol.for("immer-nothing"),Yx=Symbol.for("immer-draftable"),Wt=Symbol.for("immer-state");function fr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ms=Object.getPrototypeOf;function vi(e){return!!e&&!!e[Wt]}function en(e){var t;return e?sw(e)||Array.isArray(e)||!!e[Yx]||!!((t=e.constructor)!=null&&t[Yx])||Js(e)||tu(e):!1}var _4=Object.prototype.constructor.toString(),Gx=new WeakMap;function sw(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=Gx.get(r);return n===void 0&&(n=Function.toString.call(r),Gx.set(r,n)),n===_4}function Ul(e,t,r=!0){eu(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function eu(e){const t=e[Wt];return t?t.type_:Array.isArray(e)?1:Js(e)?2:tu(e)?3:0}function Lf(e,t){return eu(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ow(e,t,r){const n=eu(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function C4(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Js(e){return e instanceof Map}function tu(e){return e instanceof Set}function Jn(e){return e.copy_||e.base_}function zf(e,t){if(Js(e))return new Map(e);if(tu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=sw(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Wt];let i=Reflect.ownKeys(n);for(let s=0;s<i.length;s++){const o=i[s],l=n[o];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(n[o]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[o]})}return Object.create(Ms(e),n)}else{const n=Ms(e);if(n!==null&&r)return{...e};const i=Object.create(n);return Object.assign(i,e)}}function Gh(e,t=!1){return ru(e)||vi(e)||!en(e)||(eu(e)>1&&Object.defineProperties(e,{set:$o,add:$o,clear:$o,delete:$o}),Object.freeze(e),t&&Object.values(e).forEach(r=>Gh(r,!0))),e}function A4(){fr(2)}var $o={value:A4};function ru(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var O4={};function bi(e){const t=O4[e];return t||fr(0,e),t}var Is;function lw(){return Is}function E4(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Zx(e,t){t&&(bi("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Rf(e){Bf(e),e.drafts_.forEach(D4),e.drafts_=null}function Bf(e){e===Is&&(Is=e.parent_)}function Xx(e){return Is=E4(Is,e)}function D4(e){const t=e[Wt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Jx(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Wt].modified_&&(Rf(t),fr(4)),en(e)&&(e=ql(t,e),t.parent_||Hl(t,e)),t.patches_&&bi("Patches").generateReplacementPatches_(r[Wt].base_,e,t.patches_,t.inversePatches_)):e=ql(t,r,[]),Rf(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==aw?e:void 0}function ql(e,t,r){if(ru(t))return t;const n=e.immer_.shouldUseStrictIteration(),i=t[Wt];if(!i)return Ul(t,(s,o)=>Qx(e,i,t,s,o,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return Hl(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const s=i.copy_;let o=s,l=!1;i.type_===3&&(o=new Set(s),s.clear(),l=!0),Ul(o,(c,d)=>Qx(e,i,s,c,d,r,l),n),Hl(e,s,!1),r&&e.patches_&&bi("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function Qx(e,t,r,n,i,s,o){if(i==null||typeof i!="object"&&!o)return;const l=ru(i);if(!(l&&!o)){if(vi(i)){const c=s&&t&&t.type_!==3&&!Lf(t.assigned_,n)?s.concat(n):void 0,d=ql(e,i,c);if(ow(r,n,d),vi(d))e.canAutoFreeze_=!1;else return}else o&&r.add(i);if(en(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&l)return;ql(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Js(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Hl(e,i)}}}function Hl(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Gh(t,r)}function T4(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:lw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,s=Zh;r&&(i=[n],s=$s);const{revoke:o,proxy:l}=Proxy.revocable(i,s);return n.draft_=l,n.revoke_=o,l}var Zh={get(e,t){if(t===Wt)return e;const r=Jn(e);if(!Lf(r,t))return M4(e,r,t);const n=r[t];return e.finalized_||!en(n)?n:n===fd(e.base_,t)?(pd(e),e.copy_[t]=Wf(n,e)):n},has(e,t){return t in Jn(e)},ownKeys(e){return Reflect.ownKeys(Jn(e))},set(e,t,r){const n=cw(Jn(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=fd(Jn(e),t),s=i==null?void 0:i[Wt];if(s&&s.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(C4(r,i)&&(r!==void 0||Lf(e.base_,t)))return!0;pd(e),Ff(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return fd(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,pd(e),Ff(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Jn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){fr(11)},getPrototypeOf(e){return Ms(e.base_)},setPrototypeOf(){fr(12)}},$s={};Ul(Zh,(e,t)=>{$s[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});$s.deleteProperty=function(e,t){return $s.set.call(this,e,t,void 0)};$s.set=function(e,t,r){return Zh.set.call(this,e[0],t,r,e[0])};function fd(e,t){const r=e[Wt];return(r?Jn(r):e)[t]}function M4(e,t,r){var i;const n=cw(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function cw(e,t){if(!(t in e))return;let r=Ms(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ms(r)}}function Ff(e){e.modified_||(e.modified_=!0,e.parent_&&Ff(e.parent_))}function pd(e){e.copy_||(e.copy_=zf(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var I4=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const s=r;r=t;const o=this;return function(c=s,...d){return o.produce(c,u=>r.call(this,u,...d))}}typeof r!="function"&&fr(6),n!==void 0&&typeof n!="function"&&fr(7);let i;if(en(t)){const s=Xx(this),o=Wf(t,void 0);let l=!0;try{i=r(o),l=!1}finally{l?Rf(s):Bf(s)}return Zx(s,n),Jx(i,s)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===aw&&(i=void 0),this.autoFreeze_&&Gh(i,!0),n){const s=[],o=[];bi("Patches").generateReplacementPatches_(t,i,s,o),n(s,o)}return i}else fr(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...l));let n,i;return[this.produce(t,r,(o,l)=>{n=o,i=l}),n,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){en(e)||fr(8),vi(e)&&(e=Kr(e));const t=Xx(this),r=Wf(e,void 0);return r[Wt].isManual_=!0,Bf(t),r}finishDraft(e,t){const r=e&&e[Wt];(!r||!r.isManual_)&&fr(9);const{scope_:n}=r;return Zx(n,t),Jx(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=bi("Patches").applyPatches_;return vi(e)?n(e,t):this.produce(e,i=>n(i,t))}};function Wf(e,t){const r=Js(e)?bi("MapSet").proxyMap_(e,t):tu(e)?bi("MapSet").proxySet_(e,t):T4(e,t);return(t?t.scope_:lw()).drafts_.push(r),r}function Kr(e){return vi(e)||fr(10,e),uw(e)}function uw(e){if(!en(e)||ru(e))return e;const t=e[Wt];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=zf(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=zf(e,!0);return Ul(r,(i,s)=>{ow(r,i,uw(s))},n),t&&(t.finalized_=!1),r}var Uf=new I4,dw=Uf.produce,$4=Uf.setUseStrictIteration.bind(Uf);function fw(e){return({dispatch:r,getState:n})=>i=>s=>typeof s=="function"?s(r,n,e):i(s)}var L4=fw(),z4=fw,R4=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Wl:Wl.apply(null,arguments)};function ar(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(Bt(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>iw(n)&&n.type===e,r}var pw=class Qa extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Qa.prototype)}static get[Symbol.species](){return Qa}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Qa(...t[0].concat(this)):new Qa(...t.concat(this))}};function e0(e){return en(e)?dw(e,()=>{}):e}function Lo(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function B4(e){return typeof e=="boolean"}var F4=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:s=!0}=t??{};let o=new pw;return r&&(B4(r)?o.push(L4):o.push(z4(r.extraArgument))),o},hw="RTK_autoBatch",Le=()=>e=>({payload:e,meta:{[hw]:!0}}),t0=e=>t=>{setTimeout(t,e)},mw=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,s=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:t0(10):e.type==="callback"?e.queueNotification:t0(e.timeout),d=()=>{o=!1,s&&(s=!1,l.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){const f=()=>i&&u(),p=n.subscribe(f);return l.add(u),()=>{p(),l.delete(u)}},dispatch(u){var f;try{return i=!((f=u==null?void 0:u.meta)!=null&&f[hw]),s=!i,s&&(o||(o=!0,c(d))),n.dispatch(u)}finally{i=!0}}})},W4=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new pw(e);return n&&i.push(mw(typeof n=="object"?n:void 0)),i};function U4(e){const t=F4(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:s=void 0,enhancers:o=void 0}=e||{};let l;if(typeof r=="function")l=r;else if(Yh(r))l=nw(r);else throw new Error(Bt(1));let c;typeof n=="function"?c=n(t):c=t();let d=Wl;i&&(d=R4({trace:!1,...typeof i=="object"&&i}));const u=P4(...c),f=W4(u);let p=typeof o=="function"?o(f):f();const m=d(...p);return rw(l,s,m)}function gw(e){const t={},r=[];let n;const i={addCase(s,o){const l=typeof s=="string"?s:s.type;if(!l)throw new Error(Bt(28));if(l in t)throw new Error(Bt(29));return t[l]=o,i},addAsyncThunk(s,o){return o.pending&&(t[s.pending.type]=o.pending),o.rejected&&(t[s.rejected.type]=o.rejected),o.fulfilled&&(t[s.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:s.settled,reducer:o.settled}),i},addMatcher(s,o){return r.push({matcher:s,reducer:o}),i},addDefaultCase(s){return n=s,i}};return e(i),[t,r,n]}$4(!1);function q4(e){return typeof e=="function"}function H4(e,t){let[r,n,i]=gw(t),s;if(q4(e))s=()=>e0(e());else{const l=e0(e);s=()=>l}function o(l=s(),c){let d=[r[c.type],...n.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return d.filter(u=>!!u).length===0&&(d=[i]),d.reduce((u,f)=>{if(f)if(vi(u)){const m=f(u,c);return m===void 0?u:m}else{if(en(u))return dw(u,p=>f(p,c));{const p=f(u,c);if(p===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return p}}return u},l)}return o.getInitialState=s,o}var K4="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",V4=(e=21)=>{let t="",r=e;for(;r--;)t+=K4[Math.random()*64|0];return t},Y4=Symbol.for("rtk-slice-createasyncthunk");function G4(e,t){return`${e}/${t}`}function Z4({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[Y4];return function(i){const{name:s,reducerPath:o=s}=i;if(!s)throw new Error(Bt(11));const l=(typeof i.reducers=="function"?i.reducers(J4()):i.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(w,S){const N=typeof w=="string"?w:w.type;if(!N)throw new Error(Bt(12));if(N in d.sliceCaseReducersByType)throw new Error(Bt(13));return d.sliceCaseReducersByType[N]=S,u},addMatcher(w,S){return d.sliceMatchers.push({matcher:w,reducer:S}),u},exposeAction(w,S){return d.actionCreators[w]=S,u},exposeCaseReducer(w,S){return d.sliceCaseReducersByName[w]=S,u}};c.forEach(w=>{const S=l[w],N={reducerName:w,type:G4(s,w),createNotation:typeof i.reducers=="function"};eE(S)?rE(N,S,u,t):Q4(N,S,u)});function f(){const[w={},S=[],N=void 0]=typeof i.extraReducers=="function"?gw(i.extraReducers):[i.extraReducers],P={...w,...d.sliceCaseReducersByType};return H4(i.initialState,_=>{for(let T in P)_.addCase(T,P[T]);for(let T of d.sliceMatchers)_.addMatcher(T.matcher,T.reducer);for(let T of S)_.addMatcher(T.matcher,T.reducer);N&&_.addDefaultCase(N)})}const p=w=>w,m=new Map,x=new WeakMap;let g;function b(w,S){return g||(g=f()),g(w,S)}function v(){return g||(g=f()),g.getInitialState()}function j(w,S=!1){function N(_){let T=_[w];return typeof T>"u"&&S&&(T=Lo(x,N,v)),T}function P(_=p){const T=Lo(m,S,()=>new WeakMap);return Lo(T,_,()=>{const $={};for(const[M,C]of Object.entries(i.selectors??{}))$[M]=X4(C,_,()=>Lo(x,_,v),S);return $})}return{reducerPath:w,getSelectors:P,get selectors(){return P(N)},selectSlice:N}}const y={name:s,reducer:b,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:v,...j(o),injectInto(w,{reducerPath:S,...N}={}){const P=S??o;return w.inject({reducerPath:P,reducer:b},N),{...y,...j(P,!0)}}};return y}}function X4(e,t,r,n){function i(s,...o){let l=t(s);return typeof l>"u"&&n&&(l=r()),e(l,...o)}return i.unwrapped=e,i}var At=Z4();function J4(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Q4({type:e,reducerName:t,createNotation:r},n,i){let s,o;if("reducer"in n){if(r&&!tE(n))throw new Error(Bt(17));s=n.reducer,o=n.prepare}else s=n;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,o?ar(e,o):ar(e))}function eE(e){return e._reducerDefinitionType==="asyncThunk"}function tE(e){return e._reducerDefinitionType==="reducerWithPrepare"}function rE({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Bt(18));const{payloadCreator:s,fulfilled:o,pending:l,rejected:c,settled:d,options:u}=r,f=i(e,s,u);n.exposeAction(t,f),o&&n.addCase(f.fulfilled,o),l&&n.addCase(f.pending,l),c&&n.addCase(f.rejected,c),d&&n.addMatcher(f.settled,d),n.exposeCaseReducer(t,{fulfilled:o||zo,pending:l||zo,rejected:c||zo,settled:d||zo})}function zo(){}var nE="task",xw="listener",yw="completed",Xh="cancelled",iE=`task-${Xh}`,aE=`task-${yw}`,qf=`${xw}-${Xh}`,sE=`${xw}-${yw}`,nu=class{constructor(e){ho(this,"name","TaskAbortError");ho(this,"message");this.code=e,this.message=`${nE} ${Xh} (reason: ${e})`}},Jh=(e,t)=>{if(typeof e!="function")throw new TypeError(Bt(32))},Kl=()=>{},vw=(e,t=Kl)=>(e.catch(t),e),bw=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),li=(e,t)=>{const r=e.signal;r.aborted||("reason"in r||Object.defineProperty(r,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},ci=e=>{if(e.aborted){const{reason:t}=e;throw new nu(t)}};function jw(e,t){let r=Kl;return new Promise((n,i)=>{const s=()=>i(new nu(e.reason));if(e.aborted){s();return}r=bw(e,s),t.finally(()=>r()).then(n,i)}).finally(()=>{r=Kl})}var oE=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof nu?"cancelled":"rejected",error:r}}finally{t==null||t()}},Vl=e=>t=>vw(jw(e,t).then(r=>(ci(e),r))),ww=e=>{const t=Vl(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:na}=Object,r0={},iu="listenerMiddleware",lE=(e,t)=>{const r=n=>bw(e,()=>li(n,e.reason));return(n,i)=>{Jh(n);const s=new AbortController;r(s);const o=oE(async()=>{ci(e),ci(s.signal);const l=await n({pause:Vl(s.signal),delay:ww(s.signal),signal:s.signal});return ci(s.signal),l},()=>li(s,aE));return i!=null&&i.autoJoin&&t.push(o.catch(Kl)),{result:Vl(e)(o),cancel(){li(s,iE)}}}},cE=(e,t)=>{const r=async(n,i)=>{ci(t);let s=()=>{};const l=[new Promise((c,d)=>{let u=e({predicate:n,effect:(f,p)=>{p.unsubscribe(),c([f,p.getState(),p.getOriginalState()])}});s=()=>{u(),d()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await jw(t,Promise.race(l));return ci(t),c}finally{s()}};return(n,i)=>vw(r(n,i))},Sw=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:s}=e;if(t)i=ar(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error(Bt(21));return Jh(s),{predicate:i,type:t,effect:s}},Nw=na(e=>{const{type:t,predicate:r,effect:n}=Sw(e);return{id:V4(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Bt(22))}}},{withTypes:()=>Nw}),n0=(e,t)=>{const{type:r,effect:n,predicate:i}=Sw(t);return Array.from(e.values()).find(s=>(typeof r=="string"?s.type===r:s.predicate===i)&&s.effect===n)},Hf=e=>{e.pending.forEach(t=>{li(t,qf)})},uE=(e,t)=>()=>{for(const r of t.keys())Hf(r);e.clear()},i0=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},kw=na(ar(`${iu}/add`),{withTypes:()=>kw}),dE=ar(`${iu}/removeAll`),Pw=na(ar(`${iu}/remove`),{withTypes:()=>Pw}),fE=(...e)=>{console.error(`${iu}/error`,...e)},Qs=(e={})=>{const t=new Map,r=new Map,n=m=>{const x=r.get(m)??0;r.set(m,x+1)},i=m=>{const x=r.get(m)??1;x===1?r.delete(m):r.set(m,x-1)},{extra:s,onError:o=fE}=e;Jh(o);const l=m=>(m.unsubscribe=()=>t.delete(m.id),t.set(m.id,m),x=>{m.unsubscribe(),x!=null&&x.cancelActive&&Hf(m)}),c=m=>{const x=n0(t,m)??Nw(m);return l(x)};na(c,{withTypes:()=>c});const d=m=>{const x=n0(t,m);return x&&(x.unsubscribe(),m.cancelActive&&Hf(x)),!!x};na(d,{withTypes:()=>d});const u=async(m,x,g,b)=>{const v=new AbortController,j=cE(c,v.signal),y=[];try{m.pending.add(v),n(m),await Promise.resolve(m.effect(x,na({},g,{getOriginalState:b,condition:(w,S)=>j(w,S).then(Boolean),take:j,delay:ww(v.signal),pause:Vl(v.signal),extra:s,signal:v.signal,fork:lE(v.signal,y),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((w,S,N)=>{w!==v&&(li(w,qf),N.delete(w))})},cancel:()=>{li(v,qf),m.pending.delete(v)},throwIfCancelled:()=>{ci(v.signal)}})))}catch(w){w instanceof nu||i0(o,w,{raisedBy:"effect"})}finally{await Promise.all(y),li(v,sE),i(m),m.pending.delete(v)}},f=uE(t,r);return{middleware:m=>x=>g=>{if(!iw(g))return x(g);if(kw.match(g))return c(g.payload);if(dE.match(g)){f();return}if(Pw.match(g))return d(g.payload);let b=m.getState();const v=()=>{if(b===r0)throw new Error(Bt(23));return b};let j;try{if(j=x(g),t.size>0){const y=m.getState(),w=Array.from(t.values());for(const S of w){let N=!1;try{N=S.predicate(g,y,b)}catch(P){N=!1,i0(o,P,{raisedBy:"predicate"})}N&&u(S,g,m,v)}}}finally{b=r0}return j},startListening:c,stopListening:d,clearListeners:f}};function Bt(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 pE={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},_w=At({name:"chartLayout",initialState:pE,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 r,n,i,s;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(s=t.payload.left)!==null&&s!==void 0?s:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:hE,setLayout:mE,setChartSize:gE,setScale:xE}=_w.actions,yE=_w.reducer;function Cw(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function a0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Yi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?a0(Object(r),!0).forEach(function(n){vE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vE(e,t,r){return(t=bE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bE(e){var t=jE(e,"string");return typeof t=="symbol"?t:t+""}function jE(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function et(e,t,r){return Re(e)||Re(t)?r:Or(t)?Xc(e,t,r):typeof t=="function"?t(e):r}var wE=(e,t,r)=>{if(t&&r){var{width:n,height:i}=r,{align:s,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&s!=="center"&&Y(e[s]))return Yi(Yi({},e),{},{[s]:e[s]+(n||0)});if((l==="horizontal"||l==="vertical"&&s==="center")&&o!=="middle"&&Y(e[o]))return Yi(Yi({},e),{},{[o]:e[o]+(i||0)})}return e},Mr=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",Aw=(e,t,r,n)=>{if(n)return e.map(l=>l.coordinate);var i,s,o=e.map(l=>(l.coordinate===t&&(i=!0),l.coordinate===r&&(s=!0),l.coordinate));return i||o.push(t),s||o.push(r),o},Ow=(e,t,r)=>{if(!e)return null;var{duplicateDomain:n,type:i,range:s,scale:o,realScaleType:l,isCategorical:c,categoricalDomain:d,tickCount:u,ticks:f,niceTicks:p,axisType:m}=e;if(!o)return null;var x=l==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,g=i==="category"&&o.bandwidth?o.bandwidth()/x:0;if(g=m==="angleAxis"&&s&&s.length>=2?Jt(s[0]-s[1])*2*g:g,f||p){var b=(f||p||[]).map((v,j)=>{var y=n?n.indexOf(v):v;return{coordinate:o(y)+g,value:v,offset:g,index:j}});return b.filter(v=>!yr(v.coordinate))}return c&&d?d.map((v,j)=>({coordinate:o(v)+g,value:v,index:j,offset:g})):o.ticks&&u!=null?o.ticks(u).map((v,j)=>({coordinate:o(v)+g,value:v,offset:g,index:j})):o.domain().map((v,j)=>({coordinate:o(v)+g,value:n?n[v]:v,index:j,offset:g}))},s0=1e-4,SE=e=>{var t=e.domain();if(!(!t||t.length<=2)){var r=t.length,n=e.range(),i=Math.min(n[0],n[1])-s0,s=Math.max(n[0],n[1])+s0,o=e(t[0]),l=e(t[r-1]);(o<i||o>s||l<i||l>s)&&e.domain([t[0],t[r-1]])}},NE=e=>{var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var i=0,s=0,o=0;o<t;++o){var l=yr(e[o][r][1])?e[o][r][0]:e[o][r][1];l>=0?(e[o][r][0]=i,e[o][r][1]=i+l,i=e[o][r][1]):(e[o][r][0]=s,e[o][r][1]=s+l,s=e[o][r][1])}},kE=e=>{var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var i=0,s=0;s<t;++s){var o=yr(e[s][r][1])?e[s][r][0]:e[s][r][1];o>=0?(e[s][r][0]=i,e[s][r][1]=i+o,i=e[s][r][1]):(e[s][r][0]=0,e[s][r][1]=0)}},PE={sign:NE,expand:$6,none:pa,silhouette:L6,wiggle:z6,positive:kE},_E=(e,t,r)=>{var n=PE[r],i=I6().keys(t).value((s,o)=>Number(et(s,o,0))).order(If).offset(n);return i(e)};function CE(e){return e==null?void 0:String(e)}function Yl(e){var{axis:t,ticks:r,bandSize:n,entry:i,index:s,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Re(i[t.dataKey])){var l=Cj(r,"value",i[t.dataKey]);if(l)return l.coordinate+n/2}return r[s]?r[s].coordinate+n/2:null}var c=et(i,Re(o)?t.dataKey:o);return Re(c)?null:t.scale(c)}var AE=e=>{var t=e.flat(2).filter(Y);return[Math.min(...t),Math.max(...t)]},OE=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],EE=(e,t,r)=>{if(e!=null)return OE(Object.keys(e).reduce((n,i)=>{var s=e[i],{stackedData:o}=s,l=o.reduce((c,d)=>{var u=Cw(d,t,r),f=AE(u);return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],n[0]),Math.max(l[1],n[1])]},[1/0,-1/0]))},o0=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,l0=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ha=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=Qc(t,u=>u.coordinate),s=1/0,o=1,l=i.length;o<l;o++){var c=i[o],d=i[o-1];s=Math.min((c.coordinate||0)-(d.coordinate||0),s)}return s===1/0?0:s}return r?void 0:0};function c0(e){var{tooltipEntrySettings:t,dataKey:r,payload:n,value:i,name:s}=e;return Yi(Yi({},t),{},{dataKey:r,payload:n,value:i,name:s})}function au(e,t){if(e)return String(e);if(typeof t=="string")return t}var DE=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},TE=(e,t)=>t==="centric"?e.angle:e.radius,ln=e=>e.layout.width,cn=e=>e.layout.height,ME=e=>e.layout.scale,Ew=e=>e.layout.margin,su=I(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),ou=I(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),IE="data-recharts-item-index",$E="data-recharts-item-data-key",eo=60;function u0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ro(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?u0(Object(r),!0).forEach(function(n){LE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LE(e,t,r){return(t=zE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zE(e){var t=RE(e,"string");return typeof t=="symbol"?t:t+""}function RE(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var BE=e=>e.brush.height;function FE(e){var t=ou(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:eo;return r+i}return r},0)}function WE(e){var t=ou(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:eo;return r+i}return r},0)}function UE(e){var t=su(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function qE(e){var t=su(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var rt=I([ln,cn,Ew,BE,FE,WE,UE,qE,tw,b4],(e,t,r,n,i,s,o,l,c,d)=>{var u={left:(r.left||0)+i,right:(r.right||0)+s},f={top:(r.top||0)+o,bottom:(r.bottom||0)+l},p=Ro(Ro({},f),u),m=p.bottom;p.bottom+=n,p=wE(p,c,d);var x=e-p.left-p.right,g=t-p.top-p.bottom;return Ro(Ro({brushBottom:m},p),{},{width:Math.max(x,0),height:Math.max(g,0)})}),HE=I(rt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Dw=I(ln,cn,(e,t)=>({x:0,y:0,width:e,height:t})),KE=h.createContext(null),pt=()=>h.useContext(KE)!=null,lu=e=>e.brush,cu=I([lu,rt,Ew],(e,t,r)=>({height:e.height,x:Y(e.x)?e.x:t.left,y:Y(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Y(e.width)?e.width:t.width})),Tw={},Mw={},Iw={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n,{signal:i,edges:s}={}){let o,l=null;const c=s!=null&&s.includes("leading"),d=s==null||s.includes("trailing"),u=()=>{l!==null&&(r.apply(o,l),o=void 0,l=null)},f=()=>{d&&u(),g()};let p=null;const m=()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,f()},n)},x=()=>{p!==null&&(clearTimeout(p),p=null)},g=()=>{x(),o=void 0,l=null},b=()=>{u()},v=function(...j){if(i!=null&&i.aborted)return;o=this,l=j;const y=p==null;m(),c&&y&&u()};return v.schedule=m,v.cancel=g,v.flush=b,i==null||i.addEventListener("abort",g,{once:!0}),v}e.debounce=t})(Iw);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Iw;function r(n,i=0,s={}){typeof s!="object"&&(s={});const{leading:o=!1,trailing:l=!0,maxWait:c}=s,d=Array(2);o&&(d[0]="leading"),l&&(d[1]="trailing");let u,f=null;const p=t.debounce(function(...g){u=n.apply(this,g),f=null},i,{edges:d}),m=function(...g){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(u=n.apply(this,g),f=Date.now(),p.cancel(),p.schedule(),u):(p.apply(this,g),u)},x=()=>(p.flush(),u);return m.cancel=p.cancel,m.flush=x,m}e.debounce=r})(Mw);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Mw;function r(n,i=0,s={}){const{leading:o=!0,trailing:l=!0}=s;return t.debounce(n,i,{leading:o,maxWait:i,trailing:l})}e.throttle=r})(Tw);var VE=Tw.throttle;const YE=Tr(VE);var Gl=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s]},$w=(e,t,r)=>{var{width:n="100%",height:i="100%",aspect:s,maxHeight:o}=r,l=Qr(n)?e:Number(n),c=Qr(i)?t:Number(i);return s&&s>0&&(l?c=l/s:c&&(l=c*s),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},GE={width:0,height:0,overflow:"visible"},ZE={width:0,overflowX:"visible"},XE={height:0,overflowY:"visible"},JE={},QE=e=>{var{width:t,height:r}=e,n=Qr(t),i=Qr(r);return n&&i?GE:n?ZE:i?XE:JE};function e3(e){var{width:t,height:r,aspect:n}=e,i=t,s=r;return i===void 0&&s===void 0?(i="100%",s="100%"):i===void 0?i=n&&n>0?void 0:"100%":s===void 0&&(s=n&&n>0?void 0:"100%"),{width:i,height:s}}function _e(e){return Number.isFinite(e)}function Er(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Kf(){return Kf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kf.apply(null,arguments)}function d0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function f0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?d0(Object(r),!0).forEach(function(n){t3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function t3(e,t,r){return(t=r3(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r3(e){var t=n3(e,"string");return typeof t=="symbol"?t:t+""}function n3(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lw=h.createContext({width:-1,height:-1});function i3(e){return Er(e.width)&&Er(e.height)}function zw(e){var{children:t,width:r,height:n}=e,i=h.useMemo(()=>({width:r,height:n}),[r,n]);return i3(i)?h.createElement(Lw.Provider,{value:i},t):null}var Qh=()=>h.useContext(Lw),a3=h.forwardRef((e,t)=>{var{aspect:r,initialDimension:n={width:-1,height:-1},width:i,height:s,minWidth:o=0,minHeight:l,maxHeight:c,children:d,debounce:u=0,id:f,className:p,onResize:m,style:x={}}=e,g=h.useRef(null),b=h.useRef();b.current=m,h.useImperativeHandle(t,()=>g.current);var[v,j]=h.useState({containerWidth:n.width,containerHeight:n.height}),y=h.useCallback((_,T)=>{j($=>{var M=Math.round(_),C=Math.round(T);return $.containerWidth===M&&$.containerHeight===C?$:{containerWidth:M,containerHeight:C}})},[]);h.useEffect(()=>{if(g.current==null||typeof ResizeObserver>"u")return ka;var _=C=>{var R,{width:q,height:Z}=C[0].contentRect;y(q,Z),(R=b.current)===null||R===void 0||R.call(b,q,Z)};u>0&&(_=YE(_,u,{trailing:!0,leading:!1}));var T=new ResizeObserver(_),{width:$,height:M}=g.current.getBoundingClientRect();return y($,M),T.observe(g.current),()=>{T.disconnect()}},[y,u]);var{containerWidth:w,containerHeight:S}=v;Gl(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:N,calculatedHeight:P}=$w(w,S,{width:i,height:s,aspect:r,maxHeight:c});return Gl(N!=null&&N>0||P!=null&&P>0,`The width(%s) and height(%s) of chart should be greater than 0,
please check the style of container, or the props width(%s) and height(%s),
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
height and width.`,N,P,i,s,o,l,r),h.createElement("div",{id:f?"".concat(f):void 0,className:ce("recharts-responsive-container",p),style:f0(f0({},x),{},{width:i,height:s,minWidth:o,minHeight:l,maxHeight:c}),ref:g},h.createElement("div",{style:QE({width:i,height:s})},h.createElement(zw,{width:N,height:P},d)))}),p0=h.forwardRef((e,t)=>{var r=Qh();if(Er(r.width)&&Er(r.height))return e.children;var{width:n,height:i}=e3({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:s,calculatedHeight:o}=$w(void 0,void 0,{width:n,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Y(s)&&Y(o)?h.createElement(zw,{width:s,height:o},e.children):h.createElement(a3,Kf({},e,{width:n,height:i,ref:t}))});function Rw(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 uu=()=>{var e,t=pt(),r=G(HE),n=G(cu),i=(e=G(lu))===null||e===void 0?void 0:e.padding;return!t||!n||!i?r:{width:n.width-i.left-i.right,height:n.height-i.top-i.bottom,x:i.left,y:i.top}},s3={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},Bw=()=>{var e;return(e=G(rt))!==null&&e!==void 0?e:s3},Fw=()=>G(ln),Ww=()=>G(cn),ue=e=>e.layout.layoutType,to=()=>G(ue),o3=()=>{var e=to();return e!==void 0},du=e=>{var t=Ve(),r=pt(),{width:n,height:i}=e,s=Qh(),o=n,l=i;return s&&(o=s.width>0?s.width:n,l=s.height>0?s.height:i),h.useEffect(()=>{!r&&Er(o)&&Er(l)&&t(gE({width:o,height:l}))},[t,r,o,l]),null},l3={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},Uw=At({name:"legend",initialState:l3,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:Le()},removeLegendPayload:{reducer(e,t){var r=Kr(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:Le()}}}),{setLegendSize:_7,setLegendSettings:C7,addLegendPayload:c3,removeLegendPayload:u3}=Uw.actions,d3=Uw.reducer;function Vf(){return Vf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vf.apply(null,arguments)}function h0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?h0(Object(r),!0).forEach(function(n){f3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function f3(e,t,r){return(t=p3(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p3(e){var t=h3(e,"string");return typeof t=="symbol"?t:t+""}function h3(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function m3(e){return Array.isArray(e)&&Or(e[0])&&Or(e[1])?e.join(" ~ "):e}var g3=e=>{var{separator:t=" : ",contentStyle:r={},itemStyle:n={},labelStyle:i={},payload:s,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:d,label:u,labelFormatter:f,accessibilityLayer:p=!1}=e,m=()=>{if(s&&s.length){var S={padding:0,margin:0},N=(l?Qc(s,l):s).map((P,_)=>{if(P.type==="none")return null;var T=P.formatter||o||m3,{value:$,name:M}=P,C=$,R=M;if(T){var q=T($,M,P,_,s);if(Array.isArray(q))[C,R]=q;else if(q!=null)C=q;else return null}var Z=hd({display:"block",paddingTop:4,paddingBottom:4,color:P.color||"#000"},n);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(_),style:Z},Or(R)?h.createElement("span",{className:"recharts-tooltip-item-name"},R):null,Or(R)?h.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,h.createElement("span",{className:"recharts-tooltip-item-value"},C),h.createElement("span",{className:"recharts-tooltip-item-unit"},P.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:S},N)}return null},x=hd({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},r),g=hd({margin:0},i),b=!Re(u),v=b?u:"",j=ce("recharts-default-tooltip",c),y=ce("recharts-tooltip-label",d);b&&f&&s!==void 0&&s!==null&&(v=f(u,s));var w=p?{role:"status","aria-live":"assertive"}:{};return h.createElement("div",Vf({className:j,style:x},w),h.createElement("p",{className:y,style:g},h.isValidElement(v)?v:"".concat(v)),m())},Wa="recharts-tooltip-wrapper",x3={visibility:"hidden"};function y3(e){var{coordinate:t,translateX:r,translateY:n}=e;return ce(Wa,{["".concat(Wa,"-right")]:Y(r)&&t&&Y(t.x)&&r>=t.x,["".concat(Wa,"-left")]:Y(r)&&t&&Y(t.x)&&r<t.x,["".concat(Wa,"-bottom")]:Y(n)&&t&&Y(t.y)&&n>=t.y,["".concat(Wa,"-top")]:Y(n)&&t&&Y(t.y)&&n<t.y})}function m0(e){var{allowEscapeViewBox:t,coordinate:r,key:n,offsetTopLeft:i,position:s,reverseDirection:o,tooltipDimension:l,viewBox:c,viewBoxDimension:d}=e;if(s&&Y(s[n]))return s[n];var u=r[n]-l-(i>0?i:0),f=r[n]+i;if(t[n])return o[n]?u:f;var p=c[n];if(p==null)return 0;if(o[n]){var m=u,x=p;return m<x?Math.max(f,p):Math.max(u,p)}if(d==null)return 0;var g=f+l,b=p+d;return g>b?Math.max(u,p):Math.max(f,p)}function v3(e){var{translateX:t,translateY:r,useTranslate3d:n}=e;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function b3(e){var{allowEscapeViewBox:t,coordinate:r,offsetTopLeft:n,position:i,reverseDirection:s,tooltipBox:o,useTranslate3d:l,viewBox:c}=e,d,u,f;return o.height>0&&o.width>0&&r?(u=m0({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=m0({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:s,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),d=v3({translateX:u,translateY:f,useTranslate3d:l})):d=x3,{cssProperties:d,cssClasses:y3({translateX:u,translateY:f,coordinate:r})}}function g0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?g0(Object(r),!0).forEach(function(n){Yf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Yf(e,t,r){return(t=j3(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function j3(e){var t=w3(e,"string");return typeof t=="symbol"?t:t+""}function w3(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class S3 extends h.PureComponent{constructor(){super(...arguments),Yf(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),Yf(this,"handleKeyDown",t=>{if(t.key==="Escape"){var r,n,i,s;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(r=(n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==null&&r!==void 0?r:0,y:(i=(s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,r;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:r,animationDuration:n,animationEasing:i,children:s,coordinate:o,hasPayload:l,isAnimationActive:c,offset:d,position:u,reverseDirection:f,useTranslate3d:p,viewBox:m,wrapperStyle:x,lastBoundingBox:g,innerRef:b,hasPortalFromProps:v}=this.props,{cssClasses:j,cssProperties:y}=b3({allowEscapeViewBox:r,coordinate:o,offsetTopLeft:d,position:u,reverseDirection:f,tooltipBox:{height:g.height,width:g.width},useTranslate3d:p,viewBox:m}),w=v?{}:Bo(Bo({transition:c&&t?"transform ".concat(n,"ms ").concat(i):void 0},y),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&l?"visible":"hidden",position:"absolute",top:0,left:0}),S=Bo(Bo({},w),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},x);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:j,style:S,ref:b},s)}}var N3=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Ci={devToolsEnabled:!1,isSsr:N3()},qw=()=>{var e;return(e=G(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Gf(){return Gf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gf.apply(null,arguments)}function x0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function y0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?x0(Object(r),!0).forEach(function(n){k3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):x0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function k3(e,t,r){return(t=P3(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function P3(e){var t=_3(e,"string");return typeof t=="symbol"?t:t+""}function _3(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var v0={curveBasisClosed:N6,curveBasisOpen:k6,curveBasis:S6,curveBumpX:c6,curveBumpY:u6,curveLinearClosed:P6,curveLinear:Kc,curveMonotoneX:_6,curveMonotoneY:C6,curveNatural:A6,curveStep:O6,curveStepAfter:D6,curveStepBefore:E6},Zl=e=>_e(e.x)&&_e(e.y),b0=e=>e.base!=null&&Zl(e.base)&&Zl(e),Ua=e=>e.x,qa=e=>e.y,C3=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(Xs(e));return(r==="curveMonotone"||r==="curveBump")&&t?v0["".concat(r).concat(t==="vertical"?"Y":"X")]:v0[r]||Kc},A3=e=>{var{type:t="linear",points:r=[],baseLine:n,layout:i,connectNulls:s=!1}=e,o=C3(t,i),l=s?r.filter(Zl):r,c;if(Array.isArray(n)){var d=r.map((m,x)=>y0(y0({},m),{},{base:n[x]}));i==="vertical"?c=To().y(qa).x1(Ua).x0(m=>m.base.x):c=To().x(Ua).y1(qa).y0(m=>m.base.y);var u=c.defined(b0).curve(o),f=s?d.filter(b0):d;return u(f)}i==="vertical"&&Y(n)?c=To().y(qa).x1(Ua).x0(n):Y(n)?c=To().x(Ua).y1(qa).y0(n):c=hj().x(Ua).y(qa);var p=c.defined(Zl).curve(o);return p(l)},us=e=>{var{className:t,points:r,path:n,pathRef:i}=e;if((!r||!r.length)&&!n)return null;var s=r&&r.length?A3(e):n;return h.createElement("path",Gf({},nr(e),Ih(e),{className:ce("recharts-curve",t),d:s===null?void 0:s,ref:i}))},O3=["x","y","top","left","width","height","className"];function Zf(){return Zf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zf.apply(null,arguments)}function j0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function E3(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?j0(Object(r),!0).forEach(function(n){D3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function D3(e,t,r){return(t=T3(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T3(e){var t=M3(e,"string");return typeof t=="symbol"?t:t+""}function M3(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I3(e,t){if(e==null)return{};var r,n,i=$3(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function $3(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var L3=(e,t,r,n,i,s)=>"M".concat(e,",").concat(i,"v").concat(n,"M").concat(s,",").concat(t,"h").concat(r),z3=e=>{var{x:t=0,y:r=0,top:n=0,left:i=0,width:s=0,height:o=0,className:l}=e,c=I3(e,O3),d=E3({x:t,y:r,top:n,left:i,width:s,height:o},c);return!Y(t)||!Y(r)||!Y(s)||!Y(o)||!Y(n)||!Y(i)?null:h.createElement("path",Zf({},ut(d),{className:ce("recharts-cross",l),d:L3(t,r,s,o,n,i)}))};function R3(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function w0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function S0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?w0(Object(r),!0).forEach(function(n){B3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function B3(e,t,r){return(t=F3(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function F3(e){var t=W3(e,"string");return typeof t=="symbol"?t:t+""}function W3(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var U3=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),Hw=(e,t,r)=>e.map(n=>"".concat(U3(n)," ").concat(t,"ms ").concat(r)).join(","),q3=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,n)=>r.filter(i=>n.includes(i))),Ls=(e,t)=>Object.keys(t).reduce((r,n)=>S0(S0({},r),{},{[n]:e(n,t[n])}),{});function N0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N0(Object(r),!0).forEach(function(n){H3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function H3(e,t,r){return(t=K3(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function K3(e){var t=V3(e,"string");return typeof t=="symbol"?t:t+""}function V3(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xl=(e,t,r)=>e+(t-e)*r,Xf=e=>{var{from:t,to:r}=e;return t!==r},Kw=(e,t,r)=>{var n=Ls((i,s)=>{if(Xf(s)){var[o,l]=e(s.from,s.to,s.velocity);return $e($e({},s),{},{from:o,velocity:l})}return s},t);return r<1?Ls((i,s)=>Xf(s)?$e($e({},s),{},{velocity:Xl(s.velocity,n[i].velocity,r),from:Xl(s.from,n[i].from,r)}):s,t):Kw(e,n,r-1)};function Y3(e,t,r,n,i,s){var o,l=n.reduce((p,m)=>$e($e({},p),{},{[m]:{from:e[m],velocity:0,to:t[m]}}),{}),c=()=>Ls((p,m)=>m.from,l),d=()=>!Object.values(l).filter(Xf).length,u=null,f=p=>{o||(o=p);var m=p-o,x=m/r.dt;l=Kw(r,l,x),i($e($e($e({},e),t),c())),o=p,d()||(u=s.setTimeout(f))};return()=>(u=s.setTimeout(f),()=>{var p;(p=u)===null||p===void 0||p()})}function G3(e,t,r,n,i,s,o){var l=null,c=i.reduce((f,p)=>$e($e({},f),{},{[p]:[e[p],t[p]]}),{}),d,u=f=>{d||(d=f);var p=(f-d)/n,m=Ls((g,b)=>Xl(...b,r(p)),c);if(s($e($e($e({},e),t),m)),p<1)l=o.setTimeout(u);else{var x=Ls((g,b)=>Xl(...b,r(1)),c);s($e($e($e({},e),t),x))}};return()=>(l=o.setTimeout(u),()=>{var f;(f=l)===null||f===void 0||f()})}const Z3=(e,t,r,n,i,s)=>{var o=q3(e,t);return r==null?()=>(i($e($e({},e),t)),()=>{}):r.isStepper===!0?Y3(e,t,r,o,i,s):G3(e,t,r,n,o,i,s)};var Jl=1e-4,Vw=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],Yw=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),k0=(e,t)=>r=>{var n=Vw(e,t);return Yw(n,r)},X3=(e,t)=>r=>{var n=Vw(e,t),i=[...n.map((s,o)=>s*o).slice(1),0];return Yw(i,r)},J3=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length===1)switch(r[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,s=r[0].split("(");if(s[0]==="cubic-bezier"&&((i=s[1])===null||i===void 0?void 0:i.split(")")[0].split(",").length)===4){var o=s[1].split(")")[0].split(",").map(l=>parseFloat(l));return[o[0],o[1],o[2],o[3]]}}}return r.length===4?r:[0,0,1,1]},Q3=(e,t,r,n)=>{var i=k0(e,r),s=k0(t,n),o=X3(e,r),l=d=>d>1?1:d<0?0:d,c=d=>{for(var u=d>1?1:d,f=u,p=0;p<8;++p){var m=i(f)-u,x=o(f);if(Math.abs(m-u)<Jl||x<Jl)return s(f);f=l(f-m/x)}return s(f)};return c.isStepper=!1,c},P0=function(){return Q3(...J3(...arguments))},eD=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:n=8,dt:i=17}=t,s=(o,l,c)=>{var d=-(o-l)*r,u=c*n,f=c+(d-u)*i/1e3,p=c*i/1e3+o;return Math.abs(p-l)<Jl&&Math.abs(f)<Jl?[l,0]:[p,f]};return s.isStepper=!0,s.dt=i,s},tD=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return P0(e);case"spring":return eD();default:if(e.split("(")[0]==="cubic-bezier")return P0(e)}return typeof e=="function"?e:null};function rD(e){var t,r=()=>null,n=!1,i=null,s=o=>{if(!n){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...d]=l;if(typeof c=="number"){i=e.setTimeout(s.bind(null,d),c);return}s(c),i=e.setTimeout(s.bind(null,d));return}typeof o=="string"&&(t=o,r(t)),typeof o=="object"&&(t=o,r(t)),typeof o=="function"&&o()}};return{stop:()=>{n=!0},start:o=>{n=!1,i&&(i(),i=null),s(o)},subscribe:o=>(r=o,()=>{r=()=>null}),getTimeoutController:()=>e}}class nD{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),i=null,s=o=>{o-n>=r?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(s))};return i=requestAnimationFrame(s),()=>{i!=null&&cancelAnimationFrame(i)}}}function iD(){return rD(new nD)}var aD=h.createContext(iD);function sD(e,t){var r=h.useContext(aD);return h.useMemo(()=>t??r(e),[e,t,r])}var oD={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},_0={t:0},md={t:1};function fu(e){var t=ft(e,oD),{isActive:r,canBegin:n,duration:i,easing:s,begin:o,onAnimationEnd:l,onAnimationStart:c,children:d}=t,u=sD(t.animationId,t.animationManager),[f,p]=h.useState(r?_0:md),m=h.useRef(null);return h.useEffect(()=>{r||p(md)},[r]),h.useEffect(()=>{if(!r||!n)return ka;var x=Z3(_0,md,tD(s),i,p,u.getTimeoutController()),g=()=>{m.current=x()};return u.start([c,o,g,i,l]),()=>{u.stop(),m.current&&m.current(),l()}},[r,n,i,s,o,c,l,u]),d(f.t)}function pu(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=h.useRef(Ts(t)),n=h.useRef(e);return n.current!==e&&(r.current=Ts(t),n.current=e),r.current}var lD=["radius"],cD=["radius"];function C0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function A0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?C0(Object(r),!0).forEach(function(n){uD(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):C0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uD(e,t,r){return(t=dD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dD(e){var t=fD(e,"string");return typeof t=="symbol"?t:t+""}function fD(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ql(){return Ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ql.apply(null,arguments)}function O0(e,t){if(e==null)return{};var r,n,i=pD(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function pD(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var E0=(e,t,r,n,i)=>{var s=Math.min(Math.abs(r)/2,Math.abs(n)/2),o=n>=0?1:-1,l=r>=0?1:-1,c=n>=0&&r>=0||n<0&&r<0?1:0,d;if(s>0&&i instanceof Array){for(var u=[0,0,0,0],f=0,p=4;f<p;f++)u[f]=i[f]>s?s:i[f];d="M".concat(e,",").concat(t+o*u[0]),u[0]>0&&(d+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(c,",").concat(e+l*u[0],",").concat(t)),d+="L ".concat(e+r-l*u[1],",").concat(t),u[1]>0&&(d+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(c,`,
`).concat(e+r,",").concat(t+o*u[1])),d+="L ".concat(e+r,",").concat(t+n-o*u[2]),u[2]>0&&(d+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(c,`,
`).concat(e+r-l*u[2],",").concat(t+n)),d+="L ".concat(e+l*u[3],",").concat(t+n),u[3]>0&&(d+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(c,`,
`).concat(e,",").concat(t+n-o*u[3])),d+="Z"}else if(s>0&&i===+i&&i>0){var m=Math.min(s,i);d="M ".concat(e,",").concat(t+o*m,`
A `).concat(m,",").concat(m,",0,0,").concat(c,",").concat(e+l*m,",").concat(t,`
L `).concat(e+r-l*m,",").concat(t,`
A `).concat(m,",").concat(m,",0,0,").concat(c,",").concat(e+r,",").concat(t+o*m,`
L `).concat(e+r,",").concat(t+n-o*m,`
A `).concat(m,",").concat(m,",0,0,").concat(c,",").concat(e+r-l*m,",").concat(t+n,`
L `).concat(e+l*m,",").concat(t+n,`
A `).concat(m,",").concat(m,",0,0,").concat(c,",").concat(e,",").concat(t+n-o*m," Z")}else d="M ".concat(e,",").concat(t," h ").concat(r," v ").concat(n," h ").concat(-r," Z");return d},D0={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Gw=e=>{var t=ft(e,D0),r=h.useRef(null),[n,i]=h.useState(-1);h.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var D=r.current.getTotalLength();D&&i(D)}catch{}},[]);var{x:s,y:o,width:l,height:c,radius:d,className:u}=t,{animationEasing:f,animationDuration:p,animationBegin:m,isAnimationActive:x,isUpdateAnimationActive:g}=t,b=h.useRef(l),v=h.useRef(c),j=h.useRef(s),y=h.useRef(o),w=h.useMemo(()=>({x:s,y:o,width:l,height:c,radius:d}),[s,o,l,c,d]),S=pu(w,"rectangle-");if(s!==+s||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var N=ce("recharts-rectangle",u);if(!g){var P=ut(t),{radius:_}=P,T=O0(P,lD);return h.createElement("path",Ql({},T,{radius:typeof d=="number"?d:void 0,className:N,d:E0(s,o,l,c,d)}))}var $=b.current,M=v.current,C=j.current,R=y.current,q="0px ".concat(n===-1?1:n,"px"),Z="".concat(n,"px 0px"),E=Hw(["strokeDasharray"],p,typeof f=="string"?f:D0.animationEasing);return h.createElement(fu,{animationId:S,key:S,canBegin:n>0,duration:p,easing:f,isActive:g,begin:m},D=>{var O=De($,l,D),k=De(M,c,D),L=De(C,s,D),U=De(R,o,D);r.current&&(b.current=O,v.current=k,j.current=L,y.current=U);var H;x?D>0?H={transition:E,strokeDasharray:Z}:H={strokeDasharray:q}:H={strokeDasharray:Z};var te=ut(t),{radius:re}=te,we=O0(te,cD);return h.createElement("path",Ql({},we,{radius:typeof d=="number"?d:void 0,className:N,d:E0(L,U,O,k,d),ref:r,style:A0(A0({},H),t.style)}))})};function T0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function M0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T0(Object(r),!0).forEach(function(n){hD(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hD(e,t,r){return(t=mD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mD(e){var t=gD(e,"string");return typeof t=="symbol"?t:t+""}function gD(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ec=Math.PI/180,xD=e=>e*180/Math.PI,Je=(e,t,r,n)=>({x:e+Math.cos(-ec*n)*r,y:t+Math.sin(-ec*n)*r}),yD=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},vD=(e,t)=>{var{x:r,y:n}=e,{x:i,y:s}=t;return Math.sqrt((r-i)**2+(n-s)**2)},bD=(e,t)=>{var{x:r,y:n}=e,{cx:i,cy:s}=t,o=vD({x:r,y:n},{x:i,y:s});if(o<=0)return{radius:o,angle:0};var l=(r-i)/o,c=Math.acos(l);return n>s&&(c=2*Math.PI-c),{radius:o,angle:xD(c),angleInRadian:c}},jD=e=>{var{startAngle:t,endAngle:r}=e,n=Math.floor(t/360),i=Math.floor(r/360),s=Math.min(n,i);return{startAngle:t-s*360,endAngle:r-s*360}},wD=(e,t)=>{var{startAngle:r,endAngle:n}=t,i=Math.floor(r/360),s=Math.floor(n/360),o=Math.min(i,s);return e+o*360},SD=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:i,angle:s}=bD({x:r,y:n},t),{innerRadius:o,outerRadius:l}=t;if(i<o||i>l||i===0)return null;var{startAngle:c,endAngle:d}=jD(t),u=s,f;if(c<=d){for(;u>d;)u-=360;for(;u<c;)u+=360;f=u>=c&&u<=d}else{for(;u>c;)u-=360;for(;u<d;)u+=360;f=u>=d&&u<=c}return f?M0(M0({},t),{},{radius:i,angle:wD(u,t)}):null};function Zw(e){var{cx:t,cy:r,radius:n,startAngle:i,endAngle:s}=e,o=Je(t,r,n,i),l=Je(t,r,n,s);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:i,endAngle:s}}function Jf(){return Jf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jf.apply(null,arguments)}var ND=(e,t)=>{var r=Jt(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},Fo=e=>{var{cx:t,cy:r,radius:n,angle:i,sign:s,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,d=l*(o?1:-1)+n,u=Math.asin(l/d)/ec,f=c?i:i+s*u,p=Je(t,r,d,f),m=Je(t,r,n,f),x=c?i-s*u:i,g=Je(t,r,d*Math.cos(u*ec),x);return{center:p,circleTangency:m,lineTangency:g,theta:u}},Xw=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:s,endAngle:o}=e,l=ND(s,o),c=s+l,d=Je(t,r,i,s),u=Je(t,r,i,c),f="M ".concat(d.x,",").concat(d.y,`
A `).concat(i,",").concat(i,`,0,
`).concat(+(Math.abs(l)>180),",").concat(+(s>c),`,
`).concat(u.x,",").concat(u.y,`
`);if(n>0){var p=Je(t,r,n,s),m=Je(t,r,n,c);f+="L ".concat(m.x,",").concat(m.y,`
A `).concat(n,",").concat(n,`,0,
`).concat(+(Math.abs(l)>180),",").concat(+(s<=c),`,
`).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(t,",").concat(r," Z");return f},kD=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:i,cornerRadius:s,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:d}=e,u=Jt(d-c),{circleTangency:f,lineTangency:p,theta:m}=Fo({cx:t,cy:r,radius:i,angle:c,sign:u,cornerRadius:s,cornerIsExternal:l}),{circleTangency:x,lineTangency:g,theta:b}=Fo({cx:t,cy:r,radius:i,angle:d,sign:-u,cornerRadius:s,cornerIsExternal:l}),v=l?Math.abs(c-d):Math.abs(c-d)-m-b;if(v<0)return o?"M ".concat(p.x,",").concat(p.y,`
a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0
a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0
`):Xw({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:c,endAngle:d});var j="M ".concat(p.x,",").concat(p.y,`
A`).concat(s,",").concat(s,",0,0,").concat(+(u<0),",").concat(f.x,",").concat(f.y,`
A`).concat(i,",").concat(i,",0,").concat(+(v>180),",").concat(+(u<0),",").concat(x.x,",").concat(x.y,`
A`).concat(s,",").concat(s,",0,0,").concat(+(u<0),",").concat(g.x,",").concat(g.y,`
`);if(n>0){var{circleTangency:y,lineTangency:w,theta:S}=Fo({cx:t,cy:r,radius:n,angle:c,sign:u,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),{circleTangency:N,lineTangency:P,theta:_}=Fo({cx:t,cy:r,radius:n,angle:d,sign:-u,isExternal:!0,cornerRadius:s,cornerIsExternal:l}),T=l?Math.abs(c-d):Math.abs(c-d)-S-_;if(T<0&&s===0)return"".concat(j,"L").concat(t,",").concat(r,"Z");j+="L".concat(P.x,",").concat(P.y,`
A`).concat(s,",").concat(s,",0,0,").concat(+(u<0),",").concat(N.x,",").concat(N.y,`
A`).concat(n,",").concat(n,",0,").concat(+(T>180),",").concat(+(u>0),",").concat(y.x,",").concat(y.y,`
A`).concat(s,",").concat(s,",0,0,").concat(+(u<0),",").concat(w.x,",").concat(w.y,"Z")}else j+="L".concat(t,",").concat(r,"Z");return j},PD={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Jw=e=>{var t=ft(e,PD),{cx:r,cy:n,innerRadius:i,outerRadius:s,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u,className:f}=t;if(s<i||d===u)return null;var p=ce("recharts-sector",f),m=s-i,x=Rn(o,m,0,!0),g;return x>0&&Math.abs(d-u)<360?g=kD({cx:r,cy:n,innerRadius:i,outerRadius:s,cornerRadius:Math.min(x,m/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:u}):g=Xw({cx:r,cy:n,innerRadius:i,outerRadius:s,startAngle:d,endAngle:u}),h.createElement("path",Jf({},ut(t),{className:p,d:g}))};function _D(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(Ej(t)){if(e==="centric"){var{cx:n,cy:i,innerRadius:s,outerRadius:o,angle:l}=t,c=Je(n,i,s,l),d=Je(n,i,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return Zw(t)}}var Qw={},eS={},tS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Kh;function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(tS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tS;function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(eS);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Vh,r=eS;function n(i,s,o){o&&typeof o!="number"&&t.isIterateeCall(i,s,o)&&(s=o=void 0),i=r.toFinite(i),s===void 0?(s=i,i=0):s=r.toFinite(s),o=o===void 0?i<s?1:-1:r.toFinite(o);const l=Math.max(Math.ceil((s-i)/(o||1)),0),c=new Array(l);for(let d=0;d<l;d++)c[d]=i,i+=o;return c}e.range=n})(Qw);var CD=Qw.range;const rS=Tr(CD);function Mn(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function AD(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function em(e){let t,r,n;e.length!==2?(t=Mn,r=(l,c)=>Mn(e(l),c),n=(l,c)=>e(l)-c):(t=e===Mn||e===AD?e:OD,r=e,n=e);function i(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<0?d=f+1:u=f}while(d<u)}return d}function s(l,c,d=0,u=l.length){if(d<u){if(t(c,c)!==0)return u;do{const f=d+u>>>1;r(l[f],c)<=0?d=f+1:u=f}while(d<u)}return d}function o(l,c,d=0,u=l.length){const f=i(l,c,d,u-1);return f>d&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:i,center:o,right:s}}function OD(){return 0}function nS(e){return e===null?NaN:+e}function*ED(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const DD=em(Mn),ro=DD.right;em(nS).center;class I0 extends Map{constructor(t,r=ID){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get($0(this,t))}has(t){return super.has($0(this,t))}set(t,r){return super.set(TD(this,t),r)}delete(t){return super.delete(MD(this,t))}}function $0({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function TD({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function MD({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function ID(e){return e!==null&&typeof e=="object"?e.valueOf():e}function $D(e=Mn){if(e===Mn)return iS;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function iS(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const LD=Math.sqrt(50),zD=Math.sqrt(10),RD=Math.sqrt(2);function tc(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),s=n/Math.pow(10,i),o=s>=LD?10:s>=zD?5:s>=RD?2:1;let l,c,d;return i<0?(d=Math.pow(10,-i)/o,l=Math.round(e*d),c=Math.round(t*d),l/d<e&&++l,c/d>t&&--c,d=-d):(d=Math.pow(10,i)*o,l=Math.round(e/d),c=Math.round(t/d),l*d<e&&++l,c*d>t&&--c),c<l&&.5<=r&&r<2?tc(e,t,r*2):[l,c,d]}function Qf(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[i,s,o]=n?tc(t,e,r):tc(e,t,r);if(!(s>=i))return[];const l=s-i+1,c=new Array(l);if(n)if(o<0)for(let d=0;d<l;++d)c[d]=(s-d)/-o;else for(let d=0;d<l;++d)c[d]=(s-d)*o;else if(o<0)for(let d=0;d<l;++d)c[d]=(i+d)/-o;else for(let d=0;d<l;++d)c[d]=(i+d)*o;return c}function ep(e,t,r){return t=+t,e=+e,r=+r,tc(e,t,r)[2]}function tp(e,t,r){t=+t,e=+e,r=+r;const n=t<e,i=n?ep(t,e,r):ep(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}function L0(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function z0(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function aS(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?iS:$D(i);n>r;){if(n-r>600){const c=n-r+1,d=t-r+1,u=Math.log(c),f=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*f*(c-f)/c)*(d-c/2<0?-1:1),m=Math.max(r,Math.floor(t-d*f/c+p)),x=Math.min(n,Math.floor(t+(c-d)*f/c+p));aS(e,t,m,x,i)}const s=e[t];let o=r,l=n;for(Ha(e,r,t),i(e[n],s)>0&&Ha(e,r,n);o<l;){for(Ha(e,o,l),++o,--l;i(e[o],s)<0;)++o;for(;i(e[l],s)>0;)--l}i(e[r],s)===0?Ha(e,r,l):(++l,Ha(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Ha(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function BD(e,t,r){if(e=Float64Array.from(ED(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return z0(e);if(t>=1)return L0(e);var n,i=(n-1)*t,s=Math.floor(i),o=L0(aS(e,s).subarray(0,s+1)),l=z0(e.subarray(s+1));return o+(l-o)*(i-s)}}function FD(e,t,r=nS){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,s=Math.floor(i),o=+r(e[s],s,e),l=+r(e[s+1],s+1,e);return o+(l-o)*(i-s)}}function WD(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,s=new Array(i);++n<i;)s[n]=e+n*r;return s}function or(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function un(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 rp=Symbol("implicit");function tm(){var e=new I0,t=[],r=[],n=rp;function i(s){let o=e.get(s);if(o===void 0){if(n!==rp)return n;e.set(s,o=t.push(s)-1)}return r[o%r.length]}return i.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new I0;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(s){return arguments.length?(r=Array.from(s),i):r.slice()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return tm(t,r).unknown(n)},or.apply(i,arguments),i}function rm(){var e=tm().unknown(void 0),t=e.domain,r=e.range,n=0,i=1,s,o,l=!1,c=0,d=0,u=.5;delete e.unknown;function f(){var p=t().length,m=i<n,x=m?i:n,g=m?n:i;s=(g-x)/Math.max(1,p-c+d*2),l&&(s=Math.floor(s)),x+=(g-x-s*(p-c))*u,o=s*(1-c),l&&(x=Math.round(x),o=Math.round(o));var b=WD(p).map(function(v){return x+s*v});return r(m?b.reverse():b)}return e.domain=function(p){return arguments.length?(t(p),f()):t()},e.range=function(p){return arguments.length?([n,i]=p,n=+n,i=+i,f()):[n,i]},e.rangeRound=function(p){return[n,i]=p,n=+n,i=+i,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return s},e.round=function(p){return arguments.length?(l=!!p,f()):l},e.padding=function(p){return arguments.length?(c=Math.min(1,d=+p),f()):c},e.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),f()):c},e.paddingOuter=function(p){return arguments.length?(d=+p,f()):d},e.align=function(p){return arguments.length?(u=Math.max(0,Math.min(1,p)),f()):u},e.copy=function(){return rm(t(),[n,i]).round(l).paddingInner(c).paddingOuter(d).align(u)},or.apply(f(),arguments)}function sS(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return sS(t())},e}function UD(){return sS(rm.apply(null,arguments).paddingInner(1))}function nm(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function oS(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function no(){}var zs=.7,rc=1/zs,ia="\\s*([+-]?\\d+)\\s*",Rs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ar="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qD=/^#([0-9a-f]{3,8})$/,HD=new RegExp(`^rgb\\(${ia},${ia},${ia}\\)$`),KD=new RegExp(`^rgb\\(${Ar},${Ar},${Ar}\\)$`),VD=new RegExp(`^rgba\\(${ia},${ia},${ia},${Rs}\\)$`),YD=new RegExp(`^rgba\\(${Ar},${Ar},${Ar},${Rs}\\)$`),GD=new RegExp(`^hsl\\(${Rs},${Ar},${Ar}\\)$`),ZD=new RegExp(`^hsla\\(${Rs},${Ar},${Ar},${Rs}\\)$`),R0={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};nm(no,Bs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:B0,formatHex:B0,formatHex8:XD,formatHsl:JD,formatRgb:F0,toString:F0});function B0(){return this.rgb().formatHex()}function XD(){return this.rgb().formatHex8()}function JD(){return lS(this).formatHsl()}function F0(){return this.rgb().formatRgb()}function Bs(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=qD.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?W0(t):r===3?new Nt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Wo(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Wo(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=HD.exec(e))?new Nt(t[1],t[2],t[3],1):(t=KD.exec(e))?new Nt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=VD.exec(e))?Wo(t[1],t[2],t[3],t[4]):(t=YD.exec(e))?Wo(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=GD.exec(e))?H0(t[1],t[2]/100,t[3]/100,1):(t=ZD.exec(e))?H0(t[1],t[2]/100,t[3]/100,t[4]):R0.hasOwnProperty(e)?W0(R0[e]):e==="transparent"?new Nt(NaN,NaN,NaN,0):null}function W0(e){return new Nt(e>>16&255,e>>8&255,e&255,1)}function Wo(e,t,r,n){return n<=0&&(e=t=r=NaN),new Nt(e,t,r,n)}function QD(e){return e instanceof no||(e=Bs(e)),e?(e=e.rgb(),new Nt(e.r,e.g,e.b,e.opacity)):new Nt}function np(e,t,r,n){return arguments.length===1?QD(e):new Nt(e,t,r,n??1)}function Nt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}nm(Nt,np,oS(no,{brighter(e){return e=e==null?rc:Math.pow(rc,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zs:Math.pow(zs,e),new Nt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Nt(ui(this.r),ui(this.g),ui(this.b),nc(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:U0,formatHex:U0,formatHex8:e5,formatRgb:q0,toString:q0}));function U0(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}`}function e5(){return`#${ni(this.r)}${ni(this.g)}${ni(this.b)}${ni((isNaN(this.opacity)?1:this.opacity)*255)}`}function q0(){const e=nc(this.opacity);return`${e===1?"rgb(":"rgba("}${ui(this.r)}, ${ui(this.g)}, ${ui(this.b)}${e===1?")":`, ${e})`}`}function nc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ui(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ni(e){return e=ui(e),(e<16?"0":"")+e.toString(16)}function H0(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new pr(e,t,r,n)}function lS(e){if(e instanceof pr)return new pr(e.h,e.s,e.l,e.opacity);if(e instanceof no||(e=Bs(e)),!e)return new pr;if(e instanceof pr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),s=Math.max(t,r,n),o=NaN,l=s-i,c=(s+i)/2;return l?(t===s?o=(r-n)/l+(r<n)*6:r===s?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?s+i:2-s-i,o*=60):l=c>0&&c<1?0:o,new pr(o,l,c,e.opacity)}function t5(e,t,r,n){return arguments.length===1?lS(e):new pr(e,t,r,n??1)}function pr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}nm(pr,t5,oS(no,{brighter(e){return e=e==null?rc:Math.pow(rc,e),new pr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zs:Math.pow(zs,e),new pr(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,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Nt(gd(e>=240?e-240:e+120,i,n),gd(e,i,n),gd(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new pr(K0(this.h),Uo(this.s),Uo(this.l),nc(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=nc(this.opacity);return`${e===1?"hsl(":"hsla("}${K0(this.h)}, ${Uo(this.s)*100}%, ${Uo(this.l)*100}%${e===1?")":`, ${e})`}`}}));function K0(e){return e=(e||0)%360,e<0?e+360:e}function Uo(e){return Math.max(0,Math.min(1,e||0))}function gd(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const im=e=>()=>e;function r5(e,t){return function(r){return e+r*t}}function n5(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function i5(e){return(e=+e)==1?cS:function(t,r){return r-t?n5(t,r,e):im(isNaN(t)?r:t)}}function cS(e,t){var r=t-e;return r?r5(e,r):im(isNaN(e)?t:e)}const V0=function e(t){var r=i5(t);function n(i,s){var o=r((i=np(i)).r,(s=np(s)).r),l=r(i.g,s.g),c=r(i.b,s.b),d=cS(i.opacity,s.opacity);return function(u){return i.r=o(u),i.g=l(u),i.b=c(u),i.opacity=d(u),i+""}}return n.gamma=e,n}(1);function a5(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(s){for(i=0;i<r;++i)n[i]=e[i]*(1-s)+t[i]*s;return n}}function s5(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function o5(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),s=new Array(r),o;for(o=0;o<n;++o)i[o]=Pa(e[o],t[o]);for(;o<r;++o)s[o]=t[o];return function(l){for(o=0;o<n;++o)s[o]=i[o](l);return s}}function l5(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function ic(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function c5(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=Pa(e[i],t[i]):n[i]=t[i];return function(s){for(i in r)n[i]=r[i](s);return n}}var ip=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xd=new RegExp(ip.source,"g");function u5(e){return function(){return e}}function d5(e){return function(t){return e(t)+""}}function f5(e,t){var r=ip.lastIndex=xd.lastIndex=0,n,i,s,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=ip.exec(e))&&(i=xd.exec(t));)(s=i.index)>r&&(s=t.slice(r,s),l[o]?l[o]+=s:l[++o]=s),(n=n[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:ic(n,i)})),r=xd.lastIndex;return r<t.length&&(s=t.slice(r),l[o]?l[o]+=s:l[++o]=s),l.length<2?c[0]?d5(c[0].x):u5(t):(t=c.length,function(d){for(var u=0,f;u<t;++u)l[(f=c[u]).i]=f.x(d);return l.join("")})}function Pa(e,t){var r=typeof t,n;return t==null||r==="boolean"?im(t):(r==="number"?ic:r==="string"?(n=Bs(t))?(t=n,V0):f5:t instanceof Bs?V0:t instanceof Date?l5:s5(t)?a5:Array.isArray(t)?o5:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?c5:ic)(e,t)}function am(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function p5(e,t){t===void 0&&(t=e,e=Pa);for(var r=0,n=t.length-1,i=t[0],s=new Array(n<0?0:n);r<n;)s[r]=e(i,i=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return s[l](o-l)}}function h5(e){return function(){return e}}function ac(e){return+e}var Y0=[0,1];function mt(e){return e}function ap(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:h5(isNaN(t)?NaN:.5)}function m5(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function g5(e,t,r){var n=e[0],i=e[1],s=t[0],o=t[1];return i<n?(n=ap(i,n),s=r(o,s)):(n=ap(n,i),s=r(s,o)),function(l){return s(n(l))}}function x5(e,t,r){var n=Math.min(e.length,t.length)-1,i=new Array(n),s=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)i[o]=ap(e[o],e[o+1]),s[o]=r(t[o],t[o+1]);return function(l){var c=ro(e,l,1,n)-1;return s[c](i[c](l))}}function io(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function hu(){var e=Y0,t=Y0,r=Pa,n,i,s,o=mt,l,c,d;function u(){var p=Math.min(e.length,t.length);return o!==mt&&(o=m5(e[0],e[p-1])),l=p>2?x5:g5,c=d=null,f}function f(p){return p==null||isNaN(p=+p)?s:(c||(c=l(e.map(n),t,r)))(n(o(p)))}return f.invert=function(p){return o(i((d||(d=l(t,e.map(n),ic)))(p)))},f.domain=function(p){return arguments.length?(e=Array.from(p,ac),u()):e.slice()},f.range=function(p){return arguments.length?(t=Array.from(p),u()):t.slice()},f.rangeRound=function(p){return t=Array.from(p),r=am,u()},f.clamp=function(p){return arguments.length?(o=p?!0:mt,u()):o!==mt},f.interpolate=function(p){return arguments.length?(r=p,u()):r},f.unknown=function(p){return arguments.length?(s=p,f):s},function(p,m){return n=p,i=m,u()}}function sm(){return hu()(mt,mt)}function y5(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function sc(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ma(e){return e=sc(Math.abs(e)),e?e[1]:NaN}function v5(e,t){return function(r,n){for(var i=r.length,s=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),s.push(r.substring(i-=l,i+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return s.reverse().join(t)}}function b5(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var j5=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fs(e){if(!(t=j5.exec(e)))throw new Error("invalid format: "+e);var t;return new om({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]})}Fs.prototype=om.prototype;function om(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+""}om.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 w5(e){e:for(var t=e.length,r=1,n=-1,i;r<t;++r)switch(e[r]){case".":n=i=r;break;case"0":n===0&&(n=r),i=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var uS;function S5(e,t){var r=sc(e,t);if(!r)return e+"";var n=r[0],i=r[1],s=i-(uS=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return s===o?n:s>o?n+new Array(s-o+1).join("0"):s>0?n.slice(0,s)+"."+n.slice(s):"0."+new Array(1-s).join("0")+sc(e,Math.max(0,t+s-1))[0]}function G0(e,t){var r=sc(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const Z0={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:y5,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)=>G0(e*100,t),r:G0,s:S5,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function X0(e){return e}var J0=Array.prototype.map,Q0=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function N5(e){var t=e.grouping===void 0||e.thousands===void 0?X0:v5(J0.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?X0:b5(J0.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function d(f){f=Fs(f);var p=f.fill,m=f.align,x=f.sign,g=f.symbol,b=f.zero,v=f.width,j=f.comma,y=f.precision,w=f.trim,S=f.type;S==="n"?(j=!0,S="g"):Z0[S]||(y===void 0&&(y=12),w=!0,S="g"),(b||p==="0"&&m==="=")&&(b=!0,p="0",m="=");var N=g==="$"?r:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",P=g==="$"?n:/[%p]/.test(S)?o:"",_=Z0[S],T=/[defgprs%]/.test(S);y=y===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function $(M){var C=N,R=P,q,Z,E;if(S==="c")R=_(M)+R,M="";else{M=+M;var D=M<0||1/M<0;if(M=isNaN(M)?c:_(Math.abs(M),y),w&&(M=w5(M)),D&&+M==0&&x!=="+"&&(D=!1),C=(D?x==="("?x:l:x==="-"||x==="("?"":x)+C,R=(S==="s"?Q0[8+uS/3]:"")+R+(D&&x==="("?")":""),T){for(q=-1,Z=M.length;++q<Z;)if(E=M.charCodeAt(q),48>E||E>57){R=(E===46?i+M.slice(q+1):M.slice(q))+R,M=M.slice(0,q);break}}}j&&!b&&(M=t(M,1/0));var O=C.length+M.length+R.length,k=O<v?new Array(v-O+1).join(p):"";switch(j&&b&&(M=t(k+M,k.length?v-R.length:1/0),k=""),m){case"<":M=C+M+R+k;break;case"=":M=C+k+M+R;break;case"^":M=k.slice(0,O=k.length>>1)+C+M+R+k.slice(O);break;default:M=k+C+M+R;break}return s(M)}return $.toString=function(){return f+""},$}function u(f,p){var m=d((f=Fs(f),f.type="f",f)),x=Math.max(-8,Math.min(8,Math.floor(ma(p)/3)))*3,g=Math.pow(10,-x),b=Q0[8+x/3];return function(v){return m(g*v)+b}}return{format:d,formatPrefix:u}}var qo,lm,dS;k5({thousands:",",grouping:[3],currency:["$",""]});function k5(e){return qo=N5(e),lm=qo.format,dS=qo.formatPrefix,qo}function P5(e){return Math.max(0,-ma(Math.abs(e)))}function _5(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ma(t)/3)))*3-ma(Math.abs(e)))}function C5(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ma(t)-ma(e))+1}function fS(e,t,r,n){var i=tp(e,t,r),s;switch(n=Fs(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(s=_5(i,o))&&(n.precision=s),dS(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(s=C5(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=s-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(s=P5(i))&&(n.precision=s-(n.type==="%")*2);break}}return lm(n)}function qn(e){var t=e.domain;return e.ticks=function(r){var n=t();return Qf(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return fS(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,s=n.length-1,o=n[i],l=n[s],c,d,u=10;for(l<o&&(d=o,o=l,l=d,d=i,i=s,s=d);u-- >0;){if(d=ep(o,l,r),d===c)return n[i]=o,n[s]=l,t(n);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;c=d}return e},e}function pS(){var e=sm();return e.copy=function(){return io(e,pS())},or.apply(e,arguments),qn(e)}function hS(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,ac),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return hS(e).unknown(t)},e=arguments.length?Array.from(e,ac):[0,1],qn(r)}function mS(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],s=e[n],o;return s<i&&(o=r,r=n,n=o,o=i,i=s,s=o),e[r]=t.floor(i),e[n]=t.ceil(s),e}function ey(e){return Math.log(e)}function ty(e){return Math.exp(e)}function A5(e){return-Math.log(-e)}function O5(e){return-Math.exp(-e)}function E5(e){return isFinite(e)?+("1e"+e):e<0?0:e}function D5(e){return e===10?E5:e===Math.E?Math.exp:t=>Math.pow(e,t)}function T5(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 ry(e){return(t,r)=>-e(-t,r)}function cm(e){const t=e(ey,ty),r=t.domain;let n=10,i,s;function o(){return i=T5(n),s=D5(n),r()[0]<0?(i=ry(i),s=ry(s),e(A5,O5)):e(ey,ty),t}return t.base=function(l){return arguments.length?(n=+l,o()):n},t.domain=function(l){return arguments.length?(r(l),o()):r()},t.ticks=l=>{const c=r();let d=c[0],u=c[c.length-1];const f=u<d;f&&([d,u]=[u,d]);let p=i(d),m=i(u),x,g;const b=l==null?10:+l;let v=[];if(!(n%1)&&m-p<b){if(p=Math.floor(p),m=Math.ceil(m),d>0){for(;p<=m;++p)for(x=1;x<n;++x)if(g=p<0?x/s(-p):x*s(p),!(g<d)){if(g>u)break;v.push(g)}}else for(;p<=m;++p)for(x=n-1;x>=1;--x)if(g=p>0?x/s(-p):x*s(p),!(g<d)){if(g>u)break;v.push(g)}v.length*2<b&&(v=Qf(d,u,b))}else v=Qf(p,m,Math.min(m-p,b)).map(s);return f?v.reverse():v},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Fs(c)).precision==null&&(c.trim=!0),c=lm(c)),l===1/0)return c;const d=Math.max(1,n*l/t.ticks().length);return u=>{let f=u/s(Math.round(i(u)));return f*n<n-.5&&(f*=n),f<=d?c(u):""}},t.nice=()=>r(mS(r(),{floor:l=>s(Math.floor(i(l))),ceil:l=>s(Math.ceil(i(l)))})),t}function gS(){const e=cm(hu()).domain([1,10]);return e.copy=()=>io(e,gS()).base(e.base()),or.apply(e,arguments),e}function ny(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function iy(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function um(e){var t=1,r=e(ny(t),iy(t));return r.constant=function(n){return arguments.length?e(ny(t=+n),iy(t)):t},qn(r)}function xS(){var e=um(hu());return e.copy=function(){return io(e,xS()).constant(e.constant())},or.apply(e,arguments)}function ay(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function M5(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function I5(e){return e<0?-e*e:e*e}function dm(e){var t=e(mt,mt),r=1;function n(){return r===1?e(mt,mt):r===.5?e(M5,I5):e(ay(r),ay(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},qn(t)}function fm(){var e=dm(hu());return e.copy=function(){return io(e,fm()).exponent(e.exponent())},or.apply(e,arguments),e}function $5(){return fm.apply(null,arguments).exponent(.5)}function sy(e){return Math.sign(e)*e*e}function L5(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function yS(){var e=sm(),t=[0,1],r=!1,n;function i(s){var o=L5(e(s));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(s){return e.invert(sy(s))},i.domain=function(s){return arguments.length?(e.domain(s),i):e.domain()},i.range=function(s){return arguments.length?(e.range((t=Array.from(s,ac)).map(sy)),i):t.slice()},i.rangeRound=function(s){return i.range(s).round(!0)},i.round=function(s){return arguments.length?(r=!!s,i):r},i.clamp=function(s){return arguments.length?(e.clamp(s),i):e.clamp()},i.unknown=function(s){return arguments.length?(n=s,i):n},i.copy=function(){return yS(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},or.apply(i,arguments),qn(i)}function vS(){var e=[],t=[],r=[],n;function i(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=FD(e,o/l);return s}function s(o){return o==null||isNaN(o=+o)?n:t[ro(r,o)]}return s.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:e[0],l<r.length?r[l]:e[e.length-1]]},s.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Mn),i()},s.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},s.unknown=function(o){return arguments.length?(n=o,s):n},s.quantiles=function(){return r.slice()},s.copy=function(){return vS().domain(e).range(t).unknown(n)},or.apply(s,arguments)}function bS(){var e=0,t=1,r=1,n=[.5],i=[0,1],s;function o(c){return c!=null&&c<=c?i[ro(n,c,0,r)]:s}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*t-(c-r)*e)/(r+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(r=(i=Array.from(c)).length-1,l()):i.slice()},o.invertExtent=function(c){var d=i.indexOf(c);return d<0?[NaN,NaN]:d<1?[e,n[0]]:d>=r?[n[r-1],t]:[n[d-1],n[d]]},o.unknown=function(c){return arguments.length&&(s=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return bS().domain([e,t]).range(i).unknown(s)},or.apply(qn(o),arguments)}function jS(){var e=[.5],t=[0,1],r,n=1;function i(s){return s!=null&&s<=s?t[ro(e,s,0,n)]:r}return i.domain=function(s){return arguments.length?(e=Array.from(s),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(s){return arguments.length?(t=Array.from(s),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},i.unknown=function(s){return arguments.length?(r=s,i):r},i.copy=function(){return jS().domain(e).range(t).unknown(r)},or.apply(i,arguments)}const yd=new Date,vd=new Date;function Be(e,t,r,n){function i(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return i.floor=s=>(e(s=new Date(+s)),s),i.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),i.round=s=>{const o=i(s),l=i.ceil(s);return s-o<l-s?o:l},i.offset=(s,o)=>(t(s=new Date(+s),o==null?1:Math.floor(o)),s),i.range=(s,o,l)=>{const c=[];if(s=i.ceil(s),l=l==null?1:Math.floor(l),!(s<o)||!(l>0))return c;let d;do c.push(d=new Date(+s)),t(s,l),e(s);while(d<s&&s<o);return c},i.filter=s=>Be(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!s(o););else for(;--l>=0;)for(;t(o,1),!s(o););}),r&&(i.count=(s,o)=>(yd.setTime(+s),vd.setTime(+o),e(yd),e(vd),Math.floor(r(yd,vd))),i.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?i.filter(n?o=>n(o)%s===0:o=>i.count(0,o)%s===0):i)),i}const oc=Be(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);oc.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Be(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):oc);oc.range;const Wr=1e3,Qt=Wr*60,Ur=Qt*60,tn=Ur*24,pm=tn*7,oy=tn*30,bd=tn*365,ii=Be(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Wr)},(e,t)=>(t-e)/Wr,e=>e.getUTCSeconds());ii.range;const hm=Be(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Wr)},(e,t)=>{e.setTime(+e+t*Qt)},(e,t)=>(t-e)/Qt,e=>e.getMinutes());hm.range;const mm=Be(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Qt)},(e,t)=>(t-e)/Qt,e=>e.getUTCMinutes());mm.range;const gm=Be(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Wr-e.getMinutes()*Qt)},(e,t)=>{e.setTime(+e+t*Ur)},(e,t)=>(t-e)/Ur,e=>e.getHours());gm.range;const xm=Be(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ur)},(e,t)=>(t-e)/Ur,e=>e.getUTCHours());xm.range;const ao=Be(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Qt)/tn,e=>e.getDate()-1);ao.range;const mu=Be(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/tn,e=>e.getUTCDate()-1);mu.range;const wS=Be(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/tn,e=>Math.floor(e/tn));wS.range;function Ai(e){return Be(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Qt)/pm)}const gu=Ai(0),lc=Ai(1),z5=Ai(2),R5=Ai(3),ga=Ai(4),B5=Ai(5),F5=Ai(6);gu.range;lc.range;z5.range;R5.range;ga.range;B5.range;F5.range;function Oi(e){return Be(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/pm)}const xu=Oi(0),cc=Oi(1),W5=Oi(2),U5=Oi(3),xa=Oi(4),q5=Oi(5),H5=Oi(6);xu.range;cc.range;W5.range;U5.range;xa.range;q5.range;H5.range;const ym=Be(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());ym.range;const vm=Be(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());vm.range;const rn=Be(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());rn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Be(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});rn.range;const nn=Be(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());nn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Be(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});nn.range;function SS(e,t,r,n,i,s){const o=[[ii,1,Wr],[ii,5,5*Wr],[ii,15,15*Wr],[ii,30,30*Wr],[s,1,Qt],[s,5,5*Qt],[s,15,15*Qt],[s,30,30*Qt],[i,1,Ur],[i,3,3*Ur],[i,6,6*Ur],[i,12,12*Ur],[n,1,tn],[n,2,2*tn],[r,1,pm],[t,1,oy],[t,3,3*oy],[e,1,bd]];function l(d,u,f){const p=u<d;p&&([d,u]=[u,d]);const m=f&&typeof f.range=="function"?f:c(d,u,f),x=m?m.range(d,+u+1):[];return p?x.reverse():x}function c(d,u,f){const p=Math.abs(u-d)/f,m=em(([,,b])=>b).right(o,p);if(m===o.length)return e.every(tp(d/bd,u/bd,f));if(m===0)return oc.every(Math.max(tp(d,u,f),1));const[x,g]=o[p/o[m-1][2]<o[m][2]/p?m-1:m];return x.every(g)}return[l,c]}const[K5,V5]=SS(nn,vm,xu,wS,xm,mm),[Y5,G5]=SS(rn,ym,gu,ao,gm,hm);function jd(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 wd(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 Ka(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function Z5(e){var t=e.dateTime,r=e.date,n=e.time,i=e.periods,s=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,d=Va(i),u=Ya(i),f=Va(s),p=Ya(s),m=Va(o),x=Ya(o),g=Va(l),b=Ya(l),v=Va(c),j=Ya(c),y={a:D,A:O,b:k,B:L,c:null,d:py,e:py,f:vT,g:AT,G:ET,H:gT,I:xT,j:yT,L:NS,m:bT,M:jT,p:U,q:H,Q:gy,s:xy,S:wT,u:ST,U:NT,V:kT,w:PT,W:_T,x:null,X:null,y:CT,Y:OT,Z:DT,"%":my},w={a:te,A:re,b:we,B:A,c:null,d:hy,e:hy,f:$T,g:KT,G:YT,H:TT,I:MT,j:IT,L:PS,m:LT,M:zT,p:J,q:Ot,Q:gy,s:xy,S:RT,u:BT,U:FT,V:WT,w:UT,W:qT,x:null,X:null,y:HT,Y:VT,Z:GT,"%":my},S={a:$,A:M,b:C,B:R,c:q,d:dy,e:dy,f:fT,g:uy,G:cy,H:fy,I:fy,j:lT,L:dT,m:oT,M:cT,p:T,q:sT,Q:hT,s:mT,S:uT,u:tT,U:rT,V:nT,w:eT,W:iT,x:Z,X:E,y:uy,Y:cy,Z:aT,"%":pT};y.x=N(r,y),y.X=N(n,y),y.c=N(t,y),w.x=N(r,w),w.X=N(n,w),w.c=N(t,w);function N(z,ee){return function(ne){var W=[],bt=-1,pe=0,Et=z.length,Dt,Yn,ug;for(ne instanceof Date||(ne=new Date(+ne));++bt<Et;)z.charCodeAt(bt)===37&&(W.push(z.slice(pe,bt)),(Yn=ly[Dt=z.charAt(++bt)])!=null?Dt=z.charAt(++bt):Yn=Dt==="e"?" ":"0",(ug=ee[Dt])&&(Dt=ug(ne,Yn)),W.push(Dt),pe=bt+1);return W.push(z.slice(pe,bt)),W.join("")}}function P(z,ee){return function(ne){var W=Ka(1900,void 0,1),bt=_(W,z,ne+="",0),pe,Et;if(bt!=ne.length)return null;if("Q"in W)return new Date(W.Q);if("s"in W)return new Date(W.s*1e3+("L"in W?W.L:0));if(ee&&!("Z"in W)&&(W.Z=0),"p"in W&&(W.H=W.H%12+W.p*12),W.m===void 0&&(W.m="q"in W?W.q:0),"V"in W){if(W.V<1||W.V>53)return null;"w"in W||(W.w=1),"Z"in W?(pe=wd(Ka(W.y,0,1)),Et=pe.getUTCDay(),pe=Et>4||Et===0?cc.ceil(pe):cc(pe),pe=mu.offset(pe,(W.V-1)*7),W.y=pe.getUTCFullYear(),W.m=pe.getUTCMonth(),W.d=pe.getUTCDate()+(W.w+6)%7):(pe=jd(Ka(W.y,0,1)),Et=pe.getDay(),pe=Et>4||Et===0?lc.ceil(pe):lc(pe),pe=ao.offset(pe,(W.V-1)*7),W.y=pe.getFullYear(),W.m=pe.getMonth(),W.d=pe.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),Et="Z"in W?wd(Ka(W.y,0,1)).getUTCDay():jd(Ka(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(Et+5)%7:W.w+W.U*7-(Et+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,wd(W)):jd(W)}}function _(z,ee,ne,W){for(var bt=0,pe=ee.length,Et=ne.length,Dt,Yn;bt<pe;){if(W>=Et)return-1;if(Dt=ee.charCodeAt(bt++),Dt===37){if(Dt=ee.charAt(bt++),Yn=S[Dt in ly?ee.charAt(bt++):Dt],!Yn||(W=Yn(z,ne,W))<0)return-1}else if(Dt!=ne.charCodeAt(W++))return-1}return W}function T(z,ee,ne){var W=d.exec(ee.slice(ne));return W?(z.p=u.get(W[0].toLowerCase()),ne+W[0].length):-1}function $(z,ee,ne){var W=m.exec(ee.slice(ne));return W?(z.w=x.get(W[0].toLowerCase()),ne+W[0].length):-1}function M(z,ee,ne){var W=f.exec(ee.slice(ne));return W?(z.w=p.get(W[0].toLowerCase()),ne+W[0].length):-1}function C(z,ee,ne){var W=v.exec(ee.slice(ne));return W?(z.m=j.get(W[0].toLowerCase()),ne+W[0].length):-1}function R(z,ee,ne){var W=g.exec(ee.slice(ne));return W?(z.m=b.get(W[0].toLowerCase()),ne+W[0].length):-1}function q(z,ee,ne){return _(z,t,ee,ne)}function Z(z,ee,ne){return _(z,r,ee,ne)}function E(z,ee,ne){return _(z,n,ee,ne)}function D(z){return o[z.getDay()]}function O(z){return s[z.getDay()]}function k(z){return c[z.getMonth()]}function L(z){return l[z.getMonth()]}function U(z){return i[+(z.getHours()>=12)]}function H(z){return 1+~~(z.getMonth()/3)}function te(z){return o[z.getUTCDay()]}function re(z){return s[z.getUTCDay()]}function we(z){return c[z.getUTCMonth()]}function A(z){return l[z.getUTCMonth()]}function J(z){return i[+(z.getUTCHours()>=12)]}function Ot(z){return 1+~~(z.getUTCMonth()/3)}return{format:function(z){var ee=N(z+="",y);return ee.toString=function(){return z},ee},parse:function(z){var ee=P(z+="",!1);return ee.toString=function(){return z},ee},utcFormat:function(z){var ee=N(z+="",w);return ee.toString=function(){return z},ee},utcParse:function(z){var ee=P(z+="",!0);return ee.toString=function(){return z},ee}}}var ly={"-":"",_:" ",0:"0"},Ye=/^\s*\d+/,X5=/^%/,J5=/[\\^$*+?|[\]().{}]/g;function se(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",s=i.length;return n+(s<r?new Array(r-s+1).join(t)+i:i)}function Q5(e){return e.replace(J5,"\\$&")}function Va(e){return new RegExp("^(?:"+e.map(Q5).join("|")+")","i")}function Ya(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function eT(e,t,r){var n=Ye.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function tT(e,t,r){var n=Ye.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function rT(e,t,r){var n=Ye.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function nT(e,t,r){var n=Ye.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function iT(e,t,r){var n=Ye.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function cy(e,t,r){var n=Ye.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function uy(e,t,r){var n=Ye.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function aT(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function sT(e,t,r){var n=Ye.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function oT(e,t,r){var n=Ye.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function dy(e,t,r){var n=Ye.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function lT(e,t,r){var n=Ye.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function fy(e,t,r){var n=Ye.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function cT(e,t,r){var n=Ye.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function uT(e,t,r){var n=Ye.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function dT(e,t,r){var n=Ye.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function fT(e,t,r){var n=Ye.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function pT(e,t,r){var n=X5.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function hT(e,t,r){var n=Ye.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function mT(e,t,r){var n=Ye.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function py(e,t){return se(e.getDate(),t,2)}function gT(e,t){return se(e.getHours(),t,2)}function xT(e,t){return se(e.getHours()%12||12,t,2)}function yT(e,t){return se(1+ao.count(rn(e),e),t,3)}function NS(e,t){return se(e.getMilliseconds(),t,3)}function vT(e,t){return NS(e,t)+"000"}function bT(e,t){return se(e.getMonth()+1,t,2)}function jT(e,t){return se(e.getMinutes(),t,2)}function wT(e,t){return se(e.getSeconds(),t,2)}function ST(e){var t=e.getDay();return t===0?7:t}function NT(e,t){return se(gu.count(rn(e)-1,e),t,2)}function kS(e){var t=e.getDay();return t>=4||t===0?ga(e):ga.ceil(e)}function kT(e,t){return e=kS(e),se(ga.count(rn(e),e)+(rn(e).getDay()===4),t,2)}function PT(e){return e.getDay()}function _T(e,t){return se(lc.count(rn(e)-1,e),t,2)}function CT(e,t){return se(e.getFullYear()%100,t,2)}function AT(e,t){return e=kS(e),se(e.getFullYear()%100,t,2)}function OT(e,t){return se(e.getFullYear()%1e4,t,4)}function ET(e,t){var r=e.getDay();return e=r>=4||r===0?ga(e):ga.ceil(e),se(e.getFullYear()%1e4,t,4)}function DT(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+se(t/60|0,"0",2)+se(t%60,"0",2)}function hy(e,t){return se(e.getUTCDate(),t,2)}function TT(e,t){return se(e.getUTCHours(),t,2)}function MT(e,t){return se(e.getUTCHours()%12||12,t,2)}function IT(e,t){return se(1+mu.count(nn(e),e),t,3)}function PS(e,t){return se(e.getUTCMilliseconds(),t,3)}function $T(e,t){return PS(e,t)+"000"}function LT(e,t){return se(e.getUTCMonth()+1,t,2)}function zT(e,t){return se(e.getUTCMinutes(),t,2)}function RT(e,t){return se(e.getUTCSeconds(),t,2)}function BT(e){var t=e.getUTCDay();return t===0?7:t}function FT(e,t){return se(xu.count(nn(e)-1,e),t,2)}function _S(e){var t=e.getUTCDay();return t>=4||t===0?xa(e):xa.ceil(e)}function WT(e,t){return e=_S(e),se(xa.count(nn(e),e)+(nn(e).getUTCDay()===4),t,2)}function UT(e){return e.getUTCDay()}function qT(e,t){return se(cc.count(nn(e)-1,e),t,2)}function HT(e,t){return se(e.getUTCFullYear()%100,t,2)}function KT(e,t){return e=_S(e),se(e.getUTCFullYear()%100,t,2)}function VT(e,t){return se(e.getUTCFullYear()%1e4,t,4)}function YT(e,t){var r=e.getUTCDay();return e=r>=4||r===0?xa(e):xa.ceil(e),se(e.getUTCFullYear()%1e4,t,4)}function GT(){return"+0000"}function my(){return"%"}function gy(e){return+e}function xy(e){return Math.floor(+e/1e3)}var Di,CS,AS;ZT({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 ZT(e){return Di=Z5(e),CS=Di.format,Di.parse,AS=Di.utcFormat,Di.utcParse,Di}function XT(e){return new Date(e)}function JT(e){return e instanceof Date?+e:+new Date(+e)}function bm(e,t,r,n,i,s,o,l,c,d){var u=sm(),f=u.invert,p=u.domain,m=d(".%L"),x=d(":%S"),g=d("%I:%M"),b=d("%I %p"),v=d("%a %d"),j=d("%b %d"),y=d("%B"),w=d("%Y");function S(N){return(c(N)<N?m:l(N)<N?x:o(N)<N?g:s(N)<N?b:n(N)<N?i(N)<N?v:j:r(N)<N?y:w)(N)}return u.invert=function(N){return new Date(f(N))},u.domain=function(N){return arguments.length?p(Array.from(N,JT)):p().map(XT)},u.ticks=function(N){var P=p();return e(P[0],P[P.length-1],N??10)},u.tickFormat=function(N,P){return P==null?S:d(P)},u.nice=function(N){var P=p();return(!N||typeof N.range!="function")&&(N=t(P[0],P[P.length-1],N??10)),N?p(mS(P,N)):u},u.copy=function(){return io(u,bm(e,t,r,n,i,s,o,l,c,d))},u}function QT(){return or.apply(bm(Y5,G5,rn,ym,gu,ao,gm,hm,ii,CS).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function eM(){return or.apply(bm(K5,V5,nn,vm,xu,mu,xm,mm,ii,AS).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function yu(){var e=0,t=1,r,n,i,s,o=mt,l=!1,c;function d(f){return f==null||isNaN(f=+f)?c:o(i===0?.5:(f=(s(f)-r)*i,l?Math.max(0,Math.min(1,f)):f))}d.domain=function(f){return arguments.length?([e,t]=f,r=s(e=+e),n=s(t=+t),i=r===n?0:1/(n-r),d):[e,t]},d.clamp=function(f){return arguments.length?(l=!!f,d):l},d.interpolator=function(f){return arguments.length?(o=f,d):o};function u(f){return function(p){var m,x;return arguments.length?([m,x]=p,o=f(m,x),d):[o(0),o(1)]}}return d.range=u(Pa),d.rangeRound=u(am),d.unknown=function(f){return arguments.length?(c=f,d):c},function(f){return s=f,r=f(e),n=f(t),i=r===n?0:1/(n-r),d}}function Hn(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function OS(){var e=qn(yu()(mt));return e.copy=function(){return Hn(e,OS())},un.apply(e,arguments)}function ES(){var e=cm(yu()).domain([1,10]);return e.copy=function(){return Hn(e,ES()).base(e.base())},un.apply(e,arguments)}function DS(){var e=um(yu());return e.copy=function(){return Hn(e,DS()).constant(e.constant())},un.apply(e,arguments)}function jm(){var e=dm(yu());return e.copy=function(){return Hn(e,jm()).exponent(e.exponent())},un.apply(e,arguments)}function tM(){return jm.apply(null,arguments).exponent(.5)}function TS(){var e=[],t=mt;function r(n){if(n!=null&&!isNaN(n=+n))return t((ro(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let i of n)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Mn),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,i)=>t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,s)=>BD(e,s/n))},r.copy=function(){return TS(t).domain(e)},un.apply(r,arguments)}function vu(){var e=0,t=.5,r=1,n=1,i,s,o,l,c,d=mt,u,f=!1,p;function m(g){return isNaN(g=+g)?p:(g=.5+((g=+u(g))-s)*(n*g<n*s?l:c),d(f?Math.max(0,Math.min(1,g)):g))}m.domain=function(g){return arguments.length?([e,t,r]=g,i=u(e=+e),s=u(t=+t),o=u(r=+r),l=i===s?0:.5/(s-i),c=s===o?0:.5/(o-s),n=s<i?-1:1,m):[e,t,r]},m.clamp=function(g){return arguments.length?(f=!!g,m):f},m.interpolator=function(g){return arguments.length?(d=g,m):d};function x(g){return function(b){var v,j,y;return arguments.length?([v,j,y]=b,d=p5(g,[v,j,y]),m):[d(0),d(.5),d(1)]}}return m.range=x(Pa),m.rangeRound=x(am),m.unknown=function(g){return arguments.length?(p=g,m):p},function(g){return u=g,i=g(e),s=g(t),o=g(r),l=i===s?0:.5/(s-i),c=s===o?0:.5/(o-s),n=s<i?-1:1,m}}function MS(){var e=qn(vu()(mt));return e.copy=function(){return Hn(e,MS())},un.apply(e,arguments)}function IS(){var e=cm(vu()).domain([.1,1,10]);return e.copy=function(){return Hn(e,IS()).base(e.base())},un.apply(e,arguments)}function $S(){var e=um(vu());return e.copy=function(){return Hn(e,$S()).constant(e.constant())},un.apply(e,arguments)}function wm(){var e=dm(vu());return e.copy=function(){return Hn(e,wm()).exponent(e.exponent())},un.apply(e,arguments)}function rM(){return wm.apply(null,arguments).exponent(.5)}const es=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:rm,scaleDiverging:MS,scaleDivergingLog:IS,scaleDivergingPow:wm,scaleDivergingSqrt:rM,scaleDivergingSymlog:$S,scaleIdentity:hS,scaleImplicit:rp,scaleLinear:pS,scaleLog:gS,scaleOrdinal:tm,scalePoint:UD,scalePow:fm,scaleQuantile:vS,scaleQuantize:bS,scaleRadial:yS,scaleSequential:OS,scaleSequentialLog:ES,scaleSequentialPow:jm,scaleSequentialQuantile:TS,scaleSequentialSqrt:tM,scaleSequentialSymlog:DS,scaleSqrt:$5,scaleSymlog:xS,scaleThreshold:jS,scaleTime:QT,scaleUtc:eM,tickFormat:fS},Symbol.toStringTag,{value:"Module"}));var Kn=e=>e.chartData,nM=I([Kn],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),bu=(e,t,r,n)=>n?nM(e):Kn(e);function ji(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(_e(t)&&_e(r))return!0}return!1}function yy(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function LS(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,i,s;if(_e(r))i=r;else if(typeof r=="function")return;if(_e(n))s=n;else if(typeof n=="function")return;var o=[i,s];if(ji(o))return o}}function iM(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(ji(n))return yy(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[i,s]=e,o,l;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Y(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&o0.test(i)){var c=o0.exec(i);if(c==null||t==null)o=void 0;else{var d=+c[1];o=t[0]-d}}else o=t==null?void 0:t[0];if(s==="auto")t!=null&&(l=Math.max(...t));else if(Y(s))l=s;else if(typeof s=="function")try{t!=null&&(l=s(t==null?void 0:t[1]))}catch{}else if(typeof s=="string"&&l0.test(s)){var u=l0.exec(s);if(u==null||t==null)l=void 0;else{var f=+u[1];l=t[1]+f}}else l=t==null?void 0:t[1];var p=[o,l];if(ji(p))return t==null?p:yy(p,t,r)}}}var _a=1e9,aM={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Nm,je=!0,sr="[DecimalError] ",di=sr+"Invalid argument: ",Sm=sr+"Exponent out of range: ",Ca=Math.floor,Qn=Math.pow,sM=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Lt,qe=1e7,xe=7,zS=9007199254740991,uc=Ca(zS/xe),V={};V.absoluteValue=V.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};V.comparedTo=V.cmp=function(e){var t,r,n,i,s=this;if(e=new s.constructor(e),s.s!==e.s)return s.s||-e.s;if(s.e!==e.e)return s.e>e.e^s.s<0?1:-1;for(n=s.d.length,i=e.d.length,t=0,r=n<i?n:i;t<r;++t)if(s.d[t]!==e.d[t])return s.d[t]>e.d[t]^s.s<0?1:-1;return n===i?0:n>i^s.s<0?1:-1};V.decimalPlaces=V.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*xe;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};V.dividedBy=V.div=function(e){return Vr(this,new this.constructor(e))};V.dividedToIntegerBy=V.idiv=function(e){var t=this,r=t.constructor;return fe(Vr(t,new r(e),0,1),r.precision)};V.equals=V.eq=function(e){return!this.cmp(e)};V.exponent=function(){return Me(this)};V.greaterThan=V.gt=function(e){return this.cmp(e)>0};V.greaterThanOrEqualTo=V.gte=function(e){return this.cmp(e)>=0};V.isInteger=V.isint=function(){return this.e>this.d.length-2};V.isNegative=V.isneg=function(){return this.s<0};V.isPositive=V.ispos=function(){return this.s>0};V.isZero=function(){return this.s===0};V.lessThan=V.lt=function(e){return this.cmp(e)<0};V.lessThanOrEqualTo=V.lte=function(e){return this.cmp(e)<1};V.logarithm=V.log=function(e){var t,r=this,n=r.constructor,i=n.precision,s=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Lt))throw Error(sr+"NaN");if(r.s<1)throw Error(sr+(r.s?"NaN":"-Infinity"));return r.eq(Lt)?new n(0):(je=!1,t=Vr(Ws(r,s),Ws(e,s),s),je=!0,fe(t,i))};V.minus=V.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?FS(t,e):RS(t,(e.s=-e.s,e))};V.modulo=V.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(sr+"NaN");return r.s?(je=!1,t=Vr(r,e,0,1).times(e),je=!0,r.minus(t)):fe(new n(r),i)};V.naturalExponential=V.exp=function(){return BS(this)};V.naturalLogarithm=V.ln=function(){return Ws(this)};V.negated=V.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};V.plus=V.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?RS(t,e):FS(t,(e.s=-e.s,e))};V.precision=V.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(di+e);if(t=Me(i)+1,n=i.d.length-1,r=n*xe+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};V.squareRoot=V.sqrt=function(){var e,t,r,n,i,s,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(sr+"NaN")}for(e=Me(l),je=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=Nr(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Ca((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),n=new c(t)):n=new c(i.toString()),r=c.precision,i=o=r+3;;)if(s=n,n=s.plus(Vr(l,s,o+2)).times(.5),Nr(s.d).slice(0,o)===(t=Nr(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(fe(s,r+1,0),s.times(s).eq(l)){n=s;break}}else if(t!="9999")break;o+=4}return je=!0,fe(n,r)};V.times=V.mul=function(e){var t,r,n,i,s,o,l,c,d,u=this,f=u.constructor,p=u.d,m=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,r=u.e+e.e,c=p.length,d=m.length,c<d&&(s=p,p=m,m=s,o=c,c=d,d=o),s=[],o=c+d,n=o;n--;)s.push(0);for(n=d;--n>=0;){for(t=0,i=c+n;i>n;)l=s[i]+m[n]*p[i-n-1]+t,s[i--]=l%qe|0,t=l/qe|0;s[i]=(s[i]+t)%qe|0}for(;!s[--o];)s.pop();return t?++r:s.shift(),e.d=s,e.e=r,je?fe(e,f.precision):e};V.toDecimalPlaces=V.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Dr(e,0,_a),t===void 0?t=n.rounding:Dr(t,0,8),fe(r,e+Me(r)+1,t))};V.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=wi(n,!0):(Dr(e,0,_a),t===void 0?t=i.rounding:Dr(t,0,8),n=fe(new i(n),e+1,t),r=wi(n,!0,e+1)),r};V.toFixed=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?wi(i):(Dr(e,0,_a),t===void 0?t=s.rounding:Dr(t,0,8),n=fe(new s(i),e+Me(i)+1,t),r=wi(n.abs(),!1,e+Me(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};V.toInteger=V.toint=function(){var e=this,t=e.constructor;return fe(new t(e),Me(e)+1,t.rounding)};V.toNumber=function(){return+this};V.toPower=V.pow=function(e){var t,r,n,i,s,o,l=this,c=l.constructor,d=12,u=+(e=new c(e));if(!e.s)return new c(Lt);if(l=new c(l),!l.s){if(e.s<1)throw Error(sr+"Infinity");return l}if(l.eq(Lt))return l;if(n=c.precision,e.eq(Lt))return fe(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,s=l.s,o){if((r=u<0?-u:u)<=zS){for(i=new c(Lt),t=Math.ceil(n/xe+4),je=!1;r%2&&(i=i.times(l),by(i.d,t)),r=Ca(r/2),r!==0;)l=l.times(l),by(l.d,t);return je=!0,e.s<0?new c(Lt).div(i):fe(i,n)}}else if(s<0)throw Error(sr+"NaN");return s=s<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,je=!1,i=e.times(Ws(l,n+d)),je=!0,i=BS(i),i.s=s,i};V.toPrecision=function(e,t){var r,n,i=this,s=i.constructor;return e===void 0?(r=Me(i),n=wi(i,r<=s.toExpNeg||r>=s.toExpPos)):(Dr(e,1,_a),t===void 0?t=s.rounding:Dr(t,0,8),i=fe(new s(i),e,t),r=Me(i),n=wi(i,e<=r||r<=s.toExpNeg,e)),n};V.toSignificantDigits=V.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Dr(e,1,_a),t===void 0?t=n.rounding:Dr(t,0,8)),fe(new n(r),e,t)};V.toString=V.valueOf=V.val=V.toJSON=V[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Me(e),r=e.constructor;return wi(e,t<=r.toExpNeg||t>=r.toExpPos)};function RS(e,t){var r,n,i,s,o,l,c,d,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),je?fe(t,f):t;if(c=e.d,d=t.d,o=e.e,i=t.e,c=c.slice(),s=o-i,s){for(s<0?(n=c,s=-s,l=d.length):(n=d,i=o,l=c.length),o=Math.ceil(f/xe),l=o>l?o+1:l+1,s>l&&(s=l,n.length=1),n.reverse();s--;)n.push(0);n.reverse()}for(l=c.length,s=d.length,l-s<0&&(s=l,n=d,d=c,c=n),r=0;s;)r=(c[--s]=c[s]+d[s]+r)/qe|0,c[s]%=qe;for(r&&(c.unshift(r),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,je?fe(t,f):t}function Dr(e,t,r){if(e!==~~e||e<t||e>r)throw Error(di+e)}function Nr(e){var t,r,n,i=e.length-1,s="",o=e[0];if(i>0){for(s+=o,t=1;t<i;t++)n=e[t]+"",r=xe-n.length,r&&(s+=xn(r)),s+=n;o=e[t],n=o+"",r=xe-n.length,r&&(s+=xn(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}var Vr=function(){function e(n,i){var s,o=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+o,n[l]=s%qe|0,o=s/qe|0;return o&&n.unshift(o),n}function t(n,i,s,o){var l,c;if(s!=o)c=s>o?1:-1;else for(l=c=0;l<s;l++)if(n[l]!=i[l]){c=n[l]>i[l]?1:-1;break}return c}function r(n,i,s){for(var o=0;s--;)n[s]-=o,o=n[s]<i[s]?1:0,n[s]=o*qe+n[s]-i[s];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,s,o){var l,c,d,u,f,p,m,x,g,b,v,j,y,w,S,N,P,_,T=n.constructor,$=n.s==i.s?1:-1,M=n.d,C=i.d;if(!n.s)return new T(n);if(!i.s)throw Error(sr+"Division by zero");for(c=n.e-i.e,P=C.length,S=M.length,m=new T($),x=m.d=[],d=0;C[d]==(M[d]||0);)++d;if(C[d]>(M[d]||0)&&--c,s==null?j=s=T.precision:o?j=s+(Me(n)-Me(i))+1:j=s,j<0)return new T(0);if(j=j/xe+2|0,d=0,P==1)for(u=0,C=C[0],j++;(d<S||u)&&j--;d++)y=u*qe+(M[d]||0),x[d]=y/C|0,u=y%C|0;else{for(u=qe/(C[0]+1)|0,u>1&&(C=e(C,u),M=e(M,u),P=C.length,S=M.length),w=P,g=M.slice(0,P),b=g.length;b<P;)g[b++]=0;_=C.slice(),_.unshift(0),N=C[0],C[1]>=qe/2&&++N;do u=0,l=t(C,g,P,b),l<0?(v=g[0],P!=b&&(v=v*qe+(g[1]||0)),u=v/N|0,u>1?(u>=qe&&(u=qe-1),f=e(C,u),p=f.length,b=g.length,l=t(f,g,p,b),l==1&&(u--,r(f,P<p?_:C,p))):(u==0&&(l=u=1),f=C.slice()),p=f.length,p<b&&f.unshift(0),r(g,f,b),l==-1&&(b=g.length,l=t(C,g,P,b),l<1&&(u++,r(g,P<b?_:C,b))),b=g.length):l===0&&(u++,g=[0]),x[d++]=u,l&&g[0]?g[b++]=M[w]||0:(g=[M[w]],b=1);while((w++<S||g[0]!==void 0)&&j--)}return x[0]||x.shift(),m.e=c,fe(m,o?s+Me(m)+1:s)}}();function BS(e,t){var r,n,i,s,o,l,c=0,d=0,u=e.constructor,f=u.precision;if(Me(e)>16)throw Error(Sm+Me(e));if(!e.s)return new u(Lt);for(je=!1,l=f,o=new u(.03125);e.abs().gte(.1);)e=e.times(o),d+=5;for(n=Math.log(Qn(2,d))/Math.LN10*2+5|0,l+=n,r=i=s=new u(Lt),u.precision=l;;){if(i=fe(i.times(e),l),r=r.times(++c),o=s.plus(Vr(i,r,l)),Nr(o.d).slice(0,l)===Nr(s.d).slice(0,l)){for(;d--;)s=fe(s.times(s),l);return u.precision=f,t==null?(je=!0,fe(s,f)):s}s=o}}function Me(e){for(var t=e.e*xe,r=e.d[0];r>=10;r/=10)t++;return t}function Sd(e,t,r){if(t>e.LN10.sd())throw je=!0,r&&(e.precision=r),Error(sr+"LN10 precision limit exceeded");return fe(new e(e.LN10),t)}function xn(e){for(var t="";e--;)t+="0";return t}function Ws(e,t){var r,n,i,s,o,l,c,d,u,f=1,p=10,m=e,x=m.d,g=m.constructor,b=g.precision;if(m.s<1)throw Error(sr+(m.s?"NaN":"-Infinity"));if(m.eq(Lt))return new g(0);if(t==null?(je=!1,d=b):d=t,m.eq(10))return t==null&&(je=!0),Sd(g,d);if(d+=p,g.precision=d,r=Nr(x),n=r.charAt(0),s=Me(m),Math.abs(s)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)m=m.times(e),r=Nr(m.d),n=r.charAt(0),f++;s=Me(m),n>1?(m=new g("0."+r),s++):m=new g(n+"."+r.slice(1))}else return c=Sd(g,d+2,b).times(s+""),m=Ws(new g(n+"."+r.slice(1)),d-p).plus(c),g.precision=b,t==null?(je=!0,fe(m,b)):m;for(l=o=m=Vr(m.minus(Lt),m.plus(Lt),d),u=fe(m.times(m),d),i=3;;){if(o=fe(o.times(u),d),c=l.plus(Vr(o,new g(i),d)),Nr(c.d).slice(0,d)===Nr(l.d).slice(0,d))return l=l.times(2),s!==0&&(l=l.plus(Sd(g,d+2,b).times(s+""))),l=Vr(l,new g(f),d),g.precision=b,t==null?(je=!0,fe(l,b)):l;l=c,i+=2}}function vy(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Ca(r/xe),e.d=[],n=(r+1)%xe,r<0&&(n+=xe),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=xe;n<i;)e.d.push(+t.slice(n,n+=xe));t=t.slice(n),n=xe-t.length}else n-=i;for(;n--;)t+="0";if(e.d.push(+t),je&&(e.e>uc||e.e<-uc))throw Error(Sm+r)}else e.s=0,e.e=0,e.d=[0];return e}function fe(e,t,r){var n,i,s,o,l,c,d,u,f=e.d;for(o=1,s=f[0];s>=10;s/=10)o++;if(n=t-o,n<0)n+=xe,i=t,d=f[u=0];else{if(u=Math.ceil((n+1)/xe),s=f.length,u>=s)return e;for(d=s=f[u],o=1;s>=10;s/=10)o++;n%=xe,i=n-xe+o}if(r!==void 0&&(s=Qn(10,o-i-1),l=d/s%10|0,c=t<0||f[u+1]!==void 0||d%s,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?i>0?d/Qn(10,o-i):0:f[u-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(s=Me(e),f.length=1,t=t-s-1,f[0]=Qn(10,(xe-t%xe)%xe),e.e=Ca(-t/xe)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=u,s=1,u--):(f.length=u+1,s=Qn(10,xe-n),f[u]=i>0?(d/Qn(10,o-i)%Qn(10,i)|0)*s:0),c)for(;;)if(u==0){(f[0]+=s)==qe&&(f[0]=1,++e.e);break}else{if(f[u]+=s,f[u]!=qe)break;f[u--]=0,s=1}for(n=f.length;f[--n]===0;)f.pop();if(je&&(e.e>uc||e.e<-uc))throw Error(Sm+Me(e));return e}function FS(e,t){var r,n,i,s,o,l,c,d,u,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new p(e),je?fe(t,m):t;if(c=e.d,f=t.d,n=t.e,d=e.e,c=c.slice(),o=d-n,o){for(u=o<0,u?(r=c,o=-o,l=f.length):(r=f,n=d,l=c.length),i=Math.max(Math.ceil(m/xe),l)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=c.length,l=f.length,u=i<l,u&&(l=i),i=0;i<l;i++)if(c[i]!=f[i]){u=c[i]<f[i];break}o=0}for(u&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,i=f.length-l;i>0;--i)c[l++]=0;for(i=f.length;i>o;){if(c[--i]<f[i]){for(s=i;s&&c[--s]===0;)c[s]=qe-1;--c[s],c[i]+=qe}c[i]-=f[i]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,je?fe(t,m):t):new p(0)}function wi(e,t,r){var n,i=Me(e),s=Nr(e.d),o=s.length;return t?(r&&(n=r-o)>0?s=s.charAt(0)+"."+s.slice(1)+xn(n):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(i<0?"e":"e+")+i):i<0?(s="0."+xn(-i-1)+s,r&&(n=r-o)>0&&(s+=xn(n))):i>=o?(s+=xn(i+1-o),r&&(n=r-i-1)>0&&(s=s+"."+xn(n))):((n=i+1)<o&&(s=s.slice(0,n)+"."+s.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(s+="."),s+=xn(n))),e.s<0?"-"+s:s}function by(e,t){if(e.length>t)return e.length=t,!0}function WS(e){var t,r,n;function i(s){var o=this;if(!(o instanceof i))return new i(s);if(o.constructor=i,s instanceof i){o.s=s.s,o.e=s.e,o.d=(s=s.d)?s.slice():s;return}if(typeof s=="number"){if(s*0!==0)throw Error(di+s);if(s>0)o.s=1;else if(s<0)s=-s,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(s===~~s&&s<1e7){o.e=0,o.d=[s];return}return vy(o,s.toString())}else if(typeof s!="string")throw Error(di+s);if(s.charCodeAt(0)===45?(s=s.slice(1),o.s=-1):o.s=1,sM.test(s))vy(o,s);else throw Error(di+s)}if(i.prototype=V,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=WS,i.config=i.set=oM,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function oM(e){if(!e||typeof e!="object")throw Error(sr+"Object expected");var t,r,n,i=["precision",1,_a,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((n=e[r=i[t]])!==void 0)if(Ca(n)===n&&n>=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(di+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(di+r+": "+n);return this}var Nm=WS(aM);Lt=new Nm(1);const oe=Nm;var lM=e=>e,US={},qS=e=>e===US,jy=e=>function t(){return arguments.length===0||arguments.length===1&&qS(arguments.length<=0?void 0:arguments[0])?t:e(...arguments)},HS=(e,t)=>e===1?t:jy(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var s=n.filter(o=>o!==US).length;return s>=e?t(...n):HS(e-s,jy(function(){for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];var d=n.map(u=>qS(u)?l.shift():u);return t(...d,...l)}))}),ju=e=>HS(e.length,e),sp=(e,t)=>{for(var r=[],n=e;n<t;++n)r[n-e]=n;return r},cM=ju((e,t)=>Array.isArray(t)?t.map(e):Object.keys(t).map(r=>t[r]).map(e)),uM=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return lM;var i=r.reverse(),s=i[0],o=i.slice(1);return function(){return o.reduce((l,c)=>c(l),s(...arguments))}},op=e=>Array.isArray(e)?e.reverse():e.split("").reverse().join(""),KS=e=>{var t=null,r=null;return function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return t&&i.every((o,l)=>{var c;return o===((c=t)===null||c===void 0?void 0:c[l])})||(t=i,r=e(...i)),r}};function VS(e){var t;return e===0?t=1:t=Math.floor(new oe(e).abs().log(10).toNumber())+1,t}function YS(e,t,r){for(var n=new oe(e),i=0,s=[];n.lt(t)&&i<1e5;)s.push(n.toNumber()),n=n.add(r),i++;return s}ju((e,t,r)=>{var n=+e,i=+t;return n+r*(i-n)});ju((e,t,r)=>{var n=t-+e;return n=n||1/0,(r-e)/n});ju((e,t,r)=>{var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});var GS=e=>{var[t,r]=e,[n,i]=[t,r];return t>r&&([n,i]=[r,t]),[n,i]},ZS=(e,t,r)=>{if(e.lte(0))return new oe(0);var n=VS(e.toNumber()),i=new oe(10).pow(n),s=e.div(i),o=n!==1?.05:.1,l=new oe(Math.ceil(s.div(o).toNumber())).add(r).mul(o),c=l.mul(i);return t?new oe(c.toNumber()):new oe(Math.ceil(c.toNumber()))},dM=(e,t,r)=>{var n=new oe(1),i=new oe(e);if(!i.isint()&&r){var s=Math.abs(e);s<1?(n=new oe(10).pow(VS(e)-1),i=new oe(Math.floor(i.div(n).toNumber())).mul(n)):s>1&&(i=new oe(Math.floor(e)))}else e===0?i=new oe(Math.floor((t-1)/2)):r||(i=new oe(Math.floor(e)));var o=Math.floor((t-1)/2),l=uM(cM(c=>i.add(new oe(c-o).mul(n)).toNumber()),sp);return l(0,t)},XS=function(t,r,n,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(n-1)))return{step:new oe(0),tickMin:new oe(0),tickMax:new oe(0)};var o=ZS(new oe(r).sub(t).div(n-1),i,s),l;t<=0&&r>=0?l=new oe(0):(l=new oe(t).add(r).div(2),l=l.sub(new oe(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),d=Math.ceil(new oe(r).sub(l).div(o).toNumber()),u=c+d+1;return u>n?XS(t,r,n,i,s+1):(u<n&&(d=r>0?d+(n-u):d,c=r>0?c:c+(n-u)),{step:o,tickMin:l.sub(new oe(c).mul(o)),tickMax:l.add(new oe(d).mul(o))})};function fM(e){var[t,r]=e,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(n,2),[o,l]=GS([t,r]);if(o===-1/0||l===1/0){var c=l===1/0?[o,...sp(0,n-1).map(()=>1/0)]:[...sp(0,n-1).map(()=>-1/0),l];return t>r?op(c):c}if(o===l)return dM(o,n,i);var{step:d,tickMin:u,tickMax:f}=XS(o,l,s,i,0),p=YS(u,f.add(new oe(.1).mul(d)),d);return t>r?op(p):p}function pM(e,t){var[r,n]=e,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[s,o]=GS([r,n]);if(s===-1/0||o===1/0)return[r,n];if(s===o)return[s];var l=Math.max(t,2),c=ZS(new oe(o).sub(s).div(l-1),i,0),d=[...YS(new oe(s),new oe(o),c),o];return i===!1&&(d=d.map(u=>Math.round(u))),r>n?op(d):d}var hM=KS(fM),mM=KS(pM),gM=e=>e.rootProps.barCategoryGap,wu=e=>e.rootProps.stackOffset,km=e=>e.options.chartName,Pm=e=>e.rootProps.syncId,JS=e=>e.rootProps.syncMethod,_m=e=>e.options.eventEmitter,xM=e=>e.rootProps.baseValue,lt={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},zr={allowDuplicatedCategory:!0,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"category"},$t={allowDataOverflow:!1,allowDuplicatedCategory:!0,radiusAxisId:0,scale:"auto",tick:!0,tickCount:5,type:"number"},Su=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t},yM={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:zr.angleAxisId,includeHidden:!1,name:void 0,reversed:zr.reversed,scale:zr.scale,tick:zr.tick,tickCount:void 0,ticks:void 0,type:zr.type,unit:void 0},vM={allowDataOverflow:$t.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:$t.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:$t.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:$t.scale,tick:$t.tick,tickCount:$t.tickCount,ticks:void 0,type:$t.type,unit:void 0},bM={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:zr.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:zr.angleAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:zr.scale,tick:zr.tick,tickCount:void 0,ticks:void 0,type:"number",unit:void 0},jM={allowDataOverflow:$t.allowDataOverflow,allowDecimals:!1,allowDuplicatedCategory:$t.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:$t.radiusAxisId,includeHidden:!1,name:void 0,reversed:!1,scale:$t.scale,tick:$t.tick,tickCount:$t.tickCount,ticks:void 0,type:"category",unit:void 0},Cm=(e,t)=>e.polarAxis.angleAxis[t]!=null?e.polarAxis.angleAxis[t]:e.layout.layoutType==="radial"?bM:yM,Am=(e,t)=>e.polarAxis.radiusAxis[t]!=null?e.polarAxis.radiusAxis[t]:e.layout.layoutType==="radial"?jM:vM,Nu=e=>e.polarOptions,Om=I([ln,cn,rt],yD),QS=I([Nu,Om],(e,t)=>{if(e!=null)return Rn(e.innerRadius,t,0)}),e2=I([Nu,Om],(e,t)=>{if(e!=null)return Rn(e.outerRadius,t,t*.8)}),wM=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},t2=I([Nu],wM);I([Cm,t2],Su);var r2=I([Om,QS,e2],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});I([Am,r2],Su);var n2=I([ue,Nu,QS,e2,ln,cn],(e,t,r,n,i,s)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:o,cy:l,startAngle:c,endAngle:d}=t;return{cx:Rn(o,i,i/2),cy:Rn(l,s,s/2),innerRadius:r,outerRadius:n,startAngle:c,endAngle:d,clockWise:!1}}}),Fe=(e,t)=>t,ku=(e,t,r)=>r;function Em(e){return e==null?void 0:e.id}function i2(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:i,dataKey:s}=r,o=new Map;return e.forEach(l=>{var c,d=(c=l.data)!==null&&c!==void 0?c:n;if(!(d==null||d.length===0)){var u=Em(l);d.forEach((f,p)=>{var m=s==null||i?p:String(et(f,s,null)),x=et(f,l.dataKey,0),g;o.has(m)?g=o.get(m):g={},Object.assign(g,{[u]:x}),o.set(m,g)})}}),Array.from(o.values())}function Dm(e){return e.stackId!=null&&e.dataKey!=null}var Pu=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function _u(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function SM(e,t){if(e.length===t.length){for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return!1}var We=e=>{var t=ue(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Aa=e=>e.tooltip.settings.axisId;function wy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wy(Object(r),!0).forEach(function(n){NM(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NM(e,t,r){return(t=kM(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kM(e){var t=PM(e,"string");return typeof t=="symbol"?t:t+""}function PM(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lp=[0,"auto"],Tt={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},a2=(e,t)=>e.cartesianAxis.xAxis[t],dn=(e,t)=>{var r=a2(e,t);return r??Tt},Mt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:lp,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,width:eo},s2=(e,t)=>e.cartesianAxis.yAxis[t],fn=(e,t)=>{var r=s2(e,t);return r??Mt},_M={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:""},Tm=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??_M},vt=(e,t,r)=>{switch(t){case"xAxis":return dn(e,r);case"yAxis":return fn(e,r);case"zAxis":return Tm(e,r);case"angleAxis":return Cm(e,r);case"radiusAxis":return Am(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},CM=(e,t,r)=>{switch(t){case"xAxis":return dn(e,r);case"yAxis":return fn(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},so=(e,t,r)=>{switch(t){case"xAxis":return dn(e,r);case"yAxis":return fn(e,r);case"angleAxis":return Cm(e,r);case"radiusAxis":return Am(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},o2=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function l2(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var Mm=e=>e.graphicalItems.cartesianItems,AM=I([Fe,ku],l2),c2=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),oo=I([Mm,vt,AM],c2,{memoizeOptions:{resultEqualityCheck:_u}}),u2=I([oo],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Dm)),d2=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),OM=I([oo],d2),f2=e=>e.map(t=>t.data).filter(Boolean).flat(1),EM=I([oo],f2,{memoizeOptions:{resultEqualityCheck:_u}}),p2=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:i}=t;return e.length>0?e:r.slice(n,i+1)},Im=I([EM,bu],p2),h2=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:et(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:et(i,n)}))):e.map(n=>({value:n})),Cu=I([Im,vt,oo],h2);function m2(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function ll(e){if(Or(e)||e instanceof Date){var t=Number(e);if(_e(t))return t}}function Sy(e){if(Array.isArray(e)){var t=[ll(e[0]),ll(e[1])];return ji(t)?t:void 0}var r=ll(e);if(r!=null)return[r,r]}function an(e){return e.map(ll).filter(F6)}function DM(e,t,r){return!r||typeof t!="number"||yr(t)?[]:r.length?an(r.flatMap(n=>{var i=et(e,n.dataKey),s,o;if(Array.isArray(i)?[s,o]=i:s=o=i,!(!_e(s)||!_e(o)))return[t-s,t+o]})):[]}var Ue=e=>{var t=We(e),r=Aa(e);return so(e,t,r)},g2=I([Ue],e=>e==null?void 0:e.dataKey),TM=I([u2,bu,Ue],i2),x2=(e,t,r)=>{var n={},i=t.reduce((s,o)=>(o.stackId==null||(s[o.stackId]==null&&(s[o.stackId]=[]),s[o.stackId].push(o)),s),n);return Object.fromEntries(Object.entries(i).map(s=>{var[o,l]=s,c=l.map(Em);return[o,{stackedData:_E(e,c,r),graphicalItems:l}]}))},cp=I([TM,u2,wu],x2),y2=(e,t,r,n)=>{var{dataStartIndex:i,dataEndIndex:s}=t;if(n==null&&r!=="zAxis"){var o=EE(e,i,s);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},MM=I([vt],e=>e.allowDataOverflow),$m=e=>{var t;if(e==null||!("domain"in e))return lp;if(e.domain!=null)return e.domain;if(e.ticks!=null){if(e.type==="number"){var r=an(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:lp},v2=I([vt],$m),b2=I([v2,MM],LS),IM=I([cp,Kn,Fe,b2],y2,{memoizeOptions:{resultEqualityCheck:Pu}}),Lm=e=>e.errorBars,$M=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>m2(r,n)),fc=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r.filter(Boolean);if(i.length!==0){var s=i.flat(),o=Math.min(...s),l=Math.max(...s);return[o,l]}},j2=(e,t,r,n,i)=>{var s,o;if(r.length>0&&e.forEach(l=>{r.forEach(c=>{var d,u,f=(d=n[c.id])===null||d===void 0?void 0:d.filter(v=>m2(i,v)),p=et(l,(u=t.dataKey)!==null&&u!==void 0?u:c.dataKey),m=DM(l,p,f);if(m.length>=2){var x=Math.min(...m),g=Math.max(...m);(s==null||x<s)&&(s=x),(o==null||g>o)&&(o=g)}var b=Sy(p);b!=null&&(s=s==null?b[0]:Math.min(s,b[0]),o=o==null?b[1]:Math.max(o,b[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var c=Sy(et(l,t.dataKey));c!=null&&(s=s==null?c[0]:Math.min(s,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),_e(s)&&_e(o))return[s,o]},LM=I([Im,vt,OM,Lm,Fe],j2,{memoizeOptions:{resultEqualityCheck:Pu}});function zM(e){var{value:t}=e;if(Or(t)||t instanceof Date)return t}var RM=(e,t,r)=>{var n=e.map(zM).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&_j(n))?rS(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},w2=e=>e.referenceElements.dots,Oa=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),BM=I([w2,Fe,ku],Oa),S2=e=>e.referenceElements.areas,FM=I([S2,Fe,ku],Oa),N2=e=>e.referenceElements.lines,WM=I([N2,Fe,ku],Oa),k2=(e,t)=>{var r=an(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]},UM=I(BM,Fe,k2),P2=(e,t)=>{var r=an(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]},qM=I([FM,Fe],P2);function HM(e){var t;if(e.x!=null)return an([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:an(r)}function KM(e){var t;if(e.y!=null)return an([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:an(r)}var _2=(e,t)=>{var r=e.flatMap(n=>t==="xAxis"?HM(n):KM(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]},VM=I([WM,Fe],_2),YM=I(UM,VM,qM,(e,t,r)=>fc(e,r,t)),C2=(e,t,r,n,i,s,o,l)=>{if(r!=null)return r;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",d=c?fc(n,s,i):fc(s,i);return iM(t,d,e.allowDataOverflow)},GM=I([vt,v2,b2,IM,LM,YM,ue,Fe],C2,{memoizeOptions:{resultEqualityCheck:Pu}}),ZM=[0,1],A2=(e,t,r,n,i,s,o)=>{if(!((e==null||r==null||r.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,d=Mr(t,s);if(d&&l==null){var u;return rS(0,(u=r==null?void 0:r.length)!==null&&u!==void 0?u:0)}return c==="category"?RM(n,e,d):i==="expand"?ZM:o}},zm=I([vt,ue,Im,Cu,wu,Fe,GM],A2),O2=(e,t,r,n,i)=>{if(e!=null){var{scale:s,type:o}=e;if(s==="auto")return t==="radial"&&i==="radiusAxis"?"band":t==="radial"&&i==="angleAxis"?"linear":o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?"point":o==="category"?"band":"linear";if(typeof s=="string"){var l="scale".concat(Xs(s));return l in es?l:"point"}}},lo=I([vt,ue,o2,km,Fe],O2);function XM(e){if(e!=null){if(e in es)return es[e]();var t="scale".concat(Xs(e));if(t in es)return es[t]()}}function Rm(e,t,r,n){if(!(r==null||n==null)){if(typeof e.scale=="function")return e.scale.copy().domain(r).range(n);var i=XM(t);if(i!=null){var s=i.domain(r).range(n);return SE(s),s}}}var E2=(e,t,r)=>{var n=$m(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&ji(e))return hM(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&ji(e))return mM(e,t.tickCount,t.allowDecimals)}},Bm=I([zm,so,lo],E2),D2=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&ji(t)&&Array.isArray(r)&&r.length>0){var i=t[0],s=r[0],o=t[1],l=r[r.length-1];return[Math.min(i,s),Math.max(o,l)]}return t},JM=I([vt,zm,Bm,Fe],D2),QM=I(Cu,vt,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(an(e.map(l=>l.value))).sort((l,c)=>l-c);if(n.length<2)return 1/0;var i=n[n.length-1]-n[0];if(i===0)return 1/0;for(var s=0;s<n.length-1;s++){var o=n[s+1]-n[s];r=Math.min(r,o)}return r/i}}),T2=I(QM,ue,gM,rt,(e,t,r,n)=>n,(e,t,r,n,i)=>{if(!_e(e))return 0;var s=t==="vertical"?n.height:n.width;if(i==="gap")return e*s/2;if(i==="no-gap"){var o=Rn(r,e*s),l=e*s/2;return l-o-(l-o)/s*o}return 0}),eI=(e,t)=>{var r=dn(e,t);return r==null||typeof r.padding!="string"?0:T2(e,"xAxis",t,r.padding)},tI=(e,t)=>{var r=fn(e,t);return r==null||typeof r.padding!="string"?0:T2(e,"yAxis",t,r.padding)},rI=I(dn,eI,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((r=i.left)!==null&&r!==void 0?r:0)+t,right:((n=i.right)!==null&&n!==void 0?n:0)+t}}),nI=I(fn,tI,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((r=i.top)!==null&&r!==void 0?r:0)+t,bottom:((n=i.bottom)!==null&&n!==void 0?n:0)+t}}),iI=I([rt,rI,cu,lu,(e,t,r)=>r],(e,t,r,n,i)=>{var{padding:s}=n;return i?[s.left,r.width-s.right]:[e.left+t.left,e.left+e.width-t.right]}),aI=I([rt,ue,nI,cu,lu,(e,t,r)=>r],(e,t,r,n,i,s)=>{var{padding:o}=i;return s?[n.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),co=(e,t,r,n)=>{var i;switch(t){case"xAxis":return iI(e,r,n);case"yAxis":return aI(e,r,n);case"zAxis":return(i=Tm(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return t2(e);case"radiusAxis":return r2(e,r);default:return}},M2=I([vt,co],Su),Ea=I([vt,lo,JM,M2],Rm);I([oo,Lm,Fe],$M);function I2(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Au=(e,t)=>t,Ou=(e,t,r)=>r,sI=I(su,Au,Ou,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(I2)),oI=I(ou,Au,Ou,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(I2)),$2=(e,t)=>({width:e.width,height:t.height}),lI=(e,t)=>{var r=typeof t.width=="number"?t.width:eo;return{width:r,height:e.height}},cI=I(rt,dn,$2),uI=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},dI=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},fI=I(cn,rt,sI,Au,Ou,(e,t,r,n,i)=>{var s={},o;return r.forEach(l=>{var c=$2(t,l);o==null&&(o=uI(t,n,e));var d=n==="top"&&!i||n==="bottom"&&i;s[l.id]=o-Number(d)*c.height,o+=(d?-1:1)*c.height}),s}),pI=I(ln,rt,oI,Au,Ou,(e,t,r,n,i)=>{var s={},o;return r.forEach(l=>{var c=lI(t,l);o==null&&(o=dI(t,n,e));var d=n==="left"&&!i||n==="right"&&i;s[l.id]=o-Number(d)*c.width,o+=(d?-1:1)*c.width}),s}),hI=(e,t)=>{var r=dn(e,t);if(r!=null)return fI(e,r.orientation,r.mirror)},mI=I([rt,dn,hI,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),gI=(e,t)=>{var r=fn(e,t);if(r!=null)return pI(e,r.orientation,r.mirror)},xI=I([rt,fn,gI,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),yI=I(rt,fn,(e,t)=>{var r=typeof t.width=="number"?t.width:eo;return{width:r,height:e.height}}),L2=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:i,type:s,dataKey:o}=r,l=Mr(e,n),c=t.map(d=>d.value);if(o&&l&&s==="category"&&i&&_j(c))return c}},Fm=I([ue,Cu,vt,Fe],L2),z2=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:i,scale:s}=r,o=Mr(e,n);if(o&&(i==="number"||s!=="auto"))return t.map(l=>l.value)}},Wm=I([ue,Cu,so,Fe],z2),Ny=I([ue,CM,lo,Ea,Fm,Wm,co,Bm,Fe],(e,t,r,n,i,s,o,l,c)=>{if(t!=null){var d=Mr(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:s,duplicateDomain:i,isCategorical:d,niceTicks:l,range:o,realScaleType:r,scale:n}}}),vI=(e,t,r,n,i,s,o,l,c)=>{if(!(t==null||n==null)){var d=Mr(e,c),{type:u,ticks:f,tickCount:p}=t,m=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,x=u==="category"&&n.bandwidth?n.bandwidth()/m:0;x=c==="angleAxis"&&s!=null&&s.length>=2?Jt(s[0]-s[1])*2*x:x;var g=f||i;if(g){var b=g.map((v,j)=>{var y=o?o.indexOf(v):v;return{index:j,coordinate:n(y)+x,value:v,offset:x}});return b.filter(v=>_e(v.coordinate))}return d&&l?l.map((v,j)=>({coordinate:n(v)+x,value:v,index:j,offset:x})).filter(v=>_e(v.coordinate)):n.ticks?n.ticks(p).map(v=>({coordinate:n(v)+x,value:v,offset:x})):n.domain().map((v,j)=>({coordinate:n(v)+x,value:o?o[v]:v,index:j,offset:x}))}},R2=I([ue,so,lo,Ea,Bm,co,Fm,Wm,Fe],vI),bI=(e,t,r,n,i,s,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=Mr(e,o),{tickCount:c}=t,d=0;return d=o==="angleAxis"&&(n==null?void 0:n.length)>=2?Jt(n[0]-n[1])*2*d:d,l&&s?s.map((u,f)=>({coordinate:r(u)+d,value:u,index:f,offset:d})):r.ticks?r.ticks(c).map(u=>({coordinate:r(u)+d,value:u,offset:d})):r.domain().map((u,f)=>({coordinate:r(u)+d,value:i?i[u]:u,index:f,offset:d}))}},Eu=I([ue,so,Ea,co,Fm,Wm,Fe],bI),Du=I(vt,Ea,(e,t)=>{if(!(e==null||t==null))return dc(dc({},e),{},{scale:t})}),jI=I([vt,lo,zm,M2],Rm);I((e,t,r)=>Tm(e,r),jI,(e,t)=>{if(!(e==null||t==null))return dc(dc({},e),{},{scale:t})});var wI=I([ue,su,ou],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),B2=e=>e.options.defaultTooltipEventType,F2=e=>e.options.validateTooltipEventTypes;function W2(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function Um(e,t){var r=B2(e),n=F2(e);return W2(t,r,n)}function SI(e){return G(t=>Um(t,e))}var U2=(e,t)=>{var r,n=Number(t);if(!(yr(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},NI=e=>e.tooltip.settings,jn={active:!1,index:null,dataKey:void 0,coordinate:void 0},kI={itemInteraction:{click:jn,hover:jn},axisInteraction:{click:jn,hover:jn},keyboardInteraction:jn,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},q2=At({name:"tooltip",initialState:kI,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Le()},removeTooltipEntrySettings:{reducer(e,t){var r=Kr(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:Le()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,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.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.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.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,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.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,e.keyboardInteraction.dataKey=t.payload.activeDataKey}}}),{addTooltipEntrySettings:PI,removeTooltipEntrySettings:_I,setTooltipSettingsState:CI,setActiveMouseOverItemIndex:AI,mouseLeaveItem:A7,mouseLeaveChart:H2,setActiveClickItemIndex:O7,setMouseOverAxisIndex:K2,setMouseClickAxisIndex:OI,setSyncInteraction:up,setKeyboardInteraction:dp}=q2.actions,EI=q2.reducer;function ky(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ho(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ky(Object(r),!0).forEach(function(n){DI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ky(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function DI(e,t,r){return(t=TI(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TI(e){var t=MI(e,"string");return typeof t=="symbol"?t:t+""}function MI(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function II(e,t,r){return t==="axis"?r==="click"?e.axisInteraction.click:e.axisInteraction.hover:r==="click"?e.itemInteraction.click:e.itemInteraction.hover}function $I(e){return e.index!=null}var V2=(e,t,r,n)=>{if(t==null)return jn;var i=II(e,t,r);if(i==null)return jn;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var s=e.settings.active===!0;if($I(i)){if(s)return Ho(Ho({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n};return Ho(Ho({},jn),{},{coordinate:i.coordinate})},qm=(e,t)=>{var r=e==null?void 0:e.index;if(r==null)return null;var n=Number(r);if(!_e(n))return r;var i=0,s=1/0;return t.length>0&&(s=t.length-1),String(Math.max(i,Math.min(n,s)))},Y2=(e,t,r,n,i,s,o,l)=>{if(!(s==null||l==null)){var c=o[0],d=c==null?void 0:l(c.positions,s);if(d!=null)return d;var u=i==null?void 0:i[Number(s)];if(u)switch(r){case"horizontal":return{x:u.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:u.coordinate}}}},G2=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;return r==="hover"?i=e.itemInteraction.hover.dataKey:i=e.itemInteraction.click.dataKey,i==null&&n!=null?[e.tooltipItemPayloads[0]]:e.tooltipItemPayloads.filter(s=>{var o;return((o=s.settings)===null||o===void 0?void 0:o.dataKey)===i})},uo=e=>e.options.tooltipPayloadSearcher,Da=e=>e.tooltip;function Py(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _y(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Py(Object(r),!0).forEach(function(n){LI(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Py(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LI(e,t,r){return(t=zI(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zI(e){var t=RI(e,"string");return typeof t=="symbol"?t:t+""}function RI(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BI(e,t){return e??t}var Z2=(e,t,r,n,i,s,o)=>{if(!(t==null||s==null)){var{chartData:l,computedData:c,dataStartIndex:d,dataEndIndex:u}=r,f=[];return e.reduce((p,m)=>{var x,{dataDefinedOnItem:g,settings:b}=m,v=BI(g,l),j=Array.isArray(v)?Cw(v,d,u):v,y=(x=b==null?void 0:b.dataKey)!==null&&x!==void 0?x:n,w=b==null?void 0:b.nameKey,S;if(n&&Array.isArray(j)&&!Array.isArray(j[0])&&o==="axis"?S=Cj(j,n,i):S=s(j,t,c,w),Array.isArray(S))S.forEach(P=>{var _=_y(_y({},b),{},{name:P.name,unit:P.unit,color:void 0,fill:void 0});p.push(c0({tooltipEntrySettings:_,dataKey:P.dataKey,payload:P.payload,value:et(P.payload,P.dataKey),name:P.name}))});else{var N;p.push(c0({tooltipEntrySettings:b,dataKey:y,payload:S,value:et(S,y),name:(N=et(S,w))!==null&&N!==void 0?N:b==null?void 0:b.name}))}return p},f)}},Hm=I([Ue,ue,o2,km,We],O2),FI=I([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),WI=I([We,Aa],l2),fo=I([FI,Ue,WI],c2,{memoizeOptions:{resultEqualityCheck:_u}}),UI=I([fo],e=>e.filter(Dm)),qI=I([fo],f2,{memoizeOptions:{resultEqualityCheck:_u}}),Ta=I([qI,Kn],p2),HI=I([UI,Kn,Ue],i2),Km=I([Ta,Ue,fo],h2),X2=I([Ue],$m),KI=I([Ue],e=>e.allowDataOverflow),J2=I([X2,KI],LS),VI=I([fo],e=>e.filter(Dm)),YI=I([HI,VI,wu],x2),GI=I([YI,Kn,We,J2],y2),ZI=I([fo],d2),XI=I([Ta,Ue,ZI,Lm,We],j2,{memoizeOptions:{resultEqualityCheck:Pu}}),JI=I([w2,We,Aa],Oa),QI=I([JI,We],k2),e$=I([S2,We,Aa],Oa),t$=I([e$,We],P2),r$=I([N2,We,Aa],Oa),n$=I([r$,We],_2),i$=I([QI,n$,t$],fc),a$=I([Ue,X2,J2,GI,XI,i$,ue,We],C2),Q2=I([Ue,ue,Ta,Km,wu,We,a$],A2),s$=I([Q2,Ue,Hm],E2),o$=I([Ue,Q2,s$,We],D2),eN=e=>{var t=We(e),r=Aa(e),n=!1;return co(e,t,r,n)},tN=I([Ue,eN],Su),rN=I([Ue,Hm,o$,tN],Rm),l$=I([ue,Km,Ue,We],L2),c$=I([ue,Km,Ue,We],z2),u$=(e,t,r,n,i,s,o,l)=>{if(t){var{type:c}=t,d=Mr(e,l);if(n){var u=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=c==="category"&&n.bandwidth?n.bandwidth()/u:0;return f=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?Jt(i[0]-i[1])*2*f:f,d&&o?o.map((p,m)=>({coordinate:n(p)+f,value:p,index:m,offset:f})):n.domain().map((p,m)=>({coordinate:n(p)+f,value:s?s[p]:p,index:m,offset:f}))}}},pn=I([ue,Ue,Hm,rN,eN,l$,c$,We],u$),Vm=I([B2,F2,NI],(e,t,r)=>W2(r.shared,e,t)),nN=e=>e.tooltip.settings.trigger,Ym=e=>e.tooltip.settings.defaultIndex,Tu=I([Da,Vm,nN,Ym],V2),Us=I([Tu,Ta],qm),iN=I([pn,Us],U2),d$=I([Tu],e=>{if(e)return e.dataKey}),aN=I([Da,Vm,nN,Ym],G2),f$=I([ln,cn,ue,rt,pn,Ym,aN,uo],Y2),p$=I([Tu,f$],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),h$=I([Tu],e=>e.active),m$=I([aN,Us,Kn,g2,iN,uo,Vm],Z2),g$=I([m$],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function Cy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ay(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Cy(Object(r),!0).forEach(function(n){x$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function x$(e,t,r){return(t=y$(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y$(e){var t=v$(e,"string");return typeof t=="symbol"?t:t+""}function v$(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var b$=()=>G(Ue),j$=()=>{var e=b$(),t=G(pn),r=G(rN);return ha(!e||!r?void 0:Ay(Ay({},e),{},{scale:r}),t)};function Oy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ti(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Oy(Object(r),!0).forEach(function(n){w$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function w$(e,t,r){return(t=S$(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S$(e){var t=N$(e,"string");return typeof t=="symbol"?t:t+""}function N$(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var k$=(e,t,r,n)=>{var i=t.find(s=>s&&s.index===r);if(i){if(e==="horizontal")return{x:i.coordinate,y:n.chartY};if(e==="vertical")return{x:n.chartX,y:i.coordinate}}return{x:0,y:0}},P$=(e,t,r,n)=>{var i=t.find(d=>d&&d.index===r);if(i){if(e==="centric"){var s=i.coordinate,{radius:o}=n;return Ti(Ti(Ti({},n),Je(n.cx,n.cy,o,s)),{},{angle:s,radius:o})}var l=i.coordinate,{angle:c}=n;return Ti(Ti(Ti({},n),Je(n.cx,n.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function _$(e,t){var{chartX:r,chartY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var sN=(e,t,r,n,i)=>{var s,o=-1,l=(s=t==null?void 0:t.length)!==null&&s!==void 0?s:0;if(l<=1||e==null)return 0;if(n==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c<l;c++){var d=c>0?r[c-1].coordinate:r[l-1].coordinate,u=r[c].coordinate,f=c>=l-1?r[0].coordinate:r[c+1].coordinate,p=void 0;if(Jt(u-d)!==Jt(f-u)){var m=[];if(Jt(f-u)===Jt(i[1]-i[0])){p=f;var x=u+i[1]-i[0];m[0]=Math.min(x,(x+d)/2),m[1]=Math.max(x,(x+d)/2)}else{p=d;var g=f+i[1]-i[0];m[0]=Math.min(u,(g+u)/2),m[1]=Math.max(u,(g+u)/2)}var b=[Math.min(u,(p+u)/2),Math.max(u,(p+u)/2)];if(e>b[0]&&e<=b[1]||e>=m[0]&&e<=m[1]){({index:o}=r[c]);break}}else{var v=Math.min(d,f),j=Math.max(d,f);if(e>(v+u)/2&&e<=(j+u)/2){({index:o}=r[c]);break}}}else if(t){for(var y=0;y<l;y++)if(y===0&&e<=(t[y].coordinate+t[y+1].coordinate)/2||y>0&&y<l-1&&e>(t[y].coordinate+t[y-1].coordinate)/2&&e<=(t[y].coordinate+t[y+1].coordinate)/2||y===l-1&&e>(t[y].coordinate+t[y-1].coordinate)/2){({index:o}=t[y]);break}}return o},oN=()=>G(km),Gm=(e,t)=>t,lN=(e,t,r)=>r,Zm=(e,t,r,n)=>n,C$=I(pn,e=>Qc(e,t=>t.coordinate)),Xm=I([Da,Gm,lN,Zm],V2),cN=I([Xm,Ta],qm),A$=(e,t,r)=>{if(t!=null){var n=Da(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},uN=I([Da,Gm,lN,Zm],G2),pc=I([ln,cn,ue,rt,pn,Zm,uN,uo],Y2),O$=I([Xm,pc],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),dN=I([pn,cN],U2),E$=I([uN,cN,Kn,g2,dN,uo,Gm],Z2),D$=I([Xm],e=>({isActive:e.active,activeIndex:e.index})),T$=(e,t,r,n,i,s,o)=>{if(!(!e||!r||!n||!i)&&_$(e,o)){var l=DE(e,t),c=sN(l,s,i,r,n),d=k$(t,i,c,e);return{activeIndex:String(c),activeCoordinate:d}}},M$=(e,t,r,n,i,s,o)=>{if(!(!e||!n||!i||!s||!r)){var l=SD(e,r);if(l){var c=TE(l,t),d=sN(c,o,s,n,i),u=P$(t,s,d,l);return{activeIndex:String(d),activeCoordinate:u}}}},I$=(e,t,r,n,i,s,o,l)=>{if(!(!e||!t||!n||!i||!s))return t==="horizontal"||t==="vertical"?T$(e,t,n,i,s,o,l):M$(e,t,r,n,i,s,o)},$$=I(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElementId:n.elementId}}),L$=I(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(lt)),r=Array.from(new Set(t));return r.sort((n,i)=>n-i)},{memoizeOptions:{resultEqualityCheck:SM}});function Ey(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Dy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ey(Object(r),!0).forEach(function(n){z$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ey(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function z$(e,t,r){return(t=R$(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function R$(e){var t=B$(e,"string");return typeof t=="symbol"?t:t+""}function B$(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var F$={},W$={zIndexMap:Object.values(lt).reduce((e,t)=>Dy(Dy({},e),{},{[t]:{elementId:void 0,panoramaElementId:void 0,consumers:0}}),F$)},U$=new Set(Object.values(lt));function q$(e){return U$.has(e)}var fN=At({name:"zIndex",initialState:W$,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,elementId:void 0,panoramaElementId:void 0}},prepare:Le()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!q$(r)&&delete e.zIndexMap[r])},prepare:Le()},registerZIndexPortalId:{reducer:(e,t)=>{var{zIndex:r,elementId:n,isPanorama:i}=t.payload;e.zIndexMap[r]?i?e.zIndexMap[r].panoramaElementId=n:e.zIndexMap[r].elementId=n:e.zIndexMap[r]={consumers:0,elementId:i?void 0:n,panoramaElementId:i?n:void 0}},prepare:Le()},unregisterZIndexPortalId:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElementId=void 0:e.zIndexMap[r].elementId=void 0)},prepare:Le()}}}),{registerZIndexPortal:H$,unregisterZIndexPortal:K$,registerZIndexPortalId:V$,unregisterZIndexPortalId:Y$}=fN.actions,G$=fN.reducer;function Ir(e){var{zIndex:t,children:r}=e,n=o3(),i=n&&t!==void 0&&t!==0,s=pt(),o=Ve();h.useLayoutEffect(()=>i?(o(H$({zIndex:t})),()=>{o(K$({zIndex:t}))}):ka,[o,t,i]);var l=G(d=>$$(d,t,s));if(!i)return r;if(!l)return null;var c=document.getElementById(l);return c?bh.createPortal(r,c):null}function fp(){return fp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fp.apply(null,arguments)}function Ty(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ko(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ty(Object(r),!0).forEach(function(n){Z$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ty(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Z$(e,t,r){return(t=X$(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X$(e){var t=J$(e,"string");return typeof t=="symbol"?t:t+""}function J$(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Q$(e){var{cursor:t,cursorComp:r,cursorProps:n}=e;return h.isValidElement(t)?h.cloneElement(t,n):h.createElement(r,n)}function eL(e){var t,{coordinate:r,payload:n,index:i,offset:s,tooltipAxisBandSize:o,layout:l,cursor:c,tooltipEventType:d,chartName:u}=e,f=r,p=n,m=i;if(!c||!f||u!=="ScatterChart"&&d!=="axis")return null;var x,g,b;if(u==="ScatterChart")x=f,g=z3,b=lt.cursorLine;else if(u==="BarChart")x=R3(l,f,s,o),g=Gw,b=lt.cursorRectangle;else if(l==="radial"&&Ej(f)){var{cx:v,cy:j,radius:y,startAngle:w,endAngle:S}=Zw(f);x={cx:v,cy:j,startAngle:w,endAngle:S,innerRadius:y,outerRadius:y},g=Jw,b=lt.cursorLine}else x={points:_D(l,f,s)},g=us,b=lt.cursorLine;var N=typeof c=="object"&&"className"in c?c.className:void 0,P=Ko(Ko(Ko(Ko({stroke:"#ccc",pointerEvents:"none"},s),x),qc(c)),{},{payload:p,payloadIndex:m,className:ce("recharts-tooltip-cursor",N)});return h.createElement(Ir,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:b},h.createElement(Q$,{cursor:c,cursorComp:g,cursorProps:P}))}function tL(e){var t=j$(),r=Bw(),n=to(),i=oN();return t==null||r==null||n==null||i==null?null:h.createElement(eL,fp({},e,{offset:r,layout:n,tooltipAxisBandSize:t,chartName:i}))}var pN=h.createContext(null),rL=()=>h.useContext(pN),hN={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,d,u){this.fn=c,this.context=d,this.once=u||!1}function s(c,d,u,f,p){if(typeof u!="function")throw new TypeError("The listener must be a function");var m=new i(u,f||c,p),x=r?r+d:d;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],m]:c._events[x].push(m):(c._events[x]=m,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new n:delete c._events[d]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],u,f;if(this._eventsCount===0)return d;for(f in u=this._events)t.call(u,f)&&d.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(u)):d},l.prototype.listeners=function(d){var u=r?r+d:d,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var p=0,m=f.length,x=new Array(m);p<m;p++)x[p]=f[p].fn;return x},l.prototype.listenerCount=function(d){var u=r?r+d:d,f=this._events[u];return f?f.fn?1:f.length:0},l.prototype.emit=function(d,u,f,p,m,x){var g=r?r+d:d;if(!this._events[g])return!1;var b=this._events[g],v=arguments.length,j,y;if(b.fn){switch(b.once&&this.removeListener(d,b.fn,void 0,!0),v){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,u),!0;case 3:return b.fn.call(b.context,u,f),!0;case 4:return b.fn.call(b.context,u,f,p),!0;case 5:return b.fn.call(b.context,u,f,p,m),!0;case 6:return b.fn.call(b.context,u,f,p,m,x),!0}for(y=1,j=new Array(v-1);y<v;y++)j[y-1]=arguments[y];b.fn.apply(b.context,j)}else{var w=b.length,S;for(y=0;y<w;y++)switch(b[y].once&&this.removeListener(d,b[y].fn,void 0,!0),v){case 1:b[y].fn.call(b[y].context);break;case 2:b[y].fn.call(b[y].context,u);break;case 3:b[y].fn.call(b[y].context,u,f);break;case 4:b[y].fn.call(b[y].context,u,f,p);break;default:if(!j)for(S=1,j=new Array(v-1);S<v;S++)j[S-1]=arguments[S];b[y].fn.apply(b[y].context,j)}}return!0},l.prototype.on=function(d,u,f){return s(this,d,u,f,!1)},l.prototype.once=function(d,u,f){return s(this,d,u,f,!0)},l.prototype.removeListener=function(d,u,f,p){var m=r?r+d:d;if(!this._events[m])return this;if(!u)return o(this,m),this;var x=this._events[m];if(x.fn)x.fn===u&&(!p||x.once)&&(!f||x.context===f)&&o(this,m);else{for(var g=0,b=[],v=x.length;g<v;g++)(x[g].fn!==u||p&&!x[g].once||f&&x[g].context!==f)&&b.push(x[g]);b.length?this._events[m]=b.length===1?b[0]:b:o(this,m)}return this},l.prototype.removeAllListeners=function(d){var u;return d?(u=r?r+d:d,this._events[u]&&o(this,u)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,e.exports=l})(hN);var nL=hN.exports;const iL=Tr(nL);var qs=new iL,pp="recharts.syncEvent.tooltip",My="recharts.syncEvent.brush";function mN(e,t){if(t){var r=Number.parseInt(t,10);if(!yr(r))return e==null?void 0:e[r]}}var aL={chartName:"",tooltipPayloadSearcher:void 0,eventEmitter:void 0,defaultTooltipEventType:"axis"},gN=At({name:"options",initialState:aL,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),sL=gN.reducer,{createEventEmitter:oL}=gN.actions;function lL(e){return e.tooltip.syncInteraction}var cL={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},xN=At({name:"chartData",initialState:cL,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:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:Iy,setDataStartEndIndexes:uL,setComputedData:E7}=xN.actions,dL=xN.reducer,fL=["x","y"];function $y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?$y(Object(r),!0).forEach(function(n){pL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$y(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pL(e,t,r){return(t=hL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hL(e){var t=mL(e,"string");return typeof t=="symbol"?t:t+""}function mL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gL(e,t){if(e==null)return{};var r,n,i=xL(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function xL(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function yL(){var e=G(Pm),t=G(_m),r=Ve(),n=G(JS),i=G(pn),s=to(),o=uu(),l=G(c=>c.rootProps.className);h.useEffect(()=>{if(e==null)return ka;var c=(d,u,f)=>{if(t!==f&&e===d){if(n==="index"){var p;if(o&&u!==null&&u!==void 0&&(p=u.payload)!==null&&p!==void 0&&p.coordinate&&u.payload.sourceViewBox){var m=u.payload.coordinate,{x,y:g}=m,b=gL(m,fL),{x:v,y:j,width:y,height:w}=u.payload.sourceViewBox,S=Mi(Mi({},b),{},{x:o.x+(y?(x-v)/y:0)*o.width,y:o.y+(w?(g-j)/w:0)*o.height});r(Mi(Mi({},u),{},{payload:Mi(Mi({},u.payload),{},{coordinate:S})}))}else r(u);return}if(i!=null){var N;if(typeof n=="function"){var P={activeTooltipIndex:u.payload.index==null?void 0:Number(u.payload.index),isTooltipActive:u.payload.active,activeIndex:u.payload.index==null?void 0:Number(u.payload.index),activeLabel:u.payload.label,activeDataKey:u.payload.dataKey,activeCoordinate:u.payload.coordinate},_=n(i,P);N=i[_]}else n==="value"&&(N=i.find(E=>String(E.value)===u.payload.label));var{coordinate:T}=u.payload;if(N==null||u.payload.active===!1||T==null||o==null){r(up({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0}));return}var{x:$,y:M}=T,C=Math.min($,o.x+o.width),R=Math.min(M,o.y+o.height),q={x:s==="horizontal"?N.coordinate:C,y:s==="horizontal"?R:N.coordinate},Z=up({active:u.payload.active,coordinate:q,dataKey:u.payload.dataKey,index:String(N.index),label:u.payload.label,sourceViewBox:u.payload.sourceViewBox});r(Z)}}};return qs.on(pp,c),()=>{qs.off(pp,c)}},[l,r,t,e,n,i,s,o])}function vL(){var e=G(Pm),t=G(_m),r=Ve();h.useEffect(()=>{if(e==null)return ka;var n=(i,s,o)=>{t!==o&&e===i&&r(uL(s))};return qs.on(My,n),()=>{qs.off(My,n)}},[r,t,e])}function bL(){var e=Ve();h.useEffect(()=>{e(oL())},[e]),yL(),vL()}function jL(e,t,r,n,i,s){var o=G(m=>A$(m,e,t)),l=G(_m),c=G(Pm),d=G(JS),u=G(lL),f=u==null?void 0:u.active,p=uu();h.useEffect(()=>{if(!f&&c!=null&&l!=null){var m=up({active:s,coordinate:r,dataKey:o,index:i,label:typeof n=="number"?String(n):n,sourceViewBox:p});qs.emit(pp,c,m,l)}},[f,r,o,i,n,l,c,d,s,p])}function Ly(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zy(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ly(Object(r),!0).forEach(function(n){wL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ly(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function wL(e,t,r){return(t=SL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SL(e){var t=NL(e,"string");return typeof t=="symbol"?t:t+""}function NL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kL(e){return e.dataKey}function PL(e,t){return h.isValidElement(e)?h.cloneElement(e,t):typeof e=="function"?h.createElement(e,t):h.createElement(g3,t)}var Ry=[],_L={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,isAnimationActive:!Ci.isSsr,itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function By(e){var t,r,n=ft(e,_L),{active:i,allowEscapeViewBox:s,animationDuration:o,animationEasing:l,content:c,filterNull:d,isAnimationActive:u,offset:f,payloadUniqBy:p,position:m,reverseDirection:x,useTranslate3d:g,wrapperStyle:b,cursor:v,shared:j,trigger:y,defaultIndex:w,portal:S,axisId:N}=n,P=Ve(),_=typeof w=="number"?String(w):w;h.useEffect(()=>{P(CI({shared:j,trigger:y,axisId:N,active:i,defaultIndex:_}))},[P,j,y,N,i,_]);var T=uu(),$=qw(),M=SI(j),{activeIndex:C,isActive:R}=(t=G(J=>D$(J,M,y,_)))!==null&&t!==void 0?t:{},q=G(J=>E$(J,M,y,_)),Z=G(J=>dN(J,M,y,_)),E=G(J=>O$(J,M,y,_)),D=q,O=rL(),k=(r=i??R)!==null&&r!==void 0?r:!1,[L,U]=w4([D,k]),H=M==="axis"?Z:void 0;jL(M,y,E,H,C,k);var te=S??O;if(te==null||T==null||M==null)return null;var re=D??Ry;k||(re=Ry),d&&re.length&&(re=a4(re.filter(J=>J.value!=null&&(J.hide!==!0||n.includeHidden)),p,kL));var we=re.length>0,A=h.createElement(S3,{allowEscapeViewBox:s,animationDuration:o,animationEasing:l,isAnimationActive:u,active:k,coordinate:E,hasPayload:we,offset:f,position:m,reverseDirection:x,useTranslate3d:g,viewBox:T,wrapperStyle:b,lastBoundingBox:L,innerRef:U,hasPortalFromProps:!!S},PL(c,zy(zy({},n),{},{payload:re,label:H,active:k,activeIndex:C,coordinate:E,accessibilityLayer:$})));return h.createElement(h.Fragment,null,bh.createPortal(A,te),k&&h.createElement(tL,{cursor:v,tooltipEventType:M,coordinate:E,payload:re,index:C}))}function CL(e,t,r){return(t=AL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AL(e){var t=OL(e,"string");return typeof t=="symbol"?t:t+""}function OL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class EL{constructor(t){CL(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function Fy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function DL(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Fy(Object(r),!0).forEach(function(n){TL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function TL(e,t,r){return(t=ML(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ML(e){var t=IL(e,"string");return typeof t=="symbol"?t:t+""}function IL(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $L={cacheSize:2e3,enableCache:!0},yN=DL({},$L),Wy=new EL(yN.cacheSize),LL={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Uy="recharts_measurement_span";function zL(e,t){var r=t.fontSize||"",n=t.fontFamily||"",i=t.fontWeight||"",s=t.fontStyle||"",o=t.letterSpacing||"",l=t.textTransform||"";return"".concat(e,"|").concat(r,"|").concat(n,"|").concat(i,"|").concat(s,"|").concat(o,"|").concat(l)}var qy=(e,t)=>{try{var r=document.getElementById(Uy);r||(r=document.createElement("span"),r.setAttribute("id",Uy),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,LL,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},ds=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ci.isSsr)return{width:0,height:0};if(!yN.enableCache)return qy(t,r);var n=zL(t,r),i=Wy.get(n);if(i)return i;var s=qy(t,r);return Wy.set(n,s),s},Hy=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Ky=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,RL=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,BL=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,vN={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},FL=Object.keys(vN),Gi="NaN";function WL(e,t){return e*vN[t]}class jt{static parse(t){var r,[,n,i]=(r=BL.exec(t))!==null&&r!==void 0?r:[];return new jt(parseFloat(n),i??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,yr(t)&&(this.unit=""),r!==""&&!RL.test(r)&&(this.num=NaN,this.unit=""),FL.includes(r)&&(this.num=WL(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new jt(NaN,""):new jt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new jt(NaN,""):new jt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new jt(NaN,""):new jt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new jt(NaN,""):new jt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return yr(this.num)}}function bN(e){if(e.includes(Gi))return Gi;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,i,s]=(r=Hy.exec(t))!==null&&r!==void 0?r:[],o=jt.parse(n??""),l=jt.parse(s??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return Gi;t=t.replace(Hy,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var d,[,u,f,p]=(d=Ky.exec(t))!==null&&d!==void 0?d:[],m=jt.parse(u??""),x=jt.parse(p??""),g=f==="+"?m.add(x):m.subtract(x);if(g.isNaN())return Gi;t=t.replace(Ky,g.toString())}return t}var Vy=/\(([^()]*)\)/;function UL(e){for(var t=e,r;(r=Vy.exec(t))!=null;){var[,n]=r;t=t.replace(Vy,bN(n))}return t}function qL(e){var t=e.replace(/\s+/g,"");return t=UL(t),t=bN(t),t}function HL(e){try{return qL(e)}catch{return Gi}}function Nd(e){var t=HL(e.slice(5,-1));return t===Gi?"":t}var KL=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],VL=["dx","dy","angle","className","breakAll"];function hp(){return hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hp.apply(null,arguments)}function Yy(e,t){if(e==null)return{};var r,n,i=YL(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function YL(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var jN=/[ \f\n\r\t\v\u2028\u2029]+/,wN=e=>{var{children:t,breakAll:r,style:n}=e;try{var i=[];Re(t)||(r?i=t.toString().split(""):i=t.toString().split(jN));var s=i.map(l=>({word:l,width:ds(l,n).width})),o=r?0:ds(" ",n).width;return{wordsWithComputedWidth:s,spaceWidth:o}}catch{return null}};function GL(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var SN=(e,t,r,n)=>e.reduce((i,s)=>{var{word:o,width:l}=s,c=i[i.length-1];if(c&&l!=null&&(t==null||n||c.width+l+r<Number(t)))c.words.push(o),c.width+=l+r;else{var d={words:[o],width:l};i.push(d)}return i},[]),NN=e=>e.reduce((t,r)=>t.width>r.width?t:r),ZL="…",Gy=(e,t,r,n,i,s,o,l)=>{var c=e.slice(0,t),d=wN({breakAll:r,style:n,children:c+ZL});if(!d)return[!1,[]];var u=SN(d.wordsWithComputedWidth,s,o,l),f=u.length>i||NN(u).width>Number(s);return[f,u]},XL=(e,t,r,n,i)=>{var{maxLines:s,children:o,style:l,breakAll:c}=e,d=Y(s),u=String(o),f=SN(t,n,r,i);if(!d||i)return f;var p=f.length>s||NN(f).width>Number(n);if(!p)return f;for(var m=0,x=u.length-1,g=0,b;m<=x&&g<=u.length-1;){var v=Math.floor((m+x)/2),j=v-1,[y,w]=Gy(u,j,c,l,s,n,r,i),[S]=Gy(u,v,c,l,s,n,r,i);if(!y&&!S&&(m=v+1),y&&S&&(x=v-1),!y&&S){b=w;break}g++}return b||f},Zy=e=>{var t=Re(e)?[]:e.toString().split(jN);return[{words:t,width:void 0}]},JL=e=>{var{width:t,scaleToFit:r,children:n,style:i,breakAll:s,maxLines:o}=e;if((t||r)&&!Ci.isSsr){var l,c,d=wN({breakAll:s,children:n,style:i});if(d){var{wordsWithComputedWidth:u,spaceWidth:f}=d;l=u,c=f}else return Zy(n);return XL({breakAll:s,children:n,maxLines:o,style:i},l,c,t,!!r)}return Zy(n)},kN="#808080",QL={breakAll:!1,capHeight:"0.71em",fill:kN,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Jm=h.forwardRef((e,t)=>{var r=ft(e,QL),{x:n,y:i,lineHeight:s,capHeight:o,fill:l,scaleToFit:c,textAnchor:d,verticalAnchor:u}=r,f=Yy(r,KL),p=h.useMemo(()=>JL({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:m,dy:x,angle:g,className:b,breakAll:v}=f,j=Yy(f,VL);if(!Or(n)||!Or(i)||p.length===0)return null;var y=Number(n)+(Y(m)?m:0),w=Number(i)+(Y(x)?x:0);if(!_e(y)||!_e(w))return null;var S;switch(u){case"start":S=Nd("calc(".concat(o,")"));break;case"middle":S=Nd("calc(".concat((p.length-1)/2," * -").concat(s," + (").concat(o," / 2))"));break;default:S=Nd("calc(".concat(p.length-1," * -").concat(s,")"));break}var N=[];if(c){var P=p[0].width,{width:_}=f;N.push("scale(".concat(Y(_)&&Y(P)?_/P:1,")"))}return g&&N.push("rotate(".concat(g,", ").concat(y,", ").concat(w,")")),N.length&&(j.transform=N.join(" ")),h.createElement("text",hp({},ut(j),{ref:t,x:y,y:w,className:ce("recharts-text",b),textAnchor:d,fill:l.includes("url")?kN:l}),p.map((T,$)=>{var M=T.words.join(v?"":" ");return h.createElement("tspan",{x:y,dy:$===0?S:s,key:"".concat(M,"-").concat($)},M)}))});Jm.displayName="Text";var e8=["labelRef"];function t8(e,t){if(e==null)return{};var r,n,i=r8(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function r8(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Xy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ce(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xy(Object(r),!0).forEach(function(n){n8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function n8(e,t,r){return(t=i8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i8(e){var t=a8(e,"string");return typeof t=="symbol"?t:t+""}function a8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rr(){return Rr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rr.apply(null,arguments)}var PN=h.createContext(null),s8=e=>{var{x:t,y:r,upperWidth:n,lowerWidth:i,width:s,height:o,children:l}=e,c=h.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:i,width:s,height:o}),[t,r,n,i,s,o]);return h.createElement(PN.Provider,{value:c},l)},_N=()=>{var e=h.useContext(PN),t=uu();return e||Rw(t)},o8=h.createContext(null),l8=()=>{var e=h.useContext(o8),t=G(n2);return e||t},c8=e=>{var{value:t,formatter:r}=e,n=Re(e.children)?t:e.children;return typeof r=="function"?r(n):n},Qm=e=>e!=null&&typeof e=="function",u8=(e,t)=>{var r=Jt(t-e),n=Math.min(Math.abs(t-e),360);return r*n},d8=(e,t,r,n,i)=>{var{offset:s,className:o}=e,{cx:l,cy:c,innerRadius:d,outerRadius:u,startAngle:f,endAngle:p,clockWise:m}=i,x=(d+u)/2,g=u8(f,p),b=g>=0?1:-1,v,j;switch(t){case"insideStart":v=f+b*s,j=m;break;case"insideEnd":v=p-b*s,j=!m;break;case"end":v=p+b*s,j=m;break;default:throw new Error("Unsupported position ".concat(t))}j=g<=0?j:!j;var y=Je(l,c,x,v),w=Je(l,c,x,v+(j?1:-1)*359),S="M".concat(y.x,",").concat(y.y,`
A`).concat(x,",").concat(x,",0,1,").concat(j?0:1,`,
`).concat(w.x,",").concat(w.y),N=Re(e.id)?Ts("recharts-radial-line-"):e.id;return h.createElement("text",Rr({},n,{dominantBaseline:"central",className:ce("recharts-radial-bar-label",o)}),h.createElement("defs",null,h.createElement("path",{id:N,d:S})),h.createElement("textPath",{xlinkHref:"#".concat(N)},r))},f8=(e,t,r)=>{var{cx:n,cy:i,innerRadius:s,outerRadius:o,startAngle:l,endAngle:c}=e,d=(l+c)/2;if(r==="outside"){var{x:u,y:f}=Je(n,i,o+t,d);return{x:u,y:f,textAnchor:u>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var p=(s+o)/2,{x:m,y:x}=Je(n,i,p,d);return{x:m,y:x,textAnchor:"middle",verticalAnchor:"middle"}},mp=e=>"cx"in e&&Y(e.cx),p8=(e,t)=>{var{parentViewBox:r,offset:n,position:i}=e,s;r!=null&&!mp(r)&&(s=r);var{x:o,y:l,upperWidth:c,lowerWidth:d,height:u}=t,f=o,p=o+(c-d)/2,m=(f+p)/2,x=(c+d)/2,g=f+c/2,b=u>=0?1:-1,v=b*n,j=b>0?"end":"start",y=b>0?"start":"end",w=c>=0?1:-1,S=w*n,N=w>0?"end":"start",P=w>0?"start":"end";if(i==="top"){var _={x:f+c/2,y:l-v,textAnchor:"middle",verticalAnchor:j};return Ce(Ce({},_),s?{height:Math.max(l-s.y,0),width:c}:{})}if(i==="bottom"){var T={x:p+d/2,y:l+u+v,textAnchor:"middle",verticalAnchor:y};return Ce(Ce({},T),s?{height:Math.max(s.y+s.height-(l+u),0),width:d}:{})}if(i==="left"){var $={x:m-S,y:l+u/2,textAnchor:N,verticalAnchor:"middle"};return Ce(Ce({},$),s?{width:Math.max($.x-s.x,0),height:u}:{})}if(i==="right"){var M={x:m+x+S,y:l+u/2,textAnchor:P,verticalAnchor:"middle"};return Ce(Ce({},M),s?{width:Math.max(s.x+s.width-M.x,0),height:u}:{})}var C=s?{width:x,height:u}:{};return i==="insideLeft"?Ce({x:m+S,y:l+u/2,textAnchor:P,verticalAnchor:"middle"},C):i==="insideRight"?Ce({x:m+x-S,y:l+u/2,textAnchor:N,verticalAnchor:"middle"},C):i==="insideTop"?Ce({x:f+c/2,y:l+v,textAnchor:"middle",verticalAnchor:y},C):i==="insideBottom"?Ce({x:p+d/2,y:l+u-v,textAnchor:"middle",verticalAnchor:j},C):i==="insideTopLeft"?Ce({x:f+S,y:l+v,textAnchor:P,verticalAnchor:y},C):i==="insideTopRight"?Ce({x:f+c-S,y:l+v,textAnchor:N,verticalAnchor:y},C):i==="insideBottomLeft"?Ce({x:p+S,y:l+u-v,textAnchor:P,verticalAnchor:j},C):i==="insideBottomRight"?Ce({x:p+d-S,y:l+u-v,textAnchor:N,verticalAnchor:j},C):i&&typeof i=="object"&&(Y(i.x)||Qr(i.x))&&(Y(i.y)||Qr(i.y))?Ce({x:o+Rn(i.x,x),y:l+Rn(i.y,u),textAnchor:"end",verticalAnchor:"end"},C):Ce({x:g,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},C)},h8={offset:5,zIndex:lt.label};function yn(e){var t=ft(e,h8),{viewBox:r,position:n,value:i,children:s,content:o,className:l="",textBreakAll:c,labelRef:d}=t,u=l8(),f=_N(),p=n==="center"?f:u??f,m,x,g;if(r==null?m=p:mp(r)?m=r:m=Rw(r),!m||Re(i)&&Re(s)&&!h.isValidElement(o)&&typeof o!="function")return null;var b=Ce(Ce({},t),{},{viewBox:m});if(h.isValidElement(o)){var{labelRef:v}=b,j=t8(b,e8);return h.cloneElement(o,j)}if(typeof o=="function"){if(x=h.createElement(o,b),h.isValidElement(x))return x}else x=c8(t);var y=ut(t);if(mp(m)){if(n==="insideStart"||n==="insideEnd"||n==="end")return d8(t,n,x,y,m);g=f8(m,t.offset,t.position)}else g=p8(t,m);return h.createElement(Ir,{zIndex:t.zIndex},h.createElement(Jm,Rr({ref:d,className:ce("recharts-label",l)},y,g,{textAnchor:GL(y.textAnchor)?y.textAnchor:g.textAnchor,breakAll:c}),x))}yn.displayName="Label";var m8=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?h.createElement(yn,Rr({key:"label-implicit"},n)):Or(e)?h.createElement(yn,Rr({key:"label-implicit",value:e},n)):h.isValidElement(e)?e.type===yn?h.cloneElement(e,Ce({key:"label-implicit"},n)):h.createElement(yn,Rr({key:"label-implicit",content:e},n)):Qm(e)?h.createElement(yn,Rr({key:"label-implicit",content:e},n)):e&&typeof e=="object"?h.createElement(yn,Rr({},e,{key:"label-implicit"},n)):null};function g8(e){var{label:t,labelRef:r}=e,n=_N();return m8(t,n,r)||null}var CN={},AN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(AN);var ON={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(ON);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AN,r=ON,n=Jc;function i(s){if(n.isArrayLike(s))return t.last(r.toArray(s))}e.last=i})(CN);var x8=CN.last;const y8=Tr(x8);var v8=["valueAccessor"],b8=["dataKey","clockWise","id","textBreakAll","zIndex"];function hc(){return hc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hc.apply(null,arguments)}function Jy(e,t){if(e==null)return{};var r,n,i=j8(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function j8(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var w8=e=>Array.isArray(e.value)?y8(e.value):e.value,EN=h.createContext(void 0),DN=EN.Provider,TN=h.createContext(void 0);TN.Provider;function S8(){return h.useContext(EN)}function N8(){return h.useContext(TN)}function cl(e){var{valueAccessor:t=w8}=e,r=Jy(e,v8),{dataKey:n,clockWise:i,id:s,textBreakAll:o,zIndex:l}=r,c=Jy(r,b8),d=S8(),u=N8(),f=d||u;return!f||!f.length?null:h.createElement(Ir,{zIndex:l??lt.label},h.createElement(ir,{className:"recharts-label-list"},f.map((p,m)=>{var x,g=Re(n)?t(p,m):et(p&&p.payload,n),b=Re(s)?{}:{id:"".concat(s,"-").concat(m)};return h.createElement(yn,hc({key:"label-".concat(m)},ut(p),c,b,{fill:(x=r.fill)!==null&&x!==void 0?x:p.fill,parentViewBox:p.parentViewBox,value:g,textBreakAll:o,viewBox:p.viewBox,index:m,zIndex:0}))})))}cl.displayName="LabelList";function MN(e){var{label:t}=e;return t?t===!0?h.createElement(cl,{key:"labelList-implicit"}):h.isValidElement(t)||Qm(t)?h.createElement(cl,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(cl,hc({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function gp(){return gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gp.apply(null,arguments)}var IN=e=>{var{cx:t,cy:r,r:n,className:i}=e,s=ce("recharts-dot",i);return Y(t)&&Y(r)&&Y(n)?h.createElement("circle",gp({},nr(e),Ih(e),{className:s,cx:t,cy:r,r:n})):null},k8={radiusAxis:{},angleAxis:{}},$N=At({name:"polarAxis",initialState:k8,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:D7,removeRadiusAxis:T7,addAngleAxis:M7,removeAngleAxis:I7}=$N.actions,P8=$N.reducer,eg=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,LN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var i;if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const s=r[Symbol.toStringTag];return s==null||!((i=Object.getOwnPropertyDescriptor(r,Symbol.toStringTag))!=null&&i.writable)?!1:r.toString()===`[object ${s}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(LN);var _8=LN.isPlainObject;const C8=Tr(_8);function Qy(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ev(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Qy(Object(r),!0).forEach(function(n){A8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qy(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function A8(e,t,r){return(t=O8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function O8(e){var t=E8(e,"string");return typeof t=="symbol"?t:t+""}function E8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mc(){return mc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mc.apply(null,arguments)}var tv=(e,t,r,n,i)=>{var s=r-n,o;return o="M ".concat(e,",").concat(t),o+="L ".concat(e+r,",").concat(t),o+="L ".concat(e+r-s/2,",").concat(t+i),o+="L ".concat(e+r-s/2-n,",").concat(t+i),o+="L ".concat(e,",").concat(t," Z"),o},D8={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},T8=e=>{var t=ft(e,D8),{x:r,y:n,upperWidth:i,lowerWidth:s,height:o,className:l}=t,{animationEasing:c,animationDuration:d,animationBegin:u,isUpdateAnimationActive:f}=t,p=h.useRef(null),[m,x]=h.useState(-1),g=h.useRef(i),b=h.useRef(s),v=h.useRef(o),j=h.useRef(r),y=h.useRef(n),w=pu(e,"trapezoid-");if(h.useEffect(()=>{if(p.current&&p.current.getTotalLength)try{var q=p.current.getTotalLength();q&&x(q)}catch{}},[]),r!==+r||n!==+n||i!==+i||s!==+s||o!==+o||i===0&&s===0||o===0)return null;var S=ce("recharts-trapezoid",l);if(!f)return h.createElement("g",null,h.createElement("path",mc({},ut(t),{className:S,d:tv(r,n,i,s,o)})));var N=g.current,P=b.current,_=v.current,T=j.current,$=y.current,M="0px ".concat(m===-1?1:m,"px"),C="".concat(m,"px 0px"),R=Hw(["strokeDasharray"],d,c);return h.createElement(fu,{animationId:w,key:w,canBegin:m>0,duration:d,easing:c,isActive:f,begin:u},q=>{var Z=De(N,i,q),E=De(P,s,q),D=De(_,o,q),O=De(T,r,q),k=De($,n,q);p.current&&(g.current=Z,b.current=E,v.current=D,j.current=O,y.current=k);var L=q>0?{transition:R,strokeDasharray:C}:{strokeDasharray:M};return h.createElement("path",mc({},ut(t),{className:S,d:tv(O,k,Z,E,D),ref:p,style:ev(ev({},L),t.style)}))})},M8=["option","shapeType","propTransformer","activeClassName","isActive"];function I8(e,t){if(e==null)return{};var r,n,i=$8(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function $8(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function rv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rv(Object(r),!0).forEach(function(n){L8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function L8(e,t,r){return(t=z8(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function z8(e){var t=R8(e,"string");return typeof t=="symbol"?t:t+""}function R8(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function B8(e,t){return gc(gc({},t),e)}function F8(e,t){return e==="symbols"}function nv(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return h.createElement(Gw,r);case"trapezoid":return h.createElement(T8,r);case"sector":return h.createElement(Jw,r);case"symbols":if(F8(t))return h.createElement(Oj,r);break;case"curve":return h.createElement(us,r);default:return null}}function W8(e){return h.isValidElement(e)?e.props:e}function U8(e){var{option:t,shapeType:r,propTransformer:n=B8,activeClassName:i="recharts-active-shape",isActive:s}=e,o=I8(e,M8),l;if(h.isValidElement(t))l=h.cloneElement(t,gc(gc({},o),W8(t)));else if(typeof t=="function")l=t(o);else if(C8(t)&&typeof t!="boolean"){var c=n(t,o);l=h.createElement(nv,{shapeType:r,elementProps:c})}else{var d=o;l=h.createElement(nv,{shapeType:r,elementProps:d})}return s?h.createElement(ir,{className:i},l):l}function zN(e){var{fn:t,args:r}=e,n=Ve(),i=pt();return h.useLayoutEffect(()=>{if(!i){var s=t(r);return n(PI(s)),()=>{n(_I(s))}}},[t,r,n,i]),null}function RN(e){var{legendPayload:t}=e,r=Ve(),n=pt();return h.useLayoutEffect(()=>n?ka:(r(c3(t)),()=>{r(u3(t))}),[r,n,t]),null}var kd,q8=()=>{var[e]=h.useState(()=>Ts("uid-"));return e},H8=(kd=Tv.useId)!==null&&kd!==void 0?kd:q8;function BN(e,t){var r=H8();return t||(e?"".concat(e,"-").concat(r):r)}var K8=h.createContext(void 0),FN=e=>{var{id:t,type:r,children:n}=e,i=BN("recharts-".concat(r),t);return h.createElement(K8.Provider,{value:i},n(i))},V8={cartesianItems:[],polarItems:[]},WN=At({name:"graphicalItems",initialState:V8,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Le()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,i=Kr(e).cartesianItems.indexOf(r);i>-1&&(e.cartesianItems[i]=n)},prepare:Le()},removeCartesianGraphicalItem:{reducer(e,t){var r=Kr(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:Le()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Le()},removePolarGraphicalItem:{reducer(e,t){var r=Kr(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:Le()}}}),{addCartesianGraphicalItem:Y8,replaceCartesianGraphicalItem:G8,removeCartesianGraphicalItem:Z8,addPolarGraphicalItem:$7,removePolarGraphicalItem:L7}=WN.actions,X8=WN.reducer;function UN(e){var t=Ve(),r=h.useRef(null);return h.useLayoutEffect(()=>{r.current===null?t(Y8(e)):r.current!==e&&t(G8({prev:r.current,next:e})),r.current=e},[t,e]),h.useLayoutEffect(()=>()=>{r.current&&(t(Z8(r.current)),r.current=null)},[t]),null}var J8=["points"];function iv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iv(Object(r),!0).forEach(function(n){Q8(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Q8(e,t,r){return(t=ez(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ez(e){var t=tz(e,"string");return typeof t=="symbol"?t:t+""}function tz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xc(){return xc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xc.apply(null,arguments)}function rz(e,t){if(e==null)return{};var r,n,i=nz(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function nz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function iz(e){var{option:t,dotProps:r,className:n}=e;if(h.isValidElement(t))return h.cloneElement(t,r);if(typeof t=="function")return t(r);var i=ce(n,typeof t!="boolean"?t.className:""),s=r??{},{points:o}=s,l=rz(s,J8);return h.createElement(IN,xc({},l,{className:i}))}function az(e,t){return e==null?!1:t?!0:e.length===1}function qN(e){var{points:t,dot:r,className:n,dotClassName:i,dataKey:s,baseProps:o,needClip:l,clipPathId:c,zIndex:d=lt.scatter}=e;if(!az(t,r))return null;var u=eg(r),f=JO(r),p=t.map((x,g)=>{var b,v,j=Pd(Pd(Pd({r:3},o),f),{},{index:g,cx:(b=x.x)!==null&&b!==void 0?b:void 0,cy:(v=x.y)!==null&&v!==void 0?v:void 0,dataKey:s,value:x.value,payload:x.payload,points:t});return h.createElement(iz,{key:"dot-".concat(g),option:r,dotProps:j,className:i})}),m={};return l&&c!=null&&(m.clipPath="url(#clipPath-".concat(u?"":"dots-").concat(c,")")),h.createElement(Ir,{zIndex:d},h.createElement(ir,xc({className:n},m),p))}function av(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sv(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?av(Object(r),!0).forEach(function(n){sz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):av(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sz(e,t,r){return(t=oz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oz(e){var t=lz(e,"string");return typeof t=="symbol"?t:t+""}function lz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cz={xAxis:{},yAxis:{},zAxis:{}},HN=At({name:"cartesianAxis",initialState:cz,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:Le()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:Le()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:Le()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:Le()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:Le()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:Le()},updateYAxisWidth(e,t){var{id:r,width:n}=t.payload,i=e.yAxis[r];if(i){var s=i.widthHistory||[];if(s.length===3&&s[0]===s[2]&&n===s[1]&&n!==i.width&&Math.abs(n-s[0])<=1)return;var o=[...s,n].slice(-3);e.yAxis[r]=sv(sv({},e.yAxis[r]),{},{width:n,widthHistory:o})}}}}),{addXAxis:uz,removeXAxis:dz,addYAxis:fz,removeYAxis:pz,addZAxis:z7,removeZAxis:R7,updateYAxisWidth:hz}=HN.actions,mz=HN.reducer,gz=I([rt],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),xz=I([gz,ln,cn],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Mu=()=>G(xz),yz=()=>G(g$);function ov(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _d(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ov(Object(r),!0).forEach(function(n){vz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ov(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vz(e,t,r){return(t=bz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bz(e){var t=jz(e,"string");return typeof t=="symbol"?t:t+""}function jz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wz=e=>{var{point:t,childIndex:r,mainColor:n,activeDot:i,dataKey:s}=e;if(i===!1||t.x==null||t.y==null)return null;var o={index:r,dataKey:s,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},l=_d(_d(_d({},o),qc(i)),Ih(i)),c;return h.isValidElement(i)?c=h.cloneElement(i,l):typeof i=="function"?c=i(l):c=h.createElement(IN,l),h.createElement(ir,{className:"recharts-active-dot"},c)};function xp(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:i,zIndex:s=lt.activeDot}=e,o=G(Us),l=yz();if(t==null||l==null)return null;var c=t.find(d=>l.includes(d.payload));return Re(c)?null:h.createElement(Ir,{zIndex:s},h.createElement(wz,{point:c,childIndex:Number(o),mainColor:r,dataKey:i,activeDot:n}))}var Sz={},KN=At({name:"errorBars",initialState:Sz,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:i}=t.payload;e[r]&&(e[r]=e[r].map(s=>s.dataKey===n.dataKey&&s.direction===n.direction?i:s))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(i=>i.dataKey!==n.dataKey||i.direction!==n.direction))}}}),{addErrorBar:B7,replaceErrorBar:F7,removeErrorBar:W7}=KN.actions,Nz=KN.reducer,kz=["children"];function Pz(e,t){if(e==null)return{};var r,n,i=_z(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function _z(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Cz={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Az=h.createContext(Cz);function Oz(e){var{children:t}=e,r=Pz(e,kz);return h.createElement(Az.Provider,{value:r},t)}function tg(e,t){var r,n,i=G(d=>dn(d,e)),s=G(d=>fn(d,t)),o=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:Tt.allowDataOverflow,l=(n=s==null?void 0:s.allowDataOverflow)!==null&&n!==void 0?n:Mt.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function VN(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,i=Mu(),{needClipX:s,needClipY:o,needClip:l}=tg(t,r);if(!l||!i)return null;var{x:c,y:d,width:u,height:f}=i;return h.createElement("clipPath",{id:"clipPath-".concat(n)},h.createElement("rect",{x:s?c:c-u/2,y:o?d:d-f/2,width:s?u:u*2,height:o?f:f*2}))}var Ez=e=>{var{chartData:t}=e,r=Ve(),n=pt();return h.useEffect(()=>n?()=>{}:(r(Iy(t)),()=>{r(Iy(void 0))}),[t,r,n]),null},lv={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},YN=At({name:"brush",initialState:lv,reducers:{setBrushSettings(e,t){return t.payload==null?lv:t.payload}}}),{setBrushSettings:U7}=YN.actions,Dz=YN.reducer;function Tz(e,t,r){return(t=Mz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mz(e){var t=Iz(e,"string");return typeof t=="symbol"?t:t+""}function Iz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class rg{static create(t){return new rg(t)}constructor(t){this.scale=t}get domain(){return this.scale.domain}get range(){return this.scale.range}get rangeMin(){return this.range()[0]}get rangeMax(){return this.range()[1]}get bandwidth(){return this.scale.bandwidth}apply(t){var{bandAware:r,position:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t!==void 0){if(n)switch(n){case"start":return this.scale(t);case"middle":{var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+i}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(t)+s}default:return this.scale(t)}if(r){var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(t)+o}return this.scale(t)}}isInRange(t){var r=this.range(),n=r[0],i=r[r.length-1];return n<=i?t>=n&&t<=i:t>=i&&t<=n}}Tz(rg,"EPS",1e-4);function $z(e){return(e%180+180)%180}var Lz=function(t){var{width:r,height:n}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=$z(i),o=s*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},zz={dots:[],areas:[],lines:[]},GN=At({name:"referenceElements",initialState:zz,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Kr(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=Kr(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=Kr(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:q7,removeDot:H7,addArea:K7,removeArea:V7,addLine:Y7,removeLine:G7}=GN.actions,Rz=GN.reducer,Bz=h.createContext(void 0),Fz=e=>{var{children:t}=e,[r]=h.useState("".concat(Ts("recharts"),"-clip")),n=Mu();if(n==null)return null;var{x:i,y:s,width:o,height:l}=n;return h.createElement(Bz.Provider,{value:r},h.createElement("defs",null,h.createElement("clipPath",{id:r},h.createElement("rect",{x:i,y:s,height:l,width:o}))),t)};function ya(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function ZN(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;n<e.length;n+=t)r.push(e[n]);return r}function Wz(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return Lz(n,r)}function Uz(e,t,r){var n=r==="width",{x:i,y:s,width:o,height:l}=e;return t===1?{start:n?i:s,end:n?i+o:s+l}:{start:n?i+o:s+l,end:n?i:s}}function yc(e,t,r,n,i){if(e*t<e*n||e*t>e*i)return!1;var s=r();return e*(t-e*s/2-n)>=0&&e*(t+e*s/2-i)<=0}function qz(e,t){return ZN(e,t+1)}function Hz(e,t,r,n,i){for(var s=(n||[]).slice(),{start:o,end:l}=t,c=0,d=1,u=o,f=function(){var x=n==null?void 0:n[c];if(x===void 0)return{v:ZN(n,d)};var g=c,b,v=()=>(b===void 0&&(b=r(x,g)),b),j=x.coordinate,y=c===0||yc(e,j,v,u,l);y||(c=0,u=o,d+=1),y&&(u=j+e*(v()/2+i),c+=d)},p;d<=s.length;)if(p=f(),p)return p.v;return[]}function cv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function at(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cv(Object(r),!0).forEach(function(n){Kz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kz(e,t,r){return(t=Vz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vz(e){var t=Yz(e,"string");return typeof t=="symbol"?t:t+""}function Yz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Gz(e,t,r,n,i){for(var s=(n||[]).slice(),o=s.length,{start:l}=t,{end:c}=t,d=function(p){var m=s[p],x,g=()=>(x===void 0&&(x=r(m,p)),x);if(p===o-1){var b=e*(m.coordinate+e*g()/2-c);s[p]=m=at(at({},m),{},{tickCoord:b>0?m.coordinate-b*e:m.coordinate})}else s[p]=m=at(at({},m),{},{tickCoord:m.coordinate});if(m.tickCoord!=null){var v=yc(e,m.tickCoord,g,l,c);v&&(c=m.tickCoord-e*(g()/2+i),s[p]=at(at({},m),{},{isShow:!0}))}},u=o-1;u>=0;u--)d(u);return s}function Zz(e,t,r,n,i,s){var o=(n||[]).slice(),l=o.length,{start:c,end:d}=t;if(s){var u=n[l-1],f=r(u,l-1),p=e*(u.coordinate+e*f/2-d);if(o[l-1]=u=at(at({},u),{},{tickCoord:p>0?u.coordinate-p*e:u.coordinate}),u.tickCoord!=null){var m=yc(e,u.tickCoord,()=>f,c,d);m&&(d=u.tickCoord-e*(f/2+i),o[l-1]=at(at({},u),{},{isShow:!0}))}}for(var x=s?l-1:l,g=function(j){var y=o[j],w,S=()=>(w===void 0&&(w=r(y,j)),w);if(j===0){var N=e*(y.coordinate-e*S()/2-c);o[j]=y=at(at({},y),{},{tickCoord:N<0?y.coordinate-N*e:y.coordinate})}else o[j]=y=at(at({},y),{},{tickCoord:y.coordinate});if(y.tickCoord!=null){var P=yc(e,y.tickCoord,S,c,d);P&&(c=y.tickCoord+e*(S()/2+i),o[j]=at(at({},y),{},{isShow:!0}))}},b=0;b<x;b++)g(b);return o}function ng(e,t,r){var{tick:n,ticks:i,viewBox:s,minTickGap:o,orientation:l,interval:c,tickFormatter:d,unit:u,angle:f}=e;if(!i||!i.length||!n)return[];if(Y(c)||Ci.isSsr){var p;return(p=qz(i,Y(c)?c:0))!==null&&p!==void 0?p:[]}var m=[],x=l==="top"||l==="bottom"?"width":"height",g=u&&x==="width"?ds(u,{fontSize:t,letterSpacing:r}):{width:0,height:0},b=(y,w)=>{var S=typeof d=="function"?d(y.value,w):y.value;return x==="width"?Wz(ds(S,{fontSize:t,letterSpacing:r}),g,f):ds(S,{fontSize:t,letterSpacing:r})[x]},v=i.length>=2?Jt(i[1].coordinate-i[0].coordinate):1,j=Uz(s,v,x);return c==="equidistantPreserveStart"?Hz(v,j,b,i,o):(c==="preserveStart"||c==="preserveStartEnd"?m=Zz(v,j,b,i,o,c==="preserveStartEnd"):m=Gz(v,j,b,i,o),m.filter(y=>y.isShow))}var Xz=e=>{var{ticks:t,label:r,labelGapWithTick:n=5,tickSize:i=0,tickMargin:s=0}=e,o=0;if(t){Array.from(t).forEach(u=>{if(u){var f=u.getBoundingClientRect();f.width>o&&(o=f.width)}});var l=r?r.getBoundingClientRect().width:0,c=i+s,d=o+c+l+(r?n:0);return Math.round(d)}return 0},Jz=["axisLine","width","height","className","hide","ticks","axisType"],Qz=["viewBox"],eR=["viewBox"];function yp(e,t){if(e==null)return{};var r,n,i=tR(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function tR(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Si.apply(null,arguments)}function uv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ee(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?uv(Object(r),!0).forEach(function(n){rR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rR(e,t,r){return(t=nR(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nR(e){var t=iR(e,"string");return typeof t=="symbol"?t:t+""}function iR(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ig={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:lt.axis};function aR(e){var{x:t,y:r,width:n,height:i,orientation:s,mirror:o,axisLine:l,otherSvgProps:c}=e;if(!l)return null;var d=Ee(Ee(Ee({},c),nr(l)),{},{fill:"none"});if(s==="top"||s==="bottom"){var u=+(s==="top"&&!o||s==="bottom"&&o);d=Ee(Ee({},d),{},{x1:t,y1:r+u*i,x2:t+n,y2:r+u*i})}else{var f=+(s==="left"&&!o||s==="right"&&o);d=Ee(Ee({},d),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+i})}return h.createElement("line",Si({},d,{className:ce("recharts-cartesian-axis-line",Xc(l,"className"))}))}function sR(e,t,r,n,i,s,o,l,c){var d,u,f,p,m,x,g=l?-1:1,b=e.tickSize||o,v=Y(e.tickCoord)?e.tickCoord:e.coordinate;switch(s){case"top":d=u=e.coordinate,p=r+ +!l*i,f=p-g*b,x=f-g*c,m=v;break;case"left":f=p=e.coordinate,u=t+ +!l*n,d=u-g*b,m=d-g*c,x=v;break;case"right":f=p=e.coordinate,u=t+ +l*n,d=u+g*b,m=d+g*c,x=v;break;default:d=u=e.coordinate,p=r+ +l*i,f=p+g*b,x=f+g*c,m=v;break}return{line:{x1:d,y1:f,x2:u,y2:p},tick:{x:m,y:x}}}function oR(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function lR(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function cR(e){var{option:t,tickProps:r,value:n}=e,i,s=ce(r.className,"recharts-cartesian-axis-tick-value");if(h.isValidElement(t))i=h.cloneElement(t,Ee(Ee({},r),{},{className:s}));else if(typeof t=="function")i=t(Ee(Ee({},r),{},{className:s}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=ce(o,t==null?void 0:t.className)),i=h.createElement(Jm,Si({},r,{className:o}),n)}return i}var uR=h.forwardRef((e,t)=>{var{ticks:r=[],tick:n,tickLine:i,stroke:s,tickFormatter:o,unit:l,padding:c,tickTextProps:d,orientation:u,mirror:f,x:p,y:m,width:x,height:g,tickSize:b,tickMargin:v,fontSize:j,letterSpacing:y,getTicksConfig:w,events:S,axisType:N}=e,P=ng(Ee(Ee({},w),{},{ticks:r}),j,y),_=oR(u,f),T=lR(u,f),$=nr(w),M=qc(n),C={};typeof i=="object"&&(C=i);var R=Ee(Ee({},$),{},{fill:"none"},C),q=P.map(D=>Ee({entry:D},sR(D,p,m,x,g,u,b,f,v))),Z=q.map(D=>{var{entry:O,line:k}=D;return h.createElement(ir,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(O.value,"-").concat(O.coordinate,"-").concat(O.tickCoord)},i&&h.createElement("line",Si({},R,k,{className:ce("recharts-cartesian-axis-tick-line",Xc(i,"className"))})))}),E=q.map((D,O)=>{var{entry:k,tick:L}=D,U=Ee(Ee(Ee(Ee({textAnchor:_,verticalAnchor:T},$),{},{stroke:"none",fill:s},M),L),{},{index:O,payload:k,visibleTicksCount:P.length,tickFormatter:o,padding:c},d);return h.createElement(ir,Si({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(k.value,"-").concat(k.coordinate,"-").concat(k.tickCoord)},Q6(S,k,O)),n&&h.createElement(cR,{option:n,tickProps:U,value:"".concat(typeof o=="function"?o(k.value,O):k.value).concat(l||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(N,"-ticks")},E.length>0&&h.createElement(Ir,{zIndex:lt.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(N,"-tick-labels"),ref:t},E)),Z.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(N,"-tick-lines")},Z))}),dR=h.forwardRef((e,t)=>{var{axisLine:r,width:n,height:i,className:s,hide:o,ticks:l,axisType:c}=e,d=yp(e,Jz),[u,f]=h.useState(""),[p,m]=h.useState(""),x=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var b;return Xz({ticks:x.current,label:(b=e.labelRef)===null||b===void 0?void 0:b.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var g=h.useCallback(b=>{if(b){var v=b.getElementsByClassName("recharts-cartesian-axis-tick-value");x.current=v;var j=v[0];if(j){var y=window.getComputedStyle(j),w=y.fontSize,S=y.letterSpacing;(w!==u||S!==p)&&(f(w),m(S))}}},[u,p]);return o||n!=null&&n<=0||i!=null&&i<=0?null:h.createElement(Ir,{zIndex:e.zIndex},h.createElement(ir,{className:ce("recharts-cartesian-axis",s)},h.createElement(aR,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:nr(e)}),h.createElement(uR,{ref:g,axisType:c,events:d,fontSize:u,getTicksConfig:e,height:e.height,letterSpacing:p,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:l,unit:e.unit,width:e.width,x:e.x,y:e.y}),h.createElement(s8,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement(g8,{label:e.label,labelRef:e.labelRef}),e.children)))}),fR=h.memo(dR,(e,t)=>{var{viewBox:r}=e,n=yp(e,Qz),{viewBox:i}=t,s=yp(t,eR);return ya(r,i)&&ya(n,s)}),ag=h.forwardRef((e,t)=>{var r=ft(e,ig);return h.createElement(fR,Si({},r,{ref:t}))});ag.displayName="CartesianAxis";var pR=["x1","y1","x2","y2","key"],hR=["offset"],mR=["xAxisId","yAxisId"],gR=["xAxisId","yAxisId"];function dv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ot(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dv(Object(r),!0).forEach(function(n){xR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xR(e,t,r){return(t=yR(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yR(e){var t=vR(e,"string");return typeof t=="symbol"?t:t+""}function vR(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ai(){return ai=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ai.apply(null,arguments)}function vc(e,t){if(e==null)return{};var r,n,i=bR(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function bR(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var jR=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:r,x:n,y:i,width:s,height:o,ry:l}=e;return h.createElement("rect",{x:n,y:i,ry:l,width:s,height:o,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function XN(e){var{option:t,lineItemProps:r}=e,n;if(h.isValidElement(t))n=h.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var i,{x1:s,y1:o,x2:l,y2:c,key:d}=r,u=vc(r,pR),f=(i=nr(u))!==null&&i!==void 0?i:{},{offset:p}=f,m=vc(f,hR);n=h.createElement("line",ai({},m,{x1:s,y1:o,x2:l,y2:c,fill:"none",key:d}))}return n}function wR(e){var{x:t,width:r,horizontal:n=!0,horizontalPoints:i}=e;if(!n||!i||!i.length)return null;var{xAxisId:s,yAxisId:o}=e,l=vc(e,mR),c=i.map((d,u)=>{var f=ot(ot({},l),{},{x1:t,y1:d,x2:t+r,y2:d,key:"line-".concat(u),index:u});return h.createElement(XN,{key:"line-".concat(u),option:n,lineItemProps:f})});return h.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function SR(e){var{y:t,height:r,vertical:n=!0,verticalPoints:i}=e;if(!n||!i||!i.length)return null;var{xAxisId:s,yAxisId:o}=e,l=vc(e,gR),c=i.map((d,u)=>{var f=ot(ot({},l),{},{x1:d,y1:t,x2:d,y2:t+r,key:"line-".concat(u),index:u});return h.createElement(XN,{option:n,lineItemProps:f,key:"line-".concat(u)})});return h.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function NR(e){var{horizontalFill:t,fillOpacity:r,x:n,y:i,width:s,height:o,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var d=l.map(f=>Math.round(f+i-i)).sort((f,p)=>f-p);i!==d[0]&&d.unshift(0);var u=d.map((f,p)=>{var m=!d[p+1],x=m?i+o-f:d[p+1]-f;if(x<=0)return null;var g=p%t.length;return h.createElement("rect",{key:"react-".concat(p),y:f,x:n,height:x,width:s,stroke:"none",fill:t[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},u)}function kR(e){var{vertical:t=!0,verticalFill:r,fillOpacity:n,x:i,y:s,width:o,height:l,verticalPoints:c}=e;if(!t||!r||!r.length)return null;var d=c.map(f=>Math.round(f+i-i)).sort((f,p)=>f-p);i!==d[0]&&d.unshift(0);var u=d.map((f,p)=>{var m=!d[p+1],x=m?i+o-f:d[p+1]-f;if(x<=0)return null;var g=p%r.length;return h.createElement("rect",{key:"react-".concat(p),x:f,y:s,width:x,height:l,stroke:"none",fill:r[g],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},u)}var PR=(e,t)=>{var{xAxis:r,width:n,height:i,offset:s}=e;return Aw(ng(ot(ot(ot({},ig),r),{},{ticks:Ow(r),viewBox:{x:0,y:0,width:n,height:i}})),s.left,s.left+s.width,t)},_R=(e,t)=>{var{yAxis:r,width:n,height:i,offset:s}=e;return Aw(ng(ot(ot(ot({},ig),r),{},{ticks:Ow(r),viewBox:{x:0,y:0,width:n,height:i}})),s.top,s.top+s.height,t)},CR={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:lt.grid};function vp(e){var t=Fw(),r=Ww(),n=Bw(),i=ot(ot({},ft(e,CR)),{},{x:Y(e.x)?e.x:n.left,y:Y(e.y)?e.y:n.top,width:Y(e.width)?e.width:n.width,height:Y(e.height)?e.height:n.height}),{xAxisId:s,yAxisId:o,x:l,y:c,width:d,height:u,syncWithTicks:f,horizontalValues:p,verticalValues:m}=i,x=pt(),g=G(T=>Ny(T,"xAxis",s,x)),b=G(T=>Ny(T,"yAxis",o,x));if(!Er(d)||!Er(u)||!Y(l)||!Y(c))return null;var v=i.verticalCoordinatesGenerator||PR,j=i.horizontalCoordinatesGenerator||_R,{horizontalPoints:y,verticalPoints:w}=i;if((!y||!y.length)&&typeof j=="function"){var S=p&&p.length,N=j({yAxis:b?ot(ot({},b),{},{ticks:S?p:b.ticks}):void 0,width:t??d,height:r??u,offset:n},S?!0:f);Gl(Array.isArray(N),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof N,"]")),Array.isArray(N)&&(y=N)}if((!w||!w.length)&&typeof v=="function"){var P=m&&m.length,_=v({xAxis:g?ot(ot({},g),{},{ticks:P?m:g.ticks}):void 0,width:t??d,height:r??u,offset:n},P?!0:f);Gl(Array.isArray(_),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof _,"]")),Array.isArray(_)&&(w=_)}return h.createElement(Ir,{zIndex:i.zIndex},h.createElement("g",{className:"recharts-cartesian-grid"},h.createElement(jR,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),h.createElement(NR,ai({},i,{horizontalPoints:y})),h.createElement(kR,ai({},i,{verticalPoints:w})),h.createElement(wR,ai({},i,{offset:n,horizontalPoints:y,xAxis:g,yAxis:b})),h.createElement(SR,ai({},i,{offset:n,verticalPoints:w,xAxis:g,yAxis:b}))))}vp.displayName="CartesianGrid";var JN=(e,t,r,n)=>Du(e,"xAxis",t,n),QN=(e,t,r,n)=>Eu(e,"xAxis",t,n),ek=(e,t,r,n)=>Du(e,"yAxis",r,n),tk=(e,t,r,n)=>Eu(e,"yAxis",r,n),AR=I([ue,JN,ek,QN,tk],(e,t,r,n,i)=>Mr(e,"xAxis")?ha(t,n,!1):ha(r,i,!1)),OR=(e,t,r,n,i)=>i;function ER(e){return e.type==="line"}var DR=I([Mm,OR],(e,t)=>e.filter(ER).find(r=>r.id===t)),TR=I([ue,JN,ek,QN,tk,DR,AR,bu],(e,t,r,n,i,s,o,l)=>{var{chartData:c,dataStartIndex:d,dataEndIndex:u}=l;if(!(s==null||t==null||r==null||n==null||i==null||n.length===0||i.length===0||o==null)){var{dataKey:f,data:p}=s,m;if(p!=null&&p.length>0?m=p:m=c==null?void 0:c.slice(d,u+1),m!=null)return QR({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataKey:f,bandSize:o,displayedData:m})}});function rk(e){var t=qc(e),r=3,n=2;if(t!=null){var{r:i,strokeWidth:s}=t,o=Number(i),l=Number(s);return(Number.isNaN(o)||o<0)&&(o=r),(Number.isNaN(l)||l<0)&&(l=n),{r:o,strokeWidth:l}}return{r,strokeWidth:n}}var MR=["id"],IR=["type","layout","connectNulls","needClip","shape"],$R=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Hs(){return Hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hs.apply(null,arguments)}function fv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fv(Object(r),!0).forEach(function(n){LR(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function LR(e,t,r){return(t=zR(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zR(e){var t=RR(e,"string");return typeof t=="symbol"?t:t+""}function RR(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sg(e,t){if(e==null)return{};var r,n,i=BR(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function BR(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var FR=e=>{var{dataKey:t,name:r,stroke:n,legendType:i,hide:s}=e;return[{inactive:s,dataKey:t,type:i,color:n,value:au(r,t),payload:e}]};function WR(e){var{dataKey:t,data:r,stroke:n,strokeWidth:i,fill:s,name:o,hide:l,unit:c}=e;return{dataDefinedOnItem:r,positions:void 0,settings:{stroke:n,strokeWidth:i,fill:s,dataKey:t,nameKey:void 0,name:au(o,t),hide:l,type:e.tooltipType,color:e.stroke,unit:c}}}var nk=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function UR(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],i=0;i<t;++i)n=[...n,...r];return n}var qR=(e,t,r)=>{var n=r.reduce((f,p)=>f+p);if(!n)return nk(t,e);for(var i=Math.floor(e/n),s=e%n,o=t-e,l=[],c=0,d=0;c<r.length;d+=r[c],++c)if(d+r[c]>s){l=[...r.slice(0,c),s-d];break}var u=l.length%2===0?[0,o]:[o];return[...UR(r,i),...l,...u].map(f=>"".concat(f,"px")).join(", ")};function HR(e){var{clipPathId:t,points:r,props:n}=e,{dot:i,dataKey:s,needClip:o}=n,{id:l}=n,c=sg(n,MR),d=nr(c);return h.createElement(qN,{points:r,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:s,baseProps:d,needClip:o,clipPathId:t})}function KR(e){var{showLabels:t,children:r,points:n}=e,i=h.useMemo(()=>n==null?void 0:n.map(s=>{var o,l,c={x:(o=s.x)!==null&&o!==void 0?o:0,y:(l=s.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return wr(wr({},c),{},{value:s.value,payload:s.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[n]);return h.createElement(DN,{value:t?i:void 0},r)}function pv(e){var{clipPathId:t,pathRef:r,points:n,strokeDasharray:i,props:s}=e,{type:o,layout:l,connectNulls:c,needClip:d,shape:u}=s,f=sg(s,IR),p=wr(wr({},ut(f)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(t,")"):void 0,points:n,type:o,layout:l,connectNulls:c,strokeDasharray:i??s.strokeDasharray});return h.createElement(h.Fragment,null,(n==null?void 0:n.length)>1&&h.createElement(U8,Hs({shapeType:"curve",option:u},p,{pathRef:r})),h.createElement(HR,{points:n,clipPathId:t,props:s}))}function VR(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function YR(e){var{clipPathId:t,props:r,pathRef:n,previousPointsRef:i,longestAnimatedLengthRef:s}=e,{points:o,strokeDasharray:l,isAnimationActive:c,animationBegin:d,animationDuration:u,animationEasing:f,animateNewValues:p,width:m,height:x,onAnimationEnd:g,onAnimationStart:b}=r,v=i.current,j=pu(r,"recharts-line-"),[y,w]=h.useState(!1),S=!y,N=h.useCallback(()=>{typeof g=="function"&&g(),w(!1)},[g]),P=h.useCallback(()=>{typeof b=="function"&&b(),w(!0)},[b]),_=VR(n.current),T=s.current;return h.createElement(KR,{points:o,showLabels:S},r.children,h.createElement(fu,{animationId:j,begin:d,duration:u,isActive:c,easing:f,onAnimationEnd:N,onAnimationStart:P,key:j},$=>{var M=De(T,_+T,$),C=Math.min(M,_),R;if(c)if(l){var q="".concat(l).split(/[,\s]+/gim).map(D=>parseFloat(D));R=qR(C,_,q)}else R=nk(_,C);else R=l==null?void 0:String(l);if(v){var Z=v.length/o.length,E=$===1?o:o.map((D,O)=>{var k=Math.floor(O*Z);if(v[k]){var L=v[k];return wr(wr({},D),{},{x:De(L.x,D.x,$),y:De(L.y,D.y,$)})}return p?wr(wr({},D),{},{x:De(m*2,D.x,$),y:De(x/2,D.y,$)}):wr(wr({},D),{},{x:D.x,y:D.y})});return i.current=E,h.createElement(pv,{props:r,points:E,clipPathId:t,pathRef:n,strokeDasharray:R})}return $>0&&_>0&&(i.current=o,s.current=C),h.createElement(pv,{props:r,points:o,clipPathId:t,pathRef:n,strokeDasharray:R})}),h.createElement(MN,{label:r.label}))}function GR(e){var{clipPathId:t,props:r}=e,n=h.useRef(null),i=h.useRef(0),s=h.useRef(null);return h.createElement(YR,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:i,pathRef:s})}var ZR=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:et(e.payload,t)}};class XR extends h.Component{render(){var{hide:t,dot:r,points:n,className:i,xAxisId:s,yAxisId:o,top:l,left:c,width:d,height:u,id:f,needClip:p,zIndex:m}=this.props;if(t)return null;var x=ce("recharts-line",i),g=f,{r:b,strokeWidth:v}=rk(r),j=eg(r),y=b*2+v;return h.createElement(Ir,{zIndex:m},h.createElement(ir,{className:x},p&&h.createElement("defs",null,h.createElement(VN,{clipPathId:g,xAxisId:s,yAxisId:o}),!j&&h.createElement("clipPath",{id:"clipPath-dots-".concat(g)},h.createElement("rect",{x:c-y/2,y:l-y/2,width:d+y,height:u+y}))),h.createElement(Oz,{xAxisId:s,yAxisId:o,data:n,dataPointFormatter:ZR,errorBarOffset:0},h.createElement(GR,{props:this.props,clipPathId:g}))),h.createElement(xp,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey}))}}var ik={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:!Ci.isSsr,label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:lt.line};function JR(e){var t=ft(e,ik),{activeDot:r,animateNewValues:n,animationBegin:i,animationDuration:s,animationEasing:o,connectNulls:l,dot:c,hide:d,isAnimationActive:u,label:f,legendType:p,xAxisId:m,yAxisId:x,id:g}=t,b=sg(t,$R),{needClip:v}=tg(m,x),j=Mu(),y=to(),w=pt(),S=G($=>TR($,m,x,w,g));if(y!=="horizontal"&&y!=="vertical"||S==null||j==null)return null;var{height:N,width:P,x:_,y:T}=j;return h.createElement(XR,Hs({},b,{id:g,connectNulls:l,dot:c,activeDot:r,animateNewValues:n,animationBegin:i,animationDuration:s,animationEasing:o,isAnimationActive:u,hide:d,label:f,legendType:p,xAxisId:m,yAxisId:x,points:S,layout:y,height:N,width:P,left:_,top:T,needClip:v}))}function QR(e){var{layout:t,xAxis:r,yAxis:n,xAxisTicks:i,yAxisTicks:s,dataKey:o,bandSize:l,displayedData:c}=e;return c.map((d,u)=>{var f=et(d,o);if(t==="horizontal"){var p=Yl({axis:r,ticks:i,bandSize:l,entry:d,index:u}),m=Re(f)?null:n.scale(f);return{x:p,y:m,value:f,payload:d}}var x=Re(f)?null:r.scale(f),g=Yl({axis:n,ticks:s,bandSize:l,entry:d,index:u});return x==null||g==null?null:{x,y:g,value:f,payload:d}}).filter(Boolean)}function e9(e){var t=ft(e,ik),r=pt();return h.createElement(FN,{id:t.id,type:"line"},n=>h.createElement(h.Fragment,null,h.createElement(RN,{legendPayload:FR(t)}),h.createElement(zN,{fn:WR,args:t}),h.createElement(UN,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),h.createElement(JR,Hs({},t,{id:n}))))}var ak=h.memo(e9);ak.displayName="Line";var sk=(e,t,r,n)=>Du(e,"xAxis",t,n),ok=(e,t,r,n)=>Eu(e,"xAxis",t,n),lk=(e,t,r,n)=>Du(e,"yAxis",r,n),ck=(e,t,r,n)=>Eu(e,"yAxis",r,n),t9=I([ue,sk,lk,ok,ck],(e,t,r,n,i)=>Mr(e,"xAxis")?ha(t,n,!1):ha(r,i,!1)),r9=(e,t,r,n,i)=>i,uk=I([Mm,r9],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),n9=(e,t,r,n,i)=>{var s,o=uk(e,t,r,n,i);if(o!=null){var l=ue(e),c=Mr(l,"xAxis"),d;if(c?d=cp(e,"yAxis",r,n):d=cp(e,"xAxis",t,n),d!=null){var{stackId:u}=o,f=Em(o);if(!(u==null||f==null)){var p=(s=d[u])===null||s===void 0?void 0:s.stackedData;return p==null?void 0:p.find(m=>m.key===f)}}}},i9=I([ue,sk,lk,ok,ck,n9,bu,t9,uk,xM],(e,t,r,n,i,s,o,l,c,d)=>{var{chartData:u,dataStartIndex:f,dataEndIndex:p}=o;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||i==null||n.length===0||i.length===0||l==null)){var{data:m}=c,x;if(m&&m.length>0?x=m:x=u==null?void 0:u.slice(f,p+1),x!=null)return S9({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:s,displayedData:x,chartBaseValue:d,bandSize:l})}}),a9=["id"],s9=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function fi(){return fi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fi.apply(null,arguments)}function dk(e,t){if(e==null)return{};var r,n,i=o9(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function o9(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function hv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zi(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hv(Object(r),!0).forEach(function(n){l9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function l9(e,t,r){return(t=c9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c9(e){var t=u9(e,"string");return typeof t=="symbol"?t:t+""}function u9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bc(e,t){return e&&e!=="none"?e:t}var d9=e=>{var{dataKey:t,name:r,stroke:n,fill:i,legendType:s,hide:o}=e;return[{inactive:o,dataKey:t,type:s,color:bc(n,i),value:au(r,t),payload:e}]};function f9(e){var{dataKey:t,data:r,stroke:n,strokeWidth:i,fill:s,name:o,hide:l,unit:c}=e;return{dataDefinedOnItem:r,positions:void 0,settings:{stroke:n,strokeWidth:i,fill:s,dataKey:t,nameKey:void 0,name:au(o,t),hide:l,type:e.tooltipType,color:bc(n,s),unit:c}}}function p9(e){var{clipPathId:t,points:r,props:n}=e,{needClip:i,dot:s,dataKey:o}=n,l=nr(n);return h.createElement(qN,{points:r,dot:s,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:l,needClip:i,clipPathId:t})}function h9(e){var{showLabels:t,children:r,points:n}=e,i=n.map(s=>{var o,l,c={x:(o=s.x)!==null&&o!==void 0?o:0,y:(l=s.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Zi(Zi({},c),{},{value:s.value,payload:s.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return h.createElement(DN,{value:t?i:void 0},r)}function mv(e){var{points:t,baseLine:r,needClip:n,clipPathId:i,props:s}=e,{layout:o,type:l,stroke:c,connectNulls:d,isRange:u}=s,{id:f}=s,p=dk(s,a9),m=nr(p),x=ut(p);return h.createElement(h.Fragment,null,(t==null?void 0:t.length)>1&&h.createElement(ir,{clipPath:n?"url(#clipPath-".concat(i,")"):void 0},h.createElement(us,fi({},x,{id:f,points:t,connectNulls:d,type:l,baseLine:r,layout:o,stroke:"none",className:"recharts-area-area"})),c!=="none"&&h.createElement(us,fi({},m,{className:"recharts-area-curve",layout:o,type:l,connectNulls:d,fill:"none",points:t})),c!=="none"&&u&&h.createElement(us,fi({},m,{className:"recharts-area-curve",layout:o,type:l,connectNulls:d,fill:"none",points:r}))),h.createElement(p9,{points:t,props:p,clipPathId:i}))}function m9(e){var{alpha:t,baseLine:r,points:n,strokeWidth:i}=e,s=n[0].y,o=n[n.length-1].y;if(!_e(s)||!_e(o))return null;var l=t*Math.abs(s-o),c=Math.max(...n.map(d=>d.x||0));return Y(r)?c=Math.max(r,c):r&&Array.isArray(r)&&r.length&&(c=Math.max(...r.map(d=>d.x||0),c)),Y(c)?h.createElement("rect",{x:0,y:s<o?s:s-l,width:c+(i?parseInt("".concat(i),10):1),height:Math.floor(l)}):null}function g9(e){var{alpha:t,baseLine:r,points:n,strokeWidth:i}=e,s=n[0].x,o=n[n.length-1].x;if(!_e(s)||!_e(o))return null;var l=t*Math.abs(s-o),c=Math.max(...n.map(d=>d.y||0));return Y(r)?c=Math.max(r,c):r&&Array.isArray(r)&&r.length&&(c=Math.max(...r.map(d=>d.y||0),c)),Y(c)?h.createElement("rect",{x:s<o?s:s-l,y:0,width:l,height:Math.floor(c+(i?parseInt("".concat(i),10):1))}):null}function x9(e){var{alpha:t,layout:r,points:n,baseLine:i,strokeWidth:s}=e;return r==="vertical"?h.createElement(m9,{alpha:t,points:n,baseLine:i,strokeWidth:s}):h.createElement(g9,{alpha:t,points:n,baseLine:i,strokeWidth:s})}function y9(e){var{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:s}=e,{points:o,baseLine:l,isAnimationActive:c,animationBegin:d,animationDuration:u,animationEasing:f,onAnimationStart:p,onAnimationEnd:m}=n,x=pu(n,"recharts-area-"),[g,b]=h.useState(!1),v=!g,j=h.useCallback(()=>{typeof m=="function"&&m(),b(!1)},[m]),y=h.useCallback(()=>{typeof p=="function"&&p(),b(!0)},[p]),w=i.current,S=s.current;return h.createElement(h9,{showLabels:v,points:o},n.children,h.createElement(fu,{animationId:x,begin:d,duration:u,isActive:c,easing:f,onAnimationEnd:j,onAnimationStart:y,key:x},N=>{if(w){var P=w.length/o.length,_=N===1?o:o.map(($,M)=>{var C=Math.floor(M*P);if(w[C]){var R=w[C];return Zi(Zi({},$),{},{x:De(R.x,$.x,N),y:De(R.y,$.y,N)})}return $}),T;return Y(l)?T=De(S,l,N):Re(l)||yr(l)?T=De(S,0,N):T=l.map(($,M)=>{var C=Math.floor(M*P);if(Array.isArray(S)&&S[C]){var R=S[C];return Zi(Zi({},$),{},{x:De(R.x,$.x,N),y:De(R.y,$.y,N)})}return $}),N>0&&(i.current=_,s.current=T),h.createElement(mv,{points:_,baseLine:T,needClip:t,clipPathId:r,props:n})}return N>0&&(i.current=o,s.current=l),h.createElement(ir,null,c&&h.createElement("defs",null,h.createElement("clipPath",{id:"animationClipPath-".concat(r)},h.createElement(x9,{alpha:N,points:o,baseLine:l,layout:n.layout,strokeWidth:n.strokeWidth}))),h.createElement(ir,{clipPath:"url(#animationClipPath-".concat(r,")")},h.createElement(mv,{points:o,baseLine:l,needClip:t,clipPathId:r,props:n})))}),h.createElement(MN,{label:n.label}))}function v9(e){var{needClip:t,clipPathId:r,props:n}=e,i=h.useRef(null),s=h.useRef();return h.createElement(y9,{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:s})}class b9 extends h.PureComponent{render(){var{hide:t,dot:r,points:n,className:i,top:s,left:o,needClip:l,xAxisId:c,yAxisId:d,width:u,height:f,id:p,baseLine:m,zIndex:x}=this.props;if(t)return null;var g=ce("recharts-area",i),b=p,{r:v,strokeWidth:j}=rk(r),y=eg(r),w=v*2+j;return h.createElement(Ir,{zIndex:x},h.createElement(ir,{className:g},l&&h.createElement("defs",null,h.createElement(VN,{clipPathId:b,xAxisId:c,yAxisId:d}),!y&&h.createElement("clipPath",{id:"clipPath-dots-".concat(b)},h.createElement("rect",{x:o-w/2,y:s-w/2,width:u+w,height:f+w}))),h.createElement(v9,{needClip:l,clipPathId:b,props:this.props})),h.createElement(xp,{points:n,mainColor:bc(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot}),this.props.isRange&&Array.isArray(m)&&h.createElement(xp,{points:m,mainColor:bc(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot}))}}var fk={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:!Ci.isSsr,legendType:"line",stroke:"#3182bd",xAxisId:0,yAxisId:0,zIndex:lt.area};function j9(e){var t,r=ft(e,fk),{activeDot:n,animationBegin:i,animationDuration:s,animationEasing:o,connectNulls:l,dot:c,fill:d,fillOpacity:u,hide:f,isAnimationActive:p,legendType:m,stroke:x,xAxisId:g,yAxisId:b}=r,v=dk(r,s9),j=to(),y=oN(),{needClip:w}=tg(g,b),S=pt(),{points:N,isRange:P,baseLine:_}=(t=G(q=>i9(q,g,b,S,e.id)))!==null&&t!==void 0?t:{},T=Mu();if(j!=="horizontal"&&j!=="vertical"||T==null||y!=="AreaChart"&&y!=="ComposedChart")return null;var{height:$,width:M,x:C,y:R}=T;return!N||!N.length?null:h.createElement(b9,fi({},v,{activeDot:n,animationBegin:i,animationDuration:s,animationEasing:o,baseLine:_,connectNulls:l,dot:c,fill:d,fillOpacity:u,height:$,hide:f,layout:j,isAnimationActive:p,isRange:P,legendType:m,needClip:w,points:N,stroke:x,width:M,left:C,top:R,xAxisId:g,yAxisId:b}))}var w9=(e,t,r,n,i)=>{var s=r??t;if(Y(s))return s;var o=e==="horizontal"?i:n,l=o.scale.domain();if(o.type==="number"){var c=Math.max(l[0],l[1]),d=Math.min(l[0],l[1]);return s==="dataMin"?d:s==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]};function S9(e){var{areaSettings:{connectNulls:t,baseValue:r,dataKey:n},stackedData:i,layout:s,chartBaseValue:o,xAxis:l,yAxis:c,displayedData:d,dataStartIndex:u,xAxisTicks:f,yAxisTicks:p,bandSize:m}=e,x=i&&i.length,g=w9(s,o,r,l,c),b=s==="horizontal",v=!1,j=d.map((w,S)=>{var N;x?N=i[u+S]:(N=et(w,n),Array.isArray(N)?v=!0:N=[g,N]);var P=N[1]==null||x&&!t&&et(w,n)==null;return b?{x:Yl({axis:l,ticks:f,bandSize:m,entry:w,index:S}),y:P?null:c.scale(N[1]),value:N,payload:w}:{x:P?null:l.scale(N[1]),y:Yl({axis:c,ticks:p,bandSize:m,entry:w,index:S}),value:N,payload:w}}),y;return x||v?y=j.map(w=>{var S=Array.isArray(w.value)?w.value[0]:null;return b?{x:w.x,y:S!=null&&w.y!=null?c.scale(S):null,payload:w.payload}:{x:S!=null?l.scale(S):null,y:w.y,payload:w.payload}}):y=b?c.scale(g):l.scale(g),{points:j,baseLine:y,isRange:v}}function N9(e){var t=ft(e,fk),r=pt();return h.createElement(FN,{id:t.id,type:"area"},n=>h.createElement(h.Fragment,null,h.createElement(RN,{legendPayload:d9(t)}),h.createElement(zN,{fn:f9,args:t}),h.createElement(UN,{type:"area",id:n,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:CE(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),h.createElement(j9,fi({},t,{id:n}))))}var pk=h.memo(N9);pk.displayName="Area";var k9=["dangerouslySetInnerHTML","ticks"],P9=["id"],_9=["domain"],C9=["domain"];function bp(){return bp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bp.apply(null,arguments)}function jc(e,t){if(e==null)return{};var r,n,i=A9(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function A9(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function O9(e){var t=Ve();return h.useLayoutEffect(()=>(t(uz(e)),()=>{t(dz(e))}),[e,t]),null}var E9=e=>{var{xAxisId:t,className:r}=e,n=G(Dw),i=pt(),s="xAxis",o=G(b=>Ea(b,s,t,i)),l=G(b=>R2(b,s,t,i)),c=G(b=>cI(b,t)),d=G(b=>mI(b,t)),u=G(b=>a2(b,t));if(c==null||d==null||u==null)return null;var{dangerouslySetInnerHTML:f,ticks:p}=e,m=jc(e,k9),{id:x}=u,g=jc(u,P9);return h.createElement(ag,bp({},m,g,{scale:o,x:d.x,y:d.y,width:c.width,height:c.height,className:ce("recharts-".concat(s," ").concat(s),r),viewBox:n,ticks:l,axisType:s}))},D9={allowDataOverflow:Tt.allowDataOverflow,allowDecimals:Tt.allowDecimals,allowDuplicatedCategory:Tt.allowDuplicatedCategory,height:Tt.height,hide:!1,mirror:Tt.mirror,orientation:Tt.orientation,padding:Tt.padding,reversed:Tt.reversed,scale:Tt.scale,tickCount:Tt.tickCount,type:Tt.type,xAxisId:0},T9=e=>{var t,r,n,i,s,o=ft(e,D9);return h.createElement(h.Fragment,null,h.createElement(O9,{interval:(t=o.interval)!==null&&t!==void 0?t:"preserveEnd",id:o.xAxisId,scale:o.scale,type:o.type,padding:o.padding,allowDataOverflow:o.allowDataOverflow,domain:o.domain,dataKey:o.dataKey,allowDuplicatedCategory:o.allowDuplicatedCategory,allowDecimals:o.allowDecimals,tickCount:o.tickCount,includeHidden:(r=o.includeHidden)!==null&&r!==void 0?r:!1,reversed:o.reversed,ticks:o.ticks,height:o.height,orientation:o.orientation,mirror:o.mirror,hide:o.hide,unit:o.unit,name:o.name,angle:(n=o.angle)!==null&&n!==void 0?n:0,minTickGap:(i=o.minTickGap)!==null&&i!==void 0?i:5,tick:(s=o.tick)!==null&&s!==void 0?s:!0,tickFormatter:o.tickFormatter}),h.createElement(E9,o))},M9=(e,t)=>{var{domain:r}=e,n=jc(e,_9),{domain:i}=t,s=jc(t,C9);return ya(n,s)?Array.isArray(r)&&r.length===2&&Array.isArray(i)&&i.length===2?r[0]===i[0]&&r[1]===i[1]:ya({domain:r},{domain:i}):!1},jp=h.memo(T9,M9);jp.displayName="XAxis";var I9=["dangerouslySetInnerHTML","ticks"],$9=["id"],L9=["domain"],z9=["domain"];function wp(){return wp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wp.apply(null,arguments)}function wc(e,t){if(e==null)return{};var r,n,i=R9(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function R9(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function B9(e){var t=Ve();return h.useLayoutEffect(()=>(t(fz(e)),()=>{t(pz(e))}),[e,t]),null}var F9=e=>{var{yAxisId:t,className:r,width:n,label:i}=e,s=h.useRef(null),o=h.useRef(null),l=G(Dw),c=pt(),d=Ve(),u="yAxis",f=G(S=>Ea(S,u,t,c)),p=G(S=>yI(S,t)),m=G(S=>xI(S,t)),x=G(S=>R2(S,u,t,c)),g=G(S=>s2(S,t));if(h.useLayoutEffect(()=>{if(!(n!=="auto"||!p||Qm(i)||h.isValidElement(i)||g==null)){var S=s.current;if(S){var N=S.getCalculatedWidth();Math.round(p.width)!==Math.round(N)&&d(hz({id:t,width:N}))}}},[x,p,d,i,t,n,g]),p==null||m==null||g==null)return null;var{dangerouslySetInnerHTML:b,ticks:v}=e,j=wc(e,I9),{id:y}=g,w=wc(g,$9);return h.createElement(ag,wp({},j,w,{ref:s,labelRef:o,scale:f,x:m.x,y:m.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:p.width,height:p.height,className:ce("recharts-".concat(u," ").concat(u),r),viewBox:l,ticks:x,axisType:u}))},W9={allowDataOverflow:Mt.allowDataOverflow,allowDecimals:Mt.allowDecimals,allowDuplicatedCategory:Mt.allowDuplicatedCategory,hide:!1,mirror:Mt.mirror,orientation:Mt.orientation,padding:Mt.padding,reversed:Mt.reversed,scale:Mt.scale,tickCount:Mt.tickCount,type:Mt.type,width:Mt.width,yAxisId:0},U9=e=>{var t,r,n,i,s,o=ft(e,W9);return h.createElement(h.Fragment,null,h.createElement(B9,{interval:(t=o.interval)!==null&&t!==void 0?t:"preserveEnd",id:o.yAxisId,scale:o.scale,type:o.type,domain:o.domain,allowDataOverflow:o.allowDataOverflow,dataKey:o.dataKey,allowDuplicatedCategory:o.allowDuplicatedCategory,allowDecimals:o.allowDecimals,tickCount:o.tickCount,padding:o.padding,includeHidden:(r=o.includeHidden)!==null&&r!==void 0?r:!1,reversed:o.reversed,ticks:o.ticks,width:o.width,orientation:o.orientation,mirror:o.mirror,hide:o.hide,unit:o.unit,name:o.name,angle:(n=o.angle)!==null&&n!==void 0?n:0,minTickGap:(i=o.minTickGap)!==null&&i!==void 0?i:5,tick:(s=o.tick)!==null&&s!==void 0?s:!0,tickFormatter:o.tickFormatter}),h.createElement(F9,o))},q9=(e,t)=>{var{domain:r}=e,n=wc(e,L9),{domain:i}=t,s=wc(t,z9);return ya(n,s)?Array.isArray(r)&&r.length===2&&Array.isArray(i)&&i.length===2?r[0]===i[0]&&r[1]===i[1]:ya({domain:r},{domain:i}):!1},Sp=h.memo(U9,q9);Sp.displayName="YAxis";var H9={};/**
* @license React
* use-sync-external-store-with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var po=h;function K9(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var V9=typeof Object.is=="function"?Object.is:K9,Y9=po.useSyncExternalStore,G9=po.useRef,Z9=po.useEffect,X9=po.useMemo,J9=po.useDebugValue;H9.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var s=G9(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=X9(function(){function c(m){if(!d){if(d=!0,u=m,m=n(m),i!==void 0&&o.hasValue){var x=o.value;if(i(x,m))return f=x}return f=m}if(x=f,V9(u,m))return x;var g=n(m);return i!==void 0&&i(x,g)?(u=m,x):(u=m,f=g)}var d=!1,u,f,p=r===void 0?null:r;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,r,n,i]);var l=Y9(e,s[0],s[1]);return Z9(function(){o.hasValue=!0,o.value=l},[l]),J9(l),l};function Q9(e){e()}function eB(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Q9(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var gv={notify(){},get:()=>[]};function tB(e,t){let r,n=gv,i=0,s=!1;function o(g){u();const b=n.subscribe(g);let v=!1;return()=>{v||(v=!0,b(),f())}}function l(){n.notify()}function c(){x.onStateChange&&x.onStateChange()}function d(){return s}function u(){i++,r||(r=e.subscribe(c),n=eB())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=gv)}function p(){s||(s=!0,u())}function m(){s&&(s=!1,f())}const x={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:p,tryUnsubscribe:m,getListeners:()=>n};return x}var rB=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",nB=rB(),iB=()=>typeof navigator<"u"&&navigator.product==="ReactNative",aB=iB(),sB=()=>nB||aB?h.useLayoutEffect:h.useEffect,oB=sB(),Cd=Symbol.for("react-redux-context"),Ad=typeof globalThis<"u"?globalThis:{};function lB(){if(!h.createContext)return{};const e=Ad[Cd]??(Ad[Cd]=new Map);let t=e.get(h.createContext);return t||(t=h.createContext(null),e.set(h.createContext,t)),t}var cB=lB();function uB(e){const{children:t,context:r,serverState:n,store:i}=e,s=h.useMemo(()=>{const c=tB(i);return{store:i,subscription:c,getServerState:n?()=>n:void 0}},[i,n]),o=h.useMemo(()=>i.getState(),[i]);oB(()=>{const{subscription:c}=s;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[s,o]);const l=r||cB;return h.createElement(l.Provider,{value:s},t)}var dB=uB,fB=(e,t)=>t,og=I([fB,ue,n2,We,tN,pn,C$,rt],I$),lg=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},hk=ar("mouseClick"),mk=Qs();mk.startListening({actionCreator:hk,effect:(e,t)=>{var r=e.payload,n=og(t.getState(),lg(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(OI({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Np=ar("mouseMove"),gk=Qs();gk.startListening({actionCreator:Np,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=Um(n,n.tooltip.settings.shared),s=og(n,lg(r));i==="axis"&&((s==null?void 0:s.activeIndex)!=null?t.dispatch(K2({activeIndex:s.activeIndex,activeDataKey:void 0,activeCoordinate:s.activeCoordinate})):t.dispatch(H2()))}});var xv={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},xk=At({name:"rootProps",initialState:xv,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:xv.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}}}),pB=xk.reducer,{updateOptions:hB}=xk.actions,yk=At({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:Z7}=yk.actions,mB=yk.reducer,vk=ar("keyDown"),bk=ar("focus"),cg=Qs();cg.startListening({actionCreator:vk,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,s=e.payload;if(!(s!=="ArrowRight"&&s!=="ArrowLeft"&&s!=="Enter")){var o=Number(qm(i,Ta(r))),l=pn(r);if(s==="Enter"){var c=pc(r,"axis","hover",String(i.index));t.dispatch(dp({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:c}));return}var d=wI(r),u=d==="left-to-right"?1:-1,f=s==="ArrowRight"?1:-1,p=o+f*u;if(!(l==null||p>=l.length||p<0)){var m=pc(r,"axis","hover",String(p));t.dispatch(dp({active:!0,activeIndex:p.toString(),activeDataKey:void 0,activeCoordinate:m}))}}}}});cg.startListening({actionCreator:bk,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var s="0",o=pc(r,"axis","hover",String(s));t.dispatch(dp({activeDataKey:void 0,active:!0,activeIndex:s,activeCoordinate:o}))}}}});var Vt=ar("externalEvent"),jk=Qs();jk.startListening({actionCreator:Vt,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:p$(r),activeDataKey:d$(r),activeIndex:Us(r),activeLabel:iN(r),activeTooltipIndex:Us(r),isTooltipActive:h$(r)};e.payload.handler(n,e.payload.reactEvent)}}});var gB=I([Da],e=>e.tooltipItemPayloads),xB=I([gB,uo,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(l=>l.settings.dataKey===n);if(i!=null){var{positions:s}=i;if(s!=null){var o=t(s,r);return o}}}),wk=ar("touchMove"),Sk=Qs();Sk.startListening({actionCreator:wk,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var n=t.getState(),i=Um(n,n.tooltip.settings.shared);if(i==="axis"){var s=og(n,lg({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));(s==null?void 0:s.activeIndex)!=null&&t.dispatch(K2({activeIndex:s.activeIndex,activeDataKey:void 0,activeCoordinate:s.activeCoordinate}))}else if(i==="item"){var o,l=r.touches[0];if(document.elementFromPoint==null)return;var c=document.elementFromPoint(l.clientX,l.clientY);if(!c||!c.getAttribute)return;var d=c.getAttribute(IE),u=(o=c.getAttribute($E))!==null&&o!==void 0?o:void 0,f=xB(t.getState(),d,u);t.dispatch(AI({activeDataKey:u,activeIndex:d,activeCoordinate:f}))}}}});var yB=nw({brush:Dz,cartesianAxis:mz,chartData:dL,errorBars:Nz,graphicalItems:X8,layout:yE,legend:d3,options:sL,polarAxis:P8,polarOptions:mB,referenceElements:Rz,rootProps:pB,tooltip:EI,zIndex:G$}),vB=function(t){return U4({reducer:yB,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([mk.middleware,gk.middleware,cg.middleware,jk.middleware,Sk.middleware]),enhancers:r=>{var n=r;return typeof r=="function"&&(n=r()),n.concat(mw({type:"raf"}))},devTools:Ci.devToolsEnabled})};function bB(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=pt(),s=h.useRef(null);if(i)return r;s.current==null&&(s.current=vB(t));var o=Hh;return h.createElement(dB,{context:o,store:s.current},r)}function jB(e){var{layout:t,margin:r}=e,n=Ve(),i=pt();return h.useEffect(()=>{i||(n(mE(t)),n(hE(r)))},[n,i,t,r]),null}function wB(e){var t=Ve();return h.useEffect(()=>{t(hB(e))},[t,e]),null}function yv(e){var{zIndex:t,isPanorama:r}=e,n=r?"recharts-zindex-panorama-":"recharts-zindex-",i=BN("".concat(n).concat(t)),s=Ve();return h.useLayoutEffect(()=>(s(V$({zIndex:t,elementId:i,isPanorama:r})),()=>{s(Y$({zIndex:t,isPanorama:r}))}),[s,t,i,r]),h.createElement("g",{id:i})}function vv(e){var{children:t,isPanorama:r}=e,n=G(L$);if(!n||n.length===0)return t;var i=n.filter(o=>o<0),s=n.filter(o=>o>0);return h.createElement(h.Fragment,null,i.map(o=>h.createElement(yv,{key:o,zIndex:o,isPanorama:r})),t,s.map(o=>h.createElement(yv,{key:o,zIndex:o,isPanorama:r})))}var SB=["children"];function NB(e,t){if(e==null)return{};var r,n,i=kB(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function kB(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Sc(){return Sc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sc.apply(null,arguments)}var PB={width:"100%",height:"100%",display:"block"},_B=h.forwardRef((e,t)=>{var r=Fw(),n=Ww(),i=qw();if(!Er(r)||!Er(n))return null;var{children:s,otherAttributes:o,title:l,desc:c}=e,d,u;return o!=null&&(typeof o.tabIndex=="number"?d=o.tabIndex:d=i?0:void 0,typeof o.role=="string"?u=o.role:u=i?"application":void 0),h.createElement(lj,Sc({},o,{title:l,desc:c,role:u,tabIndex:d,width:r,height:n,style:PB,ref:t}),s)}),CB=e=>{var{children:t}=e,r=G(cu);if(!r)return null;var{width:n,height:i,y:s,x:o}=r;return h.createElement(lj,{width:n,height:i,x:o,y:s},t)},bv=h.forwardRef((e,t)=>{var{children:r}=e,n=NB(e,SB),i=pt();return i?h.createElement(CB,null,h.createElement(vv,{isPanorama:!0},r)):h.createElement(_B,Sc({ref:t},n),h.createElement(vv,{isPanorama:!1},r))});function AB(){var e=Ve(),[t,r]=h.useState(null),n=G(ME);return h.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),s=i.width/t.offsetWidth;_e(s)&&s!==n&&e(xE(s))}},[t,e,n]),r}function jv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function OB(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?jv(Object(r),!0).forEach(function(n){EB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function EB(e,t,r){return(t=DB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DB(e){var t=TB(e,"string");return typeof t=="symbol"?t:t+""}function TB(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ni(){return Ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ni.apply(null,arguments)}var MB=()=>(bL(),null);function Nc(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var IB=h.forwardRef((e,t)=>{var r,n,i=h.useRef(null),[s,o]=h.useState({containerWidth:Nc((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Nc((n=e.style)===null||n===void 0?void 0:n.height)}),l=h.useCallback((d,u)=>{o(f=>{var p=Math.round(d),m=Math.round(u);return f.containerWidth===p&&f.containerHeight===m?f:{containerWidth:p,containerHeight:m}})},[]),c=h.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null&&typeof ResizeObserver<"u"){var{width:u,height:f}=d.getBoundingClientRect();l(u,f);var p=x=>{var{width:g,height:b}=x[0].contentRect;l(g,b)},m=new ResizeObserver(p);m.observe(d),i.current=m}},[t,l]);return h.useEffect(()=>()=>{var d=i.current;d!=null&&d.disconnect()},[l]),h.createElement(h.Fragment,null,h.createElement(du,{width:s.containerWidth,height:s.containerHeight}),h.createElement("div",Ni({ref:c},e)))}),$B=h.forwardRef((e,t)=>{var{width:r,height:n}=e,[i,s]=h.useState({containerWidth:Nc(r),containerHeight:Nc(n)}),o=h.useCallback((c,d)=>{s(u=>{var f=Math.round(c),p=Math.round(d);return u.containerWidth===f&&u.containerHeight===p?u:{containerWidth:f,containerHeight:p}})},[]),l=h.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:d,height:u}=c.getBoundingClientRect();o(d,u)}},[t,o]);return h.createElement(h.Fragment,null,h.createElement(du,{width:i.containerWidth,height:i.containerHeight}),h.createElement("div",Ni({ref:l},e)))}),LB=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return h.createElement(h.Fragment,null,h.createElement(du,{width:r,height:n}),h.createElement("div",Ni({ref:t},e)))}),zB=h.forwardRef((e,t)=>{var{width:r,height:n}=e;return Qr(r)||Qr(n)?h.createElement($B,Ni({},e,{ref:t})):h.createElement(LB,Ni({},e,{ref:t}))});function RB(e){return e===!0?IB:zB}var BB=h.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:s,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:d,onMouseLeave:u,onMouseMove:f,onMouseUp:p,onTouchEnd:m,onTouchMove:x,onTouchStart:g,style:b,width:v,responsive:j,dispatchTouchEvents:y=!0}=e,w=h.useRef(null),S=Ve(),[N,P]=h.useState(null),[_,T]=h.useState(null),$=AB(),M=Qh(),C=(M==null?void 0:M.width)>0?M.width:v,R=(M==null?void 0:M.height)>0?M.height:i,q=h.useCallback(z=>{$(z),typeof t=="function"&&t(z),P(z),T(z),z!=null&&(w.current=z)},[$,t,P,T]),Z=h.useCallback(z=>{S(hk(z)),S(Vt({handler:s,reactEvent:z}))},[S,s]),E=h.useCallback(z=>{S(Np(z)),S(Vt({handler:d,reactEvent:z}))},[S,d]),D=h.useCallback(z=>{S(H2()),S(Vt({handler:u,reactEvent:z}))},[S,u]),O=h.useCallback(z=>{S(Np(z)),S(Vt({handler:f,reactEvent:z}))},[S,f]),k=h.useCallback(()=>{S(bk())},[S]),L=h.useCallback(z=>{S(vk(z.key))},[S]),U=h.useCallback(z=>{S(Vt({handler:o,reactEvent:z}))},[S,o]),H=h.useCallback(z=>{S(Vt({handler:l,reactEvent:z}))},[S,l]),te=h.useCallback(z=>{S(Vt({handler:c,reactEvent:z}))},[S,c]),re=h.useCallback(z=>{S(Vt({handler:p,reactEvent:z}))},[S,p]),we=h.useCallback(z=>{S(Vt({handler:g,reactEvent:z}))},[S,g]),A=h.useCallback(z=>{y&&S(wk(z)),S(Vt({handler:x,reactEvent:z}))},[S,y,x]),J=h.useCallback(z=>{S(Vt({handler:m,reactEvent:z}))},[S,m]),Ot=RB(j);return h.createElement(pN.Provider,{value:N},h.createElement(a6.Provider,{value:_},h.createElement(Ot,{width:C??(b==null?void 0:b.width),height:R??(b==null?void 0:b.height),className:ce("recharts-wrapper",n),style:OB({position:"relative",cursor:"default",width:C,height:R},b),onClick:Z,onContextMenu:U,onDoubleClick:H,onFocus:k,onKeyDown:L,onMouseDown:te,onMouseEnter:E,onMouseLeave:D,onMouseMove:O,onMouseUp:re,onTouchEnd:J,onTouchMove:A,onTouchStart:we,ref:q},h.createElement(MB,null),r)))}),FB=["width","height","responsive","children","className","style","compact","title","desc"];function WB(e,t){if(e==null)return{};var r,n,i=UB(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function UB(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var qB=h.forwardRef((e,t)=>{var{width:r,height:n,responsive:i,children:s,className:o,style:l,compact:c,title:d,desc:u}=e,f=WB(e,FB),p=nr(f);return c?h.createElement(h.Fragment,null,h.createElement(du,{width:r,height:n}),h.createElement(bv,{otherAttributes:p,title:d,desc:u},s)):h.createElement(BB,{className:o,style:l,width:r,height:n,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},h.createElement(bv,{otherAttributes:p,title:d,desc:u,ref:t},h.createElement(Fz,null,s)))});function kp(){return kp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kp.apply(null,arguments)}var HB={top:5,right:5,bottom:5,left:5},KB={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:HB,reverseStackOrder:!1,syncMethod:"index",responsive:!1},Nk=h.forwardRef(function(t,r){var n,i=ft(t.categoricalChartProps,KB),{chartName:s,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,categoricalChartProps:d}=t,u={chartName:s,defaultTooltipEventType:o,validateTooltipEventTypes:l,tooltipPayloadSearcher:c,eventEmitter:void 0};return h.createElement(bB,{preloadedState:{options:u},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:s},h.createElement(Ez,{chartData:d.data}),h.createElement(jB,{layout:i.layout,margin:i.margin}),h.createElement(wB,{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}),h.createElement(qB,kp({},i,{ref:r})))}),VB=["axis"],YB=h.forwardRef((e,t)=>h.createElement(Nk,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:VB,tooltipPayloadSearcher:mN,categoricalChartProps:e,ref:t})),GB=["axis"],ZB=h.forwardRef((e,t)=>h.createElement(Nk,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:GB,tooltipPayloadSearcher:mN,categoricalChartProps:e,ref:t}));function XB(){var b,v,j,y,w,S,N,P,_,T,$,M,C,R,q,Z,E,D,O,k,L;const[e,t]=h.useState(null),[r,n]=h.useState(null),[i,s]=h.useState(!0),[o,l]=h.useState(0),[c,d]=h.useState(!1);h.useEffect(()=>{f(),u()},[]);const u=async()=>{try{const H=(await B.getChangeStats()).pending_count;l(H);const te=localStorage.getItem("dismissedPendingChangesCount"),re=te&&parseInt(te)>=H;d(H>0&&!re)}catch(U){console.error("Failed to load change stats:",U),d(!1)}},f=async()=>{try{const[U,H]=await Promise.all([B.getDashboardStats(),B.getDashboardActivity()]);t(U),n(H)}catch(U){console.error("Failed to load dashboard:",U)}finally{s(!1)}},p=()=>{localStorage.setItem("dismissedPendingChangesCount",o.toString()),d(!1)};if(i)return a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx(Xt,{className:"w-8 h-8 animate-spin text-gray-400"})})});const m=Math.round(((b=e==null?void 0:e.products)==null?void 0:b.with_images)/((v=e==null?void 0:e.products)==null?void 0:v.total)*100)||0;Math.round(((j=e==null?void 0:e.stores)==null?void 0:j.active)/((y=e==null?void 0:e.stores)==null?void 0:y.total)*100);const x=[{date:"Mon",products:120},{date:"Tue",products:145},{date:"Wed",products:132},{date:"Thu",products:178},{date:"Fri",products:195},{date:"Sat",products:210},{date:"Sun",products:((w=e==null?void 0:e.products)==null?void 0:w.total)||225}],g=[{time:"00:00",scrapes:5},{time:"04:00",scrapes:12},{time:"08:00",scrapes:18},{time:"12:00",scrapes:25},{time:"16:00",scrapes:30},{time:"20:00",scrapes:22},{time:"24:00",scrapes:((S=r==null?void 0:r.recent_scrapes)==null?void 0:S.length)||15}];return a.jsxs(X,{children:[c&&a.jsx("div",{className:"mb-6 bg-amber-50 border-l-4 border-amber-500 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[a.jsx(nj,{className:"w-5 h-5 text-amber-600 flex-shrink-0"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h3",{className:"text-sm font-semibold text-amber-900",children:[o," pending change",o!==1?"s":""," require review"]}),a.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:"Proposed changes to dispensary data are waiting for approval"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{className:"btn btn-sm bg-amber-600 hover:bg-amber-700 text-white border-none",children:"Review Changes"}),a.jsx("button",{onClick:p,className:"btn btn-sm btn-ghost text-amber-900 hover:bg-amber-100","aria-label":"Dismiss notification",children:a.jsx(ij,{className:"w-4 h-4"})})]})]})}),a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:"Dashboard"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Monitor your dispensary data aggregation"})]}),a.jsxs("button",{onClick:f,className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors text-sm font-medium text-gray-700",children:[a.jsx(Xt,{className:"w-4 h-4"}),"Refresh"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(Ct,{className:"w-5 h-5 text-blue-600"})}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600",children:[a.jsx(zn,{className:"w-3 h-3"}),a.jsx("span",{children:"12.5%"})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Products"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((P=(N=e==null?void 0:e.products)==null?void 0:N.total)==null?void 0:P.toLocaleString())||0}),a.jsxs("p",{className:"text-xs text-gray-500",children:[((_=e==null?void 0:e.products)==null?void 0:_.in_stock)||0," in stock"]})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-emerald-50 rounded-lg",children:a.jsx(Il,{className:"w-5 h-5 text-emerald-600"})}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600",children:[a.jsx(zn,{className:"w-3 h-3"}),a.jsx("span",{children:"8.2%"})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Dispensaries"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((T=e==null?void 0:e.stores)==null?void 0:T.total)||0}),a.jsxs("p",{className:"text-xs text-gray-500",children:[(($=e==null?void 0:e.stores)==null?void 0:$.active)||0," active (crawlable)"]})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-purple-50 rounded-lg",children:a.jsx(rj,{className:"w-5 h-5 text-purple-600"})}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-red-600",children:[a.jsx(FO,{className:"w-3 h-3"}),a.jsx("span",{children:"3.1%"})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Active Campaigns"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((M=e==null?void 0:e.campaigns)==null?void 0:M.active)||0}),a.jsxs("p",{className:"text-xs text-gray-500",children:[((C=e==null?void 0:e.campaigns)==null?void 0:C.total)||0," total campaigns"]})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-amber-50 rounded-lg",children:a.jsx(lO,{className:"w-5 h-5 text-amber-600"})}),a.jsxs("span",{className:"text-xs font-medium text-gray-600",children:[m,"%"]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Images Downloaded"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((q=(R=e==null?void 0:e.products)==null?void 0:R.with_images)==null?void 0:q.toLocaleString())||0}),a.jsx("div",{className:"mt-3",children:a.jsx("div",{className:"w-full bg-gray-100 rounded-full h-1.5",children:a.jsx("div",{className:"bg-amber-500 h-1.5 rounded-full transition-all",style:{width:`${m}%`}})})})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-cyan-50 rounded-lg",children:a.jsx(vO,{className:"w-5 h-5 text-cyan-600"})}),a.jsx(xr,{className:"w-4 h-4 text-gray-400"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Clicks (24h)"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((E=(Z=e==null?void 0:e.clicks)==null?void 0:Z.clicks_24h)==null?void 0:E.toLocaleString())||0}),a.jsx("p",{className:"text-xs text-gray-500",children:"Last 24 hours"})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-indigo-50 rounded-lg",children:a.jsx(Cr,{className:"w-5 h-5 text-indigo-600"})}),a.jsx(Ds,{className:"w-4 h-4 text-gray-400"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Brands"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:((D=e==null?void 0:e.brands)==null?void 0:D.total)||((O=e==null?void 0:e.products)==null?void 0:O.unique_brands)||0}),a.jsx("p",{className:"text-xs text-gray-500",children:"Unique brands tracked"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:"Product Growth"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Weekly product count trend"})]}),a.jsx(p0,{width:"100%",height:200,children:a.jsxs(ZB,{data:x,children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"productGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#3b82f6",stopOpacity:.1}),a.jsx("stop",{offset:"95%",stopColor:"#3b82f6",stopOpacity:0})]})}),a.jsx(vp,{strokeDasharray:"3 3",stroke:"#f1f5f9"}),a.jsx(jp,{dataKey:"date",tick:{fill:"#94a3b8",fontSize:12},axisLine:{stroke:"#e2e8f0"}}),a.jsx(Sp,{tick:{fill:"#94a3b8",fontSize:12},axisLine:{stroke:"#e2e8f0"}}),a.jsx(By,{contentStyle:{backgroundColor:"#ffffff",border:"1px solid #e2e8f0",borderRadius:"8px",fontSize:"12px"}}),a.jsx(pk,{type:"monotone",dataKey:"products",stroke:"#3b82f6",strokeWidth:2,fill:"url(#productGradient)"})]})})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:"Scrape Activity"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Scrapes over the last 24 hours"})]}),a.jsx(p0,{width:"100%",height:200,children:a.jsxs(YB,{data:g,children:[a.jsx(vp,{strokeDasharray:"3 3",stroke:"#f1f5f9"}),a.jsx(jp,{dataKey:"time",tick:{fill:"#94a3b8",fontSize:12},axisLine:{stroke:"#e2e8f0"}}),a.jsx(Sp,{tick:{fill:"#94a3b8",fontSize:12},axisLine:{stroke:"#e2e8f0"}}),a.jsx(By,{contentStyle:{backgroundColor:"#ffffff",border:"1px solid #e2e8f0",borderRadius:"8px",fontSize:"12px"}}),a.jsx(ak,{type:"monotone",dataKey:"scrapes",stroke:"#10b981",strokeWidth:2,dot:{fill:"#10b981",r:4}})]})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200",children:[a.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:"Recent Scrapes"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Latest data collection activities"})]}),a.jsx("div",{className:"divide-y divide-gray-100",children:((k=r==null?void 0:r.recent_scrapes)==null?void 0:k.length)>0?r.recent_scrapes.slice(0,5).map((U,H)=>a.jsx("div",{className:"px-6 py-4 hover:bg-gray-50 transition-colors",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:U.name}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:new Date(U.last_scraped_at).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})})]}),a.jsx("div",{className:"ml-4 flex-shrink-0",children:a.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-50 text-blue-700",children:[U.product_count," products"]})})]})},H)):a.jsxs("div",{className:"px-6 py-12 text-center",children:[a.jsx(Ds,{className:"w-8 h-8 text-gray-300 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No recent scrapes"})]})})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200",children:[a.jsxs("div",{className:"px-6 py-4 border-b border-gray-200",children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:"Recent Products"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Newly added to inventory"})]}),a.jsx("div",{className:"divide-y divide-gray-100",children:((L=r==null?void 0:r.recent_products)==null?void 0:L.length)>0?r.recent_products.slice(0,5).map((U,H)=>a.jsx("div",{className:"px-6 py-4 hover:bg-gray-50 transition-colors",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:U.name}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:U.store_name})]}),U.price&&a.jsx("div",{className:"ml-4 flex-shrink-0",children:a.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-emerald-50 text-emerald-700",children:["$",U.price]})})]})},H)):a.jsxs("div",{className:"px-6 py-12 text-center",children:[a.jsx(Ct,{className:"w-8 h-8 text-gray-300 mx-auto mb-2"}),a.jsx("p",{className:"text-sm text-gray-500",children:"No recent products"})]})})]})]})]})]})}function JB(){const[e,t]=nA(),r=dt(),[n,i]=h.useState([]),[s,o]=h.useState([]),[l,c]=h.useState([]),[d,u]=h.useState(!1),[f,p]=h.useState(""),[m,x]=h.useState(""),[g,b]=h.useState(""),[v,j]=h.useState(""),[y,w]=h.useState(0),[S,N]=h.useState(0),P=50;h.useEffect(()=>{const k=e.get("store");k&&x(k),T()},[]),h.useEffect(()=>{m&&($(),_())},[f,m,g,v,S]);const _=async()=>{try{const k=await B.getCategoryTree(parseInt(m));c(k.categories||[])}catch(k){console.error("Failed to load categories:",k)}},T=async()=>{try{const k=await B.getStores();o(k.stores)}catch(k){console.error("Failed to load stores:",k)}},$=async()=>{u(!0);try{const k={limit:P,offset:S,store_id:m};f&&(k.search=f),g&&(k.category_id=g),v&&(k.in_stock=v);const L=await B.getProducts(k);i(L.products),w(L.total)}catch(k){console.error("Failed to load products:",k)}finally{u(!1)}},M=k=>{p(k),N(0)},C=k=>{x(k),b(""),N(0),p(""),t(k?{store:k}:{})},R=k=>{b(k),N(0)},q=(k,L=0)=>k.map(U=>a.jsxs("div",{style:{marginLeft:`${L*20}px`},children:[a.jsxs("button",{onClick:()=>R(U.id.toString()),style:{width:"100%",textAlign:"left",padding:"10px 15px",background:g===U.id.toString()?"#667eea":"transparent",color:g===U.id.toString()?"white":"#333",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:L===0?"600":"400",fontSize:L===0?"15px":"14px",marginBottom:"4px",transition:"all 0.2s"},onMouseEnter:H=>{g!==U.id.toString()&&(H.currentTarget.style.background="#f5f5f5")},onMouseLeave:H=>{g!==U.id.toString()&&(H.currentTarget.style.background="transparent")},children:[U.name," (",U.product_count||0,")"]}),U.children&&U.children.length>0&&q(U.children,L+1)]},U.id)),Z=l.find(k=>k.id.toString()===g),E=()=>{S+P<y&&N(S+P)},D=()=>{S>0&&N(Math.max(0,S-P))},O=s.find(k=>k.id.toString()===m);return a.jsx(X,{children:a.jsxs("div",{children:[a.jsx("h1",{style:{fontSize:"32px",marginBottom:"30px"},children:"Products"}),a.jsxs("div",{style:{background:"white",padding:"30px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"30px"},children:[a.jsx("label",{style:{display:"block",marginBottom:"15px",fontSize:"18px",fontWeight:"600",color:"#333"},children:"Select a Store to View Products:"}),a.jsxs("select",{value:m,onChange:k=>C(k.target.value),style:{width:"100%",padding:"15px",border:"2px solid #667eea",borderRadius:"8px",fontSize:"16px",fontWeight:"500",cursor:"pointer",background:"white"},children:[a.jsx("option",{value:"",children:"-- Select a Store --"}),s.map(k=>a.jsx("option",{value:k.id,children:k.name},k.id))]})]}),m?a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{background:"#667eea",color:"white",padding:"20px",borderRadius:"8px",marginBottom:"20px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{children:[a.jsx("h2",{style:{margin:0,fontSize:"24px"},children:O==null?void 0:O.name}),Z&&a.jsx("div",{style:{marginTop:"8px",fontSize:"14px",opacity:.9},children:Z.name})]}),a.jsxs("div",{style:{fontSize:"18px",fontWeight:"bold"},children:[y," Products"]})]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"280px 1fr",gap:"20px"},children:[a.jsx("div",{children:a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",position:"sticky",top:"20px"},children:[a.jsx("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",fontWeight:"600",color:"#333"},children:"Categories"}),a.jsxs("button",{onClick:()=>R(""),style:{width:"100%",textAlign:"left",padding:"10px 15px",background:g===""?"#667eea":"transparent",color:g===""?"white":"#333",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:"600",fontSize:"15px",marginBottom:"12px"},children:["All Products (",y,")"]}),a.jsx("div",{style:{borderTop:"1px solid #eee",marginBottom:"12px"}}),q(l)]})}),a.jsxs("div",{children:[a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"20px",display:"flex",gap:"15px",flexWrap:"wrap"},children:[a.jsx("input",{type:"text",placeholder:"Search products...",value:f,onChange:k=>M(k.target.value),style:{flex:"1",minWidth:"200px",padding:"10px",border:"1px solid #ddd",borderRadius:"6px"}}),a.jsxs("select",{value:v,onChange:k=>{j(k.target.value),N(0)},style:{padding:"10px",border:"1px solid #ddd",borderRadius:"6px"},children:[a.jsx("option",{value:"",children:"All Products"}),a.jsx("option",{value:"true",children:"In Stock"}),a.jsx("option",{value:"false",children:"Out of Stock"})]})]}),d?a.jsx("div",{style:{textAlign:"center",padding:"40px"},children:"Loading..."}):a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"20px",marginBottom:"20px"},children:n.map(k=>a.jsx(QB,{product:k,onViewDetails:()=>r(`/products/${k.id}`)},k.id))}),n.length===0&&a.jsx("div",{style:{background:"white",padding:"40px",borderRadius:"8px",textAlign:"center",color:"#999"},children:"No products found"}),y>P&&a.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"15px",marginTop:"30px"},children:[a.jsx("button",{onClick:D,disabled:S===0,style:{padding:"10px 20px",background:S===0?"#ddd":"#667eea",color:S===0?"#999":"white",border:"none",borderRadius:"6px",cursor:S===0?"not-allowed":"pointer"},children:"Previous"}),a.jsxs("span",{children:["Showing ",S+1," - ",Math.min(S+P,y)," of ",y]}),a.jsx("button",{onClick:E,disabled:S+P>=y,style:{padding:"10px 20px",background:S+P>=y?"#ddd":"#667eea",color:S+P>=y?"#999":"white",border:"none",borderRadius:"6px",cursor:S+P>=y?"not-allowed":"pointer"},children:"Next"})]})]})]})]})]}):a.jsxs("div",{style:{background:"white",padding:"60px 40px",borderRadius:"8px",textAlign:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"48px",marginBottom:"20px"},children:"🏪"}),a.jsx("div",{style:{fontSize:"18px",color:"#666"},children:"Please select a store from the dropdown above to view products"})]})]})})}function QB({product:e,onViewDetails:t}){const r=n=>{if(!n)return"Never";const i=new Date(n),o=new Date().getTime()-i.getTime(),l=Math.floor(o/(1e3*60*60*24));return l===0?"Today":l===1?"Yesterday":l<7?`${l} days ago`:i.toLocaleDateString()};return a.jsxs("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden",transition:"transform 0.2s"},onMouseEnter:n=>n.currentTarget.style.transform="translateY(-4px)",onMouseLeave:n=>n.currentTarget.style.transform="translateY(0)",children:[e.image_url_full?a.jsx("img",{src:e.image_url_full,alt:e.name,style:{width:"100%",height:"200px",objectFit:"cover",background:"#f5f5f5"},onError:n=>{n.currentTarget.src='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="200" height="200"%3E%3Crect fill="%23ddd" width="200" height="200"/%3E%3Ctext x="50%25" y="50%25" text-anchor="middle" dy=".3em" fill="%23999"%3ENo Image%3C/text%3E%3C/svg%3E'}}):a.jsx("div",{style:{width:"100%",height:"200px",background:"#f5f5f5",display:"flex",alignItems:"center",justifyContent:"center",color:"#999"},children:"No Image"}),a.jsxs("div",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"500",marginBottom:"8px",fontSize:"14px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"8px"},children:[a.jsx("div",{style:{fontWeight:"bold",color:"#667eea"},children:e.price?`$${e.price}`:"N/A"}),a.jsx("div",{style:{padding:"4px 8px",borderRadius:"4px",fontSize:"12px",background:e.in_stock?"#d4edda":"#f8d7da",color:e.in_stock?"#155724":"#721c24"},children:e.in_stock?"In Stock":"Out of Stock"})]}),a.jsxs("div",{style:{fontSize:"11px",color:"#888",marginBottom:"12px",borderTop:"1px solid #eee",paddingTop:"8px"},children:["Last Updated: ",r(e.last_seen_at)]}),a.jsxs("div",{style:{display:"flex",gap:"8px"},children:[e.dutchie_url&&a.jsx("a",{href:e.dutchie_url,target:"_blank",rel:"noopener noreferrer",style:{flex:1,padding:"8px 12px",background:"#f0f0f0",color:"#333",textDecoration:"none",borderRadius:"6px",fontSize:"12px",fontWeight:"500",textAlign:"center",border:"1px solid #ddd"},onClick:n=>n.stopPropagation(),children:"Dutchie"}),a.jsx("button",{onClick:n=>{n.stopPropagation(),t()},style:{flex:1,padding:"8px 12px",background:"#667eea",color:"white",border:"none",borderRadius:"6px",fontSize:"12px",fontWeight:"500",cursor:"pointer"},children:"Details"})]})]})]})}function e7(){const{id:e}=Na(),t=dt(),[r,n]=h.useState(null),[i,s]=h.useState(!0),[o,l]=h.useState(null);h.useEffect(()=>{c()},[e]);const c=async()=>{if(e){s(!0),l(null);try{const p=await B.getProduct(parseInt(e));n(p.product)}catch(p){l(p.message||"Failed to load product")}finally{s(!1)}}};if(i)return a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-600 rounded-full animate-spin"})})});if(o||!r)return a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Ct,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Product not found"}),a.jsx("p",{className:"text-gray-500 mb-4",children:o}),a.jsx("button",{onClick:()=>t(-1),className:"text-blue-600 hover:text-blue-700",children:"← Go back"})]})});const d=r.metadata||{},f=r.image_url_full?r.image_url_full:r.medium_path?`http://localhost:9020/dutchie/${r.medium_path}`:r.thumbnail_path?`http://localhost:9020/dutchie/${r.thumbnail_path}`:null;return a.jsx(X,{children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("button",{onClick:()=>t(-1),className:"flex items-center gap-2 text-gray-600 hover:text-gray-900 mb-6",children:[a.jsx(_h,{className:"w-4 h-4"}),"Back"]}),a.jsx("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 p-6",children:[a.jsx("div",{className:"aspect-square bg-gray-50 rounded-lg overflow-hidden",children:f?a.jsx("img",{src:f,alt:r.name,className:"w-full h-full object-contain"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400",children:a.jsx(Ct,{className:"w-24 h-24"})})}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.in_stock?a.jsx("span",{className:"px-2 py-1 bg-green-100 text-green-700 text-xs font-medium rounded",children:"In Stock"}):a.jsx("span",{className:"px-2 py-1 bg-red-100 text-red-700 text-xs font-medium rounded",children:"Out of Stock"}),r.strain_type&&a.jsx("span",{className:"px-2 py-1 bg-purple-100 text-purple-700 text-xs font-medium rounded capitalize",children:r.strain_type})]}),a.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:r.name}),r.brand&&a.jsx("p",{className:"text-lg text-gray-600 font-medium",children:r.brand}),a.jsxs("div",{className:"flex items-center gap-4 mt-2 text-sm text-gray-500",children:[r.store_name&&a.jsx("span",{children:r.store_name}),r.category_name&&a.jsxs(a.Fragment,{children:[a.jsx("span",{children:"•"}),a.jsx("span",{children:r.category_name})]})]})]}),r.price!==null&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsxs("div",{className:"text-3xl font-bold text-blue-600",children:["$",parseFloat(r.price).toFixed(2)]}),r.weight&&a.jsx("div",{className:"text-sm text-gray-500 mt-1",children:r.weight})]}),(r.thc_percentage||r.cbd_percentage)&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-3",children:"Cannabinoid Content"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[r.thc_percentage!==null&&a.jsxs("div",{className:"bg-green-50 rounded-lg p-3",children:[a.jsx("div",{className:"text-xs text-gray-500 uppercase",children:"THC"}),a.jsxs("div",{className:"text-xl font-bold text-green-600",children:[r.thc_percentage,"%"]})]}),r.cbd_percentage!==null&&a.jsxs("div",{className:"bg-blue-50 rounded-lg p-3",children:[a.jsx("div",{className:"text-xs text-gray-500 uppercase",children:"CBD"}),a.jsxs("div",{className:"text-xl font-bold text-blue-600",children:[r.cbd_percentage,"%"]})]})]})]}),r.description&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Description"}),a.jsx("p",{className:"text-gray-600 text-sm leading-relaxed",children:r.description})]}),d.terpenes&&d.terpenes.length>0&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Terpenes"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:d.terpenes.map(p=>a.jsx("span",{className:"px-2 py-1 bg-amber-100 text-amber-700 text-xs font-medium rounded",children:p},p))})]}),d.effects&&d.effects.length>0&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Effects"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:d.effects.map(p=>a.jsx("span",{className:"px-2 py-1 bg-indigo-100 text-indigo-700 text-xs font-medium rounded",children:p},p))})]}),d.flavors&&d.flavors.length>0&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Flavors"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:d.flavors.map(p=>a.jsx("span",{className:"px-2 py-1 bg-pink-100 text-pink-700 text-xs font-medium rounded",children:p},p))})]}),d.lineage&&a.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[a.jsx("h3",{className:"text-sm font-semibold text-gray-700 mb-2",children:"Lineage"}),a.jsx("p",{className:"text-gray-600 text-sm",children:d.lineage})]}),r.dutchie_url&&a.jsx("div",{className:"border-t border-gray-100 pt-4",children:a.jsxs("a",{href:r.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-blue-600 hover:text-blue-700",children:["View on Dutchie",a.jsx(Jr,{className:"w-4 h-4"})]})}),r.last_seen_at&&a.jsxs("div",{className:"text-xs text-gray-400 pt-4 border-t border-gray-100",children:["Last updated: ",new Date(r.last_seen_at).toLocaleString()]})]})]})})]})})}function t7(){const[e,t]=h.useState([]),[r,n]=h.useState(!0),[i,s]=h.useState(new Set),[o,l]=h.useState(new Set),c=dt();h.useEffect(()=>{d()},[]);const d=async()=>{n(!0);try{const v=await B.getStores();t(v.stores)}catch(v){console.error("Failed to load stores:",v)}finally{n(!1)}},u=v=>{const j=v.match(/(?:^|-)(al|ak|az|ar|ca|co|ct|de|fl|ga|hi|id|il|in|ia|ks|ky|la|me|md|ma|mi|mn|ms|mo|mt|ne|nv|nh|nj|nm|ny|nc|nd|oh|ok|or|pa|ri|sc|sd|tn|tx|ut|vt|va|wa|wv|wi|wy)-/i),y={peoria:"AZ"};let w=j?j[1].toUpperCase():null;if(!w){for(const[S,N]of Object.entries(y))if(v.toLowerCase().includes(S)){w=N;break}}return w||"UNKNOWN"},f=v=>{const j=u(v.slug).toLowerCase(),y=v.name.match(/^([^-]+)/),w=y?y[1].trim().toLowerCase().replace(/\s+/g,"-"):"other";return`/stores/${j}/${w}/${v.slug}`},p=e.reduce((v,j)=>{const y=j.name.match(/^([^-]+)/),w=y?y[1].trim():"Other",S=u(j.slug),P={AZ:"Arizona",FL:"Florida",PA:"Pennsylvania",NJ:"New Jersey",MA:"Massachusetts",IL:"Illinois",NY:"New York",MD:"Maryland",MI:"Michigan",OH:"Ohio",CT:"Connecticut",ME:"Maine",MO:"Missouri",NV:"Nevada",OR:"Oregon",UT:"Utah"}[S]||S;return v[w]||(v[w]={}),v[w][P]||(v[w][P]=[]),v[w][P].push(j),v},{}),m=async(v,j,y)=>{y.stopPropagation();try{await B.updateStore(v,{scrape_enabled:!j}),t(e.map(w=>w.id===v?{...w,scrape_enabled:!j}:w))}catch(w){console.error("Failed to update scraping status:",w)}},x=v=>v?new Date(v).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}):"Never",g=v=>{const j=new Set(i);j.has(v)?j.delete(v):j.add(v),s(j)},b=(v,j)=>{const y=`${v}-${j}`,w=new Set(o);w.has(y)?w.delete(y):w.add(y),l(w)};return r?a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-600 rounded-full animate-spin"})})}):a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(Il,{className:"w-6 h-6 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:"Stores"}),a.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[e.length," total stores"]})]})]})}),a.jsx("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Store Name"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"View Online"}),a.jsx("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Categories"}),a.jsx("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Products"}),a.jsx("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Scraping"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Last Scraped"})]})}),a.jsx("tbody",{children:Object.entries(p).map(([v,j])=>{const y=Object.values(j).flat().length,w=y===1,S=i.has(v);if(w){const _=Object.values(j).flat()[0];return a.jsxs("tr",{className:"border-b border-gray-100 hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>c(f(_)),title:"Click to view store",children:[a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[_.logo_url?a.jsx("img",{src:_.logo_url,alt:`${_.name} logo`,className:"w-8 h-8 object-contain flex-shrink-0",onError:T=>{T.target.style.display="none"}}):null,a.jsxs("div",{children:[a.jsx("div",{className:"font-semibold text-gray-900",children:_.name}),a.jsx("div",{className:"text-xs text-gray-500",children:_.slug})]})]})}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-blue-50 text-blue-700 rounded",children:"Dutchie"})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("a",{href:_.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700",onClick:T=>T.stopPropagation(),children:[a.jsx("span",{children:"View Online"}),a.jsx(Jr,{className:"w-3 h-3"})]})}),a.jsx("td",{className:"px-6 py-4 text-center",children:a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx(Cr,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:_.category_count||0})]})}),a.jsx("td",{className:"px-6 py-4 text-center",children:a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx(Ct,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:_.product_count||0})]})}),a.jsx("td",{className:"px-6 py-4 text-center",onClick:T=>T.stopPropagation(),children:a.jsx("button",{onClick:T=>m(_.id,_.scrape_enabled,T),className:"inline-flex items-center gap-1 text-sm font-medium transition-colors",children:_.scrape_enabled?a.jsxs(a.Fragment,{children:[a.jsx(Ix,{className:"w-5 h-5 text-green-600"}),a.jsx("span",{className:"text-green-600",children:"On"})]}):a.jsxs(a.Fragment,{children:[a.jsx(Mx,{className:"w-5 h-5 text-gray-400"}),a.jsx("span",{className:"text-gray-500",children:"Off"})]})})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(xr,{className:"w-4 h-4 text-gray-400"}),x(_.last_scraped_at)]})})]},_.id)}const N=Object.values(j).flat()[0],P=N==null?void 0:N.logo_url;return a.jsxs(fs.Fragment,{children:[a.jsx("tr",{className:"bg-gray-100 border-b border-gray-200 cursor-pointer hover:bg-gray-150 transition-colors",onClick:()=>g(v),children:a.jsx("td",{colSpan:7,className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Cf,{className:`w-5 h-5 text-gray-600 transition-transform ${S?"rotate-90":""}`}),P&&a.jsx("img",{src:P,alt:`${v} logo`,className:"w-8 h-8 object-contain flex-shrink-0",onError:_=>{_.target.style.display="none"}}),a.jsx("span",{className:"text-base font-semibold text-gray-900",children:v}),a.jsxs("span",{className:"text-sm text-gray-500",children:["(",y," stores)"]})]})})}),S&&Object.entries(j).map(([_,T])=>{const $=`${v}-${_}`,M=o.has($);return a.jsxs(fs.Fragment,{children:[a.jsx("tr",{className:"bg-gray-50 border-b border-gray-100 cursor-pointer hover:bg-gray-100 transition-colors",onClick:()=>b(v,_),children:a.jsx("td",{colSpan:7,className:"px-6 py-3 pl-12",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cf,{className:`w-4 h-4 text-gray-500 transition-transform ${M?"rotate-90":""}`}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:_}),a.jsxs("span",{className:"text-xs text-gray-500",children:["(",T.length," locations)"]})]})})}),M&&T.map(C=>a.jsxs("tr",{className:"border-b border-gray-100 hover:bg-gray-50 cursor-pointer transition-colors",onClick:()=>c(f(C)),title:"Click to view store",children:[a.jsx("td",{className:"px-6 py-4 pl-16",children:a.jsxs("div",{children:[a.jsx("div",{className:"font-semibold text-gray-900",children:C.name}),a.jsx("div",{className:"text-xs text-gray-500",children:C.slug})]})}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-blue-50 text-blue-700 rounded",children:"Dutchie"})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("a",{href:C.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700",onClick:R=>R.stopPropagation(),children:[a.jsx("span",{children:"View Online"}),a.jsx(Jr,{className:"w-3 h-3"})]})}),a.jsx("td",{className:"px-6 py-4 text-center",children:a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx(Cr,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:C.category_count||0})]})}),a.jsx("td",{className:"px-6 py-4 text-center",children:a.jsxs("div",{className:"flex items-center justify-center gap-1",children:[a.jsx(Ct,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:C.product_count||0})]})}),a.jsx("td",{className:"px-6 py-4 text-center",onClick:R=>R.stopPropagation(),children:a.jsx("button",{onClick:R=>m(C.id,C.scrape_enabled,R),className:"inline-flex items-center gap-1 text-sm font-medium transition-colors",children:C.scrape_enabled?a.jsxs(a.Fragment,{children:[a.jsx(Ix,{className:"w-5 h-5 text-green-600"}),a.jsx("span",{className:"text-green-600",children:"On"})]}):a.jsxs(a.Fragment,{children:[a.jsx(Mx,{className:"w-5 h-5 text-gray-400"}),a.jsx("span",{className:"text-gray-500",children:"Off"})]})})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(xr,{className:"w-4 h-4 text-gray-400"}),x(C.last_scraped_at)]})})]},C.id))]},`state-${$}`)})]},`chain-${v}`)})})]})})}),e.length===0&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[a.jsx(Il,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No stores found"}),a.jsx("p",{className:"text-gray-500",children:"Start by adding stores to your database"})]})]})})}function r7(){const e=dt(),[t,r]=h.useState([]),[n,i]=h.useState(!0),[s,o]=h.useState(""),[l,c]=h.useState(""),[d,u]=h.useState(null),[f,p]=h.useState({});h.useEffect(()=>{m()},[]);const m=async()=>{i(!0);try{const y=await B.getDispensaries();r(y.dispensaries)}catch(y){console.error("Failed to load dispensaries:",y)}finally{i(!1)}},x=y=>{u(y),p({dba_name:y.dba_name||"",website:y.website||"",phone:y.phone||"",google_rating:y.google_rating||"",google_review_count:y.google_review_count||""})},g=async()=>{if(d)try{await B.updateDispensary(d.id,f),await m(),u(null),p({})}catch(y){console.error("Failed to update dispensary:",y),alert("Failed to update dispensary")}},b=()=>{u(null),p({})},v=t.filter(y=>{const w=s.toLowerCase(),S=!s||y.name.toLowerCase().includes(w)||y.company_name&&y.company_name.toLowerCase().includes(w)||y.dba_name&&y.dba_name.toLowerCase().includes(w),N=!l||y.city===l;return S&&N}),j=Array.from(new Set(t.map(y=>y.city).filter(Boolean))).sort();return a.jsxs(X,{children:[a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Dispensaries"}),a.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:["AZDHS official dispensary directory (",t.length," total)"]})]}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Search"}),a.jsxs("div",{className:"relative",children:[a.jsx(AO,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),a.jsx("input",{type:"text",value:s,onChange:y=>o(y.target.value),placeholder:"Search by name or company...",className:"w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Filter by City"}),a.jsxs("select",{value:l,onChange:y=>c(y.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[a.jsx("option",{value:"",children:"All Cities"}),j.map(y=>a.jsx("option",{value:y,children:y},y))]})]})]})}),n?a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading dispensaries..."})]}):a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Name"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Company"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Address"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"City"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Phone"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Email"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Website"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-200",children:v.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:8,className:"px-4 py-8 text-center text-sm text-gray-500",children:"No dispensaries found"})}):v.map(y=>a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ln,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"text-sm font-medium text-gray-900",children:y.dba_name||y.name}),y.dba_name&&y.google_rating&&a.jsxs("span",{className:"text-xs text-gray-500",children:["⭐ ",y.google_rating," (",y.google_review_count," reviews)"]})]})]})}),a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:"text-sm text-gray-600",children:y.company_name||"-"})}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-start gap-1",children:[a.jsx(yi,{className:"w-3 h-3 text-gray-400 flex-shrink-0 mt-0.5"}),a.jsx("span",{className:"text-sm text-gray-600",children:y.address||"-"})]})}),a.jsxs("td",{className:"px-4 py-3",children:[a.jsx("span",{className:"text-sm text-gray-600",children:y.city||"-"}),y.zip&&a.jsxs("span",{className:"text-xs text-gray-400 ml-1",children:["(",y.zip,")"]})]}),a.jsx("td",{className:"px-4 py-3",children:y.phone?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Ah,{className:"w-3 h-3 text-gray-400"}),a.jsx("span",{className:"text-sm text-gray-600",children:y.phone.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")})]}):a.jsx("span",{className:"text-sm text-gray-400",children:"-"})}),a.jsx("td",{className:"px-4 py-3",children:y.email?a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(tj,{className:"w-3 h-3 text-gray-400"}),a.jsx("a",{href:`mailto:${y.email}`,className:"text-sm text-blue-600 hover:text-blue-800",children:y.email})]}):a.jsx("span",{className:"text-sm text-gray-400",children:"-"})}),a.jsx("td",{className:"px-4 py-3",children:y.website?a.jsxs("a",{href:y.website,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-blue-600 hover:text-blue-800",children:[a.jsx(Jr,{className:"w-3 h-3"}),a.jsx("span",{children:"Visit Site"})]}):a.jsx("span",{className:"text-sm text-gray-400",children:"-"})}),a.jsx("td",{className:"px-4 py-3",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:()=>x(y),className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 rounded-lg transition-colors",title:"Edit",children:a.jsx(wO,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>{const w=y.city.toLowerCase().replace(/\s+/g,"-");e(`/dispensaries/${y.state}/${w}/${y.slug}`)},className:"inline-flex items-center gap-1 px-3 py-1.5 text-sm font-medium text-blue-600 hover:text-blue-800 hover:bg-blue-50 rounded-lg transition-colors",title:"View",children:a.jsx(rO,{className:"w-4 h-4"})})]})})]},y.id))})]})}),a.jsx("div",{className:"bg-gray-50 px-4 py-3 border-t border-gray-200",children:a.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",v.length," of ",t.length," dispensaries"]})})]})]}),d&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[a.jsxs("h2",{className:"text-xl font-bold text-gray-900",children:["Edit Dispensary: ",d.name]}),a.jsx("button",{onClick:b,className:"text-gray-400 hover:text-gray-600",children:a.jsx(ij,{className:"w-6 h-6"})})]}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"DBA Name (Display Name)"}),a.jsx("input",{type:"text",value:f.dba_name,onChange:y=>p({...f,dba_name:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"e.g., Green Med Wellness"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Website"}),a.jsx("input",{type:"url",value:f.website,onChange:y=>p({...f,website:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"https://example.com"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Phone Number"}),a.jsx("input",{type:"tel",value:f.phone,onChange:y=>p({...f,phone:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"5551234567"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Google Rating"}),a.jsx("input",{type:"number",step:"0.1",min:"0",max:"5",value:f.google_rating,onChange:y=>p({...f,google_rating:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"4.5"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Review Count"}),a.jsx("input",{type:"number",min:"0",value:f.google_review_count,onChange:y=>p({...f,google_review_count:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",placeholder:"123"})]})]}),a.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg space-y-2",children:[a.jsxs("div",{className:"text-sm",children:[a.jsx("span",{className:"font-medium text-gray-700",children:"AZDHS Name:"})," ",a.jsx("span",{className:"text-gray-600",children:d.name})]}),a.jsxs("div",{className:"text-sm",children:[a.jsx("span",{className:"font-medium text-gray-700",children:"Address:"})," ",a.jsxs("span",{className:"text-gray-600",children:[d.address,", ",d.city,", ",d.state," ",d.zip]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-gray-200",children:[a.jsx("button",{onClick:b,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors",children:"Cancel"}),a.jsxs("button",{onClick:g,className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:[a.jsx(_O,{className:"w-4 h-4"}),"Save Changes"]})]})]})})]})}function n7(){const{state:e,city:t,slug:r}=Na(),n=dt(),[i,s]=h.useState(null),[o,l]=h.useState([]),[c,d]=h.useState([]),[u,f]=h.useState([]),[p,m]=h.useState(!0),[x,g]=h.useState("products"),[b,v]=h.useState(!1),[j,y]=h.useState(!1),[w,S]=h.useState(""),[N,P]=h.useState(1),[_]=h.useState(25),T=D=>{if(!D)return"Never";const O=new Date(D),L=new Date().getTime()-O.getTime(),U=Math.floor(L/(1e3*60*60*24));return U===0?"Today":U===1?"Yesterday":U<7?`${U} days ago`:O.toLocaleDateString()};h.useEffect(()=>{$()},[r]);const $=async()=>{m(!0);try{const[D,O,k,L]=await Promise.all([B.getDispensary(r),B.getDispensaryProducts(r).catch(()=>({products:[]})),B.getDispensaryBrands(r).catch(()=>({brands:[]})),B.getDispensarySpecials(r).catch(()=>({specials:[]}))]);s(D),l(O.products),d(k.brands),f(L.specials)}catch(D){console.error("Failed to load dispensary:",D)}finally{m(!1)}},M=async D=>{v(!1),y(!0);try{const O=await fetch(`https://dispos.crawlsy.com/api/dispensaries/${r}/scrape`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("token")}`},body:JSON.stringify({type:D})});if(!O.ok)throw new Error("Failed to trigger scraping");const k=await O.json();alert(`${D.charAt(0).toUpperCase()+D.slice(1)} update started! ${k.message||""}`)}catch(O){console.error("Failed to trigger scraping:",O),alert("Failed to start update. Please try again.")}finally{y(!1)}},C=o.filter(D=>{var k,L,U,H,te;if(!w)return!0;const O=w.toLowerCase();return((k=D.name)==null?void 0:k.toLowerCase().includes(O))||((L=D.brand)==null?void 0:L.toLowerCase().includes(O))||((U=D.variant)==null?void 0:U.toLowerCase().includes(O))||((H=D.description)==null?void 0:H.toLowerCase().includes(O))||((te=D.strain_type)==null?void 0:te.toLowerCase().includes(O))}),R=Math.ceil(C.length/_),q=(N-1)*_,Z=q+_,E=C.slice(q,Z);return h.useEffect(()=>{P(1)},[w]),p?a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading dispensary..."})]})}):i?a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("button",{onClick:()=>n("/dispensaries"),className:"flex items-center gap-2 text-sm text-gray-600 hover:text-gray-900",children:[a.jsx(_h,{className:"w-4 h-4"}),"Back to Dispensaries"]}),a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>v(!b),disabled:j,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed",children:[a.jsx(Xt,{className:`w-4 h-4 ${j?"animate-spin":""}`}),j?"Updating...":"Update",!j&&a.jsx(ej,{className:"w-4 h-4"})]}),b&&!j&&a.jsxs("div",{className:"absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg border border-gray-200 z-10",children:[a.jsx("button",{onClick:()=>M("products"),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-t-lg",children:"Products"}),a.jsx("button",{onClick:()=>M("brands"),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Brands"}),a.jsx("button",{onClick:()=>M("specials"),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100",children:"Specials"}),a.jsx("button",{onClick:()=>M("all"),className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-b-lg border-t border-gray-200",children:"All"})]})]})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"p-3 bg-blue-50 rounded-lg",children:a.jsx(Ln,{className:"w-8 h-8 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:i.dba_name||i.name}),i.company_name&&a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:i.company_name})]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 bg-gray-50 px-4 py-2 rounded-lg",children:[a.jsx(Ch,{className:"w-4 h-4"}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Last Crawl Date:"}),a.jsx("span",{className:"ml-2",children:i.last_menu_scrape?new Date(i.last_menu_scrape).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Never"})]})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-4",children:[i.address&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(yi,{className:"w-4 h-4"}),a.jsxs("span",{children:[i.address,", ",i.city,", ",i.state," ",i.zip]})]}),i.phone&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(Ah,{className:"w-4 h-4"}),a.jsx("span",{children:i.phone.replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(Jr,{className:"w-4 h-4"}),i.website?a.jsx("a",{href:i.website,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800",children:"Website"}):a.jsx("span",{children:"Website N/A"})]}),i.email&&a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[a.jsx(tj,{className:"w-4 h-4 text-gray-400"}),a.jsx("a",{href:`mailto:${i.email}`,className:"text-blue-600 hover:text-blue-800",children:i.email})]}),i.azdhs_url&&a.jsxs("a",{href:i.azdhs_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800",children:[a.jsx(Jr,{className:"w-4 h-4"}),a.jsx("span",{children:"AZDHS Profile"})]}),a.jsxs(K1,{to:"/schedule",className:"flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800",children:[a.jsx(xr,{className:"w-4 h-4"}),a.jsx("span",{children:"View Schedule"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[a.jsx("button",{onClick:()=>{g("products"),S("")},className:"bg-white rounded-lg border border-gray-200 p-6 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-green-50 rounded-lg",children:a.jsx(Ct,{className:"w-5 h-5 text-green-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Total Products"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:o.length})]})]})}),a.jsx("button",{onClick:()=>g("brands"),className:"bg-white rounded-lg border border-gray-200 p-6 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-purple-50 rounded-lg",children:a.jsx(Cr,{className:"w-5 h-5 text-purple-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Brands"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:c.length})]})]})}),a.jsx("button",{onClick:()=>g("specials"),className:"bg-white rounded-lg border border-gray-200 p-6 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(zn,{className:"w-5 h-5 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Active Specials"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:u.length})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-orange-50 rounded-lg",children:a.jsx(QA,{className:"w-5 h-5 text-orange-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Avg Price"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:o.length>0?`$${(o.reduce((D,O)=>D+(O.sale_price||O.regular_price||0),0)/o.length).toFixed(2)}`:"-"})]})]})})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200",children:[a.jsx("div",{className:"border-b border-gray-200",children:a.jsxs("div",{className:"flex gap-4 px-6",children:[a.jsxs("button",{onClick:()=>g("products"),className:`py-4 px-2 text-sm font-medium border-b-2 ${x==="products"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Products (",o.length,")"]}),a.jsxs("button",{onClick:()=>g("brands"),className:`py-4 px-2 text-sm font-medium border-b-2 ${x==="brands"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Brands (",c.length,")"]}),a.jsxs("button",{onClick:()=>g("specials"),className:`py-4 px-2 text-sm font-medium border-b-2 ${x==="specials"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Specials (",u.length,")"]})]})}),a.jsxs("div",{className:"p-6",children:[x==="products"&&a.jsx("div",{className:"space-y-4",children:o.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No products available"}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[a.jsx("input",{type:"text",placeholder:"Search products by name, brand, variant, description, or strain type...",value:w,onChange:D=>S(D.target.value),className:"input input-bordered input-sm flex-1"}),w&&a.jsx("button",{onClick:()=>S(""),className:"btn btn-sm btn-ghost",children:"Clear"}),a.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",q+1,"-",Math.min(Z,C.length)," of ",C.length," products"]})]}),a.jsx("div",{className:"overflow-x-auto -mx-6 px-6",children:a.jsxs("table",{className:"table table-xs table-zebra table-pin-rows w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Image"}),a.jsx("th",{children:"Product Name"}),a.jsx("th",{children:"Brand"}),a.jsx("th",{children:"Variant"}),a.jsx("th",{children:"Description"}),a.jsx("th",{className:"text-right",children:"Price"}),a.jsx("th",{className:"text-center",children:"THC %"}),a.jsx("th",{className:"text-center",children:"CBD %"}),a.jsx("th",{className:"text-center",children:"Strain Type"}),a.jsx("th",{className:"text-center",children:"In Stock"}),a.jsx("th",{children:"Last Updated"}),a.jsx("th",{children:"Actions"})]})}),a.jsx("tbody",{children:E.map(D=>a.jsxs("tr",{children:[a.jsx("td",{className:"whitespace-nowrap",children:D.image_url?a.jsx("img",{src:D.image_url,alt:D.name,className:"w-12 h-12 object-cover rounded",onError:O=>O.currentTarget.style.display="none"}):"-"}),a.jsx("td",{className:"font-medium max-w-[150px]",children:a.jsx("div",{className:"line-clamp-2",title:D.name,children:D.name})}),a.jsx("td",{className:"max-w-[120px]",children:a.jsx("div",{className:"line-clamp-2",title:D.brand||"-",children:D.brand||"-"})}),a.jsx("td",{className:"max-w-[100px]",children:a.jsx("div",{className:"line-clamp-2",title:D.variant||"-",children:D.variant||"-"})}),a.jsx("td",{className:"w-[120px]",children:a.jsx("span",{title:D.description,children:D.description?D.description.length>15?D.description.substring(0,15)+"...":D.description:"-"})}),a.jsx("td",{className:"text-right font-semibold whitespace-nowrap",children:D.sale_price?a.jsxs("div",{className:"flex flex-col items-end",children:[a.jsxs("span",{className:"text-error",children:["$",D.sale_price]}),a.jsxs("span",{className:"text-gray-400 line-through text-xs",children:["$",D.regular_price]})]}):D.regular_price?`$${D.regular_price}`:"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:D.thc_percentage?a.jsxs("span",{className:"badge badge-success badge-sm",children:[D.thc_percentage,"%"]}):"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:D.cbd_percentage?a.jsxs("span",{className:"badge badge-info badge-sm",children:[D.cbd_percentage,"%"]}):"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:D.strain_type?a.jsx("span",{className:"badge badge-ghost badge-sm",children:D.strain_type}):"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:D.in_stock?a.jsx("span",{className:"badge badge-success badge-sm",children:"Yes"}):D.in_stock===!1?a.jsx("span",{className:"badge badge-error badge-sm",children:"No"}):"-"}),a.jsx("td",{className:"whitespace-nowrap text-xs text-gray-500",children:D.updated_at?T(D.updated_at):"-"}),a.jsx("td",{children:a.jsxs("div",{className:"flex gap-1",children:[D.dutchie_url&&a.jsx("a",{href:D.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"btn btn-xs btn-outline",children:"Dutchie"}),a.jsx("button",{onClick:()=>n(`/products/${D.id}`),className:"btn btn-xs btn-primary",children:"Details"})]})})]},D.id))})]})}),R>1&&a.jsxs("div",{className:"flex justify-center items-center gap-2 mt-4",children:[a.jsx("button",{onClick:()=>P(D=>Math.max(1,D-1)),disabled:N===1,className:"btn btn-sm btn-outline",children:"Previous"}),a.jsx("div",{className:"flex gap-1",children:Array.from({length:R},(D,O)=>O+1).map(D=>{const O=D===1||D===R||D>=N-1&&D<=N+1;return D===2&&N>3||D===R-1&&N<R-2?a.jsx("span",{className:"px-2",children:"..."},D):O?a.jsx("button",{onClick:()=>P(D),className:`btn btn-sm ${N===D?"btn-primary":"btn-outline"}`,children:D},D):null})}),a.jsx("button",{onClick:()=>P(D=>Math.min(R,D+1)),disabled:N===R,className:"btn btn-sm btn-outline",children:"Next"})]})]})}),x==="brands"&&a.jsx("div",{className:"space-y-4",children:c.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No brands available"}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:c.map(D=>a.jsxs("button",{onClick:()=>{g("products"),S(D.brand)},className:"border border-gray-200 rounded-lg p-4 text-center hover:border-blue-300 hover:shadow-md transition-all cursor-pointer",children:[a.jsx("p",{className:"font-medium text-gray-900 line-clamp-2",children:D.brand}),a.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:[D.product_count," product",D.product_count!==1?"s":""]})]},D.brand))})}),x==="specials"&&a.jsx("div",{className:"space-y-4",children:u.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No active specials"}):a.jsx("div",{className:"space-y-3",children:u.map(D=>a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[a.jsx("h4",{className:"font-medium text-gray-900",children:D.name}),D.description&&a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:D.description}),a.jsxs("div",{className:"flex items-center gap-4 mt-2 text-sm text-gray-500",children:[a.jsxs("span",{children:[new Date(D.start_date).toLocaleDateString()," -"," ",D.end_date?new Date(D.end_date).toLocaleDateString():"Ongoing"]}),a.jsxs("span",{children:[D.product_count," products"]})]})]},D.id))})})]})]})]})}):a.jsx(X,{children:a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-gray-600",children:"Dispensary not found"})})})}function i7(){var $,M;const{slug:e}=Na(),t=dt(),[r,n]=h.useState(null),[i,s]=h.useState([]),[o,l]=h.useState([]),[c,d]=h.useState([]),[u,f]=h.useState(!0),[p,m]=h.useState(null),[x,g]=h.useState(""),[b,v]=h.useState("products"),[j,y]=h.useState("name");h.useEffect(()=>{w()},[e]),h.useEffect(()=>{r&&S()},[p,x,j,r]);const w=async()=>{f(!0);try{const R=(await B.getStores()).stores.find(D=>D.slug===e);if(!R)throw new Error("Store not found");const[q,Z,E]=await Promise.all([B.getStore(R.id),B.getCategories(R.id),B.getStoreBrands(R.id)]);n(q),l(Z.categories||[]),d(E.brands||[])}catch(C){console.error("Failed to load store data:",C)}finally{f(!1)}},S=async()=>{if(r)try{const C={store_id:r.id,limit:1e3};p&&(C.category_id=p),x&&(C.brand=x);let q=(await B.getProducts(C)).products||[];q.sort((Z,E)=>{switch(j){case"name":return(Z.name||"").localeCompare(E.name||"");case"price_asc":return(Z.price||0)-(E.price||0);case"price_desc":return(E.price||0)-(Z.price||0);case"thc":return(E.thc_percentage||0)-(Z.thc_percentage||0);default:return 0}}),s(q)}catch(C){console.error("Failed to load products:",C)}},N=C=>C.image_url_full?C.image_url_full:C.medium_path?`http://localhost:9020/dutchie/${C.medium_path}`:C.thumbnail_path?`http://localhost:9020/dutchie/${C.thumbnail_path}`:"https://via.placeholder.com/300x300?text=No+Image",P=C=>C?new Date(C).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}):"Never",_=C=>{switch(C==null?void 0:C.toLowerCase()){case"dutchie":return"bg-green-100 text-green-700";case"jane":return"bg-purple-100 text-purple-700";case"treez":return"bg-blue-100 text-blue-700";case"weedmaps":return"bg-orange-100 text-orange-700";case"leafly":return"bg-emerald-100 text-emerald-700";default:return"bg-gray-100 text-gray-700"}},T=C=>{switch(C){case"completed":return a.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-green-100 text-green-700 rounded-full flex items-center gap-1",children:[a.jsx(_r,{className:"w-3 h-3"})," Completed"]});case"running":return a.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-blue-100 text-blue-700 rounded-full flex items-center gap-1",children:[a.jsx(Xt,{className:"w-3 h-3 animate-spin"})," Running"]});case"failed":return a.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-red-100 text-red-700 rounded-full flex items-center gap-1",children:[a.jsx(Hr,{className:"w-3 h-3"})," Failed"]});case"pending":return a.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-yellow-100 text-yellow-700 rounded-full flex items-center gap-1",children:[a.jsx(xr,{className:"w-3 h-3"})," Pending"]});default:return a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-gray-100 text-gray-700 rounded-full",children:C})}};return u?a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-600 rounded-full animate-spin"})})}):r?a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-start justify-between mb-6",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("button",{onClick:()=>t("/stores"),className:"text-gray-600 hover:text-gray-900 mt-1",children:"← Back"}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:r.name}),a.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded ${_(r.provider)}`,children:r.provider||"Unknown"})]}),a.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["Store ID: ",r.id]})]})]}),a.jsxs("a",{href:r.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-sm text-blue-600 hover:text-blue-700",children:["View Menu ",a.jsx(Jr,{className:"w-4 h-4"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4 mb-6",children:[a.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 text-xs mb-1",children:[a.jsx(Ct,{className:"w-4 h-4"}),"Products"]}),a.jsx("p",{className:"text-xl font-semibold text-gray-900",children:r.product_count||0})]}),a.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 text-xs mb-1",children:[a.jsx(Cr,{className:"w-4 h-4"}),"Categories"]}),a.jsx("p",{className:"text-xl font-semibold text-gray-900",children:r.category_count||0})]}),a.jsxs("div",{className:"p-4 bg-green-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2 text-green-600 text-xs mb-1",children:[a.jsx(_r,{className:"w-4 h-4"}),"In Stock"]}),a.jsx("p",{className:"text-xl font-semibold text-green-700",children:r.in_stock_count||0})]}),a.jsxs("div",{className:"p-4 bg-red-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2 text-red-600 text-xs mb-1",children:[a.jsx(Hr,{className:"w-4 h-4"}),"Out of Stock"]}),a.jsx("p",{className:"text-xl font-semibold text-red-700",children:r.out_of_stock_count||0})]}),a.jsxs("div",{className:`p-4 rounded-lg ${r.is_stale?"bg-yellow-50":"bg-blue-50"}`,children:[a.jsxs("div",{className:`flex items-center gap-2 text-xs mb-1 ${r.is_stale?"text-yellow-600":"text-blue-600"}`,children:[a.jsx(xr,{className:"w-4 h-4"}),"Freshness"]}),a.jsx("p",{className:`text-sm font-semibold ${r.is_stale?"text-yellow-700":"text-blue-700"}`,children:r.freshness||"Never scraped"})]}),a.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-500 text-xs mb-1",children:[a.jsx(Ch,{className:"w-4 h-4"}),"Next Crawl"]}),a.jsx("p",{className:"text-sm font-semibold text-gray-700",children:($=r.schedule)!=null&&$.next_run_at?P(r.schedule.next_run_at):"Not scheduled"})]})]}),r.linked_dispensary&&a.jsxs("div",{className:"p-4 bg-indigo-50 rounded-lg mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2 text-indigo-600 text-xs mb-2",children:[a.jsx(WA,{className:"w-4 h-4"}),"Linked Dispensary"]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold text-indigo-900",children:r.linked_dispensary.name}),a.jsxs("p",{className:"text-sm text-indigo-700 flex items-center gap-1",children:[a.jsx(yi,{className:"w-3 h-3"}),r.linked_dispensary.city,", ",r.linked_dispensary.state,r.linked_dispensary.address&&` - ${r.linked_dispensary.address}`]})]}),a.jsx("button",{onClick:()=>t(`/dispensaries/${r.linked_dispensary.slug}`),className:"text-sm text-indigo-600 hover:text-indigo-700 font-medium",children:"View Dispensary →"})]})]}),a.jsxs("div",{className:"flex gap-2 border-b border-gray-200",children:[a.jsx("button",{onClick:()=>v("products"),className:`px-4 py-2 border-b-2 transition-colors ${b==="products"?"border-blue-600 text-blue-600 font-medium":"border-transparent text-gray-600 hover:text-gray-900"}`,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ct,{className:"w-4 h-4"}),"Products (",i.length,")"]})}),a.jsx("button",{onClick:()=>v("brands"),className:`px-4 py-2 border-b-2 transition-colors ${b==="brands"?"border-blue-600 text-blue-600 font-medium":"border-transparent text-gray-600 hover:text-gray-900"}`,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Cr,{className:"w-4 h-4"}),"Brands (",c.length,")"]})}),a.jsx("button",{onClick:()=>v("specials"),className:`px-4 py-2 border-b-2 transition-colors ${b==="specials"?"border-blue-600 text-blue-600 font-medium":"border-transparent text-gray-600 hover:text-gray-900"}`,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx($x,{className:"w-4 h-4"}),"Specials"]})}),a.jsx("button",{onClick:()=>v("crawl-history"),className:`px-4 py-2 border-b-2 transition-colors ${b==="crawl-history"?"border-blue-600 text-blue-600 font-medium":"border-transparent text-gray-600 hover:text-gray-900"}`,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ds,{className:"w-4 h-4"}),"Crawl History (",((M=r.recent_jobs)==null?void 0:M.length)||0,")"]})})]})]}),b==="crawl-history"&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[a.jsxs("div",{className:"p-4 border-b border-gray-200",children:[a.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Recent Crawl Jobs"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Last 10 crawl jobs for this store"})]}),r.recent_jobs&&r.recent_jobs.length>0?a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Status"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Type"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Started"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Completed"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase",children:"Found"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase",children:"New"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase",children:"Updated"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase",children:"In Stock"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-500 uppercase",children:"Out of Stock"}),a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase",children:"Error"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-100",children:r.recent_jobs.map(C=>a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-4 py-3",children:T(C.status)}),a.jsx("td",{className:"px-4 py-3 text-sm text-gray-700",children:C.job_type||"-"}),a.jsx("td",{className:"px-4 py-3 text-sm text-gray-700",children:P(C.started_at)}),a.jsx("td",{className:"px-4 py-3 text-sm text-gray-700",children:P(C.completed_at)}),a.jsx("td",{className:"px-4 py-3 text-center text-sm font-medium text-gray-900",children:C.products_found??"-"}),a.jsx("td",{className:"px-4 py-3 text-center text-sm font-medium text-green-600",children:C.products_new??"-"}),a.jsx("td",{className:"px-4 py-3 text-center text-sm font-medium text-blue-600",children:C.products_updated??"-"}),a.jsx("td",{className:"px-4 py-3 text-center text-sm font-medium text-green-600",children:C.in_stock_count??"-"}),a.jsx("td",{className:"px-4 py-3 text-center text-sm font-medium text-red-600",children:C.out_of_stock_count??"-"}),a.jsx("td",{className:"px-4 py-3 text-sm text-red-600 max-w-xs truncate",title:C.error_message||"",children:C.error_message||"-"})]},C.id))})]})}):a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Ds,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-500",children:"No crawl history available"})]})]}),b==="products"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:a.jsxs("div",{className:"flex flex-wrap gap-4",children:[a.jsxs("div",{className:"flex-1 min-w-[200px]",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Category"}),a.jsxs("select",{value:p||"",onChange:C=>m(C.target.value?parseInt(C.target.value):null),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[a.jsx("option",{value:"",children:"All Categories"}),o.map(C=>a.jsxs("option",{value:C.id,children:[C.name," (",i.filter(R=>R.category_id===C.id).length,")"]},C.id))]})]}),a.jsxs("div",{className:"flex-1 min-w-[200px]",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Brand"}),a.jsxs("select",{value:x,onChange:C=>g(C.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[a.jsx("option",{value:"",children:"All Brands"}),c.map(C=>a.jsx("option",{value:C,children:C},C))]})]}),a.jsxs("div",{className:"flex-1 min-w-[200px]",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Sort By"}),a.jsxs("select",{value:j,onChange:C=>y(C.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[a.jsx("option",{value:"name",children:"Name (A-Z)"}),a.jsx("option",{value:"price_asc",children:"Price (Low to High)"}),a.jsx("option",{value:"price_desc",children:"Price (High to Low)"}),a.jsx("option",{value:"thc",children:"THC % (High to Low)"})]})]})]})}),i.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:i.map(C=>a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden hover:shadow-lg transition-shadow",children:[a.jsxs("div",{className:"aspect-square bg-gray-50 relative",children:[a.jsx("img",{src:N(C),alt:C.name,className:"w-full h-full object-cover"}),C.in_stock?a.jsx("span",{className:"absolute top-2 right-2 px-2 py-1 bg-green-500 text-white text-xs font-medium rounded",children:"In Stock"}):a.jsx("span",{className:"absolute top-2 right-2 px-2 py-1 bg-red-500 text-white text-xs font-medium rounded",children:"Out of Stock"})]}),a.jsxs("div",{className:"p-3 space-y-2",children:[a.jsx("h3",{className:"font-semibold text-sm text-gray-900 line-clamp-2",children:C.name}),C.brand&&a.jsx("p",{className:"text-xs text-gray-600 font-medium",children:C.brand}),C.category_name&&a.jsx("p",{className:"text-xs text-gray-500",children:C.category_name}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-2 border-t border-gray-100",children:[C.price!==null&&a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Price:"}),a.jsxs("span",{className:"ml-1 font-semibold text-blue-600",children:["$",parseFloat(C.price).toFixed(2)]})]}),C.weight&&a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Weight:"}),a.jsx("span",{className:"ml-1 font-medium",children:C.weight})]}),C.thc_percentage!==null&&a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"THC:"}),a.jsxs("span",{className:"ml-1 font-medium text-green-600",children:[C.thc_percentage,"%"]})]}),C.cbd_percentage!==null&&a.jsxs("div",{className:"text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"CBD:"}),a.jsxs("span",{className:"ml-1 font-medium text-blue-600",children:[C.cbd_percentage,"%"]})]}),C.strain_type&&a.jsxs("div",{className:"text-xs col-span-2",children:[a.jsx("span",{className:"text-gray-500",children:"Type:"}),a.jsx("span",{className:"ml-1 font-medium capitalize",children:C.strain_type})]})]}),C.description&&a.jsx("p",{className:"text-xs text-gray-600 line-clamp-2 pt-2 border-t border-gray-100",children:C.description}),C.last_seen_at&&a.jsxs("p",{className:"text-xs text-gray-400 pt-2 border-t border-gray-100",children:["Updated: ",new Date(C.last_seen_at).toLocaleDateString()]}),a.jsxs("div",{className:"flex gap-2 mt-3 pt-3 border-t border-gray-100",children:[C.dutchie_url&&a.jsx("a",{href:C.dutchie_url,target:"_blank",rel:"noopener noreferrer",className:"flex-1 px-3 py-2 bg-gray-100 text-gray-700 text-sm font-medium rounded-lg hover:bg-gray-200 transition-colors text-center border border-gray-200",children:"Dutchie"}),a.jsx("button",{onClick:()=>t(`/products/${C.id}`),className:"flex-1 px-3 py-2 bg-blue-600 text-white text-sm font-medium rounded-lg hover:bg-blue-700 transition-colors",children:"Details"})]})]})]},C.id))}):a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[a.jsx(Ct,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No products found"}),a.jsx("p",{className:"text-gray-500",children:"Try adjusting your filters"})]})]}),b==="brands"&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:["All Brands (",c.length,")"]}),c.length>0?a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3",children:c.map(C=>{const R=i.filter(q=>q.brand===C);return a.jsxs("div",{className:"p-4 border border-gray-200 rounded-lg hover:border-blue-500 hover:bg-blue-50 transition-all cursor-pointer",onClick:()=>{v("products"),g(C)},children:[a.jsx("p",{className:"font-medium text-gray-900 text-sm",children:C}),a.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[R.length," products"]})]},C)})}):a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Cr,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-500",children:"No brands found"})]})]}),b==="specials"&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Daily Specials"}),a.jsxs("div",{className:"text-center py-12",children:[a.jsx($x,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-500",children:"No specials available"})]})]})]})}):a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Store not found"}),a.jsx("button",{onClick:()=>t("/stores"),className:"text-blue-600 hover:text-blue-700",children:"← Back to stores"})]})})}function a7(){const{state:e,storeName:t,slug:r}=Na(),n=dt(),[i,s]=h.useState(null),[o,l]=h.useState([]),[c,d]=h.useState(!0);h.useEffect(()=>{u()},[r]);const u=async()=>{d(!0);try{const p=(await B.getStores()).stores.find(x=>x.slug===r);if(!p)throw new Error("Store not found");s(p);const m=await B.getStoreBrands(p.id);l(m.brands)}catch(f){console.error("Failed to load brands:",f)}finally{d(!1)}};return c?a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("span",{className:"loading loading-spinner loading-lg"})})}):i?a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:()=>n(`/stores/${e}/${t}/${r}`),className:"btn btn-ghost btn-sm",children:"← Back to Store"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h1",{className:"text-3xl font-bold",children:[i.name," - Brands"]}),a.jsxs("div",{className:"flex gap-3 mt-2",children:[a.jsx("a",{href:`${i.dutchie_url}/brands`,target:"_blank",rel:"noopener noreferrer",className:"link link-primary text-sm",children:"View Live Brands Page"}),a.jsx("span",{className:"text-sm text-gray-500",children:"•"}),a.jsxs("span",{className:"text-sm text-gray-500",children:[o.length," ",o.length===1?"Brand":"Brands"]})]})]})]}),o.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:o.map((f,p)=>a.jsx("div",{className:"card bg-base-100 shadow-md hover:shadow-lg transition-shadow",children:a.jsx("div",{className:"card-body p-6",children:a.jsx("h3",{className:"text-lg font-semibold text-center",children:f})})},p))}):a.jsx("div",{className:"card bg-base-100 shadow-xl",children:a.jsxs("div",{className:"card-body text-center py-12",children:[a.jsx("p",{className:"text-gray-500",children:"No brands found for this store"}),a.jsx("p",{className:"text-sm text-gray-400 mt-2",children:"Brands are automatically extracted from products"})]})})]})}):a.jsx(X,{children:a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-gray-500",children:"Store not found"})})})}function s7(){const{state:e,storeName:t,slug:r}=Na(),n=dt(),[i,s]=h.useState(null),[o,l]=h.useState([]),[c,d]=h.useState(new Date().toISOString().split("T")[0]),[u,f]=h.useState(!0);h.useEffect(()=>{p()},[r,c]);const p=async()=>{f(!0);try{const x=(await B.getStores()).stores.find(b=>b.slug===r);if(!x)throw new Error("Store not found");s(x);const g=await B.getStoreSpecials(x.id,c);l(g.specials)}catch(m){console.error("Failed to load specials:",m)}finally{f(!1)}};return u?a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("span",{className:"loading loading-spinner loading-lg"})})}):i?a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:()=>n(`/stores/${e}/${t}/${r}`),className:"btn btn-ghost btn-sm",children:"← Back to Store"}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("h1",{className:"text-3xl font-bold",children:[i.name," - Specials"]}),a.jsxs("div",{className:"flex gap-3 mt-2",children:[a.jsx("a",{href:`${i.dutchie_url}/specials`,target:"_blank",rel:"noopener noreferrer",className:"link link-primary text-sm",children:"View Live Specials Page"}),a.jsx("span",{className:"text-sm text-gray-500",children:"•"}),a.jsxs("span",{className:"text-sm text-gray-500",children:[o.length," ",o.length===1?"Special":"Specials"]})]})]})]}),a.jsx("div",{className:"card bg-base-100 shadow-md",children:a.jsx("div",{className:"card-body p-4",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("label",{className:"font-semibold",children:"Select Date:"}),a.jsx("input",{type:"date",value:c,onChange:m=>d(m.target.value),className:"input input-bordered input-sm"})]})})}),o.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:o.map((m,x)=>a.jsx("div",{className:"card bg-base-100 shadow-xl hover:shadow-2xl transition-shadow",children:a.jsxs("div",{className:"card-body",children:[a.jsx("h3",{className:"card-title text-lg",children:m.name}),m.description&&a.jsx("p",{className:"text-sm text-gray-600",children:m.description}),a.jsxs("div",{className:"space-y-2 mt-2",children:[m.original_price&&a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm opacity-60",children:"Original Price:"}),a.jsxs("span",{className:"line-through text-gray-500",children:["$",parseFloat(m.original_price).toFixed(2)]})]}),m.special_price&&a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm opacity-60",children:"Special Price:"}),a.jsxs("span",{className:"text-lg font-bold text-success",children:["$",parseFloat(m.special_price).toFixed(2)]})]}),m.discount_percentage&&a.jsxs("div",{className:"badge badge-success badge-lg",children:[m.discount_percentage,"% OFF"]}),m.discount_amount&&a.jsxs("div",{className:"badge badge-info badge-lg",children:["Save $",parseFloat(m.discount_amount).toFixed(2)]})]})]})},x))}):a.jsx("div",{className:"card bg-base-100 shadow-xl",children:a.jsxs("div",{className:"card-body text-center py-12",children:[a.jsxs("p",{className:"text-gray-500",children:["No specials found for ",c]}),a.jsx("p",{className:"text-sm text-gray-400 mt-2",children:"Try selecting a different date"})]})})]})}):a.jsx(X,{children:a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-gray-500",children:"Store not found"})})})}function o7(){const[e,t]=h.useState([]),[r,n]=h.useState(null),[i,s]=h.useState([]),[o,l]=h.useState(!0);h.useEffect(()=>{c()},[]),h.useEffect(()=>{r&&d()},[r]);const c=async()=>{try{const f=await B.getStores();t(f.stores),f.stores.length>0&&n(f.stores[0].id)}catch(f){console.error("Failed to load stores:",f)}finally{l(!1)}},d=async()=>{if(r)try{const f=await B.getCategoryTree(r);s(f.tree)}catch(f){console.error("Failed to load categories:",f)}};if(o)return a.jsx(X,{children:a.jsx("div",{children:"Loading..."})});const u=e.find(f=>f.id===r);return a.jsx(X,{children:a.jsxs("div",{children:[a.jsx("h1",{style:{fontSize:"32px",marginBottom:"30px"},children:"Categories"}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"30px"},children:[a.jsx("label",{style:{display:"block",marginBottom:"10px",fontWeight:"600"},children:"Select Store:"}),a.jsx("select",{value:r||"",onChange:f=>n(parseInt(f.target.value)),style:{width:"100%",padding:"12px",border:"2px solid #667eea",borderRadius:"6px",fontSize:"16px",cursor:"pointer"},children:e.map(f=>a.jsxs("option",{value:f.id,children:[f.name," (",f.category_count||0," categories)"]},f.id))})]}),u&&a.jsxs("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsxs("h2",{style:{marginBottom:"20px",fontSize:"24px"},children:[u.name," - Categories"]}),i.length===0?a.jsx("div",{style:{color:"#999",textAlign:"center",padding:"40px"},children:'No categories found. Run "Discover Categories" from the Stores page.'}):a.jsx("div",{children:i.map(f=>a.jsx(kk,{category:f},f.id))})]})]})})}function kk({category:e,level:t=0}){return a.jsxs("div",{style:{marginLeft:t*30+"px",marginBottom:"10px"},children:[a.jsxs("div",{style:{padding:"12px 15px",background:t===0?"#f0f0ff":"#f8f9fa",borderRadius:"6px",borderLeft:`4px solid ${t===0?"#667eea":"#999"}`,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{children:[a.jsxs("strong",{style:{fontSize:t===0?"16px":"14px"},children:[t>0&&"└── ",e.name]}),a.jsxs("span",{style:{marginLeft:"10px",color:"#666",fontSize:"12px"},children:["(",e.product_count||0," products)"]})]}),a.jsx("div",{style:{fontSize:"12px",color:"#999"},children:a.jsx("code",{children:e.path})})]}),e.children&&e.children.length>0&&a.jsx("div",{style:{marginTop:"5px"},children:e.children.map(r=>a.jsx(kk,{category:r,level:t+1},r.id))})]})}function Vn({message:e,type:t,onClose:r,duration:n=4e3}){h.useEffect(()=>{const s=setTimeout(r,n);return()=>clearTimeout(s)},[n,r]);const i={success:"#10b981",error:"#ef4444",info:"#3b82f6"};return a.jsxs("div",{style:{position:"fixed",top:"20px",right:"20px",background:i[t],color:"white",padding:"16px 24px",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",zIndex:9999,maxWidth:"400px",animation:"slideIn 0.3s ease-out",fontSize:"14px",fontWeight:"500"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[a.jsx("div",{style:{flex:1,whiteSpace:"pre-wrap"},children:e}),a.jsx("button",{onClick:r,style:{background:"transparent",border:"none",color:"white",cursor:"pointer",fontSize:"18px",padding:"0 4px",opacity:.8},children:"×"})]}),a.jsx("style",{children:`
@keyframes slideIn {
from {
transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
`})]})}function l7(){const[e,t]=h.useState([]),[r,n]=h.useState(!0),[i,s]=h.useState(!1),[o,l]=h.useState(null);h.useEffect(()=>{c()},[]);const c=async()=>{n(!0);try{const u=await B.getCampaigns();t(u.campaigns)}catch(u){console.error("Failed to load campaigns:",u)}finally{n(!1)}},d=async(u,f)=>{if(confirm(`Are you sure you want to delete campaign "${f}"?`))try{await B.deleteCampaign(u),c()}catch(p){l({message:"Failed to delete campaign: "+p.message,type:"error"})}};return r?a.jsx(X,{children:a.jsx("div",{children:"Loading..."})}):a.jsxs(X,{children:[o&&a.jsx(Vn,{message:o.message,type:o.type,onClose:()=>l(null)}),a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Campaigns"}),a.jsx("button",{onClick:()=>s(!0),style:{padding:"12px 24px",background:"#667eea",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"14px",fontWeight:"500"},children:"+ Create Campaign"})]}),i&&a.jsx(c7,{onClose:()=>s(!1),onSuccess:()=>{s(!1),c()}}),a.jsx("div",{style:{display:"grid",gap:"20px"},children:e.map(u=>a.jsx("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[a.jsxs("div",{style:{flex:1},children:[a.jsxs("h3",{style:{marginBottom:"10px",fontSize:"20px"},children:[u.name,a.jsx("span",{style:{marginLeft:"10px",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",background:u.active?"#d4edda":"#f8d7da",color:u.active?"#155724":"#721c24"},children:u.active?"Active":"Inactive"})]}),a.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"5px"},children:[a.jsx("strong",{children:"Slug:"})," ",u.slug]}),u.description&&a.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"5px"},children:[a.jsx("strong",{children:"Description:"})," ",u.description]}),a.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"5px"},children:[a.jsx("strong",{children:"Display Style:"})," ",u.display_style]}),a.jsxs("div",{style:{fontSize:"14px",color:"#666"},children:[a.jsx("strong",{children:"Products:"})," ",u.product_count||0]})]}),a.jsx("div",{style:{display:"flex",gap:"10px"},children:a.jsx("button",{onClick:()=>d(u.id,u.name),style:{padding:"8px 16px",background:"#e74c3c",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"14px"},children:"Delete"})})]})},u.id))}),e.length===0&&!i&&a.jsx("div",{style:{background:"white",padding:"40px",borderRadius:"8px",textAlign:"center",color:"#999"},children:"No campaigns found"})]})]})}function c7({onClose:e,onSuccess:t}){const[r,n]=h.useState(""),[i,s]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState("grid"),[u,f]=h.useState(!0),[p,m]=h.useState(!1),[x,g]=h.useState(null),b=async v=>{v.preventDefault(),m(!0);try{await B.createCampaign({name:r,slug:i,description:o,display_style:c,active:u}),t()}catch(j){g({message:"Failed to create campaign: "+j.message,type:"error"})}finally{m(!1)}};return a.jsxs("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"20px"},children:[x&&a.jsx(Vn,{message:x.message,type:x.type,onClose:()=>g(null)}),a.jsx("h3",{style:{marginBottom:"20px"},children:"Create New Campaign"}),a.jsxs("form",{onSubmit:b,children:[a.jsxs("div",{style:{display:"grid",gap:"15px"},children:[a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"5px",fontWeight:"500"},children:"Name *"}),a.jsx("input",{type:"text",value:r,onChange:v=>n(v.target.value),required:!0,style:{width:"100%",padding:"10px",border:"1px solid #ddd",borderRadius:"6px"}})]}),a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"5px",fontWeight:"500"},children:"Slug *"}),a.jsx("input",{type:"text",value:i,onChange:v=>s(v.target.value),required:!0,placeholder:"e.g., summer-sale",style:{width:"100%",padding:"10px",border:"1px solid #ddd",borderRadius:"6px"}})]}),a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"5px",fontWeight:"500"},children:"Description"}),a.jsx("textarea",{value:o,onChange:v=>l(v.target.value),rows:3,style:{width:"100%",padding:"10px",border:"1px solid #ddd",borderRadius:"6px"}})]}),a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"5px",fontWeight:"500"},children:"Display Style"}),a.jsxs("select",{value:c,onChange:v=>d(v.target.value),style:{width:"100%",padding:"10px",border:"1px solid #ddd",borderRadius:"6px"},children:[a.jsx("option",{value:"grid",children:"Grid"}),a.jsx("option",{value:"list",children:"List"}),a.jsx("option",{value:"carousel",children:"Carousel"})]})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[a.jsx("input",{type:"checkbox",id:"active",checked:u,onChange:v=>f(v.target.checked)}),a.jsx("label",{htmlFor:"active",children:"Active"})]})]}),a.jsxs("div",{style:{display:"flex",gap:"10px",marginTop:"20px"},children:[a.jsx("button",{type:"submit",disabled:p,style:{padding:"10px 20px",background:p?"#999":"#667eea",color:"white",border:"none",borderRadius:"6px",cursor:p?"not-allowed":"pointer",fontSize:"14px"},children:p?"Creating...":"Create Campaign"}),a.jsx("button",{type:"button",onClick:e,style:{padding:"10px 20px",background:"#ddd",color:"#333",border:"none",borderRadius:"6px",cursor:"pointer",fontSize:"14px"},children:"Cancel"})]})]})]})}function u7(){var l,c,d,u;const[e,t]=h.useState(null),[r,n]=h.useState(!0),[i,s]=h.useState(30);h.useEffect(()=>{o()},[i]);const o=async()=>{n(!0);try{const f=await B.getAnalyticsOverview(i);t(f)}catch(f){console.error("Failed to load analytics:",f)}finally{n(!1)}};return r?a.jsx(X,{children:a.jsx("div",{children:"Loading..."})}):a.jsx(X,{children:a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Analytics"}),a.jsxs("select",{value:i,onChange:f=>s(parseInt(f.target.value)),style:{padding:"10px 15px",border:"1px solid #ddd",borderRadius:"6px",fontSize:"14px"},children:[a.jsx("option",{value:7,children:"Last 7 days"}),a.jsx("option",{value:30,children:"Last 30 days"}),a.jsx("option",{value:90,children:"Last 90 days"}),a.jsx("option",{value:365,children:"Last year"})]})]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(250px, 1fr))",gap:"20px",marginBottom:"30px"},children:[a.jsx(wv,{title:"Total Clicks",value:((l=e==null?void 0:e.overview)==null?void 0:l.total_clicks)||0,icon:"👆",color:"#3498db"}),a.jsx(wv,{title:"Unique Products Clicked",value:((c=e==null?void 0:e.overview)==null?void 0:c.unique_products)||0,icon:"📦",color:"#2ecc71"})]}),a.jsxs("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"30px"},children:[a.jsx("h3",{style:{marginBottom:"20px"},children:"Clicks Over Time"}),((d=e==null?void 0:e.clicks_by_day)==null?void 0:d.length)>0?a.jsx("div",{style:{overflowX:"auto"},children:a.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:"8px",minWidth:"600px",height:"200px"},children:e.clicks_by_day.slice().reverse().map((f,p)=>{const m=Math.max(...e.clicks_by_day.map(g=>g.clicks)),x=f.clicks/m*180;return a.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center"},children:[a.jsx("div",{style:{width:"100%",height:`${x}px`,background:"#667eea",borderRadius:"4px 4px 0 0",position:"relative",minHeight:"2px"},title:`${f.clicks} clicks`,children:a.jsx("div",{style:{position:"absolute",top:"-25px",left:"50%",transform:"translateX(-50%)",fontSize:"12px",fontWeight:"bold"},children:f.clicks})}),a.jsx("div",{style:{fontSize:"10px",marginTop:"5px",color:"#666",transform:"rotate(-45deg)",transformOrigin:"left",whiteSpace:"nowrap"},children:new Date(f.date).toLocaleDateString("en-US",{month:"short",day:"numeric"})})]},p)})})}):a.jsx("div",{style:{color:"#999",textAlign:"center",padding:"40px"},children:"No click data for this period"})]}),a.jsxs("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("h3",{style:{marginBottom:"20px"},children:"Top Products"}),((u=e==null?void 0:e.top_products)==null?void 0:u.length)>0?a.jsx("div",{children:e.top_products.map((f,p)=>a.jsxs("div",{style:{padding:"15px 0",borderBottom:p<e.top_products.length-1?"1px solid #eee":"none",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{style:{fontWeight:"500",marginBottom:"5px"},children:f.name}),a.jsx("div",{style:{fontSize:"14px",color:"#666"},children:f.price?`$${f.price}`:"No price"})]}),a.jsxs("div",{style:{padding:"8px 16px",background:"#667eea",color:"white",borderRadius:"20px",fontWeight:"bold",fontSize:"14px"},children:[f.click_count," clicks"]})]},p))}):a.jsx("div",{style:{color:"#999",textAlign:"center",padding:"40px"},children:"No product clicks yet"})]})]})})}function wv({title:e,value:t,icon:r,color:n}){return a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderLeft:`4px solid ${n}`},children:[a.jsx("div",{style:{fontSize:"32px",marginBottom:"10px"},children:r}),a.jsx("div",{style:{fontSize:"14px",color:"#666",marginBottom:"5px"},children:e}),a.jsx("div",{style:{fontSize:"28px",fontWeight:"bold"},children:t})]})}function d7(){const[e,t]=h.useState([]),[r,n]=h.useState(!0),[i,s]=h.useState(!1),[o,l]=h.useState({}),[c,d]=h.useState(null);h.useEffect(()=>{u()},[]);const u=async()=>{n(!0);try{const x=await B.getSettings();t(x.settings)}catch(x){console.error("Failed to load settings:",x)}finally{n(!1)}},f=(x,g)=>{l(b=>({...b,[x]:g}))},p=async()=>{s(!0);try{const x=Object.entries(o).map(([g,b])=>({key:g,value:b}));await B.updateSettings(x),l({}),u(),d({message:"Settings saved successfully!",type:"success"})}catch(x){d({message:"Failed to save settings: "+x.message,type:"error"})}finally{s(!1)}},m=Object.keys(o).length>0;return r?a.jsx(X,{children:a.jsx("div",{children:"Loading..."})}):a.jsxs(X,{children:[c&&a.jsx(Vn,{message:c.message,type:c.type,onClose:()=>d(null)}),a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Settings"}),m&&a.jsx("button",{onClick:p,disabled:i,style:{padding:"12px 24px",background:i?"#999":"#2ecc71",color:"white",border:"none",borderRadius:"6px",cursor:i?"not-allowed":"pointer",fontSize:"14px",fontWeight:"500"},children:i?"Saving...":"Save Changes"})]}),a.jsx("div",{style:{background:"white",padding:"25px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:a.jsx("div",{style:{display:"grid",gap:"25px"},children:e.map(x=>{const g=o[x.key]!==void 0?o[x.key]:x.value;return a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"500",fontSize:"16px"},children:f7(x.key)}),x.description&&a.jsx("div",{style:{fontSize:"13px",color:"#666",marginBottom:"8px"},children:x.description}),a.jsx("input",{type:"text",value:g,onChange:b=>f(x.key,b.target.value),style:{width:"100%",maxWidth:"500px",padding:"10px",border:o[x.key]!==void 0?"2px solid #667eea":"1px solid #ddd",borderRadius:"6px",fontSize:"14px"}}),a.jsxs("div",{style:{fontSize:"12px",color:"#999",marginTop:"5px"},children:["Last updated: ",new Date(x.updated_at).toLocaleString()]})]},x.key)})})}),m&&a.jsx("div",{style:{marginTop:"20px",padding:"15px",background:"#fff3cd",border:"1px solid #ffc107",borderRadius:"6px",color:"#856404"},children:'⚠️ You have unsaved changes. Click "Save Changes" to apply them.'})]})]})}function f7(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function p7(){const[e,t]=h.useState([]),[r,n]=h.useState(!0),[i,s]=h.useState(!1),[o,l]=h.useState({}),[c,d]=h.useState(null),[u,f]=h.useState(null);h.useEffect(()=>{p(),m()},[]),h.useEffect(()=>{if(!(c!=null&&c.id))return;if(c.status==="completed"||c.status==="cancelled"||c.status==="failed"){p();return}const P=setInterval(async()=>{try{const _=await B.getProxyTestJob(c.id);d(_.job),(_.job.status==="completed"||_.job.status==="cancelled"||_.job.status==="failed")&&(clearInterval(P),p())}catch(_){console.error("Failed to poll job status:",_)}},2e3);return()=>clearInterval(P)},[c==null?void 0:c.id]);const p=async()=>{n(!0);try{const N=await B.getProxies();t(N.proxies)}catch(N){console.error("Failed to load proxies:",N)}finally{n(!1)}},m=async()=>{try{const N=await B.getActiveProxyTestJob();N.job&&d(N.job)}catch{console.log("No active job found")}},x=async N=>{l(P=>({...P,[N]:!0}));try{await B.testProxy(N),p()}catch(P){f({message:"Test failed: "+P.message,type:"error"})}finally{l(P=>({...P,[N]:!1}))}},g=async N=>{l(P=>({...P,[N]:!0})),B.testProxy(N).then(()=>{p(),l(P=>({...P,[N]:!1}))}).catch(()=>{l(P=>({...P,[N]:!1}))})},b=async()=>{try{const N=await B.testAllProxies();f({message:"Proxy testing job started",type:"success"}),d({id:N.jobId,status:"pending",tested_proxies:0,total_proxies:e.length,passed_proxies:0,failed_proxies:0})}catch(N){f({message:"Failed to start testing: "+N.message,type:"error"})}},v=async()=>{if(c!=null&&c.id)try{await B.cancelProxyTestJob(c.id),f({message:"Job cancelled",type:"info"})}catch(N){f({message:"Failed to cancel job: "+N.message,type:"error"})}},j=async()=>{try{await B.updateProxyLocations(),f({message:"Location update job started",type:"success"})}catch(N){f({message:"Failed to start location update: "+N.message,type:"error"})}},y=async N=>{if(confirm("Delete this proxy?"))try{await B.deleteProxy(N),p()}catch(P){f({message:"Failed to delete proxy: "+P.message,type:"error"})}};if(r)return a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-blue-600 rounded-full animate-spin"})})});const w={total:e.length,passed:e.filter(N=>N.active).length,failed:e.filter(N=>!N.active).length},S=w.total>0?Math.round(w.passed/w.total*100):0;return a.jsxs(X,{children:[u&&a.jsx(Vn,{message:u.message,type:u.type,onClose:()=>f(null)}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(sl,{className:"w-6 h-6 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-semibold text-gray-900",children:"Proxies"}),a.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[w.total," total • ",w.passed," active • ",w.failed," inactive"]})]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("button",{onClick:b,disabled:!!c&&c.status!=="completed"&&c.status!=="cancelled"&&c.status!=="failed",className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-50 text-blue-700 rounded-lg hover:bg-blue-100 transition-colors text-sm font-medium disabled:opacity-50 disabled:cursor-not-allowed",children:[a.jsx(Xt,{className:"w-4 h-4"}),"Test All"]}),a.jsxs("button",{onClick:j,className:"inline-flex items-center gap-2 px-4 py-2 bg-purple-50 text-purple-700 rounded-lg hover:bg-purple-100 transition-colors text-sm font-medium",children:[a.jsx(yi,{className:"w-4 h-4"}),"Update Locations"]}),a.jsxs("button",{onClick:()=>s(!0),className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors text-sm font-medium",children:[a.jsx(Af,{className:"w-4 h-4"}),"Add Proxy"]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(sl,{className:"w-5 h-5 text-blue-600"})}),a.jsx("div",{className:"flex items-center gap-1 text-xs text-gray-500",children:a.jsxs("span",{children:[S,"% pass rate"]})})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Proxies"}),a.jsx("p",{className:"text-3xl font-semibold text-gray-900",children:w.total})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-green-50 rounded-lg",children:a.jsx(_r,{className:"w-5 h-5 text-green-600"})}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600",children:[a.jsx(zn,{className:"w-3 h-3"}),a.jsxs("span",{children:[Math.round(w.passed/w.total*100)||0,"%"]})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Active"}),a.jsx("p",{className:"text-3xl font-semibold text-green-600",children:w.passed}),a.jsx("p",{className:"text-xs text-gray-500",children:"Passing health checks"})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-2 bg-red-50 rounded-lg",children:a.jsx(Hr,{className:"w-5 h-5 text-red-600"})}),a.jsx("div",{className:"flex items-center gap-1 text-xs text-red-600",children:a.jsxs("span",{children:[Math.round(w.failed/w.total*100)||0,"%"]})})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Inactive"}),a.jsx("p",{className:"text-3xl font-semibold text-red-600",children:w.failed}),a.jsx("p",{className:"text-xs text-gray-500",children:"Failed health checks"})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsx("div",{className:"p-2 bg-purple-50 rounded-lg",children:a.jsx(zn,{className:"w-5 h-5 text-purple-600"})})}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Success Rate"}),a.jsxs("p",{className:"text-3xl font-semibold text-gray-900",children:[S,"%"]}),a.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2 mt-3",children:a.jsx("div",{className:"bg-green-600 h-2 rounded-full transition-all",style:{width:`${S}%`}})})]})]})]}),c&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(Xt,{className:`w-5 h-5 text-blue-600 ${c.status==="running"?"animate-spin":""}`})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-gray-900",children:"Proxy Testing Job"}),a.jsx("p",{className:"text-sm text-gray-500",children:c.status.charAt(0).toUpperCase()+c.status.slice(1)})]})]}),a.jsxs("div",{className:"flex gap-2",children:[c.status==="running"&&a.jsx("button",{onClick:v,className:"px-3 py-1.5 bg-red-50 text-red-700 rounded-lg hover:bg-red-100 transition-colors text-sm font-medium",children:"Cancel"}),(c.status==="completed"||c.status==="cancelled"||c.status==="failed")&&a.jsx("button",{onClick:()=>d(null),className:"px-3 py-1.5 text-gray-600 hover:bg-gray-50 rounded-lg transition-colors text-sm font-medium",children:"Dismiss"})]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:["Progress: ",c.tested_proxies||0," / ",c.total_proxies||0," proxies tested"]}),a.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:a.jsx("div",{className:`h-2 rounded-full transition-all ${c.status==="completed"?"bg-green-600":c.status==="cancelled"||c.status==="failed"?"bg-red-600":"bg-blue-600"}`,style:{width:`${(c.tested_proxies||0)/(c.total_proxies||100)*100}%`}})})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Passed:"}),a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-green-50 text-green-700 rounded",children:c.passed_proxies||0})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Failed:"}),a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-red-50 text-red-700 rounded",children:c.failed_proxies||0})]})]}),c.error&&a.jsxs("div",{className:"mt-4 p-3 bg-red-50 border border-red-200 rounded-lg flex items-start gap-2",children:[a.jsx(Uc,{className:"w-5 h-5 text-red-600 flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-red-900",children:"Error"}),a.jsx("p",{className:"text-sm text-red-700",children:c.error})]})]})]}),i&&a.jsx(h7,{onClose:()=>s(!1),onSuccess:()=>{s(!1),p()}}),a.jsx("div",{className:"space-y-3",children:e.map(N=>a.jsx("div",{className:"bg-white rounded-xl border border-gray-200 p-4 hover:shadow-lg transition-shadow",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsxs("h3",{className:"font-semibold text-gray-900",children:[N.protocol,"://",N.host,":",N.port]}),a.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded ${N.active?"bg-green-50 text-green-700":"bg-red-50 text-red-700"}`,children:N.active?"Active":"Inactive"}),N.is_anonymous&&a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-blue-50 text-blue-700 rounded",children:"Anonymous"}),(N.city||N.state||N.country)&&a.jsxs("span",{className:"px-2 py-1 text-xs font-medium bg-purple-50 text-purple-700 rounded flex items-center gap-1",children:[a.jsx(yi,{className:"w-3 h-3"}),N.city&&`${N.city}/`,N.state&&`${N.state.substring(0,2).toUpperCase()} `,N.country]})]}),a.jsx("div",{className:"text-sm text-gray-600",children:N.last_tested_at?a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(xr,{className:"w-4 h-4 text-gray-400"}),a.jsxs("span",{children:["Last tested: ",new Date(N.last_tested_at).toLocaleString()]})]}),N.test_result==="success"?a.jsxs("span",{className:"flex items-center gap-1 text-green-600",children:[a.jsx(_r,{className:"w-4 h-4"}),"Success (",N.response_time_ms,"ms)"]}):a.jsxs("span",{className:"flex items-center gap-1 text-red-600",children:[a.jsx(Hr,{className:"w-4 h-4"}),"Failed"]})]}):"Not tested yet"})]}),a.jsxs("div",{className:"flex gap-2",children:[N.active?a.jsx("button",{onClick:()=>x(N.id),disabled:o[N.id],className:"inline-flex items-center gap-1 px-3 py-1.5 bg-blue-50 text-blue-700 rounded-lg hover:bg-blue-100 transition-colors text-sm font-medium disabled:opacity-50",children:o[N.id]?a.jsx("div",{className:"w-4 h-4 border-2 border-blue-700 border-t-transparent rounded-full animate-spin"}):a.jsxs(a.Fragment,{children:[a.jsx(Xt,{className:"w-4 h-4"}),"Test"]})}):a.jsx("button",{onClick:()=>g(N.id),disabled:o[N.id],className:"inline-flex items-center gap-1 px-3 py-1.5 bg-yellow-50 text-yellow-700 rounded-lg hover:bg-yellow-100 transition-colors text-sm font-medium disabled:opacity-50",children:o[N.id]?a.jsx("div",{className:"w-4 h-4 border-2 border-yellow-700 border-t-transparent rounded-full animate-spin"}):a.jsxs(a.Fragment,{children:[a.jsx(Xt,{className:"w-4 h-4"}),"Retest"]})}),a.jsxs("button",{onClick:()=>y(N.id),className:"inline-flex items-center gap-1 px-3 py-1.5 bg-red-50 text-red-700 rounded-lg hover:bg-red-100 transition-colors text-sm font-medium",children:[a.jsx(RO,{className:"w-4 h-4"}),"Delete"]})]})]})},N.id))}),e.length===0&&!i&&a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[a.jsx(sl,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"No proxies configured"}),a.jsx("p",{className:"text-gray-500 mb-6",children:"Add your first proxy to get started with scraping"}),a.jsxs("button",{onClick:()=>s(!0),className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium",children:[a.jsx(Af,{className:"w-4 h-4"}),"Add Proxy"]})]})]})]})}function h7({onClose:e,onSuccess:t}){const[r,n]=h.useState("single"),[i,s]=h.useState(""),[o,l]=h.useState(""),[c,d]=h.useState("http"),[u,f]=h.useState(""),[p,m]=h.useState(""),[x,g]=h.useState(""),[b,v]=h.useState(!1),[j,y]=h.useState(null),w=_=>{if(_=_.trim(),!_||_.startsWith("#"))return null;let T;return T=_.match(/^(https?|socks5):\/\/([^:]+):([^@]+)@([^:]+):(\d+)$/),T?{protocol:T[1],username:T[2],password:T[3],host:T[4],port:parseInt(T[5])}:(T=_.match(/^(https?|socks5):\/\/([^:]+):(\d+)$/),T?{protocol:T[1],host:T[2],port:parseInt(T[3])}:(T=_.match(/^([^:]+):(\d+):([^:]+):(.+)$/),T?{protocol:"http",host:T[1],port:parseInt(T[2]),username:T[3],password:T[4]}:(T=_.match(/^([^:]+):(\d+)$/),T?{protocol:"http",host:T[1],port:parseInt(T[2])}:null)))},S=async()=>{const T=x.split(`
`).map($=>w($)).filter($=>$!==null);if(T.length===0){y({message:"No valid proxies found. Please check the format.",type:"error"});return}v(!0);try{const $=await B.addProxiesBulk(T),M=`Import complete!
Added: ${$.added}
Duplicates: ${$.duplicates||0}
Failed: ${$.failed}
Proxies are inactive by default. Use "Test All Proxies" to verify and activate them.`;y({message:M,type:"success"}),t()}catch($){y({message:"Failed to import proxies: "+$.message,type:"error"})}finally{v(!1)}},N=async _=>{var M;const T=(M=_.target.files)==null?void 0:M[0];if(!T)return;const $=await T.text();g($)},P=async _=>{if(_.preventDefault(),r==="bulk"){await S();return}v(!0);try{await B.addProxy({host:i,port:parseInt(o),protocol:c,username:u||void 0,password:p||void 0}),t()}catch(T){y({message:"Failed to add proxy: "+T.message,type:"error"})}finally{v(!1)}};return a.jsxs("div",{className:"bg-white rounded-xl border border-gray-200",children:[j&&a.jsx(Vn,{message:j.message,type:j.type,onClose:()=>y(null)}),a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Add Proxies"}),a.jsxs("div",{className:"flex bg-gray-100 rounded-lg p-1",children:[a.jsx("button",{type:"button",onClick:()=>n("single"),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${r==="single"?"bg-white text-gray-900 shadow-sm":"text-gray-600 hover:text-gray-900"}`,children:"Single"}),a.jsx("button",{type:"button",onClick:()=>n("bulk"),className:`px-4 py-2 rounded-md text-sm font-medium transition-colors ${r==="bulk"?"bg-white text-gray-900 shadow-sm":"text-gray-600 hover:text-gray-900"}`,children:"Bulk Import"})]})]}),a.jsxs("form",{onSubmit:P,children:[r==="single"?a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Host *"}),a.jsx("input",{type:"text",value:i,onChange:_=>s(_.target.value),required:!0,placeholder:"proxy.example.com",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Port *"}),a.jsx("input",{type:"number",value:o,onChange:_=>l(_.target.value),required:!0,placeholder:"8080",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Protocol *"}),a.jsxs("select",{value:c,onChange:_=>d(_.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500",children:[a.jsx("option",{value:"http",children:"HTTP"}),a.jsx("option",{value:"https",children:"HTTPS"}),a.jsx("option",{value:"socks5",children:"SOCKS5"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Username"}),a.jsx("input",{type:"text",value:u,onChange:_=>f(_.target.value),placeholder:"Optional",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Password"}),a.jsx("input",{type:"password",value:p,onChange:_=>m(_.target.value),placeholder:"Optional",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"})]})]}):a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Upload File"}),a.jsxs("label",{className:"flex items-center justify-center w-full px-4 py-6 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer hover:border-blue-500 hover:bg-blue-50 transition-colors",children:[a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx(HO,{className:"w-8 h-8 text-gray-400 mb-2"}),a.jsx("span",{className:"text-sm text-gray-600",children:"Click to upload or drag and drop"}),a.jsx("span",{className:"text-xs text-gray-500 mt-1",children:".txt or .list files"})]}),a.jsx("input",{type:"file",accept:".txt,.list",onChange:N,className:"hidden"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Or Paste Proxies (one per line)"}),a.jsx("textarea",{value:x,onChange:_=>g(_.target.value),placeholder:`Supported formats:
host:port
protocol://host:port
host:port:username:password
protocol://username:password@host:port
Example:
192.168.1.1:8080
http://proxy.example.com:3128
10.0.0.1:8080:user:pass
socks5://user:pass@proxy.example.com:1080`,rows:12,className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 font-mono text-sm"})]}),a.jsxs("div",{className:"p-3 bg-blue-50 border border-blue-200 rounded-lg flex items-start gap-2",children:[a.jsx(Uc,{className:"w-5 h-5 text-blue-600 flex-shrink-0 mt-0.5"}),a.jsx("span",{className:"text-sm text-blue-900",children:"Lines starting with # are treated as comments and ignored."})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 mt-6 pt-6 border-t border-gray-200",children:[a.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 text-gray-700 hover:bg-gray-50 rounded-lg transition-colors font-medium",children:"Cancel"}),a.jsx("button",{type:"submit",disabled:b,className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors font-medium disabled:opacity-50 disabled:cursor-not-allowed",children:b?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"}),a.jsx("span",{children:"Processing..."})]}):a.jsxs(a.Fragment,{children:[a.jsx(Af,{className:"w-4 h-4"}),r==="bulk"?"Import Proxies":"Add Proxy"]})})]})]})]})]})}function m7(){const[e,t]=h.useState([]),[r,n]=h.useState(!0),[i,s]=h.useState(!0),[o,l]=h.useState(""),[c,d]=h.useState(""),[u,f]=h.useState(200),[p,m]=h.useState(null),x=h.useRef(null);h.useEffect(()=>{g()},[o,c,u]),h.useEffect(()=>{if(!i)return;const S=setInterval(()=>{g()},2e3);return()=>clearInterval(S)},[i,o,c,u]);const g=async()=>{try{const S=await B.getLogs(u,o,c);t(S.logs)}catch(S){console.error("Failed to load logs:",S)}finally{n(!1)}},b=async()=>{if(confirm("Are you sure you want to clear all logs?"))try{await B.clearLogs(),t([]),m({message:"Logs cleared successfully",type:"success"})}catch(S){m({message:"Failed to clear logs: "+S.message,type:"error"})}},v=()=>{var S;(S=x.current)==null||S.scrollIntoView({behavior:"smooth"})},j=S=>{switch(S){case"error":return"#dc3545";case"warn":return"#ffc107";case"info":return"#17a2b8";case"debug":return"#6c757d";default:return"#333"}},y=S=>{switch(S){case"error":return"#f8d7da";case"warn":return"#fff3cd";case"info":return"#d1ecf1";case"debug":return"#e2e3e5";default:return"#f8f9fa"}},w=S=>{switch(S){case"scraper":return"🔍";case"images":return"📸";case"categories":return"📂";case"system":return"⚙️";case"api":return"🌐";default:return"📝"}};return r?a.jsx(X,{children:a.jsx("div",{children:"Loading logs..."})}):a.jsxs(X,{children:[p&&a.jsx(Vn,{message:p.message,type:p.type,onClose:()=>m(null)}),a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"System Logs"}),a.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[a.jsx("input",{type:"checkbox",checked:i,onChange:S=>s(S.target.checked)}),"Auto-refresh (2s)"]}),a.jsx("button",{onClick:v,style:{padding:"8px 16px",background:"#6c757d",color:"white",border:"none",borderRadius:"6px",cursor:"pointer"},children:"⬇️ Scroll to Bottom"}),a.jsx("button",{onClick:b,style:{padding:"8px 16px",background:"#dc3545",color:"white",border:"none",borderRadius:"6px",cursor:"pointer"},children:"🗑️ Clear Logs"})]})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"20px",display:"flex",gap:"15px",flexWrap:"wrap"},children:[a.jsxs("select",{value:o,onChange:S=>l(S.target.value),style:{padding:"10px",border:"1px solid #ddd",borderRadius:"6px"},children:[a.jsx("option",{value:"",children:"All Levels"}),a.jsx("option",{value:"info",children:"Info"}),a.jsx("option",{value:"warn",children:"Warning"}),a.jsx("option",{value:"error",children:"Error"}),a.jsx("option",{value:"debug",children:"Debug"})]}),a.jsxs("select",{value:c,onChange:S=>d(S.target.value),style:{padding:"10px",border:"1px solid #ddd",borderRadius:"6px"},children:[a.jsx("option",{value:"",children:"All Categories"}),a.jsx("option",{value:"scraper",children:"🔍 Scraper"}),a.jsx("option",{value:"images",children:"📸 Images"}),a.jsx("option",{value:"categories",children:"📂 Categories"}),a.jsx("option",{value:"system",children:"⚙️ System"}),a.jsx("option",{value:"api",children:"🌐 API"})]}),a.jsxs("select",{value:u,onChange:S=>f(parseInt(S.target.value)),style:{padding:"10px",border:"1px solid #ddd",borderRadius:"6px"},children:[a.jsx("option",{value:"50",children:"Last 50"}),a.jsx("option",{value:"100",children:"Last 100"}),a.jsx("option",{value:"200",children:"Last 200"}),a.jsx("option",{value:"500",children:"Last 500"}),a.jsx("option",{value:"1000",children:"Last 1000"})]}),a.jsx("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"10px"},children:a.jsxs("span",{style:{fontSize:"14px",color:"#666"},children:["Showing ",e.length," logs"]})})]}),a.jsxs("div",{style:{background:"#1e1e1e",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",maxHeight:"70vh",overflowY:"auto",fontFamily:"monospace",fontSize:"13px"},children:[e.length===0?a.jsx("div",{style:{color:"#999",textAlign:"center",padding:"40px"},children:"No logs to display"}):e.map((S,N)=>a.jsxs("div",{style:{padding:"8px 12px",marginBottom:"4px",borderRadius:"4px",background:y(S.level),borderLeft:`4px solid ${j(S.level)}`,display:"flex",gap:"10px",alignItems:"flex-start"},children:[a.jsx("span",{style:{color:"#666",fontSize:"11px",whiteSpace:"nowrap"},children:new Date(S.timestamp).toLocaleTimeString()}),a.jsx("span",{style:{fontSize:"14px"},children:w(S.category)}),a.jsx("span",{style:{padding:"2px 6px",borderRadius:"3px",fontSize:"10px",fontWeight:"bold",background:j(S.level),color:"white",textTransform:"uppercase"},children:S.level}),a.jsx("span",{style:{padding:"2px 6px",borderRadius:"3px",fontSize:"10px",background:"#e2e3e5",color:"#333"},children:S.category}),a.jsx("span",{style:{flex:1,color:"#333",wordBreak:"break-word"},children:S.message})]},N)),a.jsx("div",{ref:x})]})]})]})}function g7(){const[e,t]=h.useState([]),[r,n]=h.useState([]),[i,s]=h.useState(null),[o,l]=h.useState([]),[c,d]=h.useState([]),[u,f]=h.useState([]),[p,m]=h.useState(!0),[x,g]=h.useState(!0),[b,v]=h.useState("az-live"),[j,y]=h.useState(null),[w,S]=h.useState(""),[N,P]=h.useState(null),[_,T]=h.useState({scheduledJobs:[],crawlJobs:[],inMemoryScrapers:[],totalActive:0}),[$,M]=h.useState({jobLogs:[],crawlJobs:[]}),[C,R]=h.useState([]);h.useEffect(()=>{if(q(),x){const E=setInterval(q,3e3);return()=>clearInterval(E)}},[x]);const q=async()=>{try{const[E,D,O,k,L,U]=await Promise.all([B.getActiveScrapers(),B.getScraperHistory(),B.getJobStats(),B.getActiveJobs(),B.getWorkerStats(),B.getRecentJobs({limit:50})]);t(E.scrapers||[]),n(D.history||[]),s(O),l(k.jobs||[]),d(L.workers||[]),f(U.jobs||[]);const[H,te,re,we]=await Promise.all([B.getAZMonitorSummary().catch(()=>null),B.getAZMonitorActiveJobs().catch(()=>({scheduledJobs:[],crawlJobs:[],inMemoryScrapers:[],totalActive:0})),B.getAZMonitorRecentJobs(30).catch(()=>({jobLogs:[],crawlJobs:[]})),B.getAZMonitorErrors({limit:10,hours:24}).catch(()=>({errors:[]}))]);P(H),T(te),M(re),R((we==null?void 0:we.errors)||[])}catch(E){console.error("Failed to load scraper data:",E)}finally{m(!1)}},Z=E=>{const D=Math.floor(E/1e3),O=Math.floor(D/60),k=Math.floor(O/60);return k>0?`${k}h ${O%60}m ${D%60}s`:O>0?`${O}m ${D%60}s`:`${D}s`};return a.jsx(X,{children:a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Scraper Monitor"}),a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:x,onChange:E=>g(E.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),a.jsx("span",{children:"Auto-refresh (3s)"})]})]}),a.jsxs("div",{style:{marginBottom:"30px",display:"flex",gap:"10px",borderBottom:"2px solid #eee"},children:[a.jsxs("button",{onClick:()=>v("az-live"),style:{padding:"12px 24px",background:b==="az-live"?"white":"transparent",border:"none",borderBottom:b==="az-live"?"3px solid #10b981":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:b==="az-live"?"600":"400",color:b==="az-live"?"#10b981":"#666",marginBottom:"-2px"},children:["AZ Live ",_.totalActive>0&&a.jsx("span",{style:{marginLeft:"8px",padding:"2px 8px",background:"#10b981",color:"white",borderRadius:"10px",fontSize:"12px"},children:_.totalActive})]}),a.jsx("button",{onClick:()=>v("jobs"),style:{padding:"12px 24px",background:b==="jobs"?"white":"transparent",border:"none",borderBottom:b==="jobs"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:b==="jobs"?"600":"400",color:b==="jobs"?"#2563eb":"#666",marginBottom:"-2px"},children:"Dispensary Jobs"}),a.jsx("button",{onClick:()=>v("scrapers"),style:{padding:"12px 24px",background:b==="scrapers"?"white":"transparent",border:"none",borderBottom:b==="scrapers"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:b==="scrapers"?"600":"400",color:b==="scrapers"?"#2563eb":"#666",marginBottom:"-2px"},children:"Crawl History"})]}),b==="az-live"&&a.jsxs(a.Fragment,{children:[N&&a.jsx("div",{style:{marginBottom:"30px"},children:a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:"15px"},children:[a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Running Jobs"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:_.totalActive>0?"#10b981":"#666"},children:_.totalActive})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Successful (24h)"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#10b981"},children:(N.successful_jobs_24h||0)+(N.successful_crawls_24h||0)})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Failed (24h)"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:(N.failed_jobs_24h||0)+(N.failed_crawls_24h||0)>0?"#ef4444":"#666"},children:(N.failed_jobs_24h||0)+(N.failed_crawls_24h||0)})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Products (24h)"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#8b5cf6"},children:N.products_found_24h||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Snapshots (24h)"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#06b6d4"},children:N.snapshots_created_24h||0})]})]})}),a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px",display:"flex",alignItems:"center",gap:"10px"},children:["Active Jobs",_.totalActive>0&&a.jsxs("span",{style:{padding:"4px 12px",background:"#d1fae5",color:"#065f46",borderRadius:"12px",fontSize:"14px",fontWeight:"600"},children:[_.totalActive," running"]})]}),_.totalActive===0?a.jsxs("div",{style:{background:"white",padding:"60px 40px",borderRadius:"8px",textAlign:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"48px",marginBottom:"20px"},children:"😴"}),a.jsx("div",{style:{fontSize:"18px",color:"#666"},children:"No jobs currently running"})]}):a.jsxs("div",{style:{display:"grid",gap:"15px"},children:[_.scheduledJobs.map(E=>a.jsx("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderLeft:"4px solid #10b981"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"},children:E.job_name}),a.jsx("div",{style:{fontSize:"14px",color:"#666",marginBottom:"12px"},children:E.job_description||"Scheduled job"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(120px, 1fr))",gap:"12px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Processed"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600"},children:E.items_processed||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Succeeded"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#10b981"},children:E.items_succeeded||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Failed"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:E.items_failed>0?"#ef4444":"#666"},children:E.items_failed||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Duration"}),a.jsxs("div",{style:{fontSize:"16px",fontWeight:"600"},children:[Math.floor((E.duration_seconds||0)/60),"m ",Math.floor((E.duration_seconds||0)%60),"s"]})]})]})]}),a.jsx("div",{style:{padding:"6px 12px",borderRadius:"4px",fontSize:"13px",fontWeight:"600",background:"#d1fae5",color:"#065f46"},children:"RUNNING"})]})},`sched-${E.id}`)),_.crawlJobs.map(E=>a.jsx("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderLeft:"4px solid #3b82f6"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"},children:E.dispensary_name||"Unknown Store"}),a.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"12px"},children:[E.city," | ",E.job_type||"crawl"]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(120px, 1fr))",gap:"12px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Products Found"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#8b5cf6"},children:E.products_found||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Snapshots"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#06b6d4"},children:E.snapshots_created||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Duration"}),a.jsxs("div",{style:{fontSize:"16px",fontWeight:"600"},children:[Math.floor((E.duration_seconds||0)/60),"m ",Math.floor((E.duration_seconds||0)%60),"s"]})]})]})]}),a.jsx("div",{style:{padding:"6px 12px",borderRadius:"4px",fontSize:"13px",fontWeight:"600",background:"#dbeafe",color:"#1e40af"},children:"CRAWLING"})]})},`crawl-${E.id}`))]})]}),(N==null?void 0:N.nextRuns)&&N.nextRuns.length>0&&a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsx("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:"Next Scheduled Runs"}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Job"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Next Run"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Last Status"})]})}),a.jsx("tbody",{children:N.nextRuns.map(E=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600"},children:E.job_name}),a.jsx("div",{style:{fontSize:"13px",color:"#666"},children:E.description})]}),a.jsx("td",{style:{padding:"15px"},children:a.jsx("div",{style:{fontWeight:"600",color:"#2563eb"},children:E.next_run_at?new Date(E.next_run_at).toLocaleString():"-"})}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",background:E.last_status==="success"?"#d1fae5":E.last_status==="error"?"#fee2e2":"#fef3c7",color:E.last_status==="success"?"#065f46":E.last_status==="error"?"#991b1b":"#92400e"},children:E.last_status||"never"})})]},E.id))})]})})]}),C.length>0&&a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsx("h2",{style:{fontSize:"24px",marginBottom:"20px",color:"#ef4444"},children:"Recent Errors (24h)"}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:C.map((E,D)=>a.jsxs("div",{style:{padding:"15px",borderBottom:D<C.length-1?"1px solid #eee":"none"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start",marginBottom:"8px"},children:[a.jsx("div",{style:{fontWeight:"600"},children:E.job_name||E.dispensary_name}),a.jsx("span",{style:{padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:"600",background:"#fee2e2",color:"#991b1b"},children:E.status})]}),E.error_message&&a.jsx("div",{style:{fontSize:"13px",color:"#991b1b",background:"#fef2f2",padding:"8px",borderRadius:"4px"},children:E.error_message}),a.jsx("div",{style:{fontSize:"12px",color:"#999",marginTop:"8px"},children:E.started_at?new Date(E.started_at).toLocaleString():"-"})]},D))})]}),a.jsxs("div",{children:[a.jsx("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:"Recent Job Runs"}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Job"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Status"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Processed"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Duration"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Completed"})]})}),a.jsx("tbody",{children:$.jobLogs.slice(0,20).map(E=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600"},children:E.job_name}),a.jsxs("div",{style:{fontSize:"12px",color:"#999"},children:["Log #",E.id]})]}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",background:E.status==="success"?"#d1fae5":E.status==="running"?"#dbeafe":E.status==="error"?"#fee2e2":"#fef3c7",color:E.status==="success"?"#065f46":E.status==="running"?"#1e40af":E.status==="error"?"#991b1b":"#92400e"},children:E.status})}),a.jsxs("td",{style:{padding:"15px",textAlign:"right"},children:[a.jsx("span",{style:{color:"#10b981"},children:E.items_succeeded||0})," / ",a.jsx("span",{children:E.items_processed||0})]}),a.jsx("td",{style:{padding:"15px",textAlign:"right"},children:E.duration_ms?`${Math.floor(E.duration_ms/6e4)}m ${Math.floor(E.duration_ms%6e4/1e3)}s`:"-"}),a.jsx("td",{style:{padding:"15px",color:"#666"},children:E.completed_at?new Date(E.completed_at).toLocaleString():"-"})]},`log-${E.id}`))})]})})]})]}),b==="jobs"&&a.jsxs(a.Fragment,{children:[i&&a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsx("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:"Job Statistics"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"15px"},children:[a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Pending"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#f59e0b"},children:i.pending||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"In Progress"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#3b82f6"},children:i.in_progress||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Completed"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#10b981"},children:i.completed||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Failed"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#ef4444"},children:i.failed||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Products Found"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#8b5cf6"},children:i.total_products_found||0})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Products Saved"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#06b6d4"},children:i.total_products_saved||0})]})]})]}),c.length>0&&a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:["Active Workers (",c.length,")"]}),a.jsx("div",{style:{display:"grid",gap:"15px"},children:c.map(E=>a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderLeft:"4px solid #10b981"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"12px"},children:["Worker: ",E.worker_id]}),a.jsx("div",{style:{padding:"6px 12px",borderRadius:"4px",fontSize:"13px",fontWeight:"600",background:"#d1fae5",color:"#065f46"},children:"ACTIVE"})]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"12px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Active Jobs"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600"},children:E.active_jobs})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Products Found"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#8b5cf6"},children:E.total_products_found||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Products Saved"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#10b981"},children:E.total_products_saved||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Running Since"}),a.jsx("div",{style:{fontSize:"14px"},children:new Date(E.earliest_start).toLocaleTimeString()})]})]})]},E.worker_id))})]}),a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:["Active Jobs (",o.length,")"]}),o.length===0?a.jsxs("div",{style:{background:"white",padding:"60px 40px",borderRadius:"8px",textAlign:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"48px",marginBottom:"20px"},children:"😴"}),a.jsx("div",{style:{fontSize:"18px",color:"#666"},children:"No jobs currently running"})]}):a.jsx("div",{style:{display:"grid",gap:"15px"},children:o.map(E=>a.jsx("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderLeft:"4px solid #3b82f6"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"},children:E.dispensary_name||E.brand_name}),a.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"12px"},children:[E.job_type||"crawl"," | Job #",E.id]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"12px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Products Found"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#8b5cf6"},children:E.products_found||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Products Saved"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#10b981"},children:E.products_saved||0})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Duration"}),a.jsxs("div",{style:{fontSize:"16px",fontWeight:"600"},children:[Math.floor(E.duration_seconds/60),"m ",Math.floor(E.duration_seconds%60),"s"]})]})]})]}),a.jsx("div",{style:{padding:"6px 12px",borderRadius:"4px",fontSize:"13px",fontWeight:"600",background:"#dbeafe",color:"#1e40af"},children:"IN PROGRESS"})]})},E.id))})]}),a.jsxs("div",{children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:["Recent Jobs (",u.length,")"]}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Dispensary"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Type"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Status"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Found"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Saved"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Duration"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Completed"})]})}),a.jsx("tbody",{children:u.map(E=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsx("td",{style:{padding:"15px"},children:E.dispensary_name||E.brand_name}),a.jsx("td",{style:{padding:"15px",fontSize:"14px",color:"#666"},children:E.job_type||"-"}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",background:E.status==="completed"?"#d1fae5":E.status==="in_progress"?"#dbeafe":E.status==="failed"?"#fee2e2":"#fef3c7",color:E.status==="completed"?"#065f46":E.status==="in_progress"?"#1e40af":E.status==="failed"?"#991b1b":"#92400e"},children:E.status})}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:E.products_found||0}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600",color:"#10b981"},children:E.products_saved||0}),a.jsx("td",{style:{padding:"15px",textAlign:"right"},children:E.duration_seconds?`${Math.floor(E.duration_seconds/60)}m ${Math.floor(E.duration_seconds%60)}s`:"-"}),a.jsx("td",{style:{padding:"15px",color:"#666"},children:E.completed_at?new Date(E.completed_at).toLocaleString():"-"})]},E.id))})]})})]})]}),b==="scrapers"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:["Active Scrapers (",e.length,")"]}),e.length===0?a.jsxs("div",{style:{background:"white",padding:"60px 40px",borderRadius:"8px",textAlign:"center",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"48px",marginBottom:"20px"},children:"🛌"}),a.jsx("div",{style:{fontSize:"18px",color:"#666"},children:"No scrapers currently running"})]}):a.jsx("div",{style:{display:"grid",gap:"15px"},children:e.map(E=>a.jsx("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",borderLeft:`4px solid ${E.status==="running"?E.isStale?"#ff9800":"#2ecc71":E.status==="error"?"#e74c3c":"#95a5a6"}`},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start"},children:[a.jsxs("div",{style:{flex:1},children:[a.jsxs("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"},children:[E.storeName," - ",E.categoryName]}),a.jsxs("div",{style:{fontSize:"14px",color:"#666",marginBottom:"12px"},children:["ID: ",E.id]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"12px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Requests"}),a.jsxs("div",{style:{fontSize:"16px",fontWeight:"600"},children:[E.stats.requestsSuccess," / ",E.stats.requestsTotal]})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Items Saved"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#2ecc71"},children:E.stats.itemsSaved})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Items Dropped"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:"#e74c3c"},children:E.stats.itemsDropped})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Errors"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600",color:E.stats.errorsCount>0?"#ff9800":"#999"},children:E.stats.errorsCount})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"12px",color:"#999",marginBottom:"4px"},children:"Duration"}),a.jsx("div",{style:{fontSize:"16px",fontWeight:"600"},children:Z(E.duration)})]})]}),E.currentActivity&&a.jsxs("div",{style:{marginTop:"12px",padding:"8px 12px",background:"#f8f8f8",borderRadius:"4px",fontSize:"14px",color:"#666"},children:["📍 ",E.currentActivity]}),E.isStale&&a.jsx("div",{style:{marginTop:"12px",padding:"8px 12px",background:"#fff3cd",borderRadius:"4px",fontSize:"14px",color:"#856404"},children:"⚠️ No update in over 1 minute - scraper may be stuck"})]}),a.jsx("div",{style:{padding:"6px 12px",borderRadius:"4px",fontSize:"13px",fontWeight:"600",background:E.status==="running"?"#d4edda":E.status==="error"?"#f8d7da":"#e7e7e7",color:E.status==="running"?"#155724":E.status==="error"?"#721c24":"#666"},children:E.status.toUpperCase()})]})},E.id))})]}),a.jsxs("div",{children:[a.jsxs("h2",{style:{fontSize:"24px",marginBottom:"20px"},children:["Recent Scrapes (",r.length,")"]}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Dispensary"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Status"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Found"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Products"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Last Crawled"})]})}),a.jsx("tbody",{children:r.map((E,D)=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsx("td",{style:{padding:"15px"},children:E.dispensary_name||E.store_name}),a.jsx("td",{style:{padding:"15px"},children:a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",background:E.status==="completed"?"#d1fae5":E.status==="failed"?"#fee2e2":"#fef3c7",color:E.status==="completed"?"#065f46":E.status==="failed"?"#991b1b":"#92400e"},children:E.status||"-"})}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:E.products_found||"-"}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:E.product_count}),a.jsx("td",{style:{padding:"15px",color:"#666"},children:E.last_scraped_at?new Date(E.last_scraped_at).toLocaleString():"-"})]},D))})]})})]})]})]})})}function x7(){var we;const[e,t]=h.useState([]),[r,n]=h.useState([]),[i,s]=h.useState([]),[o,l]=h.useState(!0),[c,d]=h.useState(!0),[u,f]=h.useState("dispensaries"),[p,m]=h.useState(null),[x,g]=h.useState(null),[b,v]=h.useState(null),[j,y]=h.useState(null),[w,S]=h.useState(!1),[N,P]=h.useState("all"),[_,T]=h.useState(""),[$,M]=h.useState("");h.useEffect(()=>{const A=setTimeout(()=>{T($)},300);return()=>clearTimeout(A)},[$]),h.useEffect(()=>{if(C(),c){const A=setInterval(C,5e3);return()=>clearInterval(A)}},[c,N,_]);const C=async()=>{try{const A={};N==="AZ"&&(A.state="AZ"),_.trim()&&(A.search=_.trim());const[J,Ot,z]=await Promise.all([B.getGlobalSchedule(),B.getDispensarySchedules(Object.keys(A).length>0?A:void 0),B.getDispensaryCrawlJobs(100)]);t(J.schedules||[]),n(Ot.dispensaries||[]),s(z.jobs||[])}catch(A){console.error("Failed to load schedule data:",A)}finally{l(!1)}},R=async A=>{m(A);try{await B.triggerDispensaryCrawl(A),await C()}catch(J){console.error("Failed to trigger crawl:",J)}finally{m(null)}},q=async()=>{if(confirm("This will create crawl jobs for ALL active stores. Continue?"))try{const A=await B.triggerAllCrawls();alert(`Created ${A.jobs_created} crawl jobs`),await C()}catch(A){console.error("Failed to trigger all crawls:",A)}},Z=async A=>{try{await B.cancelCrawlJob(A),await C()}catch(J){console.error("Failed to cancel job:",J)}},E=async A=>{g(A);try{const J=await B.resolvePlatformId(A);J.success?alert(J.message):alert(`Failed: ${J.error||J.message}`),await C()}catch(J){console.error("Failed to resolve platform ID:",J),alert(`Error: ${J.message}`)}finally{g(null)}},D=async A=>{v(A);try{const J=await B.refreshDetection(A);alert(`Detected: ${J.menu_type}${J.platform_dispensary_id?`, Platform ID: ${J.platform_dispensary_id}`:""}`),await C()}catch(J){console.error("Failed to refresh detection:",J),alert(`Error: ${J.message}`)}finally{v(null)}},O=async(A,J)=>{y(A);try{await B.toggleDispensarySchedule(A,!J),await C()}catch(Ot){console.error("Failed to toggle schedule:",Ot),alert(`Error: ${Ot.message}`)}finally{y(null)}},k=async(A,J)=>{try{await B.updateGlobalSchedule(A,J),await C()}catch(Ot){console.error("Failed to update global schedule:",Ot)}},L=A=>{if(!A)return"Never";const J=new Date(A),z=new Date().getTime()-J.getTime(),ee=Math.floor(z/6e4),ne=Math.floor(ee/60),W=Math.floor(ne/24);return ee<1?"Just now":ee<60?`${ee}m ago`:ne<24?`${ne}h ago`:`${W}d ago`},U=A=>{const J=new Date(A),Ot=new Date,z=J.getTime()-Ot.getTime();if(z<0)return"Overdue";const ee=Math.floor(z/6e4),ne=Math.floor(ee/60);return ee<60?`${ee}m`:`${ne}h ${ee%60}m`},H=A=>{switch(A){case"completed":case"success":return{bg:"#d1fae5",color:"#065f46"};case"running":return{bg:"#dbeafe",color:"#1e40af"};case"failed":case"error":return{bg:"#fee2e2",color:"#991b1b"};case"cancelled":return{bg:"#f3f4f6",color:"#374151"};case"pending":return{bg:"#fef3c7",color:"#92400e"};case"sandbox_only":return{bg:"#e0e7ff",color:"#3730a3"};case"detection_only":return{bg:"#fce7f3",color:"#9d174d"};default:return{bg:"#f3f4f6",color:"#374151"}}},te=e.find(A=>A.schedule_type==="global_interval"),re=e.find(A=>A.schedule_type==="daily_special");return a.jsx(X,{children:a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Crawler Schedule"}),a.jsxs("div",{style:{display:"flex",gap:"15px",alignItems:"center"},children:[a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:c,onChange:A=>d(A.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),a.jsx("span",{children:"Auto-refresh (5s)"})]}),a.jsx("button",{onClick:q,style:{padding:"10px 20px",background:"#2563eb",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:"600"},children:"Crawl All Stores"})]})]}),a.jsxs("div",{style:{marginBottom:"30px",display:"flex",gap:"10px",borderBottom:"2px solid #eee"},children:[a.jsxs("button",{onClick:()=>f("dispensaries"),style:{padding:"12px 24px",background:u==="dispensaries"?"white":"transparent",border:"none",borderBottom:u==="dispensaries"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:u==="dispensaries"?"600":"400",color:u==="dispensaries"?"#2563eb":"#666",marginBottom:"-2px"},children:["Dispensary Schedules (",r.length,")"]}),a.jsxs("button",{onClick:()=>f("jobs"),style:{padding:"12px 24px",background:u==="jobs"?"white":"transparent",border:"none",borderBottom:u==="jobs"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:u==="jobs"?"600":"400",color:u==="jobs"?"#2563eb":"#666",marginBottom:"-2px"},children:["Job Queue (",i.filter(A=>A.status==="pending"||A.status==="running").length,")"]}),a.jsx("button",{onClick:()=>f("global"),style:{padding:"12px 24px",background:u==="global"?"white":"transparent",border:"none",borderBottom:u==="global"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:u==="global"?"600":"400",color:u==="global"?"#2563eb":"#666",marginBottom:"-2px"},children:"Global Settings"})]}),u==="global"&&a.jsxs("div",{style:{display:"grid",gap:"20px"},children:[a.jsxs("div",{style:{background:"white",padding:"24px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start",marginBottom:"20px"},children:[a.jsxs("div",{children:[a.jsx("h2",{style:{fontSize:"20px",margin:0,marginBottom:"8px"},children:"Interval Crawl Schedule"}),a.jsx("p",{style:{color:"#666",margin:0},children:"Crawl all stores periodically"})]}),a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[a.jsx("span",{style:{color:"#666"},children:"Enabled"}),a.jsx("input",{type:"checkbox",checked:(te==null?void 0:te.enabled)??!0,onChange:A=>k("global_interval",{enabled:A.target.checked}),style:{width:"20px",height:"20px",cursor:"pointer"}})]})]}),a.jsx("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[a.jsx("span",{children:"Crawl every"}),a.jsxs("select",{value:(te==null?void 0:te.interval_hours)??4,onChange:A=>k("global_interval",{interval_hours:parseInt(A.target.value)}),style:{padding:"8px 12px",borderRadius:"6px",border:"1px solid #ddd",fontSize:"16px"},children:[a.jsx("option",{value:1,children:"1 hour"}),a.jsx("option",{value:2,children:"2 hours"}),a.jsx("option",{value:4,children:"4 hours"}),a.jsx("option",{value:6,children:"6 hours"}),a.jsx("option",{value:8,children:"8 hours"}),a.jsx("option",{value:12,children:"12 hours"}),a.jsx("option",{value:24,children:"24 hours"})]})]})})]}),a.jsxs("div",{style:{background:"white",padding:"24px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"start",marginBottom:"20px"},children:[a.jsxs("div",{children:[a.jsx("h2",{style:{fontSize:"20px",margin:0,marginBottom:"8px"},children:"Daily Special Crawl"}),a.jsx("p",{style:{color:"#666",margin:0},children:"Crawl stores at local midnight to capture daily specials"})]}),a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[a.jsx("span",{style:{color:"#666"},children:"Enabled"}),a.jsx("input",{type:"checkbox",checked:(re==null?void 0:re.enabled)??!0,onChange:A=>k("daily_special",{enabled:A.target.checked}),style:{width:"20px",height:"20px",cursor:"pointer"}})]})]}),a.jsx("div",{style:{display:"flex",alignItems:"center",gap:"15px"},children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[a.jsx("span",{children:"Run at"}),a.jsx("input",{type:"time",value:((we=re==null?void 0:re.run_time)==null?void 0:we.slice(0,5))??"00:01",onChange:A=>k("daily_special",{run_time:A.target.value}),style:{padding:"8px 12px",borderRadius:"6px",border:"1px solid #ddd",fontSize:"16px"}}),a.jsx("span",{style:{color:"#666"},children:"(store local time)"})]})})]})]}),u==="dispensaries"&&a.jsxs("div",{children:[a.jsxs("div",{style:{marginBottom:"15px",display:"flex",gap:"20px",alignItems:"center",flexWrap:"wrap"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[a.jsx("span",{style:{fontWeight:"500",color:"#374151"},children:"State:"}),a.jsxs("div",{style:{display:"flex",borderRadius:"6px",overflow:"hidden",border:"1px solid #d1d5db"},children:[a.jsx("button",{onClick:()=>P("all"),style:{padding:"6px 14px",background:N==="all"?"#2563eb":"white",color:N==="all"?"white":"#374151",border:"none",cursor:"pointer",fontSize:"14px",fontWeight:"500"},children:"All"}),a.jsx("button",{onClick:()=>P("AZ"),style:{padding:"6px 14px",background:N==="AZ"?"#2563eb":"white",color:N==="AZ"?"white":"#374151",border:"none",borderLeft:"1px solid #d1d5db",cursor:"pointer",fontSize:"14px",fontWeight:"500"},children:"AZ Only"})]})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[a.jsx("span",{style:{fontWeight:"500",color:"#374151"},children:"Search:"}),a.jsx("input",{type:"text",placeholder:"Store name or slug...",value:$,onChange:A=>M(A.target.value),style:{padding:"6px 12px",borderRadius:"6px",border:"1px solid #d1d5db",fontSize:"14px",width:"200px"}}),$&&a.jsx("button",{onClick:()=>{M(""),T("")},style:{padding:"4px 8px",background:"#f3f4f6",border:"1px solid #d1d5db",borderRadius:"4px",cursor:"pointer",fontSize:"12px"},children:"Clear"})]}),a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:w,onChange:A=>S(A.target.checked),style:{width:"16px",height:"16px",cursor:"pointer"}}),a.jsx("span",{children:"Dutchie only"})]}),a.jsxs("span",{style:{color:"#666",fontSize:"14px",marginLeft:"auto"},children:["Showing ",(w?r.filter(A=>A.menu_type==="dutchie"):r).length," dispensaries"]})]}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"auto"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",minWidth:"1200px"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"12px",textAlign:"left",fontWeight:"600"},children:"Dispensary"}),a.jsx("th",{style:{padding:"12px",textAlign:"center",fontWeight:"600"},children:"Menu Type"}),a.jsx("th",{style:{padding:"12px",textAlign:"center",fontWeight:"600"},children:"Platform ID"}),a.jsx("th",{style:{padding:"12px",textAlign:"center",fontWeight:"600"},children:"Status"}),a.jsx("th",{style:{padding:"12px",textAlign:"left",fontWeight:"600"},children:"Last Run"}),a.jsx("th",{style:{padding:"12px",textAlign:"left",fontWeight:"600"},children:"Next Run"}),a.jsx("th",{style:{padding:"12px",textAlign:"left",fontWeight:"600"},children:"Last Result"}),a.jsx("th",{style:{padding:"12px",textAlign:"center",fontWeight:"600",minWidth:"220px"},children:"Actions"})]})}),a.jsx("tbody",{children:(w?r.filter(A=>A.menu_type==="dutchie"):r).map(A=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"12px"},children:[a.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:A.state&&A.city&&(A.dispensary_slug||A.slug)?a.jsx(K1,{to:`/dispensaries/${A.state}/${A.city.toLowerCase().replace(/\s+/g,"-")}/${A.dispensary_slug||A.slug}`,style:{fontWeight:"600",color:"#2563eb",textDecoration:"none"},children:A.dispensary_name}):a.jsx("span",{style:{fontWeight:"600"},children:A.dispensary_name})}),a.jsx("div",{style:{fontSize:"12px",color:"#666"},children:A.city?`${A.city}, ${A.state}`:A.state})]}),a.jsx("td",{style:{padding:"12px",textAlign:"center"},children:A.menu_type?a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"11px",fontWeight:"600",background:A.menu_type==="dutchie"?"#d1fae5":"#e0e7ff",color:A.menu_type==="dutchie"?"#065f46":"#3730a3"},children:A.menu_type}):a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"11px",fontWeight:"600",background:"#f3f4f6",color:"#666"},children:"unknown"})}),a.jsx("td",{style:{padding:"12px",textAlign:"center"},children:A.platform_dispensary_id?a.jsx("span",{style:{padding:"4px 8px",borderRadius:"4px",fontSize:"10px",fontFamily:"monospace",background:"#d1fae5",color:"#065f46"},title:A.platform_dispensary_id,children:A.platform_dispensary_id.length>12?`${A.platform_dispensary_id.slice(0,6)}...${A.platform_dispensary_id.slice(-4)}`:A.platform_dispensary_id}):a.jsx("span",{style:{padding:"4px 8px",borderRadius:"4px",fontSize:"10px",background:"#fee2e2",color:"#991b1b"},children:"missing"})}),a.jsx("td",{style:{padding:"12px",textAlign:"center"},children:a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"11px",fontWeight:"600",background:A.can_crawl?"#d1fae5":A.is_active!==!1?"#fef3c7":"#fee2e2",color:A.can_crawl?"#065f46":A.is_active!==!1?"#92400e":"#991b1b"},children:A.can_crawl?"Ready":A.is_active!==!1?"Not Ready":"Disabled"}),A.schedule_status_reason&&A.schedule_status_reason!=="ready"&&a.jsx("span",{style:{fontSize:"10px",color:"#666",maxWidth:"100px",textAlign:"center"},children:A.schedule_status_reason}),A.interval_minutes&&a.jsxs("span",{style:{fontSize:"10px",color:"#999"},children:["Every ",Math.round(A.interval_minutes/60),"h"]})]})}),a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{children:L(A.last_run_at)}),A.last_run_at&&a.jsx("div",{style:{fontSize:"12px",color:"#999"},children:new Date(A.last_run_at).toLocaleString()})]}),a.jsx("td",{style:{padding:"15px"},children:a.jsx("div",{style:{fontWeight:"600",color:"#2563eb"},children:A.next_run_at?U(A.next_run_at):"Not scheduled"})}),a.jsx("td",{style:{padding:"15px"},children:A.last_status||A.latest_job_status?a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"4px"},children:[a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",...H(A.last_status||A.latest_job_status||"pending")},children:A.last_status||A.latest_job_status}),A.last_error&&a.jsx("button",{onClick:()=>alert(A.last_error),style:{padding:"2px 6px",background:"#fee2e2",color:"#991b1b",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"10px"},children:"Error"})]}),A.last_summary?a.jsx("div",{style:{fontSize:"12px",color:"#666",maxWidth:"250px"},children:A.last_summary}):A.latest_products_found!==null?a.jsxs("div",{style:{fontSize:"12px",color:"#666"},children:[A.latest_products_found," products"]}):null]}):a.jsx("span",{style:{color:"#999",fontSize:"13px"},children:"No runs yet"})}),a.jsx("td",{style:{padding:"12px",textAlign:"center"},children:a.jsxs("div",{style:{display:"flex",gap:"6px",justifyContent:"center",flexWrap:"wrap"},children:[a.jsx("button",{onClick:()=>D(A.dispensary_id),disabled:b===A.dispensary_id,style:{padding:"4px 8px",background:b===A.dispensary_id?"#94a3b8":"#f3f4f6",color:"#374151",border:"1px solid #d1d5db",borderRadius:"4px",cursor:b===A.dispensary_id?"wait":"pointer",fontSize:"11px"},title:"Re-detect menu type and resolve platform ID",children:b===A.dispensary_id?"...":"Refresh"}),A.menu_type==="dutchie"&&!A.platform_dispensary_id&&a.jsx("button",{onClick:()=>E(A.dispensary_id),disabled:x===A.dispensary_id,style:{padding:"4px 8px",background:x===A.dispensary_id?"#94a3b8":"#fef3c7",color:"#92400e",border:"1px solid #fcd34d",borderRadius:"4px",cursor:x===A.dispensary_id?"wait":"pointer",fontSize:"11px"},title:"Resolve platform dispensary ID via GraphQL",children:x===A.dispensary_id?"...":"Resolve ID"}),a.jsx("button",{onClick:()=>R(A.dispensary_id),disabled:p===A.dispensary_id||!A.can_crawl,style:{padding:"4px 8px",background:p===A.dispensary_id?"#94a3b8":A.can_crawl?"#2563eb":"#e5e7eb",color:A.can_crawl?"white":"#9ca3af",border:"none",borderRadius:"4px",cursor:p===A.dispensary_id||!A.can_crawl?"not-allowed":"pointer",fontSize:"11px"},title:A.can_crawl?"Trigger immediate crawl":`Cannot crawl: ${A.schedule_status_reason}`,children:p===A.dispensary_id?"...":"Run"}),a.jsx("button",{onClick:()=>O(A.dispensary_id,A.is_active),disabled:j===A.dispensary_id,style:{padding:"4px 8px",background:j===A.dispensary_id?"#94a3b8":A.is_active?"#fee2e2":"#d1fae5",color:A.is_active?"#991b1b":"#065f46",border:"none",borderRadius:"4px",cursor:j===A.dispensary_id?"wait":"pointer",fontSize:"11px"},title:A.is_active?"Disable scheduled crawling":"Enable scheduled crawling",children:j===A.dispensary_id?"...":A.is_active?"Disable":"Enable"})]})})]},A.dispensary_id))})]})})]}),u==="jobs"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{style:{marginBottom:"30px"},children:a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"15px"},children:[a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Pending"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#f59e0b"},children:i.filter(A=>A.status==="pending").length})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Running"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#3b82f6"},children:i.filter(A=>A.status==="running").length})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Completed"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#10b981"},children:i.filter(A=>A.status==="completed").length})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#999",marginBottom:"8px"},children:"Failed"}),a.jsx("div",{style:{fontSize:"32px",fontWeight:"600",color:"#ef4444"},children:i.filter(A=>A.status==="failed").length})]})]})}),a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Dispensary"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Type"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Trigger"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Status"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Products"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Started"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Completed"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Actions"})]})}),a.jsx("tbody",{children:i.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:8,style:{padding:"40px",textAlign:"center",color:"#666"},children:"No crawl jobs found"})}):i.map(A=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600"},children:A.dispensary_name}),a.jsxs("div",{style:{fontSize:"12px",color:"#999"},children:["Job #",A.id]})]}),a.jsx("td",{style:{padding:"15px",textAlign:"center",fontSize:"13px"},children:A.job_type}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("span",{style:{padding:"3px 8px",borderRadius:"4px",fontSize:"12px",background:A.trigger_type==="manual"?"#e0e7ff":A.trigger_type==="daily_special"?"#fce7f3":"#f3f4f6",color:A.trigger_type==="manual"?"#3730a3":A.trigger_type==="daily_special"?"#9d174d":"#374151"},children:A.trigger_type})}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",...H(A.status)},children:A.status})}),a.jsx("td",{style:{padding:"15px",textAlign:"right"},children:A.products_found!==null?a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:"600"},children:A.products_found}),A.products_new!==null&&A.products_updated!==null&&a.jsxs("div",{style:{fontSize:"12px",color:"#666"},children:["+",A.products_new," / ~",A.products_updated]})]}):"-"}),a.jsx("td",{style:{padding:"15px",fontSize:"13px"},children:A.started_at?new Date(A.started_at).toLocaleString():"-"}),a.jsx("td",{style:{padding:"15px",fontSize:"13px"},children:A.completed_at?new Date(A.completed_at).toLocaleString():"-"}),a.jsxs("td",{style:{padding:"15px",textAlign:"center"},children:[A.status==="pending"&&a.jsx("button",{onClick:()=>Z(A.id),style:{padding:"4px 10px",background:"#fee2e2",color:"#991b1b",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"12px"},children:"Cancel"}),A.error_message&&a.jsx("button",{onClick:()=>alert(A.error_message),style:{padding:"4px 10px",background:"#fee2e2",color:"#991b1b",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"12px"},children:"View Error"})]})]},A.id))})]})})]})]})})}function y7(){const[e,t]=h.useState([]),[r,n]=h.useState(null),[i,s]=h.useState(3),[o,l]=h.useState("rotate-desktop"),[c,d]=h.useState(!1),[u,f]=h.useState(!1),[p,m]=h.useState(null),[x,g]=h.useState(!0);h.useEffect(()=>{b()},[]);const b=async()=>{g(!0);try{const S=(await B.getDispensaries()).dispensaries.filter(N=>N.menu_url&&N.scrape_enabled);t(S),S.length>0&&n(S[0].id)}catch(w){console.error("Failed to load dispensaries:",w)}finally{g(!1)}},v=async()=>{if(!(!r||c)){d(!0);try{await B.triggerDispensaryCrawl(r),m({message:"Crawl started for dispensary! Check the Scraper Monitor for progress.",type:"success"})}catch(w){m({message:"Failed to start crawl: "+w.message,type:"error"})}finally{d(!1)}}},j=async()=>{if(!(!r||u)){f(!0);try{m({message:"Image download feature coming soon!",type:"info"})}catch(w){m({message:"Failed to start image download: "+w.message,type:"error"})}finally{f(!1)}}},y=e.find(w=>w.id===r);return x?a.jsx(X,{children:a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("span",{className:"loading loading-spinner loading-lg"})})}):a.jsxs(X,{children:[p&&a.jsx(Vn,{message:p.message,type:p.type,onClose:()=>m(null)}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold",children:"Scraper Tools"}),a.jsx("p",{className:"text-gray-500 mt-2",children:"Manage crawling operations for dispensaries"})]}),a.jsx("div",{className:"card bg-base-100 shadow-xl",children:a.jsxs("div",{className:"card-body",children:[a.jsx("h2",{className:"card-title",children:"Select Dispensary"}),a.jsx("select",{className:"select select-bordered w-full max-w-md",value:r||"",onChange:w=>n(parseInt(w.target.value)),children:e.map(w=>a.jsxs("option",{value:w.id,children:[w.dba_name||w.name," - ",w.city,", ",w.state]},w.id))}),y&&a.jsx("div",{className:"mt-4 p-4 bg-base-200 rounded-lg",children:a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-500",children:"Status"}),a.jsx("div",{className:"font-semibold",children:y.scrape_enabled?a.jsx("span",{className:"badge badge-success",children:"Enabled"}):a.jsx("span",{className:"badge badge-error",children:"Disabled"})})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-500",children:"Provider"}),a.jsx("div",{className:"font-semibold",children:y.provider_type||"Unknown"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-500",children:"Products"}),a.jsx("div",{className:"font-semibold",children:y.product_count||0})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-500",children:"Last Crawled"}),a.jsx("div",{className:"font-semibold",children:y.last_crawl_at?new Date(y.last_crawl_at).toLocaleDateString():"Never"})]})]})})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx("div",{className:"card bg-base-100 shadow-xl",children:a.jsxs("div",{className:"card-body",children:[a.jsx("h2",{className:"card-title",children:"Crawl Dispensary"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Start crawling products from the selected dispensary menu"}),a.jsx("div",{className:"card-actions justify-end mt-4",children:a.jsx("button",{onClick:v,disabled:!r||c,className:`btn btn-primary ${c?"loading":""}`,children:c?"Starting...":"Start Crawl"})})]})}),a.jsx("div",{className:"card bg-base-100 shadow-xl",children:a.jsxs("div",{className:"card-body",children:[a.jsx("h2",{className:"card-title",children:"Download Images"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Download missing product images for the selected dispensary"}),a.jsx("div",{className:"card-actions justify-end mt-auto",children:a.jsx("button",{onClick:j,disabled:!r||u,className:`btn btn-secondary ${u?"loading":""}`,children:u?"Downloading...":"Download Missing Images"})})]})})]}),a.jsxs("div",{className:"alert alert-info",children:[a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",className:"stroke-current shrink-0 w-6 h-6",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),a.jsxs("span",{children:["After starting scraper operations, check the"," ",a.jsx("a",{href:"/scraper-monitor",className:"link",children:"Scraper Monitor"})," for real-time progress and ",a.jsx("a",{href:"/logs",className:"link",children:"Logs"})," for detailed output."]})]})]})]})}function v7(){const[e,t]=h.useState([]),[r,n]=h.useState(null),[i,s]=h.useState(!0),[o,l]=h.useState("pending"),[c,d]=h.useState(null);h.useEffect(()=>{u()},[o]);const u=async()=>{s(!0);try{const[g,b]=await Promise.all([B.getChanges(o==="all"?void 0:o),B.getChangeStats()]);t(g.changes),n(b)}catch(g){console.error("Failed to load changes:",g)}finally{s(!1)}},f=async g=>{d(g);try{(await B.approveChange(g)).requires_recrawl&&alert("Change approved! This dispensary requires a menu recrawl."),await u()}catch(b){console.error("Failed to approve change:",b),alert("Failed to approve change. Please try again.")}finally{d(null)}},p=async g=>{const b=prompt("Enter rejection reason (optional):");d(g);try{await B.rejectChange(g,b||void 0),await u()}catch(v){console.error("Failed to reject change:",v),alert("Failed to reject change. Please try again.")}finally{d(null)}},m=g=>({dba_name:"DBA Name",website:"Website",phone:"Phone",email:"Email",google_rating:"Google Rating",google_review_count:"Google Review Count",menu_url:"Menu URL"})[g]||g,x=g=>({high:"bg-green-100 text-green-800",medium:"bg-yellow-100 text-yellow-800",low:"bg-red-100 text-red-800"})[g]||"bg-gray-100 text-gray-800";return i?a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading changes..."})]})}):a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Change Approval"}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Review and approve proposed changes to dispensary data"})]}),a.jsxs("button",{onClick:u,className:"flex items-center gap-2 px-4 py-2 text-sm border border-gray-300 rounded-lg hover:bg-gray-50",children:[a.jsx(Xt,{className:"w-4 h-4"}),"Refresh"]})]}),r&&a.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-yellow-50 rounded-lg",children:a.jsx(xr,{className:"w-5 h-5 text-yellow-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Pending"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:r.pending_count})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-orange-50 rounded-lg",children:a.jsx(nj,{className:"w-5 h-5 text-orange-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Needs Recrawl"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:r.pending_recrawl_count})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-green-50 rounded-lg",children:a.jsx(_r,{className:"w-5 h-5 text-green-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Approved"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:r.approved_count})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-red-50 rounded-lg",children:a.jsx(Hr,{className:"w-5 h-5 text-red-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Rejected"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:r.rejected_count})]})]})})]}),a.jsx("div",{className:"flex gap-2",children:["all","pending","approved","rejected"].map(g=>a.jsx("button",{onClick:()=>l(g),className:`px-4 py-2 text-sm font-medium rounded-lg ${o===g?"bg-blue-600 text-white":"bg-white text-gray-700 border border-gray-300 hover:bg-gray-50"}`,children:g.charAt(0).toUpperCase()+g.slice(1)},g))}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200",children:e.length===0?a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-gray-600",children:"No changes found"})}):a.jsx("div",{className:"divide-y divide-gray-200",children:e.map(g=>a.jsx("div",{className:"p-6",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:g.dispensary_name}),a.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded ${x(g.confidence_score)}`,children:g.confidence_score||"N/A"}),g.requires_recrawl&&a.jsx("span",{className:"px-2 py-1 text-xs font-medium rounded bg-orange-100 text-orange-800",children:"Requires Recrawl"})]}),a.jsxs("p",{className:"text-sm text-gray-600 mb-3",children:[g.city,", ",g.state," • Source: ",g.source]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-medium text-gray-500",children:"Field"}),a.jsx("p",{className:"text-sm text-gray-900",children:m(g.field_name)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-medium text-gray-500",children:"Old Value"}),a.jsx("p",{className:"text-sm text-gray-900",children:g.old_value||a.jsx("em",{className:"text-gray-400",children:"None"})})]}),a.jsxs("div",{className:"col-span-2",children:[a.jsx("label",{className:"text-xs font-medium text-gray-500",children:"New Value"}),a.jsx("p",{className:"text-sm font-medium text-blue-600",children:g.new_value})]}),g.change_notes&&a.jsxs("div",{className:"col-span-2",children:[a.jsx("label",{className:"text-xs font-medium text-gray-500",children:"Notes"}),a.jsx("p",{className:"text-sm text-gray-700",children:g.change_notes})]})]}),a.jsxs("p",{className:"text-xs text-gray-500",children:["Created ",new Date(g.created_at).toLocaleString()]}),g.status==="rejected"&&g.rejection_reason&&a.jsxs("div",{className:"mt-2 p-3 bg-red-50 rounded border border-red-200",children:[a.jsx("p",{className:"text-xs font-medium text-red-800",children:"Rejection Reason:"}),a.jsx("p",{className:"text-sm text-red-700",children:g.rejection_reason})]})]}),a.jsxs("div",{className:"flex items-center gap-2 ml-4",children:[g.status==="pending"&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>f(g.id),disabled:c===g.id,className:"flex items-center gap-2 px-4 py-2 bg-green-600 text-white text-sm font-medium rounded-lg hover:bg-green-700 disabled:opacity-50",children:[a.jsx(_r,{className:"w-4 h-4"}),"Approve"]}),a.jsxs("button",{onClick:()=>p(g.id),disabled:c===g.id,className:"flex items-center gap-2 px-4 py-2 bg-red-600 text-white text-sm font-medium rounded-lg hover:bg-red-700 disabled:opacity-50",children:[a.jsx(Hr,{className:"w-4 h-4"}),"Reject"]})]}),g.status==="approved"&&a.jsxs("span",{className:"flex items-center gap-2 px-4 py-2 bg-green-100 text-green-800 text-sm font-medium rounded-lg",children:[a.jsx(_r,{className:"w-4 h-4"}),"Approved"]}),g.status==="rejected"&&a.jsxs("span",{className:"flex items-center gap-2 px-4 py-2 bg-red-100 text-red-800 text-sm font-medium rounded-lg",children:[a.jsx(Hr,{className:"w-4 h-4"}),"Rejected"]}),a.jsx("a",{href:`/dispensaries/${g.dispensary_slug}`,target:"_blank",rel:"noopener noreferrer",className:"p-2 text-gray-400 hover:text-gray-600",children:a.jsx(Jr,{className:"w-4 h-4"})})]})]})},g.id))})})]})})}function b7(){const[e,t]=h.useState([]),[r,n]=h.useState([]),[i,s]=h.useState(!0),[o,l]=h.useState(!1),[c,d]=h.useState({user_name:"",store_id:"",allowed_ips:"",allowed_domains:""}),[u,f]=h.useState(null);h.useEffect(()=>{m(),p()},[]);const p=async()=>{try{const y=await B.getApiPermissionDispensaries();n(y.dispensaries)}catch(y){console.error("Failed to load dispensaries:",y)}},m=async()=>{s(!0);try{const y=await B.getApiPermissions();t(y.permissions)}catch(y){f({message:"Failed to load API permissions: "+y.message,type:"error"})}finally{s(!1)}},x=async y=>{if(y.preventDefault(),!c.user_name.trim()){f({message:"User name is required",type:"error"});return}if(!c.store_id){f({message:"Store is required",type:"error"});return}try{const w=await B.createApiPermission({...c,store_id:parseInt(c.store_id)});f({message:w.message,type:"success"}),d({user_name:"",store_id:"",allowed_ips:"",allowed_domains:""}),l(!1),m()}catch(w){f({message:"Failed to create permission: "+w.message,type:"error"})}},g=async y=>{try{await B.toggleApiPermission(y),f({message:"Permission status updated",type:"success"}),m()}catch(w){f({message:"Failed to toggle permission: "+w.message,type:"error"})}},b=async y=>{if(confirm("Are you sure you want to delete this API permission?"))try{await B.deleteApiPermission(y),f({message:"Permission deleted successfully",type:"success"}),m()}catch(w){f({message:"Failed to delete permission: "+w.message,type:"error"})}},v=y=>{navigator.clipboard.writeText(y),f({message:"API key copied to clipboard!",type:"success"})},j=y=>{if(!y)return"Never";const w=new Date(y);return w.toLocaleDateString()+" "+w.toLocaleTimeString()};return i?a.jsx(X,{children:a.jsx("div",{className:"p-6",children:a.jsx("div",{className:"text-center text-gray-600",children:"Loading API permissions..."})})}):a.jsx(X,{children:a.jsxs("div",{className:"p-6",children:[u&&a.jsx(Vn,{message:u.message,type:u.type,onClose:()=>f(null)}),a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"API Permissions"}),a.jsx("button",{onClick:()=>l(!o),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:o?"Cancel":"Add New Permission"})]}),a.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6",children:[a.jsx("h3",{className:"font-semibold text-blue-900 mb-2",children:"How it works:"}),a.jsx("p",{className:"text-blue-800 text-sm",children:"Users with valid permissions can access your API without entering tokens. Access is automatically validated based on their IP address and/or domain name."})]}),o&&a.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[a.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Add New API User"}),a.jsxs("form",{onSubmit:x,children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"User/Client Name *"}),a.jsx("input",{type:"text",value:c.user_name,onChange:y=>d({...c,user_name:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:"e.g., My Website",required:!0}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"A friendly name to identify this API user"})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Store *"}),a.jsxs("select",{value:c.store_id,onChange:y=>d({...c,store_id:y.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",required:!0,children:[a.jsx("option",{value:"",children:"Select a store..."}),r.map(y=>a.jsx("option",{value:y.id,children:y.name},y.id))]}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"The store this API token can access"})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Allowed IP Addresses"}),a.jsx("textarea",{value:c.allowed_ips,onChange:y=>d({...c,allowed_ips:y.target.value}),rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm",placeholder:`192.168.1.1
10.0.0.0/8
2001:db8::/32`}),a.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:["One IP address or CIDR range per line. Leave empty to allow any IP.",a.jsx("br",{}),"Supports IPv4, IPv6, and CIDR notation (e.g., 192.168.0.0/24)"]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Allowed Domains"}),a.jsx("textarea",{value:c.allowed_domains,onChange:y=>d({...c,allowed_domains:y.target.value}),rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm",placeholder:`example.com
*.example.com
subdomain.example.com`}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"One domain per line. Wildcards supported (e.g., *.example.com). Leave empty to allow any domain."})]}),a.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:"Create API Permission"})]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow-md overflow-hidden",children:[a.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:a.jsx("h2",{className:"text-xl font-semibold",children:"Active API Users"})}),e.length===0?a.jsx("div",{className:"p-6 text-center text-gray-600",children:"No API permissions configured yet. Add your first user above."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"User Name"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Store"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"API Key"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Allowed IPs"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Allowed Domains"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Last Used"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:e.map(y=>a.jsxs("tr",{children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("div",{className:"font-medium text-gray-900",children:y.user_name})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("div",{className:"text-sm text-gray-900",children:y.store_name||a.jsx("span",{className:"text-gray-400 italic",children:"No store"})})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("code",{className:"text-xs bg-gray-100 px-2 py-1 rounded",children:[y.api_key.substring(0,16),"..."]}),a.jsx("button",{onClick:()=>v(y.api_key),className:"text-blue-600 hover:text-blue-800 text-sm",children:"Copy"})]})}),a.jsx("td",{className:"px-6 py-4",children:y.allowed_ips?a.jsxs("div",{className:"text-sm text-gray-600",children:[y.allowed_ips.split(`
`).slice(0,2).join(", "),y.allowed_ips.split(`
`).length>2&&a.jsxs("span",{className:"text-gray-400",children:[" +",y.allowed_ips.split(`
`).length-2," more"]})]}):a.jsx("span",{className:"text-gray-400 italic",children:"Any IP"})}),a.jsx("td",{className:"px-6 py-4",children:y.allowed_domains?a.jsxs("div",{className:"text-sm text-gray-600",children:[y.allowed_domains.split(`
`).slice(0,2).join(", "),y.allowed_domains.split(`
`).length>2&&a.jsxs("span",{className:"text-gray-400",children:[" +",y.allowed_domains.split(`
`).length-2," more"]})]}):a.jsx("span",{className:"text-gray-400 italic",children:"Any domain"})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:y.is_active?a.jsx("span",{className:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-green-100 text-green-800",children:"Active"}):a.jsx("span",{className:"px-2 inline-flex text-xs leading-5 font-semibold rounded-full bg-red-100 text-red-800",children:"Disabled"})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600",children:j(y.last_used_at)}),a.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm space-x-2",children:[a.jsx("button",{onClick:()=>g(y.id),className:"text-blue-600 hover:text-blue-800",children:y.is_active?"Disable":"Enable"}),a.jsx("button",{onClick:()=>b(y.id),className:"text-red-600 hover:text-red-800",children:"Delete"})]})]},y.id))})]})})]})]})})}function j7(){const[e,t]=h.useState([]),[r,n]=h.useState([]),[i,s]=h.useState(null),[o,l]=h.useState(null),[c,d]=h.useState(!0),[u,f]=h.useState(!0),[p,m]=h.useState("schedules"),[x,g]=h.useState(null),[b,v]=h.useState(!1),[j,y]=h.useState(!1),[w,S]=h.useState(null);h.useEffect(()=>{if(N(),u){const k=setInterval(N,1e4);return()=>clearInterval(k)}},[u]);const N=async()=>{try{const[k,L,U,H]=await Promise.all([B.getDutchieAZSchedules(),B.getDutchieAZRunLogs({limit:50}),B.getDutchieAZSchedulerStatus(),B.getDetectionStats().catch(()=>null)]);t(k.schedules||[]),n(L.logs||[]),s(U),l(H)}catch(k){console.error("Failed to load schedule data:",k)}finally{d(!1)}},P=async()=>{try{i!=null&&i.running?await B.stopDutchieAZScheduler():await B.startDutchieAZScheduler(),await N()}catch(k){console.error("Failed to toggle scheduler:",k)}},_=async()=>{try{await B.initDutchieAZSchedules(),await N()}catch(k){console.error("Failed to initialize schedules:",k)}},T=async k=>{try{await B.triggerDutchieAZSchedule(k),await N()}catch(L){console.error("Failed to trigger schedule:",L)}},$=async k=>{try{await B.updateDutchieAZSchedule(k.id,{enabled:!k.enabled}),await N()}catch(L){console.error("Failed to toggle schedule:",L)}},M=async(k,L)=>{try{const U={description:L.description??void 0,enabled:L.enabled,baseIntervalMinutes:L.baseIntervalMinutes,jitterMinutes:L.jitterMinutes,jobConfig:L.jobConfig??void 0};await B.updateDutchieAZSchedule(k,U),g(null),await N()}catch(U){console.error("Failed to update schedule:",U)}},C=async()=>{if(confirm("Run menu detection on all dispensaries with unknown/missing menu_type?")){y(!0),S(null);try{const k=await B.detectAllDispensaries({state:"AZ",onlyUnknown:!0});S(k),await N()}catch(k){console.error("Failed to run bulk detection:",k)}finally{y(!1)}}},R=async()=>{if(confirm("Resolve platform IDs for all Dutchie dispensaries missing them?")){y(!0),S(null);try{const k=await B.detectAllDispensaries({state:"AZ",onlyMissingPlatformId:!0,onlyUnknown:!1});S(k),await N()}catch(k){console.error("Failed to resolve platform IDs:",k)}finally{y(!1)}}},q=k=>{if(!k)return"Never";const L=new Date(k),H=new Date().getTime()-L.getTime(),te=Math.floor(H/6e4),re=Math.floor(te/60),we=Math.floor(re/24);return te<1?"Just now":te<60?`${te}m ago`:re<24?`${re}h ago`:`${we}d ago`},Z=k=>{if(!k)return"Not scheduled";const L=new Date(k),U=new Date,H=L.getTime()-U.getTime();if(H<0)return"Overdue";const te=Math.floor(H/6e4),re=Math.floor(te/60);return te<60?`${te}m`:`${re}h ${te%60}m`},E=k=>{if(!k)return"-";if(k<1e3)return`${k}ms`;const L=Math.floor(k/1e3),U=Math.floor(L/60);return U<1?`${L}s`:`${U}m ${L%60}s`},D=(k,L)=>{const U=Math.floor(k/60),H=k%60,te=Math.floor(L/60),re=L%60;let we=U>0?`${U}h`:"";H>0&&(we+=`${H}m`);let A=te>0?`${te}h`:"";return re>0&&(A+=`${re}m`),`${we} +/- ${A}`},O=k=>{switch(k){case"success":return{bg:"#d1fae5",color:"#065f46"};case"running":return{bg:"#dbeafe",color:"#1e40af"};case"error":return{bg:"#fee2e2",color:"#991b1b"};case"partial":return{bg:"#fef3c7",color:"#92400e"};default:return{bg:"#f3f4f6",color:"#374151"}}};return a.jsx(X,{children:a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"30px"},children:[a.jsxs("div",{children:[a.jsx("h1",{style:{fontSize:"32px",margin:0},children:"Dutchie AZ Schedule"}),a.jsx("p",{style:{color:"#666",margin:"8px 0 0 0"},children:"Jittered scheduling for Arizona Dutchie product crawls"})]}),a.jsx("div",{style:{display:"flex",gap:"15px",alignItems:"center"},children:a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",cursor:"pointer"},children:[a.jsx("input",{type:"checkbox",checked:u,onChange:k=>f(k.target.checked),style:{width:"18px",height:"18px",cursor:"pointer"}}),a.jsx("span",{children:"Auto-refresh (10s)"})]})})]}),a.jsxs("div",{style:{background:"white",padding:"20px",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",marginBottom:"30px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"20px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontSize:"14px",color:"#666",marginBottom:"4px"},children:"Scheduler Status"}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[a.jsx("span",{style:{width:"12px",height:"12px",borderRadius:"50%",background:i!=null&&i.running?"#10b981":"#ef4444",display:"inline-block"}}),a.jsx("span",{style:{fontWeight:"600",fontSize:"18px"},children:i!=null&&i.running?"Running":"Stopped"})]})]}),a.jsxs("div",{style:{borderLeft:"1px solid #eee",paddingLeft:"20px"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#666",marginBottom:"4px"},children:"Poll Interval"}),a.jsx("div",{style:{fontWeight:"600"},children:i?`${i.pollIntervalMs/1e3}s`:"-"})]}),a.jsxs("div",{style:{borderLeft:"1px solid #eee",paddingLeft:"20px"},children:[a.jsx("div",{style:{fontSize:"14px",color:"#666",marginBottom:"4px"},children:"Active Schedules"}),a.jsxs("div",{style:{fontWeight:"600"},children:[e.filter(k=>k.enabled).length," / ",e.length]})]})]}),a.jsxs("div",{style:{display:"flex",gap:"10px"},children:[a.jsx("button",{onClick:P,style:{padding:"10px 20px",background:i!=null&&i.running?"#ef4444":"#10b981",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:"600"},children:i!=null&&i.running?"Stop Scheduler":"Start Scheduler"}),e.length===0&&a.jsx("button",{onClick:_,style:{padding:"10px 20px",background:"#2563eb",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:"600"},children:"Initialize Default Schedules"})]})]}),a.jsxs("div",{style:{marginBottom:"30px",display:"flex",gap:"10px",borderBottom:"2px solid #eee"},children:[a.jsxs("button",{onClick:()=>m("schedules"),style:{padding:"12px 24px",background:p==="schedules"?"white":"transparent",border:"none",borderBottom:p==="schedules"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:p==="schedules"?"600":"400",color:p==="schedules"?"#2563eb":"#666",marginBottom:"-2px"},children:["Schedule Configs (",e.length,")"]}),a.jsxs("button",{onClick:()=>m("logs"),style:{padding:"12px 24px",background:p==="logs"?"white":"transparent",border:"none",borderBottom:p==="logs"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:p==="logs"?"600":"400",color:p==="logs"?"#2563eb":"#666",marginBottom:"-2px"},children:["Run Logs (",r.length,")"]}),a.jsxs("button",{onClick:()=>m("detection"),style:{padding:"12px 24px",background:p==="detection"?"white":"transparent",border:"none",borderBottom:p==="detection"?"3px solid #2563eb":"3px solid transparent",cursor:"pointer",fontSize:"16px",fontWeight:p==="detection"?"600":"400",color:p==="detection"?"#2563eb":"#666",marginBottom:"-2px"},children:["Menu Detection ",o!=null&&o.needsDetection?`(${o.needsDetection} pending)`:""]})]}),p==="schedules"&&a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:e.length===0?a.jsx("div",{style:{padding:"40px",textAlign:"center",color:"#666"},children:'No schedules configured. Click "Initialize Default Schedules" to create the default crawl schedule.'}):a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Job Name"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Enabled"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Interval (Jitter)"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Last Run"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Next Run"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Last Status"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Actions"})]})}),a.jsx("tbody",{children:e.map(k=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600"},children:k.jobName}),k.description&&a.jsx("div",{style:{fontSize:"13px",color:"#666",marginTop:"4px"},children:k.description}),k.jobConfig&&a.jsxs("div",{style:{fontSize:"11px",color:"#999",marginTop:"4px"},children:["Config: ",JSON.stringify(k.jobConfig)]})]}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("button",{onClick:()=>$(k),style:{padding:"4px 12px",borderRadius:"12px",border:"none",cursor:"pointer",fontWeight:"600",fontSize:"12px",background:k.enabled?"#d1fae5":"#fee2e2",color:k.enabled?"#065f46":"#991b1b"},children:k.enabled?"ON":"OFF"})}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsx("div",{style:{fontWeight:"600"},children:D(k.baseIntervalMinutes,k.jitterMinutes)})}),a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{children:q(k.lastRunAt)}),k.lastDurationMs&&a.jsxs("div",{style:{fontSize:"12px",color:"#666"},children:["Duration: ",E(k.lastDurationMs)]})]}),a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600",color:"#2563eb"},children:Z(k.nextRunAt)}),k.nextRunAt&&a.jsx("div",{style:{fontSize:"12px",color:"#999"},children:new Date(k.nextRunAt).toLocaleString()})]}),a.jsx("td",{style:{padding:"15px"},children:k.lastStatus?a.jsxs("div",{children:[a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",...O(k.lastStatus)},children:k.lastStatus}),k.lastErrorMessage&&a.jsx("button",{onClick:()=>alert(k.lastErrorMessage),style:{marginLeft:"8px",padding:"2px 6px",background:"#fee2e2",color:"#991b1b",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"10px"},children:"Error"})]}):a.jsx("span",{style:{color:"#999"},children:"Never run"})}),a.jsx("td",{style:{padding:"15px",textAlign:"center"},children:a.jsxs("div",{style:{display:"flex",gap:"8px",justifyContent:"center"},children:[a.jsx("button",{onClick:()=>T(k.id),disabled:k.lastStatus==="running",style:{padding:"6px 12px",background:k.lastStatus==="running"?"#94a3b8":"#2563eb",color:"white",border:"none",borderRadius:"4px",cursor:k.lastStatus==="running"?"not-allowed":"pointer",fontSize:"13px"},children:"Run Now"}),a.jsx("button",{onClick:()=>g(k),style:{padding:"6px 12px",background:"#f3f4f6",color:"#374151",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"Edit"})]})})]},k.id))})]})}),p==="logs"&&a.jsx("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",overflow:"hidden"},children:r.length===0?a.jsx("div",{style:{padding:"40px",textAlign:"center",color:"#666"},children:"No run logs yet. Logs will appear here after jobs execute."}):a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#f8f8f8",borderBottom:"2px solid #eee"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Job"}),a.jsx("th",{style:{padding:"15px",textAlign:"center",fontWeight:"600"},children:"Status"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",fontWeight:"600"},children:"Started"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Duration"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Processed"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Succeeded"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:"Failed"})]})}),a.jsx("tbody",{children:r.map(k=>a.jsxs("tr",{style:{borderBottom:"1px solid #eee"},children:[a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{style:{fontWeight:"600"},children:k.job_name}),a.jsxs("div",{style:{fontSize:"12px",color:"#999"},children:["Run #",k.id]})]}),a.jsxs("td",{style:{padding:"15px",textAlign:"center"},children:[a.jsx("span",{style:{padding:"4px 10px",borderRadius:"12px",fontSize:"12px",fontWeight:"600",...O(k.status)},children:k.status}),k.error_message&&a.jsx("button",{onClick:()=>alert(k.error_message),style:{marginLeft:"8px",padding:"2px 6px",background:"#fee2e2",color:"#991b1b",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"10px"},children:"Error"})]}),a.jsxs("td",{style:{padding:"15px"},children:[a.jsx("div",{children:k.started_at?new Date(k.started_at).toLocaleString():"-"}),a.jsx("div",{style:{fontSize:"12px",color:"#999"},children:q(k.started_at)})]}),a.jsx("td",{style:{padding:"15px",textAlign:"right",fontWeight:"600"},children:E(k.duration_ms)}),a.jsx("td",{style:{padding:"15px",textAlign:"right"},children:k.items_processed??"-"}),a.jsx("td",{style:{padding:"15px",textAlign:"right",color:"#10b981"},children:k.items_succeeded??"-"}),a.jsx("td",{style:{padding:"15px",textAlign:"right",color:k.items_failed?"#ef4444":"inherit"},children:k.items_failed??"-"})]},k.id))})]})}),p==="detection"&&a.jsxs("div",{style:{background:"white",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",padding:"30px"},children:[o&&a.jsxs("div",{style:{marginBottom:"30px"},children:[a.jsx("h3",{style:{margin:"0 0 20px 0"},children:"Detection Statistics"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"20px"},children:[a.jsxs("div",{style:{padding:"20px",background:"#f8f8f8",borderRadius:"8px",textAlign:"center"},children:[a.jsx("div",{style:{fontSize:"32px",fontWeight:"700",color:"#2563eb"},children:o.totalDispensaries}),a.jsx("div",{style:{color:"#666",marginTop:"4px"},children:"Total Dispensaries"})]}),a.jsxs("div",{style:{padding:"20px",background:"#f8f8f8",borderRadius:"8px",textAlign:"center"},children:[a.jsx("div",{style:{fontSize:"32px",fontWeight:"700",color:"#10b981"},children:o.withMenuType}),a.jsx("div",{style:{color:"#666",marginTop:"4px"},children:"With Menu Type"})]}),a.jsxs("div",{style:{padding:"20px",background:"#f8f8f8",borderRadius:"8px",textAlign:"center"},children:[a.jsx("div",{style:{fontSize:"32px",fontWeight:"700",color:"#10b981"},children:o.withPlatformId}),a.jsx("div",{style:{color:"#666",marginTop:"4px"},children:"With Platform ID"})]}),a.jsxs("div",{style:{padding:"20px",background:"#fef3c7",borderRadius:"8px",textAlign:"center"},children:[a.jsx("div",{style:{fontSize:"32px",fontWeight:"700",color:"#92400e"},children:o.needsDetection}),a.jsx("div",{style:{color:"#666",marginTop:"4px"},children:"Needs Detection"})]})]}),Object.keys(o.byProvider).length>0&&a.jsxs("div",{style:{marginTop:"20px"},children:[a.jsx("h4",{style:{margin:"0 0 10px 0"},children:"By Provider"}),a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"10px"},children:Object.entries(o.byProvider).map(([k,L])=>a.jsxs("span",{style:{padding:"6px 14px",background:k==="dutchie"?"#dbeafe":"#f3f4f6",borderRadius:"16px",fontSize:"14px",fontWeight:"600"},children:[k,": ",L]},k))})]})]}),a.jsxs("div",{style:{marginBottom:"30px",display:"flex",gap:"15px",flexWrap:"wrap"},children:[a.jsx("button",{onClick:C,disabled:j||!(o!=null&&o.needsDetection),style:{padding:"12px 24px",background:j?"#94a3b8":"#2563eb",color:"white",border:"none",borderRadius:"6px",cursor:j?"not-allowed":"pointer",fontWeight:"600",fontSize:"14px"},children:j?"Detecting...":"Detect All Unknown"}),a.jsx("button",{onClick:R,disabled:j,style:{padding:"12px 24px",background:j?"#94a3b8":"#10b981",color:"white",border:"none",borderRadius:"6px",cursor:j?"not-allowed":"pointer",fontWeight:"600",fontSize:"14px"},children:j?"Resolving...":"Resolve Missing Platform IDs"})]}),w&&a.jsxs("div",{style:{marginBottom:"30px",padding:"20px",background:"#f8f8f8",borderRadius:"8px"},children:[a.jsx("h4",{style:{margin:"0 0 15px 0"},children:"Detection Results"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"15px",marginBottom:"15px"},children:[a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:"600",fontSize:"24px"},children:w.totalProcessed}),a.jsx("div",{style:{color:"#666",fontSize:"13px"},children:"Processed"})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:"600",fontSize:"24px",color:"#10b981"},children:w.totalSucceeded}),a.jsx("div",{style:{color:"#666",fontSize:"13px"},children:"Succeeded"})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:"600",fontSize:"24px",color:"#ef4444"},children:w.totalFailed}),a.jsx("div",{style:{color:"#666",fontSize:"13px"},children:"Failed"})]}),a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:"600",fontSize:"24px",color:"#666"},children:w.totalSkipped}),a.jsx("div",{style:{color:"#666",fontSize:"13px"},children:"Skipped"})]})]}),w.errors&&w.errors.length>0&&a.jsxs("div",{style:{marginTop:"15px"},children:[a.jsx("div",{style:{fontWeight:"600",marginBottom:"8px",color:"#991b1b"},children:"Errors:"}),a.jsxs("div",{style:{maxHeight:"150px",overflow:"auto",background:"#fee2e2",padding:"10px",borderRadius:"4px",fontSize:"12px"},children:[w.errors.slice(0,10).map((k,L)=>a.jsx("div",{style:{marginBottom:"4px"},children:k},L)),w.errors.length>10&&a.jsxs("div",{style:{fontStyle:"italic",marginTop:"8px"},children:["...and ",w.errors.length-10," more"]})]})]})]}),a.jsxs("div",{style:{padding:"20px",background:"#f0f9ff",borderRadius:"8px",fontSize:"14px"},children:[a.jsx("h4",{style:{margin:"0 0 10px 0",color:"#1e40af"},children:"About Menu Detection"}),a.jsxs("ul",{style:{margin:0,paddingLeft:"20px",color:"#1e40af"},children:[a.jsxs("li",{style:{marginBottom:"8px"},children:[a.jsx("strong",{children:"Detect All Unknown:"})," Scans dispensaries with no menu_type set and detects the provider (dutchie, treez, jane, etc.) from their menu_url."]}),a.jsxs("li",{style:{marginBottom:"8px"},children:[a.jsx("strong",{children:"Resolve Missing Platform IDs:"}),' For dispensaries already detected as "dutchie", extracts the cName from menu_url and resolves the platform_dispensary_id via GraphQL.']}),a.jsxs("li",{children:[a.jsx("strong",{children:"Automatic scheduling:"}),' A "Menu Detection" job runs daily (24h +/- 1h jitter) to detect new dispensaries.']})]})]})]}),x&&a.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},children:a.jsxs("div",{style:{background:"white",padding:"30px",borderRadius:"12px",width:"500px",maxWidth:"90vw"},children:[a.jsxs("h2",{style:{margin:"0 0 20px 0"},children:["Edit Schedule: ",x.jobName]}),a.jsxs("div",{style:{marginBottom:"20px"},children:[a.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"600"},children:"Description"}),a.jsx("input",{type:"text",value:x.description||"",onChange:k=>g({...x,description:k.target.value}),style:{width:"100%",padding:"10px",borderRadius:"6px",border:"1px solid #ddd",fontSize:"14px"}})]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"20px",marginBottom:"20px"},children:[a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"600"},children:"Base Interval (minutes)"}),a.jsx("input",{type:"number",value:x.baseIntervalMinutes,onChange:k=>g({...x,baseIntervalMinutes:parseInt(k.target.value)||240}),style:{width:"100%",padding:"10px",borderRadius:"6px",border:"1px solid #ddd",fontSize:"14px"}}),a.jsxs("div",{style:{fontSize:"12px",color:"#666",marginTop:"4px"},children:["= ",Math.floor(x.baseIntervalMinutes/60),"h ",x.baseIntervalMinutes%60,"m"]})]}),a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"8px",fontWeight:"600"},children:"Jitter (minutes)"}),a.jsx("input",{type:"number",value:x.jitterMinutes,onChange:k=>g({...x,jitterMinutes:parseInt(k.target.value)||30}),style:{width:"100%",padding:"10px",borderRadius:"6px",border:"1px solid #ddd",fontSize:"14px"}}),a.jsxs("div",{style:{fontSize:"12px",color:"#666",marginTop:"4px"},children:["+/- ",x.jitterMinutes,"m random offset"]})]})]}),a.jsxs("div",{style:{fontSize:"13px",color:"#666",marginBottom:"20px",padding:"15px",background:"#f8f8f8",borderRadius:"6px"},children:[a.jsx("strong",{children:"Effective range:"})," ",Math.floor((x.baseIntervalMinutes-x.jitterMinutes)/60),"h ",(x.baseIntervalMinutes-x.jitterMinutes)%60,"m"," to ",Math.floor((x.baseIntervalMinutes+x.jitterMinutes)/60),"h ",(x.baseIntervalMinutes+x.jitterMinutes)%60,"m"]}),a.jsxs("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"},children:[a.jsx("button",{onClick:()=>g(null),style:{padding:"10px 20px",background:"#f3f4f6",color:"#374151",border:"none",borderRadius:"6px",cursor:"pointer"},children:"Cancel"}),a.jsx("button",{onClick:()=>M(x.id,{description:x.description,baseIntervalMinutes:x.baseIntervalMinutes,jitterMinutes:x.jitterMinutes}),style:{padding:"10px 20px",background:"#2563eb",color:"white",border:"none",borderRadius:"6px",cursor:"pointer",fontWeight:"600"},children:"Save Changes"})]})]})})]})})}function w7(){const e=dt(),[t,r]=h.useState([]),[n,i]=h.useState(0),[s,o]=h.useState(!0),[l,c]=h.useState(null);h.useEffect(()=>{d()},[]);const d=async()=>{o(!0);try{const[u,f]=await Promise.all([B.getDutchieAZStores({limit:200}),B.getDutchieAZDashboard()]);r(u.stores),i(u.total),c(f)}catch(u){console.error("Failed to load data:",u)}finally{o(!1)}};return s?a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading stores..."})]})}):a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Dutchie AZ Stores"}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Arizona dispensaries using the Dutchie platform - data from the new pipeline"})]}),a.jsxs("button",{onClick:d,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:[a.jsx(Xt,{className:"w-4 h-4"}),"Refresh"]})]}),l&&a.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(Ln,{className:"w-5 h-5 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Dispensaries"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:l.dispensaryCount})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-green-50 rounded-lg",children:a.jsx(Ct,{className:"w-5 h-5 text-green-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Total Products"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:l.productCount.toLocaleString()})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-purple-50 rounded-lg",children:a.jsx(_r,{className:"w-5 h-5 text-purple-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Brands"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:l.brandCount})]})]})}),a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-orange-50 rounded-lg",children:a.jsx(Hr,{className:"w-5 h-5 text-orange-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Failed Jobs (24h)"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:l.failedJobCount})]})]})})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200",children:[a.jsx("div",{className:"p-4 border-b border-gray-200",children:a.jsxs("h2",{className:"text-lg font-semibold text-gray-900",children:["All Stores (",n,")"]})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"table table-zebra w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Name"}),a.jsx("th",{children:"City"}),a.jsx("th",{children:"Platform ID"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Actions"})]})}),a.jsx("tbody",{children:t.map(u=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:a.jsx(Ln,{className:"w-4 h-4 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-900",children:u.dba_name||u.name}),u.company_name&&u.company_name!==u.name&&a.jsx("p",{className:"text-xs text-gray-500",children:u.company_name})]})]})}),a.jsx("td",{children:a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(yi,{className:"w-4 h-4"}),u.city,", ",u.state]})}),a.jsx("td",{children:u.platform_dispensary_id?a.jsx("span",{className:"text-xs font-mono text-gray-600",children:u.platform_dispensary_id}):a.jsx("span",{className:"badge badge-warning badge-sm",children:"Not Resolved"})}),a.jsx("td",{children:u.platform_dispensary_id?a.jsx("span",{className:"badge badge-success badge-sm",children:"Ready"}):a.jsx("span",{className:"badge badge-warning badge-sm",children:"Pending"})}),a.jsx("td",{children:a.jsx("button",{onClick:()=>e(`/az/stores/${u.id}`),className:"btn btn-sm btn-primary",disabled:!u.platform_dispensary_id,children:"View Products"})})]},u.id))})]})})]})]})})}function S7(){const{id:e}=Na(),t=dt(),[r,n]=h.useState(null),[i,s]=h.useState([]),[o,l]=h.useState(!0),[c,d]=h.useState(!1),[u,f]=h.useState("products"),[p,m]=h.useState(!1),[x,g]=h.useState(!1),[b,v]=h.useState(""),[j,y]=h.useState(1),[w,S]=h.useState(0),[N]=h.useState(25),[P,_]=h.useState(""),T=O=>{if(!O)return"Never";const k=new Date(O),U=new Date().getTime()-k.getTime(),H=Math.floor(U/(1e3*60*60*24));return H===0?"Today":H===1?"Yesterday":H<7?`${H} days ago`:k.toLocaleDateString()};h.useEffect(()=>{e&&$()},[e]),h.useEffect(()=>{e&&u==="products"&&M()},[e,j,b,P,u]),h.useEffect(()=>{y(1)},[b,P]);const $=async()=>{l(!0);try{const O=await B.getDutchieAZStoreSummary(parseInt(e,10));n(O)}catch(O){console.error("Failed to load store summary:",O)}finally{l(!1)}},M=async()=>{if(e){d(!0);try{const O=await B.getDutchieAZStoreProducts(parseInt(e,10),{search:b||void 0,stockStatus:P||void 0,limit:N,offset:(j-1)*N});s(O.products),S(O.total)}catch(O){console.error("Failed to load products:",O)}finally{d(!1)}}},C=async()=>{m(!1),g(!0);try{await B.triggerDutchieAZCrawl(parseInt(e,10)),alert("Crawl started! Refresh the page in a few minutes to see updated data.")}catch(O){console.error("Failed to trigger crawl:",O),alert("Failed to start crawl. Please try again.")}finally{g(!1)}},R=Math.ceil(w/N);if(o)return a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading store..."})]})});if(!r)return a.jsx(X,{children:a.jsx("div",{className:"text-center py-12",children:a.jsx("p",{className:"text-gray-600",children:"Store not found"})})});const{dispensary:q,brands:Z,categories:E,lastCrawl:D}=r;return a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between gap-4",children:[a.jsxs("button",{onClick:()=>t("/az"),className:"flex items-center gap-2 text-sm text-gray-600 hover:text-gray-900",children:[a.jsx(_h,{className:"w-4 h-4"}),"Back to AZ Stores"]}),a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>m(!p),disabled:x,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed",children:[a.jsx(Xt,{className:`w-4 h-4 ${x?"animate-spin":""}`}),x?"Crawling...":"Crawl Now",!x&&a.jsx(ej,{className:"w-4 h-4"})]}),p&&!x&&a.jsx("div",{className:"absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg border border-gray-200 z-10",children:a.jsx("button",{onClick:C,className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-lg",children:"Start Full Crawl"})})]})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 mb-4",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"p-3 bg-blue-50 rounded-lg",children:a.jsx(Ln,{className:"w-8 h-8 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:q.dba_name||q.name}),q.company_name&&a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:q.company_name}),a.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Platform ID: ",q.platform_dispensary_id||"Not resolved"]})]})]}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 bg-gray-50 px-4 py-2 rounded-lg",children:[a.jsx(xr,{className:"w-4 h-4"}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Last Crawl:"}),a.jsx("span",{className:"ml-2",children:D!=null&&D.completed_at?new Date(D.completed_at).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Never"}),(D==null?void 0:D.status)&&a.jsx("span",{className:`ml-2 px-2 py-0.5 rounded text-xs ${D.status==="completed"?"bg-green-100 text-green-800":D.status==="failed"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:D.status})]})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-4",children:[q.address&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(yi,{className:"w-4 h-4"}),a.jsxs("span",{children:[q.address,", ",q.city,", ",q.state," ",q.zip]})]}),q.phone&&a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[a.jsx(Ah,{className:"w-4 h-4"}),a.jsx("span",{children:q.phone})]}),q.website&&a.jsxs("a",{href:q.website,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-blue-600 hover:text-blue-800",children:[a.jsx(Jr,{className:"w-4 h-4"}),"Website"]})]})]}),a.jsxs("div",{className:"grid grid-cols-5 gap-4",children:[a.jsx("button",{onClick:()=>{f("products"),_(""),v("")},className:`bg-white rounded-lg border p-4 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left ${u==="products"&&!P?"border-blue-500":"border-gray-200"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-green-50 rounded-lg",children:a.jsx(Ct,{className:"w-5 h-5 text-green-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Total Products"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:r.totalProducts})]})]})}),a.jsx("button",{onClick:()=>{f("products"),_("in_stock"),v("")},className:`bg-white rounded-lg border p-4 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left ${P==="in_stock"?"border-blue-500":"border-gray-200"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-emerald-50 rounded-lg",children:a.jsx(_r,{className:"w-5 h-5 text-emerald-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"In Stock"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:r.inStockCount})]})]})}),a.jsx("button",{onClick:()=>{f("products"),_("out_of_stock"),v("")},className:`bg-white rounded-lg border p-4 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left ${P==="out_of_stock"?"border-blue-500":"border-gray-200"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-red-50 rounded-lg",children:a.jsx(Hr,{className:"w-5 h-5 text-red-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Out of Stock"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:r.outOfStockCount})]})]})}),a.jsx("button",{onClick:()=>f("brands"),className:`bg-white rounded-lg border p-4 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left ${u==="brands"?"border-blue-500":"border-gray-200"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-purple-50 rounded-lg",children:a.jsx(Cr,{className:"w-5 h-5 text-purple-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Brands"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:r.brandCount})]})]})}),a.jsx("button",{onClick:()=>f("categories"),className:`bg-white rounded-lg border p-4 hover:border-blue-300 hover:shadow-md transition-all cursor-pointer text-left ${u==="categories"?"border-blue-500":"border-gray-200"}`,children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-orange-50 rounded-lg",children:a.jsx(Uc,{className:"w-5 h-5 text-orange-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Categories"}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:r.categoryCount})]})]})})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200",children:[a.jsx("div",{className:"border-b border-gray-200",children:a.jsxs("div",{className:"flex gap-4 px-6",children:[a.jsxs("button",{onClick:()=>{f("products"),_("")},className:`py-4 px-2 text-sm font-medium border-b-2 ${u==="products"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Products (",r.totalProducts,")"]}),a.jsxs("button",{onClick:()=>f("brands"),className:`py-4 px-2 text-sm font-medium border-b-2 ${u==="brands"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Brands (",r.brandCount,")"]}),a.jsxs("button",{onClick:()=>f("categories"),className:`py-4 px-2 text-sm font-medium border-b-2 ${u==="categories"?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:["Categories (",r.categoryCount,")"]})]})}),a.jsxs("div",{className:"p-6",children:[u==="products"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[a.jsx("input",{type:"text",placeholder:"Search products by name or brand...",value:b,onChange:O=>v(O.target.value),className:"input input-bordered input-sm flex-1"}),a.jsxs("select",{value:P,onChange:O=>_(O.target.value),className:"select select-bordered select-sm",children:[a.jsx("option",{value:"",children:"All Stock"}),a.jsx("option",{value:"in_stock",children:"In Stock"}),a.jsx("option",{value:"out_of_stock",children:"Out of Stock"}),a.jsx("option",{value:"unknown",children:"Unknown"})]}),(b||P)&&a.jsx("button",{onClick:()=>{v(""),_("")},className:"btn btn-sm btn-ghost",children:"Clear"}),a.jsxs("div",{className:"text-sm text-gray-600",children:[w," products"]})]}),c?a.jsxs("div",{className:"text-center py-8",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-6 w-6 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading products..."})]}):i.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No products found"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"overflow-x-auto -mx-6 px-6",children:a.jsxs("table",{className:"table table-xs table-zebra table-pin-rows w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Image"}),a.jsx("th",{children:"Product Name"}),a.jsx("th",{children:"Brand"}),a.jsx("th",{children:"Type"}),a.jsx("th",{className:"text-right",children:"Price"}),a.jsx("th",{className:"text-center",children:"THC %"}),a.jsx("th",{className:"text-center",children:"Stock"}),a.jsx("th",{className:"text-center",children:"Qty"}),a.jsx("th",{children:"Last Updated"})]})}),a.jsx("tbody",{children:i.map(O=>a.jsxs("tr",{children:[a.jsx("td",{className:"whitespace-nowrap",children:O.image_url?a.jsx("img",{src:O.image_url,alt:O.name,className:"w-12 h-12 object-cover rounded",onError:k=>k.currentTarget.style.display="none"}):"-"}),a.jsx("td",{className:"font-medium max-w-[200px]",children:a.jsx("div",{className:"line-clamp-2",title:O.name,children:O.name})}),a.jsx("td",{className:"max-w-[120px]",children:a.jsx("div",{className:"line-clamp-2",title:O.brand||"-",children:O.brand||"-"})}),a.jsxs("td",{className:"whitespace-nowrap",children:[a.jsx("span",{className:"badge badge-ghost badge-sm",children:O.type||"-"}),O.subcategory&&a.jsx("span",{className:"badge badge-ghost badge-sm ml-1",children:O.subcategory})]}),a.jsx("td",{className:"text-right font-semibold whitespace-nowrap",children:O.sale_price?a.jsxs("div",{className:"flex flex-col items-end",children:[a.jsxs("span",{className:"text-error",children:["$",O.sale_price]}),a.jsxs("span",{className:"text-gray-400 line-through text-xs",children:["$",O.regular_price]})]}):O.regular_price?`$${O.regular_price}`:"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:O.thc_percentage?a.jsxs("span",{className:"badge badge-success badge-sm",children:[O.thc_percentage,"%"]}):"-"}),a.jsx("td",{className:"text-center whitespace-nowrap",children:O.stock_status==="in_stock"?a.jsx("span",{className:"badge badge-success badge-sm",children:"In Stock"}):O.stock_status==="out_of_stock"?a.jsx("span",{className:"badge badge-error badge-sm",children:"Out"}):a.jsx("span",{className:"badge badge-warning badge-sm",children:"Unknown"})}),a.jsx("td",{className:"text-center whitespace-nowrap",children:O.total_quantity!=null?O.total_quantity:"-"}),a.jsx("td",{className:"whitespace-nowrap text-xs text-gray-500",children:O.updated_at?T(O.updated_at):"-"})]},O.id))})]})}),R>1&&a.jsxs("div",{className:"flex justify-center items-center gap-2 mt-4",children:[a.jsx("button",{onClick:()=>y(O=>Math.max(1,O-1)),disabled:j===1,className:"btn btn-sm btn-outline",children:"Previous"}),a.jsx("div",{className:"flex gap-1",children:Array.from({length:Math.min(5,R)},(O,k)=>{let L;return R<=5||j<=3?L=k+1:j>=R-2?L=R-4+k:L=j-2+k,a.jsx("button",{onClick:()=>y(L),className:`btn btn-sm ${j===L?"btn-primary":"btn-outline"}`,children:L},L)})}),a.jsx("button",{onClick:()=>y(O=>Math.min(R,O+1)),disabled:j===R,className:"btn btn-sm btn-outline",children:"Next"})]})]})]}),u==="brands"&&a.jsx("div",{className:"space-y-4",children:Z.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No brands found"}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:Z.map(O=>a.jsxs("button",{onClick:()=>{f("products"),v(O.brand_name),_("")},className:"border border-gray-200 rounded-lg p-4 text-center hover:border-blue-300 hover:shadow-md transition-all cursor-pointer",children:[a.jsx("p",{className:"font-medium text-gray-900 line-clamp-2",children:O.brand_name}),a.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:[O.product_count," product",O.product_count!==1?"s":""]})]},O.brand_name))})}),u==="categories"&&a.jsx("div",{className:"space-y-4",children:E.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No categories found"}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:E.map((O,k)=>a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 text-center",children:[a.jsx("p",{className:"font-medium text-gray-900",children:O.type}),O.subcategory&&a.jsx("p",{className:"text-sm text-gray-600",children:O.subcategory}),a.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[O.product_count," product",O.product_count!==1?"s":""]})]},k))})})]})]})]})})}function N7(){const e=dt(),[t,r]=h.useState(null),[n,i]=h.useState([]),[s,o]=h.useState([]),[l,c]=h.useState([]),[d,u]=h.useState(!0),[f,p]=h.useState("overview");h.useEffect(()=>{m()},[]);const m=async()=>{u(!0);try{const[g,b,v,j]=await Promise.all([B.getDutchieAZDashboard(),B.getDutchieAZStores({limit:200}),B.getDutchieAZBrands?B.getDutchieAZBrands({limit:100}):Promise.resolve({brands:[]}),B.getDutchieAZCategories?B.getDutchieAZCategories():Promise.resolve({categories:[]})]);r(g),i(b.stores||[]),o(v.brands||[]),c(j.categories||[])}catch(g){console.error("Failed to load analytics data:",g)}finally{u(!1)}},x=g=>{if(!g)return"Never";const b=new Date(g),j=new Date().getTime()-b.getTime(),y=Math.floor(j/(1e3*60*60)),w=Math.floor(j/(1e3*60*60*24));return y<1?"Just now":y<24?`${y}h ago`:w===1?"Yesterday":w<7?`${w} days ago`:b.toLocaleDateString()};return d?a.jsx(X,{children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block animate-spin rounded-full h-8 w-8 border-4 border-blue-500 border-t-transparent"}),a.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Loading analytics..."})]})}):a.jsx(X,{children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Wholesale & Inventory Analytics"}),a.jsx("p",{className:"text-sm text-gray-600 mt-1",children:"Arizona Dutchie dispensaries data overview"})]}),a.jsxs("button",{onClick:m,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:[a.jsx(Xt,{className:"w-4 h-4"}),"Refresh"]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-4",children:[a.jsx(Ii,{title:"Dispensaries",value:(t==null?void 0:t.dispensaryCount)||0,icon:a.jsx(Ln,{className:"w-5 h-5 text-blue-600"}),color:"blue"}),a.jsx(Ii,{title:"Total Products",value:(t==null?void 0:t.productCount)||0,icon:a.jsx(Ct,{className:"w-5 h-5 text-green-600"}),color:"green"}),a.jsx(Ii,{title:"Brands",value:(t==null?void 0:t.brandCount)||0,icon:a.jsx(Cr,{className:"w-5 h-5 text-purple-600"}),color:"purple"}),a.jsx(Ii,{title:"Categories",value:(t==null?void 0:t.categoryCount)||0,icon:a.jsx(Tx,{className:"w-5 h-5 text-orange-600"}),color:"orange"}),a.jsx(Ii,{title:"Snapshots (24h)",value:(t==null?void 0:t.snapshotCount24h)||0,icon:a.jsx(zn,{className:"w-5 h-5 text-cyan-600"}),color:"cyan"}),a.jsx(Ii,{title:"Failed Jobs (24h)",value:(t==null?void 0:t.failedJobCount)||0,icon:a.jsx(Uc,{className:"w-5 h-5 text-red-600"}),color:"red"}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-600 mb-1",children:[a.jsx(xr,{className:"w-4 h-4"}),a.jsx("span",{className:"text-xs",children:"Last Crawl"})]}),a.jsx("p",{className:"text-sm font-semibold text-gray-900",children:x((t==null?void 0:t.lastCrawlTime)||null)})]})]}),a.jsxs("div",{className:"bg-white rounded-lg border border-gray-200",children:[a.jsx("div",{className:"border-b border-gray-200",children:a.jsxs("div",{className:"flex gap-4 px-6",children:[a.jsx(Vo,{active:f==="overview",onClick:()=>p("overview"),icon:a.jsx(HA,{className:"w-4 h-4"}),label:"Overview"}),a.jsx(Vo,{active:f==="stores",onClick:()=>p("stores"),icon:a.jsx(Ln,{className:"w-4 h-4"}),label:`Stores (${n.length})`}),a.jsx(Vo,{active:f==="brands",onClick:()=>p("brands"),icon:a.jsx(Cr,{className:"w-4 h-4"}),label:`Brands (${s.length})`}),a.jsx(Vo,{active:f==="categories",onClick:()=>p("categories"),icon:a.jsx(Tx,{className:"w-4 h-4"}),label:`Categories (${l.length})`})]})}),a.jsxs("div",{className:"p-6",children:[f==="overview"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Top Stores by Products"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:n.slice(0,6).map(g=>a.jsxs("button",{onClick:()=>e(`/az/stores/${g.id}`),className:"flex items-center justify-between p-4 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors text-left",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-900",children:g.dba_name||g.name}),a.jsxs("p",{className:"text-sm text-gray-600",children:[g.city,", ",g.state]}),a.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Last crawl: ",x(g.last_crawl_at||null)]})]}),a.jsx(Cf,{className:"w-5 h-5 text-gray-400"})]},g.id))})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Top Brands"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:s.slice(0,12).map(g=>a.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg text-center",children:[a.jsx("p",{className:"font-medium text-gray-900 text-sm line-clamp-2",children:g.brand_name}),a.jsx("p",{className:"text-lg font-bold text-purple-600 mt-1",children:g.product_count}),a.jsx("p",{className:"text-xs text-gray-500",children:"products"})]},g.brand_name))})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Product Categories"}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:l.slice(0,12).map((g,b)=>a.jsxs("div",{className:"p-4 bg-gray-50 rounded-lg text-center",children:[a.jsx("p",{className:"font-medium text-gray-900",children:g.type}),g.subcategory&&a.jsx("p",{className:"text-xs text-gray-600",children:g.subcategory}),a.jsx("p",{className:"text-lg font-bold text-orange-600 mt-1",children:g.product_count}),a.jsx("p",{className:"text-xs text-gray-500",children:"products"})]},b))})]})]}),f==="stores"&&a.jsx("div",{className:"space-y-4",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"table table-sm w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Store Name"}),a.jsx("th",{children:"City"}),a.jsx("th",{className:"text-center",children:"Platform ID"}),a.jsx("th",{className:"text-center",children:"Last Crawl"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:n.map(g=>a.jsxs("tr",{className:"hover",children:[a.jsx("td",{className:"font-medium",children:g.dba_name||g.name}),a.jsxs("td",{children:[g.city,", ",g.state]}),a.jsx("td",{className:"text-center",children:g.platform_dispensary_id?a.jsx("span",{className:"badge badge-success badge-sm",children:"Resolved"}):a.jsx("span",{className:"badge badge-warning badge-sm",children:"Pending"})}),a.jsx("td",{className:"text-center text-sm text-gray-600",children:x(g.last_crawl_at||null)}),a.jsx("td",{children:a.jsx("button",{onClick:()=>e(`/az/stores/${g.id}`),className:"btn btn-xs btn-ghost",children:"View"})})]},g.id))})]})})}),f==="brands"&&a.jsx("div",{className:"space-y-4",children:s.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No brands found. Run a crawl to populate brand data."}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4",children:s.map(g=>a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 text-center hover:border-purple-300 hover:shadow-md transition-all",children:[a.jsx("p",{className:"font-medium text-gray-900 text-sm line-clamp-2 h-10",children:g.brand_name}),a.jsxs("div",{className:"mt-2 space-y-1",children:[a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Products:"}),a.jsx("span",{className:"font-semibold",children:g.product_count})]}),a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Stores:"}),a.jsx("span",{className:"font-semibold",children:g.dispensary_count})]})]})]},g.brand_name))})}),f==="categories"&&a.jsx("div",{className:"space-y-4",children:l.length===0?a.jsx("p",{className:"text-center py-8 text-gray-500",children:"No categories found. Run a crawl to populate category data."}):a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:l.map((g,b)=>a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:border-orange-300 hover:shadow-md transition-all",children:[a.jsx("p",{className:"font-medium text-gray-900",children:g.type}),g.subcategory&&a.jsx("p",{className:"text-sm text-gray-600",children:g.subcategory}),a.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 text-xs",children:[a.jsxs("div",{className:"bg-gray-50 rounded p-2 text-center",children:[a.jsx("p",{className:"font-bold text-lg text-orange-600",children:g.product_count}),a.jsx("p",{className:"text-gray-500",children:"products"})]}),a.jsxs("div",{className:"bg-gray-50 rounded p-2 text-center",children:[a.jsx("p",{className:"font-bold text-lg text-blue-600",children:g.brand_count}),a.jsx("p",{className:"text-gray-500",children:"brands"})]})]}),g.avg_thc!=null&&a.jsxs("p",{className:"text-xs text-gray-500 mt-2 text-center",children:["Avg THC: ",g.avg_thc.toFixed(1),"%"]})]},b))})})]})]})]})})}function Ii({title:e,value:t,icon:r,color:n}){const i={blue:"bg-blue-50",green:"bg-green-50",purple:"bg-purple-50",orange:"bg-orange-50",cyan:"bg-cyan-50",red:"bg-red-50"};return a.jsx("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`p-2 ${i[n]||"bg-gray-50"} rounded-lg`,children:r}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-600",children:e}),a.jsx("p",{className:"text-xl font-bold text-gray-900",children:t.toLocaleString()})]})]})})}function Vo({active:e,onClick:t,icon:r,label:n}){return a.jsxs("button",{onClick:t,className:`flex items-center gap-2 py-4 px-2 text-sm font-medium border-b-2 transition-colors ${e?"border-blue-600 text-blue-600":"border-transparent text-gray-600 hover:text-gray-900"}`,children:[r,n]})}function ve({children:e}){const{isAuthenticated:t,checkAuth:r}=Ph();return h.useEffect(()=>{r()},[]),t?a.jsx(a.Fragment,{children:e}):a.jsx(H1,{to:"/login",replace:!0})}function k7(){return a.jsx(QC,{children:a.jsxs(HC,{children:[a.jsx(de,{path:"/login",element:a.jsx(DA,{})}),a.jsx(de,{path:"/",element:a.jsx(ve,{children:a.jsx(XB,{})})}),a.jsx(de,{path:"/products",element:a.jsx(ve,{children:a.jsx(JB,{})})}),a.jsx(de,{path:"/products/:id",element:a.jsx(ve,{children:a.jsx(e7,{})})}),a.jsx(de,{path:"/stores",element:a.jsx(ve,{children:a.jsx(t7,{})})}),a.jsx(de,{path:"/dispensaries",element:a.jsx(ve,{children:a.jsx(r7,{})})}),a.jsx(de,{path:"/dispensaries/:state/:city/:slug",element:a.jsx(ve,{children:a.jsx(n7,{})})}),a.jsx(de,{path:"/stores/:state/:storeName/:slug/brands",element:a.jsx(ve,{children:a.jsx(a7,{})})}),a.jsx(de,{path:"/stores/:state/:storeName/:slug/specials",element:a.jsx(ve,{children:a.jsx(s7,{})})}),a.jsx(de,{path:"/stores/:state/:storeName/:slug",element:a.jsx(ve,{children:a.jsx(i7,{})})}),a.jsx(de,{path:"/categories",element:a.jsx(ve,{children:a.jsx(o7,{})})}),a.jsx(de,{path:"/campaigns",element:a.jsx(ve,{children:a.jsx(l7,{})})}),a.jsx(de,{path:"/analytics",element:a.jsx(ve,{children:a.jsx(u7,{})})}),a.jsx(de,{path:"/settings",element:a.jsx(ve,{children:a.jsx(d7,{})})}),a.jsx(de,{path:"/changes",element:a.jsx(ve,{children:a.jsx(v7,{})})}),a.jsx(de,{path:"/proxies",element:a.jsx(ve,{children:a.jsx(p7,{})})}),a.jsx(de,{path:"/logs",element:a.jsx(ve,{children:a.jsx(m7,{})})}),a.jsx(de,{path:"/scraper-tools",element:a.jsx(ve,{children:a.jsx(y7,{})})}),a.jsx(de,{path:"/scraper-monitor",element:a.jsx(ve,{children:a.jsx(g7,{})})}),a.jsx(de,{path:"/scraper-schedule",element:a.jsx(ve,{children:a.jsx(x7,{})})}),a.jsx(de,{path:"/az-schedule",element:a.jsx(ve,{children:a.jsx(j7,{})})}),a.jsx(de,{path:"/az",element:a.jsx(ve,{children:a.jsx(w7,{})})}),a.jsx(de,{path:"/az/stores/:id",element:a.jsx(ve,{children:a.jsx(S7,{})})}),a.jsx(de,{path:"/api-permissions",element:a.jsx(ve,{children:a.jsx(b7,{})})}),a.jsx(de,{path:"/wholesale-analytics",element:a.jsx(ve,{children:a.jsx(N7,{})})}),a.jsx(de,{path:"*",element:a.jsx(H1,{to:"/",replace:!0})})]})})}Od.createRoot(document.getElementById("root")).render(a.jsx(fs.StrictMode,{children:a.jsx(k7,{})}));