@danhachuel/leadmaster 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,93 +0,0 @@
1
- var k0=Object.defineProperty;var C0=(e,t,n)=>t in e?k0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var F=(e,t,n)=>C0(e,typeof t!="symbol"?t+"":t,n);function j0(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function N0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tp={exports:{}},Da={},Op={exports:{}},H={};/**
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 Oi=Symbol.for("react.element"),E0=Symbol.for("react.portal"),M0=Symbol.for("react.fragment"),P0=Symbol.for("react.strict_mode"),R0=Symbol.for("react.profiler"),T0=Symbol.for("react.provider"),O0=Symbol.for("react.context"),D0=Symbol.for("react.forward_ref"),L0=Symbol.for("react.suspense"),A0=Symbol.for("react.memo"),z0=Symbol.for("react.lazy"),Bd=Symbol.iterator;function I0(e){return e===null||typeof e!="object"?null:(e=Bd&&e[Bd]||e["@@iterator"],typeof e=="function"?e:null)}var Dp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Lp=Object.assign,Ap={};function ds(e,t,n){this.props=e,this.context=t,this.refs=Ap,this.updater=n||Dp}ds.prototype.isReactComponent={};ds.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")};ds.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function zp(){}zp.prototype=ds.prototype;function du(e,t,n){this.props=e,this.context=t,this.refs=Ap,this.updater=n||Dp}var fu=du.prototype=new zp;fu.constructor=du;Lp(fu,ds.prototype);fu.isPureReactComponent=!0;var Wd=Array.isArray,Ip=Object.prototype.hasOwnProperty,hu={current:null},Fp={key:!0,ref:!0,__self:!0,__source:!0};function Bp(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Ip.call(t,r)&&!Fp.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Oi,type:e,key:i,ref:o,props:s,_owner:hu.current}}function F0(e,t){return{$$typeof:Oi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function pu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Oi}function B0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $d=/\/+/g;function fl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?B0(""+e.key):t.toString(36)}function jo(e,t,n,r,s){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 Oi:case E0:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+fl(o,0):r,Wd(s)?(n="",e!=null&&(n=e.replace($d,"$&/")+"/"),jo(s,t,n,"",function(c){return c})):s!=null&&(pu(s)&&(s=F0(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace($d,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Wd(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+fl(i,a);o+=jo(i,t,n,l,s)}else if(l=I0(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+fl(i,a++),o+=jo(i,t,n,l,s);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 Xi(e,t,n){if(e==null)return e;var r=[],s=0;return jo(e,r,"","",function(i){return t.call(n,i,s++)}),r}function W0(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ve={current:null},No={transition:null},$0={ReactCurrentDispatcher:Ve,ReactCurrentBatchConfig:No,ReactCurrentOwner:hu};function Wp(){throw Error("act(...) is not supported in production builds of React.")}H.Children={map:Xi,forEach:function(e,t,n){Xi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Xi(e,function(){t++}),t},toArray:function(e){return Xi(e,function(t){return t})||[]},only:function(e){if(!pu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};H.Component=ds;H.Fragment=M0;H.Profiler=R0;H.PureComponent=du;H.StrictMode=P0;H.Suspense=L0;H.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$0;H.act=Wp;H.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Lp({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=hu.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Ip.call(t,l)&&!Fp.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Oi,type:e.type,key:s,ref:i,props:r,_owner:o}};H.createContext=function(e){return e={$$typeof:O0,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:T0,_context:e},e.Consumer=e};H.createElement=Bp;H.createFactory=function(e){var t=Bp.bind(null,e);return t.type=e,t};H.createRef=function(){return{current:null}};H.forwardRef=function(e){return{$$typeof:D0,render:e}};H.isValidElement=pu;H.lazy=function(e){return{$$typeof:z0,_payload:{_status:-1,_result:e},_init:W0}};H.memo=function(e,t){return{$$typeof:A0,type:e,compare:t===void 0?null:t}};H.startTransition=function(e){var t=No.transition;No.transition={};try{e()}finally{No.transition=t}};H.unstable_act=Wp;H.useCallback=function(e,t){return Ve.current.useCallback(e,t)};H.useContext=function(e){return Ve.current.useContext(e)};H.useDebugValue=function(){};H.useDeferredValue=function(e){return Ve.current.useDeferredValue(e)};H.useEffect=function(e,t){return Ve.current.useEffect(e,t)};H.useId=function(){return Ve.current.useId()};H.useImperativeHandle=function(e,t,n){return Ve.current.useImperativeHandle(e,t,n)};H.useInsertionEffect=function(e,t){return Ve.current.useInsertionEffect(e,t)};H.useLayoutEffect=function(e,t){return Ve.current.useLayoutEffect(e,t)};H.useMemo=function(e,t){return Ve.current.useMemo(e,t)};H.useReducer=function(e,t,n){return Ve.current.useReducer(e,t,n)};H.useRef=function(e){return Ve.current.useRef(e)};H.useState=function(e){return Ve.current.useState(e)};H.useSyncExternalStore=function(e,t,n){return Ve.current.useSyncExternalStore(e,t,n)};H.useTransition=function(){return Ve.current.useTransition()};H.version="18.3.1";Op.exports=H;var b=Op.exports;const fe=N0(b),V0=j0({__proto__:null,default:fe},[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 H0=b,U0=Symbol.for("react.element"),Y0=Symbol.for("react.fragment"),K0=Object.prototype.hasOwnProperty,X0=H0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Q0={key:!0,ref:!0,__self:!0,__source:!0};function $p(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)K0.call(t,r)&&!Q0.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:U0,type:e,key:i,ref:o,props:s,_owner:X0.current}}Da.Fragment=Y0;Da.jsx=$p;Da.jsxs=$p;Tp.exports=Da;var u=Tp.exports,nc={},Vp={exports:{}},ut={},Hp={exports:{}},Up={};/**
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(T,L){var A=T.length;T.push(L);e:for(;0<A;){var U=A-1>>>1,$=T[U];if(0<s($,L))T[U]=L,T[A]=$,A=U;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var L=T[0],A=T.pop();if(A!==L){T[0]=A;e:for(var U=0,$=T.length,se=$>>>1;U<se;){var Y=2*(U+1)-1,we=T[Y],q=Y+1,kt=T[q];if(0>s(we,A))q<$&&0>s(kt,we)?(T[U]=kt,T[q]=A,U=q):(T[U]=we,T[Y]=A,U=Y);else if(q<$&&0>s(kt,A))T[U]=kt,T[q]=A,U=q;else break e}}return L}function s(T,L){var A=T.sortIndex-L.sortIndex;return A!==0?A:T.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,f=null,p=3,h=!1,g=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(T){for(var L=n(c);L!==null;){if(L.callback===null)r(c);else if(L.startTime<=T)r(c),L.sortIndex=L.expirationTime,t(l,L);else break;L=n(c)}}function _(T){if(x=!1,y(T),!g)if(n(l)!==null)g=!0,G(k);else{var L=n(c);L!==null&&J(_,L.startTime-T)}}function k(T,L){g=!1,x&&(x=!1,v(j),j=-1),h=!0;var A=p;try{for(y(L),f=n(l);f!==null&&(!(f.expirationTime>L)||T&&!N());){var U=f.callback;if(typeof U=="function"){f.callback=null,p=f.priorityLevel;var $=U(f.expirationTime<=L);L=e.unstable_now(),typeof $=="function"?f.callback=$:f===n(l)&&r(l),y(L)}else r(l);f=n(l)}if(f!==null)var se=!0;else{var Y=n(c);Y!==null&&J(_,Y.startTime-L),se=!1}return se}finally{f=null,p=A,h=!1}}var S=!1,C=null,j=-1,R=5,M=-1;function N(){return!(e.unstable_now()-M<R)}function D(){if(C!==null){var T=e.unstable_now();M=T;var L=!0;try{L=C(!0,T)}finally{L?E():(S=!1,C=null)}}else S=!1}var E;if(typeof m=="function")E=function(){m(D)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,I=B.port2;B.port1.onmessage=D,E=function(){I.postMessage(null)}}else E=function(){w(D,0)};function G(T){C=T,S||(S=!0,E())}function J(T,L){j=w(function(){T(e.unstable_now())},L)}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(T){T.callback=null},e.unstable_continueExecution=function(){g||h||(g=!0,G(k))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(T){switch(p){case 1:case 2:case 3:var L=3;break;default:L=p}var A=p;p=L;try{return T()}finally{p=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,L){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var A=p;p=T;try{return L()}finally{p=A}},e.unstable_scheduleCallback=function(T,L,A){var U=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?U+A:U):A=U,T){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=A+$,T={id:d++,callback:L,priorityLevel:T,startTime:A,expirationTime:$,sortIndex:-1},A>U?(T.sortIndex=A,t(c,T),n(l)===null&&T===n(c)&&(x?(v(j),j=-1):x=!0,J(_,A-U))):(T.sortIndex=$,t(l,T),g||h||(g=!0,G(k))),T},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(T){var L=p;return function(){var A=p;p=L;try{return T.apply(this,arguments)}finally{p=A}}}})(Up);Hp.exports=Up;var q0=Hp.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 G0=b,ct=q0;function P(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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 Yp=new Set,ai={};function wr(e,t){ns(e,t),ns(e+"Capture",t)}function ns(e,t){for(ai[e]=t,e=0;e<t.length;e++)Yp.add(t[e])}var sn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rc=Object.prototype.hasOwnProperty,J0=/^[: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]*$/,Vd={},Hd={};function Z0(e){return rc.call(Hd,e)?!0:rc.call(Vd,e)?!1:J0.test(e)?Hd[e]=!0:(Vd[e]=!0,!1)}function ev(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function tv(e,t,n,r){if(t===null||typeof t>"u"||ev(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 He(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Oe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Oe[e]=new He(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Oe[t]=new He(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Oe[e]=new He(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Oe[e]=new He(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){Oe[e]=new He(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Oe[e]=new He(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Oe[e]=new He(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Oe[e]=new He(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Oe[e]=new He(e,5,!1,e.toLowerCase(),null,!1,!1)});var gu=/[\-:]([a-z])/g;function mu(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(gu,mu);Oe[t]=new He(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(gu,mu);Oe[t]=new He(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(gu,mu);Oe[t]=new He(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Oe[e]=new He(e,1,!1,e.toLowerCase(),null,!1,!1)});Oe.xlinkHref=new He("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Oe[e]=new He(e,1,!1,e.toLowerCase(),null,!0,!0)});function xu(e,t,n,r){var s=Oe.hasOwnProperty(t)?Oe[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(tv(t,n,s,r)&&(n=null),r||s===null?Z0(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var un=G0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Qi=Symbol.for("react.element"),Or=Symbol.for("react.portal"),Dr=Symbol.for("react.fragment"),vu=Symbol.for("react.strict_mode"),sc=Symbol.for("react.profiler"),Kp=Symbol.for("react.provider"),Xp=Symbol.for("react.context"),yu=Symbol.for("react.forward_ref"),ic=Symbol.for("react.suspense"),oc=Symbol.for("react.suspense_list"),bu=Symbol.for("react.memo"),vn=Symbol.for("react.lazy"),Qp=Symbol.for("react.offscreen"),Ud=Symbol.iterator;function ks(e){return e===null||typeof e!="object"?null:(e=Ud&&e[Ud]||e["@@iterator"],typeof e=="function"?e:null)}var pe=Object.assign,hl;function zs(e){if(hl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);hl=t&&t[1]||""}return`
34
- `+hl+e}var pl=!1;function gl(e,t){if(!e||pl)return"";pl=!0;var n=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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
35
- `),i=r.stack.split(`
36
- `),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
37
- `+s[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{pl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?zs(e):""}function nv(e){switch(e.tag){case 5:return zs(e.type);case 16:return zs("Lazy");case 13:return zs("Suspense");case 19:return zs("SuspenseList");case 0:case 2:case 15:return e=gl(e.type,!1),e;case 11:return e=gl(e.type.render,!1),e;case 1:return e=gl(e.type,!0),e;default:return""}}function ac(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 Dr:return"Fragment";case Or:return"Portal";case sc:return"Profiler";case vu:return"StrictMode";case ic:return"Suspense";case oc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xp:return(e.displayName||"Context")+".Consumer";case Kp:return(e._context.displayName||"Context")+".Provider";case yu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case bu:return t=e.displayName||null,t!==null?t:ac(e.type)||"Memo";case vn:t=e._payload,e=e._init;try{return ac(e(t))}catch{}}return null}function rv(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 ac(t);case 8:return t===vu?"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 $n(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sv(e){var t=qp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qi(e){e._valueTracker||(e._valueTracker=sv(e))}function Gp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=qp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ho(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 lc(e,t){var n=t.checked;return pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Yd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=$n(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Jp(e,t){t=t.checked,t!=null&&xu(e,"checked",t,!1)}function cc(e,t){Jp(e,t);var n=$n(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?uc(e,t.type,n):t.hasOwnProperty("defaultValue")&&uc(e,t.type,$n(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Kd(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function uc(e,t,n){(t!=="number"||Ho(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Is=Array.isArray;function Yr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$n(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function dc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(P(91));return pe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Xd(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(P(92));if(Is(n)){if(1<n.length)throw Error(P(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:$n(n)}}function Zp(e,t){var n=$n(t.value),r=$n(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Qd(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function eg(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 fc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?eg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Gi,tg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Gi=Gi||document.createElement("div"),Gi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Gi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function li(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ys={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},iv=["Webkit","ms","Moz","O"];Object.keys(Ys).forEach(function(e){iv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ys[t]=Ys[e]})});function ng(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ys.hasOwnProperty(e)&&Ys[e]?(""+t).trim():t+"px"}function rg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=ng(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var ov=pe({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 hc(e,t){if(t){if(ov[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(P(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(P(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(P(61))}if(t.style!=null&&typeof t.style!="object")throw Error(P(62))}}function pc(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 gc=null;function wu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mc=null,Kr=null,Xr=null;function qd(e){if(e=Ai(e)){if(typeof mc!="function")throw Error(P(280));var t=e.stateNode;t&&(t=Fa(t),mc(e.stateNode,e.type,t))}}function sg(e){Kr?Xr?Xr.push(e):Xr=[e]:Kr=e}function ig(){if(Kr){var e=Kr,t=Xr;if(Xr=Kr=null,qd(e),t)for(e=0;e<t.length;e++)qd(t[e])}}function og(e,t){return e(t)}function ag(){}var ml=!1;function lg(e,t,n){if(ml)return e(t,n);ml=!0;try{return og(e,t,n)}finally{ml=!1,(Kr!==null||Xr!==null)&&(ag(),ig())}}function ci(e,t){var n=e.stateNode;if(n===null)return null;var r=Fa(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(P(231,t,typeof n));return n}var xc=!1;if(sn)try{var Cs={};Object.defineProperty(Cs,"passive",{get:function(){xc=!0}}),window.addEventListener("test",Cs,Cs),window.removeEventListener("test",Cs,Cs)}catch{xc=!1}function av(e,t,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Ks=!1,Uo=null,Yo=!1,vc=null,lv={onError:function(e){Ks=!0,Uo=e}};function cv(e,t,n,r,s,i,o,a,l){Ks=!1,Uo=null,av.apply(lv,arguments)}function uv(e,t,n,r,s,i,o,a,l){if(cv.apply(this,arguments),Ks){if(Ks){var c=Uo;Ks=!1,Uo=null}else throw Error(P(198));Yo||(Yo=!0,vc=c)}}function _r(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function cg(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 Gd(e){if(_r(e)!==e)throw Error(P(188))}function dv(e){var t=e.alternate;if(!t){if(t=_r(e),t===null)throw Error(P(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Gd(s),e;if(i===r)return Gd(s),t;i=i.sibling}throw Error(P(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(P(189))}}if(n.alternate!==r)throw Error(P(190))}if(n.tag!==3)throw Error(P(188));return n.stateNode.current===n?e:t}function ug(e){return e=dv(e),e!==null?dg(e):null}function dg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=dg(e);if(t!==null)return t;e=e.sibling}return null}var fg=ct.unstable_scheduleCallback,Jd=ct.unstable_cancelCallback,fv=ct.unstable_shouldYield,hv=ct.unstable_requestPaint,xe=ct.unstable_now,pv=ct.unstable_getCurrentPriorityLevel,_u=ct.unstable_ImmediatePriority,hg=ct.unstable_UserBlockingPriority,Ko=ct.unstable_NormalPriority,gv=ct.unstable_LowPriority,pg=ct.unstable_IdlePriority,La=null,Ut=null;function mv(e){if(Ut&&typeof Ut.onCommitFiberRoot=="function")try{Ut.onCommitFiberRoot(La,e,void 0,(e.current.flags&128)===128)}catch{}}var Pt=Math.clz32?Math.clz32:yv,xv=Math.log,vv=Math.LN2;function yv(e){return e>>>=0,e===0?32:31-(xv(e)/vv|0)|0}var Ji=64,Zi=4194304;function Fs(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 Xo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Fs(a):(i&=o,i!==0&&(r=Fs(i)))}else o=n&~s,o!==0?r=Fs(o):i!==0&&(r=Fs(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Pt(t),s=1<<n,r|=e[n],t&=~s;return r}function bv(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 wv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Pt(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=bv(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function yc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function gg(){var e=Ji;return Ji<<=1,!(Ji&4194240)&&(Ji=64),e}function xl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Di(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Pt(t),e[t]=n}function _v(e,t){var n=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 r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Pt(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function Su(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ee=0;function mg(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var xg,ku,vg,yg,bg,bc=!1,eo=[],Pn=null,Rn=null,Tn=null,ui=new Map,di=new Map,wn=[],Sv="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 Zd(e,t){switch(e){case"focusin":case"focusout":Pn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":Tn=null;break;case"pointerover":case"pointerout":ui.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":di.delete(t.pointerId)}}function js(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Ai(t),t!==null&&ku(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function kv(e,t,n,r,s){switch(t){case"focusin":return Pn=js(Pn,e,t,n,r,s),!0;case"dragenter":return Rn=js(Rn,e,t,n,r,s),!0;case"mouseover":return Tn=js(Tn,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return ui.set(i,js(ui.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,di.set(i,js(di.get(i)||null,e,t,n,r,s)),!0}return!1}function wg(e){var t=ar(e.target);if(t!==null){var n=_r(t);if(n!==null){if(t=n.tag,t===13){if(t=cg(n),t!==null){e.blockedOn=t,bg(e.priority,function(){vg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Eo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);gc=r,n.target.dispatchEvent(r),gc=null}else return t=Ai(n),t!==null&&ku(t),e.blockedOn=n,!1;t.shift()}return!0}function ef(e,t,n){Eo(e)&&n.delete(t)}function Cv(){bc=!1,Pn!==null&&Eo(Pn)&&(Pn=null),Rn!==null&&Eo(Rn)&&(Rn=null),Tn!==null&&Eo(Tn)&&(Tn=null),ui.forEach(ef),di.forEach(ef)}function Ns(e,t){e.blockedOn===t&&(e.blockedOn=null,bc||(bc=!0,ct.unstable_scheduleCallback(ct.unstable_NormalPriority,Cv)))}function fi(e){function t(s){return Ns(s,e)}if(0<eo.length){Ns(eo[0],e);for(var n=1;n<eo.length;n++){var r=eo[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Pn!==null&&Ns(Pn,e),Rn!==null&&Ns(Rn,e),Tn!==null&&Ns(Tn,e),ui.forEach(t),di.forEach(t),n=0;n<wn.length;n++)r=wn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<wn.length&&(n=wn[0],n.blockedOn===null);)wg(n),n.blockedOn===null&&wn.shift()}var Qr=un.ReactCurrentBatchConfig,Qo=!0;function jv(e,t,n,r){var s=ee,i=Qr.transition;Qr.transition=null;try{ee=1,Cu(e,t,n,r)}finally{ee=s,Qr.transition=i}}function Nv(e,t,n,r){var s=ee,i=Qr.transition;Qr.transition=null;try{ee=4,Cu(e,t,n,r)}finally{ee=s,Qr.transition=i}}function Cu(e,t,n,r){if(Qo){var s=wc(e,t,n,r);if(s===null)Nl(e,t,r,qo,n),Zd(e,r);else if(kv(s,e,t,n,r))r.stopPropagation();else if(Zd(e,r),t&4&&-1<Sv.indexOf(e)){for(;s!==null;){var i=Ai(s);if(i!==null&&xg(i),i=wc(e,t,n,r),i===null&&Nl(e,t,r,qo,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Nl(e,t,r,null,n)}}var qo=null;function wc(e,t,n,r){if(qo=null,e=wu(r),e=ar(e),e!==null)if(t=_r(e),t===null)e=null;else if(n=t.tag,n===13){if(e=cg(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return qo=e,null}function _g(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(pv()){case _u:return 1;case hg:return 4;case Ko:case gv:return 16;case pg:return 536870912;default:return 16}default:return 16}}var Sn=null,ju=null,Mo=null;function Sg(){if(Mo)return Mo;var e,t=ju,n=t.length,r,s="value"in Sn?Sn.value:Sn.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return Mo=s.slice(e,1<r?1-r:void 0)}function Po(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 to(){return!0}function tf(){return!1}function dt(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?to:tf,this.isPropagationStopped=tf,this}return pe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=to)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=to)},persist:function(){},isPersistent:to}),t}var fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nu=dt(fs),Li=pe({},fs,{view:0,detail:0}),Ev=dt(Li),vl,yl,Es,Aa=pe({},Li,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Eu,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!==Es&&(Es&&e.type==="mousemove"?(vl=e.screenX-Es.screenX,yl=e.screenY-Es.screenY):yl=vl=0,Es=e),vl)},movementY:function(e){return"movementY"in e?e.movementY:yl}}),nf=dt(Aa),Mv=pe({},Aa,{dataTransfer:0}),Pv=dt(Mv),Rv=pe({},Li,{relatedTarget:0}),bl=dt(Rv),Tv=pe({},fs,{animationName:0,elapsedTime:0,pseudoElement:0}),Ov=dt(Tv),Dv=pe({},fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lv=dt(Dv),Av=pe({},fs,{data:0}),rf=dt(Av),zv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Iv={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"},Fv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Bv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Fv[e])?!!t[e]:!1}function Eu(){return Bv}var Wv=pe({},Li,{key:function(e){if(e.key){var t=zv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Po(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Iv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Eu,charCode:function(e){return e.type==="keypress"?Po(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Po(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),$v=dt(Wv),Vv=pe({},Aa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sf=dt(Vv),Hv=pe({},Li,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Eu}),Uv=dt(Hv),Yv=pe({},fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kv=dt(Yv),Xv=pe({},Aa,{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}),Qv=dt(Xv),qv=[9,13,27,32],Mu=sn&&"CompositionEvent"in window,Xs=null;sn&&"documentMode"in document&&(Xs=document.documentMode);var Gv=sn&&"TextEvent"in window&&!Xs,kg=sn&&(!Mu||Xs&&8<Xs&&11>=Xs),of=" ",af=!1;function Cg(e,t){switch(e){case"keyup":return qv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Lr=!1;function Jv(e,t){switch(e){case"compositionend":return jg(t);case"keypress":return t.which!==32?null:(af=!0,of);case"textInput":return e=t.data,e===of&&af?null:e;default:return null}}function Zv(e,t){if(Lr)return e==="compositionend"||!Mu&&Cg(e,t)?(e=Sg(),Mo=ju=Sn=null,Lr=!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 kg&&t.locale!=="ko"?null:t.data;default:return null}}var ey={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 lf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ey[e.type]:t==="textarea"}function Ng(e,t,n,r){sg(r),t=Go(t,"onChange"),0<t.length&&(n=new Nu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Qs=null,hi=null;function ty(e){Ig(e,0)}function za(e){var t=Ir(e);if(Gp(t))return e}function ny(e,t){if(e==="change")return t}var Eg=!1;if(sn){var wl;if(sn){var _l="oninput"in document;if(!_l){var cf=document.createElement("div");cf.setAttribute("oninput","return;"),_l=typeof cf.oninput=="function"}wl=_l}else wl=!1;Eg=wl&&(!document.documentMode||9<document.documentMode)}function uf(){Qs&&(Qs.detachEvent("onpropertychange",Mg),hi=Qs=null)}function Mg(e){if(e.propertyName==="value"&&za(hi)){var t=[];Ng(t,hi,e,wu(e)),lg(ty,t)}}function ry(e,t,n){e==="focusin"?(uf(),Qs=t,hi=n,Qs.attachEvent("onpropertychange",Mg)):e==="focusout"&&uf()}function sy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return za(hi)}function iy(e,t){if(e==="click")return za(t)}function oy(e,t){if(e==="input"||e==="change")return za(t)}function ay(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tt=typeof Object.is=="function"?Object.is:ay;function pi(e,t){if(Tt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!rc.call(t,s)||!Tt(e[s],t[s]))return!1}return!0}function df(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ff(e,t){var n=df(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=df(n)}}function Pg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rg(){for(var e=window,t=Ho();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ho(e.document)}return t}function Pu(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 ly(e){var t=Rg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Pg(n.ownerDocument.documentElement,n)){if(r!==null&&Pu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=ff(n,i);var o=ff(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var cy=sn&&"documentMode"in document&&11>=document.documentMode,Ar=null,_c=null,qs=null,Sc=!1;function hf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Sc||Ar==null||Ar!==Ho(r)||(r=Ar,"selectionStart"in r&&Pu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qs&&pi(qs,r)||(qs=r,r=Go(_c,"onSelect"),0<r.length&&(t=new Nu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function no(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var zr={animationend:no("Animation","AnimationEnd"),animationiteration:no("Animation","AnimationIteration"),animationstart:no("Animation","AnimationStart"),transitionend:no("Transition","TransitionEnd")},Sl={},Tg={};sn&&(Tg=document.createElement("div").style,"AnimationEvent"in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),"TransitionEvent"in window||delete zr.transitionend.transition);function Ia(e){if(Sl[e])return Sl[e];if(!zr[e])return e;var t=zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Tg)return Sl[e]=t[n];return e}var Og=Ia("animationend"),Dg=Ia("animationiteration"),Lg=Ia("animationstart"),Ag=Ia("transitionend"),zg=new Map,pf="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 Kn(e,t){zg.set(e,t),wr(t,[e])}for(var kl=0;kl<pf.length;kl++){var Cl=pf[kl],uy=Cl.toLowerCase(),dy=Cl[0].toUpperCase()+Cl.slice(1);Kn(uy,"on"+dy)}Kn(Og,"onAnimationEnd");Kn(Dg,"onAnimationIteration");Kn(Lg,"onAnimationStart");Kn("dblclick","onDoubleClick");Kn("focusin","onFocus");Kn("focusout","onBlur");Kn(Ag,"onTransitionEnd");ns("onMouseEnter",["mouseout","mouseover"]);ns("onMouseLeave",["mouseout","mouseover"]);ns("onPointerEnter",["pointerout","pointerover"]);ns("onPointerLeave",["pointerout","pointerover"]);wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wr("onBeforeInput",["compositionend","keypress","textInput","paste"]);wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bs="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(" "),fy=new Set("cancel close invalid load scroll toggle".split(" ").concat(Bs));function gf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,uv(r,t,void 0,e),e.currentTarget=null}function Ig(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;gf(s,a,c),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;gf(s,a,c),i=l}}}if(Yo)throw e=vc,Yo=!1,vc=null,e}function ie(e,t){var n=t[Ec];n===void 0&&(n=t[Ec]=new Set);var r=e+"__bubble";n.has(r)||(Fg(t,e,2,!1),n.add(r))}function jl(e,t,n){var r=0;t&&(r|=4),Fg(n,e,r,t)}var ro="_reactListening"+Math.random().toString(36).slice(2);function gi(e){if(!e[ro]){e[ro]=!0,Yp.forEach(function(n){n!=="selectionchange"&&(fy.has(n)||jl(n,!1,e),jl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ro]||(t[ro]=!0,jl("selectionchange",!1,t))}}function Fg(e,t,n,r){switch(_g(t)){case 1:var s=jv;break;case 4:s=Nv;break;default:s=Cu}n=s.bind(null,t,n,e),s=void 0,!xc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Nl(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=ar(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}lg(function(){var c=i,d=wu(n),f=[];e:{var p=zg.get(e);if(p!==void 0){var h=Nu,g=e;switch(e){case"keypress":if(Po(n)===0)break e;case"keydown":case"keyup":h=$v;break;case"focusin":g="focus",h=bl;break;case"focusout":g="blur",h=bl;break;case"beforeblur":case"afterblur":h=bl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=nf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=Pv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Uv;break;case Og:case Dg:case Lg:h=Ov;break;case Ag:h=Kv;break;case"scroll":h=Ev;break;case"wheel":h=Qv;break;case"copy":case"cut":case"paste":h=Lv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=sf}var x=(t&4)!==0,w=!x&&e==="scroll",v=x?p!==null?p+"Capture":null:p;x=[];for(var m=c,y;m!==null;){y=m;var _=y.stateNode;if(y.tag===5&&_!==null&&(y=_,v!==null&&(_=ci(m,v),_!=null&&x.push(mi(m,_,y)))),w)break;m=m.return}0<x.length&&(p=new h(p,g,null,n,d),f.push({event:p,listeners:x}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==gc&&(g=n.relatedTarget||n.fromElement)&&(ar(g)||g[on]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(g=n.relatedTarget||n.toElement,h=c,g=g?ar(g):null,g!==null&&(w=_r(g),g!==w||g.tag!==5&&g.tag!==6)&&(g=null)):(h=null,g=c),h!==g)){if(x=nf,_="onMouseLeave",v="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(x=sf,_="onPointerLeave",v="onPointerEnter",m="pointer"),w=h==null?p:Ir(h),y=g==null?p:Ir(g),p=new x(_,m+"leave",h,n,d),p.target=w,p.relatedTarget=y,_=null,ar(d)===c&&(x=new x(v,m+"enter",g,n,d),x.target=y,x.relatedTarget=w,_=x),w=_,h&&g)t:{for(x=h,v=g,m=0,y=x;y;y=Er(y))m++;for(y=0,_=v;_;_=Er(_))y++;for(;0<m-y;)x=Er(x),m--;for(;0<y-m;)v=Er(v),y--;for(;m--;){if(x===v||v!==null&&x===v.alternate)break t;x=Er(x),v=Er(v)}x=null}else x=null;h!==null&&mf(f,p,h,x,!1),g!==null&&w!==null&&mf(f,w,g,x,!0)}}e:{if(p=c?Ir(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var k=ny;else if(lf(p))if(Eg)k=oy;else{k=sy;var S=ry}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(k=iy);if(k&&(k=k(e,c))){Ng(f,k,n,d);break e}S&&S(e,p,c),e==="focusout"&&(S=p._wrapperState)&&S.controlled&&p.type==="number"&&uc(p,"number",p.value)}switch(S=c?Ir(c):window,e){case"focusin":(lf(S)||S.contentEditable==="true")&&(Ar=S,_c=c,qs=null);break;case"focusout":qs=_c=Ar=null;break;case"mousedown":Sc=!0;break;case"contextmenu":case"mouseup":case"dragend":Sc=!1,hf(f,n,d);break;case"selectionchange":if(cy)break;case"keydown":case"keyup":hf(f,n,d)}var C;if(Mu)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else Lr?Cg(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(kg&&n.locale!=="ko"&&(Lr||j!=="onCompositionStart"?j==="onCompositionEnd"&&Lr&&(C=Sg()):(Sn=d,ju="value"in Sn?Sn.value:Sn.textContent,Lr=!0)),S=Go(c,j),0<S.length&&(j=new rf(j,e,null,n,d),f.push({event:j,listeners:S}),C?j.data=C:(C=jg(n),C!==null&&(j.data=C)))),(C=Gv?Jv(e,n):Zv(e,n))&&(c=Go(c,"onBeforeInput"),0<c.length&&(d=new rf("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:c}),d.data=C))}Ig(f,t)})}function mi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Go(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=ci(e,n),i!=null&&r.unshift(mi(e,i,s)),i=ci(e,t),i!=null&&r.push(mi(e,i,s))),e=e.return}return r}function Er(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function mf(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,s?(l=ci(n,i),l!=null&&o.unshift(mi(n,l,a))):s||(l=ci(n,i),l!=null&&o.push(mi(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var hy=/\r\n?/g,py=/\u0000|\uFFFD/g;function xf(e){return(typeof e=="string"?e:""+e).replace(hy,`
38
- `).replace(py,"")}function so(e,t,n){if(t=xf(t),xf(e)!==t&&n)throw Error(P(425))}function Jo(){}var kc=null,Cc=null;function jc(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 Nc=typeof setTimeout=="function"?setTimeout:void 0,gy=typeof clearTimeout=="function"?clearTimeout:void 0,vf=typeof Promise=="function"?Promise:void 0,my=typeof queueMicrotask=="function"?queueMicrotask:typeof vf<"u"?function(e){return vf.resolve(null).then(e).catch(xy)}:Nc;function xy(e){setTimeout(function(){throw e})}function El(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),fi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);fi(t)}function On(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 yf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var hs=Math.random().toString(36).slice(2),Ht="__reactFiber$"+hs,xi="__reactProps$"+hs,on="__reactContainer$"+hs,Ec="__reactEvents$"+hs,vy="__reactListeners$"+hs,yy="__reactHandles$"+hs;function ar(e){var t=e[Ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[on]||n[Ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=yf(e);e!==null;){if(n=e[Ht])return n;e=yf(e)}return t}e=n,n=e.parentNode}return null}function Ai(e){return e=e[Ht]||e[on],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ir(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(P(33))}function Fa(e){return e[xi]||null}var Mc=[],Fr=-1;function Xn(e){return{current:e}}function le(e){0>Fr||(e.current=Mc[Fr],Mc[Fr]=null,Fr--)}function re(e,t){Fr++,Mc[Fr]=e.current,e.current=t}var Vn={},Fe=Xn(Vn),Je=Xn(!1),pr=Vn;function rs(e,t){var n=e.type.contextTypes;if(!n)return Vn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ze(e){return e=e.childContextTypes,e!=null}function Zo(){le(Je),le(Fe)}function bf(e,t,n){if(Fe.current!==Vn)throw Error(P(168));re(Fe,t),re(Je,n)}function Bg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(P(108,rv(e)||"Unknown",s));return pe({},n,r)}function ea(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vn,pr=Fe.current,re(Fe,e),re(Je,Je.current),!0}function wf(e,t,n){var r=e.stateNode;if(!r)throw Error(P(169));n?(e=Bg(e,t,pr),r.__reactInternalMemoizedMergedChildContext=e,le(Je),le(Fe),re(Fe,e)):le(Je),re(Je,n)}var Jt=null,Ba=!1,Ml=!1;function Wg(e){Jt===null?Jt=[e]:Jt.push(e)}function by(e){Ba=!0,Wg(e)}function Qn(){if(!Ml&&Jt!==null){Ml=!0;var e=0,t=ee;try{var n=Jt;for(ee=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Jt=null,Ba=!1}catch(s){throw Jt!==null&&(Jt=Jt.slice(e+1)),fg(_u,Qn),s}finally{ee=t,Ml=!1}}return null}var Br=[],Wr=0,ta=null,na=0,gt=[],mt=0,gr=null,en=1,tn="";function sr(e,t){Br[Wr++]=na,Br[Wr++]=ta,ta=e,na=t}function $g(e,t,n){gt[mt++]=en,gt[mt++]=tn,gt[mt++]=gr,gr=e;var r=en;e=tn;var s=32-Pt(r)-1;r&=~(1<<s),n+=1;var i=32-Pt(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,en=1<<32-Pt(t)+s|n<<s|r,tn=i+e}else en=1<<i|n<<s|r,tn=e}function Ru(e){e.return!==null&&(sr(e,1),$g(e,1,0))}function Tu(e){for(;e===ta;)ta=Br[--Wr],Br[Wr]=null,na=Br[--Wr],Br[Wr]=null;for(;e===gr;)gr=gt[--mt],gt[mt]=null,tn=gt[--mt],gt[mt]=null,en=gt[--mt],gt[mt]=null}var lt=null,at=null,ce=!1,Mt=null;function Vg(e,t){var n=xt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function _f(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,lt=e,at=On(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,lt=e,at=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=gr!==null?{id:en,overflow:tn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=xt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,lt=e,at=null,!0):!1;default:return!1}}function Pc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Rc(e){if(ce){var t=at;if(t){var n=t;if(!_f(e,t)){if(Pc(e))throw Error(P(418));t=On(n.nextSibling);var r=lt;t&&_f(e,t)?Vg(r,n):(e.flags=e.flags&-4097|2,ce=!1,lt=e)}}else{if(Pc(e))throw Error(P(418));e.flags=e.flags&-4097|2,ce=!1,lt=e}}}function Sf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;lt=e}function io(e){if(e!==lt)return!1;if(!ce)return Sf(e),ce=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!jc(e.type,e.memoizedProps)),t&&(t=at)){if(Pc(e))throw Hg(),Error(P(418));for(;t;)Vg(e,t),t=On(t.nextSibling)}if(Sf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(P(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){at=On(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}at=null}}else at=lt?On(e.stateNode.nextSibling):null;return!0}function Hg(){for(var e=at;e;)e=On(e.nextSibling)}function ss(){at=lt=null,ce=!1}function Ou(e){Mt===null?Mt=[e]:Mt.push(e)}var wy=un.ReactCurrentBatchConfig;function Ms(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(P(309));var r=n.stateNode}if(!r)throw Error(P(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(P(284));if(!n._owner)throw Error(P(290,e))}return e}function oo(e,t){throw e=Object.prototype.toString.call(t),Error(P(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function kf(e){var t=e._init;return t(e._payload)}function Ug(e){function t(v,m){if(e){var y=v.deletions;y===null?(v.deletions=[m],v.flags|=16):y.push(m)}}function n(v,m){if(!e)return null;for(;m!==null;)t(v,m),m=m.sibling;return null}function r(v,m){for(v=new Map;m!==null;)m.key!==null?v.set(m.key,m):v.set(m.index,m),m=m.sibling;return v}function s(v,m){return v=zn(v,m),v.index=0,v.sibling=null,v}function i(v,m,y){return v.index=y,e?(y=v.alternate,y!==null?(y=y.index,y<m?(v.flags|=2,m):y):(v.flags|=2,m)):(v.flags|=1048576,m)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function a(v,m,y,_){return m===null||m.tag!==6?(m=Al(y,v.mode,_),m.return=v,m):(m=s(m,y),m.return=v,m)}function l(v,m,y,_){var k=y.type;return k===Dr?d(v,m,y.props.children,_,y.key):m!==null&&(m.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===vn&&kf(k)===m.type)?(_=s(m,y.props),_.ref=Ms(v,m,y),_.return=v,_):(_=zo(y.type,y.key,y.props,null,v.mode,_),_.ref=Ms(v,m,y),_.return=v,_)}function c(v,m,y,_){return m===null||m.tag!==4||m.stateNode.containerInfo!==y.containerInfo||m.stateNode.implementation!==y.implementation?(m=zl(y,v.mode,_),m.return=v,m):(m=s(m,y.children||[]),m.return=v,m)}function d(v,m,y,_,k){return m===null||m.tag!==7?(m=fr(y,v.mode,_,k),m.return=v,m):(m=s(m,y),m.return=v,m)}function f(v,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Al(""+m,v.mode,y),m.return=v,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Qi:return y=zo(m.type,m.key,m.props,null,v.mode,y),y.ref=Ms(v,null,m),y.return=v,y;case Or:return m=zl(m,v.mode,y),m.return=v,m;case vn:var _=m._init;return f(v,_(m._payload),y)}if(Is(m)||ks(m))return m=fr(m,v.mode,y,null),m.return=v,m;oo(v,m)}return null}function p(v,m,y,_){var k=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return k!==null?null:a(v,m,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Qi:return y.key===k?l(v,m,y,_):null;case Or:return y.key===k?c(v,m,y,_):null;case vn:return k=y._init,p(v,m,k(y._payload),_)}if(Is(y)||ks(y))return k!==null?null:d(v,m,y,_,null);oo(v,y)}return null}function h(v,m,y,_,k){if(typeof _=="string"&&_!==""||typeof _=="number")return v=v.get(y)||null,a(m,v,""+_,k);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Qi:return v=v.get(_.key===null?y:_.key)||null,l(m,v,_,k);case Or:return v=v.get(_.key===null?y:_.key)||null,c(m,v,_,k);case vn:var S=_._init;return h(v,m,y,S(_._payload),k)}if(Is(_)||ks(_))return v=v.get(y)||null,d(m,v,_,k,null);oo(m,_)}return null}function g(v,m,y,_){for(var k=null,S=null,C=m,j=m=0,R=null;C!==null&&j<y.length;j++){C.index>j?(R=C,C=null):R=C.sibling;var M=p(v,C,y[j],_);if(M===null){C===null&&(C=R);break}e&&C&&M.alternate===null&&t(v,C),m=i(M,m,j),S===null?k=M:S.sibling=M,S=M,C=R}if(j===y.length)return n(v,C),ce&&sr(v,j),k;if(C===null){for(;j<y.length;j++)C=f(v,y[j],_),C!==null&&(m=i(C,m,j),S===null?k=C:S.sibling=C,S=C);return ce&&sr(v,j),k}for(C=r(v,C);j<y.length;j++)R=h(C,v,j,y[j],_),R!==null&&(e&&R.alternate!==null&&C.delete(R.key===null?j:R.key),m=i(R,m,j),S===null?k=R:S.sibling=R,S=R);return e&&C.forEach(function(N){return t(v,N)}),ce&&sr(v,j),k}function x(v,m,y,_){var k=ks(y);if(typeof k!="function")throw Error(P(150));if(y=k.call(y),y==null)throw Error(P(151));for(var S=k=null,C=m,j=m=0,R=null,M=y.next();C!==null&&!M.done;j++,M=y.next()){C.index>j?(R=C,C=null):R=C.sibling;var N=p(v,C,M.value,_);if(N===null){C===null&&(C=R);break}e&&C&&N.alternate===null&&t(v,C),m=i(N,m,j),S===null?k=N:S.sibling=N,S=N,C=R}if(M.done)return n(v,C),ce&&sr(v,j),k;if(C===null){for(;!M.done;j++,M=y.next())M=f(v,M.value,_),M!==null&&(m=i(M,m,j),S===null?k=M:S.sibling=M,S=M);return ce&&sr(v,j),k}for(C=r(v,C);!M.done;j++,M=y.next())M=h(C,v,j,M.value,_),M!==null&&(e&&M.alternate!==null&&C.delete(M.key===null?j:M.key),m=i(M,m,j),S===null?k=M:S.sibling=M,S=M);return e&&C.forEach(function(D){return t(v,D)}),ce&&sr(v,j),k}function w(v,m,y,_){if(typeof y=="object"&&y!==null&&y.type===Dr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Qi:e:{for(var k=y.key,S=m;S!==null;){if(S.key===k){if(k=y.type,k===Dr){if(S.tag===7){n(v,S.sibling),m=s(S,y.props.children),m.return=v,v=m;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===vn&&kf(k)===S.type){n(v,S.sibling),m=s(S,y.props),m.ref=Ms(v,S,y),m.return=v,v=m;break e}n(v,S);break}else t(v,S);S=S.sibling}y.type===Dr?(m=fr(y.props.children,v.mode,_,y.key),m.return=v,v=m):(_=zo(y.type,y.key,y.props,null,v.mode,_),_.ref=Ms(v,m,y),_.return=v,v=_)}return o(v);case Or:e:{for(S=y.key;m!==null;){if(m.key===S)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){n(v,m.sibling),m=s(m,y.children||[]),m.return=v,v=m;break e}else{n(v,m);break}else t(v,m);m=m.sibling}m=zl(y,v.mode,_),m.return=v,v=m}return o(v);case vn:return S=y._init,w(v,m,S(y._payload),_)}if(Is(y))return g(v,m,y,_);if(ks(y))return x(v,m,y,_);oo(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(n(v,m.sibling),m=s(m,y),m.return=v,v=m):(n(v,m),m=Al(y,v.mode,_),m.return=v,v=m),o(v)):n(v,m)}return w}var is=Ug(!0),Yg=Ug(!1),ra=Xn(null),sa=null,$r=null,Du=null;function Lu(){Du=$r=sa=null}function Au(e){var t=ra.current;le(ra),e._currentValue=t}function Tc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function qr(e,t){sa=e,Du=$r=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qe=!0),e.firstContext=null)}function bt(e){var t=e._currentValue;if(Du!==e)if(e={context:e,memoizedValue:t,next:null},$r===null){if(sa===null)throw Error(P(308));$r=e,sa.dependencies={lanes:0,firstContext:e}}else $r=$r.next=e;return t}var lr=null;function zu(e){lr===null?lr=[e]:lr.push(e)}function Kg(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,zu(t)):(n.next=s.next,s.next=n),t.interleaved=n,an(e,r)}function an(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var yn=!1;function Iu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xg(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 rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Dn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,an(e,n)}return s=r.interleaved,s===null?(t.next=t,zu(r)):(t.next=s.next,s.next=t),r.interleaved=t,an(e,n)}function Ro(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Su(e,n)}}function Cf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ia(e,t,n,r){var s=e.updateQueue;yn=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,d=c=l=null,a=i;do{var p=a.lane,h=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,x=a;switch(p=t,h=n,x.tag){case 1:if(g=x.payload,typeof g=="function"){f=g.call(h,f,p);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=x.payload,p=typeof g=="function"?g.call(h,f,p):g,p==null)break e;f=pe({},f,p);break e;case 2:yn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=h,l=f):d=d.next=h,o|=p;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;p=a,a=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);xr|=o,e.lanes=o,e.memoizedState=f}}function jf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(P(191,s));s.call(r)}}}var zi={},Yt=Xn(zi),vi=Xn(zi),yi=Xn(zi);function cr(e){if(e===zi)throw Error(P(174));return e}function Fu(e,t){switch(re(yi,t),re(vi,e),re(Yt,zi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fc(t,e)}le(Yt),re(Yt,t)}function os(){le(Yt),le(vi),le(yi)}function Qg(e){cr(yi.current);var t=cr(Yt.current),n=fc(t,e.type);t!==n&&(re(vi,e),re(Yt,n))}function Bu(e){vi.current===e&&(le(Yt),le(vi))}var de=Xn(0);function oa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 Pl=[];function Wu(){for(var e=0;e<Pl.length;e++)Pl[e]._workInProgressVersionPrimary=null;Pl.length=0}var To=un.ReactCurrentDispatcher,Rl=un.ReactCurrentBatchConfig,mr=0,he=null,_e=null,je=null,aa=!1,Gs=!1,bi=0,_y=0;function Le(){throw Error(P(321))}function $u(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Tt(e[n],t[n]))return!1;return!0}function Vu(e,t,n,r,s,i){if(mr=i,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,To.current=e===null||e.memoizedState===null?jy:Ny,e=n(r,s),Gs){i=0;do{if(Gs=!1,bi=0,25<=i)throw Error(P(301));i+=1,je=_e=null,t.updateQueue=null,To.current=Ey,e=n(r,s)}while(Gs)}if(To.current=la,t=_e!==null&&_e.next!==null,mr=0,je=_e=he=null,aa=!1,t)throw Error(P(300));return e}function Hu(){var e=bi!==0;return bi=0,e}function Wt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return je===null?he.memoizedState=je=e:je=je.next=e,je}function wt(){if(_e===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=_e.next;var t=je===null?he.memoizedState:je.next;if(t!==null)je=t,_e=e;else{if(e===null)throw Error(P(310));_e=e,e={memoizedState:_e.memoizedState,baseState:_e.baseState,baseQueue:_e.baseQueue,queue:_e.queue,next:null},je===null?he.memoizedState=je=e:je=je.next=e}return je}function wi(e,t){return typeof t=="function"?t(e):t}function Tl(e){var t=wt(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=_e,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,c=i;do{var d=c.lane;if((mr&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,he.lanes|=d,xr|=d}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,Tt(r,t.memoizedState)||(Qe=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,he.lanes|=i,xr|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ol(e){var t=wt(),n=t.queue;if(n===null)throw Error(P(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);Tt(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function qg(){}function Gg(e,t){var n=he,r=wt(),s=t(),i=!Tt(r.memoizedState,s);if(i&&(r.memoizedState=s,Qe=!0),r=r.queue,Uu(em.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||je!==null&&je.memoizedState.tag&1){if(n.flags|=2048,_i(9,Zg.bind(null,n,r,s,t),void 0,null),Me===null)throw Error(P(349));mr&30||Jg(n,t,s)}return s}function Jg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Zg(e,t,n,r){t.value=n,t.getSnapshot=r,tm(t)&&nm(e)}function em(e,t,n){return n(function(){tm(t)&&nm(e)})}function tm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Tt(e,n)}catch{return!0}}function nm(e){var t=an(e,1);t!==null&&Rt(t,e,1,-1)}function Nf(e){var t=Wt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:e},t.queue=e,e=e.dispatch=Cy.bind(null,he,e),[t.memoizedState,e]}function _i(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function rm(){return wt().memoizedState}function Oo(e,t,n,r){var s=Wt();he.flags|=e,s.memoizedState=_i(1|t,n,void 0,r===void 0?null:r)}function Wa(e,t,n,r){var s=wt();r=r===void 0?null:r;var i=void 0;if(_e!==null){var o=_e.memoizedState;if(i=o.destroy,r!==null&&$u(r,o.deps)){s.memoizedState=_i(t,n,i,r);return}}he.flags|=e,s.memoizedState=_i(1|t,n,i,r)}function Ef(e,t){return Oo(8390656,8,e,t)}function Uu(e,t){return Wa(2048,8,e,t)}function sm(e,t){return Wa(4,2,e,t)}function im(e,t){return Wa(4,4,e,t)}function om(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 am(e,t,n){return n=n!=null?n.concat([e]):null,Wa(4,4,om.bind(null,t,e),n)}function Yu(){}function lm(e,t){var n=wt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&$u(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function cm(e,t){var n=wt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&$u(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function um(e,t,n){return mr&21?(Tt(n,t)||(n=gg(),he.lanes|=n,xr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Qe=!0),e.memoizedState=n)}function Sy(e,t){var n=ee;ee=n!==0&&4>n?n:4,e(!0);var r=Rl.transition;Rl.transition={};try{e(!1),t()}finally{ee=n,Rl.transition=r}}function dm(){return wt().memoizedState}function ky(e,t,n){var r=An(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fm(e))hm(t,n);else if(n=Kg(e,t,n,r),n!==null){var s=$e();Rt(n,e,r,s),pm(n,t,r)}}function Cy(e,t,n){var r=An(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fm(e))hm(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Tt(a,o)){var l=t.interleaved;l===null?(s.next=s,zu(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=Kg(e,t,s,r),n!==null&&(s=$e(),Rt(n,e,r,s),pm(n,t,r))}}function fm(e){var t=e.alternate;return e===he||t!==null&&t===he}function hm(e,t){Gs=aa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function pm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Su(e,n)}}var la={readContext:bt,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},jy={readContext:bt,useCallback:function(e,t){return Wt().memoizedState=[e,t===void 0?null:t],e},useContext:bt,useEffect:Ef,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Oo(4194308,4,om.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Oo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Oo(4,2,e,t)},useMemo:function(e,t){var n=Wt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Wt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ky.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=Wt();return e={current:e},t.memoizedState=e},useState:Nf,useDebugValue:Yu,useDeferredValue:function(e){return Wt().memoizedState=e},useTransition:function(){var e=Nf(!1),t=e[0];return e=Sy.bind(null,e[1]),Wt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=he,s=Wt();if(ce){if(n===void 0)throw Error(P(407));n=n()}else{if(n=t(),Me===null)throw Error(P(349));mr&30||Jg(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Ef(em.bind(null,r,i,e),[e]),r.flags|=2048,_i(9,Zg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Wt(),t=Me.identifierPrefix;if(ce){var n=tn,r=en;n=(r&~(1<<32-Pt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=bi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=_y++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ny={readContext:bt,useCallback:lm,useContext:bt,useEffect:Uu,useImperativeHandle:am,useInsertionEffect:sm,useLayoutEffect:im,useMemo:cm,useReducer:Tl,useRef:rm,useState:function(){return Tl(wi)},useDebugValue:Yu,useDeferredValue:function(e){var t=wt();return um(t,_e.memoizedState,e)},useTransition:function(){var e=Tl(wi)[0],t=wt().memoizedState;return[e,t]},useMutableSource:qg,useSyncExternalStore:Gg,useId:dm,unstable_isNewReconciler:!1},Ey={readContext:bt,useCallback:lm,useContext:bt,useEffect:Uu,useImperativeHandle:am,useInsertionEffect:sm,useLayoutEffect:im,useMemo:cm,useReducer:Ol,useRef:rm,useState:function(){return Ol(wi)},useDebugValue:Yu,useDeferredValue:function(e){var t=wt();return _e===null?t.memoizedState=e:um(t,_e.memoizedState,e)},useTransition:function(){var e=Ol(wi)[0],t=wt().memoizedState;return[e,t]},useMutableSource:qg,useSyncExternalStore:Gg,useId:dm,unstable_isNewReconciler:!1};function Nt(e,t){if(e&&e.defaultProps){t=pe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Oc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:pe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $a={isMounted:function(e){return(e=e._reactInternals)?_r(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=$e(),s=An(e),i=rn(r,s);i.payload=t,n!=null&&(i.callback=n),t=Dn(e,i,s),t!==null&&(Rt(t,e,s,r),Ro(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=$e(),s=An(e),i=rn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Dn(e,i,s),t!==null&&(Rt(t,e,s,r),Ro(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$e(),r=An(e),s=rn(n,r);s.tag=2,t!=null&&(s.callback=t),t=Dn(e,s,r),t!==null&&(Rt(t,e,r,n),Ro(t,e,r))}};function Mf(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!pi(n,r)||!pi(s,i):!0}function gm(e,t,n){var r=!1,s=Vn,i=t.contextType;return typeof i=="object"&&i!==null?i=bt(i):(s=Ze(t)?pr:Fe.current,r=t.contextTypes,i=(r=r!=null)?rs(e,s):Vn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=$a,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Pf(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&$a.enqueueReplaceState(t,t.state,null)}function Dc(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Iu(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=bt(i):(i=Ze(t)?pr:Fe.current,s.context=rs(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Oc(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&$a.enqueueReplaceState(s,s.state,null),ia(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function as(e,t){try{var n="",r=t;do n+=nv(r),r=r.return;while(r);var s=n}catch(i){s=`
39
- Error generating stack: `+i.message+`
40
- `+i.stack}return{value:e,source:t,stack:s,digest:null}}function Dl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Lc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var My=typeof WeakMap=="function"?WeakMap:Map;function mm(e,t,n){n=rn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ua||(ua=!0,Uc=r),Lc(e,t)},n}function xm(e,t,n){n=rn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Lc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Lc(e,t),typeof r!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Rf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new My;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Vy.bind(null,e,t,n),t.then(e,e))}function Tf(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 Of(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=rn(-1,1),t.tag=2,Dn(n,t,1))),n.lanes|=1),e)}var Py=un.ReactCurrentOwner,Qe=!1;function We(e,t,n,r){t.child=e===null?Yg(t,null,n,r):is(t,e.child,n,r)}function Df(e,t,n,r,s){n=n.render;var i=t.ref;return qr(t,s),r=Vu(e,t,n,r,i,s),n=Hu(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ln(e,t,s)):(ce&&n&&Ru(t),t.flags|=1,We(e,t,r,s),t.child)}function Lf(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!ed(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,vm(e,t,i,r,s)):(e=zo(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:pi,n(o,r)&&e.ref===t.ref)return ln(e,t,s)}return t.flags|=1,e=zn(i,r),e.ref=t.ref,e.return=t,t.child=e}function vm(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(pi(i,r)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Qe=!0);else return t.lanes=e.lanes,ln(e,t,s)}return Ac(e,t,n,r,s)}function ym(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},re(Hr,ot),ot|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,re(Hr,ot),ot|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,re(Hr,ot),ot|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,re(Hr,ot),ot|=r;return We(e,t,s,n),t.child}function bm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ac(e,t,n,r,s){var i=Ze(n)?pr:Fe.current;return i=rs(t,i),qr(t,s),n=Vu(e,t,n,r,i,s),r=Hu(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ln(e,t,s)):(ce&&r&&Ru(t),t.flags|=1,We(e,t,n,s),t.child)}function Af(e,t,n,r,s){if(Ze(n)){var i=!0;ea(t)}else i=!1;if(qr(t,s),t.stateNode===null)Do(e,t),gm(t,n,r),Dc(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=bt(c):(c=Ze(n)?pr:Fe.current,c=rs(t,c));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Pf(t,o,r,c),yn=!1;var p=t.memoizedState;o.state=p,ia(t,r,o,s),l=t.memoizedState,a!==r||p!==l||Je.current||yn?(typeof d=="function"&&(Oc(t,n,d,r),l=t.memoizedState),(a=yn||Mf(t,n,a,r,p,l,c))?(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=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Xg(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Nt(t.type,a),o.props=c,f=t.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=bt(l):(l=Ze(n)?pr:Fe.current,l=rs(t,l));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||p!==l)&&Pf(t,o,r,l),yn=!1,p=t.memoizedState,o.state=p,ia(t,r,o,s);var g=t.memoizedState;a!==f||p!==g||Je.current||yn?(typeof h=="function"&&(Oc(t,n,h,r),g=t.memoizedState),(c=yn||Mf(t,n,c,r,p,g,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),o.props=r,o.state=g,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return zc(e,t,n,r,i,s)}function zc(e,t,n,r,s,i){bm(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&wf(t,n,!1),ln(e,t,i);r=t.stateNode,Py.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=is(t,e.child,null,i),t.child=is(t,null,a,i)):We(e,t,a,i),t.memoizedState=r.state,s&&wf(t,n,!0),t.child}function wm(e){var t=e.stateNode;t.pendingContext?bf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&bf(e,t.context,!1),Fu(e,t.containerInfo)}function zf(e,t,n,r,s){return ss(),Ou(s),t.flags|=256,We(e,t,n,r),t.child}var Ic={dehydrated:null,treeContext:null,retryLane:0};function Fc(e){return{baseLanes:e,cachePool:null,transitions:null}}function _m(e,t,n){var r=t.pendingProps,s=de.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),re(de,s&1),e===null)return Rc(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=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Ua(o,r,0,null),e=fr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Fc(n),t.memoizedState=Ic,e):Ku(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Ry(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=zn(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=zn(a,i):(i=fr(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Fc(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Ic,r}return i=e.child,e=i.sibling,r=zn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ku(e,t){return t=Ua({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ao(e,t,n,r){return r!==null&&Ou(r),is(t,e.child,null,n),e=Ku(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ry(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=Dl(Error(P(422))),ao(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Ua({mode:"visible",children:r.children},s,0,null),i=fr(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&is(t,e.child,null,o),t.child.memoizedState=Fc(o),t.memoizedState=Ic,i);if(!(t.mode&1))return ao(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(P(419)),r=Dl(i,r,void 0),ao(e,t,o,r)}if(a=(o&e.childLanes)!==0,Qe||a){if(r=Me,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,an(e,s),Rt(r,e,s,-1))}return Zu(),r=Dl(Error(P(421))),ao(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Hy.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,at=On(s.nextSibling),lt=t,ce=!0,Mt=null,e!==null&&(gt[mt++]=en,gt[mt++]=tn,gt[mt++]=gr,en=e.id,tn=e.overflow,gr=t),t=Ku(t,r.children),t.flags|=4096,t)}function If(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Tc(e.return,t,n)}function Ll(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function Sm(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(We(e,t,r.children,n),r=de.current,r&2)r=r&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&&If(e,n,t);else if(e.tag===19)If(e,n,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}r&=1}if(re(de,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&oa(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Ll(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&oa(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Ll(t,!0,n,null,i);break;case"together":Ll(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Do(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(P(153));if(t.child!==null){for(e=t.child,n=zn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=zn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ty(e,t,n){switch(t.tag){case 3:wm(t),ss();break;case 5:Qg(t);break;case 1:Ze(t.type)&&ea(t);break;case 4:Fu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;re(ra,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(re(de,de.current&1),t.flags|=128,null):n&t.child.childLanes?_m(e,t,n):(re(de,de.current&1),e=ln(e,t,n),e!==null?e.sibling:null);re(de,de.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Sm(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),re(de,de.current),r)break;return null;case 22:case 23:return t.lanes=0,ym(e,t,n)}return ln(e,t,n)}var km,Bc,Cm,jm;km=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Bc=function(){};Cm=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,cr(Yt.current);var i=null;switch(n){case"input":s=lc(e,s),r=lc(e,r),i=[];break;case"select":s=pe({},s,{value:void 0}),r=pe({},r,{value:void 0}),i=[];break;case"textarea":s=dc(e,s),r=dc(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Jo)}hc(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ai.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ai.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ie("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};jm=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ps(e,t){if(!ce)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ae(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Oy(e,t,n){var r=t.pendingProps;switch(Tu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ae(t),null;case 1:return Ze(t.type)&&Zo(),Ae(t),null;case 3:return r=t.stateNode,os(),le(Je),le(Fe),Wu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(io(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Mt!==null&&(Xc(Mt),Mt=null))),Bc(e,t),Ae(t),null;case 5:Bu(t);var s=cr(yi.current);if(n=t.type,e!==null&&t.stateNode!=null)Cm(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(P(166));return Ae(t),null}if(e=cr(Yt.current),io(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Ht]=t,r[xi]=i,e=(t.mode&1)!==0,n){case"dialog":ie("cancel",r),ie("close",r);break;case"iframe":case"object":case"embed":ie("load",r);break;case"video":case"audio":for(s=0;s<Bs.length;s++)ie(Bs[s],r);break;case"source":ie("error",r);break;case"img":case"image":case"link":ie("error",r),ie("load",r);break;case"details":ie("toggle",r);break;case"input":Yd(r,i),ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ie("invalid",r);break;case"textarea":Xd(r,i),ie("invalid",r)}hc(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&so(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&so(r.textContent,a,e),s=["children",""+a]):ai.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ie("scroll",r)}switch(n){case"input":qi(r),Kd(r,i,!0);break;case"textarea":qi(r),Qd(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Jo)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=eg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Ht]=t,e[xi]=r,km(e,t,!1,!1),t.stateNode=e;e:{switch(o=pc(n,r),n){case"dialog":ie("cancel",e),ie("close",e),s=r;break;case"iframe":case"object":case"embed":ie("load",e),s=r;break;case"video":case"audio":for(s=0;s<Bs.length;s++)ie(Bs[s],e);s=r;break;case"source":ie("error",e),s=r;break;case"img":case"image":case"link":ie("error",e),ie("load",e),s=r;break;case"details":ie("toggle",e),s=r;break;case"input":Yd(e,r),s=lc(e,r),ie("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=pe({},r,{value:void 0}),ie("invalid",e);break;case"textarea":Xd(e,r),s=dc(e,r),ie("invalid",e);break;default:s=r}hc(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?rg(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&tg(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&li(e,l):typeof l=="number"&&li(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ai.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ie("scroll",e):l!=null&&xu(e,i,l,o))}switch(n){case"input":qi(e),Kd(e,r,!1);break;case"textarea":qi(e),Qd(e);break;case"option":r.value!=null&&e.setAttribute("value",""+$n(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Yr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Yr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Jo)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ae(t),null;case 6:if(e&&t.stateNode!=null)jm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(P(166));if(n=cr(yi.current),cr(Yt.current),io(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ht]=t,(i=r.nodeValue!==n)&&(e=lt,e!==null))switch(e.tag){case 3:so(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&so(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ht]=t,t.stateNode=r}return Ae(t),null;case 13:if(le(de),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ce&&at!==null&&t.mode&1&&!(t.flags&128))Hg(),ss(),t.flags|=98560,i=!1;else if(i=io(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(P(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(P(317));i[Ht]=t}else ss(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ae(t),i=!1}else Mt!==null&&(Xc(Mt),Mt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||de.current&1?ke===0&&(ke=3):Zu())),t.updateQueue!==null&&(t.flags|=4),Ae(t),null);case 4:return os(),Bc(e,t),e===null&&gi(t.stateNode.containerInfo),Ae(t),null;case 10:return Au(t.type._context),Ae(t),null;case 17:return Ze(t.type)&&Zo(),Ae(t),null;case 19:if(le(de),i=t.memoizedState,i===null)return Ae(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)Ps(i,!1);else{if(ke!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=oa(e),o!==null){for(t.flags|=128,Ps(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,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}),n=n.sibling;return re(de,de.current&1|2),t.child}e=e.sibling}i.tail!==null&&xe()>ls&&(t.flags|=128,r=!0,Ps(i,!1),t.lanes=4194304)}else{if(!r)if(e=oa(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ps(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!ce)return Ae(t),null}else 2*xe()-i.renderingStartTime>ls&&n!==1073741824&&(t.flags|=128,r=!0,Ps(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=xe(),t.sibling=null,n=de.current,re(de,r?n&1|2:n&1),t):(Ae(t),null);case 22:case 23:return Ju(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ot&1073741824&&(Ae(t),t.subtreeFlags&6&&(t.flags|=8192)):Ae(t),null;case 24:return null;case 25:return null}throw Error(P(156,t.tag))}function Dy(e,t){switch(Tu(t),t.tag){case 1:return Ze(t.type)&&Zo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return os(),le(Je),le(Fe),Wu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Bu(t),null;case 13:if(le(de),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(P(340));ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(de),null;case 4:return os(),null;case 10:return Au(t.type._context),null;case 22:case 23:return Ju(),null;case 24:return null;default:return null}}var lo=!1,ze=!1,Ly=typeof WeakSet=="function"?WeakSet:Set,O=null;function Vr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ge(e,t,r)}else n.current=null}function Wc(e,t,n){try{n()}catch(r){ge(e,t,r)}}var Ff=!1;function Ay(e,t){if(kc=Qo,e=Rg(),Pu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++c===s&&(a=o),p===i&&++d===r&&(l=o),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Cc={focusedElem:e,selectionRange:n},Qo=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var x=g.memoizedProps,w=g.memoizedState,v=t.stateNode,m=v.getSnapshotBeforeUpdate(t.elementType===t.type?x:Nt(t.type,x),w);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(_){ge(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return g=Ff,Ff=!1,g}function Js(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Wc(t,n,i)}s=s.next}while(s!==r)}}function Va(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function $c(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Nm(e){var t=e.alternate;t!==null&&(e.alternate=null,Nm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ht],delete t[xi],delete t[Ec],delete t[vy],delete t[yy])),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 Em(e){return e.tag===5||e.tag===3||e.tag===4}function Bf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Em(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 Vc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jo));else if(r!==4&&(e=e.child,e!==null))for(Vc(e,t,n),e=e.sibling;e!==null;)Vc(e,t,n),e=e.sibling}function Hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Hc(e,t,n),e=e.sibling;e!==null;)Hc(e,t,n),e=e.sibling}var Re=null,Et=!1;function mn(e,t,n){for(n=n.child;n!==null;)Mm(e,t,n),n=n.sibling}function Mm(e,t,n){if(Ut&&typeof Ut.onCommitFiberUnmount=="function")try{Ut.onCommitFiberUnmount(La,n)}catch{}switch(n.tag){case 5:ze||Vr(n,t);case 6:var r=Re,s=Et;Re=null,mn(e,t,n),Re=r,Et=s,Re!==null&&(Et?(e=Re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Re.removeChild(n.stateNode));break;case 18:Re!==null&&(Et?(e=Re,n=n.stateNode,e.nodeType===8?El(e.parentNode,n):e.nodeType===1&&El(e,n),fi(e)):El(Re,n.stateNode));break;case 4:r=Re,s=Et,Re=n.stateNode.containerInfo,Et=!0,mn(e,t,n),Re=r,Et=s;break;case 0:case 11:case 14:case 15:if(!ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Wc(n,t,o),s=s.next}while(s!==r)}mn(e,t,n);break;case 1:if(!ze&&(Vr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ge(n,t,a)}mn(e,t,n);break;case 21:mn(e,t,n);break;case 22:n.mode&1?(ze=(r=ze)||n.memoizedState!==null,mn(e,t,n),ze=r):mn(e,t,n);break;default:mn(e,t,n)}}function Wf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ly),t.forEach(function(r){var s=Uy.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Ct(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Re=a.stateNode,Et=!1;break e;case 3:Re=a.stateNode.containerInfo,Et=!0;break e;case 4:Re=a.stateNode.containerInfo,Et=!0;break e}a=a.return}if(Re===null)throw Error(P(160));Mm(i,o,s),Re=null,Et=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){ge(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Pm(t,e),t=t.sibling}function Pm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ct(t,e),It(e),r&4){try{Js(3,e,e.return),Va(3,e)}catch(x){ge(e,e.return,x)}try{Js(5,e,e.return)}catch(x){ge(e,e.return,x)}}break;case 1:Ct(t,e),It(e),r&512&&n!==null&&Vr(n,n.return);break;case 5:if(Ct(t,e),It(e),r&512&&n!==null&&Vr(n,n.return),e.flags&32){var s=e.stateNode;try{li(s,"")}catch(x){ge(e,e.return,x)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Jp(s,i),pc(a,o);var c=pc(a,i);for(o=0;o<l.length;o+=2){var d=l[o],f=l[o+1];d==="style"?rg(s,f):d==="dangerouslySetInnerHTML"?tg(s,f):d==="children"?li(s,f):xu(s,d,f,c)}switch(a){case"input":cc(s,i);break;case"textarea":Zp(s,i);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Yr(s,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?Yr(s,!!i.multiple,i.defaultValue,!0):Yr(s,!!i.multiple,i.multiple?[]:"",!1))}s[xi]=i}catch(x){ge(e,e.return,x)}}break;case 6:if(Ct(t,e),It(e),r&4){if(e.stateNode===null)throw Error(P(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(x){ge(e,e.return,x)}}break;case 3:if(Ct(t,e),It(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{fi(t.containerInfo)}catch(x){ge(e,e.return,x)}break;case 4:Ct(t,e),It(e);break;case 13:Ct(t,e),It(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(qu=xe())),r&4&&Wf(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(ze=(c=ze)||d,Ct(t,e),ze=c):Ct(t,e),It(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(O=e,d=e.child;d!==null;){for(f=O=d;O!==null;){switch(p=O,h=p.child,p.tag){case 0:case 11:case 14:case 15:Js(4,p,p.return);break;case 1:Vr(p,p.return);var g=p.stateNode;if(typeof g.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(x){ge(r,n,x)}}break;case 5:Vr(p,p.return);break;case 22:if(p.memoizedState!==null){Vf(f);continue}}h!==null?(h.return=p,O=h):Vf(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=ng("display",o))}catch(x){ge(e,e.return,x)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(x){ge(e,e.return,x)}}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:Ct(t,e),It(e),r&4&&Wf(e);break;case 21:break;default:Ct(t,e),It(e)}}function It(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Em(n)){var r=n;break e}n=n.return}throw Error(P(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(li(s,""),r.flags&=-33);var i=Bf(e);Hc(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Bf(e);Vc(e,a,o);break;default:throw Error(P(161))}}catch(l){ge(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zy(e,t,n){O=e,Rm(e)}function Rm(e,t,n){for(var r=(e.mode&1)!==0;O!==null;){var s=O,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||lo;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||ze;a=lo;var c=ze;if(lo=o,(ze=l)&&!c)for(O=s;O!==null;)o=O,l=o.child,o.tag===22&&o.memoizedState!==null?Hf(s):l!==null?(l.return=o,O=l):Hf(s);for(;i!==null;)O=i,Rm(i),i=i.sibling;O=s,lo=a,ze=c}$f(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,O=i):$f(e)}}function $f(e){for(;O!==null;){var t=O;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ze||Va(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ze)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Nt(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&jf(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}jf(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&fi(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(P(163))}ze||t.flags&512&&$c(t)}catch(p){ge(t,t.return,p)}}if(t===e){O=null;break}if(n=t.sibling,n!==null){n.return=t.return,O=n;break}O=t.return}}function Vf(e){for(;O!==null;){var t=O;if(t===e){O=null;break}var n=t.sibling;if(n!==null){n.return=t.return,O=n;break}O=t.return}}function Hf(e){for(;O!==null;){var t=O;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Va(4,t)}catch(l){ge(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){ge(t,s,l)}}var i=t.return;try{$c(t)}catch(l){ge(t,i,l)}break;case 5:var o=t.return;try{$c(t)}catch(l){ge(t,o,l)}}}catch(l){ge(t,t.return,l)}if(t===e){O=null;break}var a=t.sibling;if(a!==null){a.return=t.return,O=a;break}O=t.return}}var Iy=Math.ceil,ca=un.ReactCurrentDispatcher,Xu=un.ReactCurrentOwner,vt=un.ReactCurrentBatchConfig,X=0,Me=null,be=null,Te=0,ot=0,Hr=Xn(0),ke=0,Si=null,xr=0,Ha=0,Qu=0,Zs=null,Ke=null,qu=0,ls=1/0,Gt=null,ua=!1,Uc=null,Ln=null,co=!1,kn=null,da=0,ei=0,Yc=null,Lo=-1,Ao=0;function $e(){return X&6?xe():Lo!==-1?Lo:Lo=xe()}function An(e){return e.mode&1?X&2&&Te!==0?Te&-Te:wy.transition!==null?(Ao===0&&(Ao=gg()),Ao):(e=ee,e!==0||(e=window.event,e=e===void 0?16:_g(e.type)),e):1}function Rt(e,t,n,r){if(50<ei)throw ei=0,Yc=null,Error(P(185));Di(e,n,r),(!(X&2)||e!==Me)&&(e===Me&&(!(X&2)&&(Ha|=n),ke===4&&_n(e,Te)),et(e,r),n===1&&X===0&&!(t.mode&1)&&(ls=xe()+500,Ba&&Qn()))}function et(e,t){var n=e.callbackNode;wv(e,t);var r=Xo(e,e===Me?Te:0);if(r===0)n!==null&&Jd(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Jd(n),t===1)e.tag===0?by(Uf.bind(null,e)):Wg(Uf.bind(null,e)),my(function(){!(X&6)&&Qn()}),n=null;else{switch(mg(r)){case 1:n=_u;break;case 4:n=hg;break;case 16:n=Ko;break;case 536870912:n=pg;break;default:n=Ko}n=Fm(n,Tm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Tm(e,t){if(Lo=-1,Ao=0,X&6)throw Error(P(327));var n=e.callbackNode;if(Gr()&&e.callbackNode!==n)return null;var r=Xo(e,e===Me?Te:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=fa(e,r);else{t=r;var s=X;X|=2;var i=Dm();(Me!==e||Te!==t)&&(Gt=null,ls=xe()+500,dr(e,t));do try{Wy();break}catch(a){Om(e,a)}while(!0);Lu(),ca.current=i,X=s,be!==null?t=0:(Me=null,Te=0,t=ke)}if(t!==0){if(t===2&&(s=yc(e),s!==0&&(r=s,t=Kc(e,s))),t===1)throw n=Si,dr(e,0),_n(e,r),et(e,xe()),n;if(t===6)_n(e,r);else{if(s=e.current.alternate,!(r&30)&&!Fy(s)&&(t=fa(e,r),t===2&&(i=yc(e),i!==0&&(r=i,t=Kc(e,i))),t===1))throw n=Si,dr(e,0),_n(e,r),et(e,xe()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(P(345));case 2:ir(e,Ke,Gt);break;case 3:if(_n(e,r),(r&130023424)===r&&(t=qu+500-xe(),10<t)){if(Xo(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){$e(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Nc(ir.bind(null,e,Ke,Gt),t);break}ir(e,Ke,Gt);break;case 4:if(_n(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-Pt(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Iy(r/1960))-r,10<r){e.timeoutHandle=Nc(ir.bind(null,e,Ke,Gt),r);break}ir(e,Ke,Gt);break;case 5:ir(e,Ke,Gt);break;default:throw Error(P(329))}}}return et(e,xe()),e.callbackNode===n?Tm.bind(null,e):null}function Kc(e,t){var n=Zs;return e.current.memoizedState.isDehydrated&&(dr(e,t).flags|=256),e=fa(e,t),e!==2&&(t=Ke,Ke=n,t!==null&&Xc(t)),e}function Xc(e){Ke===null?Ke=e:Ke.push.apply(Ke,e)}function Fy(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!Tt(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 _n(e,t){for(t&=~Qu,t&=~Ha,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Pt(t),r=1<<n;e[n]=-1,t&=~r}}function Uf(e){if(X&6)throw Error(P(327));Gr();var t=Xo(e,0);if(!(t&1))return et(e,xe()),null;var n=fa(e,t);if(e.tag!==0&&n===2){var r=yc(e);r!==0&&(t=r,n=Kc(e,r))}if(n===1)throw n=Si,dr(e,0),_n(e,t),et(e,xe()),n;if(n===6)throw Error(P(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ir(e,Ke,Gt),et(e,xe()),null}function Gu(e,t){var n=X;X|=1;try{return e(t)}finally{X=n,X===0&&(ls=xe()+500,Ba&&Qn())}}function vr(e){kn!==null&&kn.tag===0&&!(X&6)&&Gr();var t=X;X|=1;var n=vt.transition,r=ee;try{if(vt.transition=null,ee=1,e)return e()}finally{ee=r,vt.transition=n,X=t,!(X&6)&&Qn()}}function Ju(){ot=Hr.current,le(Hr)}function dr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,gy(n)),be!==null)for(n=be.return;n!==null;){var r=n;switch(Tu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Zo();break;case 3:os(),le(Je),le(Fe),Wu();break;case 5:Bu(r);break;case 4:os();break;case 13:le(de);break;case 19:le(de);break;case 10:Au(r.type._context);break;case 22:case 23:Ju()}n=n.return}if(Me=e,be=e=zn(e.current,null),Te=ot=t,ke=0,Si=null,Qu=Ha=xr=0,Ke=Zs=null,lr!==null){for(t=0;t<lr.length;t++)if(n=lr[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}lr=null}return e}function Om(e,t){do{var n=be;try{if(Lu(),To.current=la,aa){for(var r=he.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}aa=!1}if(mr=0,je=_e=he=null,Gs=!1,bi=0,Xu.current=null,n===null||n.return===null){ke=1,Si=t,be=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=Te,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=Tf(o);if(h!==null){h.flags&=-257,Of(h,o,a,i,t),h.mode&1&&Rf(i,c,t),t=h,l=c;var g=t.updateQueue;if(g===null){var x=new Set;x.add(l),t.updateQueue=x}else g.add(l);break e}else{if(!(t&1)){Rf(i,c,t),Zu();break e}l=Error(P(426))}}else if(ce&&a.mode&1){var w=Tf(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Of(w,o,a,i,t),Ou(as(l,a));break e}}i=l=as(l,a),ke!==4&&(ke=2),Zs===null?Zs=[i]:Zs.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=mm(i,l,t);Cf(i,v);break e;case 1:a=l;var m=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ln===null||!Ln.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var _=xm(i,a,t);Cf(i,_);break e}}i=i.return}while(i!==null)}Am(n)}catch(k){t=k,be===n&&n!==null&&(be=n=n.return);continue}break}while(!0)}function Dm(){var e=ca.current;return ca.current=la,e===null?la:e}function Zu(){(ke===0||ke===3||ke===2)&&(ke=4),Me===null||!(xr&268435455)&&!(Ha&268435455)||_n(Me,Te)}function fa(e,t){var n=X;X|=2;var r=Dm();(Me!==e||Te!==t)&&(Gt=null,dr(e,t));do try{By();break}catch(s){Om(e,s)}while(!0);if(Lu(),X=n,ca.current=r,be!==null)throw Error(P(261));return Me=null,Te=0,ke}function By(){for(;be!==null;)Lm(be)}function Wy(){for(;be!==null&&!fv();)Lm(be)}function Lm(e){var t=Im(e.alternate,e,ot);e.memoizedProps=e.pendingProps,t===null?Am(e):be=t,Xu.current=null}function Am(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Dy(n,t),n!==null){n.flags&=32767,be=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ke=6,be=null;return}}else if(n=Oy(n,t,ot),n!==null){be=n;return}if(t=t.sibling,t!==null){be=t;return}be=t=e}while(t!==null);ke===0&&(ke=5)}function ir(e,t,n){var r=ee,s=vt.transition;try{vt.transition=null,ee=1,$y(e,t,n,r)}finally{vt.transition=s,ee=r}return null}function $y(e,t,n,r){do Gr();while(kn!==null);if(X&6)throw Error(P(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(P(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(_v(e,i),e===Me&&(be=Me=null,Te=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||co||(co=!0,Fm(Ko,function(){return Gr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=vt.transition,vt.transition=null;var o=ee;ee=1;var a=X;X|=4,Xu.current=null,Ay(e,n),Pm(n,e),ly(Cc),Qo=!!kc,Cc=kc=null,e.current=n,zy(n),hv(),X=a,ee=o,vt.transition=i}else e.current=n;if(co&&(co=!1,kn=e,da=s),i=e.pendingLanes,i===0&&(Ln=null),mv(n.stateNode),et(e,xe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(ua)throw ua=!1,e=Uc,Uc=null,e;return da&1&&e.tag!==0&&Gr(),i=e.pendingLanes,i&1?e===Yc?ei++:(ei=0,Yc=e):ei=0,Qn(),null}function Gr(){if(kn!==null){var e=mg(da),t=vt.transition,n=ee;try{if(vt.transition=null,ee=16>e?16:e,kn===null)var r=!1;else{if(e=kn,kn=null,da=0,X&6)throw Error(P(331));var s=X;for(X|=4,O=e.current;O!==null;){var i=O,o=i.child;if(O.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(O=c;O!==null;){var d=O;switch(d.tag){case 0:case 11:case 15:Js(8,d,i)}var f=d.child;if(f!==null)f.return=d,O=f;else for(;O!==null;){d=O;var p=d.sibling,h=d.return;if(Nm(d),d===c){O=null;break}if(p!==null){p.return=h,O=p;break}O=h}}}var g=i.alternate;if(g!==null){var x=g.child;if(x!==null){g.child=null;do{var w=x.sibling;x.sibling=null,x=w}while(x!==null)}}O=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,O=o;else e:for(;O!==null;){if(i=O,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Js(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,O=v;break e}O=i.return}}var m=e.current;for(O=m;O!==null;){o=O;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,O=y;else e:for(o=m;O!==null;){if(a=O,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Va(9,a)}}catch(k){ge(a,a.return,k)}if(a===o){O=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,O=_;break e}O=a.return}}if(X=s,Qn(),Ut&&typeof Ut.onPostCommitFiberRoot=="function")try{Ut.onPostCommitFiberRoot(La,e)}catch{}r=!0}return r}finally{ee=n,vt.transition=t}}return!1}function Yf(e,t,n){t=as(n,t),t=mm(e,t,1),e=Dn(e,t,1),t=$e(),e!==null&&(Di(e,1,t),et(e,t))}function ge(e,t,n){if(e.tag===3)Yf(e,e,n);else for(;t!==null;){if(t.tag===3){Yf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ln===null||!Ln.has(r))){e=as(n,e),e=xm(t,e,1),t=Dn(t,e,1),e=$e(),t!==null&&(Di(t,1,e),et(t,e));break}}t=t.return}}function Vy(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=$e(),e.pingedLanes|=e.suspendedLanes&n,Me===e&&(Te&n)===n&&(ke===4||ke===3&&(Te&130023424)===Te&&500>xe()-qu?dr(e,0):Qu|=n),et(e,t)}function zm(e,t){t===0&&(e.mode&1?(t=Zi,Zi<<=1,!(Zi&130023424)&&(Zi=4194304)):t=1);var n=$e();e=an(e,t),e!==null&&(Di(e,t,n),et(e,n))}function Hy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),zm(e,n)}function Uy(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(P(314))}r!==null&&r.delete(t),zm(e,n)}var Im;Im=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Je.current)Qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Qe=!1,Ty(e,t,n);Qe=!!(e.flags&131072)}else Qe=!1,ce&&t.flags&1048576&&$g(t,na,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Do(e,t),e=t.pendingProps;var s=rs(t,Fe.current);qr(t,n),s=Vu(null,t,r,e,s,n);var i=Hu();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ze(r)?(i=!0,ea(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Iu(t),s.updater=$a,t.stateNode=s,s._reactInternals=t,Dc(t,r,e,n),t=zc(null,t,r,!0,i,n)):(t.tag=0,ce&&i&&Ru(t),We(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Do(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Ky(r),e=Nt(r,e),s){case 0:t=Ac(null,t,r,e,n);break e;case 1:t=Af(null,t,r,e,n);break e;case 11:t=Df(null,t,r,e,n);break e;case 14:t=Lf(null,t,r,Nt(r.type,e),n);break e}throw Error(P(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),Ac(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),Af(e,t,r,s,n);case 3:e:{if(wm(t),e===null)throw Error(P(387));r=t.pendingProps,i=t.memoizedState,s=i.element,Xg(e,t),ia(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=as(Error(P(423)),t),t=zf(e,t,r,n,s);break e}else if(r!==s){s=as(Error(P(424)),t),t=zf(e,t,r,n,s);break e}else for(at=On(t.stateNode.containerInfo.firstChild),lt=t,ce=!0,Mt=null,n=Yg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ss(),r===s){t=ln(e,t,n);break e}We(e,t,r,n)}t=t.child}return t;case 5:return Qg(t),e===null&&Rc(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,jc(r,s)?o=null:i!==null&&jc(r,i)&&(t.flags|=32),bm(e,t),We(e,t,o,n),t.child;case 6:return e===null&&Rc(t),null;case 13:return _m(e,t,n);case 4:return Fu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=is(t,null,r,n):We(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),Df(e,t,r,s,n);case 7:return We(e,t,t.pendingProps,n),t.child;case 8:return We(e,t,t.pendingProps.children,n),t.child;case 12:return We(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,re(ra,r._currentValue),r._currentValue=o,i!==null)if(Tt(i.value,o)){if(i.children===s.children&&!Je.current){t=ln(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=rn(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Tc(i.return,n,t),a.lanes|=n;break}l=l.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(P(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Tc(o,n,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}We(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,qr(t,n),s=bt(s),r=r(s),t.flags|=1,We(e,t,r,n),t.child;case 14:return r=t.type,s=Nt(r,t.pendingProps),s=Nt(r.type,s),Lf(e,t,r,s,n);case 15:return vm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Nt(r,s),Do(e,t),t.tag=1,Ze(r)?(e=!0,ea(t)):e=!1,qr(t,n),gm(t,r,s),Dc(t,r,s,n),zc(null,t,r,!0,e,n);case 19:return Sm(e,t,n);case 22:return ym(e,t,n)}throw Error(P(156,t.tag))};function Fm(e,t){return fg(e,t)}function Yy(e,t,n,r){this.tag=e,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xt(e,t,n,r){return new Yy(e,t,n,r)}function ed(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ky(e){if(typeof e=="function")return ed(e)?1:0;if(e!=null){if(e=e.$$typeof,e===yu)return 11;if(e===bu)return 14}return 2}function zn(e,t){var n=e.alternate;return n===null?(n=xt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function zo(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")ed(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Dr:return fr(n.children,s,i,t);case vu:o=8,s|=8;break;case sc:return e=xt(12,n,t,s|2),e.elementType=sc,e.lanes=i,e;case ic:return e=xt(13,n,t,s),e.elementType=ic,e.lanes=i,e;case oc:return e=xt(19,n,t,s),e.elementType=oc,e.lanes=i,e;case Qp:return Ua(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kp:o=10;break e;case Xp:o=9;break e;case yu:o=11;break e;case bu:o=14;break e;case vn:o=16,r=null;break e}throw Error(P(130,e==null?e:typeof e,""))}return t=xt(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function fr(e,t,n,r){return e=xt(7,e,r,t),e.lanes=n,e}function Ua(e,t,n,r){return e=xt(22,e,r,t),e.elementType=Qp,e.lanes=n,e.stateNode={isHidden:!1},e}function Al(e,t,n){return e=xt(6,e,null,t),e.lanes=n,e}function zl(e,t,n){return t=xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xy(e,t,n,r,s){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=xl(0),this.expirationTimes=xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xl(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function td(e,t,n,r,s,i,o,a,l){return e=new Xy(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=xt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Iu(i),e}function Qy(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Or,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Bm(e){if(!e)return Vn;e=e._reactInternals;e:{if(_r(e)!==e||e.tag!==1)throw Error(P(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ze(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(P(171))}if(e.tag===1){var n=e.type;if(Ze(n))return Bg(e,n,t)}return t}function Wm(e,t,n,r,s,i,o,a,l){return e=td(n,r,!0,e,s,i,o,a,l),e.context=Bm(null),n=e.current,r=$e(),s=An(n),i=rn(r,s),i.callback=t??null,Dn(n,i,s),e.current.lanes=s,Di(e,s,r),et(e,r),e}function Ya(e,t,n,r){var s=t.current,i=$e(),o=An(s);return n=Bm(n),t.context===null?t.context=n:t.pendingContext=n,t=rn(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Dn(s,t,o),e!==null&&(Rt(e,s,o,i),Ro(e,s,o)),o}function ha(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 Kf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function nd(e,t){Kf(e,t),(e=e.alternate)&&Kf(e,t)}function qy(){return null}var $m=typeof reportError=="function"?reportError:function(e){console.error(e)};function rd(e){this._internalRoot=e}Ka.prototype.render=rd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(P(409));Ya(e,t,null,null)};Ka.prototype.unmount=rd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vr(function(){Ya(null,e,null,null)}),t[on]=null}};function Ka(e){this._internalRoot=e}Ka.prototype.unstable_scheduleHydration=function(e){if(e){var t=yg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wn.length&&t!==0&&t<wn[n].priority;n++);wn.splice(n,0,e),n===0&&wg(e)}};function sd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Xa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Xf(){}function Gy(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=ha(o);i.call(c)}}var o=Wm(t,r,e,0,null,!1,!1,"",Xf);return e._reactRootContainer=o,e[on]=o.current,gi(e.nodeType===8?e.parentNode:e),vr(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=ha(l);a.call(c)}}var l=td(e,0,!1,null,null,!1,!1,"",Xf);return e._reactRootContainer=l,e[on]=l.current,gi(e.nodeType===8?e.parentNode:e),vr(function(){Ya(t,l,n,r)}),l}function Qa(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=ha(o);a.call(l)}}Ya(t,o,e,s)}else o=Gy(n,t,e,s,r);return ha(o)}xg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Fs(t.pendingLanes);n!==0&&(Su(t,n|1),et(t,xe()),!(X&6)&&(ls=xe()+500,Qn()))}break;case 13:vr(function(){var r=an(e,1);if(r!==null){var s=$e();Rt(r,e,1,s)}}),nd(e,1)}};ku=function(e){if(e.tag===13){var t=an(e,134217728);if(t!==null){var n=$e();Rt(t,e,134217728,n)}nd(e,134217728)}};vg=function(e){if(e.tag===13){var t=An(e),n=an(e,t);if(n!==null){var r=$e();Rt(n,e,t,r)}nd(e,t)}};yg=function(){return ee};bg=function(e,t){var n=ee;try{return ee=e,t()}finally{ee=n}};mc=function(e,t,n){switch(t){case"input":if(cc(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Fa(r);if(!s)throw Error(P(90));Gp(r),cc(r,s)}}}break;case"textarea":Zp(e,n);break;case"select":t=n.value,t!=null&&Yr(e,!!n.multiple,t,!1)}};og=Gu;ag=vr;var Jy={usingClientEntryPoint:!1,Events:[Ai,Ir,Fa,sg,ig,Gu]},Rs={findFiberByHostInstance:ar,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Zy={bundleType:Rs.bundleType,version:Rs.version,rendererPackageName:Rs.rendererPackageName,rendererConfig:Rs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:un.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ug(e),e===null?null:e.stateNode},findFiberByHostInstance:Rs.findFiberByHostInstance||qy,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 uo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uo.isDisabled&&uo.supportsFiber)try{La=uo.inject(Zy),Ut=uo}catch{}}ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jy;ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!sd(t))throw Error(P(200));return Qy(e,t,null,n)};ut.createRoot=function(e,t){if(!sd(e))throw Error(P(299));var n=!1,r="",s=$m;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=td(e,1,!1,null,null,n,!1,r,s),e[on]=t.current,gi(e.nodeType===8?e.parentNode:e),new rd(t)};ut.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(P(188)):(e=Object.keys(e).join(","),Error(P(268,e)));return e=ug(t),e=e===null?null:e.stateNode,e};ut.flushSync=function(e){return vr(e)};ut.hydrate=function(e,t,n){if(!Xa(t))throw Error(P(200));return Qa(null,e,t,!0,n)};ut.hydrateRoot=function(e,t,n){if(!sd(e))throw Error(P(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=$m;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Wm(t,null,e,1,n??null,s,!1,i,o),e[on]=t.current,gi(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Ka(t)};ut.render=function(e,t,n){if(!Xa(t))throw Error(P(200));return Qa(null,e,t,!1,n)};ut.unmountComponentAtNode=function(e){if(!Xa(e))throw Error(P(40));return e._reactRootContainer?(vr(function(){Qa(null,null,e,!1,function(){e._reactRootContainer=null,e[on]=null})}),!0):!1};ut.unstable_batchedUpdates=Gu;ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Xa(n))throw Error(P(200));if(e==null||e._reactInternals===void 0)throw Error(P(38));return Qa(e,t,n,!1,r)};ut.version="18.3.1-next-f1338f8080-20240426";function Vm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vm)}catch(e){console.error(e)}}Vm(),Vp.exports=ut;var Ur=Vp.exports,Qf=Ur;nc.createRoot=Qf.createRoot,nc.hydrateRoot=Qf.hydrateRoot;/**
41
- * @remix-run/router v1.23.4
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 ki(){return ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ki.apply(null,arguments)}var Cn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Cn||(Cn={}));const qf="popstate";function eb(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:a}=r.location;return Qc("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:pa(s)}return nb(t,n,null,e)}function me(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Hm(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function tb(){return Math.random().toString(36).substr(2,8)}function Gf(e,t){return{usr:e.state,key:e.key,idx:t}}function Qc(e,t,n,r){return n===void 0&&(n=null),ki({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ps(t):t,{state:n,key:t&&t.key||r||tb()})}function pa(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function ps(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function nb(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=Cn.Pop,l=null,c=d();c==null&&(c=0,o.replaceState(ki({},o.state,{idx:c}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=Cn.Pop;let w=d(),v=w==null?null:w-c;c=w,l&&l({action:a,location:x.location,delta:v})}function p(w,v){a=Cn.Push;let m=Qc(x.location,w,v);c=d()+1;let y=Gf(m,c),_=x.createHref(m);try{o.pushState(y,"",_)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;s.location.assign(_)}i&&l&&l({action:a,location:x.location,delta:1})}function h(w,v){a=Cn.Replace;let m=Qc(x.location,w,v);c=d();let y=Gf(m,c),_=x.createHref(m);o.replaceState(y,"",_),i&&l&&l({action:a,location:x.location,delta:0})}function g(w){let v=s.location.origin!=="null"?s.location.origin:s.location.href,m=typeof w=="string"?w:pa(w);return m=m.replace(/ $/,"%20"),me(v,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,v)}let x={get action(){return a},get location(){return e(s,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(qf,f),l=w,()=>{s.removeEventListener(qf,f),l=null}},createHref(w){return t(s,w)},createURL:g,encodeLocation(w){let v=g(w);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(w){return o.go(w)}};return x}var Jf;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Jf||(Jf={}));function rb(e,t,n){return n===void 0&&(n="/"),sb(e,t,n)}function sb(e,t,n,r){let s=typeof t=="string"?ps(t):t,i=cs(s.pathname||"/",n);if(i==null)return null;let o=Um(e);ib(o);let a=null,l=mb(i);for(let c=0;a==null&&c<o.length;++c)a=pb(o[c],l);return a}function Um(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(me(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=In([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(me(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Um(i.children,t,d,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:fb(c,i.index),routesMeta:d})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of Ym(i.path))s(i,o,l)}),t}function Ym(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=Ym(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function ib(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:hb(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ob=/^:[\w-]+$/,ab=3,lb=2,cb=1,ub=10,db=-2,Zf=e=>e==="*";function fb(e,t){let n=e.split("/"),r=n.length;return n.some(Zf)&&(r+=db),t&&(r+=lb),n.filter(s=>!Zf(s)).reduce((s,i)=>s+(ob.test(i)?ab:i===""?cb:ub),r)}function hb(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function pb(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=qc({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),p=l.route;if(!f)return null;Object.assign(s,f.params),o.push({params:s,pathname:In([i,f.pathname]),pathnameBase:yb(In([i,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(i=In([i,f.pathnameBase]))}return o}function qc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=gb(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((c,d,f)=>{let{paramName:p,isOptional:h}=d;if(p==="*"){let x=a[f]||"";o=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const g=a[f];return h&&!g?c[p]=void 0:c[p]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function gb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Hm(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 r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function mb(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Hm(!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 cs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function xb(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?ps(e):e,i;return n?(n=Qm(n),n.startsWith("/")?i=eh(n.substring(1),"/"):i=eh(n,t)):i=t,{pathname:i,search:bb(r),hash:wb(s)}}function eh(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Il(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function vb(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Km(e,t){let n=vb(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Xm(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=ps(e):(s=ki({},e),me(!s.pathname||!s.pathname.includes("?"),Il("?","pathname","search",s)),me(!s.pathname||!s.pathname.includes("#"),Il("#","pathname","hash",s)),me(!s.search||!s.search.includes("#"),Il("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;s.pathname=p.join("/")}a=f>=0?t[f]:"/"}let l=xb(s,a),c=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const Qm=e=>e.replace(/\/\/+/g,"/"),In=e=>Qm(e.join("/")),yb=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bb=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wb=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _b(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const qm=["post","put","patch","delete"];new Set(qm);const Sb=["get",...qm];new Set(Sb);/**
50
- * React Router v6.30.6
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 Ci(){return Ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ci.apply(null,arguments)}const qa=b.createContext(null),Gm=b.createContext(null),qn=b.createContext(null),Ga=b.createContext(null),Sr=b.createContext({outlet:null,matches:[],isDataRoute:!1}),Jm=b.createContext(null);function kb(e,t){let{relative:n}=t===void 0?{}:t;Ii()||me(!1);let{basename:r,navigator:s}=b.useContext(qn),{hash:i,pathname:o,search:a}=Ja(e,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:In([r,o])),s.createHref({pathname:l,search:a,hash:i})}function Ii(){return b.useContext(Ga)!=null}function Gn(){return Ii()||me(!1),b.useContext(Ga).location}function Zm(e){b.useContext(qn).static||b.useLayoutEffect(e)}function ex(){let{isDataRoute:e}=b.useContext(Sr);return e?zb():Cb()}function Cb(){Ii()||me(!1);let e=b.useContext(qa),{basename:t,future:n,navigator:r}=b.useContext(qn),{matches:s}=b.useContext(Sr),{pathname:i}=Gn(),o=JSON.stringify(Km(s,n.v7_relativeSplatPath)),a=b.useRef(!1);return Zm(()=>{a.current=!0}),b.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=Xm(c,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:In([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,i,e])}function Ja(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(qn),{matches:s}=b.useContext(Sr),{pathname:i}=Gn(),o=JSON.stringify(Km(s,r.v7_relativeSplatPath));return b.useMemo(()=>Xm(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function jb(e,t){return Nb(e,t)}function Nb(e,t,n,r){Ii()||me(!1);let{navigator:s}=b.useContext(qn),{matches:i}=b.useContext(Sr),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=Gn(),d;if(t){var f;let w=typeof t=="string"?ps(t):t;l==="/"||(f=w.pathname)!=null&&f.startsWith(l)||me(!1),d=w}else d=c;let p=d.pathname||"/",h=p;if(l!=="/"){let w=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(w.length).join("/")}let g=rb(e,{pathname:h}),x=Tb(g&&g.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:In([l,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:In([l,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r);return t&&x?b.createElement(Ga.Provider,{value:{location:Ci({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Cn.Pop}},x):x}function Eb(){let e=Ab(),t=_b(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={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),n?b.createElement("pre",{style:s},n):null,null)}const Mb=b.createElement(Eb,null);class Pb 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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(Sr.Provider,{value:this.props.routeContext},b.createElement(Jm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Rb(e){let{routeContext:t,match:n,children:r}=e,s=b.useContext(qa);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(Sr.Provider,{value:t},r)}function Tb(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||me(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=d),f.route.id){let{loaderData:p,errors:h}=n,g=f.route.loader&&p[f.route.id]===void 0&&(!h||h[f.route.id]===void 0);if(f.route.lazy||g){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,f,p)=>{let h,g=!1,x=null,w=null;n&&(h=a&&f.route.id?a[f.route.id]:void 0,x=f.route.errorElement||Mb,l&&(c<0&&p===0?(Ib("route-fallback"),g=!0,w=null):c===p&&(g=!0,w=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,p+1)),m=()=>{let y;return h?y=x:g?y=w:f.route.Component?y=b.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=d,b.createElement(Rb,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:y})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?b.createElement(Pb,{location:n.location,revalidation:n.revalidation,component:x,error:h,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):m()},null)}var tx=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(tx||{}),nx=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}(nx||{});function Ob(e){let t=b.useContext(qa);return t||me(!1),t}function Db(e){let t=b.useContext(Gm);return t||me(!1),t}function Lb(e){let t=b.useContext(Sr);return t||me(!1),t}function rx(e){let t=Lb(),n=t.matches[t.matches.length-1];return n.route.id||me(!1),n.route.id}function Ab(){var e;let t=b.useContext(Jm),n=Db(),r=rx();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function zb(){let{router:e}=Ob(tx.UseNavigateStable),t=rx(nx.UseNavigateStable),n=b.useRef(!1);return Zm(()=>{n.current=!0}),b.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Ci({fromRouteId:t},i)))},[e,t])}const th={};function Ib(e,t,n){th[e]||(th[e]=!0)}function Fb(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function jt(e){me(!1)}function Bb(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Cn.Pop,navigator:i,static:o=!1,future:a}=e;Ii()&&me(!1);let l=t.replace(/^\/*/,"/"),c=b.useMemo(()=>({basename:l,navigator:i,static:o,future:Ci({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=ps(r));let{pathname:d="/",search:f="",hash:p="",state:h=null,key:g="default"}=r,x=b.useMemo(()=>{let w=cs(d,l);return w==null?null:{location:{pathname:w,search:f,hash:p,state:h,key:g},navigationType:s}},[l,d,f,p,h,g,s]);return x==null?null:b.createElement(qn.Provider,{value:c},b.createElement(Ga.Provider,{children:n,value:x}))}function Wb(e){let{children:t,location:n}=e;return jb(Gc(t),n)}new Promise(()=>{});function Gc(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(r,s)=>{if(!b.isValidElement(r))return;let i=[...t,s];if(r.type===b.Fragment){n.push.apply(n,Gc(r.props.children,i));return}r.type!==jt&&me(!1),!r.props.index||!r.props.children||me(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Gc(r.props.children,i)),n.push(o)}),n}/**
59
- * React Router DOM v6.30.6
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 ga(){return ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ga.apply(null,arguments)}function sx(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function $b(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Vb(e,t){return e.button===0&&(!t||t==="_self")&&!$b(e)}function Jc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function Hb(e,t){let n=Jc(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const Ub=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Yb=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Kb="6";try{window.__reactRouterVersion=Kb}catch{}const Xb=b.createContext({isTransitioning:!1}),Qb="startTransition",nh=V0[Qb];function qb(e){let{basename:t,children:n,future:r,window:s}=e,i=b.useRef();i.current==null&&(i.current=eb({window:s,v5Compat:!0}));let o=i.current,[a,l]=b.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},d=b.useCallback(f=>{c&&nh?nh(()=>l(f)):l(f)},[l,c]);return b.useLayoutEffect(()=>o.listen(d),[o,d]),b.useEffect(()=>Fb(r),[r]),b.createElement(Bb,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const Gb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Jb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Zb=b.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:c,preventScrollReset:d,viewTransition:f}=t,p=sx(t,Ub),{basename:h}=b.useContext(qn),g,x=!1;if(typeof c=="string"&&Jb.test(c)&&(g=c,Gb))try{let y=new URL(window.location.href),_=c.startsWith("//")?new URL(y.protocol+c):new URL(c),k=cs(_.pathname,h);_.origin===y.origin&&k!=null?c=k+_.search+_.hash:x=!0}catch{}let w=kb(c,{relative:s}),v=tw(c,{replace:o,state:a,target:l,preventScrollReset:d,relative:s,viewTransition:f});function m(y){r&&r(y),y.defaultPrevented||v(y)}return b.createElement("a",ga({},p,{href:g||w,onClick:x||i?r:m,ref:n,target:l}))}),ix=b.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:l,viewTransition:c,children:d}=t,f=sx(t,Yb),p=Ja(l,{relative:f.relative}),h=Gn(),g=b.useContext(Gm),{navigator:x,basename:w}=b.useContext(qn),v=g!=null&&nw(p)&&c===!0,m=x.encodeLocation?x.encodeLocation(p).pathname:p.pathname,y=h.pathname,_=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;s||(y=y.toLowerCase(),_=_?_.toLowerCase():null,m=m.toLowerCase()),_&&w&&(_=cs(_,w)||_);const k=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let S=y===m||!o&&y.startsWith(m)&&y.charAt(k)==="/",C=_!=null&&(_===m||!o&&_.startsWith(m)&&_.charAt(m.length)==="/"),j={isActive:S,isPending:C,isTransitioning:v},R=S?r:void 0,M;typeof i=="function"?M=i(j):M=[i,S?"active":null,C?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let N=typeof a=="function"?a(j):a;return b.createElement(Zb,ga({},f,{"aria-current":R,className:M,ref:n,style:N,to:l,viewTransition:c}),typeof d=="function"?d(j):d)});var Zc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Zc||(Zc={}));var rh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(rh||(rh={}));function ew(e){let t=b.useContext(qa);return t||me(!1),t}function tw(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,l=ex(),c=Gn(),d=Ja(e,{relative:o});return b.useCallback(f=>{if(Vb(f,n)){f.preventDefault();let p=r!==void 0?r:pa(c)===pa(d);l(e,{replace:p,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[c,l,d,r,s,n,e,i,o,a])}function ox(e){let t=b.useRef(Jc(e)),n=b.useRef(!1),r=Gn(),s=b.useMemo(()=>Hb(r.search,n.current?null:t.current),[r.search]),i=ex(),o=b.useCallback((a,l)=>{const c=Jc(typeof a=="function"?a(s):a);n.current=!0,i("?"+c,l)},[i,s]);return[s,o]}function nw(e,t){t===void 0&&(t={});let n=b.useContext(Xb);n==null&&me(!1);let{basename:r}=ew(Zc.useViewTransitionState),s=Ja(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=cs(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=cs(n.nextLocation.pathname,r)||n.nextLocation.pathname;return qc(s.pathname,o)!=null||qc(s.pathname,i)!=null}const rw="/api";class sw extends Error{constructor(n,r){super(r);F(this,"status");this.status=n,this.name="ApiError"}}async function V(e,t={}){const n=await fetch(rw+e,{...t,headers:t.body?{"Content-Type":"application/json",...t.headers||{}}:t.headers});if(!n.ok){let r=`Erro HTTP ${n.status}`;try{const s=await n.json();r=String(s.detail||s.mensagem||r)}catch{}throw new sw(n.status,r)}if(n.status!==204)return n.json()}const ye=e=>({method:"POST",body:JSON.stringify(e)}),z={health:()=>V("/health"),doctor:()=>V("/doctor"),shutdown:()=>V("/shutdown",ye({})),metricas:()=>V("/metrics"),leads:{listar:()=>V("/leads"),criar:e=>V("/leads",ye(e)),atualizar:(e,t)=>V(`/leads/${e}`,{method:"PATCH",body:JSON.stringify(t)}),remover:e=>V(`/leads/${e}`,{method:"DELETE"}),importar:e=>V("/leads/import",ye({leads:e})),enriquecer:e=>V(`/leads/${e}/enrich`,ye({}))},crm:{sugestoes:()=>V("/crm/sugestoes"),aplicar:(e,t)=>V("/crm/sugestoes/aplicar",ye({lead_id:e,para:t}))},campanhas:{listar:()=>V("/campaigns"),criar:e=>V("/campaigns",ye(e)),iniciar:e=>V(`/campaigns/${e}/start`,ye({})),pausar:e=>V(`/campaigns/${e}/pause`,ye({})),parar:e=>V(`/campaigns/${e}/stop`,ye({})),remover:e=>V(`/campaigns/${e}`,{method:"DELETE"})},pipeline:{listar:()=>V("/pipeline"),criar:e=>V("/pipeline",ye(e)),agir:(e,t)=>V(`/pipeline/${e}/actions`,ye({acao:t}))},extrair:{googleMaps:e=>V("/extract/google-maps",ye(e)),instagram:e=>V("/extract/instagram",ye({profile_url:e})),cnpj:e=>V("/extract/cnpj",ye({cnpj:e})),cnpjBusca:e=>V("/extract/cnpj/search",ye(e))},config:{obter:()=>V("/config"),salvar:e=>V("/config",{method:"PUT",body:JSON.stringify(e)}),testarLlm:()=>V("/config/test/llm",ye({})),testarIntegracao:e=>V("/config/test/integracao",ye({url:e}))},integracoes:()=>V("/integrations/status"),agentes:{templates:()=>V("/agents/templates"),salvarTemplates:e=>V("/agents/templates",{method:"PUT",body:JSON.stringify(e)}),testarTemplate:(e,t)=>V("/agents/templates/test",ye({template:e,lead_id:t})),chat:e=>V("/agents/attendance/chat",ye({mensagens:e}))},webhook:{obter:()=>V("/webhook"),salvar:e=>V("/webhook",{method:"PUT",body:JSON.stringify(e)}),testar:e=>V("/webhook/test",ye({url:e}))}};function W(...e){return e.filter(Boolean).join(" ")}function iw(e){return(e||"?").trim().charAt(0).toUpperCase()||"?"}function ma(e){if(!e)return"—";try{return new Date(e).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return e}}function sh(e){if(!e)return"—";try{return new Date(e).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})}catch{return e}}function id(e){const t=(e||"").replace(/\D/g,"");return t?t.length===11?`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7)}`:t.length===10?`(${t.slice(0,2)}) ${t.slice(2,6)}-${t.slice(6)}`:e||"—":"—"}function ow(e){const t=["nome","telefone","email","empresa","cidade","observacoes"],n=t.filter(r=>String(e[r]||"").trim().length>0);return Math.round(n.length/t.length*100)}function aw(e){const t={nome:"nome",telefone:"telefone",email:"e-mail",empresa:"empresa",cidade:"cidade",observacoes:"observações"};return["nome","telefone","email","empresa","cidade","observacoes"].filter(r=>String(e[r]||"").trim().length===0).map(r=>t[r])}function lw(e,t){if(e>=100)return"Lead 100% completo — excelente! 🎉";const n=t.slice(0,2).join(" e ");return`Faltam ${100-e}% (${n}${t.length>2?"...":""}) para o lead ficar completo`}function cw(e,t){const n=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),r=URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download=t,s.click(),URL.revokeObjectURL(r)}const uw={md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"};function Ot({aberto:e,onFechar:t,titulo:n,children:r,icone:s="fas fa-circle-info",largura:i="md"}){return b.useEffect(()=>{const o=a=>{a.key==="Escape"&&t()};return e&&window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[e,t]),e?u.jsx("div",{className:"fixed inset-0 z-50 bg-black/40 flex items-center justify-center p-4",onMouseDown:o=>{o.target===o.currentTarget&&t()},children:u.jsxs("div",{className:W("bg-white rounded-2xl shadow-xl w-full",uw[i]),children:[u.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[u.jsxs("h3",{className:"text-base font-semibold text-gray-800 flex items-center gap-2",children:[u.jsx("i",{className:W(s,"text-indigo-500")})," ",n]}),u.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600","aria-label":"Fechar",children:u.jsx("i",{className:"fas fa-times"})})]}),u.jsx("div",{className:"px-6 py-5 max-h-[70vh] overflow-y-auto",children:r})]})}):null}const dw=[{icone:"fas fa-users",texto:"Cadastre leads manualmente ou importe pelos Extratores (Maps, Instagram, CNPJ)."},{icone:"fas fa-columns",texto:"Arraste os cards no CRM conforme o avança no funil (Leads → Em contato → Proposta → Fechado)."},{icone:"fas fa-video",texto:"Crie um vídeo no Pipeline, inicie e acompanhe as 5 etapas até o upload no YouTube."},{icone:"fas fa-bullhorn",texto:"Monte campanhas de disparo com seus templates e acompanhe as taxas no Painel."}];function fw({titulo:e,nomeUsuario:t}){const[n,r]=b.useState(!1);return u.jsxs("header",{className:"bg-white shadow-sm px-8 py-4 flex items-center justify-between shrink-0",children:[u.jsx("div",{children:u.jsx("h2",{className:"text-lg font-semibold text-gray-800",children:e})}),u.jsxs("div",{className:"flex items-center space-x-4",children:[u.jsxs("button",{onClick:()=>r(!0),className:"text-sm text-indigo-600 hover:text-indigo-800 font-medium",children:[u.jsx("i",{className:"fas fa-play-circle mr-1"})," Ver tutorial"]}),u.jsx("div",{className:"w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600 font-bold text-sm",children:iw(t)}),u.jsx("span",{className:"text-sm font-medium text-gray-700",children:t})]}),u.jsxs(Ot,{aberto:n,onFechar:()=>r(!1),titulo:"Tutorial rápido",icone:"fas fa-graduation-cap",children:[u.jsx("ol",{className:"space-y-4",children:dw.map((s,i)=>u.jsxs("li",{className:"flex gap-3 items-start",children:[u.jsx("span",{className:"w-8 h-8 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center shrink-0",children:u.jsx("i",{className:s.icone})}),u.jsx("p",{className:"text-sm text-gray-600 pt-1.5",children:s.texto})]},i))}),u.jsx("p",{className:"text-xs text-gray-400 mt-5",children:"Dica: as integrações externas (MoneyPrinterTurbo, Short-Video-Maker, uploader) são configuráveis em Ferramentas."})]})]})}const hw=[{itens:[{para:"/",icone:"fas fa-chart-pie text-indigo-300",rotulo:"Painel",fim:!0}]},{secao:"Conexões",itens:[{para:"/leads",icone:"fas fa-users",rotulo:"Leads"},{para:"/agentes",icone:"fas fa-robot",rotulo:"Agentes"},{para:"/ferramentas",icone:"fas fa-tools",rotulo:"Ferramentas"}]},{itens:[{para:"/extratores?tab=maps",icone:"fas fa-map-marked-alt",rotulo:"Extrator Maps"},{para:"/extratores?tab=instagram",icone:"fab fa-instagram",rotulo:"Extrator Instagram"},{para:"/extratores?tab=cnpj",icone:"fas fa-building",rotulo:"Extrator CNPJ"}]},{secao:"Gestão",itens:[{para:"/disparos",icone:"fas fa-bullhorn",rotulo:"Disparos"},{para:"/crm",icone:"fas fa-columns",rotulo:"CRM"},{para:"/pipeline",icone:"fas fa-video",rotulo:"Pipeline de Vídeos"}]},{secao:"Integrações",itens:[{para:"/webhook",icone:"fas fa-link",rotulo:"Webhook"},{para:"/suporte",icone:"fas fa-headset",rotulo:"Suporte"}]}];function pw({onSair:e}){const t=Gn(),[n,r]=b.useState(!1);b.useEffect(()=>{t.pathname==="/agentes"&&r(!0)},[t.pathname]);const s=i=>{if(i.rotulo==="Agentes")return t.pathname==="/agentes";const[o,a]=i.para.split("?");return a?t.pathname===o&&t.search.includes(a):i.fim?t.pathname===o:t.pathname.startsWith(o)};return u.jsxs("aside",{className:"w-64 bg-[#1e1b4b] text-white flex flex-col shrink-0 h-screen sticky top-0",children:[u.jsx("div",{className:"p-6 border-b border-gray-700",children:u.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[u.jsx("span",{className:"text-2xl",children:"⚡"}),"LeadMaster"]})}),u.jsx("nav",{className:"flex-1 overflow-y-auto py-4",children:u.jsx("ul",{className:"space-y-1",children:hw.map((i,o)=>u.jsx("li",{children:u.jsxs("ul",{children:[i.secao&&u.jsx("li",{className:"px-6 py-2 text-xs font-semibold text-gray-400 uppercase tracking-wider list-none",children:i.secao}),i.itens.map(a=>a.rotulo==="Agentes"?u.jsxs("li",{children:[u.jsxs("button",{type:"button",onClick:()=>r(l=>!l),className:W("sidebar-link w-full flex items-center px-6 py-2.5 text-sm",s(a)&&"active"),children:[u.jsx("i",{className:W(a.icone,"w-5 text-gray-400")}),u.jsx("span",{className:"ml-3",children:a.rotulo}),u.jsx("i",{className:W("fas fa-chevron-down ml-auto text-xs text-gray-400 transition-transform",n&&"rotate-180")})]}),n&&u.jsxs("ul",{className:"pl-12 space-y-1 mt-1",children:[u.jsx("li",{children:u.jsx(ih,{para:"/agentes?tab=disparo",rotulo:"Agente de Disparo",ativo:t.pathname==="/agentes"&&t.search.includes("disparo")})}),u.jsx("li",{children:u.jsx(ih,{para:"/agentes?tab=atendimento",rotulo:"Agente de Atendimento",ativo:t.pathname==="/agentes"&&t.search.includes("atendimento")})})]})]},"agentes"):u.jsx("li",{children:u.jsxs(ix,{to:a.para,className:W("sidebar-link flex items-center px-6 py-2.5 text-sm",s(a)&&"active"),children:[u.jsx("i",{className:W(a.icone,"w-5 text-gray-400")}),u.jsx("span",{className:"ml-3",children:a.rotulo})]})},a.para))]})},o))})}),u.jsx("div",{className:"p-4 border-t border-gray-700",children:u.jsxs("button",{onClick:e,className:"w-full flex items-center justify-center px-4 py-2.5 bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg text-sm font-medium hover:opacity-90 transition",children:[u.jsx("i",{className:"fas fa-sign-out-alt mr-2"})," Sair"]})})]})}function ih({para:e,rotulo:t,ativo:n}){return u.jsx(ix,{to:e,className:W("sidebar-link block px-4 py-2 text-xs text-gray-300 rounded",n&&"active"),children:t})}const ax=b.createContext({toast:()=>{}});function St(){return b.useContext(ax)}const gw={sucesso:"bg-green-600",erro:"bg-red-600",info:"bg-indigo-600"},mw={sucesso:"fas fa-check-circle",erro:"fas fa-exclamation-circle",info:"fas fa-info-circle"};function xw({children:e}){const[t,n]=b.useState([]),r=b.useRef(0),s=b.useCallback((i,o)=>{const a=++r.current;n(l=>[...l,{id:a,tipo:i,mensagem:o}]),setTimeout(()=>n(l=>l.filter(c=>c.id!==a)),4500)},[]);return u.jsxs(ax.Provider,{value:{toast:s},children:[e,u.jsx("div",{className:"fixed top-4 right-4 z-[100] space-y-2 w-80",children:t.map(i=>u.jsxs("div",{className:W(gw[i.tipo],"text-white text-sm rounded-lg shadow-lg px-4 py-3 flex items-start gap-2 animate-pulse-once"),role:"status",children:[u.jsx("i",{className:W(mw[i.tipo],"mt-0.5")}),u.jsx("span",{className:"flex-1",children:i.mensagem}),u.jsx("button",{className:"opacity-70 hover:opacity-100",onClick:()=>n(o=>o.filter(a=>a.id!==i.id)),"aria-label":"Fechar",children:u.jsx("i",{className:"fas fa-times"})})]},i.id))})]})}function fo({rotulo:e,valor:t,subtitulo:n,children:r,icone:s}){return u.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-5 border border-gray-100",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("p",{className:"text-sm text-gray-500 font-medium",children:e}),s&&u.jsx("i",{className:`${s} text-indigo-300`})]}),r??u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-2xl font-bold text-gray-800 mt-1",children:t}),n&&u.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:n})]})]})}/*!
68
- * @kurkle/color v0.3.4
69
- * https://github.com/kurkle/color#readme
70
- * (c) 2024 Jukka Kurkela
71
- * Released under the MIT License
72
- */function Fi(e){return e+.5|0}const jn=(e,t,n)=>Math.max(Math.min(e,n),t);function Ws(e){return jn(Fi(e*2.55),0,255)}function Fn(e){return jn(Fi(e*255),0,255)}function Zt(e){return jn(Fi(e/2.55)/100,0,1)}function oh(e){return jn(Fi(e*100),0,100)}const ht={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},eu=[..."0123456789ABCDEF"],vw=e=>eu[e&15],yw=e=>eu[(e&240)>>4]+eu[e&15],ho=e=>(e&240)>>4===(e&15),bw=e=>ho(e.r)&&ho(e.g)&&ho(e.b)&&ho(e.a);function ww(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&ht[e[1]]*17,g:255&ht[e[2]]*17,b:255&ht[e[3]]*17,a:t===5?ht[e[4]]*17:255}:(t===7||t===9)&&(n={r:ht[e[1]]<<4|ht[e[2]],g:ht[e[3]]<<4|ht[e[4]],b:ht[e[5]]<<4|ht[e[6]],a:t===9?ht[e[7]]<<4|ht[e[8]]:255})),n}const _w=(e,t)=>e<255?t(e):"";function Sw(e){var t=bw(e)?vw:yw;return e?"#"+t(e.r)+t(e.g)+t(e.b)+_w(e.a,t):void 0}const kw=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function lx(e,t,n){const r=t*Math.min(n,1-n),s=(i,o=(i+e/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function Cw(e,t,n){const r=(s,i=(s+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function jw(e,t,n){const r=lx(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)r[s]*=1-t-n,r[s]+=t;return r}function Nw(e,t,n,r,s){return e===s?(t-n)/r+(t<n?6:0):t===s?(n-e)/r+2:(e-t)/r+4}function od(e){const n=e.r/255,r=e.g/255,s=e.b/255,i=Math.max(n,r,s),o=Math.min(n,r,s),a=(i+o)/2;let l,c,d;return i!==o&&(d=i-o,c=a>.5?d/(2-i-o):d/(i+o),l=Nw(n,r,s,d,i),l=l*60+.5),[l|0,c||0,a]}function ad(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Fn)}function ld(e,t,n){return ad(lx,e,t,n)}function Ew(e,t,n){return ad(jw,e,t,n)}function Mw(e,t,n){return ad(Cw,e,t,n)}function cx(e){return(e%360+360)%360}function Pw(e){const t=kw.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Ws(+t[5]):Fn(+t[5]));const s=cx(+t[2]),i=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?r=Ew(s,i,o):t[1]==="hsv"?r=Mw(s,i,o):r=ld(s,i,o),{r:r[0],g:r[1],b:r[2],a:n}}function Rw(e,t){var n=od(e);n[0]=cx(n[0]+t),n=ld(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Tw(e){if(!e)return;const t=od(e),n=t[0],r=oh(t[1]),s=oh(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${s}%, ${Zt(e.a)})`:`hsl(${n}, ${r}%, ${s}%)`}const ah={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},lh={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Ow(){const e={},t=Object.keys(lh),n=Object.keys(ah);let r,s,i,o,a;for(r=0;r<t.length;r++){for(o=a=t[r],s=0;s<n.length;s++)i=n[s],a=a.replace(i,ah[i]);i=parseInt(lh[o],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let po;function Dw(e){po||(po=Ow(),po.transparent=[0,0,0,0]);const t=po[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Lw=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Aw(e){const t=Lw.exec(e);let n=255,r,s,i;if(t){if(t[7]!==r){const o=+t[7];n=t[8]?Ws(o):jn(o*255,0,255)}return r=+t[1],s=+t[3],i=+t[5],r=255&(t[2]?Ws(r):jn(r,0,255)),s=255&(t[4]?Ws(s):jn(s,0,255)),i=255&(t[6]?Ws(i):jn(i,0,255)),{r,g:s,b:i,a:n}}}function zw(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Zt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Fl=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Mr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Iw(e,t,n){const r=Mr(Zt(e.r)),s=Mr(Zt(e.g)),i=Mr(Zt(e.b));return{r:Fn(Fl(r+n*(Mr(Zt(t.r))-r))),g:Fn(Fl(s+n*(Mr(Zt(t.g))-s))),b:Fn(Fl(i+n*(Mr(Zt(t.b))-i))),a:e.a+n*(t.a-e.a)}}function go(e,t,n){if(e){let r=od(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=ld(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function ux(e,t){return e&&Object.assign(t||{},e)}function ch(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Fn(e[3]))):(t=ux(e,{r:0,g:0,b:0,a:1}),t.a=Fn(t.a)),t}function Fw(e){return e.charAt(0)==="r"?Aw(e):Pw(e)}class ji{constructor(t){if(t instanceof ji)return t;const n=typeof t;let r;n==="object"?r=ch(t):n==="string"&&(r=ww(t)||Dw(t)||Fw(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=ux(this._rgb);return t&&(t.a=Zt(t.a)),t}set rgb(t){this._rgb=ch(t)}rgbString(){return this._valid?zw(this._rgb):void 0}hexString(){return this._valid?Sw(this._rgb):void 0}hslString(){return this._valid?Tw(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,s=t.rgb;let i;const o=n===i?.5:n,a=2*o-1,l=r.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-c,r.r=255&c*r.r+i*s.r+.5,r.g=255&c*r.g+i*s.g+.5,r.b=255&c*r.b+i*s.b+.5,r.a=o*r.a+(1-o)*s.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=Iw(this._rgb,t._rgb,n)),this}clone(){return new ji(this.rgb)}alpha(t){return this._rgb.a=Fn(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Fi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return go(this._rgb,2,t),this}darken(t){return go(this._rgb,2,-t),this}saturate(t){return go(this._rgb,1,t),this}desaturate(t){return go(this._rgb,1,-t),this}rotate(t){return Rw(this._rgb,t),this}}/*!
73
- * Chart.js v4.6.1
74
- * https://www.chartjs.org
75
- * (c) 2026 Chart.js Contributors
76
- * Released under the MIT License
77
- */function Xt(){}const Bw=(()=>{let e=0;return()=>e++})();function ne(e){return e==null}function Ee(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Q(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function _t(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ft(e,t){return _t(e)?e:t}function K(e,t){return typeof e>"u"?t:e}const Ww=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,dx=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function oe(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Z(e,t,n,r){let s,i,o;if(Ee(e))for(i=e.length,s=0;s<i;s++)t.call(n,e[s],s);else if(Q(e))for(o=Object.keys(e),i=o.length,s=0;s<i;s++)t.call(n,e[o[s]],o[s])}function xa(e,t){let n,r,s,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(s=e[n],i=t[n],s.datasetIndex!==i.datasetIndex||s.index!==i.index)return!1;return!0}function va(e){if(Ee(e))return e.map(va);if(Q(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let s=0;for(;s<r;++s)t[n[s]]=va(e[n[s]]);return t}return e}function fx(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function $w(e,t,n,r){if(!fx(e))return;const s=t[e],i=n[e];Q(s)&&Q(i)?Ni(s,i,r):t[e]=va(i)}function Ni(e,t,n){const r=Ee(t)?t:[t],s=r.length;if(!Q(e))return e;n=n||{};const i=n.merger||$w;let o;for(let a=0;a<s;++a){if(o=r[a],!Q(o))continue;const l=Object.keys(o);for(let c=0,d=l.length;c<d;++c)i(l[c],e,o,n)}return e}function ti(e,t){return Ni(e,t,{merger:Vw})}function Vw(e,t,n){if(!fx(e))return;const r=t[e],s=n[e];Q(r)&&Q(s)?ti(r,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=va(s))}const uh={"":e=>e,x:e=>e.x,y:e=>e.y};function Hw(e){const t=e.split("."),n=[];let r="";for(const s of t)r+=s,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function Uw(e){const t=Hw(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function yr(e,t){return(uh[t]||(uh[t]=Uw(t)))(e)}function cd(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ei=e=>typeof e<"u",Hn=e=>typeof e=="function",dh=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Yw(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ae=Math.PI,ue=2*ae,ya=Number.POSITIVE_INFINITY,Kw=ae/180,Ce=ae/2,er=ae/4,fh=ae*2/3,hx=Math.log10,Bn=Math.sign;function Io(e,t,n){return Math.abs(e-t)<n}function hh(e){const t=Math.round(e);e=Io(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(hx(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Xw(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((s,i)=>s-i).pop(),t}function Qw(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function ba(e){return!Qw(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function qw(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Gw(e,t,n){let r,s,i;for(r=0,s=e.length;r<s;r++)i=e[r][n],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function nn(e){return e*(ae/180)}function Jw(e){return e*(180/ae)}function ph(e){if(!_t(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function px(e,t){const n=t.x-e.x,r=t.y-e.y,s=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*ae&&(i+=ue),{angle:i,distance:s}}function Zw(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Vt(e){return(e%ue+ue)%ue}function wa(e,t,n,r){const s=Vt(e),i=Vt(t),o=Vt(n),a=Vt(i-s),l=Vt(o-s),c=Vt(s-i),d=Vt(s-o);return s===i||s===o||r&&i===o||a>l&&c<d}function qe(e,t,n){return Math.max(t,Math.min(n,e))}function e1(e){return qe(e,-32768,32767)}function ur(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ud(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,s=0,i;for(;r-s>1;)i=s+r>>1,n(i)?s=i:r=i;return{lo:s,hi:r}}const tu=(e,t,n,r)=>ud(e,n,r?s=>{const i=e[s][t];return i<n||i===n&&e[s+1][t]===n}:s=>e[s][t]<n),t1=(e,t,n)=>ud(e,n,r=>e[r][t]>=n);function n1(e,t,n){let r=0,s=e.length;for(;r<s&&e[r]<t;)r++;for(;s>r&&e[s-1]>n;)s--;return r>0||s<e.length?e.slice(r,s):e}const gx=["push","pop","shift","splice","unshift"];function r1(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),gx.forEach(n=>{const r="_onData"+cd(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...i){const o=s.apply(this,i);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...i)}),o}})})}function gh(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,s=r.indexOf(t);s!==-1&&r.splice(s,1),!(r.length>0)&&(gx.forEach(i=>{delete e[i]}),delete e._chartjs)}function mx(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const xx=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function vx(e,t){let n=[],r=!1;return function(...s){n=s,r||(r=!0,xx.call(window,()=>{r=!1,e.apply(t,n)}))}}function s1(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const yx=e=>e==="start"?"left":e==="end"?"right":"center",it=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,i1=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t,mo=e=>e===0||e===1,mh=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ue/n)),xh=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ue/n)+1,ni={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Ce)+1,easeOutSine:e=>Math.sin(e*Ce),easeInOutSine:e=>-.5*(Math.cos(ae*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>mo(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>mo(e)?e:mh(e,.075,.3),easeOutElastic:e=>mo(e)?e:xh(e,.075,.3),easeInOutElastic(e){return mo(e)?e:e<.5?.5*mh(e*2,.1125,.45):.5+.5*xh(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-ni.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?ni.easeInBounce(e*2)*.5:ni.easeOutBounce(e*2-1)*.5+.5};function bx(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function vh(e){return bx(e)?e:new ji(e)}function Bl(e){return bx(e)?e:new ji(e).saturate(.5).darken(.1).hexString()}const o1=["x","y","borderWidth","radius","tension"],a1=["color","borderColor","backgroundColor"];function l1(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:a1},numbers:{type:"number",properties:o1}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function c1(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const yh=new Map;function u1(e,t){t=t||{};const n=e+JSON.stringify(t);let r=yh.get(n);return r||(r=new Intl.NumberFormat(e,t),yh.set(n,r)),r}function dd(e,t,n){return u1(t,n).format(e)}const d1={values(e){return Ee(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let s,i=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),i=f1(e,n)}const o=hx(Math.abs(i)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),dd(e,r,l)}};function f1(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var wx={formatters:d1};function h1(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:wx.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const br=Object.create(null),nu=Object.create(null);function ri(e,t){if(!t)return e;const n=t.split(".");for(let r=0,s=n.length;r<s;++r){const i=n[r];e=e[i]||(e[i]=Object.create(null))}return e}function Wl(e,t,n){return typeof t=="string"?Ni(ri(e,t),n):Ni(ri(e,""),t)}class p1{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,s)=>Bl(s.backgroundColor),this.hoverBorderColor=(r,s)=>Bl(s.borderColor),this.hoverColor=(r,s)=>Bl(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Wl(this,t,n)}get(t){return ri(this,t)}describe(t,n){return Wl(nu,t,n)}override(t,n){return Wl(br,t,n)}route(t,n,r,s){const i=ri(this,t),o=ri(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return Q(l)?Object.assign({},c,l):K(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var ve=new p1({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[l1,c1,h1]);function g1(e){return!e||ne(e.size)||ne(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function bh(e,t,n,r,s){let i=t[s];return i||(i=t[s]=e.measureText(s).width,n.push(s)),i>r&&(r=i),r}function tr(e,t,n){const r=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*r)/r+s}function wh(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function _h(e,t,n,r){_x(e,t,n,r,null)}function _x(e,t,n,r,s){let i,o,a,l,c,d,f,p;const h=t.pointStyle,g=t.rotation,x=t.radius;let w=(g||0)*Kw;if(h&&typeof h=="object"&&(i=h.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(w),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(x)||x<=0)){switch(e.beginPath(),h){default:s?e.ellipse(n,r,s/2,x,0,0,ue):e.arc(n,r,x,0,ue),e.closePath();break;case"triangle":d=s?s/2:x,e.moveTo(n+Math.sin(w)*d,r-Math.cos(w)*x),w+=fh,e.lineTo(n+Math.sin(w)*d,r-Math.cos(w)*x),w+=fh,e.lineTo(n+Math.sin(w)*d,r-Math.cos(w)*x),e.closePath();break;case"rectRounded":c=x*.516,l=x-c,o=Math.cos(w+er)*l,f=Math.cos(w+er)*(s?s/2-c:l),a=Math.sin(w+er)*l,p=Math.sin(w+er)*(s?s/2-c:l),e.arc(n-f,r-a,c,w-ae,w-Ce),e.arc(n+p,r-o,c,w-Ce,w),e.arc(n+f,r+a,c,w,w+Ce),e.arc(n-p,r+o,c,w+Ce,w+ae),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*x,d=s?s/2:l,e.rect(n-d,r-l,2*d,2*l);break}w+=er;case"rectRot":f=Math.cos(w)*(s?s/2:x),o=Math.cos(w)*x,a=Math.sin(w)*x,p=Math.sin(w)*(s?s/2:x),e.moveTo(n-f,r-a),e.lineTo(n+p,r-o),e.lineTo(n+f,r+a),e.lineTo(n-p,r+o),e.closePath();break;case"crossRot":w+=er;case"cross":f=Math.cos(w)*(s?s/2:x),o=Math.cos(w)*x,a=Math.sin(w)*x,p=Math.sin(w)*(s?s/2:x),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-o),e.lineTo(n-p,r+o);break;case"star":f=Math.cos(w)*(s?s/2:x),o=Math.cos(w)*x,a=Math.sin(w)*x,p=Math.sin(w)*(s?s/2:x),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-o),e.lineTo(n-p,r+o),w+=er,f=Math.cos(w)*(s?s/2:x),o=Math.cos(w)*x,a=Math.sin(w)*x,p=Math.sin(w)*(s?s/2:x),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-o),e.lineTo(n-p,r+o);break;case"line":o=s?s/2:Math.cos(w)*x,a=Math.sin(w)*x,e.moveTo(n-o,r-a),e.lineTo(n+o,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(w)*(s?s/2:x),r+Math.sin(w)*x);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Sx(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function fd(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function hd(e){e.restore()}function m1(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),ne(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function x1(e,t,n,r,s){if(s.strikethrough||s.underline){const i=e.measureText(r),o=t-i.actualBoundingBoxLeft,a=t+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(o,d),e.lineTo(a,d),e.stroke()}}function v1(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function _a(e,t,n,r,s,i={}){const o=Ee(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,m1(e,i),l=0;l<o.length;++l)c=o[l],i.backdrop&&v1(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),ne(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),x1(e,n,r,c,i),r+=Number(s.lineHeight);e.restore()}function Sa(e,t){const{x:n,y:r,w:s,h:i,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*ae,ae,!0),e.lineTo(n,r+i-o.bottomLeft),e.arc(n+o.bottomLeft,r+i-o.bottomLeft,o.bottomLeft,ae,Ce,!0),e.lineTo(n+s-o.bottomRight,r+i),e.arc(n+s-o.bottomRight,r+i-o.bottomRight,o.bottomRight,Ce,0,!0),e.lineTo(n+s,r+o.topRight),e.arc(n+s-o.topRight,r+o.topRight,o.topRight,0,-Ce,!0),e.lineTo(n+o.topLeft,r)}const y1=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,b1=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function w1(e,t){const n=(""+e).match(y1);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const _1=e=>+e||0;function pd(e,t){const n={},r=Q(t),s=r?Object.keys(t):t,i=Q(e)?r?o=>K(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of s)n[o]=_1(i(o));return n}function kx(e){return pd(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Jr(e){return pd(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Dt(e){const t=kx(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Ge(e,t){e=e||{},t=t||ve.font;let n=K(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=K(e.style,t.style);r&&!(""+r).match(b1)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const s={family:K(e.family,t.family),lineHeight:w1(K(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:K(e.weight,t.weight),string:""};return s.string=g1(s),s}function xo(e,t,n,r){let s,i,o;for(s=0,i=e.length;s<i;++s)if(o=e[s],o!==void 0&&o!==void 0)return o}function S1(e,t,n){const{min:r,max:s}=e,i=dx(t,(s-r)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(r,-Math.abs(i)),max:o(s,i)}}function gs(e,t){return Object.assign(Object.create(e),t)}function gd(e,t=[""],n,r,s=()=>e[0]){const i=n||e;typeof r>"u"&&(r=Ex("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:s,override:a=>gd([a,...e],t,i,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return jx(a,l,()=>R1(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return kh(a).includes(l)},ownKeys(a){return kh(a)},set(a,l,c){const d=a._storage||(a._storage=s());return a[l]=d[l]=c,delete a._keys,!0}})}function us(e,t,n,r){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Cx(e,r),setContext:i=>us(e,i,n,r),override:i=>us(e.override(i),t,n,r)};return new Proxy(s,{deleteProperty(i,o){return delete i[o],delete e[o],!0},get(i,o,a){return jx(i,o,()=>C1(i,o,a))},getOwnPropertyDescriptor(i,o){return i._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(i,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(i,o,a){return e[o]=a,delete i[o],!0}})}function Cx(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:r,isScriptable:Hn(n)?n:()=>n,isIndexable:Hn(r)?r:()=>r}}const k1=(e,t)=>e?e+cd(t):t,md=(e,t)=>Q(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function jx(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function C1(e,t,n){const{_proxy:r,_context:s,_subProxy:i,_descriptors:o}=e;let a=r[t];return Hn(a)&&o.isScriptable(t)&&(a=j1(t,a,e,n)),Ee(a)&&a.length&&(a=N1(t,a,e,o.isIndexable)),md(t,a)&&(a=us(a,s,i&&i[t],o)),a}function j1(e,t,n,r){const{_proxy:s,_context:i,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(i,o||r);return a.delete(e),md(e,l)&&(l=xd(s._scopes,s,e,l)),l}function N1(e,t,n,r){const{_proxy:s,_context:i,_subProxy:o,_descriptors:a}=n;if(typeof i.index<"u"&&r(e))return t[i.index%t.length];if(Q(t[0])){const l=t,c=s._scopes.filter(d=>d!==l);t=[];for(const d of l){const f=xd(c,s,e,d);t.push(us(f,i,o&&o[e],a))}}return t}function Nx(e,t,n){return Hn(e)?e(t,n):e}const E1=(e,t)=>e===!0?t:typeof e=="string"?yr(t,e):void 0;function M1(e,t,n,r,s){for(const i of t){const o=E1(n,i);if(o){e.add(o);const a=Nx(o._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function xd(e,t,n,r){const s=t._rootScopes,i=Nx(t._fallback,n,r),o=[...e,...s],a=new Set;a.add(r);let l=Sh(a,o,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=Sh(a,o,i,l,r),l===null)?!1:gd(Array.from(a),[""],s,i,()=>P1(t,n,r))}function Sh(e,t,n,r,s){for(;n;)n=M1(e,t,n,r,s);return n}function P1(e,t,n){const r=e._getTarget();t in r||(r[t]={});const s=r[t];return Ee(s)&&Q(n)?n:s||{}}function R1(e,t,n,r){let s;for(const i of t)if(s=Ex(k1(i,e),n),typeof s<"u")return md(e,s)?xd(n,r,e,s):s}function Ex(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function kh(e){let t=e._keys;return t||(t=e._keys=T1(e._scopes)),t}function T1(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(r);return Array.from(t)}function vd(){return typeof window<"u"&&typeof document<"u"}function yd(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ka(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Za=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function O1(e,t){return Za(e).getPropertyValue(t)}const D1=["top","right","bottom","left"];function hr(e,t,n){const r={};n=n?"-"+n:"";for(let s=0;s<4;s++){const i=D1[s];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const L1=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function A1(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:s,offsetY:i}=r;let o=!1,a,l;if(L1(s,i,e.target))a=s,l=i;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function or(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,s=Za(n),i=s.boxSizing==="border-box",o=hr(s,"padding"),a=hr(s,"border","width"),{x:l,y:c,box:d}=A1(e,n),f=o.left+(d&&a.left),p=o.top+(d&&a.top);let{width:h,height:g}=t;return i&&(h-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-f)/h*n.width/r),y:Math.round((c-p)/g*n.height/r)}}function z1(e,t,n){let r,s;if(t===void 0||n===void 0){const i=e&&yd(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const o=i.getBoundingClientRect(),a=Za(i),l=hr(a,"border","width"),c=hr(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,r=ka(a.maxWidth,i,"clientWidth"),s=ka(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||ya,maxHeight:s||ya}}const Nn=e=>Math.round(e*10)/10;function I1(e,t,n,r){const s=Za(e),i=hr(s,"margin"),o=ka(s.maxWidth,e,"clientWidth")||ya,a=ka(s.maxHeight,e,"clientHeight")||ya,l=z1(e,t,n);let{width:c,height:d}=l;if(s.boxSizing==="content-box"){const p=hr(s,"border","width"),h=hr(s,"padding");c-=h.width+p.width,d-=h.height+p.height}return c=Math.max(0,c-i.width),d=Math.max(0,r?c/r:d-i.height),c=Nn(Math.min(c,o,l.maxWidth)),d=Nn(Math.min(d,a,l.maxHeight)),c&&!d&&(d=Nn(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,c=Nn(Math.floor(d*r))),{width:c,height:d}}function Ch(e,t,n){const r=t||1,s=Nn(e.height*r),i=Nn(e.width*r);e.height=Nn(e.height),e.width=Nn(e.width);const o=e.canvas;o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`);const a=Math.floor(s),l=Math.floor(i);return e.currentDevicePixelRatio!==r||o.height!==a||o.width!==l?(e.currentDevicePixelRatio=r,o.height=a,o.width=l,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const F1=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};vd()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function jh(e,t){const n=O1(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}const B1=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},W1=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Zr(e,t,n){return e?B1(t,n):W1()}function Mx(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function Px(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function vo(e,t,n){return e.options.clip?e[n]:t[n]}function $1(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:vo(n,t,"left"),right:vo(n,t,"right"),top:vo(r,t,"top"),bottom:vo(r,t,"bottom")}:t}function V1(e,t){const n=t._clip;if(n.disabled)return!1;const r=$1(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
78
- * Chart.js v4.6.1
79
- * https://www.chartjs.org
80
- * (c) 2026 Chart.js Contributors
81
- * Released under the MIT License
82
- */class H1{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,s){const i=n.listeners[s],o=n.duration;i.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=xx.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const i=r.items;let o=i.length-1,a=!1,l;for(;o>=0;--o)l=i[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(i[o]=i[i.length-1],i.pop());a&&(s.draw(),this._notify(s,r,t,"progress")),i.length||(r.running=!1,this._notify(s,r,t,"complete"),r.initial=!1),n+=i.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Qt=new H1;const Nh="transparent",U1={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=vh(e||Nh),s=r.valid&&vh(t||Nh);return s&&s.valid?s.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Y1{constructor(t,n,r,s){const i=n[r];s=xo([t.to,s,i,t.from]);const o=xo([t.from,i,s]);this._active=!0,this._fn=t.fn||U1[t.type||typeof o],this._easing=ni[t.easing]||ni.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],i=r-this._start,o=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=xo([t.to,n,s,t.from]),this._from=xo([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,s=this._prop,i=this._from,o=this._loop,a=this._to;let l;if(this._active=i!==a&&(o||n<r),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=i;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(i,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class Rx{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Q(t))return;const n=Object.keys(ve.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const i=t[s];if(!Q(i))return;const o={};for(const a of n)o[a]=i[a];(Ee(i.properties)&&i.properties||[s]).forEach(a=>{(a===s||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,s=X1(t,r);if(!s)return[];const i=this._createAnimations(s,r);return r.$shared&&K1(t.options.$animations,r).then(()=>{t.options=r},()=>{}),i}_createAnimations(t,n){const r=this._properties,s=[],i=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const d=n[c];let f=i[c];const p=r.get(c);if(f)if(p&&f.active()){f.update(p,d,a);continue}else f.cancel();if(!p||!p.duration){t[c]=d;continue}i[c]=f=new Y1(p,t,c,d),s.push(f)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Qt.add(this._chart,r),!0}}function K1(e,t){const n=[],r=Object.keys(t);for(let s=0;s<r.length;s++){const i=e[r[s]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function X1(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Eh(e,t){const n=e&&e.options||{},r=n.reverse,s=n.min===void 0?t:0,i=n.max===void 0?t:0;return{start:r?i:s,end:r?s:i}}function Q1(e,t,n){if(n===!1)return!1;const r=Eh(e,n),s=Eh(t,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function q1(e){let t,n,r,s;return Q(e)?(t=e.top,n=e.right,r=e.bottom,s=e.left):t=n=r=s=e,{top:t,right:n,bottom:r,left:s,disabled:e===!1}}function Tx(e,t){const n=[],r=e._getSortedDatasetMetas(t);let s,i;for(s=0,i=r.length;s<i;++s)n.push(r[s].index);return n}function Mh(e,t,n,r={}){const s=e.keys,i=r.mode==="single";let o,a,l,c;if(t===null)return;let d=!1;for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===n){if(d=!0,r.all)continue;break}c=e.values[l],_t(c)&&(i||t===0||Bn(t)===Bn(c))&&(t+=c)}return!d&&!r.all?0:t}function G1(e,t){const{iScale:n,vScale:r}=t,s=n.axis==="x"?"x":"y",i=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,d;for(l=0,c=o.length;l<c;++l)d=o[l],a[l]={[s]:d,[i]:e[d]};return a}function $l(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function J1(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Z1(e){const{min:t,max:n,minDefined:r,maxDefined:s}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function e_(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Ph(e,t,n,r){for(const s of t.getMatchingVisibleMetas(r).reverse()){const i=e[s.index];if(n&&i>0||!n&&i<0)return s.index}return null}function Rh(e,t){const{chart:n,_cachedMeta:r}=e,s=n._stacks||(n._stacks={}),{iScale:i,vScale:o,index:a}=r,l=i.axis,c=o.axis,d=J1(i,o,r),f=t.length;let p;for(let h=0;h<f;++h){const g=t[h],{[l]:x,[c]:w}=g,v=g._stacks||(g._stacks={});p=v[c]=e_(s,d,x),p[a]=w,p._top=Ph(p,o,!0,r.type),p._bottom=Ph(p,o,!1,r.type);const m=p._visualValues||(p._visualValues={});m[a]=w}}function Vl(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function t_(e,t){return gs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function n_(e,t,n){return gs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ts(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const s of t){const i=s._stacks;!i||i[r]===void 0||i[r][n]===void 0||(delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n])}}}const Hl=e=>e==="reset"||e==="none",Th=(e,t)=>t?e:Object.assign({},e),r_=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Tx(n,!0),values:null};class es{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=$l(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Ts(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(f,p,h,g)=>f==="x"?p:f==="r"?g:h,i=n.xAxisID=K(r.xAxisID,Vl(t,"x")),o=n.yAxisID=K(r.yAxisID,Vl(t,"y")),a=n.rAxisID=K(r.rAxisID,Vl(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,i,o,a),d=n.vAxisID=s(l,o,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&gh(this._data,this),t._stacked&&Ts(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Q(n)){const s=this._cachedMeta;this._data=G1(n,s)}else if(r!==n){if(r){gh(r,this);const s=this._cachedMeta;Ts(s),s._parsed=[]}n&&Object.isExtensible(n)&&r1(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let s=!1;this._dataCheck();const i=n._stacked;n._stacked=$l(n.vScale,n),n.stack!==r.stack&&(s=!0,Ts(n),n.stack=r.stack),this._resyncElements(t),(s||i!==n._stacked)&&(Rh(this,n._parsed),n._stacked=$l(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:s}=this,{iScale:i,_stacked:o}=r,a=i.axis;let l=t===0&&n===s.length?!0:r._sorted,c=t>0&&r._parsed[t-1],d,f,p;if(this._parsing===!1)r._parsed=s,r._sorted=!0,p=s;else{Ee(s[t])?p=this.parseArrayData(r,s,t,n):Q(s[t])?p=this.parseObjectData(r,s,t,n):p=this.parsePrimitiveData(r,s,t,n);const h=()=>f[a]===null||c&&f[a]<c[a];for(d=0;d<n;++d)r._parsed[d+t]=f=p[d],l&&(h()&&(l=!1),c=f);r._sorted=l}o&&Rh(this,p)}parsePrimitiveData(t,n,r,s){const{iScale:i,vScale:o}=t,a=i.axis,l=o.axis,c=i.getLabels(),d=i===o,f=new Array(s);let p,h,g;for(p=0,h=s;p<h;++p)g=p+r,f[p]={[a]:d||i.parse(c[g],g),[l]:o.parse(n[g],g)};return f}parseArrayData(t,n,r,s){const{xScale:i,yScale:o}=t,a=new Array(s);let l,c,d,f;for(l=0,c=s;l<c;++l)d=l+r,f=n[d],a[l]={x:i.parse(f[0],d),y:o.parse(f[1],d)};return a}parseObjectData(t,n,r,s){const{xScale:i,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let d,f,p,h;for(d=0,f=s;d<f;++d)p=d+r,h=n[p],c[d]={x:i.parse(yr(h,a),p),y:o.parse(yr(h,l),p)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const s=this.chart,i=this._cachedMeta,o=n[t.axis],a={keys:Tx(s,!0),values:n._stacks[t.axis]._visualValues};return Mh(a,o,i.index,{mode:r})}updateRangeFromParsed(t,n,r,s){const i=r[n.axis];let o=i===null?NaN:i;const a=s&&r._stacks[n.axis];s&&a&&(s.values=a,o=Mh(s,i,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,s=r._parsed,i=r._sorted&&t===r.iScale,o=s.length,a=this._getOtherScale(t),l=r_(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=Z1(a);let p,h;function g(){h=s[p];const x=h[a.axis];return!_t(h[t.axis])||d>x||f<x}for(p=0;p<o&&!(!g()&&(this.updateRangeFromParsed(c,t,h,l),i));++p);if(i){for(p=o-1;p>=0;--p)if(!g()){this.updateRangeFromParsed(c,t,h,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let s,i,o;for(s=0,i=n.length;s<i;++s)o=n[s][t.axis],_t(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,s=n.vScale,i=this.getParsed(t);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:s?""+s.getLabelForValue(i[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=q1(K(this.options.clip,Q1(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],i=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(t,i,a,l),d=a;d<a+l;++d){const f=s[d];f.hidden||(f.active&&c?o.push(f):f.draw(t,i))}for(d=0;d<o.length;++d)o[d].draw(t,i)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const s=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];i=o.$context||(o.$context=n_(this.getContext(),t,o)),i.parsed=this.getParsed(t),i.raw=s.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=t_(this.chart.getContext(),this.index)),i.dataset=s,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const s=n==="active",i=this._cachedDataOpts,o=t+"-"+n,a=i[o],l=this.enableOptionSharing&&Ei(r);if(a)return Th(a,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),f=s?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),d),h=Object.keys(ve.elements[t]),g=()=>this.getContext(r,s,n),x=c.resolveNamedOptions(p,h,g,f);return x.$shared&&(x.$shared=l,i[o]=Object.freeze(Th(x,l))),x}_resolveAnimations(t,n,r){const s=this.chart,i=this._cachedDataOpts,o=`animation-${n}`,a=i[o];if(a)return a;let l;if(s.options.animation!==!1){const d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,n),p=d.getOptionScopes(this.getDataset(),f);l=d.createResolver(p,this.getContext(t,r,n))}const c=new Rx(s,l&&l.animations);return l&&l._cacheable&&(i[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Hl(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),s=this._sharedOptions,i=this.getSharedOptions(r),o=this.includeOptions(n,i)||i!==s;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:o}}updateElement(t,n,r,s){Hl(s)?Object.assign(t,r):this._resolveAnimations(n,s).update(t,r)}updateSharedOptions(t,n,r){t&&!Hl(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,s){t.active=s;const i=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(t,{options:!s&&this.getSharedOptions(i)||i})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=r.length,i=n.length,o=Math.min(i,s);o&&this.parse(0,o),i>s?this._insertElements(s,i-s,t):i<s&&this._removeElements(i,s-i)}_insertElements(t,n,r=!0){const s=this._cachedMeta,i=s.data,o=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(i),a=t;a<o;++a)i[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),r&&this.updateElements(i,t,n,"reset")}updateElements(t,n,r,s){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const s=r._parsed.splice(t,n);r._stacked&&Ts(r,s)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,s]=t;this[n](r,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}F(es,"defaults",{}),F(es,"datasetElementType",null),F(es,"dataElementType",null);function s_(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let s=0,i=n.length;s<i;s++)r=r.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=mx(r.sort((s,i)=>s-i))}return e._cache.$bar}function i_(e){const t=e.iScale,n=s_(t,e.type);let r=t._length,s,i,o,a;const l=()=>{o===32767||o===-32768||(Ei(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,i=n.length;s<i;++s)o=t.getPixelForValue(n[s]),l();for(a=void 0,s=0,i=t.ticks.length;s<i;++s)o=t.getPixelForTick(s),l();return r}function o_(e,t,n,r){const s=n.barThickness;let i,o;return ne(s)?(i=t.min*n.categoryPercentage,o=n.barPercentage):(i=s*r,o=1),{chunk:i/r,ratio:o,start:t.pixels[e]-i/2}}function a_(e,t,n,r){const s=t.pixels,i=s[e];let o=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null;const l=n.categoryPercentage;o===null&&(o=i-(a===null?t.end-t.start:a-i)),a===null&&(a=i+i-o);const c=i-(i-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/r,ratio:n.barPercentage,start:c}}function l_(e,t,n,r){const s=n.parse(e[0],r),i=n.parse(e[1],r),o=Math.min(s,i),a=Math.max(s,i);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:i,min:o,max:a}}function Ox(e,t,n,r){return Ee(e)?l_(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Oh(e,t,n,r){const s=e.iScale,i=e.vScale,o=s.getLabels(),a=s===i,l=[];let c,d,f,p;for(c=n,d=n+r;c<d;++c)p=t[c],f={},f[s.axis]=a||s.parse(o[c],c),l.push(Ox(p,f,i,c));return l}function Ul(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function c_(e,t,n){return e!==0?Bn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function u_(e){let t,n,r,s,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(s="end",i="start"):(s="start",i="end"),{start:n,end:r,reverse:t,top:s,bottom:i}}function d_(e,t,n,r){let s=t.borderSkipped;const i={};if(!s){e.borderSkipped=i;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:d}=u_(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?s=c:(n._bottom||0)===r?s=d:(i[Dh(d,o,a,l)]=!0,s=c)),i[Dh(s,o,a,l)]=!0,e.borderSkipped=i}function Dh(e,t,n,r){return r?(e=f_(e,t,n),e=Lh(e,n,t)):e=Lh(e,t,n),e}function f_(e,t,n){return e===t?n:e===n?t:e}function Lh(e,t,n){return e==="start"?t:e==="end"?n:e}function h_(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Fo extends es{parsePrimitiveData(t,n,r,s){return Oh(t,n,r,s)}parseArrayData(t,n,r,s){return Oh(t,n,r,s)}parseObjectData(t,n,r,s){const{iScale:i,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?a:l,d=o.axis==="x"?a:l,f=[];let p,h,g,x;for(p=r,h=r+s;p<h;++p)x=n[p],g={},g[i.axis]=i.parse(yr(x,c),p),f.push(Ox(yr(x,d),g,o,p));return f}updateRangeFromParsed(t,n,r,s){super.updateRangeFromParsed(t,n,r,s);const i=r._custom;i&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:s}=n,i=this.getParsed(t),o=i._custom,a=Ul(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(i[s.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,s){const i=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:f,includeOptions:p}=this._getSharedOptions(n,s);for(let h=n;h<n+r;h++){const g=this.getParsed(h),x=i||ne(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),w=this._calculateBarIndexPixels(h,d),v=(g._stacks||{})[a.axis],m={horizontal:c,base:x.base,enableBorderRadius:!v||Ul(g._custom)||o===v._top||o===v._bottom,x:c?x.head:w.center,y:c?w.center:x.head,height:c?w.size:Math.abs(x.size),width:c?Math.abs(x.size):w.size};p&&(m.options=f||this.resolveDataElementOptions(h,t[h].active?"active":s));const y=m.options||t[h].options;d_(m,y,v,o),h_(m,y,d.ratio),this.updateElement(t[h],h,m,s)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,s=r.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),i=r.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=d=>{const f=d._parsed.find(h=>h[r.axis]===l),p=f&&f[d.vScale.axis];if(ne(p)||isNaN(p))return!0};for(const d of s)if(!(n!==void 0&&c(d))&&((i===!1||o.indexOf(d.stack)===-1||i===void 0&&d.stack===void 0)&&o.push(d.stack),d.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[K(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const s=this._getStacks(t,r),i=n!==void 0?s.indexOf(n):-1;return i===-1?s.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,s=[];let i,o;for(i=0,o=n.data.length;i<o;++i)s.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=t.barThickness;return{min:a||i_(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:s},options:{base:i,minBarLength:o}}=this,a=i||0,l=this.getParsed(t),c=l._custom,d=Ul(c);let f=l[n.axis],p=0,h=r?this.applyStack(n,l,r):f,g,x;h!==f&&(p=h-f,h=f),d&&(f=c.barStart,h=c.barEnd-c.barStart,f!==0&&Bn(f)!==Bn(c.barEnd)&&(p=0),p+=f);const w=!ne(i)&&!d?i:p;let v=n.getPixelForValue(w);if(this.chart.getDataVisibility(t)?g=n.getPixelForValue(p+h):g=v,x=g-v,Math.abs(x)<o){x=c_(x,n,a)*o,f===a&&(v-=x/2);const m=n.getPixelForDecimal(0),y=n.getPixelForDecimal(1),_=Math.min(m,y),k=Math.max(m,y);v=Math.max(Math.min(v,k),_),g=v+x,r&&!d&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(g)-n.getValueForPixel(v))}if(v===n.getPixelForValue(a)){const m=Bn(x)*n.getLineWidthForValue(a)/2;v+=m,x-=m}return{size:x,base:v,head:g,center:g+x/2}}_calculateBarIndexPixels(t,n){const r=n.scale,s=this.options,i=s.skipNull,o=K(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const d=i?this._getStackCount(t):n.stackCount,f=s.barThickness==="flex"?a_(t,n,s,d*c):o_(t,n,s,d*c),p=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(K(p,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0)+h;a=f.start+f.chunk*g+f.chunk/2,l=Math.min(o,f.chunk*f.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(o,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,s=r.length;let i=0;for(;i<s;++i)this.getParsed(i)[n.axis]!==null&&!r[i].hidden&&r[i].draw(this._ctx)}}F(Fo,"id","bar"),F(Fo,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),F(Fo,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function p_(e,t,n){let r=1,s=1,i=0,o=0;if(t<ue){const a=e,l=a+t,c=Math.cos(a),d=Math.sin(a),f=Math.cos(l),p=Math.sin(l),h=(y,_,k)=>wa(y,a,l,!0)?1:Math.max(_,_*n,k,k*n),g=(y,_,k)=>wa(y,a,l,!0)?-1:Math.min(_,_*n,k,k*n),x=h(0,c,f),w=h(Ce,d,p),v=g(ae,c,f),m=g(ae+Ce,d,p);r=(x-v)/2,s=(w-m)/2,i=-(x+v)/2,o=-(w+m)/2}return{ratioX:r,ratioY:s,offsetX:i,offsetY:o}}class $s extends es{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=r;else{let i=l=>+r[l];if(Q(r[t])){const{key:l="value"}=this._parsing;i=c=>+yr(r[c],l)}let o,a;for(o=t,a=t+n;o<a;++o)s._parsed[o]=i(o)}}_getRotation(){return nn(this.options.rotation-90)}_getCircumference(){return nn(this.options.circumference)}_getRotationExtents(){let t=ue,n=-ue;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const s=this.chart.getDatasetMeta(r).controller,i=s._getRotation(),o=s._getCircumference();t=Math.min(t,i),n=Math.max(n,i+o)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,s=this._cachedMeta,i=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min(Ww(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:g,offsetY:x}=p_(f,d,l),w=(r.width-o)/p,v=(r.height-o)/h,m=Math.max(Math.min(w,v)/2,0),y=dx(this.options.radius,m),_=Math.max(y*l,0),k=(y-_)/this._getVisibleDatasetWeightTotal();this.offsetX=g*y,this.offsetY=x*y,s.total=this.calculateTotal(),this.outerRadius=y-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*c,0),this.updateElements(i,0,i.length,t)}_circumference(t,n){const r=this.options,s=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*i/ue)}updateElements(t,n,r,s){const i=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,d=(a.left+a.right)/2,f=(a.top+a.bottom)/2,p=i&&c.animateScale,h=p?0:this.innerRadius,g=p?0:this.outerRadius,{sharedOptions:x,includeOptions:w}=this._getSharedOptions(n,s);let v=this._getRotation(),m;for(m=0;m<n;++m)v+=this._circumference(m,i);for(m=n;m<n+r;++m){const y=this._circumference(m,i),_=t[m],k={x:d+this.offsetX,y:f+this.offsetY,startAngle:v,endAngle:v+y,circumference:y,outerRadius:g,innerRadius:h};w&&(k.options=x||this.resolveDataElementOptions(m,_.active?"active":s)),v+=y,this.updateElement(_,m,k,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,s;for(s=0;s<n.length;s++){const i=t._parsed[s];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?ue*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],i=dd(n._parsed[t],r.options.locale);return{label:s[t]||"",value:i}}getMaxBorderWidth(t){let n=0;const r=this.chart;let s,i,o,a,l;if(!t){for(s=0,i=r.data.datasets.length;s<i;++s)if(r.isDatasetVisible(s)){o=r.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,i=t.length;s<i;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,s=t.length;r<s;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(K(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}F($s,"id","doughnut"),F($s,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,spacingMode:"angular",indexAxis:"r"}),F($s,"descriptors",{_scriptable:t=>t!=="spacing"&&t!=="spacingMode",_indexable:t=>t!=="spacing"&&t!=="spacingMode"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),F($s,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:r,textAlign:s,color:i,useBorderRadius:o,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const f=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:f.backgroundColor,fontColor:i,hidden:!t.getDataVisibility(c),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:s,pointStyle:r,borderRadius:o&&(a||f.borderRadius),index:c}}):[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});function nr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class bd{constructor(t){F(this,"options");this.options=t||{}}static override(t){Object.assign(bd.prototype,t)}init(){}formats(){return nr()}parse(){return nr()}format(){return nr()}add(){return nr()}diff(){return nr()}startOf(){return nr()}endOf(){return nr()}}var g_={_date:bd};function m_(e,t,n,r){const{controller:s,data:i,_sorted:o}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&i.length){const c=a._reversePixels?t1:tu;if(r){if(s._sharedOptions){const d=i[0],f=typeof d.getRange=="function"&&d.getRange(t);if(f){const p=c(i,t,n-f),h=c(i,t,n+f);return{lo:p.lo,hi:h.hi}}}}else{const d=c(i,t,n);if(l){const{vScale:f}=s._cachedMeta,{_parsed:p}=e,h=p.slice(0,d.lo+1).reverse().findIndex(x=>!ne(x[f.axis]));d.lo-=Math.max(0,h);const g=p.slice(d.hi).findIndex(x=>!ne(x[f.axis]));d.hi+=Math.max(0,g)}return d}}return{lo:0,hi:i.length-1}}function el(e,t,n,r,s){const i=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=i.length;a<l;++a){const{index:c,data:d}=i[a],{lo:f,hi:p}=m_(i[a],t,o,s);for(let h=f;h<=p;++h){const g=d[h];g.skip||r(g,c,h)}}}function x_(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,s){const i=t?Math.abs(r.x-s.x):0,o=n?Math.abs(r.y-s.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}}function Yl(e,t,n,r,s){const i=[];return!s&&!e.isPointInArea(t)||el(e,n,t,function(a,l,c){!s&&!Sx(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function v_(e,t,n,r){let s=[];function i(o,a,l){const{startAngle:c,endAngle:d}=o.getProps(["startAngle","endAngle"],r),{angle:f}=px(o,{x:t.x,y:t.y});wa(f,c,d)&&s.push({element:o,datasetIndex:a,index:l})}return el(e,n,t,i),s}function y_(e,t,n,r,s,i){let o=[];const a=x_(n);let l=Number.POSITIVE_INFINITY;function c(d,f,p){const h=d.inRange(t.x,t.y,s);if(r&&!h)return;const g=d.getCenterPoint(s);if(!(!!i||e.isPointInArea(g))&&!h)return;const w=a(t,g);w<l?(o=[{element:d,datasetIndex:f,index:p}],l=w):w===l&&o.push({element:d,datasetIndex:f,index:p})}return el(e,n,t,c),o}function Kl(e,t,n,r,s,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?v_(e,t,n,s):y_(e,t,n,r,s,i)}function Ah(e,t,n,r,s){const i=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return el(e,n,t,(l,c,d)=>{l[o]&&l[o](t[n],s)&&(i.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(t.x,t.y,s))}),r&&!a?[]:i}var b_={modes:{index(e,t,n,r){const s=or(t,e),i=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Yl(e,s,i,r,o):Kl(e,s,i,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const d=a[0].index,f=c.data[d];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,n,r){const s=or(t,e),i=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Yl(e,s,i,r,o):Kl(e,s,i,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(e,t,n,r){const s=or(t,e),i=n.axis||"xy",o=n.includeInvisible||!1;return Yl(e,s,i,r,o)},nearest(e,t,n,r){const s=or(t,e),i=n.axis||"xy",o=n.includeInvisible||!1;return Kl(e,s,i,n.intersect,r,o)},x(e,t,n,r){const s=or(t,e);return Ah(e,s,"x",n.intersect,r)},y(e,t,n,r){const s=or(t,e);return Ah(e,s,"y",n.intersect,r)}}};const Dx=["left","top","right","bottom"];function Os(e,t){return e.filter(n=>n.pos===t)}function zh(e,t){return e.filter(n=>Dx.indexOf(n.pos)===-1&&n.box.axis===t)}function Ds(e,t){return e.sort((n,r)=>{const s=t?r:n,i=t?n:r;return s.weight===i.weight?s.index-i.index:s.weight-i.weight})}function w_(e){const t=[];let n,r,s,i,o,a;for(n=0,r=(e||[]).length;n<r;++n)s=e[n],{position:i,options:{stack:o,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:i,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&i+o,stackWeight:a});return t}function __(e){const t={};for(const n of e){const{stack:r,pos:s,stackWeight:i}=n;if(!r||!Dx.includes(s))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=i}return t}function S_(e,t){const n=__(e),{vBoxMaxWidth:r,hBoxMaxHeight:s}=t;let i,o,a;for(i=0,o=e.length;i<o;++i){a=e[i];const{fullSize:l}=a.box,c=n[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*r:l&&t.availableWidth,a.height=s):(a.width=r,a.height=d?d*s:l&&t.availableHeight)}return n}function k_(e){const t=w_(e),n=Ds(t.filter(c=>c.box.fullSize),!0),r=Ds(Os(t,"left"),!0),s=Ds(Os(t,"right")),i=Ds(Os(t,"top"),!0),o=Ds(Os(t,"bottom")),a=zh(t,"x"),l=zh(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:Os(t,"chartArea"),vertical:r.concat(s).concat(l),horizontal:i.concat(o).concat(a)}}function Ih(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Lx(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function C_(e,t,n,r){const{pos:s,box:i}=n,o=e.maxPadding;if(!Q(s)){n.size&&(e[s]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?i.height:i.width),n.size=f.size/f.count,e[s]+=n.size}i.getPadding&&Lx(o,i.getPadding());const a=Math.max(0,t.outerWidth-Ih(o,e,"left","right")),l=Math.max(0,t.outerHeight-Ih(o,e,"top","bottom")),c=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function j_(e){const t=e.maxPadding;function n(r){const s=Math.max(t[r]-e[r],0);return e[r]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function N_(e,t){const n=t.maxPadding;function r(s){const i={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{i[o]=Math.max(t[o],n[o])}),i}return r(e?["left","right"]:["top","bottom"])}function Vs(e,t,n,r){const s=[];let i,o,a,l,c,d;for(i=0,o=e.length,c=0;i<o;++i){a=e[i],l=a.box,l.update(a.width||t.w,a.height||t.h,N_(a.horizontal,t));const{same:f,other:p}=C_(t,n,a,r);c|=f&&s.length,d=d||p,l.fullSize||s.push(a)}return c&&Vs(s,t,n,r)||d}function yo(e,t,n,r,s){e.top=n,e.left=t,e.right=t+r,e.bottom=n+s,e.width=r,e.height=s}function Fh(e,t,n,r){const s=n.padding;let{x:i,y:o}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*d,p=c.size||l.height;Ei(c.start)&&(o=c.start),l.fullSize?yo(l,s.left,o,n.outerWidth-s.right-s.left,p):yo(l,t.left+c.placed,o,f,p),c.start=o,c.placed+=f,o=l.bottom}else{const f=t.h*d,p=c.size||l.width;Ei(c.start)&&(i=c.start),l.fullSize?yo(l,i,s.top,p,n.outerHeight-s.bottom-s.top):yo(l,i,t.top+c.placed,p,f),c.start=i,c.placed+=f,i=l.right}}t.x=i,t.y=o}var En={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const s=Dt(e.options.layout.padding),i=Math.max(t-s.width,0),o=Math.max(n-s.height,0),a=k_(e.boxes),l=a.vertical,c=a.horizontal;Z(e.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});const d=l.reduce((x,w)=>w.box.options&&w.box.options.display===!1?x:x+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:i,availableHeight:o,vBoxMaxWidth:i/2/d,hBoxMaxHeight:o/2}),p=Object.assign({},s);Lx(p,Dt(r));const h=Object.assign({maxPadding:p,w:i,h:o,x:s.left,y:s.top},s),g=S_(l.concat(c),f);Vs(a.fullSize,h,f,g),Vs(l,h,f,g),Vs(c,h,f,g)&&Vs(l,h,f,g),j_(h),Fh(a.leftAndTop,h,f,g),h.x+=h.w,h.y+=h.h,Fh(a.rightAndBottom,h,f,g),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Z(a.chartArea,x=>{const w=x.box;Object.assign(w,e.chartArea),w.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class Ax{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,s){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):r)}}isAttached(t){return!0}updateConfig(t){}}class E_ extends Ax{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Bo="$chartjs",M_={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Bh=e=>e===null||e==="";function P_(e,t){const n=e.style,r=e.getAttribute("height"),s=e.getAttribute("width");if(e[Bo]={initial:{height:r,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Bh(s)){const i=jh(e,"width");i!==void 0&&(e.width=i)}if(Bh(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=jh(e,"height");i!==void 0&&(e.height=i)}return e}const zx=F1?{passive:!0}:!1;function R_(e,t,n){e&&e.addEventListener(t,n,zx)}function T_(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,zx)}function O_(e,t){const n=M_[e.type]||e.type,{x:r,y:s}=or(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:s!==void 0?s:null}}function Ca(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function D_(e,t,n){const r=e.canvas,s=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||Ca(a.addedNodes,r),o=o&&!Ca(a.removedNodes,r);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function L_(e,t,n){const r=e.canvas,s=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||Ca(a.removedNodes,r),o=o&&!Ca(a.addedNodes,r);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Mi=new Map;let Wh=0;function Ix(){const e=window.devicePixelRatio;e!==Wh&&(Wh=e,Mi.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function A_(e,t){Mi.size||window.addEventListener("resize",Ix),Mi.set(e,t)}function z_(e){Mi.delete(e),Mi.size||window.removeEventListener("resize",Ix)}function I_(e,t,n){const r=e.canvas,s=r&&yd(r);if(!s)return;const i=vx((a,l)=>{const c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||i(c,d)});return o.observe(s),A_(e,i),o}function Xl(e,t,n){n&&n.disconnect(),t==="resize"&&z_(e)}function F_(e,t,n){const r=e.canvas,s=vx(i=>{e.ctx!==null&&n(O_(i,e))},e);return R_(r,t,s),s}class B_ extends Ax{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(P_(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Bo])return!1;const r=n[Bo].initial;["height","width"].forEach(i=>{const o=r[i];ne(o)?n.removeAttribute(i):n.setAttribute(i,o)});const s=r.style||{};return Object.keys(s).forEach(i=>{n.style[i]=s[i]}),n.width=n.width,delete n[Bo],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:D_,detach:L_,resize:I_}[n]||F_;s[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),s=r[n];if(!s)return;({attach:Xl,detach:Xl,resize:Xl}[n]||T_)(t,n,s),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,s){return I1(t,n,r,s)}isAttached(t){const n=t&&yd(t);return!!(n&&n.isConnected)}}function W_(e){return!vd()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?E_:B_}class Un{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return ba(this.x)&&ba(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const s={};return t.forEach(i=>{s[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),s}}F(Un,"defaults",{}),F(Un,"defaultRoutes");function $_(e,t){const n=e.options.ticks,r=V_(e),s=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?U_(t):[],o=i.length,a=i[0],l=i[o-1],c=[];if(o>s)return Y_(t,c,i,o/s),c;const d=H_(i,t,s);if(o>0){let f,p;const h=o>1?Math.round((l-a)/(o-1)):null;for(bo(t,c,d,ne(h)?0:a-h,a),f=0,p=o-1;f<p;f++)bo(t,c,d,i[f],i[f+1]);return bo(t,c,d,l,ne(h)?t.length:l+h),c}return bo(t,c,d),c}function V_(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(r,s))}function H_(e,t,n){const r=K_(e),s=t.length/n;if(!r)return Math.max(s,1);const i=Xw(r);for(let o=0,a=i.length-1;o<a;o++){const l=i[o];if(l>s)return l}return Math.max(s,1)}function U_(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Y_(e,t,n,r){let s=0,i=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===i&&(t.push(e[o]),s++,i=n[s*r])}function bo(e,t,n,r,s){const i=K(r,0),o=Math.min(K(s,e.length),e.length);let a=0,l,c,d;for(n=Math.ceil(n),s&&(l=s-r,n=l/Math.floor(l/n)),d=i;d<0;)a++,d=Math.round(i+a*n);for(c=Math.max(i,0);c<o;c++)c===d&&(t.push(e[c]),a++,d=Math.round(i+a*n))}function K_(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const X_=e=>e==="left"?"right":e==="right"?"left":e,$h=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Vh=(e,t)=>Math.min(t||e,e);function Hh(e,t){const n=[],r=e.length/t,s=e.length;let i=0;for(;i<s;i+=r)n.push(e[Math.floor(i)]);return n}function Q_(e,t,n){const r=e.ticks.length,s=Math.min(t,r-1),i=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(s),c;if(!(n&&(r===1?c=Math.max(l-i,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<i-a||l>o+a)))return l}function q_(e,t){Z(e,n=>{const r=n.gc,s=r.length/2;let i;if(s>t){for(i=0;i<s;++i)delete n.data[r[i]];r.splice(0,s)}})}function Ls(e){return e.drawTicks?e.tickLength:0}function Uh(e,t){if(!e.display)return 0;const n=Ge(e.font,t),r=Dt(e.padding);return(Ee(e.text)?e.text.length:1)*n.lineHeight+r.height}function G_(e,t){return gs(e,{scale:t,type:"scale"})}function J_(e,t,n){return gs(e,{tick:n,index:t,type:"tick"})}function Z_(e,t,n){let r=yx(e);return(n&&t!=="right"||!n&&t==="right")&&(r=X_(r)),r}function eS(e,t,n,r){const{top:s,left:i,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:d}=l;let f=0,p,h,g;const x=o-s,w=a-i;if(e.isHorizontal()){if(h=it(r,i,a),Q(n)){const v=Object.keys(n)[0],m=n[v];g=d[v].getPixelForValue(m)+x-t}else n==="center"?g=(c.bottom+c.top)/2+x-t:g=$h(e,n,t);p=a-i}else{if(Q(n)){const v=Object.keys(n)[0],m=n[v];h=d[v].getPixelForValue(m)-w+t}else n==="center"?h=(c.left+c.right)/2-w+t:h=$h(e,n,t);g=it(r,o,s),f=n==="left"?-Ce:Ce}return{titleX:h,titleY:g,maxWidth:p,rotation:f}}class ms extends Un{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:s}=this;return t=Ft(t,Number.POSITIVE_INFINITY),n=Ft(n,Number.NEGATIVE_INFINITY),r=Ft(r,Number.POSITIVE_INFINITY),s=Ft(s,Number.NEGATIVE_INFINITY),{min:Ft(t,r),max:Ft(n,s),minDefined:_t(t),maxDefined:_t(n)}}getMinMax(t){let{min:n,max:r,minDefined:s,maxDefined:i}=this.getUserBounds(),o;if(s&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,o.min)),i||(r=Math.max(r,o.max));return n=i&&n>r?r:n,r=s&&n>r?n:r,{min:Ft(n,Ft(r,n)),max:Ft(r,Ft(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){oe(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:s,grace:i,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=S1(this,i,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Hh(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=$_(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){oe(this.options.afterUpdate,[this])}beforeSetDimensions(){oe(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){oe(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),oe(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){oe(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,s,i;for(r=0,s=t.length;r<s;r++)i=t[r],i.label=oe(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){oe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){oe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Vh(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,i=n.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!n.display||s>=i||r<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),f=d.widest.width,p=d.highest.height,h=qe(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),f+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-Ls(t.grid)-n.padding-Uh(t.title,this.chart.options.font),c=Math.sqrt(f*f+p*p),o=Jw(Math.min(Math.asin(qe((d.highest.height+6)/a,-1,1)),Math.asin(qe(l/c,-1,1))-Math.asin(qe(p/c,-1,1)))),o=Math.max(s,Math.min(i,o))),this.labelRotation=o}afterCalculateLabelRotation(){oe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){oe(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:s,grid:i}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Uh(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ls(i)+l):(t.height=this.maxHeight,t.width=Ls(i)+l),r.display&&this.ticks.length){const{first:c,last:d,widest:f,highest:p}=this._getLabelSizes(),h=r.padding*2,g=nn(this.labelRotation),x=Math.cos(g),w=Math.sin(g);if(a){const v=r.mirror?0:w*f.width+x*p.height;t.height=Math.min(this.maxHeight,t.height+v+h)}else{const v=r.mirror?0:x*f.width+w*p.height;t.width=Math.min(this.maxWidth,t.width+v+h)}this._calculatePadding(c,d,w,x)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,s){const{ticks:{align:i,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,h=0;l?c?(p=s*t.width,h=r*n.height):(p=r*t.height,h=s*n.width):i==="start"?h=n.width:i==="end"?p=t.width:i!=="inner"&&(p=t.width/2,h=n.width/2),this.paddingLeft=Math.max((p-d+o)*this.width/(this.width-d),0),this.paddingRight=Math.max((h-f+o)*this.width/(this.width-f),0)}else{let d=n.height/2,f=t.height/2;i==="start"?(d=0,f=t.height):i==="end"&&(d=n.height,f=0),this.paddingTop=d+o,this.paddingBottom=f+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){oe(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)ne(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Hh(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:s,_longestTextCache:i}=this,o=[],a=[],l=Math.floor(n/Vh(n,r));let c=0,d=0,f,p,h,g,x,w,v,m,y,_,k;for(f=0;f<n;f+=l){if(g=t[f].label,x=this._resolveTickFontOptions(f),s.font=w=x.string,v=i[w]=i[w]||{data:{},gc:[]},m=x.lineHeight,y=_=0,!ne(g)&&!Ee(g))y=bh(s,v.data,v.gc,y,g),_=m;else if(Ee(g))for(p=0,h=g.length;p<h;++p)k=g[p],!ne(k)&&!Ee(k)&&(y=bh(s,v.data,v.gc,y,k),_+=m);o.push(y),a.push(_),c=Math.max(y,c),d=Math.max(_,d)}q_(i,n);const S=o.indexOf(c),C=a.indexOf(d),j=R=>({width:o[R]||0,height:a[R]||0});return{first:j(0),last:j(n-1),widest:j(S),highest:j(C),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return e1(this._alignToPixels?tr(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=J_(this.getContext(),t,r))}return this.$context||(this.$context=G_(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=nn(this.labelRotation),r=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),i=this._getLabelSizes(),o=t.autoSkipPadding||0,a=i?i.widest.width+o:0,l=i?i.highest.height+o:0;return this.isHorizontal()?l*r>a*s?a/r:l/s:l*s<a*r?l/r:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,s=this.options,{grid:i,position:o,border:a}=s,l=i.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),p=Ls(i),h=[],g=a.setContext(this.getContext()),x=g.display?g.width:0,w=x/2,v=function(G){return tr(r,G,x)};let m,y,_,k,S,C,j,R,M,N,D,E;if(o==="top")m=v(this.bottom),C=this.bottom-p,R=m-w,N=v(t.top)+w,E=t.bottom;else if(o==="bottom")m=v(this.top),N=t.top,E=v(t.bottom)-w,C=m+w,R=this.top+p;else if(o==="left")m=v(this.right),S=this.right-p,j=m-w,M=v(t.left)+w,D=t.right;else if(o==="right")m=v(this.left),M=t.left,D=v(t.right)-w,S=m+w,j=this.left+p;else if(n==="x"){if(o==="center")m=v((t.top+t.bottom)/2+.5);else if(Q(o)){const G=Object.keys(o)[0],J=o[G];m=v(this.chart.scales[G].getPixelForValue(J))}N=t.top,E=t.bottom,C=m+w,R=C+p}else if(n==="y"){if(o==="center")m=v((t.left+t.right)/2);else if(Q(o)){const G=Object.keys(o)[0],J=o[G];m=v(this.chart.scales[G].getPixelForValue(J))}S=m-w,j=S-p,M=t.left,D=t.right}const B=K(s.ticks.maxTicksLimit,f),I=Math.max(1,Math.ceil(f/B));for(y=0;y<f;y+=I){const G=this.getContext(y),J=i.setContext(G),T=a.setContext(G),L=J.lineWidth,A=J.color,U=T.dash||[],$=T.dashOffset,se=J.tickWidth,Y=J.tickColor,we=J.tickBorderDash||[],q=J.tickBorderDashOffset;_=Q_(this,y,l),_!==void 0&&(k=tr(r,_,L),c?S=j=M=D=k:C=R=N=E=k,h.push({tx1:S,ty1:C,tx2:j,ty2:R,x1:M,y1:N,x2:D,y2:E,width:L,color:A,borderDash:U,borderDashOffset:$,tickWidth:se,tickColor:Y,tickBorderDash:we,tickBorderDashOffset:q}))}return this._ticksLength=f,this._borderValue=m,h}_computeLabelItems(t){const n=this.axis,r=this.options,{position:s,ticks:i}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:f}=i,p=Ls(r.grid),h=p+d,g=f?-d:h,x=-nn(this.labelRotation),w=[];let v,m,y,_,k,S,C,j,R,M,N,D,E="middle";if(s==="top")S=this.bottom-g,C=this._getXAxisLabelAlignment();else if(s==="bottom")S=this.top+g,C=this._getXAxisLabelAlignment();else if(s==="left"){const I=this._getYAxisLabelAlignment(p);C=I.textAlign,k=I.x}else if(s==="right"){const I=this._getYAxisLabelAlignment(p);C=I.textAlign,k=I.x}else if(n==="x"){if(s==="center")S=(t.top+t.bottom)/2+h;else if(Q(s)){const I=Object.keys(s)[0],G=s[I];S=this.chart.scales[I].getPixelForValue(G)+h}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")k=(t.left+t.right)/2-h;else if(Q(s)){const I=Object.keys(s)[0],G=s[I];k=this.chart.scales[I].getPixelForValue(G)}C=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?E="top":l==="end"&&(E="bottom"));const B=this._getLabelSizes();for(v=0,m=a.length;v<m;++v){y=a[v],_=y.label;const I=i.setContext(this.getContext(v));j=this.getPixelForTick(v)+i.labelOffset,R=this._resolveTickFontOptions(v),M=R.lineHeight,N=Ee(_)?_.length:1;const G=N/2,J=I.color,T=I.textStrokeColor,L=I.textStrokeWidth;let A=C;o?(k=j,C==="inner"&&(v===m-1?A=this.options.reverse?"left":"right":v===0?A=this.options.reverse?"right":"left":A="center"),s==="top"?c==="near"||x!==0?D=-N*M+M/2:c==="center"?D=-B.highest.height/2-G*M+M:D=-B.highest.height+M/2:c==="near"||x!==0?D=M/2:c==="center"?D=B.highest.height/2-G*M:D=B.highest.height-N*M,f&&(D*=-1),x!==0&&!I.showLabelBackdrop&&(k+=M/2*Math.sin(x))):(S=j,D=(1-N)*M/2);let U;if(I.showLabelBackdrop){const $=Dt(I.backdropPadding),se=B.heights[v],Y=B.widths[v];let we=D-$.top,q=0-$.left;switch(E){case"middle":we-=se/2;break;case"bottom":we-=se;break}switch(C){case"center":q-=Y/2;break;case"right":q-=Y;break;case"inner":v===m-1?q-=Y:v>0&&(q-=Y/2);break}U={left:q,top:we,width:Y+$.width,height:se+$.height,color:I.backdropColor}}w.push({label:_,font:R,textOffset:D,options:{rotation:x,color:J,strokeColor:T,strokeWidth:L,textAlign:A,textBaseline:E,translation:[k,S],backdrop:U}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-nn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:s,padding:i}}=this.options,o=this._getLabelSizes(),a=t+i,l=o.widest.width;let c,d;return n==="left"?s?(d=this.right+i,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?s?(d=this.left+i,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:s,width:i,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,s,i,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(i=>i.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,o;const a=(l,c,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(i=0,o=s.length;i<o;++i){const l=s[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:s}}=this,i=r.setContext(this.getContext()),o=r.display?i.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,f,p;this.isHorizontal()?(c=tr(t,this.left,o)-o/2,d=tr(t,this.right,a)+a/2,f=p=l):(f=tr(t,this.top,o)-o/2,p=tr(t,this.bottom,a)+a/2,c=d=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,f),n.lineTo(d,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,s=this._computeLabelArea();s&&fd(r,s);const i=this.getLabelItems(t);for(const o of i){const a=o.options,l=o.font,c=o.label,d=o.textOffset;_a(r,c,0,d,l,a)}s&&hd(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:s}}=this;if(!r.display)return;const i=Ge(r.font),o=Dt(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||Q(n)?(l+=o.bottom,Ee(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:d,maxWidth:f,rotation:p}=eS(this,l,n,a);_a(t,r.text,0,0,i,{color:r.color,maxWidth:f,rotation:p,textAlign:Z_(a,n,s),textBaseline:"middle",translation:[c,d],strokeColor:r.strokeColor,strokeWidth:r.strokeWidth})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=K(t.grid&&t.grid.z,-1),s=K(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ms.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];let i,o;for(i=0,o=n.length;i<o;++i){const a=n[i];a[r]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Ge(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class wo{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;rS(n)&&(r=this.register(n));const s=this.items,i=t.id,o=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in s||(s[i]=t,tS(t,o,r),this.override&&ve.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,s=this.scope;r in n&&delete n[r],s&&r in ve[s]&&(delete ve[s][r],this.override&&delete br[r])}}function tS(e,t,n){const r=Ni(Object.create(null),[n?ve.get(n):{},ve.get(t),e.defaults]);ve.set(t,r),e.defaultRoutes&&nS(t,e.defaultRoutes),e.descriptors&&ve.describe(t,e.descriptors)}function nS(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),s=r.pop(),i=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");ve.route(i,s,l,a)})}function rS(e){return"id"in e&&"defaults"in e}class sS{constructor(){this.controllers=new wo(es,"datasets",!0),this.elements=new wo(Un,"elements"),this.plugins=new wo(Object,"plugins"),this.scales=new wo(ms,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(s=>{const i=r||this._getRegistryForType(s);r||i.isForType(s)||i===this.plugins&&s.id?this._exec(t,i,s):Z(s,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const s=cd(t);oe(r["before"+s],[],r),n[t](r),oe(r["after"+s],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return s}}var $t=new sS;class iS{constructor(){this._init=void 0}notify(t,n,r,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const i=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(i,t,n,r);return n==="afterDestroy"&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,n,r,s){s=s||{};for(const i of t){const o=i.plugin,a=o[r],l=[n,s,i.options];if(oe(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){ne(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,s=K(r.options&&r.options.plugins,{}),i=oS(r);return s===!1&&!n?[]:lS(t,i,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,s=(i,o)=>i.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,r),t,"stop"),this._notify(s(r,n),t,"start")}}function oS(e){const t={},n=[],r=Object.keys($t.plugins.items);for(let i=0;i<r.length;i++)n.push($t.getPlugin(r[i]));const s=e.plugins||[];for(let i=0;i<s.length;i++){const o=s[i];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function aS(e,t){return!t&&e===!1?null:e===!0?{}:e}function lS(e,{plugins:t,localIds:n},r,s){const i=[],o=e.getContext();for(const a of t){const l=a.id,c=aS(r[l],s);c!==null&&i.push({plugin:a,options:cS(e.config,{plugin:a,local:n[l]},c,o)})}return i}function cS(e,{plugin:t,local:n},r,s){const i=e.pluginScopeKeys(t),o=e.getOptionScopes(r,i);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ru(e,t){const n=ve.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function uS(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function dS(e,t){return e===t?"_index_":"_value_"}function Yh(e){if(e==="x"||e==="y"||e==="r")return e}function fS(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function su(e,...t){if(Yh(e))return e;for(const n of t){const r=n.axis||fS(n.position)||e.length>1&&Yh(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Kh(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function hS(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Kh(e,"x",n[0])||Kh(e,"y",n[0])}return{}}function pS(e,t){const n=br[e.type]||{scales:{}},r=t.scales||{},s=ru(e.type,t),i=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!Q(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=su(o,a,hS(o,e),ve.scales[a.type]),c=dS(l,s),d=n.scales||{};i[o]=ti(Object.create(null),[{axis:l},a,d[l],d[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||ru(a,t),d=(br[a]||{}).scales||{};Object.keys(d).forEach(f=>{const p=uS(f,l),h=o[p+"AxisID"]||p;i[h]=i[h]||Object.create(null),ti(i[h],[{axis:p},r[h],d[f]])})}),Object.keys(i).forEach(o=>{const a=i[o];ti(a,[ve.scales[a.type],ve.scale])}),i}function Fx(e){const t=e.options||(e.options={});t.plugins=K(t.plugins,{}),t.scales=pS(e,t)}function Bx(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function gS(e){return e=e||{},e.data=Bx(e.data),Fx(e),e}const Xh=new Map,Wx=new Set;function _o(e,t){let n=Xh.get(e);return n||(n=t(),Xh.set(e,n),Wx.add(n)),n}const As=(e,t,n)=>{const r=yr(t,n);r!==void 0&&e.add(r)};class mS{constructor(t){this._config=gS(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Bx(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Fx(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return _o(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return _o(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return _o(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return _o(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let s=r.get(t);return(!s||n)&&(s=new Map,r.set(t,s)),s}getOptionScopes(t,n,r){const{options:s,type:i}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(f=>As(l,t,f))),d.forEach(f=>As(l,s,f)),d.forEach(f=>As(l,br[i]||{},f)),d.forEach(f=>As(l,ve,f)),d.forEach(f=>As(l,nu,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Wx.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,br[n]||{},ve.datasets[n]||{},{type:n},ve,nu]}resolveNamedOptions(t,n,r,s=[""]){const i={$shared:!0},{resolver:o,subPrefixes:a}=Qh(this._resolverCache,t,s);let l=o;if(vS(o,n)){i.$shared=!1,r=Hn(r)?r():r;const c=this.createResolver(t,r,a);l=us(o,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],s){const{resolver:i}=Qh(this._resolverCache,t,r);return Q(n)?us(i,n,void 0,s):i}}function Qh(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const s=n.join();let i=r.get(s);return i||(i={resolver:gd(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(s,i)),i}const xS=e=>Q(e)&&Object.getOwnPropertyNames(e).some(t=>Hn(e[t]));function vS(e,t){const{isScriptable:n,isIndexable:r}=Cx(e);for(const s of t){const i=n(s),o=r(s),a=(o||i)&&e[s];if(i&&(Hn(a)||xS(a))||o&&Ee(a))return!0}return!1}var yS="4.6.1";const bS=["top","bottom","left","right","chartArea"];function qh(e,t){return e==="top"||e==="bottom"||bS.indexOf(e)===-1&&t==="x"}function Gh(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Jh(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),oe(n&&n.onComplete,[e],t)}function wS(e){const t=e.chart,n=t.options.animation;oe(n&&n.onProgress,[e],t)}function $x(e){return vd()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Wo={},Zh=e=>{const t=$x(e);return Object.values(Wo).filter(n=>n.canvas===t).pop()};function _S(e,t,n){const r=Object.keys(e);for(const s of r){const i=+s;if(i>=t){const o=e[s];delete e[s],(n>0||i>t)&&(e[i+n]=o)}}}function SS(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var xn;let tl=(xn=class{static register(...t){$t.add(...t),ep()}static unregister(...t){$t.remove(...t),ep()}constructor(t,n){const r=this.config=new mS(n),s=$x(t),i=Zh(s);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||W_(s)),this.platform.updateConfig(r);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=Bw(),this.ctx=a,this.canvas=l,this.width=d,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new iS,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=s1(f=>this.update(f),o.resizeDelay||0),this._dataChanges=[],Wo[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Qt.listen(this,"complete",Jh),Qt.listen(this,"progress",wS),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:s,_aspectRatio:i}=this;return ne(t)?n&&i?i:s?r/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return $t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ch(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wh(this.canvas,this.ctx),this}stop(){return Qt.stop(this),this}resize(t,n){Qt.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,s=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,i),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Ch(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),oe(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Z(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,s=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let i=[];n&&(i=i.concat(Object.keys(n).map(o=>{const a=n[o],l=su(o,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),Z(i,o=>{const a=o.options,l=a.id,c=su(l,a),d=K(a.type,o.dtype);(a.position===void 0||qh(a.position,c)!==qh(o.dposition))&&(a.position=o.dposition),s[l]=!0;let f=null;if(l in r&&r[l].type===d)f=r[l];else{const p=$t.getScale(d);f=new p({id:l,type:d,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),Z(s,(o,a)=>{o||delete r[a]}),Z(r,o=>{En.configure(this,o,o.options),En.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((s,i)=>s.index-i.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Gh("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,s)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){const i=n[r];let o=this.getDatasetMeta(r);const a=i.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=i.indexAxis||ru(a,this.options),o.order=i.order||0,o.index=r,o.label=""+i.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=$t.getController(a),{datasetElementType:c,dataElementType:d}=ve.datasets[a];Object.assign(l,{dataElementType:$t.getElement(d),datasetElementType:c&&$t.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Z(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:f}=this.getDatasetMeta(c),p=!s&&i.indexOf(f)===-1;f.buildOrUpdateElements(p),o=Math.max(+f.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),s||Z(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Gh("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Z(this.scales,t=>{En.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!dh(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:s,count:i}of n){const o=r==="_removeElements"?-i:i;_S(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(t.filter(o=>o[0]===i).map((o,a)=>a+","+o.splice(1).join(","))),s=r(0);for(let i=1;i<n;i++)if(!dh(s,r(i)))return;return Array.from(s).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;En.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Z(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,i)=>{s._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Hn(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),s={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Qt.has(this)?this.attached&&!Qt.running(this)&&Qt.start(this):(this.draw(),Jh({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let s,i;for(s=0,i=n.length;s<i;++s){const o=n[s];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},s=V1(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&fd(n,s),t.controller.draw(),s&&hd(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Sx(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,s){const i=b_.modes[n];return typeof i=="function"?i(this,t,r,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let s=r.filter(i=>i&&i._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(s)),s}getContext(){return this.$context||(this.$context=gs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const s=r?"show":"hide",i=this.getDatasetMeta(t),o=i.controller._resolveAnimations(void 0,s);Ei(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(i,{visible:r}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Qt.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),wh(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Wo[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(i,o)=>{n.addEventListener(this,i,o),t[i]=o},s=(i,o,a)=>{i.offsetX=o,i.offsetY=a,this._eventHandler(i)};Z(this.options.events,i=>r(i,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",o)};o=()=>{this.attached=!1,s("resize",i),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Z(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Z(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const s=r?"set":"remove";let i,o,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:i,index:o})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[o],index:o}});!xa(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const s=this.options.hover,i=(l,c)=>l.filter(d=>!c.some(f=>d.datasetIndex===f.datasetIndex&&d.index===f.index)),o=i(n,t),a=r?t:i(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;const i=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(i||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:s=[],options:i}=this,o=n,a=this._getActiveElements(t,s,r,o),l=Yw(t),c=SS(t,this._lastEvent,r,l);r&&(this._lastEvent=null,oe(i.onHover,[t,a,this],this),l&&oe(i.onClick,[t,a,this],this));const d=!xa(a,s);return(d||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,d}_getActiveElements(t,n,r,s){if(t.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,s)}},F(xn,"defaults",ve),F(xn,"instances",Wo),F(xn,"overrides",br),F(xn,"registry",$t),F(xn,"version",yS),F(xn,"getChart",Zh),xn);function ep(){return Z(tl.instances,e=>e._plugins.invalidate())}function kS(e,t,n){const{startAngle:r,x:s,y:i,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:d}=l,f=Math.min(c/o,Vt(r-n));if(e.beginPath(),e.arc(s,i,o-c/2,r+f/2,n-f/2),a>0){const p=Math.min(c/a,Vt(r-n));e.arc(s,i,a+c/2,n-p/2,r+p/2,!0)}else{const p=Math.min(c/2,o*Vt(r-n));if(d==="round")e.arc(s,i,p,n-ae/2,r+ae/2,!0);else if(d==="bevel"){const h=2*p*p,g=-h*Math.cos(n+ae/2)+s,x=-h*Math.sin(n+ae/2)+i,w=h*Math.cos(r+ae/2)+s,v=h*Math.sin(r+ae/2)+i;e.lineTo(g,x),e.lineTo(w,v)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function CS(e,t,n){const{startAngle:r,pixelMargin:s,x:i,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(i,o,a,r-c,n+c),l>s?(c=s/l,e.arc(i,o,l,n+c,r-c,!0)):e.arc(i,o,s,n+Ce,r-Ce),e.closePath(),e.clip()}function jS(e){return pd(e,["outerStart","outerEnd","innerStart","innerEnd"])}function NS(e,t,n,r){const s=jS(e.options.borderRadius),i=(n-t)/2,o=Math.min(i,r*t/2),a=l=>{const c=(n-Math.min(i,l))*r/2;return qe(l,0,Math.min(i,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:qe(s.innerStart,0,o),innerEnd:qe(s.innerEnd,0,o)}}function Pr(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function ES(e,t,n,r){const{x:s,y:i,startAngle:o,pixelMargin:a,innerRadius:l}=t,c=Math.max(t.outerRadius+r+n-a,0),d=l>0?l+r+n+a:0;e.beginPath(),e.arc(s,i,c,o,o+ue),d>0&&(e.moveTo(s+Math.cos(o)*d,i+Math.sin(o)*d),e.arc(s,i,d,o+ue,o,!0)),e.closePath()}function ja(e,t,n,r,s,i){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,{spacingMode:f="angular"}=t.options,p=s-l;if(i&&t.options.selfJoin&&Math.abs(p)>=ue-1e-4){ES(e,t,n,r);return}const h=Math.max(t.outerRadius+r+n-c,0);let g=d>0?d+r+n+c:0,x=0,w=0;const v=h>0?Math.max(.001,p*h-n/ae)/h:.001,m=(p-v)/2;if(r){const A=d>0?d-r:0,U=h>0?h-r:0,$=(A+U)/2,se=(()=>{const kt=$!==0?p*$/($+r):p;return(p-kt)/2})(),Y=$>0?Math.asin(Math.min(1,r/$)):0,we=Math.max(0,v/2-.001),q=Math.sin(we);if(f==="parallel"){if(g===0&&q>0){const Hi=r/q,tt=Math.max(0,h-.001);g=Math.min(Hi,tt)}const kt=Math.min(h>0?h*q:Number.POSITIVE_INFINITY,g>0?g*q:Number.POSITIVE_INFINITY),ys=Math.min(r,kt);x=h>0?Math.asin(Math.min(1,ys/h)):Math.min(we,Y),w=g>0?Math.asin(Math.min(1,ys/g)):x}else f==="proportional"?(x=Math.min(we,se),w=Math.min(we,se)):(x=Math.min(we,Y),w=Math.min(we,Y))}const y=l+m+x,_=s-m-x,k=l+m+w,S=s-m-w,C=Math.min(_-y,S-k),{outerStart:j,outerEnd:R,innerStart:M,innerEnd:N}=NS(t,g,h,C),D=h-j,E=h-R,B=y+j/D,I=_-R/E,G=g+M,J=g+N,T=k+M/G,L=S-N/J;if(e.beginPath(),i){const A=(B+I)/2;if(e.arc(o,a,h,B,A),e.arc(o,a,h,A,I),R>0){const Y=Pr(E,I,o,a);e.arc(Y.x,Y.y,R,I,_+Ce)}const U=Pr(J,S,o,a);if(e.lineTo(U.x,U.y),N>0){const Y=Pr(J,L,o,a);e.arc(Y.x,Y.y,N,S+Ce,L+Math.PI)}const $=(S-N/g+(k+M/g))/2;if(e.arc(o,a,g,S-N/g,$,!0),e.arc(o,a,g,$,k+M/g,!0),M>0){const Y=Pr(G,T,o,a);e.arc(Y.x,Y.y,M,T+Math.PI,k-Ce)}const se=Pr(D,y,o,a);if(e.lineTo(se.x,se.y),j>0){const Y=Pr(D,B,o,a);e.arc(Y.x,Y.y,j,y-Ce,B)}}else{e.moveTo(o,a);const A=Math.cos(B)*h+o,U=Math.sin(B)*h+a;e.lineTo(A,U);const $=Math.cos(I)*h+o,se=Math.sin(I)*h+a;e.lineTo($,se)}e.closePath()}function MS(e,t,n,r,s){const{fullCircles:i,startAngle:o,circumference:a}=t;let l=t.endAngle;if(i){ja(e,t,n,r,l,s);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=o+(a%ue||ue))}return ja(e,t,n,r,l,s),e.fill(),l}function PS(e,t,n,r,s){const{fullCircles:i,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:f,borderDashOffset:p,borderRadius:h}=l,g=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=p,g?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let x=t.endAngle;const w=Math.abs(x-o)>=ue-1e-4;if(i){ja(e,t,n,r,x,s);for(let m=0;m<i;++m)e.stroke();isNaN(a)||(x=o+(a%ue||ue))}g&&CS(e,t,x),!(w&&t.innerRadius>0)&&l.selfJoin&&x-o>=ae&&h===0&&d!=="miter"&&kS(e,t,x),i||(ja(e,t,n,r,x,s),e.stroke())}class Hs extends Un{constructor(n){super();F(this,"circumference");F(this,"endAngle");F(this,"fullCircles");F(this,"innerRadius");F(this,"outerRadius");F(this,"pixelMargin");F(this,"startAngle");F(this,"circular");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,this.circular=!1,n&&Object.assign(this,n)}inRange(n,r,s){const i=this.getProps(["x","y"],s),{angle:o,distance:a}=px(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:f,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),h=(this.options.spacing+this.options.borderWidth)/2,g=K(p,c-l),x=wa(o,l,c)&&l!==c,w=g>=ue||x,v=ur(a,d+h,f+h);return w&&v}getCenterPoint(n){const{x:r,y:s,startAngle:i,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:d}=this.options,f=(i+o)/2,p=(a+l+d+c)/2;return{x:r+Math.cos(f)*p,y:s+Math.sin(f)*p}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:s}=this,i=(r.offset||0)/4,o=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=s>ue?Math.floor(s/ue):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const c=1-Math.sin(Math.min(ae,s||0)),d=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,MS(n,this,d,o,a),PS(n,this,d,o,a),n.restore()}}F(Hs,"id","arc"),F(Hs,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,spacingMode:"angular",angle:void 0,circular:!0,selfJoin:!1}),F(Hs,"defaultRoutes",{backgroundColor:"backgroundColor"}),F(Hs,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Vx(e,t){const{x:n,y:r,base:s,width:i,height:o}=e.getProps(["x","y","base","width","height"],t);let a,l,c,d,f;return e.horizontal?(f=o/2,a=Math.min(n,s),l=Math.max(n,s),c=r-f,d=r+f):(f=i/2,a=n-f,l=n+f,c=Math.min(r,s),d=Math.max(r,s)),{left:a,top:c,right:l,bottom:d}}function Mn(e,t,n,r){return e?0:qe(t,n,r)}function RS(e,t,n){const r=e.options.borderWidth,s=e.borderSkipped,i=kx(r);return{t:Mn(s.top,i.top,0,n),r:Mn(s.right,i.right,0,t),b:Mn(s.bottom,i.bottom,0,n),l:Mn(s.left,i.left,0,t)}}function TS(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,i=Jr(s),o=Math.min(t,n),a=e.borderSkipped,l=r||Q(s);return{topLeft:Mn(!l||a.top||a.left,i.topLeft,0,o),topRight:Mn(!l||a.top||a.right,i.topRight,0,o),bottomLeft:Mn(!l||a.bottom||a.left,i.bottomLeft,0,o),bottomRight:Mn(!l||a.bottom||a.right,i.bottomRight,0,o)}}function OS(e){const t=Vx(e),n=t.right-t.left,r=t.bottom-t.top,s=RS(e,n/2,r/2),i=TS(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:r-s.t-s.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,i.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(s.b,s.r))}}}}function Ql(e,t,n,r){const s=t===null,i=n===null,a=e&&!(s&&i)&&Vx(e,r);return a&&(s||ur(t,a.left,a.right))&&(i||ur(n,a.top,a.bottom))}function DS(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function LS(e,t){e.rect(t.x,t.y,t.w,t.h)}function ql(e,t,n={}){const r=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+r,y:e.y+s,w:e.w+i,h:e.h+o,radius:e.radius}}class $o extends Un{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:s}}=this,{inner:i,outer:o}=OS(this),a=DS(o.radius)?Sa:LS;t.save(),(o.w!==i.w||o.h!==i.h)&&(t.beginPath(),a(t,ql(o,n,i)),t.clip(),a(t,ql(i,-n,o)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,ql(i,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,r){return Ql(this,t,n,r)}inXRange(t,n){return Ql(this,t,null,n)}inYRange(t,n){return Ql(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:s,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(n+s)/2:n,y:i?r:(r+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}F($o,"id","bar"),F($o,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),F($o,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const tp=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},AS=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class np extends Un{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=oe(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,s)=>t.sort(r,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,s=Ge(r.font),i=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=tp(r,i);let c,d;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(o,i,a,l)+10):(d=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,s){const{ctx:i,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+a;let f=t;i.textAlign="left",i.textBaseline="middle";let p=-1,h=-d;return this.legendItems.forEach((g,x)=>{const w=r+n/2+i.measureText(g.text).width;(x===0||c[c.length-1]+w+2*a>o)&&(f+=d,c[c.length-(x>0?0:1)]=0,h+=d,p++),l[x]={left:0,top:h,row:p,width:w,height:s},c[c.length-1]+=w+a}),f}_fitCols(t,n,r,s){const{ctx:i,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=o-t;let f=a,p=0,h=0,g=0,x=0;return this.legendItems.forEach((w,v)=>{const{itemWidth:m,itemHeight:y}=zS(r,n,i,w,s);v>0&&h+y+2*a>d&&(f+=p+a,c.push({width:p,height:h}),g+=p+a,x++,p=h=0),l[v]={left:g,top:h,col:x,width:m,height:y},p=Math.max(p,m),h+=y+a}),f+=p,c.push({width:p,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:s},rtl:i}}=this,o=Zr(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=it(r,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=it(r,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=it(r,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=it(r,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;fd(t,this),this._draw(),hd(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:s}=this,{align:i,labels:o}=t,a=ve.color,l=Zr(t.rtl,this.left,this.width),c=Ge(o.font),{padding:d}=o,f=c.size,p=f/2;let h;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:x,itemHeight:w}=tp(o,f),v=function(S,C,j){if(isNaN(g)||g<=0||isNaN(x)||x<0)return;s.save();const R=K(j.lineWidth,1);if(s.fillStyle=K(j.fillStyle,a),s.lineCap=K(j.lineCap,"butt"),s.lineDashOffset=K(j.lineDashOffset,0),s.lineJoin=K(j.lineJoin,"miter"),s.lineWidth=R,s.strokeStyle=K(j.strokeStyle,a),s.setLineDash(K(j.lineDash,[])),o.usePointStyle){const M={radius:x*Math.SQRT2/2,pointStyle:j.pointStyle,rotation:j.rotation,borderWidth:R},N=l.xPlus(S,g/2),D=C+p;_x(s,M,N,D,o.pointStyleWidth&&g)}else{const M=C+Math.max((f-x)/2,0),N=l.leftForLtr(S,g),D=Jr(j.borderRadius);s.beginPath(),Object.values(D).some(E=>E!==0)?Sa(s,{x:N,y:M,w:g,h:x,radius:D}):s.rect(N,M,g,x),s.fill(),R!==0&&s.stroke()}s.restore()},m=function(S,C,j){_a(s,j.text,S,C+w/2,c,{strikethrough:j.hidden,textAlign:l.textAlign(j.textAlign)})},y=this.isHorizontal(),_=this._computeTitleHeight();y?h={x:it(i,this.left+d,this.right-r[0]),y:this.top+d+_,line:0}:h={x:this.left+d,y:it(i,this.top+_+d,this.bottom-n[0].height),line:0},Mx(this.ctx,t.textDirection);const k=w+d;this.legendItems.forEach((S,C)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const j=s.measureText(S.text).width,R=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),M=g+p+j;let N=h.x,D=h.y;l.setWidth(this.width),y?C>0&&N+M+d>this.right&&(D=h.y+=k,h.line++,N=h.x=it(i,this.left+d,this.right-r[h.line])):C>0&&D+k>this.bottom&&(N=h.x=N+n[h.line].width+d,h.line++,D=h.y=it(i,this.top+_+d,this.bottom-n[h.line].height));const E=l.x(N);if(v(E,D,S),N=i1(R,N+g+p,y?N+M:this.right,t.rtl),m(l.x(N),D,S),y)h.x+=M+d;else if(typeof S.text!="string"){const B=c.lineHeight;h.y+=Hx(S,B)+d}else h.y+=k}),Px(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Ge(n.font),s=Dt(n.padding);if(!n.display)return;const i=Zr(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,c=s.top+l;let d,f=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),d=this.top+c,f=it(t.align,f,this.right-p);else{const g=this.columnSizes.reduce((x,w)=>Math.max(x,w.height),0);d=c+it(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const h=it(a,f,f+p);o.textAlign=i.textAlign(yx(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,_a(o,n.text,h,d,r)}_computeTitleHeight(){const t=this.options.title,n=Ge(t.font),r=Dt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,s,i;if(ur(t,this.left,this.right)&&ur(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(s=i[r],ur(t,s.left,s.left+s.width)&&ur(n,s.top,s.top+s.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!BS(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,i=AS(s,r);s&&!i&&oe(n.onLeave,[t,s,this],this),this._hoveredItem=r,r&&!i&&oe(n.onHover,[t,r,this],this)}else r&&oe(n.onClick,[t,r,this],this)}}function zS(e,t,n,r,s){const i=IS(r,e,t,n),o=FS(s,r,t.lineHeight);return{itemWidth:i,itemHeight:o}}function IS(e,t,n,r){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((i,o)=>i.length>o.length?i:o)),t+n.size/2+r.measureText(s).width}function FS(e,t,n){let r=e;return typeof t.text!="string"&&(r=Hx(t,n)),r}function Hx(e,t){const n=e.text?e.text.length:0;return t*n}function BS(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var WS={id:"legend",_element:np,start(e,t,n){const r=e.legend=new np({ctx:e.ctx,options:n,chart:e});En.configure(e,r,n),En.addBox(e,r)},stop(e){En.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;En.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,s=n.chart;s.isDatasetVisible(r)?(s.hide(r),t.hidden=!0):(s.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:s,color:i,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=Dt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};const Us={average(e){if(!e.length)return!1;let t,n,r=new Set,s=0,i=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),s+=l.y,++i}}return i===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:s/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,s=Number.POSITIVE_INFINITY,i,o,a;for(i=0,o=e.length;i<o;++i){const l=e[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=Zw(t,c);d<s&&(s=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Bt(e,t){return t&&(Ee(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function qt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
83
- `)>-1?e.split(`
84
- `):e}function $S(e,t){const{element:n,datasetIndex:r,index:s}=t,i=e.getDatasetMeta(r).controller,{label:o,value:a}=i.getLabelAndValue(s);return{chart:e,label:o,parsed:i.getParsed(s),raw:e.data.datasets[r].data[s],formattedValue:a,dataset:i.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function rp(e,t){const n=e.chart.ctx,{body:r,footer:s,title:i}=e,{boxWidth:o,boxHeight:a}=t,l=Ge(t.bodyFont),c=Ge(t.titleFont),d=Ge(t.footerFont),f=i.length,p=s.length,h=r.length,g=Dt(t.padding);let x=g.height,w=0,v=r.reduce((_,k)=>_+k.before.length+k.lines.length+k.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,f&&(x+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),v){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;x+=h*_+(v-h)*l.lineHeight+(v-1)*t.bodySpacing}p&&(x+=t.footerMarginTop+p*d.lineHeight+(p-1)*t.footerSpacing);let m=0;const y=function(_){w=Math.max(w,n.measureText(_).width+m)};return n.save(),n.font=c.string,Z(e.title,y),n.font=l.string,Z(e.beforeBody.concat(e.afterBody),y),m=t.displayColors?o+2+t.boxPadding:0,Z(r,_=>{Z(_.before,y),Z(_.lines,y),Z(_.after,y)}),m=0,n.font=d.string,Z(e.footer,y),n.restore(),w+=g.width,{width:w,height:x}}function VS(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function HS(e,t,n,r){const{x:s,width:i}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&s+i+o>t.width||e==="right"&&s-i-o<0)return!0}function US(e,t,n,r){const{x:s,width:i}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=s<=(a+l)/2?"left":"right":s<=i/2?c="left":s>=o-i/2&&(c="right"),HS(c,e,t,n)&&(c="center"),c}function sp(e,t,n){const r=n.yAlign||t.yAlign||VS(e,n);return{xAlign:n.xAlign||t.xAlign||US(e,t,n,r),yAlign:r}}function YS(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function KS(e,t,n){let{y:r,height:s}=e;return t==="top"?r+=n:t==="bottom"?r-=s+n:r-=s/2,r}function ip(e,t,n,r){const{caretSize:s,caretPadding:i,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+i,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:h}=Jr(o);let g=YS(t,a);const x=KS(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(d,p)+s:a==="right"&&(g+=Math.max(f,h)+s),{x:qe(g,0,r.width-t.width),y:qe(x,0,r.height-t.height)}}function So(e,t,n){const r=Dt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function op(e){return Bt([],qt(e))}function XS(e,t,n){return gs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function ap(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Ux={beforeTitle:Xt,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Xt,beforeBody:Xt,beforeLabel:Xt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ne(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Xt,afterBody:Xt,beforeFooter:Xt,footer:Xt,afterFooter:Xt};function Ye(e,t,n,r){const s=e[t].call(n,r);return typeof s>"u"?Ux[t].call(n,r):s}class iu extends Un{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,i=new Rx(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=XS(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,s=Ye(r,"beforeTitle",this,t),i=Ye(r,"title",this,t),o=Ye(r,"afterTitle",this,t);let a=[];return a=Bt(a,qt(s)),a=Bt(a,qt(i)),a=Bt(a,qt(o)),a}getBeforeBody(t,n){return op(Ye(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,s=[];return Z(t,i=>{const o={before:[],lines:[],after:[]},a=ap(r,i);Bt(o.before,qt(Ye(a,"beforeLabel",this,i))),Bt(o.lines,Ye(a,"label",this,i)),Bt(o.after,qt(Ye(a,"afterLabel",this,i))),s.push(o)}),s}getAfterBody(t,n){return op(Ye(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,s=Ye(r,"beforeFooter",this,t),i=Ye(r,"footer",this,t),o=Ye(r,"afterFooter",this,t);let a=[];return a=Bt(a,qt(s)),a=Bt(a,qt(i)),a=Bt(a,qt(o)),a}_createItems(t){const n=this._active,r=this.chart.data,s=[],i=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push($S(this.chart,n[l]));return t.filter&&(a=a.filter((d,f,p)=>t.filter(d,f,p,r))),t.itemSort&&(a=a.sort((d,f)=>t.itemSort(d,f,r))),Z(a,d=>{const f=ap(t.callbacks,d);s.push(Ye(f,"labelColor",this,d)),i.push(Ye(f,"labelPointStyle",this,d)),o.push(Ye(f,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=i,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),s=this._active;let i,o=[];if(!s.length)this.opacity!==0&&(i={opacity:0});else{const a=Us[r.position].call(this,s,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=rp(this,r),c=Object.assign({},a,l),d=sp(this.chart,r,c),f=ip(r,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,i={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,s){const i=this.getCaretPosition(t,r,s);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:s,yAlign:i}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:f}=Jr(a),{x:p,y:h}=t,{width:g,height:x}=n;let w,v,m,y,_,k;return i==="center"?(_=h+x/2,s==="left"?(w=p,v=w-o,y=_+o,k=_-o):(w=p+g,v=w+o,y=_-o,k=_+o),m=w):(s==="left"?v=p+Math.max(l,d)+o:s==="right"?v=p+g-Math.max(c,f)-o:v=this.caretX,i==="top"?(y=h,_=y-o,w=v-o,m=v+o):(y=h+x,_=y+o,w=v+o,m=v-o),k=y),{x1:w,x2:v,x3:m,y1:y,y2:_,y3:k}}drawTitle(t,n,r){const s=this.title,i=s.length;let o,a,l;if(i){const c=Zr(r.rtl,this.x,this.width);for(t.x=So(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=Ge(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<i;++l)n.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===i&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,s,i){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,d=Ge(i.bodyFont),f=So(this,"left",i),p=s.x(f),h=l<d.lineHeight?(d.lineHeight-l)/2:0,g=n.y+h;if(i.usePointStyle){const x={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},w=s.leftForLtr(p,c)+c/2,v=g+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,_h(t,x,w,v),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,_h(t,x,w,v)}else{t.lineWidth=Q(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const x=s.leftForLtr(p,c),w=s.leftForLtr(s.xPlus(p,1),c-2),v=Jr(o.borderRadius);Object.values(v).some(m=>m!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Sa(t,{x,y:g,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Sa(t,{x:w,y:g+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(x,g,c,l),t.strokeRect(x,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(w,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:s}=this,{bodySpacing:i,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=r,f=Ge(r.bodyFont);let p=f.lineHeight,h=0;const g=Zr(r.rtl,this.x,this.width),x=function(j){n.fillText(j,g.x(t.x+h),t.y+p/2),t.y+=p+i},w=g.textAlign(o);let v,m,y,_,k,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=f.string,t.x=So(this,w,r),n.fillStyle=r.bodyColor,Z(this.beforeBody,x),h=a&&w!=="right"?o==="center"?c/2+d:c+2+d:0,_=0,S=s.length;_<S;++_){for(v=s[_],m=this.labelTextColors[_],n.fillStyle=m,Z(v.before,x),y=v.lines,a&&y.length&&(this._drawColorBox(n,t,_,g,r),p=Math.max(f.lineHeight,l)),k=0,C=y.length;k<C;++k)x(y[k]),p=f.lineHeight;Z(v.after,x)}h=0,p=f.lineHeight,Z(this.afterBody,x),t.y-=i}drawFooter(t,n,r){const s=this.footer,i=s.length;let o,a;if(i){const l=Zr(r.rtl,this.x,this.width);for(t.x=So(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=Ge(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<i;++a)n.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,s){const{xAlign:i,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:d}=r,{topLeft:f,topRight:p,bottomLeft:h,bottomRight:g}=Jr(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+f,l),o==="top"&&this.drawCaret(t,n,r,s),n.lineTo(a+c-p,l),n.quadraticCurveTo(a+c,l,a+c,l+p),o==="center"&&i==="right"&&this.drawCaret(t,n,r,s),n.lineTo(a+c,l+d-g),n.quadraticCurveTo(a+c,l+d,a+c-g,l+d),o==="bottom"&&this.drawCaret(t,n,r,s),n.lineTo(a+h,l+d),n.quadraticCurveTo(a,l+d,a,l+d-h),o==="center"&&i==="left"&&this.drawCaret(t,n,r,s),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,s=r&&r.x,i=r&&r.y;if(s||i){const o=Us[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=rp(this,t),l=Object.assign({},o,this._size),c=sp(n,t,l),d=ip(t,l,c,n);(s._to!==d.x||i._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Dt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(i,t,s,n),Mx(t,n.textDirection),i.y+=o.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),Px(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),i=!xa(r,s),o=this._positionChanged(s,n);(i||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,i=this._active||[],o=this._getActiveElements(t,i,n,r),a=this._positionChanged(o,t),l=n||!xa(o,i)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,s){const i=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,i.mode,i,r);return i.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:s,options:i}=this,o=Us[i.position].call(this,t,n);return o!==!1&&(r!==o.x||s!==o.y)}}F(iu,"positioners",Us);var QS={id:"tooltip",_element:iu,positioners:Us,afterInit(e,t,n){n&&(e.tooltip=new iu({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ux},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const qS=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function GS(e,t,n,r){const s=e.indexOf(t);if(s===-1)return qS(e,t,n,r);const i=e.lastIndexOf(t);return s!==i?n:s}const JS=(e,t)=>e===null?null:qe(Math.round(e),0,t);function lp(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class ou extends ms{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:i}of n)r[s]===i&&r.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ne(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:GS(r,t,K(n,t),this._addedLabels),JS(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,s=[];let i=this.getLabels();i=t===0&&n===i.length-1?i:i.slice(t,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)s.push({value:o});return s}getLabelForValue(t){return lp.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}F(ou,"id","category"),F(ou,"defaults",{ticks:{callback:lp}});function ZS(e,t){const n=[],{bounds:s,step:i,min:o,max:a,precision:l,count:c,maxTicks:d,maxDigits:f,includeBounds:p}=e,h=i||1,g=d-1,{min:x,max:w}=t,v=!ne(o),m=!ne(a),y=!ne(c),_=(w-x)/(f+1);let k=hh((w-x)/g/h)*h,S,C,j,R;if(k<1e-14&&!v&&!m)return[{value:x},{value:w}];R=Math.ceil(w/k)-Math.floor(x/k),R>g&&(k=hh(R*k/g/h)*h),ne(l)||(S=Math.pow(10,l),k=Math.ceil(k*S)/S),s==="ticks"?(C=Math.floor(x/k)*k,j=Math.ceil(w/k)*k):(C=x,j=w),v&&m&&i&&qw((a-o)/i,k/1e3)?(R=Math.round(Math.min((a-o)/k,d)),k=(a-o)/R,C=o,j=a):y?(C=v?o:C,j=m?a:j,R=c-1,k=(j-C)/R):(R=(j-C)/k,Io(R,Math.round(R),k/1e3)?R=Math.round(R):R=Math.ceil(R));const M=Math.max(ph(k),ph(C));S=Math.pow(10,ne(l)?M:l),C=Math.round(C*S)/S,j=Math.round(j*S)/S;let N=0;for(v&&(p&&C!==o?(n.push({value:o}),C<o&&N++,Io(Math.round((C+N*k)*S)/S,o,cp(o,_,e))&&N++):C<o&&N++);N<R;++N){const D=Math.round((C+N*k)*S)/S;if(m&&D>a)break;n.push({value:D})}return m&&p&&j!==a?n.length&&Io(n[n.length-1].value,a,cp(a,_,e))?n[n.length-1].value=a:n.push({value:a}):(!m||j===a)&&n.push({value:j}),n}function cp(e,t,{horizontal:n,minRotation:r}){const s=nn(r),i=(n?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/i,o)}class ek extends ms{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return ne(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:i}=this;const o=l=>s=n?s:l,a=l=>i=r?i:l;if(t){const l=Bn(s),c=Bn(i);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===i){let l=i===0?1:Math.abs(i*.05);a(i+l),t||o(s-l)}this.min=s,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,o=ZS(s,i);return t.bounds==="ticks"&&Gw(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const s=(r-n)/Math.max(t.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return dd(t,this.chart.options.locale,this.options.ticks.format)}}class au extends ek{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=_t(t)?t:0,this.max=_t(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=nn(this.options.ticks.minRotation),s=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}F(au,"id","linear"),F(au,"defaults",{ticks:{callback:wx.formatters.numeric}});const nl={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Xe=Object.keys(nl);function up(e,t){return e-t}function dp(e,t){if(ne(t))return null;const n=e._adapter,{parser:r,round:s,isoWeekday:i}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),_t(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(ba(i)||i===!0)?n.startOf(o,"isoWeek",i):n.startOf(o,s)),+o)}function fp(e,t,n,r){const s=Xe.length;for(let i=Xe.indexOf(e);i<s-1;++i){const o=nl[Xe[i]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return Xe[i]}return Xe[s-1]}function tk(e,t,n,r,s){for(let i=Xe.length-1;i>=Xe.indexOf(n);i--){const o=Xe[i];if(nl[o].common&&e._adapter.diff(s,r,o)>=t-1)return o}return Xe[n?Xe.indexOf(n):0]}function nk(e){for(let t=Xe.indexOf(e)+1,n=Xe.length;t<n;++t)if(nl[Xe[t]].common)return Xe[t]}function hp(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:s}=ud(n,t),i=n[r]>=t?n[r]:n[s];e[i]=!0}}function rk(e,t,n,r){const s=e._adapter,i=+s.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=i;a<=o;a=+s.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function pp(e,t,n){const r=[],s={},i=t.length;let o,a;for(o=0;o<i;++o)a=t[o],s[a]=o,r.push({value:a,major:!1});return i===0||!n?r:rk(e,r,s,n)}class Na extends ms{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),s=this._adapter=new g_._date(t.adapters.date);s.init(n),ti(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:dp(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:s,max:i,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=_t(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),i=_t(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,i-1),this.max=Math.max(s+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const i=this.min,o=this.max,a=n1(s,i,o);return this._unit=n.unit||(r.autoSkip?fp(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):tk(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:nk(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),pp(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,s,i;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=qe(n,0,o),r=qe(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,s=this.options,i=s.time,o=i.unit||fp(i.minUnit,n,r,this._getLabelCapacity(n)),a=K(s.ticks.stepSize,1),l=o==="week"?i.isoWeekday:!1,c=ba(l)||l===!0,d={};let f=n,p,h;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(p=f,h=0;p<r;p=+t.add(p,a,o),h++)hp(d,p,g);return(p===r||s.bounds==="ticks"||h===1)&&hp(d,p,g),Object.keys(d).sort(up).map(x=>+x)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,i=this._unit,o=n||s[i];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,s){const i=this.options,o=i.ticks.callback;if(o)return oe(o,[t,n,r],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],f=c&&a[c],p=r[n],h=c&&f&&p&&p.major;return this._adapter.format(t,s||(h?f:d))}generateTickLabels(t){let n,r,s;for(n=0,r=t.length;n<r;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,s=nn(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:r*i+a*o,h:r*o+a*i}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,i=this._tickFormatFunction(t,0,pp(this,[t],this._majorUnit),s),o=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)t.push(dp(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return mx(t.sort(up))}}F(Na,"id","time"),F(Na,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function ko(e,t,n){let r=0,s=e.length-1,i,o,a,l;n?(t>=e[r].pos&&t<=e[s].pos&&({lo:r,hi:s}=tu(e,"pos",t)),{pos:i,time:a}=e[r],{pos:o,time:l}=e[s]):(t>=e[r].time&&t<=e[s].time&&({lo:r,hi:s}=tu(e,"time",t)),{time:i,pos:a}=e[r],{time:o,pos:l}=e[s]);const c=o-i;return c?a+(l-a)*(t-i)/c:a}class gp extends Na{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=ko(n,this.min),this._tableRange=ko(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,s=[],i=[];let o,a,l,c,d;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=s.length;o<a;++o)d=s[o+1],l=s[o-1],c=s[o],Math.round((d+l)/2)!==c&&i.push({time:c,pos:o/(a-1)});return i}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,i)=>s-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(ko(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return ko(this._table,r*this._tableRange+this._minPos,!0)}}F(gp,"id","timeseries"),F(gp,"defaults",Na.defaults);const Yx="label";function mp(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function sk(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Kx(e,t){e.labels=t}function Xx(e,t,n=Yx){const r=[];e.datasets=t.map(s=>{const i=e.datasets.find(o=>o[n]===s[n]);return!i||!s.data||r.includes(i)?{...s}:(r.push(i),Object.assign(i,s),i)})}function ik(e,t=Yx){const n={labels:[],datasets:[]};return Kx(n,e.labels),Xx(n,e.datasets,t),n}function ok(e,t){const{height:n=150,width:r=300,redraw:s=!1,datasetIdKey:i,type:o,data:a,options:l,plugins:c=[],fallbackContent:d,updateMode:f,...p}=e,h=b.useRef(null),g=b.useRef(null),x=()=>{h.current&&(g.current=new tl(h.current,{type:o,data:ik(a,i),options:l&&{...l},plugins:c}),mp(t,g.current))},w=()=>{mp(t,null),g.current&&(g.current.destroy(),g.current=null)};return b.useEffect(()=>{!s&&g.current&&l&&sk(g.current,l)},[s,l]),b.useEffect(()=>{!s&&g.current&&Kx(g.current.config.data,a.labels)},[s,a.labels]),b.useEffect(()=>{!s&&g.current&&a.datasets&&Xx(g.current.config.data,a.datasets,i)},[s,a.datasets]),b.useEffect(()=>{g.current&&(s?(w(),setTimeout(x)):g.current.update(f))},[s,l,a.labels,a.datasets,f]),b.useEffect(()=>{g.current&&(w(),setTimeout(x))},[o]),b.useEffect(()=>(x(),()=>w()),[]),u.jsx("canvas",{ref:h,role:"img",height:n,width:r,...p,children:d})}const ak=b.forwardRef(ok);function Qx(e,t){return tl.register(t),b.forwardRef((n,r)=>u.jsx(ak,{...n,ref:r,type:e}))}const lk=Qx("bar",Fo),ck=Qx("doughnut",$s),Yn=["leads","em_contato","proposta","fechado"],Wn={leads:"Leads",em_contato:"Em contato",proposta:"Proposta",fechado:"Fechado"};tl.register(Hs,$o,ou,au,WS,QS);function uk({porEtapa:e}){const t=Yn.map(r=>e[r]??0),n=Math.max(20,Math.ceil((Math.max(...t)+1)/20)*20);return u.jsx("div",{className:"mt-4 h-64",children:u.jsx(lk,{data:{labels:Yn.map(r=>Wn[r]),datasets:[{label:"Quantidade",data:t,backgroundColor:["rgba(59, 130, 246, 0.8)","rgba(59, 130, 246, 0.6)","rgba(59, 130, 246, 0.4)","rgba(59, 130, 246, 0.3)"],borderRadius:4,barThickness:24}]},options:{indexAxis:"y",responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{x:{beginAtZero:!0,max:n,grid:{color:"#f3f4f6"},ticks:{stepSize:20}},y:{grid:{display:!1}}}}})})}function dk({enviadas:e,erros:t}){return u.jsx("div",{className:"mt-4 h-64 flex items-center justify-center",children:u.jsx(ck,{data:{labels:["Enviadas","Erros"],datasets:[{data:[e,t],backgroundColor:["#3b82f6","#ef4444"],borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:n=>`${n.label}: ${n.parsed}`}}}}})})}function fk({nomeUsuario:e}){const[t,n]=b.useState(null),[r,s]=b.useState(!0),[i,o]=b.useState(""),a=b.useCallback(async()=>{try{o(""),n(await z.metricas())}catch(d){o(d instanceof Error?d.message:"Falha ao carregar métricas.")}finally{s(!1)}},[]);b.useEffect(()=>{a();const d=setInterval(a,15e3);return()=>clearInterval(d)},[a]);const l=t==null?void 0:t.perfil,c=l==null?void 0:l.licenca.restam_dias;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsxs("h1",{className:"text-2xl font-bold text-gray-800",children:["Olá, ",e," 👋 bem-vindo ao seu painel"]}),u.jsxs("div",{className:"mt-2 flex items-center justify-between text-sm text-gray-500",children:[u.jsxs("span",{children:[l!=null&&l.licenca.ativa?"Licença ativa":"Sem licença"," •"," ",l!=null&&l.licenca.expira_em?`expira em ${l.licenca.expira_em}`:"—"," • dados 100% locais"]}),c!=null&&u.jsxs("span",{children:["Restam ",u.jsx("strong",{className:"text-gray-700",children:c===null?"∞":`${c} dias`})]})]})]}),i&&u.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 rounded-xl px-4 py-3 text-sm",children:[u.jsx("i",{className:"fas fa-exclamation-triangle mr-2"}),i]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[u.jsxs(fo,{rotulo:"Status da Conexão",icone:"fas fa-plug",children:[u.jsx("div",{className:"mt-2 flex items-center",children:u.jsxs("span",{className:W("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",t!=null&&t.conexao.geral?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:[u.jsx("span",{className:W("w-2 h-2 mr-1.5 rounded-full",t!=null&&t.conexao.geral?"bg-green-500":"bg-red-500")}),t!=null&&t.conexao.geral?"Conectado":"Desconectado"]})}),u.jsxs("p",{className:"text-[11px] text-gray-400 mt-2",children:[u.jsx("i",{className:"fas fa-video mr-1"}),t!=null&&t.conexao.moneyprinter?"MoneyPrinterTurbo ✓":"MoneyPrinterTurbo ✗"," ·"," ",u.jsx("i",{className:"fas fa-mobile-alt mr-1"}),t!=null&&t.conexao.short_video_maker?"Short-Video-Maker ✓":"Short-Video-Maker ✗"]})]}),u.jsx(fo,{rotulo:"Taxa de entrega",valor:r?"—":`${(t==null?void 0:t.taxa_entrega)??0}%`,subtitulo:`${(t==null?void 0:t.total_enviadas)??0} enviadas • total`,icone:"fas fa-paper-plane"}),u.jsx(fo,{rotulo:"Taxa de erro",valor:r?"—":`${(t==null?void 0:t.taxa_erro)??0}%`,subtitulo:`${(t==null?void 0:t.total_erros)??0} erros • total`,icone:"fas fa-triangle-exclamation"}),u.jsx(fo,{rotulo:"Leads cadastrados",valor:r?"—":(t==null?void 0:t.leads_total)??0,subtitulo:"Total na base",icone:"fas fa-users"})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6 border border-gray-100",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-base font-semibold text-gray-800",children:"Leads por etapa (CRM)"}),u.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Quantidade de leads em cada coluna do Kanban"})]}),u.jsx("button",{onClick:a,className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium",children:"Atualizar"})]}),t?u.jsx(uk,{porEtapa:t.leads_por_etapa}):u.jsx(hk,{})]}),u.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6 border border-gray-100",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-base font-semibold text-gray-800",children:"Desempenho das campanhas"}),u.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Agregação de todas as campanhas (Enviadas × Erros)"})]}),u.jsx("button",{onClick:a,className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium",children:"Atualizar"})]}),u.jsx(dk,{enviadas:(t==null?void 0:t.campanhas.enviadas)??0,erros:(t==null?void 0:t.campanhas.erros)??0}),u.jsxs("div",{className:"mt-4 flex items-center justify-center space-x-6 text-xs",children:[u.jsxs("span",{className:"flex items-center",children:[u.jsx("span",{className:"w-3 h-3 bg-blue-500 rounded-full mr-1.5"})," Enviadas (",(t==null?void 0:t.campanhas.enviadas)??0,")"]}),u.jsxs("span",{className:"flex items-center",children:[u.jsx("span",{className:"w-3 h-3 bg-red-500 rounded-full mr-1.5"})," Erros (",(t==null?void 0:t.campanhas.erros)??0,")"]})]})]})]})]})}function hk(){return u.jsx("div",{className:"mt-4 h-64 flex items-center justify-center text-gray-300",children:u.jsx("i",{className:"fas fa-spinner fa-spin text-2xl"})})}function Ie({titulo:e,icone:t="fas fa-sliders",children:n,abertoInicial:r=!1}){const[s,i]=b.useState(r);return u.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[u.jsxs("button",{type:"button",onClick:()=>i(o=>!o),className:"w-full flex items-center justify-between px-4 py-3 text-sm font-medium text-gray-600 bg-gray-50 hover:bg-gray-100 transition",children:[u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx("i",{className:W(t,"text-gray-400")})," ",e]}),u.jsx("i",{className:W("fas fa-chevron-down text-xs text-gray-400 transition-transform",s&&"rotate-180")})]}),s&&u.jsx("div",{className:"px-4 py-4 bg-white space-y-3",children:n})]})}function wd({valor:e,altura:t="md",mostrarLabel:n=!1,className:r}){const s=Math.max(0,Math.min(100,Math.round(e))),i={sm:"h-1.5",md:"h-2.5"};return u.jsxs("div",{className:W("w-full",r),children:[n&&u.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-1",children:[u.jsx("span",{children:"Progresso"}),u.jsxs("span",{className:"font-semibold text-gray-700",children:[s,"%"]})]}),u.jsx("div",{className:W("w-full bg-gray-200 rounded-full overflow-hidden",i[t]),children:u.jsx("div",{className:W("h-full rounded-full bg-gradient-to-r from-indigo-500 to-purple-500 transition-all duration-500"),style:{width:`${s}%`}})})]})}const pk={leads:"bg-blue-100 text-blue-800",em_contato:"bg-amber-100 text-amber-800",proposta:"bg-violet-100 text-violet-800",fechado:"bg-green-100 text-green-800",rascunho:"bg-gray-100 text-gray-600",em_andamento:"bg-blue-100 text-blue-800",pausado:"bg-amber-100 text-amber-800",pausada:"bg-amber-100 text-amber-800",concluido:"bg-green-100 text-green-800",cancelado:"bg-gray-100 text-gray-600",erro:"bg-red-100 text-red-800",concluida:"bg-green-100 text-green-800",pendente:"bg-gray-100 text-gray-600",pulada:"bg-gray-100 text-gray-500",enviada:"bg-green-100 text-green-800",ativo:"bg-green-100 text-green-800",inativo:"bg-gray-100 text-gray-600"},gk={leads:"Leads",em_contato:"Em contato",proposta:"Proposta",fechado:"Fechado",rascunho:"Rascunho",em_andamento:"Em andamento",pausado:"Pausado",pausada:"Pausada",concluido:"Concluído",concluida:"Concluída",cancelado:"Cancelado",erro:"Erro",pendente:"Pendente",pulada:"Pulada",enviada:"Enviada",ativo:"Ativo",inativo:"Inativo",texto:"Texto",audio:"Áudio"};function yt({status:e,rotulo:t,className:n}){const r=pk[e]||"bg-gray-100 text-gray-600";return u.jsx("span",{className:W("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium whitespace-nowrap",r,n),children:t||gk[e]||e})}const mk={nome:"",telefone:"",email:"",fonte:"Manual",etapa:"leads"};function xk(){const{toast:e}=St(),[t,n]=b.useState([]),[r,s]=b.useState(""),[i,o]=b.useState("todas"),[a,l]=b.useState(!1),[c,d]=b.useState(null),[f,p]=b.useState(null),[h,g]=b.useState(null),x=b.useCallback(async()=>{n(await z.leads.listar())},[]);b.useEffect(()=>{x().catch(S=>e("erro",S.message))},[x,e]);const w=b.useMemo(()=>{const S=r.trim().toLowerCase();return t.filter(C=>{const j=!S||C.nome.toLowerCase().includes(S)||C.telefone.includes(S)||C.email.toLowerCase().includes(S),R=i==="todas"||C.etapa===i;return j&&R})},[t,r,i]),v=()=>{d({...mk}),l(!0)},m=S=>{d({...S}),l(!0)},y=async()=>{var S;if(!((S=c==null?void 0:c.nome)!=null&&S.trim())){e("erro","O nome do lead é obrigatório.");return}try{if(c.id){const{id:C,criado_em:j,atualizado_em:R,...M}=c;await z.leads.atualizar(C,M),e("sucesso","Lead atualizado.")}else await z.leads.criar(c),e("sucesso","Lead criado com sucesso.");l(!1),d(null),await x()}catch(C){e("erro",C instanceof Error?C.message:"Falha ao salvar lead.")}},_=async()=>{if(f)try{await z.leads.remover(f.id),e("sucesso",`Lead "${f.nome}" removido.`),p(null),await x()}catch(S){e("erro",S instanceof Error?S.message:"Falha ao remover.")}},k=async S=>{g(S.id);try{(await z.leads.enriquecer(S.id)).notas.forEach(j=>e("info",j)),e("sucesso","Lead enriquecido."),await x()}catch(C){e("erro",C instanceof Error?C.message:"Falha ao enriquecer.")}finally{g(null)}};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[u.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-[280px]",children:[u.jsxs("div",{className:"relative flex-1 max-w-md",children:[u.jsx("i",{className:"fas fa-search absolute left-3 top-2.5 text-gray-400 text-sm"}),u.jsx("input",{value:r,onChange:S=>s(S.target.value),placeholder:"Buscar por nome, telefone ou e-mail...",className:"w-full pl-9 pr-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 focus:border-indigo-400 outline-none"})]}),u.jsxs("select",{value:i,onChange:S=>o(S.target.value),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 bg-white focus:ring-2 focus:ring-indigo-400 outline-none",children:[u.jsx("option",{value:"todas",children:"Todas as etapas"}),Yn.map(S=>u.jsx("option",{value:S,children:Wn[S]},S))]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{onClick:()=>cw(t,"leadmaster-leads.json"),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 transition",children:[u.jsx("i",{className:"fas fa-download mr-2"})," Exportar"]}),u.jsxs("button",{onClick:v,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition shadow-sm",children:[u.jsx("i",{className:"fas fa-plus mr-2"})," Novo Lead"]})]})]}),u.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-left text-xs text-gray-500 uppercase border-b border-gray-100 bg-gray-50/50",children:[u.jsx("th",{className:"px-5 py-3 font-semibold",children:"Lead"}),u.jsx("th",{className:"px-5 py-3 font-semibold",children:"Contato"}),u.jsx("th",{className:"px-5 py-3 font-semibold",children:"Etapa"}),u.jsx("th",{className:"px-5 py-3 font-semibold",children:"Completude"}),u.jsx("th",{className:"px-5 py-3 font-semibold",children:"Atualizado"}),u.jsx("th",{className:"px-5 py-3 font-semibold text-right",children:"Ações"})]})}),u.jsxs("tbody",{children:[w.map(S=>{const C=ow(S),j=aw(S);return u.jsxs("tr",{className:"border-b border-gray-50 hover:bg-indigo-50/40 transition",children:[u.jsxs("td",{className:"px-5 py-3",children:[u.jsx("p",{className:"font-medium text-gray-800",children:S.nome}),u.jsxs("p",{className:"text-xs text-gray-400",children:[S.fonte,S.empresa?` · ${S.empresa}`:""]})]}),u.jsxs("td",{className:"px-5 py-3 text-gray-600",children:[u.jsx("p",{children:S.telefone||"—"}),u.jsx("p",{className:"text-xs text-gray-400",children:S.email||"sem e-mail"})]}),u.jsx("td",{className:"px-5 py-3",children:u.jsx(yt,{status:S.etapa})}),u.jsxs("td",{className:"px-5 py-3 w-52",children:[u.jsx(wd,{valor:C,altura:"sm"}),u.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:lw(C,j)})]}),u.jsx("td",{className:"px-5 py-3 text-xs text-gray-400",children:ma(S.atualizado_em)}),u.jsxs("td",{className:"px-5 py-3 text-right whitespace-nowrap",children:[u.jsx("button",{onClick:()=>k(S),disabled:h===S.id,title:" Enriquecer com IA / BrasilAPI",className:"text-gray-400 hover:text-indigo-600 px-1.5 disabled:opacity-40",children:u.jsx("i",{className:W("fas fa-wand-magic-sparkles",h===S.id&&"fa-spin")})}),u.jsx("button",{onClick:()=>m(S),title:"Editar",className:"text-gray-400 hover:text-indigo-600 px-1.5",children:u.jsx("i",{className:"fas fa-pen"})}),u.jsx("button",{onClick:()=>p(S),title:"Excluir",className:"text-gray-400 hover:text-red-600 px-1.5",children:u.jsx("i",{className:"fas fa-trash"})})]})]},S.id)}),w.length===0&&u.jsx("tr",{children:u.jsxs("td",{colSpan:6,className:"px-5 py-16 text-center text-gray-400",children:[u.jsx("i",{className:"fas fa-users text-3xl text-gray-200 block mb-3"}),"Nenhum lead encontrado. Crie um novo ou importe pelos Extratores."]})})]})]})})}),u.jsx(Ot,{aberto:a,onFechar:()=>l(!1),titulo:c!=null&&c.id?"Editar lead":"Novo lead",icone:"fas fa-user-plus",children:c&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx(rr,{rotulo:"Nome *",valor:c.nome||"",onChange:S=>d({...c,nome:S})}),u.jsx(rr,{rotulo:"Telefone",valor:c.telefone||"",onChange:S=>d({...c,telefone:S}),placeholder:"(11) 99999-9999"}),u.jsx(rr,{rotulo:"E-mail",tipo:"email",valor:c.email||"",onChange:S=>d({...c,email:S}),placeholder:"contato@empresa.com.br"}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Etapa"}),u.jsx("select",{value:c.etapa||"leads",onChange:S=>d({...c,etapa:S.target.value}),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",children:Yn.map(S=>u.jsx("option",{value:S,children:Wn[S]},S))})]})]}),u.jsxs(Ie,{titulo:"Campos avançados",icone:"fas fa-sliders",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx(rr,{rotulo:"Empresa",valor:c.empresa||"",onChange:S=>d({...c,empresa:S})}),u.jsx(rr,{rotulo:"CNPJ",valor:c.cnpj||"",onChange:S=>d({...c,cnpj:S}),placeholder:"00.000.000/0000-00"}),u.jsx(rr,{rotulo:"Cidade",valor:c.cidade||"",onChange:S=>d({...c,cidade:S}),placeholder:"São Paulo/SP"}),u.jsx(rr,{rotulo:"Fonte",valor:c.fonte||"",onChange:S=>d({...c,fonte:S}),placeholder:"Google Maps, Instagram, CNPJ..."})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Observações"}),u.jsx("textarea",{value:c.observacoes||"",onChange:S=>d({...c,observacoes:S.target.value}),rows:3,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",placeholder:"Histórico de conversas, próximos passos..."})]})]}),u.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[u.jsx("button",{onClick:()=>l(!1),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50",children:"Cancelar"}),u.jsxs("button",{onClick:y,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition",children:[u.jsx("i",{className:"fas fa-save mr-2"})," Salvar"]})]})]})}),u.jsxs(Ot,{aberto:!!f,onFechar:()=>p(null),titulo:"Excluir lead",icone:"fas fa-trash",children:[u.jsxs("p",{className:"text-sm text-gray-600",children:["Tem certeza que deseja excluir ",u.jsx("strong",{children:f==null?void 0:f.nome}),"? Essa ação não pode ser desfeita."]}),u.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[u.jsx("button",{onClick:()=>p(null),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50",children:"Cancelar"}),u.jsx("button",{onClick:_,className:"px-6 py-2.5 text-sm font-medium text-white bg-red-600 rounded-lg hover:bg-red-700",children:"Excluir"})]})]})]})}function rr({rotulo:e,valor:t,onChange:n,tipo:r="text",placeholder:s}){return u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:e}),u.jsx("input",{type:r,value:t,onChange:i=>n(i.target.value),placeholder:s,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}const rl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function xs(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function _d(e){return"nodeType"in e}function Ue(e){var t,n;return e?xs(e)?e:_d(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Sd(e){const{Document:t}=Ue(e);return e instanceof t}function Bi(e){return xs(e)?!1:e instanceof Ue(e).HTMLElement}function qx(e){return e instanceof Ue(e).SVGElement}function vs(e){return e?xs(e)?e.document:_d(e)?Sd(e)?e:Bi(e)||qx(e)?e.ownerDocument:document:document:document}const cn=rl?b.useLayoutEffect:b.useEffect;function sl(e){const t=b.useRef(e);return cn(()=>{t.current=e}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function vk(){const e=b.useRef(null),t=b.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Pi(e,t){t===void 0&&(t=[e]);const n=b.useRef(e);return cn(()=>{n.current!==e&&(n.current=e)},t),n}function Wi(e,t){const n=b.useRef();return b.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ea(e){const t=sl(e),n=b.useRef(null),r=b.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function Ma(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let Gl={};function il(e,t){return b.useMemo(()=>{if(t)return t;const n=Gl[e]==null?0:Gl[e]+1;return Gl[e]=n,e+"-"+n},[e,t])}function Gx(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,o)=>{const a=Object.entries(o);for(const[l,c]of a){const d=i[l];d!=null&&(i[l]=d+e*c)}return i},{...t})}}const ts=Gx(1),Pa=Gx(-1);function yk(e){return"clientX"in e&&"clientY"in e}function kd(e){if(!e)return!1;const{KeyboardEvent:t}=Ue(e.target);return t&&e instanceof t}function bk(e){if(!e)return!1;const{TouchEvent:t}=Ue(e.target);return t&&e instanceof t}function Ra(e){if(bk(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return yk(e)?{x:e.clientX,y:e.clientY}:null}const Ri=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ri.Translate.toString(e),Ri.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),xp="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function wk(e){return e.matches(xp)?e:e.querySelector(xp)}const _k={display:"none"};function Sk(e){let{id:t,value:n}=e;return fe.createElement("div",{id:t,style:_k},n)}function kk(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return fe.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function Ck(){const[e,t]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Jx=b.createContext(null);function jk(e){const t=b.useContext(Jx);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Nk(){const[e]=b.useState(()=>new Set),t=b.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[b.useCallback(r=>{let{type:s,event:i}=r;e.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[e]),t]}const Ek={draggable:`
85
- To pick up a draggable item, press the space bar.
86
- While dragging, use the arrow keys to move the item.
87
- Press space again to drop the item in its new position, or press escape to cancel.
88
- `},Mk={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Pk(e){let{announcements:t=Mk,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Ek}=e;const{announce:i,announcement:o}=Ck(),a=il("DndLiveRegion"),[l,c]=b.useState(!1);if(b.useEffect(()=>{c(!0)},[]),jk(b.useMemo(()=>({onDragStart(f){let{active:p}=f;i(t.onDragStart({active:p}))},onDragMove(f){let{active:p,over:h}=f;t.onDragMove&&i(t.onDragMove({active:p,over:h}))},onDragOver(f){let{active:p,over:h}=f;i(t.onDragOver({active:p,over:h}))},onDragEnd(f){let{active:p,over:h}=f;i(t.onDragEnd({active:p,over:h}))},onDragCancel(f){let{active:p,over:h}=f;i(t.onDragCancel({active:p,over:h}))}}),[i,t])),!l)return null;const d=fe.createElement(fe.Fragment,null,fe.createElement(Sk,{id:r,value:s.draggable}),fe.createElement(kk,{id:a,announcement:o}));return n?Ur.createPortal(d,n):d}var Se;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Se||(Se={}));function Ta(){}function Rk(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Tk(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Lt=Object.freeze({x:0,y:0});function Ok(e,t){const n=Ra(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Dk(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Lk(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Ak(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=s-r,a=i-n;if(r<s&&n<i){const l=t.width*t.height,c=e.width*e.height,d=o*a,f=d/(l+c-d);return Number(f.toFixed(4))}return 0}const zk=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const i of r){const{id:o}=i,a=n.get(o);if(a){const l=Ak(a,t);l>0&&s.push({id:o,data:{droppableContainer:i,value:l}})}}return s.sort(Dk)};function Ik(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Zx(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Lt}function Fk(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((o,a)=>({...o,top:o.top+e*a.y,bottom:o.bottom+e*a.y,left:o.left+e*a.x,right:o.right+e*a.x}),{...n})}}const Bk=Fk(1);function e0(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Wk(e,t,n){const r=e0(t);if(!r)return e;const{scaleX:s,scaleY:i,x:o,y:a}=r,l=e.left-o-(1-s)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=s?e.width/s:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:c,right:l+d,bottom:c+f,left:l}}const $k={ignoreTransform:!1};function $i(e,t){t===void 0&&(t=$k);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Ue(e).getComputedStyle(e);c&&(n=Wk(n,c,d))}const{top:r,left:s,width:i,height:o,bottom:a,right:l}=n;return{top:r,left:s,width:i,height:o,bottom:a,right:l}}function vp(e){return $i(e,{ignoreTransform:!0})}function Vk(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Hk(e,t){return t===void 0&&(t=Ue(e).getComputedStyle(e)),t.position==="fixed"}function Uk(e,t){t===void 0&&(t=Ue(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?n.test(i):!1})}function Cd(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(Sd(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Bi(s)||qx(s)||n.includes(s))return n;const i=Ue(e).getComputedStyle(s);return s!==e&&Uk(s,i)&&n.push(s),Hk(s,i)?n:r(s.parentNode)}return e?r(e):n}function t0(e){const[t]=Cd(e,1);return t??null}function Jl(e){return!rl||!e?null:xs(e)?e:_d(e)?Sd(e)||e===vs(e).scrollingElement?window:Bi(e)?e:null:null}function n0(e){return xs(e)?e.scrollX:e.scrollLeft}function r0(e){return xs(e)?e.scrollY:e.scrollTop}function lu(e){return{x:n0(e),y:r0(e)}}var Ne;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ne||(Ne={}));function s0(e){return!rl||!e?!1:e===document.scrollingElement}function i0(e){const t={x:0,y:0},n=s0(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:r,minScroll:t}}const Yk={x:.2,y:.2};function Kk(e,t,n,r,s){let{top:i,left:o,right:a,bottom:l}=n;r===void 0&&(r=10),s===void 0&&(s=Yk);const{isTop:c,isBottom:d,isLeft:f,isRight:p}=i0(e),h={x:0,y:0},g={x:0,y:0},x={height:t.height*s.y,width:t.width*s.x};return!c&&i<=t.top+x.height?(h.y=Ne.Backward,g.y=r*Math.abs((t.top+x.height-i)/x.height)):!d&&l>=t.bottom-x.height&&(h.y=Ne.Forward,g.y=r*Math.abs((t.bottom-x.height-l)/x.height)),!p&&a>=t.right-x.width?(h.x=Ne.Forward,g.x=r*Math.abs((t.right-x.width-a)/x.width)):!f&&o<=t.left+x.width&&(h.x=Ne.Backward,g.x=r*Math.abs((t.left+x.width-o)/x.width)),{direction:h,speed:g}}function Xk(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function o0(e){return e.reduce((t,n)=>ts(t,lu(n)),Lt)}function Qk(e){return e.reduce((t,n)=>t+n0(n),0)}function qk(e){return e.reduce((t,n)=>t+r0(n),0)}function a0(e,t){if(t===void 0&&(t=$i),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);t0(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Gk=[["x",["left","right"],Qk],["y",["top","bottom"],qk]];class jd{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Cd(n),s=o0(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,a]of Gk)for(const l of o)Object.defineProperty(this,l,{get:()=>{const c=a(r),d=s[i]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class si{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Jk(e){const{EventTarget:t}=Ue(e);return e instanceof t?e:vs(e)}function Zl(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var pt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(pt||(pt={}));function yp(e){e.preventDefault()}function Zk(e){e.stopPropagation()}var te;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(te||(te={}));const l0={start:[te.Space,te.Enter],cancel:[te.Esc],end:[te.Space,te.Enter,te.Tab]},eC=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case te.Right:return{...n,x:n.x+25};case te.Left:return{...n,x:n.x-25};case te.Down:return{...n,y:n.y+25};case te.Up:return{...n,y:n.y-25}}};class c0{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new si(vs(n)),this.windowListeners=new si(Ue(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&a0(r),n(Lt)}handleKeyDown(t){if(kd(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=l0,coordinateGetter:o=eC,scrollBehavior:a="smooth"}=s,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,d=c?{x:c.left,y:c.top}:Lt;this.referenceCoordinates||(this.referenceCoordinates=d);const f=o(t,{active:n,context:r.current,currentCoordinates:d});if(f){const p=Pa(f,d),h={x:0,y:0},{scrollableAncestors:g}=r.current;for(const x of g){const w=t.code,{isTop:v,isRight:m,isLeft:y,isBottom:_,maxScroll:k,minScroll:S}=i0(x),C=Xk(x),j={x:Math.min(w===te.Right?C.right-C.width/2:C.right,Math.max(w===te.Right?C.left:C.left+C.width/2,f.x)),y:Math.min(w===te.Down?C.bottom-C.height/2:C.bottom,Math.max(w===te.Down?C.top:C.top+C.height/2,f.y))},R=w===te.Right&&!m||w===te.Left&&!y,M=w===te.Down&&!_||w===te.Up&&!v;if(R&&j.x!==f.x){const N=x.scrollLeft+p.x,D=w===te.Right&&N<=k.x||w===te.Left&&N>=S.x;if(D&&!p.y){x.scrollTo({left:N,behavior:a});return}D?h.x=x.scrollLeft-N:h.x=w===te.Right?x.scrollLeft-k.x:x.scrollLeft-S.x,h.x&&x.scrollBy({left:-h.x,behavior:a});break}else if(M&&j.y!==f.y){const N=x.scrollTop+p.y,D=w===te.Down&&N<=k.y||w===te.Up&&N>=S.y;if(D&&!p.x){x.scrollTo({top:N,behavior:a});return}D?h.y=x.scrollTop-N:h.y=w===te.Down?x.scrollTop-k.y:x.scrollTop-S.y,h.y&&x.scrollBy({top:-h.y,behavior:a});break}}this.handleMove(t,ts(Pa(f,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}c0.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=l0,onActivation:s}=t,{active:i}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function bp(e){return!!(e&&"distance"in e)}function wp(e){return!!(e&&"delay"in e)}class Nd{constructor(t,n,r){var s;r===void 0&&(r=Jk(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:o}=i;this.props=t,this.events=n,this.document=vs(o),this.documentListeners=new si(this.document),this.listeners=new si(r),this.windowListeners=new si(Ue(o)),this.initialCoordinates=(s=Ra(i))!=null?s:Lt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(pt.Resize,this.handleCancel),this.windowListeners.add(pt.DragStart,yp),this.windowListeners.add(pt.VisibilityChange,this.handleCancel),this.windowListeners.add(pt.ContextMenu,yp),this.documentListeners.add(pt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(wp(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(bp(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(pt.Click,Zk,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const l=(n=Ra(t))!=null?n:Lt,c=Pa(s,l);if(!r&&a){if(bp(a)){if(a.tolerance!=null&&Zl(c,a.tolerance))return this.handleCancel();if(Zl(c,a.distance))return this.handleStart()}if(wp(a)&&Zl(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===te.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const tC={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ed extends Nd{constructor(t){const{event:n}=t,r=vs(n.target);super(t,tC,r)}}Ed.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const nC={move:{name:"mousemove"},end:{name:"mouseup"}};var cu;(function(e){e[e.RightClick=2]="RightClick"})(cu||(cu={}));class rC extends Nd{constructor(t){super(t,nC,vs(t.event.target))}}rC.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===cu.RightClick?!1:(r==null||r({event:n}),!0)}}];const ec={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class sC extends Nd{constructor(t){super(t,ec)}static setup(){return window.addEventListener(ec.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ec.move.name,t)};function t(){}}}sC.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var ii;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(ii||(ii={}));var Oa;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Oa||(Oa={}));function iC(e){let{acceleration:t,activator:n=ii.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:a=Oa.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:f,threshold:p}=e;const h=aC({delta:f,disabled:!i}),[g,x]=vk(),w=b.useRef({x:0,y:0}),v=b.useRef({x:0,y:0}),m=b.useMemo(()=>{switch(n){case ii.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case ii.DraggableRect:return s}},[n,s,l]),y=b.useRef(null),_=b.useCallback(()=>{const S=y.current;if(!S)return;const C=w.current.x*v.current.x,j=w.current.y*v.current.y;S.scrollBy(C,j)},[]),k=b.useMemo(()=>a===Oa.TreeOrder?[...c].reverse():c,[a,c]);b.useEffect(()=>{if(!i||!c.length||!m){x();return}for(const S of k){if((r==null?void 0:r(S))===!1)continue;const C=c.indexOf(S),j=d[C];if(!j)continue;const{direction:R,speed:M}=Kk(S,j,m,t,p);for(const N of["x","y"])h[N][R[N]]||(M[N]=0,R[N]=0);if(M.x>0||M.y>0){x(),y.current=S,g(_,o),w.current=M,v.current=R;return}}w.current={x:0,y:0},v.current={x:0,y:0},x()},[t,_,r,x,i,o,JSON.stringify(m),JSON.stringify(h),g,c,k,d,JSON.stringify(p)])}const oC={x:{[Ne.Backward]:!1,[Ne.Forward]:!1},y:{[Ne.Backward]:!1,[Ne.Forward]:!1}};function aC(e){let{delta:t,disabled:n}=e;const r=Ma(t);return Wi(s=>{if(n||!r||!s)return oC;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Ne.Backward]:s.x[Ne.Backward]||i.x===-1,[Ne.Forward]:s.x[Ne.Forward]||i.x===1},y:{[Ne.Backward]:s.y[Ne.Backward]||i.y===-1,[Ne.Forward]:s.y[Ne.Forward]||i.y===1}}},[n,t,r])}function lC(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Wi(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function cC(e,t){return b.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,r)}));return[...n,...i]},[]),[e,t])}var Ti;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ti||(Ti={}));var uu;(function(e){e.Optimized="optimized"})(uu||(uu={}));const _p=new Map;function uC(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,o]=b.useState(null),{frequency:a,measure:l,strategy:c}=s,d=b.useRef(e),f=w(),p=Pi(f),h=b.useCallback(function(v){v===void 0&&(v=[]),!p.current&&o(m=>m===null?v:m.concat(v.filter(y=>!m.includes(y))))},[p]),g=b.useRef(null),x=Wi(v=>{if(f&&!n)return _p;if(!v||v===_p||d.current!==e||i!=null){const m=new Map;for(let y of e){if(!y)continue;if(i&&i.length>0&&!i.includes(y.id)&&y.rect.current){m.set(y.id,y.rect.current);continue}const _=y.node.current,k=_?new jd(l(_),_):null;y.rect.current=k,k&&m.set(y.id,k)}return m}return v},[e,i,n,f,l]);return b.useEffect(()=>{d.current=e},[e]),b.useEffect(()=>{f||h()},[n,f]),b.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),b.useEffect(()=>{f||typeof a!="number"||g.current!==null||(g.current=setTimeout(()=>{h(),g.current=null},a))},[a,f,h,...r]),{droppableRects:x,measureDroppableContainers:h,measuringScheduled:i!=null};function w(){switch(c){case Ti.Always:return!1;case Ti.BeforeDragging:return n;default:return!n}}}function Md(e,t){return Wi(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function dC(e,t){return Md(e,t)}function fC(e){let{callback:t,disabled:n}=e;const r=sl(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function ol(e){let{callback:t,disabled:n}=e;const r=sl(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function hC(e){return new jd($i(e),e)}function Sp(e,t,n){t===void 0&&(t=hC);const[r,s]=b.useState(null);function i(){s(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const o=fC({callback(l){if(e)for(const c of l){const{type:d,target:f}=c;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=ol({callback:i});return cn(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r}function pC(e){const t=Md(e);return Zx(e,t)}const kp=[];function gC(e){const t=b.useRef(e),n=Wi(r=>e?r&&r!==kp&&e&&t.current&&e.parentNode===t.current.parentNode?r:Cd(e):kp,[e]);return b.useEffect(()=>{t.current=e},[e]),n}function mC(e){const[t,n]=b.useState(null),r=b.useRef(e),s=b.useCallback(i=>{const o=Jl(i.target);o&&n(a=>a?(a.set(o,lu(o)),new Map(a)):null)},[]);return b.useEffect(()=>{const i=r.current;if(e!==i){o(i);const a=e.map(l=>{const c=Jl(l);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,lu(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(i)};function o(a){a.forEach(l=>{const c=Jl(l);c==null||c.removeEventListener("scroll",s)})}},[s,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>ts(i,o),Lt):o0(e):Lt,[e,t])}function Cp(e,t){t===void 0&&(t=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},t),b.useEffect(()=>{const r=e!==Lt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Pa(e,n.current):Lt}function xC(e){b.useEffect(()=>{if(!rl)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function vC(e,t){return b.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,t)},n},{}),[e,t])}function u0(e){return b.useMemo(()=>e?Vk(e):null,[e])}const jp=[];function yC(e,t){t===void 0&&(t=$i);const[n]=e,r=u0(n?Ue(n):null),[s,i]=b.useState(jp);function o(){i(()=>e.length?e.map(l=>s0(l)?r:new jd(t(l),l)):jp)}const a=ol({callback:o});return cn(()=>{a==null||a.disconnect(),o(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),s}function d0(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Bi(t)?t:e}function bC(e){let{measure:t}=e;const[n,r]=b.useState(null),s=b.useCallback(c=>{for(const{target:d}of c)if(Bi(d)){r(f=>{const p=t(d);return f?{...f,width:p.width,height:p.height}:p});break}},[t]),i=ol({callback:s}),o=b.useCallback(c=>{const d=d0(c);i==null||i.disconnect(),d&&(i==null||i.observe(d)),r(d?t(d):null)},[t,i]),[a,l]=Ea(o);return b.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const wC=[{sensor:Ed,options:{}},{sensor:c0,options:{}}],_C={current:{}},Vo={draggable:{measure:vp},droppable:{measure:vp,strategy:Ti.WhileDragging,frequency:uu.Optimized},dragOverlay:{measure:$i}};class oi extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const SC={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new oi,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ta},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Vo,measureDroppableContainers:Ta,windowRect:null,measuringScheduled:!1},f0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ta,draggableNodes:new Map,over:null,measureDroppableContainers:Ta},Vi=b.createContext(f0),h0=b.createContext(SC);function kC(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new oi}}}function CC(e,t){switch(t.type){case Se.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Se.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Se.DragEnd:case Se.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Se.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new oi(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case Se.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new oi(e.droppable.containers);return o.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:o}}}case Se.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new oi(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function jC(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext(Vi),i=Ma(r),o=Ma(n==null?void 0:n.id);return b.useEffect(()=>{if(!t&&!r&&i&&o!=null){if(!kd(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const f=wk(d);if(f){f.focus();break}}})}},[r,t,s,o,i]),null}function p0(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function NC(e){return b.useMemo(()=>({draggable:{...Vo.draggable,...e==null?void 0:e.draggable},droppable:{...Vo.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Vo.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function EC(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const i=b.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;cn(()=>{if(!o&&!a||!t){i.current=!1;return}if(i.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const d=n(c),f=Zx(d,r);if(o||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=t0(c);p&&p.scrollBy({top:f.y,left:f.x})}},[t,o,a,r,n])}const al=b.createContext({...Lt,scaleX:1,scaleY:1});var bn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(bn||(bn={}));const MC=b.memo(function(t){var n,r,s,i;let{id:o,accessibility:a,autoScroll:l=!0,children:c,sensors:d=wC,collisionDetection:f=zk,measuring:p,modifiers:h,...g}=t;const x=b.useReducer(CC,void 0,kC),[w,v]=x,[m,y]=Nk(),[_,k]=b.useState(bn.Uninitialized),S=_===bn.Initialized,{draggable:{active:C,nodes:j,translate:R},droppable:{containers:M}}=w,N=C!=null?j.get(C):null,D=b.useRef({initial:null,translated:null}),E=b.useMemo(()=>{var De;return C!=null?{id:C,data:(De=N==null?void 0:N.data)!=null?De:_C,rect:D}:null},[C,N]),B=b.useRef(null),[I,G]=b.useState(null),[J,T]=b.useState(null),L=Pi(g,Object.values(g)),A=il("DndDescribedBy",o),U=b.useMemo(()=>M.getEnabled(),[M]),$=NC(p),{droppableRects:se,measureDroppableContainers:Y,measuringScheduled:we}=uC(U,{dragging:S,dependencies:[R.x,R.y],config:$.droppable}),q=lC(j,C),kt=b.useMemo(()=>J?Ra(J):null,[J]),ys=S0(),Hi=dC(q,$.draggable.measure);EC({activeNode:C!=null?j.get(C):null,config:ys.layoutShiftCompensation,initialRect:Hi,measure:$.draggable.measure});const tt=Sp(q,$.draggable.measure,Hi),ll=Sp(q?q.parentElement:null),Jn=b.useRef({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:se,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Rd=M.getNodeFor((n=Jn.current.over)==null?void 0:n.id),Zn=bC({measure:$.dragOverlay.measure}),Ui=(r=Zn.nodeRef.current)!=null?r:q,kr=S?(s=Zn.rect)!=null?s:tt:null,Td=!!(Zn.nodeRef.current&&Zn.rect),Od=pC(Td?null:tt),cl=u0(Ui?Ue(Ui):null),dn=gC(S?Rd??q:null),Yi=yC(dn),Ki=p0(h,{transform:{x:R.x-Od.x,y:R.y-Od.y,scaleX:1,scaleY:1},activatorEvent:J,active:E,activeNodeRect:tt,containerNodeRect:ll,draggingNodeRect:kr,over:Jn.current.over,overlayNodeRect:Zn.rect,scrollableAncestors:dn,scrollableAncestorRects:Yi,windowRect:cl}),Dd=kt?ts(kt,R):null,Ld=mC(dn),m0=Cp(Ld),x0=Cp(Ld,[tt]),Cr=ts(Ki,m0),jr=kr?Bk(kr,Ki):null,bs=E&&jr?f({active:E,collisionRect:jr,droppableRects:se,droppableContainers:U,pointerCoordinates:Dd}):null,Ad=Lk(bs,"id"),[fn,zd]=b.useState(null),v0=Td?Ki:ts(Ki,x0),y0=Ik(v0,(i=fn==null?void 0:fn.rect)!=null?i:null,tt),ul=b.useRef(null),Id=b.useCallback((De,nt)=>{let{sensor:rt,options:hn}=nt;if(B.current==null)return;const ft=j.get(B.current);if(!ft)return;const st=De.nativeEvent,At=new rt({active:B.current,activeNode:ft,event:st,options:hn,context:Jn,onAbort(Pe){if(!j.get(Pe))return;const{onDragAbort:zt}=L.current,Kt={id:Pe};zt==null||zt(Kt),m({type:"onDragAbort",event:Kt})},onPending(Pe,pn,zt,Kt){if(!j.get(Pe))return;const{onDragPending:_s}=L.current,gn={id:Pe,constraint:pn,initialCoordinates:zt,offset:Kt};_s==null||_s(gn),m({type:"onDragPending",event:gn})},onStart(Pe){const pn=B.current;if(pn==null)return;const zt=j.get(pn);if(!zt)return;const{onDragStart:Kt}=L.current,ws={activatorEvent:st,active:{id:pn,data:zt.data,rect:D}};Ur.unstable_batchedUpdates(()=>{Kt==null||Kt(ws),k(bn.Initializing),v({type:Se.DragStart,initialCoordinates:Pe,active:pn}),m({type:"onDragStart",event:ws}),G(ul.current),T(st)})},onMove(Pe){v({type:Se.DragMove,coordinates:Pe})},onEnd:Nr(Se.DragEnd),onCancel:Nr(Se.DragCancel)});ul.current=At;function Nr(Pe){return async function(){const{active:zt,collisions:Kt,over:ws,scrollAdjustedTranslate:_s}=Jn.current;let gn=null;if(zt&&_s){const{cancelDrop:Ss}=L.current;gn={activatorEvent:st,active:zt,collisions:Kt,delta:_s,over:ws},Pe===Se.DragEnd&&typeof Ss=="function"&&await Promise.resolve(Ss(gn))&&(Pe=Se.DragCancel)}B.current=null,Ur.unstable_batchedUpdates(()=>{v({type:Pe}),k(bn.Uninitialized),zd(null),G(null),T(null),ul.current=null;const Ss=Pe===Se.DragEnd?"onDragEnd":"onDragCancel";if(gn){const dl=L.current[Ss];dl==null||dl(gn),m({type:Ss,event:gn})}})}}},[j]),b0=b.useCallback((De,nt)=>(rt,hn)=>{const ft=rt.nativeEvent,st=j.get(hn);if(B.current!==null||!st||ft.dndKit||ft.defaultPrevented)return;const At={active:st};De(rt,nt.options,At)===!0&&(ft.dndKit={capturedBy:nt.sensor},B.current=hn,Id(rt,nt))},[j,Id]),Fd=cC(d,b0);xC(d),cn(()=>{tt&&_===bn.Initializing&&k(bn.Initialized)},[tt,_]),b.useEffect(()=>{const{onDragMove:De}=L.current,{active:nt,activatorEvent:rt,collisions:hn,over:ft}=Jn.current;if(!nt||!rt)return;const st={active:nt,activatorEvent:rt,collisions:hn,delta:{x:Cr.x,y:Cr.y},over:ft};Ur.unstable_batchedUpdates(()=>{De==null||De(st),m({type:"onDragMove",event:st})})},[Cr.x,Cr.y]),b.useEffect(()=>{const{active:De,activatorEvent:nt,collisions:rt,droppableContainers:hn,scrollAdjustedTranslate:ft}=Jn.current;if(!De||B.current==null||!nt||!ft)return;const{onDragOver:st}=L.current,At=hn.get(Ad),Nr=At&&At.rect.current?{id:At.id,rect:At.rect.current,data:At.data,disabled:At.disabled}:null,Pe={active:De,activatorEvent:nt,collisions:rt,delta:{x:ft.x,y:ft.y},over:Nr};Ur.unstable_batchedUpdates(()=>{zd(Nr),st==null||st(Pe),m({type:"onDragOver",event:Pe})})},[Ad]),cn(()=>{Jn.current={activatorEvent:J,active:E,activeNode:q,collisionRect:jr,collisions:bs,droppableRects:se,draggableNodes:j,draggingNode:Ui,draggingNodeRect:kr,droppableContainers:M,over:fn,scrollableAncestors:dn,scrollAdjustedTranslate:Cr},D.current={initial:kr,translated:jr}},[E,q,bs,jr,j,Ui,kr,se,M,fn,dn,Cr]),iC({...ys,delta:R,draggingRect:jr,pointerCoordinates:Dd,scrollableAncestors:dn,scrollableAncestorRects:Yi});const w0=b.useMemo(()=>({active:E,activeNode:q,activeNodeRect:tt,activatorEvent:J,collisions:bs,containerNodeRect:ll,dragOverlay:Zn,draggableNodes:j,droppableContainers:M,droppableRects:se,over:fn,measureDroppableContainers:Y,scrollableAncestors:dn,scrollableAncestorRects:Yi,measuringConfiguration:$,measuringScheduled:we,windowRect:cl}),[E,q,tt,J,bs,ll,Zn,j,M,se,fn,Y,dn,Yi,$,we,cl]),_0=b.useMemo(()=>({activatorEvent:J,activators:Fd,active:E,activeNodeRect:tt,ariaDescribedById:{draggable:A},dispatch:v,draggableNodes:j,over:fn,measureDroppableContainers:Y}),[J,Fd,E,tt,v,A,j,fn,Y]);return fe.createElement(Jx.Provider,{value:y},fe.createElement(Vi.Provider,{value:_0},fe.createElement(h0.Provider,{value:w0},fe.createElement(al.Provider,{value:y0},c)),fe.createElement(jC,{disabled:(a==null?void 0:a.restoreFocus)===!1})),fe.createElement(Pk,{...a,hiddenTextDescribedById:A}));function S0(){const De=(I==null?void 0:I.autoScrollEnabled)===!1,nt=typeof l=="object"?l.enabled===!1:l===!1,rt=S&&!De&&!nt;return typeof l=="object"?{...l,enabled:rt}:{enabled:rt}}}),PC=b.createContext(null),Np="button",RC="Draggable";function TC(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=il(RC),{activators:o,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:f,over:p}=b.useContext(Vi),{role:h=Np,roleDescription:g="draggable",tabIndex:x=0}=s??{},w=(l==null?void 0:l.id)===t,v=b.useContext(w?al:PC),[m,y]=Ea(),[_,k]=Ea(),S=vC(o,t),C=Pi(n);cn(()=>(f.set(t,{id:t,key:i,node:m,activatorNode:_,data:C}),()=>{const R=f.get(t);R&&R.key===i&&f.delete(t)}),[f,t]);const j=b.useMemo(()=>({role:h,tabIndex:x,"aria-disabled":r,"aria-pressed":w&&h===Np?!0:void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[r,h,x,w,g,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:j,isDragging:w,listeners:r?void 0:S,node:m,over:p,setNodeRef:y,setActivatorNodeRef:k,transform:v}}function OC(){return b.useContext(h0)}const DC="Droppable",LC={timeout:25};function AC(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=il(DC),{active:o,dispatch:a,over:l,measureDroppableContainers:c}=b.useContext(Vi),d=b.useRef({disabled:n}),f=b.useRef(!1),p=b.useRef(null),h=b.useRef(null),{disabled:g,updateMeasurementsFor:x,timeout:w}={...LC,...s},v=Pi(x??r),m=b.useCallback(()=>{if(!f.current){f.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{c(Array.isArray(v.current)?v.current:[v.current]),h.current=null},w)},[w]),y=ol({callback:m,disabled:g||!o}),_=b.useCallback((j,R)=>{y&&(R&&(y.unobserve(R),f.current=!1),j&&y.observe(j))},[y]),[k,S]=Ea(_),C=Pi(t);return b.useEffect(()=>{!y||!k.current||(y.disconnect(),f.current=!1,y.observe(k.current))},[k,y]),b.useEffect(()=>(a({type:Se.RegisterDroppable,element:{id:r,key:i,disabled:n,node:k,rect:p,data:C}}),()=>a({type:Se.UnregisterDroppable,key:i,id:r})),[r]),b.useEffect(()=>{n!==d.current.disabled&&(a({type:Se.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,a]),{active:o,rect:p,isOver:(l==null?void 0:l.id)===r,node:k,over:l,setNodeRef:S}}function zC(e){let{animation:t,children:n}=e;const[r,s]=b.useState(null),[i,o]=b.useState(null),a=Ma(n);return!n&&!r&&a&&s(a),cn(()=>{if(!i)return;const l=r==null?void 0:r.key,c=r==null?void 0:r.props.id;if(l==null||c==null){s(null);return}Promise.resolve(t(c,i)).then(()=>{s(null)})},[t,r,i]),fe.createElement(fe.Fragment,null,n,r?b.cloneElement(r,{ref:o}):null)}const IC={x:0,y:0,scaleX:1,scaleY:1};function FC(e){let{children:t}=e;return fe.createElement(Vi.Provider,{value:f0},fe.createElement(al.Provider,{value:IC},t))}const BC={position:"fixed",touchAction:"none"},WC=e=>kd(e)?"transform 250ms ease":void 0,$C=b.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:a,style:l,transform:c,transition:d=WC}=e;if(!a)return null;const f=s?c:{...c,scaleX:1,scaleY:1},p={...BC,width:a.width,height:a.height,top:a.top,left:a.left,transform:Ri.Transform.toString(f),transformOrigin:s&&r?Ok(r,a):void 0,transition:typeof d=="function"?d(r):d,...l};return fe.createElement(n,{className:o,style:p,ref:t},i)}),VC=e=>t=>{let{active:n,dragOverlay:r}=t;const s={},{styles:i,className:o}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[l,c]of Object.entries(s))n.node.style.setProperty(l,c);o!=null&&o.active&&n.node.classList.remove(o.active)}},HC=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Ri.Transform.toString(t)},{transform:Ri.Transform.toString(n)}]},UC={duration:250,easing:"ease",keyframes:HC,sideEffects:VC({styles:{active:{opacity:"0"}}})};function YC(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=e;return sl((i,o)=>{if(t===null)return;const a=n.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=d0(o);if(!c)return;const{transform:d}=Ue(o).getComputedStyle(o),f=e0(d);if(!f)return;const p=typeof t=="function"?t:KC(t);return a0(l,s.draggable.measure),p({active:{id:i,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:s,transform:f})})}function KC(e){const{duration:t,easing:n,sideEffects:r,keyframes:s}={...UC,...e};return i=>{let{active:o,dragOverlay:a,transform:l,...c}=i;if(!t)return;const d={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},f={scaleX:l.scaleX!==1?o.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?o.rect.height*l.scaleY/a.rect.height:1},p={x:l.x-d.x,y:l.y-d.y,...f},h=s({...c,active:o,dragOverlay:a,transform:{initial:l,final:p}}),[g]=h,x=h[h.length-1];if(JSON.stringify(g)===JSON.stringify(x))return;const w=r==null?void 0:r({active:o,dragOverlay:a,...c}),v=a.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(m=>{v.onfinish=()=>{w==null||w(),m()}})}}let Ep=0;function XC(e){return b.useMemo(()=>{if(e!=null)return Ep++,Ep},[e])}const QC=fe.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:h,draggableNodes:g,droppableContainers:x,dragOverlay:w,over:v,measuringConfiguration:m,scrollableAncestors:y,scrollableAncestorRects:_,windowRect:k}=OC(),S=b.useContext(al),C=XC(f==null?void 0:f.id),j=p0(o,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:h,draggingNodeRect:w.rect,over:v,overlayNodeRect:w.rect,scrollableAncestors:y,scrollableAncestorRects:_,transform:S,windowRect:k}),R=Md(p),M=YC({config:r,draggableNodes:g,droppableContainers:x,measuringConfiguration:m}),N=R?w.setRef:void 0;return fe.createElement(FC,null,fe.createElement(zC,{animation:M},f&&C?fe.createElement($C,{key:C,id:f.id,ref:N,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:R,style:{zIndex:c,...s},transform:j},n):null))});function g0({lead:e,onAbrir:t,emOverlay:n=!1}){const{attributes:r,listeners:s,setNodeRef:i,transform:o,isDragging:a}=TC({id:e.id});return u.jsxs("div",{ref:i,...s,...r,style:o?{transform:`translate3d(${o.x}px, ${o.y}px, 0)`}:void 0,className:W("bg-white rounded-lg shadow-sm border border-gray-100 p-3 cursor-grab active:cursor-grabbing select-none",a&&!n&&"opacity-40",n&&"shadow-xl rotate-2"),onDoubleClick:()=>t==null?void 0:t(e),title:"Arraste para mudar de etapa · duplo clique para editar",children:[u.jsx("p",{className:"text-sm font-semibold text-gray-800 truncate",children:e.nome}),u.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:id(e.telefone)}),u.jsxs("div",{className:"flex items-center justify-between mt-2",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-wide bg-indigo-50 text-indigo-700 px-1.5 py-0.5 rounded font-medium",children:e.fonte}),u.jsxs("span",{className:"text-[10px] text-gray-400",children:[u.jsx("i",{className:"fas fa-star text-amber-400 mr-0.5"}),e.score??0]})]})]})}function qC({etapa:e,leads:t,onAbrirLead:n,cor:r}){const{setNodeRef:s,isOver:i}=AC({id:e});return u.jsxs("div",{ref:s,className:W("bg-gray-50 rounded-xl p-3 w-72 shrink-0 flex flex-col min-h-[420px] transition-colors",i&&"bg-indigo-50 ring-2 ring-indigo-300"),children:[u.jsxs("div",{className:"flex items-center justify-between px-1 pb-3",children:[u.jsxs("span",{className:"flex items-center gap-2 text-sm font-semibold text-gray-700",children:[u.jsx("span",{className:W("w-2.5 h-2.5 rounded-full",r)}),Wn[e]]}),u.jsx("span",{className:"text-xs font-medium text-gray-500 bg-white border border-gray-200 rounded-full px-2 py-0.5",children:t.length})]}),u.jsxs("div",{className:"flex-1 space-y-2 overflow-y-auto pr-0.5",style:{maxHeight:"calc(100vh - 320px)"},children:[t.length===0&&u.jsxs("div",{className:"text-center text-xs text-gray-400 border-2 border-dashed border-gray-200 rounded-lg py-10 mt-8",children:[u.jsx("i",{className:"fas fa-inbox text-2xl text-gray-300 mb-2 block"}),"Arraste leads para cá"]}),t.map(o=>u.jsx(g0,{lead:o,onAbrir:n},o.id))]})]})}const GC={leads:"bg-blue-500",em_contato:"bg-amber-500",proposta:"bg-violet-500",fechado:"bg-green-500"};function JC({leads:e,onMover:t,onAbrirLead:n}){const[r,s]=b.useState(null),i=Tk(Rk(Ed,{activationConstraint:{distance:6}})),o=l=>{const c=e.find(d=>d.id===l.active.id);s(c??null)},a=l=>{var f;s(null);const c=(f=l.over)==null?void 0:f.id;if(!c)return;const d=e.find(p=>p.id===l.active.id);!d||d.etapa===c||t(d.id,c)};return u.jsxs(MC,{sensors:i,onDragStart:o,onDragEnd:a,children:[u.jsx("div",{className:"flex gap-4 overflow-x-auto pb-2",children:Yn.map(l=>u.jsx(qC,{etapa:l,cor:GC[l],leads:e.filter(c=>c.etapa===l),onAbrirLead:n},l))}),u.jsx(QC,{children:r?u.jsx(g0,{lead:r,emOverlay:!0}):null})]})}function ZC(){const{toast:e}=St(),[t,n]=b.useState([]),[r,s]=b.useState(null),[i,o]=b.useState(!1),[a,l]=b.useState(null),[c,d]=b.useState(""),f=b.useCallback(async()=>{n(await z.leads.listar())},[]);b.useEffect(()=>{f().catch(m=>e("erro",m.message))},[f,e]);const p=async(m,y)=>{const _=t;n(k=>k.map(S=>S.id===m?{...S,etapa:y}:S));try{await z.leads.atualizar(m,{etapa:y}),e("sucesso",`Lead movido para "${Wn[y]}".`)}catch(k){n(_),e("erro",k instanceof Error?k.message:"Falha ao mover lead.")}},h=async()=>{o(!0);try{const m=await z.crm.sugestoes();s(m.sugestoes)}catch(m){e("erro",m instanceof Error?m.message:"Falha ao pedir sugestões.")}finally{o(!1)}},g=async m=>{try{await z.crm.aplicar(m.lead_id,m.para),s(y=>(y==null?void 0:y.filter(_=>_!==m))??null),await f(),e("sucesso",`Sugestão aplicada: ${m.lead_nome} → ${Wn[m.para]}.`)}catch(y){e("erro",y instanceof Error?y.message:"Falha ao aplicar sugestão.")}},x=async m=>{try{(await z.leads.enriquecer(m.id)).notas.forEach(_=>e("info",_)),await f()}catch(y){e("erro",y instanceof Error?y.message:"Falha ao enriquecer.")}},w=async()=>{if(a)try{await z.leads.atualizar(a.id,{observacoes:c}),l(null),await f(),e("sucesso","Observações salvas.")}catch(m){e("erro",m instanceof Error?m.message:"Falha ao salvar.")}},v=b.useMemo(()=>Object.fromEntries(Yn.map(m=>[m,t.filter(y=>y.etapa===m).length])),[t]);return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-500",children:[u.jsxs("span",{children:[u.jsx("strong",{className:"text-gray-800",children:t.length})," leads no funil"]}),Yn.map(m=>u.jsxs("span",{className:"hidden md:inline",children:[Wn[m],": ",u.jsx("strong",{className:"text-gray-700",children:v[m]})]},m))]}),u.jsxs("button",{onClick:h,disabled:i,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition disabled:opacity-60",children:[u.jsx("i",{className:W("fas fa-wand-magic-sparkles mr-2",i&&"fa-spin")}),"Sugestões da IA"]})]}),u.jsx(JC,{leads:t,onMover:p,onAbrirLead:m=>{l(m),d(m.observacoes||"")}}),u.jsxs(Ot,{aberto:r!==null,onFechar:()=>s(null),titulo:"Sugestões de movimentação (Agente de CRM)",icone:"fas fa-robot",largura:"lg",children:[r&&r.length===0&&u.jsxs("p",{className:"text-sm text-gray-500 text-center py-8",children:[u.jsx("i",{className:"fas fa-circle-check text-green-500 text-2xl block mb-3"}),"Nenhuma sugestão no momento — o funil está equilibrado. 🎯"]}),u.jsx("div",{className:"space-y-3",children:r==null?void 0:r.map((m,y)=>u.jsxs("div",{className:"border border-gray-100 rounded-xl p-4 flex items-start justify-between gap-4 hover:border-indigo-200 transition",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-sm font-semibold text-gray-800 truncate",children:m.lead_nome}),u.jsxs("p",{className:"text-xs text-gray-500 mt-1 flex items-center gap-2",children:[u.jsx(yt,{status:m.de})," ",u.jsx("i",{className:"fas fa-arrow-right text-gray-300"})," ",u.jsx(yt,{status:m.para}),u.jsxs("span",{className:"text-gray-400",children:["confiança ",Math.round(m.confianca*100),"%"]})]}),u.jsx("p",{className:"text-xs text-gray-600 mt-2",children:m.motivo})]}),u.jsx("button",{onClick:()=>g(m),className:"shrink-0 px-4 py-2 text-xs font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:"Aplicar"})]},y))})]}),u.jsx(Ot,{aberto:!!a,onFechar:()=>l(null),titulo:"Lead",icone:"fas fa-address-card",children:a&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-base font-semibold text-gray-800",children:a.nome}),u.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:[id(a.telefone)," · ",a.fonte]})]}),u.jsx(yt,{status:a.etapa})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Observações"}),u.jsx("textarea",{value:c,onChange:m=>d(m.target.value),rows:4,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",placeholder:"Ex.: ligou pedindo proposta, retorna na sexta..."})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("button",{onClick:()=>x(a),className:"text-sm text-indigo-600 hover:text-indigo-800 font-medium",children:[u.jsx("i",{className:"fas fa-wand-magic-sparkles mr-1"})," Enriquecer com IA"]}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx("button",{onClick:()=>l(null),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50",children:"Cancelar"}),u.jsxs("button",{onClick:w,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:[u.jsx("i",{className:"fas fa-save mr-2"})," Salvar"]})]})]})]})})]})}function ej(){const{toast:e}=St(),[t,n]=b.useState([]),[r,s]=b.useState([]),[i,o]=b.useState({}),[a,l]=b.useState(!1),[c,d]=b.useState(null),[f,p]=b.useState(""),[h,g]=b.useState("texto"),[x,w]=b.useState("texto"),[v,m]=b.useState(new Set),[y,_]=b.useState("todas"),k=b.useCallback(async()=>{const[E,B,I]=await Promise.all([z.campanhas.listar(),z.leads.listar(),z.agentes.templates()]);n(E),s(B),o(I)},[]);b.useEffect(()=>{k().catch(E=>e("erro",E.message))},[k,e]);const S=t.some(E=>E.status==="em_andamento");b.useEffect(()=>{if(!S)return;const E=setInterval(()=>k().catch(()=>{}),4e3);return()=>clearInterval(E)},[S,k]);const C=b.useMemo(()=>y==="todas"?r:r.filter(E=>E.etapa===y),[r,y]),j=E=>{m(B=>{const I=new Set(B);return I.has(E)?I.delete(E):I.add(E),I})},R=()=>{m(new Set(C.map(E=>E.id)))},M=async()=>{if(!f.trim()){e("erro","Dê um nome para a campanha.");return}if(v.size===0){e("erro","Selecione ao menos um lead para disparar.");return}try{await z.campanhas.criar({nome:f.trim(),canal:h,template:x,lead_ids:[...v]}),e("sucesso","Campanha criada — clique em Iniciar quando estiver pronto."),l(!1),p(""),m(new Set),await k()}catch(E){e("erro",E instanceof Error?E.message:"Falha ao criar campanha.")}},N=async(E,B)=>{try{const I=B==="iniciar"?await z.campanhas.iniciar(E.id):B==="pausar"?await z.campanhas.pausar(E.id):await z.campanhas.parar(E.id);e(I.ok?"sucesso":"info",I.mensagem),await k()}catch(I){e("erro",I instanceof Error?I.message:"Falha na ação.")}},D=async E=>{try{await z.campanhas.remover(E.id),e("sucesso",`Campanha "${E.nome}" removida.`),await k()}catch(B){e("erro",B instanceof Error?B.message:"Falha ao remover.")}};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("p",{className:"text-sm text-gray-500",children:[u.jsx("strong",{className:"text-gray-800",children:t.length})," campanhas • templates configuráveis em Agentes"]}),u.jsxs("button",{onClick:()=>l(!0),className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition shadow-sm",children:[u.jsx("i",{className:"fas fa-plus mr-2"})," Nova Campanha"]})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.map(E=>{const B=Math.max(E.total,E.enviadas+E.erros),I=B?Math.round((E.enviadas+E.erros)/B*100):0,G=E.status==="em_andamento";return u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-5 space-y-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-sm font-semibold text-gray-800 truncate",children:E.nome}),u.jsxs("p",{className:"text-xs text-gray-400 mt-0.5",children:["criada em ",ma(E.criado_em),' · template "',E.template,'"']})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(yt,{status:tj(E.canal),rotulo:E.canal==="audio"?"Áudio":"Texto"}),u.jsx(yt,{status:E.status})]})]}),u.jsx(wd,{valor:I,mostrarLabel:!0}),u.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[u.jsxs("span",{children:[u.jsx("i",{className:"fas fa-paper-plane text-blue-500 mr-1"}),E.enviadas," enviadas"]}),u.jsxs("span",{children:[u.jsx("i",{className:"fas fa-circle-exclamation text-red-500 mr-1"}),E.erros," erros"]}),u.jsxs("span",{children:[B," leads"]})]}),u.jsxs("div",{className:"flex items-center justify-between pt-1",children:[u.jsxs("button",{onClick:()=>d(E),className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium",children:[u.jsx("i",{className:"fas fa-list mr-1"})," Ver eventos"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[(E.status==="rascunho"||E.status==="pausada"||E.status==="concluida")&&u.jsxs("button",{onClick:()=>N(E,"iniciar"),className:"px-4 py-2 text-xs font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:[u.jsx("i",{className:"fas fa-play mr-1"})," ",E.status==="pausada"?"Retomar":"Iniciar"]}),G&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{onClick:()=>N(E,"pausar"),className:"px-4 py-2 text-xs font-medium text-amber-700 bg-amber-50 border border-amber-200 rounded-lg hover:bg-amber-100",children:[u.jsx("i",{className:"fas fa-pause mr-1"})," Pausar"]}),u.jsxs("button",{onClick:()=>N(E,"parar"),className:"px-4 py-2 text-xs font-medium text-red-700 bg-red-50 border border-red-200 rounded-lg hover:bg-red-100",children:[u.jsx("i",{className:"fas fa-stop mr-1"})," Parar"]})]}),u.jsx("button",{onClick:()=>D(E),className:"text-gray-400 hover:text-red-600 px-2 py-2",title:"Excluir campanha",children:u.jsx("i",{className:"fas fa-trash"})})]})]})]},E.id)}),t.length===0&&u.jsxs("div",{className:"lg:col-span-2 bg-white rounded-xl border border-dashed border-gray-200 py-16 text-center text-gray-400",children:[u.jsx("i",{className:"fas fa-bullhorn text-3xl text-gray-200 block mb-3"}),'Nenhuma campanha ainda. Crie a primeira com "Nova Campanha".']})]}),u.jsx(Ot,{aberto:a,onFechar:()=>l(!1),titulo:"Nova campanha de disparo",icone:"fas fa-bullhorn",largura:"lg",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsxs("div",{className:"md:col-span-3",children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Nome da campanha *"}),u.jsx("input",{value:f,onChange:E=>p(E.target.value),placeholder:"Ex.: Reativação de leads de novembro",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Canal"}),u.jsxs("select",{value:h,onChange:E=>{const B=E.target.value;g(B),w(B)},className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",children:[u.jsx("option",{value:"texto",children:"Texto"}),u.jsx("option",{value:"audio",children:"Áudio"})]})]}),u.jsxs("div",{className:"md:col-span-2",children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Template"}),u.jsx("select",{value:x,onChange:E=>w(E.target.value),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",children:Object.keys(i).map(E=>u.jsxs("option",{value:E,children:[E==="texto"?"Texto":"Áudio"," — ",i[E].slice(0,40),"..."]},E))})]})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsxs("label",{className:"text-xs font-medium text-gray-500",children:["Leads destinatários — ",v.size," selecionado(s)"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("select",{value:y,onChange:E=>_(E.target.value),className:"text-xs border border-gray-200 rounded-lg px-2 py-1.5 bg-white",children:[u.jsx("option",{value:"todas",children:"Todas as etapas"}),Yn.map(E=>u.jsx("option",{value:E,children:Wn[E]},E))]}),u.jsx("button",{onClick:R,className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium",children:"Selecionar todos"})]})]}),u.jsxs("div",{className:"max-h-52 overflow-y-auto border border-gray-100 rounded-lg divide-y divide-gray-50",children:[C.map(E=>u.jsxs("label",{className:"flex items-center gap-3 px-3 py-2.5 text-sm cursor-pointer hover:bg-indigo-50/50",children:[u.jsx("input",{type:"checkbox",checked:v.has(E.id),onChange:()=>j(E.id),className:"w-4 h-4 accent-indigo-500"}),u.jsx("span",{className:"text-gray-700 flex-1 truncate",children:E.nome}),u.jsx("span",{className:"text-xs text-gray-400",children:E.telefone||E.email||"sem contato"})]},E.id)),C.length===0&&u.jsx("p",{className:"px-3 py-6 text-center text-xs text-gray-400",children:"Nenhum lead nesta etapa."})]})]}),u.jsx(Ie,{titulo:"Como funciona o disparo?",icone:"fas fa-circle-question",children:u.jsxs("p",{className:"text-xs text-gray-500",children:["O disparo é executado pelo ",u.jsx("strong",{children:"OpenOutreach"})," (eracle/OpenOutreach). Se ainda não configurou, a validação acontece na hora de iniciar — configure em ",u.jsx("strong",{children:"Ferramentas → OpenOutreach"}),"."]})}),u.jsxs("div",{className:"flex justify-end gap-3 pt-1",children:[u.jsx("button",{onClick:()=>l(!1),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50",children:"Cancelar"}),u.jsxs("button",{onClick:M,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:[u.jsx("i",{className:"fas fa-plus mr-2"})," Criar campanha"]})]})]})}),u.jsx(Ot,{aberto:!!c,onFechar:()=>d(null),titulo:`Eventos — ${(c==null?void 0:c.nome)??""}`,icone:"fas fa-list",largura:"lg",children:c&&u.jsxs("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:[c.eventos.length===0&&u.jsx("p",{className:"text-sm text-gray-400 text-center py-8",children:"Nenhum evento ainda — inicie a campanha para gerar disparos."}),c.eventos.slice().reverse().map((E,B)=>{var I;return u.jsxs("div",{className:"flex items-start gap-3 text-sm border-b border-gray-50 pb-2",children:[u.jsx("i",{className:W("mt-1 text-xs",E.status==="enviado"?"fas fa-circle-check text-green-500":"fas fa-circle-xmark text-red-500")}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"text-gray-700 truncate",children:((I=r.find(G=>G.id===E.lead_id))==null?void 0:I.nome)??E.lead_id}),E.mensagem&&u.jsx("p",{className:"text-xs text-gray-400 truncate",children:E.mensagem})]}),u.jsx("span",{className:"text-xs text-gray-300 shrink-0",children:ma(E.momento)})]},B)})]})})]})}function tj(e){return e==="audio"?"audio":"texto"}const nj=[{id:"maps",rotulo:"Google Maps",icone:"fas fa-map-marked-alt"},{id:"instagram",rotulo:"Instagram",icone:"fab fa-instagram"},{id:"cnpj",rotulo:"CNPJ",icone:"fas fa-building"}];function rj(){const[e,t]=ox(),n=e.get("tab")||"maps";return u.jsxs("div",{className:"space-y-6",children:[u.jsx("div",{className:"flex gap-2",children:nj.map(r=>u.jsxs("button",{onClick:()=>t({tab:r.id}),className:W("px-5 py-2.5 text-sm font-medium rounded-lg transition",n===r.id?"bg-[#1e1b4b] text-white shadow-sm":"bg-white text-gray-600 border border-gray-200 hover:bg-gray-50"),children:[u.jsx("i",{className:W(r.icone,"mr-2")}),r.rotulo]},r.id))}),n==="maps"&&u.jsx(ij,{}),n==="instagram"&&u.jsx(oj,{}),n==="cnpj"&&u.jsx(aj,{})]})}function Pd({resultados:e,onImportar:t,importando:n}){const[r,s]=b.useState(()=>new Set(e.leads.map((a,l)=>l))),i=a=>s(l=>{const c=new Set(l);return c.has(a)?c.delete(a):c.add(a),c}),o=r.size===e.leads.length;return u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-gray-100 bg-gray-50/50",children:[u.jsxs("p",{className:"text-sm font-medium text-gray-700",children:[e.leads.length," resultado(s) — ",r.size," selecionado(s)"]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("button",{onClick:()=>s(o?new Set:new Set(e.leads.map((a,l)=>l))),className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium",children:o?"Limpar seleção":"Selecionar todos"}),u.jsxs("button",{onClick:()=>t(e.leads.filter((a,l)=>r.has(l))),disabled:r.size===0||n,className:"px-5 py-2 text-xs font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 disabled:opacity-50",children:[u.jsx("i",{className:"fas fa-file-import mr-1"})," ",n?"Importando...":`Importar ${r.size}`]})]})]}),u.jsx("div",{className:"overflow-x-auto max-h-[420px] overflow-y-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{className:"sticky top-0",children:u.jsxs("tr",{className:"text-left text-xs text-gray-500 uppercase border-b border-gray-100 bg-white",children:[u.jsx("th",{className:"px-4 py-2 w-8"}),u.jsx("th",{className:"px-4 py-2 font-semibold",children:"Nome / Empresa"}),u.jsx("th",{className:"px-4 py-2 font-semibold",children:"Contato"}),u.jsx("th",{className:"px-4 py-2 font-semibold",children:"Cidade"}),u.jsx("th",{className:"px-4 py-2 font-semibold",children:"Detalhes"})]})}),u.jsx("tbody",{children:e.leads.map((a,l)=>u.jsxs("tr",{className:"border-b border-gray-50 hover:bg-indigo-50/40",children:[u.jsx("td",{className:"px-4 py-2",children:u.jsx("input",{type:"checkbox",checked:r.has(l),onChange:()=>i(l),className:"w-4 h-4 accent-indigo-500"})}),u.jsx("td",{className:"px-4 py-2 text-gray-800",children:a.nome||a.empresa||"—"}),u.jsxs("td",{className:"px-4 py-2 text-gray-600",children:[u.jsx("p",{children:id(a.telefone)}),u.jsx("p",{className:"text-xs text-gray-400",children:a.email||"sem e-mail"})]}),u.jsx("td",{className:"px-4 py-2 text-gray-500 text-xs",children:a.cidade||"—"}),u.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:sj(a)})]},l))})]})})]})}function sj(e){const t=e.extras;if(!t)return"—";const n=[];return t.seguidores!==void 0&&n.push(`${t.seguidores} seguidores`),t.avaliacao!==void 0&&n.push(`★ ${t.avaliacao}`),t.qtd_avaliacoes!==void 0&&n.push(`(${t.qtd_avaliacoes} avaliações)`),n.join(" · ")||"—"}function ij(){const{toast:e}=St(),[t,n]=b.useState(""),[r,s]=b.useState(""),[i,o]=b.useState(100),[a,l]=b.useState(null),[c,d]=b.useState(!1),[f,p]=b.useState(!1),[h,g]=b.useState(null);b.useEffect(()=>{z.config.obter().then(g).catch(()=>{})},[]);const x=async()=>{if(t.trim().length<2||r.trim().length<2){e("erro",'Preencha a palavra-chave e a localização (ex.: "dentista", "São Paulo").');return}d(!0),l(null);try{const m=await z.extrair.googleMaps({palavra_chave:t.trim(),localizacao:r.trim(),max_resultados:i});l(m),e("sucesso",`${m.leads.length} leads extraídos — revise e importe.`)}catch(m){e("erro",m instanceof Error?m.message:"Falha na extração.")}finally{d(!1)}},w=async m=>{p(!0);try{const y=await z.leads.importar(m);e("sucesso",`${y.importados.length} importados, ${y.duplicados.length} duplicados ignorados.`),l(null)}catch(y){e("erro",y instanceof Error?y.message:"Falha ao importar.")}finally{p(!1)}},v=!!(h!=null&&h.extratores.google_maps_cli);return u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("p",{className:"text-sm text-gray-500",children:"Busque empresas por palavra-chave e localização (dados públicos do Google Maps)."}),u.jsx(yt,{status:v?"ativo":"inativo",rotulo:v?"Scraper configurado":"Scraper não configurado"})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[u.jsxs("div",{className:"md:col-span-2",children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Palavra-chave *"}),u.jsx("input",{value:t,onChange:m=>n(m.target.value),placeholder:"Ex.: dentista, barbearia, academia...",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Localização *"}),u.jsx("input",{value:r,onChange:m=>s(m.target.value),placeholder:"Ex.: São Paulo, SP",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Máx. resultados"}),u.jsx("input",{type:"number",min:1,max:500,value:i,onChange:m=>o(Number(m.target.value)||100),className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})]}),u.jsxs("button",{onClick:x,disabled:c,className:"w-full md:w-auto px-8 py-3 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition disabled:opacity-60",children:[u.jsx("i",{className:W("fas fa-magnifying-glass mr-2",c&&"fa-spin")}),c?"Extraindo leads...":"Extrair Leads"]}),u.jsx(Ie,{titulo:"Como instalar o Google Maps Scraper",icone:"fas fa-circle-question",children:u.jsxs("ol",{className:"text-xs text-gray-500 space-y-1 list-decimal pl-4",children:[u.jsxs("li",{children:["Instale o scraper:"," ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"github.com/gosom/google-maps-scraper"})]}),u.jsxs("li",{children:["Compile (Go) e informe o caminho do binário em ",u.jsx("strong",{children:"Ferramentas → Extratores"}),"."]}),u.jsx("li",{children:"As flags do comando são ajustáveis no template de argumentos em Ferramentas."})]})})]}),a&&u.jsx(Pd,{resultados:a,onImportar:w,importando:f})]})}function oj(){const{toast:e}=St(),[t,n]=b.useState(""),[r,s]=b.useState(null),[i,o]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(null);b.useEffect(()=>{z.config.obter().then(d).catch(()=>{})},[]);const f=async()=>{if(!t.includes("instagram.com")){e("erro","Informe a URL do perfil (ex.: https://instagram.com/perfil).");return}o(!0),s(null);try{const g=await z.extrair.instagram(t.trim());s(g),e("sucesso","Dados extraídos — revise e importe.")}catch(g){e("erro",g instanceof Error?g.message:"Falha na extração.")}finally{o(!1)}},p=async g=>{l(!0);try{const x=await z.leads.importar(g);e("sucesso",`${x.importados.length} importados, ${x.duplicados.length} duplicados ignorados.`),s(null)}catch(x){e("erro",x instanceof Error?x.message:"Falha ao importar.")}finally{l(!1)}},h=!!(c!=null&&c.extratores.igmapper_cli);return u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("p",{className:"text-sm text-gray-500",children:"Extraia contatos públicos de um perfil do Instagram."}),u.jsx(yt,{status:h?"ativo":"inativo",rotulo:h?"igmapper configurado":"igmapper não configurado"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:u.jsxs("div",{className:"md:col-span-3",children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"URL do perfil *"}),u.jsx("input",{value:t,onChange:g=>n(g.target.value),placeholder:"https://www.instagram.com/perfil_do_negocio/",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}),u.jsxs("button",{onClick:f,disabled:i,className:"w-full md:w-auto px-8 py-3 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition disabled:opacity-60",children:[u.jsx("i",{className:W("fab fa-instagram mr-2",i&&"fa-spin")}),i?"Extraindo...":"Extrair do Instagram"]}),u.jsx(Ie,{titulo:"Como instalar o igmapper",icone:"fas fa-circle-question",children:u.jsxs("ol",{className:"text-xs text-gray-500 space-y-1 list-decimal pl-4",children:[u.jsxs("li",{children:["Instale: ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"github.com/lucasoal/igmapper"})]}),u.jsxs("li",{children:["Informe o caminho do CLI em ",u.jsx("strong",{children:"Ferramentas → Extratores"}),"."]})]})})]}),r&&u.jsx(Pd,{resultados:r,onImportar:p,importando:a})]})}function aj(){const{toast:e}=St(),[t,n]=b.useState("cnpj"),[r,s]=b.useState(""),[i,o]=b.useState(""),[a,l]=b.useState("SP"),[c,d]=b.useState(20),[f,p]=b.useState(null),[h,g]=b.useState(!1),[x,w]=b.useState(!1),v=b.useCallback(async()=>{g(!0),p(null);try{if(t==="cnpj"){const _=await z.extrair.cnpj(r.trim());p({leads:[_]}),e("sucesso","CNPJ localizado — revise e importe.")}else{const _=await z.extrair.cnpjBusca({cnae:i.trim(),uf:a.trim(),quantidade:c});p(_),e("sucesso",`${_.leads.length} empresas encontradas via ${_.provedor}.`)}}catch(_){e("erro",_ instanceof Error?_.message:"Falha na consulta.")}finally{g(!1)}},[t,r,i,a,c,e]),m=async _=>{w(!0);try{const k=await z.leads.importar(_);e("sucesso",`${k.importados.length} importados, ${k.duplicados.length} duplicados ignorados.`),p(null)}catch(k){e("erro",k instanceof Error?k.message:"Falha ao importar.")}finally{w(!1)}},y=b.useMemo(()=>["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"],[]);return u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{onClick:()=>n("cnpj"),className:W("px-4 py-2 text-xs font-medium rounded-lg transition",t==="cnpj"?"bg-indigo-100 text-indigo-700":"text-gray-500 hover:bg-gray-50"),children:"Consulta por CNPJ"}),u.jsx("button",{onClick:()=>n("cnae"),className:W("px-4 py-2 text-xs font-medium rounded-lg transition",t==="cnae"?"bg-indigo-100 text-indigo-700":"text-gray-500 hover:bg-gray-50"),children:"Busca por CNAE + UF"})]}),t==="cnpj"?u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:u.jsxs("div",{className:"md:col-span-2",children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"CNPJ *"}),u.jsx("input",{value:r,onChange:_=>s(_.target.value),placeholder:"00.000.000/0000-00 (a BrasilAPI aceita com ou sem pontuação)",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}):u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"CNAE (código) *"}),u.jsx("input",{value:i,onChange:_=>o(_.target.value),placeholder:"Ex.: 6202-3/01 (desenvolvimento de software)",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"UF *"}),u.jsx("select",{value:a,onChange:_=>l(_.target.value),className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",children:y.map(_=>u.jsx("option",{children:_},_))})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Quantidade"}),u.jsx("input",{type:"number",min:1,max:100,value:c,onChange:_=>d(Number(_.target.value)||20),className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})]}),u.jsxs("button",{onClick:v,disabled:h,className:"w-full md:w-auto px-8 py-3 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition disabled:opacity-60",children:[u.jsx("i",{className:W("fas fa-building mr-2",h&&"fa-spin")}),h?"Consultando...":t==="cnpj"?"Consultar CNPJ":"Buscar empresas"]}),u.jsx(Ie,{titulo:"Fontes e scraping profundo",icone:"fas fa-circle-question",children:u.jsxs("ul",{className:"text-xs text-gray-500 space-y-1 list-disc pl-4",children:[u.jsxs("li",{children:["Consulta direta usa a ",u.jsx("strong",{children:"BrasilAPI"})," (brasilapi.com.br) — sem chave."]}),u.jsxs("li",{children:["A busca por CNAE/UF usa um ",u.jsx("strong",{children:"provedor configurável"})," (padrão: OpenCNPJ) — ajuste a URL em"," ",u.jsx("strong",{children:"Ferramentas → Extratores"})," conforme o provedor que você usa."]}),u.jsxs("li",{children:["Scraping profundo de contatos no site da empresa via ",u.jsx("strong",{children:"Scrapling"})," (D4Vinci/Scrapling), se configurado."]})]})})]}),f&&u.jsx(Pd,{resultados:f,onImportar:m,importando:x})]})}const Mp={roteiro:"fas fa-file-lines",thumbnail:"fas fa-image",wide:"fas fa-film",shorts:"fas fa-mobile-screen",upload:"fab fa-youtube"},lj={pendente:"bg-gray-100 text-gray-400 border-gray-200",em_andamento:"bg-blue-50 text-blue-600 border-blue-300 animate-pulse",concluida:"bg-green-50 text-green-600 border-green-300",erro:"bg-red-50 text-red-600 border-red-300",pulada:"bg-gray-50 text-gray-400 border-gray-200 border-dashed"};function cj(){const{toast:e}=St(),[t,n]=b.useState([]),[r,s]=b.useState({}),[i,o]=b.useState(!1),[a,l]=b.useState(new Set),[c,d]=b.useState(""),[f,p]=b.useState(""),[h,g]=b.useState("informativo"),[x,w]=b.useState(8),[v,m]=b.useState(""),[y,_]=b.useState(new Set(["wide","shorts"])),k=b.useCallback(async()=>{try{const[N,D]=await Promise.all([z.pipeline.listar(),z.integracoes()]);n(N),s(D)}catch(N){e("erro",N instanceof Error?N.message:"Falha ao carregar pipeline.")}},[e]);b.useEffect(()=>{k()},[k]);const S=t.some(N=>N.status==="em_andamento");b.useEffect(()=>{if(!S)return;const N=setInterval(()=>{z.pipeline.listar().then(n).catch(()=>{})},3e3);return()=>clearInterval(N)},[S]);const C=N=>_(D=>{const E=new Set(D);return E.has(N)?E.delete(N):E.add(N),E}),j=async()=>{if(c.trim().length<3){e("erro","Descreva o tema do vídeo (mínimo 3 caracteres).");return}if(y.size===0){e("erro","Selecione ao menos um formato (Wide e/ou Shorts).");return}try{await z.pipeline.criar({tema:c.trim(),titulo:f.trim(),tom:h,duracao_min:x,keyword_seo:v.trim(),formatos:[...y]}),e("sucesso","Vídeo criado — clique em Iniciar para rodar o pipeline."),o(!1),d(""),p(""),m(""),_(new Set(["wide","shorts"])),await k()}catch(N){e("erro",N instanceof Error?N.message:"Falha ao criar job.")}},R=async(N,D)=>{try{const E=await z.pipeline.agir(N.id,D);e("sucesso",E.mensagem),await k()}catch(E){e("erro",E instanceof Error?E.message:"Ação não permitida.")}},M=N=>l(D=>{const E=new Set(D);return E.has(N)?E.delete(N):E.add(N),E});return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 px-5 py-4 flex items-center justify-between flex-wrap gap-3",children:[u.jsx("div",{className:"flex items-center gap-4 flex-wrap text-xs",children:[{chave:"llm",rotulo:"LLM",icone:"fas fa-brain"},{chave:"moneyprinter",rotulo:"MoneyPrinterTurbo",icone:"fas fa-film"},{chave:"short_video_maker",rotulo:"Short-Video-Maker",icone:"fas fa-mobile-screen"},{chave:"uploader_youtube",rotulo:"Uploader YouTube",icone:"fab fa-youtube"}].map(N=>u.jsxs("span",{className:"flex items-center gap-1.5 text-gray-500",children:[u.jsx("span",{className:W("w-2 h-2 rounded-full",r[N.chave]?"bg-green-500":"bg-gray-300"),title:r[N.chave]?"Configurado":"Não configurado — veja Ferramentas"}),u.jsx("i",{className:W(N.icone,r[N.chave]?"text-gray-500":"text-gray-300")})," ",N.rotulo]},N.chave))}),u.jsxs("button",{onClick:()=>o(!0),className:"px-8 py-3 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition shadow-sm",children:[u.jsx("i",{className:"fas fa-circle-play mr-2 text-base"})," Iniciar Novo Vídeo"]})]}),t.length===0&&u.jsxs("div",{className:"bg-white rounded-xl border border-dashed border-gray-200 py-16 text-center text-gray-400",children:[u.jsx("i",{className:"fas fa-video text-3xl text-gray-200 block mb-3"}),"Nenhum vídeo no pipeline. Clique em ",u.jsx("strong",{className:"text-indigo-500",children:"Iniciar Novo Vídeo"})," para começar."]}),u.jsx("div",{className:"space-y-4",children:t.map(N=>u.jsx(uj,{job:N,expandido:a.has(N.id),onAlternarExpandido:()=>M(N.id),onAgir:D=>R(N,D)},N.id))}),u.jsx(Ot,{aberto:i,onFechar:()=>o(!1),titulo:"Novo vídeo faceless",icone:"fas fa-circle-play",largura:"lg",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Tema do vídeo *"}),u.jsx("textarea",{value:c,onChange:N=>d(N.target.value),rows:2,placeholder:"Ex.: Como automatizar prospecção de leads com IA em 2026",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"}),u.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:"O roteiro terá 7.000–9.000 caracteres (gerado por LLM ou modelo local)."})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Título (opcional)"}),u.jsx("input",{value:f,onChange:N=>p(N.target.value),placeholder:"Se vazio, o LLM sugere um título",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Palavra-chave SEO"}),u.jsx("input",{value:v,onChange:N=>m(N.target.value),placeholder:"Ex.: prospecção com IA",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Tom"}),u.jsxs("select",{value:h,onChange:N=>g(N.target.value),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",children:[u.jsx("option",{value:"informativo",children:"Informativo"}),u.jsx("option",{value:"educativo",children:"Educativo"}),u.jsx("option",{value:"inspirador",children:"Inspirador"}),u.jsx("option",{value:"provocativo",children:"Provocativo"}),u.jsx("option",{value:"storytelling",children:"Storytelling"})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Duração estimada"}),u.jsx("select",{value:x,onChange:N=>w(Number(N.target.value)),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",children:[3,5,8,10,15].map(N=>u.jsxs("option",{value:N,children:[N," minutos"]},N))})]})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1.5",children:"Formatos *"}),u.jsx("div",{className:"flex gap-3",children:[{id:"wide",rotulo:"Wide 16:9 (YouTube)",icone:"fas fa-film"},{id:"shorts",rotulo:"Shorts 9:16",icone:"fas fa-mobile-screen"}].map(N=>u.jsxs("button",{type:"button",onClick:()=>C(N.id),className:W("flex-1 px-4 py-3 rounded-lg border text-sm font-medium transition flex items-center justify-center gap-2",y.has(N.id)?"bg-indigo-50 border-indigo-400 text-indigo-700":"bg-white border-gray-200 text-gray-500 hover:bg-gray-50"),children:[u.jsx("i",{className:N.icone})," ",N.rotulo,y.has(N.id)&&u.jsx("i",{className:"fas fa-circle-check"})]},N.id))})]}),u.jsx(Ie,{titulo:"Como o pipeline funciona",icone:"fas fa-circle-question",children:u.jsxs("ol",{className:"text-xs text-gray-500 space-y-1 list-decimal pl-4",children:[u.jsxs("li",{children:[u.jsx("strong",{children:"Roteiro"})," — gerado por LLM (7k–9k caracteres) ou modelo local."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Thumbnail/Título"})," — título otimizado + prompt de imagem."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Produção Wide"})," — MoneyPrinterTurbo (localhost:8080) com fallback OpenMontage."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Produção Shorts"})," — Short-Video-Maker (localhost:3123)."]}),u.jsxs("li",{children:[u.jsx("strong",{children:"Upload"})," — não listado, aguarda 1h e publica (até 50/dia)."]})]})}),u.jsxs("div",{className:"flex justify-end gap-3 pt-1",children:[u.jsx("button",{onClick:()=>o(!1),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50",children:"Cancelar"}),u.jsxs("button",{onClick:j,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:[u.jsx("i",{className:"fas fa-plus mr-2"})," Criar vídeo"]})]})]})})]})}function uj({job:e,expandido:t,onAlternarExpandido:n,onAgir:r}){var f,p;const s=e.status==="em_andamento",i=e.status==="erro",o=e.status==="rascunho"||e.status==="pausado"||e.status==="cancelado",a=e.etapas.filter(h=>h.status==="concluida"||h.status==="pulada").length,l=e.etapas.filter(h=>h.status!=="concluida"&&h.status!=="pulada").length,c=b.useMemo(()=>e.status==="concluido"?"🎉 Vídeo concluído do início ao fim!":i?"Uma etapa falhou — corrija a integração e clique em Repetir.":l===0?"Finalizando...":`Faltam ${l} etapa${l>1?"s":""} para o upload 🚀`,[e.status,i,l]),d=e.dados.titulo_gerado||e.titulo||e.tema;return u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("p",{className:"text-sm font-semibold text-gray-800 flex items-center gap-2 flex-wrap",children:[u.jsx("i",{className:"fas fa-video text-indigo-400"})," ",d]}),u.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["criado em ",ma(e.criado_em)," · tom ",e.tom," · ",e.duracao_min," min ·"," ",e.formatos.join(" + ")]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="em_andamento"&&u.jsx("i",{className:"fas fa-spinner fa-spin text-indigo-500"}),u.jsx(yt,{status:e.status})]})]}),u.jsxs("div",{children:[u.jsx(wd,{valor:e.progresso??0,mostrarLabel:!0}),u.jsx("p",{className:"text-xs text-indigo-600 font-medium mt-2",children:c})]}),u.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:e.etapas.map((h,g)=>u.jsxs("div",{className:"flex items-center",children:[u.jsxs("div",{className:W("flex items-center gap-2 px-3 py-2 rounded-lg border text-xs font-medium",lj[h.status]),title:h.mensagem||h.nome,children:[u.jsx("i",{className:Mp[h.id]}),u.jsx("span",{className:"hidden sm:inline",children:h.nome}),h.status==="erro"&&u.jsx("i",{className:"fas fa-circle-exclamation"}),h.status==="pulada"&&u.jsx("span",{className:"hidden sm:inline",children:"(pulada)"})]}),g<e.etapas.length-1&&u.jsx("i",{className:"fas fa-chevron-right text-gray-200 mx-0.5"})]},h.id))}),u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[(o||i)&&u.jsxs("button",{onClick:()=>r(i?"repetir":"iniciar"),className:"px-5 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:[u.jsx("i",{className:"fas fa-play mr-2"}),i?"Repetir":e.status==="pausado"||e.status==="cancelado"?"Retomar":"Iniciar"]}),s&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{onClick:()=>r("pausar"),className:"px-5 py-2.5 text-sm font-medium text-amber-700 bg-amber-50 border border-amber-200 rounded-lg hover:bg-amber-100",children:[u.jsx("i",{className:"fas fa-pause mr-2"})," Pausar"]}),u.jsxs("button",{onClick:()=>r("parar"),className:"px-5 py-2.5 text-sm font-medium text-red-700 bg-red-50 border border-red-200 rounded-lg hover:bg-red-100",children:[u.jsx("i",{className:"fas fa-stop mr-2"})," Parar"]})]}),u.jsxs("button",{onClick:n,className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium ml-auto",children:[u.jsx("i",{className:W("fas fa-chevron-down mr-1 transition-transform",t&&"rotate-180")}),t?"Ocultar detalhes":"Ver detalhes"]})]}),((f=e.upload)==null?void 0:f.url)&&u.jsxs("div",{className:"text-xs bg-indigo-50 border border-indigo-100 rounded-lg px-3 py-2 text-indigo-700 flex items-center gap-2 flex-wrap",children:[u.jsx("i",{className:"fab fa-youtube"}),e.upload.publicado_em?u.jsxs("span",{children:["Vídeo público desde ",sh(e.upload.publicado_em)," — "]}):e.upload.agenda_publicacao?u.jsxs("span",{children:["Não listado; publicação automática às ",sh(e.upload.agenda_publicacao)," — "]}):u.jsx("span",{children:"Enviado — "}),e.upload.url,e.upload.ultimo_erro&&u.jsxs("span",{className:"text-red-600",children:["· último erro: ",e.upload.ultimo_erro]})]}),t&&u.jsxs("div",{className:"space-y-4 border-t border-gray-100 pt-4",children:[e.etapas.map(h=>u.jsxs("div",{className:"text-xs",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("p",{className:"font-semibold text-gray-700 flex items-center gap-2",children:[u.jsx("i",{className:Mp[h.id]})," ",h.nome]}),u.jsx(yt,{status:h.status})]}),h.mensagem&&u.jsx("p",{className:"text-gray-500 mt-1 ml-5",children:h.mensagem}),h.logs.length>0&&u.jsx("pre",{className:"ml-5 mt-1 bg-gray-50 border border-gray-100 rounded-lg p-2 text-[11px] text-gray-500 whitespace-pre-wrap max-h-40 overflow-y-auto",children:h.logs.join(`
89
- `)})]},h.id)),e.dados.roteiro&&u.jsxs(Ie,{titulo:`Roteiro (${(p=e.dados.roteiro_chars)==null?void 0:p.toLocaleString("pt-BR")} caracteres)`,icone:"fas fa-file-lines",children:[u.jsxs("pre",{className:"text-[11px] text-gray-600 whitespace-pre-wrap max-h-60 overflow-y-auto bg-gray-50 rounded-lg p-3",children:[e.dados.roteiro.slice(0,2500),e.dados.roteiro_chars&&e.dados.roteiro_chars>2500?`
90
-
91
- [...]`:""]}),u.jsxs("p",{className:"text-[11px] text-gray-400",children:["Arquivo local: ",e.dados.arquivo_roteiro]})]}),(e.dados.thumbnail_prompt||e.dados.titulo_alternativo)&&u.jsxs(Ie,{titulo:"Título e thumbnail gerados",icone:"fas fa-image",children:[u.jsxs("p",{className:"text-gray-600",children:[u.jsx("strong",{children:"Título alternativo:"})," ",e.dados.titulo_alternativo]}),u.jsxs("p",{className:"text-gray-600",children:[u.jsx("strong",{children:"Prompt da thumbnail:"})," ",e.dados.thumbnail_prompt]})]}),e.dados.videos_wide&&e.dados.videos_wide.length>0&&u.jsxs("p",{className:"text-xs text-gray-500",children:[u.jsx("i",{className:"fas fa-film text-gray-400 mr-1"})," Vídeo(s) wide: ",e.dados.videos_wide.join(", ")]}),a===e.etapas.length&&e.status==="concluido"&&u.jsxs("p",{className:"text-xs text-green-600 font-medium",children:[u.jsx("i",{className:"fas fa-circle-check mr-1"})," Todas as ",e.etapas.length," etapas finalizadas."]})]})]})}function dj(){const[e,t]=ox(),n=e.get("tab")||"disparo";return u.jsxs("div",{className:"space-y-6",children:[u.jsx("div",{className:"flex gap-2",children:[{id:"disparo",rotulo:"Agente de Disparo",icone:"fas fa-paper-plane"},{id:"atendimento",rotulo:"Agente de Atendimento",icone:"fas fa-headset"}].map(r=>u.jsxs("button",{onClick:()=>t({tab:r.id}),className:W("px-5 py-2.5 text-sm font-medium rounded-lg transition",n===r.id?"bg-[#1e1b4b] text-white shadow-sm":"bg-white text-gray-600 border border-gray-200 hover:bg-gray-50"),children:[u.jsx("i",{className:W(r.icone,"mr-2")}),r.rotulo]},r.id))}),n==="disparo"?u.jsx(fj,{}):u.jsx(hj,{})]})}function fj(){const{toast:e}=St(),[t,n]=b.useState({texto:"",audio:""}),[r,s]=b.useState("LeadMaster"),[i,o]=b.useState(""),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[f,p]=b.useState(null),h=b.useCallback(async()=>{const[w,v]=await Promise.all([z.agentes.templates(),z.config.obter()]);n({texto:w.texto??"",audio:w.audio??""}),s(v.agentes.disparo.minha_empresa??"LeadMaster"),p(v.integracoes.openoutreach)},[]);b.useEffect(()=>{h().catch(w=>e("erro",w.message))},[h,e]);const g=async()=>{d(!0);try{await z.agentes.salvarTemplates(t),await z.config.salvar({agentes:{disparo:{templates:t,minha_empresa:r}}}),e("sucesso","Templates do agente de disparo salvos."),await h()}catch(w){e("erro",w instanceof Error?w.message:"Falha ao salvar templates.")}finally{d(!1)}},x=async()=>{try{const w=await z.agentes.testarTemplate(t.texto);o(w.renderizado),l(!0)}catch(w){e("erro",w instanceof Error?w.message:"Falha ao renderizar template.")}};return u.jsxs("div",{className:"space-y-5 max-w-3xl",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-800",children:"Templates de mensagem"}),u.jsx(yt,{status:f!=null&&f.url&&f.enabled!==!1?"ativo":"inativo",rotulo:f!=null&&f.url&&f.enabled!==!1?"OpenOutreach configurado":"OpenOutreach não configurado"})]}),u.jsxs("p",{className:"text-xs text-gray-500",children:["Variáveis disponíveis: ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"{{nome}}"}),","," ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"{{primeiro_nome}}"}),","," ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"{{empresa}}"}),","," ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"{{cidade}}"}),","," ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"{{minha_empresa}}"}),"."]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Template — texto"}),u.jsx("textarea",{value:t.texto,onChange:w=>n({...t,texto:w.target.value}),rows:4,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Template — áudio (roteiro de gravação)"}),u.jsx("textarea",{value:t.audio,onChange:w=>n({...t,audio:w.target.value}),rows:4,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Nome da sua empresa"}),u.jsx("input",{value:r,onChange:w=>s(w.target.value),className:"w-full max-w-xs px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("button",{onClick:g,disabled:c,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 disabled:opacity-60",children:[u.jsx("i",{className:"fas fa-save mr-2"})," Salvar templates"]}),u.jsxs("button",{onClick:x,className:"px-4 py-2.5 text-sm font-medium text-indigo-600 bg-indigo-50 border border-indigo-200 rounded-lg hover:bg-indigo-100",children:[u.jsx("i",{className:"fas fa-vial mr-2"})," Testar com lead de exemplo"]})]})]}),u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 text-sm text-gray-500 space-y-2",children:[u.jsx("p",{className:"font-medium text-gray-700 text-xs uppercase tracking-wide",children:"Como funciona"}),u.jsxs("p",{children:["O envio em massa é executado pelo ",u.jsx("strong",{children:"OpenOutreach"})," (eracle/OpenOutreach). As campanhas ficam na página ",u.jsx("strong",{children:"Disparos"}),"; a validação da integração acontece na hora de iniciar a campanha — sem travas de pré-registro."]})]}),u.jsx(Ot,{aberto:a,onFechar:()=>l(!1),titulo:"Pré-visualização do template",icone:"fas fa-comment-dots",children:u.jsx("div",{className:"bg-gray-50 border border-gray-100 rounded-lg p-4 text-sm text-gray-700 whitespace-pre-wrap",children:i})})]})}function hj(){const{toast:e}=St(),[t,n]=b.useState("texto"),[r,s]=b.useState(""),[i,o]=b.useState([{role:"assistant",content:"Olá! Sou o assistente de atendimento do LeadMaster. Como posso ajudar?"}]),[a,l]=b.useState(""),[c,d]=b.useState(!1),f=b.useCallback(async()=>{const g=await z.config.obter();n(g.agentes.atendimento.modo==="voz"?"voz":"texto"),s(g.integracoes.pipecat.url||"")},[]);b.useEffect(()=>{f().catch(g=>e("erro",g.message))},[f,e]);const p=async g=>{n(g);try{await z.config.salvar({agentes:{atendimento:{modo:g}},integracoes:{pipecat:{url:r}}}),e("sucesso",`Modo de atendimento: ${g==="voz"?"voz (pipecat)":"texto (LLM)"}.`)}catch(x){e("erro",x instanceof Error?x.message:"Falha ao salvar modo.")}},h=async()=>{const g=a.trim();if(!g)return;const x=[...i,{role:"user",content:g}];o(x),l(""),d(!0);try{const w=await z.agentes.chat(x.map(v=>({role:v.role==="assistant"?"assistant":"user",content:v.content})));w.ok&&w.resposta?o([...x,{role:"assistant",content:w.resposta}]):(o([...x,{role:"assistant",content:`⚠ ${w.mensagem??"Sem resposta."}`}]),e("erro",w.mensagem??"Sem resposta do agente."))}catch(w){e("erro",w instanceof Error?w.message:"Falha no chat.")}finally{d(!1)}};return u.jsxs("div",{className:"space-y-5 max-w-3xl",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-800",children:"Modo do agente de atendimento"}),u.jsx("div",{className:"flex gap-3",children:[{id:"texto",rotulo:"Texto (LLM)",icone:"fas fa-keyboard",descricao:"Chat via LLM configurado"},{id:"voz",rotulo:"Voz (pipecat)",icone:"fas fa-microphone",descricao:"Atendimento por voz"}].map(g=>u.jsxs("button",{onClick:()=>p(g.id),className:W("flex-1 px-4 py-3 rounded-lg border text-left transition",t===g.id?"bg-indigo-50 border-indigo-400":"bg-white border-gray-200 hover:bg-gray-50"),children:[u.jsxs("p",{className:W("text-sm font-medium flex items-center gap-2",t===g.id?"text-indigo-700":"text-gray-600"),children:[u.jsx("i",{className:g.icone})," ",g.rotulo]}),u.jsx("p",{className:"text-xs text-gray-400 mt-1",children:g.descricao})]},g.id))}),t==="voz"&&u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"URL do serviço pipecat"}),u.jsx("input",{value:r,onChange:g=>s(g.target.value),onBlur:()=>p("voz"),placeholder:"http://localhost:5000",className:"w-full max-w-md px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})]}),u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6",children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-3",children:"Testar conversa"}),u.jsxs("div",{className:"space-y-3 max-h-80 overflow-y-auto mb-4",children:[i.map((g,x)=>u.jsx("div",{className:W("flex",g.role==="user"?"justify-end":"justify-start"),children:u.jsx("div",{className:W("max-w-[80%] px-4 py-2.5 rounded-2xl text-sm",g.role==="user"?"bg-indigo-500 text-white rounded-br-sm":"bg-gray-100 text-gray-700 rounded-bl-sm"),children:g.content})},x)),c&&u.jsxs("div",{className:"text-xs text-gray-400 flex items-center gap-2",children:[u.jsx("i",{className:"fas fa-spinner fa-spin"})," pensando..."]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{value:a,onChange:g=>l(g.target.value),onKeyDown:g=>g.key==="Enter"&&h(),placeholder:"Digite uma mensagem do cliente para testar...",className:"flex-1 px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"}),u.jsx("button",{onClick:h,disabled:c,className:"px-5 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 disabled:opacity-60",children:u.jsx("i",{className:"fas fa-paper-plane"})})]})]})]})}function pj({onConfigSalva:e}){const{toast:t}=St(),[n,r]=b.useState(null),[s,i]=b.useState(!1),[o,a]=b.useState(""),l=b.useCallback(async()=>{const h=await z.config.obter();r(h)},[]);if(b.useEffect(()=>{l().catch(h=>t("erro",h.message))},[l,t]),!n)return u.jsx("div",{className:"text-center text-gray-400 py-16",children:u.jsx("i",{className:"fas fa-spinner fa-spin text-2xl"})});const c=h=>{r(g=>{if(!g)return g;const x=JSON.parse(JSON.stringify(g));return h(x),x})},d=async()=>{i(!0);try{const h=await z.config.salvar(n);r(h),e==null||e(h),t("sucesso","Configurações salvas localmente (config.json).")}catch(h){t("erro",h instanceof Error?h.message:"Falha ao salvar configurações.")}finally{i(!1)}},f=async()=>{a("llm");try{const h=await z.config.testarLlm();t(h.ok?"sucesso":"erro",h.ok?`LLM respondeu: ${h.resposta}`:h.mensagem??"Falha no teste.")}finally{a("")}},p=async(h,g)=>{if(!g){t("erro","Informe a URL antes de testar.");return}a(h);try{const x=await z.config.testarIntegracao(g);t(x.ok?"sucesso":"erro",x.ok?`${h} respondeu (HTTP ${x.status_http}).`:x.mensagem??"Sem resposta.")}finally{a("")}};return u.jsxs("div",{className:"space-y-6 max-w-4xl",children:[u.jsxs(Rr,{titulo:"LLM (roteiros e agentes)",icone:"fas fa-brain",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsx(Be,{rotulo:"Base URL",valor:n.llm.base_url,onChange:h=>c(g=>{g.llm.base_url=h}),placeholder:"https://api.openai.com/v1"}),u.jsx(Be,{rotulo:"Modelo",valor:n.llm.modelo,onChange:h=>c(g=>{g.llm.modelo=h}),placeholder:"gpt-4o-mini"}),u.jsx(Pp,{rotulo:"API Key",configurado:!!n.llm.api_key_configurado,onChange:h=>c(g=>{g.llm.api_key=h})})]}),u.jsx(Co,{rotulo:"Testar conexão LLM",carregando:o==="llm",onClick:f})]}),u.jsxs(Rr,{titulo:"Produção de vídeos",icone:"fas fa-film",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx(Be,{rotulo:"MoneyPrinterTurbo — URL",valor:n.integracoes.moneyprinter.url,onChange:h=>c(g=>{g.integracoes.moneyprinter.url=h}),placeholder:"http://localhost:8080"}),u.jsx(Be,{rotulo:"Short-Video-Maker — URL",valor:n.integracoes.short_video_maker.url,onChange:h=>c(g=>{g.integracoes.short_video_maker.url=h}),placeholder:"http://localhost:3123"})]}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx(Co,{rotulo:"Testar MoneyPrinterTurbo",carregando:o==="mp",onClick:()=>p("MoneyPrinterTurbo",n.integracoes.moneyprinter.url)}),u.jsx(Co,{rotulo:"Testar Short-Video-Maker",carregando:o==="svm",onClick:()=>p("Short-Video-Maker",n.integracoes.short_video_maker.url)})]}),u.jsx(Ie,{titulo:"OpenMontage (fallback de produção)",icone:"fas fa-clapperboard",children:u.jsx(Be,{rotulo:"Caminho do CLI OpenMontage",valor:n.integracoes.openmontage.cli_path,onChange:h=>c(g=>{g.integracoes.openmontage.cli_path=h}),placeholder:"C:\\ferramentas\\openmontage\\openmontage.exe"})})]}),u.jsxs(Rr,{titulo:"Upload YouTube",icone:"fab fa-youtube",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx(Be,{rotulo:"Uploader — URL (YouTube-Video-Upload-Frontend-Api)",valor:n.integracoes.youtube_upload.url,onChange:h=>c(g=>{g.integracoes.youtube_upload.url=h}),placeholder:"http://localhost:3000"}),u.jsx(Pp,{rotulo:"Uploader — API Key",configurado:!!n.integracoes.youtube_upload.api_key_configurado,onChange:h=>c(g=>{g.integracoes.youtube_upload.api_key=h})})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-600 bg-indigo-50 border border-indigo-100 rounded-lg px-3 py-2.5 cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:n.integracoes.youtube_upload.modo==="nao_listado_1h_publico",onChange:h=>c(g=>{g.integracoes.youtube_upload.modo=h.target.checked?"nao_listado_1h_publico":"direto_publico"}),className:"w-4 h-4 accent-indigo-500"}),"Não listado → 1h → público"]}),u.jsx(tc,{rotulo:"Limite diário",valor:n.integracoes.youtube_upload.limite_diario,onChange:h=>c(g=>{g.integracoes.youtube_upload.limite_diario=h})}),u.jsx(tc,{rotulo:"Espera p/ publicar (horas)",valor:n.integracoes.youtube_upload.espera_publicacao_horas,onChange:h=>c(g=>{g.integracoes.youtube_upload.espera_publicacao_horas=h})})]}),u.jsx(Co,{rotulo:"Testar uploader",carregando:o==="up",onClick:()=>p("Uploader",n.integracoes.youtube_upload.url)}),u.jsx(Ie,{titulo:"Fallback: youtube-uploader-mcp",icone:"fas fa-shuffle",children:u.jsx(Be,{rotulo:"Caminho do youtube-uploader-mcp",valor:n.integracoes.youtube_upload.uploader_mcp_path,onChange:h=>c(g=>{g.integracoes.youtube_upload.uploader_mcp_path=h}),placeholder:"Caminho do CLI (fallback)"})})]}),u.jsxs(Rr,{titulo:"Extratores de leads",icone:"fas fa-magnifying-glass-location",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx(Be,{rotulo:"Google Maps Scraper — binário",valor:n.extratores.google_maps_cli,onChange:h=>c(g=>{g.extratores.google_maps_cli=h}),placeholder:"C:\\ferramentas\\google-maps-scraper.exe"}),u.jsx(Be,{rotulo:"igmapper — binário",valor:n.extratores.igmapper_cli,onChange:h=>c(g=>{g.extratores.igmapper_cli=h}),placeholder:"Caminho do CLI igmapper"})]}),u.jsxs(Ie,{titulo:"Argumentos dos scrapers (templates)",icone:"fas fa-terminal",children:[u.jsx(Rp,{rotulo:"Google Maps — template de argumentos",valor:n.extratores.google_maps_args,onChange:h=>c(g=>{g.extratores.google_maps_args=h}),linhas:2}),u.jsx(Rp,{rotulo:"igmapper — template de argumentos",valor:n.extratores.igmapper_args,onChange:h=>c(g=>{g.extratores.igmapper_args=h}),linhas:2})]}),u.jsxs(Ie,{titulo:"CNPJ e Scrapling",icone:"fas fa-building",children:[u.jsx(Be,{rotulo:"Provedor de busca CNAE/UF — URL",valor:n.extratores.cnpj_provedor_busca,onChange:h=>c(g=>{g.extratores.cnpj_provedor_busca=h}),placeholder:"https://api.opencnpj.org"}),u.jsx(Be,{rotulo:"Scrapling — binário (scraping profundo)",valor:n.extratores.scrapling_cli,onChange:h=>c(g=>{g.extratores.scrapling_cli=h}),placeholder:"Caminho do CLI Scrapling"})]})]}),u.jsxs(Rr,{titulo:"Agentes — integrações",icone:"fas fa-robot",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx(Be,{rotulo:"OpenOutreach — URL",valor:n.integracoes.openoutreach.url,onChange:h=>c(g=>{g.integracoes.openoutreach.url=h}),placeholder:"http://localhost:9090"}),u.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-600 bg-indigo-50 border border-indigo-100 rounded-lg px-3 py-2.5 cursor-pointer h-fit mt-5",children:[u.jsx("input",{type:"checkbox",checked:n.integracoes.openoutreach.enabled,onChange:h=>c(g=>{g.integracoes.openoutreach.enabled=h.target.checked}),className:"w-4 h-4 accent-indigo-500"}),"OpenOutreach ativo"]})]}),u.jsx(Be,{rotulo:"pipecat — URL (atendimento por voz)",valor:n.integracoes.pipecat.url,onChange:h=>c(g=>{g.integracoes.pipecat.url=h}),placeholder:"http://localhost:5000"})]}),u.jsx(Rr,{titulo:"Perfil e licença",icone:"fas fa-user",children:u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsx(Be,{rotulo:"Seu nome",valor:n.perfil.nome,onChange:h=>c(g=>{g.perfil.nome=h})}),u.jsx(Be,{rotulo:"Expira em",valor:n.perfil.licenca.expira_em,onChange:h=>c(g=>{g.perfil.licenca.expira_em=h})}),u.jsx(tc,{rotulo:"Dias restantes (vazio = infinito)",valor:n.perfil.licenca.restam_dias??0,onChange:h=>c(g=>{g.perfil.licenca.restam_dias=h>0?h:null})})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsxs("button",{onClick:d,disabled:s,className:"px-8 py-3 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition disabled:opacity-60 shadow-sm",children:[u.jsx("i",{className:W("fas fa-save mr-2",s&&"fa-spin")}),s?"Salvando...":"Salvar configurações"]})})]})}function Rr({titulo:e,icone:t,children:n}){return u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsxs("h3",{className:"text-sm font-semibold text-gray-800 flex items-center gap-2",children:[u.jsx("i",{className:W(t,"text-indigo-400")})," ",e]}),n]})}function Be({rotulo:e,valor:t,onChange:n,placeholder:r,tipo:s="text"}){return u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:e}),u.jsx("input",{type:s,value:t,onChange:i=>n(i.target.value),placeholder:r,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}function tc({rotulo:e,valor:t,onChange:n}){return u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:e}),u.jsx("input",{type:"number",value:t??0,onChange:r=>n(Number(r.target.value)||0),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}function Pp({rotulo:e,configurado:t,onChange:n}){return u.jsxs("div",{children:[u.jsxs("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:[e," ",t&&u.jsx("span",{className:"text-green-600",children:"• configurado"})]}),u.jsx("input",{type:"password",onChange:r=>n(r.target.value),placeholder:t?"•••••••• (deixe vazio para manter)":"cole a chave aqui",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}function Rp({rotulo:e,valor:t,onChange:n,linhas:r=3}){return u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:e}),u.jsx("textarea",{value:t,onChange:s=>n(s.target.value),rows:r,className:"w-full px-3 py-2 text-xs font-mono border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}function Co({rotulo:e,onClick:t,carregando:n}){return u.jsxs("button",{onClick:t,disabled:n,className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium disabled:opacity-50",children:[u.jsx("i",{className:W("fas fa-vial-circle-check mr-1",n&&"fa-spin")})," ",e]})}const gj=[{id:"lead.criado",rotulo:"Lead criado"},{id:"lead.etapa",rotulo:"Lead mudou de etapa"},{id:"campanha.concluida",rotulo:"Campanha concluída"},{id:"video.publicado",rotulo:"Vídeo publicado"}];function mj(){const{toast:e}=St(),[t,n]=b.useState(""),[r,s]=b.useState(new Set),[i,o]=b.useState(""),[a,l]=b.useState(!1),[c,d]=b.useState(!1),f=b.useCallback(async()=>{const x=await z.webhook.obter();n(x.url),s(new Set(x.eventos))},[]);b.useEffect(()=>{f().catch(x=>e("erro",x.message))},[f,e]);const p=x=>s(w=>{const v=new Set(w);return v.has(x)?v.delete(x):v.add(x),v}),h=async()=>{d(!0);try{await z.webhook.salvar({url:t.trim(),eventos:[...r]}),e("sucesso","Webhook salvo.")}catch(x){e("erro",x instanceof Error?x.message:"Falha ao salvar webhook.")}finally{d(!1)}},g=async()=>{if(!t.trim()){e("erro","Informe a URL do webhook antes de testar.");return}try{const x=await z.webhook.testar(t.trim());x.ok?o(`✅ HTTP ${x.status_http} — o endpoint recebeu o evento de teste.
92
-
93
- ${x.resposta??""}`):o(`❌ ${x.mensagem??"Falha no teste."}`),l(!0)}catch(x){e("erro",x instanceof Error?x.message:"Falha no teste.")}};return u.jsxs("div",{className:"space-y-6 max-w-3xl",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-5",children:[u.jsx("p",{className:"text-sm text-gray-500",children:"Receba eventos do LeadMaster (lead criado, mudança de etapa, campanha concluída, vídeo publicado) em qualquer endpoint local ou externo — útil para integrar com automações (n8n, Make, Zapier etc.)."}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"URL do webhook"}),u.jsx("input",{value:t,onChange:x=>n(x.target.value),placeholder:"https://seu-endpoint.com/webhook",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-2",children:"Eventos enviados"}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:gj.map(x=>u.jsxs("label",{className:W("flex items-center gap-3 px-4 py-3 rounded-lg border text-sm cursor-pointer transition",r.has(x.id)?"bg-indigo-50 border-indigo-300 text-indigo-700":"bg-white border-gray-200 text-gray-500 hover:bg-gray-50"),children:[u.jsx("input",{type:"checkbox",checked:r.has(x.id),onChange:()=>p(x.id),className:"w-4 h-4 accent-indigo-500"}),x.rotulo,u.jsx("code",{className:"text-[10px] text-gray-400 ml-auto",children:x.id})]},x.id))})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("button",{onClick:h,disabled:c,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 disabled:opacity-60",children:[u.jsx("i",{className:"fas fa-save mr-2"})," Salvar"]}),u.jsxs("button",{onClick:g,className:"px-4 py-2.5 text-sm font-medium text-indigo-600 bg-indigo-50 border border-indigo-200 rounded-lg hover:bg-indigo-100",children:[u.jsx("i",{className:"fas fa-paper-plane mr-2"})," Enviar evento de teste"]})]})]}),u.jsx(Ot,{aberto:a,onFechar:()=>l(!1),titulo:"Resultado do teste",icone:"fas fa-satellite-dish",children:u.jsx("pre",{className:"text-xs text-gray-600 bg-gray-50 rounded-lg p-4 whitespace-pre-wrap",children:i})})]})}function xj(){const{toast:e}=St(),[t,n]=b.useState(null),[r,s]=b.useState(!1),i=async()=>{s(!0);try{n(await z.doctor()),e("sucesso","Diagnóstico concluído.")}catch(o){e("erro",o instanceof Error?o.message:"Falha no diagnóstico.")}finally{s(!1)}};return b.useEffect(()=>{i()},[]),u.jsxs("div",{className:"space-y-6 max-w-3xl",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("h3",{className:"text-sm font-semibold text-gray-800 flex items-center gap-2",children:[u.jsx("i",{className:"fas fa-heart-pulse text-indigo-400"})," Diagnóstico do ambiente"]}),u.jsxs("button",{onClick:i,disabled:r,className:"px-4 py-2 text-xs font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 disabled:opacity-60",children:[u.jsx("i",{className:W("fas fa-rotate mr-1",r&&"fa-spin")})," Executar novamente"]})]}),t&&u.jsxs("div",{className:"mt-4 space-y-2 text-sm",children:[u.jsx(Tr,{rotulo:"Versão do LeadMaster",valor:t.versao}),u.jsx(Tr,{rotulo:"Python",valor:t.python}),u.jsx(Tr,{rotulo:"Sistema",valor:t.sistema}),u.jsx(Tr,{rotulo:"Interface construída (dist)",valor:t.dist_frontend?"presente":"ausente (modo dev)"}),u.jsx(Tr,{rotulo:"Uploads hoje",valor:String(t.uploads_hoje)}),u.jsx(Tr,{rotulo:"Pasta de dados",valor:t.storage}),u.jsx("div",{className:"pt-2 flex flex-wrap gap-2",children:Object.entries(t.integracoes).map(([o,a])=>u.jsx(yt,{status:a?"ativo":"inativo",rotulo:`${vj(o)}: ${a?"ativo":"inativo"}`},o))})]})]}),u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6",children:[u.jsxs("h3",{className:"text-sm font-semibold text-gray-800 mb-3",children:[u.jsx("i",{className:"fas fa-circle-question text-indigo-400 mr-2"})," Perguntas frequentes"]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ie,{titulo:"Meus dados ficam na nuvem?",icone:"fas fa-cloud",children:"Não. O LeadMaster é 100% local: todos os dados (leads, campanhas, pipeline, configuração) ficam em arquivos JSON na sua pasta de dados."}),u.jsx(Ie,{titulo:"Preciso de servidor para os vídeos?",icone:"fas fa-video",children:"Sim, localmente: o MoneyPrinterTurbo (porta 8080) produz os vídeos wide e o Short-Video-Maker (porta 3123) os Shorts. Configure as URLs em Ferramentas."}),u.jsxs(Ie,{titulo:"Como publico no YouTube?",icone:"fab fa-youtube",children:["Configure o uploader em Ferramentas → Upload YouTube (ou o fallback youtube-uploader-mcp). O pipeline publica como ",u.jsx("strong",{children:"não listado"})," e vira ",u.jsx("strong",{children:"público"})," automaticamente após 1 hora — até 50 uploads por dia."]}),u.jsx(Ie,{titulo:"Onde reporto problemas?",icone:"fas fa-bug",children:"Abra uma issue em github.com/DanHachuel/LeadMaster ou use a página de diagnóstico acima ao pedir ajuda — ela resume todo o ambiente."})]})]}),u.jsxs("div",{className:"bg-[#1e1b4b] text-white rounded-xl p-6 flex items-center justify-between flex-wrap gap-4",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-semibold",children:"LeadMaster — SaaS local de prospecção e automação de conteúdo"}),u.jsx("p",{className:"text-xs text-gray-300 mt-1",children:"Instalável via npx · dados 100% locais · sem mensalidade de nuvem"})]}),u.jsxs("a",{href:"https://github.com/DanHachuel/LeadMaster",target:"_blank",rel:"noreferrer",className:"px-4 py-2.5 text-sm font-medium bg-white/10 hover:bg-white/20 rounded-lg transition",children:[u.jsx("i",{className:"fab fa-github mr-2"})," Repositório"]})]})]})}function Tr({rotulo:e,valor:t}){return u.jsxs("div",{className:"flex items-center justify-between border-b border-gray-50 pb-2",children:[u.jsx("span",{className:"text-xs text-gray-500",children:e}),u.jsx("span",{className:"text-xs font-medium text-gray-700 text-right break-all max-w-[60%]",children:t})]})}function vj(e){return{moneyprinter:"MoneyPrinterTurbo",short_video_maker:"Short-Video-Maker",uploader_youtube:"Uploader YouTube",llm_configurado:"LLM",openmontage:"OpenMontage",openoutreach:"OpenOutreach"}[e]??e}const yj={"/":"Painel","/leads":"Leads","/agentes":"Agentes","/ferramentas":"Ferramentas","/extratores":"Extratores de Leads","/disparos":"Disparos","/crm":"CRM — Kanban","/pipeline":"Pipeline de Vídeos Faceless","/webhook":"Webhook","/suporte":"Suporte"};function bj(){const[e,t]=b.useState(null),[n,r]=b.useState(!1),[s,i]=b.useState(!1),o=b.useCallback(async()=>{try{t(await z.config.obter())}catch{}},[]);return b.useEffect(()=>{o()},[o]),s?u.jsx("div",{className:"min-h-screen bg-[#1e1b4b] text-white flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-md",children:[u.jsx("i",{className:"fas fa-power-off text-4xl text-indigo-300 mb-4 block"}),u.jsx("h1",{className:"text-xl font-bold",children:"LeadMaster encerrado"}),u.jsx("p",{className:"text-sm text-gray-300 mt-3",children:"O servidor local foi desligado com sucesso. Seus dados estão salvos na pasta de dados."}),u.jsxs("p",{className:"text-xs text-gray-400 mt-6",children:["Para voltar, execute: ",u.jsx("code",{className:"bg-white/10 px-2 py-1 rounded",children:"npx --yes @danhachuel/leadmaster"})]})]})}):u.jsx(xw,{children:u.jsxs(qb,{children:[u.jsx(wj,{nomeUsuario:(e==null?void 0:e.perfil.nome)??"...",onSair:()=>r(!0),onConfigSalva:a=>t(a)}),u.jsxs(Ot,{aberto:n,onFechar:()=>r(!1),titulo:"Encerrar o LeadMaster",icone:"fas fa-power-off",children:[u.jsx("p",{className:"text-sm text-gray-600",children:"Isso encerra o servidor local (os processos do terminal também fecham). Seus dados permanecem salvos nos arquivos JSON da pasta de dados. Deseja continuar?"}),u.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[u.jsx("button",{onClick:()=>r(!1),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50",children:"Cancelar"}),u.jsxs("button",{onClick:async()=>{r(!1);try{await z.shutdown()}catch{}setTimeout(()=>i(!0),400)},className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:[u.jsx("i",{className:"fas fa-power-off mr-2"})," Encerrar"]})]})]})]})})}function wj({nomeUsuario:e,onSair:t,onConfigSalva:n}){const r=Gn(),s=yj[r.pathname]??"LeadMaster";return u.jsxs("div",{className:"bg-gray-100 min-h-screen flex",children:[u.jsx(pw,{onSair:t}),u.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[u.jsx(fw,{titulo:s,nomeUsuario:e}),u.jsxs("div",{className:"p-8 space-y-6 overflow-y-auto flex-1",children:[u.jsxs(Wb,{children:[u.jsx(jt,{path:"/",element:u.jsx(fk,{nomeUsuario:e})}),u.jsx(jt,{path:"/leads",element:u.jsx(xk,{})}),u.jsx(jt,{path:"/crm",element:u.jsx(ZC,{})}),u.jsx(jt,{path:"/disparos",element:u.jsx(ej,{})}),u.jsx(jt,{path:"/extratores",element:u.jsx(rj,{})}),u.jsx(jt,{path:"/pipeline",element:u.jsx(cj,{})}),u.jsx(jt,{path:"/agentes",element:u.jsx(dj,{})}),u.jsx(jt,{path:"/ferramentas",element:u.jsx(pj,{onConfigSalva:n})}),u.jsx(jt,{path:"/webhook",element:u.jsx(mj,{})}),u.jsx(jt,{path:"/suporte",element:u.jsx(xj,{})})]}),u.jsxs("footer",{className:"flex items-center justify-between text-xs text-gray-400 pt-4 border-t border-gray-200",children:[u.jsx("span",{children:"© 2026 LeadMaster. Todos os direitos reservados."}),u.jsx("span",{children:"Dados 100% locais — sem nuvem"})]})]})]})]})}nc.createRoot(document.getElementById("root")).render(u.jsx(fe.StrictMode,{children:u.jsx(bj,{})}));