PageSourceSearch

https://afrocaribbeanstore.co.uk/assets/index-DEiXUGB8.js

js afrocaribbeanstore.co.uk collected 2026-10-09 22:00:21 UTC 1,327,869 bytes, 672 lines download raw bytes

vendor: 6,236 bytes, lines 1-9
1var l_=e=>{throw TypeError(e)};var cy=(e,t,r)=>t.has(e)||l_("Cannot "+r);var G=(e,t,r)=>(cy(e,t,"read from private field"),r?r.call(e):t.get(e)),Fe=(e,t,r)=>t.has(e)?l_("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Ee=(e,t,r,n)=>(cy(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),sr=(e,t,r)=>(cy(e,t,"access private method"),r);var eh=(e,t,r,n)=>({set _(a){Ee(e,t,a,r)},get _(){return G(e,t,n)}});function Y5(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var th=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d2={exports:{}},dg={},f2={exports:{}},Ie={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Of=Symbol.for("react.element"),X5=Symbol.for("react.portal"),Q5=Symbol.for("react.fragment"),J5=Symbol.for("react.strict_mode"),Z5=Symbol.for("react.profiler"),eF=Symbol.for("react.provider"),tF=Symbol.for("react.context"),rF=Symbol.for("react.forward_ref"),nF=Symbol.for("react.suspense"),aF=Symbol.for("react.memo"),iF=Symbol.for("react.lazy"),c_=Symbol.iterator;function sF(e){return e===null||typeof e!="object"?null:(e=c_&&e[c_]||e["@@iterator"],typeof e=="function"?e:null)}var h2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p2=Object.assign,m2={};function Oc(e,t,r){this.props=e,this.context=t,this.refs=m2,this.updater=r||h2}Oc.prototype.isReactComponent={};Oc.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")};Oc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function g2(){}g2.prototype=Oc.prototype;function Gw(e,t,r){this.props=e,this.context=t,this.refs=m2,this.updater=r||h2}var Yw=Gw.prototype=new g2;Yw.constructor=Gw;p2(Yw,Oc.prototype);Yw.isPureReactComponent=!0;var u_=Array.isArray,v2=Object.prototype.hasOwnProperty,Xw={current:null},y2={key:!0,ref:!0,__self:!0,__source:!0};function x2(e,t,r){var n,a={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)v2.call(t,n)&&!y2.hasOwnProperty(n)&&(a[n]=t[n]);var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)a[n]===void 0&&(a[n]=l[n]);return{$$typeof:Of,type:e,key:i,ref:o,props:a,_owner:Xw.current}}function oF(e,t){return{$$typeof:Of,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Qw(e){return typeof e=="object"&&e!==null&&e.$$typeof===Of}function lF(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var d_=/\/+/g;function uy(e,t){return typeof e=="object"&&e!==null&&e.key!=null?lF(""+e.key):t.toString(36)}function Qh(e,t,r,n,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Of:case X5:o=!0}}if(o)return o=e,a=a(o),e=n===""?"."+uy(o,0):n,u_(a)?(r="",e!=null&&(r=e.replace(d_,"$&/")+"/"),Qh(a,t,r,"",function(u){return u})):a!=null&&(Qw(a)&&(a=oF(a,r+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(d_,"$&/")+"/")+e)),t.push(a)),1;if(o=0,n=n===""?".":n+":",u_(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+uy(i,l);o+=Qh(i,t,r,c,a)}else if(c=sF(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+uy(i,l++),o+=Qh(i,t,r,c,a);else if(i==="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 rh(e,t,r){if(e==null)return e;var n=[],a=0;return Qh(e,n,"","",function(i){return t.call(r,i,a++)}),n}function cF(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 Cr={current:null},Jh={transition:null},uF={ReactCurrentDispatcher:Cr,ReactCurrentBatchConfig:Jh,ReactCurrentOwner:Xw};function b2(){throw Error("act(...) is not supported in production builds of React.")}Ie.Children={map:rh,forEach:function(e,t,r){rh(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return rh(e,function(){t++}),t},toArray:function(e){return rh(e,function(t){return t})||[]},only:function(e){if(!Qw(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ie.Component=Oc;Ie.Fragment=Q5;Ie.Profiler=Z5;Ie.PureComponent=Gw;Ie.StrictMode=J5;Ie.Suspense=nF;
vendor: 8,610 bytes, lines 9-33
9Ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uF;Ie.act=b2;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=p2({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Xw.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)v2.call(t,c)&&!y2.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 u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:Of,type:e.type,key:a,ref:i,props:n,_owner:o}};Ie.createContext=function(e){return e={$$typeof:tF,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:eF,_context:e},e.Consumer=e};Ie.createElement=x2;Ie.createFactory=function(e){var t=x2.bind(null,e);return t.type=e,t};Ie.createRef=function(){return{current:null}};Ie.forwardRef=function(e){return{$$typeof:rF,render:e}};Ie.isValidElement=Qw;Ie.lazy=function(e){return{$$typeof:iF,_payload:{_status:-1,_result:e},_init:cF}};Ie.memo=function(e,t){return{$$typeof:aF,type:e,compare:t===void 0?null:t}};Ie.startTransition=function(e){var t=Jh.transition;Jh.transition={};try{e()}finally{Jh.transition=t}};Ie.unstable_act=b2;Ie.useCallback=function(e,t){return Cr.current.useCallback(e,t)};Ie.useContext=function(e){return Cr.current.useContext(e)};Ie.useDebugValue=function(){};Ie.useDeferredValue=function(e){return Cr.current.useDeferredValue(e)};Ie.useEffect=function(e,t){return Cr.current.useEffect(e,t)};Ie.useId=function(){return Cr.current.useId()};Ie.useImperativeHandle=function(e,t,r){return Cr.current.useImperativeHandle(e,t,r)};Ie.useInsertionEffect=function(e,t){return Cr.current.useInsertionEffect(e,t)};Ie.useLayoutEffect=function(e,t){return Cr.current.useLayoutEffect(e,t)};Ie.useMemo=function(e,t){return Cr.current.useMemo(e,t)};Ie.useReducer=function(e,t,r){return Cr.current.useReducer(e,t,r)};Ie.useRef=function(e){return Cr.current.useRef(e)};Ie.useState=function(e){return Cr.current.useState(e)};Ie.useSyncExternalStore=function(e,t,r){return Cr.current.useSyncExternalStore(e,t,r)};Ie.useTransition=function(){return Cr.current.useTransition()};Ie.version="18.3.1";f2.exports=Ie;var b=f2.exports;const C=qe(b),Jw=Y5({__proto__:null,default:C},[b]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var dF=b,fF=Symbol.for("react.element"),hF=Symbol.for("react.fragment"),pF=Object.prototype.hasOwnProperty,mF=dF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,gF={key:!0,ref:!0,__self:!0,__source:!0};function w2(e,t,r){var n,a={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)pF.call(t,n)&&!gF.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:fF,type:e,key:i,ref:o,props:a,_owner:mF.current}}dg.Fragment=hF;dg.jsx=w2;dg.jsxs=w2;d2.exports=dg;var s=d2.exports,j2={exports:{}},sn={},S2={exports:{}},_2={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(e){function t(M,$){var z=M.length;M.push($);e:for(;0<z;){var K=z-1>>>1,q=M[K];if(0<a(q,$))M[K]=$,M[z]=q,z=K;else break e}}function r(M){return M.length===0?null:M[0]}function n(M){if(M.length===0)return null;var $=M[0],z=M.pop();if(z!==$){M[0]=z;e:for(var K=0,q=M.length,B=q>>>1;K<B;){var Z=2*(K+1)-1,he=M[Z],pe=Z+1,Q=M[pe];if(0>a(he,z))pe<q&&0>a(Q,he)?(M[K]=Q,M[pe]=z,K=pe):(M[K]=he,M[Z]=z,K=Z);else if(pe<q&&0>a(Q,z))M[K]=Q,M[pe]=z,K=pe;else break e}}return $}function a(M,$){var z=M.sortIndex-$.sortIndex;return z!==0?z:M.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,p=!1,v=!1,m=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(M){for(var $=r(u);$!==null;){if($.callback===null)n(u);else if($.startTime<=M)n(u),$.sortIndex=$.expirationTime,t(c,$);else break;$=r(u)}}function S(M){if(m=!1,w(M),!v)if(r(c)!==null)v=!0,P(j);else{var $=r(u);$!==null&&D(S,$.startTime-M)}}function j(M,$){v=!1,m&&(m=!1,y(k),k=-1),p=!0;var z=h;try{for(w($),f=r(c);f!==null&&(!(f.expirationTime>$)||M&&!A());){var K=f.callback;if(typeof K=="function"){f.callback=null,h=f.priorityLevel;var q=K(f.expirationTime<=$);$=e.unstable_now(),typeof q=="function"?f.callback=q:f===r(c)&&n(c),w($)}else n(c);f=r(c)}if(f!==null)var B=!0;else{var Z=r(u);Z!==null&&D(S,Z.startTime-$),B=!1}return B}finally{f=null,h=z,p=!1}}var _=!1,N=null,k=-1,O=5,E=-1;function A(){return!(e.unstable_now()-E<O)}function R(){if(N!==null){var M=e.unstable_now();E=M;var $=!0;try{$=N(!0,M)}finally{$?T():(_=!1,N=null)}}else _=!1}var T;if(typeof x=="function")T=function(){x(R)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,F=I.port2;I.port1.onmessage=R,T=function(){F.postMessage(null)}}else T=function(){g(R,0)};function P(M){N=M,_||(_=!0,T())}function D(M,$){k=g(function(){M(e.unstable_now())},$)}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(M){M.callback=null},e.unstable_continueExecution=function(){v||p||(v=!0,P(j))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(M){switch(h){case 1:case 2:case 3:var $=3;break;default:$=h}var z=h;h=$;try{return M()}finally{h=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,$){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var z=h;h=M;try{return $()}finally{h=z}},e.unstable_scheduleCallback=function(M,$,z){var K=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?K+z:K):z=K,M){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=z+q,M={id:d++,callback:$,priorityLevel:M,startTime:z,expirationTime:q,sortIndex:-1},z>K?(M.sortIndex=z,t(u,M),r(c)===null&&M===r(u)&&(m?(y(k),k=-1):m=!0,D(S,z-K))):(M.sortIndex=q,t(c,M),v||p||(v=!0,P(j))),M},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(M){var $=h;return function(){var z=h;h=$;try{return M.apply(this,arguments)}finally{h=z}}}})(_2);S2.exports=_2;var vF=S2.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var yF=b,rn=vF;function re(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 N2=new Set,ad={};function xo(e,t){ql(e,t),ql(e+"Capture",t)}function ql(e,t){for(ad[e]=t,e=0;e<t.length;e++)N2.add(t[e])}var Xa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bx=Object.prototype.hasOwnProperty,xF=/^[: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]*$/,f_={},h_={};
vendor: 4,331 bytes, line 33
33function bF(e){return Bx.call(h_,e)?!0:Bx.call(f_,e)?!1:xF.test(e)?h_[e]=!0:(f_[e]=!0,!1)}function wF(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 jF(e,t,r,n){if(t===null||typeof t>"u"||wF(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 Er(e,t,r,n,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var rr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){rr[e]=new Er(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];rr[t]=new Er(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){rr[e]=new Er(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){rr[e]=new Er(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){rr[e]=new Er(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){rr[e]=new Er(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){rr[e]=new Er(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){rr[e]=new Er(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){rr[e]=new Er(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zw=/[\-:]([a-z])/g;function e1(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(Zw,e1);rr[t]=new Er(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(Zw,e1);rr[t]=new Er(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(Zw,e1);rr[t]=new Er(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){rr[e]=new Er(e,1,!1,e.toLowerCase(),null,!1,!1)});rr.xlinkHref=new Er("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){rr[e]=new Er(e,1,!1,e.toLowerCase(),null,!0,!0)});function t1(e,t,r,n){var a=rr.hasOwnProperty(t)?rr[t]:null;(a!==null?a.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(jF(t,r,a,n)&&(r=null),n||a===null?bF(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,n=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r
vendor: 6,553 bytes, lines 33-37
33===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var li=yF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nh=Symbol.for("react.element"),rl=Symbol.for("react.portal"),nl=Symbol.for("react.fragment"),r1=Symbol.for("react.strict_mode"),Ux=Symbol.for("react.profiler"),k2=Symbol.for("react.provider"),O2=Symbol.for("react.context"),n1=Symbol.for("react.forward_ref"),zx=Symbol.for("react.suspense"),qx=Symbol.for("react.suspense_list"),a1=Symbol.for("react.memo"),_i=Symbol.for("react.lazy"),C2=Symbol.for("react.offscreen"),p_=Symbol.iterator;function nu(e){return e===null||typeof e!="object"?null:(e=p_&&e[p_]||e["@@iterator"],typeof e=="function"?e:null)}var bt=Object.assign,dy;function Ou(e){if(dy===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);dy=t&&t[1]||""}return`
34`+dy+e}var fy=!1;function hy(e,t){if(!e||fy)return"";fy=!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(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var a=u.stack.split(`
35`),i=n.stack.split(`
36`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=`
37`+a[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{fy=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ou(e):""}function SF(e){switch(e.tag){case 5:return Ou(e.type);case 16:return Ou("Lazy");case 13:return Ou("Suspense");case 19:return Ou("SuspenseList");case 0:case 2:case 15:return e=hy(e.type,!1),e;case 11:return e=hy(e.type.render,!1),e;case 1:return e=hy(e.type,!0),e;default:return""}}function Wx(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 nl:return"Fragment";case rl:return"Portal";case Ux:return"Profiler";case r1:return"StrictMode";case zx:return"Suspense";case qx:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case O2:return(e.displayName||"Context")+".Consumer";case k2:return(e._context.displayName||"Context")+".Provider";case n1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case a1:return t=e.displayName||null,t!==null?t:Wx(e.type)||"Memo";case _i:t=e._payload,e=e._init;try{return Wx(e(t))}catch{}}return null}function _F(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 Wx(t);case 8:return t===r1?"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 rs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function E2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function NF(e){var t=E2(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 a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.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 ah(e){e._valueTracker||(e._valueTracker=NF(e))}function P2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=E2(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function bp(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 Hx(e,t){var r=t.checked;return bt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function m_(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=rs(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 A2(e,t){t=t.checked,t!=null&&t1(e,"checked",t,!1)}function Vx(e,t){A2(e,t);var r=rs(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")?Kx(e,t.type,r):t.hasOwnProperty("defaultValue")&&Kx(e,t.type,rs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function g_(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 Kx(e,t,r){(t!=="number"||bp(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Cu=Array.isArray;function xl(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&n&&(e[r].defaultSelected=!0)}else{for(r=""+rs(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Gx(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(re(91)
vendor: 8,817 bytes, line 37
37);return bt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function v_(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(re(92));if(Cu(r)){if(1<r.length)throw Error(re(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:rs(r)}}function T2(e,t){var r=rs(t.value),n=rs(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 y_(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $2(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 Yx(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$2(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ih,R2=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ih=ih||document.createElement("div"),ih.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ih.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function id(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Iu={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},kF=["Webkit","ms","Moz","O"];Object.keys(Iu).forEach(function(e){kF.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Iu[t]=Iu[e]})});function M2(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Iu.hasOwnProperty(e)&&Iu[e]?(""+t).trim():t+"px"}function I2(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=M2(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var OF=bt({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 Xx(e,t){if(t){if(OF[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(re(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(re(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(re(61))}if(t.style!=null&&typeof t.style!="object")throw Error(re(62))}}function Qx(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 Jx=null;function i1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zx=null,bl=null,wl=null;function x_(e){if(e=Pf(e)){if(typeof Zx!="function")throw Error(re(280));var t=e.stateNode;t&&(t=gg(t),Zx(e.stateNode,e.type,t))}}function D2(e){bl?wl?wl.push(e):wl=[e]:bl=e}function L2(){if(bl){var e=bl,t=wl;if(wl=bl=null,x_(e),t)for(e=0;e<t.length;e++)x_(t[e])}}function F2(e,t){return e(t)}function B2(){}var py=!1;function U2(e,t,r){if(py)return e(t,r);py=!0;try{return F2(e,t,r)}finally{py=!1,(bl!==null||wl!==null)&&(B2(),L2())}}function sd(e,t){var r=e.stateNode;if(r===null)return null;var n=gg(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(re(231,t,typeof r));return r}var e0=!1;if(Xa)try{var au={};Object.defineProperty(au,"passive",{get:function(){e0=!0}}),window.addEventListener("test",au,au),window.removeEventListener("test",au,au)}catch{e0=!1}function CF(e,t,r,n,a,i,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var Du=!1,wp=null,jp=!1,t0=null,EF={onError:function(e){Du=!0,wp=e}};function PF(e,t,r,n,a,i,o,l,c){Du=!1,wp=null,CF.apply(EF,arguments)}function AF(e,t,r,n,a,i,o,l,c){if(PF.apply(this,arguments),Du){if(Du){var u=wp;Du=!1,wp=null}else throw Error(re(198));jp||(jp=!0,t0=u)}}function bo(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 z2(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 b_(e){if(bo(e)!==e)throw Error(re(188))}function TF(e){var t=e.alternate;if(!t){if(t=bo(e),t===null)throw Error(re(188));return t!==e?null:e}for(var r=e,n=t;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return b_(a),e;if(i===n)return b_(a),t;i=i.sibling}throw Error(re(188))}if(r.return!==n.return)r=a,n=i;else{for(var o=!1,l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o)throw Error(re(189))}}if(r.alternate!==n)throw Error(re(190))}if(r.tag!==3)throw Error(re(188));return r.stateNode.current===r?e:t}function q2(e){return e=TF(e),e!==null?W2(e):null}function W2(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=W2(e);if(t!==null)return t;e=e.sibling}return null}var H2=rn.unstable_scheduleCallback,w_=rn.unstable_cancelCallback,$F=rn.unstable_shouldYield,RF=rn.unstable_requestPaint,Nt=rn.unstable_now,MF=rn.unstable_getCurrentPriorityLevel,s1=rn.unstable_ImmediatePriority,V2=rn.unstable_UserBlockingPriority,Sp=rn.unstable_NormalPriority,IF=rn.unstable_LowPriority,K2=rn.unstable_IdlePriority,fg=null,va=null;function DF(e){if(va&&typeof va.onCommitFiberRoot=="function")try{va.onCommitFiberRoot(fg,e,void 0,(e.current.flags&128)===128)}catch{}}var Vn=Math.clz32?Math.clz32:BF,LF=Math.log,FF=Math.LN2;function BF(e){return e>>>=0,e===0?32:31-(LF(e)/FF|0)|0}var sh=64,oh=4194304;function Eu(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 _p(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~a;l!==0?n=Eu(l):(i&=o,i!==0&&(n=Eu(i)))}else o=r&~a,o!==0?n=Eu(o):i!==0&&(n=Eu(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&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-Vn(t),a=1<<r,n|=e[r],t&=~a;return n}function UF(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 zF(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Vn(i),l=1<<o,c=a[o];c===-1?(!(l&r)||l&n)&&(a[o]=UF(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function r0(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function G2(){var e=sh;return sh<<=1,!(sh&4194240)&&(sh=64),e}function my(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 4,087 bytes, line 37
37function Cf(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Vn(t),e[t]=r}function qF(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 a=31-Vn(r),i=1<<a;t[a]=0,n[a]=-1,e[a]=-1,r&=~i}}function o1(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Vn(r),a=1<<n;a&t|e[n]&t&&(e[n]|=t),r&=~a}}var Ve=0;function Y2(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var X2,l1,Q2,J2,Z2,n0=!1,lh=[],zi=null,qi=null,Wi=null,od=new Map,ld=new Map,Ci=[],WF="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 j_(e,t){switch(e){case"focusin":case"focusout":zi=null;break;case"dragenter":case"dragleave":qi=null;break;case"mouseover":case"mouseout":Wi=null;break;case"pointerover":case"pointerout":od.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ld.delete(t.pointerId)}}function iu(e,t,r,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Pf(t),t!==null&&l1(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function HF(e,t,r,n,a){switch(t){case"focusin":return zi=iu(zi,e,t,r,n,a),!0;case"dragenter":return qi=iu(qi,e,t,r,n,a),!0;case"mouseover":return Wi=iu(Wi,e,t,r,n,a),!0;case"pointerover":var i=a.pointerId;return od.set(i,iu(od.get(i)||null,e,t,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,ld.set(i,iu(ld.get(i)||null,e,t,r,n,a)),!0}return!1}function eA(e){var t=$s(e.target);if(t!==null){var r=bo(t);if(r!==null){if(t=r.tag,t===13){if(t=z2(r),t!==null){e.blockedOn=t,Z2(e.priority,function(){Q2(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 Zh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=a0(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Jx=n,r.target.dispatchEvent(n),Jx=null}else return t=Pf(r),t!==null&&l1(t),e.blockedOn=r,!1;t.shift()}return!0}function S_(e,t,r){Zh(e)&&r.delete(t)}function VF(){n0=!1,zi!==null&&Zh(zi)&&(zi=null),qi!==null&&Zh(qi)&&(qi=null),Wi!==null&&Zh(Wi)&&(Wi=null),od.forEach(S_),ld.forEach(S_)}function su(e,t){e.blockedOn===t&&(e.blockedOn=null,n0||(n0=!0,rn.unstable_scheduleCallback(rn.unstable_NormalPriority,VF)))}function cd(e){function t(a){return su(a,e)}if(0<lh.length){su(lh[0],e);for(var r=1;r<lh.length;r++){var n=lh[r];n.blockedOn===e&&(n.blockedOn=null)}}for(zi!==null&&su(zi,e),qi!==null&&su(qi,e),Wi!==null&&su(Wi,e),od.forEach(t),ld.forEach(t),r=0;r<Ci.length;r++)n=Ci[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Ci.length&&(r=Ci[0],r.blockedOn===null);)eA(r),r.blockedOn===null&&Ci.shift()}var jl=li.ReactCurrentBatchConfig,Np=!0;function KF(e,t,r,n){var a=Ve,i=jl.transition;jl.transition=null;try{Ve=1,c1(e,t,r,n)}finally{Ve=a,jl.transition=i}}function GF(e,t,r,n){var a=Ve,i=jl.transition;jl.transition=null;try{Ve=4,c1(e,t,r,n)}finally{Ve=a,jl.transition=i}}function c1(e,t,r,n){if(Np){var a=a0(e,t,r,n);if(a===null)Ny(e,t,n,kp,r),j_(e,n);else if(HF(a,e,t,r,n))n.stopPropagation();else if(j_(e,n),t&4&&-1<WF.indexOf(e)){for(;a!==null;){var i=Pf(a);if(i!==null&&X2(i),i=a0(e,t,r,n),i===null&&Ny(e,t,n,kp,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else Ny(e,t,n,null,r)}}var kp=null;function a0(e,t,r,n){if(kp=null,e=i1(n),e=$s(e),e!==null)if(t=bo(e),t===null)e=null;else if(r=t.tag,r===13){if(e=z2(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 kp=e,null}
vendor: 10,401 bytes, line 37
37function tA(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(MF()){case s1:return 1;case V2:return 4;case Sp:case IF:return 16;case K2:return 536870912;default:return 16}default:return 16}}var Li=null,u1=null,ep=null;function rA(){if(ep)return ep;var e,t=u1,r=t.length,n,a="value"in Li?Li.value:Li.textContent,i=a.length;for(e=0;e<r&&t[e]===a[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===a[i-n];n++);return ep=a.slice(e,1<n?1-n:void 0)}function tp(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 ch(){return!0}function __(){return!1}function on(e){function t(r,n,a,i,o){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ch:__,this.isPropagationStopped=__,this}return bt(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=ch)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ch)},persist:function(){},isPersistent:ch}),t}var Cc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},d1=on(Cc),Ef=bt({},Cc,{view:0,detail:0}),YF=on(Ef),gy,vy,ou,hg=bt({},Ef,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:f1,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!==ou&&(ou&&e.type==="mousemove"?(gy=e.screenX-ou.screenX,vy=e.screenY-ou.screenY):vy=gy=0,ou=e),gy)},movementY:function(e){return"movementY"in e?e.movementY:vy}}),N_=on(hg),XF=bt({},hg,{dataTransfer:0}),QF=on(XF),JF=bt({},Ef,{relatedTarget:0}),yy=on(JF),ZF=bt({},Cc,{animationName:0,elapsedTime:0,pseudoElement:0}),eB=on(ZF),tB=bt({},Cc,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rB=on(tB),nB=bt({},Cc,{data:0}),k_=on(nB),aB={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iB={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"},sB={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oB(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sB[e])?!!t[e]:!1}function f1(){return oB}var lB=bt({},Ef,{key:function(e){if(e.key){var t=aB[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=tp(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?iB[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:f1,charCode:function(e){return e.type==="keypress"?tp(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?tp(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),cB=on(lB),uB=bt({},hg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),O_=on(uB),dB=bt({},Ef,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:f1}),fB=on(dB),hB=bt({},Cc,{propertyName:0,elapsedTime:0,pseudoElement:0}),pB=on(hB),mB=bt({},hg,{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}),gB=on(mB),vB=[9,13,27,32],h1=Xa&&"CompositionEvent"in window,Lu=null;Xa&&"documentMode"in document&&(Lu=document.documentMode);var yB=Xa&&"TextEvent"in window&&!Lu,nA=Xa&&(!h1||Lu&&8<Lu&&11>=Lu),C_=" ",E_=!1;function aA(e,t){switch(e){case"keyup":return vB.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iA(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var al=!1;function xB(e,t){switch(e){case"compositionend":return iA(t);case"keypress":return t.which!==32?null:(E_=!0,C_);case"textInput":return e=t.data,e===C_&&E_?null:e;default:return null}}function bB(e,t){if(al)return e==="compositionend"||!h1&&aA(e,t)?(e=rA(),ep=u1=Li=null,al=!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 nA&&t.locale!=="ko"?null:t.data;default:return null}}var wB={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 P_(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!wB[e.type]:t==="textarea"}function sA(e,t,r,n){D2(n),t=Op(t,"onChange"),0<t.length&&(r=new d1("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Fu=null,ud=null;function jB(e){vA(e,0)}function pg(e){var t=ol(e);if(P2(t))return e}function SB(e,t){if(e==="change")return t}var oA=!1;if(Xa){var xy;if(Xa){var by="oninput"in document;if(!by){var A_=document.createElement("div");A_.setAttribute("oninput","return;"),by=typeof A_.oninput=="function"}xy=by}else xy=!1;oA=xy&&(!document.documentMode||9<document.documentMode)}function T_(){Fu&&(Fu.detachEvent("onpropertychange",lA),ud=Fu=null)}function lA(e){if(e.propertyName==="value"&&pg(ud)){var t=[];sA(t,ud,e,i1(e)),U2(jB,t)}}function _B(e,t,r){e==="focusin"?(T_(),Fu=t,ud=r,Fu.attachEvent("onpropertychange",lA)):e==="focusout"&&T_()}function NB(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return pg(ud)}function kB(e,t){if(e==="click")return pg(t)}function OB(e,t){if(e==="input"||e==="change")return pg(t)}function CB(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jn=typeof Object.is=="function"?Object.is:CB;function dd(e,t){if(Jn(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 a=r[n];if(!Bx.call(t,a)||!Jn(e[a],t[a]))return!1}return!0}function $_(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function R_(e,t){var r=$_(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=$_(r)}}function cA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function uA(){for(var e=window,t=bp();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=bp(e.document)}return t}function p1(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 EB(e){var t=uA(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&cA(r.ownerDocument.documentElement,r)){if(n!==null&&p1(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 a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=R_(r,i);var o=R_(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>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 PB=Xa&&"documentMode"in document&&11>=document.documentMode,il=null,i0=null,Bu=null,s0=!1;function M_(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;s0||il==null||il!==bp(n)||(n=il,"selectionStart"in n&&p1(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,383 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),Bu&&dd(Bu,n)||(Bu=n,n=Op(i0,"onSelect"),0<n.length&&(t=new d1("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=il)))}function uh(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var sl={animationend:uh("Animation","AnimationEnd"),animationiteration:uh("Animation","AnimationIteration"),animationstart:uh("Animation","AnimationStart"),transitionend:uh("Transition","TransitionEnd")},wy={},dA={};Xa&&(dA=document.createElement("div").style,"AnimationEvent"in window||(delete sl.animationend.animation,delete sl.animationiteration.animation,delete sl.animationstart.animation),"TransitionEvent"in window||delete sl.transitionend.transition);function mg(e){if(wy[e])return wy[e];if(!sl[e])return e;var t=sl[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in dA)return wy[e]=t[r];return e}var fA=mg("animationend"),hA=mg("animationiteration"),pA=mg("animationstart"),mA=mg("transitionend"),gA=new Map,I_="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 ls(e,t){gA.set(e,t),xo(t,[e])}for(var jy=0;jy<I_.length;jy++){var Sy=I_[jy],AB=Sy.toLowerCase(),TB=Sy[0].toUpperCase()+Sy.slice(1);ls(AB,"on"+TB)}ls(fA,"onAnimationEnd");ls(hA,"onAnimationIteration");ls(pA,"onAnimationStart");ls("dblclick","onDoubleClick");ls("focusin","onFocus");ls("focusout","onBlur");ls(mA,"onTransitionEnd");ql("onMouseEnter",["mouseout","mouseover"]);ql("onMouseLeave",["mouseout","mouseover"]);ql("onPointerEnter",["pointerout","pointerover"]);ql("onPointerLeave",["pointerout","pointerover"]);xo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));xo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));xo("onBeforeInput",["compositionend","keypress","textInput","paste"]);xo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));xo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));xo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pu="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(" "),$B=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pu));function D_(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,AF(n,t,void 0,e),e.currentTarget=null}function vA(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],a=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;D_(a,l,u),i=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;D_(a,l,u),i=c}}}if(jp)throw e=t0,jp=!1,t0=null,e}function lt(e,t){var r=t[d0];r===void 0&&(r=t[d0]=new Set);var n=e+"__bubble";r.has(n)||(yA(t,e,2,!1),r.add(n))}function _y(e,t,r){var n=0;t&&(n|=4),yA(r,e,n,t)}var dh="_reactListening"+Math.random().toString(36).slice(2);function fd(e){if(!e[dh]){e[dh]=!0,N2.forEach(function(r){r!=="selectionchange"&&($B.has(r)||_y(r,!1,e),_y(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[dh]||(t[dh]=!0,_y("selectionchange",!1,t))}}function yA(e,t,r,n){switch(tA(t)){case 1:var a=KF;break;case 4:a=GF;break;default:a=c1}r=a.bind(null,t,r,e),a=void 0,!e0||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function Ny(e,t,r,n,a){var i=n;
vendor: 4,304 bytes, line 37
37if(!(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===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=$s(l),o===null)return;if(c=o.tag,c===5||c===6){n=i=o;continue e}l=l.parentNode}}n=n.return}U2(function(){var u=i,d=i1(r),f=[];e:{var h=gA.get(e);if(h!==void 0){var p=d1,v=e;switch(e){case"keypress":if(tp(r)===0)break e;case"keydown":case"keyup":p=cB;break;case"focusin":v="focus",p=yy;break;case"focusout":v="blur",p=yy;break;case"beforeblur":case"afterblur":p=yy;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":p=N_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=QF;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=fB;break;case fA:case hA:case pA:p=eB;break;case mA:p=pB;break;case"scroll":p=YF;break;case"wheel":p=gB;break;case"copy":case"cut":case"paste":p=rB;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=O_}var m=(t&4)!==0,g=!m&&e==="scroll",y=m?h!==null?h+"Capture":null:h;m=[];for(var x=u,w;x!==null;){w=x;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,y!==null&&(S=sd(x,y),S!=null&&m.push(hd(x,S,w)))),g)break;x=x.return}0<m.length&&(h=new p(h,v,null,r,d),f.push({event:h,listeners:m}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&r!==Jx&&(v=r.relatedTarget||r.fromElement)&&($s(v)||v[Qa]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(v=r.relatedTarget||r.toElement,p=u,v=v?$s(v):null,v!==null&&(g=bo(v),v!==g||v.tag!==5&&v.tag!==6)&&(v=null)):(p=null,v=u),p!==v)){if(m=N_,S="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(m=O_,S="onPointerLeave",y="onPointerEnter",x="pointer"),g=p==null?h:ol(p),w=v==null?h:ol(v),h=new m(S,x+"leave",p,r,d),h.target=g,h.relatedTarget=w,S=null,$s(d)===u&&(m=new m(y,x+"enter",v,r,d),m.target=w,m.relatedTarget=g,S=m),g=S,p&&v)t:{for(m=p,y=v,x=0,w=m;w;w=To(w))x++;for(w=0,S=y;S;S=To(S))w++;for(;0<x-w;)m=To(m),x--;for(;0<w-x;)y=To(y),w--;for(;x--;){if(m===y||y!==null&&m===y.alternate)break t;m=To(m),y=To(y)}m=null}else m=null;p!==null&&L_(f,h,p,m,!1),v!==null&&g!==null&&L_(f,g,v,m,!0)}}e:{if(h=u?ol(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var j=SB;else if(P_(h))if(oA)j=OB;else{j=NB;var _=_B}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=kB);if(j&&(j=j(e,u))){sA(f,j,r,d);break e}_&&_(e,h,u),e==="focusout"&&(_=h._wrapperState)&&_.controlled&&h.type==="number"&&Kx(h,"number",h.value)}switch(_=u?ol(u):window,e){case"focusin":(P_(_)||_.contentEditable==="true")&&(il=_,i0=u,Bu=null);break;case"focusout":Bu=i0=il=null;break;case"mousedown":s0=!0;break;case"contextmenu":case"mouseup":case"dragend":s0=!1,M_(f,r,d);break;case"selectionchange":if(PB)break;case"keydown":case"keyup":M_(f,r,d)}var N;if(h1)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else al?aA(e,r)&&(k="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(k="onCompositionStart");k&&(nA&&r.locale!=="ko"&&(al||k!=="onCompositionStart"?k==="onCompositionEnd"&&al&&(N=rA()):(Li=d,u1="value"in Li?Li.value:Li.textContent,al=!0)),_=Op(u,k),0<_.length&&(k=new k_(k,e,null,r,d),f.push({event:k,listeners:_}),N?k.data=N:(N=iA(r),N!==null&&(k.data=N)))),(N=yB?xB(e,r):bB(e,r))&&(u=Op(u,"onBeforeInput"),0<u.length&&(d=new k_("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:u}),d.data=N))}vA(f,t)})}function hd(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Op(e,t){for(var r=t+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=sd(e,r),i!=null&&n.unshift(hd(e,i,a)),i=sd(e,t),i!=null&&n.push(h
vendor: 4,718 bytes, lines 37-38
37d(e,i,a))),e=e.return}return n}function To(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function L_(e,t,r,n,a){for(var i=t._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,a?(c=sd(r,i),c!=null&&o.unshift(hd(r,c,l))):a||(c=sd(r,i),c!=null&&o.push(hd(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var RB=/\r\n?/g,MB=/\u0000|\uFFFD/g;function F_(e){return(typeof e=="string"?e:""+e).replace(RB,`
38`).replace(MB,"")}function fh(e,t,r){if(t=F_(t),F_(e)!==t&&r)throw Error(re(425))}function Cp(){}var o0=null,l0=null;function c0(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 u0=typeof setTimeout=="function"?setTimeout:void 0,IB=typeof clearTimeout=="function"?clearTimeout:void 0,B_=typeof Promise=="function"?Promise:void 0,DB=typeof queueMicrotask=="function"?queueMicrotask:typeof B_<"u"?function(e){return B_.resolve(null).then(e).catch(LB)}:u0;function LB(e){setTimeout(function(){throw e})}function ky(e,t){var r=t,n=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){e.removeChild(a),cd(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);cd(t)}function Hi(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 U_(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 Ec=Math.random().toString(36).slice(2),fa="__reactFiber$"+Ec,pd="__reactProps$"+Ec,Qa="__reactContainer$"+Ec,d0="__reactEvents$"+Ec,FB="__reactListeners$"+Ec,BB="__reactHandles$"+Ec;function $s(e){var t=e[fa];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Qa]||r[fa]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=U_(e);e!==null;){if(r=e[fa])return r;e=U_(e)}return t}e=r,r=e.parentNode}return null}function Pf(e){return e=e[fa]||e[Qa],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ol(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(re(33))}function gg(e){return e[pd]||null}var f0=[],ll=-1;function cs(e){return{current:e}}function ft(e){0>ll||(e.current=f0[ll],f0[ll]=null,ll--)}function nt(e,t){ll++,f0[ll]=e.current,e.current=t}var ns={},mr=cs(ns),Ir=cs(!1),eo=ns;function Wl(e,t){var r=e.type.contextTypes;if(!r)return ns;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Dr(e){return e=e.childContextTypes,e!=null}function Ep(){ft(Ir),ft(mr)}function z_(e,t,r){if(mr.current!==ns)throw Error(re(168));nt(mr,t),nt(Ir,r)}function xA(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(re(108,_F(e)||"Unknown",a));return bt({},r,n)}function Pp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ns,eo=mr.current,nt(mr,e),nt(Ir,Ir.current),!0}function q_(e,t,r){var n=e.stateNode;if(!n)throw Error(re(169));r?(e=xA(e,t,eo),n.__reactInternalMemoizedMergedChildContext=e,ft(Ir),ft(mr),nt(mr,e)):ft(Ir),nt(Ir,r)}var La=null,vg=!1,Oy=!1;function bA(e){La===null?La=[e]:La.push(e)}function UB(e){vg=!0,bA(e)}function us(){if(!Oy&&La!==null){Oy=!0;var e=0,t=Ve;try{var r=La;for(Ve=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}La=null,vg=!1}catch(a){throw La!==null&&(La=La.slice(e+1)),H2(s1,us),a}finally{Ve=t,Oy=!1}}return null}var cl=[],ul=0,Ap=null,Tp=0,mn=[],gn=0,to=null,Ua=1,za="";function _s(e,t){cl[ul++]=Tp,cl[ul++]=Ap,Ap=e,Tp=t}function wA(e,t,r){mn[gn++]=Ua,mn[gn++]=za,mn[gn++]=to,to=e;var n=Ua;e=za;var a=32-Vn(n)-1;n&=~(1<<a),r+=1;var i=32-Vn(t)+a;if(30<i){var o=a-a%5;i=(n&(1<<o)-1).toString(32),n>>=o,a-=o,Ua=1<<32-Vn(t)+a|r<<a|n,za=i+e}else Ua=1<<i|r<<a|n,za=e}function m1(e){e.return!==null&&(_s(e,1),wA(e,1,0))}function g1(e){for(;e===Ap;)Ap=cl[--ul],cl[ul]=null,Tp=cl[--ul],cl[ul]=null;for(;e===to;)to=mn[--gn],mn[gn]=null,za=mn[--gn],mn[gn]=null,Ua=mn[--gn],mn[gn]=null}var Jr=null,Xr=null,pt=!1,Wn=null;function jA(e,t){var r=yn(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 W_(e,t){switch(e.tag){case 5:var r=e.type;
vendor: 13,737 bytes, line 38
38return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Jr=e,Xr=Hi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Jr=e,Xr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=to!==null?{id:Ua,overflow:za}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=yn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Jr=e,Xr=null,!0):!1;default:return!1}}function h0(e){return(e.mode&1)!==0&&(e.flags&128)===0}function p0(e){if(pt){var t=Xr;if(t){var r=t;if(!W_(e,t)){if(h0(e))throw Error(re(418));t=Hi(r.nextSibling);var n=Jr;t&&W_(e,t)?jA(n,r):(e.flags=e.flags&-4097|2,pt=!1,Jr=e)}}else{if(h0(e))throw Error(re(418));e.flags=e.flags&-4097|2,pt=!1,Jr=e}}}function H_(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Jr=e}function hh(e){if(e!==Jr)return!1;if(!pt)return H_(e),pt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!c0(e.type,e.memoizedProps)),t&&(t=Xr)){if(h0(e))throw SA(),Error(re(418));for(;t;)jA(e,t),t=Hi(t.nextSibling)}if(H_(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(re(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Xr=Hi(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Xr=null}}else Xr=Jr?Hi(e.stateNode.nextSibling):null;return!0}function SA(){for(var e=Xr;e;)e=Hi(e.nextSibling)}function Hl(){Xr=Jr=null,pt=!1}function v1(e){Wn===null?Wn=[e]:Wn.push(e)}var zB=li.ReactCurrentBatchConfig;function lu(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(re(309));var n=r.stateNode}if(!n)throw Error(re(147,e));var a=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(re(284));if(!r._owner)throw Error(re(290,e))}return e}function ph(e,t){throw e=Object.prototype.toString.call(t),Error(re(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function V_(e){var t=e._init;return t(e._payload)}function _A(e){function t(y,x){if(e){var w=y.deletions;w===null?(y.deletions=[x],y.flags|=16):w.push(x)}}function r(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function n(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function a(y,x){return y=Yi(y,x),y.index=0,y.sibling=null,y}function i(y,x,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<x?(y.flags|=2,x):w):(y.flags|=2,x)):(y.flags|=1048576,x)}function o(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,x,w,S){return x===null||x.tag!==6?(x=Ry(w,y.mode,S),x.return=y,x):(x=a(x,w),x.return=y,x)}function c(y,x,w,S){var j=w.type;return j===nl?d(y,x,w.props.children,S,w.key):x!==null&&(x.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===_i&&V_(j)===x.type)?(S=a(x,w.props),S.ref=lu(y,x,w),S.return=y,S):(S=lp(w.type,w.key,w.props,null,y.mode,S),S.ref=lu(y,x,w),S.return=y,S)}function u(y,x,w,S){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=My(w,y.mode,S),x.return=y,x):(x=a(x,w.children||[]),x.return=y,x)}function d(y,x,w,S,j){return x===null||x.tag!==7?(x=Xs(w,y.mode,S,j),x.return=y,x):(x=a(x,w),x.return=y,x)}function f(y,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Ry(""+x,y.mode,w),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case nh:return w=lp(x.type,x.key,x.props,null,y.mode,w),w.ref=lu(y,null,x),w.return=y,w;case rl:return x=My(x,y.mode,w),x.return=y,x;case _i:var S=x._init;return f(y,S(x._payload),w)}if(Cu(x)||nu(x))return x=Xs(x,y.mode,w,null),x.return=y,x;ph(y,x)}return null}function h(y,x,w,S){var j=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:l(y,x,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case nh:return w.key===j?c(y,x,w,S):null;case rl:return w.key===j?u(y,x,w,S):null;case _i:return j=w._init,h(y,x,j(w._payload),S)}if(Cu(w)||nu(w))return j!==null?null:d(y,x,w,S,null);ph(y,w)}return null}function p(y,x,w,S,j){if(typeof S=="string"&&S!==""||typeof S=="number")return y=y.get(w)||null,l(x,y,""+S,j);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case nh:return y=y.get(S.key===null?w:S.key)||null,c(x,y,S,j);case rl:return y=y.get(S.key===null?w:S.key)||null,u(x,y,S,j);case _i:var _=S._init;return p(y,x,w,_(S._payload),j)}if(Cu(S)||nu(S))return y=y.get(w)||null,d(x,y,S,j,null);ph(x,S)}return null}function v(y,x,w,S){for(var j=null,_=null,N=x,k=x=0,O=null;N!==null&&k<w.length;k++){N.index>k?(O=N,N=null):O=N.sibling;var E=h(y,N,w[k],S);if(E===null){N===null&&(N=O);break}e&&N&&E.alternate===null&&t(y,N),x=i(E,x,k),_===null?j=E:_.sibling=E,_=E,N=O}if(k===w.length)return r(y,N),pt&&_s(y,k),j;if(N===null){for(;k<w.length;k++)N=f(y,w[k],S),N!==null&&(x=i(N,x,k),_===null?j=N:_.sibling=N,_=N);return pt&&_s(y,k),j}for(N=n(y,N);k<w.length;k++)O=p(N,y,k,w[k],S),O!==null&&(e&&O.alternate!==null&&N.delete(O.key===null?k:O.key),x=i(O,x,k),_===null?j=O:_.sibling=O,_=O);return e&&N.forEach(function(A){return t(y,A)}),pt&&_s(y,k),j}function m(y,x,w,S){var j=nu(w);if(typeof j!="function")throw Error(re(150));if(w=j.call(w),w==null)throw Error(re(151));for(var _=j=null,N=x,k=x=0,O=null,E=w.next();N!==null&&!E.done;k++,E=w.next()){N.index>k?(O=N,N=null):O=N.sibling;var A=h(y,N,E.value,S);if(A===null){N===null&&(N=O);break}e&&N&&A.alternate===null&&t(y,N),x=i(A,x,k),_===null?j=A:_.sibling=A,_=A,N=O}if(E.done)return r(y,N),pt&&_s(y,k),j;if(N===null){for(;!E.done;k++,E=w.next())E=f(y,E.value,S),E!==null&&(x=i(E,x,k),_===null?j=E:_.sibling=E,_=E);return pt&&_s(y,k),j}for(N=n(y,N);!E.done;k++,E=w.next())E=p(N,y,k,E.value,S),E!==null&&(e&&E.alternate!==null&&N.delete(E.key===null?k:E.key),x=i(E,x,k),_===null?j=E:_.sibling=E,_=E);return e&&N.forEach(function(R){return t(y,R)}),pt&&_s(y,k),j}function g(y,x,w,S){if(typeof w=="object"&&w!==null&&w.type===nl&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case nh:e:{for(var j=w.key,_=x;_!==null;){if(_.key===j){if(j=w.type,j===nl){if(_.tag===7){r(y,_.sibling),x=a(_,w.props.children),x.return=y,y=x;break e}}else if(_.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===_i&&V_(j)===_.type){r(y,_.sibling),x=a(_,w.props),x.ref=lu(y,_,w),x.return=y,y=x;break e}r(y,_);break}else t(y,_);_=_.sibling}w.type===nl?(x=Xs(w.props.children,y.mode,S,w.key),x.return=y,y=x):(S=lp(w.type,w.key,w.props,null,y.mode,S),S.ref=lu(y,x,w),S.return=y,y=S)}return o(y);case rl:e:{for(_=w.key;x!==null;){if(x.key===_)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){r(y,x.sibling),x=a(x,w.children||[]),x.return=y,y=x;break e}else{r(y,x);break}else t(y,x);x=x.sibling}x=My(w,y.mode,S),x.return=y,y=x}return o(y);case _i:return _=w._init,g(y,x,_(w._payload),S)}if(Cu(w))return v(y,x,w,S);if(nu(w))return m(y,x,w,S);ph(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(r(y,x.sibling),x=a(x,w),x.return=y,y=x):(r(y,x),x=Ry(w,y.mode,S),x.return=y,y=x),o(y)):r(y,x)}return g}var Vl=_A(!0),NA=_A(!1),$p=cs(null),Rp=null,dl=null,y1=null;function x1(){y1=dl=Rp=null}function b1(e){var t=$p.current;ft($p),e._currentValue=t}function m0(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 Sl(e,t){Rp=e,y1=dl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Rr=!0),e.firstContext=null)}function _n(e){var t=e._currentValue;if(y1!==e)if(e={context:e,memoizedValue:t,next:null},dl===null){if(Rp===null)throw Error(re(308));dl=e,Rp.dependencies={lanes:0,firstContext:e}}else dl=dl.next=e;return t}var Rs=null;function w1(e){Rs===null?Rs=[e]:Rs.push(e)}function kA(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,w1(t)):(r.next=a.next,a.next=r),t.interleaved=r,Ja(e,n)}function Ja(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 Ni=!1;function j1(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function OA(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 Va(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vi(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Le&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Ja(e,r)}return a=n.interleaved,a===null?(t.next=t,w1(n)):(t.next=a.next,a.next=t),n.interleaved=t,Ja(e,r)}function rp(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,o1(e,r)}}function K_(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=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};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,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 Mp(e,t,r,n){var a=e.updateQueue;Ni=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=a.baseState;o=0,d=u=c=null,l=i;do{var h=l.lane,p=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,m=l;switch(h=t,p=r,m.tag){case 1:if(v=m.payload,typeof v=="function"){f=v.call(p,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,h=typeof v=="function"?v.call(p,f,h):v,h==null)break e;f=bt({},f,h);break e;case 2:Ni=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,o|=h;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;h=l,l=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(d===null&&(c=f),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);no|=o,e.lanes=o,e.memoizedState=f}}function G_(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(re(191,a));a.call(n)}}}var Af={},ya=cs(Af),md=cs(Af),gd=cs(Af);function Ms(e){if(e===Af)throw Error(re(174));return e}function S1(e,t){switch(nt(gd,t),nt(md,e),nt(ya,Af),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Yx(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Yx(t,e)}ft(ya),nt(ya,t)}function Kl(){ft(ya),ft(md),ft(gd)}function CA(e){Ms(gd.current);var t=Ms(ya.current),r=Yx(t,e.type);t!==r&&(nt(md,e),nt(ya,r))}function _1(e){md.current===e&&(ft(ya),ft(md))}var vt=cs(0);function Ip(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 Cy=[];function N1(){for(var e=0;e<Cy.length;e++)Cy[e]._workInProgressVersionPrimary=null;Cy.length=0}var np=li.ReactCurrentDispatcher,Ey=li.ReactCurrentBatchConfig,ro=0,yt=null,It=null,Ut=null,Dp=!1,Uu=!1,vd=0,qB=0;function or(){throw Error(re(321))}function k1(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Jn(e[r],t[r]))return!1;return!0}function O1(e,t,r,n,a,i){if(ro=i,yt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,np.current=e===null||e.memoizedState===null?KB:GB,e=r(n,a),Uu){i=0;do{if(Uu=!1,vd=0,25<=i)throw Error(re(301));i+=1,Ut=It=null,t.updateQueue=null,np.current=YB,e=r(n,a)}while(Uu)}if(np.current=Lp,t=It!==null&&It.next!==null,ro=0,Ut=It=yt=null,Dp=!1,t)throw Error(re(300));return e}function C1(){var e=vd!==0;return vd=0,e}function sa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?yt.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function Nn(){if(It===null){var e=yt.alternate;e=e!==null?e.memoizedState:null}else e=It.next;var t=Ut===null?yt.memoizedState:Ut.next;if(t!==null)Ut=t,It=e;else{if(e===null)throw Error(re(310));It=e,e={memoizedState:It.memoizedState,baseState:It.baseState,baseQueue:It.baseQueue,queue:It.queue,next:null},Ut===null?yt.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function yd(e,t){return typeof t=="function"?t(e):t}function Py(e){var t=Nn(),r=t.queue;if(r===null)throw Error(re(311));r.lastRenderedReducer=e;
vendor: 5,690 bytes, line 38
38var n=It,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var l=o=null,c=null,u=i;do{var d=u.lane;if((ro&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,o=n):c=c.next=f,yt.lanes|=d,no|=d}u=u.next}while(u!==null&&u!==i);c===null?o=n:c.next=l,Jn(n,t.memoizedState)||(Rr=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){a=e;do i=a.lane,yt.lanes|=i,no|=i,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ay(e){var t=Nn(),r=t.queue;if(r===null)throw Error(re(311));r.lastRenderedReducer=e;var n=r.dispatch,a=r.pending,i=t.memoizedState;if(a!==null){r.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);Jn(i,t.memoizedState)||(Rr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function EA(){}function PA(e,t){var r=yt,n=Nn(),a=t(),i=!Jn(n.memoizedState,a);if(i&&(n.memoizedState=a,Rr=!0),n=n.queue,E1($A.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Ut!==null&&Ut.memoizedState.tag&1){if(r.flags|=2048,xd(9,TA.bind(null,r,n,a,t),void 0,null),Wt===null)throw Error(re(349));ro&30||AA(r,t,a)}return a}function AA(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=yt.updateQueue,t===null?(t={lastEffect:null,stores:null},yt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function TA(e,t,r,n){t.value=r,t.getSnapshot=n,RA(t)&&MA(e)}function $A(e,t,r){return r(function(){RA(t)&&MA(e)})}function RA(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Jn(e,r)}catch{return!0}}function MA(e){var t=Ja(e,1);t!==null&&Kn(t,e,1,-1)}function Y_(e){var t=sa();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yd,lastRenderedState:e},t.queue=e,e=e.dispatch=VB.bind(null,yt,e),[t.memoizedState,e]}function xd(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=yt.updateQueue,t===null?(t={lastEffect:null,stores:null},yt.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 IA(){return Nn().memoizedState}function ap(e,t,r,n){var a=sa();yt.flags|=e,a.memoizedState=xd(1|t,r,void 0,n===void 0?null:n)}function yg(e,t,r,n){var a=Nn();n=n===void 0?null:n;var i=void 0;if(It!==null){var o=It.memoizedState;if(i=o.destroy,n!==null&&k1(n,o.deps)){a.memoizedState=xd(t,r,i,n);return}}yt.flags|=e,a.memoizedState=xd(1|t,r,i,n)}function X_(e,t){return ap(8390656,8,e,t)}function E1(e,t){return yg(2048,8,e,t)}function DA(e,t){return yg(4,2,e,t)}function LA(e,t){return yg(4,4,e,t)}function FA(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 BA(e,t,r){return r=r!=null?r.concat([e]):null,yg(4,4,FA.bind(null,t,e),r)}function P1(){}function UA(e,t){var r=Nn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&k1(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function zA(e,t){var r=Nn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&k1(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function qA(e,t,r){return ro&21?(Jn(r,t)||(r=G2(),yt.lanes|=r,no|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Rr=!0),e.memoizedState=r)}function WB(e,t){var r=Ve;Ve=r!==0&&4>r?r:4,e(!0);var n=Ey.transition;Ey.transition={};try{e(!1),t()}finally{Ve=r,Ey.transition=n}}function WA(){return Nn().memoizedState}function HB(e,t,r){var n=Gi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},HA(e))VA(t,r);else if(r=kA(e,t,r,n),r!==null){var a=kr();Kn(r,e,n,a),KA(r,t,n)}}function VB(e,t,r){var n=Gi(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(HA(e))VA(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,r);if(a.hasEagerState=!0,a.eagerState=l,Jn(l,o)){var c=t.interleaved;c===null?(a.next=a,w1(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=kA(e,t,a,n),r!==null&&(a=kr(),Kn(r,e,n,a),KA(r,t,n))}}function HA(e){var t=e.alternate;return e===yt||t!==null&&t===yt}function VA(e,t){Uu=Dp=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function KA(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,o1(e,r)}}var Lp={readContext:_n,useCallback:or,useContext:or,useEffect:or,useImperativeHandle:or,useInsertionEffect:or,useLayoutEffect:or,useMemo:or,useReducer:or,useRef:or,useState:or,useDebugValue:or,useDeferredValue:or,useTransition:or,useMutableSource:or,useSyncExternalStore:or,useId:or,unstable_isNewReconciler:!1},KB={readContext:_n,useCallback:function(e,t){return sa().memoizedState=[e,t===void 0?null:t],e},useContext:_n,useEffect:X_,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ap(4194308,4,FA.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ap(4194308,4,e,t)},useInsertionEffect:function(e,t){return ap(4,2,e,t)},useMemo:function(e,t){var r=sa();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=sa();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=HB.bind(null,yt,e),[n.memoizedState,e]}
vendor: 7,433 bytes, lines 38-40
38,useRef:function(e){var t=sa();return e={current:e},t.memoizedState=e},useState:Y_,useDebugValue:P1,useDeferredValue:function(e){return sa().memoizedState=e},useTransition:function(){var e=Y_(!1),t=e[0];return e=WB.bind(null,e[1]),sa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=yt,a=sa();if(pt){if(r===void 0)throw Error(re(407));r=r()}else{if(r=t(),Wt===null)throw Error(re(349));ro&30||AA(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,X_($A.bind(null,n,i,e),[e]),n.flags|=2048,xd(9,TA.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=sa(),t=Wt.identifierPrefix;if(pt){var r=za,n=Ua;r=(n&~(1<<32-Vn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=vd++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=qB++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},GB={readContext:_n,useCallback:UA,useContext:_n,useEffect:E1,useImperativeHandle:BA,useInsertionEffect:DA,useLayoutEffect:LA,useMemo:zA,useReducer:Py,useRef:IA,useState:function(){return Py(yd)},useDebugValue:P1,useDeferredValue:function(e){var t=Nn();return qA(t,It.memoizedState,e)},useTransition:function(){var e=Py(yd)[0],t=Nn().memoizedState;return[e,t]},useMutableSource:EA,useSyncExternalStore:PA,useId:WA,unstable_isNewReconciler:!1},YB={readContext:_n,useCallback:UA,useContext:_n,useEffect:E1,useImperativeHandle:BA,useInsertionEffect:DA,useLayoutEffect:LA,useMemo:zA,useReducer:Ay,useRef:IA,useState:function(){return Ay(yd)},useDebugValue:P1,useDeferredValue:function(e){var t=Nn();return It===null?t.memoizedState=e:qA(t,It.memoizedState,e)},useTransition:function(){var e=Ay(yd)[0],t=Nn().memoizedState;return[e,t]},useMutableSource:EA,useSyncExternalStore:PA,useId:WA,unstable_isNewReconciler:!1};function Dn(e,t){if(e&&e.defaultProps){t=bt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function g0(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:bt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var xg={isMounted:function(e){return(e=e._reactInternals)?bo(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=kr(),a=Gi(e),i=Va(n,a);i.payload=t,r!=null&&(i.callback=r),t=Vi(e,i,a),t!==null&&(Kn(t,e,a,n),rp(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=kr(),a=Gi(e),i=Va(n,a);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=Vi(e,i,a),t!==null&&(Kn(t,e,a,n),rp(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=kr(),n=Gi(e),a=Va(r,n);a.tag=2,t!=null&&(a.callback=t),t=Vi(e,a,n),t!==null&&(Kn(t,e,n,r),rp(t,e,n))}};function Q_(e,t,r,n,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,o):t.prototype&&t.prototype.isPureReactComponent?!dd(r,n)||!dd(a,i):!0}function GA(e,t,r){var n=!1,a=ns,i=t.contextType;return typeof i=="object"&&i!==null?i=_n(i):(a=Dr(t)?eo:mr.current,n=t.contextTypes,i=(n=n!=null)?Wl(e,a):ns),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=xg,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function J_(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&&xg.enqueueReplaceState(t,t.state,null)}function v0(e,t,r,n){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},j1(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=_n(i):(i=Dr(t)?eo:mr.current,a.context=Wl(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(g0(e,t,i,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&xg.enqueueReplaceState(a,a.state,null),Mp(e,r,a,n),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Gl(e,t){try{var r="",n=t;do r+=SF(n),n=n.return;while(n);var a=r}catch(i){a=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:e,source:t,stack:a,digest:null}}function Ty(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function y0(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var XB=typeof WeakMap=="function"?WeakMap:Map;function YA(e,t,r){r=Va(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Bp||(Bp=!0,C0=n),y0(e,t)},r}function XA(e,t,r){r=Va(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=t.value;r.payload=function(){return n(a)},r.callback=function(){y0(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){y0(e,t),typeof n!="function"&&(Ki===null?Ki=new Set([this]):Ki.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function Z_(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new XB;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(r)||(a.add(r),e=u6.bind(null,e,t,r),t.then(e,e))}function eN(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 tN(e,t,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,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=Va(-1,1),t.tag=2,Vi(r,t,1))),r.lanes|=1),e)}var QB=li.ReactCurrentOwner,Rr=!1;function wr(e,t,r,n){t.child=e===null?NA(t,null,r,n):Vl(t,e.child,r,n)}function rN(e,t,r,n,a){r=r.render;var i=t.ref;return Sl(t,a),n=O1(e,t,r,n,i,a),r=C1(),e!==null&&!Rr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Za(e,t,a)):(pt&&r&&m1(t),t.flags|=1,wr(e,t,n,a),t.child)}function nN(e,t,r,n,a){if(e===null){var i=r.type;return typeof i=="function"&&!L1(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,QA(e,t,i,n,a)):(e=lp(r.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:dd,r(o,n)&&e.ref===t.ref)return Za(e,t,a)}return t.flags|=1,e=Yi(i,n),e.ref=t.ref,e.return=t,t.child=e}function QA(e,t,r,n,a){if(e!==null){var i=e.memoizedProps;if(dd(i,n)&&e.ref===t.ref)if(Rr=!1,t.pendingProps=n=i,(e.lanes&a)!==0)e.flags&131072&&(Rr=!0);else return t.lanes=e.lanes,Za(e,t,a)}return x0(e,t,r,n,a)}function JA(e,t,r){var n=t.pendingProps,a=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},nt(hl,Hr),Hr|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,nt(hl,Hr),Hr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,nt(hl,Hr),Hr|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,nt(hl,Hr),Hr|=n;return wr(e,t,a,r),t.child}function ZA(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}
vendor: 4,711 bytes, line 40
40function x0(e,t,r,n,a){var i=Dr(r)?eo:mr.current;return i=Wl(t,i),Sl(t,a),r=O1(e,t,r,n,i,a),n=C1(),e!==null&&!Rr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Za(e,t,a)):(pt&&n&&m1(t),t.flags|=1,wr(e,t,r,a),t.child)}function aN(e,t,r,n,a){if(Dr(r)){var i=!0;Pp(t)}else i=!1;if(Sl(t,a),t.stateNode===null)ip(e,t),GA(t,r,n),v0(t,r,n,a),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=_n(u):(u=Dr(r)?eo:mr.current,u=Wl(t,u));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==u)&&J_(t,o,n,u),Ni=!1;var h=t.memoizedState;o.state=h,Mp(t,n,o,a),c=t.memoizedState,l!==n||h!==c||Ir.current||Ni?(typeof d=="function"&&(g0(t,r,d,n),c=t.memoizedState),(l=Ni||Q_(t,r,l,n,h,c,u))?(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=u,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,OA(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Dn(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=_n(c):(c=Dr(r)?eo:mr.current,c=Wl(t,c));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||h!==c)&&J_(t,o,n,c),Ni=!1,h=t.memoizedState,o.state=h,Mp(t,n,o,a);var v=t.memoizedState;l!==f||h!==v||Ir.current||Ni?(typeof p=="function"&&(g0(t,r,p,n),v=t.memoizedState),(u=Ni||Q_(t,r,u,n,h,v,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,v,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,v,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),o.props=n,o.state=v,o.context=c,n=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return b0(e,t,r,n,i,a)}function b0(e,t,r,n,a,i){ZA(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return a&&q_(t,r,!1),Za(e,t,i);n=t.stateNode,QB.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Vl(t,e.child,null,i),t.child=Vl(t,null,l,i)):wr(e,t,l,i),t.memoizedState=n.state,a&&q_(t,r,!0),t.child}function eT(e){var t=e.stateNode;t.pendingContext?z_(e,t.pendingContext,t.pendingContext!==t.context):t.context&&z_(e,t.context,!1),S1(e,t.containerInfo)}function iN(e,t,r,n,a){return Hl(),v1(a),t.flags|=256,wr(e,t,r,n),t.child}var w0={dehydrated:null,treeContext:null,retryLane:0};function j0(e){return{baseLanes:e,cachePool:null,transitions:null}}function tT(e,t,r){var n=t.pendingProps,a=vt.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),nt(vt,a&1),e===null)return p0(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,i?(n=t.mode,i=t.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=jg(o,n,0,null),e=Xs(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=j0(r),t.memoizedState=w0,e):A1(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return JB(e,t,o,n,l,a,r);if(i){i=n.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&t.child!==a?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Yi(a,c),n.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=Yi(l,i):(i=Xs(i,o,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,o=e.child.memoizedState,o=o===null?j0(r):{base
vendor: 8,923 bytes, line 40
40Lanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~r,t.memoizedState=w0,n}return i=e.child,e=i.sibling,n=Yi(i,{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 A1(e,t){return t=jg({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function mh(e,t,r,n){return n!==null&&v1(n),Vl(t,e.child,null,r),e=A1(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function JB(e,t,r,n,a,i,o){if(r)return t.flags&256?(t.flags&=-257,n=Ty(Error(re(422))),mh(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,a=t.mode,n=jg({mode:"visible",children:n.children},a,0,null),i=Xs(i,a,o,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Vl(t,e.child,null,o),t.child.memoizedState=j0(o),t.memoizedState=w0,i);if(!(t.mode&1))return mh(e,t,o,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(re(419)),n=Ty(i,n,void 0),mh(e,t,o,n)}if(l=(o&e.childLanes)!==0,Rr||l){if(n=Wt,n!==null){switch(o&-o){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Ja(e,a),Kn(n,e,a,-1))}return D1(),n=Ty(Error(re(421))),mh(e,t,o,n)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=d6.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Xr=Hi(a.nextSibling),Jr=t,pt=!0,Wn=null,e!==null&&(mn[gn++]=Ua,mn[gn++]=za,mn[gn++]=to,Ua=e.id,za=e.overflow,to=t),t=A1(t,n.children),t.flags|=4096,t)}function sN(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),m0(e.return,t,r)}function $y(e,t,r,n,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function rT(e,t,r){var n=t.pendingProps,a=n.revealOrder,i=n.tail;if(wr(e,t,n.children,r),n=vt.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&&sN(e,r,t);else if(e.tag===19)sN(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(nt(vt,n),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&Ip(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),$y(t,!1,a,r,i);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Ip(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}$y(t,!0,r,null,i);break;case"together":$y(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ip(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Za(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),no|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(re(153));if(t.child!==null){for(e=t.child,r=Yi(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Yi(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function ZB(e,t,r){switch(t.tag){case 3:eT(t),Hl();break;case 5:CA(t);break;case 1:Dr(t.type)&&Pp(t);break;case 4:S1(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,a=t.memoizedProps.value;nt($p,n._currentValue),n._currentValue=a;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(nt(vt,vt.current&1),t.flags|=128,null):r&t.child.childLanes?tT(e,t,r):(nt(vt,vt.current&1),e=Za(e,t,r),e!==null?e.sibling:null);nt(vt,vt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return rT(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),nt(vt,vt.current),n)break;return null;case 22:case 23:return t.lanes=0,JA(e,t,r)}return Za(e,t,r)}var nT,S0,aT,iT;nT=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}};S0=function(){};aT=function(e,t,r,n){var a=e.memoizedProps;if(a!==n){e=t.stateNode,Ms(ya.current);var i=null;switch(r){case"input":a=Hx(e,a),n=Hx(e,n),i=[];break;case"select":a=bt({},a,{value:void 0}),n=bt({},n,{value:void 0}),i=[];break;case"textarea":a=Gx(e,a),n=Gx(e,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Cp)}Xx(r,n);var o;r=null;for(u in a)if(!n.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ad.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=a!=null?a[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="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||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ad.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&lt("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};iT=function(e,t,r,n){r!==n&&(t.flags|=4)};function cu(e,t){if(!pt)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 lr(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function e6(e,t,r){var n=t.pendingProps;switch(g1(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lr(t),null;case 1:return Dr(t.type)&&Ep(),lr(t),null;case 3:return n=t.stateNode,Kl(),ft(Ir),ft(mr),N1(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(hh(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Wn!==null&&(A0(Wn),Wn=null))),S0(e,t),lr(t),null;case 5:_1(t);var a=Ms(gd.current);if(r=t.type,e!==null&&t.stateNode!=null)aT(e,t,r,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(re(166));return lr(t),null}if(e=Ms(ya.current),hh(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[fa]=t,n[pd]=i,e=(t.mode&1)!==0,r){case"dialog":lt("cancel",n),lt("close",n);break;case"iframe":case"object":case"embed":lt("load",n);break;case"video":case"audio":for(a=0;a<Pu.length;a++)lt(Pu[a],n);break;case"source":lt("error",n);break;case"img":case"image":case"link":lt("error",n),lt("load",n);break;case"details":lt("toggle",n);break;case"input":m_(n,i),lt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},lt("invalid",n);break;case"textarea":v_(n,i),lt("invalid",n)}Xx(r,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&fh(n.textContent,l,e),a=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&fh(n.textContent,l,e),a=["children",""+l]):ad.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&lt("scroll",n)}switch(r){case"input":ah(n),g_(n,i,!0);break;case"textarea":ah(n),y_(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Cp)}n=a,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=$2(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>
40",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[fa]=t,e[pd]=n,nT(e,t,!1,!1),t.stateNode=e;e:{switch(o=Qx(r,n),r){case"dialog":lt("cancel",e),lt("close",e),a=n;break;case"iframe":case"object":case"embed":lt("load",e),a=n;break;case"video":case"audio":for(a=0;a<Pu.length;a++)lt(Pu[a],e);a=n;break;case"source":lt("error",e),a=n;break;case"img":case"image":case"link":lt("error",e),lt("load",e),a=n;break;case"details":lt("toggle",e),a=n;break;case"input":m_(e,n),a=Hx(e,n),lt("invalid",e);break;case"option":a=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=bt({},n,{value:void 0}),lt("invalid",e);break;case"textarea":v_(e,n),a=Gx(e,n),lt("invalid",e);break;default:a=n}Xx(r,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?I2(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&R2(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&id(e,c):typeof c=="number"&&id(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ad.hasOwnProperty(i)?c!=null&&i==="onScroll"&&lt("scroll",e):c!=null&&t1(e,i,c,o))}switch(r){case"input":ah(e),g_(e,n,!1);break;case"textarea":ah(e),y_(e);break;case"option":n.value!=null&&e.setAttribute("value",""+rs(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?xl(e,!!n.multiple,i,!1):n.defaultValue!=null&&xl(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Cp)}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 lr(t),null;case 6:if(e&&t.stateNode!=null)iT(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(re(166));if(r=Ms(gd.current),Ms(ya.current),hh(t)){if(n=t.stateNode,r=t.memoizedProps,n[fa]=t,(i=n.nodeValue!==r)&&(e=Jr,e!==null))switch(e.tag){case 3:fh(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&fh(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[fa]=t,t.stateNode=n}return lr(t),null;case 13:if(ft(vt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(pt&&Xr!==null&&t.mode&1&&!(t.flags&128))SA(),Hl(),t.flags|=98560,i=!1;else if(i=hh(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(re(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(re(317));i[fa]=t}else Hl(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lr(t),i=!1}else Wn!==null&&(A0(Wn),Wn=null),i=!0;if(!i)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||vt.current&1?Dt===0&&(Dt=3):D1())),t.updateQueue!==null&&(t.flags|=4),lr(t),null);case 4:return Kl(),S0(e,t),e===null&&fd(t.stateNode.containerInfo),lr(t),null;case 10:return b1(t.type._context),lr(t),null;case 17:return Dr(t.type)&&Ep(),lr(t),null;case 19:if(ft(vt),i=t.memoizedState,i===null)return lr(t),null;if(n=(t.flags&128)!==0,o=i.rendering,o===null)if(n)cu(i,!1);else{if(Dt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ip(e),o!==null){for(t.flags|=128,cu(i,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return nt(vt,vt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Nt()>Yl&&(t.flags|=128,n=!0,cu(i,!1),t.lanes=4194304)}else{if(!n)if(e=Ip(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),cu(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!pt)return lr(t),null}else 2*Nt()-i.renderingStartTime>Yl&&r!==1073741824&&(t.flags|=128,n=!0,cu(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Nt(),t.sibling=null,r=vt.current,nt(vt,n?r&1|2:r&1),t):(lr(t),null);case 22:case 23:return I1(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Hr&1073741824&&(lr(t),t.subtreeFlags&6&&(t.flags|=8192)):lr(t),null;case 24:return null;case 25:return null}throw Error(re(156,t.tag))}function t6(e,t){switch(g1(t),t.tag){case 1:return Dr(t.type)&&Ep(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 26,970 bytes, line 40
40case 3:return Kl(),ft(Ir),ft(mr),N1(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _1(t),null;case 13:if(ft(vt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(re(340));Hl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ft(vt),null;case 4:return Kl(),null;case 10:return b1(t.type._context),null;case 22:case 23:return I1(),null;case 24:return null;default:return null}}var gh=!1,dr=!1,r6=typeof WeakSet=="function"?WeakSet:Set,ue=null;function fl(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){St(e,t,n)}else r.current=null}function _0(e,t,r){try{r()}catch(n){St(e,t,n)}}var oN=!1;function n6(e,t){if(o0=Np,e=uA(),p1(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 a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==r||a!==0&&f.nodeType!==3||(l=o+a),f!==i||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===r&&++u===a&&(l=o),h===i&&++d===n&&(c=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(l0={focusedElem:e,selectionRange:r},Np=!1,ue=t;ue!==null;)if(t=ue,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ue=e;else for(;ue!==null;){t=ue;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,g=v.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:Dn(t.type,m),g);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(re(163))}}catch(S){St(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,ue=e;break}ue=t.return}return v=oN,oN=!1,v}function zu(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&_0(t,r,i)}a=a.next}while(a!==n)}}function bg(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 N0(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 sT(e){var t=e.alternate;t!==null&&(e.alternate=null,sT(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[fa],delete t[pd],delete t[d0],delete t[FB],delete t[BB])),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 oT(e){return e.tag===5||e.tag===3||e.tag===4}function lN(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||oT(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 k0(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=Cp));else if(n!==4&&(e=e.child,e!==null))for(k0(e,t,r),e=e.sibling;e!==null;)k0(e,t,r),e=e.sibling}function O0(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(O0(e,t,r),e=e.sibling;e!==null;)O0(e,t,r),e=e.sibling}var er=null,zn=!1;function yi(e,t,r){for(r=r.child;r!==null;)lT(e,t,r),r=r.sibling}function lT(e,t,r){if(va&&typeof va.onCommitFiberUnmount=="function")try{va.onCommitFiberUnmount(fg,r)}catch{}switch(r.tag){case 5:dr||fl(r,t);case 6:var n=er,a=zn;er=null,yi(e,t,r),er=n,zn=a,er!==null&&(zn?(e=er,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):er.removeChild(r.stateNode));break;case 18:er!==null&&(zn?(e=er,r=r.stateNode,e.nodeType===8?ky(e.parentNode,r):e.nodeType===1&&ky(e,r),cd(e)):ky(er,r.stateNode));break;case 4:n=er,a=zn,er=r.stateNode.containerInfo,zn=!0,yi(e,t,r),er=n,zn=a;break;case 0:case 11:case 14:case 15:if(!dr&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&_0(r,t,o),a=a.next}while(a!==n)}yi(e,t,r);break;case 1:if(!dr&&(fl(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){St(r,t,l)}yi(e,t,r);break;case 21:yi(e,t,r);break;case 22:r.mode&1?(dr=(n=dr)||r.memoizedState!==null,yi(e,t,r),dr=n):yi(e,t,r);break;default:yi(e,t,r)}}function cN(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new r6),t.forEach(function(n){var a=f6.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function Tn(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:er=l.stateNode,zn=!1;break e;case 3:er=l.stateNode.containerInfo,zn=!0;break e;case 4:er=l.stateNode.containerInfo,zn=!0;break e}l=l.return}if(er===null)throw Error(re(160));lT(i,o,a),er=null,zn=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){St(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)cT(t,e),t=t.sibling}function cT(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Tn(t,e),aa(e),n&4){try{zu(3,e,e.return),bg(3,e)}catch(m){St(e,e.return,m)}try{zu(5,e,e.return)}catch(m){St(e,e.return,m)}}break;case 1:Tn(t,e),aa(e),n&512&&r!==null&&fl(r,r.return);break;case 5:if(Tn(t,e),aa(e),n&512&&r!==null&&fl(r,r.return),e.flags&32){var a=e.stateNode;try{id(a,"")}catch(m){St(e,e.return,m)}}if(n&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&A2(a,i),Qx(l,o);var u=Qx(l,i);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?I2(a,f):d==="dangerouslySetInnerHTML"?R2(a,f):d==="children"?id(a,f):t1(a,d,f,u)}switch(l){case"input":Vx(a,i);break;case"textarea":T2(a,i);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?xl(a,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?xl(a,!!i.multiple,i.defaultValue,!0):xl(a,!!i.multiple,i.multiple?[]:"",!1))}a[pd]=i}catch(m){St(e,e.return,m)}}break;case 6:if(Tn(t,e),aa(e),n&4){if(e.stateNode===null)throw Error(re(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(m){St(e,e.return,m)}}break;case 3:if(Tn(t,e),aa(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{cd(t.containerInfo)}catch(m){St(e,e.return,m)}break;case 4:Tn(t,e),aa(e);break;case 13:Tn(t,e),aa(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(R1=Nt())),n&4&&cN(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(dr=(u=dr)||d,Tn(t,e),dr=u):Tn(t,e),aa(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ue=e,d=e.child;d!==null;){for(f=ue=d;ue!==null;){switch(h=ue,p=h.child,h.tag){case 0:case 11:case 14:case 15:zu(4,h,h.return);break;case 1:fl(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(m){St(n,r,m)}}break;case 5:fl(h,h.return);break;case 22:if(h.memoizedState!==null){dN(f);continue}}p!==null?(p.return=h,ue=p):dN(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=M2("display",o))}catch(m){St(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(m){St(e,e.return,m)}}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;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Tn(t,e),aa(e),n&4&&cN(e);break;case 21:break;default:Tn(t,e),aa(e)}}function aa(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(oT(r)){var n=r;break e}r=r.return}throw Error(re(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(id(a,""),n.flags&=-33);var i=lN(e);O0(e,i,a);break;case 3:case 4:var o=n.stateNode.containerInfo,l=lN(e);k0(e,l,o);break;default:throw Error(re(161))}}catch(c){St(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function a6(e,t,r){ue=e,uT(e)}function uT(e,t,r){for(var n=(e.mode&1)!==0;ue!==null;){var a=ue,i=a.child;if(a.tag===22&&n){var o=a.memoizedState!==null||gh;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||dr;l=gh;var u=dr;if(gh=o,(dr=c)&&!u)for(ue=a;ue!==null;)o=ue,c=o.child,o.tag===22&&o.memoizedState!==null?fN(a):c!==null?(c.return=o,ue=c):fN(a);for(;i!==null;)ue=i,uT(i),i=i.sibling;ue=a,gh=l,dr=u}uN(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,ue=i):uN(e)}}function uN(e){for(;ue!==null;){var t=ue;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:dr||bg(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!dr)if(r===null)n.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Dn(t.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&G_(t,i,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}G_(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 u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&cd(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(re(163))}dr||t.flags&512&&N0(t)}catch(h){St(t,t.return,h)}}if(t===e){ue=null;break}if(r=t.sibling,r!==null){r.return=t.return,ue=r;break}ue=t.return}}function dN(e){for(;ue!==null;){var t=ue;if(t===e){ue=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ue=r;break}ue=t.return}}function fN(e){for(;ue!==null;){var t=ue;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{bg(4,t)}catch(c){St(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var a=t.return;try{n.componentDidMount()}catch(c){St(t,a,c)}}var i=t.return;try{N0(t)}catch(c){St(t,i,c)}break;case 5:var o=t.return;try{N0(t)}catch(c){St(t,o,c)}}}catch(c){St(t,t.return,c)}if(t===e){ue=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ue=l;break}ue=t.return}}var i6=Math.ceil,Fp=li.ReactCurrentDispatcher,T1=li.ReactCurrentOwner,bn=li.ReactCurrentBatchConfig,Le=0,Wt=null,Pt=null,tr=0,Hr=0,hl=cs(0),Dt=0,bd=null,no=0,wg=0,$1=0,qu=null,$r=null,R1=0,Yl=1/0,Ra=null,Bp=!1,C0=null,Ki=null,vh=!1,Fi=null,Up=0,Wu=0,E0=null,sp=-1,op=0;function kr(){return Le&6?Nt():sp!==-1?sp:sp=Nt()}function Gi(e){return e.mode&1?Le&2&&tr!==0?tr&-tr:zB.transition!==null?(op===0&&(op=G2()),op):(e=Ve,e!==0||(e=window.event,e=e===void 0?16:tA(e.type)),e):1}function Kn(e,t,r,n){if(50<Wu)throw Wu=0,E0=null,Error(re(185));Cf(e,r,n),(!(Le&2)||e!==Wt)&&(e===Wt&&(!(Le&2)&&(wg|=r),Dt===4&&Ei(e,tr)),Lr(e,n),r===1&&Le===0&&!(t.mode&1)&&(Yl=Nt()+500,vg&&us()))}function Lr(e,t){var r=e.callbackNode;zF(e,t);var n=_p(e,e===Wt?tr:0);if(n===0)r!==null&&w_(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&w_(r),t===1)e.tag===0?UB(hN.bind(null,e)):bA(hN.bind(null,e)),DB(function(){!(Le&6)&&us()}),r=null;else{switch(Y2(n)){case 1:r=s1;break;case 4:r=V2;break;case 16:r=Sp;break;case 536870912:r=K2;break;default:r=Sp}r=yT(r,dT.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function dT(e,t){if(sp=-1,op=0,Le&6)throw Error(re(327));var r=e.callbackNode;if(_l()&&e.callbackNode!==r)return null;var n=_p(e,e===Wt?tr:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=zp(e,n);else{t=n;var a=Le;Le|=2;var i=hT();(Wt!==e||tr!==t)&&(Ra=null,Yl=Nt()+500,Ys(e,t));do try{l6();break}catch(l){fT(e,l)}while(!0);x1(),Fp.current=i,Le=a,Pt!==null?t=0:(Wt=null,tr=0,t=Dt)}if(t!==0){if(t===2&&(a=r0(e),a!==0&&(n=a,t=P0(e,a))),t===1)throw r=bd,Ys(e,0),Ei(e,n),Lr(e,Nt()),r;if(t===6)Ei(e,n);else{if(a=e.current.alternate,!(n&30)&&!s6(a)&&(t=zp(e,n),t===2&&(i=r0(e),i!==0&&(n=i,t=P0(e,i))),t===1))throw r=bd,Ys(e,0),Ei(e,n),Lr(e,Nt()),r;switch(e.finishedWork=a,e.finishedLanes=n,t){case 0:case 1:throw Error(re(345));case 2:Ns(e,$r,Ra);break;case 3:if(Ei(e,n),(n&130023424)===n&&(t=R1+500-Nt(),10<t)){if(_p(e,0)!==0)break;if(a=e.suspendedLanes,(a&n)!==n){kr(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=u0(Ns.bind(null,e,$r,Ra),t);break}Ns(e,$r,Ra);break;case 4:if(Ei(e,n),(n&4194240)===n)break;for(t=e.eventTimes,a=-1;0<n;){var o=31-Vn(n);i=1<<o,o=t[o],o>a&&(a=o),n&=~i}if(n=a,n=Nt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*i6(n/1960))-n,10<n){e.timeoutHandle=u0(Ns.bind(null,e,$r,Ra),n);break}Ns(e,$r,Ra);break;case 5:Ns(e,$r,Ra);break;default:throw Error(re(329))}}}return Lr(e,Nt()),e.callbackNode===r?dT.bind(null,e):null}function P0(e,t){var r=qu;return e.current.memoizedState.isDehydrated&&(Ys(e,t).flags|=256),e=zp(e,t),e!==2&&(t=$r,$r=r,t!==null&&A0(t)),e}function A0(e){$r===null?$r=e:$r.push.apply($r,e)}function s6(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 a=r[n],i=a.getSnapshot;a=a.value;try{if(!Jn(i(),a))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 Ei(e,t){for(t&=~$1,t&=~wg,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Vn(t),n=1<<r;e[r]=-1,t&=~n}}function hN(e){if(Le&6)throw Error(re(327));_l();var t=_p(e,0);if(!(t&1))return Lr(e,Nt()),null;var r=zp(e,t);if(e.tag!==0&&r===2){var n=r0(e);n!==0&&(t=n,r=P0(e,n))}if(r===1)throw r=bd,Ys(e,0),Ei(e,t),Lr(e,Nt()),r;if(r===6)throw Error(re(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ns(e,$r,Ra),Lr(e,Nt()),null}function M1(e,t){var r=Le;Le|=1;try{return e(t)}finally{Le=r,Le===0&&(Yl=Nt()+500,vg&&us())}}function ao(e){Fi!==null&&Fi.tag===0&&!(Le&6)&&_l();var t=Le;Le|=1;var r=bn.transition,n=Ve;try{if(bn.transition=null,Ve=1,e)return e()}finally{Ve=n,bn.transition=r,Le=t,!(Le&6)&&us()}}function I1(){Hr=hl.current,ft(hl)}function Ys(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,IB(r)),Pt!==null)for(r=Pt.return;r!==null;){var n=r;switch(g1(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Ep();break;case 3:Kl(),ft(Ir),ft(mr),N1();break;case 5:_1(n);break;case 4:Kl();break;case 13:ft(vt);break;case 19:ft(vt);break;case 10:b1(n.type._context);break;case 22:case 23:I1()}r=r.return}if(Wt=e,Pt=e=Yi(e.current,null),tr=Hr=t,Dt=0,bd=null,$1=wg=no=0,$r=qu=null,Rs!==null){for(t=0;t<Rs.length;t++)if(r=Rs[t],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=a,n.next=o}r.pending=n}Rs=null}return e}function fT(e,t){do{var r=Pt;try{if(x1(),np.current=Lp,Dp){for(var n=yt.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Dp=!1}if(ro=0,Ut=It=yt=null,Uu=!1,vd=0,T1.current=null,r===null||r.return===null){Dt=1,bd=t,Pt=null;break}e:{var i=e,o=r.return,l=r,c=t;if(t=tr,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=eN(o);if(p!==null){p.flags&=-257,tN(p,o,l,i,t),p.mode&1&&Z_(i,u,t),t=p,c=u;var v=t.updateQueue;if(v===null){var m=new Set;m.add(c),t.updateQueue=m}else v.add(c);break e}else{if(!(t&1)){Z_(i,u,t),D1();break e}c=Error(re(426))}}else if(pt&&l.mode&1){var g=eN(o);if(g!==null){!(g.flags&65536)&&(g.flags|=256),tN(g,o,l,i,t),v1(Gl(c,l));break e}}i=c=Gl(c,l),Dt!==4&&(Dt=2),qu===null?qu=[i]:qu.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=YA(i,c,t);K_(i,y);break e;case 1:l=c;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ki===null||!Ki.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=XA(i,l,t);K_(i,S);break e}}i=i.return}while(i!==null)}mT(r)}catch(j){t=j,Pt===r&&r!==null&&(Pt=r=r.return);continue}break}while(!0)}function hT(){var e=Fp.current;return Fp.current=Lp,e===null?Lp:e}function D1(){(Dt===0||Dt===3||Dt===2)&&(Dt=4),Wt===null||!(no&268435455)&&!(wg&268435455)||Ei(Wt,tr)}function zp(e,t){var r=Le;Le|=2;var n=hT();(Wt!==e||tr!==t)&&(Ra=null,Ys(e,t));do try{o6();break}catch(a){fT(e,a)}while(!0);if(x1(),Le=r,Fp.current=n,Pt!==null)throw Error(re(261));return Wt=null,tr=0,Dt}function o6(){for(;Pt!==null;)pT(Pt)}function l6(){for(;Pt!==null&&!$F();)pT(Pt)}function pT(e){var t=vT(e.alternate,e,Hr);e.memoizedProps=e.pendingProps,t===null?mT(e):Pt=t,T1.current=null}function mT(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=t6(r,t),r!==null){r.flags&=32767,Pt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Dt=6,Pt=null;return}}else if(r=e6(r,t,Hr),r!==null){Pt=r;return}if(t=t.sibling,t!==null){Pt=t;return}Pt=t=e}while(t!==null);Dt===0&&(Dt=5)}function Ns(e,t,r){var n=Ve,a=bn.transition;try{bn.transition=null,Ve=1,c6(e,t,r,n)}finally{bn.transition=a,Ve=n}return null}function c6(e,t,r,n){do _l();while(Fi!==null);if(Le&6)throw Error(re(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(re(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(qF(e,i),e===Wt&&(Pt=Wt=null,tr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||vh||(vh=!0,yT(Sp,function(){return _l(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=bn.transition,bn.transition=null;var o=Ve;Ve=1;var l=Le;Le|=4,T1.current=null,n6(e,r),cT(r,e),EB(l0),Np=!!o0,l0=o0=null,e.current=r,a6(r),RF(),Le=l,Ve=o,bn.transition=i}else e.current=r;if(vh&&(vh=!1,Fi=e,Up=a),i=e.pendingLanes,i===0&&(Ki=null),DF(r.stateNode),Lr(e,Nt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(Bp)throw Bp=!1,e=C0,C0=null,e;return Up&1&&e.tag!==0&&_l(),i=e.pendingLanes,i&1?e===E0?Wu++:(Wu=0,E0=e):Wu=0,us(),null}function _l(){if(Fi!==null){var e=Y2(Up),t=bn.transition,r=Ve;try{if(bn.transition=null,Ve=16>e?16:e,Fi===null)var n=!1;else{if(e=Fi,Fi=null,Up=0,Le&6)throw Error(re(331));var a=Le;for(Le|=4,ue=e.current;ue!==null;){var i=ue,o=i.child;if(ue.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ue=u;ue!==null;){var d=ue;switch(d.tag){case 0:case 11:case 15:zu(8,d,i)}var f=d.child;if(f!==null)f.return=d,ue=f;else for(;ue!==null;){d=ue;var h=d.sibling,p=d.return;if(sT(d),d===u){ue=null;break}if(h!==null){h.return=p,ue=h;break}ue=p}}}var v=i.alternate;if(v!==null){var m=v.child;if(m!==null){v.child=null;do{var g=m.sibling;m.sibling=null,m=g}while(m!==null)}}ue=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,ue=o;else e:for(;ue!==null;){if(i=ue,i.flags&2048)switch(i.tag){case 0:case 11:case 15:zu(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,ue=y;break e}ue=i.return}}var x=e.current;for(ue=x;ue!==null;){o=ue;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,ue=w;else e:for(o=x;ue!==null;){if(l=ue,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:bg(9,l)}}catch(j){St(l,l.return,j)}if(l===o){ue=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,ue=S;break e}ue=l.return}}if(Le=a,us(),va&&typeof va.onPostCommitFiberRoot=="function")try{va.onPostCommitFiberRoot(fg,e)}catch{}n=!0}return n}finally{Ve=r,bn.transition=t}}return!1}function pN(e,t,r){t=Gl(r,t),t=YA(e,t,1),e=Vi(e,t,1),t=kr(),e!==null&&(Cf(e,1,t),Lr(e,t))}function St(e,t,r){if(e.tag===3)pN(e,e,r);else for(;t!==null;){if(t.tag===3){pN(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ki===null||!Ki.has(n))){e=Gl(r,e),e=XA(t,e,1),t=Vi(t,e,1),e=kr(),t!==null&&(Cf(t,1,e),Lr(t,e));break}}t=t.return}}function u6(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=kr(),e.pingedLanes|=e.suspendedLanes&r,Wt===e&&(tr&r)===r&&(Dt===4||Dt===3&&(tr&130023424)===tr&&500>Nt()-R1?Ys(e,0):$1|=r),Lr(e,t)}function gT(e,t){t===0&&(e.mode&1?(t=oh,oh<<=1,!(oh&130023424)&&(oh=4194304)):t=1);var r=kr();e=Ja(e,t),e!==null&&(Cf(e,t,r),Lr(e,r))}function d6(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),gT(e,r)}function f6(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(re(314))}n!==null&&n.delete(t),gT(e,r)}var vT;vT=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ir.current)Rr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Rr=!1,ZB(e,t,r);Rr=!!(e.flags&131072)}else Rr=!1,pt&&t.flags&1048576&&wA(t,Tp,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;ip(e,t),e=t.pendingProps;var a=Wl(t,mr.current);Sl(t,r),a=O1(null,t,n,e,a,r);var i=C1();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Dr(n)?(i=!0,Pp(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,j1(t),a.updater=xg,t.stateNode=a,a._reactInternals=t,v0(t,n,e,r),t=b0(null,t,n,!0,i,r)):(t.tag=0,pt&&i&&m1(t),wr(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(ip(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=p6(n),e=Dn(n,e),a){case 0:t=x0(null,t,n,e,r);break e;case 1:t=aN(null,t,n,e,r);break e;case 11:t=rN(null,t,n,e,r);break e;case 14:t=nN(null,t,n,Dn(n.type,e),r);break e}throw Error(re(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Dn(n,a),x0(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Dn(n,a),aN(e,t,n,a,r);case 3:e:{if(eT(t),e===null)throw Error(re(387));n=t.pendingProps,i=t.memoizedState,a=i.element,OA(e,t),Mp(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Gl(Error(re(423)),t),t=iN(e,t,n,r,a);break e}else if(n!==a){a=Gl(Error(re(424)),t),t=iN(e,t,n,r,a);break e}else for(Xr=Hi(t.stateNode.containerInfo.firstChild),Jr=t,pt=!0,Wn=null,r=NA(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Hl(),n===a){t=Za(e,t,r);break e}wr(e,t,n,r)}t=t.child}return t;case 5:return CA(t),e===null&&p0(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,c0(n,a)?o=null:i!==null&&c0(n,i)&&(t.flags|=32),ZA(e,t),wr(e,t,o,r),t.child;case 6:return e===null&&p0(t),null;case 13:return tT(e,t,r);case 4:return S1(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Vl(t,null,n,r):wr(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Dn(n,a),rN(e,t,n,a,r);case 7:return wr(e,t,t.pendingProps,r),t.child;case 8:return wr(e,t,t.pendingProps.children,r),t.child;case 12:return wr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,nt($p,n._currentValue),n._currentValue=o,i!==null)if(Jn(i.value,o)){if(i.children===a.children&&!Ir.current){t=Za(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=Va(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),m0(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(re(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),m0(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}wr(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,Sl(t,r),a=_n(a),n=n(a),t.flags|=1,wr(e,t,n,r),t.child;case 14:return n=t.type,a=Dn(n,t.pendingProps),a=Dn(n.type,a),nN(e,t,n,a,r);case 15:return QA(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Dn(n,a),ip(e,t),t.tag=1,Dr(n)?(e=!0,Pp(t)):e=!1,Sl(t,r),GA(t,n,a),v0(t,n,a,r),b0(null,t,n,!0,e,r);case 19:return rT(e,t,r);case 22:return JA(e,t,r)}throw Error(re(156,t.tag))};function yT(e,t){return H2(e,t)}function h6(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 yn(e,t,r,n){return new h6(e,t,r,n)}function L1(e){return e=e.prototype,!(!e||!e.isReactComponent)}function p6(e){if(typeof e=="function")return L1(e)?1:0;if(e!=null){if(e=e.$$typeof,e===n1)return 11;if(e===a1)return 14}return 2}function Yi(e,t){var r=e.alternate;return r===null?(r=yn(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.depen
vendor: 8,762 bytes, line 40
40dencies,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 lp(e,t,r,n,a,i){var o=2;if(n=e,typeof e=="function")L1(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case nl:return Xs(r.children,a,i,t);case r1:o=8,a|=8;break;case Ux:return e=yn(12,r,t,a|2),e.elementType=Ux,e.lanes=i,e;case zx:return e=yn(13,r,t,a),e.elementType=zx,e.lanes=i,e;case qx:return e=yn(19,r,t,a),e.elementType=qx,e.lanes=i,e;case C2:return jg(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case k2:o=10;break e;case O2:o=9;break e;case n1:o=11;break e;case a1:o=14;break e;case _i:o=16,n=null;break e}throw Error(re(130,e==null?e:typeof e,""))}return t=yn(o,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function Xs(e,t,r,n){return e=yn(7,e,n,t),e.lanes=r,e}function jg(e,t,r,n){return e=yn(22,e,n,t),e.elementType=C2,e.lanes=r,e.stateNode={isHidden:!1},e}function Ry(e,t,r){return e=yn(6,e,null,t),e.lanes=r,e}function My(e,t,r){return t=yn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function m6(e,t,r,n,a){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=my(0),this.expirationTimes=my(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=my(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function F1(e,t,r,n,a,i,o,l,c){return e=new m6(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=yn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},j1(i),e}function g6(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:rl,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function xT(e){if(!e)return ns;e=e._reactInternals;e:{if(bo(e)!==e||e.tag!==1)throw Error(re(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Dr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(re(171))}if(e.tag===1){var r=e.type;if(Dr(r))return xA(e,r,t)}return t}function bT(e,t,r,n,a,i,o,l,c){return e=F1(r,n,!0,e,a,i,o,l,c),e.context=xT(null),r=e.current,n=kr(),a=Gi(r),i=Va(n,a),i.callback=t??null,Vi(r,i,a),e.current.lanes=a,Cf(e,a,n),Lr(e,n),e}function Sg(e,t,r,n){var a=t.current,i=kr(),o=Gi(a);return r=xT(r),t.context===null?t.context=r:t.pendingContext=r,t=Va(i,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Vi(a,t,o),e!==null&&(Kn(e,a,o,i),rp(e,a,o)),o}function qp(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 mN(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function B1(e,t){mN(e,t),(e=e.alternate)&&mN(e,t)}function v6(){return null}var wT=typeof reportError=="function"?reportError:function(e){console.error(e)};function U1(e){this._internalRoot=e}_g.prototype.render=U1.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(re(409));Sg(e,t,null,null)};_g.prototype.unmount=U1.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ao(function(){Sg(null,e,null,null)}),t[Qa]=null}};function _g(e){this._internalRoot=e}_g.prototype.unstable_scheduleHydration=function(e){if(e){var t=J2();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Ci.length&&t!==0&&t<Ci[r].priority;r++);Ci.splice(r,0,e),r===0&&eA(e)}};function z1(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ng(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function gN(){}function y6(e,t,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var u=qp(o);i.call(u)}}var o=bT(t,n,e,0,null,!1,!1,"",gN);return e._reactRootContainer=o,e[Qa]=o.current,fd(e.nodeType===8?e.parentNode:e),ao(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof n=="function"){var l=n;n=function(){var u=qp(c);l.call(u)}}var c=F1(e,0,!1,null,null,!1,!1,"",gN);return e._reactRootContainer=c,e[Qa]=c.current,fd(e.nodeType===8?e.parentNode:e),ao(function(){Sg(t,c,r,n)}),c}function kg(e,t,r,n,a){var i=r._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=qp(o);l.call(c)}}Sg(t,o,e,a)}else o=y6(r,t,e,a,n);return qp(o)}X2=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Eu(t.pendingLanes);r!==0&&(o1(t,r|1),Lr(t,Nt()),!(Le&6)&&(Yl=Nt()+500,us()))}break;case 13:ao(function(){var n=Ja(e,1);if(n!==null){var a=kr();Kn(n,e,1,a)}}),B1(e,1)}};l1=function(e){if(e.tag===13){var t=Ja(e,134217728);if(t!==null){var r=kr();Kn(t,e,134217728,r)}B1(e,134217728)}};Q2=function(e){if(e.tag===13){var t=Gi(e),r=Ja(e,t);if(r!==null){var n=kr();Kn(r,e,t,n)}B1(e,t)}};J2=function(){return Ve};Z2=function(e,t){var r=Ve;try{return Ve=e,t()}finally{Ve=r}};Zx=function(e,t,r){switch(t){case"input":if(Vx(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 a=gg(n);if(!a)throw Error(re(90));P2(n),Vx(n,a)}}}break;case"textarea":T2(e,r);break;case"select":t=r.value,t!=null&&xl(e,!!r.multiple,t,!1)}};F2=M1;B2=ao;var x6={usingClientEntryPoint:!1,Events:[Pf,ol,gg,D2,L2,M1]},uu={findFiberByHostInstance:$s,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},b6={bundleType:uu.bundleType,version:uu.version,rendererPackageName:uu.rendererPackageName,rendererConfig:uu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:li.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=q2(e),e===null?null:e.stateNode},findFiberByHostInstance:uu.findFiberByHostInstance||v6,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 yh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yh.isDisabled&&yh.supportsFiber)try{fg=yh.inject(b6),va=yh}catch{}}sn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=x6;sn.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!z1(t))throw Error(re(200));return g6(e,t,null,r)};sn.createRoot=function(e,t){if(!z1(e))throw Error(re(299));var r=!1,n="",a=wT;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=F1(e,1,!1,null,null,r,!1,n,a),e[Qa]=t.current,fd(e.nodeType===8?e.parentNode:e),new U1(t)};sn.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(re(188)):(e=Object.keys(e).join(","),Error(re(268,e)));return e=q2(t),e=e===null?null:e.stateNode,e};sn.flushSync=function(e){return ao(e)};sn.hydrate=function(e,t,r){if(!Ng(t))throw Error(re(200));return kg(null,e,t,!0,r)};sn.hydrateRoot=function(e,t,r){if(!z1(e))throw Error(re(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",o=wT;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=bT(t,null,e,1,r??null,a,!1,i,o),e[Qa]=t.current,fd(e),n)for(e=0;e<n.length;e++)r=n[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new _g(t)};sn.render=function(e,t,r){if(!Ng(t))throw Error(re(200));return kg(null,e,t,!1,r)};sn.unmountComponentAtNode=function(e){if(!Ng(e))throw Error(re(40));return e._reactRootContainer?(ao(function(){kg(null,null,e,!1,function(){e._reactRootContainer=null,e[Qa]=null})}),!0):!1};sn.unstable_batchedUpdates=M1;sn.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Ng(r))throw Error(re(200));if(e==null||e._reactInternals===void 0)throw Error(re(38));return kg(e,t,r,!1,n)};sn.version="18.3.1-next-f1338f8080-20240426";
vendor: 8,664 bytes, line 40
40function jT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(jT)}catch(e){console.error(e)}}jT(),j2.exports=sn;var wo=j2.exports;const ST=qe(wo);var _T,vN=wo;_T=vN.createRoot,vN.hydrateRoot;var Og=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Cg=typeof window>"u"||"Deno"in globalThis;function Ln(){}function w6(e,t){return typeof e=="function"?e(t):e}function j6(e){return typeof e=="number"&&e>=0&&e!==1/0}function S6(e,t){return Math.max(e+(t||0)-Date.now(),0)}function T0(e,t){return typeof e=="function"?e(t):e}function _6(e,t){return typeof e=="function"?e(t):e}function yN(e,t){const{type:r="all",exact:n,fetchStatus:a,predicate:i,queryKey:o,stale:l}=e;if(o){if(n){if(t.queryHash!==q1(o,t.options))return!1}else if(!jd(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||a&&a!==t.state.fetchStatus||i&&!i(t))}function xN(e,t){const{exact:r,status:n,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(wd(t.options.mutationKey)!==wd(i))return!1}else if(!jd(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||a&&!a(t))}function q1(e,t){return((t==null?void 0:t.queryKeyHashFn)||wd)(e)}function wd(e){return JSON.stringify(e,(t,r)=>$0(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function jd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>jd(e[r],t[r])):!1}function NT(e,t){if(e===t)return e;const r=bN(e)&&bN(t);if(r||$0(e)&&$0(t)){const n=r?e:Object.keys(e),a=n.length,i=r?t:Object.keys(t),o=i.length,l=r?[]:{},c=new Set(n);let u=0;for(let d=0;d<o;d++){const f=r?d:i[d];(!r&&c.has(f)||r)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=NT(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return a===o&&u===a?e:l}return t}function bN(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $0(e){if(!wN(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!wN(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wN(e){return Object.prototype.toString.call(e)==="[object Object]"}function N6(e){return new Promise(t=>{setTimeout(t,e)})}function k6(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?NT(e,t):t}function O6(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function C6(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var W1=Symbol();function kT(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===W1?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var qs,$i,Ml,n2,E6=(n2=class extends Og{constructor(){super();Fe(this,qs);Fe(this,$i);Fe(this,Ml);Ee(this,Ml,t=>{if(!Cg&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){G(this,$i)||this.setEventListener(G(this,Ml))}onUnsubscribe(){var t;this.hasListeners()||((t=G(this,$i))==null||t.call(this),Ee(this,$i,void 0))}setEventListener(t){var r;Ee(this,Ml,t),(r=G(this,$i))==null||r.call(this),Ee(this,$i,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){G(this,qs)!==t&&(Ee(this,qs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof G(this,qs)=="boolean"?G(this,qs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},qs=new WeakMap,$i=new WeakMap,Ml=new WeakMap,n2),OT=new E6,Il,Ri,Dl,a2,P6=(a2=class extends Og{constructor(){super();Fe(this,Il,!0);Fe(this,Ri);Fe(this,Dl);Ee(this,Dl,t=>{if(!Cg&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){G(this,Ri)||this.setEventListener(G(this,Dl))}onUnsubscribe(){var t;this.hasListeners()||((t=G(this,Ri))==null||t.call(this),Ee(this,Ri,void 0))}setEventListener(t){var r;Ee(this,Dl,t),(r=G(this,Ri))==null||r.call(this),Ee(this,Ri,t(this.setOnline.bind(this)))}setOnline(t){G(this,Il)!==t&&(Ee(this,Il,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return G(this,Il)}},Il=new WeakMap,Ri=new WeakMap,Dl=new WeakMap,a2),Wp=new P6;function A6(){let e,t;const r=new Promise((a,i)=>{e=a,t=i});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),e(a)},r.reject=a=>{n({status:"rejected",reason:a}),t(a)},r}function T6(e){return Math.min(1e3*2**e,3e4)}function CT(e){return(e??"online")==="online"?Wp.isOnline():!0}var ET=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Iy(e){return e instanceof ET}function PT(e){let t=!1,r=0,n=!1,a;const i=A6(),o=m=>{var g;n||(h(new ET(m)),(g=e.abort)==null||g.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>OT.isFocused()&&(e.networkMode==="always"||Wp.isOnline())&&e.canRun(),d=()=>CT(e.networkMode)&&e.canRun(),f=m=>{var g;n||(n=!0,(g=e.onSuccess)==null||g.call(e,m),a==null||a(),i.resolve(m))},h=m=>{var g;n||(n=!0,(g=e.onError)==null||g.call(e,m),a==null||a(),i.reject(m))},p=()=>new Promise(m=>{var g;a=y=>{(n||u())&&m(y)},(g=e.onPause)==null||g.call(e)}).then(()=>{var m;a=void 0,n||(m=e.onContinue)==null||m.call(e)}),v=()=>{if(n)return;let m;const g=r===0?e.initialPromise:void 0;try{m=g??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(f).catch(y=>{var _;if(n)return;const x=e.retry??(Cg?0:3),w=e.retryDelay??T6,S=typeof w=="function"?w(r,y):w,j=x===!0||typeof x=="number"&&r<x||typeof x=="function"&&x(r,y);if(t||!j){h(y);return}r++,(_=e.onFail)==null||_.call(e,r,y),N6(S).then(()=>u()?void 0:p()).then(()=>{t?h(y):v()})})};return{promise:i,cancel:o,continue:()=>(a==null||a(),i),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?v():p().then(v),i)}}var $6=e=>setTimeout(e,0);function R6(){let e=[],t=0,r=l=>{l()},n=l=>{l()},a=$6;const i=l=>{t?e.push(l):a(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{a=l}}}var jr=R6(),Ws,i2,AT=(i2=class{constructor(){Fe(this,Ws)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),j6(this.gcTime)&&Ee(this,Ws,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Cg?1/0:5*60*1e3))}clearGcTimeout(){G(this,Ws)&&(clearTimeout(G(this,Ws)),Ee(this,Ws,void 0))}},Ws=new WeakMap,i2),Ll,Hs,pn,Vs,cr,Nf,Ks,Bn,$a,s2,M6=(s2=class extends AT{constructor(t){super();Fe(this,Bn);Fe(this,Ll);Fe(this,Hs);Fe(this,pn);Fe(this,Vs);Fe(this,cr);Fe(this,Nf);Fe(this,Ks);Ee(this,Ks,!1),Ee(this,Nf,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ee(this,Vs,t.client),Ee(this,pn,G(this,Vs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ee(this,Ll,D6(this.options)),this.state=t.state??G(this,Ll),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=G(this,cr))==null?void 0:t.promise}setOptions(t){this.options={...G(this,Nf),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&G(this,pn).remove(this)}setData(t,r){const n=k6(this.state.data,t,this.options);return sr(this,Bn,$a).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){sr(this,Bn,$a).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,a;const r=(n=G(this,cr))==null?void 0:n.promise;return(a=G(this,cr))==null||a.cancel(t),r?r.then(Ln).catch(Ln):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(G(this,Ll))}isActive(){return this.observers.some(t=>_6(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===W1||this.state.dataUpdateCount+this.state.errorUpdate
40Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>T0(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!S6(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=G(this,cr))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=G(this,cr))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),G(this,pn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(G(this,cr)&&(G(this,Ks)?G(this,cr).cancel({revert:!0}):G(this,cr).cancelRetry()),this.scheduleGc()),G(this,pn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||sr(this,Bn,$a).call(this,{type:"invalidate"})}fetch(t,r){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(G(this,cr))return G(this,cr).continueRetry(),G(this,cr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,a=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(Ee(this,Ks,!0),n.signal)})},i=()=>{const h=kT(this.options,r),v=(()=>{const m={client:G(this,Vs),queryKey:this.queryKey,meta:this.meta};return a(m),m})();return Ee(this,Ks,!1),this.options.persister?this.options.persister(h,v,this):h(v)},l=(()=>{const h={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:G(this,Vs),state:this.state,fetchFn:i};return a(h),h})();(u=this.options.behavior)==null||u.onFetch(l,this),Ee(this,Hs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&sr(this,Bn,$a).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=h=>{var p,v,m,g;Iy(h)&&h.silent||sr(this,Bn,$a).call(this,{type:"error",error:h}),Iy(h)||((v=(p=G(this,pn).config).onError)==null||v.call(p,h,this),(g=(m=G(this,pn).config).onSettled)==null||g.call(m,this.state.data,h,this)),this.scheduleGc()};return Ee(this,cr,PT({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:n.abort.bind(n),onSuccess:h=>{var p,v,m,g;if(h===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(y){c(y);return}(v=(p=G(this,pn).config).onSuccess)==null||v.call(p,h,this),(g=(m=G(this,pn).config).onSettled)==null||g.call(m,h,this.state.error,this),this.scheduleGc()},onError:c,onFail:(h,p)=>{sr(this,Bn,$a).call(this,{type:"failed",failureCount:h,error:p})},onPause:()=>{sr(this,Bn,$a).call(this,{type:"pause"})},onContinue:()=>{sr(this,Bn,$a).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),G(this,cr).start()}},Ll=new WeakMap,Hs=new WeakMap,pn=new WeakMap,Vs=new WeakMap,cr=new WeakMap,Nf=new WeakMap,Ks=new WeakMap,Bn=new WeakSet,$a=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...I6(n.data,this.options),fetchMeta:t.meta??null};case"success":return Ee(this,Hs,void 0),{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return Iy(a)&&a.revert&&G(this,Hs)?{...G(this,Hs),fetchStatus:"idle"}
vendor: 5,105 bytes, line 40
40:{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),jr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),G(this,pn).notify({query:this,type:"updated",action:t})})},s2);function I6(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:CT(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function D6(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var la,o2,L6=(o2=class extends Og{constructor(t={}){super();Fe(this,la);this.config=t,Ee(this,la,new Map)}build(t,r,n){const a=r.queryKey,i=r.queryHash??q1(a,r);let o=this.get(i);return o||(o=new M6({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){G(this,la).has(t.queryHash)||(G(this,la).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=G(this,la).get(t.queryHash);r&&(t.destroy(),r===t&&G(this,la).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){jr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return G(this,la).get(t)}getAll(){return[...G(this,la).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>yN(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>yN(t,n)):r}notify(t){jr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){jr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){jr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},la=new WeakMap,o2),ca,br,Gs,ua,ji,l2,F6=(l2=class extends AT{constructor(t){super();Fe(this,ua);Fe(this,ca);Fe(this,br);Fe(this,Gs);this.mutationId=t.mutationId,Ee(this,br,t.mutationCache),Ee(this,ca,[]),this.state=t.state||B6(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){G(this,ca).includes(t)||(G(this,ca).push(t),this.clearGcTimeout(),G(this,br).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ee(this,ca,G(this,ca).filter(r=>r!==t)),this.scheduleGc(),G(this,br).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){G(this,ca).length||(this.state.status==="pending"?this.scheduleGc():G(this,br).remove(this))}continue(){var t;return((t=G(this,Gs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,l,c,u,d,f,h,p,v,m,g,y,x,w,S,j,_,N,k;const r=()=>{sr(this,ua,ji).call(this,{type:"continue"})};Ee(this,Gs,PT({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(O,E)=>{sr(this,ua,ji).call(this,{type:"failed",failureCount:O,error:E})},onPause:()=>{sr(this,ua,ji).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>G(this,br).canRun(this)}));const n=this.state.status==="pending",a=!G(this,Gs).canStart();try{if(n)r();else{sr(this,ua,ji).call(this,{type:"pending",variables:t,isPaused:a}),await((o=(i=G(this,br).config).onMutate)==null?void 0:o.call(i,t,this));const E=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));E!==this.state.context&&sr(this,ua,ji).call(this,{type:"pending",context:E,variables:t,isPaused:a})}const O=await G(this,Gs).start();return await((d=(u=G(this,br).config).onSuccess)==null?void 0:d.call(u,O,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,O,t,this.state.context)),await((v=(p=G(this,br).config).onSettled)==null?void 0:v.call(p,O,null,this.state.variables,this.state.context,this)),await((g=(m=this.options).onSettled)==null?void 0:g.call(m,O,null,t,this.state.context)),sr(this,ua,ji).call(this,{type:"success",data:O}),O}catch(O){try{throw await((x=(y=G(this,br).config).onError)==null?void 0:x.call(y,O,t,this.state.context,this)),await((S=(w=this.options).onError)==null?void 0:S.call(w,O,t,this.state.context)),await((_=(j=G(this,br).config).onSettled)==null?void 0:_.call(j,void 0,O,this.state.variables,this.state.context,this)),await((k=(N=this.options).onSettled)==null?void 0:k.call(N,void 0,O,t,this.state.context)),O}finally{sr(this,ua,ji).call(this,{type:"error",error:O})}}finally{G(this,br).runNext(this)}}},ca=new WeakMap,br=new WeakMap,Gs=new WeakMap,ua=new WeakSet,ji=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};
40case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),jr.batch(()=>{G(this,ca).forEach(n=>{n.onMutationUpdate(t)}),G(this,br).notify({mutation:this,type:"updated",action:t})})},l2);function B6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Fa,Un,kf,c2,U6=(c2=class extends Og{constructor(t={}){super();Fe(this,Fa);Fe(this,Un);Fe(this,kf);this.config=t,Ee(this,Fa,new Set),Ee(this,Un,new Map),Ee(this,kf,0)}build(t,r,n){const a=new F6({mutationCache:this,mutationId:++eh(this,kf)._,options:t.defaultMutationOptions(r),state:n});return this.add(a),a}add(t){G(this,Fa).add(t);const r=xh(t);if(typeof r=="string"){const n=G(this,Un).get(r);n?n.push(t):G(this,Un).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(G(this,Fa).delete(t)){const r=xh(t);if(typeof r=="string"){const n=G(this,Un).get(r);if(n)if(n.length>1){const a=n.indexOf(t);a!==-1&&n.splice(a,1)}else n[0]===t&&G(this,Un).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=xh(t);if(typeof r=="string"){const n=G(this,Un).get(r),a=n==null?void 0:n.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var n;const r=xh(t);if(typeof r=="string"){const a=(n=G(this,Un).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){jr.batch(()=>{G(this,Fa).forEach(t=>{this.notify({type:"removed",mutation:t})}),G(this,Fa).clear(),G(this,Un).clear()})}getAll(){return Array.from(G(this,Fa))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>xN(r,n))}findAll(t={}){return this.getAll().filter(r=>xN(t,r))}notify(t){jr.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>
vendor: 4,438 bytes, line 40
40r.state.isPaused);return jr.batch(()=>Promise.all(t.map(r=>r.continue().catch(Ln))))}},Fa=new WeakMap,Un=new WeakMap,kf=new WeakMap,c2);function xh(e){var t;return(t=e.options.scope)==null?void 0:t.id}function jN(e){return{onFetch:(t,r)=>{var d,f,h,p,v;const n=t.options,a=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let m=!1;const g=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},y=kT(t.options,t.fetchOptions),x=async(w,S,j)=>{if(m)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const N=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:S,direction:j?"backward":"forward",meta:t.options.meta};return g(A),A})(),k=await y(N),{maxPages:O}=t.options,E=j?C6:O6;return{pages:E(w.pages,k,O),pageParams:E(w.pageParams,S,O)}};if(a&&i.length){const w=a==="backward",S=w?z6:SN,j={pages:i,pageParams:o},_=S(n,j);l=await x(j,_,w)}else{const w=e??i.length;do{const S=c===0?o[0]??n.initialPageParam:SN(n,l);if(c>0&&S==null)break;l=await x(l,S),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var m,g;return(g=(m=t.options).persister)==null?void 0:g.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function SN(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function z6(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var wt,Mi,Ii,Fl,Bl,Di,Ul,zl,u2,q6=(u2=class{constructor(e={}){Fe(this,wt);Fe(this,Mi);Fe(this,Ii);Fe(this,Fl);Fe(this,Bl);Fe(this,Di);Fe(this,Ul);Fe(this,zl);Ee(this,wt,e.queryCache||new L6),Ee(this,Mi,e.mutationCache||new U6),Ee(this,Ii,e.defaultOptions||{}),Ee(this,Fl,new Map),Ee(this,Bl,new Map),Ee(this,Di,0)}mount(){eh(this,Di)._++,G(this,Di)===1&&(Ee(this,Ul,OT.subscribe(async e=>{e&&(await this.resumePausedMutations(),G(this,wt).onFocus())})),Ee(this,zl,Wp.subscribe(async e=>{e&&(await this.resumePausedMutations(),G(this,wt).onOnline())})))}unmount(){var e,t;eh(this,Di)._--,G(this,Di)===0&&((e=G(this,Ul))==null||e.call(this),Ee(this,Ul,void 0),(t=G(this,zl))==null||t.call(this),Ee(this,zl,void 0))}isFetching(e){return G(this,wt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return G(this,Mi).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=G(this,wt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=G(this,wt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(T0(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return G(this,wt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=G(this,wt).get(n.queryHash),i=a==null?void 0:a.state.data,o=w6(t,i);if(o!==void 0)return G(this,wt).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return jr.batch(()=>G(this,wt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=G(this,wt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=G(this,wt);jr.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=G(this,wt);return jr.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=jr.batch(()=>G(this,wt).findAll(e).map(a=>a.cancel(r)));return Promise.all(n).then(Ln).catch(Ln)}invalidateQueries(e,t={}){return jr.batch(()=>(G(this,wt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=jr.batch(()=>G(this,wt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,r);return r.throwOnError||(i=i.catch(Ln)),a.state.fetchStatus==="paused"?Promise.resolve():i}
40));return Promise.all(n).then(Ln)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=G(this,wt).build(this,t);return r.isStaleByTime(T0(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ln).catch(Ln)}fetchInfiniteQuery(e){return e.behavior=jN(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ln).catch(Ln)}ensureInfiniteQueryData(e){return e.behavior=jN(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Wp.isOnline()?G(this,Mi).resumePausedMutations():Promise.resolve()}getQueryCache(){return G(this,wt)}getMutationCache(){return G(this,Mi)}getDefaultOptions(){return G(this,Ii)}setDefaultOptions(e){Ee(this,Ii,e)}setQueryDefaults(e,t){G(this,Fl).set(wd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...G(this,Fl).values()],r={};return t.forEach(n=>{jd(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){G(this,Bl).set(wd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...G(this,Bl).values()],r={};return t.forEach(n=>{jd(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...G(this,Ii).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=q1(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===W1&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...G(this,Ii).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){G(this,wt).clear(),G(this,Mi).clear()}},wt=new WeakMap,Mi=new WeakMap,Ii=new WeakMap,Fl=new WeakMap,Bl=new WeakMap,Di=new WeakMap,Ul=new WeakMap,zl=new WeakMap,u2),W6=b.createContext(void 0),H6=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(W6.Provider,{value:e,children:t}));/**
41 * @remix-run/router v1.23.0
42 *
43 * Copyright (c) Remix Software Inc.
44 *
45 * This source code is licensed under the MIT license found in the
46 * LICENSE.md file in the root directory of this source tree.
47 *
48 * @license MIT
49 */function Sd(){return Sd=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},Sd.apply(this,arguments)}var Bi;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Bi||(Bi={}));const _N="popstate";function V6(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:o,hash:l}=n.location;return R0("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Hp(a)}return G6(t,r,null,e)}function xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function TT(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function K6(){return Math.random().toString(36).substr(2,8)}function NN(e,t){return{usr:e.state,key:e.key,idx:t}}function R0(e,t,r,n){return r===void 0&&(r=null),Sd({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Pc(t):t,{state:r,key:t&&t.key||n||K6()})}function Hp(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 Pc(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 G6(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,l=Bi.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Sd({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=Bi.Pop;let g=d(),y=g==null?null:g-u;u=g,c&&c({action:l,location:m.location,delta:y})}function h(g,y){l=Bi.Push;let x=R0(m.location,g,y);u=d()+1;let w=NN(x,u),S=m.createHref(x);try{o.pushState(w,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(S)}i&&c&&c({action:l,location:m.location,delta:1})}function p(g,y){l=Bi.Replace;let x=R0(m.location,g,y);u=d();let w=NN(x,u),S=m.createHref(x);o.replaceState(w,"",S),i&&c&&c({action:l,location:m.location,delta:0})}function v(g){let y=a.location.origin!=="null"?a.location.origin:a.location.href,x=typeof g=="string"?g:Hp(g);return x=x.replace(/ $/,"%20"),xt(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let m={get action(){return l},get location(){return e(a,o)},listen(g){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(_N,f),c=g,()=>{a.removeEventListener(_N,f),c=null}},createHref(g){return t(a,g)},createURL:v,encodeLocation(g){let y=v(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:p,go(g){return o.go(g)}};return m}var kN;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(kN||(kN={}));function Y6(e,t,r){return r===void 0&&(r="/"),X6(e,t,r,!1)}function X6(e,t,r,n){let a=typeof t=="string"?Pc(t):t,i=Xl(a.pathname||"/",r);if(i==null)return null;let o=$T(e);Q6(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=l8(i);l=s8(o[c],u,n)}return l}function $T(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(xt(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not val
49id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Xi([n,c.relativePath]),d=r.concat(c);i.children&&i.children.length>0&&(xt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),$T(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:a8(u,i.index),routesMeta:d})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of RT(i.path))a(i,o,c)}),t}function RT(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=RT(n.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Q6(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:i8(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const J6=/^:[\w-]+$/,Z6=3,e8=2,t8=1,r8=10,n8=-2,ON=e=>e==="*";function a8(e,t){let r=e.split("/"),n=r.length;return r.some(ON)&&(n+=n8),t&&(n+=e8),r.filter(a=>!ON(a)).reduce((a,i)=>a+(J6.test(i)?Z6:i===""?t8:r8),n)}function i8(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function s8(e,t,r){let{routesMeta:n}=e,a={},i="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=Vp({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&r&&!n[n.length-1].route.index&&(f=Vp({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;
vendor: 9,622 bytes, lines 49-58
49Object.assign(a,f.params),o.push({params:a,pathname:Xi([i,f.pathname]),pathnameBase:f8(Xi([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=Xi([i,f.pathnameBase]))}return o}function Vp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=o8(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((u,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=l[f]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const v=l[f];return p&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function o8(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),TT(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=[],a="^"+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:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function l8(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return TT(!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 Xl(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)||"/"}function c8(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?Pc(e):e;return{pathname:r?r.startsWith("/")?r:u8(r,t):t,search:h8(n),hash:p8(a)}}function u8(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Dy(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 d8(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function H1(e,t){let r=d8(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function V1(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=Pc(e):(a=Sd({},e),xt(!a.pathname||!a.pathname.includes("?"),Dy("?","pathname","search",a)),xt(!a.pathname||!a.pathname.includes("#"),Dy("#","pathname","hash",a)),xt(!a.search||!a.search.includes("#"),Dy("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=c8(a,l),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Xi=e=>e.join("/").replace(/\/\/+/g,"/"),f8=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),h8=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,p8=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function m8(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const MT=["post","put","patch","delete"];new Set(MT);const g8=["get",...MT];new Set(g8);/**
50 * React Router v6.30.1
51 *
52 * Copyright (c) Remix Software Inc.
53 *
54 * This source code is licensed under the MIT license found in the
55 * LICENSE.md file in the root directory of this source tree.
56 *
57 * @license MIT
58 */function _d(){return _d=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},_d.apply(this,arguments)}const Eg=b.createContext(null),IT=b.createContext(null),ci=b.createContext(null),Pg=b.createContext(null),Na=b.createContext({outlet:null,matches:[],isDataRoute:!1}),DT=b.createContext(null);function v8(e,t){let{relative:r}=t===void 0?{}:t;Ac()||xt(!1);let{basename:n,navigator:a}=b.useContext(ci),{hash:i,pathname:o,search:l}=Ag(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:Xi([n,o])),a.createHref({pathname:c,search:l,hash:i})}function Ac(){return b.useContext(Pg)!=null}function ka(){return Ac()||xt(!1),b.useContext(Pg).location}function LT(e){b.useContext(ci).static||b.useLayoutEffect(e)}function ui(){let{isDataRoute:e}=b.useContext(Na);return e?T8():y8()}function y8(){Ac()||xt(!1);let e=b.useContext(Eg),{basename:t,future:r,navigator:n}=b.useContext(ci),{matches:a}=b.useContext(Na),{pathname:i}=ka(),o=JSON.stringify(H1(a,r.v7_relativeSplatPath)),l=b.useRef(!1);return LT(()=>{l.current=!0}),b.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=V1(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Xi([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,o,i,e])}const x8=b.createContext(null);function b8(e){let t=b.useContext(Na).outlet;return t&&b.createElement(x8.Provider,{value:e},t)}function FT(){let{matches:e}=b.useContext(Na),t=e[e.length-1];return t?t.params:{}}function Ag(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=b.useContext(ci),{matches:a}=b.useContext(Na),{pathname:i}=ka(),o=JSON.stringify(H1(a,n.v7_relativeSplatPath));return b.useMemo(()=>V1(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function w8(e,t){return j8(e,t)}function j8(e,t,r,n){Ac()||xt(!1);let{navigator:a}=b.useContext(ci),{matches:i}=b.useContext(Na),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=ka(),d;if(t){var f;let g=typeof t=="string"?Pc(t):t;c==="/"||(f=g.pathname)!=null&&f.startsWith(c)||xt(!1),d=g}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let g=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(g.length).join("/")}let v=Y6(e,{pathname:p}),m=O8(v&&v.map(g=>Object.assign({},g,{params:Object.assign({},l,g.params),pathname:Xi([c,a.encodeLocation?a.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?c:Xi([c,a.encodeLocation?a.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),i,r,n);return t&&m?b.createElement(Pg.Provider,{value:{location:_d({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Bi.Pop}},m):m}function S8(){let e=A8(),t=m8(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),r?b.createElement("pre",{style:a},r):null,null)}const _8=b.createElement(S8,null);class N8 extends b.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?b.createElement(Na.Provider,{value:this.props.routeContext},b.createElement(DT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function k8(e){let{routeContext:t,match:r,children:n}=e,a=b.useContext(Eg);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),b.createElement(Na.Provider,{value:t},n)}function O8(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(a=r)==null?void 0:a.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||xt(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:p}=r,v=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||v){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,v=!1,m=null,g=null;r&&(p=l&&f.route.id?l[f.route.id]:void 0,m=f.route.errorElement||_8,c&&(u<0&&h===0?(v=!0,g=null):u===h&&(v=!0,g=f.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,h+1)),x=()=>{let w;return p?w=m:v?w=g:f.route.Component?w=b.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,b.createElement(k8,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:r!=null},children:w})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?b.createElement(N8,{location:r.location,revalidation:r.revalidation,component:m,error:p,children:x(),routeC
58ontext:{outlet:null,matches:y,isDataRoute:!0}}):x()},null)}var BT=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(BT||{}),Kp=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}(Kp||{});function C8(e){let t=b.useContext(Eg);return t||xt(!1),t}function E8(e){let t=b.useContext(IT);return t||xt(!1),t}function P8(e){let t=b.useContext(Na);return t||xt(!1),t}function UT(e){let t=P8(),r=t.matches[t.matches.length-1];return r.route.id||xt(!1),r.route.id}function A8(){var e;let t=b.useContext(DT),r=E8(Kp.UseRouteError),n=UT(Kp.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function T8(){let{router:e}=C8(BT.UseNavigateStable),t=UT(Kp.UseNavigateStable),r=b.useRef(!1);return LT(()=>{r.current=!0}),b.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,_d({fromRouteId:t},i)))},[e,t])}function $8(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function R8(e){let{to:t,replace:r,state:n,relative:a}=e;Ac()||xt(!1);let{future:i,static:o}=b.useContext(ci),{matches:l}=b.useContext(Na),{pathname:c}=ka(),u=ui(),d=V1(t,H1(l,i.v7_relativeSplatPath),c,a==="path"),f=JSON.stringify(d);return b.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:a}),[u,f,a,r,n]),null}function M8(e){return b8(e.context)}function Ae(e){xt(!1)}function I8(e){let{basename:t="/",children:r=null,location:n,navigationType:a=Bi.Pop,navigator:i,static:o=!1,future:l}=e;Ac()&&xt(!1);let c=t.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:c,navigator:i,static:o,future:_d({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof n=="string"&&(n=Pc(n));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:v="default"}=n,m=b.useMemo(()=>{let g=Xl(d,c);return g==null?null:{location:{pathname:g,search:f,hash:h,state:p,key:v},navigationType:a}},[c,d,f,h,p,v,a]);return m==null?null:b.createElement(ci.Provider,{value:u},b.createElement(Pg.Provider,{children:r,value:m}))}function CN(e){let{children:t,location:r}=e;return w8(M0(t),r)}new Promise(()=>{});function M0(e,t){t===void 0&&(t=[]);let r=[];return b.Children.forEach(e,(n,a)=>{if(!b.isValidElement(n))return;let i=[...t,a];if(n.type===b.Fragment){r.push.apply(r,M0(n.props.children,i));return}n.type!==Ae&&xt(!1),!n.props.index||!n.props.children||xt(!1);let o={id:n.props.id||i.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=M0(n.props.children,i)),r.push(o)}),r}/**
59 * React Router DOM v6.30.1
60 *
61 * Copyright (c) Remix Software Inc.
62 *
63 * This source code is licensed under the MIT license found in the
64 * LICENSE.md file in the root directory of this source tree.
65 *
66 * @license MIT
67 */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)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gp.apply(this,arguments)}function zT(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function D8(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function L8(e,t){return e.button===0&&(!t||t==="_self")&&!D8(e)}function I0(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(a=>[r,a]):[[r,n]])},[]))}function F8(e,t){let r=I0(e);return t&&t.forEach((n,a)=>
67{r.has(a)||t.getAll(a).forEach(i=>{r.append(a,i)})}),r}const B8=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],U8=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],z8="6";try{window.__reactRouterVersion=z8}catch{}const q8=b.createContext({isTransitioning:!1}),W8="startTransition",EN=Jw[W8];function H8(e){let{basename:t,children:r,future:n,window:a}=e,i=b.useRef();i.current==null&&(i.current=V6({window:a,v5Compat:!0}));let o=i.current,[l,c]=b.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},d=b.useCallback(f=>{u&&EN?EN(()=>c(f)):c(f)},[c,u]);return b.useLayoutEffect(()=>o.listen(d),[o,d]),b.useEffect(()=>$8(n),[n]),b.createElement(I8,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const V8=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",K8=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,we=b.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=zT(t,B8),{basename:p}=b.useContext(ci),v,m=!1;if(typeof u=="string"&&K8.test(u)&&(v=u,V8))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),j=Xl(S.pathname,p);S.origin===w.origin&&j!=null?u=j+S.search+S.hash:m=!0}catch{}let g=v8(u,{relative:a}),y=X8(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:a,viewTransition:f});function x(w){n&&n(w),w.defaultPrevented||y(w)}return b.createElement("a",Gp({},h,{href:v||g,onClick:m||i?n:x,ref:r,target:c}))}),G8=b.forwardRef(function(t,r){let{"aria-current":n="page",caseSensitive:a=!1,className:i="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=zT(t,U8),h=Ag(c,{relative:f.relative}),p=ka(),v=b.useContext(IT),{navigator:m,basename:g}=b.useContext(ci),y=v!=null&&Q8(h)&&u===!0,x=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,w=p.pathname,S=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;a||(w=w.toLowerCase(),S=S?S.toLowerCase():null,x=x.toLowerCase()),S&&g&&(S=Xl(S,g)||S);const j=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let _=w===x||!o&&w.startsWith(x)&&w.charAt(j)==="/",N=S!=null&&(S===x||!o&&S.startsWith(x)&&S.charAt(x.length)==="/"),k={isActive:_,isPending:N,isTransitioning:y},O=_?n:void 0,E;typeof i=="function"?E=i(k):E=[i,_?"active":null,N?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let A=typeof l=="function"?l(k):l;return b.createElement(we,Gp({},f,{"aria-current":O,className:E,ref:r,style:A,to:c,viewTransition:u}),typeof d=="function"?d(k):d)});var D0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(D0||(D0={}));var PN;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(PN||(PN={}));function Y8(e){let t=b.useContext(Eg);return t||xt(!1),t}function X8(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=ui(),u=ka(),d=Ag(e,{relative:o});return b.useCallback(f=>{if(L8(f,r)){f.preventDefault();let h=n!==void 0?n:Hp(u)===Hp(d);c(e,{replace:h,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,d,n,a,r,e,i,o,l])}function qT(e){let t=b.useRef(I0(e)),r=b.useRef(!1),n=ka(),a=b.useMemo(()=>F8(n.search,r.current?null:t.current),[n.search]),i=ui(),o=b.useCallback((l,c)=>{const u=I0(typeof l=="function"?l(a):l);r.current=!0,i("?"+u,c)},[i,a]);return[a,o]}function Q8(e,t){t===void 0&&(t={});let r=b.useContext(q8);r==null&&xt(!1);let{basename:n}=Y8(D0.useViewTransitionState),a=Ag(e,{relative:t.relative});if(!r.isTransitioning)return!1;let i=Xl(r.currentLocation.pathname,n)||r.currentLocation.pathname,o=Xl(r.nextLocation.pathname,n)||r.nextLocation.pathname;return Vp(a.pathname,o)!=null||Vp(a.pathname,i)!=null}var AN=["light","dark"],J8="(prefers-color-scheme: dark)",Z8=b.createContext(void 0),eU={setTheme:e=>{},themes:[]},tU=()=>{var e;return(e=b.useContext(Z8))!=null?e:eU};b.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:a,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let u=i==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,f=a?AN.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(v,m=!1,g=!0)=>{let y=o?o[v]:v,x=m?v+"|| ''":`'${y}'`,w="";return a&&g&&!m&&AN.includes(v)&&(w+=`d.style.colorScheme = '${v}';`),r==="class"?m||y?w+=`c.add(${x})`:w+="null":y&&(w+=`d[s](n,${x})`),w},p=e?`!function(){${d}${h(e)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${J8}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}
67${u?"":"else{"+h(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(i,!1,!1)};}${f}}catch(t){}}();`;return b.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:p}})});var rU=e=>{switch(e){case"success":return iU;case"info":return oU;case"warning":return sU;case"error":return lU;default:return null}},nU=Array(12).fill(0),aU=({visible:e,className:t})=>C.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},C.createElement("div",{className:"sonner-spinner"},nU.map((r,n)=>C.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),iU=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),sU=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),oU=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),lU=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},C.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),cU=C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},C.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),C.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),uU=()=>{let[e,t]=C.useState(document.hidden);return C.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},L0=1,dU=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:L0++,i=this.toasts.find(l=>l.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...e,id:a,title:r}),{...l,...e,id:a,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
67this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),a=r!==void 0,i,o=n.then(async c=>{if(i=["resolve",c],C.isValidElement(c))a=!1,this.create({id:r,type:"default",message:c});else if(hU(c)&&!c.ok){a=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:r,type:"error",message:u,description:d})}else if(t.success!==void 0){a=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"success",message:u,description:d})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){a=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:r,type:"error",message:u,description:d})}}).finally(()=>{var c;a&&(this.dismiss(r),r=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>i[0]==="reject"?u(i[1]):c(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||L0++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Tr=new dU,fU=(e,t)=>{let r=(t==null?void 0:t.id)||L0++;return Tr.addToast({title:e,...t,id:r}),r},hU=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",pU=fU,mU=()=>Tr.toasts,gU=()=>Tr.getActiveToasts(),X=Object.assign(pU,{success:Tr.success,info:Tr.info,warning:Tr.warning,error:Tr.error,custom:Tr.custom,message:Tr.message,promise:Tr.promise,dismiss:Tr.dismiss,loading:Tr.loading},{getHistory:mU,getToasts:gU});function vU(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}vU(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
67left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
67:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
67--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
68`);function bh(e){return e.label!==void 0}var yU=3,xU="32px",bU="16px",TN=4e3,wU=356,jU=14,SU=20,_U=200;function $n(...e){return e.filter(Boolean).join(" ")}function NU(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var kU=e=>{var t,r,n,a,i,o,l,c,u,d,f;let{invert:h,toast:p,unstyled:v,interacting:m,setHeights:g,visibleToasts:y,heights:x,index:w,toasts:S,expanded:j,removeToast:_,defaultRichColors:N,closeButton:k,style:O,cancelButtonStyle:E,actionButtonStyle:A,className:R="",descriptionClassName:T="",duration:I,position:F,gap:P,loadingIcon:D,expandByDefault:M,classNames:$,icons:z,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:q}=e,[B,Z]=C.useState(null),[he,pe]=C.useState(null),[Q,me]=C.useState(!1),[L,Y]=C.useState(!1),[J,U]=C.useState(!1),[ge,ve]=C.useState(!1),[Ne,Re]=C.useState(!1),[it,Xe]=C.useState(0),[Qe,cn]=C.useState(0),Xt=C.useRef(p.duration||I||TN),xr=C.useRef(null),st=C.useRef(null),vs=w===0,Jf=w+1<=y,un=p.type,Eo=p.dismissible!==!1,z5=p.className||"",q5=p.descriptionClassName||"",Zf=C.useMemo(()=>x.findIndex(Ce=>Ce.toastId===p.id)||0,[x,p.id]),W5=C.useMemo(()=>{var Ce;return(Ce=p.closeButton)!=null?Ce:k},[p.closeButton,k]),a_=C.useMemo(()=>p.duration||I||TN,[p.duration,I]),oy=C.useRef(0),Po=C.useRef(0),i_=C.useRef(0),Ao=C.useRef(null),[H5,V5]=F.split("-"),s_=C.useMemo(()=>x.reduce((Ce,Ge,ht)=>ht>=Zf?Ce:Ce+Ge.height,0),[x,Zf]),o_=uU(),K5=p.invert||h,ly=un==="loading";Po.current=C.useMemo(()=>Zf*P+s_,[Zf,s_]),C.useEffect(()=>{Xt.current=a_},[a_]),C.useEffect(()=>{me(!0)},[]),C.useEffect(()=>{let Ce=st.current;if(Ce){let Ge=Ce.getBoundingClientRect().height;return cn(Ge),g(ht=>[{toastId:p.id,height:Ge,position:p.position},...ht]),()=>g(ht=>ht.filter(En=>En.toastId!==p.id))}},[g,p.id]),C.useLayoutEffect(()=>{if(!Q)return;let Ce=st.current,Ge=Ce.style.height;Ce.style.height="auto";let ht=Ce.getBoundingClientRect().height;Ce.style.height=Ge,cn(ht),g(En=>En.find(Pn=>Pn.toastId===p.id)?En.map(Pn=>Pn.toastId===p.id?{...Pn,height:ht}:Pn):[{toastId:p.id,height:ht,position:p.position},...En])},[Q,p.title,p.description,g,p.id]);let mi=C.useCallback(()=>{Y(!0),Xe(Po.current),g(Ce=>Ce.filter(Ge=>Ge.toastId!==p.id)),setTimeout(()=>{_(p)},_U)},[p,_,g,Po]);C.useEffect(()=>{if(p.promise&&un==="loading"||p.duration===1/0||p.type==="loading")return;let Ce;return j||m||q&&o_?(()=>{if(i_.current<oy.current){let Ge=new Date().getTime()-oy.current;Xt.current=Xt.current-Ge}
68i_.current=new Date().getTime()})():Xt.current!==1/0&&(oy.current=new Date().getTime(),Ce=setTimeout(()=>{var Ge;(Ge=p.onAutoClose)==null||Ge.call(p,p),mi()},Xt.current)),()=>clearTimeout(Ce)},[j,m,p,un,q,o_,mi]),C.useEffect(()=>{p.delete&&mi()},[mi,p.delete]);function G5(){var Ce,Ge,ht;return z!=null&&z.loading?C.createElement("div",{className:$n($==null?void 0:$.loader,(Ce=p==null?void 0:p.classNames)==null?void 0:Ce.loader,"sonner-loader"),"data-visible":un==="loading"},z.loading):D?C.createElement("div",{className:$n($==null?void 0:$.loader,(Ge=p==null?void 0:p.classNames)==null?void 0:Ge.loader,"sonner-loader"),"data-visible":un==="loading"},D):C.createElement(aU,{className:$n($==null?void 0:$.loader,(ht=p==null?void 0:p.classNames)==null?void 0:ht.loader),visible:un==="loading"})}return C.createElement("li",{tabIndex:0,ref:st,className:$n(R,z5,$==null?void 0:$.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,$==null?void 0:$.default,$==null?void 0:$[un],(r=p==null?void 0:p.classNames)==null?void 0:r[un]),"data-sonner-toast":"","data-rich-colors":(n=p.richColors)!=null?n:N,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":Q,"data-promise":!!p.promise,"data-swiped":Ne,"data-removed":L,"data-visible":Jf,"data-y-position":H5,"data-x-position":V5,"data-index":w,"data-front":vs,"data-swiping":J,"data-dismissible":Eo,"data-type":un,"data-invert":K5,"data-swipe-out":ge,"data-swipe-direction":he,"data-expanded":!!(j||M&&Q),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${L?it:Po.current}px`,"--initial-height":M?"auto":`${Qe}px`,...O,...p.style},onDragEnd:()=>{U(!1),Z(null),Ao.current=null},onPointerDown:Ce=>{ly||!Eo||(xr.current=new Date,Xe(Po.current),Ce.target.setPointerCapture(Ce.pointerId),Ce.target.tagName!=="BUTTON"&&(U(!0),Ao.current={x:Ce.clientX,y:Ce.clientY}))},onPointerUp:()=>{var Ce,Ge,ht,En;if(ge||!Eo)return;Ao.current=null;let Pn=Number(((Ce=st.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),gi=Number(((Ge=st.current)==null?void 0:Ge.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ys=new Date().getTime()-((ht=xr.current)==null?void 0:ht.getTime()),An=B==="x"?Pn:gi,vi=Math.abs(An)/ys;if(Math.abs(An)>=SU||vi>.11){Xe(Po.current),(En=p.onDismiss)==null||En.call(p,p),pe(B==="x"?Pn>0?"right":"left":gi>0?"down":"up"),mi(),ve(!0),Re(!1);return}U(!1),Z(null)},onPointerMove:Ce=>{var Ge,ht,En,Pn;if(!Ao.current||!Eo||((Ge=window.getSelection())==null?void 0:Ge.toString().length)>0)return;let gi=Ce.clientY-Ao.current.y,ys=Ce.clientX-Ao.current.x,An=(ht=e.swipeDirections)!=null?ht:NU(F);!B&&(Math.abs(ys)>1||Math.abs(gi)>1)&&Z(Math.abs(ys)>Math.abs(gi)?"x":"y");let vi={x:0,y:0};B==="y"?(An.includes("top")||An.includes("bottom"))&&(An.includes("top")&&gi<0||An.includes("bottom")&&gi>0)&&(vi.y=gi):B==="x"&&(An.includes("left")||An.includes("right"))&&(An.includes("left")&&ys<0||An.includes("right")&&ys>0)&&(vi.x=ys),(Math.abs(vi.x)>0||Math.abs(vi.y)>0)&&Re(!0),(En=st.current)==null||En.style.setProperty("--swipe-amount-x",`${vi.x}px`),(Pn=st.current)==null||Pn.style.setProperty("--swipe-amount-y",`${vi.y}px`)}},W5&&!p.jsx?C.createElement("button",{"aria-label":K,"data-disabled":ly,"data-close-button":!0,onClick:ly||!Eo?()=>{}:()=>{var Ce;mi(),(Ce=p.onDismiss)==null||Ce.call(p,p)},className:$n($==null?void 0:$.closeButton,(a=p==null?void 0:p.classNames)==null?void 0:a.closeButton)},(i=z==null?void 0:z.close)!=null?i:cU):null,p.jsx||b.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:C.createElement(C.Fragment,null,un||p.icon||p.promise?C.createElement("div",{"data-icon":"",className:$n($==null?void 0:$.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||G5():null,p.type!=="loading"?p.icon||(z==null?void 0:z[un])||rU(un):null):null,C.createElement("div",{"data-content":"",className:$n($==null?void 0:$.content,(l=p==null?void 0:p.classNames)==null?void 0:l.content)},C.createElement("div",{"data-title":"",className:$n($==null?void 0:$.title,(c=p==null?void 0:p.classNames)==null?void 0:c.title)},typeof p.title=="function"?p.title():p.title),p.description?C.createElement("div",{"data-description":"",className:$n(T,q5,$==null?void 0:$.description,(u=p==null?void 0:p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),b.isValidElement(p.cancel)?p.cancel:p.cancel&&bh(p.cancel)?C.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||E,onClick:Ce=>{var Ge,ht;bh(p.cancel)&&Eo&&((ht=(Ge=p.cancel).onClick)==null||ht.call(Ge,Ce),mi())},className:$n($==null?void 0:$.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,b.isValidElement(p.action)?p.action:p.action&&bh(p.action)?C.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||A,onClick:Ce=>{var Ge,ht;bh(p.action)&&((ht=(Ge=p.action).onClick)==null||ht.call(Ge,Ce),!Ce.defaultPrevented&&mi())},className:$n($==null?void 0:$.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function $N(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function OU(e,t){let r={};return[e,t].forEach((n,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",l=i?bU:xU;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${o}-${u}`]=l:r[`${o}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}var CU=b.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:h,style:p,visibleToasts:v=yU,toastOptions:m,dir:g=$N(),gap:y=jU,loadingIcon:x,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:j}=e,[_,N]=C.useState([]),k=C.useMemo(()=>Array.from(new Set([n].concat(_.filter(q=>q.position).map(q=>q.position)))),[_,n]),[O,E]=C.useState([]),[A,R]=C.useState(!1),[T,I]=C.useState(!1),[F,P]=C.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
68k":"light"),D=C.useRef(null),M=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=C.useRef(null),z=C.useRef(!1),K=C.useCallback(q=>{N(B=>{var Z;return(Z=B.find(he=>he.id===q.id))!=null&&Z.delete||Tr.dismiss(q.id),B.filter(({id:he})=>he!==q.id)})},[]);return C.useEffect(()=>Tr.subscribe(q=>{if(q.dismiss){N(B=>B.map(Z=>Z.id===q.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{ST.flushSync(()=>{N(B=>{let Z=B.findIndex(he=>he.id===q.id);return Z!==-1?[...B.slice(0,Z),{...B[Z],...q},...B.slice(Z+1)]:[q,...B]})})})}),[]),C.useEffect(()=>{if(d!=="system"){P(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?P("dark"):P("light")),typeof window>"u")return;let q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:B})=>{P(B?"dark":"light")})}catch{q.addListener(({matches:Z})=>{try{P(Z?"dark":"light")}catch(he){console.error(he)}})}},[d]),C.useEffect(()=>{_.length<=1&&R(!1)},[_]),C.useEffect(()=>{let q=B=>{var Z,he;a.every(pe=>B[pe]||B.code===pe)&&(R(!0),(Z=D.current)==null||Z.focus()),B.code==="Escape"&&(document.activeElement===D.current||(he=D.current)!=null&&he.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[a]),C.useEffect(()=>{if(D.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,z.current=!1)}},[D.current]),C.createElement("section",{ref:t,"aria-label":`${S} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((q,B)=>{var Z;let[he,pe]=q.split("-");return _.length?C.createElement("ol",{key:q,dir:g==="auto"?$N():g,tabIndex:-1,ref:D,className:l,"data-sonner-toaster":!0,"data-theme":F,"data-y-position":he,"data-lifted":A&&_.length>1&&!i,"data-x-position":pe,style:{"--front-toast-height":`${((Z=O[0])==null?void 0:Z.height)||0}px`,"--width":`${wU}px`,"--gap":`${y}px`,...p,...OU(c,u)},onBlur:Q=>{z.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(z.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||z.current||(z.current=!0,$.current=Q.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{T||R(!1)},onDragEnd:()=>R(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},_.filter(Q=>!Q.position&&B===0||Q.position===q).map((Q,me)=>{var L,Y;return C.createElement(kU,{key:Q.id,icons:w,index:me,toast:Q,defaultRichColors:f,duration:(L=m==null?void 0:m.duration)!=null?L:h,className:m==null?void 0:m.className,descriptionClassName:m==null?void 0:m.descriptionClassName,invert:r,visibleToasts:v,closeButton:(Y=m==null?void 0:m.closeButton)!=null?Y:o,interacting:T,position:q,style:m==null?void 0:m.style,unstyled:m==null?void 0:m.unstyled,classNames:m==null?void 0:m.classNames,cancelButtonStyle:m==null?void 0:m.cancelButtonStyle,actionButtonStyle:m==null?void 0:m.actionButtonStyle,removeToast:K,toasts:_.filter(J=>J.position==Q.position),heights:O.filter(J=>J.position==Q.position),setHeights:E,expandByDefault:i,gap:y,loadingIcon:x,expanded:A,pauseWhenPageIsHidden:j,swipeDirections:e.swipeDirections})})):null}))});const EU=({...e})=>{const{theme:t="system"}=tU();return s.jsx(CU,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},PU=1,AU=1e6;let Ly=0;function TU(){return Ly=(Ly+1)%Number.MAX_SAFE_INTEGER,Ly.toString()}const Fy=new Map,RN=e=>{if(Fy.has(e))return;const t=setTimeout(()=>{Fy.delete(e),Hu({type:"REMOVE_TOAST",toastId:e})},AU);Fy.set(e,t)},$U=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,PU)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;
68return r?RN(r):e.toasts.forEach(n=>{RN(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},cp=[];let up={toasts:[]};function Hu(e){up=$U(up,e),cp.forEach(t=>{t(up)})}function RU({...e}){const t=TU(),r=a=>Hu({type:"UPDATE_TOAST",toast:{...a,id:t}}),n=()=>Hu({type:"DISMISS_TOAST",toastId:t});return Hu({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||n()}}}),{id:t,dismiss:n,update:r}}function MU(){const[e,t]=b.useState(up);return b.useEffect(()=>(cp.push(t),()=>{const r=cp.indexOf(t);r>-1&&cp.splice(r,1)}),[e]),{...e,toast:RU,dismiss:r=>Hu({type:"DISMISS_TOAST",toastId:r})}}function oe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function MN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Tg(...e){return t=>{let r=!1;const n=e.map(a=>{const i=MN(a,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():MN(e[a],null)}}}}function Me(...e){return b.useCallback(Tg(...e),e)}function IU(e,t){const r=b.createContext(t),n=i=>{const{children:o,...l}=i,c=b.useMemo(()=>l,Object.values(l));return s.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function a(i){const o=b.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,a]}function Br(e,t=[]){let r=[];function n(i,o){const l=b.createContext(o),c=r.length;r=[...r,o];const u=f=>{var y;const{scope:h,children:p,...v}=f,m=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,g=b.useMemo(()=>v,Object.values(v));return s.jsx(m.Provider,{value:g,children:p})};u.displayName=i+"Provider";function d(f,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[c])||l,v=b.useContext(p);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const a=()=>{const i=r.map(o=>b.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return b.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,DU(a,...t)]}function DU(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...l,...f}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function io(e){const t=LU(e),r=b.forwardRef((n,a)=>{const{children:i,...o}=n,l=b.Children.toArray(i),c=l.find(BU);if(c){const u=c.props.children,d=l.map(f=>f===c?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:f);return s.jsx(t,{...o,ref:a,children:b.isValidElement(u)?b.cloneElement(u,void 0,d):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}var Tc=io("Slot");function LU(e){const t=b.forwardRef((r,n)=>{const{children:a,...i}=r;if(b.isValidElement(a)){const o=zU(a),l=UU(i,a.props);return a.type!==b.Fragment&&(l.ref=n?Tg(n,o):o),b.cloneElement(a,l)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var WT=Symbol("radix.slottable");function FU(e){const t=({children:r})=>s.jsx(s.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=WT,t}function BU(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===WT}function UU(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function zU(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Tf(e){const t=e+"CollectionProvider",[r,n]=Br(t),[a,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:g,children:y}=m,x=C.useRef(null),w=C.useRef(new Map).current;return s.jsx(a,{scope:g,itemMap:w,collectionRef:x,children:y})};o.displayName=t;const l=e+"CollectionSlot",c=io(l),u=C.forwardRef((m,g)=>{const{scope:y,children:x}=m,w=i(l,y),S=Me(g,w.collectionRef);return s.jsx(c,{ref:S,children:x})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=io(d),p=C.forwardRef((m,g)=>{const{scope:y,children:x,...w}=m,S=C.useRef(null),j=Me(g,S),_=i(d,y);return C.useEffect(()=>(_.itemMap.set(S,{ref:S,...w}),()=>void _.itemMap.delete(S))),s.jsx(h,{[f]:"",ref:j,children:x})});p.displayName=d;function v(m){const g=i(e+"CollectionConsumer",m);return C.useCallback(()=>{const x=g.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${f}]`));
vendor: 8,792 bytes, line 68
68return Array.from(g.itemMap.values()).sort((_,N)=>w.indexOf(_.ref.current)-w.indexOf(N.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:u,ItemSlot:p},v,n]}var qU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ye=qU.reduce((e,t)=>{const r=io(`Primitive.${t}`),n=b.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function K1(e,t){e&&wo.flushSync(()=>e.dispatchEvent(t))}function Fr(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function WU(e,t=globalThis==null?void 0:globalThis.document){const r=Fr(e);b.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var HU="DismissableLayer",F0="dismissableLayer.update",VU="dismissableLayer.pointerDownOutside",KU="dismissableLayer.focusOutside",IN,HT=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$c=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=b.useContext(HT),[d,f]=b.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=b.useState({}),v=Me(t,N=>f(N)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),x=d?m.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=x>=y,j=YU(N=>{const k=N.target,O=[...u.branches].some(E=>E.contains(k));!S||O||(a==null||a(N),o==null||o(N),N.defaultPrevented||l==null||l())},h),_=XU(N=>{const k=N.target;[...u.branches].some(E=>E.contains(k))||(i==null||i(N),o==null||o(N),N.defaultPrevented||l==null||l())},h);return WU(N=>{x===u.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&l&&(N.preventDefault(),l()))},h),b.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(IN=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),DN(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=IN)}},[d,h,r,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),DN())},[d,u]),b.useEffect(()=>{const N=()=>p({});return document.addEventListener(F0,N),()=>document.removeEventListener(F0,N)},[]),s.jsx(ye.div,{...c,ref:v,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:oe(e.onFocusCapture,_.onFocusCapture),onBlurCapture:oe(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:oe(e.onPointerDownCapture,j.onPointerDownCapture)})});$c.displayName=HU;var GU="DismissableLayerBranch",VT=b.forwardRef((e,t)=>{const r=b.useContext(HT),n=b.useRef(null),a=Me(t,n);return b.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),s.jsx(ye.div,{...e,ref:a})});VT.displayName=GU;function YU(e,t=globalThis==null?void 0:globalThis.document){const r=Fr(e),n=b.useRef(!1),a=b.useRef(()=>{});return b.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){KT(VU,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function XU(e,t=globalThis==null?void 0:globalThis.document){const r=Fr(e),n=b.useRef(!1);return b.useEffect(()=>{const a=i=>{i.target&&!n.current&&KT(KU,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function DN(){const e=new CustomEvent(F0);document.dispatchEvent(e)}function KT(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?K1(a,i):a.dispatchEvent(i)}var QU=$c,JU=VT,Gt=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},ZU="Portal",$f=b.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[a,i]=b.useState(!1);Gt(()=>i(!0),[]);const o=r||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?ST.createPortal(s.jsx(ye.div,{...n,ref:t}),o):null});$f.displayName=ZU;function ez(e,t){return b.useReducer((r,n)=>t[r][n]??r,e)}var ln=e=>{const{present:t,children:r}=e,n=tz(t),a=typeof r=="function"?r({present:n.isPresent}):b.Children.only(r),i=Me(n.ref,rz(a));return typeof r=="function"||n.isPresent?b.cloneElement(a,{ref:i}):null};ln.displayName="Presence";function tz(e){const[t,r]=b.useState(),n=b.useRef(null),a=b.useRef(e),i=b.useRef("none"),o=e?"mounted":"unmounted",[l,c]=ez(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=wh(n.current);i.current=l==="mounted"?u:"none"},[l]),Gt(()=>{const u=n.current,d=a.current;if(d!==e){const h=i.current,p=wh(u);e?c("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),Gt(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=p=>{const m=wh(n.current).includes(p.animationName);if(p.target===t&&m&&(c("ANIMATION_END"),!a.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=p=>{p.target===t&&(i.current=wh(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:b.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function wh(e){return(e==null?void 0:e.animationName)||"none"}function rz(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var nz=Jw[" useInsertionEffect ".trim().toString()]||Gt;function nn({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,i,o]=az({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:a;{const d=b.useRef(e!==void 0);b.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,n])}const u=b.useCallback(d=>{var f;if(l){const h=iz(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else i(d)},[l,e,i,o]);return[c,u]}function az({defaultProp:e,onChange:t}){const[r,n]=b.useState(e),a=b.useRef(r),i=b.useRef(t);return nz(()=>{i.current=t},[t]),b.useEffect(()=>{var o;a.current!==r&&((o=i.current)==null||o.call(i,r),a.current=r)},[r,a]),[r,n,i]}function iz(e){return typeof e=="function"}var GT=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sz="VisuallyHidden",$g=b.forwardRef((e,t)=>s.jsx(ye.span,{...e,ref:t,style:{...GT,...e.style}}));$g.displayName=sz;var oz=$g,G1="ToastProvider",[Y1,lz,cz]=Tf("Toast"),[YT,WNe]=Br("Toast",[cz]),[uz,Rg]=YT(G1),XT=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[l,c]=b.useState(null),[u,d]=b.useState(0),f=b.useRef(!1),h=b.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${G1}\`. Expected non-empty \`string\`.`),s.jsx(Y1.Provider,{scope:t,children:s.jsx(uz,{scope:t,label:r,duration:n,swipeDirection:a,swipeThreshold:i,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:b.useCallback(()=>d(p=>p+1),[]),onToastRemove:b.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:o})})};
68XT.displayName=G1;var QT="ToastViewport",dz=["F8"],B0="toast.viewportPause",U0="toast.viewportResume",JT=b.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=dz,label:a="Notifications ({hotkey})",...i}=e,o=Rg(QT,r),l=lz(r),c=b.useRef(null),u=b.useRef(null),d=b.useRef(null),f=b.useRef(null),h=Me(t,f,o.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=o.toastCount>0;b.useEffect(()=>{const g=y=>{var w;n.length!==0&&n.every(S=>y[S]||y.code===S)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),b.useEffect(()=>{const g=c.current,y=f.current;if(v&&g&&y){const x=()=>{if(!o.isClosePausedRef.current){const _=new CustomEvent(B0);y.dispatchEvent(_),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const _=new CustomEvent(U0);y.dispatchEvent(_),o.isClosePausedRef.current=!1}},S=_=>{!g.contains(_.relatedTarget)&&w()},j=()=>{g.contains(document.activeElement)||w()};return g.addEventListener("focusin",x),g.addEventListener("focusout",S),g.addEventListener("pointermove",x),g.addEventListener("pointerleave",j),window.addEventListener("blur",x),window.addEventListener("focus",w),()=>{g.removeEventListener("focusin",x),g.removeEventListener("focusout",S),g.removeEventListener("pointermove",x),g.removeEventListener("pointerleave",j),window.removeEventListener("blur",x),window.removeEventListener("focus",w)}}},[v,o.isClosePausedRef]);const m=b.useCallback(({tabbingDirection:g})=>{const x=l().map(w=>{const S=w.ref.current,j=[S,..._z(S)];return g==="forwards"?j:j.reverse()});return(g==="forwards"?x.reverse():x).flat()},[l]);return b.useEffect(()=>{const g=f.current;if(g){const y=x=>{var j,_,N;const w=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!w){const k=document.activeElement,O=x.shiftKey;if(x.target===g&&O){(j=u.current)==null||j.focus();return}const R=m({tabbingDirection:O?"backwards":"forwards"}),T=R.findIndex(I=>I===k);By(R.slice(T+1))?x.preventDefault():O?(_=u.current)==null||_.focus():(N=d.current)==null||N.focus()}};return g.addEventListener("keydown",y),()=>g.removeEventListener("keydown",y)}},[l,m]),s.jsxs(JU,{ref:c,role:"region","aria-label":a.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&s.jsx(z0,{ref:u,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"forwards"});By(g)}}),s.jsx(Y1.Slot,{scope:r,children:s.jsx(ye.ol,{tabIndex:-1,...i,ref:h})}),v&&s.jsx(z0,{ref:d,onFocusFromOutsideViewport:()=>{const g=m({tabbingDirection:"backwards"});By(g)}})]})});JT.displayName=QT;var ZT="ToastFocusProxy",z0=b.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...a}=e,i=Rg(ZT,r);return s.jsx($g,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(l))&&n()}})});z0.displayName=ZT;var Rf="Toast",fz="toast.swipeStart",hz="toast.swipeMove",pz="toast.swipeCancel",mz="toast.swipeEnd",e$=b.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:a,onOpenChange:i,...o}=e,[l,c]=nn({prop:n,defaultProp:a??!0,onChange:i,caller:Rf});return s.jsx(ln,{present:r||l,children:s.jsx(yz,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:Fr(e.onPause),onResume:Fr(e.onResume),onSwipeStart:oe(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:oe(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:oe(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:oe(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});e$.displayName=Rf;var[gz,vz]=YT(Rf,{onClose(){}}),yz=b.forwardRef((e,t)=>
68{const{__scopeToast:r,type:n="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:p,...v}=e,m=Rg(Rf,r),[g,y]=b.useState(null),x=Me(t,I=>y(I)),w=b.useRef(null),S=b.useRef(null),j=a||m.duration,_=b.useRef(0),N=b.useRef(j),k=b.useRef(0),{onToastAdd:O,onToastRemove:E}=m,A=Fr(()=>{var F;(g==null?void 0:g.contains(document.activeElement))&&((F=m.viewport)==null||F.focus()),o()}),R=b.useCallback(I=>{!I||I===1/0||(window.clearTimeout(k.current),_.current=new Date().getTime(),k.current=window.setTimeout(A,I))},[A]);b.useEffect(()=>{const I=m.viewport;if(I){const F=()=>{R(N.current),u==null||u()},P=()=>{const D=new Date().getTime()-_.current;N.current=N.current-D,window.clearTimeout(k.current),c==null||c()};return I.addEventListener(B0,P),I.addEventListener(U0,F),()=>{I.removeEventListener(B0,P),I.removeEventListener(U0,F)}}},[m.viewport,j,c,u,R]),b.useEffect(()=>{i&&!m.isClosePausedRef.current&&R(j)},[i,j,m.isClosePausedRef,R]),b.useEffect(()=>(O(),()=>E()),[O,E]);const T=b.useMemo(()=>g?o$(g):null,[g]);return m.viewport?s.jsxs(s.Fragment,{children:[T&&s.jsx(xz,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:T}),s.jsx(gz,{scope:r,onClose:A,children:wo.createPortal(s.jsx(Y1.ItemSlot,{scope:r,children:s.jsx(QU,{asChild:!0,onEscapeKeyDown:oe(l,()=>{m.isFocusedToastEscapeKeyDownRef.current||A(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(ye.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...v,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:oe(e.onKeyDown,I=>{I.key==="Escape"&&(l==null||l(I.nativeEvent),I.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,A()))}),onPointerDown:oe(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:oe(e.onPointerMove,I=>{if(!w.current)return;const F=I.clientX-w.current.x,P=I.clientY-w.current.y,D=!!S.current,M=["left","right"].includes(m.swipeDirection),$=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,z=M?$(0,F):0,K=M?0:$(0,P),q=I.pointerType==="touch"?10:2,B={x:z,y:K},Z={originalEvent:I,delta:B};D?(S.current=B,jh(hz,f,Z,{discrete:!1})):LN(B,m.swipeDirection,q)?(S.current=B,jh(fz,d,Z,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(F)>q||Math.abs(P)>q)&&(w.current=null)}),onPointerUp:oe(e.onPointerUp,I=>{const F=S.current,P=I.target;if(P.hasPointerCapture(I.pointerId)&&P.releasePointerCapture(I.pointerId),S.current=null,w.current=null,F){const D=I.currentTarget,M={originalEvent:I,delta:F};LN(F,m.swipeDirection,m.swipeThreshold)?jh(mz,p,M,{discrete:!0}):jh(pz,h,M,{discrete:!0}),D.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),xz=e=>{const{__scopeToast:t,children:r,...n}=e,a=Rg(Rf,t),[i,o]=b.useState(!1),[l,c]=b.useState(!1);return jz(()=>o(!0)),b.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:s.jsx($f,{asChild:!0,children:s.jsx($g,{...n,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",r]})})})},bz="ToastTitle",t$=b.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return s.jsx(ye.div,{...n,ref:t})});t$.displayName=bz;var wz="ToastDescription",r$=b.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return s.jsx(ye.div,{...n,ref:t})});r$.displayName=wz;var n$="ToastAction",a$=b.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?s.jsx(s$,{altText:r,asChild:!0,children:s.jsx(X1,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${n$}\`. Expected non-empty \`string\`.`),null)});a$.displayName=n$;var i$="ToastClose",X1=b.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,a=vz(i$,r);return s.jsx(s$,{asChild:!0,children:s.jsx(ye.button,{type:"button",...n,ref:t,onClick:oe(e.onClick,a.onClose)})})});X1.displayName=i$;var s$=b.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...a}=e;return s.jsx(ye.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:t})});function o$(e){const t=[];
vendor: 9,865 bytes, lines 68-187
68return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),Sz(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...o$(n))}}),t}function jh(e,t,r,{discrete:n}){const a=r.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?K1(a,i):a.dispatchEvent(i)}var LN=(e,t,r=0)=>{const n=Math.abs(e.x),a=Math.abs(e.y),i=n>a;return t==="left"||t==="right"?i&&n>r:!i&&a>r};function jz(e=()=>{}){const t=Fr(e);Gt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function Sz(e){return e.nodeType===e.ELEMENT_NODE}function _z(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function By(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Nz=XT,l$=JT,c$=e$,u$=t$,d$=r$,f$=a$,h$=X1;function p$(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=p$(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Te(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=p$(e))&&(n&&(n+=" "),n+=t);return n}const FN=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,BN=Te,Rc=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return BN(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(u=>{const d=r==null?void 0:r[u],f=i==null?void 0:i[u];if(d===null)return null;const h=FN(d)||FN(f);return a[u][h]}),l=r&&Object.entries(r).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(v=>{let[m,g]=v;return Array.isArray(g)?g.includes({...i,...l}[m]):{...i,...l}[m]===g})?[...u,f,h]:u},[]);return BN(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
69 * @license lucide-react v0.462.0 - ISC
70 *
71 * This source code is licensed under the ISC license.
72 * See the LICENSE file in the root directory of this source tree.
73 */const kz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m$=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
74 * @license lucide-react v0.462.0 - ISC
75 *
76 * This source code is licensed under the ISC license.
77 * See the LICENSE file in the root directory of this source tree.
78 */var Oz={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"};/**
79 * @license lucide-react v0.462.0 - ISC
80 *
81 * This source code is licensed under the ISC license.
82 * See the LICENSE file in the root directory of this source tree.
83 */const Cz=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...l},c)=>b.createElement("svg",{ref:c,...Oz,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:m$("lucide",a),...l},[...o.map(([u,d])=>b.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
84 * @license lucide-react v0.462.0 - ISC
85 *
86 * This source code is licensed under the ISC license.
87 * See the LICENSE file in the root directory of this source tree.
88 */const ie=(e,t)=>{const r=b.forwardRef(({className:n,...a},i)=>b.createElement(Cz,{ref:i,iconNode:t,className:m$(`lucide-${kz(e)}`,n),...a}));return r.displayName=`${e}`,r};/**
89 * @license lucide-react v0.462.0 - ISC
90 *
91 * This source code is licensed under the ISC license.
92 * See the LICENSE file in the root directory of this source tree.
93 */const Ez=ie("ArrowDownRight",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);/**
94 * @license lucide-react v0.462.0 - ISC
95 *
96 * This source code is licensed under the ISC license.
97 * See the LICENSE file in the root directory of this source tree.
98 */const Mc=ie("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
99 * @license lucide-react v0.462.0 - ISC
100 *
101 * This source code is licensed under the ISC license.
102 * See the LICENSE file in the root directory of this source tree.
103 */const Pz=ie("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
104 * @license lucide-react v0.462.0 - ISC
105 *
106 * This source code is licensed under the ISC license.
107 * See the LICENSE file in the root directory of this source tree.
108 */const Az=ie("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
109 * @license lucide-react v0.462.0 - ISC
110 *
111 * This source code is licensed under the ISC license.
112 * See the LICENSE file in the root directory of this source tree.
113 */const UN=ie("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
114 * @license lucide-react v0.462.0 - ISC
115 *
116 * This source code is licensed under the ISC license.
117 * See the LICENSE file in the root directory of this source tree.
118 */const Tz=ie("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
119 * @license lucide-react v0.462.0 - ISC
120 *
121 * This source code is licensed under the ISC license.
122 * See the LICENSE file in the root directory of this source tree.
123 */const $z=ie("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
124 * @license lucide-react v0.462.0 - ISC
125 *
126 * This source code is licensed under the ISC license.
127 * See the LICENSE file in the root directory of this source tree.
128 */const Yp=ie("ChartColumn",[["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"}]]);/**
129 * @license lucide-react v0.462.0 - ISC
130 *
131 * This source code is licensed under the ISC license.
132 * See the LICENSE file in the root directory of this source tree.
133 */const Ql=ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
134 * @license lucide-react v0.462.0 - ISC
135 *
136 * This source code is licensed under the ISC license.
137 * See the LICENSE file in the root directory of this source tree.
138 */const Rz=ie("ChefHat",[["path",{d:"M17 21a1 1 0 0 0 1-1v-5.35c0-.457.316-.844.727-1.041a4 4 0 0 0-2.134-7.589 5 5 0 0 0-9.186 0 4 4 0 0 0-2.134 7.588c.411.198.727.585.727 1.041V20a1 1 0 0 0 1 1Z",key:"1qvrer"}],["path",{d:"M6 17h12",key:"1jwigz"}]]);/**
139 * @license lucide-react v0.462.0 - ISC
140 *
141 * This source code is licensed under the ISC license.
142 * See the LICENSE file in the root directory of this source tree.
143 */const Q1=ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
144 * @license lucide-react v0.462.0 - ISC
145 *
146 * This source code is licensed under the ISC license.
147 * See the LICENSE file in the root directory of this source tree.
148 */const Mz=ie("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
149 * @license lucide-react v0.462.0 - ISC
150 *
151 * This source code is licensed under the ISC license.
152 * See the LICENSE file in the root directory of this source tree.
153 */const J1=ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
154 * @license lucide-react v0.462.0 - ISC
155 *
156 * This source code is licensed under the ISC license.
157 * See the LICENSE file in the root directory of this source tree.
158 */const Iz=ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
159 * @license lucide-react v0.462.0 - ISC
160 *
161 * This source code is licensed under the ISC license.
162 * See the LICENSE file in the root directory of this source tree.
163 */const zN=ie("CircleAlert",[["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"}]]);/**
164 * @license lucide-react v0.462.0 - ISC
165 *
166 * This source code is licensed under the ISC license.
167 * See the LICENSE file in the root directory of this source tree.
168 */const q0=ie("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
169 * @license lucide-react v0.462.0 - ISC
170 *
171 * This source code is licensed under the ISC license.
172 * See the LICENSE file in the root directory of this source tree.
173 */const Nd=ie("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
174 * @license lucide-react v0.462.0 - ISC
175 *
176 * This source code is licensed under the ISC license.
177 * See the LICENSE file in the root directory of this source tree.
178 */const Vu=ie("CircleX",[["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"}]]);/**
179 * @license lucide-react v0.462.0 - ISC
180 *
181 * This source code is licensed under the ISC license.
182 * See the LICENSE file in the root directory of this source tree.
183 */const Dz=ie("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
184 * @license lucide-react v0.462.0 - ISC
185 *
186 * This source code is licensed under the ISC license.
187 * See the LICENSE file in the root directory of this source tree.
188 */const g$=ie("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
189 * @license lucide-react v0.462.0 - ISC
190 *
191 * This source code is licensed under the ISC license.
192 * See the LICENSE file in the root directory of this source tree.
193 */const ei=ie("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
194 * @license lucide-react v0.462.0 - ISC
195 *
196 * This source code is licensed under the ISC license.
197 * See the LICENSE file in the root directory of this source tree.
198 */const Lz=ie("DollarSign",[["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"}]]);/**
199 * @license lucide-react v0.462.0 - ISC
200 *
201 * This source code is licensed under the ISC license.
202 * See the LICENSE file in the root directory of this source tree.
203 */const W0=ie("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
204 * @license lucide-react v0.462.0 - ISC
205 *
206 * This source code is licensed under the ISC license.
207 * See the LICENSE file in the root directory of this source tree.
208 */const Uy=ie("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
209 * @license lucide-react v0.462.0 - ISC
210 *
211 * This source code is licensed under the ISC license.
212 * See the LICENSE file in the root directory of this source tree.
213 */const v$=ie("ExternalLink",[["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"}]]);/**
214 * @license lucide-react v0.462.0 - ISC
215 *
216 * This source code is licensed under the ISC license.
217 * See the LICENSE file in the root directory of this source tree.
218 */const Fz=ie("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
219 * @license lucide-react v0.462.0 - ISC
220 *
221 * This source code is licensed under the ISC license.
222 * See the LICENSE file in the root directory of this source tree.
223 */const Mf=ie("Eye",[["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"}]]);/**
224 * @license lucide-react v0.462.0 - ISC
225 *
226 * This source code is licensed under the ISC license.
227 * See the LICENSE file in the root directory of this source tree.
228 */const Bz=ie("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/**
229 * @license lucide-react v0.462.0 - ISC
230 *
231 * This source code is licensed under the ISC license.
232 * See the LICENSE file in the root directory of this source tree.
233 */const qN=ie("FileDown",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
234 * @license lucide-react v0.462.0 - ISC
235 *
236 * This source code is licensed under the ISC license.
237 * See the LICENSE file in the root directory of this source tree.
238 */const Uz=ie("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
239 * @license lucide-react v0.462.0 - ISC
240 *
241 * This source code is licensed under the ISC license.
242 * See the LICENSE file in the root directory of this source tree.
243 */const zz=ie("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/**
244 * @license lucide-react v0.462.0 - ISC
245 *
246 * This source code is licensed under the ISC license.
247 * See the LICENSE file in the root directory of this source tree.
248 */const Qs=ie("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
249 * @license lucide-react v0.462.0 - ISC
250 *
251 * This source code is licensed under the ISC license.
252 * See the LICENSE file in the root directory of this source tree.
253 */const qz=ie("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
254 * @license lucide-react v0.462.0 - ISC
255 *
256 * This source code is licensed under the ISC license.
257 * See the LICENSE file in the root directory of this source tree.
258 */const WN=ie("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}
258]]);/**
259 * @license lucide-react v0.462.0 - ISC
260 *
261 * This source code is licensed under the ISC license.
262 * See the LICENSE file in the root directory of this source tree.
263 */const zy=ie("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
264 * @license lucide-react v0.462.0 - ISC
265 *
266 * This source code is licensed under the ISC license.
267 * See the LICENSE file in the root directory of this source tree.
268 */const Wz=ie("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
269 * @license lucide-react v0.462.0 - ISC
270 *
271 * This source code is licensed under the ISC license.
272 * See the LICENSE file in the root directory of this source tree.
273 */const Hz=ie("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
274 * @license lucide-react v0.462.0 - ISC
275 *
276 * This source code is licensed under the ISC license.
277 * See the LICENSE file in the root directory of this source tree.
278 */const y$=ie("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
279 * @license lucide-react v0.462.0 - ISC
280 *
281 * This source code is licensed under the ISC license.
282 * See the LICENSE file in the root directory of this source tree.
283 */const Jl=ie("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
284 * @license lucide-react v0.462.0 - ISC
285 *
286 * This source code is licensed under the ISC license.
287 * See the LICENSE file in the root directory of this source tree.
288 */const Vz=ie("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
289 * @license lucide-react v0.462.0 - ISC
290 *
291 * This source code is licensed under the ISC license.
292 * See the LICENSE file in the root directory of this source tree.
293 */const x$=ie("Image",[["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"}]]);/**
294 * @license lucide-react v0.462.0 - ISC
295 *
296 * This source code is licensed under the ISC license.
297 * See the LICENSE file in the root directory of this source tree.
298 */const Z1=ie("LayoutDashboard",[["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"}]]);/**
299 * @license lucide-react v0.462.0 - ISC
300 *
301 * This source code is licensed under the ISC license.
302 * See the LICENSE file in the root directory of this source tree.
303 */const b$=ie("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/**
304 * @license lucide-react v0.462.0 - ISC
305 *
306 * This source code is licensed under the ISC license.
307 * See the LICENSE file in the root directory of this source tree.
308 */const Kz=ie("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
309 * @license lucide-react v0.462.0 - ISC
310 *
311 * This source code is licensed under the ISC license.
312 * See the LICENSE file in the root directory of this source tree.
313 */const Ze=ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
314 * @license lucide-react v0.462.0 - ISC
315 *
316 * This source code is licensed under the ISC license.
317 * See the LICENSE file in the root directory of this source tree.
318 */const HN=ie("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
319 * @license lucide-react v0.462.0 - ISC
320 *
321 * This source code is licensed under the ISC license.
322 * See the LICENSE file in the root directory of this source tree.
323 */const w$=ie("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
324 * @license lucide-react v0.462.0 - ISC
325 *
326 * This source code is licensed under the ISC license.
327 * See the LICENSE file in the root directory of this source tree.
328 */const Gz=ie("MailX",[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h9",key:"1j9vog"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m17 17 4 4",key:"1b3523"}],["path",{d:"m21 17-4 4",key:"uinynz"}]]);/**
329 * @license lucide-react v0.462.0 - ISC
330 *
331 * This source code is licensed under the ISC license.
332 * See the LICENSE file in the root directory of this source tree.
333 */const ti=ie("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
334 * @license lucide-react v0.462.0 - ISC
335 *
336 * This source code is licensed under the ISC license.
337 * See the LICENSE file in the root directory of this source tree.
338 */const ej=ie("MapPin",[["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"}]]);/**
339 * @license lucide-react v0.462.0 - ISC
340 *
341 * This source code is licensed under the ISC license.
342 * See the LICENSE file in the root directory of this source tree.
343 */const Yz=ie("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
344 * @license lucide-react v0.462.0 - ISC
345 *
346 * This source code is licensed under the ISC license.
347 * See the LICENSE file in the root directory of this source tree.
348 */const Xz=ie("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
349 * @license lucide-react v0.462.0 - ISC
350 *
351 * This source code is licensed under the ISC license.
352 * See the LICENSE file in the root directory of this source tree.
353 */const j$=ie("MessageSquareQuote",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M8 12a2 2 0 0 0 2-2V8H8",key:"1jfesj"}],["path",{d:"M14 12a2 2 0 0 0 2-2V8h-2",key:"1dq9mh"}]]);/**
354 * @license lucide-react v0.462.0 - ISC
355 *
356 * This source code is licensed under the ISC license.
357 * See the LICENSE file in the root directory of this source tree.
358 */const Xp=ie("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
359 * @license lucide-react v0.462.0 - ISC
360 *
361 * This source code is licensed under the ISC license.
362 * See the LICENSE file in the root directory of this source tree.
363 */const tj=ie("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
364 * @license lucide-react v0.462.0 - ISC
365 *
366 * This source code is licensed under the ISC license.
367 * See the LICENSE file in the root directory of this source tree.
368 */const rj=ie("PackageCheck",[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 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.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/**
369 * @license lucide-react v0.462.0 - ISC
370 *
371 * This source code is licensed under the ISC license.
372 * See the LICENSE file in the root directory of this source tree.
373 */const Gn=ie("Package",[["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"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
374 * @license lucide-react v0.462.0 - ISC
375 *
376 * This source code is licensed under the ISC license.
377 * See the LICENSE file in the root directory of this source tree.
378 */const Qz=ie("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
379 * @license lucide-react v0.462.0 - ISC
380 *
381 * This source code is licensed under the ISC license.
382 * See the LICENSE file in the root directory of this source tree.
383 */const nj=ie("Pencil",[["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"}]]);/**
384 * @license lucide-react v0.462.0 - ISC
385 *
386 * This source code is licensed under the ISC license.
387 * See the LICENSE file in the root directory of this source tree.
388 */const Jz=ie("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
389 * @license lucide-react v0.462.0 - ISC
390 *
391 * This source code is licensed under the ISC license.
392 * See the LICENSE file in the root directory of this source tree.
393 */const aj=ie("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
394 * @license lucide-react v0.462.0 - ISC
395 *
396 * This source code is licensed under the ISC license.
397 * See the LICENSE file in the root directory of this source tree.
398 */const Or=ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
399 * @license lucide-react v0.462.0 - ISC
400 *
401 * This source code is licensed under the ISC license.
402 * See the LICENSE file in the root directory of this source tree.
403 */const VN=ie("PoundSterling",[["path",{d:"M18 7c0-5.333-8-5.333-8 0",key:"1prm2n"}],["path",{d:"M10 7v14",key:"18tmcs"}],["path",{d:"M6 21h12",key:"4dkmi1"}],["path",{d:"M6 13h10",key:"ybwr4a"}]]);/**
404 * @license lucide-react v0.462.0 - ISC
405 *
406 * This source code is licensed under the ISC license.
407 * See the LICENSE file in the root directory of this source tree.
408 */const If=ie("RefreshCw",[["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"}]]);/**
409 * @license lucide-react v0.462.0 - ISC
410 *
411 * This source code is licensed under the ISC license.
412 * See the LICENSE file in the root directory of this source tree.
413 */const Ur=ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
414 * @license lucide-react v0.462.0 - ISC
415 *
416 * This source code is licensed under the ISC license.
417 * See the LICENSE file in the root directory of this source tree.
418 */const Zl=ie("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
419 * @license lucide-react v0.462.0 - ISC
420 *
421 * This source code is licensed under the ISC license.
422 * See the LICENSE file in the root directory of this source tree.
423 */const ij=ie("ShieldCheck",[["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",ke
423y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
424 * @license lucide-react v0.462.0 - ISC
425 *
426 * This source code is licensed under the ISC license.
427 * See the LICENSE file in the root directory of this source tree.
428 */const as=ie("ShoppingBag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);/**
429 * @license lucide-react v0.462.0 - ISC
430 *
431 * This source code is licensed under the ISC license.
432 * See the LICENSE file in the root directory of this source tree.
433 */const ec=ie("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/**
434 * @license lucide-react v0.462.0 - ISC
435 *
436 * This source code is licensed under the ISC license.
437 * See the LICENSE file in the root directory of this source tree.
438 */const Zz=ie("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
439 * @license lucide-react v0.462.0 - ISC
440 *
441 * This source code is licensed under the ISC license.
442 * See the LICENSE file in the root directory of this source tree.
443 */const e7=ie("SquareX",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
444 * @license lucide-react v0.462.0 - ISC
445 *
446 * This source code is licensed under the ISC license.
447 * See the LICENSE file in the root directory of this source tree.
448 */const dp=ie("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
449 * @license lucide-react v0.462.0 - ISC
450 *
451 * This source code is licensed under the ISC license.
452 * See the LICENSE file in the root directory of this source tree.
453 */const sj=ie("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]]);/**
454 * @license lucide-react v0.462.0 - ISC
455 *
456 * This source code is licensed under the ISC license.
457 * See the LICENSE file in the root directory of this source tree.
458 */const S$=ie("Tag",[["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"}]]);/**
459 * @license lucide-react v0.462.0 - ISC
460 *
461 * This source code is licensed under the ISC license.
462 * See the LICENSE file in the root directory of this source tree.
463 */const t7=ie("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
464 * @license lucide-react v0.462.0 - ISC
465 *
466 * This source code is licensed under the ISC license.
467 * See the LICENSE file in the root directory of this source tree.
468 */const xa=ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
469 * @license lucide-react v0.462.0 - ISC
470 *
471 * This source code is licensed under the ISC license.
472 * See the LICENSE file in the root directory of this source tree.
473 */const kd=ie("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
474 * @license lucide-react v0.462.0 - ISC
475 *
476 * This source code is licensed under the ISC license.
477 * See the LICENSE file in the root directory of this source tree.
478 */const so=ie("TriangleAlert",[["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"}]]);/**
479 * @license lucide-react v0.462.0 - ISC
480 *
481 * This source code is licensed under the ISC license.
482 * See the LICENSE file in the root directory of this source tree.
483 */const Oa=ie("Truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);/**
484 * @license lucide-react v0.462.0 - ISC
485 *
486 * This source code is licensed under the ISC license.
487 * See the LICENSE file in the root directory of this source tree.
488 */const Od=ie("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
489 * @license lucide-react v0.462.0 - ISC
490 *
491 * This source code is licensed under the ISC license.
492 * See the LICENSE file in the root directory of this source tree.
493 */const r7=ie("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
494 * @license lucide-react v0.462.0 - ISC
495 *
496 * This source code is licensed under the ISC license.
497 * See the LICENSE file in the root directory of this source tree.
498 */const Qp=ie("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
499 * @license lucide-react v0.462.0 - ISC
500 *
501 * This source code is licensed under the ISC license.
502 * See the LICENSE file in the root directory of this source tree.
503 */const oj=ie("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
504 * @license lucide-react v0.462.0 - ISC
505 *
506 * This source code is licensed under the ISC license.
507 * See the LICENSE file in the root directory of this source tree.
508 */const _$=ie("Warehouse",[["path",{d:"M22 8.35V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8.35A2 2 0 0 1 3.26 6.5l8-3.2a2 2 0 0 1 1.48 0l8 3.2A2 2 0 0 1 22 8.35Z",key:"gksnxg"}],["path",{d:"M6 18h12",key:"9pbo8z"}],["path",{d:"M6 14h12",key:"4cwo0f"}],["rect",{width:"12",height:"12",x:"6",y:"10",key:"apd30q"}]]);/**
509 * @license lucide-react v0.462.0 - ISC
510 *
511 * This source code is licensed under the ISC license.
512 * See the LICENSE file in the root directory of this source tree.
513 */const Ic=ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 9,097 bytes, line 513
513],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),lj="-",n7=e=>{const t=i7(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(lj);return l[0]===""&&l.length!==1&&l.shift(),N$(l,t)||a7(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},N$=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?N$(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(lj);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},KN=/^\[(.+)\]$/,a7=e=>{if(KN.test(e)){const t=KN.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},i7=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return o7(Object.entries(e.classGroups),r).forEach(([i,o])=>{H0(o,n,i,t)}),n},H0=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:GN(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(s7(a)){H0(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{H0(o,GN(t,i),r,n)})})},GN=(e,t)=>{let r=e;return t.split(lj).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},s7=e=>e.isThemeGetter,o7=(e,t)=>t?e.map(([r,n])=>{const a=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[r,a]}):e,l7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},k$="!",c7=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,a=t[0],i=t.length,o=l=>{const c=[];let u=0,d=0,f;for(let g=0;g<l.length;g++){let y=l[g];if(u===0){if(y===a&&(n||l.slice(g,g+i)===t)){c.push(l.slice(d,g)),d=g+i;continue}if(y==="/"){f=g;continue}}y==="["?u++:y==="]"&&u--}const h=c.length===0?l:l.substring(d),p=h.startsWith(k$),v=p?h.substring(1):h,m=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:m}};return r?l=>r({className:l,parseClassName:o}):o},u7=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},d7=e=>({cache:l7(e.cacheSize),parseClassName:c7(e),...n7(e)}),f7=/\s+/,h7=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(f7);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=r(u);let v=!!p,m=n(v?h.substring(0,p):h);if(!m){if(!v){l=u+(l.length>0?" "+l:l);continue}if(m=n(h),!m){l=u+(l.length>0?" "+l:l);continue}v=!1}const g=u7(d).join(":"),y=f?g+k$:g,x=y+m;if(i.includes(x))continue;i.push(x);const w=a(m,v);for(let S=0;S<w.length;++S){const j=w[S];i.push(y+j)}l=u+(l.length>0?" "+l:l)}return l};function p7(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=O$(t))&&(n&&(n+=" "),n+=r);return n}const O$=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=O$(e[n]))&&(r&&(r+=" "),r+=t);return r};function m7(e,...t){let r,n,a,i=o;function o(c){const u=t.reduce((d,f)=>f(d),e());return r=d7(u),n=r.cache.get,a=r.cache.set,i=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=h7(c,r);return a(c,d),d}return function(){return i(p7.apply(null,arguments))}}const ot=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},C$=/^\[(?:([a-z-]+):)?(.+)\]$/i,g7=/^\d+\/\d+$/,v7=new Set(["px","full","screen"]),y7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,x7=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,b7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,w7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,j7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Aa=e=>Nl(e)||v7.has(e)||g7.test(e),xi=e=>Dc(e,"length",P7),Nl=e=>!!e&&!Number.isNaN(Number(e)),qy=e=>Dc(e,"number",Nl),du=e=>!!e&&Number.isInteger(Number(e)),S7=e=>e.endsWith("%")&&Nl(e.slice(0,-1)),Pe=e=>C$.test(e),bi=e=>y7.test(e),_7=new Set(["length","size","percentage"]),N7=e=>Dc(e,_7,E$),k7=e=>Dc(e,"position",E$),O7=new Set(["image","url"]),C7=e=>Dc(e,O7,T7),E7=e=>Dc(e,"",A7),fu=()=>!0,Dc=(e,t,r)=>{const n=C$.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},P7=e=>x7.test(e)&&!b7.test(e),E$=()=>!1,A7=e=>w7.test(e),T7=e=>j7.test(e),$7=()=>{const e=ot("colors"),t=ot("spacing"),r=ot("blur"),n=ot("brightness"),a=ot("borderColor"),i=ot("borderRadius"),o=ot("borderSpacing"),l=ot("borderWidth"),c=ot("contrast"),u=ot("grayscale"),d=ot("hueRotate"),f=ot("invert"),h=ot("gap"),p=ot("gradientColorStops"),v=ot("gradientColorStopPositions"),m=ot("inset"),g=ot("margin"),y=ot("opacity"),x=ot("padding"),w=ot("saturate"),S=ot("scale"),j=ot("sepia"),_=ot("skew"),N=ot("space"),k=ot("translate"),O=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto",Pe,t],R=()=>[Pe,t],T=()=>["",Aa,xi],I=()=>["auto",Nl,Pe],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],P=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",Pe],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[Nl,Pe];return{cacheSize:500,separator:":",theme:{colors:[fu],spacing:[Aa,xi],blur:["none","",bi,Pe],brightness:K(),borderColor:[e],borderRadius:["none","","full",bi,Pe],borderSpacing:R(),borderWidth:T(),contrast:K(),grayscale:$(),hueRotate:K(),invert:$(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[S7,xi],inset:A(),margin:A(),opacity:K(),padding:R(),saturate:K(),scale:K(),sepia:$(),skew:K(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",Pe]}],container:["container"],columns:[{columns:[bi]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),Pe]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",du,Pe]}],basis:[{basis:A()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Pe]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",du,Pe]}],"grid-cols":[{"grid-cols":[fu]}],"col-start-end":[{col:["auto",{span:["full",du,Pe]},Pe]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[fu]}],"row-start-end":[{row:["auto",{span:[du,Pe]},Pe]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Pe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}
vendor: 8,339 bytes, line 513
513],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Pe,t]}],"min-w":[{"min-w":[Pe,t,"min","max","fit"]}],"max-w":[{"max-w":[Pe,t,"none","full","min","max","fit","prose",{screen:[bi]},bi]}],h:[{h:[Pe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Pe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Pe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Pe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",bi,xi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",qy]}],"font-family":[{font:[fu]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Pe]}],"line-clamp":[{"line-clamp":["none",Nl,qy]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Aa,Pe]}],"list-image":[{"list-image":["none",Pe]}],"list-style-type":[{list:["none","disc","decimal",Pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...P(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Aa,xi]}],"underline-offset":[{"underline-offset":["auto",Aa,Pe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),k7]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",N7]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},C7]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...P(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:P()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...P()]}],"outline-offset":[{"outline-offset":[Aa,Pe]}],"outline-w":[{outline:[Aa,xi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Aa,xi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",bi,E7]}],"shadow-color":[{shadow:[fu]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",bi,Pe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Pe]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",Pe]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",Pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[du,Pe]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Pe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,647 bytes, line 513
513],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Aa,xi,qy]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},R7=m7($7);function ne(...e){return R7(Te(e))}const M7=Nz,P$=b.forwardRef(({className:e,...t},r)=>s.jsx(l$,{ref:r,className:ne("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));P$.displayName=l$.displayName;const I7=Rc("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),A$=b.forwardRef(({className:e,variant:t,...r},n)=>s.jsx(c$,{ref:n,className:ne(I7({variant:t}),e),...r}));A$.displayName=c$.displayName;const D7=b.forwardRef(({className:e,...t},r)=>s.jsx(f$,{ref:r,className:ne("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));D7.displayName=f$.displayName;const T$=b.forwardRef(({className:e,...t},r)=>s.jsx(h$,{ref:r,className:ne("absolute right-2 top-2 rounded-md p-1 text-foreground
vendor: 10,554 bytes, line 513
513/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(Ic,{className:"h-4 w-4"})}));T$.displayName=h$.displayName;const $$=b.forwardRef(({className:e,...t},r)=>s.jsx(u$,{ref:r,className:ne("text-sm font-semibold",e),...t}));$$.displayName=u$.displayName;const R$=b.forwardRef(({className:e,...t},r)=>s.jsx(d$,{ref:r,className:ne("text-sm opacity-90",e),...t}));R$.displayName=d$.displayName;function L7(){const{toasts:e}=MU();return s.jsxs(M7,{children:[e.map(function({id:t,title:r,description:n,action:a,...i}){return s.jsxs(A$,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[r&&s.jsx($$,{children:r}),n&&s.jsx(R$,{children:n})]}),a,s.jsx(T$,{})]},t)}),s.jsx(P$,{})]})}var F7=Jw[" useId ".trim().toString()]||(()=>{}),B7=0;function Zr(e){const[t,r]=b.useState(F7());return Gt(()=>{r(n=>n??String(B7++))},[e]),t?`radix-${t}`:""}const U7=["top","right","bottom","left"],is=Math.min,Kr=Math.max,Jp=Math.round,Sh=Math.floor,ba=e=>({x:e,y:e}),z7={left:"right",right:"left",bottom:"top",top:"bottom"},q7={start:"end",end:"start"};function V0(e,t,r){return Kr(e,is(t,r))}function ri(e,t){return typeof e=="function"?e(t):e}function ni(e){return e.split("-")[0]}function Lc(e){return e.split("-")[1]}function cj(e){return e==="x"?"y":"x"}function uj(e){return e==="y"?"height":"width"}const W7=new Set(["top","bottom"]);function ma(e){return W7.has(ni(e))?"y":"x"}function dj(e){return cj(ma(e))}function H7(e,t,r){r===void 0&&(r=!1);const n=Lc(e),a=dj(e),i=uj(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Zp(o)),[o,Zp(o)]}function V7(e){const t=Zp(e);return[K0(e),t,K0(t)]}function K0(e){return e.replace(/start|end/g,t=>q7[t])}const YN=["left","right"],XN=["right","left"],K7=["top","bottom"],G7=["bottom","top"];function Y7(e,t,r){switch(e){case"top":case"bottom":return r?t?XN:YN:t?YN:XN;case"left":case"right":return t?K7:G7;default:return[]}}function X7(e,t,r,n){const a=Lc(e);let i=Y7(ni(e),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(K0)))),i}function Zp(e){return e.replace(/left|right|bottom|top/g,t=>z7[t])}function Q7(e){return{top:0,right:0,bottom:0,left:0,...e}}function M$(e){return typeof e!="number"?Q7(e):{top:e,right:e,bottom:e,left:e}}function em(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function QN(e,t,r){let{reference:n,floating:a}=e;const i=ma(t),o=dj(t),l=uj(o),c=ni(t),u=i==="y",d=n.x+n.width/2-a.width/2,f=n.y+n.height/2-a.height/2,h=n[l]/2-a[l]/2;let p;switch(c){case"top":p={x:d,y:n.y-a.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-a.width,y:f};break;default:p={x:n.x,y:n.y}}switch(Lc(t)){case"start":p[o]-=h*(r&&u?-1:1);break;case"end":p[o]+=h*(r&&u?-1:1);break}return p}const J7=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:f}=QN(u,n,c),h=n,p={},v=0;for(let m=0;m<l.length;m++){const{name:g,fn:y}=l[m],{x,y:w,data:S,reset:j}=await y({x:d,y:f,initialPlacement:n,placement:h,strategy:a,middlewareData:p,rects:u,platform:o,elements:{reference:e,floating:t}});d=x??d,f=w??f,p={...p,[g]:{...p[g],...S}},j&&v<=50&&(v++,typeof j=="object"&&(j.placement&&(h=j.placement),j.rects&&(u=j.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):j.rects),{x:d,y:f}=QN(u,h,c)),m=-1)}return{x:d,y:f,placement:h,strategy:a,middlewareData:p}};async function Cd(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=ri(t,e),v=M$(p),g=l[h?f==="floating"?"reference":"floating":f],y=em(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(g)))==null||r?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=f==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},j=em(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:c}):x);return{top:(y.top-j.top+v.top)/S.y,bottom:(j.bottom-y.bottom+v.bottom)/S.y,left:(y.left-j.left+v.left)/S.x,right:(j.right-y.right+v.right)/S.x}}const Z7=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=ri(e,t)||{};if(u==null)return{};const f=M$(d),h={x:r,y:n},p=dj(a),v=uj(p),m=await o.getDimensions(u),g=p==="y",y=g?"top":"left",x=g?"bottom":"right",w=g?"clientHeight":"clientWidth",S=i.reference[v]+i.reference[p]-h[p]-i.floating[v],j=h[p]-i.reference[p],_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let N=_?_[w]:0;(!N||!await(o.isElement==null?void 0:o.isElement(_)))&&(N=l.floating[w]||i.floating[v]);const k=S/2-j/2,O=N/2-m[v]/2-1,E=is(f[y],O),A=is(f[x],O),R=E,T=N-m[v]-A,I=N/2-m[v]/2+k,F=V0(R,I,T),P=!c.arrow&&Lc(a)!=null&&I!==F&&i.reference[v]/2-(I<R?E:A)-m[v]/2<0,D=P?I<R?I-R:I-T:0;return{[p]:h[p]+D,data:{[p]:F,centerOffset:I-F-D,...P&&{alignmentOffset:D}},reset:P}}}),eq=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...g}=ri(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const y=ni(a),x=ma(l),w=ni(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),j=h||(w||!m?[Zp(l)]:V7(l)),_=v!=="none";!h&&_&&j.push(...X7(l,m,v,S));const N=[l,...j],k=await Cd(t,g),O=[];let E=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&O.push(k[y]),f){const I=H7(a,o,S);O.push(k[I[0]],k[I[1]])}if(E=[...E,{placement:a,overflows:O}],!O.every(I=>I<=0)){var A,R;const I=(((A=i.flip)==null?void 0:A.index)||0)+1,F=N[I];if(F&&(!(f==="alignment"?x!==ma(F):!1)||E.every(M=>M.overflows[0]>0&&ma(M.placement)===x)))return{data:{index:I,overflows:E},reset:{placement:F}};let P=(R=E.filter(D=>D.overflows[0]<=0).sort((D,M)=>D.overflows[1]-M.overflows[1])[0])==null?void 0:R.placement;if(!P)switch(p){case"bestFit":{var T;const D=(T=E.filter(M=>{if(_){const $=ma(M.placement);return $===x||$==="y"}return!0}).map(M=>[M.placement,M.overflows.filter($=>$>0).reduce(($,z)=>$+z,0)]).sort((M,$)=>M[1]-$[1])[0])==null?void 0:T[0];D&&(P=D);break}case"initialPlacement":P=l;break}if(a!==P)return{reset:{placement:P}}}return{}}}};function JN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ZN(e){return U7.some(t=>e[t]>=0)}const tq=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=ri(e,t);switch(n){case"referenceHidden":{const i=await Cd(t,{...a,elementContext:"reference"}),o=JN(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:ZN(o)}}}case"escaped":{const i=await Cd(t,{...a,altBoundary:!0}),o=JN(i,r.floating);return{data:{escapedOffsets:o,escaped:ZN(o)}}}default:return{}}}}},I$=new Set(["left","top"]);async function rq(e,t){const{placement:r,platform:n,elements:a}=e,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=ni(r),l=Lc(r),c=ma(r)==="y",u=I$.has(o)?-1:1,d=i&&c?-1:1,f=ri(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(p=l==="end"?v*-1:v),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const nq=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await rq(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},aq=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:g=>{let{x:y,y:x}=g;return{x:y,y:x}}},...c}=ri(e,t),u={x:r,y:n},d=await Cd(t,c),f=ma(ni(a)),h=cj(f);let p=u[h],v=u[f];if(i){const g=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=p+d[g],w=p-d[y];p=V0(x,p,w)}if(o){const g=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=v+d[g],w=v-d[y];v=V0(x,v,w)}const m=l.fn({...t,[h]:p,[f]:v});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[h]:i,[f]:o}}}}}},iq=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=ri(e,t),d={x:r,y:n},f=ma(a),h=cj(f);let p=d[h],v=d[f];const m=ri(l,t),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const w=h==="y"?"height":"width",S=i.reference[h]-i.floating[w]+g.mainAxis,j=i.reference[h]+i.reference[w]-g.mainAxis;p<S?p=S:p>j&&(p=j)}if(u){var y,x;const w=h==="y"?"width":"height",S=I$.has(ni(a)),j=i.reference[f]-i.floating[w]+(S&&((y=o.offset)==null?void 0:y[f])||0)+(S?0:g.crossAxis),_=i.reference[f]+i.reference[w]+(S?0:((x=o.offset)==null?void 0:x[f])||0)-(S?g.crossAxis:0);v<j?v=j:v>_&&(v=_)}return{[h]:p,[f]:v}}}},sq=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=ri(e,t),d=await Cd(t,u),f=ni(a),h=Lc(a),p=ma(a)==="y",{width:v,height:m}=i.floating;let g,y;f==="top"||f==="bottom"?(g=f,y=h===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(y=f,g=h==="end"?"top":"bottom");const x=m-d.top-d.bottom,w=v-d.left-d.right,S=is(m-d[g],x),j=is(v-d[y],w),_=!t.middlewareData.shift;let N=S,k=j;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=x),_&&!h){const E=Kr(d.left,0),A=Kr(d.right,0),R=Kr(d.top,0),T=Kr(d.bottom,0);
vendor: 5,139 bytes, line 513
513p?k=v-2*(E!==0||A!==0?E+A:Kr(d.left,d.right)):N=m-2*(R!==0||T!==0?R+T:Kr(d.top,d.bottom))}await c({...t,availableWidth:k,availableHeight:N});const O=await o.getDimensions(l.floating);return v!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};function Mg(){return typeof window<"u"}function Fc(e){return D$(e)?(e.nodeName||"").toLowerCase():"#document"}function en(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ca(e){var t;return(t=(D$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function D$(e){return Mg()?e instanceof Node||e instanceof en(e).Node:!1}function Zn(e){return Mg()?e instanceof Element||e instanceof en(e).Element:!1}function Sa(e){return Mg()?e instanceof HTMLElement||e instanceof en(e).HTMLElement:!1}function ek(e){return!Mg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof en(e).ShadowRoot}const oq=new Set(["inline","contents"]);function Df(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=ea(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!oq.has(a)}const lq=new Set(["table","td","th"]);function cq(e){return lq.has(Fc(e))}const uq=[":popover-open",":modal"];function Ig(e){return uq.some(t=>{try{return e.matches(t)}catch{return!1}})}const dq=["transform","translate","scale","rotate","perspective"],fq=["transform","translate","scale","rotate","perspective","filter"],hq=["paint","layout","strict","content"];function fj(e){const t=hj(),r=Zn(e)?ea(e):e;return dq.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||fq.some(n=>(r.willChange||"").includes(n))||hq.some(n=>(r.contain||"").includes(n))}function pq(e){let t=ss(e);for(;Sa(t)&&!tc(t);){if(fj(t))return t;if(Ig(t))return null;t=ss(t)}return null}function hj(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const mq=new Set(["html","body","#document"]);function tc(e){return mq.has(Fc(e))}function ea(e){return en(e).getComputedStyle(e)}function Dg(e){return Zn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ss(e){if(Fc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ek(e)&&e.host||Ca(e);return ek(t)?t.host:t}function L$(e){const t=ss(e);return tc(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sa(t)&&Df(t)?t:L$(t)}function Ed(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=L$(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),o=en(a);if(i){const l=G0(o);return t.concat(o,o.visualViewport||[],Df(a)?a:[],l&&r?Ed(l):[])}return t.concat(a,Ed(a,[],r))}function G0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function F$(e){const t=ea(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Sa(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,l=Jp(r)!==i||Jp(n)!==o;return l&&(r=i,n=o),{width:r,height:n,$:l}}function pj(e){return Zn(e)?e:e.contextElement}function kl(e){const t=pj(e);if(!Sa(t))return ba(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:i}=F$(t);let o=(i?Jp(r.width):r.width)/n,l=(i?Jp(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const gq=ba(0);function B$(e){const t=en(e);return!hj()||!t.visualViewport?gq:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vq(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==en(e)?!1:t}function oo(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=pj(e);let o=ba(1);t&&(n?Zn(n)&&(o=kl(n)):o=kl(e));const l=vq(i,r,n)?B$(i):ba(0);let c=(a.left+l.x)/o.x,u=(a.top+l.y)/o.y,d=a.width/o.x,f=a.height/o.y;if(i){const h=en(i),p=n&&Zn(n)?en(n):n;let v=h,m=G0(v);for(;m&&n&&p!==v;){const g=kl(m),y=m.getBoundingClientRect(),x=ea(m),w=y.left+(m.clientLeft+parseFloat(x.paddingLeft))*g.x,S=y.top+(m.clientTop+parseFloat(x.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,f*=g.y,c+=w,u+=S,v=en(m),m=G0(v)}}return em({width:d,height:f,x:c,y:u})}function mj(e,t){const r=Dg(e).scrollLeft;return t?t.left+r:oo(Ca(e)).left+r}function U$(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-(r?0:mj(e,n)),i=n.top+t.scrollTop;return{x:a,y:i}}function yq(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const i=a==="fixed",o=Ca(n),l=t?Ig(t.floating):!1;if(n===o||l&&i)return r;let c={scrollLeft:0,scrollTop:0},u=ba(1);const d=ba(0),f=Sa(n);if((f||!f&&!i)&&((Fc(n)!=="body"||Df(o))&&(c=Dg(n)),Sa(n))){const p=oo(n);u=kl(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const h=o&&!f&&!i?U$(o,c,!0):ba(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:r.y*u.y-c.scrollTop*u.y+d.y+h.y}}function xq(e){return Array.from(e.getClientRects())}function bq(e){const t=Ca(e),r=Dg(e),n=e.ownerDocument.body,a=Kr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Kr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+mj(e);const l=-r.scrollTop;return ea(n).direction==="rtl"&&(o+=Kr(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:l}}
vendor: 4,850 bytes, line 513
513function wq(e,t){const r=en(e),n=Ca(e),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const u=hj();(!u||u&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:i,height:o,x:l,y:c}}const jq=new Set(["absolute","fixed"]);function Sq(e,t){const r=oo(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=Sa(e)?kl(e):ba(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,u=n*i.y;return{width:o,height:l,x:c,y:u}}function tk(e,t,r){let n;if(t==="viewport")n=wq(e,r);else if(t==="document")n=bq(Ca(e));else if(Zn(t))n=Sq(t,r);else{const a=B$(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return em(n)}function z$(e,t){const r=ss(e);return r===t||!Zn(r)||tc(r)?!1:ea(r).position==="fixed"||z$(r,t)}function _q(e,t){const r=t.get(e);if(r)return r;let n=Ed(e,[],!1).filter(l=>Zn(l)&&Fc(l)!=="body"),a=null;const i=ea(e).position==="fixed";let o=i?ss(e):e;for(;Zn(o)&&!tc(o);){const l=ea(o),c=fj(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&jq.has(a.position)||Df(o)&&!c&&z$(e,o))?n=n.filter(d=>d!==o):a=l,o=ss(o)}return t.set(e,n),n}function Nq(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[...r==="clippingAncestors"?Ig(t)?[]:_q(t,this._c):[].concat(r),n],l=o[0],c=o.reduce((u,d)=>{const f=tk(t,d,a);return u.top=Kr(f.top,u.top),u.right=is(f.right,u.right),u.bottom=is(f.bottom,u.bottom),u.left=Kr(f.left,u.left),u},tk(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function kq(e){const{width:t,height:r}=F$(e);return{width:t,height:r}}function Oq(e,t,r){const n=Sa(t),a=Ca(t),i=r==="fixed",o=oo(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=ba(0);function u(){c.x=mj(a)}if(n||!n&&!i)if((Fc(t)!=="body"||Df(a))&&(l=Dg(t)),n){const p=oo(t,!0,i,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else a&&u();i&&!n&&a&&u();const d=a&&!n&&!i?U$(a,l):ba(0),f=o.left+l.scrollLeft-c.x-d.x,h=o.top+l.scrollTop-c.y-d.y;return{x:f,y:h,width:o.width,height:o.height}}function Wy(e){return ea(e).position==="static"}function rk(e,t){if(!Sa(e)||ea(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ca(e)===r&&(r=r.ownerDocument.body),r}function q$(e,t){const r=en(e);if(Ig(e))return r;if(!Sa(e)){let a=ss(e);for(;a&&!tc(a);){if(Zn(a)&&!Wy(a))return a;a=ss(a)}return r}let n=rk(e,t);for(;n&&cq(n)&&Wy(n);)n=rk(n,t);return n&&tc(n)&&Wy(n)&&!fj(n)?r:n||pq(e)||r}const Cq=async function(e){const t=this.getOffsetParent||q$,r=this.getDimensions,n=await r(e.floating);return{reference:Oq(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Eq(e){return ea(e).direction==="rtl"}const Pq={convertOffsetParentRelativeRectToViewportRelativeRect:yq,getDocumentElement:Ca,getClippingRect:Nq,getOffsetParent:q$,getElementRects:Cq,getClientRects:xq,getDimensions:kq,getScale:kl,isElement:Zn,isRTL:Eq};function W$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Aq(e,t){let r=null,n;const a=Ca(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=u;if(l||t(),!h||!p)return;const v=Sh(f),m=Sh(a.clientWidth-(d+h)),g=Sh(a.clientHeight-(f+p)),y=Sh(d),w={rootMargin:-v+"px "+-m+"px "+-g+"px "+-y+"px",threshold:Kr(0,is(1,c))||1};let S=!0;function j(_){const N=_[0].intersectionRatio;if(N!==c){if(!S)return o();N?o(!1,N):n=setTimeout(()=>{o(!1,1e-7)},1e3)}N===1&&!W$(u,e.getBoundingClientRect())&&o(),S=!1}try{r=new IntersectionObserver(j,{...w,root:a.ownerDocument})}catch{r=new IntersectionObserver(j,w)}r.observe(e)}return o(!0),i}function Tq(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=pj(e),d=a||i?[...u?Ed(u):[],...Ed(t)]:[];d.forEach(y=>{a&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});const f=u&&l?Aq(u,r):null;let h=-1,p=null;o&&(p=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),r()}),u&&!c&&p.observe(u),p.observe(t));let v,m=c?oo(e):null;c&&g();function g(){const y=oo(e);m&&!W$(m,y)&&r(),m=y,v=requestAnimationFrame(g)}return r(),()=>{var y;d.forEach(x=>{a&&x.removeEventListener("scroll",r),i&&x.removeEventListener("resize",r)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(v)}}const $q=nq,Rq=aq,Mq=eq,Iq=sq,Dq=tq,nk=Z7,Lq=iq,Fq=(e,t,r)=>{const n=new Map,a={platform:Pq,...r},i={...a.platform,_c:n};return J7(e,t,{...a,platform:i})};var Bq=typeof document<"u",Uq=function(){},fp=Bq?b.useLayoutEffect:Uq;function tm(e,t){if(e===t)return!0;
vendor: 4,143 bytes, line 513
513if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!tm(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&e.$$typeof)&&!tm(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function H$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ak(e,t){const r=H$(e);return Math.round(t*r)/r}function Hy(e){const t=b.useRef(e);return fp(()=>{t.current=e}),t}function zq(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=b.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=b.useState(n);tm(h,n)||p(n);const[v,m]=b.useState(null),[g,y]=b.useState(null),x=b.useCallback(M=>{M!==_.current&&(_.current=M,m(M))},[]),w=b.useCallback(M=>{M!==N.current&&(N.current=M,y(M))},[]),S=i||v,j=o||g,_=b.useRef(null),N=b.useRef(null),k=b.useRef(d),O=c!=null,E=Hy(c),A=Hy(a),R=Hy(u),T=b.useCallback(()=>{if(!_.current||!N.current)return;const M={placement:t,strategy:r,middleware:h};A.current&&(M.platform=A.current),Fq(_.current,N.current,M).then($=>{const z={...$,isPositioned:R.current!==!1};I.current&&!tm(k.current,z)&&(k.current=z,wo.flushSync(()=>{f(z)}))})},[h,t,r,A,R]);fp(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(M=>({...M,isPositioned:!1})))},[u]);const I=b.useRef(!1);fp(()=>(I.current=!0,()=>{I.current=!1}),[]),fp(()=>{if(S&&(_.current=S),j&&(N.current=j),S&&j){if(E.current)return E.current(S,j,T);T()}},[S,j,T,E,O]);const F=b.useMemo(()=>({reference:_,floating:N,setReference:x,setFloating:w}),[x,w]),P=b.useMemo(()=>({reference:S,floating:j}),[S,j]),D=b.useMemo(()=>{const M={position:r,left:0,top:0};if(!P.floating)return M;const $=ak(P.floating,d.x),z=ak(P.floating,d.y);return l?{...M,transform:"translate("+$+"px, "+z+"px)",...H$(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:z}},[r,l,P.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:T,refs:F,elements:P,floatingStyles:D}),[d,T,F,P,D])}const qq=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?nk({element:n.current,padding:a}).fn(r):{}:n?nk({element:n,padding:a}).fn(r):{}}}},Wq=(e,t)=>({...$q(e),options:[e,t]}),Hq=(e,t)=>({...Rq(e),options:[e,t]}),Vq=(e,t)=>({...Lq(e),options:[e,t]}),Kq=(e,t)=>({...Mq(e),options:[e,t]}),Gq=(e,t)=>({...Iq(e),options:[e,t]}),Yq=(e,t)=>({...Dq(e),options:[e,t]}),Xq=(e,t)=>({...qq(e),options:[e,t]});var Qq="Arrow",V$=b.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...i}=e;return s.jsx(ye.svg,{...i,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});V$.displayName=Qq;var Jq=V$;function gj(e){const[t,r]=b.useState(void 0);return Gt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;r({width:o,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var vj="Popper",[K$,Bc]=Br(vj),[Zq,G$]=K$(vj),Y$=e=>{const{__scopePopper:t,children:r}=e,[n,a]=b.useState(null);return s.jsx(Zq,{scope:t,anchor:n,onAnchorChange:a,children:r})};Y$.displayName=vj;var X$="PopperAnchor",Q$=b.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,i=G$(X$,r),o=b.useRef(null),l=Me(t,o);return b.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:s.jsx(ye.div,{...a,ref:l})});Q$.displayName=X$;var yj="PopperContent",[e9,t9]=K$(yj),J$=b.forwardRef((e,t)=>
vendor: 1,249 bytes, line 513
513{var Q,me,L,Y,J,U;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:v,...m}=e,g=G$(yj,r),[y,x]=b.useState(null),w=Me(t,ge=>x(ge)),[S,j]=b.useState(null),_=gj(S),N=(_==null?void 0:_.width)??0,k=(_==null?void 0:_.height)??0,O=n+(i!=="center"?"-"+i:""),E=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},A=Array.isArray(u)?u:[u],R=A.length>0,T={padding:E,boundary:A.filter(n9),altBoundary:R},{refs:I,floatingStyles:F,placement:P,isPositioned:D,middlewareData:M}=zq({strategy:"fixed",placement:O,whileElementsMounted:(...ge)=>Tq(...ge,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[Wq({mainAxis:a+k,alignmentAxis:o}),c&&Hq({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Vq():void 0,...T}),c&&Kq({...T}),Gq({...T,apply:({elements:ge,rects:ve,availableWidth:Ne,availableHeight:Re})=>{const{width:it,height:Xe}=ve.reference,Qe=ge.floating.style;Qe.setProperty("--radix-popper-available-width",`${Ne}px`),Qe.setProperty("--radix-popper-available-height",`${Re}px`),Qe.setProperty("--radix-popper-anchor-width",`${it}
513px`),Qe.setProperty("--radix-popper-anchor-height",`${Xe}px`)}}),S&&Xq({element:S,padding:l}),a9({arrowWidth:N,arrowHeight:k}),h&&Yq({strategy:"referenceHidden",...T})]}),[$,z]=tR(P),K=Fr(v);Gt(()=>{D&&(K==null||K())},[D,K]);const q=(Q=M.arrow)==null?void 0:Q.x,B=(me=M.arrow)==null?void 0:me.y,Z=((L=M.arrow)==null?void 0:L.centerOffset)!==0,[he,pe]=b.useState();return Gt(()=>{y&&pe(window.getComputedStyle(y).zIndex)},[y]),s.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:D?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(Y=M.transformOrigin)==null?void 0:Y.x,(J=M.transformOrigin)==null?void 0:J.y].join(" "),...((U=M.hide)==null?void 0:U.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(e9,{scope:r,placedSide:$,onArrowChange:j,arrowX:q,arrowY:B,shouldHideArrow:Z,children:s.jsx(ye.div,{"data-side":$,"data-align":z,...m,ref:w,style:{...m.style,animation:D?void 0:"none"}})})})});J$.displayName=yj;var Z$="PopperArrow",r9={top:"bottom",right:"left",bottom:"top",left:"right"},eR=b.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,i=t9(Z$,n),o=r9[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(Jq,{...a,ref:r,style:{...a.style,display:"block"}})})});eR.displayName=Z$;function n9(e){return e!==null}var a9=e=>({name:"transformOrigin",options:e,fn(t){var g,y,x;const{placement:r,rects:n,middlewareData:a}=t,o=((g=a.arrow)==null?void 0:g.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=tR(r),f={start:"0%",center:"50%",end:"100%"}[d],h=(((y=a.arrow)==null?void 0:y.x)??0)+l/2,p=(((x=a.arrow)==null?void 0:x.y)??0)+c/2;let v="",m="";return u==="bottom"?(v=o?f:`${h}px`,m=`${-c}px`):u==="top"?(v=o?f:`${h}px`,m=`${n.floating.height+c}px`):u==="right"?(v=`${-c}px`,m=o?f:`${p}px`):u==="left"&&(v=`${n.floating.width+c}px`,m=o?f:`${p}px`),{data:{x:v,y:m}}}});function tR(e){const[t,r="center"]=e.split("-");return[t,r]}var xj=Y$,bj=Q$,wj=J$,jj=eR,[Lg,HNe]=Br("Tooltip",[Bc]),Fg=Bc(),rR="TooltipProvider",i9=700,Y0="tooltip.open",[s9,Sj]=Lg(rR),nR=e=>{const{__scopeTooltip:t,delayDuration:r=i9,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:i}=e,o=b.useRef(!0),l=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),s.jsx(s9,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(u=>{l.current=u},[]),disableHoverableContent:a,children:i})};nR.displayName=rR;var Pd="Tooltip",[o9,Bg]=Lg(Pd),aR=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=Sj(Pd,e.__scopeTooltip),u=Fg(t),[d,f]=b.useState(null),h=Zr(),p=b.useRef(0),v=o??c.disableHoverableContent,m=l??c.delayDuration,g=b.useRef(!1),[y,x]=nn({prop:n,defaultProp:a??!1,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(Y0))):c.onClose(),i==null||i(N)},caller:Pd}),w=b.useMemo(()=>y?g.current?"delayed-open":"instant-open":"closed",[y]),S=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,x(!0)},[x]),j=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,x(!1)},[x]),_=b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,x(!0),p.current=0},m)},[m,x]);return b.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),s.jsx(xj,{...u,children:s.jsx(o9,{scope:t,contentId:h,open:y,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?_():S()},[c.isOpenDelayedRef,_,S]),onTriggerLeave:b.useCallback(()=>{v?j():(window.clearTimeout(p.current),p.current=0)},[j,v]),onOpen:S,onClose:j,disableHoverableContent:v,children:r})})};aR.displayName=Pd;var X0="TooltipTrigger",iR=b.forwardRef((e,t)=>
vendor: 4,427 bytes, line 513
513{const{__scopeTooltip:r,...n}=e,a=Bg(X0,r),i=Sj(X0,r),o=Fg(r),l=b.useRef(null),c=Me(t,l,a.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),f=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),s.jsx(bj,{asChild:!0,...o,children:s.jsx(ye.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:c,onPointerMove:oe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:oe(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:oe(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:oe(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:oe(e.onBlur,a.onClose),onClick:oe(e.onClick,a.onClose)})})});iR.displayName=X0;var l9="TooltipPortal",[VNe,c9]=Lg(l9,{forceMount:void 0}),rc="TooltipContent",sR=b.forwardRef((e,t)=>{const r=c9(rc,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...i}=e,o=Bg(rc,e.__scopeTooltip);return s.jsx(ln,{present:n||o.open,children:o.disableHoverableContent?s.jsx(oR,{side:a,...i,ref:t}):s.jsx(u9,{side:a,...i,ref:t})})}),u9=b.forwardRef((e,t)=>{const r=Bg(rc,e.__scopeTooltip),n=Sj(rc,e.__scopeTooltip),a=b.useRef(null),i=Me(t,a),[o,l]=b.useState(null),{trigger:c,onClose:u}=r,d=a.current,{onPointerInTransitChange:f}=n,h=b.useCallback(()=>{l(null),f(!1)},[f]),p=b.useCallback((v,m)=>{const g=v.currentTarget,y={x:v.clientX,y:v.clientY},x=m9(y,g.getBoundingClientRect()),w=g9(y,x),S=v9(m.getBoundingClientRect()),j=x9([...w,...S]);l(j),f(!0)},[f]);return b.useEffect(()=>()=>h(),[h]),b.useEffect(()=>{if(c&&d){const v=g=>p(g,d),m=g=>p(g,c);return c.addEventListener("pointerleave",v),d.addEventListener("pointerleave",m),()=>{c.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",m)}}},[c,d,p,h]),b.useEffect(()=>{if(o){const v=m=>{const g=m.target,y={x:m.clientX,y:m.clientY},x=(c==null?void 0:c.contains(g))||(d==null?void 0:d.contains(g)),w=!y9(y,o);x?h():w&&(h(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[c,d,o,u,h]),s.jsx(oR,{...e,ref:i})}),[d9,f9]=Lg(Pd,{isInside:!1}),h9=FU("TooltipContent"),oR=b.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=Bg(rc,r),u=Fg(r),{onClose:d}=c;return b.useEffect(()=>(document.addEventListener(Y0,d),()=>document.removeEventListener(Y0,d)),[d]),b.useEffect(()=>{if(c.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),s.jsx($c,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:s.jsxs(wj,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(h9,{children:n}),s.jsx(d9,{scope:r,isInside:!0,children:s.jsx(oz,{id:c.contentId,role:"tooltip",children:a||n})})]})})});sR.displayName=rc;var lR="TooltipArrow",p9=b.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Fg(r);return f9(lR,r).isInside?null:s.jsx(jj,{...a,...n,ref:t})});p9.displayName=lR;function m9(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function g9(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function v9(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function y9(e,t){const{x:r,y:n}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;
513o=i++){const l=t[i],c=t[o],u=l.x,d=l.y,f=c.x,h=c.y;d>n!=h>n&&r<(f-u)*(n-d)/(h-d)+u&&(a=!a)}return a}function x9(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),b9(t)}function b9(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const a=e[n];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var w9=nR,j9=aR,S9=iR,cR=sR;const uR=w9,_9=j9,N9=S9,dR=b.forwardRef(({className:e,sideOffset:t=4,...r},n)=>s.jsx(cR,{ref:n,sideOffset:t,className:ne("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));dR.displayName=cR.displayName;const fR=b.createContext(void 0),k9=({children:e})=>{const[t,r]=b.useState([]),[n,a]=b.useState(!1),i=f=>{r(h=>h.find(v=>v.id===f.id)?h.map(v=>v.id===f.id?{...v,quantity:v.quantity+1}:v):[...h,{...f,quantity:1}])},o=f=>{r(h=>h.filter(p=>p.id!==f))},l=(f,h)=>{if(h<=0){o(f);return}r(p=>p.map(v=>v.id===f?{...v,quantity:h}:v))},c=()=>r([]),u=t.reduce((f,h)=>f+h.quantity,0),d=t.reduce((f,h)=>f+h.price*h.quantity,0);return s.jsx(fR.Provider,{value:{items:t,addToCart:i,removeFromCart:o,updateQuantity:l,clearCart:c,totalItems:u,totalPrice:d,isCartOpen:n,setIsCartOpen:a},children:e})},jo=()=>{const e=b.useContext(fR);if(!e)throw new Error("useCart must be used within CartProvider");return e};var ha=function(){return ha=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},ha.apply(this,arguments)};function Uc(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function O9(e,t,r,n){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(d){try{u(n.next(d))}catch(f){o(f)}}function c(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):a(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}function C9(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}const E9=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class _j extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}}class P9 extends _j{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class ik extends _j{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class sk extends _j{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Q0;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Q0||(Q0={}));class A9{constructor(t,{headers:r={},customFetch:n,region:a=Q0.Any}={}){this.url=t,this.headers=r,this.region=a,this.fetch=E9(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return O9(this,arguments,void 0,function*(r,n={}){var a;let i,o;try{const{headers:l,method:c,body:u,signal:d,timeout:f}=n;let h={},{region:p}=n;p||(p=this.region);const v=new URL(`${this.url}/${r}`);p&&p!=="any"&&(h["x-region"]=p,v.searchParams.set("forceFunctionRegion",p));let m;u&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",m=u):typeof u=="string"?(h["Content-Type"]="text/plain",m=u):typeof FormData<"u"&&u instanceof FormData?m=u:(h["Content-Type"]="application/json",m=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?m=JSON.stringify(u):m=u;let g=d;f&&(o=new AbortController,i=setTimeout(()=>
513o.abort(),f),d?(g=o.signal,d.addEventListener("abort",()=>o.abort())):g=o.signal);const y=yield this.fetch(v.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),l),body:m,signal:g}).catch(j=>{throw new P9(j)}),x=y.headers.get("x-relay-error");if(x&&x==="true")throw new ik(y);if(!y.ok)throw new sk(y);let w=((a=y.headers.get("Content-Type"))!==null&&a!==void 0?a:"text/plain").split(";")[0].trim(),S;return w==="application/json"?S=yield y.json():w==="application/octet-stream"||w==="application/pdf"?S=yield y.blob():w==="text/event-stream"?S=y:w==="multipart/form-data"?S=yield y.formData():S=yield y.text(),{data:S,error:null,response:y}}catch(l){return{data:null,error:l,response:l instanceof sk||l instanceof ik?l.context:void 0}}finally{i&&clearTimeout(i)}})}}var T9=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},$9=class{constructor(e){var t,r,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(n=e.urlLengthLimit)!==null&&n!==void 0?n:8e3,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var r=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const n=this.fetch;let a=n(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{let o=null,l=null,c=null,u=i.status,d=i.statusText;if(i.ok){var f,h;if(r.method!=="HEAD"){var p;const y=await i.text();y===""||(r.headers.get("Accept")==="text/csv"||r.headers.get("Accept")&&(!((p=r.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?l=y:l=JSON.parse(y))}const m=(f=r.headers.get("Prefer"))===null||f===void 0?void 0:f.match(/count=(exact|planned|estimated)/),g=(h=i.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");m&&g&&g.length>1&&(c=parseInt(g[1])),r.isMaybeSingle&&r.method==="GET"&&Array.isArray(l)&&(l.length>1?(o={code:"PGRST116",details:`Results contain ${l.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},l=null,c=null,u=406,d="Not Acceptable"):l.length===1?l=l[0]:l=null)}else{var v;const m=await i.text();try{o=JSON.parse(m),Array.isArray(o)&&i.status===404&&(l=[],o=null,u=200,d="OK")}catch{i.status===404&&m===""?(u=204,d="No Content"):o={message:m}}if(o&&r.isMaybeSingle&&(!(o==null||(v=o.details)===null||v===void 0)&&v.includes("0 rows"))&&(o=null,u=200,d="OK"),o&&r.shouldThrowOnError)throw new T9(o)}return{error:o,data:l,count:c,status:u,statusText:d}});return this.shouldThrowOnError||(a=a.catch(i=>{var o;let l="",c="",u="";const d=i==null?void 0:i.cause;if(d){var f,h,p,v;const y=(f=d==null?void 0:d.message)!==null&&f!==void 0?f:"",x=(h=d==null?void 0:d.code)!==null&&h!==void 0?h:"";l=`${(p=i==null?void 0:i.name)!==null&&p!==void 0?p:"FetchError"}: ${i==null?void 0:i.message}`,l+=`
514
515Caused by: ${(v=d==null?void 0:d.name)!==null&&v!==void 0?v:"Error"}: ${y}`,x&&(l+=` (${x})`),d!=null&&d.stack&&(l+=`
516${d.stack}`)}else{var m;l=(m=i==null?void 0:i.stack)!==null&&m!==void 0?m:""}const g=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(u="",c="Request was aborted (timeout or manual cancellation)",g>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${g} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",c="HTTP headers exceeded server limits (typically 16KB)",g>this.urlLengthLimit&&(c+=`. Your request URL is ${g} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:l,hint:c,code:u},data:null,count:null,status:0,statusText:""}}
516)),a.then(e,t)}returns(){return this}overrideTypes(){return this}},R9=class extends $9{select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:a=n}={}){const i=a?`${a}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const a=typeof n>"u"?"offset":`${n}.offset`,i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(a,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:a=!1,format:i="text"}={}){var o;const l=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,a?"wal":null].filter(Boolean).join("|"),c=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${c}"; options=${l};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const ok=new RegExp("[,()]");var Ko=class extends R9{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&ok.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&ok.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let a="";n==="plain"?a="pl":n==="phrase"?a="ph":n==="websearch"&&(a="w");const i=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${a}fts${i}.${t}`),this}match(e){return Object.entries(e).filter(([t,r])=>
516r!==void 0).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},M9=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:a=8e3}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=a}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:n}=t??{},a=r?"HEAD":"GET";let i=!1;const o=(e??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join(""),{url:l,headers:c}=this.cloneRequestState();return l.searchParams.set("select",o),n&&c.append("Prefer",`count=${n}`),new Ko({method:a,url:l,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const a="POST",{url:i,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),r||o.append("Prefer","missing=default"),Array.isArray(e)){const l=e.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(l.length>0){const c=[...new Set(l)].map(u=>`"${u}"`);i.searchParams.set("columns",c.join(","))}}return new Ko({method:a,url:i,headers:o,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:a=!0}={}){var i;const o="POST",{url:l,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&l.searchParams.set("on_conflict",t),n&&c.append("Prefer",`count=${n}`),a||c.append("Prefer","missing=default"),Array.isArray(e)){const u=e.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);l.searchParams.set("columns",d.join(","))}}return new Ko({method:o,url:l,headers:c,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit})}update(e,{count:t}={}){var r;const n="PATCH",{url:a,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new Ko({method:n,url:a,headers:i,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:a}=this.cloneRequestState();return e&&a.append("Prefer",`count=${e}`),new Ko({method:r,url:n,headers:a,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit})}};function Ad(e){"@babel/helpers - typeof";return Ad=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ad(e)}function I9(e,t){if(Ad(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Ad(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function D9(e){var t=I9(e,"string");return Ad(t)=="symbol"?t:t+""}function L9(e,t,r){return(t=D9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function _h(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lk(Object(r),!0).forEach(function(n){L9(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lk(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var F9=class hR{constructor(t,{headers:r={},schema:n,fetch:a,timeout:i,urlLengthLimit:o=8e3}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;const l=a??globalThis.fetch;i!==void 0&&i>0?this.fetch=(c,u)=>{const d=new AbortController,f=setTimeout(()=>d.abort(),i),h=u==null?void 0:u.signal;if(h){if(h.aborted)return clearTimeout(f),l(c,u);const p=()=>{clearTimeout(f),d.abort()};return h.addEventListener("abort",p,{once:!0}),l(c,_h(_h({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(f),h.removeEventListener("abort",p)})}return l(c,_h(_h({},u),{},{signal:d.signal})).finally(()=>clearTimeout(f))}:this.fetch=l}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new M9(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(t){return new hR(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(t,r={},{head:n=!1,get:a=!1,count:i}={}){var o;let l;const c=new URL(`${this.url}/rpc/${t}`);let u;const d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),f=n&&Object.values(r).some(d);f?(l="POST",u=r):n||a?(l=n?"HEAD":"GET",Object.entries(r).filter(([p,v])=>v!==void 0).map(([p,v])=>[p,Array.isArray(v)?`{${v.join(",")}}`:`${v}
516`]).forEach(([p,v])=>{c.searchParams.append(p,v)})):(l="POST",u=r);const h=new Headers(this.headers);return f?h.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&h.set("Prefer",`count=${i}`),new Ko({method:l,url:c,headers:h,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit})}};class B9{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const a=n.node,i=parseInt(a.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
517import ws from "ws"
518new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=`
519
520Suggested solution: ${t.workaround}`),new Error(r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const U9="2.100.0",z9=`realtime-js/${U9}`,q9="1.0.0",pR="2.0.0",W9=pR,H9=1e4,V9=100,Pi={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},mR={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},J0={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class K9{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const a=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,a)}_encodeJsonUserBroadcastPush(t){var r,n;const a=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(a)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,r,n){var a,i;const o=t.topic,l=(a=t.ref)!==null&&a!==void 0?a:"",c=(i=t.join_ref)!==null&&i!==void 0?i:"",u=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+o.length+u.length+f.length,p=new ArrayBuffer(this.HEADER_LENGTH+h);let v=new DataView(p),m=0;v.setUint8(m++,this.KINDS.userBroadcastPush),v.setUint8(m++,c.length),v.setUint8(m++,l.length),v.setUint8(m++,o.length),v.setUint8(m++,u.length),v.setUint8(m++,f.length),v.setUint8(m++,r),Array.from(c,y=>
520v.setUint8(m++,y.charCodeAt(0))),Array.from(l,y=>v.setUint8(m++,y.charCodeAt(0))),Array.from(o,y=>v.setUint8(m++,y.charCodeAt(0))),Array.from(u,y=>v.setUint8(m++,y.charCodeAt(0))),Array.from(f,y=>v.setUint8(m++,y.charCodeAt(0)));var g=new Uint8Array(p.byteLength+n.byteLength);return g.set(new Uint8Array(p),0),g.set(new Uint8Array(n),p.byteLength),g.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[a,i,o,l,c]=n;return r({join_ref:a,ref:i,topic:o,event:l,payload:c})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),a=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,a)}}_decodeUserBroadcast(t,r,n){const a=r.getUint8(1),i=r.getUint8(2),o=r.getUint8(3),l=r.getUint8(4);let c=this.HEADER_LENGTH+4;const u=n.decode(t.slice(c,c+a));c=c+a;const d=n.decode(t.slice(c,c+i));c=c+i;const f=n.decode(t.slice(c,c+o));c=c+o;const h=t.slice(c,t.byteLength),p=l===this.JSON_ENCODING?JSON.parse(n.decode(h)):h,v={type:this.BROADCAST_EVENT,event:d,payload:p};return o>0&&(v.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:v}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}var et;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(et||(et={}));const ck=(e,t,r={})=>{var n;const a=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=G9(o,e,t,a),i),{}):{}},G9=(e,t,r,n)=>{const a=t.find(l=>
vendor: 5,523 bytes, line 520
520l.name===e),i=a==null?void 0:a.type,o=r[e];return i&&!n.includes(i)?gR(i,o):Z0(o)},gR=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return J9(t,r)}switch(e){case et.bool:return Y9(t);case et.float4:case et.float8:case et.int2:case et.int4:case et.int8:case et.numeric:case et.oid:return X9(t);case et.json:case et.jsonb:return Q9(t);case et.timestamp:return Z9(t);case et.abstime:case et.date:case et.daterange:case et.int4range:case et.int8range:case et.money:case et.reltime:case et.text:case et.time:case et.timestamptz:case et.timetz:case et.tsrange:case et.tstzrange:return Z0(t);default:return Z0(t)}},Z0=e=>e,Y9=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},X9=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},Q9=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},J9=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let i;const o=e.slice(1,r);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(l=>gR(t,l))}return e},Z9=e=>typeof e=="string"?e.replace(" ","T"):e,vR=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var Ku=e=>typeof e=="function"?e:function(){return e},eW=typeof self<"u"?self:null,Go=typeof window<"u"?window:null,oa=eW||Go||globalThis,tW="2.0.0",rW=1e4,nW=1e3,da={connecting:0,open:1,closing:2,closed:3},Ar={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Ma={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},eb={longpoll:"longpoll",websocket:"websocket"},aW={complete:4},tb="base64url.bearer.phx.",Nh=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},yR=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},iW=class{constructor(e,t,r){this.state=Ar.closed,this.topic=e,this.params=Ku(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Nh(this,Ma.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new yR(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Ar.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=Ar.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Ar.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=Ar.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Nh(this,Ma.leave,Ku({}),this.timeout).send(),this.state=Ar.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Ma.reply,(n,a)=>{this.trigger(this.replyEventName(a),n)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}
vendor: 5,263 bytes, line 520
520teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Ar.closed,this.bindings=[]}onClose(e){this.on(Ma.close,e)}onError(e){return this.on(Ma.error,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>!(r.event===e&&(typeof t>"u"||t===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new Nh(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Ar.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Ma.close,"leave")},r=new Nh(this,Ma.leave,Ku({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic!==e?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Ar.joining,this.joinPush.resend(e))}trigger(e,t,r,n){let a=this.onMessage(e,t,r,n);if(t&&!a)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(o=>o.event===e&&this.filterBindings(o,t,r));for(let o=0;o<i.length;o++)i[o].callback(a,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Ar.closed}isErrored(){return this.state===Ar.errored}isJoined(){return this.state===Ar.joined}isJoining(){return this.state===Ar.joining}isLeaving(){return this.state===Ar.leaving}},rm=class{static request(e,t,r,n,a,i,o){if(oa.XDomainRequest){let l=new oa.XDomainRequest;return this.xdomainRequest(l,e,t,n,a,i,o)}else if(oa.XMLHttpRequest){let l=new oa.XMLHttpRequest;return this.xhrRequest(l,e,t,r,n,a,i,o)}else{if(oa.fetch&&oa.AbortController)return this.fetchRequest(e,t,r,n,a,i,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,r,n,a,i,o){let l={method:e,headers:r,body:n},c=null;return a&&(c=new AbortController,setTimeout(()=>c.abort(),a),l.signal=c.signal),oa.fetch(t,l).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>o&&o(u)).catch(u=>{u.name==="AbortError"&&i?i():o&&o(null)}),c}static xdomainRequest(e,t,r,n,a,i,o){return e.timeout=a,e.open(t,r),e.onload=()=>{let l=this.parseJSON(e.responseText);o&&o(l)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,a,i,o,l){e.open(t,r,!0),e.timeout=i;for(let[c,u]of Object.entries(n))e.setRequestHeader(c,u);return e.onerror=()=>l&&l(null),e.onreadystatechange=()=>{if(e.readyState===aW.complete&&l){let c=this.parseJSON(e.responseText);l(c)}},o&&(e.ontimeout=o),e.send(a),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let a=t?`${t}[${n}]`:n,i=e[n];typeof i=="object"?r.push(this.serialize(i,a)):r.push(encodeURIComponent(a)+"="+encodeURIComponent(i))}return r.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},sW=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let a=0;a<n;a++)t+=String.fromCharCode(r[a]);return btoa(t)},$o=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(tb)&&(this.authToken=atob(t[1].slice(tb.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=da.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+eb.websocket),"$1/"+eb.longpoll)}endpointURL(){return rm.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=da.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===da.open||this.readyState===da.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:r,token:n,messages:a}=t;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:a.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=da.open,this.onopen({}),this.poll();break;
520case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(e){typeof e!="string"&&(e=sW(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
521`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,r){for(let a of this.reqs)a.abort();this.readyState=da.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,a){let i,o=()=>{this.reqs.delete(i),n()};i=rm.request(e,this.endpointURL(),t,r,this.timeout,o,l=>{this.reqs.delete(i),this.isActive()&&a(l)}),this.reqs.add(i)}},oW=class Au{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,a=>{let{onJoin:i,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Au.syncState(this.state,a,i,o),this.pendingDiffs.forEach(c=>{this.state=Au.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],l()}),this.channel.on(n.diff,a=>{let{onJoin:i,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=Au.syncDiff(this.state,a,i,o),l())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return Au.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,r,n,a){let i=this.clone(t),o={},l={};return this.map(i,(c,u)=>{r[c]||(l[c]=u)}),this.map(r,(c,u)=>{let d=i[c];if(d){let f=u.metas.map(m=>m.phx_ref),h=d.metas.map(m=>m.phx_ref),p=u.metas.filter(m=>h.indexOf(m.phx_ref)<0),v=d.metas.filter(m=>f.indexOf(m.phx_ref)<0);p.length>0&&(o[c]=u,o[c].metas=p),v.length>0&&(l[c]=this.clone(d),l[c].metas=v)}else o[c]=u}),this.syncDiff(i,{joins:o,leaves:l},n,a)}static syncDiff(t,r,n,a){let{joins:i,leaves:o}=this.clone(r);return n||(n=function(){}),a||(a=function(){}),this.map(i,(l,c)=>{let u=t[l];if(t[l]=this.clone(c),u){let d=t[l].metas.map(h=>h.phx_ref),f=u.metas.filter(h=>d.indexOf(h.phx_ref)<0);t[l].metas.unshift(...f)}n(l,u,c)}),this.map(o,(l,c)=>{let u=t[l];if(!u)return;let d=c.metas.map(f=>f.phx_ref);u.metas=u.metas.filter(f=>d.indexOf(f.phx_ref)<0),a(l,u,c),u.metas.length===0&&delete t[l]}),t}static list(t,r){return r||(r=function(n,a){return a}),this.map(t,(n,a)=>r(n,a))}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static clone(t){return JSON.parse(JSON.stringify(t))}},kh={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,a,i,o]=JSON.parse(e);return t({join_ref:r,ref:n,topic:a,event:i,payload:o})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:a,payload:i}=e,o=this.META_LENGTH+t.length+r.length+a.length+n.length,l=new ArrayBuffer(this.HEADER_LENGTH+o),c=new DataView(l),u=0;c.setUint8(u++,this.KINDS.push),c.setUint8(u++,t.length),c.setUint8(u++,r.length),c.setUint8(u++,a.length),c.setUint8(u++,n.length),Array.from(t,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(r,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(a,f=>c.setUint8(u++,f.charCodeAt(0))),Array.from(n,f=>c.setUint8(u++,f.charCodeAt(0)));var d=new Uint8Array(l.byteLength+i.byteLength);return d.set(new Uint8Array(l),0),d.set(new Uint8Array(i),l.byteLength),d.buffer},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;
vendor: 8,595 bytes, line 521
521switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),a=t.getUint8(2),i=t.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,l=r.decode(e.slice(o,o+n));o=o+n;let c=r.decode(e.slice(o,o+a));o=o+a;let u=r.decode(e.slice(o,o+i));o=o+i;let d=e.slice(o,e.byteLength);return{join_ref:l,ref:null,topic:c,event:u,payload:d}},decodeReply(e,t,r){let n=t.getUint8(1),a=t.getUint8(2),i=t.getUint8(3),o=t.getUint8(4),l=this.HEADER_LENGTH+this.META_LENGTH,c=r.decode(e.slice(l,l+n));l=l+n;let u=r.decode(e.slice(l,l+a));l=l+a;let d=r.decode(e.slice(l,l+i));l=l+i;let f=r.decode(e.slice(l,l+o));l=l+o;let h=e.slice(l,e.byteLength),p={status:f,response:h};return{join_ref:c,ref:u,topic:d,event:Ma.reply,payload:p}},decodeBroadcast(e,t,r){let n=t.getUint8(1),a=t.getUint8(2),i=this.HEADER_LENGTH+2,o=r.decode(e.slice(i,i+n));i=i+n;let l=r.decode(e.slice(i,i+a));i=i+a;let c=e.slice(i,e.byteLength);return{join_ref:null,ref:null,topic:o,event:l,payload:c}}},lW=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||rW,this.transport=t.transport||oa.WebSocket||$o,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||oa&&oa.sessionStorage,this.establishedConnections=0,this.defaultEncoder=kh.encode.bind(kh),this.defaultDecoder=kh.decode.bind(kh),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==$o?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;Go&&Go.addEventListener&&(Go.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),r=this.connectClock)}),Go.addEventListener("pageshow",n=>{r===this.connectClock&&(r=null,this.connect())}),Go.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=n=>t.rejoinAfterMs?t.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>t.reconnectAfterMs?t.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(n,a,i)=>{console.log(`${n}: ${a}`,i)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Ku(t.params||{}),this.endPoint=`${e}/${eb.websocket}`,this.vsn=t.vsn||tW,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new yR(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return $o}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=rm.appendParams(rm.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Ku(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==$o?this.connectWithFallback($o,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(a=>{a.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){switch(e){case $o:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${tb}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,a,i,o=this.transportName(e),l=c=>{this.log("transport",`falling back to ${o}...`,c),this.off([a,i]),n=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return l("memorized");this.fallbackTimer=setTimeout(l,t),i=this.onError(c=>{this.log("transport","error",c),n&&!r&&(clearTimeout(this.fallbackTimer),l(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let c=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(l,t),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),nW,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();const n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){if(r===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r)}waitForSocketClosed(e,t,r=1){if(r===5||e.readyState===da.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError()}
521triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Ma.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case da.connecting:return"connecting";case da.open:return"open";case da.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([r])=>e.indexOf(r)===-1)}channel(e,t={}){let r=new iW(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:a,join_ref:i}=e;this.log("push",`${t} ${r} (${i}, ${a})`,n)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:r,event:n,payload:a,ref:i,join_ref:o}=t;if(i&&i===this.pendingHeartbeatRef){const l=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(a.status==="ok"?"ok":"error",l)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${a.status||""} ${r} ${n} ${i&&"("+i+")"||""}`.trim(),a);for(let l=0;l<this.channels.length;l++){const c=this.channels[l];c.isMember(r,n,a,o)&&c.trigger(n,a,i,o)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(a){this.log("error",`error in ${e} callback`,a)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r.isJoined()||r.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class Gu{constructor(t,r){const n=uW(r);this.presence=new oW(t.getChannel(),n),this.presence.onJoin((a,i,o)=>{const l=Gu.onJoinPayload(a,i,o);t.getChannel().trigger("presence",l)}),this.presence.onLeave((a,i,o)=>{const l=Gu.onLeavePayload(a,i,o);t.getChannel().trigger("presence",l)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return Gu.transformState(this.presence.state)}static transformState(t){return t=cW(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const a=t[n];return r[n]=hp(a),r},{})}static onJoinPayload(t,r,n){const a=uk(r),i=hp(n);return{event:"join",key:t,currentPresences:a,newPresences:i}}static onLeavePayload(t,r,n){const a=uk(r),i=hp(n);return{event:"leave",key:t,currentPresences:a,leftPresences:i}}}function hp(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function cW(e){return JSON.parse(JSON.stringify(e))}function uW(e){return(e==null?void 0:e.events)&&{events:e.events}}function uk(e){return e!=null&&e.metas?hp(e):[]}var dk;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(dk||(dk={}));class dW{get state(){return this.presenceAdapter.state}constructor(t,r){this.channel=t,this.presenceAdapter=new Gu(this.channel.channelAdapter,r)}}class fW{constructor(t,r,n){const a=hW(n);this.channel=t.getSocket().channel(r,a),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,r){return this.channel.on(t,r)}off(t,r){this.channel.off(t,r)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,r,n){let a;try{a=this.channel.push(t,r,n)}catch{throw`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`}if(this.channel.pushBuffer.length>V9){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return a}updateJoinPayload(t){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),t)}canPush(){return this.socket.isConnected()&&this.state===Pi.joined}isJoined(){return this.state===Pi.joined}isJoining(){return this.state===Pi.joining}isClosed(){return this.state===Pi.closed}isLeaving(){return this.state===Pi.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function hW(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var fk;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(fk||(fk={}));var Yu;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Yu||(Yu={}));var Ia;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"}
521)(Ia||(Ia={}));class Xu{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,r={config:{}},n){var a,i;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new fW(this.socket.socketAdapter,t,this.params),this.presence=new dW(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=vR(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(a=this.params.config)===null||a===void 0?void 0:a.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,r=this.timeout){var n,a,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:o,presence:l,private:c}}=this.params,u=(a=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(p=>p.filter))!==null&&a!==void 0?a:[],d=!!this.bindings[Yu.PRESENCE]&&this.bindings[Yu.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,f={},h={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:d}),postgres_changes:u,private:c};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(p=>{t==null||t(Ia.CHANNEL_ERROR,p)}),this._onClose(()=>t==null?void 0:t(Ia.CLOSED)),this.updateJoinPayload(Object.assign({config:h},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:p})=>{if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(Ia.SUBSCRIBED);return}this._updatePostgresBindings(p,t)}).receive("error",p=>{this.state=Pi.errored,t==null||t(Ia.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(Ia.TIMED_OUT)})}return this}_updatePostgresBindings(t,r){var n;const a=this.bindings.postgres_changes,i=(n=a==null?void 0:a.length)!==null&&n!==void 0?n:0,o=[];for(let l=0;l<i;l++){const c=a[l],{filter:{event:u,schema:d,table:f,filter:h}}=c,p=t&&t[l];if(p&&p.event===u&&Xu.isFilterValueEqual(p.schema,d)&&Xu.isFilterValueEqual(p.table,f)&&Xu.isFilterValueEqual(p.filter,h))o.push(Object.assign(Object.assign({},c),{id:p.id}));else{this.unsubscribe(),this.state=Pi.errored,r==null||r(Ia.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=Pi.errored&&r&&r(Ia.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){if(this.channelAdapter.isJoined()&&t===Yu.PRESENCE)throw this.socket.log("channel",`cannot add presence callbacks for ${this.topic} after joining.`),new Error("cannot add presence callbacks after joining a channel");return this._on(t,r,n)}async httpSend(t,r,n={}){var a;if(r==null)return Promise.reject("Payload is required for httpSend()");const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(a=n.timeout)!==null&&a!==void 0?a:this.timeout);if(l.status===202)return{success:!0};let c=l.statusText;try{const u=await l.json();c=u.error||u.message||c}catch{}return Promise.reject(new Error(c))}async send(t,r={}){var n,a;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
521in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=t,l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:l,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((a=u.body)===null||a===void 0?void 0:a.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,l,c;const u=this.channelAdapter.push(t.type,t,r.timeout||this.timeout);t.type==="broadcast"&&!(!((c=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,r,n){const a=new AbortController,i=setTimeout(()=>a.abort(),n),o=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:a.signal}));return clearTimeout(i),o}_on(t,r,n){const a=t.toLocaleLowerCase(),i=this.channelAdapter.on(t,n),o={type:a,filter:r,callback:n,ref:i};return this.bindings[a]?this.bindings[a].push(o):this.bindings[a]=[o],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,r,n)=>{var a,i,o,l,c,u,d;const f=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,n))return!1;const h=(a=this.bindings[f])===null||a===void 0?void 0:a.find(p=>p.ref===t.ref);if(!h)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in h){const p=h.id,v=(i=h.filter)===null||i===void 0?void 0:i.event;return p&&((o=r.ids)===null||o===void 0?void 0:o.includes(p))&&(v==="*"||(v==null?void 0:v.toLocaleLowerCase())===((l=r.data)===null||l===void 0?void 0:l.type.toLocaleLowerCase()))}else{const p=(u=(c=h==null?void 0:h.filter)===null||c===void 0?void 0:c.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return p==="*"||p===((d=r==null?void 0:r.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===f})}_notThisChannelEvent(t,r){const{close:n,error:a,leave:i,join:o}=mR;return r&&[n,a,i,o].includes(t)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,r,n)=>{if(typeof r=="object"&&"ids"in r){const a=r.data,{schema:i,table:o,commit_timestamp:l,type:c,errors:u}=a;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:l,eventType:c,new:{},old:{},errors:u}),this._getPayloadRecords(a))}return r})}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=ck(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=ck(t.columns,t.old_record)),r}}class pW{constructor(t,r){this.socket=new lW(t,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,r,n,a=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),a),this.socket.disconnect(()=>{t(),i("ok")},r,n)})}push(t){this.socket.push(t)}log(t,r,n){this.socket.log(t,r,n)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==J0.connecting}isDisconnecting(){return this.socket.connectionState()==J0.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const mW={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},gW=[1e3,2e3,5e3,1e4],vW=1e4,yW=`
522  addEventListener("message", (e) => {
523    if (e.data.event === "start") {
524      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
525    }
526  });`;class xW{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
526,this.ref=0,this.serializer=new K9,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=i=>i?(...o)=>i(...o):(...o)=>fetch(...o),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const a=this._initializeOptions(r);this.socketAdapter=new pW(t,a),this.httpEndpoint=vR(t),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const r=t.message;throw r.includes("Node.js")?new Error(`${r}
527
528To use Realtime in Node.js, you need to provide a WebSocket implementation:
529
530Option 1: Use Node.js 22+ which has native WebSocket support
531Option 2: Install and provide the "ws" package:
532
533  npm install ws
534
535  import ws from "ws"
536  const client = new RealtimeClient(url, {
537    ...options,
538    transport: ws
539  })`):new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,r){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,r)}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return r==="ok"&&t.teardown(),this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const t=this.channels.map(async n=>{const a=await n.unsubscribe();return n.teardown(),a}),r=await Promise.all(t);return this.disconnect(),r}log(t,r,n){this.socketAdapter.log(t,r,n)}connectionState(){return this.socketAdapter.connectionState()||J0.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,r={config:{}}){const n=`realtime:${t}`,a=this.getChannels().find(i=>i.topic===n);if(a)return a;{const i=new Xu(`realtime:${t}`,r,this);return this.channels.push(i),i}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic)}async _performAuth(t=null){let r,n=!1;if(t)r=t,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(a){this.log("error","Error fetching access token from callback",a),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(a=>{const i={access_token:r,version:z9};r&&a.updateJoinPayload(i),a.joinedOnce&&a.channelAdapter.isJoined()&&a.channelAdapter.push(mR.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(r,n)=>{r=="sent"&&this._setAuthSafely(),t&&t(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([yW],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(t){var r,n,a,i,o,l,c,u,d;this.worker=(r=t==null?void 0:t.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=t==null?void 0:t.accessToken)!==null&&n!==void 0?n:null;const f={};
539f.timeout=(a=t==null?void 0:t.timeout)!==null&&a!==void 0?a:H9,f.heartbeatIntervalMs=(i=t==null?void 0:t.heartbeatIntervalMs)!==null&&i!==void 0?i:mW.HEARTBEAT_INTERVAL,f.transport=(o=t==null?void 0:t.transport)!==null&&o!==void 0?o:B9.getWebSocketConstructor(),f.params=t==null?void 0:t.params,f.logger=t==null?void 0:t.logger,f.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),f.reconnectAfterMs=(l=t==null?void 0:t.reconnectAfterMs)!==null&&l!==void 0?l:m=>gW[m-1]||vW;let h,p;const v=(c=t==null?void 0:t.vsn)!==null&&c!==void 0?c:W9;switch(v){case q9:h=(m,g)=>g(JSON.stringify(m)),p=(m,g)=>g(JSON.parse(m));break;case pR:h=this.serializer.encode.bind(this.serializer),p=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${f.vsn}`)}if(f.vsn=v,f.encode=(u=t==null?void 0:t.encode)!==null&&u!==void 0?u:h,f.decode=(d=t==null?void 0:t.decode)!==null&&d!==void 0?d:p,f.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,f.params=Object.assign(Object.assign({},f.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,f.autoSendHeartbeat=!this.worker}return f}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Td=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function bW(e,t,r){const n=new URL(t,e);if(r)for(const[a,i]of Object.entries(r))i!==void 0&&n.searchParams.set(a,i);return n.toString()}async function wW(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function jW(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:a,body:i,headers:o}){const l=bW(e.baseUrl,n,a),c=await wW(e.auth),u=await t(l,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...c,...o},body:i?JSON.stringify(i):void 0}),d=await u.text(),f=(u.headers.get("content-type")||"").includes("application/json"),h=f&&d?JSON.parse(d):d;if(!u.ok){const p=f?h:void 0,v=p==null?void 0:p.error;throw new Td((v==null?void 0:v.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:v==null?void 0:v.type,icebergCode:v==null?void 0:v.code,details:p})}return{status:u.status,headers:u.headers,data:h}}}}function Oh(e){return e.join("�")}var SW=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Oh(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Oh(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Oh(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Oh(e.namespace)}`}),!0}catch(t){if(t instanceof Td&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Td&&r.status===409)return;throw r}}};function Ro(e){return e.join("�")}var _W=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ro(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ro(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Ro(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ro(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ro(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Ro(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Td&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Td&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},NW=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=jW({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new SW(this.client,t),this.tableOps=new _W(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
539async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},Ug=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}};function zg(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var rb=class extends Ug{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},xR=class extends Ug{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const kW=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),OW=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},nb=e=>{if(Array.isArray(e))return e.map(r=>nb(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const a=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[a]=nb(n)}),t},CW=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function $d(e){"@babel/helpers - typeof";return $d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$d(e)}function EW(e,t){if($d(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if($d(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PW(e){var t=EW(e,"string");return $d(t)=="symbol"?t:t+""}function AW(e,t,r){return(t=PW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function je(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hk(Object(r),!0).forEach(function(n){AW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hk(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const pk=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},TW=async(e,t,r,n)=>{if(e!==null&&typeof e=="object"&&typeof e.json=="function"){const a=e;let i=parseInt(a.status,10);Number.isFinite(i)||(i=500),a.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";t(new rb(pk(o),i,l,n))}).catch(()=>{const o=i+"";t(new rb(a.statusText||`HTTP ${i} error`,i,o,n))})}else t(new xR(pk(e),e,n))},$W=(e,t,r,n)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!n?je(je({},a),r):(OW(n)?(a.headers=je({"Content-Type":"application/json"},t==null?void 0:t.headers),a.body=JSON.stringify(n)):a.body=n,t!=null&&t.duplex&&(a.duplex=t.duplex),je(je({},a),r))};async function hu(e,t,r,n,a,i,o){return new Promise((l,c)=>{e(r,$W(t,n,a,i)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;if(o==="vectors"){const d=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!d||!d.includes("application/json"))return{}}return u.json()}).then(u=>l(u)).catch(u=>TW(u,c,n,o))})}function bR(e="storage"){return{get:async(t,r,n,a)=>hu(t,"GET",r,n,a,void 0,e),post:async(t,r,n,a,i)=>hu(t,"POST",r,a,i,n,e),put:async(t,r,n,a,i)=>hu(t,"PUT",r,a,i,n,e),head:async(t,r,n,a)=>hu(t,"HEAD",r,je(je({},n),{},{noResolveJson:!0}),a,void 0,e),remove:async(t,r,n,a,i)=>hu(t,"DELETE",r,a,i,n,e)}}const RW=bR("storage"),{get:Rd,post:Fn,put:ab,head:MW,remove:Nj}=RW,Gr=bR("vectors");var zc=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=kW(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=je(je({},this.headers),{},{[e]:t}),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(zg(r))return{data:null,error:r};throw r}}},IW=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(zg(t))return{data:null,error:t};throw t}}};let wR;wR=Symbol.toStringTag;var DW=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[wR]="BlobDownloadBuilder",this.promise=null}asStream(){return new IW(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(zg(t))return{data:null,error:t};throw t}}};const LW={limit:100,offset:0,sortBy:{column:"name",order:"asc"}}
539,mk={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var FW=class extends zc{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var a=this;return a.handleOperation(async()=>{let i;const o=je(je({},mk),n);let l=je(je({},a.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",a.encodeMetadata(c)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),c&&!i.has("metadata")&&i.append("metadata",a.encodeMetadata(c))):(i=r,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,c&&(l["x-metadata"]=a.toBase64(a.encodeMetadata(c))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),n!=null&&n.headers&&(l=je(je({},l),n.headers));const u=a._removeEmptyFolders(t),d=a._getFinalPath(u),f=await(e=="PUT"?ab:Fn)(a.fetch,`${a.url}/object/${d}`,i,je({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:f.Id,fullPath:f.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var a=this;const i=a._removeEmptyFolders(e),o=a._getFinalPath(i),l=new URL(a.url+`/object/upload/sign/${o}`);return l.searchParams.set("token",t),a.handleOperation(async()=>{let c;const u=je({upsert:mk.upsert},n),d=je(je({},a.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),c.append("",r)):typeof FormData<"u"&&r instanceof FormData?(c=r,c.append("cacheControl",u.cacheControl)):(c=r,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType),{path:i,fullPath:(await ab(a.fetch,l.toString(),c,{headers:d})).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e);const a=je({},r.headers);t!=null&&t.upsert&&(a["x-upsert"]="true");const i=await Fn(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:a}),o=new URL(r.url+i.url),l=o.searchParams.get("token");if(!l)throw new Ug("No token returned by API");return{signedUrl:o.toString(),path:e,token:l}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await Fn(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
539stinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await Fn(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let a=n._getFinalPath(e);const i=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let o=await Fn(n.fetch,`${n.url}/object/sign/${a}`,je({expiresIn:t},i?{transform:r.transform}:{}),{headers:n.headers});const l=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"",c=i&&o.signedURL.includes("/object/sign/")?o.signedURL.replace("/object/sign/","/render/image/sign/"):o.signedURL;return{signedUrl:encodeURI(`${n.url}${c}${l}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{const a=await Fn(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return a.map(o=>je(je({},o),{},{signedUrl:o.signedURL?encodeURI(`${n.url}${o.signedURL}${i}`):null}))})}download(e,t,r){const n=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",a=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),i=a?`?${a}`:"",o=this._getFinalPath(e),l=()=>Rd(this.fetch,`${this.url}/${n}/${o}${i}`,{headers:this.headers,noResolveJson:!0},r);return new DW(l,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>nb(await Rd(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await MW(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(a){if(t.shouldThrowOnError)throw a;if(zg(a)){var n;const i=a instanceof rb?a.status:a instanceof xR?(n=a.originalError)===null||n===void 0?void 0:n.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:a}}throw a}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=[],a=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";a!==""&&n.push(a);const i=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",o=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});o!==""&&n.push(o);let l=n.join("&");return l!==""&&(l=`?${l}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}${l}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await Nj(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var n=this;return n.handleOperation(async()=>{const a=je(je(je({},LW),t),{},{prefix:e||""});return await Fn(n.fetch,`${n.url}/object/list/${n.bucketId}`,a,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const n=je({},e);return await Fn(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const BW="2.100.0",Lf={"X-Client-Info":`storage-js/${BW}`};var UW=class extends zc{constructor(e,t={},r,n){const a=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase."));const i=a.href.replace(/\/$/,""),o=je(je({},Lf),t);super(i,o,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await Rd(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Rd(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await Fn(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await ab(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Fn(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Nj(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},zW=class extends zc{constructor(e,t={},r){const n=e.replace(/\/$/,""),a=je(je({},Lf),t);super(n,a,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Fn(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>
539{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),a=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await Rd(t.fetch,a,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Nj(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!CW(e))throw new Ug("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new NW({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(a,i){const o=a[i];return typeof o!="function"?o:async(...l)=>{try{return{data:await o.apply(a,l),error:null}}catch(c){if(n)throw c;return{data:null,error:c}}}}})}},qW=class extends zc{constructor(e,t={},r){const n=e.replace(/\/$/,""),a=je(je({},Lf),{},{"Content-Type":"application/json"},t);super(n,a,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await Gr.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await Gr.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},WW=class extends zc{constructor(e,t={},r){const n=e.replace(/\/$/,""),a=je(je({},Lf),{},{"Content-Type":"application/json"},t);super(n,a,r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},HW=class extends zc{constructor(e,t={},r){const n=e.replace(/\/$/,""),a=je(je({},Lf),{},{"Content-Type":"application/json"},t);super(n,a,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Gr.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},VW=class extends HW{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new KW(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},KW=class extends qW{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,je(je({},e),{},{vectorBucketName:r.vectorBucketName}))}
539async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,je(je({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new GW(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},GW=class extends WW{constructor(e,t,r,n,a){super(e,t,a),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,je(je({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,je(je({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,je(je({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,je(je({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,je(je({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},YW=class extends UW{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new FW(this.url,this.headers,e,this.fetch)}get vectors(){return new VW(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new zW(this.url+"/iceberg",this.headers,this.fetch)}};const jR="2.100.0",Yo=30*1e3,ib=3,Vy=ib*Yo,XW="http://localhost:9999",QW="supabase.auth.token",JW={"X-Client-Info":`gotrue-js/${jR}`},sb="X-Supabase-Api-Version",SR={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},ZW=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,eH=10*60*1e3;class Md extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function fe(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class tH extends Md{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function rH(e){return fe(e)&&e.name==="AuthApiError"}class As extends Md{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class di extends Md{constructor(t,r,n,a){super(t,n,a),this.name=r,this.status=n}}class qr extends di{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Ky(e){return fe(e)&&e.name==="AuthSessionMissingError"}class Mo extends di{constructor(){super("Auth session or user missing","AuthInvalidToken
539ResponseError",500,void 0)}}class Ch extends di{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Eh extends di{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function nH(e){return fe(e)&&e.name==="AuthImplicitGrantRedirectError"}class gk extends di{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class aH extends di{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class ob extends di{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function Gy(e){return fe(e)&&e.name==="AuthRetryableFetchError"}class vk extends di{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class lb extends di{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const nm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),yk=` 	
540\r=`.split(""),iH=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<yk.length;t+=1)e[yk[t].charCodeAt(0)]=-2;for(let t=0;t<nm.length;t+=1)e[nm[t].charCodeAt(0)]=t;return e})();function xk(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(nm[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(nm[n]),t.queuedBits-=6}}function _R(e,t,r){const n=iH[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function bk(e){const t=[],r=o=>{t.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},i=o=>{lH(o,n,r)};for(let o=0;o<e.length;o+=1)_R(e.charCodeAt(o),a,i);return t.join("")}function sH(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function oH(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const a=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|a)+65536,r+=1}sH(n,t)}}function lH(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&r(t.codepoint)}}function Ol(e){const t=[],r={queue:0,queuedBits:0},n=a=>{t.push(a)};for(let a=0;a<e.length;a+=1)_R(e.charCodeAt(a),r,n);return new Uint8Array(t)}function cH(e){const t=[];return oH(e,r=>t.push(r)),new Uint8Array(t)}function Is(e){const t=[],r={queue:0,queuedBits:0},n=a=>{t.push(a)};return e.forEach(a=>xk(a,r,n)),xk(null,r,n),t.join("")}function uH(e){return Math.round(Date.now()/1e3)+e}function dH(){return Symbol("auth-callback")}const Jt=()=>typeof window<"u"&&typeof document<"u",xs={tested:!1,writable:!1},NR=()=>{if(!Jt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(xs.tested)return xs.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),xs.tested=!0,xs.writable=!0}catch{xs.tested=!0,xs.writable=!1}return xs.writable};function fH(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEac
540h((a,i)=>{t[i]=a})}catch{}return r.searchParams.forEach((n,a)=>{t[a]=n}),t}const kR=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),hH=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Xo=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},bs=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Qt=async(e,t)=>{await e.removeItem(t)};class qg{constructor(){this.promise=new qg.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}qg.promiseConstructor=Promise;function Ph(e){const t=e.split(".");if(t.length!==3)throw new lb("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!ZW.test(t[n]))throw new lb("JWT not in base64url format");return{header:JSON.parse(bk(t[0])),payload:JSON.parse(bk(t[1])),signature:Ol(t[2]),raw:{header:t[0],payload:t[1]}}}async function pH(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function mH(e,t){return new Promise((n,a)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){n(o);return}}catch(o){if(!t(i,o)){a(o);return}}})()})}function gH(e){return("0"+e.toString(16)).substr(-2)}function vH(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let a="";for(let i=0;i<56;i++)a+=r.charAt(Math.floor(Math.random()*n));return a}return crypto.getRandomValues(t),Array.from(t,gH).join("")}async function yH(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),a=new Uint8Array(n);return Array.from(a).map(i=>String.fromCharCode(i)).join("")}async function xH(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const r=await yH(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Io(e,t,r=!1){const n=vH();let a=n;r&&(a+="/PASSWORD_RECOVERY"),await Xo(e,`${t}-code-verifier`,a);const i=await xH(n);return[i,n===i?"plain":"s256"]}const bH=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function wH(e){const t=e.headers.get(sb);if(!t||!t.match(bH))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function jH(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function SH(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const _H=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Do(e){if(!_H.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Yy(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function NH(e,t){return new Proxy(e,{get:(r,n,a)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,a)}return!t.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(r,n,a)}})}function wk(e){return JSON.parse(JSON.stringify(e))}const ks=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),kH=[502,503,504];async function jk(e){var t;if(!hH(e))throw new ob(ks(e),0);if(kH.includes(e.status))throw new ob(ks(e),e.status);let r;try{r=await e.json()}catch(i){throw new As(ks(i),i)}let n;const a=wH(e);if(a&&a.getTime()>=SR["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new vk(ks(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new qr}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((i,o)=>
540i&&typeof o=="string",!0))throw new vk(ks(r),e.status,r.weak_password.reasons);throw new tH(ks(r),e.status||500,n)}const OH=(e,t,r,n)=>{const a={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),a.body=JSON.stringify(n),Object.assign(Object.assign({},a),r))};async function be(e,t,r,n){var a;const i=Object.assign({},n==null?void 0:n.headers);i[sb]||(i[sb]=SR["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const o=(a=n==null?void 0:n.query)!==null&&a!==void 0?a:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await CH(e,t,r+l,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(c):{data:Object.assign({},c),error:null}}async function CH(e,t,r,n,a,i){const o=OH(t,n,a,i);let l;try{l=await e(r,Object.assign({},o))}catch(c){throw console.error(c),new ob(ks(c),0)}if(l.ok||await jk(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(c){await jk(c)}}function Mn(e){var t;let r=null;AH(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=uH(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function Sk(e){const t=Mn(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Ai(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function EH(e){return{data:e,error:null}}function PH(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:a,verification_type:i}=e,o=Uc(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:t,email_otp:r,hashed_token:n,redirect_to:a,verification_type:i},c=Object.assign({},o);return{data:{properties:l,user:c},error:null}}function _k(e){return e}function AH(e){return e.access_token&&e.refresh_token&&e.expires_in}const Xy=["global","local","others"];class TH{constructor({url:t="",headers:r={},fetch:n}){this.url=t,this.headers=r,this.fetch=kR(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(t,r=Xy[0]){if(Xy.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Xy.join(", ")}`);try{return await be(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(fe(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await be(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Ai})}catch(n){if(fe(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=Uc(t,["options"]),a=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(a.new_email=n==null?void 0:n.newEmail,delete a.newEmail),await be(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:PH,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(fe(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await be(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Ai})}catch(r){if(fe(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,a,i,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await be(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:_k});if(d.error)throw d.error;const f=await d.json(),h=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>
5400&&(p.forEach(v=>{const m=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(v.split(";")[1].split("=")[1]);u[`${g}Page`]=m}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(fe(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){Do(t);try{return await be(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Ai})}catch(r){if(fe(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){Do(t);try{return await be(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:Ai})}catch(n){if(fe(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){Do(t);try{return await be(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:Ai})}catch(n){if(fe(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){Do(t.userId);try{const{data:r,error:n}=await be(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:r,error:n}}catch(r){if(fe(r))return{data:null,error:r};throw r}}async _deleteFactor(t){Do(t.userId),Do(t.id);try{return{data:await be(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(fe(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,a,i,o,l,c;try{const u={nextPage:null,lastPage:0,total:0},d=await be(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(a=t==null?void 0:t.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:_k});if(d.error)throw d.error;const f=await d.json(),h=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(c=(l=d.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&c!==void 0?c:[];return p.length>0&&(p.forEach(v=>{const m=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),g=JSON.parse(v.split(";")[1].split("=")[1]);u[`${g}Page`]=m}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},f),u),error:null}}catch(u){if(fe(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(t){try{return await be(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(fe(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await be(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(fe(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await be(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(fe(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await be(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(fe(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await be(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(fe(r))return{data:null,error:r};throw r}}async _listCustomProviders(t){try{const r={};return t!=null&&t.type&&(r.type=t.type),await be(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var a;return{data:{providers:(a=n==null?void 0:n.providers)!==null&&a!==void 0?a:[]},error:null}}})}catch(r){if(fe(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(t){try{return await be(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(fe(r))return{data:null,error:r};throw r}}async _getCustomProvider(t){try{return await be(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(fe(r))return{data:null,error:r};throw r}}async _updateCustomProvider(t,r){try{return await be(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(fe(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(t){try{return await be(this.fetch,"DELET
540E",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(fe(r))return{data:null,error:r};throw r}}}function Nk(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const ia={debug:!!(globalThis&&NR()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class OR extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class kk extends OR{}async function $H(e,t,r){ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;let a;t>0&&(a=setTimeout(()=>{n.abort(),ia.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){clearTimeout(a),ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await r()}finally{ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new kk(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(ia.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null,"  "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(a),await r()}})}catch(i){if(t>0&&clearTimeout(a),(i==null?void 0:i.name)==="AbortError"&&t>0){if(n.signal.aborted)return ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async o=>{if(o){ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,o.name);try{return await r()}finally{ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw ia.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new kk(`Lock "${e}" was released because another request stole it`)}throw i}}function RH(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function CR(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function MH(e){return parseInt(e,16)}function IH(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function DH(e){var t;const{chainId:r,domain:n,expirationTime:a,issuedAt:i=new Date,nonce:o,notBefore:l,requestId:c,resources:u,scheme:d,uri:f,version:h}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!f)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);
540if(!((t=e.statement)===null||t===void 0)&&t.includes(`
541`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=CR(e.address),v=d?`${d}://${n}`:n,m=e.statement?`${e.statement}
542`:"",g=`${v} wants you to sign in with your Ethereum account:
543${p}
544
545${m}`;let y=`URI: ${f}
546Version: ${h}
547Chain ID: ${r}${o?`
548Nonce: ${o}`:""}
549Issued At: ${i.toISOString()}`;if(a&&(y+=`
550Expiration Time: ${a.toISOString()}`),l&&(y+=`
551Not Before: ${l.toISOString()}`),c&&(y+=`
552Request ID: ${c}`),u){let x=`
553Resources:`;for(const w of u){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);x+=`
554- ${w}`}y+=x}return`${g}
555${y}`}class Et extends Error{constructor({message:t,code:r,cause:n,name:a}){var i;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(i=a??(n instanceof Error?n.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=r}}class am extends Et{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function LH({error:e,options:t}){var r,n,a;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Et({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=i.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Et({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=i.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Et({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((a=i.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new Et({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Et({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Et({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return i.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new Et({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Et({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const o=window.location.hostname;if(ER(o)){if(i.rp.id!==o)return new Et({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Et({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new Et({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Et({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Et({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function FH({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Et({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Et({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(ER(n)){if(r.rpId!==n)return new Et({message:`The RP ID "${r.rpId}
555" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Et({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Et({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Et({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class BH{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const UH=new BH;function zH(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,a=Uc(e,["challenge","user","excludeCredentials"]),i=Ol(t).buffer,o=Object.assign(Object.assign({},r),{id:Ol(r.id).buffer}),l=Object.assign(Object.assign({},a),{challenge:i,user:o});if(n&&n.length>0){l.excludeCredentials=new Array(n.length);for(let c=0;c<n.length;c++){const u=n[c];l.excludeCredentials[c]=Object.assign(Object.assign({},u),{id:Ol(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return l}function qH(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,n=Uc(e,["challenge","allowCredentials"]),a=Ol(t).buffer,i=Object.assign(Object.assign({},n),{challenge:a});if(r&&r.length>0){i.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const l=r[o];i.allowCredentials[o]=Object.assign(Object.assign({},l),{id:Ol(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return i}function WH(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:Is(new Uint8Array(e.response.attestationObject)),clientDataJSON:Is(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function HH(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),a=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Is(new Uint8Array(a.authenticatorData)),clientDataJSON:Is(new Uint8Array(a.clientDataJSON)),signature:Is(new Uint8Array(a.signature)),userHandle:a.userHandle?Is(new Uint8Array(a.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function ER(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Ok(){var e,t;return!!(Jt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function VH(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new am("Browser returned unexpected credential type",t)}:{data:null,error:new am("Empty credential response",t)}}catch(t){return{data:null,error:LH({error:t,options:e})}}}async function KH(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new am("Browser returned unexpected credential type",t)}:{data:null,error:new am("Empty credential response",t)}}
555catch(t){return{data:null,error:FH({error:t,options:e})}}}const GH={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},YH={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function im(...e){const t=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),r=a=>a instanceof ArrayBuffer||ArrayBuffer.isView(a),n={};for(const a of e)if(a)for(const i in a){const o=a[i];if(o!==void 0)if(Array.isArray(o))n[i]=o;else if(r(o))n[i]=o;else if(t(o)){const l=n[i];t(l)?n[i]=im(l,o):n[i]=im(o)}else n[i]=o}return n}function XH(e,t){return im(GH,e,t||{})}function QH(e,t){return im(YH,e,t||{})}class JH{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:a},i){var o;try{const{data:l,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!l)return{data:null,error:c};const u=a??UH.createNewAbortSignal();if(l.webauthn.type==="create"){const{user:d}=l.webauthn.credential_options.publicKey;if(!d.name){const f=n;if(f)d.name=`${d.id}:${f}`;else{const p=(await this.client.getUser()).data.user,v=((o=p==null?void 0:p.user_metadata)===null||o===void 0?void 0:o.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";d.name=`${d.id}:${v}`}}d.displayName||(d.displayName=d.name)}switch(l.webauthn.type){case"create":{const d=XH(l.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:f,error:h}=await VH({publicKey:d,signal:u});return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}case"request":{const d=QH(l.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:f,error:h}=await KH(Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:d,signal:u}));return f?{data:{factorId:t,challengeId:l.id,webauthn:{type:l.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}}}catch(l){return fe(l)?{data:null,error:l}:{data:null,error:new As("Unexpected error in challenge",l)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},i){if(!r)return{data:null,error:new Md("rpId is required for WebAuthn authentication")};try{if(!Ok())return{data:null,error:new As("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:a},{request:i});if(!o)return{data:null,error:l};const{webauthn:c}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:c.type,rpId:r,rpOrigins:n,credential_response:c.credential_response}})}catch(o){return fe(o)?{data:null,error:o}:{data:null,error:new As("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},i){if(!r)return{data:null,error:new Md("rpId is required for WebAuthn registration")};try{if(!Ok())return{data:null,error:new As("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:t});if(!o)return await this.client.mfa.listFactors().then(d=>{var f;return(f=d.data)===null||f===void 0?void 0:f.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===t&&h.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:l};const{data:c,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:a},{create:i});return c?this._verify({factorId:o.id,challengeId:c.challengeId,webauthn:{rpId:r,rpOrigins:n,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:u}}catch(o){return fe(o)?{data:null,error:o}:{data:null,error:new As("Unexpected error in register",o)}}}}RH();const ZH={url:XW,storageKey:QW,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:JW,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function Ck(e,t,r){return await r()}const Lo={};class Id{get jwks(){var t,r;return(r=(t=Lo[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Lo[this.storageKey]=Object.assign(Object.assign({},Lo[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Lo[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Lo[this.storageKey]=Object.assign(Object.assign({},Lo[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,a;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},ZH),t);if(this.storageKey=i.storageKey,this.instanceID=(r=Id.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Id.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&Jt()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new TH({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=kR(i.fetch),this.lock=i.lock||Ck,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock?this.lock=i.lock:this.persistSession&&Jt()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=$H:this.lock=Ck,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new JH(this)}
555,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:NR()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Nk(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=Nk(this.memoryStorage)),Jt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}i.skipAutoInitialize||this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${jR}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(Jt()&&(r=fH(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Jt()&&this.detectSessionInUrl&&n!=="none"){const{data:a,error:i}=await this._getSessionFromURL(r,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),nH(i)){const c=(t=i.details)===null||t===void 0?void 0:t.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:o,redirectType:l}=a;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return fe(r)?this._returnResult({error:r}):this._returnResult({error:new As("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,a;try{const i=await be(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}},xform:Mn}),{data:o,error:l}=i;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(fe(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var r,n,a;try{let i;if("email"in t){const{email:d,password:f,options:h}=t;let p=null,v=null;this.flowType==="pkce"&&([p,v]=await Io(this.storage,this.storageKey)),i=await be(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:d,password:f,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:p,code_challenge_method:v},xform:Mn})}else if("phone"in t){const{phone:d,password:f,options:h}=t;i=await be(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},channel:(a=h==null?void 0:h.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:Mn})}else throw new Ch("You must provide either an email or phone number and a password");const{data:o,error:l}=i;if(l||!o)return await Qt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l});const c=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(i){if(await Qt(this.storage,`${this.storageKey}-code-verifier`),fe(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(t){try{let r;if("email"in t){const{email:i,password:o,options:l}=t;r=await be(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:Sk})}else if("phone"in t){const{phone:i,password:o,options:l}=t;r=await be(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:Sk})}else throw new Ch("You must provide either an email or phone number and a password");const{data:n,error:a}=r;if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!n||!n.session||!n.user){const i=new Mo;return this._returnResult({data:{user:null,session:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:a})}catch(r){if(fe(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,a,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(a=t.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,a,i,o,l,c,u,d,f,h;let p,v;if("message"in t)p=t.message,v=t.signature;else{const{chain:m,wallet:g,statement:y,options:x}=t;let w;if(Jt())if(typeof g=="object")w=g;else{const O=window;if("ethereum"in O&&typeof O.ethereum=="object"&&"request"in O.ethereum&&typeof O.ethereum.request=="function")w=O.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof g!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=g}const S=new URL((r=x==null?void 0:x.url)!==null&&r!==void 0?r:window.location.href),j=await w.request({method:"eth_requestAccounts"}).then(O=>O).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!j||j.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const _=CR(j[0]);let N=(n=x==null?void 0:x.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!N){const O=await w.request({method:"eth_chainId"});N=MH(O)}const k={domain:S.host,address:_,statement:y,uri:S.href,version:"1",chainId:N,nonce:(a=x==null?void 0:x.signInWithEthereum)===null||a===void 0?void 0:a.nonce,issuedAt:(o=(i=x==null?void 0:x.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=x==null?void 0:x.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(c=x==null?void 0:x.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(u=x==null?void 0:x.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(d=x==null?void 0:x.signInWithEthereum)===null||d===void 0?void 0:d.resources};p=DH(k),v=await w.request({method:"personal_sign",params:[IH(p),_]})}try{const{data:m,error:g}=await be(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:v},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:Mn});if(g)throw g;if(!m||!m.session||!m.user){const y=new Mo;return this._returnResult({data:{user:null,session:null},error:y})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:g})}catch(m){if(fe(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(t){var r,n,a,i,o,l,c,u,d,f,h,p;let v,m;if("message"in t)v=t.message,m=t.signature;else{const{chain:g,wallet:y,statement:x,options:w}=t;let S;if(Jt())if(typeof y=="object")S=y;else{const _=window;if("solana"in _&&typeof _.solana=="object"&&("signIn"in _.solana&&typeof _.solana.signIn=="function"||"signMessage"in _.solana&&typeof _.solana.signMessage=="function"))S=_.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof y!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=y}const j=new URL((r=w==null?void 0:w.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in S&&S.signIn){const _=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:j.host,uri:j.href}),x?{statement:x}:null));let N;if(Array.isArray(_)&&_[0]&&typeof _[0]=="object")N=_[0];else if(_&&typeof _=="object"&&"signedMessage"in _&&"signature"in _)N=_;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in N&&"signature"in N&&(typeof N.signedMessage=="string"||N.signedMessage instanceof Uint8Array)&&N.signature instanceof Uint8Array)v=typeof N.signedMessage=="string"?N.signedMessage:new TextDecoder().decode(N.signedMessage),m=N.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");v=[`${j.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...x?["",x,""]:[""],"Version: 1",`URI: ${j.href}`,`Issued At: ${(a=(n=w==null?void 0:w.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((i=w==null?void 0:w.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((c=w==null?void 0:w.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((u=w==null?void 0:w.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((f=(d=w==null?void 0:w.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...w.sign
555InWithSolana.resources.map(N=>`- ${N}`)]:[]].join(`
556`);const _=await S.signMessage(new TextEncoder().encode(v),"utf8");if(!_||!(_ instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=_}}try{const{data:g,error:y}=await be(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:Is(m)},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Mn});if(y)throw y;if(!g||!g.session||!g.user){const x=new Mo;return this._returnResult({data:{user:null,session:null},error:x})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:y})}catch(g){if(fe(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async _exchangeCodeForSession(t){const r=await bs(this.storage,`${this.storageKey}-code-verifier`),[n,a]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new aH;const{data:i,error:o}=await be(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:Mn});if(await Qt(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const l=new Mo;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:a??null}),error:o})}catch(i){if(await Qt(this.storage,`${this.storageKey}-code-verifier`),fe(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(t){try{const{options:r,provider:n,token:a,access_token:i,nonce:o}=t,l=await be(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:a,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Mn}),{data:c,error:u}=l;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!c||!c.session||!c.user){const d=new Mo;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:u})}catch(r){if(fe(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,a,i,o;try{if("email"in t){const{email:l,options:c}=t;let u=null,d=null;this.flowType==="pkce"&&([u,d]=await Io(this.storage,this.storageKey));const{error:f}=await be(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=c==null?void 0:c.data)!==null&&r!==void 0?r:{},create_user:(n=c==null?void 0:c.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:u,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in t){const{phone:l,options:c}=t,{data:u,error:d}=await be(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(a=c==null?void 0:c.data)!==null&&a!==void 0?a:{},create_user:(i=c==null?void 0:c.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(o=c==null?void 0:c.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new Ch("You must provide either an email or phone number.")}catch(l){if(await Qt(this.storage,`${this.storageKey}-code-verifier`),fe(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(t){var r,n;try{let a,i;"options"in t&&(a=(r=t.options)===null||r===void 0?void 0:r.redirectTo,i=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:l}=await be(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:a,xform:Mn});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,u=o.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:u,session:c},error:null})}catch(a){if(fe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithSSO(t){var r,n,a,i,o;try{let l=null,c=null;this.flowType==="pkce"&&([l,c]=await Io(this.storage,this.storageKey));const u=await be(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((a=t==null?void 0:t.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:c}),headers:this.headers,xform:EH});return!((i=u.data)===null||i===void 0)&&i.url&&Jt()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(l){if(await Qt(this.storage,`${this.storageKey}-code-verifier`),fe(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new qr;const{error:a}=await be(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:a})})}catch(t){if(fe(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:a,options:i}=t,{error:o}=await be(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:n,type:a,options:i}=t,{data:o,error:l}=await be(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new Ch("You must provide either an email or phone number and a type")}catch(r){if(fe(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await bs(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
556id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<Vy:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const o=await bs(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=Yy()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=NH(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:a},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await be(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Ai}):await this._useSession(async r=>{var n,a,i;const{data:o,error:l}=r;if(l)throw l;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new qr}:await be(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(a=o.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0,xform:Ai})})}catch(r){if(fe(r))return Ky(r)&&(await this._removeSession(),await Qt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r))}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:a,error:i}=n;if(i)throw i;if(!a.session)throw new qr;const o=a.session;let l=null,c=null;this.flowType==="pkce"&&t.email!=null&&([l,c]=await Io(this.storage,this.storageKey));const{data:u,error:d}=await be(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:l,code_challenge_method:c}),jwt:o.access_token,xform:Ai});if(d)throw d;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(await Qt(this.storage,`${this.storageKey}-code-verifier`),fe(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new qr;const r=Date.now()/1e3;let n=r,a=!0,i=null;const{payload:o}=Ph(t.access_token);if(o.exp&&(n=o.exp,a=n<=r),a){const{data:l,error:c}=await this._callRefreshToken(t.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l)return{data:{user:null,session:null},error:null};i=l}else{const{data:l,error:c}=await this._getUser(t.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});i={access_token:t.access_token,refresh_token:t.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(r){if(fe(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:o,error:l}=r;if(l)throw l;t=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new qr;const{data:a,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):a?this._returnResult({data:{user:a.user,session:a},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(fe(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){try{if(!Jt())throw new Eh("No browser detected.");
556if(t.error||t.error_description||t.error_code)throw new Eh(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new gk("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Eh("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new gk("No code detected.");const{data:x,error:w}=await this._exchangeCodeForSession(t.code);if(w)throw w;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:x.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:a,access_token:i,refresh_token:o,expires_in:l,expires_at:c,token_type:u}=t;if(!i||!l||!o||!u)throw new Eh("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(l);let h=d+f;c&&(h=parseInt(c));const p=h-d;p*1e3<=Yo&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${f}s`);const v=h-f;d-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,h,d):d-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,h,d);const{data:m,error:g}=await this._getUser(i);if(g)throw g;const y={provider_token:n,provider_refresh_token:a,access_token:i,expires_in:f,expires_at:h,refresh_token:o,token_type:u,user:m.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(n){if(fe(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const r=await bs(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:a,error:i}=r;if(i&&!Ky(i))return this._returnResult({error:i});const o=(n=a.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:l}=await this.admin.signOut(o,t);if(l&&!(rH(l)&&(l.status===404||l.status===401||l.status===403)||Ky(l)))return this._returnResult({error:l})}return t!=="others"&&(await this._removeSession(),await Qt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=dH(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,a;try{const{data:{session:i},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){await((a=this.stateChangeEmitters.get(t))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",i),console.error(i)}})}async resetPasswordForEmail(t,r={}){let n=null,a=null;this.flowType==="pkce"&&([n,a]=await Io(this.storage,this.storageKey,!0));try{return await be(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:a,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(i){if(await Qt(this.storage,`${this.storageKey}-code-verifier`),fe(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(fe(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:a}=await this._useSession(async i=>{var o,l,c,u,d;const{data:f,error:h}=i;if(h)throw h;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=t.options)===null||l===void 0?void 0:l.scopes,queryParams:(c=t.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await be(this.fetch,"GET",p,{headers:this.headers,jwt:(d=(u=f.session)===null||u===void 0?void 0:u.access_token)!==null&&d!==void 0?d:void 0})});if(a)throw a;return Jt()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(fe(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:a,data:{session:i}}=r;if(a)throw a;const{options:o,provider:l,token:c,access_token:u,nonce:d}=t,f=await be(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=i==null?void 0:i.access_token)!==null&&n!==void 0?n:void 0,body:{provider:l,id_token:c,access_token:u,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Mn}),{data:h,error:p}=f;return p?this._returnResult({data:{user:null,session:null},error:p}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new Mo}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:p}))}catch(a){if(await Qt(this.storage,`${this.storageKey}-code-verifier`),fe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,a;const{data:i,error:o}=r;if(o)throw o;
556return await be(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(a=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&a!==void 0?a:void 0})})}catch(r){if(fe(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await mH(async a=>(a>0&&await pH(200*Math.pow(2,a-1)),this._debug(r,"refreshing attempt",a),await be(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Mn})),(a,i)=>{const o=200*Math.pow(2,a);return i&&Gy(i)&&Date.now()+o-n<Yo})}catch(n){if(this._debug(r,"error",n),fe(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),Jt()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const a=await bs(this.storage,this.storageKey);if(a&&this.userStorage){let o=await bs(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:a.user},await Xo(this.userStorage,this.storageKey+"-user",o)),a.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:Yy()}else if(a&&!a.user&&!a.user){const o=await bs(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(a.user=o.user,await Qt(this.storage,this.storageKey+"-user"),await Xo(this.storage,this.storageKey,a)):a.user=Yy()}if(this._debug(n,"session from storage",a),!this._isValidSession(a)){this._debug(n,"session is not valid"),a!==null&&await this._removeSession();return}const i=((r=a.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Vy;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${Vy}s`),i){if(this.autoRefreshToken&&a.refresh_token){const{error:o}=await this._callRefreshToken(a.refresh_token);o&&(console.error(o),Gy(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(a.access_token);!l&&(o!=null&&o.user)?(a.user=o.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",a)}catch(a){this._debug(n,"error",a),console.error(a);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new qr;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new qg;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new qr;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const l={data:i.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(i){if(this._debug(a,"error",i),fe(i)){const o={data:null,error:i};return Gy(i)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(t,r,n=!0){const a=`#_notifyAllSubscribers(${t})`;this._debug(a,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(t,r)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let l=0;l<i.length;l+=1)console.error(i[l]);throw i[0]}}finally{this._debug(a,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Qt(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Xo(this.userStorage,this.storageKey+"-user",{user:r.user});const a=Object.assign({},r);delete a.user;const i=wk(a);await Xo(this.storage,this.storageKey,i)}else{const a=wk(r);await Xo(this.storage,this.storageKey,a)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Qt(this.storage,this.storageKey),await Qt(this.storage,this.storageKey+"-code-verifier"),await Qt(this.storage,this.storageKey+"-user"),this.userStorage&&await Qt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Jt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
556catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Yo);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((n.expires_at*1e3-t)/Yo);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${Yo}ms, refresh threshold is ${ib} ticks`),a<=ib&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof OR)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Jt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const a=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&a.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&a.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,o]=await Io(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});a.push(l.toString())}if(n!=null&&n.queryParams){const i=new URLSearchParams(n.queryParams);a.push(i.toString())}return n!=null&&n.skipBrowserRedirect&&a.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${a.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:a,error:i}=r;return i?this._returnResult({data:null,error:i}):await be(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(fe(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,a;const{data:i,error:o}=r;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:c,error:u}=await be(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(t.factorType==="totp"&&c.type==="totp"&&(!((a=c==null?void 0:c.totp)===null||a===void 0)&&a.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(r){if(fe(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:a,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?WH(t.webauthn.credential_response):HH(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await be(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(r){if(fe(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:a,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=await be(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:zH(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:qH(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(fe(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const a={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])a.all.push(i),i.status==="verified"&&a[i.factor_type].push(i);return{data:a,error:null}}async _getAuthenticatorAssuranceLevel(t){var r,n,a,i;if(t)try{const{payload:p}=Ph(t);let v=null;p.aal&&(v=p.aal);let m=v;const{data:{user:g},error:y}=await this.getUser(t);if(y)return this._returnResult({data:null,error:y});((n=(r=g==null?void 0:g.factors)===null||r===void 0?void 0:r.filter(S=>S.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(m="aal2");const w=p.amr||[];return{data:{currentLevel:v,nextLevel:m,currentAuthenticationMethods:w},error:null}}catch(p){if(fe(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:o},error:l}
556=await this.getSession();if(l)return this._returnResult({data:null,error:l});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=Ph(o.access_token);let u=null;c.aal&&(u=c.aal);let d=u;((i=(a=o.user.factors)===null||a===void 0?void 0:a.filter(p=>p.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(d="aal2");const h=c.amr||[];return{data:{currentLevel:u,nextLevel:d,currentAuthenticationMethods:h},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:a}=r;return a?this._returnResult({data:null,error:a}):n?await be(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new qr})})}catch(r){if(fe(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:a},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new qr});const o=await be(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Jt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(fe(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:a},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new qr});const o=await be(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Jt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(fe(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await be(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new qr})})}catch(t){if(fe(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:a}=r;return a?this._returnResult({data:null,error:a}):n?(await be(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new qr})})}catch(r){if(fe(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(l=>l.kid===t);if(n)return n;const a=Date.now();if(n=this.jwks.keys.find(l=>l.kid===t),n&&this.jwks_cached_at+eH>a)return n;const{data:i,error:o}=await be(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=a,n=i.keys.find(l=>l.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:p,error:v}
556=await this.getSession();if(v||!p.session)return this._returnResult({data:null,error:v});n=p.session.access_token}const{header:a,payload:i,signature:o,raw:{header:l,payload:c}}=Ph(n);r!=null&&r.allowExpired||jH(i.exp);const u=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:p}=await this.getUser(n);if(p)throw p;return{data:{claims:i,header:a,signature:o},error:null}}const d=SH(a.alg),f=await crypto.subtle.importKey("jwk",u,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,o,cH(`${l}.${c}`)))throw new lb("Invalid JWT signature");return{data:{claims:i,header:a,signature:o},error:null}}catch(n){if(fe(n))return this._returnResult({data:null,error:n});throw n}}}Id.nextInstanceID={};const eV=Id,tV="2.100.0";let Tu="";typeof Deno<"u"?Tu="deno":typeof document<"u"?Tu="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Tu="react-native":Tu="node";const rV={"X-Client-Info":`supabase-js-${Tu}/${tV}`},nV={headers:rV},aV={schema:"public"},iV={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},sV={};function Dd(e){"@babel/helpers - typeof";return Dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dd(e)}function oV(e,t){if(Dd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Dd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lV(e){var t=oV(e,"string");return Dd(t)=="symbol"?t:t+""}function cV(e,t,r){return(t=lV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ek(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function jt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ek(Object(r),!0).forEach(function(n){cV(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ek(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const uV=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),dV=()=>Headers,fV=(e,t,r)=>{const n=uV(r),a=dV();return async(i,o)=>{var l;const c=(l=await t())!==null&&l!==void 0?l:e;let u=new a(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${c}`),n(i,jt(jt({},o),{},{headers:u}))}};function hV(e){return e.endsWith("/")?e:e+"/"}function pV(e,t){var r,n;const{db:a,auth:i,realtime:o,global:l}=e,{db:c,auth:u,realtime:d,global:f}=t,h={db:jt(jt({},c),a),auth:jt(jt({},u),i),realtime:jt(jt({},d),o),storage:{},global:jt(jt(jt({},f),l),{},{headers:jt(jt({},(r=f==null?void 0:f.headers)!==null&&r!==void 0?r:{}),(n=l==null?void 0:l.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}function mV(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(hV(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var gV=class extends eV{constructor(e){super(e)}},vV=class{constructor(e,t,r){var n,a;this.supabaseUrl=e,this.supabaseKey=t;const i=mV(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,l={db:aV,realtime:sV,auth:jt(jt({},iV),{},{storageKey:o}),global:nV},c=pV(r??{},l);if(this.storageKey=(n=c.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(a=c.global.headers)!==null&&a!==void 0?a:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=c.auth)!==null&&u!==void 0?u:{},this.headers,c.global.fetch)}this.fetch=fV(t,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(jt({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new F9(new URL("rest/v1",i).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new YW(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new A9(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
556channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:a,storageKey:i,flowType:o,lock:l,debug:c,throwOnError:u},d,f){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new gV({url:this.authUrl.href,headers:jt(jt({},h),d),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:a,flowType:o,lock:l,debug:c,throwOnError:u,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new xW(this.realtimeUrl.href,jt(jt({},e),{},{params:jt(jt({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const yV=(e,t,r)=>new vV(e,t,r);function xV(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}xV()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const bV="https://nakyicofsxpkdzvhkhkl.supabase.co",wV="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im5ha3lpY29mc3hwa2R6dmhraGtsIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzQ1MjIxODMsImV4cCI6MjA5MDA5ODE4M30.yfrNRHIgVdKAs1b_dy8qbADNQMRIiCwc_u3PMJkukCQ",V=yV(bV,wV,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),PR=b.createContext(void 0),jV=({children:e})=>{const[t,r]=b.useState(null),[n,a]=b.useState(null),[i,o]=b.useState(!0),[l,c]=b.useState(null),u=async m=>{const{data:g}=await V.from("user_roles").select("role").eq("user_id",m).limit(1).maybeSingle();c((g==null?void 0:g.role)??null)};b.useEffect(()=>{const{data:{subscription:m}}=V.auth.onAuthStateChange((g,y)=>{a(y),r((y==null?void 0:y.user)??null),y!=null&&y.user?setTimeout(()=>u(y.user.id),0):c(null),o(!1)});return V.auth.getSession().then(({data:{session:g}})=>{a(g),r((g==null?void 0:g.user)??null),g!=null&&g.user&&u(g.user.id),o(!1)}),()=>m.unsubscribe()},[]);const d=async(m,g)=>{const{error:y}=await V.auth.signInWithPassword({email:m,password:g});return{error:y}},f=async(m,g,y)=>{const{error:x}=await V.auth.signUp({email:m,password:g,options:{data:{full_name:y},emailRedirectTo:window.location.origin}});return{error:x}},h=async()=>{await V.auth.signOut()},p=l==="owner"||l==="admin",v=l==="owner"||l==="admin"||l==="staff";return s.jsx(PR.Provider,{value:{user:t,session:n,loading:i,role:l,isAdmin:p,isStaff:v,signIn:d,signUp:f,signOut:h},children:e})},ir=()=>{const e=b.useContext(PR);if(!e)throw new Error("useAuth must be used within AuthProvider");return e},AR=b.createContext(void 0),SV=({children:e})=>{const{user:t}=ir(),[r,n]=b.useState([]),[a,i]=b.useState(!1);b.useEffect(()=>{if(!t){n([]);return}i(!0),V.from("wishlists").select("product_id").eq("user_id",t.id).then(({data:c,error:u})=>{!u&&c&&n(c.map(d=>d.product_id)),i(!1)})},[t]);const o=b.useCallback(c=>r.includes(c),[r]),l=b.useCallback(async c=>{if(!t){X.error("Please sign in to save items to your wishlist");return}if(o(c)){n(d=>d.filter(f=>f!==c));const{error:u}=await V.from("wishlists").delete().eq("user_id",t.id).eq("product_id",c);u?(n(d=>[...d,c]),X.error("Failed to remove from wishlist")):X.success("Removed from wishlist")}else{n(d=>[...d,c]);const{error:u}=await V.from("wishlists").insert({user_id:t.id,product_id:c});u?(n(d=>d.filter(f=>f!==c)),X.error("Failed to add to wishlist")):X.success("Added to wishlist")}},[t,o]);return s.jsx(AR.Provider,{value:{wishlistIds:r,isInWishlist:o,toggleWishlist:l,loading:a},children:e})},Wg=()=>{const e=b.useContext(AR);if(!e)throw new Error("useWishlist must be used within WishlistProvider");return e},_V=Rc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),W=b.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},i)=>{const o=n?Tc:"button";return s.jsx(o,{className:ne(_V({variant:t,size:r,className:e})),ref:i,...a})});W.displayName="Button";const TR="/assets/logo-Cz-LcSpZ.png",NV=()=>{const[e,t]=b.useState(!1),{totalItems:r,setIsCartOpen:n}=jo(),{wishlistIds:a}=Wg(),{user:i,isStaff:o}=ir(),l=ka(),c=[{to:"/",label:"Home"},{to:"/shop",label:"Shop"},{to:"/categories",label:"Categories"},{to:"/wholesale",label:"Wholesale"},{to:"/about",label:"About"},{to:"/contact",label:"Contact"}],u=d=>l.pathname===d;return s.jsxs("nav",{className:"sticky top-0 z-50 bg-background/95 backdrop-blur-md border-b",children:[s.jsxs("div",{className:"container flex items-center justify-between h-16 md:h-20",children:[s.jsxs(we,{to:"/",className:"flex items-center gap-2",children:[s.jsx("img",{src:TR,alt:"Afro Caribbean Store",className:"h-14 md:h-16 w-auto"}),s.jsxs("div",{className:"leading-tight hidden sm:block",children:[s.jsx("span",{className:"font-display font-bold text-lg text-foreground block",children:"AFRO CARIBBEAN STORE"}),s.jsx("span",{className:"text-xs text-muted-foreground tracking-wider",children:"Taste Of Africa Mini Mart"})]})]}),s.jsx("div",{className:"hidden md:flex items-center gap-8",children:c.map(d=>s.jsx(we,{to:d.to,className:`text-sm font-medium transition-colors hover:text-primary ${u(d.to)?"text-primary":"text-muted-foreground"}`,children:d.label},d.to))}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(we,{to:"/shop",children:s.jsx(W,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground",children:s.jsx(Ur,{className:"h-5 w-5"})})}),s.jsx(we,{to:"/wishlist",children:s.jsxs(W,{variant:"ghost",size:"icon",className:"relative text-muted-foreground hover:text-foreground",children:[s.jsx(Jl,{className:"h-5 w-5"}),a.length>0&&s.jsx("span",{className:"absolute -top-1 -right-1 h-5 w-5 rounded-full bg-accent text-accent-foreground text-xs flex items-center justify-center font-bold",children:a.length})]})}),s.jsxs(W,{variant:"ghost",size:"icon",className:"relative text-muted-foreground hover:text-foreground",onClick:()=>n(!0),children:[s.jsx(ec,{className:"h-5 w-5"}),r>0&&s.jsx("span",{className:"absolute -top-1 -right-1 h-5 w-5 rounded-full bg-primary text-primary-foreground text-xs flex items-center justify-center font-bold",children:r})]}),i&&o&&s.jsx(we,{to:"/admin",children:s.jsx(W,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-primary",title:"Admin Dashboard",children:s.jsx(Z1,{className:"h-5 w-5"})})}),i?s.jsx(we,{to:"/account",children:s.jsx(W,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground",title:"My Account",children:s.jsx(Qp,{className:"h-5 w-5"})})}):s.jsx(we,{to:"/auth",children:s.jsx(W,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-foreground",title:"Sign in",children:s.jsx(Qp,{className:"h-5 w-5"})})}),s.jsx(W,{variant:"ghost",size:"icon",className:"md:hidden text-muted-foreground",onClick:()=>t(!e),children:e?s.jsx(Ic,{className:"h-5 w-5"}):s.jsx(Yz,{className:"h-5 w-5"})})]})]}),e&&s.jsx("div",{className:"md:hidden border-t bg-background animate-fade-in",children:s.jsx("div",{className:"container py-4 flex flex-col gap-3",children:c.map(d=>s.jsx(we,{to:d.to,className:`py-2 text-sm font-medium ${u(d.to)?"text-primary":"text-muted-foreground"}`,onClick:()=>t(!1),children:d.label},d.to))})})]})},kV=()=>s.jsx("footer",{className:"bg-earth text-earth-foreground mt-20",children:s.jsxs("div",{className:"container py-12 md:py-16",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx("img",{src:TR,alt:"Afro Caribbean Store",className:"h-16 w-auto"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-display font-bold text-lg block",children:"AFRO CARIBBEAN STORE"}),s.jsx("span",{className:"text-xs opacity-70 tracking-wider",children:"Taste Of Africa Mini Mart"})]})]}),s.jsx("p",{className:"text-sm opacity-70",children:"Taste Of Africa Mini Mart — Bringing authentic African and Caribbean flavours to your doorstep."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-display font-bold mb-4",children:"Qu
556ick Links"}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm opacity-70",children:[s.jsx(we,{to:"/shop",className:"hover:opacity-100 transition-opacity",children:"Shop"}),s.jsx(we,{to:"/categories",className:"hover:opacity-100 transition-opacity",children:"Categories"}),s.jsx(we,{to:"/wholesale",className:"hover:opacity-100 transition-opacity",children:"Wholesale / Bulk"}),s.jsx(we,{to:"/about",className:"hover:opacity-100 transition-opacity",children:"About Us"}),s.jsx(we,{to:"/contact",className:"hover:opacity-100 transition-opacity",children:"Contact Us"}),s.jsx(we,{to:"/faq",className:"hover:opacity-100 transition-opacity",children:"FAQ"})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-display font-bold mb-4",children:"Categories"}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm opacity-70",children:[s.jsx(we,{to:"/shop?cat=groceries",className:"hover:opacity-100 transition-opacity",children:"Groceries"}),s.jsx(we,{to:"/shop?cat=beverages",className:"hover:opacity-100 transition-opacity",children:"Beverages"}),s.jsx(we,{to:"/shop?cat=vegetables",className:"hover:opacity-100 transition-opacity",children:"Vegetables"}),s.jsx(we,{to:"/shop?cat=hair-beauty",className:"hover:opacity-100 transition-opacity",children:"Hair & Beauty"})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-display font-bold mb-4",children:"Information"}),s.jsxs("div",{className:"flex flex-col gap-2 text-sm opacity-70",children:[s.jsx(we,{to:"/delivery-info",className:"hover:opacity-100 transition-opacity",children:"Delivery Information"}),s.jsx(we,{to:"/returns-policy",className:"hover:opacity-100 transition-opacity",children:"Returns Policy"}),s.jsx(we,{to:"/terms",className:"hover:opacity-100 transition-opacity",children:"Terms & Conditions"}),s.jsx(we,{to:"/privacy",className:"hover:opacity-100 transition-opacity",children:"Privacy Policy"})]}),s.jsx("h4",{className:"font-display font-bold mt-6 mb-3",children:"Follow Us"}),s.jsxs("div",{className:"flex gap-3 text-2xl",children:[s.jsx("a",{href:"#","aria-label":"Facebook",className:"hover:opacity-80 transition-opacity",children:"📘"}),s.jsx("a",{href:"#","aria-label":"Instagram",className:"hover:opacity-80 transition-opacity",children:"📸"}),s.jsx("a",{href:"#","aria-label":"TikTok",className:"hover:opacity-80 transition-opacity",children:"🎵"}),s.jsx("a",{href:"#","aria-label":"WhatsApp",className:"hover:opacity-80 transition-opacity",children:"💬"})]})]})]}),s.jsxs("div",{className:"border-t border-earth-foreground/20 mt-8 pt-8 text-sm text-center opacity-50",children:["© ",new Date().getFullYear()," Afro Caribbean Store. All rights reserved. Powered by Trust n Trade."]})]})});var Qy="focusScope.autoFocusOnMount",Jy="focusScope.autoFocusOnUnmount",Pk={bubbles:!1,cancelable:!0},OV="FocusScope",Hg=b.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=b.useState(null),u=Fr(a),d=Fr(i),f=b.useRef(null),h=Me(t,m=>c(m)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(n){let m=function(w){if(p.paused||!l)return;const S=w.target;l.contains(S)?f.current=S:Si(f.current,{select:!0})},g=function(w){if(p.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||Si(f.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const j of w)j.removedNodes.length>0&&Si(l)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const x=new MutationObserver(y);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),x.disconnect()}}},[n,l,p.paused]),b.useEffect(()=>{if(l){Tk.add(p);const m=document.activeElement;if(!l.contains(m)){const y=new CustomEvent(Qy,Pk);l.addEventListener(Qy,u),l.dispatchEvent(y),y.defaultPrevented||(CV($V($R(l)),{select:!0}),document.activeElement===m&&Si(l))}return()=>{l.removeEventListener(Qy,u),setTimeout(()=>{const y=new CustomEvent(Jy,Pk);l.addEventListener(Jy,d),l.dispatchEvent(y),y.defaultPrevented||Si(m??document.body,{select:!0}),l.removeEventListener(Jy,d),Tk.remove(p)}
vendor: 4,126 bytes, line 556
556,0)}}},[l,u,d,p]);const v=b.useCallback(m=>{if(!r&&!n||p.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(g&&y){const x=m.currentTarget,[w,S]=EV(x);w&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&Si(w,{select:!0})):m.shiftKey&&y===w&&(m.preventDefault(),r&&Si(S,{select:!0})):y===x&&m.preventDefault()}},[r,n,p.paused]);return s.jsx(ye.div,{tabIndex:-1,...o,ref:h,onKeyDown:v})});Hg.displayName=OV;function CV(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Si(n,{select:t}),document.activeElement!==r)return}function EV(e){const t=$R(e),r=Ak(t,e),n=Ak(t.reverse(),e);return[r,n]}function $R(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Ak(e,t){for(const r of e)if(!PV(r,{upTo:t}))return r}function PV(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function AV(e){return e instanceof HTMLInputElement&&"select"in e}function Si(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&AV(e)&&t&&e.select()}}var Tk=TV();function TV(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=$k(e,t),e.unshift(t)},remove(t){var r;e=$k(e,t),(r=e[0])==null||r.resume()}}}function $k(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function $V(e){return e.filter(t=>t.tagName!=="A")}var Zy=0;function kj(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Rk()),document.body.insertAdjacentElement("beforeend",e[1]??Rk()),Zy++,()=>{Zy===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zy--}},[])}function Rk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var pp="right-scroll-bar-position",mp="width-before-scroll-bar",RV="with-scroll-bars-hidden",MV="--removed-body-scroll-bar-size";function ex(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function IV(e,t){var r=b.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=t,r.facade}var DV=typeof window<"u"?b.useLayoutEffect:b.useEffect,Mk=new WeakMap;function LV(e,t){var r=IV(null,function(n){return e.forEach(function(a){return ex(a,n)})});return DV(function(){var n=Mk.get(r);if(n){var a=new Set(n),i=new Set(e),o=r.current;a.forEach(function(l){i.has(l)||ex(l,null)}),i.forEach(function(l){a.has(l)||ex(l,o)})}Mk.set(r,e)},[e]),r}function FV(e){return e}function BV(e,t){t===void 0&&(t=FV);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var o=t(i,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(i),o=r}var c=function(){var d=o;o=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),r}}}};return a}function UV(e){e===void 0&&(e={});var t=BV(null);return t.options=ha({async:!0,ssr:!1},e),t}var RR=function(e){var t=e.sideCar,r=Uc(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return b.createElement(n,ha({},r))};
vendor: 4,634 bytes, lines 556-593
556RR.isSideCarExport=!0;function zV(e,t){return e.useMedium(t),RR}var MR=UV(),tx=function(){},Vg=b.forwardRef(function(e,t){var r=b.useRef(null),n=b.useState({onScrollCapture:tx,onWheelCapture:tx,onTouchMoveCapture:tx}),a=n[0],i=n[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,v=e.noIsolation,m=e.inert,g=e.allowPinchZoom,y=e.as,x=y===void 0?"div":y,w=e.gapMode,S=Uc(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=h,_=LV([r,t]),N=ha(ha({},S),a);return b.createElement(b.Fragment,null,d&&b.createElement(j,{sideCar:MR,removeScrollBar:u,shards:f,noRelative:p,noIsolation:v,inert:m,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:w}),o?b.cloneElement(b.Children.only(l),ha(ha({},N),{ref:_})):b.createElement(x,ha({},N,{className:c,ref:_}),l))});Vg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vg.classNames={fullWidth:mp,zeroRight:pp};var qV=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function WV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=qV();return t&&e.setAttribute("nonce",t),e}function HV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function VV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var KV=function(){var e=0,t=null;return{add:function(r){e==0&&(t=WV())&&(HV(t,r),VV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},GV=function(){var e=KV();return function(t,r){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},IR=function(){var e=GV(),t=function(r){var n=r.styles,a=r.dynamic;return e(n,a),null};return t},YV={left:0,top:0,right:0,gap:0},rx=function(e){return parseInt(e||"",10)||0},XV=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[rx(r),rx(n),rx(a)]},QV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return YV;var t=XV(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},JV=IR(),Cl="data-scroll-locked",ZV=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),`
557  .`.concat(RV,` {
558   overflow: hidden `).concat(n,`;
559   padding-right: `).concat(l,"px ").concat(n,`;
560  }
561  body[`).concat(Cl,`] {
562    overflow: hidden `).concat(n,`;
563    overscroll-behavior: contain;
564    `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
565    padding-left: `.concat(a,`px;
566    padding-top: `).concat(i,`px;
567    padding-right: `).concat(o,`px;
568    margin-left:0;
569    margin-top:0;
570    margin-right: `).concat(l,"px ").concat(n,`;
571    `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),`
572  }
573  
574  .`).concat(pp,` {
575    right: `).concat(l,"px ").concat(n,`;
576  }
577  
578  .`).concat(mp,` {
579    margin-right: `).concat(l,"px ").concat(n,`;
580  }
581  
582  .`).concat(pp," .").concat(pp,` {
583    right: 0 `).concat(n,`;
584  }
585  
586  .`).concat(mp," .").concat(mp,` {
587    margin-right: 0 `).concat(n,`;
588  }
589  
590  body[`).concat(Cl,`] {
591    `).concat(MV,": ").concat(l,`px;
592  }
593`)},Ik=function(){var e=parseInt(document.body.getAttribute(Cl)||"0",10);return isFinite(e)?e:0},eK=function(){b.useEffect(function(){return document.body.setAttribute(Cl,(Ik()+1).toString()),function(){var e=Ik()-1;e<=0?document.body.removeAttribute(Cl):document.body.setAttribute(Cl,e.toString())}},[])},tK=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;eK();var i=b.useMemo(function(){return QV(a)},[a]);return b.createElement(JV,{styles:ZV(i,!t,a,r?"":"!important")})},cb=!1;if(typeof window<"u")try{var Ah=Object.defineProperty({},"passive",{get:function(){return cb=!0,!0}});window.addEventListener("test",Ah,Ah),window.removeEventListener("test",Ah,Ah)}catch{cb=!1}var Fo=cb?{passive:!1}:!1,rK=function(e){return e.tagName==="TEXTAREA"},DR=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!rK(e)&&r[t]==="visible")},nK=function(e){return DR(e,"overflowY")},aK=function(e){return DR(e,"overflowX")},Dk=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=LR(e,n);if(a){var i=FR(e,n),o=i[1],l=i[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1}
vendor: 4,570 bytes, lines 593-596
593,iK=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},sK=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},LR=function(e,t){return e==="v"?nK(t):aK(t)},FR=function(e,t){return e==="v"?iK(t):sK(t)},oK=function(e,t){return e==="h"&&t==="rtl"?-1:1},lK=function(e,t,r,n,a){var i=oK(e,window.getComputedStyle(t).direction),o=i*n,l=r.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;do{if(!l)break;var p=FR(e,l),v=p[0],m=p[1],g=p[2],y=m-g-i*v;(v||y)&&LR(e,l)&&(f+=y,h+=v);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!a)||!d&&(Math.abs(h)<1||!a))&&(u=!0),u},Th=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Lk=function(e){return[e.deltaX,e.deltaY]},Fk=function(e){return e&&"current"in e?e.current:e},cK=function(e,t){return e[0]===t[0]&&e[1]===t[1]},uK=function(e){return`
594  .block-interactivity-`.concat(e,` {pointer-events: none;}
595  .allow-interactivity-`).concat(e,` {pointer-events: all;}
596`)},dK=0,Bo=[];function fK(e){var t=b.useRef([]),r=b.useRef([0,0]),n=b.useRef(),a=b.useState(dK++)[0],i=b.useState(IR)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var m=C9([e.lockRef.current],(e.shards||[]).map(Fk),!0).filter(Boolean);return m.forEach(function(g){return g.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),m.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=b.useCallback(function(m,g){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!o.current.allowPinchZoom;var y=Th(m),x=r.current,w="deltaX"in m?m.deltaX:x[0]-y[0],S="deltaY"in m?m.deltaY:x[1]-y[1],j,_=m.target,N=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in m&&N==="h"&&_.type==="range")return!1;var k=Dk(N,_);if(!k)return!0;if(k?j=N:(j=N==="v"?"h":"v",k=Dk(N,_)),!k)return!1;if(!n.current&&"changedTouches"in m&&(w||S)&&(n.current=j),!j)return!0;var O=n.current||j;return lK(O,g,m,O==="h"?w:S,!0)},[]),c=b.useCallback(function(m){var g=m;if(!(!Bo.length||Bo[Bo.length-1]!==i)){var y="deltaY"in g?Lk(g):Th(g),x=t.current.filter(function(j){return j.name===g.type&&(j.target===g.target||g.target===j.shadowParent)&&cK(j.delta,y)})[0];if(x&&x.should){g.cancelable&&g.preventDefault();return}if(!x){var w=(o.current.shards||[]).map(Fk).filter(Boolean).filter(function(j){return j.contains(g.target)}),S=w.length>0?l(g,w[0]):!o.current.noIsolation;S&&g.cancelable&&g.preventDefault()}}},[]),u=b.useCallback(function(m,g,y,x){var w={name:m,delta:g,target:y,should:x,shadowParent:hK(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=b.useCallback(function(m){r.current=Th(m),n.current=void 0},[]),f=b.useCallback(function(m){u(m.type,Lk(m),m.target,l(m,e.lockRef.current))},[]),h=b.useCallback(function(m){u(m.type,Th(m),m.target,l(m,e.lockRef.current))},[]);b.useEffect(function(){return Bo.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Fo),document.addEventListener("touchmove",c,Fo),document.addEventListener("touchstart",d,Fo),function(){Bo=Bo.filter(function(m){return m!==i}),document.removeEventListener("wheel",c,Fo),document.removeEventListener("touchmove",c,Fo),document.removeEventListener("touchstart",d,Fo)}},[]);var p=e.removeScrollBar,v=e.inert;return b.createElement(b.Fragment,null,v?b.createElement(i,{styles:uK(a)}):null,p?b.createElement(tK,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function hK(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pK=zV(MR,fK);var Kg=b.forwardRef(function(e,t){return b.createElement(Vg,ha({},e,{ref:t,sideCar:pK}))});Kg.classNames=Vg.classNames;var mK=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Uo=new WeakMap,$h=new WeakMap,Rh={},nx=0,BR=function(e){return e&&(e.host||BR(e.parentNode))},gK=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=BR(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},vK=function(e,t,r,n){var a=gK(t,Array.isArray(e)?e:[e]);Rh[r]||(Rh[r]=new WeakMap);
vendor: 4,638 bytes, line 596
596var i=Rh[r],o=[],l=new Set,c=new Set(a),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};a.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var p=h.getAttribute(n),v=p!==null&&p!=="false",m=(Uo.get(h)||0)+1,g=(i.get(h)||0)+1;Uo.set(h,m),i.set(h,g),o.push(h),m===1&&v&&$h.set(h,!0),g===1&&h.setAttribute(r,"true"),v||h.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return d(t),l.clear(),nx++,function(){o.forEach(function(f){var h=Uo.get(f)-1,p=i.get(f)-1;Uo.set(f,h),i.set(f,p),h||($h.has(f)||f.removeAttribute(n),$h.delete(f)),p||f.removeAttribute(r)}),nx--,nx||(Uo=new WeakMap,Uo=new WeakMap,$h=new WeakMap,Rh={})}},Oj=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=mK(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live]"))),vK(n,a,r,"aria-hidden")):function(){return null}},Gg="Dialog",[UR,KNe]=Br(Gg),[yK,ta]=UR(Gg),zR=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=b.useRef(null),c=b.useRef(null),[u,d]=nn({prop:n,defaultProp:a??!1,onChange:i,caller:Gg});return s.jsx(yK,{scope:t,triggerRef:l,contentRef:c,contentId:Zr(),titleId:Zr(),descriptionId:Zr(),open:u,onOpenChange:d,onOpenToggle:b.useCallback(()=>d(f=>!f),[d]),modal:o,children:r})};zR.displayName=Gg;var qR="DialogTrigger",WR=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=ta(qR,r),i=Me(t,a.triggerRef);return s.jsx(ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Pj(a.open),...n,ref:i,onClick:oe(e.onClick,a.onOpenToggle)})});WR.displayName=qR;var Cj="DialogPortal",[xK,HR]=UR(Cj,{forceMount:void 0}),VR=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,i=ta(Cj,t);return s.jsx(xK,{scope:t,forceMount:r,children:b.Children.map(n,o=>s.jsx(ln,{present:r||i.open,children:s.jsx($f,{asChild:!0,container:a,children:o})}))})};VR.displayName=Cj;var sm="DialogOverlay",KR=b.forwardRef((e,t)=>{const r=HR(sm,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=ta(sm,e.__scopeDialog);return i.modal?s.jsx(ln,{present:n||i.open,children:s.jsx(wK,{...a,ref:t})}):null});KR.displayName=sm;var bK=io("DialogOverlay.RemoveScroll"),wK=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=ta(sm,r);return s.jsx(Kg,{as:bK,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(ye.div,{"data-state":Pj(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),lo="DialogContent",GR=b.forwardRef((e,t)=>{const r=HR(lo,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=ta(lo,e.__scopeDialog);return s.jsx(ln,{present:n||i.open,children:i.modal?s.jsx(jK,{...a,ref:t}):s.jsx(SK,{...a,ref:t})})});GR.displayName=lo;var jK=b.forwardRef((e,t)=>{const r=ta(lo,e.__scopeDialog),n=b.useRef(null),a=Me(t,r.contentRef,n);return b.useEffect(()=>{const i=n.current;if(i)return Oj(i)},[]),s.jsx(YR,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oe(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:oe(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:oe(e.onFocusOutside,i=>i.preventDefault())})}),SK=b.forwardRef((e,t)=>{const r=ta(lo,e.__scopeDialog),n=b.useRef(!1),a=b.useRef(!1);return s.jsx(YR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),YR=b.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=ta(lo,r),c=b.useRef(null),u=Me(t,c);return kj(),s.jsxs(s.Fragment,{children:[s.jsx(Hg,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx($c,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Pj(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(_K,{titleId:l.titleId}),s.jsx(kK,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Ej="DialogTitle",XR=b.forwardRef((e,t)=>
596{const{__scopeDialog:r,...n}=e,a=ta(Ej,r);return s.jsx(ye.h2,{id:a.titleId,...n,ref:t})});XR.displayName=Ej;var QR="DialogDescription",JR=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=ta(QR,r);return s.jsx(ye.p,{id:a.descriptionId,...n,ref:t})});JR.displayName=QR;var ZR="DialogClose",eM=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=ta(ZR,r);return s.jsx(ye.button,{type:"button",...n,ref:t,onClick:oe(e.onClick,()=>a.onOpenChange(!1))})});eM.displayName=ZR;function Pj(e){return e?"open":"closed"}var tM="DialogTitleWarning",[GNe,rM]=IU(tM,{contentName:lo,titleName:Ej,docsSlug:"dialog"}),_K=({titleId:e})=>{const t=rM(tM),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
597
598If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
599
600For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},NK="DialogDescriptionWarning",kK=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rM(NK).contentName}}.`;return b.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},nM=zR,OK=WR,aM=VR,Yg=KR,Xg=GR,Qg=XR,Jg=JR,iM=eM;const sM=nM,CK=aM,oM=b.forwardRef(({className:e,...t},r)=>s.jsx(Yg,{className:ne("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));oM.displayName=Yg.displayName;const EK=Rc("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Aj=b.forwardRef(({side:e="right",className:t,children:r,...n},a)=>s.jsxs(CK,{children:[s.jsx(oM,{}),s.jsxs(Xg,{ref:a,className:ne(EK({side:e}),t),...n,children:[r,s.jsxs(iM,{className:"absolute right-4 top-4 roun
600ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(Ic,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Aj.displayName=Xg.displayName;const lM=({className:e,...t})=>s.jsx("div",{className:ne("flex flex-col space-y-2 text-center sm:text-left",e),...t});lM.displayName="SheetHeader";const cM=b.forwardRef(({className:e,...t},r)=>s.jsx(Qg,{ref:r,className:ne("text-lg font-semibold text-foreground",e),...t}));cM.displayName=Qg.displayName;const PK=b.forwardRef(({className:e,...t},r)=>s.jsx(Jg,{ref:r,className:ne("text-sm text-muted-foreground",e),...t}));PK.displayName=Jg.displayName;const AK=()=>{const{items:e,isCartOpen:t,setIsCartOpen:r,updateQuantity:n,removeFromCart:a,totalPrice:i,totalItems:o}=jo(),l=ui(),c=()=>{r(!1),l("/checkout")};return s.jsx(sM,{open:t,onOpenChange:r,children:s.jsxs(Aj,{className:"flex flex-col w-full sm:max-w-md",children:[s.jsx(lM,{children:s.jsxs(cM,{className:"font-display text-xl",children:["Your Cart (",o,")"]})}),e.length===0?s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 text-muted-foreground",children:[s.jsx(as,{className:"h-16 w-16 opacity-30"}),s.jsx("p",{className:"font-medium",children:"Your cart is empty"}),s.jsx(W,{variant:"outline",onClick:()=>r(!1),children:"Continue Shopping"})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1 overflow-y-auto space-y-4 py-4",children:e.map(u=>s.jsxs("div",{className:"flex gap-3 p-3 rounded-lg bg-card",children:[s.jsx("img",{src:u.image,alt:u.name,className:"w-16 h-16 rounded-md object-cover"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h4",{className:"font-medium text-sm truncate",children:u.name}),s.jsx("p",{className:"text-xs text-muted-foreground",children:u.weight}),s.jsxs("p",{className:"font-bold text-primary text-sm mt-1",children:["£",(u.price*u.quantity).toFixed(2)]})]}),s.jsxs("div",{className:"flex flex-col items-end gap-2",children:[s.jsx(W,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive",onClick:()=>
600a(u.id),children:s.jsx(xa,{className:"h-3 w-3"})}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(W,{variant:"outline",size:"icon",className:"h-6 w-6",onClick:()=>n(u.id,u.quantity-1),children:s.jsx(tj,{className:"h-3 w-3"})}),s.jsx("span",{className:"w-6 text-center text-sm font-medium",children:u.quantity}),s.jsx(W,{variant:"outline",size:"icon",className:"h-6 w-6",onClick:()=>n(u.id,u.quantity+1),children:s.jsx(Or,{className:"h-3 w-3"})})]})]})]},u.id))}),s.jsxs("div",{className:"border-t pt-4 space-y-4",children:[s.jsxs("div",{className:"flex justify-between text-lg font-bold",children:[s.jsx("span",{children:"Total"}),s.jsxs("span",{className:"text-primary",children:["£",i.toFixed(2)]})]}),s.jsx(W,{className:"w-full h-12 text-base font-bold",onClick:c,children:"Proceed to Checkout"})]})]})]})})},Zg=({product:e,onQuickView:t})=>{const{addToCart:r}=jo(),{isInWishlist:n,toggleWishlist:a}=Wg(),i=c=>{c.preventDefault(),c.stopPropagation(),r(e),X.success(`${e.name} added to cart`)},o=c=>{c.preventDefault(),c.stopPropagation(),a(e.id)},l=n(e.id);return s.jsx(we,{to:`/product/${e.id}`,className:"group block",children:s.jsxs("div",{className:"bg-card rounded-xl overflow-hidden border transition-all hover:shadow-lg hover:-translate-y-1",children:[s.jsxs("div",{className:"relative aspect-square overflow-hidden",children:[s.jsx("img",{src:e.image,alt:e.name,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-110",loading:"lazy",width:400,height:400}),!e.inStock&&s.jsx("div",{className:"absolute inset-0 bg-foreground
600/50 flex items-center justify-center",children:s.jsx("span",{className:"bg-background px-3 py-1 rounded-full text-sm font-bold",children:"Out of Stock"})}),e.featured&&s.jsx("span",{className:"absolute top-3 left-3 bg-primary text-primary-foreground text-xs font-bold px-2 py-1 rounded-full",children:"Featured"}),s.jsx("button",{onClick:o,className:"absolute top-3 right-3 h-8 w-8 rounded-full bg-background/80 backdrop-blur-sm flex items-center justify-center hover:bg-background transition-colors","aria-label":l?"Remove from wishlist":"Add to wishlist",children:s.jsx(Jl,{className:`h-4 w-4 transition-colors ${l?"fill-accent text-accent":"text-muted-foreground"}`})}),t&&s.jsxs("button",{onClick:c=>{c.preventDefault(),c.stopPropagation(),t(e)},className:"absolute bottom-3 left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity bg-background/90 backdrop-blur-sm text-foreground text-xs font-medium px-3 py-1.5 rounded-full flex items-center gap-1.5 hover:bg-background",children:[s.jsx(Mf,{className:"h-3.5 w-3.5"})," Quick View"]})]}),s.jsxs("div",{className:"p-4",children:[s.jsx("h3",{className:"font-medium text-sm truncate",children:e.name}),s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.weight}),s.jsxs("div",{className:"flex items-center justify-between mt-3",children:[s.jsxs("span",{className:"text-lg font-bold text-primary",children:["£",e.price.toFixed(2)]}),e.inStock&&s.jsx(W,{size:"icon",className:"h-8 w-8 rounded-full",onClick:i,children:s.jsx(Or,{className:"h-4 w-4"})})]})]})]})})},Ld=[{id:"groceries",name:"Groceries",icon:"🛒",count:12},{id:"beverages",name:"Beverages",icon:"🥤",count:8},{id:"condiments",name:"Condiments",icon:"🫙",count:8},{id:"vegetables",name:"Vegetables",icon:"🥬",count:8},{id:"baked-goods",name:"Baked Goods",icon:"🍞",count:6},{id:"hair-beauty",name:"Hair & Beauty",icon:"✨",count:8},{id:"bulk",name:"Bulk / Restaurant",icon:"📦",count:6}],os=[{id:"1",name:"Plantain (Ripe)",price:1.49,image:"https://images.unsplash.com/photo-1603052875302-d376b7c0638a?w=400&h=400&fit=crop",category:"vegetables",description:"Sweet ripe plantains perfect for frying. A staple in West African and Caribbean cuisine.",weight:"per piece",inStock:!0,featured:!0},{id:"2",name:"Yam Tuber",price:5.99,image:"https://images.unsplash.com/photo-1590165482129-1b8b27698780?w=400&h=400&fit=crop",category:"vegetables",description:"Fresh African yam, perfect for pounded yam or boiled yam dishes.",weight:"per kg",inStock:!0,featured:!0},{id:"4",name:"Scotch Bonnet Peppers",price:1.99,image:"https://images.unsplash.com/photo-1526346698789-22fd84314424?w=400&h=400&fit=crop",category:"vegetables",description:"Fresh, fiery scotch bonnet peppers for Caribbean and African hot sauces.",weight:"200g",inStock:!0},{id:"v1",name:"Green Plantain",price:1.29,image:"https://images.unsplash.com/photo-1571771894821-ce9b6c11b08e?w=400&h=400&fit=crop",category:"vegetables",description:"Firm green plantains ideal for boiling, chips, or kelewele.",weight:"per piece",inStock:!0},{id:"v2",name:"Sweet Potatoes",price:2.49,image:"https://images.unsplash.com/photo-1590165482129-1b8b27698780?w=400&h=400&fit=crop",category:"vegetables",description:"Orange-fleshed sweet potatoes, great roasted, mashed or in stews.",weight:"per kg",inStock:!0},{id:"v3",name:"Okra (Fresh)",price:2.29,image:"https://images.unsplash.com/photo-1604977042946-1eecc30f269e?w=400&h=400&fit=crop",category:"vegetables",description:"Fresh okra for soups, stews, and traditional draw soup.",weight:"250g",inStock:!0},{id:"v4",name:"Cassava Root",price:3.49,image:"https://images.unsplash.com/photo-1599690925058-90e1a0b56154?w=400&h=400&fit=crop",category:"vegetables",description:"Fresh cassava root for boiling, frying, or making fufu.",weight:"per kg",inStock:!0},{id:"v5",name:"Eddoes",price:3.99,image:"https://images.unsplash.com/photo-1590165482129-1b8b27698780?w=400&h=400&fit=crop",category:"vegetables",description:"Small taro-like root vegetable popular in Caribbean cooking.",weight:"per kg",inStock:!0},{id:"6",name:"Cassava Flour (2kg)",price:3.99,image:"https://images.unsplash.com/photo-1574323347407-f5e1ad6d020b?w=400&h=400&fit=crop",category:"groceries",description:"Fine cassava flour for making fufu, garri, and other traditional dishes.",weight:"2kg",inStock:!0},{id:"10",name:"Egusi Seeds (Ground)",price:4.49,image:"https://images.unsplash.com/photo-1615485500704-8e990f9900f7?w=400&h=400&fit=crop",category:"groceries",description:"Ground melon seeds for making rich, flavourful egusi soup.",weight:"500g",inStock:!0,featured:!0},{id:"12",name:"Gari (Ijebu)",price:2.99,image:"https://images.unsplash.com/photo-1586201375761-83865001e31c?w=400&h=400&fit=crop",category:"groceries",description:"Premium Ijebu gari, perfect for so
600aking or making eba.",weight:"1kg",inStock:!0},{id:"g1",name:"Rice (Long Grain)",price:8.99,image:"https://images.unsplash.com/photo-1586201375761-83865001e31c?w=400&h=400&fit=crop",category:"groceries",description:"Premium long grain rice, perfect for jollof, fried rice and everyday meals.",weight:"5kg",inStock:!0,featured:!0},{id:"g2",name:"Semolina",price:2.49,image:"https://images.unsplash.com/photo-1509440159596-0249088772ff?w=400&h=400&fit=crop",category:"groceries",description:"Fine semolina flour for making swallow, puddings and pastries.",weight:"1kg",inStock:!0},{id:"g3",name:"Black Eye Beans",price:2.99,image:"https://images.unsplash.com/photo-1534604973900-c43ab4c2e0ab?w=400&h=400&fit=crop",category:"groceries",description:"Dried black eye beans for traditional bean stews and akara.",weight:"1kg",inStock:!0},{id:"g4",name:"Pounded Yam Flour",price:4.99,image:"https://images.unsplash.com/photo-1574323347407-f5e1ad6d020b?w=400&h=400&fit=crop",category:"groceries",description:"Instant pounded yam flour — just add hot water for perfect swallow.",weight:"1.5kg",inStock:!0},{id:"g5",name:"Crayfish (Ground)",price:3.99,image:"https://images.unsplash.com/photo-1565680018434-b513d5e5fd47?w=400&h=400&fit=crop",category:"groceries",description:"Finely ground dried crayfish for seasoning soups and stews.",weight:"200g",inStock:!0},{id:"g6",name:"Ogbono Seeds",price:5.49,image:"https://images.unsplash.com/photo-1506807803488-8eafc15316c7?w=400&h=400&fit=crop",category:"groceries",description:"African bush mango seeds for rich, thick ogbono soup.",weight:"250g",inStock:!0},{id:"g7",name:"Stockfish (Dried)",price:12.99,image:"https://images.unsplash.com/photo-1534604973900-c43ab4c2e0ab?w=400&h=400&fit=crop",category:"groceries",description:"Dried stockfish, a prized ingredient in Nigerian soups and stews.",weight:"350g",inStock:!0},{id:"g8",name:"Red Kidney Beans",price:1.99,image:"https://images.unsplash.com/photo-1534604973900-c43ab4c2e0ab?w=400&h=400&fit=crop",category:"groceries",description:"Dried red kidney beans for Caribbean rice and peas and stews.",weight:"500g",inStock:!0},{id:"g9",name:"Cornmeal",price:2.79,image:"https://images.unsplash.com/photo-1574323347407-f5e1ad6d020b?w=400&h=400&fit=crop",category:"groceries",description:"Fine yellow cornmeal for porridge, dumplings and cou-cou.",weight:"1kg",inStock:!0},{id:"3",name:"Palm Oil (1L)",price:4.99,image:"https://images.unsplash.com/photo-1526947425960-945c6e72858f?w=400&h=400&fit=crop",category:"condiments",description:"Premium quality red palm oil for authentic West African soups and stews.",weight:"1 Litre",inStock:!0,featured:!0},{id:"5",name:"Jollof Rice Seasoning",price:2.49,image:"https://images.unsplash.com/photo-1532336414038-cf19250c5757?w=400&h=400&fit=crop",category:"condiments",description:"Authentic Jollof rice seasoning mix for the perfect party rice.",weight:"100g",inStock:!0,featured:!0},{id:"c1",name:"Maggi Seasoning Cubes",price:1.49,image:"https://images.unsplash.com/photo-1596040033229-a9821ebd058d?w=400&h=400&fit=crop",category:"condiments",description:"Classic seasoning cubes used across West Africa for rich, savoury flavour.",weight:"100 cubes",inStock:!0},{id:"c2",name:"Suya Spice Mix",price:2.99,image:"https://images.unsplash.com/photo-1596040033229-a9821ebd058d?w=400&h=400&fit=crop",category:"condiments",description:"Traditional Nigerian suya pepper blend for grilled meats and kebabs.",weight:"100g",inStock:!0},{id:"c3",name:"Hot Pepper Sauce",price:2.49,image:"https://images.unsplash.com/photo-1583119022894-919a68a3d0e3?w=400&h=400&fit=crop",category:"condiments",description:"Fiery Caribbean hot pepper sauce made with scotch bonnet peppers.",weight:"150ml",inStock:!0},{id:"c4",name:"Coconut Cream",price:1.79,image:"https://images.unsplash.com/photo-1550583724-b2692b85b150?w=400&h=400&fit=crop",category:"condiments",description:"Rich coconut cream for curries, rice and peas, and desserts.",weight:"400ml",inStock:!0},{id:"c5",name:"Dawadawa (Locust Bean)",price:3.49,image:"https://images.unsplash.com/photo-1506368249639-73a05d6f6488?w=400&h=400&fit=crop",category:"condiments",description:"Fermented locust beans — a traditional West African flavour enhancer.",weight:"100g",inStock:!0},{id:"c6",name:"Jerk Seasoning Paste",price:3.29,image:"https://images.unsplash.com/photo-1472476443507-c7a5948772fc?w=400&h=400&fit=crop",category:"condiments",description:"Authentic Jamaican jerk seasoning paste for marinating chicken, pork and fish.",weight:"280g",inStock:!0},{id:"7",name:"Malt Drink (6 Pack)",price:5.99,image:"https://images.unsplash.com/photo-1558642452-9d2a7deb7f62?w=400&h=400&fit=crop",category:"beverages",description:"Classic malt drink, a favourite non-alcoholic beverage across Africa and the Caribbean.",weight:"6 × 330ml",inStock:!0,featured:!0},{id:"11",name:"Coconut Water",price:1.79,image:"https://images.unsplash.com/photo-1525385133512-2f3bdd039054?w=400&h=400&fit=crop",category:"beverages",description:"Pure coconut water, naturally refreshing. A Caribbean favourite.",weight:"500ml",inStock:!0},{id:"b1",name:"Ginger Beer",price:1.49,image:"https://images.unsplash.com/photo-1551024709-8f23befc6f87?w=400&h=400&fit=crop",category:"beverages",description:"Spicy Caribbean ginger beer with a fiery kick.",weight:"330ml",inStock:!0},{id:"b2",name:"Sorrel Drink",price:2.49,image:"https://images.unsplash.com/photo-1556679343-c7306c1976bc?w=400&h=400&fit=crop",category:"beverages",description:"Traditional Caribbean sorrel (hibiscus) drink with festive spices.",weight:"500ml",inStock:!0},{id:"b3",name:"Tropical Fruit Punch",price:1.99,image:"https://images.unsplash.com/photo-1546171753-97d7676e4602?w=400&h=400&fit=crop",category:"beverages",description:"Sweet tropical fruit punch with mango, guava and passion fruit.",weight:"1 Litre",inStock:!0},{id:"b4",name:"Zobo (Hibiscus Tea)",price:2.99,image:"https://images.unsplash.com/photo-1544787219-7f47ccb76574?w=400&h=400&fit=crop",category:"beverages",description:"Nigerian zobo drink mix — dried hibiscus flowers for a refreshing iced tea.",weight:"200g",inStock:!0},{id:"b5",name:"Supermalt",price:1.29,image:"https://images.unsplash.com/photo-1566633806327-68e152aaf26d?w=400&h=400&fit=crop",category:"beverages",description:"Original Supermalt enriched with B vitamins. A West African classic.",weight:"330ml",inStock:!0},{id:"b6",name:"Ting Grapefruit Soda",price:1.29,image:"https://images.unsplash.com/photo-1603569283847-aa295f0d016a?w=400&h=400&fit=crop",category:"beverages",description:"Sparkling Jamaican grapefruit soda — tangy, sweet and refreshing.",weight:"330ml",inStock:!0},{id:"9",name:"Chin Chin",price:2.99,image:"https://images.unsplash.com/photo-1599599810694-b5b37304c041?w=400&h=400&fit=crop",category:"baked-goods",description:"Crunchy, sweet fried dough snack. A popular Nigerian treat.",weight:"250g",inStock:!0},{id:"bk1",name:"Plantain Chips",price:1.99,image:"https://images.unsplash.com/photo-1566478989037-eec170784d0b?w=400&h=400&fit=crop",category:"baked-goods",description:"Crispy salted plantain chips — a moorish snack from West Africa.",weight:"150g",inStock:!0},{id:"bk2",name:"Coconut Drops",price:3.49,image:"https://images.unsplash.com/photo-1490457843367-34b21b6ccd85?w=400&h=400&fit=crop",category:"baked-goods",description:"Traditional Jamaican coconut drops with ginger and brown sugar.",weight:"200g",inStock:!0},{id:"bk3",name:"Puff Puff Mix",price:2.49,image:"https://images.unsplash.com/photo-1509440159596-0249088772ff?w=400&h=400&fit=crop",category:"baked-goods",description:"Ready-mix for Nigerian puff puff — sweet, fluffy fried dough balls.",weight:"500g",inStock:!0},{id:"bk4",name:"Hard Dough Bread",price:2.99,image:"https://images.unsplash.com/photo-1509440159596-0249088772ff?w=400&h=400&fit=crop",category:"baked-goods",description:"Classic Caribbean hard dough bread, dense and slightly sweet.",weight:"800g loaf",inStock:!0},{id:"bk5",name:"Bofrot (Ghanaian Doughnuts)",price:3.49,image:"https://images.unsplash.com/photo-1551024601-bec78aea704b?w=400&h=400&fit=crop",category:"baked-goods",description:"Soft, spiced Ghanaian doughnuts with nutmeg and cinnamon.",weight:"6 pieces",inStock:!0},{id:"8",name:"Shea Butter (Raw)",price:7.99,image:"https://images.unsplash.com/photo-1611080626919-7cf5a9dbab5b?w=400&h=400&fit=crop",category:"hair-beauty",description:"100% raw, unrefined 
600shea butter from Ghana. Natural moisturiser for skin and hair.",weight:"500g",inStock:!0},{id:"hb1",name:"Black Soap (Dudu Osun)",price:3.49,image:"https://images.unsplash.com/photo-1607006344380-b6775a0824a7?w=400&h=400&fit=crop",category:"hair-beauty",description:"Traditional African black soap with shea butter, honey and aloe vera.",weight:"150g",inStock:!0,featured:!0},{id:"hb2",name:"Coconut Oil (Virgin)",price:5.99,image:"https://images.unsplash.com/photo-1526947425960-945c6e72858f?w=400&h=400&fit=crop",category:"hair-beauty",description:"Cold-pressed virgin coconut oil for hair treatments, cooking and skin care.",weight:"500ml",inStock:!0},{id:"hb3",name:"Jamaican Black Castor Oil",price:6.99,image:"https://images.unsplash.com/photo-1608571423902-eed4a5ad8108?w=400&h=400&fit=crop",category:"hair-beauty",description:"Pure Jamaican black castor oil for hair growth, scalp health and thickness.",weight:"236ml",inStock:!0},{id:"hb4",name:"Cocoa Butter Lotion",price:4.99,image:"https://images.unsplash.com/photo-1556228578-0d85b1a4d571?w=400&h=400&fit=crop",category:"hair-beauty",description:"Rich cocoa butter body lotion for deep moisturising and even skin tone.",weight:"400ml",inStock:!0},{id:"hb5",name:"African Chebe Powder",price:8.99,image:"https://images.unsplash.com/photo-1608248543803-ba4f8c70ae0b?w=400&h=400&fit=crop",category:"hair-beauty",description:"Traditional Chadian chebe powder for hair length retention and strengthening.",weight:"100g",inStock:!0},{id:"hb6",name:"Neem Oil",price:4.49,image:"https://images.unsplash.com/photo-1608571423902-eed4a5ad8108?w=400&h=400&fit=crop",category:"hair-beauty",description:"Cold-pressed neem oil for scalp treatment, skin care and natural remedies.",weight:"100ml",inStock:!0},{id:"hb7",name:"Chebe Hair Butter",price:9.99,image:"https://images.unsplash.com/photo-1535585209827-a15fcdbc4c2d?w=400&h=400&fit=crop",category:"hair-beauty",description:"Ready-made chebe hair butter blend with shea butter and essential oils.",weight:"250g",inStock:!0},{id:"bk10",name:"Rice (25kg Sack)",price:34.99,image:"https://images.unsplash.com/photo-1586201375761-83865001e31c?w=400&h=400&fit=crop",category:"bulk",description:"Bulk 25kg sack of premium long grain rice for restaurants and catering.",weight:"25kg",inStock:!0},{id:"bk11",name:"Palm Oil (5L)",price:18.99,image:"https://images.unsplash.com/photo-1526947425960-945c6e72858f?w=400&h=400&fit=crop",category:"bulk",description:"5 litre catering-size palm oil for commercial kitchens.",weight:"5 Litres",inStock:!0},{id:"bk12",name:"Gari (10kg Bag)",price:19.99,image:"https://images.unsplash.com/photo-1586201375761-83865001e31c?w=400&h=400&fit=crop",category:"bulk",description:"Bulk bag of premium Ijebu gari for restaurants and wholesale.",weight:"10kg",inStock:!0},{id:"bk13",name:"Plantain (Box of 20)",price:22.99,image:"https://images.unsplash.com/photo-1603052875302-d376b7c0638a?w=400&h=400&fit=crop",category:"bulk",description:"Box of 20 ripe plantains for restaurants, caterers and events.",weight:"20 pieces",inStock:!0},{id:"bk14",name:"Yam (10kg Box)",price:39.99,image:"https://images.unsplash.com/photo-1590165482129-1b8b27698780?w=400&h=400&fit=crop",category:"bulk",description:"Bulk box of fresh yam tubers for commercial and restaurant use.",weight:"10kg",inStock:!0},{id:"bk15",name:"Scotch Bonnet (2kg)",price:12.99,image:"https://images.unsplash.com/photo-1526346698789-22fd84314424?w=400&h=400&fit=crop",category:"bulk",description:"Catering pack of fresh scotch bonnet peppers for restaurant kitchens.",weight:"2kg",inStock:!0}],TK="/assets/hero-banner-CyD_aq5N.jpg",$K=()=>{const e=os.filter(t=>t.featured);return s.jsxs("div",{children:[s.jsxs("section",{className:"relative h-[70vh] min-h-[500px] flex items-center overflow-hidden",children:[s.jsx("img",{src:TK,alt:"Afro Caribbean produce",className:"absolute inset-0 w-full h-full object-cover",width:1920,height:1024}),s.jsx("div",{className:"absolute inset-0 gradient-hero"}),s.jsx("div",{className:"container relative z-10",children:s.jsxs("div",{className:"max-w-xl",children:[s.jsx("p",{className:"text-primary-foreground
600/80 font-medium text-sm tracking-widest uppercase mb-3",children:"Taste Of Africa Mini Mart"}),s.jsx("h1",{className:"font-display text-4xl md:text-6xl font-bold text-primary-foreground leading-tight mb-4",children:"Authentic Afro-Caribbean Flavours"}),s.jsx("p",{className:"text-primary-foreground/80 text-lg mb-8",children:"From plantain to palm oil — discover the finest African and Caribbean groceries, delivered to your door."}),s.jsxs("div",{className:"flex gap-3 flex-wrap",children:[s.jsx(we,{to:"/shop",children:s.jsxs(W,{size:"lg",className:"h-12 px-8 text-base font-bold bg-gold text-gold-foreground hover:bg-gold/90",children:["Shop Now ",s.jsx(Pz,{className:"ml-2 h-5 w-5"})]})}),s.jsx(we,{to:"/trade",children:s.jsx(W,{size:"lg",variant:"outline",className:"h-12 px-8 text-base font-bold border-white/40 text-white bg-white/10 hover:bg-white/20",children:"Trade / Bulk Orders"})})]})]})})]}),s.jsx("section",{className:"py-16 bg-card",children:s.jsxs("div",{className:"container",children:[s.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold text-center mb-10",children:"How It Works"}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[{icon:"🛒",title:"Browse",desc:"Explore our range of authentic products"},{icon:"🛍️",title:"Add to Cart",desc:"Select your favourites and quantities"},{icon:"💳",title:"Checkout",desc:"Complete your order via Trust n Trade"},{icon:"🚚",title:"Delivery",desc:"Get it delivered by Trust n Trade"}].map((t,r)=>s.jsxs("div",{className:"text-center p-6",children:[s.jsx("div",{className:"text-4xl mb-3",children:t.icon}),s.jsx("h3",{className:"font-display font-bold mb-1",children:t.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:t.desc})]},r))})]})}),s.jsx("section",{className:"py-16",children:s.jsxs("div",{className:"container",children:[s.jsxs("div",{className:"flex items-center justify-between mb-8",children:[s.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold",children:"Shop by Category"}),s.jsx(we,{to:"/categories",className:"text-primary text-sm font-medium hover:underline",children:"View All"})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-7 gap-4",children:Ld.map(t=>s.jsxs(we,{to:`/shop?cat=${t.id}`,className:"bg-card border rounded-xl p-4 text-center hover:border-primary hover:shadow-md transition-all group",children:[s.jsx("div",{className:"text-3xl mb-2",children:t.icon}),s.jsx("h3",{className:"text-sm font-medium group-hover:text-primary transition-colors",children:t.name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.count," items"]})]},t.id))})]})}),s.jsx("section",{className:"py-16 bg-card",children:s.jsxs("div",{className:"container",children:[s.jsxs("div",{className:"flex items-center justify-between mb-8",children:[s.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold",children:"Featured Products"}),s.jsx(we,{to:"/shop",className:"text-primary text-sm font-medium hover:underline",children:"View All"})]}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 md:gap-6",children:e.map(t=>s.jsx(Zg,{product:t},t.id))})]})}),s.jsx("section",{className:"py-16",children:s.jsx("div",{className:"container",children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[{icon:s.jsx(Oa,{className:"h-8 w-8 text-primary"}),title:"Fast Delivery",desc:"Reliable delivery via Trust n Trade logistics"},{icon:s.jsx(ij,{className:"h-8 w-8 text-secondary"}),title:"Secure Checkout",desc:"Payments handled securely by Trust n Trade"},{icon:s.jsx(ei,{className:"h-8 w-8 text-gold"}),title:"Fresh Products",desc:"Quality-checked with real-time stock management"}].map((t,r)=>s.jsxs("div",{className:"flex items-start gap-4 p-6 rounded-xl border bg-card",children:[t.icon,s.jsxs("div",{children:[s.jsx("h3",{className:"font-display font-bold mb-1",children:t.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:t.desc})]})]},r))})})})]})},se=b.forwardRef(({className:e,type:t,...r},n)=>s.jsx("input",{type:t,className:ne("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));
vendor: 4,116 bytes, line 600
600se.displayName="Input";function Bk(e,[t,r]){return Math.min(r,Math.max(t,e))}var RK=b.createContext(void 0);function Ff(e){const t=b.useContext(RK);return e||t||"ltr"}function Tj(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var MK=[" ","Enter","ArrowUp","ArrowDown"],IK=[" ","Enter"],co="Select",[ev,tv,DK]=Tf(co),[qc,YNe]=Br(co,[DK,Bc]),rv=Bc(),[LK,ds]=qc(co),[FK,BK]=qc(co),uM=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:p,form:v}=e,m=rv(t),[g,y]=b.useState(null),[x,w]=b.useState(null),[S,j]=b.useState(!1),_=Ff(u),[N,k]=nn({prop:n,defaultProp:a??!1,onChange:i,caller:co}),[O,E]=nn({prop:o,defaultProp:l,onChange:c,caller:co}),A=b.useRef(null),R=g?v||!!g.closest("form"):!0,[T,I]=b.useState(new Set),F=Array.from(T).map(P=>P.props.value).join(";");return s.jsx(xj,{...m,children:s.jsxs(LK,{required:p,scope:t,trigger:g,onTriggerChange:y,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:j,contentId:Zr(),value:O,onValueChange:E,open:N,onOpenChange:k,dir:_,triggerPointerDownPosRef:A,disabled:h,children:[s.jsx(ev.Provider,{scope:t,children:s.jsx(FK,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(P=>{I(D=>new Set(D).add(P))},[]),onNativeOptionRemove:b.useCallback(P=>{I(D=>{const M=new Set(D);return M.delete(P),M})},[]),children:r})}),R?s.jsxs(RM,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:O,onChange:P=>E(P.target.value),disabled:h,form:v,children:[O===void 0?s.jsx("option",{value:""}):null,Array.from(T)]},F):null]})})};uM.displayName=co;var dM="SelectTrigger",fM=b.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...a}=e,i=rv(r),o=ds(dM,r),l=o.disabled||n,c=Me(t,o.onTriggerChange),u=tv(r),d=b.useRef("touch"),[f,h,p]=IM(m=>{const g=u().filter(w=>!w.disabled),y=g.find(w=>w.value===o.value),x=DM(g,m,y);x!==void 0&&o.onValueChange(x.value)}),v=m=>{l||(o.onOpenChange(!0),p()),m&&(o.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return s.jsx(bj,{asChild:!0,...i,children:s.jsx(ye.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":MM(o.value)?"":void 0,...a,ref:c,onClick:oe(a.onClick,m=>{m.currentTarget.focus(),d.current!=="mouse"&&v(m)}),onPointerDown:oe(a.onPointerDown,m=>{d.current=m.pointerType;const g=m.target;g.hasPointerCapture(m.pointerId)&&g.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(v(m),m.preventDefault())}),onKeyDown:oe(a.onKeyDown,m=>{const g=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(g&&m.key===" ")&&MK.includes(m.key)&&(v(),m.preventDefault())})})})});fM.displayName=dM;var hM="SelectValue",pM=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,children:i,placeholder:o="",...l}=e,c=ds(hM,r),{onValueNodeHasChildrenChange:u}=c,d=i!==void 0,f=Me(t,c.onValueNodeChange);return Gt(()=>{u(d)},[u,d]),s.jsx(ye.span,{...l,ref:f,style:{pointerEvents:"none"},children:MM(c.value)?s.jsx(s.Fragment,{children:o}):i})});pM.displayName=hM;var UK="SelectIcon",mM=b.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...a}=e;return s.jsx(ye.span,{"aria-hidden":!0,...a,ref:t,children:n||"▼"})});mM.displayName=UK;var zK="SelectPortal",gM=e=>s.jsx($f,{asChild:!0,...e});gM.displayName=zK;var uo="SelectContent",vM=b.forwardRef((e,t)=>{const r=ds(uo,e.__scopeSelect),[n,a]=b.useState();if(Gt(()=>{a(new DocumentFragment)},[]),!r.open){const i=n;return i?wo.createPortal(s.jsx(yM,{scope:e.__scopeSelect,children:s.jsx(ev.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(xM,{...e,ref:t})});vM.displayName=uo;var In=10,[yM,fs]=qc(uo),qK="SelectContentImpl",WK=io("SelectContent.RemoveScroll"),xM=b.forwardRef((e,t)=>
vendor: 14,408 bytes, line 600
600{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:v,hideWhenDetached:m,avoidCollisions:g,...y}=e,x=ds(uo,r),[w,S]=b.useState(null),[j,_]=b.useState(null),N=Me(t,Q=>S(Q)),[k,O]=b.useState(null),[E,A]=b.useState(null),R=tv(r),[T,I]=b.useState(!1),F=b.useRef(!1);b.useEffect(()=>{if(w)return Oj(w)},[w]),kj();const P=b.useCallback(Q=>{const[me,...L]=R().map(U=>U.ref.current),[Y]=L.slice(-1),J=document.activeElement;for(const U of Q)if(U===J||(U==null||U.scrollIntoView({block:"nearest"}),U===me&&j&&(j.scrollTop=0),U===Y&&j&&(j.scrollTop=j.scrollHeight),U==null||U.focus(),document.activeElement!==J))return},[R,j]),D=b.useCallback(()=>P([k,w]),[P,k,w]);b.useEffect(()=>{T&&D()},[T,D]);const{onOpenChange:M,triggerPointerDownPosRef:$}=x;b.useEffect(()=>{if(w){let Q={x:0,y:0};const me=Y=>{var J,U;Q={x:Math.abs(Math.round(Y.pageX)-(((J=$.current)==null?void 0:J.x)??0)),y:Math.abs(Math.round(Y.pageY)-(((U=$.current)==null?void 0:U.y)??0))}},L=Y=>{Q.x<=10&&Q.y<=10?Y.preventDefault():w.contains(Y.target)||M(!1),document.removeEventListener("pointermove",me),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",L,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",L,{capture:!0})}}},[w,M,$]),b.useEffect(()=>{const Q=()=>M(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[M]);const[z,K]=IM(Q=>{const me=R().filter(J=>!J.disabled),L=me.find(J=>J.ref.current===document.activeElement),Y=DM(me,Q,L);Y&&setTimeout(()=>Y.ref.current.focus())}),q=b.useCallback((Q,me,L)=>{const Y=!F.current&&!L;(x.value!==void 0&&x.value===me||Y)&&(O(Q),Y&&(F.current=!0))},[x.value]),B=b.useCallback(()=>w==null?void 0:w.focus(),[w]),Z=b.useCallback((Q,me,L)=>{const Y=!F.current&&!L;(x.value!==void 0&&x.value===me||Y)&&A(Q)},[x.value]),he=n==="popper"?ub:bM,pe=he===ub?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:v,hideWhenDetached:m,avoidCollisions:g}:{};return s.jsx(yM,{scope:r,content:w,viewport:j,onViewportChange:_,itemRefCallback:q,selectedItem:k,onItemLeave:B,itemTextRefCallback:Z,focusSelectedItem:D,selectedItemText:E,position:n,isPositioned:T,searchRef:z,children:s.jsx(Kg,{as:WK,allowPinchZoom:!0,children:s.jsx(Hg,{asChild:!0,trapped:x.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:oe(a,Q=>{var me;(me=x.trigger)==null||me.focus({preventScroll:!0}),Q.preventDefault()}),children:s.jsx($c,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:s.jsx(he,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:Q=>Q.preventDefault(),...y,...pe,onPlaced:()=>I(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:oe(y.onKeyDown,Q=>{const me=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!me&&Q.key.length===1&&K(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let Y=R().filter(J=>!J.disabled).map(J=>J.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(Y=Y.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const J=Q.target,U=Y.indexOf(J);Y=Y.slice(U+1)}setTimeout(()=>P(Y)),Q.preventDefault()}})})})})})})});xM.displayName=qK;var HK="SelectItemAlignedPosition",bM=b.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...a}=e,i=ds(uo,r),o=fs(uo,r),[l,c]=b.useState(null),[u,d]=b.useState(null),f=Me(t,N=>d(N)),h=tv(r),p=b.useRef(!1),v=b.useRef(!0),{viewport:m,selectedItem:g,selectedItemText:y,focusSelectedItem:x}=o,w=b.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&m&&g&&y){const N=i.trigger.getBoundingClientRect(),k=u.getBoundingClientRect(),O=i.valueNode.getBoundingClientRect(),E=y.getBoundingClientRect();if(i.dir!=="rtl"){const J=E.left-k.left,U=O.left-J,ge=N.left-U,ve=N.width+ge,Ne=Math.max(ve,k.width),Re=window.innerWidth-In,it=Bk(U,[In,Math.max(In,Re-Ne)]);l.style.minWidth=ve+"px",l.style.left=it+"px"}else{const J=k.right-E.right,U=window.innerWidth-O.right-J,ge=window.innerWidth-N.right-U,ve=N.width+ge,Ne=Math.max(ve,k.width),Re=window.innerWidth-In,it=Bk(U,[In,Math.max(In,Re-Ne)]);l.style.minWidth=ve+"px",l.style.right=it+"px"}const A=h(),R=window.innerHeight-In*2,T=m.scrollHeight,I=window.getComputedStyle(u),F=parseInt(I.borderTopWidth,10),P=parseInt(I.paddingTop,10),D=parseInt(I.borderBottomWidth,10),M=parseInt(I.paddingBottom,10),$=F+P+T+M+D,z=Math.min(g.offsetHeight*5,$),K=window.getComputedStyle(m),q=parseInt(K.paddingTop,10),B=parseInt(K.paddingBottom,10),Z=N.top+N.height/2-In,he=R-Z,pe=g.offsetHeight/2,Q=g.offsetTop+pe,me=F+P+Q,L=$-me;if(me<=Z){const J=A.length>0&&g===A[A.length-1].ref.current;l.style.bottom="0px";const U=u.clientHeight-m.offsetTop-m.offsetHeight,ge=Math.max(he,pe+(J?B:0)+U+D),ve=me+ge;l.style.height=ve+"px"}else{const J=A.length>0&&g===A[0].ref.current;l.style.top="0px";const ge=Math.max(Z,F+m.offsetTop+(J?q:0)+pe)+L;l.style.height=ge+"px",m.scrollTop=me-Z+m.offsetTop}l.style.margin=`${In}px 0`,l.style.minHeight=z+"px",l.style.maxHeight=R+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,l,u,m,g,y,i.dir,n]);Gt(()=>w(),[w]);const[S,j]=b.useState();Gt(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const _=b.useCallback(N=>{N&&v.current===!0&&(w(),x==null||x(),v.current=!1)},[w,x]);return s.jsx(KK,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:p,onScrollButtonChange:_,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:s.jsx(ye.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});bM.displayName=HK;var VK="SelectPopperPosition",ub=b.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=In,...i}=e,o=rv(r);return s.jsx(wj,{...o,...i,ref:t,align:n,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ub.displayName=VK;var[KK,$j]=qc(uo,{}),db="SelectViewport",wM=b.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...a}=e,i=fs(db,r),o=$j(db,r),l=Me(t,i.onViewportChange),c=b.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),s.jsx(ev.Slot,{scope:r,children:s.jsx(ye.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:oe(a.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&f){const p=Math.abs(c.current-d.scrollTop);if(p>0){const v=window.innerHeight-In*2,m=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),y=Math.max(m,g);if(y<v){const x=y+p,w=Math.min(v,x),S=x-w;f.style.height=w+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});wM.displayName=db;var jM="SelectGroup",[GK,YK]=qc(jM),XK=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=Zr();return s.jsx(GK,{scope:r,id:a,children:s.jsx(ye.div,{role:"group","aria-labelledby":a,...n,ref:t})})});XK.displayName=jM;var SM="SelectLabel",_M=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=YK(SM,r);return s.jsx(ye.div,{id:a.id,...n,ref:t})});_M.displayName=SM;var om="SelectItem",[QK,NM]=qc(om),kM=b.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:i,...o}=e,l=ds(om,r),c=fs(om,r),u=l.value===n,[d,f]=b.useState(i??""),[h,p]=b.useState(!1),v=Me(t,x=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,x,n,a)}),m=Zr(),g=b.useRef("touch"),y=()=>{a||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(QK,{scope:r,value:n,disabled:a,textId:m,isSelected:u,onItemTextChange:b.useCallback(x=>{f(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:s.jsx(ev.ItemSlot,{scope:r,value:n,disabled:a,textValue:d,children:s.jsx(ye.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:v,onFocus:oe(o.onFocus,()=>p(!0)),onBlur:oe(o.onBlur,()=>p(!1)),onClick:oe(o.onClick,()=>{g.current!=="mouse"&&y()}),onPointerUp:oe(o.onPointerUp,()=>{g.current==="mouse"&&y()}),onPointerDown:oe(o.onPointerDown,x=>{g.current=x.pointerType}),onPointerMove:oe(o.onPointerMove,x=>{var w;g.current=x.pointerType,a?(w=c.onItemLeave)==null||w.call(c):g.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:oe(o.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:oe(o.onKeyDown,x=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&x.key===" "||(IK.includes(x.key)&&y(),x.key===" "&&x.preventDefault())})})})})});kM.displayName=om;var $u="SelectItemText",OM=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,...i}=e,o=ds($u,r),l=fs($u,r),c=NM($u,r),u=BK($u,r),[d,f]=b.useState(null),h=Me(t,y=>f(y),c.onItemTextChange,y=>{var x;return(x=l.itemTextRefCallback)==null?void 0:x.call(l,y,c.value,c.disabled)}),p=d==null?void 0:d.textContent,v=b.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:g}=u;return Gt(()=>(m(v),()=>g(v)),[m,g,v]),s.jsxs(s.Fragment,{children:[s.jsx(ye.span,{id:c.textId,...i,ref:h}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?wo.createPortal(i.children,o.valueNode):null]})});OM.displayName=$u;var CM="SelectItemIndicator",EM=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return NM(CM,r).isSelected?s.jsx(ye.span,{"aria-hidden":!0,...n,ref:t}):null});EM.displayName=CM;var fb="SelectScrollUpButton",PM=b.forwardRef((e,t)=>{const r=fs(fb,e.__scopeSelect),n=$j(fb,e.__scopeSelect),[a,i]=b.useState(!1),o=Me(t,n.onScrollButtonChange);return Gt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?s.jsx(TM,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});PM.displayName=fb;var hb="SelectScrollDownButton",AM=b.forwardRef((e,t)=>{const r=fs(hb,e.__scopeSelect),n=$j(hb,e.__scopeSelect),[a,i]=b.useState(!1),o=Me(t,n.onScrollButtonChange);return Gt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?s.jsx(TM,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});AM.displayName=hb;var TM=b.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=e,i=fs("SelectScrollButton",r),o=b.useRef(null),l=tv(r),c=b.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),Gt(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),s.jsx(ye.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:oe(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:oe(a.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:oe(a.onPointerLeave,()=>{c()})})}),JK="SelectSeparator",$M=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return s.jsx(ye.div,{"aria-hidden":!0,...n,ref:t})});$M.displayName=JK;var pb="SelectArrow",ZK=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=rv(r),i=ds(pb,r),o=fs(pb,r);return i.open&&o.position==="popper"?s.jsx(jj,{...a,...n,ref:t}):null});ZK.displayName=pb;var eG="SelectBubbleInput",RM=b.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const a=b.useRef(null),i=Me(n,a),o=Tj(t);return b.useEffect(()=>{const l=a.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const f=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[o,t]),s.jsx(ye.select,{...r,style:{...GT,...r.style},ref:i,defaultValue:t})});RM.displayName=eG;function MM(e){return e===""||e===void 0}function IM(e){const t=Fr(e),r=b.useRef(""),n=b.useRef(0),a=b.useCallback(o=>{const l=r.current+o;t(l),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=b.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,i]}function DM(e,t,r){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=tG(e,Math.max(i,0));a.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==r?c:void 0}function tG(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var rG=uM,LM=fM,nG=pM,aG=mM,iG=gM,FM=vM,sG=wM,BM=_M,UM=kM,oG=OM,lG=EM,zM=PM,qM=AM,WM=$M;const Tt=rG,$t=nG,kt=b.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(LM,{ref:n,className:ne("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
600ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,s.jsx(aG,{asChild:!0,children:s.jsx(Q1,{className:"h-4 w-4 opacity-50"})})]}));kt.displayName=LM.displayName;const HM=b.forwardRef(({className:e,...t},r)=>s.jsx(zM,{ref:r,className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Iz,{className:"h-4 w-4"})}));HM.displayName=zM.displayName;const VM=b.forwardRef(({className:e,...t},r)=>s.jsx(qM,{ref:r,className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Q1,{className:"h-4 w-4"})}));VM.displayName=qM.displayName;const Ot=b.forwardRef(({className:e,children:t,position:r="popper",...n},a)=>s.jsx(iG,{children:s.jsxs(FM,{ref:a,className:ne("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[s.jsx(HM,{}),s.jsx(sG,{className:ne("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(VM,{})]})}));Ot.displayName=FM.displayName;const cG=b.forwardRef(({className:e,...t},r)=>s.jsx(BM,{ref:r,className:ne("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));cG.displayName=BM.displayName;const xe=b.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(UM,{ref:n,className:ne("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(lG,{children:s.jsx(Ql,{className:"h-4 w-4"})})}),s.jsx(oG,{children:t})]}));xe.displayName=UM.displayName;const uG=b.forwardRef(({className:e,...t},r)=>s.jsx(WM,{ref:r,className:ne("-mx-1 my-1 h-px bg-muted",e),...t}));uG.displayName=WM.displayName;const gr=nM,Wc=OK,dG=aM,KM=b.forwardRef(({className:e,...t},r)=>s.jsx(Yg,{ref:r,className:ne("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));KM.displayName=Yg.displayName;const nr=b.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(dG,{children:[s.jsx(KM,{}),s.jsxs(Xg,{ref:n,className:ne("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,s.jsxs(iM,{className:"absolute right-4 top-4 roun
600ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(Ic,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));nr.displayName=Xg.displayName;const vr=({className:e,...t})=>s.jsx("div",{className:ne("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});vr.displayName="DialogHeader";const GM=({className:e,...t})=>s.jsx("div",{className:ne("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});GM.displayName="DialogFooter";const ar=b.forwardRef(({className:e,...t},r)=>s.jsx(Qg,{ref:r,className:ne("text-lg font-semibold leading-none tracking-tight",e),...t}));ar.displayName=Qg.displayName;const fG=b.forwardRef(({className:e,...t},r)=>s.jsx(Jg,{ref:r,className:ne("text-sm text-muted-foreground",e),...t}));fG.displayName=Jg.displayName;const hG=({product:e,open:t,onOpenChange:r})=>{const{addToCart:n}=jo(),{isInWishlist:a,toggleWishlist:i}=Wg(),[o,l]=b.useState(1);if(!e)return null;const c=a(e.id),u=()=>{for(let d=0;d<o;d++)n(e);X.success(`${o} × ${e.name} added to cart`),l(1),r(!1)};return s.jsx(gr,{open:t,onOpenChange:d=>{r(d),d||l(1)},children:s.jsxs(nr,{className:"max-w-2xl p-0 overflow-hidden gap-0",children:[s.jsx(ar,{className:"sr-only",children:e.name}),s.jsxs("div",{className:"grid md:grid-cols-2",children:[s.jsx("div",{className:"aspect-square bg-card overflow-hidden",children:s.jsx("img",{src:e.image,alt:e.name,className:"w-full h-full object-cover",width:400,height:400})}),s.jsxs("div",{className:"p-6 flex flex-col justify-center",children:[s.jsx("span",{className:"text-xs text-primary font-medium uppercase tracking-wider mb-1",children:e.category.replace("-"," & ")}),s.jsx("h2",{className:"font-display text-2xl font-bold mb-1",children:e.name}),s.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:e.weight}),s.jsxs("p",{className:"text-2xl font-bold text-primary my-3",children:["£",e.price.toFixed(2)]}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4 line-clamp-3",children:e.description}),s.jsx("div",{className:"flex items-center gap-2 mb-4",children:s.jsxs("span",{className:`inline-flex items-center gap-1 text-sm font-medium ${e.inStock?"text-secondary":"text-destructive"}`,children:[s.jsx("span",{className:`h-2 w-2 rounded-full ${e.inStock?"bg-secondary":"bg-destructive"}`}),e.inStock?"In Stock":"Out of Stock"]})}),e.inStock&&s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex items-center border rounded-lg",children:[s.jsx(W,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:()=>l(Math.max(1,o-1)),children:s.jsx(tj,{className:"h-4 w-4"})}),s.jsx("span",{className:"w-8 text-center font-medium text-sm",children:o}),s.jsx(W,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:()=>l(o+1),children:s.jsx(Or,{className:"h-4 w-4"})})]}),s.jsxs(W,{className:"flex-1 h-10 text-sm font-bold",onClick:u,children:[s.jsx(ec,{className:"mr-2 h-4 w-4"})," Add to Cart"]})]}),s.jsxs(W,{variant:"outline",className:"mt-3 w-full",onClick:()=>i(e.id),children:[s.jsx(Jl,{className:`h-4 w-4 mr-2 ${c?"fill-accent text-accent":""}`}),c?"Remove from Wishlist":"Add to Wishlist"]})]})]})]})})},ax=12,pG=()=>{const[e,t]=qT(),[r,n]=b.useState(""),[a,i]=b.useState("default"),[o,l]=b.useState(1),[c,u]=b.useState(null),d=e.get("cat")||"all",f=b.useMemo(()=>{let x=os.filter(w=>{const S=d==="all"||w.category===d,j=w.name.toLowerCase().includes(r.toLowerCase());return S&&j});switch(a){case"price-asc":x=[...x].sort((w,S)=>w.price-S.price);break;case"price-desc":x=[...x].sort((w,S)=>S.price-w.price);break;case"name-asc":x=[...x].sort((w,S)=>w.name.localeCompare(S.name));break}return x},[d,r,a]),h=Math.ceil(f.length/ax),p=Math.min(o,h||1),v=f.slice((p-1)*ax,p*ax),m=x=>{l(1),t(x?{cat:x}:{})},g=x=>{i(x),l(1)},y=x=>{n(x.target.value),l(1)};return s.jsxs("div",{className:"container py-8 md:py-12",children:[s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold mb-2",children:"Shop"}),s.jsx("p",{className:"text-muted-foreground mb-8",children:"Browse our full range of authentic Afro-Caribbean products"}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-4 mb-8",children:[s.jsxs("div",{className:"relative flex-1 max-w-md",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search products...",value:r,onChange:y,className:"pl-10"})]}),s.jsxs(Tt,{value:a,onValueChange:g,children:[s.jsxs(kt,{className:"w-[180px]",children:[s.jsx(Az,{className:"h-4 w-4 mr-2 text-muted-foreground"}),s.jsx($t,{placeholder:"Sort by"})]}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"default",children:"Default"}),s.jsx(xe,{value:"price-asc",children:"Price: Low → High"}),s.jsx(xe,{value:"price-desc",children:"Price: High → Low"}),s.jsx(xe,{value:"name-asc",children:"Name: A → Z"})]})]})]}),s.jsxs("div",{className:"flex gap-2 flex-wrap mb-8",children:[s.jsx(W,{variant:d==="all"?"default":"outline",size:"sm",onClick:()=>m(),children:"All"}),Ld.map(x=>s.jsxs(W,{variant:d===x.id?"default":"outline",size:"sm",onClick:()=>m(x.id),children:[x.icon," ",x.name]},x.id))]}),s.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:["Showing ",v.length," of ",f.length," products"]}),f.length===0?s.jsxs("div",{className:"text-center py-20 text-muted-foreground",children:[s.jsx("p",{className:"text-lg font-medium",children:"No products found"}),s.jsx("p",{className:"text-sm",children:"Try a different search or category"})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 md:gap-6",children:v.map(x=>s.jsx(Zg,{product:x,onQuickView:u},x.id))}),h>1&&s.jsxs("div",{className:"flex items-center justify-center gap-2 mt-10",children:[s.jsx(W,{variant:"outline",size:"icon",onClick:()=>{l(x=>Math.max(1,x-1)),window.scrollTo({top:0,behavior:"smooth"})},disabled:p===1,children:s.jsx(Mz,{className:"h-4 w-4"})}),Array.from({length:h},(x,w)=>w+1).map(x=>s.jsx(W,{variant:x===p?"default":"outline",size:"icon",onClick:()=>{l(x),window.scrollTo({top:0,behavior:"smooth"})},className:"w-10 h-10",children:x},x)),s.jsx(W,{variant:"outline",size:"icon",onClick:()=>{l(x=>Math.min(h,x+1)),window.scrollTo({top:0,behavior:"smooth"})},disabled:p===h,children:s.jsx(J1,{className:"h-4 w-4"})})]})]}),s.jsx(hG,{product:c,open:!!c,onOpenChange:x=>{x||u(null)}})]})},mG=()=>{const{id:e}=FT(),t=os.find(l=>l.id===e),{addToCart:r}=jo(),[n,a]=b.useState(1);if(!t)return s.jsxs("div",{className:"container py-20 text-center",children:[s.jsx("p",{className:"text-xl font-display font-bold",children:"Product not found"}),s.jsx(we,{to:"/shop",className:"text-primary hover:underline mt-4 inline-block",children:"Back to Shop"})]});const i=os.filter(l=>l.category===t.category&&l.id!==t.id).slice(0,4),o=()=>{for(let l=0;l<n;l++)r(t);X.success(`${n} × ${t.name} added to cart`)};return s.jsxs("div",{className:"container py-8 md:py-12",children:[s.jsxs(we,{to:"/shop",className:"inline-flex items-center text-sm text-muted-foreground hover:text-foreground mb-6",children:[s.jsx(Mc,{className:"h-4 w-4 mr-1"})," Back to Shop"]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-8 md:gap-12",children:[s.jsx("div",{className:"aspect-square rounded-xl overflow-hidden bg-card",children:s.jsx("img",{src:t.image,alt:t.name,className:"w-full h-full object-cover",width:600,height:600})}),s.jsxs("div",{className:"flex flex-col justify-center",children:[s.jsx("span",{className:"text-sm text-primary font-medium uppercase tracking-wider mb-2",children:t.category.replace("-"," & ")}),s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold mb-2",children:t.name}),s.jsx("p",{className:"text-muted-foreground mb-1",children:t.weight}),s.jsxs("p",{className:"text-3xl font-bold text-primary my-4",children:["£",t.price.toFixed(2)]}),s.jsx("p",{className:"text-muted-foreground mb-6",children:t.description}),s.jsx("div",{className:"flex items-center gap-2 mb-2",children:s.jsxs("span",{className:`inline-flex items-center gap-1 text-sm font-medium ${t.inStock?"text-secondary":"text-destructive"}`,children:[s.jsx("span",{className:`h-2 w-2 rounded-full ${t.inStock?"bg-secondary":"bg-destructive"}`}),t.inStock?"In Stock":"Out of Stock"]})}),t.inStock&&s.jsxs("div",{className:"flex items-center gap-4 mt-4",children:[s.jsxs("div",{className:"flex items-center border rounded-lg",children:[s.jsx(W,{variant:"ghost",size:"icon",onClick:()=>a(Math.max(1,n-1)),children:s.jsx(tj,{className:"h-4 w-4"})}),s.jsx("span",{className:"w-10 text-center font-medium",children:n}),s.jsx(W,{variant:"ghost",size:"icon",onClick:()=>a(n+1),children:s.jsx(Or,{className:"h-4 w-4"})})]}),s.jsxs(W,{className:"flex-1 h-12 text-base font-bold",onClick:o,children:[s.jsx(ec,{className:"mr-2 h-5 w-5"})," Add to Cart"]})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-4",children:"Checkout & delivery handled by Trust n Trade"})]})]}),i.length>0&&s.jsxs("div",{className:"mt-16",children:[s.jsx("h2",{className:"font-display text-2xl font-bold mb-6",children:"You May Also Like"}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 md:gap-6",children:i.map(l=>s.jsx(Zg,{product:l},l.id))})]})]})},gG=()=>s.jsxs("div",{className:"container py-8 md:py-12",children:[s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold mb-2",children:"Categories"}),s.jsx("p",{className:"text-muted-foreground mb-8",children:"Browse products by category"}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6",children:Ld.map(e=>s.jsxs(we,{to:`/shop?cat=${e.id}`,className:"group bg-card border rounded-2xl p-8 text-center hover:border-primary hover:shadow-xl transition-all",children:[s.jsx("div",{className:"text-5xl mb-4",children:e.icon}),s.jsx("h2",{className:"font-display text-xl font-bold group-hover:text-primary transition-colors",children:e.name}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[e.count," products"]})]},e.id))})]}),yr=b.forwardRef(({className:e,...t},r)=>s.jsx("textarea",{className:ne("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
600ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));yr.displayName="Textarea";const vG=()=>{const e=t=>{t.preventDefault(),X.success("Quote request submitted! We'll get back to you shortly.")};return s.jsx("div",{className:"container py-8 md:py-12",children:s.jsxs("div",{className:"max-w-3xl mx-auto",children:[s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold mb-2",children:"Trade & Restaurant Supply"}),s.jsx("p",{className:"text-muted-foreground mb-8",children:"Reliable bulk supply for restaurants, caterers, and retail businesses."}),s.jsx("div",{className:"grid md:grid-cols-2 gap-8 mb-12",children:[{title:"Bulk Ordering",desc:"Competitive pricing on large quantities of all our products."},{title:"Consistent Supply",desc:"Regular deliveries managed by Trust n Trade logistics."},{title:"Wide Range",desc:"Full catalogue of African and Caribbean ingredients available."},{title:"Dedicated Support",desc:"Customer support and queries handled via Trust n Trade."}].map((t,r)=>s.jsxs("div",{className:"p-6 rounded-xl bg-card border",children:[s.jsx("h3",{className:"font-display font-bold text-lg mb-2",children:t.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:t.desc})]},r))}),s.jsxs("div",{className:"bg-card border rounded-2xl p-8",children:[s.jsx("h2",{className:"font-display text-2xl font-bold mb-6",children:"Request a Quote"}),s.jsxs("form",{onSubmit:e,className:"space-y-4",children:[s.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[s.jsx(se,{placeholder:"Business Name",required:!0}),s.jsx(se,{placeholder:"Contact Name",required:!0})]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[s.jsx(se,{type:"email",placeholder:"Email",required:!0}),s.jsx(se,{placeholder:"Phone"})]}),s.jsx(yr,{placeholder:"Tell us what products you need, quantities, and delivery frequency...",rows:5,required:!0}),s.jsx(W,{type:"submit",size:"lg",className:"w-full md:w-auto font-bold",children:"Submit Quote Request"})]})]})]})})},yG=()=>s.jsx("div",{className:"container py-8 md:py-12",children:s.jsxs("div",{className:"max-w-3xl mx-auto",children:[s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold mb-4",children:"About Us"}),s.jsxs("p",{className:"text-lg text-muted-foreground mb-8",children:["Afro Caribbean Store — ",s.jsx("em",{children:"Taste Of Africa Mini Mart"})," — is your one-stop destination for authentic African and Caribbean groceries, beverages, and beauty products."]}),s.jsxs("div",{className:"prose prose-lg",children:[s.jsx("p",{className:"text-muted-foreground mb-4",children:"We're passionate about bringing the vibrant flavours of Africa and the Caribbean to communities across the UK. From fresh plantains and yams to authentic seasonings and traditional snacks, every product on our shelves is hand-selected for quality and authenticity."}),s.jsxs("p",{className:"text-muted-foreground mb-4",children:["Our checkout, delivery, and customer support are powered by ",s.jsx("strong",{children:"Trust n Trade"}),", ensuring a seamless and secure shopping experience from order to doorstep."]}),s.jsx("p",{className:"text-muted-foreground mb-8",children:"Whether you're cooking a family feast, running a restaurant, or just craving a taste of home — we've got you covered."})]}),s.jsxs("div",{className:"bg-card border rounded-2xl p-8 mt-8",children:[s.jsx("h2",{className:"font-display text-2xl font-bold mb-4",children:"Get In Touch"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Have questions? We'd love to hear from you."}),s.jsxs("div",{className:"flex gap-3 flex-wrap",children:[s.jsx("a",{href:"mailto:[email protected]",children:s.jsx(W,{variant:"outline",children:"📧 Email Us"})}),s.jsx("a",{href:"https://wa.me/",target:"_blank",rel:"noopener noreferrer",children:s.jsx(W,{variant:"outline",children:"💬 WhatsApp"})})]})]}),s.jsxs("div",{className:"mt-12 text-center",children:[s.jsx("h3",{className:"font-display text-xl font-bold mb-3",children:"Frequently Asked Questions"}),s.jsx("div",{className:"text-left space-y-4",children:[{q:"How does checkout work?",a:"You browse and add items here, then checkout is completed securely via Trust n Trade."},{q:"How is delivery handled?",a:"All deliveries are managed by Trust n Trade's logistics network for reliable service."},{q:"Do you offer bulk ordering?",a:"Yes! Visit our Trade page for bulk pricing and quote requests."}].map((e,t)=>s.jsxs("div",{className:"p-4 rounded-xl bg-card border",children:[s.jsx("h4",{className:"font-bold mb-1",children:e.q}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e.a})]},t))})]})]})}),xG=()=>{const e=ka();return b.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),s.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})}
600,bG=()=>{const{user:e}=ir(),{wishlistIds:t,loading:r}=Wg(),n=os.filter(a=>t.includes(a.id));return e?r?s.jsx("div",{className:"container py-20 text-center",children:s.jsx("p",{className:"text-muted-foreground",children:"Loading your wishlist…"})}):s.jsxs("div",{className:"container py-8 md:py-12",children:[s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold mb-2",children:"Your Wishlist"}),s.jsxs("p",{className:"text-muted-foreground mb-8",children:[n.length," saved ",n.length===1?"item":"items"]}),n.length===0?s.jsxs("div",{className:"text-center py-20 text-muted-foreground",children:[s.jsx(Jl,{className:"h-12 w-12 mx-auto mb-4 opacity-40"}),s.jsx("p",{className:"text-lg font-medium",children:"Your wishlist is empty"}),s.jsx("p",{className:"text-sm mb-6",children:"Browse products and tap the heart icon to save them"}),s.jsx(W,{asChild:!0,children:s.jsx(we,{to:"/shop",children:"Browse Shop"})})]}):s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 md:gap-6",children:n.map(a=>s.jsx(Zg,{product:a},a.id))})]}):s.jsxs("div",{className:"container py-20 text-center",children:[s.jsx(Jl,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),s.jsx("h1",{className:"font-display text-2xl font-bold mb-2",children:"Your Wishlist"}),s.jsx("p",{className:"text-muted-foreground mb-6",children:"Sign in to save your favourite products"}),s.jsx(W,{asChild:!0,children:s.jsx(we,{to:"/auth",children:"Sign In"})})]})};var wG="Label",YM=b.forwardRef((e,t)=>s.jsx(ye.label,{...e,ref:t,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));YM.displayName=wG;var XM=YM;const jG=Rc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Oe=b.forwardRef(({className:e,...t},r)=>s.jsx(XM,{ref:r,className:ne(jG(),e),...t}));Oe.displayName=XM.displayName;const SG=()=>{const[e,t]=b.useState(""),[r,n]=b.useState(""),[a,i]=b.useState(!1),{signIn:o}=ir(),l=ui(),c=async u=>{u.preventDefault(),i(!0);const{error:d}=await o(e,r);i(!1),d?X.error(d.message):(X.success("Signed in successfully"),l("/admin"))};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-sidebar",children:s.jsxs("div",{className:"w-full max-w-sm p-8 bg-card rounded-2xl shadow-xl border",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("div",{className:"h-14 w-14 rounded-2xl bg-primary/10 mx-auto flex items-center justify-center mb-4",children:s.jsx(sj,{className:"h-7 w-7 text-primary"})}),s.jsx("h1",{className:"font-display text-xl font-bold",children:"Admin Dashboard"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Afro Caribbean Store"})]}),s.jsxs("form",{onSubmit:c,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"email",className:"text-xs font-medium",children:"Email"}),s.jsx(se,{id:"email",type:"email",value:e,onChange:u=>t(u.target.value),required:!0,placeholder:"[email protected]",className:"mt-1.5"})]}),s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"password",className:"text-xs font-medium",children:"Password"}),s.jsx(se,{id:"password",type:"password",value:r,onChange:u=>n(u.target.value),required:!0,placeholder:"••••••••",className:"mt-1.5"})]}),s.jsx(W,{type:"submit",className:"w-full h-11 font-bold",disabled:a,children:a?s.jsx(Ze,{className:"h-4 w-4 animate-spin"}):"Sign In"})]})]})})};var ix="rovingFocusGroup.onEntryFocus",_G={bubbles:!1,cancelable:!0},Bf="RovingFocusGroup",[mb,QM,NG]=Tf(Bf),[kG,nv]=Br(Bf,[NG]),[OG,CG]=kG(Bf),JM=b.forwardRef((e,t)=>s.jsx(mb.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(mb.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(EG,{...e,ref:t})})}));JM.displayName=Bf;var EG=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=b.useRef(null),p=Me(t,h),v=Ff(i),[m,g]=nn({prop:o,defaultProp:l??null,onChange:c,caller:Bf}),[y,x]=b.useState(!1),w=Fr(u),S=QM(r),j=b.useRef(!1),[_,N]=b.useState(0);return b.useEffect(()=>{const k=h.current;if(k)return k.addEventListener(ix,w),()=>k.removeEventListener(ix,w)},[w]),s.jsx(OG,{scope:r,orientation:n,dir:v,loop:a,currentTabStopId:m,onItemFocus:b.useCallback(k=>g(k),[g]),onItemShiftTab:b.useCallback(()=>x(!0),[]),onFocusableItemAdd:b.useCallback(()=>N(k=>k+1),[]),onFocusableItemRemove:b.useCallback(()=>N(k=>k-1),[]),children:s.jsx(ye.div,{tabIndex:y||_===0?-1:0,"data-orientation":n,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:oe(e.onMouseDown,()=>{j.current=!0}),onFocus:oe(e.onFocus,k=>{const O=!j.current;if(k.target===k.currentTarget&&O&&!y){const E=new CustomEvent(ix,_G);
vendor: 2,462 bytes, line 600
600if(k.currentTarget.dispatchEvent(E),!E.defaultPrevented){const A=S().filter(P=>P.focusable),R=A.find(P=>P.active),T=A.find(P=>P.id===m),F=[R,T,...A].filter(Boolean).map(P=>P.ref.current);tI(F,d)}}j.current=!1}),onBlur:oe(e.onBlur,()=>x(!1))})})}),ZM="RovingFocusGroupItem",eI=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,children:o,...l}=e,c=Zr(),u=i||c,d=CG(ZM,r),f=d.currentTabStopId===u,h=QM(r),{onFocusableItemAdd:p,onFocusableItemRemove:v,currentTabStopId:m}=d;return b.useEffect(()=>{if(n)return p(),()=>v()},[n,p,v]),s.jsx(mb.ItemSlot,{scope:r,id:u,focusable:n,active:a,children:s.jsx(ye.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:oe(e.onMouseDown,g=>{n?d.onItemFocus(u):g.preventDefault()}),onFocus:oe(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:oe(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){d.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const y=TG(g,d.orientation,d.dir);if(y!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let w=h().filter(S=>S.focusable).map(S=>S.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const S=w.indexOf(g.currentTarget);w=d.loop?$G(w,S+1):w.slice(S+1)}setTimeout(()=>tI(w))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:m!=null}):o})})});eI.displayName=ZM;var PG={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function AG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function TG(e,t,r){const n=AG(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return PG[n]}function tI(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function $G(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var rI=JM,nI=eI,av="Tabs",[RG,XNe]=Br(av,[nv]),aI=nv(),[MG,Rj]=RG(av),iI=b.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=Ff(l),[f,h]=nn({prop:n,onChange:a,defaultProp:i??"",caller:av});return s.jsx(MG,{scope:r,baseId:Zr(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:c,children:s.jsx(ye.div,{dir:d,"data-orientation":o,...u,ref:t})})});iI.displayName=av;
600var sI="TabsList",oI=b.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...a}=e,i=Rj(sI,r),o=aI(r);return s.jsx(rI,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:s.jsx(ye.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});oI.displayName=sI;var lI="TabsTrigger",cI=b.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:a=!1,...i}=e,o=Rj(lI,r),l=aI(r),c=fI(o.baseId,n),u=hI(o.baseId,n),d=n===o.value;return s.jsx(nI,{asChild:!0,...l,focusable:!a,active:d,children:s.jsx(ye.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:oe(e.onMouseDown,f=>{!a&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:oe(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:oe(e.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!a&&f&&o.onValueChange(n)})})})});cI.displayName=lI;var uI="TabsContent",dI=b.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:a,children:i,...o}=e,l=Rj(uI,r),c=fI(l.baseId,n),u=hI(l.baseId,n),d=n===l.value,f=b.useRef(d);return b.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),s.jsx(ln,{present:a||d,children:({present:h})=>s.jsx(ye.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&i})})});dI.displayName=uI;function fI(e,t){return`${e}-trigger-${t}`}function hI(e,t){return`${e}-content-${t}`}var IG=iI,pI=oI,mI=cI,gI=dI;const vI=IG,Mj=b.forwardRef(({className:e,...t},r)=>s.jsx(pI,{ref:r,className:ne("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Mj.displayName=pI.displayName;const Ds=b.forwardRef(({className:e,...t},r)=>s.jsx(mI,{ref:r,className:ne("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Ds.displayName=mI.displayName;const Ls=b.forwardRef(({className:e,...t},r)=>s.jsx(gI,{ref:r,className:ne("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ls.displayName=gI.displayName;var DG="Separator",Uk="horizontal",LG=["horizontal","vertical"],yI=b.forwardRef((e,t)=>{const{decorative:r,orientation:n=Uk,...a}=e,i=FG(n)?n:Uk,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(ye.div,{"data-orientation":i,...l,...a,ref:t})});yI.displayName=DG;function FG(e){return LG.includes(e)}var xI=yI;const Yn=b.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},a)=>s.jsx(xI,{ref:a,decorative:r,orientation:t,className:ne("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));Yn.displayName=xI.displayName;var BG="authorization_response",UG="/~oauth/initiate",zG=["https://oauth.lovable.app","https://lovable.dev"],qG="lovable://oauth-callback",WG=500,HG=12e4;function VG(e){let t;const r=new Promise(i=>{t=i}),n=i=>{if(!e.some(c=>i.origin===c))return;const l=i.data;!l||typeof l!="object"||l.type===BG&&t(l.response)},a=()=>{window.removeEventListener("message",n)};return window.addEventListener("message",n),{cleanup:a,messagePromise:r}}function KG(e){const t=window.screenX!==0||window.screenY!==0||!e,r=t?window.outerWidth*.5:window.screen.width*.5,n=t?window.outerHeight*.5:window.screen.height*.5,a=t?window.screenX+(window.outerWidth-r)/2:(window.screen.width-r)/2,i=t?window.screenY+(window.outerHeight-n)/2:(window.screen.height-n)/2;return{width:r,height:n,left:a,top:i}}function zk(e,t){return e.state!==t?{error:new Error("State is invali
600d")}:e.error?e.error==="legacy_flow"?{error:new Error("This flow is not supported in Preview mode. Please open the app in a new tab to sign in.")}:{error:new Error(e.error_description??"Sign in failed")}:!e.access_token||!e.refresh_token?{error:new Error("No tokens received")}:{tokens:{access_token:e.access_token,refresh_token:e.refresh_token},error:null}}function GG(){return typeof crypto<"u"&&crypto.getRandomValues?[...crypto.getRandomValues(new Uint8Array(16))].map(e=>e.toString(16).padStart(2,"0")).join(""):Math.random().toString(36).substring(2)+Date.now().toString(36)}function YG(e={}){const t=e.oauthBrokerUrl??UG,r=e.supportedOAuthOrigins??zG;async function n(a,i={}){let o=!1;try{o=window.self!==window.top}catch{o=!0}const l=navigator.userAgent,c=/iPhone|iPad|iPod|Android/i.test(l),u=/LovableApp\//.test(l),d=GG(),f=u&&o?qG:i.redirect_uri??window.location.origin,h=new URLSearchParams({...i.extraParams,provider:a,redirect_uri:f,state:d});if(!o)return window.location.href=`${t}?${h.toString()}`,{error:null,redirected:!0};u||h.set("response_mode","web_message");const p=`${t}?${h.toString()}`,{messagePromise:v,cleanup:m}=VG(r);let g;if(c)g=window.open(p,"_blank");else{const{width:w,height:S,left:j,top:_}=KG(o);g=window.open(p,"oauth",`width=${w},height=${S},left=${j},top=${_}`)}if(!g&&u){let w;const S=new Promise((j,_)=>{w=setTimeout(()=>{_(new Error("OAuth timed out waiting for response"))},HG)});try{const j=await Promise.race([v,S]);return zk(j,d)}catch(j){return{error:j instanceof Error?j:new Error(String(j))}}finally{w&&clearTimeout(w),m()}}if(!g)return m(),{error:new Error("Popup was blocked")};let y;const x=new Promise((w,S)=>{y=setInterval(()=>{g.closed&&(clearInterval(y),S(new Error("Sign in was cancelled")))},WG)});try{const w=await Promise.race([v,x]);return zk(w,d)}catch(w){return{error:w instanceof Error?w:new Error(String(w))}}finally{clearInterval(y),m(),g==null||g.close()}}return{signInWithOAuth:n}}function XG(e={}){return YG(e)}const QG=XG(),JG={auth:{signInWithOAuth:async(e,t)=>{const r=await QG.signInWithOAuth(e,{redirect_uri:t==null?void 0:t.redirect_uri,extraParams:{...t==null?void 0:t.extraParams}});if(r.redirected||r.error)return r;try{await V.auth.setSession(r.tokens)}catch(n){return{error:n instanceof Error?n:new Error(String(n))}}return r}}},ZG=()=>{const[e,t]=b.useState("login"),[r,n]=b.useState(""),[a,i]=b.useState(""),[o,l]=b.useState(""),[c,u]=b.useState(!1),{signIn:d,signUp:f,user:h}=ir(),p=ui();if(h)return p("/",{replace:!0}),null;const v=async y=>{y.preventDefault(),u(!0);const{error:x}=await d(r,a);u(!1),x?X.error(x.message):(X.success("Welcome back!"),p("/"))},m=async y=>{if(y.preventDefault(),a.length<6){X.error("Password must be at least 6 characters");return}u(!0);const{error:x}=await f(r,a,o);u(!1),x?X.error(x.message):(X.success("Account created! Please check your email to verify your account."),t("login"))},g=async()=>{const{error:y}=await JG.auth.signInWithOAuth("google",{redirect_uri:window.location.origin});y&&X.error(y.message)};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:s.jsxs("div",{className:"w-full max-w-md",children:[s.jsxs(we,{to:"/",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-6",children:[s.jsx(Mc,{className:"h-4 w-4"})," Back to store"]}),s.jsxs("div",{className:"bg-card rounded-2xl shadow-xl border p-8",children:[s.jsxs("div",{className:"text-center mb-6",children:[s.jsx("span",{className:"text-3xl",children:"🌍"}),s.jsx("h1",{className:"font-display text-2xl font-bold mt-2",children:"My Account"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Sign in or create an account to save your wishlist and track orders."})]}),s.jsxs(vI,{value:e,onValueChange:y=>t(y),children:[s.jsxs(Mj,{className:"grid w-full grid-cols-2 mb-6",children:[s.jsx(Ds,{value:"login",children:"Sign In"}),s.jsx(Ds,{value:"signup",children:"Create Account"})]}),s.jsx(Ls,{value:"login",children:s.jsxs("form",{onSubmit:v,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"login-email",children:"Email"}),s.jsxs("div",{className:"relative",children:[s.jsx(ti,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{id:"login-email",type:"email",value:r,onChange:y=>n(y.target.value),required:!0,placeholder:"[email protected]",className:"pl-10"})]})]}),s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"login-password",children:"Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(HN,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{id:"login-password",type:"password",value:a,onChange:y=>i(y.target.value),required:!0,placeholder:"••••••••",className:"pl-10"})]})]}),s.jsx(W,{type:"submit",className:"w-full h-11 font-bold",disabled:c,
600children:c?"Signing in...":"Sign In"})]})}),s.jsx(Ls,{value:"signup",children:s.jsxs("form",{onSubmit:m,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"signup-name",children:"Full Name"}),s.jsxs("div",{className:"relative",children:[s.jsx(Qp,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{id:"signup-name",type:"text",value:o,onChange:y=>l(y.target.value),placeholder:"Your name",className:"pl-10"})]})]}),s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"signup-email",children:"Email"}),s.jsxs("div",{className:"relative",children:[s.jsx(ti,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{id:"signup-email",type:"email",value:r,onChange:y=>n(y.target.value),required:!0,placeholder:"[email protected]",className:"pl-10"})]})]}),s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"signup-password",children:"Password"}),s.jsxs("div",{className:"relative",children:[s.jsx(HN,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{id:"signup-password",type:"password",value:a,onChange:y=>i(y.target.value),required:!0,placeholder:"Min. 6 characters",className:"pl-10"})]})]}),s.jsx(W,{type:"submit",className:"w-full h-11 font-bold",disabled:c,children:c?"Creating account...":"Create Account"})]})})]}),s.jsxs("div",{className:"flex items-center gap-3 my-6",children:[s.jsx(Yn,{className:"flex-1"}),s.jsx("span",{className:"text-xs text-muted-foreground uppercase",children:"or"}),s.jsx(Yn,{className:"flex-1"})]}),s.jsxs(W,{variant:"outline",className:"w-full h-11 font-medium",onClick:g,disabled:c,children:[s.jsxs("svg",{className:"h-5 w-5 mr-2",viewBox:"0 0 24 24",children:[s.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),s.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),s.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),s.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Continue with Google"]})]})]})})},le=b.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ne("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));le.displayName="Card";const dt=b.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ne("flex flex-col space-y-1.5 p-6",e),...t}));dt.displayName="CardHeader";const mt=b.forwardRef(({className:e,...t},r)=>s.jsx("h3",{ref:r,className:ne("text-2xl font-semibold leading-none tracking-tight",e),...t}));mt.displayName="CardTitle";const gb=b.forwardRef(({className:e,...t},r)=>s.jsx("p",{ref:r,className:ne("text-sm text-muted-foreground",e),...t}));gb.displayName="CardDescription";const ce=b.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ne("p-6 pt-0",e),...t}));ce.displayName="CardContent";const eY=b.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:ne("flex items-center p-6 pt-0",e),...t}));eY.displayName="CardFooter";const tY=Rc("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Be({className:e,variant:t,...r}){return s.jsx("div",{className:ne(tY({variant:t}),e),...r})}function an(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function fo(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const bI=6048e5,rY=864e5,nY=36e5;let aY={};function iv(){return aY}function Fd(e,t){var l,c,u,d;const r=iv(),n=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=an(e),i=a.getDay(),o=(i<n?7:0)+i-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function lm(e){return Fd(e,{weekStartsOn:1}
vendor: 4,136 bytes, line 600
600)}function wI(e){const t=an(e),r=t.getFullYear(),n=fo(e,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const a=lm(n),i=fo(e,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=lm(i);return t.getTime()>=a.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function qk(e){const t=an(e);return t.setHours(0,0,0,0),t}function Wk(e){const t=an(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function iY(e,t){const r=qk(e),n=qk(t),a=+r-Wk(r),i=+n-Wk(n);return Math.round((a-i)/rY)}function sY(e){const t=wI(e),r=fo(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),lm(r)}function oY(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function lY(e){if(!oY(e)&&typeof e!="number")return!1;const t=an(e);return!isNaN(Number(t))}function cY(e){return t=>{const n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function uY(e,t){return+an(e)-+an(t)}function Hk(e,t,r){const n=uY(e,t)/nY;return cY(r==null?void 0:r.roundingMethod)(n)}function dY(e){const t=an(e),r=fo(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}const fY={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},hY=(e,t,r)=>{let n;const a=fY[e];return typeof a=="string"?n=a:t===1?n=a.one:n=a.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function sx(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const pY={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},mY={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gY={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vY={date:sx({formats:pY,defaultWidth:"full"}),time:sx({formats:mY,defaultWidth:"full"}),dateTime:sx({formats:gY,defaultWidth:"full"})},yY={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xY=(e,t,r,n)=>yY[e];function pu(e){return(t,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let a;if(n==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=r!=null&&r.width?String(r.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const bY={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},wY={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},jY={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},SY={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
600ay","Saturday"]},_Y={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},NY={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},kY=(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},OY={ordinalNumber:kY,era:pu({values:bY,defaultWidth:"wide"}),quarter:pu({values:wY,defaultWidth:"wide",argumentCallback:e=>e-1}),month:pu({values:jY,defaultWidth:"wide"}),day:pu({values:SY,defaultWidth:"wide"}),dayPeriod:pu({values:_Y,defaultWidth:"wide",formattingValues:NY,defaultFormattingWidth:"wide"})};function mu(e){return(t,r={})=>{const n=r.width,a=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?EY(l,f=>f.test(o)):CY(l,f=>f.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;const d=t.slice(o.length);return{value:u,rest:d}}}function CY(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function EY(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function PY(e){return(t,r={})=>{const n=t.match(e.matchPattern);if(!n)return null;const a=n[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=r.valueCallback?r.valueCallback(o):o;const l=t.slice(a.length);return{value:o,rest:l}}}const AY=/^(\d+)(th|st|nd|rd)?/i,TY=/\d+/i,$Y={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},RY={any:[/^b/i,/^(a|c)/i]},MY={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},IY={any:[/1/i,/2/i,/3/i,/4/i]},DY={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},LY={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},FY={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},BY={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},UY={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},zY={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},qY={ordinalNumber:PY({matchPattern:AY,parsePattern:TY,valueCallback:e=>parseInt(e,10)}),era:mu({matchPatterns:$Y,defaultMatchWidth:"wide",parsePatterns:RY,defaultParseWidth:"any"}),quarter:mu({matchPatterns:MY,defaultMatchWidth:"wide",parsePatterns:IY,defaultParseWidth:"any",valueCallback:e=>e+1}),month:mu({matchPatterns:DY,defaultMatchWidth:"wide",parsePatterns:LY,defaultParseWidth:"any"}),day:mu({matchPatterns:FY,defaultMatchWidth:"wide",parsePatterns:BY,defaultParseWidth:"any"}),dayPeriod:mu({matchPatterns:UY,defaultMatchWidth:"any",parsePatterns:zY,defaultParseWidth:"any"})},WY={code:"en-US",formatDistance:hY,formatLong:vY,formatRelative:xY,localize:OY,match:qY,options:{weekStartsOn:0,firstWeekContainsDate:1}};function HY(e){const t=an(e);return iY(t,dY(t))+1}function VY(e){const t=an(e),r=+lm(t)-+sY(t);return Math.round(r/bI)+1}function jI(e,t){var d,f,h,p;const r=an(e),n=r.getFullYear(),a=iv(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((p=(h=a.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=fo(e,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=Fd(o,t),c=fo(e,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const u=Fd(c,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=u.getTime()?n:n-1}function KY(e,t){var l,c,u,d;const r=iv(),n=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,a=jI(e,t),i=fo(e,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),Fd(i,t)}function GY(e,t){const r=an(e),n=+Fd(r,t)-+KY(r,t);return Math.round(n/bI)+1}function We(e,t){const r=e<0?"-":"",n=Math.abs(e).toString().padStart(t,"0");return r+n}const wi={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return We(t==="yy"?n%100:n,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):We(r+1,2)},d(e,t){return We(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return We(e.getHours()%12||12,t.length)},H(e,t){return We(e.getHours(),t.length)},m(e,t){return We(e.getMinutes(),t.length)},s(e,t){return We(e.getSeconds(),t.length)},S(e,t){const r=t.length,n=e.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return We(a,t.length)}},zo={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Vk={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const n=e.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return wi.y(e,t)},Y:function(e,t,r,n){const a=jI(e,n),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return We(o,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):We(i,t.length)},R:function(e,t){const r=wI(e);return We(r,t.length)},u:function(e,t){const r=e.getFullYear();return We(r,t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return We(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return We(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return wi.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return We(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const a=GY(e,n);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):We(a,t.length)},I:function(e,t,r){const n=VY(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):We(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):wi.d(e,t)},D:function(e,t,r){const n=HY(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):We(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return We(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const a=e.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return We(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),a=n===0?7:n;switch(t){case"i":return String(a);case"ii":return We(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let a;switch(n===12?a=zo.noon:n===0?a=zo.midnight:a=n/12>
vendor: 4,402 bytes, line 600
600=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let a;switch(n>=17?a=zo.evening:n>=12?a=zo.afternoon:n>=4?a=zo.morning:a=zo.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let n=e.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return wi.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):wi.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):We(n,t.length)},k:function(e,t,r){let n=e.getHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):We(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):wi.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):wi.s(e,t)},S:function(e,t){return wi.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(n===0)return"Z";switch(t){case"X":return Gk(n);case"XXXX":case"XX":return Os(n);case"XXXXX":case"XXX":default:return Os(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return Gk(n);case"xxxx":case"xx":return Os(n);case"xxxxx":case"xxx":default:return Os(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Kk(n,":");case"OOOO":default:return"GMT"+Os(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Kk(n,":");case"zzzz":default:return"GMT"+Os(n,":")}},t:function(e,t,r){const n=Math.trunc(e.getTime()/1e3);return We(n,t.length)},T:function(e,t,r){const n=e.getTime();return We(n,t.length)}};function Kk(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),i=n%60;return i===0?r+String(a):r+String(a)+t+We(i,2)}function Gk(e,t){return e%60===0?(e>0?"-":"+")+We(Math.abs(e)/60,2):Os(e,t)}function Os(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),a=We(Math.trunc(n/60),2),i=We(n%60,2);return r+a+t+i}const Yk=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},SI=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},YY=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return Yk(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",Yk(n,t)).replace("{{time}}",SI(a,t))},XY={p:SI,P:YY},QY=/^D+$/,JY=/^Y+$/,ZY=["D","DD","YY","YYYY"];function eX(e){return QY.test(e)}function tX(e){return JY.test(e)}function rX(e,t,r){const n=nX(e,t,r);if(console.warn(n),ZY.includes(e))throw new RangeError(n)}function nX(e,t,r){const n=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const aX=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,iX=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sX=/^'([^]*?)'?$/,oX=/''/g,lX=/[a-zA-Z]/;function pr(e,t,r){var d,f,h,p;const n=iv(),a=n.locale??WY,i=n.firstWeekContainsDate??((f=(d=n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,o=n.weekStartsOn??((p=(h=n.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,l=an(e);if(!lY(l))throw new RangeError("Invalid time value");let c=t.match(iX).map(v=>{const m=v[0];if(m==="p"||m==="P"){const g=XY[m];return g(v,a.formatLong)}return v}).join("").match(aX).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const m=v[0];if(m==="'")return{isToken:!1,value:cX(v)};if(Vk[m])return{isToken:!0,value:v};
600if(m.match(lX))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:v}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(v=>{if(!v.isToken)return v.value;const m=v.value;(tX(m)||eX(m))&&rX(m,t,String(e));const g=Vk[m[0]];return g(l,m,a.localize,u)}).join("")}function cX(e){const t=e.match(sX);return t?t[1].replace(oX,"'"):e}const uX=e=>{switch(e.toLowerCase()){case"completed":case"delivered":return"bg-secondary/20 text-secondary border-secondary/30";case"pending":return"bg-primary/20 text-primary border-primary/30";case"cancelled":return"bg-destructive/20 text-destructive border-destructive/30";default:return"bg-muted text-muted-foreground"}},dX=()=>{const{user:e,loading:t,signOut:r,isStaff:n}=ir(),a=ui(),[i,o]=b.useState(""),[l,c]=b.useState(!1),[u,d]=b.useState(!0),[f,h]=b.useState([]),[p,v]=b.useState(!0);b.useEffect(()=>{!t&&!e&&a("/auth",{replace:!0})},[t,e,a]),b.useEffect(()=>{if(!e)return;const y=async()=>{const{data:w}=await V.from("profiles").select("display_name").eq("user_id",e.id).maybeSingle();w!=null&&w.display_name&&o(w.display_name),d(!1)},x=async()=>{const{data:w}=await V.from("orders").select("id, order_number, status, total, items, created_at").eq("user_id",e.id).order("created_at",{ascending:!1}).limit(20);h(w??[]),v(!1)};y(),x()},[e]);const m=async y=>{if(y.preventDefault(),!e)return;c(!0);const{error:x}=await V.from("profiles").update({display_name:i}).eq("user_id",e.id);c(!1),x?X.error("Failed to update profile"):X.success("Profile updated")},g=async()=>{await r(),X.success("Signed out"),a("/")};return t||!e?s.jsx("div",{className:"container py-20 text-center",children:s.jsx(Ze,{className:"h-6 w-6 animate-spin mx-auto text-muted-foreground"})}):s.jsxs("div",{className:"container max-w-2xl py-8 md:py-12",children:[s.jsxs(we,{to:"/",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-6",children:[s.jsx(Mc,{className:"h-4 w-4"})," Back to store"]}),s.jsx("h1",{className:"font-display text-3xl font-bold mb-1",children:"My Account"}),s.jsx("p",{className:"text-muted-foreground mb-8",children:"Manage your profile and preferences"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs(le,{children:[s.jsxs(dt,{children:[s.jsx(mt,{className:"text-lg",children:"Profile Details"}),s.jsx(gb,{children:"Update your personal information"})]}),s.jsx(ce,{children:u?s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"}):s.jsxs("form",{onSubmit:m,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"displayName",children:"Display Name"}),s.jsxs("div",{className:"relative mt-1",children:[s.jsx(Qp,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{id:"displayName",value:i,onChange:y=>o(y.target.value),placeholder:"Your name",className:"pl-10"})]})]}),s.jsxs("div",{children:[s.jsx(Oe,{children:"Email"}),s.jsxs("div",{className:"relative mt-1",children:[s.jsx(ti,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{value:e.email??"",disabled:!0,className:"pl-10 opacity-60"})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Email cannot be changed here"})]}),s.jsx(W,{type:"submit",disabled:l,className:"font-bold",children:l?"Saving...":"Save Changes"})]})})]}),s.jsxs(le,{children:[s.jsxs(dt,{children:[s.jsxs(mt,{className:"text-lg flex items-center gap-2",children:[s.jsx(Gn,{className:"h-5 w-5"})," Order History"]}),s.jsx(gb,{children:"Your recent purchases"})]}),s.jsx(ce,{children:p?s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"}):f.length===0?s.jsxs("div",{className:"text-center py-8",children:[s.jsx(as,{className:"h-10 w-10 mx-auto text-muted-foreground/40 mb-3"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-1",children:"No orders yet"}),s.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Your purchase history will appear here"}),s.jsx(W,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(we,{to:"/shop",children:"Browse Shop"})})]}):s.jsx("div",{className:"space-y-3",children:f.map(y=>{const x=Array.isArray(y.items)?y.items.length:0;return s.jsxs(we,{to:`/order/${y.id}`,className:"flex items-center justify-between p-4 rounded-lg border bg-background hover:border-primary/40 hover:shadow-sm transition-all cursor-pointer",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("p",{className:"font-medium text-sm",children:["#",y.order_number]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[pr(new Date(y.created_at),"d MMM yyyy"),x>0&&` · ${x} item${x!==1?"s":""}`]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[s.jsx(Be,{variant:"outline",className:uX(y.status),children:y.status}),s.jsxs("span",{className:"font-bold text-sm",children:["£",y.total.toFixed(2)]})]})]},y.id)})})})]}),s.jsxs(le,{children:[s.jsx(dt,{children:s.jsx(mt,{className:"text-lg",children:"Qu
600ick Links"})}),s.jsxs(ce,{className:"space-y-3",children:[n&&s.jsxs(s.Fragment,{children:[s.jsxs(we,{to:"/admin",className:"flex items-center gap-3 text-sm font-medium hover:text-primary transition-colors",children:[s.jsx(Z1,{className:"h-4 w-4"})," Admin Dashboard"]}),s.jsx(Yn,{})]}),s.jsxs(we,{to:"/wishlist",className:"flex items-center gap-3 text-sm hover:text-primary transition-colors",children:[s.jsx(Jl,{className:"h-4 w-4"})," My Wishlist"]}),s.jsx(Yn,{}),s.jsxs("button",{onClick:g,className:"flex items-center gap-3 text-sm text-destructive hover:text-destructive/80 transition-colors",children:[s.jsx(w$,{className:"h-4 w-4"})," Sign Out"]})]})]})]})]})},fX=()=>{var x,w;const{items:e,totalPrice:t,totalItems:r,clearCart:n}=jo(),{user:a}=ir();ui();const[i,o]=b.useState(((x=a==null?void 0:a.user_metadata)==null?void 0:x.full_name)??((w=a==null?void 0:a.user_metadata)==null?void 0:w.name)??""),[l,c]=b.useState((a==null?void 0:a.email)??""),[u,d]=b.useState(""),[f,h]=b.useState(""),[p,v]=b.useState(!1),[m,g]=b.useState(null);if(m)return s.jsxs("div",{className:"container max-w-lg py-16 text-center",children:[s.jsx(Nd,{className:"h-16 w-16 mx-auto text-secondary mb-4"}),s.jsx("h1",{className:"font-display text-3xl font-bold mb-2",children:"Order Confirmed!"}),s.jsx("p",{className:"text-muted-foreground mb-1",children:"Thank you for your order."}),s.jsxs("p",{className:"text-sm font-medium mb-6",children:["Order number: ",s.jsxs("span",{className:"text-primary font-bold",children:["#",m]})]}),s.jsxs("div",{className:"flex gap-3 justify-center",children:[s.jsx(W,{asChild:!0,variant:"outline",children:s.jsx(we,{to:"/account",children:"View Account"})}),s.jsx(W,{asChild:!0,children:s.jsx(we,{to:"/shop",children:"Continue Shopping"})})]})]});if(e.length===0)return s.jsxs("div",{className:"container max-w-lg py-16 text-center",children:[s.jsx(as,{className:"h-16 w-16 mx-auto text-muted-foreground/40 mb-4"}),s.jsx("h1",{className:"font-display text-2xl font-bold mb-2",children:"Your cart is empty"}),s.jsx("p",{className:"text-muted-foreground mb-6",children:"Add some products before checking out."}),s.jsx(W,{asChild:!0,children:s.jsx(we,{to:"/shop",children:"Browse Shop"})})]});const y=async S=>{if(S.preventDefault(),!i.trim()){X.error("Please enter your name");return}v(!0);const j=`ORD-${Date.now().toString(36).toUpperCase()}`,_=e.map(O=>({product_id:O.id,name:O.name,price:O.price,quantity:O.quantity,weight:O.weight})),{error:N}=await V.from("orders").insert({order_number:j,customer_name:i.trim(),customer_email:l.trim()||null,customer_phone:u.trim()||null,notes:f.trim()||null,items:_,total:t,status:"pending",user_id:(a==null?void 0:a.id)??null});if(v(!1),N){X.error("Failed to place order. Please try again.");return}const k=l.trim();if(k){const O=_.map(E=>`${E.name} × ${E.quantity}`).join(", ");V.functions.invoke("send-transactional-email",{body:{templateName:"order-confirmation",recipientEmail:k,idempotencyKey:`order-confirm-${j}`,templateData:{customerName:i.trim(),orderNumber:j,total:t.toFixed(2),itemsSummary:O}}})}n(),g(j),X.success("Order placed successfully!")};return s.jsxs("div",{className:"container max-w-4xl py-8 md:py-12",children:[s.jsxs(we,{to:"/shop",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-6",children:[s.jsx(Mc,{className:"h-4 w-4"})," Back to shop"]}),s.jsx("h1",{className:"font-display text-3xl font-bold mb-8",children:"Checkout"}),s.jsxs("div",{className:"grid md:grid-cols-5 gap-8",children:[s.jsx("div",{className:"md:col-span-3",children:s.jsxs(le,{children:[s.jsx(dt,{children:s.jsx(mt,{className:"text-lg",children:"Your Details"})}),s.jsx(ce,{children:s.jsxs("form",{id:"checkout-form",onSubmit:y,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"checkout-name",children:"Full Name *"}),s.jsx(se,{id:"checkout-name",value:i,onChange:S=>o(S.target.value),required:!0,placeholder:"Your name",className:"mt-1"})]}),s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"checkout-email",children:"Email"}
600),s.jsx(se,{id:"checkout-email",type:"email",value:l,onChange:S=>c(S.target.value),placeholder:"[email protected]",className:"mt-1"})]}),s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"checkout-phone",children:"Phone"}),s.jsx(se,{id:"checkout-phone",type:"tel",value:u,onChange:S=>d(S.target.value),placeholder:"07xxx xxxxxx",className:"mt-1"})]}),s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"checkout-notes",children:"Order Notes"}),s.jsx(yr,{id:"checkout-notes",value:f,onChange:S=>h(S.target.value),placeholder:"Any special requests or delivery instructions...",className:"mt-1 resize-none",rows:3})]})]})})]})}),s.jsx("div",{className:"md:col-span-2",children:s.jsxs(le,{className:"sticky top-24",children:[s.jsx(dt,{children:s.jsx(mt,{className:"text-lg",children:"Order Summary"})}),s.jsxs(ce,{className:"space-y-3",children:[e.map(S=>s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsxs("span",{className:"text-muted-foreground truncate max-w-[60%]",children:[S.name," × ",S.quantity]}),s.jsxs("span",{className:"font-medium",children:["£",(S.price*S.quantity).toFixed(2)]})]},S.id)),s.jsx(Yn,{}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Items"}),s.jsx("span",{children:r})]}),s.jsxs("div",{className:"flex justify-between font-bold text-lg",children:[s.jsx("span",{children:"Total"}),s.jsxs("span",{className:"text-primary",children:["£",t.toFixed(2)]})]}),s.jsx(W,{type:"submit",form:"checkout-form",className:"w-full h-12 text-base font-bold mt-2",disabled:p,children:p?s.jsxs(s.Fragment,{children:[s.jsx(Ze,{className:"h-4 w-4 mr-2 animate-spin"})," Placing Order..."]}):"Place Order"}),!a&&s.jsxs("p",{className:"text-xs text-center text-muted-foreground",children:[s.jsx(we,{to:"/auth",className:"text-primary hover:underline",children:"Sign in"})," to track your order later"]})]})]})})]})]})},hX=()=>{const[e]=qT(),t=e.get("token"),[r,n]=b.useState("loading"),[a,i]=b.useState(!1);b.useEffect(()=>{if(!t){n("invalid");return}(async()=>{try{const d=await fetch(`https://nakyicofsxpkdzvhkhkl.supabase.co/functions/v1/handle-email-unsubscribe?token=${t}`,{headers:{apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im5ha3lpY29mc3hwa2R6dmhraGtsIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzQ1MjIxODMsImV4cCI6MjA5MDA5ODE4M30.yfrNRHIgVdKAs1b_dy8qbADNQMRIiCwc_u3PMJkukCQ"}}),f=await d.json();d.ok&&f.valid?n("valid"):f.reason==="already_unsubscribed"?n("already"):n("invalid")}catch{n("invalid")}})()},[t]);const o=async()=>{if(t){i(!0);try{const{data:l,error:c}=await V.functions.invoke("handle-email-unsubscribe",{body:{token:t}});if(c)throw c;const u=typeof l=="string"?JSON.parse(l):l;n(u.success?"success":"error")}catch{n("error")}i(!1)}};return s.jsx("div",{className:"container max-w-lg py-16",children:s.jsx(le,{children:s.jsxs(ce,{className:"pt-8 pb-8 text-center space-y-4",children:[r==="loading"&&s.jsxs(s.Fragment,{children:[s.jsx(Ze,{className:"h-12 w-12 mx-auto animate-spin text-muted-foreground"}),s.jsx("p",{className:"text-muted-foreground",children:"Validating your request…"})]}),r==="valid"&&s.jsxs(s.Fragment,{children:[s.jsx(Gz,{className:"h-12 w-12 mx-auto text-primary"}),s.jsx("h1",{className:"font-display text-2xl font-bold",children:"Unsubscribe"}),s.jsx("p",{className:"text-muted-foreground",children:"Are you sure you want to unsubscribe from Afro Caribbean Store emails?"}),s.jsxs(W,{onClick:o,disabled:a,className:"w-full max-w-xs",children:[a?s.jsx(Ze,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Confirm Unsubscribe"]})]}),r==="success"&&s.jsxs(s.Fragment,{children:[s.jsx(Nd,{className:"h-12 w-12 mx-auto text-secondary"}),s.jsx("h1",{className:"font-display text-2xl font-bold",children:"Unsubscribed"}),s.jsx("p",{className:"text-muted-foreground",children:"You've been successfully unsubscribed. You won't receive any more emails from us."})]}),r==="already"&&s.jsxs(s.Fragment,{children:[s.jsx(Nd,{className:"h-12 w-12 mx-auto text-muted-foreground"}),s.jsx("h1",{className:"font-display text-2xl font-bold",children:"Already Unsubscribed"}),s.jsx("p",{className:"text-muted-foreground",children:"You've already unsubscribed from our emails."})]}),(r==="invalid"||r==="error")&&s.jsxs(s.Fragment,{children:[s.jsx(Vu,{className:"h-12 w-12 mx-auto text-destructive"}),s.jsx("h1",{className:"font-display text-2xl font-bold",children:r==="invalid"?"Invalid Link":"Something Went Wrong"}),s.jsx("p",{className:"text-muted-foreground",children:r==="invalid"?"This unsubscribe link is invali
600d or has expired.":"We couldn't process your request. Please try again later."})]})]})})})},pX=e=>{switch(e.toLowerCase()){case"completed":case"delivered":return"bg-secondary/20 text-secondary border-secondary/30";case"pending":return"bg-primary/20 text-primary border-primary/30";case"cancelled":return"bg-destructive/20 text-destructive border-destructive/30";default:return"bg-muted text-muted-foreground"}},gp=[{key:"pending",label:"Order Placed",icon:ei,description:"Your order has been received"},{key:"confirmed",label:"Confirmed",icon:Nd,description:"Order confirmed and being prepared"},{key:"processing",label:"Processing",icon:Gn,description:"Your items are being packed"},{key:"shipped",label:"Shipped",icon:Oa,description:"On its way to you"},{key:"delivered",label:"Delivered",icon:rj,description:"Successfully delivered"}],mX=e=>{const t=e.toLowerCase();if(t==="cancelled")return-1;const r=gp.findIndex(n=>n.key===t);return r===-1?0:r},gX=({status:e})=>{const t=e.toLowerCase()==="cancelled",r=mX(e);return t?s.jsxs(le,{children:[s.jsx(dt,{children:s.jsx(mt,{className:"text-lg",children:"Order Status"})}),s.jsx(ce,{children:s.jsxs("div",{className:"flex items-center gap-3 text-destructive",children:[s.jsx(Vu,{className:"h-6 w-6"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-bold",children:"Order Cancelled"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This order has been cancelled."})]})]})})]}):s.jsxs(le,{children:[s.jsx(dt,{children:s.jsx(mt,{className:"text-lg",children:"Order Status"})}),s.jsx(ce,{children:s.jsx("div",{className:"relative",children:gp.map((n,a)=>{const i=a<=r,o=a===r,l=n.icon;return s.jsxs("div",{className:"flex gap-4 relative",children:[a<gp.length-1&&s.jsx("div",{className:`absolute left-[15px] top-[32px] w-0.5 h-[calc(100%-16px)] ${a<r?"bg-primary":"bg-border"}`}),s.jsx("div",{className:`relative z-10 flex items-center justify-center h-8 w-8 rounded-full shrink-0 transition-colors ${i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"} ${o?"ring-2 ring-primary/30 ring-offset-2 ring-offset-background":""}`,children:s.jsx(l,{className:"h-4 w-4"})}),s.jsxs("div",{className:`pb-8 ${a===gp.length-1?"pb-0":""}`,children:[s.jsx("p",{className:`font-medium text-sm ${i?"text-foreground":"text-muted-foreground"}`,children:n.label}),s.jsx("p",{className:"text-xs text-muted-foreground",children:n.description})]})]},n.key)})})})]})},vX=()=>{const{id:e}=FT(),{user:t,loading:r}=ir(),n=ui(),[a,i]=b.useState(null),[o,l]=b.useState(!0),{addToCart:c,setIsCartOpen:u}=jo();return b.useEffect(()=>{!r&&!t&&n("/auth",{replace:!0})},[r,t,n]),b.useEffect(()=>{if(!t||!e)return;(async()=>{const{data:f,error:h}=await V.from("orders").select("id, order_number, status, total, items, created_at, customer_name, customer_email, customer_phone, notes").eq("id",e).eq("user_id",t.id).maybeSingle();f&&i({...f,items:Array.isArray(f.items)?f.items:[]}),l(!1)})()},[t,e]),r||o?s.jsx("div",{className:"container py-20 text-center",children:s.jsx(Ze,{className:"h-6 w-6 animate-spin mx-auto text-muted-foreground"})}):a?s.jsxs("div",{className:"container max-w-2xl py-8 md:py-12",children:[s.jsxs(we,{to:"/account",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-6",children:[s.jsx(Mc,{className:"h-4 w-4"})," Back to Account"]}),s.jsxs("div",{className:"flex items-start justify-between mb-6",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:["Order #",a.order_number]}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Placed on ",pr(new Date(a.created_at),"d MMMM yyyy 'at' h:mm a")]})]}),s.jsx(Be,{variant:"outline",className:`${pX(a.status)} text-sm`,children:a.status})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsx(gX,{status:a.status}),s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"text-lg flex items-center gap-2",children:[s.jsx(Gn,{className:"h-5 w-5"})," Items (",a.items.length,")"]})}),s.jsxs(ce,{children:[s.jsx("div",{className:"space-y-4",children:a.items.map((d,f)=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-4",children:[(()=>{const h=os.find(v=>v.id===(d.product_id||d.id)),p=d.image||(h==null?void 0:h.image);return p?s.jsx("img",{src:p,alt:d.name,className:"h-16 w-16 rounded-lg object-cover border bg-muted"}):s.jsx("div",{className:"h-16 w-16 rounded-lg bg-muted flex items-center justify-center",children:s.jsx(as,{className:"h-6 w-6 text-muted-foreground
600/40"})})})(),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-sm truncate",children:d.name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Qty: ",d.quantity]})]}),s.jsxs("div",{className:"text-right shrink-0",children:[s.jsxs("p",{className:"font-bold text-sm",children:["£",(d.price*d.quantity).toFixed(2)]}),d.quantity>1&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["£",d.price.toFixed(2)," each"]})]})]}),f<a.items.length-1&&s.jsx(Yn,{className:"mt-4"})]},d.id||d.product_id||f))}),s.jsx(Yn,{className:"my-4"}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"font-display font-bold text-lg",children:"Total"}),s.jsxs("span",{className:"font-display font-bold text-lg",children:["£",a.total.toFixed(2)]})]})]})]}),s.jsxs(le,{children:[s.jsx(dt,{children:s.jsx(mt,{className:"text-lg",children:"Delivery Details"})}),s.jsxs(ce,{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Name"}),s.jsx("span",{className:"font-medium",children:a.customer_name})]}),a.customer_email&&s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Email"}),s.jsx("span",{className:"font-medium",children:a.customer_email})]}),a.customer_phone&&s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Phone"}),s.jsx("span",{className:"font-medium",children:a.customer_phone})]}),a.notes&&s.jsxs(s.Fragment,{children:[s.jsx(Yn,{}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground block mb-1",children:"Notes"}),s.jsx("p",{className:"font-medium",children:a.notes})]})]})]})]}),s.jsxs(W,{className:"w-full font-bold",size:"lg",onClick:()=>{let d=0;a.items.forEach(f=>{const h=os.find(p=>p.id===(f.product_id||f.id));if(h){for(let p=0;p<f.quantity;p++)c(h);d++}}),d>0?(u(!0),X.success(`${d} item${d!==1?"s":""} added to cart`)):X.error("Some items are no longer available")},children:[s.jsx(If,{className:"h-4 w-4 mr-2"})," Reorder These Items"]})]})]}):s.jsxs("div",{className:"container max-w-2xl py-12 text-center",children:[s.jsx(as,{className:"h-12 w-12 mx-auto text-muted-foreground/40 mb-4"}),s.jsx("h2",{className:"font-display text-xl font-bold mb-2",children:"Order not found"}),s.jsx("p",{className:"text-muted-foreground text-sm mb-6",children:"This order doesn't exist or you don't have access to it."}),s.jsx(W,{asChild:!0,variant:"outline",children:s.jsx(we,{to:"/account",children:"Back to Account"})})]})};var sv="Collapsible",[yX,_I]=Br(sv),[xX,Ij]=yX(sv),NI=b.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:a,disabled:i,onOpenChange:o,...l}=e,[c,u]=nn({prop:n,defaultProp:a??!1,onChange:o,caller:sv});return s.jsx(xX,{scope:r,disabled:i,contentId:Zr(),open:c,onOpenToggle:b.useCallback(()=>u(d=>!d),[u]),children:s.jsx(ye.div,{"data-state":Lj(c),"data-disabled":i?"":void 0,...l,ref:t})})});NI.displayName=sv;var kI="CollapsibleTrigger",OI=b.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,a=Ij(kI,r);return s.jsx(ye.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":Lj(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...n,ref:t,onClick:oe(e.onClick,a.onOpenToggle)})});OI.displayName=kI;var Dj="CollapsibleContent",CI=b.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=Ij(Dj,e.__scopeCollapsible);return s.jsx(ln,{present:r||a.open,children:({present:i})=>s.jsx(bX,{...n,ref:t,present:i})})});CI.displayName=Dj;var bX=b.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:a,...i}=e,o=Ij(Dj,r),[l,c]=b.useState(n),u=b.useRef(null),d=Me(t,u),f=b.useRef(0),h=f.current,p=b.useRef(0),v=p.current,m=o.open||l,g=b.useRef(m),y=b.useRef(void 0);return b.useEffect(()=>{const x=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(x)},[]),Gt(()=>{const x=u.current;if(x){y.current=y.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();f.current=w.height,p.current=w.width,g.current||(x.style.transitionDuration=y.current.transitionDuration,x.style.animationName=y.current.animationName),c(n)}},[o.open,n]),s.jsx(ye.div,{"data-state":Lj(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m,...i,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:m&&a})});function Lj(e){return e?"open":"closed"}var wX=NI,jX=OI,SX=CI,ra="Accordion",_X=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Fj,NX,kX]=Tf(ra),[ov,QNe]=Br(ra,[kX,_I]),Bj=_I(),EI=C.forwardRef((e,t)=>
600{const{type:r,...n}=e,a=n,i=n;return s.jsx(Fj.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?s.jsx(PX,{...i,ref:t}):s.jsx(EX,{...a,ref:t})})});EI.displayName=ra;var[PI,OX]=ov(ra),[AI,CX]=ov(ra,{collapsible:!1}),EX=C.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},collapsible:i=!1,...o}=e,[l,c]=nn({prop:r,defaultProp:n??"",onChange:a,caller:ra});return s.jsx(PI,{scope:e.__scopeAccordion,value:C.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:C.useCallback(()=>i&&c(""),[i,c]),children:s.jsx(AI,{scope:e.__scopeAccordion,collapsible:i,children:s.jsx(TI,{...o,ref:t})})})}),PX=C.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:a=()=>{},...i}=e,[o,l]=nn({prop:r,defaultProp:n??[],onChange:a,caller:ra}),c=C.useCallback(d=>l((f=[])=>[...f,d]),[l]),u=C.useCallback(d=>l((f=[])=>f.filter(h=>h!==d)),[l]);return s.jsx(PI,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:u,children:s.jsx(AI,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(TI,{...i,ref:t})})})}),[AX,lv]=ov(ra),TI=C.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:a,orientation:i="vertical",...o}=e,l=C.useRef(null),c=Me(l,t),u=NX(r),f=Ff(a)==="ltr",h=oe(e.onKeyDown,p=>{var k;if(!_X.includes(p.key))return;const v=p.target,m=u().filter(O=>{var E;return!((E=O.ref.current)!=null&&E.disabled)}),g=m.findIndex(O=>O.ref.current===v),y=m.length;if(g===-1)return;p.preventDefault();let x=g;const w=0,S=y-1,j=()=>{x=g+1,x>S&&(x=w)},_=()=>{x=g-1,x<w&&(x=S)};switch(p.key){case"Home":x=w;break;case"End":x=S;break;case"ArrowRight":i==="horizontal"&&(f?j():_());break;case"ArrowDown":i==="vertical"&&j();break;case"ArrowLeft":i==="horizontal"&&(f?_():j());break;case"ArrowUp":i==="vertical"&&_();break}const N=x%y;(k=m[N].ref.current)==null||k.focus()});return s.jsx(AX,{scope:r,disabled:n,direction:a,orientation:i,children:s.jsx(Fj.Slot,{scope:r,children:s.jsx(ye.div,{...o,"data-orientation":i,ref:c,onKeyDown:n?void 0:h})})})}),cm="AccordionItem",[TX,Uj]=ov(cm),$I=C.forwardRef((e,t)=>{const{__scopeAccordion:r,value:n,...a}=e,i=lv(cm,r),o=OX(cm,r),l=Bj(r),c=Zr(),u=n&&o.value.includes(n)||!1,d=i.disabled||e.disabled;return s.jsx(TX,{scope:r,open:u,disabled:d,triggerId:c,children:s.jsx(wX,{"data-orientation":i.orientation,"data-state":FI(u),...l,...a,ref:t,disabled:d,open:u,onOpenChange:f=>{f?o.onItemOpen(n):o.onItemClose(n)}})})});$I.displayName=cm;var RI="AccordionHeader",MI=C.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=lv(ra,r),i=Uj(RI,r);return s.jsx(ye.h3,{"data-orientation":a.orientation,"data-state":FI(i.open),"data-disabled":i.disabled?"":void 0,...n,ref:t})});MI.displayName=RI;var vb="AccordionTrigger",II=C.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=lv(ra,r),i=Uj(vb,r),o=CX(vb,r),l=Bj(r);return s.jsx(Fj.ItemSlot,{scope:r,children:s.jsx(jX,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":a.orientation,id:i.triggerId,...l,...n,ref:t})})});II.displayName=vb;var DI="AccordionContent",LI=C.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,a=lv(ra,r),i=Uj(DI,r),o=Bj(r);return s.jsx(SX,{role:"region","aria-labelledby":i.triggerId,"data-orientation":a.orientation,...o,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});LI.displayName=DI;function FI(e){return e?"open":"closed"}var $X=EI,RX=$I,MX=MI,BI=II,UI=LI;const IX=$X,zI=b.forwardRef(({className:e,...t},r)=>s.jsx(RX,{ref:r,className:ne("border-b",e),...t}));zI.displayName="AccordionItem";const qI=b.forwardRef(({className:e,children:t,...r},n)=>s.jsx(MX,{className:"flex",children:s.jsxs(BI,{ref:n,className:ne("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,s.jsx(Q1,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));qI.displayName=BI.displayName;const WI=b.forwardRef(({className:e,children:t,...r},n)=>s.jsx(UI,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:s.jsx("div",{className:ne("pb-4 pt-0",e),children:t})}));WI.displayName=UI.displayName;const DX=[{q:"What products do you sell?",a:"We specialise in Afro-Caribbean groceries including fresh and frozen meat, fish, vegetables, spices, beverages, condiments, baked goods, hair & beauty products, and household essentials. We also offer wholesale and bulk packs for restaurants and caterers."},{q:"Do you offer wholesale pricing?",a:"Yes! We cater to restaurants, c
600aterers, and food businesses with competitive bulk pricing. Register for a wholesale account to access special rates and place larger quantity orders."},{q:"What are your delivery areas?",a:"We currently deliver within the local area. Visit our Delivery Information page for specific zones and delivery fees. Collection is also available from our store."},{q:"How do I track my order?",a:"Once your order is dispatched, you'll receive status updates via email. You can also track your order through your account dashboard under 'Order History'."},{q:"What payment methods do you accept?",a:"We accept all major payment methods through our secure checkout system. Payment processing is handled via Trust n Trade for a safe and reliable experience."},{q:"Can I return or exchange products?",a:"Yes, please refer to our Returns Policy page for full details. Fresh and frozen items have specific return conditions due to their perishable nature."},{q:"Do you sell Halal products?",a:"Yes, we stock a wide range of Halal-certified meat and grocery products. Look for the Halal tag on product listings."},{q:"How can I contact customer support?",a:"You can reach us through the Contact Us page, via email, or through WhatsApp for quick queries. Our support team typically responds within 24 hours."},{q:"Do you offer regular supply arrangements for businesses?",a:"Absolutely! Approved wholesale customers can set up regular supply schedules. Contact us through the wholesale portal or get in touch with our team to discuss your requirements."},{q:"Are your products authentic?",a:"We pride ourselves on sourcing authentic Afro-Caribbean products directly from trusted suppliers. Quality and authenticity are at the heart of everything we do."}],LX=()=>s.jsxs("div",{className:"max-w-3xl mx-auto py-16 px-4",children:[s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold text-center mb-2",children:"Frequently Asked Questions"}),s.jsx("p",{className:"text-center text-muted-foreground mb-10",children:"Find answers to common questions about shopping with Afro Caribbean Store."}),s.jsx(IX,{type:"single",collapsible:!0,className:"space-y-2",children:DX.map((e,t)=>s.jsxs(zI,{value:`faq-${t}`,className:"border rounded-xl px-5",children:[s.jsx(qI,{className:"text-left font-medium text-sm hover:no-underline",children:e.q}),s.jsx(WI,{className:"text-sm text-muted-foreground leading-relaxed",children:e.a})]},t))})]}),FX=[{icon:Oa,title:"Local Delivery",desc:"We deliver directly to your doorstep within our delivery zones. Orders are typically dispatched within 1–2 business days."},{icon:ei,title:"Delivery Times",desc:"Standard delivery: 1–3 business days. Same-day delivery may be available for orders placed before 12pm (subject to availability)."},{icon:ej,title:"Delivery Zones",desc:"We currently serve the local area and surrounding postcodes. Contact us for specific delivery zone information."},{icon:Gn,title:"Collection Available",desc:"Prefer to collect? You can pick up your order from our store. Select 'Collection' at checkout and we'll notify you when it's ready."},{icon:aj,title:"Delivery Support",desc:"Having issues with your delivery? Contact our support team via email, phone, or WhatsApp and we'll sort it out promptly."}],BX=()=>s.jsxs("div",{className:"max-w-4xl mx-auto py-16 px-4",children:[s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold text-center mb-2",children:"Delivery Information"}),s.jsx("p",{className:"text-center text-muted-foreground mb-10",children:"Everything you need to know about how we get your order to you."}),s.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3 mb-12",children:FX.map(e=>s.jsx(le,{className:"border-0 bg-card/50",children:s.jsxs(ce,{className:"p-6",children:[s.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary/10 flex items-center justify-center mb-4",children:s.jsx(e.icon,{className:"h-5 w-5 text-primary"})}),s.jsx("h3",{className:"font-display font-bold text-base mb-2",children:e.title}),s.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e.desc})]})}
600,e.title))}),s.jsx(le,{className:"bg-primary/5 border-primary/20",children:s.jsxs(ce,{className:"p-8 text-center",children:[s.jsx("h2",{className:"font-display text-xl font-bold mb-2",children:"Wholesale & Bulk Deliveries"}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-xl mx-auto leading-relaxed",children:"For restaurants, caterers, and bulk buyers, we offer tailored delivery schedules and larger vehicle capacity. Contact our wholesale team to arrange regular deliveries that suit your business needs."})]})}),s.jsxs("div",{className:"mt-12 space-y-4",children:[s.jsx("h2",{className:"font-display text-xl font-bold",children:"Delivery Fees"}),s.jsx("div",{className:"border rounded-xl overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-muted/50",children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left p-3 font-medium",children:"Order Value"}),s.jsx("th",{className:"text-left p-3 font-medium",children:"Delivery Fee"})]})}),s.jsxs("tbody",{children:[s.jsxs("tr",{className:"border-t",children:[s.jsx("td",{className:"p-3",children:"Under £30"}),s.jsx("td",{className:"p-3",children:"£4.99"})]}),s.jsxs("tr",{className:"border-t",children:[s.jsx("td",{className:"p-3",children:"£30 – £60"}),s.jsx("td",{className:"p-3",children:"£2.99"})]}),s.jsxs("tr",{className:"border-t",children:[s.jsx("td",{className:"p-3",children:"Over £60"}),s.jsx("td",{className:"p-3 text-secondary font-medium",children:"FREE"})]}),s.jsxs("tr",{className:"border-t",children:[s.jsx("td",{className:"p-3",children:"Collection"}),s.jsx("td",{className:"p-3 text-secondary font-medium",children:"FREE"})]})]})]})})]})]}),UX=()=>s.jsxs("div",{className:"max-w-3xl mx-auto py-16 px-4 prose prose-sm",children:[s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold text-center mb-8 not-prose",children:"Returns Policy"}),s.jsx("h2",{children:"Our Commitment"}),s.jsx("p",{children:"At Afro Caribbean Store, we want you to be completely satisfied with your purchase. If something isn't right, we're here to help."}),s.jsx("h2",{children:"Non-Perishable Items"}),s.jsxs("p",{children:["Non-perishable items may be returned within ",s.jsx("strong",{children:"14 days"})," of receipt, provided they are:"]}),s.jsxs("ul",{children:[s.jsx("li",{children:"Unopened and in original packaging"}),s.jsx("li",{children:"In resaleable condition"}),s.jsx("li",{children:"Accompanied by proof of purchase"})]}),s.jsx("h2",{children:"Perishable & Fresh Items"}),s.jsx("p",{children:"Due to the nature of fresh, frozen, and perishable goods:"}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Returns for quality issues must be reported within ",s.jsx("strong",{children:"24 hours"})," of delivery"]}),s.jsx("li",{children:"Please include photos of the item and any packaging"}),s.jsx("li",{children:"We will offer a full refund or replacement for items that arrive damaged, spoiled, or incorrect"})]}),s.jsx("h2",{children:"Damaged or Incorrect Items"}),s.jsx("p",{children:"If you receive damaged or incorrect products, please contact us immediately. We will arrange a replacement or full refund at no extra cost to you."}),s.jsx("h2",{children:"How to Request a Return"}),s.jsxs("ol",{children:[s.jsx("li",{children:"Contact our customer support team via the Contact page or email"}),s.jsx("li",{children:"Provide your order number and details of the issue"}),s.jsx("li",{children:"Our team will review your request and respond within 48 hours"}),s.jsx("li",{children:"If approved, we'll arrange collection or provide return instructions"})]}),s.jsx("h2",{children:"Refunds"}),s.jsxs("p",{children:["Approved refunds will be processed within ",s.jsx("strong",{children:"5–10 business days"})," to your original payment method. Delivery fees are non-refundable unless the return is due to our error."]}),s.jsx("h2",{children:"Wholesale Orders"}),s.jsx("p",{children:"Wholesale and bulk orders have specific return terms. Please refer to your wholesale agreement or contact our wholesale team for details."}),s.jsx("h2",{children:"Contact Us"}),s.jsxs("p",{children:["For any returns or refund queries, email us at ",s.jsx("strong",{children:"[email protected]"})," or visit our Contact page."]})]}),zX=()=>s.jsxs("div",{className:"max-w-3xl mx-auto py-16 px-4 prose prose-sm",children:[s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold text-center mb-8 not-prose",children:"Terms & Conditions"}),s.jsx("p",{children:s.jsx("em",{children:"Last updated: March 2026"})}),s.jsx("h2",{children:"1. Introduction"}),s.jsx("p",{children:"These terms and conditions govern your use of the Afro Caribbean Store website and services. By accessing or using our platform, you agree to be bound by these terms."}),s.jsx("h2",{children:"2. Definitions"}),s.jsxs("ul",{children:[s.jsxs("li",{children:[s.jsx("strong",{children:'"We", "Us", "Our"'})," refers to Afro Caribbean Store"]}),s.jsxs("li",{children:[s.jsx("strong",{children:'"You", "Customer"'})," refers to the user of our services"]}),s.jsxs("li",{children:[s.jsx("strong",{children:'"Products"'})," refers to all items available for purchase"]}),s.jsxs("li",{children:[s.jsx("strong",{children:'"Platform"'})," refers to our website and related services"]})]}),s.jsx("h2",{children:"3. Orders"}),s.jsx("p",{children:"All orders placed through our platform are subject to availability and acceptance. We reserve the right to refuse or cancel any order for any reason, including pricing errors or stock unavailability."}),s.jsx("h2",{children:"4. Pricing"}),s.jsx("p",{children:"All prices are displayed in GBP and include applicable taxes unless otherwise stated. We reserve the right to change prices at any time. Wholesale pricing is available only to approved wholesale account holders."}),s.jsx("h2",{children:"5. Payment"}),s.jsx("p",{children:"Payment is processed securely through our checkout system. We accept major payment methods as displayed at checkout. All payments must be received before goods are dispatched."}),s.jsx("h2",{children:"6. Delivery"}),s.jsx("p",{children:"Delivery times are estimates and not guaranteed. We will make reasonable efforts to deliver within the stated t
600imeframe. Please refer to our Delivery Information page for full details."}),s.jsx("h2",{children:"7. Returns & Refunds"}),s.jsx("p",{children:"Returns are handled in accordance with our Returns Policy. Please review the policy for full details on eligibility, timeframes, and process."}),s.jsx("h2",{children:"8. Wholesale Accounts"}),s.jsx("p",{children:"Wholesale accounts are subject to approval. We reserve the right to approve, decline, or revoke wholesale status at our discretion. Wholesale pricing and terms may differ from retail."}),s.jsx("h2",{children:"9. Intellectual Property"}),s.jsx("p",{children:"All content on this platform, including logos, images, text, and design, is the property of Afro Caribbean Store and protected by intellectual property laws."}),s.jsx("h2",{children:"10. Limitation of Liability"}),s.jsx("p",{children:"To the fullest extent permitted by law, Afro Caribbean Store shall not be liable for any indirect, incidental, or consequential damages arising from the use of our services."}),s.jsx("h2",{children:"11. Changes to Terms"}),s.jsx("p",{children:"We reserve the right to modify these terms at any time. Continued use of the platform constitutes acceptance of updated terms."}),s.jsx("h2",{children:"12. Contact"}),s.jsxs("p",{children:["For questions about these terms, contact us at ",s.jsx("strong",{children:"[email protected]"}),"."]})]}),qX=()=>s.jsxs("div",{className:"max-w-3xl mx-auto py-16 px-4 prose prose-sm",children:[s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold text-center mb-8 not-prose",children:"Privacy Policy"}),s.jsx("p",{children:s.jsx("em",{children:"Last updated: March 2026"})}),s.jsx("h2",{children:"1. Introduction"}),s.jsx("p",{children:'Afro Caribbean Store ("we", "us") is committed to protecting your privacy. This policy explains how we collect, use, and protect your personal information when you use our website and services.'}),s.jsx("h2",{children:"2. Information We Collect"}),s.jsx("p",{children:"We may collect the following information:"}),s.jsxs("ul",{children:[s.jsxs("li",{children:[s.jsx("strong",{children:"Account information:"})," name, email address, phone number"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Order information:"})," delivery address, order history, payment details (processed securely by our payment provider)"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Communication data:"})," messages and support queries"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Usage data:"})," browsing activity, device information, IP address"]}),s.jsxs("li",{children:[s.jsx("strong",{children:"Wholesale data:"})," business name, tax ID, business address"]})]}),s.jsx("h2",{children:"3. How We Use Your Information"}),s.jsxs("ul",{children:[s.jsx("li",{children:"Processing and fulfilling your orders"}),s.jsx("li",{children:"Managing your account"}),s.jsx("li",{children:"Communicating order updates and delivery information"}),s.jsx("li",{children:"Responding to customer support queries"}),s.jsx("li",{children:"Sending marketing communications (with your consent)"}),s.jsx("li",{children:"Improving our services and platform"})]}),s.jsx("h2",{children:"4. Data Sharing"}),s.jsx("p",{children:"We do not sell your personal data. We may share information with:"}),s.jsxs("ul",{children:[s.jsx("li",{children:"Delivery partners for order fulfilment"}),s.jsx("li",{children:"Payment processors for secure transactions"}),s.jsx("li",{children:"Trust n Trade for integrated checkout and procurement services"}),s.jsx("li",{children:"Legal authorities when required by law"})]}),s.jsx("h2",{children:"5. Data Security"}),s.jsx("p",{children:"We implement appropriate technical and organisational measures to protect your personal information, including encryption, secure storage, and access controls."}),s.jsx("h2",{children:"6. Your Rights"}),s.jsx("p",{children:"Under data protection law, you have the right to:"}),s.jsxs("ul",{children:[s.jsx("li",{children:"Access your personal data"}),s.jsx("li",{children:"Request correction of inaccurate data"}
600),s.jsx("li",{children:"Request deletion of your data"}),s.jsx("li",{children:"Object to processing of your data"}),s.jsx("li",{children:"Withdraw consent for marketing communications"})]}),s.jsx("h2",{children:"7. Cookies"}),s.jsx("p",{children:"We use essential cookies to ensure the platform functions correctly. We may also use analytics cookies to understand how visitors interact with our website."}),s.jsx("h2",{children:"8. Contact"}),s.jsxs("p",{children:["For privacy-related queries, contact us at ",s.jsx("strong",{children:"[email protected]"}),"."]})]}),WX=[{icon:ej,label:"Visit Us",value:"Afro Caribbean Store, Local Area, UK"},{icon:aj,label:"Call Us",value:"Contact via WhatsApp or phone"},{icon:ti,label:"Email Us",value:"[email protected]"},{icon:ei,label:"Opening Hours",value:"Mon–Sat: 9am–7pm, Sun: 10am–5pm"}],HX=()=>{const[e,t]=b.useState(!1),r=async n=>{n.preventDefault(),t(!0);const a=new FormData(n.currentTarget),{error:i}=await V.from("customer_messages").insert({customer_name:a.get("name"),customer_email:a.get("email")||null,subject:a.get("subject"),message:a.get("message")});if(t(!1),i){X.error("Failed to send message. Please try again.");return}X.success("Message sent! We'll get back to you soon."),n.target.reset()};return s.jsxs("div",{className:"max-w-5xl mx-auto py-16 px-4",children:[s.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold text-center mb-2",children:"Contact Us"}),s.jsx("p",{className:"text-center text-muted-foreground mb-10",children:"We'd love to hear from you. Get in touch with our team."}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:WX.map(n=>s.jsx(le,{className:"border-0 bg-card/50",children:s.jsxs(ce,{className:"p-5",children:[s.jsx("div",{className:"h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center mb-3",children:s.jsx(n.icon,{className:"h-4 w-4 text-primary"})}),s.jsx("h3",{className:"font-display font-bold text-sm",children:n.label}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n.value})]})},n.label))}),s.jsx(le,{className:"bg-secondary/5 border-secondary/20",children:s.jsxs(ce,{className:"p-6 text-center",children:[s.jsx(Xz,{className:"h-8 w-8 text-secondary mx-auto mb-3"}),s.jsx("h3",{className:"font-display font-bold mb-1",children:"WhatsApp Support"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Quick questions? Reach us on WhatsApp for fast responses."})]})})]}),s.jsx(le,{children:s.jsxs(ce,{className:"p-6",children:[s.jsx("h2",{className:"font-display text-lg font-bold mb-4",children:"Send us a Message"}),s.jsxs("form",{onSubmit:r,className:"space-y-4",children:[s.jsx(se,{name:"name",placeholder:"Your name *",required:!0}),s.jsx(se,{name:"email",type:"email",placeholder:"Email address"}),s.jsx(se,{name:"subject",placeholder:"Subject *",required:!0}),s.jsx(yr,{name:"message",placeholder:"Your message *",required:!0,rows:5}),s.jsx(W,{type:"submit",className:"w-full",disabled:e,children:e?"Sending…":"Send Message"})]})]})})]})]})},VX=[{icon:Gn,title:"Bulk Pricing",desc:"Competitive rates on large quantity orders for restaurants and caterers."},{icon:Oa,title:"Regular Deliveries",desc:"Set up scheduled deliveries to suit your business operations."},{icon:ij,title:"Quality Guaranteed",desc:"Authentic Afro-Caribbean products sourced from trusted suppliers."},{icon:oj,title:"Dedicated Support",desc:"Personal account manager for wholesale enquiries and orders."}],KX=[{icon:Rz,title:"Restaurants & Caterers",desc:"Bulk ingredients for Oxtail, Curry Goat, Jollof Rice, and more."},{icon:sj,title:"Retail Shops",desc:"Stock authentic Afro-Caribbean products in your store."},{icon:oj,title:"Event Organisers",desc:"Catering supplies for cultural events and celebrations."}],GX=()=>{const{user:e}=ir(),[t,r]=b.useState(!1),[n,a]=b.useState(!1),i=async l=>{if(l.preventDefault(),!e){X.error("Please sign in to apply for wholesale access.");return}r(!0);const c=new FormData(l.currentTarget),{error:u}=await V.from("wholesale_profiles").insert({user_id:e.id,business_name:c.get("business_name"),business_type:c.get("business_type")||null,contact_person:c.get("contact_person")||null,phone:c.get("phone")||null,email:c.get("email")||e.email,address:c.get("address")||null});if(r(!1),u){if(u.code==="23505"){X.error("You already have a wholesale application on file.");return}X.error(u.message);return}a(!0),X.success("Application submitted! We'll review it shortly.")},o=async l=>{l.preventDefault(),r(!0);const c=new FormData(l.currentTarget),{error:u}=await V.from("quote_requests").insert({user_id:(e==null?void 0:e.id)||null,business_name:c.get("business_name"),contact_name:c.get("contact_name"),email:c.get("email"),phone:c.get("phone")||null,message:c.get("message")||null});if(r(!1),u){X.error(u.message);return}X.success("Quote request submitted!"),l.target.reset()};return s.jsxs("div",{className:"max-w-6xl mx-auto py-16 px-4",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx(Be,{className:"mb-4 bg-primary/10 text-primary border-0",children:"Wholesale & Bulk Orders"}),s.jsxs("h1",{className:"font-display text-3xl md:text-5xl font-bold mb-4",children:["Supply Your Business with",s.jsx("br",{}),s.jsx("span",{className:"text-gradient-gold",children:"Authentic Afro-Caribbean Products"})]}),s.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto leading-relaxed",children:"Whether you run a restaurant, catering service, or retail shop — we provide bulk quantities at competitive wholesale prices with reliable delivery."})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 mb-16",children:VX.map(l=>s.jsx(le,{className:"border-0 bg-card/50 text-center",children:s.jsxs(ce,{className:"p-6",children:[s.jsx("div",{className:"h-12 w-12 rounded-2xl bg-primary/10 flex items-center justify-center mx-auto mb-4",children:s.jsx(l.icon,{className:"h-6 w-6 text-primary"})}),s.jsx("h3",{className:"font-display font-bold text-sm mb-1",children:l.title}),s.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:l.desc})]})},l.title))}),s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"font-display text-2xl font-bold text-center mb-8",children:"Who We Serve"}),s.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:KX.map(l=>s.jsx(le,{className:"bg-primary/5 border-primary/10",children:s.jsxs(ce,{className:"p-6",children:[s.jsx(l.icon,{className:"h-8 w-8 text-primary mb-3"}),s.jsx("h3",{className:"font-display font-bold mb-1",children:l.title}),s.jsx("p",{className:"text-sm text-muted-foreground",children:l.desc})]})},l.title))})]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[s.jsx(le,{children:s.jsxs(ce,{className:"p-6",children:[s.jsx("h2",{className:"font-display text-lg font-bold mb-1",children:"Apply for Wholesale Account"}),s.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Get approved for wholesale pricing and bulk order access."}),e?n?s.jsxs("div",{className:"text-center py-8",children:[s.jsx(ij,{className:"h-10 w-10 text-secondary mx-auto mb-3"}),s.jsx("p",{className:"font-medium",children:"Application Submitted!"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"We'll review and get back to you within 2 business days."})]}):s.jsxs("form",{onSubmit:i,className:"space-y-3",children:[s.jsx(se,{name:"business_name",placeholder:"Business name *",required:!0}),s.jsx(se,{name:"business_type",placeholder:"Business type (e.g. Restaurant, Retail)"}),s.jsx(se,{name:"contact_person",placeholder:"Contact person"}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(se,{name:"phone",placeholder:"Phone"}),s.jsx(se,{name:"email",type:"email",placeholder:"Email",defaultValue:e.email||""})]}),s.jsx(se,{name:"address",placeholder:"Business address"}),s.jsx(W,{type:"submit",className:"w-full",disabled:t,children:t?"Submitting…":"Submit Application"})]}):s.jsxs("div",{className:"text-center py-8",children:[s.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Please sign in to apply."}),s.jsx(W,{asChild:!0,children:s.jsx(we,{to:"/auth",children:"Sign In"})})]})]})}),s.jsx(le,{children:s.jsxs(ce,{className:"p-6",children:[s.jsx("h2",{className:"font-display text-lg font-bold mb-1",children:"Request a Quote"}),s.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Tell us what you need and we'll provide competitive pricing."}),s.jsxs("form",{onSubmit:o,className:"space-y-3",children:[s.jsx(se,{name:"business_name",placeholder:"Business name *",required:!0}),s.jsx(se,{name:"contact_name",placeholder:"Contact name *",required:!0}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(se,{name:"email",type:"email",placeholder:"Email *",required:!0}),s.jsx(se,{name:"phone",placeholder:"Phone"})]}),s.jsx(yr,{name:"message",placeholder:"What products are you looking for? Include quantities if possible.",rows:4}),s.jsx(W,{type:"submit",variant:"outline",className:"w-full",disabled:t,children:t?"Submitting…":"Request Quote"})]})]})})]})]})},ox=768;function YX(){const[e,t]=b.useState(void 0);return b.useEffect(()=>{const r=window.matchMedia(`(max-width: ${ox-1}px)`),n=()=>{t(window.innerWidth<ox)};return r.addEventListener("change",n),t(window.innerWidth<ox),()=>r.removeEventListener("change",n)},[]),!!e}function Xk({className:e,...t}){return s.jsx("div",{className:ne("animate-pulse rounded-md bg-muted",e),...t})}const XX="sidebar:state",QX=60*60*24*7,JX="16rem",ZX="18rem",eQ="3rem",tQ="b",HI=b.createContext(null);function Uf(){const e=b.useContext(HI);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const VI=b.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:r,className:n,style:a,children:i,...o},l)=>{const c=YX(),[u,d]=b.useState(!1),[f,h]=b.useState(e),p=t??f,v=b.useCallback(x=>{const w=typeof x=="function"?x(p):x;r?r(w):h(w),document.cookie=`${XX}=${w}; path=/; max-age=${QX}`},[r,p]),m=b.useCallback(()=>c?d(x=>!x):v(x=>!x),[c,v,d]);b.useEffect(()=>{const x=w=>
600{w.key===tQ&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),m())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[m]);const g=p?"expanded":"collapsed",y=b.useMemo(()=>({state:g,open:p,setOpen:v,isMobile:c,openMobile:u,setOpenMobile:d,toggleSidebar:m}),[g,p,v,c,u,d,m]);return s.jsx(HI.Provider,{value:y,children:s.jsx(uR,{delayDuration:0,children:s.jsx("div",{style:{"--sidebar-width":JX,"--sidebar-width-icon":eQ,...a},className:ne("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:l,...o,children:i})})})});VI.displayName="SidebarProvider";const KI=b.forwardRef(({side:e="left",variant:t="sidebar",collapsible:r="offcanvas",className:n,children:a,...i},o)=>{const{isMobile:l,state:c,openMobile:u,setOpenMobile:d}=Uf();return r==="none"?s.jsx("div",{className:ne("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:o,...i,children:a}):l?s.jsx(sM,{open:u,onOpenChange:d,...i,children:s.jsx(Aj,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":ZX},side:e,children:s.jsx("div",{className:"flex h-full w-full flex-col",children:a})})}):s.jsxs("div",{ref:o,className:"group peer hidden text-sidebar-foreground md:block","data-state":c,"data-collapsible":c==="collapsed"?r:"","data-variant":t,"data-side":e,children:[s.jsx("div",{className:ne("relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),s.jsx("div",{className:ne("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...i,children:s.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:a})})]})});KI.displayName="Sidebar";const GI=b.forwardRef(({className:e,onClick:t,...r},n)=>{const{toggleSidebar:a}=Uf();return s.jsxs(W,{ref:n,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:ne("h-7 w-7",e),onClick:i=>{t==null||t(i),a()},...r,children:[s.jsx(Qz,{}),s.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});GI.displayName="SidebarTrigger";const rQ=b.forwardRef(({className:e,...t},r)=>{const{toggleSidebar:n}=Uf();return s.jsx("button",{ref:r,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:ne("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});rQ.displayName="SidebarRail";const nQ=b.forwardRef(({className:e,...t},r)=>s.jsx("main",{ref:r,className:ne("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-
600h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));nQ.displayName="SidebarInset";const aQ=b.forwardRef(({className:e,...t},r)=>s.jsx(se,{ref:r,"data-sidebar":"input",className:ne("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));aQ.displayName="SidebarInput";const iQ=b.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"header",className:ne("flex flex-col gap-2 p-2",e),...t}));iQ.displayName="SidebarHeader";const YI=b.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"footer",className:ne("flex flex-col gap-2 p-2",e),...t}));YI.displayName="SidebarFooter";const sQ=b.forwardRef(({className:e,...t},r)=>s.jsx(Yn,{ref:r,"data-sidebar":"separator",className:ne("mx-2 w-auto bg-sidebar-border",e),...t}));sQ.displayName="SidebarSeparator";const XI=b.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"content",className:ne("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));XI.displayName="SidebarContent";const Qo=b.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"group",className:ne("relative flex w-full min-w-0 flex-col p-2",e),...t}));Qo.displayName="SidebarGroup";const Jo=b.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?Tc:"div";return s.jsx(a,{ref:n,"data-sidebar":"group-label",className:ne("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...r})});Jo.displayName="SidebarGroupLabel";const oQ=b.forwardRef(({className:e,asChild:t=!1,...r},n)=>{const a=t?Tc:"button";return s.jsx(a,{ref:n,"data-sidebar":"group-action",className:ne("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...r})});oQ.displayName="SidebarGroupAction";const Zo=b.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"group-content",className:ne("w-full text-sm",e),...t}));Zo.displayName="SidebarGroupContent";const el=b.forwardRef(({className:e,...t},r)=>s.jsx("ul",{ref:r,"data-sidebar":"menu",className:ne("flex w-full min-w-0 flex-col gap-1",e),...t}));el.displayName="SidebarMenu";const yb=b.forwardRef(({className:e,...t},r)=>s.jsx("li",{ref:r,"data-sidebar":"menu-item",className:ne("group/menu-item relative",e),...t}));yb.displayName="SidebarMenuItem";const lQ=Rc("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),xb=b.forwardRef(({asChild:e=!1,isActive:t=!1,variant:r="default",size:n="default",tooltip:a,className:i,...o},l)=>{const c=e?Tc:"button",{isMobile:u,state:d}=Uf(),f=s.jsx(c,{ref:l,"data-sidebar":"menu-button","data-size":n,"data-active":t,className:ne(lQ({variant:r,size:n}),i),...o});
600return a?(typeof a=="string"&&(a={children:a}),s.jsxs(_9,{children:[s.jsx(N9,{asChild:!0,children:f}),s.jsx(dR,{side:"right",align:"center",hidden:d!=="collapsed"||u,...a})]})):f});xb.displayName="SidebarMenuButton";const cQ=b.forwardRef(({className:e,asChild:t=!1,showOnHover:r=!1,...n},a)=>{const i=t?Tc:"button";return s.jsx(i,{ref:a,"data-sidebar":"menu-action",className:ne("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...n})});cQ.displayName="SidebarMenuAction";const uQ=b.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,"data-sidebar":"menu-badge",className:ne("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));uQ.displayName="SidebarMenuBadge";const dQ=b.forwardRef(({className:e,showIcon:t=!1,...r},n)=>{const a=b.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return s.jsxs("div",{ref:n,"data-sidebar":"menu-skeleton",className:ne("flex h-8 items-center gap-2 rounded-md px-2",e),...r,children:[t&&s.jsx(Xk,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),s.jsx(Xk,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":a}})]})});dQ.displayName="SidebarMenuSkeleton";const fQ=b.forwardRef(({className:e,...t},r)=>s.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:ne("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));fQ.displayName="SidebarMenuSub";const hQ=b.forwardRef(({...e},t)=>s.jsx("li",{ref:t,...e}));hQ.displayName="SidebarMenuSubItem";const pQ=b.forwardRef(({asChild:e=!1,size:t="md",isActive:r,className:n,...a},i)=>{const o=e?Tc:"a";return s.jsx(o,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":r,className:ne("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...a})});pQ.displayName="SidebarMenuSubButton";const QI=b.forwardRef(({className:e,activeClassName:t,pendingClassName:r,to:n,...a},i)=>s.jsx(G8,{ref:i,to:n,className:({isActive:o,isPending:l})=>ne(e,o&&t,l&&r),...a}));QI.displayName="NavLink";const mQ=[{title:"Overview",url:"/admin",icon:Z1},{title:"Products",url:"/admin/products",icon:Gn},{title:"Orders",url:"/admin/orders",icon:g$},{title:"Inventory",url:"/admin/inventory",icon:_$},{title:"Procurement",url:"/admin/procurement",icon:Oa},{title:"Suppliers",url:"/admin/suppliers",icon:as}],gQ=[{title:"Inward Deliveries",url:"/admin/deliveries-inward",icon:rj},{title:"Outward Deliveries",url:"/admin/deliveries-outward",icon:Oa}],vQ=[{title:"Promotions",url:"/admin/promotions",icon:S$},{title:"Banners",url:"/admin/banners",icon:x$}],yQ=[{title:"Messages",url:"/admin/messages",icon:Xp},{title:"Support Tickets",url:"/admin/support-tickets",icon:b$},{title:"Email Log",url:"/admin/email-log",icon:ti},{title:"Staff",url:"/admin/staff",icon:oj},{title:"Reports",url:"/admin/reports",icon:Yp},{title:"Procurement Reports",url:"/admin/procurement-reports",icon:kd},{title:"Cloud Desktop",url:"/admin/documents",icon:y$}],xQ=[{title:"Microsoft 365",url:"https://www.office.com"},{title:"Xero",url:"https://login.xero.com"},{title:"HMRC Gateway",url:"https://www.gov.uk/log-in-register-hmrc-online-services"},{title:"K&N Accounting",url:"https://knnaccounting.online/login"}];function bQ(){const{state:e}=Uf(),t=e==="collapsed",r=ka(),{signOut:n}=ir(),a=o=>o==="/admin"?r.pathname===o:r.pathname.startsWith(o),i=o=>o.map(l=>s.jsx(yb,{children:s.jsx(xb,{asChild:!0,isActive:a(l.url),children:s.jsxs(QI,{to:l.url,end:l.url==="/admin",className:"hover:bg-sidebar-accent/60 transition-colors",activeClassName:"bg-sidebar-accent text-sidebar-primary font-semibold",children:[s.jsx(l.icon,{className:"mr-2 h-4 w-4 shrink-0"}),!t&&s.jsx("span",{children:l.title})]})})},l.title));return s.jsxs(KI,{collapsible:"icon",children:[s.jsxs(XI,{children:[s.jsx("div",{className:`p-4 ${t?"text-center py-4 px-2":""}`,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"h-9 w-9 rounded-lg bg-primary/20 flex items-center justify-center shrink-0",children:s.jsx(sj,{className:"h-5 w-5 text-primary"})}),!t&&s.jsxs("div",{children:[s.jsx("p",{className:"font-display font-bold text-sm text-sidebar-foreground leading-tight",children:"AFRO CARIBBEAN"}
600),s.jsx("p",{className:"text-[11px] text-sidebar-foreground/50",children:"Admin Console"})]})]})}),s.jsx(Yn,{className:"bg-sidebar-border"}),s.jsxs(Qo,{children:[s.jsx(Jo,{className:"text-sidebar-foreground/40 text-[10px] uppercase tracking-wider",children:"Operations"}),s.jsx(Zo,{children:s.jsx(el,{children:i(mQ)})})]}),s.jsxs(Qo,{children:[s.jsx(Jo,{className:"text-sidebar-foreground/40 text-[10px] uppercase tracking-wider",children:"Deliveries"}),s.jsx(Zo,{children:s.jsx(el,{children:i(gQ)})})]}),s.jsxs(Qo,{children:[s.jsx(Jo,{className:"text-sidebar-foreground/40 text-[10px] uppercase tracking-wider",children:"Marketing"}),s.jsx(Zo,{children:s.jsx(el,{children:i(vQ)})})]}),s.jsxs(Qo,{children:[s.jsx(Jo,{className:"text-sidebar-foreground/40 text-[10px] uppercase tracking-wider",children:"Management"}),s.jsx(Zo,{children:s.jsx(el,{children:i(yQ)})})]}),!t&&s.jsxs(Qo,{children:[s.jsx(Jo,{className:"text-sidebar-foreground/40 text-[10px] uppercase tracking-wider",children:"Quick Links"}),s.jsx(Zo,{children:s.jsx(el,{children:xQ.map(o=>s.jsx(yb,{children:s.jsx(xb,{asChild:!0,children:s.jsxs("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"hover:bg-sidebar-accent/60 transition-colors text-sidebar-foreground/70",children:[s.jsx(v$,{className:"mr-2 h-3 w-3 shrink-0"}),s.jsx("span",{className:"text-sm",children:o.title})]})})},o.title))})})]})]}),s.jsx(YI,{className:"border-t border-sidebar-border p-3",children:s.jsxs(W,{variant:"ghost",size:"sm",className:"w-full justify-start text-sidebar-foreground/60 hover:text-sidebar-foreground hover:bg-sidebar-accent/60",onClick:n,children:[s.jsx(w$,{className:"mr-2 h-4 w-4"}),!t&&"Sign Out"]})})]})}const wQ=()=>{var a,i;const{user:e,loading:t,isStaff:r,role:n}=ir();return t?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-sidebar",children:s.jsxs("div",{className:"text-center space-y-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/20 mx-auto flex items-center justify-center",children:s.jsx("div",{className:"h-5 w-5 rounded-full border-2 border-primary border-t-transparent animate-spin"})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading dashboard…"})]})}):e?r?s.jsx(VI,{children:s.jsxs("div",{className:"min-h-screen flex w-full",children:[s.jsx(bQ,{}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[s.jsxs("header",{className:"h-16 flex items-center justify-between border-b bg-background/80 backdrop-blur-sm px-4 md:px-6 sticky top-0 z-10",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(GI,{className:"shrink-0"}),s.jsxs("div",{className:"hidden md:flex items-center relative",children:[s.jsx(Ur,{className:"absolute left-3 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search…",className:"pl-9 w-64 h-9 bg-muted/50 border-0 focus-visible:bg-background"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(W,{variant:"ghost",size:"icon",className:"relative",children:s.jsx($z,{className:"h-4 w-4"})}),s.jsxs("div",{className:"hidden sm:flex items-center gap-2 pl-2 border-l ml-1",children:[s.jsx("div",{className:"h-8 w-8 rounded-full bg-primary/10 flex items-center justify-center text-xs font-bold text-primary",children:(a=e.email)==null?void 0:a.charAt(0).toUpperCase()}),s.jsxs("div",{className:"text-right",children:[s.jsx("p",{className:"text-xs font-medium leading-none",children:(i=e.email)==null?void 0:i.split("@")[0]}),s.jsx("p",{className:"text-[10px] text-muted-foreground capitalize",children:n})]})]})]})]}),s.jsx("main",{className:"flex-1 overflow-auto bg-muted/30 p-4 md:p-6 lg:p-8",children:s.jsx(M8,{})})]})]})}):s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-sidebar",children:s.jsxs("div",{className:"text-center max-w-sm p-8 bg-card rounded-2xl border shadow-lg",children:[s.jsx("div",{className:"h-14 w-14 rounded-full bg-destructive/10 mx-auto flex items-center justify-center mb-4",children:s.jsx("span",{className:"text-2xl",children:"🔒"})}),s.jsx("h1",{className:"font-display text-xl font-bold",children:"Access Denied"}),s.jsx("p",{className:"text-muted-foreground mt-2 text-sm leading-relaxed",children:"You don't have permission to access the admin dashboard. Contact the owner to get a role assigned."})]})}):s.jsx(R8,{to:"/admin/login",replace:!0})},jQ={pending:"bg-amber-100 text-amber-700",confirmed:"bg-blue-100 text-blue-700",processing:"bg-purple-100 text-purple-700",shipped:"bg-indigo-100 text-indigo-700",delivered:"bg-emerald-100 text-emerald-700",cancelled:"bg-red-100 text-red-700"},SQ=()=>{const[e,t]=b.useState({totalOrders:0,pendingOrders:0,lowStock:0,newMessages:0}),[r,n]=b.useState([]),[a,i]=b.useState(!0);b.useEffect(()=>{(async()=>{const[c,u,d,f,h]=await Promise.all([V.from("orders").select("id",{count:"exact",head:!0}),V.from("orders").select("id",{count:"exact",head:!0}
600).eq("status","pending"),V.from("inventory").select("id",{count:"exact",head:!0}).lt("stock_level",10),V.from("customer_messages").select("id",{count:"exact",head:!0}).eq("status","new"),V.from("orders").select("id, order_number, customer_name, total, status, created_at").order("created_at",{ascending:!1}).limit(5)]);t({totalOrders:c.count??0,pendingOrders:u.count??0,lowStock:d.count??0,newMessages:f.count??0}),n(h.data||[]),i(!1)})()},[]);const o=[{title:"Total Orders",value:e.totalOrders,icon:g$,trend:"+12%",trendUp:!0,href:"/admin/orders",gradient:"from-primary/10 to-primary/5",iconColor:"text-primary"},{title:"Pending",value:e.pendingOrders,icon:Gn,trend:e.pendingOrders>0?"Needs attention":"All clear",trendUp:e.pendingOrders===0,href:"/admin/orders",gradient:"from-amber-500/10 to-amber-500/5",iconColor:"text-amber-600"},{title:"Low Stock",value:e.lowStock,icon:so,trend:e.lowStock>0?"Reorder needed":"Stocked up",trendUp:e.lowStock===0,href:"/admin/inventory",gradient:"from-destructive/10 to-destructive/5",iconColor:"text-destructive"},{title:"New Messages",value:e.newMessages,icon:Xp,trend:e.newMessages>0?"Unread":"All read",trendUp:e.newMessages===0,href:"/admin/messages",gradient:"from-secondary/10 to-secondary/5",iconColor:"text-secondary"}];return a?s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ze,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Dashboard"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Overview of your store operations"})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:o.map(l=>s.jsx(we,{to:l.href,className:"group",children:s.jsx(le,{className:"transition-all hover:shadow-md hover:-translate-y-0.5 border-0 bg-gradient-to-br ${card.gradient}",children:s.jsx(ce,{className:"p-5",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:l.title}),s.jsx("p",{className:"text-3xl font-bold mt-2",children:l.value}),s.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[l.trendUp?s.jsx(UN,{className:"h-3 w-3 text-secondary"}):s.jsx(Ez,{className:"h-3 w-3 text-destructive"}),s.jsx("span",{className:`text-xs font-medium ${l.trendUp?"text-secondary":"text-destructive"}`,children:l.trend})]})]}),s.jsx("div",{className:`h-10 w-10 rounded-xl bg-background/80 flex items-center justify-center ${l.iconColor} group-hover:scale-110 transition-transform`,children:s.jsx(l.icon,{className:"h-5 w-5"})})]})})})},l.title))}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsxs(le,{className:"lg:col-span-2",children:[s.jsx(dt,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(mt,{className:"text-base flex items-center gap-2",children:[s.jsx(kd,{className:"h-4 w-4 text-primary"})," Recent Orders"]}),s.jsx(we,{to:"/admin/orders",className:"text-xs text-primary hover:underline font-medium",children:"View all →"})]})}),s.jsx(ce,{children:r.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No orders yet"}):s.jsx("div",{className:"space-y-3",children:r.map(l=>s.jsxs(we,{to:"/admin/orders",className:"flex items-center justify-between p-3 rounded-xl bg-muted/40 hover:bg-muted/70 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[s.jsx("div",{className:"h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:s.jsx(Gn,{className:"h-4 w-4 text-primary"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:l.customer_name}),s.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:l.order_number})]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${jQ[l.status]||"bg-muted text-muted-foreground"}`,children:l.status}),s.jsxs("span",{className:"text-sm font-bold",children:["£",Number(l.total).toFixed(2)]})]})]},l.id))})})]}),s.jsxs(le,{children:[s.jsx(dt,{className:"pb-3",children:s.jsx(mt,{className:"text-base",children:"Qu
600ick Actions"})}),s.jsx(ce,{className:"space-y-2",children:[{label:"Manage Products",href:"/admin/products",icon:Gn},{label:"View Inventory",href:"/admin/inventory",icon:so},{label:"Check Messages",href:"/admin/messages",icon:Xp},{label:"View Reports",href:"/admin/reports",icon:kd}].map(l=>s.jsxs(we,{to:l.href,className:"flex items-center gap-3 p-3 rounded-xl hover:bg-muted/70 transition-colors group",children:[s.jsx("div",{className:"h-8 w-8 rounded-lg bg-primary/10 flex items-center justify-center group-hover:bg-primary/20 transition-colors",children:s.jsx(l.icon,{className:"h-4 w-4 text-primary"})}),s.jsx("span",{className:"text-sm font-medium",children:l.label}),s.jsx(UN,{className:"h-3 w-3 text-muted-foreground ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]},l.label))})]})]})]})},Ht=b.forwardRef(({className:e,...t},r)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:r,className:ne("w-full caption-bottom text-sm",e),...t})}));Ht.displayName="Table";const Vt=b.forwardRef(({className:e,...t},r)=>s.jsx("thead",{ref:r,className:ne("[&_tr]:border-b",e),...t}));Vt.displayName="TableHeader";const Kt=b.forwardRef(({className:e,...t},r)=>s.jsx("tbody",{ref:r,className:ne("[&_tr:last-child]:border-0",e),...t}));Kt.displayName="TableBody";const _Q=b.forwardRef(({className:e,...t},r)=>s.jsx("tfoot",{ref:r,className:ne("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));_Q.displayName="TableFooter";const De=b.forwardRef(({className:e,...t},r)=>s.jsx("tr",{ref:r,className:ne("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));De.displayName="TableRow";const te=b.forwardRef(({className:e,...t},r)=>s.jsx("th",{ref:r,className:ne("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));te.displayName="TableHead";const ee=b.forwardRef(({className:e,...t},r)=>s.jsx("td",{ref:r,className:ne("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ee.displayName="TableCell";const NQ=b.forwardRef(({className:e,...t},r)=>s.jsx("caption",{ref:r,className:ne("mt-4 text-sm text-muted-foreground",e),...t}));NQ.displayName="TableCaption";const kQ=()=>{var f;const[e,t]=b.useState(""),[r,n]=b.useState(os),[a,i]=b.useState(null),[o,l]=b.useState(!1),c=r.filter(h=>h.name.toLowerCase().includes(e.toLowerCase())),u=h=>{n(p=>p.filter(v=>v.id!==h)),X.success("Product deleted")},d=h=>{h.preventDefault();const p=new FormData(h.currentTarget),v=p.get("name"),m=parseFloat(p.get("price")),g=p.get("category"),y=p.get("weight"),x=p.get("description"),w=p.get("inStock")==="true";if(a)n(S=>S.map(j=>j.id===a.id?{...j,name:v,price:m,category:g,weight:y,description:x,inStock:w}:j)),X.success("Product updated");else{const S={id:`prod-${Date.now()}`,name:v,price:m,category:g,weight:y,description:x,inStock:w,image:"https://images.unsplash.com/photo-1607305387299-a3d9611cd469?w=400",featured:!1};n(j=>[...j,S]),X.success("Product added")}l(!1),i(null)};return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h1",{className:"font-display text-2xl font-bold",children:"Products"}),s.jsxs(gr,{open:o,onOpenChange:h=>{l(h),h||i(null)},children:[s.jsx(Wc,{asChild:!0,children:s.jsxs(W,{children:[s.jsx(Or,{className:"mr-2 h-4 w-4"})," Add Product"]})}),s.jsxs(nr,{className:"max-w-lg",children:[s.jsx(vr,{children:s.jsx(ar,{children:a?"Edit Product":"Add Product"})}),s.jsxs("form",{onSubmit:d,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"name",children:"Name"}),s.jsx(se,{id:"name",name:"name",required:!0,defaultValue:a==null?void 0:a.name})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"price",children:"Price (£)"}),s.jsx(se,{id:"price",name:"price",type:"number",step:"0.01",required:!0,defaultValue:a==null?void 0:a.price})]}),s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"weight",children:"Weight/Size"}),s.jsx(se,{id:"weight",name:"weight",defaultValue:a==null?void 0:a.weight})]})]}),s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"category",children:"Category"}),s.jsxs(Tt,{name:"category",defaultValue:(a==null?void 0:a.category)||((f=Ld[0])==null?void 0:f.id),children:[s.jsx(kt,{children:s.jsx($t,{})}),s.jsx(Ot,{children:Ld.map(h=>s.jsx(xe,{value:h.id,children:h.name},h.id))})]})]}),s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"description",children:"Description"}),s.jsx(yr,{id:"description",name:"description",defaultValue:a==null?void 0:a.description})]}),s.jsxs("div",{children:[s.jsx(Oe,{htmlFor:"inStock",children:"Stock Status"}),s.jsxs(Tt,{name:"inStock",defaultValue:(a==null?void 0:a.inStock)!==!1?"true":"false",children:[s.jsx(kt,{children:s.jsx($t,{})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"true",children:"In Stock"}),s.jsx(xe,{value:"false",children:"Out of Stock"})]})]})]}),s.jsx(W,{type:"submit",className:"w-full",children:a?"Save Changes":"Add Product"})]})]})]})]}),s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative flex-1 max-w-sm",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}
600),s.jsx(se,{placeholder:"Search products...",value:e,onChange:h=>t(h.target.value),className:"pl-10"})]}),s.jsxs(Be,{variant:"secondary",children:[c.length," products"]})]})}),s.jsx(ce,{children:s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{children:"Product"}),s.jsx(te,{children:"Category"}),s.jsx(te,{children:"Price"}),s.jsx(te,{children:"Status"}),s.jsx(te,{className:"text-right",children:"Actions"})]})}),s.jsx(Kt,{children:c.map(h=>s.jsxs(De,{children:[s.jsx(ee,{children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("img",{src:h.image,alt:h.name,className:"w-10 h-10 rounded object-cover"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:h.name}),s.jsx("p",{className:"text-xs text-muted-foreground",children:h.weight})]})]})}),s.jsx(ee,{children:s.jsx(Be,{variant:"outline",className:"capitalize",children:h.category.replace("-"," & ")})}),s.jsxs(ee,{className:"font-medium",children:["£",h.price.toFixed(2)]}),s.jsx(ee,{children:s.jsx(Be,{variant:h.inStock?"default":"destructive",children:h.inStock?"In Stock":"Out of Stock"})}),s.jsxs(ee,{className:"text-right",children:[s.jsx(W,{variant:"ghost",size:"icon",onClick:()=>{i(h),l(!0)},children:s.jsx(nj,{className:"h-4 w-4"})}),s.jsx(W,{variant:"ghost",size:"icon",onClick:()=>
600u(h.id),children:s.jsx(xa,{className:"h-4 w-4 text-destructive"})})]})]},h.id))})]})})]})]})},Qk=["pending","confirmed","processing","shipped","delivered","cancelled"],OQ={pending:"bg-amber-100 text-amber-700",confirmed:"bg-blue-100 text-blue-700",processing:"bg-purple-100 text-purple-700",shipped:"bg-indigo-100 text-indigo-700",delivered:"bg-emerald-100 text-emerald-700",cancelled:"bg-red-100 text-red-700"},CQ=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(""),[o,l]=b.useState("all"),c=async()=>{const{data:f}=await V.from("orders").select("*").order("created_at",{ascending:!1});t(f||[]),n(!1)};b.useEffect(()=>{c()},[]);const u=async(f,h)=>{const p=e.find(m=>m.id===f),{error:v}=await V.from("orders").update({status:h}).eq("id",f);if(v){X.error("Failed to update");return}X.success("Order updated"),p!=null&&p.customer_email&&V.functions.invoke("send-transactional-email",{body:{templateName:"order-status-update",recipientEmail:p.customer_email,idempotencyKey:`order-status-${p.order_number}-${h}`,templateData:{customerName:p.customer_name,orderNumber:p.order_number,newStatus:h}}}),c()},d=e.filter(f=>{const h=f.customer_name.toLowerCase().includes(a.toLowerCase())||f.order_number.toLowerCase().includes(a.toLowerCase()),p=o==="all"||f.status===o;return h&&p});return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Orders"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage customer orders and update statuses"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsxs("div",{className:"relative flex-1 max-w-sm",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search orders…",value:a,onChange:f=>i(f.target.value),className:"pl-9 h-9"})]}),s.jsxs(Tt,{value:o,onValueChange:l,children:[s.jsx(kt,{className:"w-36 h-9",children:s.jsx($t,{})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"all",children:"All statuses"}),Qk.map(f=>s.jsx(xe,{value:f,className:"capitalize",children:f},f))]})]}),s.jsxs(Be,{variant:"secondary",className:"h-9 px-3",children:[d.length," orders"]})]}),s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:r?s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):d.length===0?s.jsxs("div",{className:"text-center py-16",children:[s.jsx(Gn,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No orders found"}),s.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Orders from Trust n Trade will appear here"})]}):s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{className:"text-xs",children:"Order #"}),s.jsx(te,{className:"text-xs",children:"Customer"}),s.jsx(te,{className:"text-xs",children:"Total"}),s.jsx(te,{className:"text-xs",children:"Status"}),s.jsx(te,{className:"text-xs",children:"Date"}),s.jsx(te,{className:"text-xs",children:"Update"})]})}),s.jsx(Kt,{children:d.map(f=>s.jsxs(De,{children:[s.jsx(ee,{className:"font-mono text-sm font-medium",children:f.order_number}),s.jsxs(ee,{children:[s.jsx("p",{className:"font-medium text-sm",children:f.customer_name}),s.jsx("p",{className:"text-xs text-muted-foreground",children:f.customer_email||"No email"})]}),s.jsxs(ee,{className:"font-bold text-sm",children:["£",Number(f.total).toFixed(2)]}),s.jsx(ee,{children:s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[11px] font-medium capitalize ${OQ[f.status]||""}`,children:f.status})}),s.jsx(ee,{className:"text-xs text-muted-foreground",children:new Date(f.created_at).toLocaleDateString()}),s.jsx(ee,{children:s.jsxs(Tt,{value:f.status,onValueChange:h=>u(f.id,h),children:[s.jsx(kt,{className:"w-32 h-8 text-xs",children:s.jsx($t,{})}),s.jsx(Ot,{children:Qk.map(h=>s.jsx(xe,{value:h,className:"capitalize text-xs",children:h},h))})]})})]},f.id))})]})})})]})},EQ=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(""),o=async()=>{n(!0);const{data:f}=await V.from("inventory").select("*").order("product_name");t(f||[]),n(!1)};b.useEffect(()=>{o()},[]);const l=f=>f.stock_level<=f.reorder_level,c=f=>f.expiry_date?(new Date(f.expiry_date).getTime()-Date.now())/(1e3*60*60*24)<=14:!1,u=e.filter(f=>f.product_name.toLowerCase().includes(a.toLowerCase())),d=e.filter(l);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Inventory"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Track stock levels and expiry dates"})]}),s.jsxs(W,{variant:"outline",size:"sm",onClick:o,children:[s.jsx(If,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`})," Sync Epos Now"]})]}),d.length>0&&s.jsx(le,{className:"border-destructive/30 bg-destructive/5",children:s.jsxs(ce,{className:"p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(so,{className:"h-4 w-4 text-destructive"}),s.jsxs("span",{className:"text-sm font-semibold text-destructive",children:[d.length," item",d.length!==1?"s":""," low on stock"]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:d.map(f=>s.jsxs(Be,{variant:"destructive",className:"text-xs",children:[f.product_name,": ",f.stock_level," left"]},f.id))})]})}),s.jsxs("div",{className:"relative max-w-sm",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search inventory…",value:a,onChange:f=>i(f.target.value),className:"pl-9 h-9"})]}),s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:r?s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):u.length===0?s.jsxs("div",{className:"text-center py-16",children:[s.jsx(_$,{className:"h-10 w-10 mx-auto text-muted-foreground
600/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No inventory data"}),s.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Connect Epos Now to sync real-time stock levels"})]}):s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{className:"text-xs",children:"Product"}),s.jsx(te,{className:"text-xs",children:"SKU"}),s.jsx(te,{className:"text-xs",children:"Stock"}),s.jsx(te,{className:"text-xs",children:"Reorder At"}),s.jsx(te,{className:"text-xs",children:"Expiry"}),s.jsx(te,{className:"text-xs",children:"Last Synced"})]})}),s.jsx(Kt,{children:u.map(f=>s.jsxs(De,{className:l(f)?"bg-destructive/5":"",children:[s.jsx(ee,{className:"font-medium text-sm",children:f.product_name}),s.jsx(ee,{className:"font-mono text-xs text-muted-foreground",children:f.sku||"—"}),s.jsx(ee,{children:s.jsx(Be,{variant:l(f)?"destructive":"default",className:"text-xs",children:f.stock_level})}),s.jsx(ee,{className:"text-sm",children:f.reorder_level}),s.jsx(ee,{children:f.expiry_date?s.jsx("span",{className:`text-sm ${c(f)?"text-destructive font-medium":""}`,children:new Date(f.expiry_date).toLocaleDateString()}):s.jsx("span",{className:"text-muted-foreground text-sm",children:"—"})}),s.jsx(ee,{className:"text-xs text-muted-foreground",children:f.last_synced_at?new Date(f.last_synced_at).toLocaleString():"Never"})]},f.id))})]})})})]})},Jk={requested:"bg-amber-100 text-amber-700",confirmed:"bg-blue-100 text-blue-700",shipped:"bg-indigo-100 text-indigo-700",received:"bg-emerald-100 text-emerald-700",cancelled:"bg-red-100 text-red-700"},PQ=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(!1),o=async()=>{const{data:u}=await V.from("procurement").select("*").order("created_at",{ascending:!1});t(u||[]),n(!1)};b.useEffect(()=>{o()},[]);const l=async u=>{u.preventDefault();const d=new FormData(u.currentTarget),{error:f}=await V.from("procurement").insert({supplier_name:d.get("supplier"),total_cost:parseFloat(d.get("cost"))||null,expected_delivery:d.get("delivery")||null,notes:d.get("notes")||null});if(f){X.error("Failed to create");return}X.success("Procurement request created"),i(!1),o()},c=async(u,d)=>{const{error:f}=await V.from("procurement").update({status:d}).eq("id",u);if(f){X.error("Failed to update");return}X.success("Status updated"),o()};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Procurement"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage supplier orders and deliveries"})]}),s.jsxs(gr,{open:a,onOpenChange:i,children:[s.jsx(Wc,{asChild:!0,children:s.jsxs(W,{size:"sm",children:[s.jsx(Or,{className:"mr-2 h-4 w-4"})," New Request"]})}),s.jsxs(nr,{children:[s.jsx(vr,{children:s.jsx(ar,{children:"New Procurement Request"})}),s.jsxs("form",{onSubmit:l,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Oe,{children:"Supplier Name"}),s.jsx(se,{name:"supplier",required:!0})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Oe,{children:"Estimated Cost (£)"}),s.jsx(se,{name:"cost",type:"number",step:"0.01"})]}),s.jsxs("div",{children:[s.jsx(Oe,{children:"Expected Delivery"}),s.jsx(se,{name:"delivery",type:"date"})]})]}),s.jsxs("div",{children:[s.jsx(Oe,{children:"Notes"}),s.jsx(yr,{name:"notes",rows:3})]}),s.jsx(W,{type:"submit",className:"w-full",children:"Create Request"})]})]})]})]}),s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:r?s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):e.length===0?s.jsxs("div",{className:"text-center py-16",children:[s.jsx(Oa,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No procurement orders"}),s.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Request stock from Trust n Trade suppliers"})]}):s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{className:"text-xs",children:"Supplier"}),s.jsx(te,{className:"text-xs",children:"Cost"}),s.jsx(te,{className:"text-xs",children:"Status"}),s.jsx(te,{className:"text-xs",children:"Expected Delivery"}),s.jsx(te,{className:"text-xs",children:"Date"}),s.jsx(te,{className:"text-xs",children:"Update"})]})}),s.jsx(Kt,{children:e.map(u=>s.jsxs(De,{children:[s.jsx(ee,{className:"font-medium text-sm",children:u.supplier_name}),s.jsx(ee,{className:"text-sm",children:u.total_cost?`£${Number(u.total_cost).toFixed(2)}`:"—"}),s.jsx(ee,{children:s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[11px] font-medium capitalize ${Jk[u.status]||""}`,children:u.status})}),s.jsx(ee,{className:"text-sm",children:u.expected_delivery?new Date(u.expected_delivery).toLocaleDateString():"—"}),s.jsx(ee,{className:"text-xs text-muted-foreground",children:new Date(u.created_at).toLocaleDateString()}),s.jsx(ee,{children:s.jsxs(Tt,{value:u.status,onValueChange:d=>c(u.id,d),children:[s.jsx(kt,{className:"w-28 h-8 text-xs",children:s.jsx($t,{})}),s.jsx(Ot,{children:Object.keys(Jk).map(d=>s.jsx(xe,{value:d,className:"capitalize text-xs",children:d},d))})]})})]},u.id))})]})})})]})},Zk={new:{color:"bg-blue-100 text-blue-700",icon:ti}
600,read:{color:"bg-amber-100 text-amber-700",icon:ei},replied:{color:"bg-emerald-100 text-emerald-700",icon:q0},resolved:{color:"bg-emerald-100 text-emerald-700",icon:q0}},AQ=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(null),[o,l]=b.useState(""),{user:c}=ir(),u=async()=>{const{data:h}=await V.from("customer_messages").select("*").order("created_at",{ascending:!1});t(h||[]),n(!1)};b.useEffect(()=>{u()},[]);const d=async h=>{await V.from("customer_messages").update({status:"read"}).eq("id",h),X.success("Marked as read"),u()},f=async h=>{o.trim()&&(await V.from("customer_messages").update({status:"replied",reply:o,replied_by:c==null?void 0:c.id}).eq("id",h.id),X.success("Reply sent"),i(null),l(""),u())};return r?s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Messages"}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[e.filter(h=>h.status==="new").length," unread message",e.filter(h=>h.status==="new").length!==1?"s":""]})]}),e.length===0?s.jsx(le,{children:s.jsxs(ce,{className:"py-16 text-center",children:[s.jsx(Xp,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No messages yet"}),s.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Customer queries from Trust n Trade will appear here"})]})}):s.jsx("div",{className:"space-y-3",children:e.map(h=>{const p=Zk[h.status]||Zk.new,v=p.icon,m=a===h.id;return s.jsx(le,{className:`transition-all ${h.status==="new"?"border-primary/30 shadow-sm":""}`,children:s.jsx(ce,{className:"p-5",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s.jsx("div",{className:"h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0 mt-0.5",children:s.jsx(v,{className:"h-4 w-4 text-primary"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("h3",{className:"font-semibold text-sm",children:h.subject}),s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${p.color}`,children:h.status})]}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[h.customer_name," ",h.customer_email&&`· ${h.customer_email}`]}),s.jsx("p",{className:"text-sm text-foreground/80 mt-2 leading-relaxed",children:h.message}),h.reply&&s.jsxs("div",{className:"mt-3 p-3 rounded-lg bg-secondary/5 border border-secondary/20",children:[s.jsx("p",{className:"text-xs font-medium text-secondary mb-1",children:"Your reply:"}),s.jsx("p",{className:"text-sm text-foreground/80",children:h.reply})]}),m&&s.jsxs("div",{className:"mt-3 space-y-2",children:[s.jsx(yr,{value:o,onChange:g=>l(g.target.value),placeholder:"Type your reply…",rows:3}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(W,{size:"sm",onClick:()=>f(h),children:[s.jsx(Zl,{className:"mr-2 h-3 w-3"})," Send Reply"]}),s.jsx(W,{size:"sm",variant:"ghost",onClick:()=>{i(null),l("")},children:"Cancel"})]})]})]})]}),s.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[s.jsx("span",{className:"text-[11px] text-muted-foreground",children:new Date(h.created_at).toLocaleDateString()}),h.status==="new"&&s.jsx(W,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>d(h.id),children:"Mark Read"}),!h.reply&&h.status!=="resolved"&&!m&&s.jsx(W,{size:"sm",variant:"outline",className:"h-7 text-xs",onClick:()=>i(h.id),children:"Reply"})]})]})})},h.id)})})]})},eO={owner:{color:"bg-amber-100 text-amber-700 border-amber-300",label:"Owner"},admin:{color:"bg-blue-100 text-blue-700 border-blue-300",label:"Admin"},staff:{color:"bg-muted text-muted-foreground border-border",label:"Staff"}},TQ=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(!1),[o,l]=b.useState(""),[c,u]=b.useState("staff"),[d,f]=b.useState(!1),{role:h}=ir(),p=async()=>{const{data:g}=await V.from("user_roles").select("user_id, role");
600if(!g){n(!1);return}const y=g.map(S=>S.user_id),{data:x}=await V.from("profiles").select("user_id, display_name, avatar_url").in("user_id",y),w=g.map(S=>{const j=x==null?void 0:x.find(_=>_.user_id===S.user_id);return{user_id:S.user_id,display_name:(j==null?void 0:j.display_name)||"Unknown",role:S.role,avatar_url:(j==null?void 0:j.avatar_url)||null}});t(w),n(!1)};b.useEffect(()=>{p()},[]);const v=async()=>{if(!o.trim()){X.error("Please enter a user ID");return}f(!0);const{error:g}=await V.from("user_roles").insert({user_id:o.trim(),role:c});if(f(!1),g){g.code==="23505"?X.error("This user already has this role assigned"):g.code==="23503"?X.error("User not found — make sure they've signed up first"):X.error(g.message);return}X.success("Role assigned successfully"),i(!1),l(""),u("staff"),p()},m=async g=>{const{error:y}=await V.from("user_roles").delete().eq("user_id",g);if(y){X.error("Failed to remove role");return}X.success("Role removed"),p()};return r?s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Staff"}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[e.length," team member",e.length!==1?"s":""]})]}),h==="owner"&&s.jsxs(gr,{open:a,onOpenChange:i,children:[s.jsx(Wc,{asChild:!0,children:s.jsxs(W,{size:"sm",children:[s.jsx(r7,{className:"mr-2 h-4 w-4"})," Add Staff"]})}),s.jsxs(nr,{children:[s.jsx(vr,{children:s.jsx(ar,{children:"Assign Role to User"})}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"The user must have signed up first. Paste their User ID below and select a role."}),s.jsxs("div",{className:"space-y-4 mt-2",children:[s.jsxs("div",{children:[s.jsx(Oe,{children:"User ID"}),s.jsx(se,{placeholder:"e.g. af444c14-79d2-4415-9b4b-de84ed1cc5ae",value:o,onChange:g=>l(g.target.value)})]}),s.jsxs("div",{children:[s.jsx(Oe,{children:"Role"}),s.jsxs(Tt,{value:c,onValueChange:u,children:[s.jsx(kt,{children:s.jsx($t,{})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"staff",children:"Staff"}),s.jsx(xe,{value:"admin",children:"Admin"})]})]})]}),s.jsx(W,{className:"w-full",onClick:v,disabled:d,children:d?"Assigning…":"Assign Role"})]})]})]})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(g=>{const y=eO[g.role]||eO.staff;return s.jsx(le,{className:"hover:shadow-sm transition-shadow",children:s.jsx(ce,{className:"p-5",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"h-11 w-11 rounded-full bg-primary/10 flex items-center justify-center text-sm font-bold text-primary shrink-0",children:(g.display_name||"?").charAt(0).toUpperCase()}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-semibold text-sm truncate",children:g.display_name}),s.jsx("p",{className:"text-[11px] font-mono text-muted-foreground mt-0.5 truncate",children:g.user_id}),s.jsx("span",{className:`inline-block mt-2 px-2 py-0.5 rounded-full text-[10px] font-medium capitalize border ${y.color}`,children:y.label})]}),h==="owner"&&g.role!=="owner"&&s.jsx(W,{variant:"ghost",size:"sm",className:"text-xs text-destructive hover:text-destructive shrink-0",onClick:()=>m(g.user_id),children:"Remove"})]})})},g.user_id)})})]})};var $Q=Array.isArray,zr=$Q,RQ=typeof th=="object"&&th&&th.Object===Object&&th,JI=RQ,MQ=JI,IQ=typeof self=="object"&&self&&self.Object===Object&&self,DQ=MQ||IQ||Function("return this")(),Ea=DQ,LQ=Ea,FQ=LQ.Symbol,zf=FQ,tO=zf,ZI=Object.prototype,BQ=ZI.hasOwnProperty,UQ=ZI.toString,gu=tO?tO.toStringTag:void 0;function zQ(e){var t=BQ.call(e,gu),r=e[gu];try{e[gu]=void 0;var n=!0}catch{}var a=UQ.call(e);return n&&(t?e[gu]=r:delete e[gu]),a}var qQ=zQ,WQ=Object.prototype,HQ=WQ.toString;function VQ(e){return HQ.call(e)}var KQ=VQ,rO=zf,GQ=qQ,YQ=KQ,XQ="[object Null]",QQ="[object Undefined]",nO=rO?rO.toStringTag:void 0;function JQ(e){return e==null?e===void 0?QQ:XQ:nO&&nO in Object(e)?GQ(e):YQ(e)}var fi=JQ;function ZQ(e){return e!=null&&typeof e=="object"}
vendor: 4,733 bytes, line 600
600var hi=ZQ,eJ=fi,tJ=hi,rJ="[object Symbol]";function nJ(e){return typeof e=="symbol"||tJ(e)&&eJ(e)==rJ}var Hc=nJ,aJ=zr,iJ=Hc,sJ=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oJ=/^\w*$/;function lJ(e,t){if(aJ(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||iJ(e)?!0:oJ.test(e)||!sJ.test(e)||t!=null&&e in Object(t)}var zj=lJ;function cJ(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var hs=cJ;const Vc=qe(hs);var uJ=fi,dJ=hs,fJ="[object AsyncFunction]",hJ="[object Function]",pJ="[object GeneratorFunction]",mJ="[object Proxy]";function gJ(e){if(!dJ(e))return!1;var t=uJ(e);return t==hJ||t==pJ||t==fJ||t==mJ}var qj=gJ;const ke=qe(qj);var vJ=Ea,yJ=vJ["__core-js_shared__"],xJ=yJ,lx=xJ,aO=function(){var e=/[^.]+$/.exec(lx&&lx.keys&&lx.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function bJ(e){return!!aO&&aO in e}var wJ=bJ,jJ=Function.prototype,SJ=jJ.toString;function _J(e){if(e!=null){try{return SJ.call(e)}catch{}try{return e+""}catch{}}return""}var eD=_J,NJ=qj,kJ=wJ,OJ=hs,CJ=eD,EJ=/[\\^$.*+?()[\]{}|]/g,PJ=/^\[object .+?Constructor\]$/,AJ=Function.prototype,TJ=Object.prototype,$J=AJ.toString,RJ=TJ.hasOwnProperty,MJ=RegExp("^"+$J.call(RJ).replace(EJ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function IJ(e){if(!OJ(e)||kJ(e))return!1;var t=NJ(e)?MJ:PJ;return t.test(CJ(e))}var DJ=IJ;function LJ(e,t){return e==null?void 0:e[t]}var FJ=LJ,BJ=DJ,UJ=FJ;function zJ(e,t){var r=UJ(e,t);return BJ(r)?r:void 0}var So=zJ,qJ=So,WJ=qJ(Object,"create"),cv=WJ,iO=cv;function HJ(){this.__data__=iO?iO(null):{},this.size=0}var VJ=HJ;function KJ(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var GJ=KJ,YJ=cv,XJ="__lodash_hash_undefined__",QJ=Object.prototype,JJ=QJ.hasOwnProperty;function ZJ(e){var t=this.__data__;if(YJ){var r=t[e];return r===XJ?void 0:r}return JJ.call(t,e)?t[e]:void 0}var eZ=ZJ,tZ=cv,rZ=Object.prototype,nZ=rZ.hasOwnProperty;function aZ(e){var t=this.__data__;return tZ?t[e]!==void 0:nZ.call(t,e)}var iZ=aZ,sZ=cv,oZ="__lodash_hash_undefined__";function lZ(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=sZ&&t===void 0?oZ:t,this}var cZ=lZ,uZ=VJ,dZ=GJ,fZ=eZ,hZ=iZ,pZ=cZ;function Kc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Kc.prototype.clear=uZ;Kc.prototype.delete=dZ;Kc.prototype.get=fZ;Kc.prototype.has=hZ;Kc.prototype.set=pZ;var mZ=Kc;function gZ(){this.__data__=[],this.size=0}var vZ=gZ;function yZ(e,t){return e===t||e!==e&&t!==t}var Wj=yZ,xZ=Wj;function bZ(e,t){for(var r=e.length;r--;)if(xZ(e[r][0],t))return r;return-1}var uv=bZ,wZ=uv,jZ=Array.prototype,SZ=jZ.splice;function _Z(e){var t=this.__data__,r=wZ(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():SZ.call(t,r,1),--this.size,!0}var NZ=_Z,kZ=uv;function OZ(e){var t=this.__data__,r=kZ(t,e);return r<0?void 0:t[r][1]}var CZ=OZ,EZ=uv;function PZ(e){return EZ(this.__data__,e)>-1}var AZ=PZ,TZ=uv;function $Z(e,t){var r=this.__data__,n=TZ(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var RZ=$Z,MZ=vZ,IZ=NZ,DZ=CZ,LZ=AZ,FZ=RZ;function Gc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Gc.prototype.clear=MZ;Gc.prototype.delete=IZ;Gc.prototype.get=DZ;Gc.prototype.has=LZ;Gc.prototype.set=FZ;var dv=Gc,BZ=So,UZ=Ea,zZ=BZ(UZ,"Map"),Hj=zZ,sO=mZ,qZ=dv,WZ=Hj;function HZ(){this.size=0,this.__data__={hash:new sO,map:new(WZ||qZ),string:new sO}}var VZ=HZ;function KZ(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var GZ=KZ,YZ=GZ;function XZ(e,t){var r=e.__data__;return YZ(t)?r[typeof t=="string"?"string":"hash"]:r.map}var fv=XZ,QZ=fv;function JZ(e){var t=QZ(this,e).delete(e);return this.size-=t?1:0,t}var ZZ=JZ,eee=fv;function tee(e){return eee(this,e).get(e)}var ree=tee,nee=fv;function aee(e){return nee(this,e).has(e)}var iee=aee,see=fv;function oee(e,t){var r=see(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var lee=oee,cee=VZ,uee=ZZ,dee=ree,fee=iee,hee=lee;function Yc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Yc.prototype.clear=cee;Yc.prototype.delete=uee;Yc.prototype.get=dee;Yc.prototype.has=fee;Yc.prototype.set=hee;var Vj=Yc,tD=Vj,pee="Expected a function";function Kj(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(pee);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(Kj.Cache||tD),r}Kj.Cache=tD;var rD=Kj;const mee=qe(rD);var gee=rD,vee=500;function yee(e){var t=gee(e,function(n){return r.size===vee&&r.clear(),n}
vendor: 6,750 bytes, lines 600-608
600),r=t.cache;return t}var xee=yee,bee=xee,wee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jee=/\\(\\)?/g,See=bee(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(wee,function(r,n,a,i){t.push(a?i.replace(jee,"$1"):n||r)}),t}),_ee=See;function Nee(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var Gj=Nee,oO=zf,kee=Gj,Oee=zr,Cee=Hc,Eee=1/0,lO=oO?oO.prototype:void 0,cO=lO?lO.toString:void 0;function nD(e){if(typeof e=="string")return e;if(Oee(e))return kee(e,nD)+"";if(Cee(e))return cO?cO.call(e):"";var t=e+"";return t=="0"&&1/e==-Eee?"-0":t}var Pee=nD,Aee=Pee;function Tee(e){return e==null?"":Aee(e)}var aD=Tee,$ee=zr,Ree=zj,Mee=_ee,Iee=aD;function Dee(e,t){return $ee(e)?e:Ree(e,t)?[e]:Mee(Iee(e))}var iD=Dee,Lee=Hc,Fee=1/0;function Bee(e){if(typeof e=="string"||Lee(e))return e;var t=e+"";return t=="0"&&1/e==-Fee?"-0":t}var hv=Bee,Uee=iD,zee=hv;function qee(e,t){t=Uee(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[zee(t[r++])];return r&&r==n?e:void 0}var Yj=qee,Wee=Yj;function Hee(e,t,r){var n=e==null?void 0:Wee(e,t);return n===void 0?r:n}var sD=Hee;const tn=qe(sD);function Vee(e){return e==null}var Kee=Vee;const $e=qe(Kee);var Gee=fi,Yee=zr,Xee=hi,Qee="[object String]";function Jee(e){return typeof e=="string"||!Yee(e)&&Xee(e)&&Gee(e)==Qee}var Zee=Jee;const ho=qe(Zee);var oD={exports:{}},Ke={};/**
601 * @license React
602 * react-is.production.min.js
603 *
604 * Copyright (c) Facebook, Inc. and its affiliates.
605 *
606 * This source code is licensed under the MIT license found in the
607 * LICENSE file in the root directory of this source tree.
608 */var Xj=Symbol.for("react.element"),Qj=Symbol.for("react.portal"),pv=Symbol.for("react.fragment"),mv=Symbol.for("react.strict_mode"),gv=Symbol.for("react.profiler"),vv=Symbol.for("react.provider"),yv=Symbol.for("react.context"),ete=Symbol.for("react.server_context"),xv=Symbol.for("react.forward_ref"),bv=Symbol.for("react.suspense"),wv=Symbol.for("react.suspense_list"),jv=Symbol.for("react.memo"),Sv=Symbol.for("react.lazy"),tte=Symbol.for("react.offscreen"),lD;lD=Symbol.for("react.module.reference");function On(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Xj:switch(e=e.type,e){case pv:case gv:case mv:case bv:case wv:return e;default:switch(e=e&&e.$$typeof,e){case ete:case yv:case xv:case Sv:case jv:case vv:return e;default:return t}}case Qj:return t}}}Ke.ContextConsumer=yv;Ke.ContextProvider=vv;Ke.Element=Xj;Ke.ForwardRef=xv;Ke.Fragment=pv;Ke.Lazy=Sv;Ke.Memo=jv;Ke.Portal=Qj;Ke.Profiler=gv;Ke.StrictMode=mv;Ke.Suspense=bv;Ke.SuspenseList=wv;Ke.isAsyncMode=function(){return!1};Ke.isConcurrentMode=function(){return!1};Ke.isContextConsumer=function(e){return On(e)===yv};Ke.isContextProvider=function(e){return On(e)===vv};Ke.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xj};Ke.isForwardRef=function(e){return On(e)===xv};Ke.isFragment=function(e){return On(e)===pv};Ke.isLazy=function(e){return On(e)===Sv};Ke.isMemo=function(e){return On(e)===jv};Ke.isPortal=function(e){return On(e)===Qj};Ke.isProfiler=function(e){return On(e)===gv};Ke.isStrictMode=function(e){return On(e)===mv};Ke.isSuspense=function(e){return On(e)===bv};Ke.isSuspenseList=function(e){return On(e)===wv};Ke.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===pv||e===gv||e===mv||e===bv||e===wv||e===tte||typeof e=="object"&&e!==null&&(e.$$typeof===Sv||e.$$typeof===jv||e.$$typeof===vv||e.$$typeof===yv||e.$$typeof===xv||e.$$typeof===lD||e.getModuleId!==void 0)};Ke.typeOf=On;oD.exports=Ke;var rte=oD.exports,nte=fi,ate=hi,ite="[object Number]";function ste(e){return typeof e=="number"||ate(e)&&nte(e)==ite}var cD=ste;const ote=qe(cD);var lte=cD;function cte(e){return lte(e)&&e!=+e}var ute=cte;const qf=qe(ute);var Sr=function(t){return t===0?0:t>0?1:-1},Fs=function(t){return ho(t)&&t.indexOf("%")===t.length-1},ae=function(t){return ote(t)&&!qf(t)},dte=function(t){return $e(t)},Lt=function(t){return ae(t)||ho(t)},fte=0,Wf=function(t){var r=++fte;return"".concat(t||"").concat(r)},_r=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ae(t)&&!ho(t))return n;var i;if(Fs(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return qf(i)&&(i=n),a&&i>r&&(i=r),i},Ti=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},hte=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a<r;a++)if(!n[t[a]])n[t[a]]=!0;else return!0;return!1},ki=function(t,r){return ae(t)&&ae(r)?function(n){return t+n*(r-t)}:function(){return r}};function bb(e,t,r){return!e||!e.length?null:e.find(function(n){return n&&(typeof t=="function"?t(n):tn(n,t))===r})}var pte=function(t,r){return ae(t)&&ae(r)?t-r:ho(t)&&ho(r)?t.localeCompare(r):t instanceof Date&&r instanceof Date?t.getTime()-r.getTime():String(t).localeCompare(String(r))};function El(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 wb(e){"@babel/helpers - typeof";return wb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wb(e)}var mte=["viewBox","children"],gte=["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","colorRen
608dering","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"],uO=["points","pathLength"],cx={svg:mte,polygon:uO,polyline:uO},Jj=["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","onDrag
608Capture","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"],um=function(t,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var n=t;if(b.isValidElement(t)&&(n=t.props),!Vc(n))return null;var a={};return Object.keys(n).forEach(function(i){Jj.includes(i)&&(a[i]=r||function(o){return n[i](n,o)})}),a},vte=function(t,r,n){return function(a){return t(r,n,a),null}},po=function(t,r,n){if(!Vc(t)||wb(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];Jj.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=vte(o,r,n))}),a},yte=["children"],xte=["children"];function dO(e,t){if(e==null)return{};var r=bte(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var fO={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Ka=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},hO=null,ux=null,Zj=function e(t){if(t===hO&&Array.isArray(ux))return ux;var r=[];return b.Children.forEach(t,function(n){$e(n)||(rte.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),ux=r,hO=t,r};function wn(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return Ka(a)}):n=[Ka(t)],Zj(e).forEach(function(a){var i=tn(a,"type.displayName")||tn(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Vr(e,t){var r=wn(e,t);return r&&r[0]}var pO=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!ae(n)||n<=0||!ae(a)||a<=0)},wte=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],jte=function(t){return t&&t.type&&ho(t.type)&&wte.indexOf(t.type)>=0},Ste=function(t,r,n,a){var i,o=(i=cx==null?void 0:cx[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!ke(t)&&(a&&o.includes(r)||gte.includes(r))||n&&Jj.includes(r)},_e=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(b.isValidElement(t)&&(a=t.props),!Vc(a))return null;var i={};
608return Object.keys(a).forEach(function(o){var l;Ste((l=a)===null||l===void 0?void 0:l[o],o,r,n)&&(i[o]=a[o])}),i},jb=function e(t,r){if(t===r)return!0;var n=b.Children.count(t);if(n!==b.Children.count(r))return!1;if(n===0)return!0;if(n===1)return mO(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a<n;a++){var i=t[a],o=r[a];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!mO(i,o))return!1}return!0},mO=function(t,r){if($e(t)&&$e(r))return!0;if(!$e(t)&&!$e(r)){var n=t.props||{},a=n.children,i=dO(n,yte),o=r.props||{},l=o.children,c=dO(o,xte);return a&&l?El(i,c)&&jb(a,l):!a&&!l?El(i,c):!1}return!1},gO=function(t,r){var n=[],a={};return Zj(t).forEach(function(i,o){if(jte(i))n.push(i);else if(i){var l=Ka(i.type),c=r[l]||{},u=c.handler,d=c.once;if(u&&(!d||!a[l])){var f=u(i,l,o);n.push(f),a[l]=!0}}}),n},_te=function(t){var r=t&&t.type;return r&&fO[r]?fO[r]:null},Nte=function(t,r){return Zj(r).indexOf(t)},kte=["children","width","height","viewBox","className","style","title","desc"];function Sb(){return Sb=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},Sb.apply(this,arguments)}function Ote(e,t){if(e==null)return{};var r=Cte(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _b(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,o=e.style,l=e.title,c=e.desc,u=Ote(e,kte),d=a||{width:r,height:n,x:0,y:0},f=Te("recharts-surface",i);return C.createElement("svg",Sb({},_e(u,!0,"svg"),{className:f,width:r,height:n,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),C.createElement("title",null,l),C.createElement("desc",null,c),t)}var Ete=["children","className"];function Nb(){return Nb=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},Nb.apply(this,arguments)}function Pte(e,t){if(e==null)return{};var r=Ate(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ate(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var He=C.forwardRef(function(e,t){var r=e.children,n=e.className,a=Pte(e,Ete),i=Te("recharts-layer",n);return C.createElement("g",Nb({className:i},_e(a,!0),{ref:t}),r)}),Xn=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i]};function Tte(e,t,r){var n=-1,a=e.length;t<0&&(t=-t>a?0:a+t),r=r>a?a:r,r<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(a);++n<a;)i[n]=e[n+t];return i}var $te=Tte,Rte=$te;function Mte(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:Rte(e,t,r)}var Ite=Mte,Dte="\\ud800-\\udfff",Lte="\\u0300-\\u036f",Fte="\\ufe20-\\ufe2f",Bte="\\u20d0-\\u20ff",Ute=Lte+Fte+Bte,zte="\\ufe0e\\ufe0f",qte="\\u200d",Wte=RegExp("["+qte+Dte+Ute+zte+"]");function Hte(e){return Wte.test(e)}var uD=Hte;function Vte(e){return e.split("")}var Kte=Vte,dD="\\ud800-\\udfff",Gte="\\u0300-\\u036f",Yte="\\ufe20-\\ufe2f",Xte="\\u20d0-\\u20ff",Qte=Gte+Yte+Xte,Jte="\\ufe0e\\ufe0f",Zte="["+dD+"]",kb="["+Qte+"]",Ob="\\ud83c[\\udffb-\\udfff]",ere="(?:"+kb+"|"+Ob+")",fD="[^"+dD+"]",hD="(?:\\ud83c[\\udde6-\\uddff]){2}",pD="[\\ud800-\\udbff][\\udc00-\\udfff]",tre="\\u200d",mD=ere+"?",gD="["+Jte+"]?",rre="(?:"+tre+"(?:"+[fD,hD,pD].join("|")+")"+gD+mD+")*",nre=gD+mD+rre,are="(?:"+[fD+kb+"?",kb,hD,pD,Zte].join("|")+")",ire=RegExp(Ob+"(?="+Ob+")|"+are+nre,"g");function sre(e){return e.match(ire)||[]}var ore=sre,lre=Kte,cre=uD,ure=ore;function dre(e){return cre(e)?ure(e):lre(e)}var fre=dre,hre=Ite,pre=uD,mre=fre,gre=aD;function vre(e){return function(t){t=gre(t);var r=pre(t)?mre(t):void 0,n=r?r[0]:t.charAt(0),a=r?hre(r,1).join(""):t.slice(1);return n[e]()+a}}var yre=vre,xre=yre,bre=xre("toUpperCase"),wre=bre;const _v=qe(wre);function rt(e){return function(){return e}}const vD=Math.cos,dm=Math.sin,na=Math.sqrt,fm=Math.PI,Nv=2*fm,Cb=Math.PI,Eb=2*Cb,Cs=1e-6,jre=Eb-Cs;function yD(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function Sre(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return yD;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class _re{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?yD:Sre(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,a){this._append`Q${+t},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(t,r,n,a,i,o){this._append`C${+t},${+r},${+n}
608,${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,r,n,a,i){if(t=+t,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=n-t,u=a-r,d=o-t,f=l-r,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=r}`;else if(h>Cs)if(!(Math.abs(f*c-u*d)>Cs)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,v=a-l,m=c*c+u*u,g=p*p+v*v,y=Math.sqrt(m),x=Math.sqrt(h),w=i*Math.tan((Cb-Math.acos((m+h-g)/(2*y*x)))/2),S=w/x,j=w/y;Math.abs(S-1)>Cs&&this._append`L${t+S*d},${r+S*f}`,this._append`A${i},${i},0,0,${+(f*p>d*v)},${this._x1=t+j*c},${this._y1=r+j*u}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),c=n*Math.sin(a),u=t+l,d=r+c,f=1^o,h=o?a-i:i-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>Cs||Math.abs(this._y1-d)>Cs)&&this._append`L${u},${d}`,n&&(h<0&&(h=h%Eb+Eb),h>jre?this._append`A${n},${n},0,1,${f},${t-l},${r-c}A${n},${n},0,1,${f},${this._x1=u},${this._y1=d}`:h>Cs&&this._append`A${n},${n},0,${+(h>=Cb)},${f},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function eS(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 _re(t)}function tS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xD(e){this._context=e}xD.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 kv(e){return new xD(e)}function bD(e){return e[0]}function wD(e){return e[1]}function jD(e,t){var r=rt(!0),n=null,a=kv,i=null,o=eS(l);e=typeof e=="function"?e:e===void 0?bD:rt(e),t=typeof t=="function"?t:t===void 0?wD:rt(t);function l(c){var u,d=(c=tS(c)).length,f,h=!1,p;for(n==null&&(i=a(p=o())),u=0;u<=d;++u)!(u<d&&r(f=c[u],u,c))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(f,u,c),+t(f,u,c));if(p)return i=null,p+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:rt(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:rt(+c),l):t},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:rt(!!c),l):r},l.curve=function(c){return arguments.length?(a=c,n!=null&&(i=a(n)),l):a},l.context=function(c){return arguments.length?(c==null?n=i=null:i=a(n=c),l):n},l}function Mh(e,t,r){var n=null,a=rt(!0),i=null,o=kv,l=null,c=eS(u);e=typeof e=="function"?e:e===void 0?bD:rt(+e),t=typeof t=="function"?t:rt(t===void 0?0:+t),r=typeof r=="function"?r:r===void 0?wD:rt(+r);function u(f){var h,p,v,m=(f=tS(f)).length,g,y=!1,x,w=new Array(m),S=new Array(m);for(i==null&&(l=o(x=c())),h=0;h<=m;++h){if(!(h<m&&a(g=f[h],h,f))===y)if(y=!y)p=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),v=h-1;v>=p;--v)l.point(w[v],S[v]);l.lineEnd(),l.areaEnd()}y&&(w[h]=+e(g,h,f),S[h]=+t(g,h,f),l.point(n?+n(g,h,f):w[h],r?+r(g,h,f):S[h]))}if(x)return l=null,x+""||null}function d(){return jD().defined(a).curve(o).context(i)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:rt(+f),n=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:rt(+f),u):e},u.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:rt(+f),u):n},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:rt(+f),r=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:rt(+f),u):t},u.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:rt(+f),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:rt(!!f),u):a},u.curve=function(f){return arguments.length?(o=f,i!=null&&(l=o(i)),u):o},u.context=function(f){return arguments.length?(f==null?i=l=null:l=o(i=f),u):i},u}class SD{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 Nre(e){return new SD(e,!0)}function kre(e){return new SD(e,!1)}const rS={draw(e,t){const r=na(t/fm);e.moveTo(r,0),e.arc(0,0,r,0,Nv)}},Ore={draw(e,t){const r=na(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()}},_D=na(1/3),Cre=_D*2,Ere={draw(e,t){const r=na(t/Cre),n=r*_D;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Pre={draw(e,t){const r=na(t),n=-r/2;e.rect(n,n,r,r)}},Are=.8908130915292852,ND=dm(fm/10)/dm(7*fm/10),Tre=dm(Nv/10)*ND,$re=-vD(Nv/10)*ND,Rre={draw(e,t){const r=na(t*Are),n=Tre*r,a=$re*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=Nv*i/5,l=vD(o),c=dm(o);e.lineTo(c*r,-l*r),e.lineTo(l*n-c*a,c*n+l*a)}e.closePath()}},dx=na(3),Mre={draw(e,t){const r=-na(t/(dx*3));e.moveTo(0,r*2),e.lineTo(-dx*r,-r),e.lineTo(dx*r,-r),e.closePath()}},dn=-.5,fn=na(3)/2,Pb=1/na(12),Ire=(Pb/2+1)*3,Dre={draw(e,t){const r=na(t/Ire),n=r/2,a=r*Pb,i=n,o=r*Pb+r,l=-i,c=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(dn*n-fn*a,fn*n+dn*a),e.lineTo(dn*i-fn*o,fn*i+dn*o),e.lineTo(dn*l-fn*c,fn*l+dn*c),e.lineTo(dn*n+fn*a,dn*a-fn*n),e.lineTo(dn*i+fn*o,dn*o-fn*i),e.lineTo(dn*l+fn*c,dn*c-fn*l),e.closePath()}};function Lre(e,t){let r=null,n=eS(a);
vendor: 6,737 bytes, line 608
608e=typeof e=="function"?e:rt(e||rS),t=typeof t=="function"?t:rt(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:rt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:rt(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function hm(){}function pm(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 kD(e){this._context=e}kD.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:pm(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:pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Fre(e){return new kD(e)}function OD(e){this._context=e}OD.prototype={areaStart:hm,areaEnd:hm,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:pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bre(e){return new OD(e)}function CD(e){this._context=e}CD.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:pm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Ure(e){return new CD(e)}function ED(e){this._context=e}ED.prototype={areaStart:hm,areaEnd:hm,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 zre(e){return new ED(e)}function vO(e){return e<0?-1:1}function yO(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),l=(i*a+o*n)/(n+a);return(vO(i)+vO(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function xO(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function fx(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,l=(i-n)/3;e._context.bezierCurveTo(n+l,a+l*t,i-l,o-l*r,i,o)}function mm(e){this._context=e}mm.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:fx(this,this._t0,xO(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,fx(this,xO(this,r=yO(this,e,t)),r);break;default:fx(this,this._t0,r=yO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function PD(e){this._context=new AD(e)}(PD.prototype=Object.create(mm.prototype)).point=function(e,t){mm.prototype.point.call(this,t,e)};function AD(e){this._context=e}AD.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,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function qre(e){return new mm(e)}function Wre(e){return new PD(e)}function TD(e){this._context=e}TD.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=bO(e),a=bO(t),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],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 bO(e){var t,r=e.length-1,n,a=new Array(r),i=new Array(r),o=new Array(r);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,i[r-1]=7,o[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=a[t]/i[t-1],i[t]-=n,o[t]-=n*o[t-1];for(a[r-1]=o[r-1]/i[r-1],t=r-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function Hre(e){return new TD(e)}function Ov(e,t){this._context=e,this._t=t}Ov.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;
vendor: 9,187 bytes, lines 608-611
608default:{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 Vre(e){return new Ov(e,.5)}function Kre(e){return new Ov(e,0)}function Gre(e){return new Ov(e,1)}function nc(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,l=i.length;r<o;++r)for(a=i,i=e[t[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function Ab(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Yre(e,t){return e[t]}function Xre(e){const t=[];return t.key=e,t}function Qre(){var e=rt([]),t=Ab,r=nc,n=Yre;function a(i){var o=Array.from(e.apply(this,arguments),Xre),l,c=o.length,u=-1,d;for(const f of i)for(l=0,++u;l<c;++l)(o[l][u]=[0,+n(f,o[l].key,u,i)]).data=f;for(l=0,d=tS(t(o));l<c;++l)o[d[l]].index=l;return r(o,d),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:rt(Array.from(i)),a):e},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:rt(+i),a):n},a.order=function(i){return arguments.length?(t=i==null?Ab:typeof i=="function"?i:rt(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(r=i??nc,a):r},a}function Jre(e,t){if((n=e.length)>0){for(var r,n,a=0,i=e[0].length,o;a<i;++a){for(o=r=0;r<n;++r)o+=e[r][a][1]||0;if(o)for(r=0;r<n;++r)e[r][a][1]/=o}nc(e,t)}}function Zre(e,t){if((a=e.length)>0){for(var r=0,n=e[t[0]],a,i=n.length;r<i;++r){for(var o=0,l=0;o<a;++o)l+=e[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}nc(e,t)}}function ene(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,o;n<i;++n){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[n][1]||0,h=d[n-1][1]||0,p=(f-h)/2,v=0;v<l;++v){var m=e[t[v]],g=m[n][1]||0,y=m[n-1][1]||0;p+=g-y}c+=f,u+=p*f}a[n-1][1]+=a[n-1][0]=r,c&&(r-=u/c)}a[n-1][1]+=a[n-1][0]=r,nc(e,t)}}function Bd(e){"@babel/helpers - typeof";return Bd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bd(e)}var tne=["type","size","sizeType"];function Tb(){return Tb=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},Tb.apply(this,arguments)}function wO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function jO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wO(Object(r),!0).forEach(function(n){rne(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rne(e,t,r){return t=nne(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nne(e){var t=ane(e,"string");return Bd(t)=="symbol"?t:t+""}function ane(e,t){if(Bd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Bd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ine(e,t){if(e==null)return{};var r=sne(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var $D={symbolCircle:rS,symbolCross:Ore,symbolDiamond:Ere,symbolSquare:Pre,symbolStar:Rre,symbolTriangle:Mre,symbolWye:Dre},one=Math.PI/180,lne=function(t){var r="symbol".concat(_v(t));return $D[r]||rS},cne=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*one;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},une=function(t,r){$D["symbol".concat(_v(t))]=r},nS=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,o=t.sizeType,l=o===void 0?"area":o,c=ine(t,tne),u=jO(jO({},c),{},{type:n,size:i,sizeType:l}),d=function(){var g=lne(n),y=Lre().type(g).size(cne(i,l,n));return y()},f=u.className,h=u.cx,p=u.cy,v=_e(u,!0);return h===+h&&p===+p&&i===+i?C.createElement("path",Tb({},v,{className:Te("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(p,")"),d:d()})):null};nS.registerSymbol=une;function ac(e){"@babel/helpers - typeof";return ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ac(e)}function $b(){return $b=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},$b.apply(this,arguments)}function SO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function dne(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?SO(Object(r),!0).forEach(function(n){Ud(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function hne(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,MD(n.key),n)}}function pne(e,t,r){return t&&hne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function mne(e,t,r){return t=gm(t),gne(e,RD()?Reflect.construct(t,r||[],gm(e).constructor):t.apply(e,r))}function gne(e,t){if(t&&(ac(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vne(e)}function vne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RD=function(){return!!e})()}function gm(e){return gm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},gm(e)}function yne(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rb(e,t)}function Rb(e,t){return Rb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Rb(e,t)}function Ud(e,t,r){return t=MD(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MD(e){var t=xne(e,"string");return ac(t)=="symbol"?t:t+""}function xne(e,t){if(ac(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ac(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hn=32,aS=function(e){function t(){return fne(this,t),mne(this,t,arguments)}return yne(t,e),pne(t,[{key:"renderIcon",value:function(n){var a=this.props.inactiveColor,i=hn/2,o=hn/6,l=hn/3,c=n.inactive?a:n.color;if(n.type==="plainline")return C.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:hn,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return C.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
609            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(i,`
610            H`).concat(hn,"M").concat(2*l,",").concat(i,`
611            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return C.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(hn/8,"h").concat(hn,"v").concat(hn*3/4,"h").concat(-hn,"z"),className:"recharts-legend-icon"});if(C.isValidElement(n.legendIcon)){var u=dne({},n);return delete u.legendIcon,C.cloneElement(n.legendIcon,u)}return C.createElement(nS,{fill:c,cx:i,cy:i,size:hn,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,a=this.props,i=a.payload,o=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,d={x:0,y:0,width:hn,height:hn}
611,f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(p,v){var m=p.formatter||c,g=Te(Ud(Ud({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",p.inactive));if(p.type==="none")return null;var y=ke(p.value)?null:p.value;Xn(!ke(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var x=p.inactive?u:p.color;return C.createElement("li",$b({className:g,style:f,key:"legend-item-".concat(v)},po(n.props,p,v)),C.createElement(_b,{width:o,height:o,viewBox:d,style:h},n.renderIcon(p)),C.createElement("span",{className:"recharts-legend-item-text",style:{color:x}},m?m(y,p,v):y))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return C.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(b.PureComponent);Ud(aS,"displayName","Legend");Ud(aS,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var bne=dv;function wne(){this.__data__=new bne,this.size=0}var jne=wne;function Sne(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var _ne=Sne;function Nne(e){return this.__data__.get(e)}var kne=Nne;function One(e){return this.__data__.has(e)}var Cne=One,Ene=dv,Pne=Hj,Ane=Vj,Tne=200;function $ne(e,t){var r=this.__data__;if(r instanceof Ene){var n=r.__data__;if(!Pne||n.length<Tne-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ane(n)}return r.set(e,t),this.size=r.size,this}var Rne=$ne,Mne=dv,Ine=jne,Dne=_ne,Lne=kne,Fne=Cne,Bne=Rne;function Xc(e){var t=this.__data__=new Mne(e);this.size=t.size}Xc.prototype.clear=Ine;Xc.prototype.delete=Dne;Xc.prototype.get=Lne;Xc.prototype.has=Fne;Xc.prototype.set=Bne;var ID=Xc,Une="__lodash_hash_undefined__";function zne(e){return this.__data__.set(e,Une),this}var qne=zne;function Wne(e){return this.__data__.has(e)}var Hne=Wne,Vne=Vj,Kne=qne,Gne=Hne;function vm(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Vne;++t<r;)this.add(e[t])}vm.prototype.add=vm.prototype.push=Kne;vm.prototype.has=Gne;var DD=vm;function Yne(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var LD=Yne;function Xne(e,t){return e.has(t)}var FD=Xne,Qne=DD,Jne=LD,Zne=FD,eae=1,tae=2;function rae(e,t,r,n,a,i){var o=r&eae,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,p=r&tae?new Qne:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var v=e[f],m=t[f];if(n)var g=o?n(m,v,f,t,e,i):n(v,m,f,e,t,i);if(g!==void 0){if(g)continue;h=!1;break}if(p){if(!Jne(t,function(y,x){if(!Zne(p,x)&&(v===y||a(v,y,r,n,i)))return p.push(x)})){h=!1;break}}else if(!(v===m||a(v,m,r,n,i))){h=!1;break}}return i.delete(e),i.delete(t),h}var BD=rae,nae=Ea,aae=nae.Uint8Array,iae=aae;function sae(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}var oae=sae;function lae(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var iS=lae,_O=zf,NO=iae,cae=Wj,uae=BD,dae=oae,fae=iS,hae=1,pae=2,mae="[object Boolean]",gae="[object Date]",vae="[object Error]",yae="[object Map]",xae="[object Number]",bae="[object RegExp]",wae="[object Set]",jae="[object String]",Sae="[object Symbol]",_ae="[object ArrayBuffer]",Nae="[object DataView]",kO=_O?_O.prototype:void 0,hx=kO?kO.valueOf:void 0;function kae(e,t,r,n,a,i,o){switch(r){case Nae:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _ae:return!(e.byteLength!=t.byteLength||!i(new NO(e),new NO(t)));case mae:case gae:case xae:return cae(+e,+t);case vae:return e.name==t.name&&e.message==t.message;case bae:case jae:return e==t+"";case yae:var l=dae;case wae:var c=n&hae;if(l||(l=fae),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;n|=pae,o.set(e,t);var d=uae(l(e),l(t),n,a,i,o);return o.delete(e),d;
vendor: 5,630 bytes, line 611
611case Sae:if(hx)return hx.call(e)==hx.call(t)}return!1}var Oae=kae;function Cae(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}var UD=Cae,Eae=UD,Pae=zr;function Aae(e,t,r){var n=t(e);return Pae(e)?n:Eae(n,r(e))}var Tae=Aae;function $ae(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[a++]=o)}return i}var Rae=$ae;function Mae(){return[]}var Iae=Mae,Dae=Rae,Lae=Iae,Fae=Object.prototype,Bae=Fae.propertyIsEnumerable,OO=Object.getOwnPropertySymbols,Uae=OO?function(e){return e==null?[]:(e=Object(e),Dae(OO(e),function(t){return Bae.call(e,t)}))}:Lae,zae=Uae;function qae(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Wae=qae,Hae=fi,Vae=hi,Kae="[object Arguments]";function Gae(e){return Vae(e)&&Hae(e)==Kae}var Yae=Gae,CO=Yae,Xae=hi,zD=Object.prototype,Qae=zD.hasOwnProperty,Jae=zD.propertyIsEnumerable,Zae=CO(function(){return arguments}())?CO:function(e){return Xae(e)&&Qae.call(e,"callee")&&!Jae.call(e,"callee")},sS=Zae,ym={exports:{}};function eie(){return!1}var tie=eie;ym.exports;(function(e,t){var r=Ea,n=tie,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;e.exports=u})(ym,ym.exports);var qD=ym.exports,rie=9007199254740991,nie=/^(?:0|[1-9]\d*)$/;function aie(e,t){var r=typeof e;return t=t??rie,!!t&&(r=="number"||r!="symbol"&&nie.test(e))&&e>-1&&e%1==0&&e<t}var oS=aie,iie=9007199254740991;function sie(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=iie}var lS=sie,oie=fi,lie=lS,cie=hi,uie="[object Arguments]",die="[object Array]",fie="[object Boolean]",hie="[object Date]",pie="[object Error]",mie="[object Function]",gie="[object Map]",vie="[object Number]",yie="[object Object]",xie="[object RegExp]",bie="[object Set]",wie="[object String]",jie="[object WeakMap]",Sie="[object ArrayBuffer]",_ie="[object DataView]",Nie="[object Float32Array]",kie="[object Float64Array]",Oie="[object Int8Array]",Cie="[object Int16Array]",Eie="[object Int32Array]",Pie="[object Uint8Array]",Aie="[object Uint8ClampedArray]",Tie="[object Uint16Array]",$ie="[object Uint32Array]",ct={};ct[Nie]=ct[kie]=ct[Oie]=ct[Cie]=ct[Eie]=ct[Pie]=ct[Aie]=ct[Tie]=ct[$ie]=!0;ct[uie]=ct[die]=ct[Sie]=ct[fie]=ct[_ie]=ct[hie]=ct[pie]=ct[mie]=ct[gie]=ct[vie]=ct[yie]=ct[xie]=ct[bie]=ct[wie]=ct[jie]=!1;function Rie(e){return cie(e)&&lie(e.length)&&!!ct[oie(e)]}var Mie=Rie;function Iie(e){return function(t){return e(t)}}var WD=Iie,xm={exports:{}};xm.exports;(function(e,t){var r=JI,n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(xm,xm.exports);var Die=xm.exports,Lie=Mie,Fie=WD,EO=Die,PO=EO&&EO.isTypedArray,Bie=PO?Fie(PO):Lie,HD=Bie,Uie=Wae,zie=sS,qie=zr,Wie=qD,Hie=oS,Vie=HD,Kie=Object.prototype,Gie=Kie.hasOwnProperty;function Yie(e,t){var r=qie(e),n=!r&&zie(e),a=!r&&!n&&Wie(e),i=!r&&!n&&!a&&Vie(e),o=r||n||a||i,l=o?Uie(e.length,String):[],c=l.length;for(var u in e)(t||Gie.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Hie(u,c)))&&l.push(u);return l}var Xie=Yie,Qie=Object.prototype;function Jie(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Qie;return e===r}var Zie=Jie;function ese(e,t){return function(r){return e(t(r))}}var VD=ese,tse=VD,rse=tse(Object.keys,Object),nse=rse,ase=Zie,ise=nse,sse=Object.prototype,ose=sse.hasOwnProperty;function lse(e){if(!ase(e))return ise(e);var t=[];for(var r in Object(e))ose.call(e,r)&&r!="constructor"&&t.push(r);return t}var cse=lse,use=qj,dse=lS;function fse(e){return e!=null&&dse(e.length)&&!use(e)}var Hf=fse,hse=Xie,pse=cse,mse=Hf;function gse(e){return mse(e)?hse(e):pse(e)}var Cv=gse,vse=Tae,yse=zae,xse=Cv;function bse(e){return vse(e,xse,yse)}var wse=bse,AO=wse,jse=1,Sse=Object.prototype,_se=Sse.hasOwnProperty;function Nse(e,t,r,n,a,i){var o=r&jse,l=AO(e),c=l.length,u=AO(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:_se.call(t,h)))return!1}var p=i.get(e),v=i.get(t);if(p&&v)return p==t&&v==e;var m=!0;i.set(e,t),i.set(t,e);for(var g=o;++f<c;){h=l[f];var y=e[h],x=t[h];if(n)var w=o?n(x,y,h,t,e,i):n(y,x,h,e,t,i);if(!(w===void 0?y===x||a(y,x,r,n,i):w)){m=!1;break}g||(g=h=="constructor")}if(m&&!g){var S=e.constructor,j=t.constructor;S!=j&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof j=="function"&&j instanceof j)&&(m=!1)}return i.delete(e),i.delete(t),m}var kse=Nse,Ose=So,Cse=Ea,Ese=Ose(Cse,"DataView"),Pse=Ese,Ase=So,Tse=Ea,$se=Ase(Tse,"Promise"),Rse=$se,Mse=So,Ise=Ea,Dse=Mse(Ise,"Set"),KD=Dse,Lse=So,Fse=Ea,Bse=Lse(Fse,"WeakMap"),Use=Bse,Mb=Pse,Ib=Hj,Db=Rse,Lb=KD,Fb=Use,GD=fi,Qc=eD,TO="[object Map]",zse="[object Object]",$O="[object Promise]",RO="[object Set]",MO="[object WeakMap]",IO="[object DataView]",qse=Qc(Mb),Wse=Qc(Ib),Hse=Qc(Db),Vse=Qc(Lb),Kse=Qc(Fb),Es=GD;(Mb&&Es(new Mb(new ArrayBuffer(1)))!=IO||Ib&&Es(new Ib)!=TO||Db&&Es(Db.resolve())!=$O||Lb&&Es(new Lb)!=RO||Fb&&Es(new Fb)!=MO)&&(Es=function(e){var t=GD(e),r=t==zse?e.constructor:void 0,n=r?Qc(r):"";if(n)switch(n){case qse:return IO;case Wse:return TO;case Hse:return $O;case Vse:return RO;case Kse:return MO}return t});var Gse=Es,px=ID,Yse=BD,Xse=Oae,Qse=kse,DO=Gse,LO=zr,FO=qD,Jse=HD,Zse=1,BO="[object Arguments]",UO="[object Array]",Ih="[object Object]",eoe=Object.prototype,zO=eoe.hasOwnProperty;function toe(e,t,r,n,a,i){var o=LO(e),l=LO(t),c=o?UO:DO(e),u=l?UO:DO(t);c=c==BO?Ih:c,u=u==BO?Ih:u;var d=c==Ih,f=u==Ih,h=c==u;if(h&&FO(e)){if(!FO(t))return!1;o=!0,d=!1}
vendor: 4,093 bytes, line 611
611if(h&&!d)return i||(i=new px),o||Jse(e)?Yse(e,t,r,n,a,i):Xse(e,t,c,r,n,a,i);if(!(r&Zse)){var p=d&&zO.call(e,"__wrapped__"),v=f&&zO.call(t,"__wrapped__");if(p||v){var m=p?e.value():e,g=v?t.value():t;return i||(i=new px),a(m,g,r,n,i)}}return h?(i||(i=new px),Qse(e,t,r,n,a,i)):!1}var roe=toe,noe=roe,qO=hi;function YD(e,t,r,n,a){return e===t?!0:e==null||t==null||!qO(e)&&!qO(t)?e!==e&&t!==t:noe(e,t,r,n,YD,a)}var cS=YD,aoe=ID,ioe=cS,soe=1,ooe=2;function loe(e,t,r,n){var a=r.length,i=a,o=!n;if(e==null)return!i;for(e=Object(e);a--;){var l=r[a];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<i;){l=r[a];var c=l[0],u=e[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new aoe;if(n)var h=n(u,d,c,e,t,f);if(!(h===void 0?ioe(d,u,soe|ooe,n,f):h))return!1}}return!0}var coe=loe,uoe=hs;function doe(e){return e===e&&!uoe(e)}var XD=doe,foe=XD,hoe=Cv;function poe(e){for(var t=hoe(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,foe(a)]}return t}var moe=poe;function goe(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var QD=goe,voe=coe,yoe=moe,xoe=QD;function boe(e){var t=yoe(e);return t.length==1&&t[0][2]?xoe(t[0][0],t[0][1]):function(r){return r===e||voe(r,e,t)}}var woe=boe;function joe(e,t){return e!=null&&t in Object(e)}var Soe=joe,_oe=iD,Noe=sS,koe=zr,Ooe=oS,Coe=lS,Eoe=hv;function Poe(e,t,r){t=_oe(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var o=Eoe(t[n]);if(!(i=e!=null&&r(e,o)))break;e=e[o]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&Coe(a)&&Ooe(o,a)&&(koe(e)||Noe(e)))}var Aoe=Poe,Toe=Soe,$oe=Aoe;function Roe(e,t){return e!=null&&$oe(e,t,Toe)}var Moe=Roe,Ioe=cS,Doe=sD,Loe=Moe,Foe=zj,Boe=XD,Uoe=QD,zoe=hv,qoe=1,Woe=2;function Hoe(e,t){return Foe(e)&&Boe(t)?Uoe(zoe(e),t):function(r){var n=Doe(r,e);return n===void 0&&n===t?Loe(r,e):Ioe(t,n,qoe|Woe)}}var Voe=Hoe;function Koe(e){return e}var Jc=Koe;function Goe(e){return function(t){return t==null?void 0:t[e]}}var Yoe=Goe,Xoe=Yj;function Qoe(e){return function(t){return Xoe(t,e)}}var Joe=Qoe,Zoe=Yoe,ele=Joe,tle=zj,rle=hv;function nle(e){return tle(e)?Zoe(rle(e)):ele(e)}var ale=nle,ile=woe,sle=Voe,ole=Jc,lle=zr,cle=ale;function ule(e){return typeof e=="function"?e:e==null?ole:typeof e=="object"?lle(e)?sle(e[0],e[1]):ile(e):cle(e)}var Pa=ule;function dle(e,t,r,n){for(var a=e.length,i=r+(n?1:-1);n?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var JD=dle;function fle(e){return e!==e}var hle=fle;function ple(e,t,r){for(var n=r-1,a=e.length;++n<a;)if(e[n]===t)return n;return-1}var mle=ple,gle=JD,vle=hle,yle=mle;function xle(e,t,r){return t===t?yle(e,t,r):gle(e,vle,r)}var ble=xle,wle=ble;function jle(e,t){var r=e==null?0:e.length;return!!r&&wle(e,t,0)>-1}var Sle=jle;function _le(e,t,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(t,e[n]))return!0;return!1}var Nle=_le;function kle(){}var Ole=kle,mx=KD,Cle=Ole,Ele=iS,Ple=1/0,Ale=mx&&1/Ele(new mx([,-0]))[1]==Ple?function(e){return new mx(e)}:Cle,Tle=Ale,$le=DD,Rle=Sle,Mle=Nle,Ile=FD,Dle=Tle,Lle=iS,Fle=200;function Ble(e,t,r){var n=-1,a=Rle,i=e.length,o=!0,l=[],c=l;if(r)o=!1,a=Mle;else if(i>=Fle){var u=t?null:Dle(e);if(u)return Lle(u);o=!1,a=Ile,c=new $le}else c=t?[]:l;e:for(;++n<i;){var d=e[n],f=t?t(d):d;if(d=r||d!==0?d:0,o&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),l.push(d)}else a(c,f,r)||(c!==l&&c.push(f),l.push(d))}return l}var Ule=Ble,zle=Pa,qle=Ule;function Wle(e,t){return e&&e.length?qle(e,zle(t)):[]}var Hle=Wle;const WO=qe(Hle);function ZD(e,t,r){return t===!0?WO(e,r):ke(t)?WO(e,t):e}function ic(e){"@babel/helpers - typeof";return ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ic(e)}var Vle=["ref"];function HO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ta(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
vendor: 4,101 bytes, line 611
611t%2?HO(Object(r),!0).forEach(function(n){Ev(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kle(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VO(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t4(n.key),n)}}function Gle(e,t,r){return t&&VO(e.prototype,t),r&&VO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yle(e,t,r){return t=bm(t),Xle(e,e4()?Reflect.construct(t,r||[],bm(e).constructor):t.apply(e,r))}function Xle(e,t){if(t&&(ic(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qle(e)}function Qle(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(e4=function(){return!!e})()}function bm(e){return bm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bm(e)}function Jle(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bb(e,t)}function Bb(e,t){return Bb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Bb(e,t)}function Ev(e,t,r){return t=t4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t4(e){var t=Zle(e,"string");return ic(t)=="symbol"?t:t+""}function Zle(e,t){if(ic(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ic(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ece(e,t){if(e==null)return{};var r=tce(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tce(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function rce(e){return e.value}function nce(e,t){if(C.isValidElement(e))return C.cloneElement(e,t);if(typeof e=="function")return C.createElement(e,t);t.ref;var r=ece(t,Vle);return C.createElement(aS,r)}var KO=1,Pl=function(e){function t(){var r;Kle(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=Yle(this,t,[].concat(a)),Ev(r,"lastBoundingBox",{width:-1,height:-1}),r}return Jle(t,e),Gle(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>KO||Math.abs(a.height-this.lastBoundingBox.height)>KO)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ta({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,d=a.chartHe
611ight,f,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();f={left:((u||0)-p.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var v=this.getBBoxSnapshot();h={top:((d||0)-v.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ta(Ta({},f),h)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=Ta(Ta({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return C.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(p){n.wrapperNode=p}},nce(i,Ta(Ta({},this.props),{},{payload:ZD(d,u,rce)})))}}],[{key:"getWithHeight",value:function(n,a){var i=Ta(Ta({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&ae(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])}(b.PureComponent);Ev(Pl,"displayName","Legend");Ev(Pl,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var GO=zf,ace=sS,ice=zr,YO=GO?GO.isConcatSpreadable:void 0;function sce(e){return ice(e)||ace(e)||!!(YO&&e&&e[YO])}var oce=sce,lce=UD,cce=oce;function r4(e,t,r,n,a){var i=-1,o=e.length;for(r||(r=cce),a||(a=[]);++i<o;){var l=e[i];t>0&&r(l)?t>1?r4(l,t-1,r,n,a):lce(a,l):n||(a[a.length]=l)}return a}var n4=r4;function uce(e){return function(t,r,n){for(var a=-1,i=Object(t),o=n(t),l=o.length;l--;){var c=o[e?l:++a];if(r(i[c],c,i)===!1)break}return t}}var dce=uce,fce=dce,hce=fce(),pce=hce,mce=pce,gce=Cv;function vce(e,t){return e&&mce(e,t,gce)}var a4=vce,yce=Hf;function xce(e,t){return function(r,n){if(r==null)return r;if(!yce(r))return e(r,n);for(var a=r.length,i=t?a:-1,o=Object(r);(t?i--:++i<a)&&n(o[i],i,o)!==!1;);return r}}var bce=xce,wce=a4,jce=bce,Sce=jce(wce),uS=Sce,_ce=uS,Nce=Hf;function kce(e,t){var r=-1,n=Nce(e)?Array(e.length):[];return _ce(e,function(a,i,o){n[++r]=t(a,i,o)}),n}var i4=kce;function Oce(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}var Cce=Oce,XO=Hc;function Ece(e,t){if(e!==t){var r=e!==void 0,n=e===null,a=e===e,i=XO(e),o=t!==void 0,l=t===null,c=t===t,u=XO(t);if(!l&&!u&&!i&&e>t||i&&o&&c&&!l&&!u||n&&o&&c||!r&&c||!a)return 1;if(!n&&!i&&!u&&e<t||u&&r&&a&&!n&&!i||l&&r&&a||!o&&a||!c)return-1}return 0}var Pce=Ece,Ace=Pce;function Tce(e,t,r){for(var n=-1,a=e.criteria,i=t.criteria,o=a.length,l=r.length;++n<o;){var c=Ace(a[n],i[n]);if(c){if(n>=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}var $ce=Tce,gx=Gj,Rce=Yj,Mce=Pa,Ice=i4,Dce=Cce,Lce=WD,Fce=$ce,Bce=Jc,Uce=zr;function zce(e,t,r){t.length?t=gx(t,function(i){return Uce(i)?function(o){return Rce(o,i.length===1?i[0]:i)}:i}):t=[Bce];var n=-1;t=gx(t,Lce(Mce));var a=Ice(e,function(i,o,l){var c=gx(t,function(u){return u(i)});return{criteria:c,index:++n,value:i}});return Dce(a,function(i,o){return Fce(i,o,r)})}var qce=zce;function Wce(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Hce=Wce,Vce=Hce,QO=Math.max;function Kce(e,t,r){return t=QO(t===void 0?e.length-1:t,0),function(){for(var n=arguments,a=-1,i=QO(n.length-t,0),o=Array(i);++a<i;)o[a]=n[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=n[a];return l[t]=r(o),Vce(e,this,l)}}var Gce=Kce;function Yce(e){return function(){return e}}var Xce=Yce,Qce=So,Jce=function(){try{var e=Qce(Object,"defineProperty");return e({},"",{}),e}catch{}}(),s4=Jce,Zce=Xce,JO=s4,eue=Jc,tue=JO?function(e,t){return JO(e,"toString",{configurable:!0,enumerable:!1,value:Zce(t),writable:!0})}:eue,rue=tue,nue=800,aue=16,iue=Date.now;function sue(e){var t=0,r=0;return function(){var n=iue(),a=aue-(n-r);if(r=n,a>0){if(++t>=nue)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var oue=sue,lue=rue,cue=oue,uue=cue(lue),due=uue,fue=Jc,hue=Gce,pue=due;function mue(e,t){return pue(hue(e,t,fue),e+"")}var gue=mue,vue=Wj,yue=Hf,xue=oS,bue=hs;function wue(e,t,r){if(!bue(r))return!1;var n=typeof t;return(n=="number"?yue(r)&&xue(t,r.length):n=="string"&&t in r)?vue(r[t],e):!1}var Pv=wue,jue=n4,Sue=qce,_ue=gue,ZO=Pv,Nue=_ue(function(e,t){if(e==null)return[];var r=t.length;return r>1&&ZO(e,t[0],t[1])?t=[]:r>2&&ZO(t[0],t[1],t[2])&&(t=[t[0]]),Sue(e,jue(t,1),[])}),kue=Nue;const dS=qe(kue);function zd(e){"@babel/helpers - typeof";return zd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zd(e)}function Ub(){return Ub=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
vendor: 29,151 bytes, lines 611-618
611for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ub.apply(this,arguments)}function Oue(e,t){return Aue(e)||Pue(e,t)||Eue(e,t)||Cue()}function Cue(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
612In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Eue(e,t){if(e){if(typeof e=="string")return eC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eC(e,t)}}function eC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Pue(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Aue(e){if(Array.isArray(e))return e}function tC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function vx(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tC(Object(r),!0).forEach(function(n){Tue(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tue(e,t,r){return t=$ue(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $ue(e){var t=Rue(e,"string");return zd(t)=="symbol"?t:t+""}function Rue(e,t){if(zd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(zd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mue(e){return Array.isArray(e)&&Lt(e[0])&&Lt(e[1])?e.join(" ~ "):e}var Iue=function(t){var r=t.separator,n=r===void 0?" : ":r,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,p=t.wrapperClassName,v=t.labelClassName,m=t.label,g=t.labelFormatter,y=t.accessibilityLayer,x=y===void 0?!1:y,w=function(){if(d&&d.length){var R={padding:0,margin:0},T=(h?dS(d,h):d).map(function(I,F){if(I.type==="none")return null;var P=vx({display:"block",paddingTop:4,paddingBottom:4,color:I.color||"#000"},l),D=I.formatter||f||Mue,M=I.value,$=I.name,z=M,K=$;if(D&&z!=null&&K!=null){var q=D(M,$,I,F,d);if(Array.isArray(q)){var B=Oue(q,2);z=B[0],K=B[1]}else z=q}return C.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(F),style:P},Lt(K)?C.createElement("span",{className:"recharts-tooltip-item-name"},K):null,Lt(K)?C.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,C.createElement("span",{className:"recharts-tooltip-item-value"},z),C.createElement("span",{className:"recharts-tooltip-item-unit"},I.unit||""))});return C.createElement("ul",{className:"recharts-tooltip-item-list",style:R},T)}return null},S=vx({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),j=vx({margin:0},u),_=!$e(m),N=_?m:"",k=Te("recharts-default-tooltip",p),O=Te("recharts-tooltip-label",v);_&&g&&d!==void 0&&d!==null&&(N=g(m,d));var E=x?{role:"status","aria-live":"assertive"}:{};return C.createElement("div",Ub({className:k,style:S},E),C.createElement("p",{className:O,style:j},C.isValidElement(N)?N:"".concat(N)),w())};function qd(e){"@babel/helpers - typeof";return qd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qd(e)}function Dh(e,t,r){return t=Due(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Due(e){var t=Lue(e,"string");return qd(t)=="symbol"?t:t+""}function Lue(e,t){if(qd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(qd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vu="recharts-tooltip-wrapper",Fue={visibility:"hidden"};function Bue(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return Te(vu,Dh(Dh(Dh(Dh({},"".concat(vu,"-right"),ae(r)&&t&&ae(t.x)&&r>=t.x),"".concat(vu,"-left"),ae(r)&&t&&ae(t.x)&&r<t.x),"".concat(vu,"-bottom"),ae(n)&&t&&ae(t.y)&&n>=t.y),"".concat(vu,"-top"),ae(n)&&t&&ae(t.y)&&n<t.y))}function rC(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,a=e.offsetTopLeft,i=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(i&&ae(i[n]))return i[n];var d=r[n]-l-a,f=r[n]+a;if(t[n])return o[n]?d:f;if(o[n]){var h=d,p=c[n];return h<p?Math.max(f,c[n]):Math.max(d,c[n])}var v=f+l,m=c[n]+u;return v>m?Math.max(d,c[n]):Math.max(f,c[n])}function Uue(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function zue(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&r?(d=rC({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=rC({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=Uue({translateX:d,translateY:f,useTranslate3d:l})):u=Fue,{cssProperties:u,cssClasses:Bue({translateX:d,translateY:f,coordinate:r})}}function sc(e){"@babel/helpers - typeof";return sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sc(e)}function nC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function aC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nC(Object(r),!0).forEach(function(n){qb(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function que(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l4(n.key),n)}}function Hue(e,t,r){return t&&Wue(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Vue(e,t,r){return t=wm(t),Kue(e,o4()?Reflect.construct(t,r||[],wm(e).constructor):t.apply(e,r))}function Kue(e,t){if(t&&(sc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gue(e)}function Gue(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function o4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(o4=function(){return!!e})()}function wm(e){return wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wm(e)}function Yue(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zb(e,t)}function zb(e,t){return zb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},zb(e,t)}function qb(e,t,r){return t=l4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l4(e){var t=Xue(e,"string");return sc(t)=="symbol"?t:t+""}function Xue(e,t){if(sc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(sc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iC=1,Que=function(e){function t(){var r;que(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=Vue(this,t,[].concat(a)),qb(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),qb(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),r}return Yue(t,e),Hue(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>iC||Math.abs(n.height-this.state.lastBoundingBox.height)>iC)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,h=a.isAnimationActive,p=a.offset,v=a.position,m=a.reverseDirection,g=a.useTranslate3d,y=a.viewBox,x=a.wrapperStyle,w=zue({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:v,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:y}),S=w.cssClasses,j=w.cssProperties,_=aC(aC({transition:h&&i?"transform ".concat(l,"ms ").concat(c):void 0},j),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&f?"visible":"hidden",position:"absolute",top:0,left:0},x);return C.createElement("div",{tabIndex:-1,className:S,style:_,ref:function(k){n.wrapperNode=k}},u)}}])}(b.PureComponent),Jue=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ga={isSsr:Jue(),get:function(t){return Ga[t]},set:function(t,r){if(typeof t=="string")Ga[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(a){Ga[a]=t[a]})}}};function oc(e){"@babel/helpers - typeof";return oc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oc(e)}function sC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function oC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?sC(Object(r),!0).forEach(function(n){fS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ede(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u4(n.key),n)}}function tde(e,t,r){return t&&ede(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rde(e,t,r){return t=jm(t),nde(e,c4()?Reflect.construct(t,r||[],jm(e).constructor):t.apply(e,r))}function nde(e,t){if(t&&(oc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ade(e)}function ade(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(c4=function(){return!!e})()}function jm(e){return jm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jm(e)}function ide(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wb(e,t)}function Wb(e,t){return Wb=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Wb(e,t)}function fS(e,t,r){return t=u4(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u4(e){var t=sde(e,"string");return oc(t)=="symbol"?t:t+""}function sde(e,t){if(oc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(oc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ode(e){return e.dataKey}function lde(e,t){return C.isValidElement(e)?C.cloneElement(e,t):typeof e=="function"?C.createElement(e,t):C.createElement(Iue,t)}var zt=function(e){function t(){return Zue(this,t),rde(this,t,arguments)}return ide(t,e),tde(t,[{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,d=a.coordinate,f=a.filterNull,h=a.isAnimationActive,p=a.offset,v=a.payload,m=a.payloadUniqBy,g=a.position,y=a.reverseDirection,x=a.useTranslate3d,w=a.viewBox,S=a.wrapperStyle,j=v??[];f&&j.length&&(j=ZD(v.filter(function(N){return N.value!=null&&(N.hide!==!0||n.props.includeHidden)}),m,ode));var _=j.length>0;return C.createElement(Que,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:i,coordinate:d,hasPayload:_,offset:p,position:g,reverseDirection:y,useTranslate3d:x,viewBox:w,wrapperStyle:S},lde(u,oC(oC({},this.props),{},{payload:j})))}}])}(b.PureComponent);fS(zt,"displayName","Tooltip");fS(zt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ga.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var cde=Ea,ude=function(){return cde.Date.now()},dde=ude,fde=/\s/;function hde(e){for(var t=e.length;t--&&fde.test(e.charAt(t)););return t}var pde=hde,mde=pde,gde=/^\s+/;function vde(e){return e&&e.slice(0,mde(e)+1).replace(gde,"")}var yde=vde,xde=yde,lC=hs,bde=Hc,cC=NaN,wde=/^[-+]0x[0-9a-f]+$/i,jde=/^0b[01]+$/i,Sde=/^0o[0-7]+$/i,_de=parseInt;function Nde(e){if(typeof e=="number")return e;if(bde(e))return cC;if(lC(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=lC(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=xde(e);var r=jde.test(e);return r||Sde.test(e)?_de(e.slice(2),r?2:8):wde.test(e)?cC:+e}var d4=Nde,kde=hs,yx=dde,uC=d4,Ode="Expected a function",Cde=Math.max,Ede=Math.min;function Pde(e,t,r){var n,a,i,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(Ode);t=uC(t)||0,kde(r)&&(d=!!r.leading,f="maxWait"in r,i=f?Cde(uC(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h);function p(_){var N=n,k=a;return n=a=void 0,u=_,o=e.apply(k,N),o}function v(_){return u=_,l=setTimeout(y,t),d?p(_):o}function m(_){var N=_-c,k=_-u,O=t-N;return f?Ede(O,i-k):O}function g(_){var N=_-c,k=_-u;return c===void 0||N>=t||N<0||f&&k>=i}function y(){var _=yx();if(g(_))return x(_);l=setTimeout(y,m(_))}function x(_){return l=void 0,h&&n?p(_):(n=a=void 0,o)}function w(){l!==void 0&&clearTimeout(l),u=0,n=c=a=l=void 0}function S(){return l===void 0?o:x(yx())}function j(){var _=yx(),N=g(_);if(n=arguments,a=this,c=_,N){if(l===void 0)return v(c);if(f)return clearTimeout(l),l=setTimeout(y,t),p(c)}return l===void 0&&(l=setTimeout(y,t)),o}return j.cancel=w,j.flush=S,j}var Ade=Pde,Tde=Ade,$de=hs,Rde="Expected a function";function Mde(e,t,r){var n=!0,a=!0;if(typeof e!="function")throw new TypeError(Rde);return $de(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),Tde(e,t,{leading:n,maxWait:t,trailing:a})}var Ide=Mde;const f4=qe(Ide);function Wd(e){"@babel/helpers - typeof";return Wd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wd(e)}function dC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Lh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dC(Object(r),!0).forEach(function(n){Dde(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dde(e,t,r){return t=Lde(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lde(e){var t=Fde(e,"string");return Wd(t)=="symbol"?t:t+""}function Fde(e,t){if(Wd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Wd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bde(e,t){return Wde(e)||qde(e,t)||zde(e,t)||Ude()}function Ude(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
613In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zde(e,t){if(e){if(typeof e=="string")return fC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fC(e,t)}}function fC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function qde(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Wde(e){if(Array.isArray(e))return e}var Ba=b.forwardRef(function(e,t){var r=e.aspect,n=e.initialDimension,a=n===void 0?{width:-1,height:-1}:n,i=e.width,o=i===void 0?"100%":i,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,p=e.children,v=e.debounce,m=v===void 0?0:v,g=e.id,y=e.className,x=e.onResize,w=e.style,S=w===void 0?{}:w,j=b.useRef(null),_=b.useRef();_.current=x,b.useImperativeHandle(t,function(){return Object.defineProperty(j.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),j.current},configurable:!0})});var N=b.useState({containerWidth:a.width,containerHeight:a.height}),k=Bde(N,2),O=k[0],E=k[1],A=b.useCallback(function(T,I){E(function(F){var P=Math.round(T),D=Math.round(I);return F.containerWidth===P&&F.containerHeight===D?F:{containerWidth:P,containerHeight:D}})},[]);b.useEffect(function(){var T=function($){var z,K=$[0].contentRect,q=K.width,B=K.height;A(q,B),(z=_.current)===null||z===void 0||z.call(_,q,B)};m>0&&(T=f4(T,m,{trailing:!0,leading:!1}));var I=new ResizeObserver(T),F=j.current.getBoundingClientRect(),P=F.width,D=F.height;return A(P,D),I.observe(j.current),function(){I.disconnect()}},[A,m]);var R=b.useMemo(function(){var T=O.containerWidth,I=O.containerHeight;if(T<0||I<0)return null;Xn(Fs(o)||Fs(c),`The width(%s) and height(%s) are both fixed numbers,
614       maybe you don't need to use a ResponsiveContainer.`,o,c),Xn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var F=Fs(o)?T:o,P=Fs(c)?I:c;r&&r>0&&(F?P=F/r:P&&(F=P*r),h&&P>h&&(P=h)),Xn(F>0||P>0,`The width(%s) and height(%s) of chart should be greater than 0,
615       please check the style of container, or the props width(%s) and height(%s),
616       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
617       height and width.`,F,P,o,c,d,f,r);var D=!Array.isArray(p)&&Ka(p.type).endsWith("Chart");return C.Children.map(p,function(M){return C.isValidElement(M)?b.cloneElement(M,Lh({width:F,height:P},D?{style:Lh({height:"100%",width:"100%",maxHeight:P,maxWidth:F},M.props.style)}:{})):M})},[r,p,c,h,f,d,O,o]);return C.createElement("div",{id:g?"".concat(g):void 0,className:Te("recharts-responsive-container",y),style:Lh(Lh({},S),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:j},R)}),pa=function(t){return null};pa.displayName="Cell";function Hd(e){"@babel/helpers - typeof";return Hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hd(e)}function hC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Hb(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hC(Object(r),!0).forEach(function(n){Hde(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Hde(e,t,r){return t=Vde(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vde(e){var t=Kde(e,"string");return Hd(t)=="symbol"?t:t+""}function Kde(e,t){if(Hd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Hd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qo={widthCache:{},cacheCount:0},Gde=2e3,Yde={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},pC="recharts_measurement_span";function Xde(e){var t=Hb({},e);return Object.keys(t).forEach(function(r){t[r]||delete t[r]}),t}var Qu=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ga.isSsr)return{width:0,height:0};var n=Xde(r),a=JSON.stringify({text:t,copyStyle:n});if(qo.widthCache[a])return qo.widthCache[a];try{var i=document.getElementById(pC);i||(i=document.createElement("span"),i.setAttribute("id",pC),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=Hb(Hb({},Yde),n);Object.assign(i.style,o),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return qo.widthCache[a]=c,++qo.cacheCount>Gde&&(qo.cacheCount=0,qo.widthCache={}),c}catch{return{width:0,height:0}}},Qde=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Vd(e){"@babel/helpers - typeof";return Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vd(e)}function Sm(e,t){return tfe(e)||efe(e,t)||Zde(e,t)||Jde()}function Jde(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
618In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zde(e,t){if(e){if(typeof e=="string")return mC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mC(e,t)}}function mC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function efe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function tfe(e){if(Array.isArray(e))return e}function rfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gC(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,afe(n.key),n)}}function nfe(e,t,r){return t&&gC(e.prototype,t),r&&gC(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function afe(e){var t=ife(e,"string");return Vd(t)=="symbol"?t:t+""}function ife(e,t){if(Vd(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vd(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var vC=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,yC=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,sfe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,ofe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,h4={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},lfe=Object.keys(h4),pl="NaN";function cfe(e,t){return e*h4[t]}var Fh=function(){function e(t,r){rfe(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),r!==""&&!sfe.test(r)&&(this.num=NaN,this.unit=""),lfe.includes(r)&&(this.num=cfe(t,r),this.unit="px")}return nfe(e,[{key:"add",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new e(NaN,""):new e(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new e(NaN,""):new e(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,a=(n=ofe.exec(r))!==null&&n!==void 0?n:[],i=Sm(a,3),o=i[1],l=i[2];return new e(parseFloat(o),l??"")}}])}();function p4(e){if(e.includes(pl))return pl;for(var t=e;t.includes("*")||t.includes("/");){var r,n=(r=vC.exec(t))!==null&&r!==void 0?r:[],a=Sm(n,4),i=a[1],o=a[2],l=a[3],c=Fh.parse(i??""),u=Fh.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return pl;t=t.replace(vC,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=yC.exec(t))!==null&&f!==void 0?f:[],p=Sm(h,4),v=p[1],m=p[2],g=p[3],y=Fh.parse(v??""),x=Fh.parse(g??""),w=m==="+"?y.add(x):y.subtract(x);if(w.isNaN())return pl;t=t.replace(yC,w.toString())}return t}var xC=/\(([^()]*)\)/;function ufe(e){for(var t=e;t.includes("(");){var r=xC.exec(t),n=Sm(r,2),a=n[1];t=t.replace(xC,p4(a))}return t}function dfe(e){var t=e.replace(/\s+/g,"");return t=ufe(t),t=p4(t),t}function ffe(e){try{return dfe(e)}catch{return pl}}function xx(e){var t=ffe(e.slice(5,-1));return t===pl?"":t}var hfe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],pfe=["dx","dy","angle","className","breakAll"];function Vb(){return Vb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
618for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vb.apply(this,arguments)}function bC(e,t){if(e==null)return{};var r=mfe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mfe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wC(e,t){return xfe(e)||yfe(e,t)||vfe(e,t)||gfe()}function gfe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
619In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vfe(e,t){if(e){if(typeof e=="string")return jC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jC(e,t)}}function jC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function yfe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function xfe(e){if(Array.isArray(e))return e}var m4=/[ \f\n\r\t\v\u2028\u2029]+/,g4=function(t){var r=t.children,n=t.breakAll,a=t.style;try{var i=[];$e(r)||(n?i=r.toString().split(""):i=r.toString().split(m4));var o=i.map(function(c){return{word:c,width:Qu(c,a).width}}),l=n?0:Qu(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},bfe=function(t,r,n,a,i){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=ae(o),f=l,h=function(){var F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return F.reduce(function(P,D){var M=D.word,$=D.width,z=P[P.length-1];if(z&&(a==null||i||z.width+$+n<Number(a)))z.words.push(M),z.width+=$+n;else{var K={words:[M],width:$};P.push(K)}return P},[])},p=h(r),v=function(F){return F.reduce(function(P,D){return P.width>D.width?P:D})};if(!d)return p;for(var m="…",g=function(F){var P=f.slice(0,F),D=g4({breakAll:u,style:c,children:P+m}).wordsWithComputedWidth,M=h(D),$=M.length>o||v(M).width>Number(a);return[$,M]},y=0,x=f.length-1,w=0,S;y<=x&&w<=f.length-1;){var j=Math.floor((y+x)/2),_=j-1,N=g(_),k=wC(N,2),O=k[0],E=k[1],A=g(j),R=wC(A,1),T=R[0];if(!O&&!T&&(y=j+1),O&&T&&(x=j-1),!O&&T){S=E;break}w++}return S||p},SC=function(t){var r=$e(t)?[]:t.toString().split(m4);return[{words:r}]},wfe=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,l=t.maxLines;if((r||n)&&!Ga.isSsr){var c,u,d=g4({breakAll:o,children:a,style:i});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return SC(a);return bfe({breakAll:o,children:a,maxLines:l,style:i},c,u,r,n)}return SC(a)},_C="#808080",mo=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,p=h===void 0?"start":h,v=t.verticalAnchor,m=v===void 0?"end":v,g=t.fill,y=g===void 0?_C:g,x=bC(t,hfe),w=b.useMemo(function(){return wfe({breakAll:x.breakAll,children:x.children,maxLines:x.maxLines,scaleToFit:f,style:x.style,width:x.width})},[x.breakAll,x.children,x.maxLines,f,x.style,x.width]),S=x.dx,j=x.dy,_=x.angle,N=x.className,k=x.breakAll,O=bC(x,pfe);if(!Lt(n)||!Lt(i))return null;var E=n+(ae(S)?S:0),A=i+(ae(j)?j:0),R;switch(m){case"start":R=xx("calc(".concat(u,")"));break;case"middle":R=xx("calc(".concat((w.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:R=xx("calc(".concat(w.length-1," * -").concat(l,")"));break}var T=[];if(f){var I=w[0].width,F=x.width;T.push("scale(".concat((ae(F)?F/I:1)/I,")"))}return _&&T.push("rotate(".concat(_,", ").concat(E,", ").concat(A,")")),T.length&&(O.transform=T.join(" ")),C.createElement("text",Vb({},_e(O,!0),{x:E,y:A,className:Te("recharts-text",N),textAnchor:p,fill:y.includes("url")?_C:y}),w.map(function(P,D){var M=P.words.join(k?"":" ");return C.createElement("tspan",{x:E,dy:D===0?R:l,key:"".concat(M,"-").concat(D)},M)}))};function Qi(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jfe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function hS(e){let t,r,n;e.length!==2?(t=Qi,r=(l,c)=>Qi(e(l),c),n=(l,c)=>e(l)-c):(t=e===Qi||e===jfe?e:Sfe,r=e,n=e);function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function i(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;r(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=a(l,c,u,d-1);return f>u&&n(l[f-1],c)>-n(l[f],c)?f-1:f}return{left:a,center:o,right:i}}function Sfe(){return 0}function v4(e){return e===null?NaN:+e}function*_fe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Nfe=hS(Qi),Vf=Nfe.right;hS(v4).center;class NC extends Map{constructor(t,r=Cfe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(kC(this,t))}has(t){return super.has(kC(this,t))}set(t,r){return super.set(kfe(this,t),r)}delete(t){return super.delete(Ofe(this,t))}}function kC({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function kfe({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Ofe({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Cfe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Efe(e=Qi){if(e===Qi)return y4;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 y4(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const Pfe=Math.sqrt(50),Afe=Math.sqrt(10),Tfe=Math.sqrt(2);function _m(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=Pfe?10:i>=Afe?5:i>=Tfe?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=r&&r<2?_m(e,t,r*2):[l,c,u]}function Kb(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];const n=t<e,[a,i,o]=n?_m(t,e,r):_m(e,t,r);if(!(i>=a))return[];const l=i-a+1,c=new Array(l);if(n)if(o<0)for(let u=0;u<l;++u)c[u]=(i-u)/-o;else for(let u=0;u<l;++u)c[u]=(i-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(a+u)/-o;else for(let u=0;u<l;++u)c[u]=(a+u)*o;return c}function Gb(e,t,r){return t=+t,e=+e,r=+r,_m(e,t,r)[2]}function Yb(e,t,r){t=+t,e=+e,r=+r;const n=t<e,a=n?Gb(t,e,r):Gb(e,t,r);return(n?-1:1)*(a<0?1/-a:a)}function OC(e,t){let r;for(const n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function CC(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function x4(e,t,r=0,n=1/0,a){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(a=a===void 0?y4:Efe(a);n>r;){if(n-r>600){const c=n-r+1,u=t-r+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(t-u*f/c+h)),v=Math.min(n,Math.floor(t+(c-u)*f/c+h));x4(e,t,p,v,a)}const i=e[t];let o=r,l=n;for(yu(e,r,t),a(e[n],i)>0&&yu(e,r,n);o<l;){for(yu(e,o,l),++o,--l;a(e[o],i)<0;)++o;for(;a(e[l],i)>0;)--l}a(e[r],i)===0?yu(e,r,l):(++l,yu(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function yu(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function $fe(e,t,r){if(e=Float64Array.from(_fe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return CC(e);if(t>=1)return OC(e);var n,a=(n-1)*t,i=Math.floor(a),o=OC(x4(e,i).subarray(0,i+1)),l=CC(e.subarray(i+1));return o+(l-o)*(a-i)}}function Rfe(e,t,r=v4){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,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),l=+r(e[i+1],i+1,e);return o+(l-o)*(a-i)}}function Mfe(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n<a;)i[n]=e+n*r;return i}function Cn(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function pi(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}
vendor: 7,774 bytes, line 619
619const Xb=Symbol("implicit");function pS(){var e=new NC,t=[],r=[],n=Xb;function a(i){let o=e.get(i);if(o===void 0){if(n!==Xb)return n;e.set(i,o=t.push(i)-1)}return r[o%r.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new NC;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(r=Array.from(i),a):r.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return pS(t,r).unknown(n)},Cn.apply(a,arguments),a}function Kd(){var e=pS().unknown(void 0),t=e.domain,r=e.range,n=0,a=1,i,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,p=a<n,v=p?a:n,m=p?n:a;i=(m-v)/Math.max(1,h-c+u*2),l&&(i=Math.floor(i)),v+=(m-v-i*(h-c))*d,o=i*(1-c),l&&(v=Math.round(v),o=Math.round(o));var g=Mfe(h).map(function(y){return v+i*y});return r(p?g.reverse():g)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([n,a]=h,n=+n,a=+a,f()):[n,a]},e.rangeRound=function(h){return[n,a]=h,n=+n,a=+a,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d},e.copy=function(){return Kd(t(),[n,a]).round(l).paddingInner(c).paddingOuter(u).align(d)},Cn.apply(f(),arguments)}function b4(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return b4(t())},e}function Ju(){return b4(Kd.apply(null,arguments).paddingInner(1))}function mS(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function w4(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Kf(){}var Gd=.7,Nm=1/Gd,Al="\\s*([+-]?\\d+)\\s*",Yd="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ife=/^#([0-9a-f]{3,8})$/,Dfe=new RegExp(`^rgb\\(${Al},${Al},${Al}\\)$`),Lfe=new RegExp(`^rgb\\(${wa},${wa},${wa}\\)$`),Ffe=new RegExp(`^rgba\\(${Al},${Al},${Al},${Yd}\\)$`),Bfe=new RegExp(`^rgba\\(${wa},${wa},${wa},${Yd}\\)$`),Ufe=new RegExp(`^hsl\\(${Yd},${wa},${wa}\\)$`),zfe=new RegExp(`^hsla\\(${Yd},${wa},${wa},${Yd}\\)$`),EC={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};mS(Kf,Xd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:PC,formatHex:PC,formatHex8:qfe,formatHsl:Wfe,formatRgb:AC,toString:AC});function PC(){return this.rgb().formatHex()}function qfe(){return this.rgb().formatHex8()}function Wfe(){return j4(this).formatHsl()}function AC(){return this.rgb().formatRgb()}function Xd(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Ife.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?TC(t):r===3?new Mr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Bh(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Bh(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=Dfe.exec(e))?new Mr(t[1],t[2],t[3],1):(t=Lfe.exec(e))?new Mr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ffe.exec(e))?Bh(t[1],t[2],t[3],t[4]):(t=Bfe.exec(e))?Bh(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ufe.exec(e))?MC(t[1],t[2]/100,t[3]/100,1):(t=zfe.exec(e))?MC(t[1],t[2]/100,t[3]/100,t[4]):EC.hasOwnProperty(e)?TC(EC[e]):e==="transparent"?new Mr(NaN,NaN,NaN,0):null}function TC(e){return new Mr(e>>16&255,e>>8&255,e&255,1)}function Bh(e,t,r,n){return n<=0&&(e=t=r=NaN),new Mr(e,t,r,n)}function Hfe(e){return e instanceof Kf||(e=Xd(e)),e?(e=e.rgb(),new Mr(e.r,e.g,e.b,e.opacity)):new Mr}function Qb(e,t,r,n){return arguments.length===1?Hfe(e):new Mr(e,t,r,n??1)}function Mr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}mS(Mr,Qb,w4(Kf,{brighter(e){return e=e==null?Nm:Math.pow(Nm,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Gd:Math.pow(Gd,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mr(Js(this.r),Js(this.g),Js(this.b),km(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:$C,formatHex:$C,formatHex8:Vfe,formatRgb:RC,toString:RC}));function $C(){return`#${Bs(this.r)}${Bs(this.g)}${Bs(this.b)}`}function Vfe(){return`#${Bs(this.r)}${Bs(this.g)}${Bs(this.b)}${Bs((isNaN(this.opacity)?1:this.opacity)*255)}`}function RC(){const e=km(this.opacity);return`${e===1?"rgb(":"rgba("}${Js(this.r)}, ${Js(this.g)}, ${Js(this.b)}${e===1?")":`, ${e})`}`}function km(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Js(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Bs(e){return e=Js(e),(e<16?"0":"")+e.toString(16)}function MC(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Hn(e,t,r,n)}function j4(e){if(e instanceof Hn)return new Hn(e.h,e.s,e.l,e.opacity);if(e instanceof Kf||(e=Xd(e)),!e)return new Hn;
vendor: 5,453 bytes, line 619
619if(e instanceof Hn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,l=i-a,c=(i+a)/2;return l?(t===i?o=(r-n)/l+(r<n)*6:r===i?o=(n-t)/l+2:o=(t-r)/l+4,l/=c<.5?i+a:2-i-a,o*=60):l=c>0&&c<1?0:o,new Hn(o,l,c,e.opacity)}function Kfe(e,t,r,n){return arguments.length===1?j4(e):new Hn(e,t,r,n??1)}function Hn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}mS(Hn,Kfe,w4(Kf,{brighter(e){return e=e==null?Nm:Math.pow(Nm,e),new Hn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Gd:Math.pow(Gd,e),new Hn(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,a=2*r-n;return new Mr(bx(e>=240?e-240:e+120,a,n),bx(e,a,n),bx(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new Hn(IC(this.h),Uh(this.s),Uh(this.l),km(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=km(this.opacity);return`${e===1?"hsl(":"hsla("}${IC(this.h)}, ${Uh(this.s)*100}%, ${Uh(this.l)*100}%${e===1?")":`, ${e})`}`}}));function IC(e){return e=(e||0)%360,e<0?e+360:e}function Uh(e){return Math.max(0,Math.min(1,e||0))}function bx(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 gS=e=>()=>e;function Gfe(e,t){return function(r){return e+r*t}}function Yfe(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 Xfe(e){return(e=+e)==1?S4:function(t,r){return r-t?Yfe(t,r,e):gS(isNaN(t)?r:t)}}function S4(e,t){var r=t-e;return r?Gfe(e,r):gS(isNaN(e)?t:e)}const DC=function e(t){var r=Xfe(t);function n(a,i){var o=r((a=Qb(a)).r,(i=Qb(i)).r),l=r(a.g,i.g),c=r(a.b,i.b),u=S4(a.opacity,i.opacity);return function(d){return a.r=o(d),a.g=l(d),a.b=c(d),a.opacity=u(d),a+""}}return n.gamma=e,n}(1);function Qfe(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=e[a]*(1-i)+t[a]*i;return n}}function Jfe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Zfe(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,a=new Array(n),i=new Array(r),o;for(o=0;o<n;++o)a[o]=Zc(e[o],t[o]);for(;o<r;++o)i[o]=t[o];return function(l){for(o=0;o<n;++o)i[o]=a[o](l);return i}}function ehe(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function Om(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function the(e,t){var r={},n={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?r[a]=Zc(e[a],t[a]):n[a]=t[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var Jb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wx=new RegExp(Jb.source,"g");function rhe(e){return function(){return e}}function nhe(e){return function(t){return e(t)+""}}function ahe(e,t){var r=Jb.lastIndex=wx.lastIndex=0,n,a,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(n=Jb.exec(e))&&(a=wx.exec(t));)(i=a.index)>r&&(i=t.slice(r,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:Om(n,a)})),r=wx.lastIndex;return r<t.length&&(i=t.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?nhe(c[0].x):rhe(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function Zc(e,t){var r=typeof t,n;return t==null||r==="boolean"?gS(t):(r==="number"?Om:r==="string"?(n=Xd(t))?(t=n,DC):ahe:t instanceof Xd?DC:t instanceof Date?ehe:Jfe(t)?Qfe:Array.isArray(t)?Zfe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?the:Om)(e,t)}function vS(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function ihe(e,t){t===void 0&&(t=e,e=Zc);for(var r=0,n=t.length-1,a=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(a,a=t[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return i[l](o-l)}}function she(e){return function(){return e}}function Cm(e){return+e}var LC=[0,1];function Nr(e){return e}function Zb(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:she(isNaN(t)?NaN:.5)}function ohe(e,t){var r;return e>t&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function lhe(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a<n?(n=Zb(a,n),i=r(o,i)):(n=Zb(n,a),i=r(i,o)),function(l){return i(n(l))}}function che(e,t,r){var n=Math.min(e.length,t.length)-1,a=new Array(n),i=new Array(n),o=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<n;)a[o]=Zb(e[o],e[o+1]),i[o]=r(t[o],t[o+1]);return function(l){var c=Vf(e,l,1,n)-1;return i[c](a[c](l))}}function Gf(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Av(){var e=LC,t=LC,r=Zc,n,a,i,o=Nr,l,c,u;function d(){var h=Math.min(e.length,t.length);return o!==Nr&&(o=ohe(e[0],e[h-1])),l=h>2?che:lhe,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?i:(c||(c=l(e.map(n),t,r)))(n(o(h)))}return f.invert=function(h){return o(a((u||(u=l(t,e.map(n),Om)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,Cm),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),r=vS,d()},f.clamp=function(h){return arguments.length?(o=h?!0:Nr,d()):o!==Nr},f.interpolate=function(h){return arguments.length?(r=h,d()):r},f.unknown=function(h){return arguments.length?(i=h,f):i},function(h,p){return n=h,a=p,d()}}function yS(){return Av()(Nr,Nr)}
vendor: 4,456 bytes, line 619
619function uhe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Em(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 lc(e){return e=Em(Math.abs(e)),e?e[1]:NaN}function dhe(e,t){return function(r,n){for(var a=r.length,i=[],o=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(a-=l,a+l)),!((c+=l+1)>n));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function fhe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var hhe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Qd(e){if(!(t=hhe.exec(e)))throw new Error("invalid format: "+e);var t;return new xS({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]})}Qd.prototype=xS.prototype;function xS(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+""}xS.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 phe(e){e:for(var t=e.length,r=1,n=-1,a;r<t;++r)switch(e[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+e[r])break e;n>0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var _4;function mhe(e,t){var r=Em(e,t);if(!r)return e+"";var n=r[0],a=r[1],i=a-(_4=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Em(e,Math.max(0,t+i-1))[0]}function FC(e,t){var r=Em(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const BC={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:uhe,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)=>FC(e*100,t),r:FC,s:mhe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function UC(e){return e}var zC=Array.prototype.map,qC=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ghe(e){var t=e.grouping===void 0||e.thousands===void 0?UC:dhe(zC.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?UC:fhe(zC.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 u(f){f=Qd(f);var h=f.fill,p=f.align,v=f.sign,m=f.symbol,g=f.zero,y=f.width,x=f.comma,w=f.precision,S=f.trim,j=f.type;j==="n"?(x=!0,j="g"):BC[j]||(w===void 0&&(w=12),S=!0,j="g"),(g||h==="0"&&p==="=")&&(g=!0,h="0",p="=");var _=m==="$"?r:m==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():"",N=m==="$"?n:/[%p]/.test(j)?o:"",k=BC[j],O=/[defgprs%]/.test(j);w=w===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function E(A){var R=_,T=N,I,F,P;if(j==="c")T=k(A)+T,A="";else{A=+A;var D=A<0||1/A<0;if(A=isNaN(A)?c:k(Math.abs(A),w),S&&(A=phe(A)),D&&+A==0&&v!=="+"&&(D=!1),R=(D?v==="("?v:l:v==="-"||v==="("?"":v)+R,T=(j==="s"?qC[8+_4/3]:"")+T+(D&&v==="("?")":""),O){for(I=-1,F=A.length;++I<F;)if(P=A.charCodeAt(I),48>P||P>57){T=(P===46?a+A.slice(I+1):A.slice(I))+T,A=A.slice(0,I);break}}}x&&!g&&(A=t(A,1/0));var M=R.length+A.length+T.length,$=M<y?new Array(y-M+1).join(h):"";switch(x&&g&&(A=t($+A,$.length?y-T.length:1/0),$=""),p){case"<":A=R+A+T+$;break;case"=":A=R+$+A+T;break;case"^":A=$.slice(0,M=$.length>>1)+R+A+T+$.slice(M);break;default:A=$+R+A+T;break}return i(A)}return E.toString=function(){return f+""},E}function d(f,h){var p=u((f=Qd(f),f.type="f",f)),v=Math.max(-8,Math.min(8,Math.floor(lc(h)/3)))*3,m=Math.pow(10,-v),g=qC[8+v/3];return function(y){return p(m*y)+g}}return{format:u,formatPrefix:d}}var zh,bS,N4;
619vhe({thousands:",",grouping:[3],currency:["$",""]});function vhe(e){return zh=ghe(e),bS=zh.format,N4=zh.formatPrefix,zh}function yhe(e){return Math.max(0,-lc(Math.abs(e)))}function xhe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(lc(t)/3)))*3-lc(Math.abs(e)))}function bhe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,lc(t)-lc(e))+1}function k4(e,t,r,n){var a=Yb(e,t,r),i;switch(n=Qd(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=xhe(a,o))&&(n.precision=i),N4(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=bhe(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=yhe(a))&&(n.precision=i-(n.type==="%")*2);break}}return bS(n)}function ps(e){var t=e.domain;return e.ticks=function(r){var n=t();return Kb(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return k4(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],l=n[i],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=a,a=i,i=u);d-- >0;){if(u=Gb(o,l,r),u===c)return n[a]=o,n[i]=l,t(n);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function Pm(){var e=yS();return e.copy=function(){return Gf(e,Pm())},Cn.apply(e,arguments),ps(e)}function O4(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,Cm),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return O4(e).unknown(t)},e=arguments.length?Array.from(e,Cm):[0,1],ps(r)}function C4(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return i<a&&(o=r,r=n,n=o,o=a,a=i,i=o),e[r]=t.floor(a),e[n]=t.ceil(i),e}function WC(e){return Math.log(e)}function HC(e){return Math.exp(e)}function whe(e){return-Math.log(-e)}function jhe(e){return-Math.exp(-e)}function She(e){return isFinite(e)?+("1e"+e):e<0?0:e}function _he(e){return e===10?She:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Nhe(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 VC(e){return(t,r)=>-e(-t,r)}function wS(e){const t=e(WC,HC),r=t.domain;let n=10,a,i;function o(){return a=Nhe(n),i=_he(n),r()[0]<0?(a=VC(a),i=VC(i),e(whe,jhe)):e(WC,HC),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 u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=a(u),p=a(d),v,m;const g=l==null?10:+l;let y=[];if(!(n%1)&&p-h<g){if(h=Math.floor(h),p=Math.ceil(p),u>0){for(;h<=p;++h)for(v=1;v<n;++v)if(m=h<0?v/i(-h):v*i(h),!(m<u)){if(m>d)break;y.push(m)}}else for(;h<=p;++h)for(v=n-1;v>=1;--v)if(m=h>0?v/i(-h):v*i(h),!(m<u)){if(m>d)break;y.push(m)}y.length*2<g&&(y=Kb(u,d,g))}else y=Kb(h,p,Math.min(p-h,g)).map(i);return f?y.reverse():y},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=Qd(c)).precision==null&&(c.trim=!0),c=bS(c)),l===1/0)return c;const u=Math.max(1,n*l/t.ticks().length);return d=>{let f=d/i(Math.round(a(d)));return f*n<n-.5&&(f*=n),f<=u?c(d):""}},t.nice=()=>r(C4(r(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function E4(){const e=wS(Av()).domain([1,10]);return e.copy=()=>Gf(e,E4()).base(e.base()),Cn.apply(e,arguments),e}function KC(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function GC(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jS(e){var t=1,r=e(KC(t),GC(t));return r.constant=function(n){return arguments.length?e(KC(t=+n),GC(t)):t},ps(r)}function P4(){var e=jS(Av());return e.copy=function(){return Gf(e,P4()).constant(e.constant())},Cn.apply(e,arguments)}function YC(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function khe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Ohe(e){return e<0?-e*e:e*e}function SS(e){var t=e(Nr,Nr),r=1;function n(){return r===1?e(Nr,Nr):r===.5?e(khe,Ohe):e(YC(r),YC(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},ps(t)}function _S(){var e=SS(Av());return e.copy=function(){return Gf(e,_S()).exponent(e.exponent())},Cn.apply(e,arguments),e}function Che(){return _S.apply(null,arguments).exponent(.5)}function XC(e){return Math.sign(e)*e*e}function Ehe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function A4(){var e=yS(),t=[0,1],r=!1,n;function a(i){var o=Ehe(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert(XC(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,Cm)).map(XC)),a):t.slice()}
619,a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return A4(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Cn.apply(a,arguments),ps(a)}function T4(){var e=[],t=[],r=[],n;function a(){var o=0,l=Math.max(1,t.length);for(r=new Array(l-1);++o<l;)r[o-1]=Rfe(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:t[Vf(r,o)]}return i.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]]},i.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(Qi),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return T4().domain(e).range(t).unknown(n)},Cn.apply(i,arguments)}function $4(){var e=0,t=1,r=1,n=[.5],a=[0,1],i;function o(c){return c!=null&&c<=c?a[Vf(n,c,0,r)]:i}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=(a=Array.from(c)).length-1,l()):a.slice()},o.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,n[0]]:u>=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return $4().domain([e,t]).range(a).unknown(i)},Cn.apply(ps(o),arguments)}function R4(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[Vf(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return R4().domain(e).range(t).unknown(r)},Cn.apply(a,arguments)}const jx=new Date,Sx=new Date;function Ft(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),l=a.ceil(i);return i-o<l-i?o:l},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,l)=>{const c=[];if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let u;do c.push(u=new Date(+i)),t(i,l),e(i);while(u<i&&i<o);return c},a.filter=i=>Ft(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),r&&(a.count=(i,o)=>(jx.setTime(+i),Sx.setTime(+o),e(jx),e(Sx),Math.floor(r(jx,Sx))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const Am=Ft(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Am.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ft(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Am);Am.range;const qa=1e3,xn=qa*60,Wa=xn*60,ai=Wa*24,NS=ai*7,QC=ai*30,_x=ai*365,Us=Ft(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*qa)},(e,t)=>(t-e)/qa,e=>e.getUTCSeconds());Us.range;const kS=Ft(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qa)},(e,t)=>{e.setTime(+e+t*xn)},(e,t)=>(t-e)/xn,e=>e.getMinutes());kS.range;const OS=Ft(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*xn)},(e,t)=>(t-e)/xn,e=>e.getUTCMinutes());OS.range;const CS=Ft(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*qa-e.getMinutes()*xn)},(e,t)=>{e.setTime(+e+t*Wa)},(e,t)=>(t-e)/Wa,e=>e.getHours());CS.range;const ES=Ft(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Wa)},(e,t)=>(t-e)/Wa,e=>e.getUTCHours());ES.range;const Yf=Ft(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*xn)/ai,e=>e.getDate()-1);Yf.range;const Tv=Ft(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ai,e=>e.getUTCDate()-1);Tv.range;const M4=Ft(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ai,e=>Math.floor(e/ai));M4.range;function _o(e){return Ft(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())*xn)/NS)}const $v=_o(0),Tm=_o(1),Phe=_o(2),Ahe=_o(3),cc=_o(4),The=_o(5),$he=_o(6);$v.range;Tm.range;Phe.range;Ahe.range;cc.range;The.range;$he.range;function No(e){return Ft(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)/NS)}const Rv=No(0),$m=No(1),Rhe=No(2),Mhe=No(3),uc=No(4),Ihe=No(5),Dhe=No(6);Rv.range;$m.range;Rhe.range;Mhe.range;uc.range;Ihe.range;Dhe.range;const PS=Ft(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());PS.range;const AS=Ft(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());AS.range;const ii=Ft(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());ii.every=e=>
vendor: 4,499 bytes, line 619
619!isFinite(e=Math.floor(e))||!(e>0)?null:Ft(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)});ii.range;const si=Ft(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());si.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ft(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)});si.range;function I4(e,t,r,n,a,i){const o=[[Us,1,qa],[Us,5,5*qa],[Us,15,15*qa],[Us,30,30*qa],[i,1,xn],[i,5,5*xn],[i,15,15*xn],[i,30,30*xn],[a,1,Wa],[a,3,3*Wa],[a,6,6*Wa],[a,12,12*Wa],[n,1,ai],[n,2,2*ai],[r,1,NS],[t,1,QC],[t,3,3*QC],[e,1,_x]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const p=f&&typeof f.range=="function"?f:c(u,d,f),v=p?p.range(u,+d+1):[];return h?v.reverse():v}function c(u,d,f){const h=Math.abs(d-u)/f,p=hS(([,,g])=>g).right(o,h);if(p===o.length)return e.every(Yb(u/_x,d/_x,f));if(p===0)return Am.every(Math.max(Yb(u,d,f),1));const[v,m]=o[h/o[p-1][2]<o[p][2]/h?p-1:p];return v.every(m)}return[l,c]}const[Lhe,Fhe]=I4(si,AS,Rv,M4,ES,OS),[Bhe,Uhe]=I4(ii,PS,$v,Yf,CS,kS);function Nx(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 kx(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 xu(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function zhe(e){var t=e.dateTime,r=e.date,n=e.time,a=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=bu(a),d=wu(a),f=bu(i),h=wu(i),p=bu(o),v=wu(o),m=bu(l),g=wu(l),y=bu(c),x=wu(c),w={a:D,A:M,b:$,B:z,c:null,d:nE,e:nE,f:dpe,g:wpe,G:Spe,H:lpe,I:cpe,j:upe,L:D4,m:fpe,M:hpe,p:K,q,Q:sE,s:oE,S:ppe,u:mpe,U:gpe,V:vpe,w:ype,W:xpe,x:null,X:null,y:bpe,Y:jpe,Z:_pe,"%":iE},S={a:B,A:Z,b:he,B:pe,c:null,d:aE,e:aE,f:Cpe,g:Lpe,G:Bpe,H:Npe,I:kpe,j:Ope,L:F4,m:Epe,M:Ppe,p:Q,q:me,Q:sE,s:oE,S:Ape,u:Tpe,U:$pe,V:Rpe,w:Mpe,W:Ipe,x:null,X:null,y:Dpe,Y:Fpe,Z:Upe,"%":iE},j={a:E,A,b:R,B:T,c:I,d:tE,e:tE,f:ape,g:eE,G:ZC,H:rE,I:rE,j:epe,L:npe,m:Zhe,M:tpe,p:O,q:Jhe,Q:spe,s:ope,S:rpe,u:Khe,U:Ghe,V:Yhe,w:Vhe,W:Xhe,x:F,X:P,y:eE,Y:ZC,Z:Qhe,"%":ipe};w.x=_(r,w),w.X=_(n,w),w.c=_(t,w),S.x=_(r,S),S.X=_(n,S),S.c=_(t,S);function _(L,Y){return function(J){var U=[],ge=-1,ve=0,Ne=L.length,Re,it,Xe;for(J instanceof Date||(J=new Date(+J));++ge<Ne;)L.charCodeAt(ge)===37&&(U.push(L.slice(ve,ge)),(it=JC[Re=L.charAt(++ge)])!=null?Re=L.charAt(++ge):it=Re==="e"?" ":"0",(Xe=Y[Re])&&(Re=Xe(J,it)),U.push(Re),ve=ge+1);return U.push(L.slice(ve,ge)),U.join("")}}function N(L,Y){return function(J){var U=xu(1900,void 0,1),ge=k(U,L,J+="",0),ve,Ne;if(ge!=J.length)return null;if("Q"in U)return new Date(U.Q);if("s"in U)return new Date(U.s*1e3+("L"in U?U.L:0));if(Y&&!("Z"in U)&&(U.Z=0),"p"in U&&(U.H=U.H%12+U.p*12),U.m===void 0&&(U.m="q"in U?U.q:0),"V"in U){if(U.V<1||U.V>53)return null;"w"in U||(U.w=1),"Z"in U?(ve=kx(xu(U.y,0,1)),Ne=ve.getUTCDay(),ve=Ne>4||Ne===0?$m.ceil(ve):$m(ve),ve=Tv.offset(ve,(U.V-1)*7),U.y=ve.getUTCFullYear(),U.m=ve.getUTCMonth(),U.d=ve.getUTCDate()+(U.w+6)%7):(ve=Nx(xu(U.y,0,1)),Ne=ve.getDay(),ve=Ne>4||Ne===0?Tm.ceil(ve):Tm(ve),ve=Yf.offset(ve,(U.V-1)*7),U.y=ve.getFullYear(),U.m=ve.getMonth(),U.d=ve.getDate()+(U.w+6)%7)}else("W"in U||"U"in U)&&("w"in U||(U.w="u"in U?U.u%7:"W"in U?1:0),Ne="Z"in U?kx(xu(U.y,0,1)).getUTCDay():Nx(xu(U.y,0,1)).getDay(),U.m=0,U.d="W"in U?(U.w+6)%7+U.W*7-(Ne+5)%7:U.w+U.U*7-(Ne+6)%7);return"Z"in U?(U.H+=U.Z/100|0,U.M+=U.Z%100,kx(U)):Nx(U)}}function k(L,Y,J,U){for(var ge=0,ve=Y.length,Ne=J.length,Re,it;ge<ve;){if(U>=Ne)return-1;if(Re=Y.charCodeAt(ge++),Re===37){if(Re=Y.charAt(ge++),it=j[Re in JC?Y.charAt(ge++):Re],!it||(U=it(L,J,U))<0)return-1}else if(Re!=J.charCodeAt(U++))return-1}return U}function O(L,Y,J){var U=u.exec(Y.slice(J));return U?(L.p=d.get(U[0].toLowerCase()),J+U[0].length):-1}function E(L,Y,J){var U=p.exec(Y.slice(J));return U?(L.w=v.get(U[0].toLowerCase()),J+U[0].length):-1}function A(L,Y,J){var U=f.exec(Y.slice(J));return U?(L.w=h.get(U[0].toLowerCase()),J+U[0].length):-1}function R(L,Y,J){var U=y.exec(Y.slice(J));return U?(L.m=x.get(U[0].toLowerCase()),J+U[0].length):-1}function T(L,Y,J){var U=m.exec(Y.slice(J));return U?(L.m=g.get(U[0].toLowerCase()),J+U[0].length):-1}function I(L,Y,J){return k(L,t,Y,J)}
vendor: 4,418 bytes, line 619
619function F(L,Y,J){return k(L,r,Y,J)}function P(L,Y,J){return k(L,n,Y,J)}function D(L){return o[L.getDay()]}function M(L){return i[L.getDay()]}function $(L){return c[L.getMonth()]}function z(L){return l[L.getMonth()]}function K(L){return a[+(L.getHours()>=12)]}function q(L){return 1+~~(L.getMonth()/3)}function B(L){return o[L.getUTCDay()]}function Z(L){return i[L.getUTCDay()]}function he(L){return c[L.getUTCMonth()]}function pe(L){return l[L.getUTCMonth()]}function Q(L){return a[+(L.getUTCHours()>=12)]}function me(L){return 1+~~(L.getUTCMonth()/3)}return{format:function(L){var Y=_(L+="",w);return Y.toString=function(){return L},Y},parse:function(L){var Y=N(L+="",!1);return Y.toString=function(){return L},Y},utcFormat:function(L){var Y=_(L+="",S);return Y.toString=function(){return L},Y},utcParse:function(L){var Y=N(L+="",!0);return Y.toString=function(){return L},Y}}}var JC={"-":"",_:" ",0:"0"},Yt=/^\s*\d+/,qhe=/^%/,Whe=/[\\^$*+?|[\]().{}]/g;function Ue(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(t)+a:a)}function Hhe(e){return e.replace(Whe,"\\$&")}function bu(e){return new RegExp("^(?:"+e.map(Hhe).join("|")+")","i")}function wu(e){return new Map(e.map((t,r)=>[t.toLowerCase(),r]))}function Vhe(e,t,r){var n=Yt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Khe(e,t,r){var n=Yt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function Ghe(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function Yhe(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function Xhe(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function ZC(e,t,r){var n=Yt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function eE(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Qhe(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 Jhe(e,t,r){var n=Yt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Zhe(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function tE(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function epe(e,t,r){var n=Yt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function rE(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function tpe(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function rpe(e,t,r){var n=Yt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function npe(e,t,r){var n=Yt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function ape(e,t,r){var n=Yt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function ipe(e,t,r){var n=qhe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function spe(e,t,r){var n=Yt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function ope(e,t,r){var n=Yt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function nE(e,t){return Ue(e.getDate(),t,2)}function lpe(e,t){return Ue(e.getHours(),t,2)}function cpe(e,t){return Ue(e.getHours()%12||12,t,2)}function upe(e,t){return Ue(1+Yf.count(ii(e),e),t,3)}function D4(e,t){return Ue(e.getMilliseconds(),t,3)}function dpe(e,t){return D4(e,t)+"000"}function fpe(e,t){return Ue(e.getMonth()+1,t,2)}function hpe(e,t){return Ue(e.getMinutes(),t,2)}function ppe(e,t){return Ue(e.getSeconds(),t,2)}function mpe(e){var t=e.getDay();return t===0?7:t}function gpe(e,t){return Ue($v.count(ii(e)-1,e),t,2)}function L4(e){var t=e.getDay();return t>=4||t===0?cc(e):cc.ceil(e)}function vpe(e,t){return e=L4(e),Ue(cc.count(ii(e),e)+(ii(e).getDay()===4),t,2)}function ype(e){return e.getDay()}function xpe(e,t){return Ue(Tm.count(ii(e)-1,e),t,2)}function bpe(e,t){return Ue(e.getFullYear()%100,t,2)}function wpe(e,t){return e=L4(e),Ue(e.getFullYear()%100,t,2)}function jpe(e,t){return Ue(e.getFullYear()%1e4,t,4)}function Spe(e,t){var r=e.getDay();return e=r>=4||r===0?cc(e):cc.ceil(e),Ue(e.getFullYear()%1e4,t,4)}function _pe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ue(t/60|0,"0",2)+Ue(t%60,"0",2)}function aE(e,t){return Ue(e.getUTCDate(),t,2)}function Npe(e,t){return Ue(e.getUTCHours(),t,2)}function kpe(e,t){return Ue(e.getUTCHours()%12||12,t,2)}function Ope(e,t){return Ue(1+Tv.count(si(e),e),t,3)}
619function F4(e,t){return Ue(e.getUTCMilliseconds(),t,3)}function Cpe(e,t){return F4(e,t)+"000"}function Epe(e,t){return Ue(e.getUTCMonth()+1,t,2)}function Ppe(e,t){return Ue(e.getUTCMinutes(),t,2)}function Ape(e,t){return Ue(e.getUTCSeconds(),t,2)}function Tpe(e){var t=e.getUTCDay();return t===0?7:t}function $pe(e,t){return Ue(Rv.count(si(e)-1,e),t,2)}function B4(e){var t=e.getUTCDay();return t>=4||t===0?uc(e):uc.ceil(e)}function Rpe(e,t){return e=B4(e),Ue(uc.count(si(e),e)+(si(e).getUTCDay()===4),t,2)}function Mpe(e){return e.getUTCDay()}function Ipe(e,t){return Ue($m.count(si(e)-1,e),t,2)}function Dpe(e,t){return Ue(e.getUTCFullYear()%100,t,2)}function Lpe(e,t){return e=B4(e),Ue(e.getUTCFullYear()%100,t,2)}function Fpe(e,t){return Ue(e.getUTCFullYear()%1e4,t,4)}function Bpe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?uc(e):uc.ceil(e),Ue(e.getUTCFullYear()%1e4,t,4)}function Upe(){return"+0000"}function iE(){return"%"}function sE(e){return+e}function oE(e){return Math.floor(+e/1e3)}var Wo,U4,z4;zpe({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 zpe(e){return Wo=zhe(e),U4=Wo.format,Wo.parse,z4=Wo.utcFormat,Wo.utcParse,Wo}function qpe(e){return new Date(e)}function Wpe(e){return e instanceof Date?+e:+new Date(+e)}function TS(e,t,r,n,a,i,o,l,c,u){var d=yS(),f=d.invert,h=d.domain,p=u(".%L"),v=u(":%S"),m=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),x=u("%b %d"),w=u("%B"),S=u("%Y");function j(_){return(c(_)<_?p:l(_)<_?v:o(_)<_?m:i(_)<_?g:n(_)<_?a(_)<_?y:x:r(_)<_?w:S)(_)}return d.invert=function(_){return new Date(f(_))},d.domain=function(_){return arguments.length?h(Array.from(_,Wpe)):h().map(qpe)},d.ticks=function(_){var N=h();return e(N[0],N[N.length-1],_??10)},d.tickFormat=function(_,N){return N==null?j:u(N)},d.nice=function(_){var N=h();return(!_||typeof _.range!="function")&&(_=t(N[0],N[N.length-1],_??10)),_?h(C4(N,_)):d},d.copy=function(){return Gf(d,TS(e,t,r,n,a,i,o,l,c,u))},d}function Hpe(){return Cn.apply(TS(Bhe,Uhe,ii,PS,$v,Yf,CS,kS,Us,U4).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Vpe(){return Cn.apply(TS(Lhe,Fhe,si,AS,Rv,Tv,ES,OS,Us,z4).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Mv(){var e=0,t=1,r,n,a,i,o=Nr,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(a===0?.5:(f=(i(f)-r)*a,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,r=i(e=+e),n=i(t=+t),a=r===n?0:1/(n-r),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(h){var p,v;return arguments.length?([p,v]=h,o=f(p,v),u):[o(0),o(1)]}}return u.range=d(Zc),u.rangeRound=d(vS),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return i=f,r=f(e),n=f(t),a=r===n?0:1/(n-r),u}}function ms(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function q4(){var e=ps(Mv()(Nr));return e.copy=function(){return ms(e,q4())},pi.apply(e,arguments)}function W4(){var e=wS(Mv()).domain([1,10]);return e.copy=function(){return ms(e,W4()).base(e.base())},pi.apply(e,arguments)}function H4(){var e=jS(Mv());return e.copy=function(){return ms(e,H4()).constant(e.constant())},pi.apply(e,arguments)}function $S(){var e=SS(Mv());return e.copy=function(){return ms(e,$S()).exponent(e.exponent())},pi.apply(e,arguments)}function Kpe(){return $S.apply(null,arguments).exponent(.5)}function V4(){var e=[],t=Nr;function r(n){if(n!=null&&!isNaN(n=+n))return t((Vf(e,n,1)-1)/(e.length-1))}return r.domain=function(n){if(!arguments.length)return e.slice();e=[];for(let a of n)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Qi),r},r.interpolator=function(n){return arguments.length?(t=n,r):t},r.range=function(){return e.map((n,a)=>t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>$fe(e,i/n))},r.copy=function(){return V4(t).domain(e)},pi.apply(r,arguments)}function Iv(){var e=0,t=.5,r=1,n=1,a,i,o,l,c,u=Nr,d,f=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+d(m))-i)*(n*m<n*i?l:c),u(f?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t,r]=m,a=d(e=+e),i=d(t=+t),o=d(r=+r),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),n=i<a?-1:1,p):[e,t,r]},p.clamp=function(m){return arguments.length?(f=!!m,p):f},p.interpolator=function(m){return arguments.length?(u=m,p):u};function v(m){return function(g){var y,x,w;return arguments.length?([y,x,w]=g,u=ihe(m,[y,x,w]),p):[u(0),u(.5),u(1)]}}return p.range=v(Zc),p.rangeRound=v(vS),p.unknown=function(m){return arguments.length?(h=m,p):h},function(m){return d=m,a=m(e),i=m(t),o=m(r),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),n=i<a?-1:1,p}}function K4(){var e=ps(Iv()(Nr));return e.copy=function(){return ms(e,K4())},pi.apply(e,arguments)}function G4(){var e=wS(Iv()).domain([.1,1,10]);return e.copy=function(){return ms(e,G4()).base(e.base())},pi.apply(e,arguments)}function Y4(){var e=jS(Iv());return e.copy=function(){return ms(e,Y4()).constant(e.constant())},pi.apply(e,arguments)}function RS(){var e=SS(Iv());return e.copy=function(){return ms(e,RS()).exponent(e.exponent())},pi.apply(e,arguments)}function Gpe(){return RS.apply(null,arguments).exponent(.5)}const lE=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Kd,scaleDiverging:K4,scaleDivergingLog:G4,scaleDivergingPow:RS,scaleDivergingSqrt:Gpe,scaleDivergingSymlog:Y4,scaleIdentity:O4,scaleImplicit:Xb,scaleLinear:Pm,scaleLog:E4,scaleOrdinal:pS,scalePoint:Ju,scalePow:_S,scaleQuantile:T4,scaleQuantize:$4,scaleRadial:A4,scaleSequential:q4,scaleSequentialLog:W4,scaleSequentialPow:$S,scaleSequentialQuantile:V4,scaleSequentialSqrt:Kpe,scaleSequentialSymlog:H4,
vendor: 63,413 bytes, lines 619-646
619scaleSqrt:Che,scaleSymlog:P4,scaleThreshold:R4,scaleTime:Hpe,scaleUtc:Vpe,tickFormat:k4},Symbol.toStringTag,{value:"Module"}));var Ype=Hc;function Xpe(e,t,r){for(var n=-1,a=e.length;++n<a;){var i=e[n],o=t(i);if(o!=null&&(l===void 0?o===o&&!Ype(o):r(o,l)))var l=o,c=i}return c}var Dv=Xpe;function Qpe(e,t){return e>t}var X4=Qpe,Jpe=Dv,Zpe=X4,eme=Jc;function tme(e){return e&&e.length?Jpe(e,eme,Zpe):void 0}var rme=tme;const Lv=qe(rme);function nme(e,t){return e<t}var Q4=nme,ame=Dv,ime=Q4,sme=Jc;function ome(e){return e&&e.length?ame(e,sme,ime):void 0}var lme=ome;const Fv=qe(lme);var cme=Gj,ume=Pa,dme=i4,fme=zr;function hme(e,t){var r=fme(e)?cme:dme;return r(e,ume(t))}var pme=hme,mme=n4,gme=pme;function vme(e,t){return mme(gme(e,t),1)}var yme=vme;const xme=qe(yme);var bme=cS;function wme(e,t){return bme(e,t)}var jme=wme;const Bv=qe(jme);var eu=1e9,Sme={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},IS,gt=!0,kn="[DecimalError] ",Zs=kn+"Invalid argument: ",MS=kn+"Exponent out of range: ",tu=Math.floor,Ps=Math.pow,_me=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Yr,Bt=1e7,ut=7,J4=9007199254740991,Rm=tu(J4/ut),de={};de.absoluteValue=de.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};de.comparedTo=de.cmp=function(e){var t,r,n,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=n<a?n:a;t<r;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};de.decimalPlaces=de.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ut;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};de.dividedBy=de.div=function(e){return Ya(this,new this.constructor(e))};de.dividedToIntegerBy=de.idiv=function(e){var t=this,r=t.constructor;return Je(Ya(t,new r(e),0,1),r.precision)};de.equals=de.eq=function(e){return!this.cmp(e)};de.exponent=function(){return At(this)};de.greaterThan=de.gt=function(e){return this.cmp(e)>0};de.greaterThanOrEqualTo=de.gte=function(e){return this.cmp(e)>=0};de.isInteger=de.isint=function(){return this.e>this.d.length-2};de.isNegative=de.isneg=function(){return this.s<0};de.isPositive=de.ispos=function(){return this.s>0};de.isZero=function(){return this.s===0};de.lessThan=de.lt=function(e){return this.cmp(e)<0};de.lessThanOrEqualTo=de.lte=function(e){return this.cmp(e)<1};de.logarithm=de.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Yr))throw Error(kn+"NaN");if(r.s<1)throw Error(kn+(r.s?"NaN":"-Infinity"));return r.eq(Yr)?new n(0):(gt=!1,t=Ya(Jd(r,i),Jd(e,i),i),gt=!0,Je(t,a))};de.minus=de.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?tL(t,e):Z4(t,(e.s=-e.s,e))};de.modulo=de.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(kn+"NaN");return r.s?(gt=!1,t=Ya(r,e,0,1).times(e),gt=!0,r.minus(t)):Je(new n(r),a)};de.naturalExponential=de.exp=function(){return eL(this)};de.naturalLogarithm=de.ln=function(){return Jd(this)};de.negated=de.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};de.plus=de.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Z4(t,e):tL(t,(e.s=-e.s,e))};de.precision=de.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Zs+e);if(t=At(a)+1,n=a.d.length-1,r=n*ut+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};de.squareRoot=de.sqrt=function(){var e,t,r,n,a,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(kn+"NaN")}for(e=At(l),gt=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=ga(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=tu((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new c(t)):n=new c(a.toString()),r=c.precision,a=o=r+3;;)if(i=n,n=i.plus(Ya(l,i,o+2)).times(.5),ga(i.d).slice(0,o)===(t=ga(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(Je(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(t!="9999")break;o+=4}return gt=!0,Je(n,r)};de.times=de.mul=function(e){var t,r,n,a,i,o,l,c,u,d=this,f=d.constructor,h=d.d,p=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,r=d.e+e.e,c=h.length,u=p.length,c<u&&(i=h,h=p,p=i,o=c,c=u,u=o),i=[],o=c+u,n=o;n--;)i.push(0);for(n=u;--n>=0;){for(t=0,a=c+n;a>n;)l=i[a]+p[n]*h[a-n-1]+t,i[a--]=l%Bt|0,t=l/Bt|0;i[a]=(i[a]+t)%Bt|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,gt?Je(e,f.precision):e};de.toDecimalPlaces=de.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(_a(e,0,eu),t===void 0?t=n.rounding:_a(t,0,8),Je(r,e+At(r)+1,t))};de.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=go(n,!0):(_a(e,0,eu),t===void 0?t=a.rounding:_a(t,0,8),n=Je(new a(n),e+1,t),r=go(n,!0,e+1)),r};de.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?go(a):(_a(e,0,eu),t===void 0?t=i.rounding:_a(t,0,8),n=Je(new i(a),e+At(a)+1,t),r=go(n.abs(),!1,e+At(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};de.toInteger=de.toint=function(){var e=this,t=e.constructor;return Je(new t(e),At(e)+1,t.rounding)};de.toNumber=function(){return+this};de.toPower=de.pow=function(e){var t,r,n,a,i,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Yr);if(l=new c(l),!l.s){if(e.s<1)throw Error(kn+"Infinity");return l}if(l.eq(Yr))return l;if(n=c.precision,e.eq(Yr))return Je(l,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=l.s,o){if((r=d<0?-d:d)<=J4){for(a=new c(Yr),t=Math.ceil(n/ut+4),gt=!1;r%2&&(a=a.times(l),uE(a.d,t)),r=tu(r/2),r!==0;)l=l.times(l),uE(l.d,t);return gt=!0,e.s<0?new c(Yr).div(a):Je(a,n)}}else if(i<0)throw Error(kn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,gt=!1,a=e.times(Jd(l,n+u)),gt=!0,a=eL(a),a.s=i,a};de.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=At(a),n=go(a,r<=i.toExpNeg||r>=i.toExpPos)):(_a(e,1,eu),t===void 0?t=i.rounding:_a(t,0,8),a=Je(new i(a),e,t),r=At(a),n=go(a,e<=r||r<=i.toExpNeg,e)),n};de.toSignificantDigits=de.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(_a(e,1,eu),t===void 0?t=n.rounding:_a(t,0,8)),Je(new n(r),e,t)};de.toString=de.valueOf=de.val=de.toJSON=de[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=At(e),r=e.constructor;return go(e,t<=r.toExpNeg||t>=r.toExpPos)};function Z4(e,t){var r,n,a,i,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),gt?Je(t,f):t;if(c=e.d,u=t.d,o=e.e,a=t.e,c=c.slice(),i=o-a,i){for(i<0?(n=c,i=-i,l=u.length):(n=u,a=o,l=c.length),o=Math.ceil(f/ut),l=o>l?o+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,n=u,u=c,c=n),r=0;i;)r=(c[--i]=c[i]+u[i]+r)/Bt|0,c[i]%=Bt;for(r&&(c.unshift(r),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,gt?Je(t,f):t}function _a(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Zs+e)}function ga(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)n=e[t]+"",r=ut-n.length,r&&(i+=Oi(r)),i+=n;o=e[t],n=o+"",r=ut-n.length,r&&(i+=Oi(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var Ya=function(){function e(n,a){var i,o=0,l=n.length;for(n=n.slice();l--;)i=n[l]*a+o,n[l]=i%Bt|0,o=i/Bt|0;return o&&n.unshift(o),n}function t(n,a,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=a[l]){c=n[l]>a[l]?1:-1;break}return c}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]<a[i]?1:0,n[i]=o*Bt+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,o){var l,c,u,d,f,h,p,v,m,g,y,x,w,S,j,_,N,k,O=n.constructor,E=n.s==a.s?1:-1,A=n.d,R=a.d;if(!n.s)return new O(n);if(!a.s)throw Error(kn+"Division by zero");for(c=n.e-a.e,N=R.length,j=A.length,p=new O(E),v=p.d=[],u=0;R[u]==(A[u]||0);)++u;if(R[u]>(A[u]||0)&&--c,i==null?x=i=O.precision:o?x=i+(At(n)-At(a))+1:x=i,x<0)return new O(0);if(x=x/ut+2|0,u=0,N==1)for(d=0,R=R[0],x++;(u<j||d)&&x--;u++)w=d*Bt+(A[u]||0),v[u]=w/R|0,d=w%R|0;else{for(d=Bt/(R[0]+1)|0,d>1&&(R=e(R,d),A=e(A,d),N=R.length,j=A.length),S=N,m=A.slice(0,N),g=m.length;g<N;)m[g++]=0;k=R.slice(),k.unshift(0),_=R[0],R[1]>=Bt/2&&++_;do d=0,l=t(R,m,N,g),l<0?(y=m[0],N!=g&&(y=y*Bt+(m[1]||0)),d=y/_|0,d>1?(d>=Bt&&(d=Bt-1),f=e(R,d),h=f.length,g=m.length,l=t(f,m,h,g),l==1&&(d--,r(f,N<h?k:R,h))):(d==0&&(l=d=1),f=R.slice()),h=f.length,h<g&&f.unshift(0),r(m,f,g),l==-1&&(g=m.length,l=t(R,m,N,g),l<1&&(d++,r(m,N<g?k:R,g))),g=m.length):l===0&&(d++,m=[0]),v[u++]=d,l&&m[0]?m[g++]=A[S]||0:(m=[A[S]],g=1);while((S++<j||m[0]!==void 0)&&x--)}return v[0]||v.shift(),p.e=c,Je(p,o?i+At(p)+1:i)}}();function eL(e,t){var r,n,a,i,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(At(e)>16)throw Error(MS+At(e));if(!e.s)return new d(Yr);for(t==null?(gt=!1,l=f):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(Ps(2,u))/Math.LN10*2+5|0,l+=n,r=a=i=new d(Yr),d.precision=l;;){if(a=Je(a.times(e),l),r=r.times(++c),o=i.plus(Ya(a,r,l)),ga(o.d).slice(0,l)===ga(i.d).slice(0,l)){for(;u--;)i=Je(i.times(i),l);return d.precision=f,t==null?(gt=!0,Je(i,f)):i}i=o}}function At(e){for(var t=e.e*ut,r=e.d[0];r>=10;r/=10)t++;return t}function Ox(e,t,r){if(t>e.LN10.sd())throw gt=!0,r&&(e.precision=r),Error(kn+"LN10 precision limit exceeded");return Je(new e(e.LN10),t)}function Oi(e){for(var t="";e--;)t+="0";return t}function Jd(e,t){var r,n,a,i,o,l,c,u,d,f=1,h=10,p=e,v=p.d,m=p.constructor,g=m.precision;if(p.s<1)throw Error(kn+(p.s?"NaN":"-Infinity"));if(p.eq(Yr))return new m(0);if(t==null?(gt=!1,u=g):u=t,p.eq(10))return t==null&&(gt=!0),Ox(m,u);if(u+=h,m.precision=u,r=ga(v),n=r.charAt(0),i=At(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=ga(p.d),n=r.charAt(0),f++;i=At(p),n>1?(p=new m("0."+r),i++):p=new m(n+"."+r.slice(1))}else return c=Ox(m,u+2,g).times(i+""),p=Jd(new m(n+"."+r.slice(1)),u-h).plus(c),m.precision=g,t==null?(gt=!0,Je(p,g)):p;for(l=o=p=Ya(p.minus(Yr),p.plus(Yr),u),d=Je(p.times(p),u),a=3;;){if(o=Je(o.times(d),u),c=l.plus(Ya(o,new m(a),u)),ga(c.d).slice(0,u)===ga(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(Ox(m,u+2,g).times(i+""))),l=Ya(l,new m(f),u),m.precision=g,t==null?(gt=!0,Je(l,g)):l;l=c,a+=2}}function cE(e,t){var r,n,a;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(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=tu(r/ut),e.d=[],n=(r+1)%ut,r<0&&(n+=ut),n<a){for(n&&e.d.push(+t.slice(0,n)),a-=ut;n<a;)e.d.push(+t.slice(n,n+=ut));t=t.slice(n),n=ut-t.length}else n-=a;for(;n--;)t+="0";if(e.d.push(+t),gt&&(e.e>Rm||e.e<-Rm))throw Error(MS+r)}else e.s=0,e.e=0,e.d=[0];return e}function Je(e,t,r){var n,a,i,o,l,c,u,d,f=e.d;for(o=1,i=f[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=ut,a=t,u=f[d=0];else{if(d=Math.ceil((n+1)/ut),i=f.length,d>=i)return e;for(u=i=f[d],o=1;i>=10;i/=10)o++;n%=ut,a=n-ut+o}if(r!==void 0&&(i=Ps(10,o-a-1),l=u/i%10|0,c=t<0||f[d+1]!==void 0||u%i,c=r<4?(l||c)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?a>0?u/Ps(10,o-a):0:f[d-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return c?(i=At(e),f.length=1,t=t-i-1,f[0]=Ps(10,(ut-t%ut)%ut),e.e=tu(-t/ut)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=d,i=1,d--):(f.length=d+1,i=Ps(10,ut-n),f[d]=a>0?(u/Ps(10,o-a)%Ps(10,a)|0)*i:0),c)for(;;)if(d==0){(f[0]+=i)==Bt&&(f[0]=1,++e.e);break}else{if(f[d]+=i,f[d]!=Bt)break;f[d--]=0,i=1}for(n=f.length;f[--n]===0;)f.pop();if(gt&&(e.e>Rm||e.e<-Rm))throw Error(MS+At(e));return e}function tL(e,t){var r,n,a,i,o,l,c,u,d,f,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),gt?Je(t,p):t;if(c=e.d,f=t.d,n=t.e,u=e.e,c=c.slice(),o=u-n,o){for(d=o<0,d?(r=c,o=-o,l=f.length):(r=f,n=u,l=c.length),a=Math.max(Math.ceil(p/ut),l)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=c.length,l=f.length,d=a<l,d&&(l=a),a=0;a<l;a++)if(c[a]!=f[a]){d=c[a]<f[a];break}o=0}for(d&&(r=c,c=f,f=r,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>o;){if(c[--a]<f[a]){for(i=a;i&&c[--i]===0;)c[i]=Bt-1;--c[i],c[a]+=Bt}c[a]-=f[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(t.d=c,t.e=n,gt?Je(t,p):t):new h(0)}function go(e,t,r){var n,a=At(e),i=ga(e.d),o=i.length;return t?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+Oi(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Oi(-a-1)+i,r&&(n=r-o)>0&&(i+=Oi(n))):a>=o?(i+=Oi(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+Oi(n))):((n=a+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(a+1===o&&(i+="."),i+=Oi(n))),e.s<0?"-"+i:i}function uE(e,t){if(e.length>t)return e.length=t,!0}function rL(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Zs+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return cE(o,i.toString())}else if(typeof i!="string")throw Error(Zs+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,_me.test(i))cE(o,i);else throw Error(Zs+i)}if(a.prototype=de,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=rL,a.config=a.set=Nme,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 a.config(e),a}function Nme(e){if(!e||typeof e!="object")throw Error(kn+"Object expected");var t,r,n,a=["precision",1,eu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((n=e[r=a[t]])!==void 0)if(tu(n)===n&&n>=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(Zs+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Zs+r+": "+n);return this}var IS=rL(Sme);Yr=new IS(1);const Ye=IS;function kme(e){return Pme(e)||Eme(e)||Cme(e)||Ome()}function Ome(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
620In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cme(e,t){if(e){if(typeof e=="string")return ew(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ew(e,t)}}function Eme(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Pme(e){if(Array.isArray(e))return ew(e)}function ew(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ame=function(t){return t},nL={"@@functional/placeholder":!0},aL=function(t){return t===nL},dE=function(t){return function r(){return arguments.length===0||arguments.length===1&&aL(arguments.length<=0?void 0:arguments[0])?r:t.apply(void 0,arguments)}},Tme=function e(t,r){return t===1?r:dE(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var o=a.filter(function(l){return l!==nL}).length;return o>=t?r.apply(void 0,a):e(t-o,dE(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=a.map(function(f){return aL(f)?c.shift():f});return r.apply(void 0,kme(d).concat(c))}))})},Uv=function(t){return Tme(t.length,t)},tw=function(t,r){for(var n=[],a=t;a<r;++a)n[a-t]=a;return n},$me=Uv(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(r){return t[r]}).map(e)}),Rme=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(!r.length)return Ame;var a=r.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},rw=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},iL=function(t){var r=null,n=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return r&&i.every(function(l,c){return l===r[c]})||(r=i,n=t.apply(void 0,i)),n}};function Mme(e){var t;return e===0?t=1:t=Math.floor(new Ye(e).abs().log(10).toNumber())+1,t}function Ime(e,t,r){for(var n=new Ye(e),a=0,i=[];n.lt(t)&&a<1e5;)i.push(n.toNumber()),n=n.add(r),a++;return i}var Dme=Uv(function(e,t,r){var n=+e,a=+t;return n+r*(a-n)}),Lme=Uv(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),Fme=Uv(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});const zv={rangeStep:Ime,getDigitCount:Mme,interpolateNumber:Dme,uninterpolateNumber:Lme,uninterpolateTruncation:Fme};function nw(e){return zme(e)||Ume(e)||sL(e)||Bme()}function Bme(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
621In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ume(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function zme(e){if(Array.isArray(e))return aw(e)}function Zd(e,t){return Hme(e)||Wme(e,t)||sL(e,t)||qme()}function qme(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
622In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sL(e,t){if(e){if(typeof e=="string")return aw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aw(e,t)}}function aw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wme(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(t&&r.length===t));n=!0);}catch(c){a=!0,i=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function Hme(e){if(Array.isArray(e))return e}function oL(e){var t=Zd(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function lL(e,t,r){if(e.lte(0))return new Ye(0);var n=zv.getDigitCount(e.toNumber()),a=new Ye(10).pow(n),i=e.div(a),o=n!==1?.05:.1,l=new Ye(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(a);return t?c:new Ye(Math.ceil(c))}function Vme(e,t,r){var n=1,a=new Ye(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new Ye(10).pow(zv.getDigitCount(e)-1),a=new Ye(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new Ye(Math.floor(e)))}else e===0?a=new Ye(Math.floor((t-1)/2)):r||(a=new Ye(Math.floor(e)));var o=Math.floor((t-1)/2),l=Rme($me(function(c){return a.add(new Ye(c-o).mul(n)).toNumber()}),tw);return l(0,t)}function cL(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Ye(0),tickMin:new Ye(0),tickMax:new Ye(0)};var i=lL(new Ye(t).sub(e).div(r-1),n,a),o;e<=0&&t>=0?o=new Ye(0):(o=new Ye(e).add(t).div(2),o=o.sub(new Ye(o).mod(i)));var l=Math.ceil(o.sub(e).div(i).toNumber()),c=Math.ceil(new Ye(t).sub(o).div(i).toNumber()),u=l+c+1;return u>r?cL(e,t,r,n,a+1):(u<r&&(c=t>0?c+(r-u):c,l=t>0?l:l+(r-u)),{step:i,tickMin:o.sub(new Ye(l).mul(i)),tickMax:o.add(new Ye(c).mul(i))})}function Kme(e){var t=Zd(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),l=oL([r,n]),c=Zd(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(nw(tw(0,a-1).map(function(){return 1/0}))):[].concat(nw(tw(0,a-1).map(function(){return-1/0})),[d]);return r>n?rw(f):f}if(u===d)return Vme(u,a,i);var h=cL(u,d,o,i),p=h.step,v=h.tickMin,m=h.tickMax,g=zv.rangeStep(v,m.add(new Ye(.1).mul(p)),p);return r>n?rw(g):g}function Gme(e,t){var r=Zd(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=oL([n,a]),l=Zd(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,a];if(c===u)return[c];var d=Math.max(t,2),f=lL(new Ye(u).sub(c).div(d-1),i,0),h=[].concat(nw(zv.rangeStep(new Ye(c),new Ye(u).sub(new Ye(.99).mul(f)),f)),[u]);return n>a?rw(h):h}var Yme=iL(Kme),Xme=iL(Gme),Qme="Invariant failed";function vo(e,t){throw new Error(Qme)}var Jme=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function dc(e){"@babel/helpers - typeof";return dc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dc(e)}function Mm(){return Mm=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},Mm.apply(this,arguments)}function Zme(e,t){return nge(e)||rge(e,t)||tge(e,t)||ege()}function ege(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
623In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tge(e,t){if(e){if(typeof e=="string")return fE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fE(e,t)}}function fE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rge(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function nge(e){if(Array.isArray(e))return e}function age(e,t){if(e==null)return{};var r=ige(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ige(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function sge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oge(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,fL(n.key),n)}}function lge(e,t,r){return t&&oge(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function cge(e,t,r){return t=Im(t),uge(e,uL()?Reflect.construct(t,r||[],Im(e).constructor):t.apply(e,r))}function uge(e,t){if(t&&(dc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dge(e)}function dge(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uL=function(){return!!e})()}function Im(e){return Im=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Im(e)}function fge(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&iw(e,t)}function iw(e,t){return iw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},iw(e,t)}function dL(e,t,r){return t=fL(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fL(e){var t=hge(e,"string");return dc(t)=="symbol"?t:t+""}function hge(e,t){if(dc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(dc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qv=function(e){function t(){return sge(this,t),cge(this,t,arguments)}return fge(t,e),lge(t,[{key:"render",value:function(){var n=this.props,a=n.offset,i=n.layout,o=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,d=n.xAxis,f=n.yAxis,h=age(n,Jme),p=_e(h,!1);this.props.direction==="x"&&d.type!=="number"&&vo();var v=c.map(function(m){var g=u(m,l),y=g.x,x=g.y,w=g.value,S=g.errorVal;if(!S)return null;var j=[],_,N;if(Array.isArray(S)){var k=Zme(S,2);_=k[0],N=k[1]}else _=N=S;if(i==="vertical"){var O=d.scale,E=x+a,A=E+o,R=E-o,T=O(w-_),I=O(w+N);j.push({x1:I,y1:A,x2:I,y2:R}),j.push({x1:T,y1:E,x2:I,y2:E}),j.push({x1:T,y1:A,x2:T,y2:R})}else if(i==="horizontal"){var F=f.scale,P=y+a,D=P-o,M=P+o,$=F(w-_),z=F(w+N);j.push({x1:D,y1:z,x2:M,y2:z}),j.push({x1:P,y1:$,x2:P,y2:z}),j.push({x1:D,y1:$,x2:M,y2:$})}return C.createElement(He,Mm({className:"recharts-errorBar",key:"bar-".concat(j.map(function(K){return"".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))},p),j.map(function(K){return C.createElement("line",Mm({},K,{key:"line-".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))}))});return C.createElement(He,{className:"recharts-errorBars"},v)}}])}(C.Component);dL(qv,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});dL(qv,"displayName","ErrorBar");function ef(e){"@babel/helpers - typeof";return ef=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ef(e)}function hE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ws(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hE(Object(r),!0).forEach(function(n){pge(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pge(e,t,r){return t=mge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mge(e){var t=gge(e,"string");return ef(t)=="symbol"?t:t+""}function gge(e,t){if(ef(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ef(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hL=function(t){var r=t.children,n=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Vr(r,Pl);if(!o)return null;var l=Pl.defaultProps,c=l!==void 0?ws(ws({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:i==="children"?u=(n||[]).reduce(function(d,f){var h=f.item,p=f.props,v=p.sectors||p.data||[];return d.concat(v.map(function(m){return{type:o.props.iconType||h.props.legendType,value:m.name,color:m.fill,payload:m}}))},[]):u=(n||[]).map(function(d){var f=d.item,h=f.type.defaultProps,p=h!==void 0?ws(ws({},h),f.props):{},v=p.dataKey,m=p.name,g=p.legendType,y=p.hide;return{inactive:y,dataKey:v,type:c.iconType||g||"square",color:DS(f),value:m||v,payload:p}}),ws(ws(ws({},c),Pl.getWithHeight(o,a)),{},{payload:u,item:o})};function tf(e){"@babel/helpers - typeof";return tf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tf(e)}function pE(e){return bge(e)||xge(e)||yge(e)||vge()}function vge(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
624In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yge(e,t){if(e){if(typeof e=="string")return sw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sw(e,t)}}function xge(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function bge(e){if(Array.isArray(e))return sw(e)}function sw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function _t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mE(Object(r),!0).forEach(function(n){Tl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tl(e,t,r){return t=wge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wge(e){var t=jge(e,"string");return tf(t)=="symbol"?t:t+""}function jge(e,t){if(tf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(tf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hr(e,t,r){return $e(e)||$e(t)?r:Lt(t)?tn(e,t,r):ke(t)?t(e):r}function Zu(e,t,r,n){var a=xme(e,function(l){return hr(l,t)});if(r==="number"){var i=a.filter(function(l){return ae(l)||parseFloat(l)});return i.length?[Fv(i),Lv(i)]:[1/0,-1/0]}var o=n?a.filter(function(l){return!$e(l)}):a;return o.map(function(l){return Lt(l)||l instanceof Date?l:""})}var Sge=function(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,u=0;u<l;u++){var d=u>0?a[u-1].coordinate:a[l-1].coordinate,f=a[u].coordinate,h=u>=l-1?a[0].coordinate:a[u+1].coordinate,p=void 0;if(Sr(f-d)!==Sr(h-f)){var v=[];if(Sr(h-f)===Sr(c[1]-c[0])){p=h;var m=f+c[1]-c[0];v[0]=Math.min(m,(m+d)/2),v[1]=Math.max(m,(m+d)/2)}else{p=d;var g=h+c[1]-c[0];v[0]=Math.min(f,(g+f)/2),v[1]=Math.max(f,(g+f)/2)}var y=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>y[0]&&t<=y[1]||t>=v[0]&&t<=v[1]){o=a[u].index;break}}else{var x=Math.min(d,h),w=Math.max(d,h);if(t>(x+f)/2&&t<=(w+f)/2){o=a[u].index;break}}}else for(var S=0;S<l;S++)if(S===0&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S>0&&S<l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===l-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},DS=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?_t(_t({},t.type.defaultProps),t.props):t.props,o=i.stroke,l=i.fill,c;switch(a){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},_ge=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},l=Object.keys(i),c=0,u=l.length;c<u;c++)for(var d=i[l[c]].stackGroups,f=Object.keys(d),h=0,p=f.length;h<p;h++){var v=d[f[h]],m=v.items,g=v.cateAxisId,y=m.filter(function(N){return Ka(N.type).indexOf("Bar")>=0});if(y&&y.length){var x=y[0].type.defaultProps,w=x!==void 0?_t(_t({},x),y[0].props):y[0].props,S=w.barSize,j=w[g];o[j]||(o[j]=[]);var _=$e(S)?r:S;o[j].push({item:y[0],stackList:y.slice(1),barSize:$e(_)?void 0:_r(_,n,0)})}}return o},Nge=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=_r(r,a,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=a/c,v=o.reduce(function(S,j){return S+j.barSize||0},0);v+=(c-1)*u,v>=a&&(v-=(c-1)*u,u=0),v>=a&&p>0&&(h=!0,p*=.9,v=c*p);var m=(a-v)/2>>0,g={offset:m-u,size:0};d=o.reduce(function(S,j){var _={item:j.item,position:{offset:g.offset+g.size+u,size:h?p:j.barSize}},N=[].concat(pE(S),[_]);return g=N[N.length-1].position,j.stackList&&j.stackList.length&&j.stackList.forEach(function(k){N.push({item:k,position:g})}),N},f)}else{var y=_r(n,a,0,!0);a-2*y-(c-1)*u<=0&&(u=0);var x=(a-2*y-(c-1)*u)/c;x>1&&(x>>=0);var w=l===+l?Math.min(x,l):x;d=o.reduce(function(S,j,_){var N=[].concat(pE(S),[{item:j.item,position:{offset:y+(x+u)*_+(x-w)/2,size:w}}]);return j.stackList&&j.stackList.length&&j.stackList.forEach(function(k){N.push({item:k,position:N[N.length-1].position})}),N},f)}return d},kge=function(t,r,n,a){var i=n.children,o=n.width,l=n.margin,c=o-(l.left||0)-(l.right||0),u=hL({children:i,legendWidth:c});if(u){var d=a||{},f=d.width,h=d.height,p=u.align,v=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&v==="middle")&&p!=="center"&&ae(t[p]))return _t(_t({},t),{},Tl({},p,t[p]+(f||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&v!=="middle"&&ae(t[v]))return _t(_t({},t),{},Tl({},v,t[v]+(h||0)))}return t},Oge=function(t,r,n){return $e(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},pL=function(t,r,n,a,i){var o=r.props.children,l=wn(o,qv).filter(function(u){return Oge(a,i,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=hr(d,n);if($e(f))return u;var h=Array.isArray(f)?[Fv(f),Lv(f)]:[f,f],p=c.reduce(function(v,m){var g=hr(d,m,0),y=h[0]-Math.abs(Array.isArray(g)?g[0]:g),x=h[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(y,v[0]),Math.max(x,v[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},Cge=function(t,r,n,a,i){var o=r.map(function(l){return pL(t,l,n,i,a)}).filter(function(l){return!$e(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},mL=function(t,r,n,a,i){var o=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&pL(t,c,u,a)||Zu(t,u,n,i)});if(n==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},gL=function(t,r){return t==="horizontal"&&r==="xAxis"||t==="vertical"&&r==="yAxis"||t==="centric"&&r==="angleAxis"||t==="radial"&&r==="radiusAxis"},vL=function(t,r,n,a){if(a)return t.map(function(c){return c.coordinate});var i,o,l=t.map(function(c){return c.coordinate===r&&(i=!0),c.coordinate===n&&(o=!0),c.coordinate});return i||l.push(r),o||l.push(n),l},Ha=function(t,r,n){if(!t)return null;var a=t.scale,i=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(r||n)&&o==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Sr(l[0]-l[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=i?i.indexOf(f):f;return{coordinate:a(h)+u,value:f,offset:u}});return d.filter(function(f){return!qf(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:a(f)+u,value:f,index:h,offset:u}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+u,value:f,offset:u}}):a.domain().map(function(f,h){return{coordinate:a(f)+u,value:i?i[f]:f,index:h,offset:u}})},Cx=new WeakMap,qh=function(t,r){if(typeof r!="function")return t;Cx.has(t)||Cx.set(t,new WeakMap);var n=Cx.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},yL=function(t,r,n){var a=t.scale,i=t.type,o=t.layout,l=t.axisType;if(a==="auto")return o==="radial"&&l==="radiusAxis"?{scale:Kd(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:Pm(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Ju(),realScaleType:"point"}:i==="category"?{scale:Kd(),realScaleType:"band"}:{scale:Pm(),realScaleType:"linear"};if(ho(a)){var c="scale".concat(_v(a));return{scale:(lE[c]||Ju)(),realScaleType:lE[c]?c:"point"}}return ke(a)?{scale:a}:{scale:Ju(),realScaleType:"point"}},gE=1e-4,xL=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-gE,o=Math.max(a[0],a[1])+gE,l=t(r[0]),c=t(r[n-1]);(l<i||l>o||c<i||c>o)&&t.domain([r[0],r[n-1]])}},Ege=function(t,r){if(!t)return null;for(var n=0,a=t.length;n<a;n++)if(t[n].item===r)return t[n].position;return null},Pge=function(t,r){if(!r||r.length!==2||!ae(r[0])||!ae(r[1]))return t;var n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]),i=[t[0],t[1]];return(!ae(t[0])||t[0]<n)&&(i[0]=n),(!ae(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<n&&(i[1]=n),i},Age=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,o=0,l=0;l<r;++l){var c=qf(t[l][n][1])?t[l][n][0]:t[l][n][1];c>=0?(t[l][n][0]=i,t[l][n][1]=i+c,i=t[l][n][1]):(t[l][n][0]=o,t[l][n][1]=o+c,o=t[l][n][1])}},Tge=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n<a;++n)for(var i=0,o=0;o<r;++o){var l=qf(t[o][n][1])?t[o][n][0]:t[o][n][1];l>=0?(t[o][n][0]=i,t[o][n][1]=i+l,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},$ge={sign:Age,expand:Jre,none:nc,silhouette:Zre,wiggle:ene,positive:Tge},Rge=function(t,r,n){var a=r.map(function(l){return l.props.dataKey}),i=$ge[n],o=Qre().keys(a).value(function(l,c){return+hr(l,c,0)}).order(Ab).offset(i);return o(t)},Mge=function(t,r,n,a,i,o){if(!t)return null;var l=o?r.reverse():r,c={},u=l.reduce(function(f,h){var p,v=(p=h.type)!==null&&p!==void 0&&p.defaultProps?_t(_t({},h.type.defaultProps),h.props):h.props,m=v.stackId,g=v.hide;if(g)return f;var y=v[n],x=f[y]||{hasStack:!1,stackGroups:{}};if(Lt(m)){var w=x.stackGroups[m]||{numericAxisId:n,cateAxisId:a,items:[]};w.items.push(h),x.hasStack=!0,x.stackGroups[m]=w}else x.stackGroups[Wf("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[h]};return _t(_t({},f),{},Tl({},y,x))},c),d={};return Object.keys(u).reduce(function(f,h){var p=u[h];if(p.hasStack){var v={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,g){var y=p.stackGroups[g];return _t(_t({},m),{},Tl({},g,{numericAxisId:n,cateAxisId:a,items:y.items,stackedData:Rge(t,y.items,i)}))},v)}return _t(_t({},f),{},Tl({},h,p))},d)},bL=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=Yme(u,i,l);return t.domain([Fv(d),Lv(d)]),{niceTicks:d}}if(i&&a==="number"){var f=t.domain(),h=Xme(f,i,l);return{niceTicks:h}}return null},vE=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,l=t.index;if(r.type==="category")return n[l]?n[l].coordinate+a:null;var c=hr(o,r.dataKey,r.domain[l]);return $e(c)?null:r.scale(c)-i/2+a},Ige=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},Dge=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?_t(_t({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(Lt(i)){var o=r[i];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},Lge=function(t){return t.reduce(function(r,n){return[Fv(n.concat([r[0]]).filter(ae)),Lv(n.concat([r[1]]).filter(ae))]},[1/0,-1/0])},wL=function(t,r,n){return Object.keys(t).reduce(function(a,i){var o=t[i],l=o.stackedData,c=l.reduce(function(u,d){var f=Lge(d.slice(r,n+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},yE=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,xE=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ow=function(t,r,n){if(ke(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(ae(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(yE.test(t[0])){var i=+yE.exec(t[0])[1];a[0]=r[0]-i}else ke(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(ae(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(xE.test(t[1])){var o=+xE.exec(t[1])[1];a[1]=r[1]+o}else ke(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},Dm=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=dS(r,function(f){return f.coordinate}),o=1/0,l=1,c=i.length;l<c;l++){var u=i[l],d=i[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},bE=function(t,r,n){return!t||!t.length||Bv(t,tn(n,"type.defaultProps.domain"))?r:t},jL=function(t,r){var n=t.type.defaultProps?_t(_t({},t.type.defaultProps),t.props):t.props,a=n.dataKey,i=n.name,o=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,d=n.hide;return _t(_t({},_e(t,!1)),{},{dataKey:a,unit:o,formatter:l,name:i||a,color:DS(t),value:hr(r,a),type:c,payload:r,chartType:u,hide:d})};function rf(e){"@babel/helpers - typeof";return rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rf(e)}function wE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Da(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wE(Object(r),!0).forEach(function(n){SL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function SL(e,t,r){return t=Fge(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fge(e){var t=Bge(e,"string");return rf(t)=="symbol"?t:t+""}function Bge(e,t){if(rf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(rf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Uge(e,t){return Hge(e)||Wge(e,t)||qge(e,t)||zge()}function zge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
625In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qge(e,t){if(e){if(typeof e=="string")return jE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jE(e,t)}}function jE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wge(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Hge(e){if(Array.isArray(e))return e}var Lm=Math.PI/180,Vge=function(t){return t*180/Math.PI},at=function(t,r,n,a){return{x:t+Math.cos(-Lm*a)*n,y:r+Math.sin(-Lm*a)*n}},_L=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},Kge=function(t,r,n,a,i){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=_r(t.cx,o,o/2),f=_r(t.cy,l,l/2),h=_L(o,l,n),p=_r(t.innerRadius,h,0),v=_r(t.outerRadius,h,h*.8),m=Object.keys(r);return m.reduce(function(g,y){var x=r[y],w=x.domain,S=x.reversed,j;if($e(x.range))a==="angleAxis"?j=[c,u]:a==="radiusAxis"&&(j=[p,v]),S&&(j=[j[1],j[0]]);else{j=x.range;var _=j,N=Uge(_,2);c=N[0],u=N[1]}var k=yL(x,i),O=k.realScaleType,E=k.scale;E.domain(w).range(j),xL(E);var A=bL(E,Da(Da({},x),{},{realScaleType:O})),R=Da(Da(Da({},x),A),{},{range:j,radius:v,realScaleType:O,scale:E,cx:d,cy:f,innerRadius:p,outerRadius:v,startAngle:c,endAngle:u});return Da(Da({},g),{},SL({},y,R))},{})},Gge=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},Yge=function(t,r){var n=t.x,a=t.y,i=r.cx,o=r.cy,l=Gge({x:n,y:a},{x:i,y:o});if(l<=0)return{radius:l};var c=(n-i)/l,u=Math.acos(c);return a>o&&(u=2*Math.PI-u),{radius:l,angle:Vge(u),angleInRadian:u}},Xge=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},Qge=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),l=Math.min(i,o);return t+l*360},SE=function(t,r){var n=t.x,a=t.y,i=Yge({x:n,y:a},r),o=i.radius,l=i.angle,c=r.innerRadius,u=r.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=Xge(r),f=d.startAngle,h=d.endAngle,p=l,v;if(f<=h){for(;p>h;)p-=360;for(;p<f;)p+=360;v=p>=f&&p<=h}else{for(;p>f;)p-=360;for(;p<h;)p+=360;v=p>=h&&p<=f}return v?Da(Da({},r),{},{radius:o,angle:Qge(p,r)}):null},NL=function(t){return!b.isValidElement(t)&&!ke(t)&&typeof t!="boolean"?t.className:""};function nf(e){"@babel/helpers - typeof";return nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nf(e)}var Jge=["offset"];function Zge(e){return nve(e)||rve(e)||tve(e)||eve()}function eve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
626In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tve(e,t){if(e){if(typeof e=="string")return lw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lw(e,t)}}function rve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nve(e){if(Array.isArray(e))return lw(e)}function lw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ave(e,t){if(e==null)return{};var r=ive(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ive(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Mt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_E(Object(r),!0).forEach(function(n){sve(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_E(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sve(e,t,r){return t=ove(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ove(e){var t=lve(e,"string");return nf(t)=="symbol"?t:t+""}function lve(e,t){if(nf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(nf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function af(){return af=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},af.apply(this,arguments)}var cve=function(t){var r=t.value,n=t.formatter,a=$e(t.children)?r:t.children;return ke(n)?n(a):a},uve=function(t,r){var n=Sr(r-t),a=Math.min(Math.abs(r-t),360);return n*a},dve=function(t,r,n){var a=t.position,i=t.viewBox,o=t.offset,l=t.className,c=i,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,p=c.startAngle,v=c.endAngle,m=c.clockWise,g=(f+h)/2,y=uve(p,v),x=y>=0?1:-1,w,S;a==="insideStart"?(w=p+x*o,S=m):a==="insideEnd"?(w=v-x*o,S=!m):a==="end"&&(w=v+x*o,S=m),S=y<=0?S:!S;var j=at(u,d,g,w),_=at(u,d,g,w+(S?1:-1)*359),N="M".concat(j.x,",").concat(j.y,`
627    A`).concat(g,",").concat(g,",0,1,").concat(S?0:1,`,
628    `).concat(_.x,",").concat(_.y),k=$e(t.id)?Wf("recharts-radial-line-"):t.id;return C.createElement("text",af({},n,{dominantBaseline:"central",className:Te("recharts-radial-bar-label",l)}),C.createElement("defs",null,C.createElement("path",{id:k,d:N})),C.createElement("textPath",{xlinkHref:"#".concat(k)},r))},fve=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,o=i.cx,l=i.cy,c=i.innerRadius,u=i.outerRadius,d=i.startAngle,f=i.endAngle,h=(d+f)/2;if(a==="outside"){var p=at(o,l,u+n,h),v=p.x,m=p.y;return{x:v,y:m,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var g=(c+u)/2,y=at(o,l,g,h),x=y.x,w=y.y;return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},hve=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,o=r,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*a,p=f>0?"end":"start",v=f>0?"start":"end",m=u>=0?1:-1,g=m*a,y=m>0?"end":"start",x=m>0?"start":"end";if(i==="top"){var w={x:l+u/2,y:c-f*a,textAnchor:"middle",verticalAnchor:p};return Mt(Mt({},w),n?{height:Math.max(c-n.y,0),width:u}:{})}if(i==="bottom"){var S={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:v};return Mt(Mt({},S),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(i==="left"){var j={x:l-g,y:c+d/2,textAnchor:y,verticalAnchor:"middle"};return Mt(Mt({},j),n?{width:Math.max(j.x-n.x,0),height:d}:{})}if(i==="right"){var _={x:l+u+g,y:c+d/2,textAnchor:x,verticalAnchor:"middle"};return Mt(Mt({},_),n?{width:Math.max(n.x+n.width-_.x,0),height:d}:{})}var N=n?{width:u,height:d}:{};return i==="insideLeft"?Mt({x:l+g,y:c+d/2,textAnchor:x,verticalAnchor:"middle"},N):i==="insideRight"?Mt({x:l+u-g,y:c+d/2,textAnchor:y,verticalAnchor:"middle"},N):i==="insideTop"?Mt({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:v},N):i==="insideBottom"?Mt({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:p},N):i==="insideTopLeft"?Mt({x:l+g,y:c+h,textAnchor:x,verticalAnchor:v},N):i==="insideTopRight"?Mt({x:l+u-g,y:c+h,textAnchor:y,verticalAnchor:v},N):i==="insideBottomLeft"?Mt({x:l+g,y:c+d-h,textAnchor:x,verticalAnchor:p},N):i==="insideBottomRight"?Mt({x:l+u-g,y:c+d-h,textAnchor:y,verticalAnchor:p},N):Vc(i)&&(ae(i.x)||Fs(i.x))&&(ae(i.y)||Fs(i.y))?Mt({x:l+_r(i.x,u),y:c+_r(i.y,d),textAnchor:"end",verticalAnchor:"end"},N):Mt({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},N)},pve=function(t){return"cx"in t&&ae(t.cx)};function qt(e){var t=e.offset,r=t===void 0?5:t,n=ave(e,Jge),a=Mt({offset:r},n),i=a.viewBox,o=a.position,l=a.value,c=a.children,u=a.content,d=a.className,f=d===void 0?"":d,h=a.textBreakAll;if(!i||$e(l)&&$e(c)&&!b.isValidElement(u)&&!ke(u))return null;if(b.isValidElement(u))return b.cloneElement(u,a);var p;if(ke(u)){if(p=b.createElement(u,a),b.isValidElement(p))return p}else p=cve(a);var v=pve(i),m=_e(a,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return dve(a,p,m);var g=v?fve(a):hve(a);return C.createElement(mo,af({className:Te("recharts-label",f)},m,g,{breakAll:h}),p)}qt.displayName="Label";var kL=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,p=t.top,v=t.left,m=t.width,g=t.height,y=t.clockWise,x=t.labelViewBox;if(x)return x;if(ae(m)&&ae(g)){if(ae(f)&&ae(h))return{x:f,y:h,width:m,height:g};if(ae(p)&&ae(v))return{x:p,y:v,width:m,height:g}}return ae(f)&&ae(h)?{x:f,y:h,width:0,height:0}:ae(r)&&ae(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:y}:t.viewBox?t.viewBox:{}},mve=function(t,r){return t?t===!0?C.createElement(qt,{key:"label-implicit",viewBox:r}):Lt(t)?C.createElement(qt,{key:"label-implicit",viewBox:r,value:t}):b.isValidElement(t)?t.type===qt?b.cloneElement(t,{key:"label-implicit",viewBox:r}):C.createElement(qt,{key:"label-implicit",content:t,viewBox:r}):ke(t)?C.createElement(qt,{key:"label-implicit",content:t,viewBox:r}):Vc(t)?C.createElement(qt,af({viewBox:r},t,{key:"label-implicit"})):null:null},gve=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=kL(t),o=wn(a,qt).map(function(c,u){return b.cloneElement(c,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return o;var l=mve(t.label,r||i);return[l].concat(Zge(o))};qt.parseViewBox=kL;qt.renderCallByParent=gve;function vve(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var yve=vve;const xve=qe(yve);function sf(e){"@babel/helpers - typeof";return sf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sf(e)}var bve=["valueAccessor"],wve=["data","dataKey","clockWise","id","textBreakAll"];function jve(e){return kve(e)||Nve(e)||_ve(e)||Sve()}function Sve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
629In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ve(e,t){if(e){if(typeof e=="string")return cw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cw(e,t)}}function Nve(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kve(e){if(Array.isArray(e))return cw(e)}function cw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Fm(){return Fm=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},Fm.apply(this,arguments)}function NE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function kE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?NE(Object(r),!0).forEach(function(n){Ove(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ove(e,t,r){return t=Cve(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Cve(e){var t=Eve(e,"string");return sf(t)=="symbol"?t:t+""}function Eve(e,t){if(sf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(sf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OE(e,t){if(e==null)return{};var r=Pve(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pve(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Ave=function(t){return Array.isArray(t.value)?xve(t.value):t.value};function Ji(e){var t=e.valueAccessor,r=t===void 0?Ave:t,n=OE(e,bve),a=n.data,i=n.dataKey,o=n.clockWise,l=n.id,c=n.textBreakAll,u=OE(n,wve);return!a||!a.length?null:C.createElement(He,{className:"recharts-label-list"},a.map(function(d,f){var h=$e(i)?r(d,f):hr(d&&d.payload,i),p=$e(l)?{}:{id:"".concat(l,"-").concat(f)};return C.createElement(qt,Fm({},_e(d,!0),u,p,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:qt.parseViewBox($e(o)?d:kE(kE({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}Ji.displayName="LabelList";function Tve(e,t){return e?e===!0?C.createElement(Ji,{key:"labelList-implicit",data:t}):C.isValidElement(e)||ke(e)?C.createElement(Ji,{key:"labelList-implicit",data:t,content:e}):Vc(e)?C.createElement(Ji,Fm({data:t},e,{key:"labelList-implicit"})):null:null}function $ve(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=wn(n,Ji).map(function(o,l){return b.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!r)return a;var i=Tve(e.label,t);return[i].concat(jve(a))}Ji.renderCallByParent=$ve;function of(e){"@babel/helpers - typeof";return of=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},of(e)}function uw(){return uw=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},uw.apply(this,arguments)}function CE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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?CE(Object(r),!0).forEach(function(n){Rve(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rve(e,t,r){return t=Mve(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mve(e){var t=Ive(e,"string");return of(t)=="symbol"?t:t+""}function Ive(e,t){if(of(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(of(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dve=function(t,r){var n=Sr(r-t),a=Math.min(Math.abs(r-t),359.999);return n*a},Wh=function(t){var r=t.cx,n=t.cy,a=t.radius,i=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+a,f=Math.asin(c/d)/Lm,h=u?i:i+o*f,p=at(r,n,d,h),v=at(r,n,a,h),m=u?i-o*f:i,g=at(r,n,d*Math.cos(f*Lm),m);return{center:p,circleTangency:v,lineTangency:g,theta:f}},OL=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,l=t.endAngle,c=Dve(o,l),u=o+c,d=at(r,n,i,o),f=at(r,n,i,u),h="M ".concat(d.x,",").concat(d.y,`
630    A `).concat(i,",").concat(i,`,0,
631    `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
632    `).concat(f.x,",").concat(f.y,`
633  `);if(a>0){var p=at(r,n,a,o),v=at(r,n,a,u);h+="L ".concat(v.x,",").concat(v.y,`
634            A `).concat(a,",").concat(a,`,0,
635            `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
636            `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},Lve=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=Sr(d-u),h=Wh({cx:r,cy:n,radius:i,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),p=h.circleTangency,v=h.lineTangency,m=h.theta,g=Wh({cx:r,cy:n,radius:i,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),y=g.circleTangency,x=g.lineTangency,w=g.theta,S=c?Math.abs(u-d):Math.abs(u-d)-m-w;if(S<0)return l?"M ".concat(v.x,",").concat(v.y,`
637        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
638        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
639      `):OL({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:u,endAngle:d});var j="M ".concat(v.x,",").concat(v.y,`
640    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(p.x,",").concat(p.y,`
641    A`).concat(i,",").concat(i,",0,").concat(+(S>180),",").concat(+(f<0),",").concat(y.x,",").concat(y.y,`
642    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(x.x,",").concat(x.y,`
643  `);if(a>0){var _=Wh({cx:r,cy:n,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),N=_.circleTangency,k=_.lineTangency,O=_.theta,E=Wh({cx:r,cy:n,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),A=E.circleTangency,R=E.lineTangency,T=E.theta,I=c?Math.abs(u-d):Math.abs(u-d)-O-T;if(I<0&&o===0)return"".concat(j,"L").concat(r,",").concat(n,"Z");j+="L".concat(R.x,",").concat(R.y,`
644      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(A.x,",").concat(A.y,`
645      A`).concat(a,",").concat(a,",0,").concat(+(I>180),",").concat(+(f>0),",").concat(N.x,",").concat(N.y,`
646      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(k.x,",").concat(k.y,"Z")}else j+="L".concat(r,",").concat(n,"Z");return j},Fve={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},CL=function(t){var r=EE(EE({},Fve),t),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,f=r.endAngle,h=r.className;if(o<i||d===f)return null;var p=Te("recharts-sector",h),v=o-i,m=_r(l,v,0,!0),g;return m>0&&Math.abs(d-f)<360?g=Lve({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(m,v/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):g=OL({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:d,endAngle:f}),C.createElement("path",uw({},_e(r,!0),{className:p,d:g,role:"img"}))};function lf(e){"@babel/helpers - typeof";return lf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lf(e)}function dw(){return dw=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},dw.apply(this,arguments)}function PE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function AE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PE(Object(r),!0).forEach(function(n){Bve(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PE(Object(r)).forEac
646h(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Bve(e,t,r){return t=Uve(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Uve(e){var t=zve(e,"string");return lf(t)=="symbol"?t:t+""}function zve(e,t){if(lf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(lf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var TE={curveBasisClosed:Bre,curveBasisOpen:Ure,curveBasis:Fre,curveBumpX:Nre,curveBumpY:kre,curveLinearClosed:zre,curveLinear:kv,curveMonotoneX:qre,curveMonotoneY:Wre,curveNatural:Hre,curveStep:Vre,curveStepAfter:Gre,curveStepBefore:Kre},Hh=function(t){return t.x===+t.x&&t.y===+t.y},ju=function(t){return t.x},Su=function(t){return t.y},qve=function(t,r){if(ke(t))return t;var n="curve".concat(_v(t));return(n==="curveMonotone"||n==="curveBump")&&r?TE["".concat(n).concat(r==="vertical"?"Y":"X")]:TE[n]||kv},Wve=function(t){var r=t.type,n=r===void 0?"linear":r,a=t.points,i=a===void 0?[]:a,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=qve(n,l),f=u?i.filter(function(m){return Hh(m)}):i,h;if(Array.isArray(o)){var p=u?o.filter(function(m){return Hh(m)}):o,v=f.map(function(m,g){return AE(AE({},m),{},{base:p[g]})});return l==="vertical"?h=Mh().y(Su).x1(ju).x0(function(m){return m.base.x}):h=Mh().x(ju).y1(Su).y0(function(m){return m.base.y}),h.defined(Hh).curve(d),h(v)}return l==="vertical"&&ae(o)?h=Mh().y(Su).x1(ju).x0(o):ae(o)?h=Mh().x(ju).y1(Su).y0(o):h=jD().x(ju).y(Su),h.defined(Hh).curve(d),h(f)},fw=function(t){var r=t.className,n=t.points,a=t.path,i=t.pathRef;if((!n||!n.length)&&!a)return null;var o=n&&n.length?Wve(t):a;return b.createElement("path",dw({},_e(t,!1),um(t),{className:Te("recharts-curve",r),d:o,ref:i}))},EL={exports:{}},Hve="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Vve=Hve,Kve=Vve;function PL(){}function AL(){}AL.resetWarningCache=PL;var Gve=function(){function e(n,a,i,o,l,c){if(c!==Kve){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:AL,resetWarningCache:PL};return r.PropTypes=r,r};EL.exports=Gve();var Yve=EL.exports;const ze=qe(Yve);var Xve=Object.getOwnPropertyNames,Qve=Object.getOwnPropertySymbols,Jve=Object.prototype.hasOwnProperty;function $E(e,t){return function(n,a,i){return e(n,a,i)&&t(n,a,i)}}function Vh(e){return function(r,n,a){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,a);var i=a.cache,o=i.get(r),l=i.get(n);if(o&&l)return o===n&&l===r;i.set(r,n),i.set(n,r);var c=e(r,n,a);return i.delete(r),i.delete(n),c}}function RE(e){return Xve(e).concat(Qve(e))}var Zve=Object.hasOwn||function(e,t){return Jve.call(e,t)};function ko(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var eye="__v",tye="__o",rye="_owner",ME=Object.getOwnPropertyDescriptor,IE=Object.keys;function nye(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function aye(e,t){return ko(e.getTime(),t.getTime())}function iye(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function sye(e,t){return e===t}function DE(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),i=e.entries(),o,l,c=0;(o=i.next())&&!o.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(a[f]){f++;continue}var h=o.value,p=l.value;if(r.equals(h[0],p[0],c,f,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){d=a[f]=!0;break}f++}if(!d)return!1;c++}return!0}var oye=ko;function lye(e,t,r){var n=IE(e),a=n.length;if(IE(t).length!==a)return!1;for(;a-- >0;)if(!TL(e,t,r,n[a]))return!1;return!0}function _u(e,t,r){var n=RE(e),a=n.length;if(RE(t).length!==a)return!1;for(var i,o,l;a-- >0;)if(i=n[a],!TL(e,t,r,i)||(o=ME(e,i),l=ME(t,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function cye(e,t){return ko(e.valueOf(),t.valueOf())}function uye(e,t){return e.source===t.source&&e.flags===t.flags}function LE(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var a=new Array(n),i=e.values(),o,l;(o=i.next())&&!o.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!a[d]&&r.equals(o.value,l.value,o.value,l.value,e,t,r)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function dye(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function fye(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function TL(e,t,r,n){return(n===rye||n===tye||n===eye)&&(e.$$typeof||t.$$typeof)?!0:Zve(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var hye="[object Arguments]",pye="[object Boolean]",mye="[object Date]",gye="[object Error]",vye="[object Map]",yye="[object Number]",xye="[object Object]",bye="[object RegExp]",wye="[object Set]",jye="[object String]",Sye="[object URL]",_ye=Array.isArray,FE=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,BE=Object.assign,Nye=Object.prototype.toString.call.bind(Object.prototype.toString);function kye(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,a=e.areFunctionsEqual,i=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,h=e.areUrlsEqual;return function(v,m,g){if(v===m)return!0;
646if(v==null||m==null)return!1;var y=typeof v;if(y!==typeof m)return!1;if(y!=="object")return y==="number"?o(v,m,g):y==="function"?a(v,m,g):!1;var x=v.constructor;if(x!==m.constructor)return!1;if(x===Object)return l(v,m,g);if(_ye(v))return t(v,m,g);if(FE!=null&&FE(v))return f(v,m,g);if(x===Date)return r(v,m,g);if(x===RegExp)return u(v,m,g);if(x===Map)return i(v,m,g);if(x===Set)return d(v,m,g);var w=Nye(v);return w===mye?r(v,m,g):w===bye?u(v,m,g):w===vye?i(v,m,g):w===wye?d(v,m,g):w===xye?typeof v.then!="function"&&typeof m.then!="function"&&l(v,m,g):w===Sye?h(v,m,g):w===gye?n(v,m,g):w===hye?l(v,m,g):w===pye||w===yye||w===jye?c(v,m,g):!1}}function Oye(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,a={areArraysEqual:n?_u:nye,areDatesEqual:aye,areErrorsEqual:iye,areFunctionsEqual:sye,areMapsEqual:n?$E(DE,_u):DE,areNumbersEqual:oye,areObjectsEqual:n?_u:lye,arePrimitiveWrappersEqual:cye,areRegExpsEqual:uye,areSetsEqual:n?$E(LE,_u):LE,areTypedArraysEqual:n?_u:dye,areUrlsEqual:fye};if(r&&(a=BE({},a,r(a))),t){var i=Vh(a.areArraysEqual),o=Vh(a.areMapsEqual),l=Vh(a.areObjectsEqual),c=Vh(a.areSetsEqual);a=BE({},a,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return a}function Cye(e){return function(t,r,n,a,i,o,l){return e(t,r,l)}}function Eye(e){var t=e.circular,r=e.comparator,n=e.createState,a=e.equals,i=e.strict;if(n)return function(c,u){var d=n(),f=d.cache,h=f===void 0?t?new WeakMap:void 0:f,p=d.meta;return r(c,u,{cache:h,equals:a,meta:p,strict:i})};if(t)return function(c,u){return r(c,u,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var o={cache:void 0,equals:a,meta:void 0,strict:i};return function(c,u){return r(c,u,o)}}var Pye=gs();gs({strict:!0});gs({circular:!0});gs({circular:!0,strict:!0});gs({createInternalComparator:function(){return ko}});gs({strict:!0,createInternalComparator:function(){return ko}});gs({circular:!0,createInternalComparator:function(){return ko}});gs({circular:!0,createInternalComparator:function(){return ko},strict:!0});function gs(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,a=e.createState,i=e.strict,o=i===void 0?!1:i,l=Oye(e),c=kye(l),u=n?n(c):Cye(c);return Eye({circular:r,comparator:c,createState:a,equals:u,strict:o})}function Aye(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function UE(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):Aye(a)};requestAnimationFrame(n)}function hw(e){"@babel/helpers - typeof";return hw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hw(e)}function Tye(e){return Iye(e)||Mye(e)||Rye(e)||$ye()}function $ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
647In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rye(e,t){if(e){if(typeof e=="string")return zE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zE(e,t)}}function zE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Mye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Iye(e){if(Array.isArray(e))return e}function Dye(){var e={},t=function(){return null},r=!1,n=function a(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var o=i,l=Tye(o),c=l[0],u=l.slice(1);if(typeof c=="number"){UE(a.bind(null,u),c);return}a(c),UE(a.bind(null,u));return}hw(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function cf(e){"@babel/helpers - typeof";return cf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cf(e)}function qE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function WE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
vendor: 58,702 bytes, lines 647-665
647t%2?qE(Object(r),!0).forEach(function(n){$L(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $L(e,t,r){return t=Lye(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lye(e){var t=Fye(e,"string");return cf(t)==="symbol"?t:String(t)}function Fye(e,t){if(cf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(cf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bye=function(t,r){return[Object.keys(t),Object.keys(r)].reduce(function(n,a){return n.filter(function(i){return a.includes(i)})})},Uye=function(t){return t},zye=function(t){return t.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},ed=function(t,r){return Object.keys(r).reduce(function(n,a){return WE(WE({},n),{},$L({},a,t(a,r[a])))},{})},HE=function(t,r,n){return t.map(function(a){return"".concat(zye(a)," ").concat(r,"ms ").concat(n)}).join(",")};function qye(e,t){return Vye(e)||Hye(e,t)||RL(e,t)||Wye()}function Wye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
648In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hye(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Vye(e){if(Array.isArray(e))return e}function Kye(e){return Xye(e)||Yye(e)||RL(e)||Gye()}function Gye(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
649In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RL(e,t){if(e){if(typeof e=="string")return pw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pw(e,t)}}function Yye(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xye(e){if(Array.isArray(e))return pw(e)}function pw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Bm=1e-4,ML=function(t,r){return[0,3*t,3*r-6*t,3*t-3*r+1]},IL=function(t,r){return t.map(function(n,a){return n*Math.pow(r,a)}).reduce(function(n,a){return n+a})},VE=function(t,r){return function(n){var a=ML(t,r);return IL(a,n)}},Qye=function(t,r){return function(n){var a=ML(t,r),i=[].concat(Kye(a.map(function(o,l){return o*l}).slice(1)),[0]);return IL(i,n)}},KE=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0],i=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":a=0,i=0,o=1,l=1;break;case"ease":a=.25,i=.1,o=.25,l=1;break;case"ease-in":a=.42,i=0,o=1,l=1;break;case"ease-out":a=.42,i=0,o=.58,l=1;break;case"ease-in-out":a=0,i=0,o=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(g){return parseFloat(g)}),d=qye(u,4);a=d[0],i=d[1],o=d[2],l=d[3]}}}var f=VE(a,o),h=VE(i,l),p=Qye(a,o),v=function(y){return y>1?1:y<0?0:y},m=function(y){for(var x=y>1?1:y,w=x,S=0;S<8;++S){var j=f(w)-x,_=p(w);if(Math.abs(j-x)<Bm||_<Bm)return h(w);w=v(w-j/_)}return h(w)};return m.isStepper=!1,m},Jye=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,o=t.dt,l=o===void 0?17:o,c=function(d,f,h){var p=-(d-f)*n,v=h*i,m=h+(p-v)*l/1e3,g=h*l/1e3+d;return Math.abs(g-f)<Bm&&Math.abs(m)<Bm?[f,0]:[g,m]};return c.isStepper=!0,c.dt=l,c},Zye=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return KE(a);case"spring":return Jye();default:if(a.split("(")[0]==="cubic-bezier")return KE(a)}return typeof a=="function"?a:null};function uf(e){"@babel/helpers - typeof";return uf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uf(e)}function GE(e){return rxe(e)||txe(e)||DL(e)||exe()}function exe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
650In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function txe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function rxe(e){if(Array.isArray(e))return gw(e)}function YE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Zt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YE(Object(r),!0).forEach(function(n){mw(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mw(e,t,r){return t=nxe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nxe(e){var t=axe(e,"string");return uf(t)==="symbol"?t:String(t)}function axe(e,t){if(uf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(uf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ixe(e,t){return lxe(e)||oxe(e,t)||DL(e,t)||sxe()}function sxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
651In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DL(e,t){if(e){if(typeof e=="string")return gw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gw(e,t)}}function gw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function oxe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function lxe(e){if(Array.isArray(e))return e}var Um=function(t,r,n){return t+(r-t)*n},vw=function(t){var r=t.from,n=t.to;return r!==n},cxe=function e(t,r,n){var a=ed(function(i,o){if(vw(o)){var l=t(o.from,o.to,o.velocity),c=ixe(l,2),u=c[0],d=c[1];return Zt(Zt({},o),{},{from:u,velocity:d})}return o},r);return n<1?ed(function(i,o){return vw(o)?Zt(Zt({},o),{},{velocity:Um(o.velocity,a[i].velocity,n),from:Um(o.from,a[i].from,n)}):o},r):e(t,a,n-1)};const uxe=function(e,t,r,n,a){var i=Bye(e,t),o=i.reduce(function(g,y){return Zt(Zt({},g),{},mw({},y,[e[y],t[y]]))},{}),l=i.reduce(function(g,y){return Zt(Zt({},g),{},mw({},y,{from:e[y],velocity:0,to:t[y]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return ed(function(y,x){return x.from},l)},p=function(){return!Object.values(l).filter(vw).length},v=function(y){u||(u=y);var x=y-u,w=x/r.dt;l=cxe(r,l,w),a(Zt(Zt(Zt({},e),t),h())),u=y,p()||(c=requestAnimationFrame(f))},m=function(y){d||(d=y);var x=(y-d)/n,w=ed(function(j,_){return Um.apply(void 0,GE(_).concat([r(x)]))},o);if(a(Zt(Zt(Zt({},e),t),w)),x<1)c=requestAnimationFrame(f);else{var S=ed(function(j,_){return Um.apply(void 0,GE(_).concat([r(1)]))},o);a(Zt(Zt(Zt({},e),t),S))}};return f=r.isStepper?v:m,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function fc(e){"@babel/helpers - typeof";return fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fc(e)}var dxe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function fxe(e,t){if(e==null)return{};var r=hxe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hxe(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function Ex(e){return vxe(e)||gxe(e)||mxe(e)||pxe()}function pxe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
652In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mxe(e,t){if(e){if(typeof e=="string")return yw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yw(e,t)}}function gxe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vxe(e){if(Array.isArray(e))return yw(e)}function yw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function XE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Rn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?XE(Object(r),!0).forEach(function(n){Ru(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):XE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ru(e,t,r){return t=LL(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yxe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xxe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,LL(n.key),n)}}function bxe(e,t,r){return t&&xxe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function LL(e){var t=wxe(e,"string");return fc(t)==="symbol"?t:String(t)}function wxe(e,t){if(fc(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(fc(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jxe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xw(e,t)}function xw(e,t){return xw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},xw(e,t)}function Sxe(e){var t=_xe();return function(){var n=zm(e),a;if(t){var i=zm(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return bw(this,a)}}function bw(e,t){if(t&&(fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ww(e)}function ww(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _xe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zm(e){return zm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zm(e)}var oi=function(e){jxe(r,e);var t=Sxe(r);function r(n,a){var i;yxe(this,r),i=t.call(this,n,a);var o=i.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,p=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(ww(i)),i.changeStyle=i.changeStyle.bind(ww(i)),!l||p<=0)return i.state={style:{}},typeof h=="function"&&(i.state={style:d}),bw(i);if(f&&f.length)i.state={style:f[0].style};else if(u){if(typeof h=="function")return i.state={style:u},bw(i);i.state={style:c?Ru({},c,u):u}}else i.state={style:{}};return i}return bxe(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,l=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,d=i.to,f=i.from,h=this.state.style;if(l){if(!o){var p={style:c?Ru({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(p);return}if(!(Pye(a.to,d)&&a.canBegin&&a.isActive)){var v=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=v||u?f:a.to;if(this.state&&h){var g={style:c?Ru({},c,m):m};(c&&h[c]!==m||!c&&h!==m)&&this.setState(g)}this.runAnimation(Rn(Rn({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,l=a.to,c=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,h=a.onAnimationStart,p=uxe(o,l,Zye(u),c,this.changeStyle),v=function(){i.stopJSAnimation=p()};this.manager.start([h,d,v,c,f])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,l=a.begin,c=a.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,p=function(m,g,y){if(y===0)return m;var x=g.duration,w=g.easing,S=w===void 0?"ease":w,j=g.style,_=g.properties,N=g.onAnimationEnd,k=y>0?o[y-1]:g,O=_||Object.keys(j);if(typeof S=="function"||S==="spring")return[].concat(Ex(m),[i.runJSAnimation.bind(i,{from:k.style,to:j,duration:x,easing:S}),x]);var E=HE(O,x,S),A=Rn(Rn(Rn({},k.style),j),{},{transition:E});return[].concat(Ex(m),[A,x,N]).filter(Uye)};return this.manager.start([c].concat(Ex(o.reduce(p,[d,Math.max(h,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Dye());var i=a.begin,o=a.duration,l=a.attributeName,c=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,h=a.steps,p=a.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var m=l?Ru({},l,c):c,g=HE(Object.keys(m),o,u);v.start([d,i,Rn(Rn({},m),{},{transition:g}),o,f])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=fxe(a,dxe),u=b.Children.count(i),d=this.state.style;if(typeof i=="function")return i(d);if(!l||u===0||o<=0)return i;var f=function(p){var v=p.props,m=v.style,g=m===void 0?{}:m,y=v.className,x=b.cloneElement(p,Rn(Rn({},c),{},{style:Rn(Rn({},g),d),className:y}));return x};return u===1?f(b.Children.only(i)):C.createElement("div",null,b.Children.map(i,function(h){return f(h)}))}}]),r}(b.PureComponent);oi.displayName="Animate";oi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};oi.propTypes={from:ze.oneOfType([ze.object,ze.string]),to:ze.oneOfType([ze.object,ze.string]),attributeName:ze.string,duration:ze.number,begin:ze.number,easing:ze.oneOfType([ze.string,ze.func]),steps:ze.arrayOf(ze.shape({duration:ze.number.isRequired,style:ze.object.isRequired,easing:ze.oneOfType([ze.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ze.func]),properties:ze.arrayOf("string"),onAnimationEnd:ze.func})),children:ze.oneOfType([ze.node,ze.func]),isActive:ze.bool,canBegin:ze.bool,onAnimationEnd:ze.func,shouldReAnimate:ze.bool,onAnimationStart:ze.func,onAnimationReStart:ze.func};function df(e){"@babel/helpers - typeof";return df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},df(e)}function qm(){return qm=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},qm.apply(this,arguments)}function Nxe(e,t){return Exe(e)||Cxe(e,t)||Oxe(e,t)||kxe()}function kxe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
653In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oxe(e,t){if(e){if(typeof e=="string")return QE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return QE(e,t)}}function QE(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Cxe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function Exe(e){if(Array.isArray(e))return e}function JE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ZE(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?JE(Object(r),!0).forEach(function(n){Pxe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):JE(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pxe(e,t,r){return t=Axe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Axe(e){var t=Txe(e,"string");return df(t)=="symbol"?t:t+""}function Txe(e,t){if(df(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(df(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var eP=function(t,r,n,a,i){var o=Math.min(Math.abs(n)/2,Math.abs(a)/2),l=a>=0?1:-1,c=n>=0?1:-1,u=a>=0&&n>=0||a<0&&n<0?1:0,d;if(o>0&&i instanceof Array){for(var f=[0,0,0,0],h=0,p=4;h<p;h++)f[h]=i[h]>o?o:i[h];d="M".concat(t,",").concat(r+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(r)),d+="L ".concat(t+n-c*f[1],",").concat(r),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
654        `).concat(t+n,",").concat(r+l*f[1])),d+="L ".concat(t+n,",").concat(r+a-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
655        `).concat(t+n-c*f[2],",").concat(r+a)),d+="L ".concat(t+c*f[3],",").concat(r+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
656        `).concat(t,",").concat(r+a-l*f[3])),d+="Z"}else if(o>0&&i===+i&&i>0){var v=Math.min(o,i);d="M ".concat(t,",").concat(r+l*v,`
657            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+c*v,",").concat(r,`
658            L `).concat(t+n-c*v,",").concat(r,`
659            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n,",").concat(r+l*v,`
660            L `).concat(t+n,",").concat(r+a-l*v,`
661            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n-c*v,",").concat(r+a,`
662            L `).concat(t+c*v,",").concat(r+a,`
663            A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(r+a-l*v," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return d},$xe=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,o=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(i,i+l),d=Math.max(i,i+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return n>=u&&n<=d&&a>=f&&a<=h}return!1},Rxe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},LS=function(t){var r=ZE(ZE({},Rxe),t),n=b.useRef(),a=b.useState(-1),i=Nxe(a,2),o=i[0],l=i[1];b.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&l(S)}catch{}},[]);var c=r.x,u=r.y,d=r.width,f=r.height,h=r.radius,p=r.className,v=r.animationEasing,m=r.animationDuration,g=r.animationBegin,y=r.isAnimationActive,x=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var w=Te("recharts-rectangle",p);return x?C.createElement(oi,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:m,animationEasing:v,isActive:x},function(S){var j=S.width,_=S.height,N=S.x,k=S.y;return C.createElement(oi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,isActive:y,easing:v},C.createElement("path",qm({},_e(r,!0),{className:w,d:eP(N,k,j,_,h),ref:n})))}):C.createElement("path",qm({},_e(r,!0),{className:w,d:eP(c,u,d,f,h)}))},Mxe=["points","className","baseLinePoints","connectNulls"];function ml(){return ml=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},ml.apply(this,arguments)}function Ixe(e,t){if(e==null)return{};var r=Dxe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dxe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function tP(e){return Uxe(e)||Bxe(e)||Fxe(e)||Lxe()}function Lxe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
664In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fxe(e,t){if(e){if(typeof e=="string")return jw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jw(e,t)}}function Bxe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Uxe(e){if(Array.isArray(e))return jw(e)}function jw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var rP=function(t){return t&&t.x===+t.x&&t.y===+t.y},zxe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){rP(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),rP(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},td=function(t,r){var n=zxe(t);r&&(n=[n.reduce(function(i,o){return[].concat(tP(i),tP(o))},[])]);var a=n.map(function(i){return i.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},qxe=function(t,r,n){var a=td(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(td(r.reverse(),n).slice(1))},Wxe=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,o=Ixe(t,Mxe);if(!r||!r.length)return null;var l=Te("recharts-polygon",n);if(a&&a.length){var c=o.stroke&&o.stroke!=="none",u=qxe(r,a,i);return C.createElement("g",{className:l},C.createElement("path",ml({},_e(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?C.createElement("path",ml({},_e(o,!0),{fill:"none",d:td(r,i)})):null,c?C.createElement("path",ml({},_e(o,!0),{fill:"none",d:td(a,i)})):null)}var d=td(r,i);return C.createElement("path",ml({},_e(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:l,d}))};function Sw(){return Sw=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},Sw.apply(this,arguments)}var FS=function(t){var r=t.cx,n=t.cy,a=t.r,i=t.className,o=Te("recharts-dot",i);return r===+r&&n===+n&&a===+a?b.createElement("circle",Sw({},_e(t,!1),um(t),{className:o,cx:r,cy:n,r:a})):null};function ff(e){"@babel/helpers - typeof";return ff=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ff(e)}var Hxe=["x","y","top","left","width","height","className"];function _w(){return _w=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},_w.apply(this,arguments)}function nP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Vxe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nP(Object(r),!0).forEach(function(n){Kxe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kxe(e,t,r){return t=Gxe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gxe(e){var t=Yxe(e,"string");return ff(t)=="symbol"?t:t+""}function Yxe(e,t){if(ff(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ff(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xxe(e,t){if(e==null)return{};var r=Qxe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qxe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Jxe=function(t,r,n,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},Zxe=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,p=h===void 0?0:h,v=t.className,m=Xxe(t,Hxe),g=Vxe({x:n,y:i,top:l,left:u,width:f,height:p},m);return!ae(n)||!ae(i)||!ae(f)||!ae(p)||!ae(l)||!ae(u)?null:C.createElement("path",_w({},_e(g,!0),{className:Te("recharts-cross",v),d:Jxe(n,i,f,p,l,u)}))},e0e=Dv,t0e=X4,r0e=Pa;function n0e(e,t){return e&&e.length?e0e(e,r0e(t),t0e):void 0}var a0e=n0e;const i0e=qe(a0e);var s0e=Dv,o0e=Pa,l0e=Q4;function c0e(e,t){return e&&e.length?s0e(e,o0e(t),l0e):void 0}var u0e=c0e;const d0e=qe(u0e);var f0e=["cx","cy","angle","ticks","axisLine"],h0e=["ticks","tick","angle","tickFormatter","stroke"];function hc(e){"@babel/helpers - typeof";return hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hc(e)}function rd(){return rd=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},rd.apply(this,arguments)}function aP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function js(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?aP(Object(r),!0).forEach(function(n){Wv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iP(e,t){if(e==null)return{};var r=p0e(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function p0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function m0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,BL(n.key),n)}}function g0e(e,t,r){return t&&sP(e.prototype,t),r&&sP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function v0e(e,t,r){return t=Wm(t),y0e(e,FL()?Reflect.construct(t,r||[],Wm(e).constructor):t.apply(e,r))}function y0e(e,t){if(t&&(hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x0e(e)}function x0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FL=function(){return!!e})()}function Wm(e){return Wm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wm(e)}function b0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nw(e,t)}function Nw(e,t){return Nw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Nw(e,t)}function Wv(e,t,r){return t=BL(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BL(e){var t=w0e(e,"string");return hc(t)=="symbol"?t:t+""}function w0e(e,t){if(hc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(hc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hv=function(e){function t(){return m0e(this,t),v0e(this,t,arguments)}return b0e(t,e),g0e(t,[{key:"getTickValueCoord",value:function(n){var a=n.coordinate,i=this.props,o=i.angle,l=i.cx,c=i.cy;return at(l,c,a,o)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,a;switch(n){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.angle,l=n.ticks,c=i0e(l,function(d){return d.coordinate||0}),u=d0e(l,function(d){return d.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.angle,l=n.ticks,c=n.axisLine,u=iP(n,f0e),d=l.reduce(function(v,m){return[Math.min(v[0],m.coordinate),Math.max(v[1],m.coordinate)]},[1/0,-1/0]),f=at(a,i,d[0],o),h=at(a,i,d[1],o),p=js(js(js({},_e(u,!1)),{},{fill:"none"},_e(c,!1)),{},{x1:f.x,y1:f.y,x2:h.x,y2:h.y});return C.createElement("line",rd({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,l=a.angle,c=a.tickFormatter,u=a.stroke,d=iP(a,h0e),f=this.getTickTextAnchor(),h=_e(d,!1),p=_e(o,!1),v=i.map(function(m,g){var y=n.getTickValueCoord(m),x=js(js(js(js({textAnchor:f,transform:"rotate(".concat(90-l,", ").concat(y.x,", ").concat(y.y,")")},h),{},{stroke:"none",fill:u},p),{},{index:g},y),{},{payload:m});return C.createElement(He,rd({className:Te("recharts-polar-radius-axis-tick",NL(o)),key:"tick-".concat(m.coordinate)},po(n.props,m,g)),t.renderTickItem(o,x,c?c(m.value,g):m.value))});return C.createElement(He,{className:"recharts-polar-radius-axis-ticks"},v)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.axisLine,o=n.tick;return!a||!a.length?null:C.createElement(He,{className:Te("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),qt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,a,i){var o;return C.isValidElement(n)?o=C.cloneElement(n,a):ke(n)?o=n(a):o=C.createElement(mo,rd({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])}(b.PureComponent);Wv(Hv,"displayName","PolarRadiusAxis");Wv(Hv,"axisType","radiusAxis");Wv(Hv,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function pc(e){"@babel/helpers - typeof";return pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pc(e)}function Ts(){return Ts=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},Ts.apply(this,arguments)}function oP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ss(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?oP(Object(r),!0).forEach(function(n){Vv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function j0e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,zL(n.key),n)}}function S0e(e,t,r){return t&&lP(e.prototype,t),r&&lP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _0e(e,t,r){return t=Hm(t),N0e(e,UL()?Reflect.construct(t,r||[],Hm(e).constructor):t.apply(e,r))}function N0e(e,t){if(t&&(pc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return k0e(e)}function k0e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UL=function(){return!!e})()}function Hm(e){return Hm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Hm(e)}function O0e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kw(e,t)}function kw(e,t){return kw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},kw(e,t)}function Vv(e,t,r){return t=zL(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zL(e){var t=C0e(e,"string");return pc(t)=="symbol"?t:t+""}function C0e(e,t){if(pc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var E0e=Math.PI/180,cP=1e-5,Kv=function(e){function t(){return j0e(this,t),_0e(this,t,arguments)}return O0e(t,e),S0e(t,[{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.cx,o=a.cy,l=a.radius,c=a.orientation,u=a.tickSize,d=u||8,f=at(i,o,l,n.coordinate),h=at(i,o,l+(c==="inner"?-1:1)*d,n.coordinate);return{x1:f.x,y1:f.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(n){var a=this.props.orientation,i=Math.cos(-n.coordinate*E0e),o;return i>cP?o=a==="outer"?"start":"end":i<-cP?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.radius,l=n.axisLine,c=n.axisLineType,u=Ss(Ss({},_e(this.props,!1)),{},{fill:"none"},_e(l,!1));if(c==="circle")return C.createElement(FS,Ts({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:o}));var d=this.props.ticks,f=d.map(function(h){return at(a,i,o,h.coordinate)});return C.createElement(Wxe,Ts({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,l=a.tickLine,c=a.tickFormatter,u=a.stroke,d=_e(this.props,!1),f=_e(o,!1),h=Ss(Ss({},d),{},{fill:"none"},_e(l,!1)),p=i.map(function(v,m){var g=n.getTickLineCoord(v),y=n.getTickTextAnchor(v),x=Ss(Ss(Ss({textAnchor:y},d),{},{stroke:"none",fill:u},f),{},{index:m,payload:v,x:g.x2,y:g.y2});return C.createElement(He,Ts({className:Te("recharts-polar-angle-axis-tick",NL(o)),key:"tick-".concat(v.coordinate)},po(n.props,v,m)),l&&C.createElement("line",Ts({className:"recharts-polar-angle-axis-tick-line"},h,g)),o&&t.renderTickItem(o,x,c?c(v.value,m):v.value))});return C.createElement(He,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!a||!a.length?null:C.createElement(He,{className:Te("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var o;return C.isValidElement(n)?o=C.cloneElement(n,a):ke(n)?o=n(a):o=C.createElement(mo,Ts({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(b.PureComponent);Vv(Kv,"displayName","PolarAngleAxis");Vv(Kv,"axisType","angleAxis");Vv(Kv,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var P0e=VD,A0e=P0e(Object.getPrototypeOf,Object),T0e=A0e,$0e=fi,R0e=T0e,M0e=hi,I0e="[object Object]",D0e=Function.prototype,L0e=Object.prototype,qL=D0e.toString,F0e=L0e.hasOwnProperty,B0e=qL.call(Object);function U0e(e){if(!M0e(e)||$0e(e)!=I0e)return!1;var t=R0e(e);if(t===null)return!0;var r=F0e.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&qL.call(r)==B0e}var z0e=U0e;const q0e=qe(z0e);var W0e=fi,H0e=hi,V0e="[object Boolean]";function K0e(e){return e===!0||e===!1||H0e(e)&&W0e(e)==V0e}var G0e=K0e;const Y0e=qe(G0e);function hf(e){"@babel/helpers - typeof";return hf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hf(e)}function Vm(){return Vm=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},Vm.apply(this,arguments)}function X0e(e,t){return ebe(e)||Z0e(e,t)||J0e(e,t)||Q0e()}function Q0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
665In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J0e(e,t){if(e){if(typeof e=="string")return uP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uP(e,t)}}function uP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Z0e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function ebe(e){if(Array.isArray(e))return e}function dP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dP(Object(r),!0).forEach(function(n){tbe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tbe(e,t,r){return t=rbe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rbe(e){var t=nbe(e,"string");return hf(t)=="symbol"?t:t+""}function nbe(e,t){if(hf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(hf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hP=function(t,r,n,a,i){var o=n-a,l;return l="M ".concat(t,",").concat(r),l+="L ".concat(t+n,",").concat(r),l+="L ".concat(t+n-o/2,",").concat(r+i),l+="L ".concat(t+n-o/2-a,",").concat(r+i),l+="L ".concat(t,",").concat(r," Z"),l},abe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},ibe=function(t){var r=fP(fP({},abe),t),n=b.useRef(),a=b.useState(-1),i=X0e(a,2),o=i[0],l=i[1];b.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var w=n.current.getTotalLength();w&&l(w)}catch{}},[]);var c=r.x,u=r.y,d=r.upperWidth,f=r.lowerWidth,h=r.height,p=r.className,v=r.animationEasing,m=r.animationDuration,g=r.animationBegin,y=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var x=Te("recharts-trapezoid",p);return y?C.createElement(oi,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:m,animationEasing:v,isActive:y},function(w){var S=w.upperWidth,j=w.lowerWidth,_=w.height,N=w.x,k=w.y;return C.createElement(oi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:m,easing:v},C.createElement("path",Vm({},_e(r,!0),{className:x,d:hP(N,k,S,j,_),ref:n})))}):C.createElement("g",null,C.createElement("path",Vm({},_e(r,!0),{className:x,d:hP(c,u,d,f,h)})))},sbe=["option","shapeType","propTransformer","activeClassName","isActive"];function pf(e){"@babel/helpers - typeof";return pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pf(e)}function obe(e,t){if(e==null)return{};var r=lbe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lbe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Km(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pP(Object(r),!0).forEach(function(n){cbe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cbe(e,t,r){return t=ube(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ube(e){var t=dbe(e,"string");return pf(t)=="symbol"?t:t+""}function dbe(e,t){if(pf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fbe(e,t){return Km(Km({},t),e)}function hbe(e,t){return e==="symbols"}function mP(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return C.createElement(LS,r);case"trapezoid":return C.createElement(ibe,r);case"sector":return C.createElement(CL,r);case"symbols":if(hbe(t))return C.createElement(nS,r);break;default:return null}}function pbe(e){return b.isValidElement(e)?e.props:e}function WL(e){var t=e.option,r=e.shapeType,n=e.propTransformer,a=n===void 0?fbe:n,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,l=e.isActive,c=obe(e,sbe),u;if(b.isValidElement(t))u=b.cloneElement(t,Km(Km({},c),pbe(t)));else if(ke(t))u=t(c);else if(q0e(t)&&!Y0e(t)){var d=a(t,c);u=C.createElement(mP,{shapeType:r,elementProps:d})}else{var f=c;u=C.createElement(mP,{shapeType:r,elementProps:f})}return l?C.createElement(He,{className:o},u):u}function Gv(e,t){return t!=null&&"trapezoids"in e.props}function Yv(e,t){return t!=null&&"sectors"in e.props}function mf(e,t){return t!=null&&"points"in e.props}function mbe(e,t){var r,n,a=e.x===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.x)||e.x===t.x,i=e.y===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.y)||e.y===t.y;return a&&i}function gbe(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function vbe(e,t){var r=e.x===t.x,n=e.y===t.y,a=e.z===t.z;return r&&n&&a}function ybe(e,t){var r;return Gv(e,t)?r=mbe:Yv(e,t)?r=gbe:mf(e,t)&&(r=vbe),r}function xbe(e,t){var r;return Gv(e,t)?r="trapezoids":Yv(e,t)?r="sectors":mf(e,t)&&(r="points"),r}function bbe(e,t){if(Gv(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(Yv(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return mf(e,t)?t.payload:{}}function wbe(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,a=xbe(r,t),i=bbe(r,t),o=n.filter(function(c,u){var d=Bv(i,c),f=r.props[a].filter(function(v){var m=ybe(r,t);return m(v,t)}),h=r.props[a].indexOf(f[f.length-1]),p=u===h;return d&&p}),l=n.indexOf(o[o.length-1]);return l}var vp;function mc(e){"@babel/helpers - typeof";return mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mc(e)}function gl(){return gl=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},gl.apply(this,arguments)}function gP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function tt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gP(Object(r),!0).forEach(function(n){vn(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,VL(n.key),n)}}function Sbe(e,t,r){return t&&vP(e.prototype,t),r&&vP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _be(e,t,r){return t=Gm(t),Nbe(e,HL()?Reflect.construct(t,r||[],Gm(e).constructor):t.apply(e,r))}function Nbe(e,t){if(t&&(mc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return kbe(e)}function kbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HL=function(){return!!e})()}function Gm(e){return Gm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Gm(e)}function Obe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ow(e,t)}function Ow(e,t){return Ow=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Ow(e,t)}function vn(e,t,r){return t=VL(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VL(e){var t=Cbe(e,"string");return mc(t)=="symbol"?t:t+""}function Cbe(e,t){if(mc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(mc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jn=function(e){function t(r){var n;return jbe(this,t),n=_be(this,t,[r]),vn(n,"pieRef",null),vn(n,"sectorRefs",[]),vn(n,"id",Wf("recharts-pie-")),vn(n,"handleAnimationEnd",function(){var a=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),ke(a)&&a()}),vn(n,"handleAnimationStart",function(){var a=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),ke(a)&&a()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return Obe(t,e),Sbe(t,[{key:"isActiveIndex",value:function(n){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(n)!==-1:n===a}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,l=i.labelLine,c=i.dataKey,u=i.valueKey,d=_e(this.props,!1),f=_e(o,!1),h=_e(l,!1),p=o&&o.offsetRadius||20,v=n.map(function(m,g){var y=(m.startAngle+m.endAngle)/2,x=at(m.cx,m.cy,m.outerRadius+p,y),w=tt(tt(tt(tt({},d),m),{},{stroke:"none"},f),{},{index:g,textAnchor:t.getTextAnchor(x.x,m.cx)},x),S=tt(tt(tt(tt({},d),m),{},{fill:"none",stroke:m.fill},h),{},{index:g,points:[at(m.cx,m.cy,m.outerRadius,y),x]}),j=c;return $e(c)&&$e(u)?j="value":$e(c)&&(j=u),C.createElement(He,{key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(g)},l&&t.renderLabelLineItem(l,S,"line"),t.renderLabelItem(o,w,hr(m,j)))});return C.createElement(He,{className:"recharts-pie-labels"},v)}},{key:"renderSectorsStatically",value:function(n){var a=this,i=this.props,o=i.activeShape,l=i.blendStroke,c=i.inactiveShape;return n.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var f=a.isActiveIndex(d),h=c&&a.hasActiveIndex()?c:null,p=f?o:h,v=tt(tt({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return C.createElement(He,gl({ref:function(g){g&&!a.sectorRefs.includes(g)&&a.sectorRefs.push(g)},tabIndex:-1,className:"recharts-pie-sector"},po(a.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),C.createElement(WL,gl({option:p,isActive:f,shapeType:"sector"},v)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,a=this.props,i=a.sectors,o=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,d=a.animationId,f=this.state,h=f.prevSectors,p=f.prevIsAnimationActive;return C.createElement(oi,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(v){var m=v.t,g=[],y=i&&i[0],x=y.startAngle;return i.forEach(function(w,S){var j=h&&h[S],_=S>0?tn(w,"paddingAngle",0):0;if(j){var N=ki(j.endAngle-j.startAngle,w.endAngle-w.startAngle),k=tt(tt({},w),{},{startAngle:x+_,endAngle:x+N(m)+_});g.push(k),x=k.endAngle}else{var O=w.endAngle,E=w.startAngle,A=ki(0,O-E),R=A(m),T=tt(tt({},w),{},{startAngle:x+_,endAngle:x+R+_});g.push(T),x=T.endAngle}}),C.createElement(He,null,n.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!Bv(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,o=a.sectors,l=a.className,c=a.label,u=a.cx,d=a.cy,f=a.innerRadius,h=a.outerRadius,p=a.isAnimationActive,v=this.state.isAnimationFinished;if(i||!o||!o.length||!ae(u)||!ae(d)||!ae(f)||!ae(h))return null;var m=Te("recharts-pie",l);return C.createElement(He,{tabIndex:this.props.rootTabIndex,className:m,ref:function(y){n.pieRef=y}},this.renderSectors(),c&&this.renderLabels(o),qt.renderCallByParent(this.props,null,!1),(!p||v)&&Ji.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,a,i){if(C.isValidElement(n))return C.cloneElement(n,a);if(ke(n))return n(a);var o=Te("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return C.createElement(fw,gl({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(n,a,i){if(C.isValidElement(n))return C.cloneElement(n,a);var o=i;if(ke(n)&&(o=n(a),C.isValidElement(o)))return o;var l=Te("recharts-pie-label-text",typeof n!="boolean"&&!ke(n)?n.className:"");return C.createElement(mo,gl({},a,{alignmentBaseline:"middle",className:l}),o)}}])}(b.PureComponent);vp=jn;vn(jn,"displayName","Pie");vn(jn,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Ga.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});vn(jn,"parseDeltaAngle",function(e,t){var r=Sr(t-e),n=Math.min(Math.abs(t-e),360);return r*n});vn(jn,"getRealPieData",function(e){var t=e.data,r=e.children,n=_e(e,!1),a=wn(r,pa);return t&&t.length?t.map(function(i,o){return tt(tt(tt({payload:i},n),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return tt(tt({},n),i.props)}):[]});vn(jn,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,a=t.width,i=t.height,o=_L(a,i),l=n+_r(e.cx,a,a/2),c=r+_r(e.cy,i,i/2),u=_r(e.innerRadius,o,0),d=_r(e.outerRadius,o,o*.8),f=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:d,maxRadius:f}});vn(jn,"getComposedData",function(e){var t=e.item,r=e.offset,n=t.type.defaultProps!==void 0?tt(tt({},t.type.defaultProps),t.props):t.props,a=vp.getRealPieData(n);if(!a||!a.length)return null;var i=n.cornerRadius,o=n.startAngle,l=n.endAngle,c=n.paddingAngle,u=n.dataKey,d=n.nameKey,f=n.valueKey,h=n.tooltipType,p=Math.abs(n.minAngle),v=vp.parseCoordinateOfPie(n,r),m=vp.parseDeltaAngle(o,l),g=Math.abs(m),y=u;$e(u)&&$e(f)?(Xn(!1,`Use "dataKey" to specify the value of pie,
666      the props "valueKey" will be deprecated in 1.1.0`),y="value"):$e(u)&&(Xn(!1,`Use "dataKey" to specify the value of pie,
667      the props "valueKey" will be deprecated in 1.1.0`),y=f);var x=a.filter(function(k){return hr(k,y,0)!==0}).length,w=(g>=360?x:x-1)*c,S=g-x*p-w,j=a.reduce(function(k,O){var E=hr(O,y,0);return k+(ae(E)?E:0)},0),_;if(j>0){var N;_=a.map(function(k,O){var E=hr(k,y,0),A=hr(k,d,O),R=(ae(E)?E:0)/j,T;O?T=N.endAngle+Sr(m)*c*(E!==0?1:0):T=o;var I=T+Sr(m)*((E!==0?p:0)+R*S),F=(T+I)/2,P=(v.innerRadius+v.outerRadius)/2,D=[{name:A,value:E,payload:k,dataKey:y,type:h}],M=at(v.cx,v.cy,P,F);return N=tt(tt(tt({percent:R,cornerRadius:i,name:A,tooltipPayload:D,midAngle:F,middleRadius:P,tooltipPosition:M},k),v),{},{value:hr(k,y),startAngle:T,endAngle:I,payload:k,paddingAngle:Sr(m)*c}),N})}return tt(tt({},v),{},{sectors:_,data:a})});var Ebe=Math.ceil,Pbe=Math.max;function Abe(e,t,r,n){for(var a=-1,i=Pbe(Ebe((t-e)/(r||1)),0),o=Array(i);i--;)o[n?i:++a]=e,e+=r;return o}var Tbe=Abe,$be=d4,yP=1/0,Rbe=17976931348623157e292;function Mbe(e){if(!e)return e===0?e:0;if(e=$be(e),e===yP||e===-yP){var t=e<0?-1:1;return t*Rbe}return e===e?e:0}var KL=Mbe,Ibe=Tbe,Dbe=Pv,Px=KL;function Lbe(e){return function(t,r,n){return n&&typeof n!="number"&&Dbe(t,r,n)&&(r=n=void 0),t=Px(t),r===void 0?(r=t,t=0):r=Px(r),n=n===void 0?t<r?1:-1:Px(n),Ibe(t,r,n,e)}}var Fbe=Lbe,Bbe=Fbe,Ube=Bbe(),zbe=Ube;const Ym=qe(zbe);function gf(e){"@babel/helpers - typeof";return gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gf(e)}function xP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function bP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xP(Object(r),!0).forEach(function(n){GL(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function GL(e,t,r){return t=qbe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qbe(e){var t=Wbe(e,"string");return gf(t)=="symbol"?t:t+""}function Wbe(e,t){if(gf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(gf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Hbe=["Webkit","Moz","O","ms"],Vbe=function(t,r){var n=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=Hbe.reduce(function(i,o){return bP(bP({},i),{},GL({},o+n,r))},{});return a[t]=r,a};function gc(e){"@babel/helpers - typeof";return gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gc(e)}function Xm(){return Xm=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},Xm.apply(this,arguments)}function wP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ax(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wP(Object(r),!0).forEach(function(n){Wr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Kbe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,XL(n.key),n)}}function Gbe(e,t,r){return t&&jP(e.prototype,t),r&&jP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ybe(e,t,r){return t=Qm(t),Xbe(e,YL()?Reflect.construct(t,r||[],Qm(e).constructor):t.apply(e,r))}function Xbe(e,t){if(t&&(gc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qbe(e)}function Qbe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function YL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(YL=function(){return!!e})()}function Qm(e){return Qm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qm(e)}function Jbe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cw(e,t)}
vendor: 111,518 bytes, lines 667-671
667function Cw(e,t){return Cw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Cw(e,t)}function Wr(e,t,r){return t=XL(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XL(e){var t=Zbe(e,"string");return gc(t)=="symbol"?t:t+""}function Zbe(e,t){if(gc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(gc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ewe=function(t){var r=t.data,n=t.startIndex,a=t.endIndex,i=t.x,o=t.width,l=t.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=Ju().domain(Ym(0,c)).range([i,i+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(a),scale:u,scaleValues:d}},SP=function(t){return t.changedTouches&&!!t.changedTouches.length},vc=function(e){function t(r){var n;return Kbe(this,t),n=Ybe(this,t,[r]),Wr(n,"handleDrag",function(a){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(a):n.state.isSlideMoving&&n.handleSlideDrag(a)}),Wr(n,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&n.handleDrag(a.changedTouches[0])}),Wr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:i,startIndex:l})}),n.detachDragEndListener()}),Wr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Wr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Wr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Wr(n,"handleSlideDragStart",function(a){var i=SP(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Jbe(t,e),Gbe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(a,i),h=Math.max(a,i),p=t.getIndexInRange(o,f),v=t.getIndexInRange(o,h);return{startIndex:p-p%c,endIndex:v===d?d:v-v%c}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,l=a.dataKey,c=hr(i[n],l,n);return ke(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,l=a.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,p=c.endIndex,v=c.onChange,m=n.pageX-i;m>0?m=Math.min(m,u+d-f-l,u+d-f-o):m<0&&(m=Math.max(m,u-o,u-l));var g=this.getIndex({startX:o+m,endX:l+m});(g.startIndex!==h||g.endIndex!==p)&&v&&v(g),this.setState({startX:o+m,endX:l+m,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=SP(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,p=d.travellerWidth,v=d.onChange,m=d.gap,g=d.data,y={startX:this.state.startX,endX:this.state.endX},x=n.pageX-i;x>0?x=Math.min(x,f+h-p-u):x<0&&(x=Math.max(x,f-u)),y[o]=u+x;var w=this.getIndex(y),S=w.startIndex,j=w.endIndex,_=function(){var k=g.length-1;return o==="startX"&&(l>c?S%m===0:j%m===0)||l<c&&j===k||o==="endX"&&(l>c?j%m===0:S%m===0)||l>c&&j===k};this.setState(Wr(Wr({},o,u+x),"brushMoveStartX",n.pageX),function(){v&&_()&&v(w)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[a],f=l.indexOf(d);if(f!==-1){var h=f+n;if(!(h===-1||h>=l.length)){var p=l[h];a==="startX"&&p>=u||a==="endX"&&p<=c||this.setState(Wr({},a,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.fill,u=n.stroke;return C.createElement("rect",{stroke:u,fill:c,x:a,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.data,u=n.children,d=n.padding,f=b.Children.only(u);return f?C.cloneElement(f,{x:a,y:i,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,p=c.ariaLabel,v=c.data,m=c.startIndex,g=c.endIndex,y=Math.max(n,this.props.x),x=Ax(Ax({},_e(this.props,!1)),{},{x:y,y:u,width:d,height:f}),w=p||"Min value: ".concat((i=v[m])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=v[g])===null||o===void 0?void 0:o.name);return C.createElement(He,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(j){["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),l.handleTravellerMoveKeyboard(j.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,x))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,l=i.height,c=i.stroke,u=i.travellerWidth,d=Math.min(n,a)+u,f=Math.max(Math.abs(a-n)-u,0);return C.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,f=d.startX,h=d.endX,p=5,v={pointerEvents:"none",fill:u};return C.createElement(He,{className:"recharts-brush-texts"},C.createElement(mo,Xm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-p,y:o+l/2},v),this.getTextOfTick(a)),C.createElement(mo,Xm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+p,y:o+l/2},v),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,l=n.x,c=n.y,u=n.width,d=n.height,f=n.alwaysShowText,h=this.state,p=h.startX,v=h.endX,m=h.isTextActive,g=h.isSlideMoving,y=h.isTravellerMoving,x=h.isTravellerFocused;if(!a||!a.length||!ae(l)||!ae(c)||!ae(u)||!ae(d)||u<=0||d<=0)return null;var w=Te("recharts-brush",i),S=C.Children.count(o)===1,j=Vbe("userSelect","none");return C.createElement(He,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:j},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,v),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(v,"endX"),(m||g||y||x||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,l=n.height,c=n.stroke,u=Math.floor(i+l/2)-1;return C.createElement(C.Fragment,null,C.createElement("rect",{x:a,y:i,width:o,height:l,fill:c,stroke:"none"}),C.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),C.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return C.isValidElement(n)?i=C.cloneElement(n,a):ke(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,f=n.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return Ax({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},i&&i.length?ewe({data:i,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+o-c]);var h=a.scale.domain().map(function(p){return a.scale(p)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,l=i-1;l-o>1;){var c=Math.floor((o+l)/2);n[c]>a?l=c:o=c}return a>=n[l]?l:o}}])}(b.PureComponent);Wr(vc,"displayName","Brush");Wr(vc,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var twe=uS;function rwe(e,t){var r;return twe(e,function(n,a,i){return r=t(n,a,i),!r}),!!r}var nwe=rwe,awe=LD,iwe=Pa,swe=nwe,owe=zr,lwe=Pv;function cwe(e,t,r){var n=owe(e)?awe:swe;return r&&lwe(e,t,r)&&(t=void 0),n(e,iwe(t))}var uwe=cwe;const dwe=qe(uwe);var ja=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},_P=s4;function fwe(e,t,r){t=="__proto__"&&_P?_P(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var hwe=fwe,pwe=hwe,mwe=a4,gwe=Pa;function vwe(e,t){var r={};return t=gwe(t),mwe(e,function(n,a,i){pwe(r,a,t(n,a,i))}),r}var ywe=vwe;const xwe=qe(ywe);function bwe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}var wwe=bwe,jwe=uS;function Swe(e,t){var r=!0;return jwe(e,function(n,a,i){return r=!!t(n,a,i),r}),r}var _we=Swe,Nwe=wwe,kwe=_we,Owe=Pa,Cwe=zr,Ewe=Pv;function Pwe(e,t,r){var n=Cwe(e)?Nwe:kwe;return r&&Ewe(e,t,r)&&(t=void 0),n(e,Owe(t))}var Awe=Pwe;const QL=qe(Awe);var Twe=["x","y"];function vf(e){"@babel/helpers - typeof";return vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vf(e)}function Ew(){return Ew=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},Ew.apply(this,arguments)}function NP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Nu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?NP(Object(r),!0).forEach(function(n){$we(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $we(e,t,r){return t=Rwe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rwe(e){var t=Mwe(e,"string");return vf(t)=="symbol"?t:t+""}function Mwe(e,t){if(vf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(vf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Iwe(e,t){if(e==null)return{};var r=Dwe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dwe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Lwe(e,t){var r=e.x,n=e.y,a=Iwe(e,Twe),i="".concat(r),o=parseInt(i,10),l="".concat(n),c=parseInt(l,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),h=parseInt(f,10);return Nu(Nu(Nu(Nu(Nu({},t),a),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function kP(e){return C.createElement(WL,Ew({shapeType:"rectangle",propTransformer:Lwe,activeClassName:"recharts-active-bar"},e))}var Fwe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=ae(n)||dte(n);return i?t(n,a):(i||vo(),r)}},Bwe=["value","background"],JL;function yc(e){"@babel/helpers - typeof";return yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yc(e)}function Uwe(e,t){if(e==null)return{};var r=zwe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zwe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Jm(){return Jm=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},Jm.apply(this,arguments)}function OP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OP(Object(r),!0).forEach(function(n){Ui(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function qwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,e3(n.key),n)}}function Wwe(e,t,r){return t&&CP(e.prototype,t),r&&CP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hwe(e,t,r){return t=Zm(t),Vwe(e,ZL()?Reflect.construct(t,r||[],Zm(e).constructor):t.apply(e,r))}function Vwe(e,t){if(t&&(yc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kwe(e)}function Kwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZL=function(){return!!e})()}function Zm(e){return Zm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Zm(e)}function Gwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pw(e,t)}function Pw(e,t){return Pw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Pw(e,t)}function Ui(e,t,r){return t=e3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function e3(e){var t=Ywe(e,"string");return yc(t)=="symbol"?t:t+""}function Ywe(e,t){if(yc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qn=function(e){function t(){var r;qwe(this,t);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=Hwe(this,t,[].concat(a)),Ui(r,"state",{isAnimationFinished:!1}),Ui(r,"id",Wf("recharts-bar-")),Ui(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),Ui(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return Gwe(t,e),Wwe(t,[{key:"renderRectanglesStatically",value:function(n){var a=this,i=this.props,o=i.shape,l=i.dataKey,c=i.activeIndex,u=i.activeBar,d=_e(this.props,!1);return n&&n.map(function(f,h){var p=h===c,v=p?u:o,m=Ct(Ct(Ct({},d),f),{},{isActive:p,option:v,index:h,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return C.createElement(He,Jm({className:"recharts-bar-rectangle"},po(a.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),C.createElement(kP,m))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,a=this.props,i=a.data,o=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,h=this.state.prevData;return C.createElement(oi,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var v=p.t,m=i.map(function(g,y){var x=h&&h[y];if(x){var w=ki(x.x,g.x),S=ki(x.y,g.y),j=ki(x.width,g.width),_=ki(x.height,g.height);return Ct(Ct({},g),{},{x:w(v),y:S(v),width:j(v),height:_(v)})}if(o==="horizontal"){var N=ki(0,g.height),k=N(v);return Ct(Ct({},g),{},{y:g.y+g.height-k,height:k})}var O=ki(0,g.width),E=O(v);return Ct(Ct({},g),{},{width:E})});return C.createElement(He,null,n.renderRectanglesStatically(m))})}},{key:"renderRectangles",value:function(){var n=this.props,a=n.data,i=n.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!Bv(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var n=this,a=this.props,i=a.data,o=a.dataKey,l=a.activeIndex,c=_e(this.props.background,!1);return i.map(function(u,d){u.value;var f=u.background,h=Uwe(u,Bwe);if(!f)return null;var p=Ct(Ct(Ct(Ct(Ct({},h),{},{fill:"#eee"},f),c),po(n.props,u,d)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return C.createElement(kP,Jm({key:"background-bar-".concat(d),option:n.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,l=i.xAxis,c=i.yAxis,u=i.layout,d=i.children,f=wn(d,qv);if(!f)return null;var h=u==="vertical"?o[0].height/2:o[0].width/2,p=function(g,y){var x=Array.isArray(g.value)?g.value[1]:g.value;return{x:g.x,y:g.y,value:x,errorVal:hr(g,y)}},v={clipPath:n?"url(#clipPath-".concat(a,")"):null};return C.createElement(He,v,f.map(function(m){return C.cloneElement(m,{key:"error-bar-".concat(a,"-").concat(m.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:p})}))}},{key:"render",value:function(){var n=this.props,a=n.hide,i=n.data,o=n.className,l=n.xAxis,c=n.yAxis,u=n.left,d=n.top,f=n.width,h=n.height,p=n.isAnimationActive,v=n.background,m=n.id;if(a||!i||!i.length)return null;var g=this.state.isAnimationFinished,y=Te("recharts-bar",o),x=l&&l.allowDataOverflow,w=c&&c.allowDataOverflow,S=x||w,j=$e(m)?this.id:m;return C.createElement(He,{className:y},x||w?C.createElement("defs",null,C.createElement("clipPath",{id:"clipPath-".concat(j)},C.createElement("rect",{x:x?u:u-f/2,y:w?d:d-h/2,width:x?f:f*2,height:w?h:h*2}))):null,C.createElement(He,{className:"recharts-bar-rectangles",clipPath:S?"url(#clipPath-".concat(j,")"):null},v?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(S,j),(!p||g)&&Ji.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:a.curData}:n.data!==a.curData?{curData:n.data}:null}}])}(b.PureComponent);JL=Qn;Ui(Qn,"displayName","Bar");Ui(Qn,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Ga.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});Ui(Qn,"getComposedData",function(e){var t=e.props,r=e.item,n=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,p=Ege(n,r);if(!p)return null;var v=t.layout,m=r.type.defaultProps,g=m!==void 0?Ct(Ct({},m),r.props):r.props,y=g.dataKey,x=g.children,w=g.minPointSize,S=v==="horizontal"?o:i,j=u?S.scale.domain():null,_=Ige({numericAxis:S}),N=wn(x,pa),k=f.map(function(O,E){var A,R,T,I,F,P;u?A=Pge(u[d+E],j):(A=hr(O,y),Array.isArray(A)||(A=[_,A]));var D=Fwe(w,JL.defaultProps.minPointSize)(A[1],E);if(v==="horizontal"){var M,$=[o.scale(A[0]),o.scale(A[1])],z=$[0],K=$[1];R=vE({axis:i,ticks:l,bandSize:a,offset:p.offset,entry:O,index:E}),T=(M=K??z)!==null&&M!==void 0?M:void 0,I=p.size;var q=z-K;if(F=Number.isNaN(q)?0:q,P={x:R,y:o.y,width:I,height:o.height},Math.abs(D)>0&&Math.abs(F)<Math.abs(D)){var B=Sr(F||D)*(Math.abs(D)-Math.abs(F));T-=B,F+=B}}else{var Z=[i.scale(A[0]),i.scale(A[1])],he=Z[0],pe=Z[1];if(R=he,T=vE({axis:o,ticks:c,bandSize:a,offset:p.offset,entry:O,index:E}),I=pe-he,F=p.size,P={x:i.x,y:T,width:i.width,height:F},Math.abs(D)>0&&Math.abs(I)<Math.abs(D)){var Q=Sr(I||D)*(Math.abs(D)-Math.abs(I));I+=Q}}return Ct(Ct(Ct({},O),{},{x:R,y:T,width:I,height:F,value:u?A:A[1],payload:O,background:P},N&&N[E]&&N[E].props),{},{tooltipPayload:[jL(r,O)],tooltipPosition:{x:R+I/2,y:T+F/2}})});return Ct({data:k,layout:v},h)});function yf(e){"@babel/helpers - typeof";return yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yf(e)}function Xwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t3(n.key),n)}}function Qwe(e,t,r){return t&&EP(e.prototype,t),r&&EP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function PP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function qn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?PP(Object(r),!0).forEach(function(n){Xv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):PP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xv(e,t,r){return t=t3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t3(e){var t=Jwe(e,"string");return yf(t)=="symbol"?t:t+""}function Jwe(e,t){if(yf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Zwe=function(t,r,n,a,i){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(r),f={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},h=!!Vr(u,Qn);return d.reduce(function(p,v){var m=r[v],g=m.orientation,y=m.domain,x=m.padding,w=x===void 0?{}:x,S=m.mirror,j=m.reversed,_="".concat(g).concat(S?"Mirror":""),N,k,O,E,A;if(m.type==="number"&&(m.padding==="gap"||m.padding==="no-gap")){var R=y[1]-y[0],T=1/0,I=m.categoricalDomain.sort(pte);if(I.forEach(function(Z,he){he>0&&(T=Math.min((Z||0)-(I[he-1]||0),T))}),Number.isFinite(T)){var F=T/R,P=m.layout==="vertical"?n.height:n.width;if(m.padding==="gap"&&(N=F*P/2),m.padding==="no-gap"){var D=_r(t.barCategoryGap,F*P),M=F*P/2;N=M-D-(M-D)/P*D}}}a==="xAxis"?k=[n.left+(w.left||0)+(N||0),n.left+n.width-(w.right||0)-(N||0)]:a==="yAxis"?k=c==="horizontal"?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(N||0),n.top+n.height-(w.bottom||0)-(N||0)]:k=m.range,j&&(k=[k[1],k[0]]);var $=yL(m,i,h),z=$.scale,K=$.realScaleType;z.domain(y).range(k),xL(z);var q=bL(z,qn(qn({},m),{},{realScaleType:K}));a==="xAxis"?(A=g==="top"&&!S||g==="bottom"&&S,O=n.left,E=f[_]-A*m.height):a==="yAxis"&&(A=g==="left"&&!S||g==="right"&&S,O=f[_]-A*m.width,E=n.top);var B=qn(qn(qn({},m),q),{},{realScaleType:K,x:O,y:E,scale:z,width:a==="xAxis"?n.width:m.width,height:a==="yAxis"?n.height:m.height});return B.bandSize=Dm(B,q),!m.hide&&a==="xAxis"?f[_]+=(A?-1:1)*B.height:m.hide||(f[_]+=(A?-1:1)*B.width),qn(qn({},p),{},Xv({},v,B))},{})},r3=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},e1e=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return r3({x:r,y:n},{x:a,y:i})},n3=function(){function e(t){Xwe(this,e),this.scale=t}return Qwe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])}();Xv(n3,"EPS",1e-4);var BS=function(t){var r=Object.keys(t).reduce(function(n,a){return qn(qn({},n),{},Xv({},a,n3.create(t[a])))},{});return qn(qn({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return xwe(a,function(c,u){return r[u].apply(c,{bandAware:o,position:l})})},isInRange:function(a){return QL(a,function(i,o){return r[o].isInRange(i)})}})};function t1e(e){return(e%180+180)%180}var r1e=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=t1e(a),o=i*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)},n1e=Pa,a1e=Hf,i1e=Cv;function s1e(e){return function(t,r,n){var a=Object(t);if(!a1e(t)){var i=n1e(r);t=i1e(t),r=function(l){return i(a[l],l,a)}}var o=e(t,r,n);return o>-1?a[i?t[o]:o]:void 0}}var o1e=s1e,l1e=KL;function c1e(e){var t=l1e(e),r=t%1;return t===t?r?t-r:t:0}var u1e=c1e,d1e=JD,f1e=Pa,h1e=u1e,p1e=Math.max;function m1e(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var a=r==null?0:h1e(r);return a<0&&(a=p1e(n+a,0)),d1e(e,f1e(t),a)}var g1e=m1e,v1e=o1e,y1e=g1e,x1e=v1e(y1e),b1e=x1e;const w1e=qe(b1e);var j1e=mee(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),US=b.createContext(void 0),zS=b.createContext(void 0),a3=b.createContext(void 0),i3=b.createContext({}),s3=b.createContext(void 0),o3=b.createContext(0),l3=b.createContext(0),AP=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=j1e(i);return C.createElement(US.Provider,{value:n},C.createElement(zS.Provider,{value:a},C.createElement(i3.Provider,{value:i},C.createElement(a3.Provider,{value:d},C.createElement(s3.Provider,{value:o},C.createElement(o3.Provider,{value:u},C.createElement(l3.Provider,{value:c},l)))))))},S1e=function(){return b.useContext(s3)},c3=function(t){var r=b.useContext(US);r==null&&vo();var n=r[t];return n==null&&vo(),n},_1e=function(){var t=b.useContext(US);return Ti(t)},N1e=function(){var t=b.useContext(zS),r=w1e(t,function(n){return QL(n.domain,Number.isFinite)});return r||Ti(t)},u3=function(t){var r=b.useContext(zS);r==null&&vo();var n=r[t];return n==null&&vo(),n},k1e=function(){var t=b.useContext(a3);return t},O1e=function(){return b.useContext(i3)},qS=function(){return b.useContext(l3)},WS=function(){return b.useContext(o3)};function xc(e){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xc(e)}function C1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E1e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f3(n.key),n)}}function P1e(e,t,r){return t&&E1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function A1e(e,t,r){return t=eg(t),T1e(e,d3()?Reflect.construct(t,r||[],eg(e).constructor):t.apply(e,r))}function T1e(e,t){if(t&&(xc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return $1e(e)}function $1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(d3=function(){return!!e})()}function eg(e){return eg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},eg(e)}function R1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Aw(e,t)}function Aw(e,t){return Aw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Aw(e,t)}function TP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function $P(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?TP(Object(r),!0).forEach(function(n){HS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HS(e,t,r){return t=f3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f3(e){var t=M1e(e,"string");return xc(t)=="symbol"?t:t+""}function M1e(e,t){if(xc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I1e(e,t){return B1e(e)||F1e(e,t)||L1e(e,t)||D1e()}function D1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
668In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L1e(e,t){if(e){if(typeof e=="string")return RP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return RP(e,t)}}function RP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function F1e(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function B1e(e){if(Array.isArray(e))return e}function Tw(){return Tw=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},Tw.apply(this,arguments)}var U1e=function(t,r){var n;return C.isValidElement(t)?n=C.cloneElement(t,r):ke(t)?n=t(r):n=C.createElement("line",Tw({},r,{className:"recharts-reference-line-line"})),n},z1e=function(t,r,n,a,i,o,l,c,u){var d=i.x,f=i.y,h=i.width,p=i.height;if(n){var v=u.y,m=t.y.apply(v,{position:o});if(ja(u,"discard")&&!t.y.isInRange(m))return null;var g=[{x:d+h,y:m},{x:d,y:m}];return c==="left"?g.reverse():g}if(r){var y=u.x,x=t.x.apply(y,{position:o});if(ja(u,"discard")&&!t.x.isInRange(x))return null;var w=[{x,y:f+p},{x,y:f}];return l==="top"?w.reverse():w}if(a){var S=u.segment,j=S.map(function(_){return t.apply(_,{position:o})});return ja(u,"discard")&&dwe(j,function(_){return!t.isInRange(_)})?null:j}return null};function q1e(e){var t=e.x,r=e.y,n=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=S1e(),d=c3(a),f=u3(i),h=k1e();if(!u||!h)return null;Xn(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=BS({x:d.scale,y:f.scale}),v=Lt(t),m=Lt(r),g=n&&n.length===2,y=z1e(p,v,m,g,h,e.position,d.orientation,f.orientation,e);if(!y)return null;var x=I1e(y,2),w=x[0],S=w.x,j=w.y,_=x[1],N=_.x,k=_.y,O=ja(e,"hidden")?"url(#".concat(u,")"):void 0,E=$P($P({clipPath:O},_e(e,!0)),{},{x1:S,y1:j,x2:N,y2:k});return C.createElement(He,{className:Te("recharts-reference-line",l)},U1e(o,E),qt.renderCallByParent(e,e1e({x1:S,y1:j,x2:N,y2:k})))}var VS=function(e){function t(){return C1e(this,t),A1e(this,t,arguments)}return R1e(t,e),P1e(t,[{key:"render",value:function(){return C.createElement(q1e,this.props)}}])}(C.Component);HS(VS,"displayName","ReferenceLine");HS(VS,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function $w(){return $w=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},$w.apply(this,arguments)}function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}function MP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function IP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MP(Object(r),!0).forEach(function(n){Qv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function W1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H1e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p3(n.key),n)}}function V1e(e,t,r){return t&&H1e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function K1e(e,t,r){return t=tg(t),G1e(e,h3()?Reflect.construct(t,r||[],tg(e).constructor):t.apply(e,r))}function G1e(e,t){if(t&&(bc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Y1e(e)}function Y1e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(h3=function(){return!!e})()}function tg(e){return tg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},tg(e)}function X1e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rw(e,t)}function Rw(e,t){return Rw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Rw(e,t)}function Qv(e,t,r){return t=p3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p3(e){var t=Q1e(e,"string");return bc(t)=="symbol"?t:t+""}function Q1e(e,t){if(bc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(bc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var J1e=function(t){var r=t.x,n=t.y,a=t.xAxis,i=t.yAxis,o=BS({x:a.scale,y:i.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return ja(t,"discard")&&!o.isInRange(l)?null:l},Jv=function(e){function t(){return W1e(this,t),K1e(this,t,arguments)}return X1e(t,e),V1e(t,[{key:"render",value:function(){var n=this.props,a=n.x,i=n.y,o=n.r,l=n.alwaysShow,c=n.clipPathId,u=Lt(a),d=Lt(i);if(Xn(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=J1e(this.props);if(!f)return null;var h=f.x,p=f.y,v=this.props,m=v.shape,g=v.className,y=ja(this.props,"hidden")?"url(#".concat(c,")"):void 0,x=IP(IP({clipPath:y},_e(this.props,!0)),{},{cx:h,cy:p});return C.createElement(He,{className:Te("recharts-reference-dot",g)},t.renderDot(m,x),qt.renderCallByParent(this.props,{x:h-o,y:p-o,width:2*o,height:2*o}))}}])}(C.Component);Qv(Jv,"displayName","ReferenceDot");Qv(Jv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Qv(Jv,"renderDot",function(e,t){var r;return C.isValidElement(e)?r=C.cloneElement(e,t):ke(e)?r=e(t):r=C.createElement(FS,$w({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),r});function Mw(){return Mw=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},Mw.apply(this,arguments)}function wc(e){"@babel/helpers - typeof";return wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wc(e)}function DP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function LP(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DP(Object(r),!0).forEach(function(n){Zv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Z1e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eje(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,g3(n.key),n)}}function tje(e,t,r){return t&&eje(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rje(e,t,r){return t=rg(t),nje(e,m3()?Reflect.construct(t,r||[],rg(e).constructor):t.apply(e,r))}function nje(e,t){if(t&&(wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return aje(e)}function aje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(m3=function(){return!!e})()}function rg(e){return rg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},rg(e)}function ije(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Iw(e,t)}function Iw(e,t){return Iw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Iw(e,t)}function Zv(e,t,r){return t=g3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g3(e){var t=sje(e,"string");return wc(t)=="symbol"?t:t+""}function sje(e,t){if(wc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(wc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var oje=function(t,r,n,a,i){var o=i.x1,l=i.x2,c=i.y1,u=i.y2,d=i.xAxis,f=i.yAxis;if(!d||!f)return null;var h=BS({x:d.scale,y:f.scale}),p={x:t?h.x.apply(o,{position:"start"}):h.x.rangeMin,y:n?h.y.apply(c,{position:"start"}):h.y.rangeMin},v={x:r?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(u,{position:"end"}):h.y.rangeMax};return ja(i,"discard")&&(!h.isInRange(p)||!h.isInRange(v))?null:r3(p,v)},ey=function(e){function t(){return Z1e(this,t),rje(this,t,arguments)}return ije(t,e),tje(t,[{key:"render",value:function(){var n=this.props,a=n.x1,i=n.x2,o=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,d=n.clipPathId;Xn(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Lt(a),h=Lt(i),p=Lt(o),v=Lt(l),m=this.props.shape;if(!f&&!h&&!p&&!v&&!m)return null;var g=oje(f,h,p,v,this.props);if(!g&&!m)return null;var y=ja(this.props,"hidden")?"url(#".concat(d,")"):void 0;return C.createElement(He,{className:Te("recharts-reference-area",c)},t.renderRect(m,LP(LP({clipPath:y},_e(this.props,!0)),g)),qt.renderCallByParent(this.props,g))}}])}(C.Component);Zv(ey,"displayName","ReferenceArea");Zv(ey,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Zv(ey,"renderRect",function(e,t){var r;return C.isValidElement(e)?r=C.cloneElement(e,t):ke(e)?r=e(t):r=C.createElement(LS,Mw({},t,{className:"recharts-reference-area-rect"})),r});function v3(e,t,r){if(t<1)return[];if(t===1&&r===void 0)return e;for(var n=[],a=0;a<e.length;a+=t)n.push(e[a]);return n}function lje(e,t,r){var n={width:e.width+t.width,height:e.height+t.height};return r1e(n,r)}function cje(e,t,r){var n=r==="width",a=e.x,i=e.y,o=e.width,l=e.height;return t===1?{start:n?a:i,end:n?a+o:i+l}:{start:n?a+o:i+l,end:n?a:i}}function ng(e,t,r,n,a){if(e*t<e*n||e*t>e*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function uje(e,t){return v3(e,t+1)}function dje(e,t,r,n,a){for(var i=(n||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var v=n==null?void 0:n[c];if(v===void 0)return{v:v3(n,u)};var m=c,g,y=function(){return g===void 0&&(g=r(v,m)),g},x=v.coordinate,w=c===0||ng(e,x,y,d,l);w||(c=0,d=o,u+=1),w&&(d=x+e*(y()/2+a),c+=u)},h;u<=i.length;)if(h=f(),h)return h.v;return[]}function xf(e){"@babel/helpers - typeof";return xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xf(e)}function FP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ur(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?FP(Object(r),!0).forEach(function(n){fje(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function fje(e,t,r){return t=hje(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hje(e){var t=pje(e,"string");return xf(t)=="symbol"?t:t+""}function pje(e,t){if(xf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(xf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mje(e,t,r,n,a){for(var i=(n||[]).slice(),o=i.length,l=t.start,c=t.end,u=function(h){var p=i[h],v,m=function(){return v===void 0&&(v=r(p,h)),v};if(h===o-1){var g=e*(p.coordinate+e*m()/2-c);i[h]=p=ur(ur({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate})}else i[h]=p=ur(ur({},p),{},{tickCoord:p.coordinate});var y=ng(e,p.tickCoord,m,l,c);y&&(c=p.tickCoord-e*(m()/2+a),i[h]=ur(ur({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return i}function gje(e,t,r,n,a,i){var o=(n||[]).slice(),l=o.length,c=t.start,u=t.end;if(i){var d=n[l-1],f=r(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=ur(ur({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var p=ng(e,d.tickCoord,function(){return f},c,u);p&&(u=d.tickCoord-e*(f/2+a),o[l-1]=ur(ur({},d),{},{isShow:!0}))}for(var v=i?l-1:l,m=function(x){var w=o[x],S,j=function(){return S===void 0&&(S=r(w,x)),S};if(x===0){var _=e*(w.coordinate-e*j()/2-c);o[x]=w=ur(ur({},w),{},{tickCoord:_<0?w.coordinate-_*e:w.coordinate})}else o[x]=w=ur(ur({},w),{},{tickCoord:w.coordinate});var N=ng(e,w.tickCoord,j,c,u);N&&(c=w.tickCoord+e*(j()/2+a),o[x]=ur(ur({},w),{},{isShow:!0}))},g=0;g<v;g++)m(g);return o}function KS(e,t,r){var n=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!a||!a.length||!n)return[];if(ae(c)||Ga.isSsr)return uje(a,typeof c=="number"&&ae(c)?c:0);var h=[],p=l==="top"||l==="bottom"?"width":"height",v=d&&p==="width"?Qu(d,{fontSize:t,letterSpacing:r}):{width:0,height:0},m=function(w,S){var j=ke(u)?u(w.value,S):w.value;return p==="width"?lje(Qu(j,{fontSize:t,letterSpacing:r}),v,f):Qu(j,{fontSize:t,letterSpacing:r})[p]},g=a.length>=2?Sr(a[1].coordinate-a[0].coordinate):1,y=cje(i,g,p);return c==="equidistantPreserveStart"?dje(g,y,m,a,o):(c==="preserveStart"||c==="preserveStartEnd"?h=gje(g,y,m,a,o,c==="preserveStartEnd"):h=mje(g,y,m,a,o),h.filter(function(x){return x.isShow}))}var vje=["viewBox"],yje=["viewBox"],xje=["ticks"];function jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function vl(){return vl=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},vl.apply(this,arguments)}function BP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Rt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?BP(Object(r),!0).forEach(function(n){GS(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):BP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Tx(e,t){if(e==null)return{};var r=bje(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bje(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function UP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,x3(n.key),n)}}function jje(e,t,r){return t&&UP(e.prototype,t),r&&UP(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sje(e,t,r){return t=ag(t),_je(e,y3()?Reflect.construct(t,r||[],ag(e).constructor):t.apply(e,r))}function _je(e,t){if(t&&(jc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nje(e)}function Nje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y3=function(){return!!e})()}function ag(e){return ag=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ag(e)}function kje(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dw(e,t)}function Dw(e,t){return Dw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Dw(e,t)}function GS(e,t,r){return t=x3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function x3(e){var t=Oje(e,"string");return jc(t)=="symbol"?t:t+""}function Oje(e,t){if(jc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ru=function(e){function t(r){var n;return wje(this,t),n=Sje(this,t,[r]),n.state={fontSize:"",letterSpacing:""},n}return kje(t,e),jje(t,[{key:"shouldComponentUpdate",value:function(n,a){var i=n.viewBox,o=Tx(n,vje),l=this.props,c=l.viewBox,u=Tx(l,yje);return!El(i,c)||!El(o,u)||!El(a,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var a=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.x,o=a.y,l=a.width,c=a.height,u=a.orientation,d=a.tickSize,f=a.mirror,h=a.tickMargin,p,v,m,g,y,x,w=f?-1:1,S=n.tickSize||d,j=ae(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":p=v=n.coordinate,g=o+ +!f*c,m=g-w*S,x=m-w*h,y=j;break;case"left":m=g=n.coordinate,v=i+ +!f*l,p=v-w*S,y=p-w*h,x=j;break;case"right":m=g=n.coordinate,v=i+ +f*l,p=v+w*S,y=p+w*h,x=j;break;default:p=v=n.coordinate,g=o+ +f*c,m=g+w*S,x=m+w*h,y=j;break}return{line:{x1:p,y1:m,x2:v,y2:g},tick:{x:y,y:x}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,c=n.orientation,u=n.mirror,d=n.axisLine,f=Rt(Rt(Rt({},_e(this.props,!1)),_e(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=Rt(Rt({},f),{},{x1:a,y1:i+h*l,x2:a+o,y2:i+h*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);f=Rt(Rt({},f),{},{x1:a+p*o,y1:i,x2:a+p*o,y2:i+l})}return C.createElement("line",vl({},f,{className:Te("recharts-cartesian-axis-line",tn(d,"className"))}))}},{key:"renderTicks",value:function(n,a,i){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,p=KS(Rt(Rt({},this.props),{},{ticks:n}),a,i),v=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),g=_e(this.props,!1),y=_e(d,!1),x=Rt(Rt({},g),{},{fill:"none"},_e(c,!1)),w=p.map(function(S,j){var _=o.getTickLineCoord(S),N=_.line,k=_.tick,O=Rt(Rt(Rt(Rt({textAnchor:v,verticalAnchor:m},g),{},{stroke:"none",fill:u},y),k),{},{index:j,payload:S,visibleTicksCount:p.length,tickFormatter:f});return C.createElement(He,vl({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},po(o.props,S,j)),c&&C.createElement("line",vl({},x,N,{className:Te("recharts-cartesian-axis-tick-line",tn(c,"className"))})),d&&t.renderTickItem(d,O,"".concat(ke(f)?f(S.value,j):S.value).concat(h||"")))});return C.createElement("g",{className:"recharts-cartesian-axis-ticks"},w)}},{key:"render",value:function(){var n=this,a=this.props,i=a.axisLine,o=a.width,l=a.height,c=a.ticksGenerator,u=a.className,d=a.hide;if(d)return null;var f=this.props,h=f.ticks,p=Tx(f,xje),v=h;return ke(c)&&(v=h&&h.length>0?c(this.props):c(p)),o<=0||l<=0||!v||!v.length?null:C.createElement(He,{className:Te("recharts-cartesian-axis",u),ref:function(g){n.layerReference=g}},i&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),qt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o,l=Te(a.className,"recharts-cartesian-axis-tick-value");return C.isValidElement(n)?o=C.cloneElement(n,Rt(Rt({},a),{},{className:l})):ke(n)?o=n(Rt(Rt({},a),{},{className:l})):o=C.createElement(mo,vl({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(b.Component);GS(ru,"displayName","CartesianAxis");GS(ru,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Cje=["x1","y1","x2","y2","key"],Eje=["offset"];function yo(e){"@babel/helpers - typeof";return yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yo(e)}function zP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zP(Object(r),!0).forEach(function(n){Pje(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pje(e,t,r){return t=Aje(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Aje(e){var t=Tje(e,"string");return yo(t)=="symbol"?t:t+""}function Tje(e,t){if(yo(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(yo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zs(){return zs=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},zs.apply(this,arguments)}function qP(e,t){if(e==null)return{};var r=$je(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $je(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Rje=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,o=t.width,l=t.height,c=t.ry;return C.createElement("rect",{x:a,y:i,ry:c,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function b3(e,t){var r;if(C.isValidElement(e))r=C.cloneElement(e,t);else if(ke(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,o=t.y2,l=t.key,c=qP(t,Cje),u=_e(c,!1);u.offset;var d=qP(u,Eje);r=C.createElement("line",zs({},d,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:l}))}return r}function Mje(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,c){var u=fr(fr({},e),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return b3(a,u)});return C.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Ije(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,c){var u=fr(fr({},e),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return b3(a,u)});return C.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function Dje(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var v=!d[p+1],m=v?a+o-h:d[p+1]-h;if(m<=0)return null;var g=p%t.length;return C.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:m,width:i,stroke:"none",fill:t[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return C.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function Lje(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==d[0]&&d.unshift(0);var f=d.map(function(h,p){var v=!d[p+1],m=v?i+l-h:d[p+1]-h;if(m<=0)return null;var g=p%n.length;return C.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:c,stroke:"none",fill:n[g],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return C.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var Fje=function(t,r){var n=t.xAxis,a=t.width,i=t.height,o=t.offset;return vL(KS(fr(fr(fr({},ru.defaultProps),n),{},{ticks:Ha(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},Bje=function(t,r){var n=t.yAxis,a=t.width,i=t.height,o=t.offset;return vL(KS(fr(fr(fr({},ru.defaultProps),n),{},{ticks:Ha(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},Ho={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function $l(e){var t,r,n,a,i,o,l=qS(),c=WS(),u=O1e(),d=fr(fr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Ho.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Ho.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Ho.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Ho.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:Ho.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:Ho.verticalFill,x:ae(e.x)?e.x:u.left,y:ae(e.y)?e.y:u.top,width:ae(e.width)?e.width:u.width,height:ae(e.height)?e.height:u.height}),f=d.x,h=d.y,p=d.width,v=d.height,m=d.syncWithTicks,g=d.horizontalValues,y=d.verticalValues,x=_1e(),w=N1e();if(!ae(p)||p<=0||!ae(v)||v<=0||!ae(f)||f!==+f||!ae(h)||h!==+h)return null;var S=d.verticalCoordinatesGenerator||Fje,j=d.horizontalCoordinatesGenerator||Bje,_=d.horizontalPoints,N=d.verticalPoints;if((!_||!_.length)&&ke(j)){var k=g&&g.length,O=j({yAxis:w?fr(fr({},w),{},{ticks:k?g:w.ticks}):void 0,width:l,height:c,offset:u},k?!0:m);Xn(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(yo(O),"]")),Array.isArray(O)&&(_=O)}if((!N||!N.length)&&ke(S)){var E=y&&y.length,A=S({xAxis:x?fr(fr({},x),{},{ticks:E?y:x.ticks}):void 0,width:l,height:c,offset:u},E?!0:m);Xn(Array.isArray(A),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(yo(A),"]")),Array.isArray(A)&&(N=A)}return C.createElement("g",{className:"recharts-cartesian-grid"},C.createElement(Rje,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),C.createElement(Mje,zs({},d,{offset:u,horizontalPoints:_,xAxis:x,yAxis:w})),C.createElement(Ije,zs({},d,{offset:u,verticalPoints:N,xAxis:x,yAxis:w})),C.createElement(Dje,zs({},d,{horizontalPoints:_})),C.createElement(Lje,zs({},d,{verticalPoints:N})))}$l.displayName="CartesianGrid";function Sc(e){"@babel/helpers - typeof";return Sc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sc(e)}function Uje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zje(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,S3(n.key),n)}}function qje(e,t,r){return t&&zje(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Wje(e,t,r){return t=ig(t),Hje(e,w3()?Reflect.construct(t,r||[],ig(e).constructor):t.apply(e,r))}function Hje(e,t){if(t&&(Sc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vje(e)}function Vje(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w3=function(){return!!e})()}function ig(e){return ig=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ig(e)}function Kje(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lw(e,t)}function Lw(e,t){return Lw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Lw(e,t)}function j3(e,t,r){return t=S3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S3(e){var t=Gje(e,"string");return Sc(t)=="symbol"?t:t+""}function Gje(e,t){if(Sc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Sc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fw(){return Fw=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},Fw.apply(this,arguments)}function Yje(e){var t=e.xAxisId,r=qS(),n=WS(),a=c3(t);return a==null?null:b.createElement(ru,Fw({},a,{className:Te("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return Ha(o,!0)}}))}var Zi=function(e){function t(){return Uje(this,t),Wje(this,t,arguments)}return Kje(t,e),qje(t,[{key:"render",value:function(){return b.createElement(Yje,this.props)}}])}(b.Component);j3(Zi,"displayName","XAxis");j3(Zi,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function _c(e){"@babel/helpers - typeof";return _c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_c(e)}function Xje(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qje(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,k3(n.key),n)}}function Jje(e,t,r){return t&&Qje(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zje(e,t,r){return t=sg(t),eSe(e,_3()?Reflect.construct(t,r||[],sg(e).constructor):t.apply(e,r))}function eSe(e,t){if(t&&(_c(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tSe(e)}function tSe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_3=function(){return!!e})()}function sg(e){return sg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sg(e)}function rSe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bw(e,t)}function Bw(e,t){return Bw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Bw(e,t)}function N3(e,t,r){return t=k3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function k3(e){var t=nSe(e,"string");return _c(t)=="symbol"?t:t+""}function nSe(e,t){if(_c(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(_c(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Uw(){return Uw=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},Uw.apply(this,arguments)}var aSe=function(t){var r=t.yAxisId,n=qS(),a=WS(),i=u3(r);return i==null?null:b.createElement(ru,Uw({},i,{className:Te("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:a},ticksGenerator:function(l){return Ha(l,!0)}}))},es=function(e){function t(){return Xje(this,t),Zje(this,t,arguments)}return rSe(t,e),Jje(t,[{key:"render",value:function(){return b.createElement(aSe,this.props)}}])}(b.Component);N3(es,"displayName","YAxis");N3(es,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function WP(e){return lSe(e)||oSe(e)||sSe(e)||iSe()}function iSe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
669In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sSe(e,t){if(e){if(typeof e=="string")return zw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zw(e,t)}}function oSe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lSe(e){if(Array.isArray(e))return zw(e)}function zw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var qw=function(t,r,n,a,i){var o=wn(t,VS),l=wn(t,Jv),c=[].concat(WP(o),WP(l)),u=wn(t,ey),d="".concat(a,"Id"),f=a[0],h=r;if(c.length&&(h=c.reduce(function(m,g){if(g.props[d]===n&&ja(g.props,"extendDomain")&&ae(g.props[f])){var y=g.props[f];return[Math.min(m[0],y),Math.max(m[1],y)]}return m},h)),u.length){var p="".concat(f,"1"),v="".concat(f,"2");h=u.reduce(function(m,g){if(g.props[d]===n&&ja(g.props,"extendDomain")&&ae(g.props[p])&&ae(g.props[v])){var y=g.props[p],x=g.props[v];return[Math.min(m[0],y,x),Math.max(m[1],y,x)]}return m},h)}return i&&i.length&&(h=i.reduce(function(m,g){return ae(g)?[Math.min(m[0],g),Math.max(m[1],g)]:m},h)),h},O3={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function i(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new a(d,f||c,h),v=r?r+u:u;return c._events[v]?c._events[v].fn?c._events[v]=[c._events[v],p]:c._events[v].push(p):(c._events[v]=p,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=r?r+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,v=new Array(p);h<p;h++)v[h]=f[h].fn;return v},l.prototype.listenerCount=function(u){var d=r?r+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,p,v){var m=r?r+u:u;if(!this._events[m])return!1;var g=this._events[m],y=arguments.length,x,w;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,d),!0;case 3:return g.fn.call(g.context,d,f),!0;case 4:return g.fn.call(g.context,d,f,h),!0;case 5:return g.fn.call(g.context,d,f,h,p),!0;case 6:return g.fn.call(g.context,d,f,h,p,v),!0}for(w=1,x=new Array(y-1);w<y;w++)x[w-1]=arguments[w];g.fn.apply(g.context,x)}else{var S=g.length,j;for(w=0;w<S;w++)switch(g[w].once&&this.removeListener(u,g[w].fn,void 0,!0),y){case 1:g[w].fn.call(g[w].context);break;case 2:g[w].fn.call(g[w].context,d);break;case 3:g[w].fn.call(g[w].context,d,f);break;case 4:g[w].fn.call(g[w].context,d,f,h);break;default:if(!x)for(j=1,x=new Array(y-1);j<y;j++)x[j-1]=arguments[j];g[w].fn.apply(g[w].context,x)}}return!0},l.prototype.on=function(u,d,f){return i(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return i(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var p=r?r+u:u;if(!this._events[p])return this;if(!d)return o(this,p),this;var v=this._events[p];if(v.fn)v.fn===d&&(!h||v.once)&&(!f||v.context===f)&&o(this,p);else{for(var m=0,g=[],y=v.length;m<y;m++)(v[m].fn!==d||h&&!v[m].once||f&&v[m].context!==f)&&g.push(v[m]);g.length?this._events[p]=g.length===1?g[0]:g:o(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&o(this,d)):(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})(O3);var cSe=O3.exports;const uSe=qe(cSe);var $x=new uSe,Rx="recharts.syncMouseEvents";function bf(e){"@babel/helpers - typeof";return bf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bf(e)}function dSe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fSe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,C3(n.key),n)}}function hSe(e,t,r){return t&&fSe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Mx(e,t,r){return t=C3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C3(e){var t=pSe(e,"string");return bf(t)=="symbol"?t:t+""}function pSe(e,t){if(bf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(bf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var mSe=function(){function e(){dSe(this,e),Mx(this,"activeIndex",0),Mx(this,"coordinateList",[]),Mx(this,"layout","horizontal")}return hSe(e,[{key:"setDetails",value:function(r){var n,a=r.coordinateList,i=a===void 0?null:a,o=r.container,l=o===void 0?null:o,c=r.layout,u=c===void 0?null:c,d=r.offset,f=d===void 0?null:d,h=r.mouseHandlerCallback,p=h===void 0?null:h;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,f=i+c+u,h=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function gSe(e,t,r){if(r==="number"&&t===!0&&Array.isArray(e)){var n=e==null?void 0:e[0],a=e==null?void 0:e[1];if(n&&a&&ae(n)&&ae(a))return!0}return!1}function vSe(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function E3(e){var t=e.cx,r=e.cy,n=e.radius,a=e.startAngle,i=e.endAngle,o=at(t,r,n,a),l=at(t,r,n,i);return{points:[o,l],cx:t,cy:r,radius:n,startAngle:a,endAngle:i}}function ySe(e,t,r){var n,a,i,o;if(e==="horizontal")n=t.x,i=n,a=r.top,o=r.top+r.height;else if(e==="vertical")a=t.y,o=a,n=r.left,i=r.left+r.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,h=at(l,c,u,f),p=at(l,c,d,f);n=h.x,a=h.y,i=p.x,o=p.y}else return E3(t);return[{x:n,y:a},{x:i,y:o}]}function wf(e){"@babel/helpers - typeof";return wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wf(e)}function HP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Kh(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HP(Object(r),!0).forEach(function(n){xSe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function xSe(e,t,r){return t=bSe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bSe(e){var t=wSe(e,"string");return wf(t)=="symbol"?t:t+""}function wSe(e,t){if(wf(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(wf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jSe(e){var t,r,n=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,p=(t=n.props.cursor)!==null&&t!==void 0?t:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!p||!i||!o||h!=="ScatterChart"&&a!=="axis")return null;var v,m=fw;if(h==="ScatterChart")v=o,m=Zxe;else if(h==="BarChart")v=vSe(f,o,c,d),m=LS;else if(f==="radial"){var g=E3(o),y=g.cx,x=g.cy,w=g.radius,S=g.startAngle,j=g.endAngle;v={cx:y,cy:x,startAngle:S,endAngle:j,innerRadius:w,outerRadius:w},m=CL}else v={points:ySe(f,o,c)},m=fw;var _=Kh(Kh(Kh(Kh({stroke:"#ccc",pointerEvents:"none"},c),v),_e(p,!1)),{},{payload:l,payloadIndex:u,className:Te("recharts-tooltip-cursor",p.className)});return b.isValidElement(p)?b.cloneElement(p,_):b.createElement(m,_)}var SSe=["item"],_Se=["children","className","width","height","style","compact","title","desc"];function Nc(e){"@babel/helpers - typeof";return Nc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nc(e)}function yl(){return yl=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},yl.apply(this,arguments)}function VP(e,t){return OSe(e)||kSe(e,t)||A3(e,t)||NSe()}function NSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
670In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kSe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function OSe(e){if(Array.isArray(e))return e}function KP(e,t){if(e==null)return{};var r=CSe(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function CSe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ESe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PSe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,T3(n.key),n)}}function ASe(e,t,r){return t&&PSe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function TSe(e,t,r){return t=og(t),$Se(e,P3()?Reflect.construct(t,r||[],og(e).constructor):t.apply(e,r))}function $Se(e,t){if(t&&(Nc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return RSe(e)}function RSe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(P3=function(){return!!e})()}function og(e){return og=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},og(e)}function MSe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ww(e,t)}function Ww(e,t){return Ww=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},Ww(e,t)}function kc(e){return LSe(e)||DSe(e)||A3(e)||ISe()}function ISe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
671In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A3(e,t){if(e){if(typeof e=="string")return Hw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Hw(e,t)}}function DSe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function LSe(e){if(Array.isArray(e))return Hw(e)}function Hw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function GP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?GP(Object(r),!0).forEach(function(n){Se(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):GP(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Se(e,t,r){return t=T3(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T3(e){var t=FSe(e,"string");return Nc(t)=="symbol"?t:t+""}function FSe(e,t){if(Nc(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var BSe={xAxis:["bottom","top"],yAxis:["left","right"]},USe={width:"100%",height:"100%"},$3={x:0,y:0};function Gh(e){return e}var zSe=function(t,r){return r==="horizontal"?t.x:r==="vertical"?t.y:r==="centric"?t.angle:t.radius},qSe=function(t,r,n,a){var i=r.find(function(d){return d&&d.index===n});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,l=a.radius;return H(H(H({},a),at(a.cx,a.cy,l,o)),{},{angle:o,radius:l})}var c=i.coordinate,u=a.angle;return H(H(H({},a),at(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return $3},ty=function(t,r){var n=r.graphicalItems,a=r.dataStartIndex,i=r.dataEndIndex,o=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(kc(l),kc(u)):l},[]);return o.length>0?o:t&&t.length&&ae(a)&&ae(i)?t.slice(a,i+1):[]};function R3(e){return e==="number"?[0,"auto"]:void 0}var Vw=function(t,r,n,a){var i=t.graphicalItems,o=t.tooltipAxis,l=ty(r,t);return n<0||!i||!i.length||n>=l.length?null:i.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:r;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=f===void 0?l:f;h=bb(p,o.dataKey,a)}else h=f&&f[n]||l[n];return h?[].concat(kc(c),[jL(u,h)]):c},[])},YP=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},o=zSe(i,n),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=Sge(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=Vw(t,r,d,f),p=qSe(n,l,d,i);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:p}}return null},WSe=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,p=gL(d,i);return n.reduce(function(v,m){var g,y=m.type.defaultProps!==void 0?H(H({},m.type.defaultProps),m.props):m.props,x=y.type,w=y.dataKey,S=y.allowDataOverflow,j=y.allowDuplicatedCategory,_=y.scale,N=y.ticks,k=y.includeHidden,O=y[o];if(v[O])return v;var E=ty(t.data,{graphicalItems:a.filter(function(q){var B,Z=o in q.props?q.props[o]:(B=q.type.defaultProps)===null||B===void 0?void 0:B[o];return Z===O}),dataStartIndex:c,dataEndIndex:u}),A=E.length,R,T,I;gSe(y.domain,S,x)&&(R=ow(y.domain,null,S),p&&(x==="number"||_!=="auto")&&(I=Zu(E,w,"category")));var F=R3(x);if(!R||R.length===0){var P,D=(P=y.domain)!==null&&P!==void 0?P:F;if(w){if(R=Zu(E,w,x),x==="category"&&p){var M=hte(R);j&&M?(T=R,R=Ym(0,A)):j||(R=bE(D,R,m).reduce(function(q,B){return q.indexOf(B)>=0?q:[].concat(kc(q),[B])},[]))}else if(x==="category")j?R=R.filter(function(q){return q!==""&&!$e(q)}):R=bE(D,R,m).reduce(function(q,B){return q.indexOf(B)>=0||B===""||$e(B)?q:[].concat(kc(q),[B])},[]);else if(x==="number"){var $=Cge(E,a.filter(function(q){var B,Z,he=o in q.props?q.props[o]:(B=q.type.defaultProps)===null||B===void 0?void 0:B[o],pe="hide"in q.props?q.props.hide:(Z=q.type.defaultProps)===null||Z===void 0?void 0:Z.hide;return he===O&&(k||!pe)}),w,i,d);$&&(R=$)}p&&(x==="number"||_!=="auto")&&(I=Zu(E,w,"category"))}else p?R=Ym(0,A):l&&l[O]&&l[O].hasStack&&x==="number"?R=h==="expand"?[0,1]:wL(l[O].stackGroups,c,u):R=mL(E,a.filter(function(q){var B=o in q.props?q.props[o]:q.type.defaultProps[o],Z="hide"in q.props?q.props.hide:q.type.defaultProps.hide;return B===O&&(k||!Z)}),x,d,!0);if(x==="number")R=qw(f,R,O,i,N),D&&(R=ow(D,R,S));else if(x==="category"&&D){var z=D,K=R.every(function(q){return z.indexOf(q)>=0});K&&(R=z)}}return H(H({},v),{},Se({},O,H(H({},y),{},{axisType:i,domain:R,categoricalDomain:I,duplicateDomain:T,originalDomain:(g=y.domain)!==null&&g!==void 0?g:F,isCategorical:p,layout:d})))},{})},HSe=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.layout,f=t.children,h=ty(t.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),p=h.length,v=gL(d,i),m=-1;return n.reduce(function(g,y){var x=y.type.defaultProps!==void 0?H(H({},y.type.defaultProps),y.props):y.props,w=x[o],S=R3("number");if(!g[w]){m++;var j;return v?j=Ym(0,p):l&&l[w]&&l[w].hasStack?(j=wL(l[w].stackGroups,c,u),j=qw(f,j,w,i)):(j=ow(S,mL(h,n.filter(function(_){var N,k,O=o in _.props?_.props[o]:(N=_.type.defaultProps)===null||N===void 0?void 0:N[o],E="hide"in _.props?_.props.hide:(k=_.type.defaultProps)===null||k===void 0?void 0:k.hide;return O===w&&!E}),"number",d),a.defaultProps.allowDataOverflow),j=qw(f,j,w,i)),H(H({},g),{},Se({},w,H(H({axisType:i},a.defaultProps),{},{hide:!0,orientation:tn(BSe,"".concat(i,".").concat(m%2),null),domain:j,originalDomain:S,isCategorical:v,layout:d})))}return g},{})},VSe=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=t.children,f="".concat(a,"Id"),h=wn(d,i),p={};return h&&h.length?p=WSe(t,{axes:h,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=HSe(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},KSe=function(t){var r=Ti(t),n=Ha(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:dS(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Dm(r,n)}},XP=function(t){var r=t.children,n=t.defaultShowTooltip,a=Vr(r,vc),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},GSe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Ka(r&&r.type);return n&&n.indexOf("Bar")>=0})},QP=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},YSe=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,u=n.width,d=n.height,f=n.children,h=n.margin||{},p=Vr(f,vc),v=Vr(f,Pl),m=Object.keys(c).reduce(function(j,_){var N=c[_],k=N.orientation;return!N.mirror&&!N.hide?H(H({},j),{},Se({},k,j[k]+N.width)):j},{left:h.left||0,right:h.right||0}),g=Object.keys(o).reduce(function(j,_){var N=o[_],k=N.orientation;return!N.mirror&&!N.hide?H(H({},j),{},Se({},k,tn(j,"".concat(k))+N.height)):j},{top:h.top||0,bottom:h.bottom||0}),y=H(H({},g),m),x=y.bottom;p&&(y.bottom+=p.props.height||vc.defaultProps.height),v&&r&&(y=kge(y,a,n,r));var w=u-y.left-y.right,S=d-y.top-y.bottom;return H(H({brushBottom:x},y),{},{width:Math.max(w,0),height:Math.max(S,0)})},XSe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},M3=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(y,x){var w=x.graphicalItems,S=x.stackGroups,j=x.offset,_=x.updateId,N=x.dataStartIndex,k=x.dataEndIndex,O=y.barSize,E=y.layout,A=y.barGap,R=y.barCategoryGap,T=y.maxBarSize,I=QP(E),F=I.numericAxisName,P=I.cateAxisName,D=GSe(w),M=[];return w.forEach(function($,z){var K=ty(y.data,{graphicalItems:[$],dataStartIndex:N,dataEndIndex:k}),q=$.type.defaultProps!==void 0?H(H({},$.type.defaultProps),$.props):$.props,B=q.dataKey,Z=q.maxBarSize,he=q["".concat(F,"Id")],pe=q["".concat(P,"Id")],Q={},me=c.reduce(function(Xt,xr){var st=x["".concat(xr.axisType,"Map")],vs=q["".concat(xr.axisType,"Id")];st&&st[vs]||xr.axisType==="zAxis"||vo();var Jf=st[vs];return H(H({},Xt),{},Se(Se({},xr.axisType,Jf),"".concat(xr.axisType,"Ticks"),Ha(Jf)))},Q),L=me[P],Y=me["".concat(P,"Ticks")],J=S&&S[he]&&S[he].hasStack&&Dge($,S[he].stackGroups),U=Ka($.type).indexOf("Bar")>=0,ge=Dm(L,Y),ve=[],Ne=D&&_ge({barSize:O,stackGroups:S,totalSize:XSe(me,P)});if(U){var Re,it,Xe=$e(Z)?T:Z,Qe=(Re=(it=Dm(L,Y,!0))!==null&&it!==void 0?it:Xe)!==null&&Re!==void 0?Re:0;ve=Nge({barGap:A,barCategoryGap:R,bandSize:Qe!==ge?Qe:ge,sizeList:Ne[pe],maxBarSize:Xe}),Qe!==ge&&(ve=ve.map(function(Xt){return H(H({},Xt),{},{position:H(H({},Xt.position),{},{offset:Xt.position.offset-Qe/2})})}))}var cn=$&&$.type&&$.type.getComposedData;cn&&M.push({props:H(H({},cn(H(H({},me),{},{displayedData:K,props:y,dataKey:B,item:$,bandSize:ge,barPosition:ve,offset:j,stackedData:J,layout:E,dataStartIndex:N,dataEndIndex:k}))),{},Se(Se(Se({key:$.key||"item-".concat(z)},F,me[F]),P,me[P]),"animationId",_)),childIndex:Nte($,y.children),item:$})}),M},p=function(y,x){var w=y.props,S=y.dataStartIndex,j=y.dataEndIndex,_=y.updateId;if(!pO({props:w}))return null;var N=w.children,k=w.layout,O=w.stackOffset,E=w.data,A=w.reverseStackOrder,R=QP(k),T=R.numericAxisName,I=R.cateAxisName,F=wn(N,n),P=Mge(E,F,"".concat(T,"Id"),"".concat(I,"Id"),O,A),D=c.reduce(function(q,B){var Z="".concat(B.axisType,"Map");return H(H({},q),{},Se({},Z,VSe(w,H(H({},B),{},{graphicalItems:F,stackGroups:B.axisType===T&&P,dataStartIndex:S,dataEndIndex:j}))))},{}),M=YSe(H(H({},D),{},{props:w,graphicalItems:F}),x==null?void 0:x.legendBBox);Object.keys(D).forEach(function(q){D[q]=d(w,D[q],M,q.replace("Map",""),r)});var $=D["".concat(I,"Map")],z=KSe($),K=h(w,H(H({},D),{},{dataStartIndex:S,dataEndIndex:j,updateId:_,graphicalItems:F,stackGroups:P,offset:M}));return H(H({formattedGraphicalItems:K,graphicalItems:F,offset:M,stackGroups:P},z),D)},v=function(g){function y(x){var w,S,j;return ESe(this,y),j=TSe(this,y,[x]),Se(j,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Se(j,"accessibilityManager",new mSe),Se(j,"handleLegendBBoxUpdate",function(_){if(_){var N=j.state,k=N.dataStartIndex,O=N.dataEndIndex,E=N.updateId;j.setState(H({legendBBox:_},p({props:j.props,dataStartIndex:k,dataEndIndex:O,updateId:E},H(H({},j.state),{},{legendBBox:_}))))}}),Se(j,"handleReceiveSyncEvent",function(_,N,k){if(j.props.syncId===_){if(k===j.eventEmitterSymbol&&typeof j.props.syncMethod!="function")return;j.applySyncEvent(N)}}),Se(j,"handleBrushChange",function(_){var N=_.startIndex,k=_.endIndex;if(N!==j.state.dataStartIndex||k!==j.state.dataEndIndex){var O=j.state.updateId;j.setState(function(){return H({dataStartIndex:N,dataEndIndex:k},p({props:j.props,dataStartIndex:N,dataEndIndex:k,updateId:O},j.state))}),j.triggerSyncEvent({dataStartIndex:N,dataEndIndex:k})}}),Se(j,"handleMouseEnter",function(_){var N=j.getMouseInfo(_);if(N){var k=H(H({},N),{},{isTooltipActive:!0});j.setState(k),j.triggerSyncEvent(k);var O=j.props.onMouseEnter;ke(O)&&O(k,_)}}),Se(j,"triggeredAfterMouseMove",function(_){var N=j.getMouseInfo(_),k=N?H(H({},N),{},{isTooltipActive:!0}):{isTooltipActive:!1};j.setState(k),j.triggerSyncEvent(k);var O=j.props.onMouseMove;ke(O)&&O(k,_)}),Se(j,"handleItemMouseEnter",function(_){j.setState(function(){return{isTooltipActive:!0,activeItem:_,activePayload:_.tooltipPayload,activeCoordinate:_.tooltipPosition||{x:_.cx,y:_.cy}}})}),Se(j,"handleItemMouseLeave",function(){j.setState(function(){return{isTooltipActive:!1}})}),Se(j,"handleMouseMove",function(_){_.persist(),j.throttleTriggeredAfterMouseMove(_)}),Se(j,"handleMouseLeave",function(_){j.throttleTriggeredAfterMouseMove.cancel();var N={isTooltipActive:!1};j.setState(N),j.triggerSyncEvent(N);var k=j.props.onMouseLeave;ke(k)&&k(N,_)}),Se(j,"handleOuterEvent",function(_){var N=_te(_),k=tn(j.props,"".concat(N));if(N&&ke(k)){var O,E;/.*touch.*/i.test(N)?E=j.getMouseInfo(_.changedTouches[0]):E=j.getMouseInfo(_),k((O=E)!==null&&O!==void 0?O:{},_)}}),Se(j,"handleClick",function(_){var N=j.getMouseInfo(_);if(N){var k=H(H({},N),{},{isTooltipActive:!0});j.setState(k),j.triggerSyncEvent(k);var O=j.props.onClick;ke(O)&&O(k,_)}}),Se(j,"handleMouseDown",function(_){var N=j.props.onMouseDown;if(ke(N)){var k=j.getMouseInfo(_);N(k,_)}}),Se(j,"handleMouseUp",function(_){var N=j.props.onMouseUp;if(ke(N)){var k=j.getMouseInfo(_);N(k,_)}}),Se(j,"handleTouchMove",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&j.throttleTriggeredAfterMouseMove(_.changedTouches[0])}),Se(j,"handleTouchStart",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&j.handleMouseDown(_.changedTouches[0])}),Se(j,"handleTouchEnd",function(_){_.changedTouches!=null&&_.changedTouches.length>0&&j.handleMouseUp(_.changedTouches[0])}),Se(j,"handleDoubleClick",function(_){var N=j.props.onDoubleClick;if(ke(N)){var k=j.getMouseInfo(_);N(k,_)}}),Se(j,"handleContextMenu",function(_){var N=j.props.onContextMenu;if(ke(N)){var k=j.getMouseInfo(_);N(k,_)}}),Se(j,"triggerSyncEvent",function(_){j.props.syncId!==void 0&&$x.emit(Rx,j.props.syncId,_,j.eventEmitterSymbol)}),Se(j,"applySyncEvent",function(_){var N=j.props,k=N.layout,O=N.syncMethod,E=j.state.updateId,A=_.dataStartIndex,R=_.dataEndIndex;if(_.dataStartIndex!==void 0||_.dataEndIndex!==void 0)j.setState(H({dataStartIndex:A,dataEndIndex:R},p({props:j.props,dataStartIndex:A,dataEndIndex:R,updateId:E},j.state)));else if(_.activeTooltipIndex!==void 0){var T=_.chartX,I=_.chartY,F=_.activeTooltipIndex,P=j.state,D=P.offset,M=P.tooltipTicks;if(!D)return;if(typeof O=="function")F=O(M,_);else if(O==="value"){F=-1;for(var $=0;$<M.length;$++)if(M[$].value===_.activeLabel){F=$;break}}var z=H(H({},D),{},{x:D.left,y:D.top}),K=Math.min(T,z.x+z.width),q=Math.min(I,z.y+z.height),B=M[F]&&M[F].value,Z=Vw(j.state,j.props.data,F),he=M[F]?{x:k==="horizontal"?M[F].coordinate:K,y:k==="horizontal"?q:M[F].coordinate}:$3;j.setState(H(H({},_),{},{activeLabel:B,activeCoordinate:he,activePayload:Z,activeTooltipIndex:F}))}else j.setState(_)}),Se(j,"renderCursor",function(_){var N,k=j.state,O=k.isTooltipActive,E=k.activeCoordinate,A=k.activePayload,R=k.offset,T=k.activeTooltipIndex,I=k.tooltipAxisBandSize,F=j.getTooltipEventType(),P=(N=_.props.active)!==null&&N!==void 0?N:O,D=j.props.layout,M=_.key||"_recharts-cursor";return C.createElement(jSe,{key:M,activeCoordinate:E,activePayload:A,activeTooltipIndex:T,chartName:r,element:_,isActive:P,layout:D,offset:R,tooltipAxisBandSize:I,tooltipEventType:F})}),Se(j,"renderPolarAxis",function(_,N,k){var O=tn(_,"type.axisType"),E=tn(j.state,"".concat(O,"Map")),A=_.type.defaultProps,R=A!==void 0?H(H({},A),_.props):_.props,T=E&&E[R["".concat(O,"Id")]];return b.cloneElement(_,H(H({},T),{},{className:Te(O,T.className),key:_.key||"".concat(N,"-").concat(k),ticks:Ha(T,!0)}))}),Se(j,"renderPolarGrid",function(_){var N=_.props,k=N.radialLines,O=N.polarAngles,E=N.polarRadius,A=j.state,R=A.radiusAxisMap,T=A.angleAxisMap,I=Ti(R),F=Ti(T),P=F.cx,D=F.cy,M=F.innerRadius,$=F.outerRadius;return b.cloneElement(_,{polarAngles:Array.isArray(O)?O:Ha(F,!0).map(function(z){return z.coordinate}),polarRadius:Array.isArray(E)?E:Ha(I,!0).map(function(z){return z.coordinate}),cx:P,cy:D,innerRadius:M,outerRadius:$,key:_.key||"polar-grid",radialLines:k})}),Se(j,"renderLegend",function(){var _=j.state.formattedGraphicalItems,N=j.props,k=N.children,O=N.width,E=N.height,A=j.props.margin||{},R=O-(A.left||0)-(A.right||0),T=hL({children:k,formattedGraphicalItems:_,legendWidth:R,legendContent:u});if(!T)return null;var I=T.item,F=KP(T,SSe);return b.cloneElement(I,H(H({},F),{},{chartWidth:O,chartHeight:E,margin:A,onBBoxUpdate:j.handleLegendBBoxUpdate}))}),Se(j,"renderTooltip",function(){var _,N=j.props,k=N.children,O=N.accessibilityLayer,E=Vr(k,zt);if(!E)return null;var A=j.state,R=A.isTooltipActive,T=A.activeCoordinate,I=A.activePayload,F=A.activeLabel,P=A.offset,D=(_=E.props.active)!==null&&_!==void 0?_:R;return b.cloneElement(E,{viewBox:H(H({},P),{},{x:P.left,y:P.top}),active:D,label:F,payload:D?I:[],coordinate:T,accessibilityLayer:O})}),Se(j,"renderBrush",function(_){var N=j.props,k=N.margin,O=N.data,E=j.state,A=E.offset,R=E.dataStartIndex,T=E.dataEndIndex,I=E.updateId;return b.cloneElement(_,{key:_.key||"_recharts-brush",onChange:qh(j.handleBrushChange,_.props.onChange),data:O,x:ae(_.props.x)?_.props.x:A.left,y:ae(_.props.y)?_.props.y:A.top+A.height+A.brushBottom-(k.bottom||0),width:ae(_.props.width)?_.props.width:A.width,startIndex:R,endIndex:T,updateId:"brush-".concat(I)})}),Se(j,"renderReferenceElement",function(_,N,k){if(!_)return null;var O=j,E=O.clipPathId,A=j.state,R=A.xAxisMap,T=A.yAxisMap,I=A.offset,F=_.type.defaultProps||{},P=_.props,D=P.xAxisId,M=D===void 0?F.xAxisId:D,$=P.yAxisId,z=$===void 0?F.yAxisId:$;return b.cloneElement(_,{key:_.key||"".concat(N,"-").concat(k),xAxis:R[M],yAxis:T[z],viewBox:{x:I.left,y:I.top,width:I.width,height:I.height},clipPathId:E})}),Se(j,"renderActivePoints",function(_){var N=_.item,k=_.activePoint,O=_.basePoint,E=_.childIndex,A=_.isRange,R=[],T=N.props.key,I=N.item.type.defaultProps!==void 0?H(H({},N.item.type.defaultProps),N.item.props):N.item.props,F=I.activeDot,P=I.dataKey,D=H(H({index:E,dataKey:P,cx:k.x,cy:k.y,r:4,fill:DS(N.item),strokeWidth:2,stroke:"#fff",payload:k.payload,value:k.value},_e(F,!1)),um(F));return R.push(y.renderActiveDot(F,D,"".concat(T,"-activePoint-").concat(E))),O?R.push(y.renderActiveDot(F,H(H({},D),{},{cx:O.x,cy:O.y}),"".concat(T,"-basePoint-").concat(E))):A&&R.push(null),R}),Se(j,"renderGraphicChild",function(_,N,k){var O=j.filterFormatItem(_,N,k);if(!O)return null;var E=j.getTooltipEventType(),A=j.state,R=A.isTooltipActive,T=A.tooltipAxis,I=A.activeTooltipIndex,F=A.activeLabel,P=j.props.children,D=Vr(P,zt),M=O.props,$=M.points,z=M.isRange,K=M.baseLine,q=O.item.type.defaultProps!==void 0?H(H({},O.item.type.defaultProps),O.item.props):O.item.props,B=q.activeDot,Z=q.hide,he=q.activeBar,pe=q.activeShape,Q=!!(!Z&&R&&D&&(B||he||pe)),me={};E!=="axis"&&D&&D.props.trigger==="click"?me={onClick:qh(j.handleItemMouseEnter,_.props.onClick)}:E!=="axis"&&(me={onMouseLeave:qh(j.handleItemMouseLeave,_.props.onMouseLeave),onMouseEnter:qh(j.handleItemMouseEnter,_.props.onMouseEnter)});var L=b.cloneElement(_,H(H({},O.props),me));function Y(xr){return typeof T.dataKey=="function"?T.dataKey(xr.payload):null}if(Q)if(I>=0){var J,U;if(T.dataKey&&!T.allowDuplicatedCategory){var ge=typeof T.dataKey=="function"?Y:"payload.".concat(T.dataKey.toString());J=bb($,ge,F),U=z&&K&&bb(K,ge,F)}else J=$==null?void 0:$[I],U=z&&K&&K[I];if(pe||he){var ve=_.props.activeIndex!==void 0?_.props.activeIndex:I;return[b.cloneElement(_,H(H(H({},O.props),me),{},{activeIndex:ve})),null,null]}if(!$e(J))return[L].concat(kc(j.renderActivePoints({item:O,activePoint:J,basePoint:U,childIndex:I,isRange:z})))}else{var Ne,Re=(Ne=j.getItemByXY(j.state.activeCoordinate))!==null&&Ne!==void 0?Ne:{graphicalItem:L},it=Re.graphicalItem,Xe=it.item,Qe=Xe===void 0?_:Xe,cn=it.childIndex,Xt=H(H(H({},O.props),me),{},{activeIndex:cn});return[b.cloneElement(Qe,Xt),null,null]}return z?[L,null,null]:[L,null]}),Se(j,"renderCustomized",function(_,N,k){return b.cloneElement(_,H(H({key:"recharts-customized-".concat(k)},j.props),j.state))}),Se(j,"renderMap",{CartesianGrid:{handler:Gh,once:!0},ReferenceArea:{handler:j.renderReferenceElement},ReferenceLine:{handler:Gh},ReferenceDot:{handler:j.renderReferenceElement},XAxis:{handler:Gh},YAxis:{handler:Gh},Brush:{handler:j.renderBrush,once:!0},Bar:{handler:j.renderGraphicChild},Line:{handler:j.renderGraphicChild},Area:{handler:j.renderGraphicChild},Radar:{handler:j.renderGraphicChild},RadialBar:{handler:j.renderGraphicChild},Scatter:{handler:j.renderGraphicChild},Pie:{handler:j.renderGraphicChild},Funnel:{handler:j.renderGraphicChild},Tooltip:{handler:j.renderCursor,once:!0},PolarGrid:{handler:j.renderPolarGrid,once:!0},PolarAngleAxis:{handler:j.renderPolarAxis},PolarRadiusAxis:{handler:j.renderPolarAxis},Customized:{handler:j.renderCustomized}}),j.clipPathId="".concat((w=x.id)!==null&&w!==void 0?w:Wf("recharts"),"-clip"),j.throttleTriggeredAfterMouseMove=f4(j.triggeredAfterMouseMove,(S=x.throttleDelay)!==null&&S!==void 0?S:1e3/60),j.state={},j}return MSe(y,g),ASe(y,[{key:"componentDidMount",value:function(){var w,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var w=this.props,S=w.children,j=w.data,_=w.height,N=w.layout,k=Vr(S,zt);if(k){var O=k.props.defaultIndex;if(!(typeof O!="number"||O<0||O>this.state.tooltipTicks.length-1)){var E=this.state.tooltipTicks[O]&&this.state.tooltipTicks[O].value,A=Vw(this.state,j,O,E),R=this.state.tooltipTicks[O].coordinate,T=(this.state.offset.top+_)/2,I=N==="horizontal",F=I?{x:R,y:T}:{y:R,x:T},P=this.state.formattedGraphicalItems.find(function(M){var $=M.item;return $.type.name==="Scatter"});P&&(F=H(H({},F),P.props.points[O].tooltipPosition),A=P.props.points[O].tooltipPayload);var D={activeTooltipIndex:O,isTooltipActive:!0,activeLabel:E,activePayload:A,activeCoordinate:F};this.setState(D),this.renderCursor(k),this.accessibilityManager.setIndex(O)}}}},{key:"getSnapshotBeforeUpdate",value:function(w,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==w.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==w.margin){var j,_;this.accessibilityManager.setDetails({offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(_=this.props.margin.top)!==null&&_!==void 0?_:0}})}return null}},{key:"componentDidUpdate",value:function(w){jb([Vr(w.children,zt)],[Vr(this.props.children,zt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var w=Vr(this.props.children,zt);if(w&&typeof w.props.shared=="boolean"){var S=w.props.shared?"axis":"item";return l.indexOf(S)>=0?S:i}return i}},{key:"getMouseInfo",value:function(w){if(!this.container)return null;var S=this.container,j=S.getBoundingClientRect(),_=Qde(j),N={chartX:Math.round(w.pageX-_.left),chartY:Math.round(w.pageY-_.top)},k=j.width/S.offsetWidth||1,O=this.inRange(N.chartX,N.chartY,k);if(!O)return null;var E=this.state,A=E.xAxisMap,R=E.yAxisMap,T=this.getTooltipEventType(),I=YP(this.state,this.props.data,this.props.layout,O);if(T!=="axis"&&A&&R){var F=Ti(A).scale,P=Ti(R).scale,D=F&&F.invert?F.invert(N.chartX):null,M=P&&P.invert?P.invert(N.chartY):null;return H(H({},N),{},{xValue:D,yValue:M},I)}return I?H(H({},N),I):null}},{key:"inRange",value:function(w,S){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,_=this.props.layout,N=w/j,k=S/j;if(_==="horizontal"||_==="vertical"){var O=this.state.offset,E=N>=O.left&&N<=O.left+O.width&&k>=O.top&&k<=O.top+O.height;return E?{x:N,y:k}:null}var A=this.state,R=A.angleAxisMap,T=A.radiusAxisMap;if(R&&T){var I=Ti(R);return SE({x:N,y:k},I)}return null}},{key:"parseEventsOfWrapper",value:function(){var w=this.props.children,S=this.getTooltipEventType(),j=Vr(w,zt),_={};j&&S==="axis"&&(j.props.trigger==="click"?_={onClick:this.handleClick}:_={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var N=um(this.props,this.handleOuterEvent);return H(H({},N),_)}},{key:"addListener",value:function(){$x.on(Rx,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){$x.removeListener(Rx,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(w,S,j){for(var _=this.state.formattedGraphicalItems,N=0,k=_.length;N<k;N++){var O=_[N];if(O.item===w||O.props.key===w.key||S===Ka(O.item.type)&&j===O.childIndex)return O}return null}},{key:"renderClipPath",value:function(){var w=this.clipPathId,S=this.state.offset,j=S.left,_=S.top,N=S.height,k=S.width;return C.createElement("defs",null,C.createElement("clipPath",{id:w},C.createElement("rect",{x:j,y:_,height:N,width:k})))}},{key:"getXScales",value:function(){var w=this.state.xAxisMap;return w?Object.entries(w).reduce(function(S,j){var _=VP(j,2),N=_[0],k=_[1];return H(H({},S),{},Se({},N,k.scale))},{}):null}},{key:"getYScales",value:function(){var w=this.state.yAxisMap;return w?Object.entries(w).reduce(function(S,j){var _=VP(j,2),N=_[0],k=_[1];return H(H({},S),{},Se({},N,k.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(w){var S;return(S=this.state.xAxisMap)===null||S===void 0||(S=S[w])===null||S===void 0?void 0:S.scale}},{key:"getYScaleByAxisId",value:function(w){var S;return(S=this.state.yAxisMap)===null||S===void 0||(S=S[w])===null||S===void 0?void 0:S.scale}},{key:"getItemByXY",value:function(w){var S=this.state,j=S.formattedGraphicalItems,_=S.activeItem;if(j&&j.length)for(var N=0,k=j.length;N<k;N++){var O=j[N],E=O.props,A=O.item,R=A.type.defaultProps!==void 0?H(H({},A.type.defaultProps),A.props):A.props,T=Ka(A.type);if(T==="Bar"){var I=(E.data||[]).find(function(M){return $xe(w,M)});if(I)return{graphicalItem:O,payload:I}}else if(T==="RadialBar"){var F=(E.data||[]).find(function(M){return SE(w,M)});if(F)return{graphicalItem:O,payload:F}}else if(Gv(O,_)||Yv(O,_)||mf(O,_)){var P=wbe({graphicalItem:O,activeTooltipItem:_,itemData:R.data}),D=R.activeIndex===void 0?P:R.activeIndex;return{graphicalItem:H(H({},O),{},{childIndex:D}),payload:mf(O,_)?R.data[P]:O.props.data[P]}}}return null}},{key:"render",value:function(){var w=this;if(!pO(this))return null;var S=this.props,j=S.children,_=S.className,N=S.width,k=S.height,O=S.style,E=S.compact,A=S.title,R=S.desc,T=KP(S,_Se),I=_e(T,!1);if(E)return C.createElement(AP,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},C.createElement(_b,yl({},I,{width:N,height:k,title:A,desc:R}),this.renderClipPath(),gO(j,this.renderMap)));if(this.props.accessibilityLayer){var F,P;I.tabIndex=(F=this.props.tabIndex)!==null&&F!==void 0?F:0,I.role=(P=this.props.role)!==null&&P!==void 0?P:"application",I.onKeyDown=function(M){w.accessibilityManager.keyboardEvent(M)},I.onFocus=function(){w.accessibilityManager.focus()}}var D=this.parseEventsOfWrapper();return C.createElement(AP,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},C.createElement("div",yl({className:Te("recharts-wrapper",_),style:H({position:"relative",cursor:"default",width:N,height:k},O)},D,{ref:function($){w.container=$}}),C.createElement(_b,yl({},I,{width:N,height:k,title:A,desc:R,style:USe}),this.renderClipPath(),gO(j,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(b.Component);Se(v,"displayName",r),Se(v,"defaultProps",H({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),Se(v,"getDerivedStateFromProps",function(g,y){var x=g.dataKey,w=g.data,S=g.children,j=g.width,_=g.height,N=g.layout,k=g.stackOffset,O=g.margin,E=y.dataStartIndex,A=y.dataEndIndex;if(y.updateId===void 0){var R=XP(g);return H(H(H({},R),{},{updateId:0},p(H(H({props:g},R),{},{updateId:0}),y)),{},{prevDataKey:x,prevData:w,prevWidth:j,prevHeight:_,prevLayout:N,prevStackOffset:k,prevMargin:O,prevChildren:S})}if(x!==y.prevDataKey||w!==y.prevData||j!==y.prevWidth||_!==y.prevHeight||N!==y.prevLayout||k!==y.prevStackOffset||!El(O,y.prevMargin)){var T=XP(g),I={chartX:y.chartX,chartY:y.chartY,isTooltipActive:y.isTooltipActive},F=H(H({},YP(y,w,N)),{},{updateId:y.updateId+1}),P=H(H(H({},T),I),F);return H(H(H({},P),p(H({props:g},P),y)),{},{prevDataKey:x,prevData:w,prevWidth:j,prevHeight:_,prevLayout:N,prevStackOffset:k,prevMargin:O,prevChildren:S})}if(!jb(S,y.prevChildren)){var D,M,$,z,K=Vr(S,vc),q=K&&(D=(M=K.props)===null||M===void 0?void 0:M.startIndex)!==null&&D!==void 0?D:E,B=K&&($=(z=K.props)===null||z===void 0?void 0:z.endIndex)!==null&&$!==void 0?$:A,Z=q!==E||B!==A,he=!$e(w),pe=he&&!Z?y.updateId:y.updateId+1;return H(H({updateId:pe},p(H(H({props:g},y),{},{updateId:pe,dataStartIndex:q,dataEndIndex:B}),y)),{},{prevChildren:S,dataStartIndex:q,dataEndIndex:B})}return null}),Se(v,"renderActiveDot",function(g,y,x){var w;return b.isValidElement(g)?w=b.cloneElement(g,y):ke(g)?w=g(y):w=C.createElement(FS,y),C.createElement(He,{className:"recharts-active-dot",ke
671y:x},w)});var m=b.forwardRef(function(y,x){return C.createElement(v,yl({},y,{ref:x}))});return m.displayName=v.displayName,m},nd=M3({chartName:"BarChart",GraphicalChild:Qn,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Zi},{axisType:"yAxis",AxisComp:es}],formatAxisMap:Zwe}),yp=M3({chartName:"PieChart",GraphicalChild:jn,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Kv},{axisType:"radiusAxis",AxisComp:Hv}],formatAxisMap:Kge,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const JP=["hsl(28,85%,45%)","hsl(145,40%,32%)","hsl(42,90%,55%)","hsl(5,70%,50%)","hsl(25,30%,30%)","hsl(200,60%,50%)"],QSe=()=>{const[e,t]=b.useState([]),[r,n]=b.useState([]),[a,i]=b.useState(!0);b.useEffect(()=>{Promise.all([V.from("orders").select("total, status, items, created_at").order("created_at"),V.from("inventory").select("product_name, stock_level, expiry_date").order("product_name")]).then(([p,v])=>{t(p.data||[]),n(v.data||[]),i(!1)})},[]);const o=(()=>{const p={};e.forEach(m=>{const g=new Date(m.created_at).toLocaleString("en-GB",{month:"short",year:"2-digit"});p[g]=(p[g]||0)+Number(m.total)});const v=Object.entries(p).map(([m,g])=>({month:m,revenue:+g.toFixed(2)}));return v.length===0?[{month:"Jan 26",revenue:1240},{month:"Feb 26",revenue:1890},{month:"Mar 26",revenue:2150},{month:"Apr 26",revenue:1780},{month:"May 26",revenue:2430},{month:"Jun 26",revenue:2100}]:v})(),l=(()=>{const p={};e.forEach(m=>{p[m.status]=(p[m.status]||0)+1});const v=Object.entries(p).map(([m,g])=>({name:m,value:g}));return v.length===0?[{name:"Delivered",value:45},{name:"Processing",value:12},{name:"Shipped",value:8},{name:"Pending",value:5},{name:"Cancelled",value:2}]:v})(),c=(()=>{const p={};e.forEach(m=>{(Array.isArray(m.items)?m.items:[]).forEach(y=>{const x=y.name||y.product_name||"Unknown";p[x]=(p[x]||0)+(y.quantity||1)})});const v=Object.entries(p).sort(([,m],[,g])=>g-m).slice(0,6).map(([m,g])=>({name:m,sold:g}));return v.length===0?[{name:"Plantain",sold:156},{name:"Yam Tuber",sold:98},{name:"Palm Oil",sold:87},{name:"Scotch Bonnet",sold:74},{name:"Cassava Flour",sold:65},{name:"Jollof Seasoning",sold:52}]:v})(),u=r.filter(p=>{if(!p.expiry_date)return!1;const v=(new Date(p.expiry_date).getTime()-Date.now())/(1e3*60*60*24);return v>0&&v<=30}),d=r.length>0?r.slice(0,8).map(p=>({name:p.product_name.split(" ")[0],stock:p.stock_level})):[{name:"Plantain",stock:85},{name:"Yam",stock:42},{name:"Palm Oil",stock:8},{name:"Peppers",stock:63},{name:"Cassava",stock:31},{name:"Jollof",stock:15},{name:"Ginger Beer",stock:55},{name:"Cocoa Butter",stock:22}],f=e.length>0?e.reduce((p,v)=>p+Number(v.total),0):o.reduce((p,v)=>p+v.revenue,0),h=e.length===0;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Reports"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Analytics and performance insights"})]}),h&&s.jsx(Be,{variant:"secondary",className:"text-xs",children:"Demo data — real data appears with orders"})]}),s.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:[{label:"Total Revenue",value:`£${f.toLocaleString("en-GB",{minimumFractionDigits:2})}`},{label:"Total Orders",value:e.length||72},{label:"Avg Order Value",value:`£${(e.length?f/e.length:f/72).toFixed(2)}`},{label:"Products Tracked",value:r.length||12}].map(p=>s.jsx(le,{children:s.jsxs(ce,{className:"pt-5 pb-4",children:[s.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:p.label}),s.jsx("p",{className:"text-2xl font-bold mt-1",children:p.value})]})},p.label))}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6",children:[s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"flex items-center gap-2 text-base",children:[s.jsx(kd,{className:"h-4 w-4 text-primary"})," Monthly Revenue"]})}),s.jsx(ce,{children:s.jsx(Ba,{width:"100%",height:260,children:s.jsxs(nd,{data:o,children:[s.jsx($l,{strokeDasharray:"3 3",stroke:"hsl(30,20%,90%)"}),s.jsx(Zi,{dataKey:"month",fontSize:12,tickLine:!1}),s.jsx(es,{fontSize:12,tickLine:!1,tickFormatter:p=>`£${p}`}),s.jsx(zt,{formatter:p=>[`£${p.toFixed(2)}`,"Revenue"]}),s.jsx(Qn,{dataKey:"revenue",fill:"hsl(28,85%,45%)",radius:[4,4,0,0]})]})})})]}),s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Yp,{className:"h-4 w-4 text-primary"})," Order Status Breakdown"]})}),s.jsx(ce,{children:s.jsx(Ba,{width:"100%",height:260,children:s.jsxs(yp,{children:[s.jsx(jn,{data:l,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:3,dataKey:"value",label:({name:p,percent:v})=>`${p} ${(v*100).toFixed(0)}%`,fontSize:11,children:l.map((p,v)=>s.jsx(pa,{fill:JP[v%JP.length]},v))}),s.jsx(zt,{})]})})})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6",children:[s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Gn,{className:"h-4 w-4 text-secondary"})," Best Sellers"]})}),s.jsx(ce,{children:s.jsx(Ba,{width:"100%",height:260,children:s.jsxs(nd,{data:c,layout:"vertical",children:[s.jsx($l,{strokeDasharray:"3 3",stroke:"hsl(30,20%,90%)"}),s.jsx(Zi,{type:"number",fontSize:12,tickLine:!1}),s.jsx(es,{dataKey:"name",type:"category",fontSize:12,tickLine:!1,width:90}),s.jsx(zt,{}),s.jsx(Qn,{dataKey:"sold",fill:"hsl(145,40%,32%)",radius:[0,4,4,0]})]})})})]}),s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Yp,{className:"h-4 w-4 text-primary"})," Stock Levels"]})}),s.jsx(ce,{children:s.jsx(Ba,{width:"100%",height:260,children:s.jsxs(nd,{data:d,children:[s.jsx($l,{strokeDasharray:"3 3",stroke:"hsl(30,20%,90%)"}),s.jsx(Zi,{dataKey:"name",fontSize:11,tickLine:!1}),s.jsx(es,{fontSize:12,tickLine:!1}),s.jsx(zt,{}),s.jsx(Qn,{dataKey:"stock",fill:"hsl(42,90%,55%)",radius:[4,4,0,0],children:d.map((p,v)=>
671s.jsx(pa,{fill:p.stock<=15?"hsl(0,84%,60%)":"hsl(42,90%,55%)"},v))})]})})})]})]}),s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"flex items-center gap-2 text-base",children:[s.jsx(so,{className:"h-4 w-4 text-destructive"})," Near-Expiry Items (Next 30 Days)"]})}),s.jsx(ce,{children:u.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:r.length===0?"No inventory data yet — connect Epos Now to track expiry dates":"No items expiring within 30 days"}):s.jsx("div",{className:"space-y-2",children:u.map((p,v)=>{const m=Math.ceil((new Date(p.expiry_date).getTime()-Date.now())/864e5);return s.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-lg bg-destructive/5 border border-destructive/20",children:[s.jsx("span",{className:"font-medium text-sm",children:p.product_name}),s.jsxs("span",{className:"text-xs font-medium text-destructive",children:[m," days left — ",new Date(p.expiry_date).toLocaleDateString()]})]},v)})})})]})]})},Yh=["hsl(28,85%,45%)","hsl(145,40%,32%)","hsl(42,90%,55%)","hsl(5,70%,50%)","hsl(25,30%,30%)","hsl(200,60%,50%)"],JSe=()=>{const[e,t]=b.useState([]),[r,n]=b.useState([]),[a,i]=b.useState([]),[o,l]=b.useState(!0);if(b.useEffect(()=>{Promise.all([V.from("purchase_orders").select("id, po_number, total_value, status, created_at, supplier_id, suppliers(name)").order("created_at"),V.from("rfqs").select("id, rfq_number, status, created_at, updated_at").order("created_at"),V.from("supplier_quotes").select("id, rfq_id, supplier_id, total_amount, status, created_at, suppliers(name)").order("created_at")]).then(([S,j,_])=>{t(S.data||[]),n(j.data||[]),i(_.data||[]),l(!1)})},[]),o)return s.jsx("div",{className:"flex items-center justify-center py-24",children:s.jsx(Ze,{className:"h-6 w-6 animate-spin text-muted-foreground"})});const c=e.length>0||r.length>0,u=e.filter(S=>["approved","sent","received"].includes(S.status)).reduce((S,j)=>S+Number(j.total_value),0),d=e.length,f=r.length,h=(()=>{const S=[];return r.forEach(_=>{a.filter(k=>k.rfq_id===_.id).forEach(k=>{const O=Hk(new Date(k.created_at),new Date(_.created_at));O>=0&&S.push(O)})}),S.length===0?null:S.reduce((_,N)=>_+N,0)/S.length})(),p=(()=>{const S={};return e.filter(j=>["approved","sent","received"].includes(j.status)).forEach(j=>{const _=pr(new Date(j.created_at),"MMM yy");S[_]=(S[_]||0)+Number(j.total_value)}),Object.entries(S).map(([j,_])=>({month:j,spend:+_.toFixed(2)}))})(),v=(()=>{const S={};return e.filter(j=>["approved","sent","received"].includes(j.status)).forEach(j=>{var N;const _=((N=j.suppliers)==null?void 0:N.name)||"Unknown";
671S[j.supplier_id]||(S[j.supplier_id]={name:_,spend:0}),S[j.supplier_id].spend+=Number(j.total_value)}),Object.values(S).sort((j,_)=>_.spend-j.spend).slice(0,8)})(),m=(()=>{const S={};return r.forEach(j=>{S[j.status]=(S[j.status]||0)+1}),Object.entries(S).map(([j,_])=>({name:j,value:_}))})(),g=(()=>{const S={};return e.forEach(j=>{S[j.status]=(S[j.status]||0)+1}),Object.entries(S).map(([j,_])=>({name:j,value:_}))})(),y=(()=>{const S={};return a.forEach(j=>{var O;const _=r.find(E=>E.id===j.rfq_id);if(!_)return;const N=((O=j.suppliers)==null?void 0:O.name)||"Unknown",k=Hk(new Date(j.created_at),new Date(_.created_at));k<0||(S[j.supplier_id]||(S[j.supplier_id]={name:N,hours:[],count:0}),S[j.supplier_id].hours.push(k),S[j.supplier_id].count++)}),Object.values(S).map(j=>({name:j.name,avgHours:Math.round(j.hours.reduce((_,N)=>_+N,0)/j.hours.length),quotes:j.count})).sort((j,_)=>j.avgHours-_.avgHours).slice(0,8)})(),x=(()=>{a.length;const S=a.filter(N=>N.status==="accepted").length,j=a.filter(N=>N.status==="rejected").length,_=a.filter(N=>N.status==="received").length;return[{name:"Accepted",value:S},{name:"Rejected",value:j},{name:"Pending",value:_}].filter(N=>N.value>0)})(),w=S=>{if(S<24)return`${S}h`;const j=Math.floor(S/24),_=S%24;return _>0?`${j}d ${_}h`:`${j}d`};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Procurement Reports"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Spend analytics, supplier performance, and RFQ insights"})]}),!c&&s.jsx(Be,{variant:"secondary",className:"text-xs",children:"No data yet — stats populate as you create RFQs and POs"})]}),s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsx(le,{children:s.jsxs(ce,{className:"pt-5 pb-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(VN,{className:"h-4 w-4 text-primary"}),s.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Total Spend"})]}),s.jsxs("p",{className:"text-2xl font-bold",children:["£",u.toLocaleString("en-GB",{minimumFractionDigits:2})]})]})}),s.jsx(le,{children:s.jsxs(ce,{className:"pt-5 pb-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(Qs,{className:"h-4 w-4 text-primary"}),s.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Purchase Orders"})]}),s.jsx("p",{className:"text-2xl font-bold",children:d})]})}),s.jsx(le,{children:s.jsxs(ce,{className:"pt-5 pb-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(as,{className:"h-4 w-4 text-primary"}),s.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"RFQs Issued"})]}),s.jsx("p",{className:"text-2xl font-bold",children:f})]})}),s.jsx(le,{children:s.jsxs(ce,{className:"pt-5 pb-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(t7,{className:"h-4 w-4 text-primary"}),s.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Avg Response Time"})]}),s.jsx("p",{className:"text-2xl font-bold",children:h!==null?w(Math.round(h)):"—"})]})})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"flex items-center gap-2 text-base",children:[s.jsx(kd,{className:"h-4 w-4 text-primary"})," Monthly Procurement Spend"]})}),s.jsx(ce,{children:p.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-12",children:"No spend data yet"}):s.jsx(Ba,{width:"100%",height:260,children:s.jsxs(nd,{data:p,children:[s.jsx($l,{strokeDasharray:"3 3",stroke:"hsl(30,20%,90%)"}),s.jsx(Zi,{dataKey:"month",fontSize:12,tickLine:!1}),s.jsx(es,{fontSize:12,tickLine:!1,tickFormatter:S=>`£${S}`}),s.jsx(zt,{formatter:S=>[`£${S.toFixed(2)}`,"Spend"]}),s.jsx(Qn,{dataKey:"spend",fill:"hsl(28,85%,45%)",radius:[4,4,0,0]})]})})})]}),s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"flex items-center gap-2 text-base",children:[s.jsx(VN,{className:"h-4 w-4 text-primary"})," Spend by Supplier"]})}),s.jsx(ce,{children:v.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-12",children:"No supplier spend data yet"}):s.jsx(Ba,{width:"100%",height:260,children:s.jsxs(nd,{data:v,layout:"vertical",children:[s.jsx($l,{strokeDasharray:"3 3",stroke:"hsl(30,20%,90%)"}),s.jsx(Zi,{type:"number",fontSize:12,tickLine:!1,tickFormatter:S=>`£${S}`}),s.jsx(es,{dataKey:"name",type:"category",fontSize:11,tickLine:!1,width:100}),s.jsx(zt,{formatter:S=>[`£${S.toFixed(2)}`,"Spend"]}),s.jsx(Qn,{dataKey:"spend",fill:"hsl(145,40%,32%)",radius:[0,4,4,0]})]})})})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Qs,{className:"h-4 w-4 text-primary"}
671)," RFQ Status Breakdown"]})}),s.jsx(ce,{children:m.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-12",children:"No RFQs yet"}):s.jsx(Ba,{width:"100%",height:260,children:s.jsxs(yp,{children:[s.jsx(jn,{data:m,cx:"50%",cy:"50%",innerRadius:55,outerRadius:95,paddingAngle:3,dataKey:"value",label:({name:S,percent:j})=>`${S} ${(j*100).toFixed(0)}%`,fontSize:11,children:m.map((S,j)=>s.jsx(pa,{fill:Yh[j%Yh.length]},j))}),s.jsx(zt,{})]})})})]}),s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"flex items-center gap-2 text-base",children:[s.jsx(Qs,{className:"h-4 w-4 text-primary"})," PO Status Breakdown"]})}),s.jsx(ce,{children:g.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-12",children:"No purchase orders yet"}):s.jsx(Ba,{width:"100%",height:260,children:s.jsxs(yp,{children:[s.jsx(jn,{data:g,cx:"50%",cy:"50%",innerRadius:55,outerRadius:95,paddingAngle:3,dataKey:"value",label:({name:S,percent:j})=>`${S} ${(j*100).toFixed(0)}%`,fontSize:11,children:g.map((S,j)=>s.jsx(pa,{fill:Yh[j%Yh.length]},j))}),s.jsx(zt,{})]})})})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"flex items-center gap-2 text-base",children:[s.jsx(ei,{className:"h-4 w-4 text-primary"})," Supplier Response Times"]})}),s.jsx(ce,{children:y.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-12",children:"No response data yet — send RFQs and receive quotes to track"}):s.jsx("div",{className:"space-y-3",children:y.map((S,j)=>s.jsxs("div",{className:"flex items-center justify-between py-2.5 px-3 rounded-lg bg-muted/40",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:S.name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[S.quotes," quote(s) received"]})]}),s.jsxs(Be,{variant:"outline",className:`font-mono text-xs ${S.avgHours<=24?"border-emerald-300 text-emerald-700 bg-emerald-50":S.avgHours<=72?"border-amber-300 text-amber-700 bg-amber-50":"border-red-300 text-red-700 bg-red-50"}`,children:[w(S.avgHours)," avg"]})]},j))})})]}),s.jsxs(le,{children:[s.jsx(dt,{children:s.jsxs(mt,{className:"flex items-center gap-2 text-base",children:[s.jsx(as,{className:"h-4 w-4 text-primary"})," Quote Outcomes"]})}),s.jsx(ce,{children:x.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-12",children:"No quotes processed yet"}):s.jsx(Ba,{width:"100%",height:260,children:s.jsxs(yp,{children:[s.jsxs(jn,{data:x,cx:"50%",cy:"50%",innerRadius:55,outerRadius:95,paddingAngle:3,dataKey:"value",label:({name:S,percent:j})=>`${S} ${(j*100).toFixed(0)}%`,fontSize:11,children:[s.jsx(pa,{fill:"hsl(145,40%,32%)"}),s.jsx(pa,{fill:"hsl(5,70%,50%)"}),s.jsx(pa,{fill:"hsl(42,90%,55%)"})]}),s.jsx(zt,{})]})})})]})]})]})},ZSe={pending:{label:"Pending",color:"bg-amber-100 text-amber-700",icon:ei},sent:{label:"Sent",color:"bg-emerald-100 text-emerald-700",icon:Nd},failed:{label:"Failed",color:"bg-red-100 text-red-700",icon:Vu},dlq:{label:"Failed (DLQ)",color:"bg-red-100 text-red-700",icon:Vu},suppressed:{label:"Suppressed",color:"bg-orange-100 text-orange-700",icon:so},bounced:{label:"Bounced",color:"bg-red-100 text-red-700",icon:Vu},complained:{label:"Complained",color:"bg-red-100 text-red-700",icon:so}},e_e=[{label:"Last 24h",hours:24},{label:"Last 7 days",hours:168},{label:"Last 30 days",hours:720},{label:"All time",hours:0}],t_e=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(168),[o,l]=b.useState("all"),[c,u]=b.useState("all"),[d,f]=b.useState([]),h=async()=>{n(!0);let m=V.from("email_send_log").select("id, template_name, recipient_email, status, error_message, message_id, created_at").order("created_at",{ascending:!1}).limit(100);if(a>0){const S=new Date(Date.now()-a*60*60*1e3).toISOString();m=m.gte("created_at",S)}o!=="all"&&(m=m.eq("status",o)),c!=="all"&&(m=m.eq("template_name",c));const{data:g}=await m,y=g||[],x=new Map;y.forEach(S=>{const j=S.message_id||S.id,_=x.get(j);(!_||new Date(S.created_at)>new Date(_.created_at))&&x.set(j,S)});const w=Array.from(x.values()).sort((S,j)=>new Date(j.created_at).getTime()-new Date(S.created_at).getTime());t(w),n(!1)},p=async()=>{const{data:m}=await V.from("email_send_log").select("template_name").limit(1e3);if(m){const g=[...new Set(m.map(y=>y.template_name))].sort();f(g)}};b.useEffect(()=>{p()},[]),b.useEffect(()=>{h()},[a,o,c]);const v={total:e.length,sent:e.filter(m=>m.status==="sent").length,failed:e.filter(m=>["failed","dlq","bounced","complained"].includes(m.status)).length,suppressed:e.filter(m=>m.status==="suppressed").length,pending:e.filter(m=>m.status==="pending").length};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Email Log"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Track order notifications and system emails"})]}),s.jsxs(W,{variant:"outline",size:"sm",onClick:h,disabled:r,children:[s.jsx(If,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`})," Refresh"]})]}
671),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-3",children:[{label:"Total",value:v.total,color:"text-foreground"},{label:"Sent",value:v.sent,color:"text-emerald-600"},{label:"Failed",value:v.failed,color:"text-destructive"},{label:"Suppressed",value:v.suppressed,color:"text-orange-600"},{label:"Pending",value:v.pending,color:"text-amber-600"}].map(m=>s.jsx(le,{className:"border-0 bg-muted/40",children:s.jsxs(ce,{className:"p-4",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wider text-muted-foreground font-medium",children:m.label}),s.jsx("p",{className:`text-2xl font-bold mt-1 ${m.color}`,children:m.value})]})},m.label))}),s.jsxs("div",{className:"flex flex-wrap gap-3",children:[s.jsx("div",{className:"flex gap-1.5",children:e_e.map(m=>s.jsx(W,{variant:a===m.hours?"default":"outline",size:"sm",className:"h-8 text-xs",onClick:()=>i(m.hours),children:m.label},m.hours))}),s.jsxs(Tt,{value:o,onValueChange:l,children:[s.jsx(kt,{className:"w-36 h-8 text-xs",children:s.jsx($t,{placeholder:"Status"})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"all",children:"All statuses"}),s.jsx(xe,{value:"sent",children:"Sent"}),s.jsx(xe,{value:"failed",children:"Failed"}),s.jsx(xe,{value:"dlq",children:"DLQ"}),s.jsx(xe,{value:"suppressed",children:"Suppressed"}),s.jsx(xe,{value:"pending",children:"Pending"})]})]}),d.length>0&&s.jsxs(Tt,{value:c,onValueChange:u,children:[s.jsx(kt,{className:"w-48 h-8 text-xs",children:s.jsx($t,{placeholder:"Template"})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"all",children:"All templates"}),d.map(m=>s.jsx(xe,{value:m,children:m},m))]})]})]}),s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:r?s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):e.length===0?s.jsxs("div",{className:"text-center py-16",children:[s.jsx(ti,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No emails found"}),s.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Emails will appear here when order status changes trigger notifications"})]}):s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{className:"text-xs",children:"Template"}),s.jsx(te,{className:"text-xs",children:"Recipient"}),s.jsx(te,{className:"text-xs",children:"Status"}),s.jsx(te,{className:"text-xs",children:"Time"}),s.jsx(te,{className:"text-xs",children:"Error"})]})}),s.jsx(Kt,{children:e.map(m=>{const g=ZSe[m.status]||{label:m.status,color:"bg-muted text-muted-foreground",icon:ti},y=g.icon;return s.jsxs(De,{children:[s.jsx(ee,{children:s.jsx(Be,{variant:"outline",className:"font-mono text-[11px]",children:m.template_name})}),s.jsx(ee,{className:"text-sm",children:m.recipient_email}),s.jsx(ee,{children:s.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-medium ${g.color}`,children:[s.jsx(y,{className:"h-3 w-3"}),g.label]})}),s.jsx(ee,{className:"text-xs text-muted-foreground whitespace-nowrap",children:pr(new Date(m.created_at),"d MMM, HH:mm")}),s.jsx(ee,{className:"text-xs text-destructive max-w-[200px] truncate",children:m.error_message||"—"})]},m.id)})})]})})})]})};var ry="Checkbox",[r_e,JNe]=Br(ry),[n_e,YS]=r_e(ry);function a_e(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:a,disabled:i,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,p]=nn({prop:r,defaultProp:a??!1,onChange:c,caller:ry}),[v,m]=b.useState(null),[g,y]=b.useState(null),x=b.useRef(!1),w=v?!!o||!!v.closest("form"):!0,S={checked:h,disabled:i,setChecked:p,control:v,setControl:m,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:x,required:u,defaultChecked:ts(a)?!1:a,isFormControl:w,bubbleInput:g,setBubbleInput:y};return s.jsx(n_e,{scope:t,...S,children:i_e(f)?f(S):n})}var I3="CheckboxTrigger",D3=b.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},a)=>{const{control:i,value:o,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:p,bubbleInput:v}=YS(I3,e),m=Me(a,d),g=b.useRef(c);return b.useEffect(()=>{const y=i==null?void 0:i.form;if(y){const x=()=>f(g.current);return y.addEventListener("reset",x),()=>y.removeEventListener("reset",x)}},[i,f]),s.jsx(ye.button,{type:"button",role:"checkbox","aria-checked":ts(c)?"mixed":c,"aria-required":u,"data-state":z3(c),"data-disabled":l?"":void 0,disabled:l,value:o,...n,ref:m,onKeyDown:oe(t,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:oe(r,y=>{f(x=>ts(x)?!0:!x),v&&p&&(h.current=y.isPropagationStopped(),h.current||y.stopPropagation())})})});D3.displayName=I3;var XS=b.forwardRef((e,t)=>
vendor: 4,519 bytes, line 671
671{const{__scopeCheckbox:r,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return s.jsx(a_e,{__scopeCheckbox:r,checked:a,defaultChecked:i,disabled:l,required:o,onCheckedChange:u,name:n,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>s.jsxs(s.Fragment,{children:[s.jsx(D3,{...f,ref:t,__scopeCheckbox:r}),h&&s.jsx(U3,{__scopeCheckbox:r})]})})});XS.displayName=ry;var L3="CheckboxIndicator",F3=b.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...a}=e,i=YS(L3,r);return s.jsx(ln,{present:n||ts(i.checked)||i.checked===!0,children:s.jsx(ye.span,{"data-state":z3(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});F3.displayName=L3;var B3="CheckboxBubbleInput",U3=b.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:p}=YS(B3,e),v=Me(r,p),m=Tj(i),g=gj(n);b.useEffect(()=>{const x=h;if(!x)return;const w=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(w,"checked").set,_=!a.current;if(m!==i&&j){const N=new Event("click",{bubbles:_});x.indeterminate=ts(i),j.call(x,ts(i)?!1:i),x.dispatchEvent(N)}},[h,m,i,a]);const y=b.useRef(ts(i)?!1:i);return s.jsx(ye.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??y.current,required:l,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:v,style:{...t.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});U3.displayName=B3;function i_e(e){return typeof e=="function"}function ts(e){return e==="indeterminate"}function z3(e){return ts(e)?"indeterminate":e?"checked":"unchecked"}const jf=b.forwardRef(({className:e,...t},r)=>s.jsx(XS,{ref:r,className:ne("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(F3,{className:ne("flex items-center justify-center text-current"),children:s.jsx(Ql,{className:"h-4 w-4"})})}));jf.displayName=XS.displayName;const Xh=[{tnt_id:"TNT-SUP-001",name:"West African Foods Ltd",contact_person:"Kwame Asante",phone:"+233 20 123 4567",email:"[email protected]",category:"Grains & Cereals",location:"Accra, Ghana",rating:4.5,status:"active"},{tnt_id:"TNT-SUP-002",name:"Caribbean Spice Traders",contact_person:"Marcia Brown",phone:"+1 876 555 0123",email:"[email protected]",category:"Spices & Seasonings",location:"Kingston, Jamaica",rating:4.2,status:"active"},{tnt_id:"TNT-SUP-003",name:"Tropical Produce Direct",contact_person:"Emmanuel Obi",phone:"+234 803 456 7890",email:"[email protected]",category:"Fresh Produce",location:"Lagos, Nigeria",rating:4.8,status:"active"},{tnt_id:"TNT-SUP-004",name:"Island Beverages Co",contact_person:"Andre Williams",phone:"+1 868 555 0456",email:"[email protected]",category:"Beverages",location:"Port of Spain, Trinidad",rating:3.9,status:"active"},{tnt_id:"TNT-SUP-005",name:"Pan African Oils",contact_person:"Fatima Diallo",phone:"+221 77 123 4567",email:"[email protected]",category:"Cooking Oils",location:"Dakar, Senegal",rating:4.6,status:"active"},{tnt_id:"TNT-SUP-006",name:"Plantain King Supplies",contact_person:"Kofi Mensah",phone:"+233 24 987 6543",email:"[email protected]",category:"Fresh Produce",location:"Kumasi, Ghana",rating:4.3,status:"active"},{tnt_id:"TNT-SUP-007",name:"Nollywood Snacks Ltd",contact_person:"Chioma Eze",phone:"+234 812 345 6789",email:"[email protected]",category:"Snacks & Confectionery",location:"Enugu, Nigeria",rating:4.1,status:"active"},{tnt_id:"TNT-SUP-008",name:"Jerk Seasoning Masters",contact_person:"Devon Clarke",phone:"+1 876 555 7890",email:"[email protected]",category:"Spices & Seasonings",location:"Montego Bay, Jamaica",rating:4.7,status:"active"},{tnt_id:"TNT-SUP-009",name:"Saharan Dates Export",contact_person:"Ahmed Hassan",phone:"+212 655 123 456",email:"[email protected]",category:"Dried Fruits & Nuts",location:"Casablanca, Morocco",rating:4.4,status:"active"},{tnt_id:"TNT-SUP-010",name:"Reggae Sauces Inc",contact_person:"Simone Barrett",phone:"+1 876 555 3456",email:"[email protected]",category:"Sauces & Condiments",location:"Spanish Town, Jamaica",rating:4,status:"active"}],Vo=e=>
671new Promise(t=>setTimeout(t,e)),Rl={async fetchSuppliers(e){if(await Vo(800),e){const t=e.toLowerCase();return Xh.filter(r=>r.name.toLowerCase().includes(t)||r.category.toLowerCase().includes(t)||r.location.toLowerCase().includes(t))}return Xh},async syncSupplier(e){return await Vo(500),Xh.find(t=>t.tnt_id===e)||null},async sendRFQ(e){return await Vo(1e3),{success:!0,tnt_rfq_id:`TNT-RFQ-${Date.now()}`}},async fetchQuoteResponses(e,t,r){return await Vo(1200),r.map((n,a)=>({supplier_name:n,quote_number:`QT-${Date.now()}-${a+1}`,delivery_time_days:7+Math.floor(Math.random()*14),lead_time_days:3+Math.floor(Math.random()*7),items:t.map(i=>({product_name:i.product_name,rfq_item_id:i.id,quantity:i.quantity,unit_price:(5+Math.random()*45).toFixed(2),availability:Math.random()>.2?"in_stock":"low_stock",substitute_item:Math.random()>.8?`${i.product_name} (Alternative)`:null}))}))},async sendPurchaseOrder(e){return await Vo(1e3),{success:!0,tnt_po_id:`TNT-PO-${Date.now()}`}},async syncAllSuppliers(){return await Vo(1500),{synced:Xh.length,errors:0}}},Qr={active:"bg-emerald-100 text-emerald-700",inactive:"bg-muted text-muted-foreground",pending:"bg-amber-100 text-amber-700",blocked:"bg-red-100 text-red-700",draft:"bg-muted text-muted-foreground",sent:"bg-blue-100 text-blue-700",partially_responded:"bg-amber-100 text-amber-700",fully_responded:"bg-emerald-100 text-emerald-700",closed:"bg-muted text-muted-foreground",cancelled:"bg-red-100 text-red-700",received:"bg-blue-100 text-blue-700",under_review:"bg-amber-100 text-amber-700",accepted:"bg-emerald-100 text-emerald-700",rejected:"bg-red-100 text-red-700",expired:"bg-muted text-muted-foreground",pending_approval:"bg-amber-100 text-amber-700",approved:"bg-emerald-100 text-emerald-700",acknowledged:"bg-blue-100 text-blue-700",partially_delivered:"bg-amber-100 text-amber-700",delivered:"bg-emerald-100 text-emerald-700",synced:"bg-emerald-100 text-emerald-700",local:"bg-blue-100 text-blue-700",in_stock:"bg-emerald-100 text-emerald-700",low_stock:"bg-amber-100 text-amber-700",out_of_stock:"bg-red-100 text-red-700"},s_e=({open:e,onOpenChange:t,onImported:r,existingRefs:n})=>{const[a,i]=b.useState([]),[o,l]=b.useState(!1),[c,u]=b.useState(!1),[d,f]=b.useState(""),[h,p]=b.useState(new Set),v=async()=>{l(!0);const w=await Rl.fetchSuppliers(d||void 0);i(w),l(!1)};b.useEffect(()=>{e&&(v(),p(new Set))},[e]);const m=()=>v(),g=w=>{const S=new Set(h);S.has(w)?S.delete(w):S.add(w),p(S)},y=async()=>{if(h.size===0)return;u(!0);const w=a.filter(_=>h.has(_.tnt_id)),S=w.map(_=>({name:_.name,contact_person:_.contact_person,phone:_.phone,email:_.email,category_supplied:_.category,address:_.location,trust_n_trade_ref:_.tnt_id,sync_status:"synced",rating:_.rating,status:"active"})),{error:j}=await V.from("suppliers").insert(S);if(u(!1),j){X.error(j.message);return}X.success(`${w.length} supplier(s) imported from Trust n Trade`),r(),t(!1)},x=a.filter(w=>!n.includes(w.tnt_id));return s.jsx(gr,{open:e,onOpenChange:t,children:s.jsxs(nr,{className:"max-w-2xl max-h-[80vh] flex flex-col",children:[s.jsx(vr,{children:s.jsx(ar,{children:"Import from Trust n Trade"})}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search suppliers…",value:d,onChange:w=>f(w.target.value),onKeyDown:w=>w.key==="Enter"&&m(),className:"pl-9"})]}),s.jsx(W,{variant:"outline",onClick:m,children:"Search"})]}),s.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 space-y-2 mt-2",children:o?s.jsx("div",{className:"flex justify-center py-12",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):x.length===0?s.jsx("p",{className:"text-center text-muted-foreground py-12",children:a.length>0?"All Trust n Trade suppliers already imported":"No suppliers found"}):x.map(w=>s.jsxs("div",{className:`flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-colors ${h.has(w.tnt_id)?"bg-accent border-primary":"hover:bg-accent/50"}`,onClick:()=>g(w.tnt_id),children:[s.jsx(jf,{checked:h.has(w.tnt_id)}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-sm truncate",children:w.name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.contact_person," · ",w.location]})]}),s.jsx(Be,{variant:"outline",className:"text-xs shrink-0",children:w.
671category}),s.jsxs("div",{className:"flex items-center gap-1 text-xs text-amber-600 shrink-0",children:[s.jsx(dp,{className:"h-3 w-3 fill-current"}),w.rating]})]},w.tnt_id))}),s.jsxs("div",{className:"flex items-center justify-between pt-3 border-t",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:h.size>0?`${h.size} selected`:"Select suppliers to import"}),s.jsxs(W,{onClick:y,disabled:h.size===0||c,children:[c?s.jsx(Ze,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(Od,{className:"mr-2 h-4 w-4"}),"Import ",h.size>0?`(${h.size})`:""]})]})]})})},o_e=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(""),[o,l]=b.useState("all"),[c,u]=b.useState(new Set),[d,f]=b.useState(!1),[h,p]=b.useState(!1),[v,m]=b.useState(null),[g,y]=b.useState(!1),x=async()=>{const{data:T}=await V.from("suppliers").select("*").order("name");t(T||[]),n(!1)};b.useEffect(()=>{x()},[]);const w=async()=>{y(!0);const T=await Rl.syncAllSuppliers();X.success(`Sync complete: ${T.synced} suppliers synced`),y(!1),x()},S=async T=>{T.preventDefault();const I=new FormData(T.currentTarget),F={name:I.get("name"),contact_person:I.get("contact_person")||null,phone:I.get("phone")||null,email:I.get("email")||null,category_supplied:I.get("category_supplied")||null,address:I.get("address")||null,notes:I.get("notes")||null,trust_n_trade_ref:I.get("trust_n_trade_ref")||null,status:I.get("status")||"active"};if(v){const{error:P}=await V.from("suppliers").update(F).eq("id",v.id);if(P){X.error(P.message);return}X.success("Supplier updated")}else{F.sync_status="local";const{error:P}=await V.from("suppliers").insert(F);if(P){X.error(P.message);return}X.success("Supplier added")}f(!1),m(null),x()},j=async T=>{const{error:I}=await V.from("suppliers").delete().eq("id",T);if(I){X.error(I.message);return}X.success("Supplier removed"),u(F=>{const P=new Set(F);return P.delete(T),P}),x()},_=async()=>{for(const T of c)await V.from("suppliers").delete().eq("id",T);X.success(`${c.size} supplier(s) removed`),u(new Set),x()},N=async()=>{for(const T of c)await V.from("suppliers").update({is_preferred:!0}).eq("id",T);X.success(`${c.size} supplier(s) marked as preferred`),u(new Set),x()},k=()=>{const T=["Name,Contact,Phone,Email,Category,Status,Sync Status"].concat(A.map(D=>`"${D.name}","${D.contact_person||""}","${D.phone||""}","${D.email||""}","${D.category_supplied||""}","${D.status}","${D.sync_status}"`)).join(`
672`),I=new Blob([T],{type:"text/csv"}),F=URL.createObjectURL(I),P=document.createElement("a");P.href=F,P.download="suppliers.csv",P.click(),URL.revokeObjectURL(F),X.success("Supplier list exported")},O=T=>{const I=new Set(c);I.has(T)?I.delete(T):I.add(T),u(I)},E=()=>{c.size===A.length?u(new Set):u(new Set(A.map(T=>T.id)))},A=e.filter(T=>{const I=T.name.toLowerCase().includes(a.toLowerCase())||(T.contact_person||"").toLowerCase().includes(a.toLowerCase())||(T.category_supplied||"").toLowerCase().includes(a.toLowerCase()),F=o==="all"||T.status===o;return I&&F}),R=e.filter(T=>T.trust_n_trade_ref).map(T=>T.trust_n_trade_ref);return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(W,{onClick:()=>p(!0),children:[s.jsx(Od,{className:"mr-2 h-4 w-4"})," Import from Trust n Trade"]}),s.jsxs(W,{variant:"outline",onClick:()=>{m(null),f(!0)},children:[s.jsx(Or,{className:"mr-2 h-4 w-4"})," Add Supplier"]}),s.jsxs(W,{variant:"outline",onClick:w,disabled:g,children:[s.jsx(If,{className:`mr-2 h-4 w-4 ${g?"animate-spin":""}`})," Sync"]}),s.jsxs(W,{variant:"outline",onClick:k,children:[s.jsx(W0,{className:"mr-2 h-4 w-4"})," Export"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsxs("div",{className:"relative flex-1 max-w-sm",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search suppliers…",value:a,onChange:T=>i(T.target.value),className:"pl-9"})]}),s.jsxs(Tt,{value:o,onValueChange:l,children:[s.jsx(kt,{className:"w-[140px]",children:s.jsx($t,{})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"all",children:"All Status"}),s.jsx(xe,{value:"active",children:"Active"}),s.jsx(xe,{value:"inactive",children:"Inactive"}),s.jsx(xe,{value:"pending",children:"Pending"}),s.jsx(xe,{value:"blocked",children:"Blocked"})]})]}),s.jsxs(Be,{variant:"secondary",children:[A.length," supplier",A.length!==1?"s":""]})]}),c.size>0&&s.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-accent border",children:[s.jsxs(Be,{children:[c.size," selected"]}),s.jsxs(W,{size:"sm",variant:"outline",onClick:N,children:[s.jsx(dp,{className:"mr-1 h-3.5 w-3.5"})," Mark Preferred"]}),s.jsxs(W,{size:"sm",variant:"outline",className:"text-destructive",onClick:_,children:[s.jsx(xa,{
672className:"mr-1 h-3.5 w-3.5"})," Remove Selected"]}),s.jsxs(W,{size:"sm",variant:"ghost",onClick:()=>u(new Set),children:[s.jsx(e7,{className:"mr-1 h-3.5 w-3.5"})," Clear"]})]}),r?s.jsx("div",{className:"flex justify-center py-20",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):A.length===0?s.jsx(le,{children:s.jsxs(ce,{className:"py-16 text-center",children:[s.jsx(Oa,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No suppliers linked yet"}),s.jsxs(W,{className:"mt-4",onClick:()=>p(!0),children:[s.jsx(Od,{className:"mr-2 h-4 w-4"})," Import Suppliers from Trust n Trade"]})]})}):s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{className:"w-10",children:s.jsx(jf,{checked:c.size===A.length&&A.length>0,onCheckedChange:E})}),s.jsx(te,{children:"Supplier"}),s.jsx(te,{className:"hidden md:table-cell",children:"Contact"}),s.jsx(te,{className:"hidden lg:table-cell",children:"Category"}),s.jsx(te,{children:"Status"}),s.jsx(te,{className:"hidden md:table-cell",children:"Sync"}),s.jsx(te,{className:"text-right",children:"Actions"})]})}),s.jsx(Kt,{children:A.map(T=>s.jsxs(De,{className:c.has(T.id)?"bg-accent/50":"",children:[s.jsx(ee,{children:s.jsx(jf,{checked:c.has(T.id),onCheckedChange:()=>O(T.id)})}),s.jsx(ee,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[T.is_preferred&&s.jsx(dp,{className:"h-3.5 w-3.5 text-amber-500 fill-amber-500 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:T.name}),T.address&&s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(ej,{className:"h-3 w-3"}),T.address]}),T.rating!=null&&T.rating>0&&s.jsxs("span",{className:"text-xs text-amber-600 flex items-center gap-0.5",children:[s.jsx(dp,{className:"h-3 w-3 fill-current"})," ",T.rating]})]})]})}),s.jsx(ee,{className:"hidden md:table-cell",children:s.jsxs("div",{className:"space-y-0.5",children:[T.contact_person&&s.jsx("p",{className:"text-sm",children:T.contact_person}),T.phone&&s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(aj,{className:"h-3 w-3"}),T.phone]}),T.email&&s.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1",children:[s.jsx(ti,{className:"h-3 w-3"}),T.email]})]})}),s.jsx(ee,{className:"hidden lg:table-cell",children:T.category_supplied&&s.jsx(Be,{variant:"outline",className:"text-xs",children:T.category_supplied})}),s.jsx(ee,{children:s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${Qr[T.status]||Qr.active}`,children:T.status})}),s.jsx(ee,{className:"hidden md:table-cell",children:s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${Qr[T.sync_status]||Qr.local}`,children:T.sync_status||"local"})}),s.jsx(ee,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{m(T),f(!0)},children:s.jsx(Zz,{className:"h-3.5 w-3.5"})}),s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive",onClick:()=>
672j(T.id),children:s.jsx(xa,{className:"h-3.5 w-3.5"})})]})})]},T.id))})]})})}),s.jsx(gr,{open:d,onOpenChange:T=>{f(T),T||m(null)},children:s.jsxs(nr,{className:"max-w-lg",children:[s.jsx(vr,{children:s.jsx(ar,{children:v?"Edit Supplier":"Add New Supplier"})}),s.jsxs("form",{onSubmit:S,className:"space-y-4 mt-2",children:[s.jsx(se,{name:"name",placeholder:"Supplier name *",required:!0,defaultValue:(v==null?void 0:v.name)||""}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(se,{name:"contact_person",placeholder:"Contact person",defaultValue:(v==null?void 0:v.contact_person)||""}),s.jsx(se,{name:"phone",placeholder:"Phone",defaultValue:(v==null?void 0:v.phone)||""})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(se,{name:"email",placeholder:"Email",type:"email",defaultValue:(v==null?void 0:v.email)||""}),s.jsx(se,{name:"category_supplied",placeholder:"Category supplied",defaultValue:(v==null?void 0:v.category_supplied)||""})]}),s.jsx(se,{name:"address",placeholder:"Address",defaultValue:(v==null?void 0:v.address)||""}),s.jsx(se,{name:"trust_n_trade_ref",placeholder:"Trust n Trade reference",defaultValue:(v==null?void 0:v.trust_n_trade_ref)||""}),s.jsxs("select",{name:"status",className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",defaultValue:(v==null?void 0:v.status)||"active",children:[s.jsx("option",{value:"active",children:"Active"}),s.jsx("option",{value:"inactive",children:"Inactive"}),s.jsx("option",{value:"pending",children:"Pending"}),s.jsx("option",{value:"blocked",children:"Blocked"})]}),s.jsx(yr,{name:"notes",placeholder:"Notes",defaultValue:(v==null?void 0:v.notes)||""}),s.jsxs(W,{type:"submit",className:"w-full",children:[v?"Update":"Add"," Supplier"]})]})]})}),s.jsx(s_e,{open:h,onOpenChange:p,onImported:x,existingRefs:R})]})},l_e=()=>{const{user:e}=ir(),[t,r]=b.useState([]),[n,a]=b.useState(!0),[i,o]=b.useState(!1),[l,c]=b.useState(null),[u,d]=b.useState([]),[f,h]=b.useState([]),[p,v]=b.useState([]),[m,g]=b.useState("all"),[y,x]=b.useState(""),[w,S]=b.useState(""),[j,_]=b.useState(""),[N,k]=b.useState(""),[O,E]=b.useState(""),[A,R]=b.useState(new Set),[T,I]=b.useState([{product_name:"",quantity:"1",unit:"units",specifications:""}]),[F,P]=b.useState(!1),D=async()=>{const{data:L}=await V.from("rfqs").select("*").order("created_at",{ascending:!1});r(L||[]),a(!1)},M=async()=>{const{data:L}=await V.from("suppliers").select("*").eq("status","active").order("name");v(L||[])};b.useEffect(()=>{D(),M()},[]);const $=()=>I([...T,{product_name:"",quantity:"1",unit:"units",specifications:""}]),z=L=>I(T.filter((Y,J)=>J!==L)),K=(L,Y,J)=>{const U=[...T];U[L][Y]=J,I(U)},q=L=>{const Y=new Set(A);Y.has(L)?Y.delete(L):Y.add(L),R(Y)},B=()=>{x(""),S(""),_(""),k(""),E(""),R(new Set),I([{product_name:"",quantity:"1",unit:"units",specifications:""}])},Z=async L=>{if(!y.trim()){X.error("RFQ title is required");return}if(T.filter(Ne=>Ne.product_name.trim()).length===0){X.error("Add at least one item");return}if(A.size===0){X.error("Select at least one supplier");return}P(!0);const Y=`RFQ-${pr(new Date,"yyyyMMdd")}-${String(Math.floor(Math.random()*9999)).padStart(4,"0")}`,J=(await V.auth.getUser()).data.user,{data:U,error:ge}=await V.from("rfqs").insert({rfq_number:Y,title:y,description:w||null,requested_by:J==null?void 0:J.id,delivery_date:j||null,delivery_location:N||null,notes:O||null,status:L?"sent":"draft"}).select().single();if(ge||!U){X.error((ge==null?void 0:ge.message)||"Failed to create RFQ"),P(!1);return}const ve=T.filter(Ne=>Ne.product_name.trim());if(await V.from("rfq_items").insert(ve.map(Ne=>({rfq_id:U.id,product_name:Ne.product_name,quantity:parseFloat(Ne.quantity)||1,unit:Ne.unit,specifications:Ne.specifications||null}))),await V.from("rfq_suppliers").insert(Array.from(A).map(Ne=>({rfq_id:U.id,supplier_id:Ne,sent_at:L?new Date().toISOString():null,status:L?"sent":"pending"}))),L){await Rl.sendRFQ({rfq_number:Y,items:ve,supplier_ids:Array.from(A)}),J&&await V.from("notifications").insert({user_id:J.id,title:"RFQ Sent",message:`RFQ ${Y} sent to ${A.size} supplier(s)`,type:"info",link:"/admin/suppliers"});const Ne=p.filter(Re=>A.has(Re.id));for(const Re of Ne)await V.functions.invoke("send-transactional-email",{body:{templateName:"rfq-sent",recipientEmail:Re.email||(J==null?void 0:J.email),idempotencyKey:`rfq-sent-${U.id}-${Re.id}`,templateData:{supplierName:Re.name,rfqNumber:Y,itemCount:String(ve.length),deliveryDate:j||void 0,deliveryLocation:N||void 0,notes:O||void 0}}})}await V.from("procurement_activity_log").insert({action:L?"rfq_sent":"rfq_created",entity_type:"rfq",entity_id:U.id,details:{rfq_number:Y,supplier_count:A.size,item_count:ve.length},performed_by:J==null?void 0:J.id}),X.success(L?`RFQ ${Y} sent to ${A.size} supplier(s)`:`RFQ ${Y} saved as draft`),P(!1),o(!1),B(),D()},he=async L=>{var J,U;await V.from("rfqs").update({status:"sent"}).eq("id",L.id),await V.from("rfq_suppliers").update({status:"sent",sent_at:new Date().toISOString()}).eq("rfq_id",L.id),await Rl.sendRFQ({rfq_number:L.rfq_number,items:[],supplier_ids:[]});const{data:Y}=await V.from("rfq_suppliers").select("*, suppliers(name, email)").eq("rfq_id",L.id);for(const ge of Y||[]){const ve=((J=ge.suppliers)==null?void 0:J.email)||(e==null?void 0:e.email);ve&&await V.functions.invoke("send-transactional-email",{body:{templateName:"rfq-sent",recipientEmail:ve,idempotencyKey:`rfq-sent-${L.id}-${ge.supplier_id}`,templateData:{supplierName:((U=ge.suppliers)==null?void 0:U.name)||"Supplier",rfqNumber:L.rfq_number}}})}X.success(`RFQ ${L.rfq_number} sent`),D()},pe=async L=>{c(L);const{data:Y}=await V.from("rfq_items").select("*").eq("rfq_id",L.id);d(Y||[]);const{data:J}=await V.from("rfq_suppliers").select("*, suppliers(*)").eq("rfq_id",L.id);h(J||[])},Q=async L=>{var Re,it;X.info("Checking Trust n Trade for quote responses…");const{data:Y}=await V.from("rfq_items").select("*").eq("rfq_id",L.id),J=Y||[],{data:U}=await V.from("rfq_suppliers").select("*, suppliers(name)").eq("rfq_id",L.id),ge=U||[],ve=ge.map(Xe=>{var Qe;return((Qe=Xe.suppliers)==null?void 0:Qe.name)||"Unknown"}),Ne=await Rl.fetchQuoteResponses(L.trust_n_trade_rfq_id||"",J,ve);for(let Xe=0;Xe<Ne.length;Xe++){const Qe=Ne[Xe],cn=(Re=ge[Xe])==null?void 0:Re.supplier_id;if(!cn)continue;const Xt=Qe.items.reduce((st,vs)=>st+parseFloat(vs.unit_price)*vs.quantity,0),{data:xr}=await V.from("supplier_quotes").insert({rfq_id:L.id,supplier_id:cn,quote_number:Qe.quote_number,total_amount:Xt,delivery_time_days:Qe.delivery_time_days,lead_time_days:Qe.lead_time_days,status:"received"}).select().single();xr&&await V.from("supplier_quote_items").insert(Qe.items.map(st=>
672({quote_id:xr.id,rfq_item_id:st.rfq_item_id,product_name:st.product_name,quantity:st.quantity,unit_price:parseFloat(st.unit_price),total_price:parseFloat(st.unit_price)*st.quantity,availability:st.availability,substitute_item:st.substitute_item})))}await V.from("rfqs").update({status:"fully_responded"}).eq("id",L.id);for(let Xe=0;Xe<Ne.length;Xe++){const Qe=Ne[Xe],cn=ve[Xe]||"Supplier",Xt=Qe.items.reduce((xr,st)=>xr+parseFloat(st.unit_price)*st.quantity,0);e!=null&&e.email&&await V.functions.invoke("send-transactional-email",{body:{templateName:"quote-received",recipientEmail:e.email,idempotencyKey:`quote-received-${L.id}-${(it=ge[Xe])==null?void 0:it.supplier_id}`,templateData:{supplierName:cn,rfqNumber:L.rfq_number,totalAmount:Xt.toFixed(2),itemCount:String(Qe.items.length),leadTimeDays:Qe.lead_time_days?String(Qe.lead_time_days):void 0}}})}X.success(`${Ne.length} quote response(s) received and saved`),D()},me=t.filter(L=>m==="all"||L.status===m);return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(W,{onClick:()=>{B(),o(!0)},children:[s.jsx(Or,{className:"mr-2 h-4 w-4"})," Create RFQ"]}),s.jsxs(Tt,{value:m,onValueChange:g,children:[s.jsx(kt,{className:"w-[160px]",children:s.jsx($t,{})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"all",children:"All Status"}),s.jsx(xe,{value:"draft",children:"Draft"}),s.jsx(xe,{value:"sent",children:"Sent"}),s.jsx(xe,{value:"partially_responded",children:"Partial Response"}),s.jsx(xe,{value:"fully_responded",children:"Fully Responded"}),s.jsx(xe,{value:"closed",children:"Closed"})]})]}),s.jsxs(Be,{variant:"secondary",children:[me.length," RFQ",me.length!==1?"s":""]})]}),n?s.jsx("div",{className:"flex justify-center py-20",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):me.length===0?s.jsx(le,{children:s.jsxs(ce,{className:"py-16 text-center",children:[s.jsx(Qs,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No RFQs yet"}),s.jsxs(W,{className:"mt-4",onClick:()=>{B(),o(!0)},children:[s.jsx(Or,{className:"mr-2 h-4 w-4"})," Create Your First RFQ"]})]})}):s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{children:"RFQ Number"}),s.jsx(te,{children:"Title"}),s.jsx(te,{className:"hidden md:table-cell",children:"Delivery Date"}),s.jsx(te,{children:"Status"}),s.jsx(te,{className:"hidden md:table-cell",children:"Created"}),s.jsx(te,{className:"text-right",children:"Actions"})]})}),s.jsx(Kt,{children:me.map(L=>s.jsxs(De,{children:[s.jsx(ee,{className:"font-mono text-xs",children:L.rfq_number}),s.jsx(ee,{className:"font-medium text-sm",children:L.title}),s.jsx(ee,{className:"hidden md:table-cell text-sm",children:L.delivery_date?pr(new Date(L.delivery_date),"dd MMM yyyy"):"—"}),s.jsx(ee,{children:s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${Qr[L.status]||""}`,children:L.status.replace(/_/g," ")})}),s.jsx(ee,{className:"hidden md:table-cell text-xs text-muted-foreground",children:pr(new Date(L.created_at),"dd MMM yyyy")}),s.jsx(ee,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>pe(L),children:s.jsx(Mf,{className:"h-3.5 w-3.5"})}),L.status==="draft"&&s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>he(L),children:s.jsx(Zl,{className:"h-3.5 w-3.5"})}),L.status==="sent"&&s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>Q(L),children:s.jsx(If,{className:"h-3.5 w-3.5"})})]})})]},L.id))})]})})}),s.jsx(gr,{open:i,onOpenChange:o,children:s.jsxs(nr,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:[s.jsx(vr,{children:s.jsx(ar,{children:"Create Request for Quotation"})}),s.jsxs("div",{className:"space-y-6 mt-2",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"RFQ Details"}),s.jsx(se,{placeholder:"RFQ Title *",value:y,onChange:L=>x(L.target.value)}),s.jsx(yr,{placeholder:"Description",value:w,onChange:L=>S(L.target.value)}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(se,{type:"date",placeholder:"Delivery Date",value:j,onChange:L=>_(L.target.value)}),s.jsx(se,{placeholder:"Delivery Location",value:N,onChange:L=>k(L.target.value)})]}),s.jsx(yr,{placeholder:"Notes / Specifications",value:O,onChange:L=>E(L.target.value),rows:2})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Items"}),s.jsxs(W,{variant:"outline",size:"sm",onClick:$,children:[s.jsx(Or,{className:"mr-1 h-3.5 w-3.5"})," Add Item"]})]}),T.map((L,Y)=>s.jsxs("div",{className:"flex gap-2 items-start",children:[s.jsx(se,{placeholder:"Product name *",className:"flex-1",value:L.product_name,onChange:J=>K(Y,"product_name",J.target.value)}),s.jsx(se,{placeholder:"Qty",className:"w-20",type:"number",value:L.quantity,onChange:J=>K(Y,"quantity",J.target.value)}),s.jsx(se,{placeholder:"Unit",className:"w-24",value:L.unit,onChange:J=>K(Y,"unit",J.target.value)}),T.length>1&&s.jsx(W,{variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0",onClick:()=>
672z(Y),children:s.jsx(xa,{className:"h-4 w-4 text-destructive"})})]},Y))]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("h3",{className:"text-sm font-semibold",children:["Select Suppliers (",A.size,")"]}),s.jsx("div",{className:"max-h-48 overflow-y-auto space-y-1 border rounded-lg p-2",children:p.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No active suppliers — import from Trust n Trade first"}):p.map(L=>s.jsxs("div",{className:"flex items-center gap-2 p-2 rounded hover:bg-accent cursor-pointer",onClick:()=>q(L.id),children:[s.jsx(jf,{checked:A.has(L.id)}),s.jsx("span",{className:"text-sm flex-1",children:L.name}),L.category_supplied&&s.jsx(Be,{variant:"outline",className:"text-[10px]",children:L.category_supplied})]},L.id))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(W,{variant:"outline",className:"flex-1",onClick:()=>Z(!1),disabled:F,children:"Save as Draft"}),s.jsxs(W,{className:"flex-1",onClick:()=>Z(!0),disabled:F,children:[F?s.jsx(Ze,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(Zl,{className:"mr-2 h-4 w-4"}),"Send RFQ"]})]})]})]})}),s.jsx(gr,{open:!!l,onOpenChange:L=>{L||c(null)},children:s.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsx(vr,{children:s.jsxs(ar,{children:["RFQ ",l==null?void 0:l.rfq_number]})}),l&&s.jsxs("div",{className:"space-y-4 mt-2",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Title:"})," ",s.jsx("span",{className:"font-medium",children:l.title})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Status:"})," ",s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${Qr[l.status]}`,children:l.status.replace(/_/g," ")})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Delivery Date:"})," ",l.delivery_date?pr(new Date(l.delivery_date),"dd MMM yyyy"):"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Location:"})," ",l.delivery_location||"—"]})]}),l.description&&s.jsx("p",{className:"text-sm text-muted-foreground",children:l.description}),l.notes&&s.jsx("p",{className:"text-sm text-muted-foreground italic",children:l.notes}),s.jsxs("div",{children:[s.jsxs("h4",{className:"text-sm font-semibold mb-2",children:["Items (",u.length,")"]}),s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{children:"Product"}),s.jsx(te,{children:"Qty"}),s.jsx(te,{children:"Unit"})]})}),s.jsx(Kt,{children:u.map(L=>s.jsxs(De,{children:[s.jsx(ee,{children:L.product_name}),s.jsx(ee,{children:L.quantity}),s.jsx(ee,{children:L.unit})]},L.id))})]})]}),s.jsxs("div",{children:[s.jsxs("h4",{className:"text-sm font-semibold mb-2",children:["Suppliers (",f.length,")"]}),s.jsx("div",{className:"space-y-1",children:f.map(L=>{var Y;return s.jsxs("div",{className:"flex items-center justify-between p-2 border rounded text-sm",children:[s.jsx("span",{children:((Y=L.suppliers)==null?void 0:Y.name)||"Unknown"}),s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${Qr[L.status]}`,children:L.status})]},L.id)})})]})]})]})})]})},c_e=()=>{var S,j;const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState([]),[o,l]=b.useState(null),[c,u]=b.useState(null),[d,f]=b.useState(null),[h,p]=b.useState([]),v=async()=>{const{data:_}=await V.from("supplier_quotes").select("*, suppliers(name, email)").order("created_at",{ascending:!1});t(_||[]),n(!1)},m=async()=>{const{data:_}=await V.from("rfqs").select("*").in("status",["fully_responded","partially_responded","closed"]).order("created_at",{ascending:!1});i(_||[])};b.useEffect(()=>{v(),m()},[]);const g=async _=>{f(_);const{data:N}=await V.from("supplier_quote_items").select("*").eq("quote_id",_.id);p(N||[])},y=async _=>{l(_);const{data:N}=await V.from("rfq_items").select("*").eq("rfq_id",_),k=N||[],{data:O}=await V.from("supplier_quotes").select("*, suppliers(name), supplier_quote_items(*)").eq("rfq_id",_),A=(O||[]).map(R=>({...R,quote_items:R.supplier_quote_items||[]}));u({items:k,quotes:A})},x=async(_,N,k,O,E,A)=>{const R=(await V.auth.getUser()).data.user,{error:T}=await V.from("procurement_awards").insert({rfq_id:_,rfq_item_id:N,supplier_id:k,quote_item_id:O,awarded_quantity:E,awarded_price:A,awarded_by:R==null?void 0:R.id});if(T){X.error(T.message);return}X.success("Item awarded to supplier"),await V.from("procurement_activity_log").insert({action:"item_awarded",entity_type:"procurement_award",entity_id:_,details:{rfq_item_id:N,supplier_id:k,quantity:E,price:A},performed_by:R==null?void 0:R.id})},w=async(_,N)=>{await V.from("supplier_quotes").update({status:N}).eq("id",_),X.success(`Quote ${N}`),v(),(d==null?void 0:d.id)===_&&f({...d,status:N})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Be,{variant:"secondary",children:[e.length," quote",e.length!==1?"s":""]}),a.length>0&&s.jsxs(Tt,{onValueChange:y,children:[s.jsx(kt,{className:"w-[240px]",children:s.jsx($t,{placeholder:"Compare quotes for RFQ…"})}),s.jsx(Ot,{children:a.map(_=>s.jsxs(xe,{value:_.id,children:[_.rfq_number," — ",_.title]},_.id))})]})]}),c&&s.jsxs(le,{children:[s.jsx(dt,{className:"pb-3",children:s.jsxs(mt,{className:"text-base flex items-center gap-2",children:[s.jsx(Yp,{className:"h-4 w-4"})," Quote Comparison"]})}),s.jsx(ce,{className:"p-0 overflow-x-auto",children:s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{className:"sticky left-0 bg-background z-10 min-w-[150px]",children:"Item"}),s.jsx(te,{className:"sticky left-0 bg-background z-10",children:"Qty"}),c.quotes.map(_=>{var N;return s.jsx(te,{className:"text-center min-w-[160px]",children:s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:(N=_.suppliers)==null?void 0:N.name}),s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[_.delivery_time_days,"d delivery"]})]})},_.id)})]})}),s.jsxs(Kt,{children:[c.items.map(_=>{const N=c.quotes.map(O=>{const E=O.quote_items.find(A=>A.rfq_item_id===_.id);return E?E.unit_price:null}),k=Math.min(...N.filter(O=>O!==null));return s.jsxs(De,{children:[s.jsx(ee,{className:"sticky left-0 bg-background z-10 font-medium text-sm",children:_.product_name}),s.jsx(ee,{className:"sticky left-0 bg-background z-10 text-sm",children:_.quantity}),c.quotes.map(O=>{const E=O.quote_items.find(R=>R.rfq_item_id===_.id),A=E&&E.unit_price===k;return s.jsx(ee,{className:"text-center",children:E?s.jsxs("div",{className:"space-y-1",children:[s.jsxs("p",{className:`font-medium ${A?"text-emerald-600":""}`,children:["£",E.unit_price.toFixed(2),A&&s.jsx("span",{className:"text-[9px] ml-1",children:"✓ Best"})]}),s.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Total: £",E.total_price.toFixed(2)]}),s.jsx("span",{className:`inline-block px-1.5 py-0.5 rounded text-[9px] ${Qr[E.availability]}`,children:E.availability.replace(/_/g," ")}),E.substitute_item&&s.jsxs("p",{className:"text-[9px] text-amber-600",children:["Alt: ",E.substitute_item]}),s.jsxs(W,{size:"sm",variant:"outline",className:"h-6 text-[10px] mt-1",onClick:()=>
672x(O.rfq_id,_.id,O.supplier_id,E.id,E.quantity,E.unit_price),children:[s.jsx(Tz,{className:"h-3 w-3 mr-0.5"})," Award"]})]}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"No quote"})},O.id)})]},_.id)}),s.jsxs(De,{className:"font-semibold",children:[s.jsx(ee,{className:"sticky left-0 bg-background z-10",colSpan:2,children:"Total"}),c.quotes.map(_=>{var N;return s.jsxs(ee,{className:"text-center",children:["£",((N=_.total_amount)==null?void 0:N.toFixed(2))||"0.00"]},_.id)})]})]})]})})]}),r?s.jsx("div",{className:"flex justify-center py-20",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):e.length===0?s.jsx(le,{children:s.jsxs(ce,{className:"py-16 text-center",children:[s.jsx(j$,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No quotes received yet"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Send an RFQ to suppliers first, then fetch responses"})]})}):s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{children:"Supplier"}),s.jsx(te,{children:"Quote #"}),s.jsx(te,{children:"Total"}),s.jsx(te,{className:"hidden md:table-cell",children:"Delivery"}),s.jsx(te,{className:"hidden md:table-cell",children:"Expires"}),s.jsx(te,{children:"Status"}),s.jsx(te,{className:"text-right",children:"Actions"})]})}),s.jsx(Kt,{children:e.map(_=>{var N,k;return s.jsxs(De,{children:[s.jsx(ee,{className:"font-medium text-sm",children:((N=_.suppliers)==null?void 0:N.name)||"—"}),s.jsx(ee,{className:"font-mono text-xs",children:_.quote_number||"—"}),s.jsxs(ee,{className:"font-medium",children:["£",(k=_.total_amount)==null?void 0:k.toFixed(2)]}),s.jsx(ee,{className:"hidden md:table-cell text-sm",children:_.delivery_time_days?`${_.delivery_time_days} days`:"—"}),s.jsx(ee,{className:"hidden md:table-cell text-xs",children:_.quote_expiry_date?pr(new Date(_.quote_expiry_date),"dd MMM yyyy"):"—"}),s.jsx(ee,{children:s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${Qr[_.status]}`,children:_.status.replace(/_/g," ")})}),s.jsx(ee,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>g(_),children:s.jsx(Mf,{className:"h-3.5 w-3.5"})}),_.status==="received"&&s.jsxs(s.Fragment,{children:[s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7 text-emerald-600",onClick:()=>w(_.id,"accepted"),children:s.jsx(Ql,{className:"h-3.5 w-3.5"})}),s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive",onClick:()=>w(_.id,"rejected"),children:s.jsx(Ic,{className:"h-3.5 w-3.5"})})]})]})})]},_.id)})})]})})}),s.jsx(gr,{open:!!d,onOpenChange:_=>{_||f(null)},children:s.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsx(vr,{children:s.jsxs(ar,{children:["Quote ",d==null?void 0:d.quote_number]})}),d&&s.jsxs("div",{className:"space-y-4 mt-2",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Supplier:"})," ",(S=d.suppliers)==null?void 0:S.name]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Total:"})," ",s.jsxs("span",{className:"font-bold",children:["£",(j=d.total_amount)==null?void 0:j.toFixed(2)]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Delivery:"})," ",d.delivery_time_days||"—"," days"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Lead Time:"})," ",d.lead_time_days||"—"," days"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Status:"})," ",s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${Qr[d.status]}`,children:d.status.replace(/_/g," ")})]})]}),s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{children:"Product"}),s.jsx(te,{children:"Qty"}),s.jsx(te,{children:"Unit Price"}),s.jsx(te,{children:"Total"}),s.jsx(te,{children:"Availability"})]})}),s.jsx(Kt,{children:h.map(_=>s.jsxs(De,{children:[s.jsxs(ee,{className:"text-sm",children:[_.product_name,_.substitute_item&&s.jsxs("p",{className:"text-[10px] text-amber-600",children:["Alt: ",_.substitute_item]})]}),s.jsx(ee,{children:_.quantity}),s.jsxs(ee,{children:["£",_.unit_price.toFixed(2)]}),s.jsxs(ee,{className:"font-medium",children:["£",_.total_price.toFixed(2)]}),s.jsx(ee,{children:s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] capitalize ${Qr[_.availability]}`,children:_.availability.replace(/_/g," ")})})]},_.id))})]})]})]})})]})},u_e=()=>{var q;const{user:e,isAdmin:t,role:r}=ir(),[n,a]=b.useState([]),[i,o]=b.useState(!0),[l,c]=b.useState("all"),[u,d]=b.useState(!1),[f,h]=b.useState(null),[p,v]=b.useState([]),[m,g]=b.useState([]),[y,x]=b.useState(new Set),[w,S]=b.useState(""),[j,_]=b.useState(""),[N,k]=b.useState(""),[O,E]=b.useState(""),[A,R]=b.useState(!1),T=async()=>{const{data:B}=await V.from("purchase_orders").select("*, suppliers(name)").order("created_at",{ascending:!1});a(B||[]),o(!1)},I=async()=>{const{data:B}=await V.from("procurement_awards").select("*, suppliers:supplier_id(name), rfq_items:rfq_item_id(product_name)").is("po_id",null),Z=(B||[]).map(he=>{var pe,Q;return{...he,supplier_name:((pe=he.suppliers)==null?void 0:pe.name)||"Unknown",product_name:((Q=he.rfq_items)==null?void 0:Q.product_name)||"Unknown"}});g(Z)};b.useEffect(()=>{T()},[]);const F=()=>{d(!0),I(),x(new Set),S(""),_(""),k(""),E("")},P=B=>{const Z=new Set(y);Z.has(B)?Z.delete(B):Z.add(B),x(Z)},D=async()=>
672{if(y.size===0){X.error("Select at least one award");return}R(!0);const B=m.filter(pe=>y.has(pe.id)),Z=new Map;B.forEach(pe=>{const Q=pe.supplier_id;Z.has(Q)||Z.set(Q,[]),Z.get(Q).push(pe)});let he=0;for(const[pe,Q]of Z){const me=`PO-${pr(new Date,"yyyyMMdd")}-${String(Math.floor(Math.random()*9999)).padStart(4,"0")}`,L=Q.reduce((U,ge)=>U+ge.awarded_quantity*ge.awarded_price,0),{data:Y,error:J}=await V.from("purchase_orders").insert({po_number:me,supplier_id:pe,rfq_id:Q[0].rfq_id,total_value:L,delivery_address:w||null,expected_delivery_date:j||null,notes:O||null,payment_terms:N||null,status:"draft",created_by:e==null?void 0:e.id}).select().single();if(J||!Y){X.error((J==null?void 0:J.message)||"Failed");continue}await V.from("purchase_order_items").insert(Q.map(U=>({po_id:Y.id,quote_item_id:U.quote_item_id,product_name:U.product_name||"Item",quantity:U.awarded_quantity,unit_price:U.awarded_price,total_price:U.awarded_quantity*U.awarded_price})));for(const U of Q)await V.from("procurement_awards").update({po_id:Y.id}).eq("id",U.id);await V.from("procurement_activity_log").insert({action:"po_created",entity_type:"purchase_order",entity_id:Y.id,details:{po_number:me,supplier_id:pe,total_value:L,items:Q.length},performed_by:e==null?void 0:e.id}),he++}X.success(`${he} purchase order(s) generated`),R(!1),d(!1),T()},M=async B=>{h(B);const{data:Z}=await V.from("purchase_order_items").select("*").eq("po_id",B.id);v(Z||[])},$=async(B,Z)=>{var J,U;const he={status:Z};Z==="approved"&&(he.approved_by=e==null?void 0:e.id,he.approved_at=new Date().toISOString()),Z==="sent"&&(he.sent_at=new Date().toISOString(),await Rl.sendPurchaseOrder({po_id:B}));const{error:pe}=await V.from("purchase_orders").update(he).eq("id",B);if(pe){X.error(pe.message);return}const Q=n.find(ge=>ge.id===B),me=((J=Q==null?void 0:Q.suppliers)==null?void 0:J.name)||"Supplier",L=(Q==null?void 0:Q.po_number)||"N/A",Y=((U=Q==null?void 0:Q.total_value)==null?void 0:U.toFixed(2))||"0.00";e!=null&&e.email&&(Z==="approved"&&await V.functions.invoke("send-transactional-email",{body:{templateName:"po-approved",recipientEmail:e.email,idempotencyKey:`po-approved-${B}`,templateData:{poNumber:L,supplierName:me,totalValue:Y,approvedBy:r||"Admin"}}}),Z==="sent"&&await V.functions.invoke("send-transactional-email",{body:{templateName:"po-sent",recipientEmail:e.email,idempotencyKey:`po-sent-${B}`,templateData:{poNumber:L,supplierName:me,totalValue:Y}}})),e&&(Z==="approved"||Z==="sent")&&await V.from("notifications").insert({user_id:e.id,title:`PO ${Z}`,type:"info",link:"/admin/suppliers",message:`Purchase order has been ${Z}`}),await V.from("procurement_activity_log").insert({action:`po_${Z}`,entity_type:"purchase_order",entity_id:B,details:{status:Z},performed_by:e==null?void 0:e.id}),X.success(`Purchase order ${Z}`),T(),(f==null?void 0:f.id)===B&&h({...f,status:Z})},z=B=>
672!!(r==="owner"||t&&B.total_value<=500),K=n.filter(B=>l==="all"||B.status===l);return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(W,{onClick:F,children:[s.jsx(Or,{className:"mr-2 h-4 w-4"})," Create PO from Awards"]}),s.jsxs(Tt,{value:l,onValueChange:c,children:[s.jsx(kt,{className:"w-[170px]",children:s.jsx($t,{})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"all",children:"All Status"}),s.jsx(xe,{value:"draft",children:"Draft"}),s.jsx(xe,{value:"pending_approval",children:"Pending Approval"}),s.jsx(xe,{value:"approved",children:"Approved"}),s.jsx(xe,{value:"sent",children:"Sent"}),s.jsx(xe,{value:"delivered",children:"Delivered"}),s.jsx(xe,{value:"closed",children:"Closed"})]})]}),s.jsxs(Be,{variant:"secondary",children:[K.length," PO",K.length!==1?"s":""]})]}),i?s.jsx("div",{className:"flex justify-center py-20",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):K.length===0?s.jsx(le,{children:s.jsxs(ce,{className:"py-16 text-center",children:[s.jsx(ec,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No purchase orders yet"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Award items from quotes to generate purchase orders"})]})}):s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{children:"PO Number"}),s.jsx(te,{children:"Supplier"}),s.jsx(te,{children:"Total"}),s.jsx(te,{className:"hidden md:table-cell",children:"Delivery"}),s.jsx(te,{children:"Status"}),s.jsx(te,{className:"text-right",children:"Actions"})]})}),s.jsx(Kt,{children:K.map(B=>{var Z;return s.jsxs(De,{children:[s.jsx(ee,{className:"font-mono text-xs",children:B.po_number}),s.jsx(ee,{className:"font-medium text-sm",children:((Z=B.suppliers)==null?void 0:Z.name)||"—"}),s.jsxs(ee,{className:"font-bold",children:["£",B.total_value.toFixed(2)]}),s.jsx(ee,{className:"hidden md:table-cell text-sm",children:B.expected_delivery_date?pr(new Date(B.expected_delivery_date),"dd MMM yyyy"):"—"}),s.jsx(ee,{children:s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${Qr[B.status]}`,children:B.status.replace(/_/g," ")})}),s.jsx(ee,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>M(B),children:s.jsx(Mf,{className:"h-3.5 w-3.5"})}),B.status==="draft"&&s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>$(B.id,"pending_approval"),children:s.jsx(qN,{className:"h-3.5 w-3.5"})}),B.status==="pending_approval"&&z(B)&&s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7 text-emerald-600",onClick:()=>$(B.id,"approved"),children:s.jsx(Ql,{className:"h-3.5 w-3.5"})}),B.status==="approved"&&s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>$(B.id,"sent"),children:s.jsx(Zl,{className:"h-3.5 w-3.5"})})]})})]},B.id)})})]})})}),s.jsx(gr,{open:u,onOpenChange:d,children:s.jsxs(nr,{className:"max-w-2xl max-h-[85vh] overflow-y-auto",children:[s.jsx(vr,{children:s.jsx(ar,{children:"Generate Purchase Orders from Awards"})}),s.jsx("div",{className:"space-y-4 mt-2",children:m.length===0?s.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No unlinked awards — award items from quote comparison first"}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Select Awards to Convert"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Items from the same supplier will be grouped into one PO"}),s.jsx("div",{className:"max-h-52 overflow-y-auto space-y-1 border rounded-lg p-2",children:m.map(B=>s.jsxs("div",{className:"flex items-center gap-2 p-2 rounded hover:bg-accent cursor-pointer text-sm",onClick:()=>P(B.id),children:[s.jsx("input",{type:"checkbox",checked:y.has(B.id),readOnly:!0,className:"h-4 w-4"}),s.jsx("span",{className:"flex-1",children:B.product_name}),s.jsx(Be,{variant:"outline",className:"text-[10px]",children:B.supplier_name}),s.jsxs("span",{className:"font-medium",children:["£",(B.awarded_quantity*B.awarded_price).toFixed(2)]})]},B.id))})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"PO Details"}),s.jsx(se,{placeholder:"Delivery Address",value:w,onChange:B=>S(B.target.value)}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(se,{type:"date",placeholder:"Expected Delivery",value:j,onChange:B=>_(B.target.value)}),s.jsx(se,{placeholder:"Payment Terms",value:N,onChange:B=>k(B.target.value)})]}),s.jsx(yr,{placeholder:"Notes",value:O,onChange:B=>E(B.target.value),rows:2})]}),s.jsxs(W,{className:"w-full",onClick:D,disabled:y.size===0||A,children:[A?s.jsx(Ze,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(ec,{className:"mr-2 h-4 w-4"}),"Generate PO",y.size>0?` (${y.size} items)`:""]})]})})]})}),s.jsx(gr,{open:!!f,onOpenChange:B=>{B||h(null)},children:s.jsxs(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsx(vr,{children:s.jsxs(ar,{children:["Purchase Order ",f==null?void 0:f.po_number]})}
672),f&&s.jsxs("div",{className:"space-y-4 mt-2",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Supplier:"})," ",(q=f.suppliers)==null?void 0:q.name]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Total:"})," ",s.jsxs("span",{className:"font-bold",children:["£",f.total_value.toFixed(2)]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Status:"})," ",s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${Qr[f.status]}`,children:f.status.replace(/_/g," ")})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Expected:"})," ",f.expected_delivery_date?pr(new Date(f.expected_delivery_date),"dd MMM yyyy"):"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Payment:"})," ",f.payment_terms||"—"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Delivery:"})," ",f.delivery_address||"—"]})]}),f.notes&&s.jsx("p",{className:"text-sm text-muted-foreground italic",children:f.notes}),s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{children:"Product"}),s.jsx(te,{children:"Qty"}),s.jsx(te,{children:"Unit Price"}),s.jsx(te,{children:"Total"})]})}),s.jsx(Kt,{children:p.map(B=>s.jsxs(De,{children:[s.jsx(ee,{className:"font-medium text-sm",children:B.product_name}),s.jsx(ee,{children:B.quantity}),s.jsxs(ee,{children:["£",B.unit_price.toFixed(2)]}),s.jsxs(ee,{className:"font-bold",children:["£",B.total_price.toFixed(2)]})]},B.id))})]}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[f.status==="draft"&&s.jsxs(W,{className:"flex-1",onClick:()=>$(f.id,"pending_approval"),children:[s.jsx(qN,{className:"mr-2 h-4 w-4"})," Submit for Approval"]}),f.status==="pending_approval"&&z(f)&&s.jsxs(W,{className:"flex-1",onClick:()=>$(f.id,"approved"),children:[s.jsx(Ql,{className:"mr-2 h-4 w-4"})," Approve"]}),f.status==="approved"&&s.jsxs(W,{className:"flex-1",onClick:()=>$(f.id,"sent"),children:[s.jsx(Zl,{className:"mr-2 h-4 w-4"})," Send to Supplier"]})]})]})]})})]})},d_e=()=>s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Procurement & Suppliers"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage your supplier network, quotations, and purchase orders — powered by Trust n Trade"})]}),s.jsxs(vI,{defaultValue:"suppliers",className:"space-y-4",children:[s.jsxs(Mj,{className:"grid w-full grid-cols-4 lg:w-auto lg:inline-grid",children:[s.jsxs(Ds,{value:"suppliers",className:"gap-1.5",children:[s.jsx(Oa,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Suppliers"})]}),s.jsxs(Ds,{value:"rfqs",className:"gap-1.5",children:[s.jsx(Qs,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"RFQs"})]}),s.jsxs(Ds,{value:"quotes",className:"gap-1.5",children:[s.jsx(j$,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Quotes"})]}),s.jsxs(Ds,{value:"purchase-orders",className:"gap-1.5",children:[s.jsx(ec,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Purchase Orders"})]})]}),s.jsx(Ls,{value:"suppliers",children:s.jsx(o_e,{})}),s.jsx(Ls,{value:"rfqs",children:s.jsx(l_e,{})}),s.jsx(Ls,{value:"quotes",children:s.jsx(c_e,{})}),s.jsx(Ls,{value:"purchase-orders",children:s.jsx(u_e,{})})]})]}),ZP={expected:"bg-blue-100 text-blue-700",in_transit:"bg-indigo-100 text-indigo-700",received:"bg-emerald-100 text-emerald-700",partial:"bg-amber-100 text-amber-700",discrepancy:"bg-red-100 text-red-700"},f_e=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(""),[o,l]=b.useState("all"),[c,u]=b.useState(!1),d=async()=>{const{data:v}=await V.from("deliveries_inward").select("*").order("created_at",{ascending:!1});t(v||[]),n(!1)};b.useEffect(()=>{d()},[]);const f=async v=>{v.preventDefault();const m=new FormData(v.currentTarget),{error:g}=await V.from("deliveries_inward").insert({supplier_name:m.get("supplier_name"),expected_date:m.get("expected_date")||null,
672notes:m.get("notes")||null,items:JSON.parse(m.get("items")||"[]")});if(g){X.error(g.message);return}X.success("Delivery created"),u(!1),d()},h=async(v,m)=>{const g={status:m};m==="received"&&(g.received_date=new Date().toISOString().split("T")[0]);const{error:y}=await V.from("deliveries_inward").update(g).eq("id",v);if(y){X.error(y.message);return}X.success(`Status updated to ${m}`),d()},p=e.filter(v=>o!=="all"&&v.status!==o?!1:v.supplier_name.toLowerCase().includes(a.toLowerCase()));return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Inward Deliveries"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Track supplier deliveries and stock receipts"})]}),s.jsxs(gr,{open:c,onOpenChange:u,children:[s.jsx(Wc,{asChild:!0,children:s.jsxs(W,{children:[s.jsx(Or,{className:"mr-2 h-4 w-4"})," Record Delivery"]})}),s.jsxs(nr,{children:[s.jsx(vr,{children:s.jsx(ar,{children:"Record Expected Delivery"})}),s.jsxs("form",{onSubmit:f,className:"space-y-4 mt-2",children:[s.jsx(se,{name:"supplier_name",placeholder:"Supplier name *",required:!0}),s.jsx(se,{name:"expected_date",type:"date",placeholder:"Expected date"}),s.jsx(yr,{name:"items",placeholder:'Items JSON e.g. [{"name":"Rice","qty":50}]',defaultValue:"[]"}),s.jsx(yr,{name:"notes",placeholder:"Notes"}),s.jsx(W,{type:"submit",className:"w-full",children:"Create"})]})]})]})]}),s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsxs("div",{className:"relative flex-1 max-w-sm",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search…",value:a,onChange:v=>i(v.target.value),className:"pl-9"})]}),s.jsxs(Tt,{value:o,onValueChange:l,children:[s.jsx(kt,{className:"w-40",children:s.jsx($t,{})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"all",children:"All Status"}),s.jsx(xe,{value:"expected",children:"Expected"}),s.jsx(xe,{value:"in_transit",children:"In Transit"}),s.jsx(xe,{value:"received",children:"Received"}),s.jsx(xe,{value:"partial",children:"Partial"}),s.jsx(xe,{value:"discrepancy",children:"Discrepancy"})]})]}),s.jsxs(Be,{variant:"secondary",children:[p.length," delivery",p.length!==1?"ies":"y"]})]}),r?s.jsx("div",{className:"flex justify-center py-20",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):p.length===0?s.jsx(le,{children:s.jsxs(ce,{className:"py-16 text-center",children:[s.jsx(rj,{className:"h-10 w-10 mx-auto text-muted-foreground/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No deliveries found"})]})}):s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{children:"Supplier"}),s.jsx(te,{children:"Expected"}),s.jsx(te,{children:"Received"}),s.jsx(te,{children:"Status"}),s.jsx(te,{className:"hidden md:table-cell",children:"Notes"}),s.jsx(te,{className:"text-right",children:"Update"})]})}),s.jsx(Kt,{children:p.map(v=>s.jsxs(De,{className:v.discrepancies?"bg-destructive/5":"",children:[s.jsx(ee,{className:"font-medium",children:v.supplier_name}),s.jsx(ee,{className:"text-sm",children:v.expected_date||"—"}),s.jsx(ee,{className:"text-sm",children:v.received_date||"—"}),s.jsx(ee,{children:s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${ZP[v.status]||"bg-muted"}`,children:v.status.replace("_"," ")})}),s.jsxs(ee,{className:"hidden md:table-cell text-xs text-muted-foreground max-w-[200px] truncate",children:[v.discrepancies&&s.jsxs("span",{className:"text-destructive flex items-center gap-1",children:[s.jsx(so,{className:"h-3 w-3"}),v.discrepancies]}),!v.discrepancies&&(v.notes||"—")]}),s.jsx(ee,{className:"text-right",children:s.jsxs(Tt,{value:v.status,onValueChange:m=>h(v.id,m),children:[s.jsx(kt,{className:"w-28 h-7 text-xs",children:s.jsx($t,{})}),s.jsx(Ot,{children:Object.keys(ZP).map(m=>s.jsx(xe,{value:m,children:m.replace("_"," ")},m))})]})})]},v.id))})]})})})]})},Ix={pending:"bg-amber-100 text-amber-700",packed:"bg-blue-100 text-blue-700",dispatched:"bg-indigo-100 text-indigo-700",delivered:"bg-emerald-100 text-emerald-700",failed:"bg-red-100 text-red-700",collection:"bg-purple-100 text-purple-700"},h_e=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(""),[o,l]=b.useState("all"),c=async()=>{const{data:f}=await V.from("deliveries_outward").select("*").order("created_at",{ascending:!1});t(f||[]),n(!1)};b.useEffect(()=>{c()},[]);const u=async(f,h)=>{const p={status:h};h==="dispatched"&&(p.dispatched_at=new Date().toISOString()),h==="delivered"&&(p.delivered_at=new Date().toISOString());const{error:v}=await V.from("deliveries_outward").update(p).eq("id",f);if(v){X.error(v.message);return}X.success(`Delivery marked as ${h}`),c()},d=e.filter(f=>o!=="all"&&f.status!==o?!1:f.customer_name.toLowerCase().includes(a.toLowerCase())||(f.order_number||"").toLowerCase().includes(a.toLowerCase()));return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Outward Deliveries"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Track customer deliveries and dispatch"})]}),s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsxs("div",{className:"relative flex-1 max-w-sm",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search customer or order…",value:a,onChange:f=>i(f.target.value),className:"pl-9"})]}),s.jsxs(Tt,{value:o,onValueChange:l,children:[s.jsx(kt,{className:"w-36",children:s.jsx($t,{})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"all",children:"All Status"}),Object.keys(Ix).map(f=>s.jsx(xe,{value:f,children:f},f))]})]}),s.jsxs(Be,{variant:"secondary",children:[d.length," delivery",d.length!==1?"ies":"y"]})]}),r?s.jsx("div",{className:"flex justify-center py-20",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):d.length===0?s.jsx(le,{children:s.jsxs(ce,{className:"py-16 text-center",children:[s.jsx(Oa,{className:"h-10 w-10 mx-auto text-muted-foreground
672/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No outward deliveries found"}),s.jsx("p",{className:"text-xs text-muted-foreground/70 mt-1",children:"Deliveries are created when orders are processed"})]})}):s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{children:"Customer"}),s.jsx(te,{children:"Order"}),s.jsx(te,{children:"Type"}),s.jsx(te,{children:"Status"}),s.jsx(te,{className:"hidden md:table-cell",children:"Driver"}),s.jsx(te,{className:"hidden lg:table-cell",children:"Tracking"}),s.jsx(te,{className:"text-right",children:"Update"})]})}),s.jsx(Kt,{children:d.map(f=>s.jsxs(De,{children:[s.jsx(ee,{children:s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:f.customer_name}),f.delivery_address&&s.jsx("p",{className:"text-xs text-muted-foreground truncate max-w-[180px]",children:f.delivery_address})]})}),s.jsx(ee,{className:"font-mono text-xs",children:f.order_number||"—"}),s.jsx(ee,{children:s.jsx(Be,{variant:"outline",className:"text-xs capitalize",children:f.delivery_type})}),s.jsx(ee,{children:s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${Ix[f.status]||"bg-muted"}`,children:f.status})}),s.jsx(ee,{className:"hidden md:table-cell text-sm",children:f.driver_name||"—"}),s.jsx(ee,{className:"hidden lg:table-cell text-xs font-mono",children:f.tracking_ref||"—"}),s.jsx(ee,{className:"text-right",children:s.jsxs(Tt,{value:f.status,onValueChange:h=>u(f.id,h),children:[s.jsx(kt,{className:"w-28 h-7 text-xs",children:s.jsx($t,{})}),s.jsx(Ot,{children:Object.keys(Ix).map(h=>s.jsx(xe,{value:h,children:h},h))})]})})]},f.id))})]})})})]})},ku={new:{color:"bg-blue-100 text-blue-700",icon:zN},open:{color:"bg-amber-100 text-amber-700",icon:ei},pending:{color:"bg-purple-100 text-purple-700",icon:ei},resolved:{color:"bg-emerald-100 text-emerald-700",icon:q0},escalated:{color:"bg-red-100 text-red-700",icon:zN}},p_e={low:"bg-muted text-muted-foreground",normal:"bg-blue-50 text-blue-600",high:"bg-amber-50 text-amber-600",urgent:"bg-red-50 text-red-600"},m_e=()=>{var N;const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(""),[o,l]=b.useState("all"),[c,u]=b.useState(null),[d,f]=b.useState([]),[h,p]=b.useState(""),[v,m]=b.useState(!1),{user:g}=ir(),y=async()=>{const{data:k}=await V.from("support_tickets").select("*").order("created_at",{ascending:!1});t(k||[]),n(!1)},x=async k=>{const{data:O}=await V.from("support_messages").select("*").eq("ticket_id",k).order("created_at");f(O||[])};b.useEffect(()=>{y()},[]);const w=async k=>{u(k),await x(k.id)},S=async()=>{var O;if(!h.trim()||!c)return;const{error:k}=await V.from("support_messages").insert({ticket_id:c.id,sender_id:g==null?void 0:g.id,sender_name:((O=g==null?void 0:g.email)==null?void 0:O.split("@")[0])||"Staff",sender_type:"staff",message:h,is_internal:v});if(k){X.error(k.message);return}c.status==="new"&&await V.from("support_tickets").update({status:"open"}).eq("id",c.id),X.success(v?"Internal note added":"Reply sent"),p(""),m(!1),x(c.id),y()},j=async(k,O)=>{const E={status:O};O==="resolved"&&(E.resolved_at=new Date().toISOString()),await V.from("support_tickets").update(E).eq("id",k),X.success(`Ticket ${O}`),y(),(c==null?void 0:c.id)===k&&u({...c,status:O})},_=e.filter(k=>o!=="all"&&k.status!==o?!1:k.subject.toLowerCase().includes(a.toLowerCase())||k.customer_name.toLowerCase().includes(a.toLowerCase())||k.ticket_number.toLowerCase().includes(a.toLowerCase()));return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"font-display text-2xl md:text-3xl font-bold",children:"Support Tickets"}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[e.filter(k=>k.status==="new").length," new ticket",e.filter(k=>k.status==="new").length!==1?"s":""]})]}),s.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[s.jsxs("div",{className:"relative flex-1 max-w-sm",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search tickets…",value:a,onChange:k=>i(k.target.value),className:"pl-9"})]}),s.jsxs(Tt,{value:o,onValueChange:l,children:[s.jsx(kt,{className:"w-36",children:s.jsx($t,{})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"all",children:"All Status"}),Object.keys(ku).map(k=>s.jsx(xe,{value:k,children:k},k))]})]}),s.jsxs(Be,{variant:"secondary",children:[_.length," ticket",_.length!==1?"s":""]})]}),r?s.jsx("div",{className:"flex justify-center py-20",children:s.jsx(Ze,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):_.length===0?s.jsx(le,{children:s.jsxs(ce,{className:"py-16 text-center",children:[s.jsx(b$,{className:"h-10 w-10 mx-auto text-muted-foreground
672/30 mb-3"}),s.jsx("p",{className:"font-medium text-muted-foreground",children:"No support tickets"})]})}):s.jsx("div",{className:"space-y-3",children:_.map(k=>{const O=ku[k.status]||ku.new,E=O.icon;return s.jsx(le,{className:`cursor-pointer transition-all hover:shadow-sm ${k.status==="new"?"border-primary/30":""}`,onClick:()=>w(k),children:s.jsx(ce,{className:"p-4",children:s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[s.jsx("div",{className:"h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center shrink-0 mt-0.5",children:s.jsx(E,{className:"h-4 w-4 text-primary"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:k.ticket_number}),s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${O.color}`,children:k.status}),s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${p_e[k.priority]}`,children:k.priority})]}),s.jsx("h3",{className:"font-semibold text-sm mt-1",children:k.subject}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[k.customer_name," ",k.customer_email&&`· ${k.customer_email}`]})]})]}),s.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[s.jsx("span",{className:"text-[11px] text-muted-foreground",children:new Date(k.created_at).toLocaleDateString()}),s.jsx(Be,{variant:"outline",className:"text-[10px]",children:k.category})]})]})})},k.id)})}),s.jsx(gr,{open:!!c,onOpenChange:k=>{k||(u(null),f([]))},children:s.jsx(nr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:c&&s.jsxs(s.Fragment,{children:[s.jsxs(vr,{children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:c.ticket_number}),s.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-medium capitalize ${(N=ku[c.status])==null?void 0:N.color}`,children:c.status})]}),s.jsx(ar,{className:"text-lg",children:c.subject}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[c.customer_name," · ",c.customer_email||"No email"," · ",c.category]})]}),s.jsx("div",{className:"flex gap-2 mb-4",children:Object.keys(ku).map(k=>s.jsx(W,{size:"sm",variant:c.status===k?"default":"outline",className:"h-7 text-xs capitalize",onClick:O=>{O.stopPropagation(),j(c.id,k)},children:k},k))}),s.jsx("div",{className:"space-y-3 mb-4",children:d.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-6",children:"No messages yet. Send a reply below."}):d.map(k=>s.jsxs("div",{className:`p-3 rounded-lg ${k.sender_type==="staff"?k.is_internal?"bg-amber-50 border border-amber-200":"bg-secondary/5 border border-secondary/20":"bg-muted/50"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("span",{className:"text-xs font-medium",children:k.sender_name}),s.jsxs(Be,{variant:"outline",className:"text-[9px] h-4",children:[k.sender_type,k.is_internal?" · internal":""]}),s.jsx("span",{className:"text-[10px] text-muted-foreground ml-auto",children:new Date(k.created_at).toLocaleString()})]}),s.jsx("p",{className:"text-sm text-foreground/80",children:k.message})]},k.id))}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx(yr,{value:h,onChange:k=>p(k.target.value),placeholder:"Type your reply…",rows:3}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("label",{className:"flex items-center gap-2 text-xs",children:[s.jsx("input",{type:"checkbox",checked:v,onChange:k=>m(k.target.checked),className:"rounded"}),"Internal note (not visible to customer)"]}),s.jsxs(W,{size:"sm",onClick:S,disabled:!h.trim(),children:[s.jsx(Zl,{className:"mr-2 h-3 w-3"})," ",v?"Add Note":"Send Reply"]})]})]})]})})})]})};var ny="Switch",[g_e,ZNe]=Br(ny),[v_e,y_e]=g_e(ny),q3=b.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,p]=b.useState(null),v=Me(t,w=>p(w)),m=b.useRef(!1),g=h?d||!!h.closest("form"):!0,[y,x]=nn({prop:a,defaultProp:i??!1,onChange:u,caller:ny});return s.jsxs(v_e,{scope:r,checked:y,disabled:l,children:[s.jsx(ye.button,{type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":K3(y),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:v,onClick:oe(e.onClick,w=>{x(S=>!S),g&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})}),g&&s.jsx(V3,{control:h,bubbles:!m.current,name:n,value:c,checked:y,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});q3.displayName=ny;var W3="SwitchThumb",H3=b.forwardRef((e,t)=>
672{const{__scopeSwitch:r,...n}=e,a=y_e(W3,r);return s.jsx(ye.span,{"data-state":K3(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});H3.displayName=W3;var x_e="SwitchBubbleInput",V3=b.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...a},i)=>{const o=b.useRef(null),l=Me(o,i),c=Tj(r),u=gj(t);return b.useEffect(()=>{const d=o.current;if(!d)return;const f=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==r&&p){const v=new Event("click",{bubbles:n});p.call(d,r),d.dispatchEvent(v)}},[c,r,n]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:l,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});V3.displayName=x_e;function K3(e){return e?"checked":"unchecked"}var G3=q3,b_e=H3;const lg=b.forwardRef(({className:e,...t},r)=>s.jsx(G3,{className:ne("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:r,children:s.jsx(b_e,{className:ne("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));lg.displayName=G3.displayName;const w_e=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(""),[o,l]=b.useState(!1),[c,u]=b.useState(null),d=async()=>{n(!0);const{data:g,error:y}=await V.from("promotions").select("*").order("created_at",{ascending:!1});y?X.error(y.message):t(g||[]),n(!1)};b.useEffect(()=>{d()},[]);const f=async g=>{g.preventDefault();const y=new FormData(g.currentTarget),x={name:y.get("name"),description:y.get("description")||null,promo_code:y.get("promo_code")||null,discount_type:y.get("discount_type"),discount_value:parseFloat(y.get("discount_value"))||0,min_order_value:y.get("min_order_value")?parseFloat(y.get("min_order_value")):null,max_uses:y.get("max_uses")?parseInt(y.get("max_uses")):null,starts_at:y.get("starts_at")||null,ends_at:y.get("ends_at")||null,is_active:y.get("is_active")==="on"};if(c){const{error:w}=await V.from("promotions").update(x).eq("id",c.id);if(w)return X.error(w.message);X.success("Promotion updated")}else{const{error:w}=await V.from("promotions").insert(x);if(w)return X.error(w.message);X.success("Promotion created")}l(!1),u(null),d()},h=async g=>{const{error:y}=await V.from("promotions").delete().eq("id",g);if(y)return X.error(y.message);X.success("Promotion deleted"),d()},p=async g=>{const{error:y}=await V.from("promotions").update({is_active:!g.is_active}).eq("id",g.id);if(y)return X.error(y.message);d()},v=e.filter(g=>g.name.toLowerCase().includes(a.toLowerCase())||(g.promo_code||"").toLowerCase().includes(a.toLowerCase())),m=g=>{u(g),l(!0)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-display font-bold text-foreground",children:"Promotions"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage discount codes and campaigns"})]}),s.jsxs(gr,{open:o,onOpenChange:g=>{l(g),g||u(null)},children:[s.jsx(Wc,{asChild:!0,children:s.jsxs(W,{children:[s.jsx(Or,{className:"mr-2 h-4 w-4"}),"Create Promotion"]})}),s.jsxs(nr,{className:"max-w-lg max-h-[85vh] overflow-y-auto",children:[s.jsx(vr,{children:s.jsx(ar,{children:c?"Edit Promotion":"New Promotion"})}),s.jsxs("form",{onSubmit:f,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"name",children:"Name *"}),s.jsx(se,{id:"name",name:"name",required:!0,defaultValue:(c==null?void 0:c.name)||""})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"description",children:"Description"}),s.jsx(yr,{id:"description",name:"description",defaultValue:(c==null?void 0:c.description)||""})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"promo_code",children:"Promo Code"}),s.jsx(se,{id:"promo_code",name:"promo_code",placeholder:"e.g. SAVE20",defaultValue:(c==null?void 0:c.promo_code)||""})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"discount_type",children:"Discount Type"}),s.jsxs(Tt,{name:"discount_type",defaultValue:(c==null?void 0:c.discount_type)||"percentage",children:[s.jsx(kt,{children:s.jsx($t,{})}),s.jsxs(Ot,{children:[s.jsx(xe,{value:"percentage",children:"Percentage (%)"}),s.jsx(xe,{value:"fixed",children:"Fixed Amount (£)"})]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"discount_value",children:"Discount Value *"}),s.jsx(se,{id:"discount_value",name:"discount_value",type:"number",step:"0.01",required:!0,defaultValue:(c==null?void 0:c.discount_value)||""})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"min_order_value",children:"Min Order (£)"}),s.jsx(se,{id:"min_order_value",name:"min_order_value",type:"number",step:"0.01",defaultValue:(c==null?void 0:c.min_order_value)||""})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"max_uses",children:"Max Uses"}),s.jsx(se,{id:"max_uses",name:"max_uses",type:"number",defaultValue:(c==null?void 0:c.max_uses)||""})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"starts_at",children:"Start Date"}),s.jsx(se,{id:"starts_at",name:"starts_at",type:"datetime-local",defaultValue:c!=null&&c.starts_at?c.starts_at.slice(0,16):""})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"ends_at",children:"End Date"}),s.jsx(se,{id:"ends_at",name:"ends_at",type:"datetime-local",defaultValue:c!=null&&c.ends_at?c.ends_at.slice(0,16):""})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(lg,{id:"is_active",name:"is_active",defaultChecked:c?c.is_active:!0}),s.jsx(Oe,{htmlFor:"is_active",children:"Active"})]}),s.jsxs(W,{type:"submit",className:"w-full",children:[c?"Update":"Create"," Promotion"]})]})]})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative flex-1 max-w-sm",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search promotions...",value:a,onChange:g=>i(g.target.value),className:"pl-9"})]}),s.jsxs(Be,{variant:"secondary",children:[v.length," promotion",v.length!==1?"s":""]})]}),s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:r?s.jsx("div",{className:"flex justify-center py-12",children:s.jsx("div",{className:"animate-spin h-8 w-8 border-4 border-primary border-t-transparent roun
672ded-full"})}):v.length===0?s.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[s.jsx(S$,{className:"mx-auto h-10 w-10 mb-2 opacity-40"}),s.jsx("p",{children:"No promotions found"})]}):s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{children:"Name"}),s.jsx(te,{children:"Code"}),s.jsx(te,{children:"Discount"}),s.jsx(te,{children:"Schedule"}),s.jsx(te,{children:"Usage"}),s.jsx(te,{children:"Status"}),s.jsx(te,{className:"text-right",children:"Actions"})]})}),s.jsx(Kt,{children:v.map(g=>s.jsxs(De,{children:[s.jsx(ee,{className:"font-medium",children:g.name}),s.jsx(ee,{children:g.promo_code?s.jsx(Be,{variant:"outline",className:"font-mono text-xs",children:g.promo_code}):s.jsx("span",{className:"text-muted-foreground text-xs",children:"—"})}),s.jsx(ee,{children:s.jsxs("span",{className:"flex items-center gap-1",children:[g.discount_type==="percentage"?s.jsx(Jz,{className:"h-3 w-3"}):s.jsx(Lz,{className:"h-3 w-3"}),g.discount_value,g.discount_type==="percentage"?"%":""]})}),s.jsxs(ee,{className:"text-xs text-muted-foreground",children:[g.starts_at?pr(new Date(g.starts_at),"dd MMM yy"):"—"," → ",g.ends_at?pr(new Date(g.ends_at),"dd MMM yy"):"∞"]}),s.jsxs(ee,{className:"text-xs",children:[g.used_count,g.max_uses?` / ${g.max_uses}`:""]}),s.jsx(ee,{children:s.jsx(lg,{checked:g.is_active,onCheckedChange:()=>p(g)})}),s.jsxs(ee,{className:"text-right space-x-1",children:[s.jsx(W,{variant:"ghost",size:"icon",onClick:()=>m(g),children:s.jsx(nj,{className:"h-4 w-4"})}),s.jsx(W,{variant:"ghost",size:"icon",onClick:()=>
672h(g.id),children:s.jsx(xa,{className:"h-4 w-4 text-destructive"})})]})]},g.id))})]})})})]})},e2={hero:"Hero",sidebar:"Sidebar",category:"Category Page",popup:"Pop-up"},j_e=()=>{const[e,t]=b.useState([]),[r,n]=b.useState(!0),[a,i]=b.useState(""),[o,l]=b.useState(!1),[c,u]=b.useState(null),d=async()=>{n(!0);const{data:g,error:y}=await V.from("banners").select("*").order("display_order",{ascending:!0});y?X.error(y.message):t(g||[]),n(!1)};b.useEffect(()=>{d()},[]);const f=async g=>{g.preventDefault();const y=new FormData(g.currentTarget),x={title:y.get("title"),subtitle:y.get("subtitle")||null,image_url:y.get("image_url")||null,link_url:y.get("link_url")||null,position:y.get("position"),display_order:parseInt(y.get("display_order"))||0,starts_at:y.get("starts_at")||null,ends_at:y.get("ends_at")||null,is_active:y.get("is_active")==="on"};if(c){const{error:w}=await V.from("banners").update(x).eq("id",c.id);if(w)return X.error(w.message);X.success("Banner updated")}else{const{error:w}=await V.from("banners").insert(x);if(w)return X.error(w.message);X.success("Banner created")}l(!1),u(null),d()},h=async g=>{const{error:y}=await V.from("banners").delete().eq("id",g);if(y)return X.error(y.message);X.success("Banner deleted"),d()},p=async g=>{const{error:y}=await V.from("banners").update({is_active:!g.is_active}).eq("id",g.id);if(y)return X.error(y.message);d()},v=e.filter(g=>g.title.toLowerCase().includes(a.toLowerCase())),m=g=>{u(g),l(!0)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-display font-bold text-foreground",children:"Banners"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Manage homepage and promotional banners"})]}),s.jsxs(gr,{open:o,onOpenChange:g=>{l(g),g||u(null)},children:[s.jsx(Wc,{asChild:!0,children:s.jsxs(W,{children:[s.jsx(Or,{className:"mr-2 h-4 w-4"}),"Add Banner"]})}),s.jsxs(nr,{className:"max-w-lg max-h-[85vh] overflow-y-auto",children:[s.jsx(vr,{children:s.jsx(ar,{children:c?"Edit Banner":"New Banner"})}),s.jsxs("form",{onSubmit:f,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"title",children:"Title *"}),s.jsx(se,{id:"title",name:"title",required:!0,defaultValue:(c==null?void 0:c.title)||""})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"subtitle",children:"Subtitle"}),s.jsx(se,{id:"subtitle",name:"subtitle",defaultValue:(c==null?void 0:c.subtitle)||""})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"image_url",children:"Image URL"}),s.jsx(se,{id:"image_url",name:"image_url",type:"url",placeholder:"https://...",defaultValue:(c==null?void 0:c.image_url)||""})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"link_url",children:"Link URL"}),s.jsx(se,{id:"link_url",name:"link_url",type:"url",placeholder:"https://...",defaultValue:(c==null?void 0:c.link_url)||""})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"position",children:"Position"}),s.jsxs(Tt,{name:"position",defaultValue:(c==null?void 0:c.position)||"hero",children:[s.jsx(kt,{children:s.jsx($t,{})}),s.jsx(Ot,{children:Object.entries(e2).map(([g,y])=>s.jsx(xe,{value:g,children:y},g))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"display_order",children:"Display Order"}),s.jsx(se,{id:"display_order",name:"display_order",type:"number",defaultValue:(c==null?void 0:c.display_order)??0})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"starts_at",children:"Start Date"}),s.jsx(se,{id:"starts_at",name:"starts_at",type:"datetime-local",defaultValue:c!=null&&c.starts_at?c.starts_at.slice(0,16):""})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Oe,{htmlFor:"ends_at",children:"End Date"}),s.jsx(se,{id:"ends_at",name:"ends_at",type:"datetime-local",defaultValue:c!=null&&c.ends_at?c.ends_at.slice(0,16):""})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(lg,{id:"is_active",name:"is_active",defaultChecked:c?c.is_active:!0}),s.jsx(Oe,{htmlFor:"is_active",children:"Active"})]}),s.jsxs(W,{type:"submit",className:"w-full",children:[c?"Update":"Create"," Banner"]})]})]})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative flex-1 max-w-sm",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search banners...",value:a,onChange:g=>i(g.target.value),className:"pl-9"})]}),s.jsxs(Be,{variant:"secondary",children:[v.length," banner",v.length!==1?"s":""]})]}),s.jsx(le,{children:s.jsx(ce,{className:"p-0",children:r?s.jsx("div",{className:"flex justify-center py-12",children:s.jsx("div",{className:"animate-spin h-8 w-8 border-4 border-primary border-t-transparent roun
672ded-full"})}):v.length===0?s.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[s.jsx(x$,{className:"mx-auto h-10 w-10 mb-2 opacity-40"}),s.jsx("p",{children:"No banners found"})]}):s.jsxs(Ht,{children:[s.jsx(Vt,{children:s.jsxs(De,{children:[s.jsx(te,{className:"w-10",children:"#"}),s.jsx(te,{children:"Title"}),s.jsx(te,{children:"Position"}),s.jsx(te,{children:"Schedule"}),s.jsx(te,{children:"Preview"}),s.jsx(te,{children:"Status"}),s.jsx(te,{className:"text-right",children:"Actions"})]})}),s.jsx(Kt,{children:v.map(g=>s.jsxs(De,{children:[s.jsxs(ee,{className:"text-muted-foreground",children:[s.jsx(Hz,{className:"h-4 w-4 inline-block"})," ",g.display_order]}),s.jsx(ee,{children:s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:g.title}),g.subtitle&&s.jsx("p",{className:"text-xs text-muted-foreground",children:g.subtitle})]})}),s.jsx(ee,{children:s.jsx(Be,{variant:"outline",children:e2[g.position]||g.position})}),s.jsxs(ee,{className:"text-xs text-muted-foreground",children:[g.starts_at?pr(new Date(g.starts_at),"dd MMM yy"):"—"," → ",g.ends_at?pr(new Date(g.ends_at),"dd MMM yy"):"∞"]}),s.jsx(ee,{children:g.image_url?s.jsx("img",{src:g.image_url,alt:g.title,className:"h-8 w-14 object-cover rounded border border-border"}):s.jsx("span",{className:"text-xs text-muted-foreground",children:"No image"})}),s.jsx(ee,{children:s.jsxs(W,{variant:"ghost",size:"sm",className:"gap-1 px-2",onClick:()=>p(g),children:[g.is_active?s.jsx(Mf,{className:"h-4 w-4 text-secondary"}):s.jsx(Fz,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"text-xs",children:g.is_active?"Live":"Off"})]})}),s.jsxs(ee,{className:"text-right space-x-1",children:[s.jsx(W,{variant:"ghost",size:"icon",onClick:()=>m(g),children:s.jsx(nj,{className:"h-4 w-4"})}),s.jsx(W,{variant:"ghost",size:"icon",onClick:()=>
vendor: 16,569 bytes, line 672
672h(g.id),children:s.jsx(xa,{className:"h-4 w-4 text-destructive"})})]})]},g.id))})]})})})]})};var Kw=["Enter"," "],S_e=["ArrowDown","PageUp","Home"],Y3=["ArrowUp","PageDown","End"],__e=[...S_e,...Y3],N_e={ltr:[...Kw,"ArrowRight"],rtl:[...Kw,"ArrowLeft"]},k_e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Xf="Menu",[Sf,O_e,C_e]=Tf(Xf),[Oo,X3]=Br(Xf,[C_e,Bc,nv]),ay=Bc(),Q3=nv(),[E_e,Co]=Oo(Xf),[P_e,Qf]=Oo(Xf),J3=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:i,modal:o=!0}=e,l=ay(t),[c,u]=b.useState(null),d=b.useRef(!1),f=Fr(i),h=Ff(a);return b.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),s.jsx(xj,{...l,children:s.jsx(E_e,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:u,children:s.jsx(P_e,{scope:t,onClose:b.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:n})})})};J3.displayName=Xf;var A_e="MenuAnchor",QS=b.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=ay(r);return s.jsx(bj,{...a,...n,ref:t})});QS.displayName=A_e;var JS="MenuPortal",[T_e,Z3]=Oo(JS,{forceMount:void 0}),e5=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:a}=e,i=Co(JS,t);return s.jsx(T_e,{scope:t,forceMount:r,children:s.jsx(ln,{present:r||i.open,children:s.jsx($f,{asChild:!0,container:a,children:n})})})};e5.displayName=JS;var Sn="MenuContent",[$_e,ZS]=Oo(Sn),t5=b.forwardRef((e,t)=>{const r=Z3(Sn,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=Co(Sn,e.__scopeMenu),o=Qf(Sn,e.__scopeMenu);return s.jsx(Sf.Provider,{scope:e.__scopeMenu,children:s.jsx(ln,{present:n||i.open,children:s.jsx(Sf.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(R_e,{...a,ref:t}):s.jsx(M_e,{...a,ref:t})})})})}),R_e=b.forwardRef((e,t)=>{const r=Co(Sn,e.__scopeMenu),n=b.useRef(null),a=Me(t,n);return b.useEffect(()=>{const i=n.current;if(i)return Oj(i)},[]),s.jsx(e_,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:oe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),M_e=b.forwardRef((e,t)=>{const r=Co(Sn,e.__scopeMenu);return s.jsx(e_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),I_e=io("MenuContent.ScrollLock"),e_=b.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:v,...m}=e,g=Co(Sn,r),y=Qf(Sn,r),x=ay(r),w=Q3(r),S=O_e(r),[j,_]=b.useState(null),N=b.useRef(null),k=Me(t,N,g.onContentChange),O=b.useRef(0),E=b.useRef(""),A=b.useRef(0),R=b.useRef(null),T=b.useRef("right"),I=b.useRef(0),F=v?Kg:b.Fragment,P=v?{as:I_e,allowPinchZoom:!0}:void 0,D=$=>{var Q,me;const z=E.current+$,K=S().filter(L=>!L.disabled),q=document.activeElement,B=(Q=K.find(L=>L.ref.current===q))==null?void 0:Q.textValue,Z=K.map(L=>L.textValue),he=G_e(Z,z,B),pe=(me=K.find(L=>L.textValue===he))==null?void 0:me.ref.current;(function L(Y){E.current=Y,window.clearTimeout(O.current),Y!==""&&(O.current=window.setTimeout(()=>L(""),1e3))})(z),pe&&setTimeout(()=>pe.focus())};b.useEffect(()=>()=>window.clearTimeout(O.current),[]),kj();const M=b.useCallback($=>{var K,q;return T.current===((K=R.current)==null?void 0:K.side)&&X_e($,(q=R.current)==null?void 0:q.area)},[]);return s.jsx($_e,{scope:r,searchRef:E,onItemEnter:b.useCallback($=>{M($)&&$.preventDefault()},[M]),onItemLeave:b.useCallback($=>{var z;M($)||((z=N.current)==null||z.focus(),_(null))},[M]),onTriggerLeave:b.useCallback($=>{M($)&&$.preventDefault()},[M]),pointerGraceTimerRef:A,onPointerGraceIntentChange:b.useCallback($=>{R.current=$},[]),children:s.jsx(F,{...P,children:s.jsx(Hg,{asChild:!0,trapped:a,onMountAutoFocus:oe(i,$=>{var z;$.preventDefault(),(z=N.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx($c,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:s.jsx(rI,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:n,currentTabStopId:j,onCurrentTabStopIdChange:_,onEntryFocus:oe(c,$=>{y.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(wj,{role:"menu","aria-orientation":"vertical","data-state":v5(g.open),"data-radix-menu-content":"",dir:y.dir,...x,...m,ref:k,style:{outline:"none",...m.style},onKeyDown:oe(m.onKeyDown,$=>{const K=$.target.closest("[data-radix-menu-content]")===$.currentTarget,q=$.ctrlKey||$.altKey||$.metaKey,B=$.key.length===1;K&&($.key==="Tab"&&$.preventDefault(),!q&&B&&D($.key));const Z=N.current;if($.target!==Z||!__e.includes($.key))return;$.preventDefault();const pe=S().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);Y3.includes($.key)&&pe.reverse(),V_e(pe)}),onBlur:oe(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(O.current),E.current="")}),onPointerMove:oe(e.onPointerMove,_f($=>{const z=$.target,K=I.current!==$.clientX;if($.currentTarget.contains(z)&&K){const q=$.clientX>I.current?"right":"left";T.current=q,I.current=$.clientX}}))})})})})})})});t5.displayName=Sn;var D_e="MenuGroup",t_=b.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return s.jsx(ye.div,{role:"group",...n,ref:t})});t_.displayName=D_e;var L_e="MenuLabel",r5=b.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return s.jsx(ye.div,{...n,ref:t})});r5.displayName=L_e;var cg="MenuItem",t2="menu.itemSelect",iy=b.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...a}=e,i=b.useRef(null),o=Qf(cg,e.__scopeMenu),l=ZS(cg,e.__scopeMenu),c=Me(t,i),u=b.useRef(!1),d=()=>{const f=i.current;if(!r&&f){const h=new CustomEvent(t2,{bubbles:!0,cancelable:!0});f.addEventListener(t2,p=>n==null?void 0:n(p),{once:!0}),K1(f,h),h.defaultPrevented?u.current=!1:o.onClose()}};return s.jsx(n5,{...a,ref:c,disabled:r,onClick:oe(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:oe(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:oe(e.onKeyDown,f=>{const h=l.searchRef.current!=="";r||h&&f.key===" "||Kw.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});iy.displayName=cg;var n5=b.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...i}=e,o=ZS(cg,r),l=Q3(r),c=b.useRef(null),u=Me(t,c),[d,f]=b.useState(!1),[h,p]=b.useState("");return b.useEffect(()=>{const v=c.current;v&&p((v.textContent??"").trim())},[i.children]),s.jsx(Sf.ItemSlot,{scope:r,disabled:n,textValue:a??h,children:s.jsx(nI,{asChild:!0,...l,focusable:!n,children:s.jsx(ye.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:oe(e.onPointerMove,_f(v=>{n?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:oe(e.onPointerLeave,_f(v=>o.onItemLeave(v))),onFocus:oe(e.onFocus,()=>f(!0)),onBlur:oe(e.onBlur,()=>f(!1))})})})}),F_e="MenuCheckboxItem",a5=b.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...a}=e;return s.jsx(c5,{scope:e.__scopeMenu,checked:r,children:s.jsx(iy,{role:"menuitemcheckbox","aria-checked":ug(r)?"mixed":r,...a,ref:t,"data-state":n_(r),onSelect:oe(a.onSelect,()=>n==null?void 0:n(ug(r)?!0:!r),{checkForDefaultPrevented:!1})})})});a5.displayName=F_e;var i5="MenuRadioGroup",[B_e,U_e]=Oo(i5,{value:void 0,onValueChange:()=>{}}),s5=b.forwardRef((e,t)=>{const{value:r,onValueChange:n,...a}=e,i=Fr(n);return s.jsx(B_e,{scope:e.__scopeMenu,value:r,onValueChange:i,children:s.jsx(t_,{...a,ref:t})})});s5.displayName=i5;var o5="MenuRadioItem",l5=b.forwardRef((e,t)=>{const{value:r,...n}=e,a=U_e(o5,e.__scopeMenu),i=r===a.value;return s.jsx(c5,{scope:e.__scopeMenu,checked:i,children:s.jsx(iy,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":n_(i),onSelect:oe(n.onSelect,()=>{var o;return(o=a.onValueChange)==null?void 0:o.call(a,r)},{checkForDefaultPrevented:!1})})})});l5.displayName=o5;var r_="MenuItemIndicator",[c5,z_e]=Oo(r_,{checked:!1}),u5=b.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...a}=e,i=z_e(r_,r);return s.jsx(ln,{present:n||ug(i.checked)||i.checked===!0,children:s.jsx(ye.span,{...a,ref:t,"data-state":n_(i.checked)})})});u5.displayName=r_;var q_e="MenuSeparator",d5=b.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return s.jsx(ye.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});d5.displayName=q_e;var W_e="MenuArrow",f5=b.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=ay(r);return s.jsx(jj,{...a,...n,ref:t})});f5.displayName=W_e;var H_e="MenuSub",[eke,h5]=Oo(H_e),Mu="MenuSubTrigger",p5=b.forwardRef((e,t)=>{const r=Co(Mu,e.__scopeMenu),n=Qf(Mu,e.__scopeMenu),a=h5(Mu,e.__scopeMenu),i=ZS(Mu,e.__scopeMenu),o=b.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},d=b.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return b.useEffect(()=>d,[d]),b.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),s.jsx(QS,{asChild:!0,...u,children:s.jsx(n5,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":v5(r.open),...e,ref:Tg(t,a.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:oe(e.onPointerMove,_f(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:oe(e.onPointerLeave,_f(f=>{var p,v;d();const h=(p=r.content)==null?void 0:p.getBoundingClientRect();if(h){const m=(v=r.content)==null?void 0:v.dataset.side,g=m==="right",y=g?-5:5,x=h[g?"left":"right"],w=h[g?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+y,y:f.clientY},{x,y:h.top},{x:w,y:h.top},{x:w,y:h.bottom},{x,y:h.bottom}],side:m}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:oe(e.onKeyDown,f=>{var p;const h=i.searchRef.current!=="";e.disabled||h&&f.key===" "||N_e[n.dir].includes(f.key)&&(r.onOpenChange(!0),(p=r.content)==null||p.focus(),f.preventDefault())})})})});p5.displayName=Mu;var m5="MenuSubContent",g5=b.forwardRef((e,t)=>{const r=Z3(Sn,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=Co(Sn,e.__scopeMenu),o=Qf(Sn,e.__scopeMenu),l=h5(m5,e.__scopeMenu),c=b.useRef(null),u=Me(t,c);return s.jsx(Sf.Provider,{scope:e.__scopeMenu,children:s.jsx(ln,{present:n||i.open,children:s.jsx(Sf.Slot,{scope:e.__scopeMenu,children:s.jsx(e_,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:oe(e.onFocusOutside,d=>{d.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:oe(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:oe(e.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),h=k_e[o.dir].includes(d.key);f&&h&&(i.onOpenChange(!1),(p=l.trigger)==null||p.focus(),d.preventDefault())})})})})})});g5.displayName=m5;function v5(e){return e?"open":"closed"}function ug(e){return e==="indeterminate"}function n_(e){return ug(e)?"indeterminate":e?"checked":"unchecked"}function V_e(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function K_e(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function G_e(e,t,r){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=K_e(e,Math.max(i,0));a.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.toLowerCase().startsWith(a.toLowerCase()));return c!==r?c:void 0}function Y_e(e,t){const{x:r,y:n}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],u=l.x,d=l.y,f=c.x,h=c.y;d>n!=h>n&&r<(f-u)*(n-d)/(h-d)+u&&(a=!a)}return a}function X_e(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return Y_e(r,t)}function _f(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Q_e=J3,J_e=QS,Z_e=e5,eNe=t5,tNe=t_,rNe=r5,nNe=iy,aNe=a5,iNe=s5,sNe=l5,oNe=u5,lNe=d5,cNe=f5,uNe=p5,dNe=g5,sy="DropdownMenu",[fNe,tke]=Br(sy,[X3]),Pr=X3(),[hNe,y5]=fNe(sy),x5=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,c=Pr(t),u=b.useRef(null),[d,f]=nn({prop:a,defaultProp:i??!1,onChange:o,caller:sy});return s.jsx(hNe,{scope:t,triggerId:Zr(),triggerRef:u,contentId:Zr(),open:d,onOpenChange:f,onOpenToggle:b.useCallback(()=>f(h=>!h),[f]),modal:l,children:s.jsx(Q_e,{...c,open:d,onOpenChange:f,dir:n,modal:l,children:r})})};x5.displayName=sy;var b5="DropdownMenuTrigger",w5=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,i=y5(b5,r),o=Pr(r);return s.jsx(J_e,{asChild:!0,...o,children:s.jsx(ye.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:Tg(t,i.triggerRef),onPointerDown:oe(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:oe(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});w5.displayName=b5;var pNe="DropdownMenuPortal",j5=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Pr(t);return s.jsx(Z_e,{...n,...r})};j5.displayName=pNe;var S5="DropdownMenuContent",_5=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=y5(S5,r),i=Pr(r),o=b.useRef(!1);return s.jsx(eNe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...n,ref:t,onCloseAutoFocus:oe(e.onCloseAutoFocus,l=>{var c;o.current||(c=a.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:oe(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!a.modal||d)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_5.displayName=S5;var mNe="DropdownMenuGroup",gNe=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=Pr(r);return s.jsx(tNe,{...a,...n,ref:t})});gNe.displayName=mNe;var vNe="DropdownMenuLabel",N5=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=Pr(r);return s.jsx(rNe,{...a,...n,ref:t})});N5.displayName=vNe;var yNe="DropdownMenuItem",k5=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=Pr(r);return s.jsx(nNe,{...a,...n,ref:t})});k5.displayName=yNe;var xNe="DropdownMenuCheckboxItem",O5=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=Pr(r);return s.jsx(aNe,{...a,...n,ref:t})});O5.displayName=xNe;var bNe="DropdownMenuRadioGroup",wNe=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=Pr(r);return s.jsx(iNe,{...a,...n,ref:t})});wNe.displayName=bNe;var jNe="DropdownMenuRadioItem",C5=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=Pr(r);return s.jsx(sNe,{...a,...n,ref:t})});C5.displayName=jNe;var SNe="DropdownMenuItemIndicator",E5=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=Pr(r);return s.jsx(oNe,{...a,...n,ref:t})});E5.displayName=SNe;var _Ne="DropdownMenuSeparator",P5=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=Pr(r);return s.jsx(lNe,{...a,...n,ref:t})});P5.displayName=_Ne;var NNe="DropdownMenuArrow",kNe=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=Pr(r);return s.jsx(cNe,{...a,...n,ref:t})});kNe.displayName=NNe;var ONe="DropdownMenuSubTrigger",A5=b.forwardRef((e,t)=>
672{const{__scopeDropdownMenu:r,...n}=e,a=Pr(r);return s.jsx(uNe,{...a,...n,ref:t})});A5.displayName=ONe;var CNe="DropdownMenuSubContent",T5=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=Pr(r);return s.jsx(dNe,{...a,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});T5.displayName=CNe;var ENe=x5,PNe=w5,ANe=j5,$5=_5,R5=N5,M5=k5,I5=O5,D5=C5,L5=E5,F5=P5,B5=A5,U5=T5;const Dx=ENe,Lx=PNe,TNe=b.forwardRef(({className:e,inset:t,children:r,...n},a)=>s.jsxs(B5,{ref:a,className:ne("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...n,children:[r,s.jsx(J1,{className:"ml-auto h-4 w-4"})]}));TNe.displayName=B5.displayName;const $Ne=b.forwardRef(({className:e,...t},r)=>s.jsx(U5,{ref:r,className:ne("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));$Ne.displayName=U5.displayName;const xp=b.forwardRef(({className:e,sideOffset:t=4,...r},n)=>s.jsx(ANe,{children:s.jsx($5,{ref:n,sideOffset:t,className:ne("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));xp.displayName=$5.displayName;const tl=b.forwardRef(({className:e,inset:t,...r},n)=>s.jsx(M5,{ref:n,className:ne("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...r}));tl.displayName=M5.displayName;const RNe=b.forwardRef(({className:e,children:t,checked:r,...n},a)=>s.jsxs(I5,{ref:a,className:ne("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:r,...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(L5,{children:s.jsx(Ql,{className:"h-4 w-4"})})}),t]}));RNe.displayName=I5.displayName;const MNe=b.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(D5,{ref:n,className:ne("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(L5,{children:s.jsx(Dz,{className:"h-2 w-2 fill-current"})})}),t]}));MNe.displayName=D5.displayName;const INe=b.forwardRef(({className:e,inset:t,...r},n)=>s.jsx(R5,{ref:n,className:ne("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));INe.displayName=R5.displayName;const DNe=b.forwardRef(({className:e,...t},r)=>s.jsx(F5,{ref:r,className:ne("-mx-1 my-1 h-px bg-muted",e),...t}));DNe.displayName=F5.displayName;const LNe=[{name:"Word",description:"Documents",url:"https://www.office.com/launch/word",color:"#2B579A",icon:"W"},{name:"Excel",description:"Spreadsheets",url:"https://www.office.com/launch/excel",color:"#217346",icon:"X"},{name:"PowerPoint",description:"Presentations",url:"https://www.office.com/launch/powerpoint",color:"#D24726",icon:"P"},{name:"OneNote",description:"Notes",url:"https://www.office.com/launch/onenote",color:"#7719AA",icon:"N"},{name:"Outlook",description:"Email & Calendar",url:"https://outlook.office.com/mail",color:"#0078D4",icon:"O"},{name:"Teams",description:"Chat & Meetings",url:"https://teams.microsoft.com",color:"#6264A7",icon:"T"},{name:"OneDrive",description:"Cloud Storage",url:"https://onedrive.live.com",color:"#0078D4",icon:"D"},{name:"Forms",description:"Surveys & Quizzes",url:"https://forms.office.com",color:"#008272",icon:"F"}],FNe=()=>{const[e,t]=b.useState(null),r=a=>{t(a)},n=a=>{window.open(a,"_blank","noopener,noreferrer")};return e?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-8 w-8 rounded-lg flex items-center justify-center text-white font-bold text-sm",style:{backgroundColor:e.color},children:e.icon}),s.jsxs("div",{children:[s.jsxs("h3",{className:"font-semibold text-sm",children:["Microsoft ",e.name]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:e.description})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(W,{variant:"outline",size:"sm",onClick:()=>n(e.url),children:[s.jsx(v$,{className:"h-3.5 w-3.5 mr-1"}),"Open in New Tab"]}),s.jsx(W,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>t(null),children:s.jsx(Ic,{className:"h-4 w-4"})})]})]}),s.jsx("div",{className:"rounded-lg border overflow-hidden bg-white",style:{height:"calc(100vh - 260px)"},children:s.jsx("iframe",{src:e.url,className:"w-full h-full border-0",title:`Microsoft ${e.name}`,allow:"clipboard-read; clipboard-write; fullscreen",sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads"})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-8 w-8 rounded-lg bg-gradient-to-br from-[#D24726] via-[#0078D4] to-[#217346] flex items-center justify-center",children:s.jsx("span",{className:"text-white font-bold text-xs",children:"365"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-sm",children:"Microsoft 365"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Create and edit documents, spreadsheets, and presentations"})]})]}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 md:grid-cols-4 lg:grid-cols-8 gap-3",children:LNe.map(a=>s.jsx(le,{className:"group cursor-pointer hover:shadow-md transition-all hover:scale-[1.02]",onClick:()=>r(a),children:s.jsxs(ce,{className:"p-4 flex flex-col items-center text-center gap-2",children:[s.jsx("div",{className:"h-12 w-12 rounded-xl flex items-center justify-center text-white font-bold text-xl shadow-sm transition-transform group-hover:scale-110",style:{backgroundColor:a.color},children:a.icon}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:a.name}),s.jsx("p",{className:"text-[10px] text-muted-foreground leading-tight",children:a.description})]})]})},a.name))})]})},r2=e=>e?e.startsWith("image/")?s.jsx(Uz,{className:"h-8 w-8 text-blue-500"}):e.includes("spreadsheet")||e.includes("excel")||e.includes("csv")?s.jsx(zz,{className:"h-8 w-8 text-green-600"}):e.includes("pdf")?s.jsx(Qs,{className:"h-8 w-8 text-red-500"}):e.includes("zip")||e.includes("rar")||e.includes("archive")?s.jsx(Bz,{className:"h-8 w-8 text-amber-600"}):s.jsx(Qs,{className:"h-8 w-8 text-muted-foreground"}):s.jsx(qz,{className:"h-8 w-8 text-muted-foreground"}),Fx=e=>e?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`:"—",BNe=()=>{const{user:e,isAdmin:t}=ir(),[r,n]=b.useState([]),[a,i]=b.useState(!0),[o,l]=b.useState(null),[c,u]=b.useState([{id:null,name:"My Documents"}]),[d,f]=b.useState("grid"),[h,p]=b.useState(!1),[v,m]=b.useState(""),[g,y]=b.useState(!1),[x,w]=b.useState(""),S=b.useCallback(async()=>{i(!0);let P=V.from("admin_documents").select("*").order("type",{ascending:!0}).order("name",{ascending:!0});o?P=P.eq("parent_id",o):P=P.is("parent_id",null);const{data:D,error:M}=await P;M?X.error("Failed to load documents"):n(D||[]),i(!1)},[o]);b.useEffect(()=>{S()},[S]);const j=async(P,D)=>{l(P),u(M=>[...M,{id:P,name:D}])},_=P=>{const D=c[P];l(D.id),u(c.slice(0,P+1))},N=()=>{c.length>1&&_(c.length-2)},k=async()=>
672{if(!v.trim())return;const{error:P}=await V.from("admin_documents").insert({name:v.trim(),type:"folder",parent_id:o,created_by:e==null?void 0:e.id});P?X.error("Failed to create folder"):(X.success("Folder created"),m(""),p(!1),S())},O=async P=>{const D=P.target.files;if(D!=null&&D.length){y(!0);for(const M of Array.from(D)){const $=`${e==null?void 0:e.id}/${Date.now()}_${M.name}`,{error:z}=await V.storage.from("admin-documents").upload($,M);if(z){X.error(`Failed to upload ${M.name}`);continue}const{error:K}=await V.from("admin_documents").insert({name:M.name,type:"file",parent_id:o,storage_path:$,file_size:M.size,mime_type:M.type,created_by:e==null?void 0:e.id});K?X.error(`Failed to save ${M.name} metadata`):X.success(`${M.name} uploaded`)}y(!1),S(),P.target.value=""}},E=async P=>{if(!P.storage_path)return;const{data:D,error:M}=await V.storage.from("admin-documents").download(P.storage_path);if(M||!D){X.error("Download failed");return}const $=URL.createObjectURL(D),z=document.createElement("a");z.href=$,z.download=P.name,z.click(),URL.revokeObjectURL($)},A=async P=>{P.type==="file"&&P.storage_path&&await V.storage.from("admin-documents").remove([P.storage_path]);const{error:D}=await V.from("admin_documents").delete().eq("id",P.id);D?X.error("Failed to delete"):(X.success(`${P.name} deleted`),S())},R=r.filter(P=>P.name.toLowerCase().includes(x.toLowerCase())),T=R.filter(P=>P.type==="folder"),I=R.filter(P=>P.type==="file"),F=r.reduce((P,D)=>P+(D.file_size||0),0);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl font-display font-bold tracking-tight flex items-center gap-2",children:[s.jsx(y$,{className:"h-6 w-6 text-primary"}),"Cloud Desktop"]}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[r.length," items · ",Fx(F)," used"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Ur,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(se,{placeholder:"Search files…",value:x,onChange:P=>w(P.target.value),className:"pl-9 w-48 h-9"})]}),s.jsx(W,{variant:"outline",size:"icon",className:"h-9 w-9",onClick:()=>f(d==="grid"?"list":"grid"),children:d==="grid"?s.jsx(Kz,{className:"h-4 w-4"}):s.jsx(Wz,{className:"h-4 w-4"})}),s.jsxs(W,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[s.jsx(WN,{className:"h-4 w-4 mr-1"})," New Folder"]}),s.jsxs(W,{size:"sm",className:"relative",disabled:g,children:[s.jsx(Od,{className:"h-4 w-4 mr-1"}),g?"Uploading…":"Upload",s.jsx("input",{type:"file",multiple:!0,onChange:O,className:"absolute inset-0 opacity-0 cursor-pointer",disabled:g})]})]})]}),s.jsx(FNe,{}),s.jsx("div",{className:"flex items-center gap-1 text-sm",children:c.map((P,D)=>s.jsxs("div",{className:"flex items-center gap-1",children:[D>0&&s.jsx(J1,{className:"h-3 w-3 text-muted-foreground"}),s.jsxs("button",{onClick:()=>_(D),className:`flex items-center gap-1 px-2 py-1 rounded-md transition-colors ${D===c.length-1?"font-semibold text-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,children:[D===0&&s.jsx(Vz,{className:"h-3.5 w-3.5"}),P.name]})]},D))}),o&&s.jsxs(W,{variant:"ghost",size:"sm",onClick:N,className:"text-muted-foreground",children:[s.jsx(Mc,{className:"h-4 w-4 mr-1"})," Back"]}),a?s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsx("div",{className:"h-6 w-6 rounded-full border-2 border-primary border-t-transparent animate-spin"})}):R.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[s.jsx("div",{className:"h-16 w-16 rounded-2xl bg-muted flex items-center justify-center mb-4",children:s.jsx(zy,{className:"h-8 w-8 text-muted-foreground"})}),s.jsx("h3",{className:"font-semibold text-lg",children:x?"No matches":"This folder is empty"}),s.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:x?"Try a different search term":"Create a folder or upload files to get started"}),!x&&s.jsxs("div",{className:"flex gap-2 mt-4",children:[s.jsxs(W,{variant:"outline",size:"sm",onClick:()=>p(!0),children:[s.jsx(WN,{className:"h-4 w-4 mr-1"})," New Folder"]}),s.jsxs(W,{size:"sm",className:"relative",children:[s.jsx(Od,{className:"h-4 w-4 mr-1"})," Upload Files",s.jsx("input",{type:"file",multiple:!0,onChange:O,className:"absolute inset-0 opacity-0 cursor-pointer"})]})]})]}):d==="grid"?s.jsxs("div",{className:"space-y-6",children:[T.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:"Folders"}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-3",children:T.map(P=>s.jsx(le,{className:"group cursor-pointer hover:border-primary/40 hover:shadow-md transition-all",onDoubleClick:()=>j(P.id,P.name),onClick:()=>j(P.id,P.name),children:s.jsxs(ce,{className:"p-4 flex flex-col items-center text-center relative",children:[t&&s.jsxs(Dx,{children:[s.jsx(Lx,{asChild:!0,children:s.jsx(W,{variant:"ghost",size:"icon",className:"absolute top-1 right-1 h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:D=>D.stopPropagation(),children:s.jsx(Uy,{className:"h-3.5 w-3.5"})})}),s.jsx(xp,{align:"end",children:s.jsxs(tl,{className:"text-destructive",onClick:D=>{D.stopPropagation(),A(P)}
672,children:[s.jsx(xa,{className:"h-4 w-4 mr-2"})," Delete"]})})]}),s.jsx(zy,{className:"h-10 w-10 text-amber-500 mb-2"}),s.jsx("p",{className:"text-sm font-medium truncate w-full",children:P.name})]})},P.id))})]}),I.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider mb-3",children:"Files"}),s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-3",children:I.map(P=>s.jsx(le,{className:"group cursor-pointer hover:border-primary/40 hover:shadow-md transition-all",children:s.jsxs(ce,{className:"p-4 flex flex-col items-center text-center relative",children:[s.jsxs(Dx,{children:[s.jsx(Lx,{asChild:!0,children:s.jsx(W,{variant:"ghost",size:"icon",className:"absolute top-1 right-1 h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(Uy,{className:"h-3.5 w-3.5"})})}),s.jsxs(xp,{align:"end",children:[s.jsxs(tl,{onClick:()=>E(P),children:[s.jsx(W0,{className:"h-4 w-4 mr-2"})," Download"]}),t&&s.jsxs(tl,{className:"text-destructive",onClick:()=>A(P),children:[s.jsx(xa,{className:"h-4 w-4 mr-2"})," Delete"]})]})]}),r2(P.mime_type),s.jsx("p",{className:"text-sm font-medium truncate w-full mt-2",children:P.name}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:Fx(P.file_size)})]})},P.id))})]})]}):s.jsx("div",{className:"border rounded-lg divide-y",children:R.map(P=>s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 hover:bg-muted/50 transition-colors cursor-pointer group",onClick:()=>P.type==="folder"?j(P.id,P.name):void 0,children:[P.type==="folder"?s.jsx(zy,{className:"h-5 w-5 text-amber-500 shrink-0"}):s.jsx("span",{className:"shrink-0",children:r2(P.mime_type)}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:P.name}),s.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(P.created_at).toLocaleDateString()})]}),s.jsx("span",{className:"text-xs text-muted-foreground w-16 text-right",children:P.type==="file"?Fx(P.file_size):"—"}),s.jsxs(Dx,{children:[s.jsx(Lx,{asChild:!0,children:s.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7 opacity-0 group-hover:opacity-100",onClick:D=>D.stopPropagation(),children:s.jsx(Uy,{className:"h-3.5 w-3.5"})})}),s.jsxs(xp,{align:"end",children:[P.type==="file"&&s.jsxs(tl,{onClick:()=>E(P),children:[s.jsx(W0,{className:"h-4 w-4 mr-2"})," Download"]}),t&&s.jsxs(tl,{className:"text-destructive",onClick:()=>A(P),children:[s.jsx(xa,{className:"h-4 w-4 mr-2"})," Delete"]})]})]})]},P.id))}),s.jsx(gr,{open:h,onOpenChange:p,children:s.jsxs(nr,{className:"sm:max-w-sm",children:[s.jsx(vr,{children:s.jsx(ar,{children:"Create New Folder"})}),s.jsx(se,{placeholder:"Folder name (e.g. Tax Invoices)",value:v,onChange:P=>m(P.target.value),onKeyDown:P=>P.key==="Enter"&&k(),autoFocus:!0}),s.jsxs(GM,{children:[s.jsx(W,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsxs(W,{onClick:k,disabled:!v.trim(),children:[s.jsx(Or,{className:"h-4 w-4 mr-1"})," Create"]})]})]})})]})},UNe=new q6,zNe=()=>s.jsx(H6,{client:UNe,children:s.jsx(uR,{children:s.jsx(jV,{children:s.jsx(k9,{children:s.jsxs(SV,{children:[s.jsx(L7,{}),s.jsx(EU,{}),s.jsx(H8,{children:s.jsxs(CN,{children:[s.jsx(Ae,{path:"/admin/login",element:s.jsx(SG,{})}),s.jsx(Ae,{path:"/auth",element:s.jsx(ZG,{})}),s.jsxs(Ae,{path:"/admin",element:s.jsx(wQ,{}),children:[s.jsx(Ae,{index:!0,element:s.jsx(SQ,{})}),s.jsx(Ae,{path:"products",element:s.jsx(kQ,{})}),s.jsx(Ae,{path:"orders",element:s.jsx(CQ,{})}),s.jsx(Ae,{path:"inventory",element:s.jsx(EQ,{})}),s.jsx(Ae,{path:"procurement",element:s.jsx(PQ,{})}),s.jsx(Ae,{path:"suppliers",element:s.jsx(d_e,{})}),s.jsx(Ae,{path:"deliveries-inward",element:s.jsx(f_e,{})}),s.jsx(Ae,{path:"deliveries-outward",element:s.jsx(h_e,{})}),s.jsx(Ae,{path:"messages",element:s.jsx(AQ,{})}),s.jsx(Ae,{path:"support-tickets",element:s.jsx(m_e,{})}),s.jsx(Ae,{path:"staff",element:s.jsx(TQ,{})}),s.jsx(Ae,{path:"reports",element:s.jsx(QSe,{})}),s.jsx(Ae,{path:"procurement-reports",element:s.jsx(JSe,{})}),s.jsx(Ae,{path:"promotions",element:s.jsx(w_e,{})}),s.jsx(Ae,{path:"banners",element:s.jsx(j_e,{})}),s.jsx(Ae,{path:"email-log",element:s.jsx(t_e,{})}),s.jsx(Ae,{path:"documents",element:s.jsx(BNe,{})})]}),s.jsx(Ae,{path:"*",element:s.jsxs(s.Fragment,{children:[s.jsx(NV,{}),s.jsx(AK,{}),s.jsx("main",{className:"min-h-screen",children:s.jsxs(CN,{children:[s.jsx(Ae,{path:"/",element:s.jsx($K,{})}),s.jsx(Ae,{path:"/shop",element:s.jsx(pG,{})}),s.jsx(Ae,{path:"/product/:id",element:s.jsx(mG,{})}),s.jsx(Ae,{path:"/categories",element:s.jsx(gG,{})}),s.jsx(Ae,{path:"/wholesale",element:s.jsx(GX,{})}),s.jsx(Ae,{path:"/trade",element:s.jsx(vG,{})}),s.jsx(Ae,{path:"/about",element:s.jsx(yG,{})}),s.jsx(Ae,{path:"/contact",element:s.jsx(HX,{})}),s.jsx(Ae,{path:"/faq",element:s.jsx(LX,{})}),s.jsx(Ae,{path:"/delivery-info",element:s.jsx(BX,{})}),s.jsx(Ae,{path:"/returns-policy",element:s.jsx(UX,{})}),s.jsx(Ae,{path:"/terms",element:s.jsx(zX,{})}),s.jsx(Ae,{path:"/privacy",element:s.jsx(qX,{})}),s.jsx(Ae,{path:"/wishlist",element:s.jsx(bG,{})}),s.jsx(Ae,{path:"/account",element:s.jsx(dX,{})}),s.jsx(Ae,{path:"/checkout",element:s.jsx(fX,{})}),s.jsx(Ae,{path:"/unsubscribe",element:s.jsx(hX,{})}),s.jsx(Ae,{path:"/order/:id",element:s.jsx(vX,{})}),s.jsx(Ae,{path:"*",element:s.jsx(xG,{})})]})}),s.jsx(kV,{})]})})]})})]})})})})});_T(document.getElementById("root")).render(s.jsx(zNe,{}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.