Files
GreenHomeBack/src/GreenHome.Api/wwwroot/assets/index-BNRf8j5s.js

418 lines
619 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var RS=Object.defineProperty;var OS=(n,t,a)=>t in n?RS(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a;var _e=(n,t,a)=>OS(n,typeof t!="symbol"?t+"":t,a);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function a(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(l){if(l.ep)return;l.ep=!0;const o=a(l);fetch(l.href,o)}})();function ly(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sf={exports:{}},Al={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Bp;function LS(){if(Bp)return Al;Bp=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(s,l,o){var u=null;if(o!==void 0&&(u=""+o),l.key!==void 0&&(u=""+l.key),"key"in l){o={};for(var d in l)d!=="key"&&(o[d]=l[d])}else o=l;return l=o.ref,{$$typeof:n,type:s,key:u,ref:l!==void 0?l:null,props:o}}return Al.Fragment=t,Al.jsx=a,Al.jsxs=a,Al}var Up;function HS(){return Up||(Up=1,sf.exports=LS()),sf.exports}var h=HS(),lf={exports:{}},be={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var $p;function BS(){if($p)return be;$p=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),v=Symbol.iterator;function _(O){return O===null||typeof O!="object"?null:(O=v&&O[v]||O["@@iterator"],typeof O=="function"?O:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,S={};function N(O,I,W){this.props=O,this.context=I,this.refs=S,this.updater=W||M}N.prototype.isReactComponent={},N.prototype.setState=function(O,I){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,I,"setState")},N.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function C(){}C.prototype=N.prototype;function k(O,I,W){this.props=O,this.context=I,this.refs=S,this.updater=W||M}var E=k.prototype=new C;E.constructor=k,j(E,N.prototype),E.isPureReactComponent=!0;var A=Array.isArray;function z(){}var L={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function X(O,I,W){var ee=W.ref;return{$$typeof:n,type:O,key:I,ref:ee!==void 0?ee:null,props:W}}function de(O,I){return X(O.type,I,O.props)}function Q(O){return typeof O=="object"&&O!==null&&O.$$typeof===n}function ae(O){var I={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(W){return I[W]})}var Ee=/\/+/g;function Oe(O,I){return typeof O=="object"&&O!==null&&O.key!=null?ae(""+O.key):I.toString(36)}function he(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(z,z):(O.status="pending",O.then(function(I){O.status==="pending"&&(O.status="fulfilled",O.value=I)},function(I){O.status==="pending"&&(O.status="rejected",O.reason=I)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function U(O,I,W,ee,ne){var le=typeof O;(le==="undefined"||le==="boolean")&&(O=null);var ge=!1;if(O===null)ge=!0;else switch(le){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(O.$$typeof){case n:case t:ge=!0;break;case x:return ge=O._init,U(ge(O._payload),I,W,ee,ne)}}if(ge)return ne=ne(O),ge=ee===""?"."+Oe(O,0):ee,A(ne)?(W="",ge!=null&&(W=ge.replace(Ee,"$&/")+"/"),U(ne,I,W,"",function(kn){return kn})):ne!=null&&(Q(ne)&&(ne=de(ne,W+(ne.key==null||O&&O.key===ne.key?"":(""+ne.key).replace(Ee,"$&/")+"/")+ge)),I.push(ne)),1;ge=0;var rt=ee===""?".":ee+":";if(A(O))for(var ye=0;ye<O.length;ye++)ee=O[ye],le=rt+Oe(ee,ye),ge+=U(ee,I,W,le,ne);else if(ye=_(O),typeof ye=="function")for(O=ye.call(O),ye=0;!(ee=O.next()).done;)ee=ee.value,le=rt+Oe(ee,ye++),ge+=U(ee,I,W,le,ne);else if(le==="object"){if(typeof O.then=="function")return U(he(O),I,W,ee,ne);throw I=String(O),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return ge}function K(O,I,W){if(O==null)return O;var ee=[],ne=0;return U(O,ee,"","",function(le){return I.call(W,le,ne++)}),ee}function fe(O){if(O._status===-1){var I=O._result;I=I(),I.then(function(W){(O._status===0||O._status===-1)&&(O._status=1,O._result=W)},function(W){(O._status===0||O._status===-1)&&(O._status=2,O._result=W)}),O._status===-1&&(O._status=0,O._result=I)}if(O._status===1)return O._result.default;throw O._result}var we=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},P={map:K,forEach:function(O,I,W){K(O,function(){I.apply(this,arguments)},W)},count:function(O){var I=0;return K(O,function(){I++}),I},toArray:function(O){return K(O,function(I){return I})||[]},only:function(O){if(!Q(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return be.Activity=b,be.Children=P,be.Component=N,be.Fragment=a,be.Profiler=l,be.PureComponent=k,be.StrictMode=s,be.Suspense=f,be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,be.__COMPILER_RUNTIME={__proto__:null,c:function(O){return L.H.useMemoCache(O)}},be.cache=function(O){return function(){return O.apply(null,arguments)}},be.cacheSignal=function(){return null},be.cloneElement=function(O,I,W){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ee=j({},O.props),ne=O.key;if(I!=null)for(le in I.key!==void 0&&(ne=""+I.key),I)!R.call(I,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&I.ref===void 0||(ee[le]=I[le]);var le=arguments.length-2;if(le===1)ee.children=W;else if(1<le){for(var ge=Array(le),rt=0;rt<le;rt++)ge[rt]=arguments[rt+2];ee.children=ge}return X(O.type,ne,ee)},be.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:o,_context:O},O},be.createElement=function(O,I,W){var ee,ne={},le=null;if(I!=null)for(ee in I.key!==void 0&&(le=""+I.key),I)R.call(I,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ne[ee]=I[ee]);var ge=arguments.length-2;if(ge===1)ne.children=W;else if(1<ge){for(var rt=Array(ge),ye=0;ye<ge;ye++)rt[ye]=arguments[ye+2];ne.children=rt}if(O&&O.defaultProps)for(ee in ge=O.defaultProps,ge)ne[ee]===void 0&&(ne[ee]=ge[ee]);return X(O,le,ne)},be.createRef=function(){return{current:null}},be.forwardRef=function(O){return{$$typeof:d,render:O}},be.isValidElement=Q,be.lazy=function(O){return{$$typeof:x,_payload:{_status:-1,_result:O},_init:fe}},be.memo=function(O,I){return{$$typeof:g,type:O,compare:I===void 0?null:I}},be.startTransition=function(O){var I=L.T,W={};L.T=W;try{var ee=O(),ne=L.S;ne!==null&&ne(W,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(z,we)}catch(le){we(le)}finally{I!==null&&W.types!==null&&(I.types=W.types),L.T=I}},be.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},be.use=function(O){return L.H.use(O)},be.useActionState=function(O,I,W){return L.H.useActionState(O,I,W)},be.useCallback=function(O,I){return L.H.useCallback(O,I)},be.useContext=function(O){return L.H.useContext(O)},be.useDebugValue=function(){},be.useDeferredValue=function(O,I){return L.H.useDeferredValue(O,I)},be.useEffect=function(O,I){return L.H.useEffect(O,I)},be.useEffectEvent=function(O){return L.H.useEffectEvent(O)},be.useId=function(){return L.H.useId()},be.useImperativeHandle=function(O,I,W){return L.H.useImperativeHandle(O,I,W)},be.useInsertionEffect=function(O,I){return L.H.useInsertionEffect(O,I)},be.useLayoutEffect=function(O,I){return L.H.useLayoutEffect(O,I)},be.useMemo=function(O,I){return L.H.useMemo(O,I)},be.useOptimistic=function(O,I){return L.H.useOptimistic(O,I)},be.useReducer=function(O,I,W){return L.H.useReducer(O,I,W)},be.useRef=function(O){return L.H.useRef(O)},be.useState=function(O){return L.H.useState(O)},be.useSyncExternalStore=function(O,I,W){return L.H.useSyncExternalStore(O,I,W)},be.useTransition=function(){return L.H.useTransition()},be.version="19.2.8",be}var Vp;function eh(){return Vp||(Vp=1,lf.exports=BS()),lf.exports}var w=eh();const ry=ly(w);var rf={exports:{}},Dl={},of={exports:{}},cf={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Yp;function US(){return Yp||(Yp=1,(function(n){function t(U,K){var fe=U.length;U.push(K);e:for(;0<fe;){var we=fe-1>>>1,P=U[we];if(0<l(P,K))U[we]=K,U[fe]=P,fe=we;else break e}}function a(U){return U.length===0?null:U[0]}function s(U){if(U.length===0)return null;var K=U[0],fe=U.pop();if(fe!==K){U[0]=fe;e:for(var we=0,P=U.length,O=P>>>1;we<O;){var I=2*(we+1)-1,W=U[I],ee=I+1,ne=U[ee];if(0>l(W,fe))ee<P&&0>l(ne,W)?(U[we]=ne,U[ee]=fe,we=ee):(U[we]=W,U[I]=fe,we=I);else if(ee<P&&0>l(ne,fe))U[we]=ne,U[ee]=fe,we=ee;else break e}}return K}function l(U,K){var fe=U.sortIndex-K.sortIndex;return fe!==0?fe:U.id-K.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var u=Date,d=u.now();n.unstable_now=function(){return u.now()-d}}var f=[],g=[],x=1,b=null,v=3,_=!1,M=!1,j=!1,S=!1,N=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function E(U){for(var K=a(g);K!==null;){if(K.callback===null)s(g);else if(K.startTime<=U)s(g),K.sortIndex=K.expirationTime,t(f,K);else break;K=a(g)}}function A(U){if(j=!1,E(U),!M)if(a(f)!==null)M=!0,z||(z=!0,ae());else{var K=a(g);K!==null&&he(A,K.startTime-U)}}var z=!1,L=-1,R=5,X=-1;function de(){return S?!0:!(n.unstable_now()-X<R)}function Q(){if(S=!1,z){var U=n.unstable_now();X=U;var K=!0;try{e:{M=!1,j&&(j=!1,C(L),L=-1),_=!0;var fe=v;try{t:{for(E(U),b=a(f);b!==null&&!(b.expirationTime>U&&de());){var we=b.callback;if(typeof we=="function"){b.callback=null,v=b.priorityLevel;var P=we(b.expirationTime<=U);if(U=n.unstable_now(),typeof P=="function"){b.callback=P,E(U),K=!0;break t}b===a(f)&&s(f),E(U)}else s(f);b=a(f)}if(b!==null)K=!0;else{var O=a(g);O!==null&&he(A,O.startTime-U),K=!1}}break e}finally{b=null,v=fe,_=!1}K=void 0}}finally{K?ae():z=!1}}}var ae;if(typeof k=="function")ae=function(){k(Q)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,Oe=Ee.port2;Ee.port1.onmessage=Q,ae=function(){Oe.postMessage(null)}}else ae=function(){N(Q,0)};function he(U,K){L=N(function(){U(n.unstable_now())},K)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<U?Math.floor(1e3/U):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(U){switch(v){case 1:case 2:case 3:var K=3;break;default:K=v}var fe=v;v=K;try{return U()}finally{v=fe}},n.unstable_requestPaint=function(){S=!0},n.unstable_runWithPriority=function(U,K){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var fe=v;v=U;try{return K()}finally{v=fe}},n.unstable_scheduleCallback=function(U,K,fe){var we=n.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?we+fe:we):fe=we,U){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=fe+P,U={id:x++,callback:K,priorityLevel:U,startTime:fe,expirationTime:P,sortIndex:-1},fe>we?(U.sortIndex=fe,t(g,U),a(f)===null&&U===a(g)&&(j?(C(L),L=-1):j=!0,he(A,fe-we))):(U.sortIndex=P,t(f,U),M||_||(M=!0,z||(z=!0,ae()))),U},n.unstable_shouldYield=de,n.unstable_wrapCallback=function(U){var K=v;return function(){var fe=v;v=K;try{return U.apply(this,arguments)}finally{v=fe}}}})(cf)),cf}var Gp;function $S(){return Gp||(Gp=1,of.exports=US()),of.exports}var uf={exports:{}},Mt={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var qp;function VS(){if(qp)return Mt;qp=1;var n=eh();function t(f){var g="https://react.dev/errors/"+f;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)g+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+f+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},l=Symbol.for("react.portal");function o(f,g,x){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:b==null?null:""+b,children:f,containerInfo:g,implementation:x}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,g){if(f==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Mt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Mt.createPortal=function(f,g){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(t(299));return o(f,g,null,x)},Mt.flushSync=function(f){var g=u.T,x=s.p;try{if(u.T=null,s.p=2,f)return f()}finally{u.T=g,s.p=x,s.d.f()}},Mt.preconnect=function(f,g){typeof f=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,s.d.C(f,g))},Mt.prefetchDNS=function(f){typeof f=="string"&&s.d.D(f)},Mt.preinit=function(f,g){if(typeof f=="string"&&g&&typeof g.as=="string"){var x=g.as,b=d(x,g.crossOrigin),v=typeof g.integrity=="string"?g.integrity:void 0,_=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;x==="style"?s.d.S(f,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:b,integrity:v,fetchPriority:_}):x==="script"&&s.d.X(f,{crossOrigin:b,integrity:v,fetchPriority:_,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Mt.preinitModule=function(f,g){if(typeof f=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var x=d(g.as,g.crossOrigin);s.d.M(f,{crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&s.d.M(f)},Mt.preload=function(f,g){if(typeof f=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var x=g.as,b=d(x,g.crossOrigin);s.d.L(f,x,{crossOrigin:b,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Mt.preloadModule=function(f,g){if(typeof f=="string")if(g){var x=d(g.as,g.crossOrigin);s.d.m(f,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:x,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else s.d.m(f)},Mt.requestFormReset=function(f){s.d.r(f)},Mt.unstable_batchedUpdates=function(f,g){return f(g)},Mt.useFormState=function(f,g,x){return u.H.useFormState(f,g,x)},Mt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Mt.version="19.2.8",Mt}var Xp;function YS(){if(Xp)return uf.exports;Xp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),uf.exports=VS(),uf.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ip;function GS(){if(Ip)return Dl;Ip=1;var n=$S(),t=eh(),a=YS();function s(e){var i="https://react.dev/errors/"+e;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)i+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var i=e,r=e;if(e.alternate)for(;i.return;)i=i.return;else{e=i;do i=e,(i.flags&4098)!==0&&(r=i.return),e=i.return;while(e)}return i.tag===3?r:null}function u(e){if(e.tag===13){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function d(e){if(e.tag===31){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function f(e){if(o(e)!==e)throw Error(s(188))}function g(e){var i=e.alternate;if(!i){if(i=o(e),i===null)throw Error(s(188));return i!==e?null:e}for(var r=e,c=i;;){var m=r.return;if(m===null)break;var p=m.alternate;if(p===null){if(c=m.return,c!==null){r=c;continue}break}if(m.child===p.child){for(p=m.child;p;){if(p===r)return f(m),e;if(p===c)return f(m),i;p=p.sibling}throw Error(s(188))}if(r.return!==c.return)r=m,c=p;else{for(var y=!1,T=m.child;T;){if(T===r){y=!0,r=m,c=p;break}if(T===c){y=!0,c=m,r=p;break}T=T.sibling}if(!y){for(T=p.child;T;){if(T===r){y=!0,r=p,c=m;break}if(T===c){y=!0,c=p,r=m;break}T=T.sibling}if(!y)throw Error(s(189))}}if(r.alternate!==c)throw Error(s(190))}if(r.tag!==3)throw Error(s(188));return r.stateNode.current===r?e:i}function x(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e;for(e=e.child;e!==null;){if(i=x(e),i!==null)return i;e=e.sibling}return null}var b=Object.assign,v=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),k=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),de=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=Q&&e[Q]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Symbol.for("react.client.reference");function Oe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case N:return"Profiler";case S:return"StrictMode";case A:return"Suspense";case z:return"SuspenseList";case X:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case M:return"Portal";case k:return e.displayName||"Context";case C:return(e._context.displayName||"Context")+".Consumer";case E:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return i=e.displayName||null,i!==null?i:Oe(e.type)||"Memo";case R:i=e._payload,e=e._init;try{return Oe(e(i))}catch{}}return null}var he=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},we=[],P=-1;function O(e){return{current:e}}function I(e){0>P||(e.current=we[P],we[P]=null,P--)}function W(e,i){P++,we[P]=e.current,e.current=i}var ee=O(null),ne=O(null),le=O(null),ge=O(null);function rt(e,i){switch(W(le,i),W(ne,e),W(ee,null),i.nodeType){case 9:case 11:e=(e=i.documentElement)&&(e=e.namespaceURI)?rp(e):0;break;default:if(e=i.tagName,i=i.namespaceURI)i=rp(i),e=op(i,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}I(ee),W(ee,e)}function ye(){I(ee),I(ne),I(le)}function kn(e){e.memoizedState!==null&&W(ge,e);var i=ee.current,r=op(i,e.type);i!==r&&(W(ne,e),W(ee,r))}function re(e){ne.current===e&&(I(ee),I(ne)),ge.current===e&&(I(ge),Tl._currentValue=fe)}var xe,Ae;function je(e){if(xe===void 0)try{throw Error()}catch(r){var i=r.stack.trim().match(/\n( *(at )?)/);xe=i&&i[1]||"",Ae=-1<r.stack.indexOf(`
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
`+xe+e+Ae}var Je=!1;function xt(e,i){if(!e||Je)return"";Je=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var Z=function(){throw Error()};if(Object.defineProperty(Z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Z,[])}catch(G){var Y=G}Reflect.construct(e,[],Z)}else{try{Z.call()}catch(G){Y=G}e.call(Z.prototype)}}else{try{throw Error()}catch(G){Y=G}(Z=e())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(G){if(G&&Y&&typeof G.stack=="string")return[G.stack,Y.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=c.DetermineComponentFrameRoot(),y=p[0],T=p[1];if(y&&T){var D=y.split(`
`),V=T.split(`
`);for(m=c=0;c<D.length&&!D[c].includes("DetermineComponentFrameRoot");)c++;for(;m<V.length&&!V[m].includes("DetermineComponentFrameRoot");)m++;if(c===D.length||m===V.length)for(c=D.length-1,m=V.length-1;1<=c&&0<=m&&D[c]!==V[m];)m--;for(;1<=c&&0<=m;c--,m--)if(D[c]!==V[m]){if(c!==1||m!==1)do if(c--,m--,0>m||D[c]!==V[m]){var q=`
`+D[c].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=c&&0<=m);break}}}finally{Je=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?je(r):""}function bn(e,i){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je("Lazy");case 13:return e.child!==i&&i!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return xt(e.type,!1);case 11:return xt(e.type.render,!1);case 1:return xt(e.type,!0);case 31:return je("Activity");default:return""}}function Ct(e){try{var i="",r=null;do i+=bn(e,r),r=e,e=e.return;while(e);return i}catch(c){return`
Error generating stack: `+c.message+`
`+c.stack}}var an=Object.prototype.hasOwnProperty,ot=n.unstable_scheduleCallback,Xc=n.unstable_cancelCallback,f1=n.unstable_shouldYield,h1=n.unstable_requestPaint,Gt=n.unstable_now,m1=n.unstable_getCurrentPriorityLevel,Uh=n.unstable_ImmediatePriority,$h=n.unstable_UserBlockingPriority,ur=n.unstable_NormalPriority,g1=n.unstable_LowPriority,Vh=n.unstable_IdlePriority,p1=n.log,x1=n.unstable_setDisableYieldValue,Us=null,qt=null;function fa(e){if(typeof p1=="function"&&x1(e),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(Us,e)}catch{}}var Xt=Math.clz32?Math.clz32:v1,b1=Math.log,y1=Math.LN2;function v1(e){return e>>>=0,e===0?32:31-(b1(e)/y1|0)|0}var dr=256,fr=262144,hr=4194304;function Za(e){var i=e&42;if(i!==0)return i;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function mr(e,i,r){var c=e.pendingLanes;if(c===0)return 0;var m=0,p=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var T=c&134217727;return T!==0?(c=T&~p,c!==0?m=Za(c):(y&=T,y!==0?m=Za(y):r||(r=T&~e,r!==0&&(m=Za(r))))):(T=c&~p,T!==0?m=Za(T):y!==0?m=Za(y):r||(r=c&~e,r!==0&&(m=Za(r)))),m===0?0:i!==0&&i!==m&&(i&p)===0&&(p=m&-m,r=i&-i,p>=r||p===32&&(r&4194048)!==0)?i:m}function $s(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function S1(e,i){switch(e){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Yh(){var e=hr;return hr<<=1,(hr&62914560)===0&&(hr=4194304),e}function Ic(e){for(var i=[],r=0;31>r;r++)i.push(e);return i}function Vs(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _1(e,i,r,c,m,p){var y=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var T=e.entanglements,D=e.expirationTimes,V=e.hiddenUpdates;for(r=y&~r;0<r;){var q=31-Xt(r),Z=1<<q;T[q]=0,D[q]=-1;var Y=V[q];if(Y!==null)for(V[q]=null,q=0;q<Y.length;q++){var G=Y[q];G!==null&&(G.lane&=-536870913)}r&=~Z}c!==0&&Gh(e,c,0),p!==0&&m===0&&e.tag!==0&&(e.suspendedLanes|=p&~(y&~i))}function Gh(e,i,r){e.pendingLanes|=i,e.suspendedLanes&=~i;var c=31-Xt(i);e.entangledLanes|=i,e.entanglements[c]=e.entanglements[c]|1073741824|r&261930}function qh(e,i){var r=e.entangledLanes|=i;for(e=e.entanglements;r;){var c=31-Xt(r),m=1<<c;m&i|e[c]&i&&(e[c]|=i),r&=~m}}function Xh(e,i){var r=i&-i;return r=(r&42)!==0?1:Fc(r),(r&(e.suspendedLanes|i))!==0?0:r}function Fc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ih(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:Ap(e.type))}function Fh(e,i){var r=K.p;try{return K.p=e,i()}finally{K.p=r}}var ha=Math.random().toString(36).slice(2),St="__reactFiber$"+ha,At="__reactProps$"+ha,Di="__reactContainer$"+ha,Zc="__reactEvents$"+ha,w1="__reactListeners$"+ha,j1="__reactHandles$"+ha,Qh="__reactResources$"+ha,Ys="__reactMarker$"+ha;function Kc(e){delete e[St],delete e[At],delete e[Zc],delete e[w1],delete e[j1]}function zi(e){var i=e[St];if(i)return i;for(var r=e.parentNode;r;){if(i=r[Di]||r[St]){if(r=i.alternate,i.child!==null||r!==null&&r.child!==null)for(e=gp(e);e!==null;){if(r=e[St])return r;e=gp(e)}return i}e=r,r=e.parentNode}return null}function Ri(e){if(e=e[St]||e[Di]){var i=e.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return e}return null}function Gs(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e.stateNode;throw Error(s(33))}function Oi(e){var i=e[Qh];return i||(i=e[Qh]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function bt(e){e[Ys]=!0}var Zh=new Set,Kh={};function Ka(e,i){Li(e,i),Li(e+"Capture",i)}function Li(e,i){for(Kh[e]=i,e=0;e<i.length;e++)Zh.add(i[e])}var N1=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ph={},Wh={};function M1(e){return an.call(Wh,e)?!0:an.call(Ph,e)?!1:N1.test(e)?Wh[e]=!0:(Ph[e]=!0,!1)}function gr(e,i,r){if(M1(i))if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){e.removeAttribute(i);return}}e.setAttribute(i,""+r)}}function pr(e,i,r){if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttribute(i,""+r)}}function $n(e,i,r,c){if(c===null)e.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(i,r,""+c)}}function sn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Jh(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function T1(e,i,r){var c=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);if(!e.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,p=c.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return m.call(this)},set:function(y){r=""+y,p.call(this,y)}}),Object.defineProperty(e,i,{enumerable:c.enumerable}),{getValue:function(){return r},setValue:function(y){r=""+y},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function Pc(e){if(!e._valueTracker){var i=Jh(e)?"checked":"value";e._valueTracker=T1(e,i,""+e[i])}}function em(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var r=i.getValue(),c="";return e&&(c=Jh(e)?e.checked?"true":"false":e.value),e=c,e!==r?(i.setValue(e),!0):!1}function xr(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}}var k1=/[\n"\\]/g;function ln(e){return e.replace(k1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Wc(e,i,r,c,m,p,y,T){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),i!=null?y==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+sn(i)):e.value!==""+sn(i)&&(e.value=""+sn(i)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),i!=null?Jc(e,y,sn(i)):r!=null?Jc(e,y,sn(r)):c!=null&&e.removeAttribute("value"),m==null&&p!=null&&(e.defaultChecked=!!p),m!=null&&(e.checked=m&&typeof m!="function"&&typeof m!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+sn(T):e.removeAttribute("name")}function tm(e,i,r,c,m,p,y,T){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),i!=null||r!=null){if(!(p!=="submit"&&p!=="reset"||i!=null)){Pc(e);return}r=r!=null?""+sn(r):"",i=i!=null?""+sn(i):r,T||i===e.value||(e.value=i),e.defaultValue=i}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,e.checked=T?e.checked:!!c,e.defaultChecked=!!c,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),Pc(e)}function Jc(e,i,r){i==="number"&&xr(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Hi(e,i,r,c){if(e=e.options,i){i={};for(var m=0;m<r.length;m++)i["$"+r[m]]=!0;for(r=0;r<e.length;r++)m=i.hasOwnProperty("$"+e[r].value),e[r].selected!==m&&(e[r].selected=m),m&&c&&(e[r].defaultSelected=!0)}else{for(r=""+sn(r),i=null,m=0;m<e.length;m++){if(e[m].value===r){e[m].selected=!0,c&&(e[m].defaultSelected=!0);return}i!==null||e[m].disabled||(i=e[m])}i!==null&&(i.selected=!0)}}function nm(e,i,r){if(i!=null&&(i=""+sn(i),i!==e.value&&(e.value=i),r==null)){e.defaultValue!==i&&(e.defaultValue=i);return}e.defaultValue=r!=null?""+sn(r):""}function am(e,i,r,c){if(i==null){if(c!=null){if(r!=null)throw Error(s(92));if(he(c)){if(1<c.length)throw Error(s(93));c=c[0]}r=c}r==null&&(r=""),i=r}r=sn(i),e.defaultValue=r,c=e.textContent,c===r&&c!==""&&c!==null&&(e.value=c),Pc(e)}function Bi(e,i){if(i){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=i;return}}e.textContent=i}var C1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function im(e,i,r){var c=i.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?c?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="":c?e.setProperty(i,r):typeof r!="number"||r===0||C1.has(i)?i==="float"?e.cssFloat=r:e[i]=(""+r).trim():e[i]=r+"px"}function sm(e,i,r){if(i!=null&&typeof i!="object")throw Error(s(62));if(e=e.style,r!=null){for(var c in r)!r.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?e.setProperty(c,""):c==="float"?e.cssFloat="":e[c]="");for(var m in i)c=i[m],i.hasOwnProperty(m)&&r[m]!==c&&im(e,m,c)}else for(var p in i)i.hasOwnProperty(p)&&im(e,p,i[p])}function eu(e){if(e.indexOf("-")===-1)return!1;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 E1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),A1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function br(e){return A1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Vn(){}var tu=null;function nu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ui=null,$i=null;function lm(e){var i=Ri(e);if(i&&(e=i.stateNode)){var r=e[At]||null;e:switch(e=i.stateNode,i.type){case"input":if(Wc(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),i=r.name,r.type==="radio"&&i!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+ln(""+i)+'"][type="radio"]'),i=0;i<r.length;i++){var c=r[i];if(c!==e&&c.form===e.form){var m=c[At]||null;if(!m)throw Error(s(90));Wc(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(i=0;i<r.length;i++)c=r[i],c.form===e.form&&em(c)}break e;case"textarea":nm(e,r.value,r.defaultValue);break e;case"select":i=r.value,i!=null&&Hi(e,!!r.multiple,i,!1)}}}var au=!1;function rm(e,i,r){if(au)return e(i,r);au=!0;try{var c=e(i);return c}finally{if(au=!1,(Ui!==null||$i!==null)&&(so(),Ui&&(i=Ui,e=$i,$i=Ui=null,lm(i),e)))for(i=0;i<e.length;i++)lm(e[i])}}function qs(e,i){var r=e.stateNode;if(r===null)return null;var c=r[At]||null;if(c===null)return null;r=c[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(e=e.type,c=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!c;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(s(231,i,typeof r));return r}var Yn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),iu=!1;if(Yn)try{var Xs={};Object.defineProperty(Xs,"passive",{get:function(){iu=!0}}),window.addEventListener("test",Xs,Xs),window.removeEventListener("test",Xs,Xs)}catch{iu=!1}var ma=null,su=null,yr=null;function om(){if(yr)return yr;var e,i=su,r=i.length,c,m="value"in ma?ma.value:ma.textContent,p=m.length;for(e=0;e<r&&i[e]===m[e];e++);var y=r-e;for(c=1;c<=y&&i[r-c]===m[p-c];c++);return yr=m.slice(e,1<c?1-c:void 0)}function vr(e){var i=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&i===13&&(e=13)):e=i,e===10&&(e=13),32<=e||e===13?e:0}function Sr(){return!0}function cm(){return!1}function Dt(e){function i(r,c,m,p,y){this._reactName=r,this._targetInst=m,this.type=c,this.nativeEvent=p,this.target=y,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(r=e[T],this[T]=r?r(p):p[T]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Sr:cm,this.isPropagationStopped=cm,this}return b(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Sr)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Sr)},persist:function(){},isPersistent:Sr}),i}var Pa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_r=Dt(Pa),Is=b({},Pa,{view:0,detail:0}),D1=Dt(Is),lu,ru,Fs,wr=b({},Is,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cu,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!==Fs&&(Fs&&e.type==="mousemove"?(lu=e.screenX-Fs.screenX,ru=e.screenY-Fs.screenY):ru=lu=0,Fs=e),lu)},movementY:function(e){return"movementY"in e?e.movementY:ru}}),um=Dt(wr),z1=b({},wr,{dataTransfer:0}),R1=Dt(z1),O1=b({},Is,{relatedTarget:0}),ou=Dt(O1),L1=b({},Pa,{animationName:0,elapsedTime:0,pseudoElement:0}),H1=Dt(L1),B1=b({},Pa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),U1=Dt(B1),$1=b({},Pa,{data:0}),dm=Dt($1),V1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Y1={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"},G1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function q1(e){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(e):(e=G1[e])?!!i[e]:!1}function cu(){return q1}var X1=b({},Is,{key:function(e){if(e.key){var i=V1[e.key]||e.key;if(i!=="Unidentified")return i}return e.type==="keypress"?(e=vr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Y1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cu,charCode:function(e){return e.type==="keypress"?vr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),I1=Dt(X1),F1=b({},wr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fm=Dt(F1),Q1=b({},Is,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cu}),Z1=Dt(Q1),K1=b({},Pa,{propertyName:0,elapsedTime:0,pseudoElement:0}),P1=Dt(K1),W1=b({},wr,{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}),J1=Dt(W1),e2=b({},Pa,{newState:0,oldState:0}),t2=Dt(e2),n2=[9,13,27,32],uu=Yn&&"CompositionEvent"in window,Qs=null;Yn&&"documentMode"in document&&(Qs=document.documentMode);var a2=Yn&&"TextEvent"in window&&!Qs,hm=Yn&&(!uu||Qs&&8<Qs&&11>=Qs),mm=" ",gm=!1;function pm(e,i){switch(e){case"keyup":return n2.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vi=!1;function i2(e,i){switch(e){case"compositionend":return xm(i);case"keypress":return i.which!==32?null:(gm=!0,mm);case"textInput":return e=i.data,e===mm&&gm?null:e;default:return null}}function s2(e,i){if(Vi)return e==="compositionend"||!uu&&pm(e,i)?(e=om(),yr=su=ma=null,Vi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return hm&&i.locale!=="ko"?null:i.data;default:return null}}var l2={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 bm(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i==="input"?!!l2[e.type]:i==="textarea"}function ym(e,i,r,c){Ui?$i?$i.push(c):$i=[c]:Ui=c,i=ho(i,"onChange"),0<i.length&&(r=new _r("onChange","change",null,r,c),e.push({event:r,listeners:i}))}var Zs=null,Ks=null;function r2(e){tp(e,0)}function jr(e){var i=Gs(e);if(em(i))return e}function vm(e,i){if(e==="change")return i}var Sm=!1;if(Yn){var du;if(Yn){var fu="oninput"in document;if(!fu){var _m=document.createElement("div");_m.setAttribute("oninput","return;"),fu=typeof _m.oninput=="function"}du=fu}else du=!1;Sm=du&&(!document.documentMode||9<document.documentMode)}function wm(){Zs&&(Zs.detachEvent("onpropertychange",jm),Ks=Zs=null)}function jm(e){if(e.propertyName==="value"&&jr(Ks)){var i=[];ym(i,Ks,e,nu(e)),rm(r2,i)}}function o2(e,i,r){e==="focusin"?(wm(),Zs=i,Ks=r,Zs.attachEvent("onpropertychange",jm)):e==="focusout"&&wm()}function c2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return jr(Ks)}function u2(e,i){if(e==="click")return jr(i)}function d2(e,i){if(e==="input"||e==="change")return jr(i)}function f2(e,i){return e===i&&(e!==0||1/e===1/i)||e!==e&&i!==i}var It=typeof Object.is=="function"?Object.is:f2;function Ps(e,i){if(It(e,i))return!0;if(typeof e!="object"||e===null||typeof i!="object"||i===null)return!1;var r=Object.keys(e),c=Object.keys(i);if(r.length!==c.length)return!1;for(c=0;c<r.length;c++){var m=r[c];if(!an.call(i,m)||!It(e[m],i[m]))return!1}return!0}function Nm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mm(e,i){var r=Nm(e);e=0;for(var c;r;){if(r.nodeType===3){if(c=e+r.textContent.length,e<=i&&c>=i)return{node:r,offset:i-e};e=c}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Nm(r)}}function Tm(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?Tm(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function km(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var i=xr(e.document);i instanceof e.HTMLIFrameElement;){try{var r=typeof i.contentWindow.location.href=="string"}catch{r=!1}if(r)e=i.contentWindow;else break;i=xr(e.document)}return i}function hu(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i&&(i==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||i==="textarea"||e.contentEditable==="true")}var h2=Yn&&"documentMode"in document&&11>=document.documentMode,Yi=null,mu=null,Ws=null,gu=!1;function Cm(e,i,r){var c=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;gu||Yi==null||Yi!==xr(c)||(c=Yi,"selectionStart"in c&&hu(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Ws&&Ps(Ws,c)||(Ws=c,c=ho(mu,"onSelect"),0<c.length&&(i=new _r("onSelect","select",null,i,r),e.push({event:i,listeners:c}),i.target=Yi)))}function Wa(e,i){var r={};return r[e.toLowerCase()]=i.toLowerCase(),r["Webkit"+e]="webkit"+i,r["Moz"+e]="moz"+i,r}var Gi={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionrun:Wa("Transition","TransitionRun"),transitionstart:Wa("Transition","TransitionStart"),transitioncancel:Wa("Transition","TransitionCancel"),transitionend:Wa("Transition","TransitionEnd")},pu={},Em={};Yn&&(Em=document.createElement("div").style,"AnimationEvent"in window||(delete Gi.animationend.animation,delete Gi.animationiteration.animation,delete Gi.animationstart.animation),"TransitionEvent"in window||delete Gi.transitionend.transition);function Ja(e){if(pu[e])return pu[e];if(!Gi[e])return e;var i=Gi[e],r;for(r in i)if(i.hasOwnProperty(r)&&r in Em)return pu[e]=i[r];return e}var Am=Ja("animationend"),Dm=Ja("animationiteration"),zm=Ja("animationstart"),m2=Ja("transitionrun"),g2=Ja("transitionstart"),p2=Ja("transitioncancel"),Rm=Ja("transitionend"),Om=new Map,xu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");xu.push("scrollEnd");function yn(e,i){Om.set(e,i),Ka(i,[e])}var Nr=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},rn=[],qi=0,bu=0;function Mr(){for(var e=qi,i=bu=qi=0;i<e;){var r=rn[i];rn[i++]=null;var c=rn[i];rn[i++]=null;var m=rn[i];rn[i++]=null;var p=rn[i];if(rn[i++]=null,c!==null&&m!==null){var y=c.pending;y===null?m.next=m:(m.next=y.next,y.next=m),c.pending=m}p!==0&&Lm(r,m,p)}}function Tr(e,i,r,c){rn[qi++]=e,rn[qi++]=i,rn[qi++]=r,rn[qi++]=c,bu|=c,e.lanes|=c,e=e.alternate,e!==null&&(e.lanes|=c)}function yu(e,i,r,c){return Tr(e,i,r,c),kr(e)}function ei(e,i){return Tr(e,null,null,i),kr(e)}function Lm(e,i,r){e.lanes|=r;var c=e.alternate;c!==null&&(c.lanes|=r);for(var m=!1,p=e.return;p!==null;)p.childLanes|=r,c=p.alternate,c!==null&&(c.childLanes|=r),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(m=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,m&&i!==null&&(m=31-Xt(r),e=p.hiddenUpdates,c=e[m],c===null?e[m]=[i]:c.push(i),i.lane=r|536870912),p):null}function kr(e){if(50<vl)throw vl=0,kd=null,Error(s(185));for(var i=e.return;i!==null;)e=i,i=e.return;return e.tag===3?e.stateNode:null}var Xi={};function x2(e,i,r,c){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ft(e,i,r,c){return new x2(e,i,r,c)}function vu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gn(e,i){var r=e.alternate;return r===null?(r=Ft(e.tag,i,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=i,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,i=e.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Hm(e,i){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=i,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,i=r.dependencies,e.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),e}function Cr(e,i,r,c,m,p){var y=0;if(c=e,typeof e=="function")vu(e)&&(y=1);else if(typeof e=="string")y=_S(e,r,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case X:return e=Ft(31,r,i,m),e.elementType=X,e.lanes=p,e;case j:return ti(r.children,m,p,i);case S:y=8,m|=24;break;case N:return e=Ft(12,r,i,m|2),e.elementType=N,e.lanes=p,e;case A:return e=Ft(13,r,i,m),e.elementType=A,e.lanes=p,e;case z:return e=Ft(19,r,i,m),e.elementType=z,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case k:y=10;break e;case C:y=9;break e;case E:y=11;break e;case L:y=14;break e;case R:y=16,c=null;break e}y=29,r=Error(s(130,e===null?"null":typeof e,"")),c=null}return i=Ft(y,r,i,m),i.elementType=e,i.type=c,i.lanes=p,i}function ti(e,i,r,c){return e=Ft(7,e,c,i),e.lanes=r,e}function Su(e,i,r){return e=Ft(6,e,null,i),e.lanes=r,e}function Bm(e){var i=Ft(18,null,null,0);return i.stateNode=e,i}function _u(e,i,r){return i=Ft(4,e.children!==null?e.children:[],e.key,i),i.lanes=r,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}var Um=new WeakMap;function on(e,i){if(typeof e=="object"&&e!==null){var r=Um.get(e);return r!==void 0?r:(i={value:e,source:i,stack:Ct(i)},Um.set(e,i),i)}return{value:e,source:i,stack:Ct(i)}}var Ii=[],Fi=0,Er=null,Js=0,cn=[],un=0,ga=null,Cn=1,En="";function qn(e,i){Ii[Fi++]=Js,Ii[Fi++]=Er,Er=e,Js=i}function $m(e,i,r){cn[un++]=Cn,cn[un++]=En,cn[un++]=ga,ga=e;var c=Cn;e=En;var m=32-Xt(c)-1;c&=~(1<<m),r+=1;var p=32-Xt(i)+m;if(30<p){var y=m-m%5;p=(c&(1<<y)-1).toString(32),c>>=y,m-=y,Cn=1<<32-Xt(i)+m|r<<m|c,En=p+e}else Cn=1<<p|r<<m|c,En=e}function wu(e){e.return!==null&&(qn(e,1),$m(e,1,0))}function ju(e){for(;e===Er;)Er=Ii[--Fi],Ii[Fi]=null,Js=Ii[--Fi],Ii[Fi]=null;for(;e===ga;)ga=cn[--un],cn[un]=null,En=cn[--un],cn[un]=null,Cn=cn[--un],cn[un]=null}function Vm(e,i){cn[un++]=Cn,cn[un++]=En,cn[un++]=ga,Cn=i.id,En=i.overflow,ga=e}var _t=null,Qe=null,De=!1,pa=null,dn=!1,Nu=Error(s(519));function xa(e){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw el(on(i,e)),Nu}function Ym(e){var i=e.stateNode,r=e.type,c=e.memoizedProps;switch(i[St]=e,i[At]=c,r){case"dialog":Te("cancel",i),Te("close",i);break;case"iframe":case"object":case"embed":Te("load",i);break;case"video":case"audio":for(r=0;r<_l.length;r++)Te(_l[r],i);break;case"source":Te("error",i);break;case"img":case"image":case"link":Te("error",i),Te("load",i);break;case"details":Te("toggle",i);break;case"input":Te("invalid",i),tm(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Te("invalid",i);break;case"textarea":Te("invalid",i),am(i,c.value,c.defaultValue,c.children)}r=c.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||i.textContent===""+r||c.suppressHydrationWarning===!0||sp(i.textContent,r)?(c.popover!=null&&(Te("beforetoggle",i),Te("toggle",i)),c.onScroll!=null&&Te("scroll",i),c.onScrollEnd!=null&&Te("scrollend",i),c.onClick!=null&&(i.onclick=Vn),i=!0):i=!1,i||xa(e,!0)}function Gm(e){for(_t=e.return;_t;)switch(_t.tag){case 5:case 31:case 13:dn=!1;return;case 27:case 3:dn=!0;return;default:_t=_t.return}}function Qi(e){if(e!==_t)return!1;if(!De)return Gm(e),De=!0,!1;var i=e.tag,r;if((r=i!==3&&i!==27)&&((r=i===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Gd(e.type,e.memoizedProps)),r=!r),r&&Qe&&xa(e),Gm(e),i===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Qe=mp(e)}else if(i===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Qe=mp(e)}else i===27?(i=Qe,Aa(e.type)?(e=Qd,Qd=null,Qe=e):Qe=i):Qe=_t?hn(e.stateNode.nextSibling):null;return!0}function ni(){Qe=_t=null,De=!1}function Mu(){var e=pa;return e!==null&&(Lt===null?Lt=e:Lt.push.apply(Lt,e),pa=null),e}function el(e){pa===null?pa=[e]:pa.push(e)}var Tu=O(null),ai=null,Xn=null;function ba(e,i,r){W(Tu,i._currentValue),i._currentValue=r}function In(e){e._currentValue=Tu.current,I(Tu)}function ku(e,i,r){for(;e!==null;){var c=e.alternate;if((e.childLanes&i)!==i?(e.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),e===r)break;e=e.return}}function Cu(e,i,r,c){var m=e.child;for(m!==null&&(m.return=e);m!==null;){var p=m.dependencies;if(p!==null){var y=m.child;p=p.firstContext;e:for(;p!==null;){var T=p;p=m;for(var D=0;D<i.length;D++)if(T.context===i[D]){p.lanes|=r,T=p.alternate,T!==null&&(T.lanes|=r),ku(p.return,r,e),c||(y=null);break e}p=T.next}}else if(m.tag===18){if(y=m.return,y===null)throw Error(s(341));y.lanes|=r,p=y.alternate,p!==null&&(p.lanes|=r),ku(y,r,e),y=null}else y=m.child;if(y!==null)y.return=m;else for(y=m;y!==null;){if(y===e){y=null;break}if(m=y.sibling,m!==null){m.return=y.return,y=m;break}y=y.return}m=y}}function Zi(e,i,r,c){e=null;for(var m=i,p=!1;m!==null;){if(!p){if((m.flags&524288)!==0)p=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var y=m.alternate;if(y===null)throw Error(s(387));if(y=y.memoizedProps,y!==null){var T=m.type;It(m.pendingProps.value,y.value)||(e!==null?e.push(T):e=[T])}}else if(m===ge.current){if(y=m.alternate,y===null)throw Error(s(387));y.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(e!==null?e.push(Tl):e=[Tl])}m=m.return}e!==null&&Cu(i,e,r,c),i.flags|=262144}function Ar(e){for(e=e.firstContext;e!==null;){if(!It(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ii(e){ai=e,Xn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function wt(e){return qm(ai,e)}function Dr(e,i){return ai===null&&ii(e),qm(e,i)}function qm(e,i){var r=i._currentValue;if(i={context:i,memoizedValue:r,next:null},Xn===null){if(e===null)throw Error(s(308));Xn=i,e.dependencies={lanes:0,firstContext:i},e.flags|=524288}else Xn=Xn.next=i;return r}var b2=typeof AbortController<"u"?AbortController:function(){var e=[],i=this.signal={aborted:!1,addEventListener:function(r,c){e.push(c)}};this.abort=function(){i.aborted=!0,e.forEach(function(r){return r()})}},y2=n.unstable_scheduleCallback,v2=n.unstable_NormalPriority,ct={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Eu(){return{controller:new b2,data:new Map,refCount:0}}function tl(e){e.refCount--,e.refCount===0&&y2(v2,function(){e.controller.abort()})}var nl=null,Au=0,Ki=0,Pi=null;function S2(e,i){if(nl===null){var r=nl=[];Au=0,Ki=Rd(),Pi={status:"pending",value:void 0,then:function(c){r.push(c)}}}return Au++,i.then(Xm,Xm),i}function Xm(){if(--Au===0&&nl!==null){Pi!==null&&(Pi.status="fulfilled");var e=nl;nl=null,Ki=0,Pi=null;for(var i=0;i<e.length;i++)(0,e[i])()}}function _2(e,i){var r=[],c={status:"pending",value:null,reason:null,then:function(m){r.push(m)}};return e.then(function(){c.status="fulfilled",c.value=i;for(var m=0;m<r.length;m++)(0,r[m])(i)},function(m){for(c.status="rejected",c.reason=m,m=0;m<r.length;m++)(0,r[m])(void 0)}),c}var Im=U.S;U.S=function(e,i){C0=Gt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&S2(e,i),Im!==null&&Im(e,i)};var si=O(null);function Du(){var e=si.current;return e!==null?e:Xe.pooledCache}function zr(e,i){i===null?W(si,si.current):W(si,i.pool)}function Fm(){var e=Du();return e===null?null:{parent:ct._currentValue,pool:e}}var Wi=Error(s(460)),zu=Error(s(474)),Rr=Error(s(542)),Or={then:function(){}};function Qm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Zm(e,i,r){switch(r=e[r],r===void 0?e.push(i):r!==i&&(i.then(Vn,Vn),i=r),i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,Pm(e),e;default:if(typeof i.status=="string")i.then(Vn,Vn);else{if(e=Xe,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=i,e.status="pending",e.then(function(c){if(i.status==="pending"){var m=i;m.status="fulfilled",m.value=c}},function(c){if(i.status==="pending"){var m=i;m.status="rejected",m.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,Pm(e),e}throw ri=i,Wi}}function li(e){try{var i=e._init;return i(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(ri=r,Wi):r}}var ri=null;function Km(){if(ri===null)throw Error(s(459));var e=ri;return ri=null,e}function Pm(e){if(e===Wi||e===Rr)throw Error(s(483))}var Ji=null,al=0;function Lr(e){var i=al;return al+=1,Ji===null&&(Ji=[]),Zm(Ji,e,i)}function il(e,i){i=i.props.ref,e.ref=i!==void 0?i:null}function Hr(e,i){throw i.$$typeof===v?Error(s(525)):(e=Object.prototype.toString.call(i),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":e)))}function Wm(e){function i(B,H){if(e){var $=B.deletions;$===null?(B.deletions=[H],B.flags|=16):$.push(H)}}function r(B,H){if(!e)return null;for(;H!==null;)i(B,H),H=H.sibling;return null}function c(B){for(var H=new Map;B!==null;)B.key!==null?H.set(B.key,B):H.set(B.index,B),B=B.sibling;return H}function m(B,H){return B=Gn(B,H),B.index=0,B.sibling=null,B}function p(B,H,$){return B.index=$,e?($=B.alternate,$!==null?($=$.index,$<H?(B.flags|=67108866,H):$):(B.flags|=67108866,H)):(B.flags|=1048576,H)}function y(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function T(B,H,$,F){return H===null||H.tag!==6?(H=Su($,B.mode,F),H.return=B,H):(H=m(H,$),H.return=B,H)}function D(B,H,$,F){var me=$.type;return me===j?q(B,H,$.props.children,F,$.key):H!==null&&(H.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===R&&li(me)===H.type)?(H=m(H,$.props),il(H,$),H.return=B,H):(H=Cr($.type,$.key,$.props,null,B.mode,F),il(H,$),H.return=B,H)}function V(B,H,$,F){return H===null||H.tag!==4||H.stateNode.containerInfo!==$.containerInfo||H.stateNode.implementation!==$.implementation?(H=_u($,B.mode,F),H.return=B,H):(H=m(H,$.children||[]),H.return=B,H)}function q(B,H,$,F,me){return H===null||H.tag!==7?(H=ti($,B.mode,F,me),H.return=B,H):(H=m(H,$),H.return=B,H)}function Z(B,H,$){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Su(""+H,B.mode,$),H.return=B,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case _:return $=Cr(H.type,H.key,H.props,null,B.mode,$),il($,H),$.return=B,$;case M:return H=_u(H,B.mode,$),H.return=B,H;case R:return H=li(H),Z(B,H,$)}if(he(H)||ae(H))return H=ti(H,B.mode,$,null),H.return=B,H;if(typeof H.then=="function")return Z(B,Lr(H),$);if(H.$$typeof===k)return Z(B,Dr(B,H),$);Hr(B,H)}return null}function Y(B,H,$,F){var me=H!==null?H.key:null;if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return me!==null?null:T(B,H,""+$,F);if(typeof $=="object"&&$!==null){switch($.$$typeof){case _:return $.key===me?D(B,H,$,F):null;case M:return $.key===me?V(B,H,$,F):null;case R:return $=li($),Y(B,H,$,F)}if(he($)||ae($))return me!==null?null:q(B,H,$,F,null);if(typeof $.then=="function")return Y(B,H,Lr($),F);if($.$$typeof===k)return Y(B,H,Dr(B,$),F);Hr(B,$)}return null}function G(B,H,$,F,me){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return B=B.get($)||null,T(H,B,""+F,me);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case _:return B=B.get(F.key===null?$:F.key)||null,D(H,B,F,me);case M:return B=B.get(F.key===null?$:F.key)||null,V(H,B,F,me);case R:return F=li(F),G(B,H,$,F,me)}if(he(F)||ae(F))return B=B.get($)||null,q(H,B,F,me,null);if(typeof F.then=="function")return G(B,H,$,Lr(F),me);if(F.$$typeof===k)return G(B,H,$,Dr(H,F),me);Hr(H,F)}return null}function oe(B,H,$,F){for(var me=null,Le=null,ue=H,Se=H=0,Ce=null;ue!==null&&Se<$.length;Se++){ue.index>Se?(Ce=ue,ue=null):Ce=ue.sibling;var He=Y(B,ue,$[Se],F);if(He===null){ue===null&&(ue=Ce);break}e&&ue&&He.alternate===null&&i(B,ue),H=p(He,H,Se),Le===null?me=He:Le.sibling=He,Le=He,ue=Ce}if(Se===$.length)return r(B,ue),De&&qn(B,Se),me;if(ue===null){for(;Se<$.length;Se++)ue=Z(B,$[Se],F),ue!==null&&(H=p(ue,H,Se),Le===null?me=ue:Le.sibling=ue,Le=ue);return De&&qn(B,Se),me}for(ue=c(ue);Se<$.length;Se++)Ce=G(ue,B,Se,$[Se],F),Ce!==null&&(e&&Ce.alternate!==null&&ue.delete(Ce.key===null?Se:Ce.key),H=p(Ce,H,Se),Le===null?me=Ce:Le.sibling=Ce,Le=Ce);return e&&ue.forEach(function(La){return i(B,La)}),De&&qn(B,Se),me}function pe(B,H,$,F){if($==null)throw Error(s(151));for(var me=null,Le=null,ue=H,Se=H=0,Ce=null,He=$.next();ue!==null&&!He.done;Se++,He=$.next()){ue.index>Se?(Ce=ue,ue=null):Ce=ue.sibling;var La=Y(B,ue,He.value,F);if(La===null){ue===null&&(ue=Ce);break}e&&ue&&La.alternate===null&&i(B,ue),H=p(La,H,Se),Le===null?me=La:Le.sibling=La,Le=La,ue=Ce}if(He.done)return r(B,ue),De&&qn(B,Se),me;if(ue===null){for(;!He.done;Se++,He=$.next())He=Z(B,He.value,F),He!==null&&(H=p(He,H,Se),Le===null?me=He:Le.sibling=He,Le=He);return De&&qn(B,Se),me}for(ue=c(ue);!He.done;Se++,He=$.next())He=G(ue,B,Se,He.value,F),He!==null&&(e&&He.alternate!==null&&ue.delete(He.key===null?Se:He.key),H=p(He,H,Se),Le===null?me=He:Le.sibling=He,Le=He);return e&&ue.forEach(function(zS){return i(B,zS)}),De&&qn(B,Se),me}function qe(B,H,$,F){if(typeof $=="object"&&$!==null&&$.type===j&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case _:e:{for(var me=$.key;H!==null;){if(H.key===me){if(me=$.type,me===j){if(H.tag===7){r(B,H.sibling),F=m(H,$.props.children),F.return=B,B=F;break e}}else if(H.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===R&&li(me)===H.type){r(B,H.sibling),F=m(H,$.props),il(F,$),F.return=B,B=F;break e}r(B,H);break}else i(B,H);H=H.sibling}$.type===j?(F=ti($.props.children,B.mode,F,$.key),F.return=B,B=F):(F=Cr($.type,$.key,$.props,null,B.mode,F),il(F,$),F.return=B,B=F)}return y(B);case M:e:{for(me=$.key;H!==null;){if(H.key===me)if(H.tag===4&&H.stateNode.containerInfo===$.containerInfo&&H.stateNode.implementation===$.implementation){r(B,H.sibling),F=m(H,$.children||[]),F.return=B,B=F;break e}else{r(B,H);break}else i(B,H);H=H.sibling}F=_u($,B.mode,F),F.return=B,B=F}return y(B);case R:return $=li($),qe(B,H,$,F)}if(he($))return oe(B,H,$,F);if(ae($)){if(me=ae($),typeof me!="function")throw Error(s(150));return $=me.call($),pe(B,H,$,F)}if(typeof $.then=="function")return qe(B,H,Lr($),F);if($.$$typeof===k)return qe(B,H,Dr(B,$),F);Hr(B,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,H!==null&&H.tag===6?(r(B,H.sibling),F=m(H,$),F.return=B,B=F):(r(B,H),F=Su($,B.mode,F),F.return=B,B=F),y(B)):r(B,H)}return function(B,H,$,F){try{al=0;var me=qe(B,H,$,F);return Ji=null,me}catch(ue){if(ue===Wi||ue===Rr)throw ue;var Le=Ft(29,ue,null,B.mode);return Le.lanes=F,Le.return=B,Le}finally{}}}var oi=Wm(!0),Jm=Wm(!1),ya=!1;function Ru(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ou(e,i){e=e.updateQueue,i.updateQueue===e&&(i.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(e,i,r){var c=e.updateQueue;if(c===null)return null;if(c=c.shared,(Be&2)!==0){var m=c.pending;return m===null?i.next=i:(i.next=m.next,m.next=i),c.pending=i,i=kr(e),Lm(e,null,r),i}return Tr(e,c,i,r),kr(e)}function sl(e,i,r){if(i=i.updateQueue,i!==null&&(i=i.shared,(r&4194048)!==0)){var c=i.lanes;c&=e.pendingLanes,r|=c,i.lanes=r,qh(e,r)}}function Lu(e,i){var r=e.updateQueue,c=e.alternate;if(c!==null&&(c=c.updateQueue,r===c)){var m=null,p=null;if(r=r.firstBaseUpdate,r!==null){do{var y={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};p===null?m=p=y:p=p.next=y,r=r.next}while(r!==null);p===null?m=p=i:p=p.next=i}else m=p=i;r={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:p,shared:c.shared,callbacks:c.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=i:e.next=i,r.lastBaseUpdate=i}var Hu=!1;function ll(){if(Hu){var e=Pi;if(e!==null)throw e}}function rl(e,i,r,c){Hu=!1;var m=e.updateQueue;ya=!1;var p=m.firstBaseUpdate,y=m.lastBaseUpdate,T=m.shared.pending;if(T!==null){m.shared.pending=null;var D=T,V=D.next;D.next=null,y===null?p=V:y.next=V,y=D;var q=e.alternate;q!==null&&(q=q.updateQueue,T=q.lastBaseUpdate,T!==y&&(T===null?q.firstBaseUpdate=V:T.next=V,q.lastBaseUpdate=D))}if(p!==null){var Z=m.baseState;y=0,q=V=D=null,T=p;do{var Y=T.lane&-536870913,G=Y!==T.lane;if(G?(ke&Y)===Y:(c&Y)===Y){Y!==0&&Y===Ki&&(Hu=!0),q!==null&&(q=q.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var oe=e,pe=T;Y=i;var qe=r;switch(pe.tag){case 1:if(oe=pe.payload,typeof oe=="function"){Z=oe.call(qe,Z,Y);break e}Z=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=pe.payload,Y=typeof oe=="function"?oe.call(qe,Z,Y):oe,Y==null)break e;Z=b({},Z,Y);break e;case 2:ya=!0}}Y=T.callback,Y!==null&&(e.flags|=64,G&&(e.flags|=8192),G=m.callbacks,G===null?m.callbacks=[Y]:G.push(Y))}else G={lane:Y,tag:T.tag,payload:T.payload,callback:T.callback,next:null},q===null?(V=q=G,D=Z):q=q.next=G,y|=Y;if(T=T.next,T===null){if(T=m.shared.pending,T===null)break;G=T,T=G.next,G.next=null,m.lastBaseUpdate=G,m.shared.pending=null}}while(!0);q===null&&(D=Z),m.baseState=D,m.firstBaseUpdate=V,m.lastBaseUpdate=q,p===null&&(m.shared.lanes=0),Ma|=y,e.lanes=y,e.memoizedState=Z}}function eg(e,i){if(typeof e!="function")throw Error(s(191,e));e.call(i)}function tg(e,i){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)eg(r[e],i)}var es=O(null),Br=O(0);function ng(e,i){e=ta,W(Br,e),W(es,i),ta=e|i.baseLanes}function Bu(){W(Br,ta),W(es,es.current)}function Uu(){ta=Br.current,I(es),I(Br)}var Qt=O(null),fn=null;function _a(e){var i=e.alternate;W(it,it.current&1),W(Qt,e),fn===null&&(i===null||es.current!==null||i.memoizedState!==null)&&(fn=e)}function $u(e){W(it,it.current),W(Qt,e),fn===null&&(fn=e)}function ag(e){e.tag===22?(W(it,it.current),W(Qt,e),fn===null&&(fn=e)):wa()}function wa(){W(it,it.current),W(Qt,Qt.current)}function Zt(e){I(Qt),fn===e&&(fn=null),I(it)}var it=O(0);function Ur(e){for(var i=e;i!==null;){if(i.tag===13){var r=i.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Id(r)||Fd(r)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Fn=0,ve=null,Ye=null,ut=null,$r=!1,ts=!1,ci=!1,Vr=0,ol=0,ns=null,w2=0;function nt(){throw Error(s(321))}function Vu(e,i){if(i===null)return!1;for(var r=0;r<i.length&&r<e.length;r++)if(!It(e[r],i[r]))return!1;return!0}function Yu(e,i,r,c,m,p){return Fn=p,ve=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,U.H=e===null||e.memoizedState===null?$g:ad,ci=!1,p=r(c,m),ci=!1,ts&&(p=sg(i,r,c,m)),ig(e),p}function ig(e){U.H=dl;var i=Ye!==null&&Ye.next!==null;if(Fn=0,ut=Ye=ve=null,$r=!1,ol=0,ns=null,i)throw Error(s(300));e===null||dt||(e=e.dependencies,e!==null&&Ar(e)&&(dt=!0))}function sg(e,i,r,c){ve=e;var m=0;do{if(ts&&(ns=null),ol=0,ts=!1,25<=m)throw Error(s(301));if(m+=1,ut=Ye=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}U.H=Vg,p=i(r,c)}while(ts);return p}function j2(){var e=U.H,i=e.useState()[0];return i=typeof i.then=="function"?cl(i):i,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(ve.flags|=1024),i}function Gu(){var e=Vr!==0;return Vr=0,e}function qu(e,i,r){i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~r}function Xu(e){if($r){for(e=e.memoizedState;e!==null;){var i=e.queue;i!==null&&(i.pending=null),e=e.next}$r=!1}Fn=0,ut=Ye=ve=null,ts=!1,ol=Vr=0,ns=null}function Et(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?ve.memoizedState=ut=e:ut=ut.next=e,ut}function st(){if(Ye===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var i=ut===null?ve.memoizedState:ut.next;if(i!==null)ut=i,Ye=e;else{if(e===null)throw ve.alternate===null?Error(s(467)):Error(s(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},ut===null?ve.memoizedState=ut=e:ut=ut.next=e}return ut}function Yr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cl(e){var i=ol;return ol+=1,ns===null&&(ns=[]),e=Zm(ns,e,i),i=ve,(ut===null?i.memoizedState:ut.next)===null&&(i=i.alternate,U.H=i===null||i.memoizedState===null?$g:ad),e}function Gr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return cl(e);if(e.$$typeof===k)return wt(e)}throw Error(s(438,String(e)))}function Iu(e){var i=null,r=ve.updateQueue;if(r!==null&&(i=r.memoCache),i==null){var c=ve.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(m){return m.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),r===null&&(r=Yr(),ve.updateQueue=r),r.memoCache=i,r=i.data[i.index],r===void 0)for(r=i.data[i.index]=Array(e),c=0;c<e;c++)r[c]=de;return i.index++,r}function Qn(e,i){return typeof i=="function"?i(e):i}function qr(e){var i=st();return Fu(i,Ye,e)}function Fu(e,i,r){var c=e.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=r;var m=e.baseQueue,p=c.pending;if(p!==null){if(m!==null){var y=m.next;m.next=p.next,p.next=y}i.baseQueue=m=p,c.pending=null}if(p=e.baseState,m===null)e.memoizedState=p;else{i=m.next;var T=y=null,D=null,V=i,q=!1;do{var Z=V.lane&-536870913;if(Z!==V.lane?(ke&Z)===Z:(Fn&Z)===Z){var Y=V.revertLane;if(Y===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),Z===Ki&&(q=!0);else if((Fn&Y)===Y){V=V.next,Y===Ki&&(q=!0);continue}else Z={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(T=D=Z,y=p):D=D.next=Z,ve.lanes|=Y,Ma|=Y;Z=V.action,ci&&r(p,Z),p=V.hasEagerState?V.eagerState:r(p,Z)}else Y={lane:Z,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},D===null?(T=D=Y,y=p):D=D.next=Y,ve.lanes|=Z,Ma|=Z;V=V.next}while(V!==null&&V!==i);if(D===null?y=p:D.next=T,!It(p,e.memoizedState)&&(dt=!0,q&&(r=Pi,r!==null)))throw r;e.memoizedState=p,e.baseState=y,e.baseQueue=D,c.lastRenderedState=p}return m===null&&(c.lanes=0),[e.memoizedState,c.dispatch]}function Qu(e){var i=st(),r=i.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=e;var c=r.dispatch,m=r.pending,p=i.memoizedState;if(m!==null){r.pending=null;var y=m=m.next;do p=e(p,y.action),y=y.next;while(y!==m);It(p,i.memoizedState)||(dt=!0),i.memoizedState=p,i.baseQueue===null&&(i.baseState=p),r.lastRenderedState=p}return[p,c]}function lg(e,i,r){var c=ve,m=st(),p=De;if(p){if(r===void 0)throw Error(s(407));r=r()}else r=i();var y=!It((Ye||m).memoizedState,r);if(y&&(m.memoizedState=r,dt=!0),m=m.queue,Pu(cg.bind(null,c,m,e),[e]),m.getSnapshot!==i||y||ut!==null&&ut.memoizedState.tag&1){if(c.flags|=2048,as(9,{destroy:void 0},og.bind(null,c,m,r,i),null),Xe===null)throw Error(s(349));p||(Fn&127)!==0||rg(c,i,r)}return r}function rg(e,i,r){e.flags|=16384,e={getSnapshot:i,value:r},i=ve.updateQueue,i===null?(i=Yr(),ve.updateQueue=i,i.stores=[e]):(r=i.stores,r===null?i.stores=[e]:r.push(e))}function og(e,i,r,c){i.value=r,i.getSnapshot=c,ug(i)&&dg(e)}function cg(e,i,r){return r(function(){ug(i)&&dg(e)})}function ug(e){var i=e.getSnapshot;e=e.value;try{var r=i();return!It(e,r)}catch{return!0}}function dg(e){var i=ei(e,2);i!==null&&Ht(i,e,2)}function Zu(e){var i=Et();if(typeof e=="function"){var r=e;if(e=r(),ci){fa(!0);try{r()}finally{fa(!1)}}}return i.memoizedState=i.baseState=e,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qn,lastRenderedState:e},i}function fg(e,i,r,c){return e.baseState=r,Fu(e,Ye,typeof c=="function"?c:Qn)}function N2(e,i,r,c,m){if(Fr(e))throw Error(s(485));if(e=i.action,e!==null){var p={payload:m,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){p.listeners.push(y)}};U.T!==null?r(!0):p.isTransition=!1,c(p),r=i.pending,r===null?(p.next=i.pending=p,hg(i,p)):(p.next=r.next,i.pending=r.next=p)}}function hg(e,i){var r=i.action,c=i.payload,m=e.state;if(i.isTransition){var p=U.T,y={};U.T=y;try{var T=r(m,c),D=U.S;D!==null&&D(y,T),mg(e,i,T)}catch(V){Ku(e,i,V)}finally{p!==null&&y.types!==null&&(p.types=y.types),U.T=p}}else try{p=r(m,c),mg(e,i,p)}catch(V){Ku(e,i,V)}}function mg(e,i,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(c){gg(e,i,c)},function(c){return Ku(e,i,c)}):gg(e,i,r)}function gg(e,i,r){i.status="fulfilled",i.value=r,pg(i),e.state=r,i=e.pending,i!==null&&(r=i.next,r===i?e.pending=null:(r=r.next,i.next=r,hg(e,r)))}function Ku(e,i,r){var c=e.pending;if(e.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=r,pg(i),i=i.next;while(i!==c)}e.action=null}function pg(e){e=e.listeners;for(var i=0;i<e.length;i++)(0,e[i])()}function xg(e,i){return i}function bg(e,i){if(De){var r=Xe.formState;if(r!==null){e:{var c=ve;if(De){if(Qe){t:{for(var m=Qe,p=dn;m.nodeType!==8;){if(!p){m=null;break t}if(m=hn(m.nextSibling),m===null){m=null;break t}}p=m.data,m=p==="F!"||p==="F"?m:null}if(m){Qe=hn(m.nextSibling),c=m.data==="F!";break e}}xa(c)}c=!1}c&&(i=r[0])}}return r=Et(),r.memoizedState=r.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xg,lastRenderedState:i},r.queue=c,r=Hg.bind(null,ve,c),c.dispatch=r,c=Zu(!1),p=nd.bind(null,ve,!1,c.queue),c=Et(),m={state:i,dispatch:null,action:e,pending:null},c.queue=m,r=N2.bind(null,ve,m,p,r),m.dispatch=r,c.memoizedState=e,[i,r,!1]}function yg(e){var i=st();return vg(i,Ye,e)}function vg(e,i,r){if(i=Fu(e,i,xg)[0],e=qr(Qn)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=cl(i)}catch(y){throw y===Wi?Rr:y}else c=i;i=st();var m=i.queue,p=m.dispatch;return r!==i.memoizedState&&(ve.flags|=2048,as(9,{destroy:void 0},M2.bind(null,m,r),null)),[c,p,e]}function M2(e,i){e.action=i}function Sg(e){var i=st(),r=Ye;if(r!==null)return vg(i,r,e);st(),i=i.memoizedState,r=st();var c=r.queue.dispatch;return r.memoizedState=e,[i,c,!1]}function as(e,i,r,c){return e={tag:e,create:r,deps:c,inst:i,next:null},i=ve.updateQueue,i===null&&(i=Yr(),ve.updateQueue=i),r=i.lastEffect,r===null?i.lastEffect=e.next=e:(c=r.next,r.next=e,e.next=c,i.lastEffect=e),e}function _g(){return st().memoizedState}function Xr(e,i,r,c){var m=Et();ve.flags|=e,m.memoizedState=as(1|i,{destroy:void 0},r,c===void 0?null:c)}function Ir(e,i,r,c){var m=st();c=c===void 0?null:c;var p=m.memoizedState.inst;Ye!==null&&c!==null&&Vu(c,Ye.memoizedState.deps)?m.memoizedState=as(i,p,r,c):(ve.flags|=e,m.memoizedState=as(1|i,p,r,c))}function wg(e,i){Xr(8390656,8,e,i)}function Pu(e,i){Ir(2048,8,e,i)}function T2(e){ve.flags|=4;var i=ve.updateQueue;if(i===null)i=Yr(),ve.updateQueue=i,i.events=[e];else{var r=i.events;r===null?i.events=[e]:r.push(e)}}function jg(e){var i=st().memoizedState;return T2({ref:i,nextImpl:e}),function(){if((Be&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function Ng(e,i){return Ir(4,2,e,i)}function Mg(e,i){return Ir(4,4,e,i)}function Tg(e,i){if(typeof i=="function"){e=e();var r=i(e);return function(){typeof r=="function"?r():i(null)}}if(i!=null)return e=e(),i.current=e,function(){i.current=null}}function kg(e,i,r){r=r!=null?r.concat([e]):null,Ir(4,4,Tg.bind(null,i,e),r)}function Wu(){}function Cg(e,i){var r=st();i=i===void 0?null:i;var c=r.memoizedState;return i!==null&&Vu(i,c[1])?c[0]:(r.memoizedState=[e,i],e)}function Eg(e,i){var r=st();i=i===void 0?null:i;var c=r.memoizedState;if(i!==null&&Vu(i,c[1]))return c[0];if(c=e(),ci){fa(!0);try{e()}finally{fa(!1)}}return r.memoizedState=[c,i],c}function Ju(e,i,r){return r===void 0||(Fn&1073741824)!==0&&(ke&261930)===0?e.memoizedState=i:(e.memoizedState=r,e=A0(),ve.lanes|=e,Ma|=e,r)}function Ag(e,i,r,c){return It(r,i)?r:es.current!==null?(e=Ju(e,r,c),It(e,i)||(dt=!0),e):(Fn&42)===0||(Fn&1073741824)!==0&&(ke&261930)===0?(dt=!0,e.memoizedState=r):(e=A0(),ve.lanes|=e,Ma|=e,i)}function Dg(e,i,r,c,m){var p=K.p;K.p=p!==0&&8>p?p:8;var y=U.T,T={};U.T=T,nd(e,!1,i,r);try{var D=m(),V=U.S;if(V!==null&&V(T,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var q=_2(D,c);ul(e,i,q,Wt(e))}else ul(e,i,c,Wt(e))}catch(Z){ul(e,i,{then:function(){},status:"rejected",reason:Z},Wt())}finally{K.p=p,y!==null&&T.types!==null&&(y.types=T.types),U.T=y}}function k2(){}function ed(e,i,r,c){if(e.tag!==5)throw Error(s(476));var m=zg(e).queue;Dg(e,m,i,fe,r===null?k2:function(){return Rg(e),r(c)})}function zg(e){var i=e.memoizedState;if(i!==null)return i;i={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qn,lastRenderedState:fe},next:null};var r={};return i.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qn,lastRenderedState:r},next:null},e.memoizedState=i,e=e.alternate,e!==null&&(e.memoizedState=i),i}function Rg(e){var i=zg(e);i.next===null&&(i=e.alternate.memoizedState),ul(e,i.next.queue,{},Wt())}function td(){return wt(Tl)}function Og(){return st().memoizedState}function Lg(){return st().memoizedState}function C2(e){for(var i=e.return;i!==null;){switch(i.tag){case 24:case 3:var r=Wt();e=va(r);var c=Sa(i,e,r);c!==null&&(Ht(c,i,r),sl(c,i,r)),i={cache:Eu()},e.payload=i;return}i=i.return}}function E2(e,i,r){var c=Wt();r={lane:c,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Fr(e)?Bg(i,r):(r=yu(e,i,r,c),r!==null&&(Ht(r,e,c),Ug(r,i,c)))}function Hg(e,i,r){var c=Wt();ul(e,i,r,c)}function ul(e,i,r,c){var m={lane:c,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Fr(e))Bg(i,m);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=i.lastRenderedReducer,p!==null))try{var y=i.lastRenderedState,T=p(y,r);if(m.hasEagerState=!0,m.eagerState=T,It(T,y))return Tr(e,i,m,0),Xe===null&&Mr(),!1}catch{}finally{}if(r=yu(e,i,m,c),r!==null)return Ht(r,e,c),Ug(r,i,c),!0}return!1}function nd(e,i,r,c){if(c={lane:2,revertLane:Rd(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Fr(e)){if(i)throw Error(s(479))}else i=yu(e,r,c,2),i!==null&&Ht(i,e,2)}function Fr(e){var i=e.alternate;return e===ve||i!==null&&i===ve}function Bg(e,i){ts=$r=!0;var r=e.pending;r===null?i.next=i:(i.next=r.next,r.next=i),e.pending=i}function Ug(e,i,r){if((r&4194048)!==0){var c=i.lanes;c&=e.pendingLanes,r|=c,i.lanes=r,qh(e,r)}}var dl={readContext:wt,use:Gr,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useLayoutEffect:nt,useInsertionEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useSyncExternalStore:nt,useId:nt,useHostTransitionStatus:nt,useFormState:nt,useActionState:nt,useOptimistic:nt,useMemoCache:nt,useCacheRefresh:nt};dl.useEffectEvent=nt;var $g={readContext:wt,use:Gr,useCallback:function(e,i){return Et().memoizedState=[e,i===void 0?null:i],e},useContext:wt,useEffect:wg,useImperativeHandle:function(e,i,r){r=r!=null?r.concat([e]):null,Xr(4194308,4,Tg.bind(null,i,e),r)},useLayoutEffect:function(e,i){return Xr(4194308,4,e,i)},useInsertionEffect:function(e,i){Xr(4,2,e,i)},useMemo:function(e,i){var r=Et();i=i===void 0?null:i;var c=e();if(ci){fa(!0);try{e()}finally{fa(!1)}}return r.memoizedState=[c,i],c},useReducer:function(e,i,r){var c=Et();if(r!==void 0){var m=r(i);if(ci){fa(!0);try{r(i)}finally{fa(!1)}}}else m=i;return c.memoizedState=c.baseState=m,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:m},c.queue=e,e=e.dispatch=E2.bind(null,ve,e),[c.memoizedState,e]},useRef:function(e){var i=Et();return e={current:e},i.memoizedState=e},useState:function(e){e=Zu(e);var i=e.queue,r=Hg.bind(null,ve,i);return i.dispatch=r,[e.memoizedState,r]},useDebugValue:Wu,useDeferredValue:function(e,i){var r=Et();return Ju(r,e,i)},useTransition:function(){var e=Zu(!1);return e=Dg.bind(null,ve,e.queue,!0,!1),Et().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,i,r){var c=ve,m=Et();if(De){if(r===void 0)throw Error(s(407));r=r()}else{if(r=i(),Xe===null)throw Error(s(349));(ke&127)!==0||rg(c,i,r)}m.memoizedState=r;var p={value:r,getSnapshot:i};return m.queue=p,wg(cg.bind(null,c,p,e),[e]),c.flags|=2048,as(9,{destroy:void 0},og.bind(null,c,p,r,i),null),r},useId:function(){var e=Et(),i=Xe.identifierPrefix;if(De){var r=En,c=Cn;r=(c&~(1<<32-Xt(c)-1)).toString(32)+r,i="_"+i+"R_"+r,r=Vr++,0<r&&(i+="H"+r.toString(32)),i+="_"}else r=w2++,i="_"+i+"r_"+r.toString(32)+"_";return e.memoizedState=i},useHostTransitionStatus:td,useFormState:bg,useActionState:bg,useOptimistic:function(e){var i=Et();i.memoizedState=i.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=r,i=nd.bind(null,ve,!0,r),r.dispatch=i,[e,i]},useMemoCache:Iu,useCacheRefresh:function(){return Et().memoizedState=C2.bind(null,ve)},useEffectEvent:function(e){var i=Et(),r={impl:e};return i.memoizedState=r,function(){if((Be&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}},ad={readContext:wt,use:Gr,useCallback:Cg,useContext:wt,useEffect:Pu,useImperativeHandle:kg,useInsertionEffect:Ng,useLayoutEffect:Mg,useMemo:Eg,useReducer:qr,useRef:_g,useState:function(){return qr(Qn)},useDebugValue:Wu,useDeferredValue:function(e,i){var r=st();return Ag(r,Ye.memoizedState,e,i)},useTransition:function(){var e=qr(Qn)[0],i=st().memoizedState;return[typeof e=="boolean"?e:cl(e),i]},useSyncExternalStore:lg,useId:Og,useHostTransitionStatus:td,useFormState:yg,useActionState:yg,useOptimistic:function(e,i){var r=st();return fg(r,Ye,e,i)},useMemoCache:Iu,useCacheRefresh:Lg};ad.useEffectEvent=jg;var Vg={readContext:wt,use:Gr,useCallback:Cg,useContext:wt,useEffect:Pu,useImperativeHandle:kg,useInsertionEffect:Ng,useLayoutEffect:Mg,useMemo:Eg,useReducer:Qu,useRef:_g,useState:function(){return Qu(Qn)},useDebugValue:Wu,useDeferredValue:function(e,i){var r=st();return Ye===null?Ju(r,e,i):Ag(r,Ye.memoizedState,e,i)},useTransition:function(){var e=Qu(Qn)[0],i=st().memoizedState;return[typeof e=="boolean"?e:cl(e),i]},useSyncExternalStore:lg,useId:Og,useHostTransitionStatus:td,useFormState:Sg,useActionState:Sg,useOptimistic:function(e,i){var r=st();return Ye!==null?fg(r,Ye,e,i):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Iu,useCacheRefresh:Lg};Vg.useEffectEvent=jg;function id(e,i,r,c){i=e.memoizedState,r=r(c,i),r=r==null?i:b({},i,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var sd={enqueueSetState:function(e,i,r){e=e._reactInternals;var c=Wt(),m=va(c);m.payload=i,r!=null&&(m.callback=r),i=Sa(e,m,c),i!==null&&(Ht(i,e,c),sl(i,e,c))},enqueueReplaceState:function(e,i,r){e=e._reactInternals;var c=Wt(),m=va(c);m.tag=1,m.payload=i,r!=null&&(m.callback=r),i=Sa(e,m,c),i!==null&&(Ht(i,e,c),sl(i,e,c))},enqueueForceUpdate:function(e,i){e=e._reactInternals;var r=Wt(),c=va(r);c.tag=2,i!=null&&(c.callback=i),i=Sa(e,c,r),i!==null&&(Ht(i,e,r),sl(i,e,r))}};function Yg(e,i,r,c,m,p,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(c,p,y):i.prototype&&i.prototype.isPureReactComponent?!Ps(r,c)||!Ps(m,p):!0}function Gg(e,i,r,c){e=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(r,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(r,c),i.state!==e&&sd.enqueueReplaceState(i,i.state,null)}function ui(e,i){var r=i;if("ref"in i){r={};for(var c in i)c!=="ref"&&(r[c]=i[c])}if(e=e.defaultProps){r===i&&(r=b({},r));for(var m in e)r[m]===void 0&&(r[m]=e[m])}return r}function qg(e){Nr(e)}function Xg(e){console.error(e)}function Ig(e){Nr(e)}function Qr(e,i){try{var r=e.onUncaughtError;r(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function Fg(e,i,r){try{var c=e.onCaughtError;c(r.value,{componentStack:r.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function ld(e,i,r){return r=va(r),r.tag=3,r.payload={element:null},r.callback=function(){Qr(e,i)},r}function Qg(e){return e=va(e),e.tag=3,e}function Zg(e,i,r,c){var m=r.type.getDerivedStateFromError;if(typeof m=="function"){var p=c.value;e.payload=function(){return m(p)},e.callback=function(){Fg(i,r,c)}}var y=r.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){Fg(i,r,c),typeof m!="function"&&(Ta===null?Ta=new Set([this]):Ta.add(this));var T=c.stack;this.componentDidCatch(c.value,{componentStack:T!==null?T:""})})}function A2(e,i,r,c,m){if(r.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=r.alternate,i!==null&&Zi(i,r,m,!0),r=Qt.current,r!==null){switch(r.tag){case 31:case 13:return fn===null?lo():r.alternate===null&&at===0&&(at=3),r.flags&=-257,r.flags|=65536,r.lanes=m,c===Or?r.flags|=16384:(i=r.updateQueue,i===null?r.updateQueue=new Set([c]):i.add(c),Ad(e,c,m)),!1;case 22:return r.flags|=65536,c===Or?r.flags|=16384:(i=r.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},r.updateQueue=i):(r=i.retryQueue,r===null?i.retryQueue=new Set([c]):r.add(c)),Ad(e,c,m)),!1}throw Error(s(435,r.tag))}return Ad(e,c,m),lo(),!1}if(De)return i=Qt.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=m,c!==Nu&&(e=Error(s(422),{cause:c}),el(on(e,r)))):(c!==Nu&&(i=Error(s(423),{cause:c}),el(on(i,r))),e=e.current.alternate,e.flags|=65536,m&=-m,e.lanes|=m,c=on(c,r),m=ld(e.stateNode,c,m),Lu(e,m),at!==4&&(at=2)),!1;var p=Error(s(520),{cause:c});if(p=on(p,r),yl===null?yl=[p]:yl.push(p),at!==4&&(at=2),i===null)return!0;c=on(c,r),r=i;do{switch(r.tag){case 3:return r.flags|=65536,e=m&-m,r.lanes|=e,e=ld(r.stateNode,c,e),Lu(r,e),!1;case 1:if(i=r.type,p=r.stateNode,(r.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Ta===null||!Ta.has(p))))return r.flags|=65536,m&=-m,r.lanes|=m,m=Qg(m),Zg(m,e,r,c),Lu(r,m),!1}r=r.return}while(r!==null);return!1}var rd=Error(s(461)),dt=!1;function jt(e,i,r,c){i.child=e===null?Jm(i,null,r,c):oi(i,e.child,r,c)}function Kg(e,i,r,c,m){r=r.render;var p=i.ref;if("ref"in c){var y={};for(var T in c)T!=="ref"&&(y[T]=c[T])}else y=c;return ii(i),c=Yu(e,i,r,y,p,m),T=Gu(),e!==null&&!dt?(qu(e,i,m),Zn(e,i,m)):(De&&T&&wu(i),i.flags|=1,jt(e,i,c,m),i.child)}function Pg(e,i,r,c,m){if(e===null){var p=r.type;return typeof p=="function"&&!vu(p)&&p.defaultProps===void 0&&r.compare===null?(i.tag=15,i.type=p,Wg(e,i,p,c,m)):(e=Cr(r.type,null,c,i,i.mode,m),e.ref=i.ref,e.return=i,i.child=e)}if(p=e.child,!gd(e,m)){var y=p.memoizedProps;if(r=r.compare,r=r!==null?r:Ps,r(y,c)&&e.ref===i.ref)return Zn(e,i,m)}return i.flags|=1,e=Gn(p,c),e.ref=i.ref,e.return=i,i.child=e}function Wg(e,i,r,c,m){if(e!==null){var p=e.memoizedProps;if(Ps(p,c)&&e.ref===i.ref)if(dt=!1,i.pendingProps=c=p,gd(e,m))(e.flags&131072)!==0&&(dt=!0);else return i.lanes=e.lanes,Zn(e,i,m)}return od(e,i,r,c,m)}function Jg(e,i,r,c){var m=c.children,p=e!==null?e.memoizedState:null;if(e===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(p=p!==null?p.baseLanes|r:r,e!==null){for(c=i.child=e.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~p}else c=0,i.child=null;return e0(e,i,p,r,c)}if((r&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},e!==null&&zr(i,p!==null?p.cachePool:null),p!==null?ng(i,p):Bu(),ag(i);else return c=i.lanes=536870912,e0(e,i,p!==null?p.baseLanes|r:r,r,c)}else p!==null?(zr(i,p.cachePool),ng(i,p),wa(),i.memoizedState=null):(e!==null&&zr(i,null),Bu(),wa());return jt(e,i,m,r),i.child}function fl(e,i){return e!==null&&e.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function e0(e,i,r,c,m){var p=Du();return p=p===null?null:{parent:ct._currentValue,pool:p},i.memoizedState={baseLanes:r,cachePool:p},e!==null&&zr(i,null),Bu(),ag(i),e!==null&&Zi(e,i,c,!0),i.childLanes=m,null}function Zr(e,i){return i=Pr({mode:i.mode,children:i.children},e.mode),i.ref=e.ref,e.child=i,i.return=e,i}function t0(e,i,r){return oi(i,e.child,null,r),e=Zr(i,i.pendingProps),e.flags|=2,Zt(i),i.memoizedState=null,e}function D2(e,i,r){var c=i.pendingProps,m=(i.flags&128)!==0;if(i.flags&=-129,e===null){if(De){if(c.mode==="hidden")return e=Zr(i,c),i.lanes=536870912,fl(null,e);if($u(i),(e=Qe)?(e=hp(e,dn),e=e!==null&&e.data==="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:ga!==null?{id:Cn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},r=Bm(e),r.return=i,i.child=r,_t=i,Qe=null)):e=null,e===null)throw xa(i);return i.lanes=536870912,null}return Zr(i,c)}var p=e.memoizedState;if(p!==null){var y=p.dehydrated;if($u(i),m)if(i.flags&256)i.flags&=-257,i=t0(e,i,r);else if(i.memoizedState!==null)i.child=e.child,i.flags|=128,i=null;else throw Error(s(558));else if(dt||Zi(e,i,r,!1),m=(r&e.childLanes)!==0,dt||m){if(c=Xe,c!==null&&(y=Xh(c,r),y!==0&&y!==p.retryLane))throw p.retryLane=y,ei(e,y),Ht(c,e,y),rd;lo(),i=t0(e,i,r)}else e=p.treeContext,Qe=hn(y.nextSibling),_t=i,De=!0,pa=null,dn=!1,e!==null&&Vm(i,e),i=Zr(i,c),i.flags|=4096;return i}return e=Gn(e.child,{mode:c.mode,children:c.children}),e.ref=i.ref,i.child=e,e.return=i,e}function Kr(e,i){var r=i.ref;if(r===null)e!==null&&e.ref!==null&&(i.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(s(284));(e===null||e.ref!==r)&&(i.flags|=4194816)}}function od(e,i,r,c,m){return ii(i),r=Yu(e,i,r,c,void 0,m),c=Gu(),e!==null&&!dt?(qu(e,i,m),Zn(e,i,m)):(De&&c&&wu(i),i.flags|=1,jt(e,i,r,m),i.child)}function n0(e,i,r,c,m,p){return ii(i),i.updateQueue=null,r=sg(i,c,r,m),ig(e),c=Gu(),e!==null&&!dt?(qu(e,i,p),Zn(e,i,p)):(De&&c&&wu(i),i.flags|=1,jt(e,i,r,p),i.child)}function a0(e,i,r,c,m){if(ii(i),i.stateNode===null){var p=Xi,y=r.contextType;typeof y=="object"&&y!==null&&(p=wt(y)),p=new r(c,p),i.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=sd,i.stateNode=p,p._reactInternals=i,p=i.stateNode,p.props=c,p.state=i.memoizedState,p.refs={},Ru(i),y=r.contextType,p.context=typeof y=="object"&&y!==null?wt(y):Xi,p.state=i.memoizedState,y=r.getDerivedStateFromProps,typeof y=="function"&&(id(i,r,y,c),p.state=i.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(y=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),y!==p.state&&sd.enqueueReplaceState(p,p.state,null),rl(i,c,p,m),ll(),p.state=i.memoizedState),typeof p.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(e===null){p=i.stateNode;var T=i.memoizedProps,D=ui(r,T);p.props=D;var V=p.context,q=r.contextType;y=Xi,typeof q=="object"&&q!==null&&(y=wt(q));var Z=r.getDerivedStateFromProps;q=typeof Z=="function"||typeof p.getSnapshotBeforeUpdate=="function",T=i.pendingProps!==T,q||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(T||V!==y)&&Gg(i,p,c,y),ya=!1;var Y=i.memoizedState;p.state=Y,rl(i,c,p,m),ll(),V=i.memoizedState,T||Y!==V||ya?(typeof Z=="function"&&(id(i,r,Z,c),V=i.memoizedState),(D=ya||Yg(i,r,D,c,Y,V,y))?(q||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(i.flags|=4194308)):(typeof p.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=V),p.props=c,p.state=V,p.context=y,c=D):(typeof p.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{p=i.stateNode,Ou(e,i),y=i.memoizedProps,q=ui(r,y),p.props=q,Z=i.pendingProps,Y=p.context,V=r.contextType,D=Xi,typeof V=="object"&&V!==null&&(D=wt(V)),T=r.getDerivedStateFromProps,(V=typeof T=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(y!==Z||Y!==D)&&Gg(i,p,c,D),ya=!1,Y=i.memoizedState,p.state=Y,rl(i,c,p,m),ll();var G=i.memoizedState;y!==Z||Y!==G||ya||e!==null&&e.dependencies!==null&&Ar(e.dependencies)?(typeof T=="function"&&(id(i,r,T,c),G=i.memoizedState),(q=ya||Yg(i,r,q,c,Y,G,D)||e!==null&&e.dependencies!==null&&Ar(e.dependencies))?(V||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(c,G,D),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(c,G,D)),typeof p.componentDidUpdate=="function"&&(i.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof p.componentDidUpdate!="function"||y===e.memoizedProps&&Y===e.memoizedState||(i.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&Y===e.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=G),p.props=c,p.state=G,p.context=D,c=q):(typeof p.componentDidUpdate!="function"||y===e.memoizedProps&&Y===e.memoizedState||(i.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&Y===e.memoizedState||(i.flags|=1024),c=!1)}return p=c,Kr(e,i),c=(i.flags&128)!==0,p||c?(p=i.stateNode,r=c&&typeof r.getDerivedStateFromError!="function"?null:p.render(),i.flags|=1,e!==null&&c?(i.child=oi(i,e.child,null,m),i.child=oi(i,null,r,m)):jt(e,i,r,m),i.memoizedState=p.state,e=i.child):e=Zn(e,i,m),e}function i0(e,i,r,c){return ni(),i.flags|=256,jt(e,i,r,c),i.child}var cd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ud(e){return{baseLanes:e,cachePool:Fm()}}function dd(e,i,r){return e=e!==null?e.childLanes&~r:0,i&&(e|=Pt),e}function s0(e,i,r){var c=i.pendingProps,m=!1,p=(i.flags&128)!==0,y;if((y=p)||(y=e!==null&&e.memoizedState===null?!1:(it.current&2)!==0),y&&(m=!0,i.flags&=-129),y=(i.flags&32)!==0,i.flags&=-33,e===null){if(De){if(m?_a(i):wa(),(e=Qe)?(e=hp(e,dn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:ga!==null?{id:Cn,overflow:En}:null,retryLane:536870912,hydrationErrors:null},r=Bm(e),r.return=i,i.child=r,_t=i,Qe=null)):e=null,e===null)throw xa(i);return Fd(e)?i.lanes=32:i.lanes=536870912,null}var T=c.children;return c=c.fallback,m?(wa(),m=i.mode,T=Pr({mode:"hidden",children:T},m),c=ti(c,m,r,null),T.return=i,c.return=i,T.sibling=c,i.child=T,c=i.child,c.memoizedState=ud(r),c.childLanes=dd(e,y,r),i.memoizedState=cd,fl(null,c)):(_a(i),fd(i,T))}var D=e.memoizedState;if(D!==null&&(T=D.dehydrated,T!==null)){if(p)i.flags&256?(_a(i),i.flags&=-257,i=hd(e,i,r)):i.memoizedState!==null?(wa(),i.child=e.child,i.flags|=128,i=null):(wa(),T=c.fallback,m=i.mode,c=Pr({mode:"visible",children:c.children},m),T=ti(T,m,r,null),T.flags|=2,c.return=i,T.return=i,c.sibling=T,i.child=c,oi(i,e.child,null,r),c=i.child,c.memoizedState=ud(r),c.childLanes=dd(e,y,r),i.memoizedState=cd,i=fl(null,c));else if(_a(i),Fd(T)){if(y=T.nextSibling&&T.nextSibling.dataset,y)var V=y.dgst;y=V,c=Error(s(419)),c.stack="",c.digest=y,el({value:c,source:null,stack:null}),i=hd(e,i,r)}else if(dt||Zi(e,i,r,!1),y=(r&e.childLanes)!==0,dt||y){if(y=Xe,y!==null&&(c=Xh(y,r),c!==0&&c!==D.retryLane))throw D.retryLane=c,ei(e,c),Ht(y,e,c),rd;Id(T)||lo(),i=hd(e,i,r)}else Id(T)?(i.flags|=192,i.child=e.child,i=null):(e=D.treeContext,Qe=hn(T.nextSibling),_t=i,De=!0,pa=null,dn=!1,e!==null&&Vm(i,e),i=fd(i,c.children),i.flags|=4096);return i}return m?(wa(),T=c.fallback,m=i.mode,D=e.child,V=D.sibling,c=Gn(D,{mode:"hidden",children:c.children}),c.subtreeFlags=D.subtreeFlags&65011712,V!==null?T=Gn(V,T):(T=ti(T,m,r,null),T.flags|=2),T.return=i,c.return=i,c.sibling=T,i.child=c,fl(null,c),c=i.child,T=e.child.memoizedState,T===null?T=ud(r):(m=T.cachePool,m!==null?(D=ct._currentValue,m=m.parent!==D?{parent:D,pool:D}:m):m=Fm(),T={baseLanes:T.baseLanes|r,cachePool:m}),c.memoizedState=T,c.childLanes=dd(e,y,r),i.memoizedState=cd,fl(e.child,c)):(_a(i),r=e.child,e=r.sibling,r=Gn(r,{mode:"visible",children:c.children}),r.return=i,r.sibling=null,e!==null&&(y=i.deletions,y===null?(i.deletions=[e],i.flags|=16):y.push(e)),i.child=r,i.memoizedState=null,r)}function fd(e,i){return i=Pr({mode:"visible",children:i},e.mode),i.return=e,e.child=i}function Pr(e,i){return e=Ft(22,e,null,i),e.lanes=0,e}function hd(e,i,r){return oi(i,e.child,null,r),e=fd(i,i.pendingProps.children),e.flags|=2,i.memoizedState=null,e}function l0(e,i,r){e.lanes|=i;var c=e.alternate;c!==null&&(c.lanes|=i),ku(e.return,i,r)}function md(e,i,r,c,m,p){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:r,tailMode:m,treeForkCount:p}:(y.isBackwards=i,y.rendering=null,y.renderingStartTime=0,y.last=c,y.tail=r,y.tailMode=m,y.treeForkCount=p)}function r0(e,i,r){var c=i.pendingProps,m=c.revealOrder,p=c.tail;c=c.children;var y=it.current,T=(y&2)!==0;if(T?(y=y&1|2,i.flags|=128):y&=1,W(it,y),jt(e,i,c,r),c=De?Js:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=i.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&l0(e,r,i);else if(e.tag===19)l0(e,r,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break e;for(;e.sibling===null;){if(e.return===null||e.return===i)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(m){case"forwards":for(r=i.child,m=null;r!==null;)e=r.alternate,e!==null&&Ur(e)===null&&(m=r),r=r.sibling;r=m,r===null?(m=i.child,i.child=null):(m=r.sibling,r.sibling=null),md(i,!1,m,r,p,c);break;case"backwards":case"unstable_legacy-backwards":for(r=null,m=i.child,i.child=null;m!==null;){if(e=m.alternate,e!==null&&Ur(e)===null){i.child=m;break}e=m.sibling,m.sibling=r,r=m,m=e}md(i,!0,r,null,p,c);break;case"together":md(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function Zn(e,i,r){if(e!==null&&(i.dependencies=e.dependencies),Ma|=i.lanes,(r&i.childLanes)===0)if(e!==null){if(Zi(e,i,r,!1),(r&i.childLanes)===0)return null}else return null;if(e!==null&&i.child!==e.child)throw Error(s(153));if(i.child!==null){for(e=i.child,r=Gn(e,e.pendingProps),i.child=r,r.return=i;e.sibling!==null;)e=e.sibling,r=r.sibling=Gn(e,e.pendingProps),r.return=i;r.sibling=null}return i.child}function gd(e,i){return(e.lanes&i)!==0?!0:(e=e.dependencies,!!(e!==null&&Ar(e)))}function z2(e,i,r){switch(i.tag){case 3:rt(i,i.stateNode.containerInfo),ba(i,ct,e.memoizedState.cache),ni();break;case 27:case 5:kn(i);break;case 4:rt(i,i.stateNode.containerInfo);break;case 10:ba(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,$u(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(_a(i),i.flags|=128,null):(r&i.child.childLanes)!==0?s0(e,i,r):(_a(i),e=Zn(e,i,r),e!==null?e.sibling:null);_a(i);break;case 19:var m=(e.flags&128)!==0;if(c=(r&i.childLanes)!==0,c||(Zi(e,i,r,!1),c=(r&i.childLanes)!==0),m){if(c)return r0(e,i,r);i.flags|=128}if(m=i.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),W(it,it.current),c)break;return null;case 22:return i.lanes=0,Jg(e,i,r,i.pendingProps);case 24:ba(i,ct,e.memoizedState.cache)}return Zn(e,i,r)}function o0(e,i,r){if(e!==null)if(e.memoizedProps!==i.pendingProps)dt=!0;else{if(!gd(e,r)&&(i.flags&128)===0)return dt=!1,z2(e,i,r);dt=(e.flags&131072)!==0}else dt=!1,De&&(i.flags&1048576)!==0&&$m(i,Js,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(e=li(i.elementType),i.type=e,typeof e=="function")vu(e)?(c=ui(e,c),i.tag=1,i=a0(null,i,e,c,r)):(i.tag=0,i=od(null,i,e,c,r));else{if(e!=null){var m=e.$$typeof;if(m===E){i.tag=11,i=Kg(null,i,e,c,r);break e}else if(m===L){i.tag=14,i=Pg(null,i,e,c,r);break e}}throw i=Oe(e)||e,Error(s(306,i,""))}}return i;case 0:return od(e,i,i.type,i.pendingProps,r);case 1:return c=i.type,m=ui(c,i.pendingProps),a0(e,i,c,m,r);case 3:e:{if(rt(i,i.stateNode.containerInfo),e===null)throw Error(s(387));c=i.pendingProps;var p=i.memoizedState;m=p.element,Ou(e,i),rl(i,c,null,r);var y=i.memoizedState;if(c=y.cache,ba(i,ct,c),c!==p.cache&&Cu(i,[ct],r,!0),ll(),c=y.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:y.cache},i.updateQueue.baseState=p,i.memoizedState=p,i.flags&256){i=i0(e,i,c,r);break e}else if(c!==m){m=on(Error(s(424)),i),el(m),i=i0(e,i,c,r);break e}else{switch(e=i.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Qe=hn(e.firstChild),_t=i,De=!0,pa=null,dn=!0,r=Jm(i,null,c,r),i.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ni(),c===m){i=Zn(e,i,r);break e}jt(e,i,c,r)}i=i.child}return i;case 26:return Kr(e,i),e===null?(r=yp(i.type,null,i.pendingProps,null))?i.memoizedState=r:De||(r=i.type,e=i.pendingProps,c=mo(le.current).createElement(r),c[St]=i,c[At]=e,Nt(c,r,e),bt(c),i.stateNode=c):i.memoizedState=yp(i.type,e.memoizedProps,i.pendingProps,e.memoizedState),null;case 27:return kn(i),e===null&&De&&(c=i.stateNode=pp(i.type,i.pendingProps,le.current),_t=i,dn=!0,m=Qe,Aa(i.type)?(Qd=m,Qe=hn(c.firstChild)):Qe=m),jt(e,i,i.pendingProps.children,r),Kr(e,i),e===null&&(i.flags|=4194304),i.child;case 5:return e===null&&De&&((m=c=Qe)&&(c=cS(c,i.type,i.pendingProps,dn),c!==null?(i.stateNode=c,_t=i,Qe=hn(c.firstChild),dn=!1,m=!0):m=!1),m||xa(i)),kn(i),m=i.type,p=i.pendingProps,y=e!==null?e.memoizedProps:null,c=p.children,Gd(m,p)?c=null:y!==null&&Gd(m,y)&&(i.flags|=32),i.memoizedState!==null&&(m=Yu(e,i,j2,null,null,r),Tl._currentValue=m),Kr(e,i),jt(e,i,c,r),i.child;case 6:return e===null&&De&&((e=r=Qe)&&(r=uS(r,i.pendingProps,dn),r!==null?(i.stateNode=r,_t=i,Qe=null,e=!0):e=!1),e||xa(i)),null;case 13:return s0(e,i,r);case 4:return rt(i,i.stateNode.containerInfo),c=i.pendingProps,e===null?i.child=oi(i,null,c,r):jt(e,i,c,r),i.child;case 11:return Kg(e,i,i.type,i.pendingProps,r);case 7:return jt(e,i,i.pendingProps,r),i.child;case 8:return jt(e,i,i.pendingProps.children,r),i.child;case 12:return jt(e,i,i.pendingProps.children,r),i.child;case 10:return c=i.pendingProps,ba(i,i.type,c.value),jt(e,i,c.children,r),i.child;case 9:return m=i.type._context,c=i.pendingProps.children,ii(i),m=wt(m),c=c(m),i.flags|=1,jt(e,i,c,r),i.child;case 14:return Pg(e,i,i.type,i.pendingProps,r);case 15:return Wg(e,i,i.type,i.pendingProps,r);case 19:return r0(e,i,r);case 31:return D2(e,i,r);case 22:return Jg(e,i,r,i.pendingProps);case 24:return ii(i),c=wt(ct),e===null?(m=Du(),m===null&&(m=Xe,p=Eu(),m.pooledCache=p,p.refCount++,p!==null&&(m.pooledCacheLanes|=r),m=p),i.memoizedState={parent:c,cache:m},Ru(i),ba(i,ct,m)):((e.lanes&r)!==0&&(Ou(e,i),rl(i,null,null,r),ll()),m=e.memoizedState,p=i.memoizedState,m.parent!==c?(m={parent:c,cache:c},i.memoizedState=m,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=m),ba(i,ct,c)):(c=p.cache,ba(i,ct,c),c!==m.cache&&Cu(i,[ct],r,!0))),jt(e,i,i.pendingProps.children,r),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function Kn(e){e.flags|=4}function pd(e,i,r,c,m){if((i=(e.mode&32)!==0)&&(i=!1),i){if(e.flags|=16777216,(m&335544128)===m)if(e.stateNode.complete)e.flags|=8192;else if(O0())e.flags|=8192;else throw ri=Or,zu}else e.flags&=-16777217}function c0(e,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!jp(i))if(O0())e.flags|=8192;else throw ri=Or,zu}function Wr(e,i){i!==null&&(e.flags|=4),e.flags&16384&&(i=e.tag!==22?Yh():536870912,e.lanes|=i,rs|=i)}function hl(e,i){if(!De)switch(e.tailMode){case"hidden":i=e.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var c=null;r!==null;)r.alternate!==null&&(c=r),r=r.sibling;c===null?i||e.tail===null?e.tail=null:e.tail.sibling=null:c.sibling=null}}function Ze(e){var i=e.alternate!==null&&e.alternate.child===e.child,r=0,c=0;if(i)for(var m=e.child;m!==null;)r|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=e,m=m.sibling;else for(m=e.child;m!==null;)r|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=e,m=m.sibling;return e.subtreeFlags|=c,e.childLanes=r,i}function R2(e,i,r){var c=i.pendingProps;switch(ju(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(i),null;case 1:return Ze(i),null;case 3:return r=i.stateNode,c=null,e!==null&&(c=e.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),In(ct),ye(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Qi(i)?Kn(i):e===null||e.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Mu())),Ze(i),null;case 26:var m=i.type,p=i.memoizedState;return e===null?(Kn(i),p!==null?(Ze(i),c0(i,p)):(Ze(i),pd(i,m,null,c,r))):p?p!==e.memoizedState?(Kn(i),Ze(i),c0(i,p)):(Ze(i),i.flags&=-16777217):(e=e.memoizedProps,e!==c&&Kn(i),Ze(i),pd(i,m,e,c,r)),null;case 27:if(re(i),r=le.current,m=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==c&&Kn(i);else{if(!c){if(i.stateNode===null)throw Error(s(166));return Ze(i),null}e=ee.current,Qi(i)?Ym(i):(e=pp(m,c,r),i.stateNode=e,Kn(i))}return Ze(i),null;case 5:if(re(i),m=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==c&&Kn(i);else{if(!c){if(i.stateNode===null)throw Error(s(166));return Ze(i),null}if(p=ee.current,Qi(i))Ym(i);else{var y=mo(le.current);switch(p){case 1:p=y.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:p=y.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":p=y.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":p=y.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":p=y.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof c.is=="string"?y.createElement("select",{is:c.is}):y.createElement("select"),c.multiple?p.multiple=!0:c.size&&(p.size=c.size);break;default:p=typeof c.is=="string"?y.createElement(m,{is:c.is}):y.createElement(m)}}p[St]=i,p[At]=c;e:for(y=i.child;y!==null;){if(y.tag===5||y.tag===6)p.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===i)break e;for(;y.sibling===null;){if(y.return===null||y.return===i)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}i.stateNode=p;e:switch(Nt(p,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Kn(i)}}return Ze(i),pd(i,i.type,e===null?null:e.memoizedProps,i.pendingProps,r),null;case 6:if(e&&i.stateNode!=null)e.memoizedProps!==c&&Kn(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(s(166));if(e=le.current,Qi(i)){if(e=i.stateNode,r=i.memoizedProps,c=null,m=_t,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}e[St]=i,e=!!(e.nodeValue===r||c!==null&&c.suppressHydrationWarning===!0||sp(e.nodeValue,r)),e||xa(i,!0)}else e=mo(e).createTextNode(c),e[St]=i,i.stateNode=e}return Ze(i),null;case 31:if(r=i.memoizedState,e===null||e.memoizedState!==null){if(c=Qi(i),r!==null){if(e===null){if(!c)throw Error(s(318));if(e=i.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[St]=i}else ni(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ze(i),e=!1}else r=Mu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return i.flags&256?(Zt(i),i):(Zt(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Ze(i),null;case 13:if(c=i.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(m=Qi(i),c!==null&&c.dehydrated!==null){if(e===null){if(!m)throw Error(s(318));if(m=i.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(s(317));m[St]=i}else ni(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ze(i),m=!1}else m=Mu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=m),m=!0;if(!m)return i.flags&256?(Zt(i),i):(Zt(i),null)}return Zt(i),(i.flags&128)!==0?(i.lanes=r,i):(r=c!==null,e=e!==null&&e.memoizedState!==null,r&&(c=i.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),p=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),p!==m&&(c.flags|=2048)),r!==e&&r&&(i.child.flags|=8192),Wr(i,i.updateQueue),Ze(i),null);case 4:return ye(),e===null&&Bd(i.stateNode.containerInfo),Ze(i),null;case 10:return In(i.type),Ze(i),null;case 19:if(I(it),c=i.memoizedState,c===null)return Ze(i),null;if(m=(i.flags&128)!==0,p=c.rendering,p===null)if(m)hl(c,!1);else{if(at!==0||e!==null&&(e.flags&128)!==0)for(e=i.child;e!==null;){if(p=Ur(e),p!==null){for(i.flags|=128,hl(c,!1),e=p.updateQueue,i.updateQueue=e,Wr(i,e),i.subtreeFlags=0,e=r,r=i.child;r!==null;)Hm(r,e),r=r.sibling;return W(it,it.current&1|2),De&&qn(i,c.treeForkCount),i.child}e=e.sibling}c.tail!==null&&Gt()>ao&&(i.flags|=128,m=!0,hl(c,!1),i.lanes=4194304)}else{if(!m)if(e=Ur(p),e!==null){if(i.flags|=128,m=!0,e=e.updateQueue,i.updateQueue=e,Wr(i,e),hl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!De)return Ze(i),null}else 2*Gt()-c.renderingStartTime>ao&&r!==536870912&&(i.flags|=128,m=!0,hl(c,!1),i.lanes=4194304);c.isBackwards?(p.sibling=i.child,i.child=p):(e=c.last,e!==null?e.sibling=p:i.child=p,c.last=p)}return c.tail!==null?(e=c.tail,c.rendering=e,c.tail=e.sibling,c.renderingStartTime=Gt(),e.sibling=null,r=it.current,W(it,m?r&1|2:r&1),De&&qn(i,c.treeForkCount),e):(Ze(i),null);case 22:case 23:return Zt(i),Uu(),c=i.memoizedState!==null,e!==null?e.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(r&536870912)!==0&&(i.flags&128)===0&&(Ze(i),i.subtreeFlags&6&&(i.flags|=8192)):Ze(i),r=i.updateQueue,r!==null&&Wr(i,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==r&&(i.flags|=2048),e!==null&&I(si),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),In(ct),Ze(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function O2(e,i){switch(ju(i),i.tag){case 1:return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return In(ct),ye(),e=i.flags,(e&65536)!==0&&(e&128)===0?(i.flags=e&-65537|128,i):null;case 26:case 27:case 5:return re(i),null;case 31:if(i.memoizedState!==null){if(Zt(i),i.alternate===null)throw Error(s(340));ni()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 13:if(Zt(i),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(s(340));ni()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return I(it),null;case 4:return ye(),null;case 10:return In(i.type),null;case 22:case 23:return Zt(i),Uu(),e!==null&&I(si),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 24:return In(ct),null;case 25:return null;default:return null}}function u0(e,i){switch(ju(i),i.tag){case 3:In(ct),ye();break;case 26:case 27:case 5:re(i);break;case 4:ye();break;case 31:i.memoizedState!==null&&Zt(i);break;case 13:Zt(i);break;case 19:I(it);break;case 10:In(i.type);break;case 22:case 23:Zt(i),Uu(),e!==null&&I(si);break;case 24:In(ct)}}function ml(e,i){try{var r=i.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var m=c.next;r=m;do{if((r.tag&e)===e){c=void 0;var p=r.create,y=r.inst;c=p(),y.destroy=c}r=r.next}while(r!==m)}}catch(T){$e(i,i.return,T)}}function ja(e,i,r){try{var c=i.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var p=m.next;c=p;do{if((c.tag&e)===e){var y=c.inst,T=y.destroy;if(T!==void 0){y.destroy=void 0,m=i;var D=r,V=T;try{V()}catch(q){$e(m,D,q)}}}c=c.next}while(c!==p)}}catch(q){$e(i,i.return,q)}}function d0(e){var i=e.updateQueue;if(i!==null){var r=e.stateNode;try{tg(i,r)}catch(c){$e(e,e.return,c)}}}function f0(e,i,r){r.props=ui(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(c){$e(e,i,c)}}function gl(e,i){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var c=e.stateNode;break;case 30:c=e.stateNode;break;default:c=e.stateNode}typeof r=="function"?e.refCleanup=r(c):r.current=c}}catch(m){$e(e,i,m)}}function An(e,i){var r=e.ref,c=e.refCleanup;if(r!==null)if(typeof c=="function")try{c()}catch(m){$e(e,i,m)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(m){$e(e,i,m)}else r.current=null}function h0(e){var i=e.type,r=e.memoizedProps,c=e.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":r.autoFocus&&c.focus();break e;case"img":r.src?c.src=r.src:r.srcSet&&(c.srcset=r.srcSet)}}catch(m){$e(e,e.return,m)}}function xd(e,i,r){try{var c=e.stateNode;aS(c,e.type,r,i),c[At]=i}catch(m){$e(e,e.return,m)}}function m0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Aa(e.type)||e.tag===4}function bd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||m0(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.tag===27&&Aa(e.type)||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 yd(e,i,r){var c=e.tag;if(c===5||c===6)e=e.stateNode,i?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,i):(i=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,i.appendChild(e),r=r._reactRootContainer,r!=null||i.onclick!==null||(i.onclick=Vn));else if(c!==4&&(c===27&&Aa(e.type)&&(r=e.stateNode,i=null),e=e.child,e!==null))for(yd(e,i,r),e=e.sibling;e!==null;)yd(e,i,r),e=e.sibling}function Jr(e,i,r){var c=e.tag;if(c===5||c===6)e=e.stateNode,i?r.insertBefore(e,i):r.appendChild(e);else if(c!==4&&(c===27&&Aa(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(Jr(e,i,r),e=e.sibling;e!==null;)Jr(e,i,r),e=e.sibling}function g0(e){var i=e.stateNode,r=e.memoizedProps;try{for(var c=e.type,m=i.attributes;m.length;)i.removeAttributeNode(m[0]);Nt(i,c,r),i[St]=e,i[At]=r}catch(p){$e(e,e.return,p)}}var Pn=!1,ft=!1,vd=!1,p0=typeof WeakSet=="function"?WeakSet:Set,yt=null;function L2(e,i){if(e=e.containerInfo,Vd=So,e=km(e),hu(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var c=r.getSelection&&r.getSelection();if(c&&c.rangeCount!==0){r=c.anchorNode;var m=c.anchorOffset,p=c.focusNode;c=c.focusOffset;try{r.nodeType,p.nodeType}catch{r=null;break e}var y=0,T=-1,D=-1,V=0,q=0,Z=e,Y=null;t:for(;;){for(var G;Z!==r||m!==0&&Z.nodeType!==3||(T=y+m),Z!==p||c!==0&&Z.nodeType!==3||(D=y+c),Z.nodeType===3&&(y+=Z.nodeValue.length),(G=Z.firstChild)!==null;)Y=Z,Z=G;for(;;){if(Z===e)break t;if(Y===r&&++V===m&&(T=y),Y===p&&++q===c&&(D=y),(G=Z.nextSibling)!==null)break;Z=Y,Y=Z.parentNode}Z=G}r=T===-1||D===-1?null:{start:T,end:D}}else r=null}r=r||{start:0,end:0}}else r=null;for(Yd={focusedElem:e,selectionRange:r},So=!1,yt=i;yt!==null;)if(i=yt,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,yt=e;else for(;yt!==null;){switch(i=yt,p=i.alternate,e=i.flags,i.tag){case 0:if((e&4)!==0&&(e=i.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)m=e[r],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,r=i,m=p.memoizedProps,p=p.memoizedState,c=r.stateNode;try{var oe=ui(r.type,m);e=c.getSnapshotBeforeUpdate(oe,p),c.__reactInternalSnapshotBeforeUpdate=e}catch(pe){$e(r,r.return,pe)}}break;case 3:if((e&1024)!==0){if(e=i.stateNode.containerInfo,r=e.nodeType,r===9)Xd(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Xd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=i.sibling,e!==null){e.return=i.return,yt=e;break}yt=i.return}}function x0(e,i,r){var c=r.flags;switch(r.tag){case 0:case 11:case 15:Jn(e,r),c&4&&ml(5,r);break;case 1:if(Jn(e,r),c&4)if(e=r.stateNode,i===null)try{e.componentDidMount()}catch(y){$e(r,r.return,y)}else{var m=ui(r.type,i.memoizedProps);i=i.memoizedState;try{e.componentDidUpdate(m,i,e.__reactInternalSnapshotBeforeUpdate)}catch(y){$e(r,r.return,y)}}c&64&&d0(r),c&512&&gl(r,r.return);break;case 3:if(Jn(e,r),c&64&&(e=r.updateQueue,e!==null)){if(i=null,r.child!==null)switch(r.child.tag){case 27:case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}try{tg(e,i)}catch(y){$e(r,r.return,y)}}break;case 27:i===null&&c&4&&g0(r);case 26:case 5:Jn(e,r),i===null&&c&4&&h0(r),c&512&&gl(r,r.return);break;case 12:Jn(e,r);break;case 31:Jn(e,r),c&4&&v0(e,r);break;case 13:Jn(e,r),c&4&&S0(e,r),c&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=X2.bind(null,r),dS(e,r))));break;case 22:if(c=r.memoizedState!==null||Pn,!c){i=i!==null&&i.memoizedState!==null||ft,m=Pn;var p=ft;Pn=c,(ft=i)&&!p?ea(e,r,(r.subtreeFlags&8772)!==0):Jn(e,r),Pn=m,ft=p}break;case 30:break;default:Jn(e,r)}}function b0(e){var i=e.alternate;i!==null&&(e.alternate=null,b0(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&Kc(i)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var et=null,zt=!1;function Wn(e,i,r){for(r=r.child;r!==null;)y0(e,i,r),r=r.sibling}function y0(e,i,r){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(Us,r)}catch{}switch(r.tag){case 26:ft||An(r,i),Wn(e,i,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:ft||An(r,i);var c=et,m=zt;Aa(r.type)&&(et=r.stateNode,zt=!1),Wn(e,i,r),jl(r.stateNode),et=c,zt=m;break;case 5:ft||An(r,i);case 6:if(c=et,m=zt,et=null,Wn(e,i,r),et=c,zt=m,et!==null)if(zt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(r.stateNode)}catch(p){$e(r,i,p)}else try{et.removeChild(r.stateNode)}catch(p){$e(r,i,p)}break;case 18:et!==null&&(zt?(e=et,dp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),gs(e)):dp(et,r.stateNode));break;case 4:c=et,m=zt,et=r.stateNode.containerInfo,zt=!0,Wn(e,i,r),et=c,zt=m;break;case 0:case 11:case 14:case 15:ja(2,r,i),ft||ja(4,r,i),Wn(e,i,r);break;case 1:ft||(An(r,i),c=r.stateNode,typeof c.componentWillUnmount=="function"&&f0(r,i,c)),Wn(e,i,r);break;case 21:Wn(e,i,r);break;case 22:ft=(c=ft)||r.memoizedState!==null,Wn(e,i,r),ft=c;break;default:Wn(e,i,r)}}function v0(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gs(e)}catch(r){$e(i,i.return,r)}}}function S0(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gs(e)}catch(r){$e(i,i.return,r)}}function H2(e){switch(e.tag){case 31:case 13:case 19:var i=e.stateNode;return i===null&&(i=e.stateNode=new p0),i;case 22:return e=e.stateNode,i=e._retryCache,i===null&&(i=e._retryCache=new p0),i;default:throw Error(s(435,e.tag))}}function eo(e,i){var r=H2(e);i.forEach(function(c){if(!r.has(c)){r.add(c);var m=I2.bind(null,e,c);c.then(m,m)}})}function Rt(e,i){var r=i.deletions;if(r!==null)for(var c=0;c<r.length;c++){var m=r[c],p=e,y=i,T=y;e:for(;T!==null;){switch(T.tag){case 27:if(Aa(T.type)){et=T.stateNode,zt=!1;break e}break;case 5:et=T.stateNode,zt=!1;break e;case 3:case 4:et=T.stateNode.containerInfo,zt=!0;break e}T=T.return}if(et===null)throw Error(s(160));y0(p,y,m),et=null,zt=!1,p=m.alternate,p!==null&&(p.return=null),m.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)_0(i,e),i=i.sibling}var vn=null;function _0(e,i){var r=e.alternate,c=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rt(i,e),Ot(e),c&4&&(ja(3,e,e.return),ml(3,e),ja(5,e,e.return));break;case 1:Rt(i,e),Ot(e),c&512&&(ft||r===null||An(r,r.return)),c&64&&Pn&&(e=e.updateQueue,e!==null&&(c=e.callbacks,c!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?c:r.concat(c))));break;case 26:var m=vn;if(Rt(i,e),Ot(e),c&512&&(ft||r===null||An(r,r.return)),c&4){var p=r!==null?r.memoizedState:null;if(c=e.memoizedState,r===null)if(c===null)if(e.stateNode===null){e:{c=e.type,r=e.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":p=m.getElementsByTagName("title")[0],(!p||p[Ys]||p[St]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=m.createElement(c),m.head.insertBefore(p,m.querySelector("head > title"))),Nt(p,c,r),p[St]=e,bt(p),c=p;break e;case"link":var y=_p("link","href",m).get(c+(r.href||""));if(y){for(var T=0;T<y.length;T++)if(p=y[T],p.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&p.getAttribute("rel")===(r.rel==null?null:r.rel)&&p.getAttribute("title")===(r.title==null?null:r.title)&&p.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){y.splice(T,1);break t}}p=m.createElement(c),Nt(p,c,r),m.head.appendChild(p);break;case"meta":if(y=_p("meta","content",m).get(c+(r.content||""))){for(T=0;T<y.length;T++)if(p=y[T],p.getAttribute("content")===(r.content==null?null:""+r.content)&&p.getAttribute("name")===(r.name==null?null:r.name)&&p.getAttribute("property")===(r.property==null?null:r.property)&&p.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&p.getAttribute("charset")===(r.charSet==null?null:r.charSet)){y.splice(T,1);break t}}p=m.createElement(c),Nt(p,c,r),m.head.appendChild(p);break;default:throw Error(s(468,c))}p[St]=e,bt(p),c=p}e.stateNode=c}else wp(m,e.type,e.stateNode);else e.stateNode=Sp(m,c,e.memoizedProps);else p!==c?(p===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):p.count--,c===null?wp(m,e.type,e.stateNode):Sp(m,c,e.memoizedProps)):c===null&&e.stateNode!==null&&xd(e,e.memoizedProps,r.memoizedProps)}break;case 27:Rt(i,e),Ot(e),c&512&&(ft||r===null||An(r,r.return)),r!==null&&c&4&&xd(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Rt(i,e),Ot(e),c&512&&(ft||r===null||An(r,r.return)),e.flags&32){m=e.stateNode;try{Bi(m,"")}catch(oe){$e(e,e.return,oe)}}c&4&&e.stateNode!=null&&(m=e.memoizedProps,xd(e,m,r!==null?r.memoizedProps:m)),c&1024&&(vd=!0);break;case 6:if(Rt(i,e),Ot(e),c&4){if(e.stateNode===null)throw Error(s(162));c=e.memoizedProps,r=e.stateNode;try{r.nodeValue=c}catch(oe){$e(e,e.return,oe)}}break;case 3:if(xo=null,m=vn,vn=go(i.containerInfo),Rt(i,e),vn=m,Ot(e),c&4&&r!==null&&r.memoizedState.isDehydrated)try{gs(i.containerInfo)}catch(oe){$e(e,e.return,oe)}vd&&(vd=!1,w0(e));break;case 4:c=vn,vn=go(e.stateNode.containerInfo),Rt(i,e),Ot(e),vn=c;break;case 12:Rt(i,e),Ot(e);break;case 31:Rt(i,e),Ot(e),c&4&&(c=e.updateQueue,c!==null&&(e.updateQueue=null,eo(e,c)));break;case 13:Rt(i,e),Ot(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(no=Gt()),c&4&&(c=e.updateQueue,c!==null&&(e.updateQueue=null,eo(e,c)));break;case 22:m=e.memoizedState!==null;var D=r!==null&&r.memoizedState!==null,V=Pn,q=ft;if(Pn=V||m,ft=q||D,Rt(i,e),ft=q,Pn=V,Ot(e),c&8192)e:for(i=e.stateNode,i._visibility=m?i._visibility&-2:i._visibility|1,m&&(r===null||D||Pn||ft||di(e)),r=null,i=e;;){if(i.tag===5||i.tag===26){if(r===null){D=r=i;try{if(p=D.stateNode,m)y=p.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{T=D.stateNode;var Z=D.memoizedProps.style,Y=Z!=null&&Z.hasOwnProperty("display")?Z.display:null;T.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(oe){$e(D,D.return,oe)}}}else if(i.tag===6){if(r===null){D=i;try{D.stateNode.nodeValue=m?"":D.memoizedProps}catch(oe){$e(D,D.return,oe)}}}else if(i.tag===18){if(r===null){D=i;try{var G=D.stateNode;m?fp(G,!0):fp(D.stateNode,!1)}catch(oe){$e(D,D.return,oe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===e)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;r===i&&(r=null),i=i.return}r===i&&(r=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=e.updateQueue,c!==null&&(r=c.retryQueue,r!==null&&(c.retryQueue=null,eo(e,r))));break;case 19:Rt(i,e),Ot(e),c&4&&(c=e.updateQueue,c!==null&&(e.updateQueue=null,eo(e,c)));break;case 30:break;case 21:break;default:Rt(i,e),Ot(e)}}function Ot(e){var i=e.flags;if(i&2){try{for(var r,c=e.return;c!==null;){if(m0(c)){r=c;break}c=c.return}if(r==null)throw Error(s(160));switch(r.tag){case 27:var m=r.stateNode,p=bd(e);Jr(e,p,m);break;case 5:var y=r.stateNode;r.flags&32&&(Bi(y,""),r.flags&=-33);var T=bd(e);Jr(e,T,y);break;case 3:case 4:var D=r.stateNode.containerInfo,V=bd(e);yd(e,V,D);break;default:throw Error(s(161))}}catch(q){$e(e,e.return,q)}e.flags&=-3}i&4096&&(e.flags&=-4097)}function w0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var i=e;w0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),e=e.sibling}}function Jn(e,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)x0(e,i.alternate,i),i=i.sibling}function di(e){for(e=e.child;e!==null;){var i=e;switch(i.tag){case 0:case 11:case 14:case 15:ja(4,i,i.return),di(i);break;case 1:An(i,i.return);var r=i.stateNode;typeof r.componentWillUnmount=="function"&&f0(i,i.return,r),di(i);break;case 27:jl(i.stateNode);case 26:case 5:An(i,i.return),di(i);break;case 22:i.memoizedState===null&&di(i);break;case 30:di(i);break;default:di(i)}e=e.sibling}}function ea(e,i,r){for(r=r&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,m=e,p=i,y=p.flags;switch(p.tag){case 0:case 11:case 15:ea(m,p,r),ml(4,p);break;case 1:if(ea(m,p,r),c=p,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(V){$e(c,c.return,V)}if(c=p,m=c.updateQueue,m!==null){var T=c.stateNode;try{var D=m.shared.hiddenCallbacks;if(D!==null)for(m.shared.hiddenCallbacks=null,m=0;m<D.length;m++)eg(D[m],T)}catch(V){$e(c,c.return,V)}}r&&y&64&&d0(p),gl(p,p.return);break;case 27:g0(p);case 26:case 5:ea(m,p,r),r&&c===null&&y&4&&h0(p),gl(p,p.return);break;case 12:ea(m,p,r);break;case 31:ea(m,p,r),r&&y&4&&v0(m,p);break;case 13:ea(m,p,r),r&&y&4&&S0(m,p);break;case 22:p.memoizedState===null&&ea(m,p,r),gl(p,p.return);break;case 30:break;default:ea(m,p,r)}i=i.sibling}}function Sd(e,i){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(e=i.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&tl(r))}function _d(e,i){e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&tl(e))}function Sn(e,i,r,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)j0(e,i,r,c),i=i.sibling}function j0(e,i,r,c){var m=i.flags;switch(i.tag){case 0:case 11:case 15:Sn(e,i,r,c),m&2048&&ml(9,i);break;case 1:Sn(e,i,r,c);break;case 3:Sn(e,i,r,c),m&2048&&(e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&tl(e)));break;case 12:if(m&2048){Sn(e,i,r,c),e=i.stateNode;try{var p=i.memoizedProps,y=p.id,T=p.onPostCommit;typeof T=="function"&&T(y,i.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){$e(i,i.return,D)}}else Sn(e,i,r,c);break;case 31:Sn(e,i,r,c);break;case 13:Sn(e,i,r,c);break;case 23:break;case 22:p=i.stateNode,y=i.alternate,i.memoizedState!==null?p._visibility&2?Sn(e,i,r,c):pl(e,i):p._visibility&2?Sn(e,i,r,c):(p._visibility|=2,is(e,i,r,c,(i.subtreeFlags&10256)!==0||!1)),m&2048&&Sd(y,i);break;case 24:Sn(e,i,r,c),m&2048&&_d(i.alternate,i);break;default:Sn(e,i,r,c)}}function is(e,i,r,c,m){for(m=m&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var p=e,y=i,T=r,D=c,V=y.flags;switch(y.tag){case 0:case 11:case 15:is(p,y,T,D,m),ml(8,y);break;case 23:break;case 22:var q=y.stateNode;y.memoizedState!==null?q._visibility&2?is(p,y,T,D,m):pl(p,y):(q._visibility|=2,is(p,y,T,D,m)),m&&V&2048&&Sd(y.alternate,y);break;case 24:is(p,y,T,D,m),m&&V&2048&&_d(y.alternate,y);break;default:is(p,y,T,D,m)}i=i.sibling}}function pl(e,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var r=e,c=i,m=c.flags;switch(c.tag){case 22:pl(r,c),m&2048&&Sd(c.alternate,c);break;case 24:pl(r,c),m&2048&&_d(c.alternate,c);break;default:pl(r,c)}i=i.sibling}}var xl=8192;function ss(e,i,r){if(e.subtreeFlags&xl)for(e=e.child;e!==null;)N0(e,i,r),e=e.sibling}function N0(e,i,r){switch(e.tag){case 26:ss(e,i,r),e.flags&xl&&e.memoizedState!==null&&wS(r,vn,e.memoizedState,e.memoizedProps);break;case 5:ss(e,i,r);break;case 3:case 4:var c=vn;vn=go(e.stateNode.containerInfo),ss(e,i,r),vn=c;break;case 22:e.memoizedState===null&&(c=e.alternate,c!==null&&c.memoizedState!==null?(c=xl,xl=16777216,ss(e,i,r),xl=c):ss(e,i,r));break;default:ss(e,i,r)}}function M0(e){var i=e.alternate;if(i!==null&&(e=i.child,e!==null)){i.child=null;do i=e.sibling,e.sibling=null,e=i;while(e!==null)}}function bl(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var r=0;r<i.length;r++){var c=i[r];yt=c,k0(c,e)}M0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)T0(e),e=e.sibling}function T0(e){switch(e.tag){case 0:case 11:case 15:bl(e),e.flags&2048&&ja(9,e,e.return);break;case 3:bl(e);break;case 12:bl(e);break;case 22:var i=e.stateNode;e.memoizedState!==null&&i._visibility&2&&(e.return===null||e.return.tag!==13)?(i._visibility&=-3,to(e)):bl(e);break;default:bl(e)}}function to(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var r=0;r<i.length;r++){var c=i[r];yt=c,k0(c,e)}M0(e)}for(e=e.child;e!==null;){switch(i=e,i.tag){case 0:case 11:case 15:ja(8,i,i.return),to(i);break;case 22:r=i.stateNode,r._visibility&2&&(r._visibility&=-3,to(i));break;default:to(i)}e=e.sibling}}function k0(e,i){for(;yt!==null;){var r=yt;switch(r.tag){case 0:case 11:case 15:ja(8,r,i);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var c=r.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:tl(r.memoizedState.cache)}if(c=r.child,c!==null)c.return=r,yt=c;else e:for(r=e;yt!==null;){c=yt;var m=c.sibling,p=c.return;if(b0(c),c===r){yt=null;break e}if(m!==null){m.return=p,yt=m;break e}yt=p}}}var B2={getCacheForType:function(e){var i=wt(ct),r=i.data.get(e);return r===void 0&&(r=e(),i.data.set(e,r)),r},cacheSignal:function(){return wt(ct).controller.signal}},U2=typeof WeakMap=="function"?WeakMap:Map,Be=0,Xe=null,Me=null,ke=0,Ue=0,Kt=null,Na=!1,ls=!1,wd=!1,ta=0,at=0,Ma=0,fi=0,jd=0,Pt=0,rs=0,yl=null,Lt=null,Nd=!1,no=0,C0=0,ao=1/0,io=null,Ta=null,mt=0,ka=null,os=null,na=0,Md=0,Td=null,E0=null,vl=0,kd=null;function Wt(){return(Be&2)!==0&&ke!==0?ke&-ke:U.T!==null?Rd():Ih()}function A0(){if(Pt===0)if((ke&536870912)===0||De){var e=fr;fr<<=1,(fr&3932160)===0&&(fr=262144),Pt=e}else Pt=536870912;return e=Qt.current,e!==null&&(e.flags|=32),Pt}function Ht(e,i,r){(e===Xe&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)&&(cs(e,0),Ca(e,ke,Pt,!1)),Vs(e,r),((Be&2)===0||e!==Xe)&&(e===Xe&&((Be&2)===0&&(fi|=r),at===4&&Ca(e,ke,Pt,!1)),Dn(e))}function D0(e,i,r){if((Be&6)!==0)throw Error(s(327));var c=!r&&(i&127)===0&&(i&e.expiredLanes)===0||$s(e,i),m=c?Y2(e,i):Ed(e,i,!0),p=c;do{if(m===0){ls&&!c&&Ca(e,i,0,!1);break}else{if(r=e.current.alternate,p&&!$2(r)){m=Ed(e,i,!1),p=!1;continue}if(m===2){if(p=i,e.errorRecoveryDisabledLanes&p)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){i=y;e:{var T=e;m=yl;var D=T.current.memoizedState.isDehydrated;if(D&&(cs(T,y).flags|=256),y=Ed(T,y,!1),y!==2){if(wd&&!D){T.errorRecoveryDisabledLanes|=p,fi|=p,m=4;break e}p=Lt,Lt=m,p!==null&&(Lt===null?Lt=p:Lt.push.apply(Lt,p))}m=y}if(p=!1,m!==2)continue}}if(m===1){cs(e,0),Ca(e,i,0,!0);break}e:{switch(c=e,p=m,p){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:Ca(c,i,Pt,!Na);break e;case 2:Lt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(m=no+300-Gt(),10<m)){if(Ca(c,i,Pt,!Na),mr(c,0,!0)!==0)break e;na=i,c.timeoutHandle=cp(z0.bind(null,c,r,Lt,io,Nd,i,Pt,fi,rs,Na,p,"Throttled",-0,0),m);break e}z0(c,r,Lt,io,Nd,i,Pt,fi,rs,Na,p,null,-0,0)}}break}while(!0);Dn(e)}function z0(e,i,r,c,m,p,y,T,D,V,q,Z,Y,G){if(e.timeoutHandle=-1,Z=i.subtreeFlags,Z&8192||(Z&16785408)===16785408){Z={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vn},N0(i,p,Z);var oe=(p&62914560)===p?no-Gt():(p&4194048)===p?C0-Gt():0;if(oe=jS(Z,oe),oe!==null){na=p,e.cancelPendingCommit=oe(V0.bind(null,e,i,p,r,c,m,y,T,D,q,Z,null,Y,G)),Ca(e,p,y,!V);return}}V0(e,i,p,r,c,m,y,T,D)}function $2(e){for(var i=e;;){var r=i.tag;if((r===0||r===11||r===15)&&i.flags&16384&&(r=i.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var c=0;c<r.length;c++){var m=r[c],p=m.getSnapshot;m=m.value;try{if(!It(p(),m))return!1}catch{return!1}}if(r=i.child,i.subtreeFlags&16384&&r!==null)r.return=i,i=r;else{if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ca(e,i,r,c){i&=~jd,i&=~fi,e.suspendedLanes|=i,e.pingedLanes&=~i,c&&(e.warmLanes|=i),c=e.expirationTimes;for(var m=i;0<m;){var p=31-Xt(m),y=1<<p;c[p]=-1,m&=~y}r!==0&&Gh(e,r,i)}function so(){return(Be&6)===0?(Sl(0),!1):!0}function Cd(){if(Me!==null){if(Ue===0)var e=Me.return;else e=Me,Xn=ai=null,Xu(e),Ji=null,al=0,e=Me;for(;e!==null;)u0(e.alternate,e),e=e.return;Me=null}}function cs(e,i){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,lS(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),na=0,Cd(),Xe=e,Me=r=Gn(e.current,null),ke=i,Ue=0,Kt=null,Na=!1,ls=$s(e,i),wd=!1,rs=Pt=jd=fi=Ma=at=0,Lt=yl=null,Nd=!1,(i&8)!==0&&(i|=i&32);var c=e.entangledLanes;if(c!==0)for(e=e.entanglements,c&=i;0<c;){var m=31-Xt(c),p=1<<m;i|=e[m],c&=~p}return ta=i,Mr(),r}function R0(e,i){ve=null,U.H=dl,i===Wi||i===Rr?(i=Km(),Ue=3):i===zu?(i=Km(),Ue=4):Ue=i===rd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Kt=i,Me===null&&(at=1,Qr(e,on(i,e.current)))}function O0(){var e=Qt.current;return e===null?!0:(ke&4194048)===ke?fn===null:(ke&62914560)===ke||(ke&536870912)!==0?e===fn:!1}function L0(){var e=U.H;return U.H=dl,e===null?dl:e}function H0(){var e=U.A;return U.A=B2,e}function lo(){at=4,Na||(ke&4194048)!==ke&&Qt.current!==null||(ls=!0),(Ma&134217727)===0&&(fi&134217727)===0||Xe===null||Ca(Xe,ke,Pt,!1)}function Ed(e,i,r){var c=Be;Be|=2;var m=L0(),p=H0();(Xe!==e||ke!==i)&&(io=null,cs(e,i)),i=!1;var y=at;e:do try{if(Ue!==0&&Me!==null){var T=Me,D=Kt;switch(Ue){case 8:Cd(),y=6;break e;case 3:case 2:case 9:case 6:Qt.current===null&&(i=!0);var V=Ue;if(Ue=0,Kt=null,us(e,T,D,V),r&&ls){y=0;break e}break;default:V=Ue,Ue=0,Kt=null,us(e,T,D,V)}}V2(),y=at;break}catch(q){R0(e,q)}while(!0);return i&&e.shellSuspendCounter++,Xn=ai=null,Be=c,U.H=m,U.A=p,Me===null&&(Xe=null,ke=0,Mr()),y}function V2(){for(;Me!==null;)B0(Me)}function Y2(e,i){var r=Be;Be|=2;var c=L0(),m=H0();Xe!==e||ke!==i?(io=null,ao=Gt()+500,cs(e,i)):ls=$s(e,i);e:do try{if(Ue!==0&&Me!==null){i=Me;var p=Kt;t:switch(Ue){case 1:Ue=0,Kt=null,us(e,i,p,1);break;case 2:case 9:if(Qm(p)){Ue=0,Kt=null,U0(i);break}i=function(){Ue!==2&&Ue!==9||Xe!==e||(Ue=7),Dn(e)},p.then(i,i);break e;case 3:Ue=7;break e;case 4:Ue=5;break e;case 7:Qm(p)?(Ue=0,Kt=null,U0(i)):(Ue=0,Kt=null,us(e,i,p,7));break;case 5:var y=null;switch(Me.tag){case 26:y=Me.memoizedState;case 5:case 27:var T=Me;if(y?jp(y):T.stateNode.complete){Ue=0,Kt=null;var D=T.sibling;if(D!==null)Me=D;else{var V=T.return;V!==null?(Me=V,ro(V)):Me=null}break t}}Ue=0,Kt=null,us(e,i,p,5);break;case 6:Ue=0,Kt=null,us(e,i,p,6);break;case 8:Cd(),at=6;break e;default:throw Error(s(462))}}G2();break}catch(q){R0(e,q)}while(!0);return Xn=ai=null,U.H=c,U.A=m,Be=r,Me!==null?0:(Xe=null,ke=0,Mr(),at)}function G2(){for(;Me!==null&&!f1();)B0(Me)}function B0(e){var i=o0(e.alternate,e,ta);e.memoizedProps=e.pendingProps,i===null?ro(e):Me=i}function U0(e){var i=e,r=i.alternate;switch(i.tag){case 15:case 0:i=n0(r,i,i.pendingProps,i.type,void 0,ke);break;case 11:i=n0(r,i,i.pendingProps,i.type.render,i.ref,ke);break;case 5:Xu(i);default:u0(r,i),i=Me=Hm(i,ta),i=o0(r,i,ta)}e.memoizedProps=e.pendingProps,i===null?ro(e):Me=i}function us(e,i,r,c){Xn=ai=null,Xu(i),Ji=null,al=0;var m=i.return;try{if(A2(e,m,i,r,ke)){at=1,Qr(e,on(r,e.current)),Me=null;return}}catch(p){if(m!==null)throw Me=m,p;at=1,Qr(e,on(r,e.current)),Me=null;return}i.flags&32768?(De||c===1?e=!0:ls||(ke&536870912)!==0?e=!1:(Na=e=!0,(c===2||c===9||c===3||c===6)&&(c=Qt.current,c!==null&&c.tag===13&&(c.flags|=16384))),$0(i,e)):ro(i)}function ro(e){var i=e;do{if((i.flags&32768)!==0){$0(i,Na);return}e=i.return;var r=R2(i.alternate,i,ta);if(r!==null){Me=r;return}if(i=i.sibling,i!==null){Me=i;return}Me=i=e}while(i!==null);at===0&&(at=5)}function $0(e,i){do{var r=O2(e.alternate,e);if(r!==null){r.flags&=32767,Me=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!i&&(e=e.sibling,e!==null)){Me=e;return}Me=e=r}while(e!==null);at=6,Me=null}function V0(e,i,r,c,m,p,y,T,D){e.cancelPendingCommit=null;do oo();while(mt!==0);if((Be&6)!==0)throw Error(s(327));if(i!==null){if(i===e.current)throw Error(s(177));if(p=i.lanes|i.childLanes,p|=bu,_1(e,r,p,y,T,D),e===Xe&&(Me=Xe=null,ke=0),os=i,ka=e,na=r,Md=p,Td=m,E0=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,F2(ur,function(){return I0(),null})):(e.callbackNode=null,e.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=U.T,U.T=null,m=K.p,K.p=2,y=Be,Be|=4;try{L2(e,i,r)}finally{Be=y,K.p=m,U.T=c}}mt=1,Y0(),G0(),q0()}}function Y0(){if(mt===1){mt=0;var e=ka,i=os,r=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||r){r=U.T,U.T=null;var c=K.p;K.p=2;var m=Be;Be|=4;try{_0(i,e);var p=Yd,y=km(e.containerInfo),T=p.focusedElem,D=p.selectionRange;if(y!==T&&T&&T.ownerDocument&&Tm(T.ownerDocument.documentElement,T)){if(D!==null&&hu(T)){var V=D.start,q=D.end;if(q===void 0&&(q=V),"selectionStart"in T)T.selectionStart=V,T.selectionEnd=Math.min(q,T.value.length);else{var Z=T.ownerDocument||document,Y=Z&&Z.defaultView||window;if(Y.getSelection){var G=Y.getSelection(),oe=T.textContent.length,pe=Math.min(D.start,oe),qe=D.end===void 0?pe:Math.min(D.end,oe);!G.extend&&pe>qe&&(y=qe,qe=pe,pe=y);var B=Mm(T,pe),H=Mm(T,qe);if(B&&H&&(G.rangeCount!==1||G.anchorNode!==B.node||G.anchorOffset!==B.offset||G.focusNode!==H.node||G.focusOffset!==H.offset)){var $=Z.createRange();$.setStart(B.node,B.offset),G.removeAllRanges(),pe>qe?(G.addRange($),G.extend(H.node,H.offset)):($.setEnd(H.node,H.offset),G.addRange($))}}}}for(Z=[],G=T;G=G.parentNode;)G.nodeType===1&&Z.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<Z.length;T++){var F=Z[T];F.element.scrollLeft=F.left,F.element.scrollTop=F.top}}So=!!Vd,Yd=Vd=null}finally{Be=m,K.p=c,U.T=r}}e.current=i,mt=2}}function G0(){if(mt===2){mt=0;var e=ka,i=os,r=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||r){r=U.T,U.T=null;var c=K.p;K.p=2;var m=Be;Be|=4;try{x0(e,i.alternate,i)}finally{Be=m,K.p=c,U.T=r}}mt=3}}function q0(){if(mt===4||mt===3){mt=0,h1();var e=ka,i=os,r=na,c=E0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?mt=5:(mt=0,os=ka=null,X0(e,e.pendingLanes));var m=e.pendingLanes;if(m===0&&(Ta=null),Qc(r),i=i.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(Us,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=U.T,m=K.p,K.p=2,U.T=null;try{for(var p=e.onRecoverableError,y=0;y<c.length;y++){var T=c[y];p(T.value,{componentStack:T.stack})}}finally{U.T=i,K.p=m}}(na&3)!==0&&oo(),Dn(e),m=e.pendingLanes,(r&261930)!==0&&(m&42)!==0?e===kd?vl++:(vl=0,kd=e):vl=0,Sl(0)}}function X0(e,i){(e.pooledCacheLanes&=i)===0&&(i=e.pooledCache,i!=null&&(e.pooledCache=null,tl(i)))}function oo(){return Y0(),G0(),q0(),I0()}function I0(){if(mt!==5)return!1;var e=ka,i=Md;Md=0;var r=Qc(na),c=U.T,m=K.p;try{K.p=32>r?32:r,U.T=null,r=Td,Td=null;var p=ka,y=na;if(mt=0,os=ka=null,na=0,(Be&6)!==0)throw Error(s(331));var T=Be;if(Be|=4,T0(p.current),j0(p,p.current,y,r),Be=T,Sl(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(Us,p)}catch{}return!0}finally{K.p=m,U.T=c,X0(e,i)}}function F0(e,i,r){i=on(r,i),i=ld(e.stateNode,i,2),e=Sa(e,i,2),e!==null&&(Vs(e,2),Dn(e))}function $e(e,i,r){if(e.tag===3)F0(e,e,r);else for(;i!==null;){if(i.tag===3){F0(i,e,r);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ta===null||!Ta.has(c))){e=on(r,e),r=Qg(2),c=Sa(i,r,2),c!==null&&(Zg(r,c,i,e),Vs(c,2),Dn(c));break}}i=i.return}}function Ad(e,i,r){var c=e.pingCache;if(c===null){c=e.pingCache=new U2;var m=new Set;c.set(i,m)}else m=c.get(i),m===void 0&&(m=new Set,c.set(i,m));m.has(r)||(wd=!0,m.add(r),e=q2.bind(null,e,i,r),i.then(e,e))}function q2(e,i,r){var c=e.pingCache;c!==null&&c.delete(i),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Xe===e&&(ke&r)===r&&(at===4||at===3&&(ke&62914560)===ke&&300>Gt()-no?(Be&2)===0&&cs(e,0):jd|=r,rs===ke&&(rs=0)),Dn(e)}function Q0(e,i){i===0&&(i=Yh()),e=ei(e,i),e!==null&&(Vs(e,i),Dn(e))}function X2(e){var i=e.memoizedState,r=0;i!==null&&(r=i.retryLane),Q0(e,r)}function I2(e,i){var r=0;switch(e.tag){case 31:case 13:var c=e.stateNode,m=e.memoizedState;m!==null&&(r=m.retryLane);break;case 19:c=e.stateNode;break;case 22:c=e.stateNode._retryCache;break;default:throw Error(s(314))}c!==null&&c.delete(i),Q0(e,r)}function F2(e,i){return ot(e,i)}var co=null,ds=null,Dd=!1,uo=!1,zd=!1,Ea=0;function Dn(e){e!==ds&&e.next===null&&(ds===null?co=ds=e:ds=ds.next=e),uo=!0,Dd||(Dd=!0,Z2())}function Sl(e,i){if(!zd&&uo){zd=!0;do for(var r=!1,c=co;c!==null;){if(e!==0){var m=c.pendingLanes;if(m===0)var p=0;else{var y=c.suspendedLanes,T=c.pingedLanes;p=(1<<31-Xt(42|e)+1)-1,p&=m&~(y&~T),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(r=!0,W0(c,p))}else p=ke,p=mr(c,c===Xe?p:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(p&3)===0||$s(c,p)||(r=!0,W0(c,p));c=c.next}while(r);zd=!1}}function Q2(){Z0()}function Z0(){uo=Dd=!1;var e=0;Ea!==0&&sS()&&(e=Ea);for(var i=Gt(),r=null,c=co;c!==null;){var m=c.next,p=K0(c,i);p===0?(c.next=null,r===null?co=m:r.next=m,m===null&&(ds=r)):(r=c,(e!==0||(p&3)!==0)&&(uo=!0)),c=m}mt!==0&&mt!==5||Sl(e),Ea!==0&&(Ea=0)}function K0(e,i){for(var r=e.suspendedLanes,c=e.pingedLanes,m=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var y=31-Xt(p),T=1<<y,D=m[y];D===-1?((T&r)===0||(T&c)!==0)&&(m[y]=S1(T,i)):D<=i&&(e.expiredLanes|=T),p&=~T}if(i=Xe,r=ke,r=mr(e,e===i?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),c=e.callbackNode,r===0||e===i&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)return c!==null&&c!==null&&Xc(c),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||$s(e,r)){if(i=r&-r,i===e.callbackPriority)return i;switch(c!==null&&Xc(c),Qc(r)){case 2:case 8:r=$h;break;case 32:r=ur;break;case 268435456:r=Vh;break;default:r=ur}return c=P0.bind(null,e),r=ot(r,c),e.callbackPriority=i,e.callbackNode=r,i}return c!==null&&c!==null&&Xc(c),e.callbackPriority=2,e.callbackNode=null,2}function P0(e,i){if(mt!==0&&mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(oo()&&e.callbackNode!==r)return null;var c=ke;return c=mr(e,e===Xe?c:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),c===0?null:(D0(e,c,i),K0(e,Gt()),e.callbackNode!=null&&e.callbackNode===r?P0.bind(null,e):null)}function W0(e,i){if(oo())return null;D0(e,i,!0)}function Z2(){rS(function(){(Be&6)!==0?ot(Uh,Q2):Z0()})}function Rd(){if(Ea===0){var e=Ki;e===0&&(e=dr,dr<<=1,(dr&261888)===0&&(dr=256)),Ea=e}return Ea}function J0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:br(""+e)}function ep(e,i){var r=i.ownerDocument.createElement("input");return r.name=i.name,r.value=i.value,e.id&&r.setAttribute("form",e.id),i.parentNode.insertBefore(r,i),e=new FormData(e),r.parentNode.removeChild(r),e}function K2(e,i,r,c,m){if(i==="submit"&&r&&r.stateNode===m){var p=J0((m[At]||null).action),y=c.submitter;y&&(i=(i=y[At]||null)?J0(i.formAction):y.getAttribute("formAction"),i!==null&&(p=i,y=null));var T=new _r("action","action",null,c,m);e.push({event:T,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Ea!==0){var D=y?ep(m,y):new FormData(m);ed(r,{pending:!0,data:D,method:m.method,action:p},null,D)}}else typeof p=="function"&&(T.preventDefault(),D=y?ep(m,y):new FormData(m),ed(r,{pending:!0,data:D,method:m.method,action:p},p,D))},currentTarget:m}]})}}for(var Od=0;Od<xu.length;Od++){var Ld=xu[Od],P2=Ld.toLowerCase(),W2=Ld[0].toUpperCase()+Ld.slice(1);yn(P2,"on"+W2)}yn(Am,"onAnimationEnd"),yn(Dm,"onAnimationIteration"),yn(zm,"onAnimationStart"),yn("dblclick","onDoubleClick"),yn("focusin","onFocus"),yn("focusout","onBlur"),yn(m2,"onTransitionRun"),yn(g2,"onTransitionStart"),yn(p2,"onTransitionCancel"),yn(Rm,"onTransitionEnd"),Li("onMouseEnter",["mouseout","mouseover"]),Li("onMouseLeave",["mouseout","mouseover"]),Li("onPointerEnter",["pointerout","pointerover"]),Li("onPointerLeave",["pointerout","pointerover"]),Ka("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ka("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ka("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ka("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ka("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ka("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _l="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(" "),J2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(_l));function tp(e,i){i=(i&4)!==0;for(var r=0;r<e.length;r++){var c=e[r],m=c.event;c=c.listeners;e:{var p=void 0;if(i)for(var y=c.length-1;0<=y;y--){var T=c[y],D=T.instance,V=T.currentTarget;if(T=T.listener,D!==p&&m.isPropagationStopped())break e;p=T,m.currentTarget=V;try{p(m)}catch(q){Nr(q)}m.currentTarget=null,p=D}else for(y=0;y<c.length;y++){if(T=c[y],D=T.instance,V=T.currentTarget,T=T.listener,D!==p&&m.isPropagationStopped())break e;p=T,m.currentTarget=V;try{p(m)}catch(q){Nr(q)}m.currentTarget=null,p=D}}}}function Te(e,i){var r=i[Zc];r===void 0&&(r=i[Zc]=new Set);var c=e+"__bubble";r.has(c)||(np(i,e,2,!1),r.add(c))}function Hd(e,i,r){var c=0;i&&(c|=4),np(r,e,c,i)}var fo="_reactListening"+Math.random().toString(36).slice(2);function Bd(e){if(!e[fo]){e[fo]=!0,Zh.forEach(function(r){r!=="selectionchange"&&(J2.has(r)||Hd(r,!1,e),Hd(r,!0,e))});var i=e.nodeType===9?e:e.ownerDocument;i===null||i[fo]||(i[fo]=!0,Hd("selectionchange",!1,i))}}function np(e,i,r,c){switch(Ap(i)){case 2:var m=TS;break;case 8:m=kS;break;default:m=Jd}r=m.bind(null,i,r,e),m=void 0,!iu||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(m=!0),c?m!==void 0?e.addEventListener(i,r,{capture:!0,passive:m}):e.addEventListener(i,r,!0):m!==void 0?e.addEventListener(i,r,{passive:m}):e.addEventListener(i,r,!1)}function Ud(e,i,r,c,m){var p=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var y=c.tag;if(y===3||y===4){var T=c.stateNode.containerInfo;if(T===m)break;if(y===4)for(y=c.return;y!==null;){var D=y.tag;if((D===3||D===4)&&y.stateNode.containerInfo===m)return;y=y.return}for(;T!==null;){if(y=zi(T),y===null)return;if(D=y.tag,D===5||D===6||D===26||D===27){c=p=y;continue e}T=T.parentNode}}c=c.return}rm(function(){var V=p,q=nu(r),Z=[];e:{var Y=Om.get(e);if(Y!==void 0){var G=_r,oe=e;switch(e){case"keypress":if(vr(r)===0)break e;case"keydown":case"keyup":G=I1;break;case"focusin":oe="focus",G=ou;break;case"focusout":oe="blur",G=ou;break;case"beforeblur":case"afterblur":G=ou;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":G=um;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=R1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=Z1;break;case Am:case Dm:case zm:G=H1;break;case Rm:G=P1;break;case"scroll":case"scrollend":G=D1;break;case"wheel":G=J1;break;case"copy":case"cut":case"paste":G=U1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=fm;break;case"toggle":case"beforetoggle":G=t2}var pe=(i&4)!==0,qe=!pe&&(e==="scroll"||e==="scrollend"),B=pe?Y!==null?Y+"Capture":null:Y;pe=[];for(var H=V,$;H!==null;){var F=H;if($=F.stateNode,F=F.tag,F!==5&&F!==26&&F!==27||$===null||B===null||(F=qs(H,B),F!=null&&pe.push(wl(H,F,$))),qe)break;H=H.return}0<pe.length&&(Y=new G(Y,oe,null,r,q),Z.push({event:Y,listeners:pe}))}}if((i&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",G=e==="mouseout"||e==="pointerout",Y&&r!==tu&&(oe=r.relatedTarget||r.fromElement)&&(zi(oe)||oe[Di]))break e;if((G||Y)&&(Y=q.window===q?q:(Y=q.ownerDocument)?Y.defaultView||Y.parentWindow:window,G?(oe=r.relatedTarget||r.toElement,G=V,oe=oe?zi(oe):null,oe!==null&&(qe=o(oe),pe=oe.tag,oe!==qe||pe!==5&&pe!==27&&pe!==6)&&(oe=null)):(G=null,oe=V),G!==oe)){if(pe=um,F="onMouseLeave",B="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(pe=fm,F="onPointerLeave",B="onPointerEnter",H="pointer"),qe=G==null?Y:Gs(G),$=oe==null?Y:Gs(oe),Y=new pe(F,H+"leave",G,r,q),Y.target=qe,Y.relatedTarget=$,F=null,zi(q)===V&&(pe=new pe(B,H+"enter",oe,r,q),pe.target=$,pe.relatedTarget=qe,F=pe),qe=F,G&&oe)t:{for(pe=eS,B=G,H=oe,$=0,F=B;F;F=pe(F))$++;F=0;for(var me=H;me;me=pe(me))F++;for(;0<$-F;)B=pe(B),$--;for(;0<F-$;)H=pe(H),F--;for(;$--;){if(B===H||H!==null&&B===H.alternate){pe=B;break t}B=pe(B),H=pe(H)}pe=null}else pe=null;G!==null&&ap(Z,Y,G,pe,!1),oe!==null&&qe!==null&&ap(Z,qe,oe,pe,!0)}}e:{if(Y=V?Gs(V):window,G=Y.nodeName&&Y.nodeName.toLowerCase(),G==="select"||G==="input"&&Y.type==="file")var Le=vm;else if(bm(Y))if(Sm)Le=d2;else{Le=c2;var ue=o2}else G=Y.nodeName,!G||G.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?V&&eu(V.elementType)&&(Le=vm):Le=u2;if(Le&&(Le=Le(e,V))){ym(Z,Le,r,q);break e}ue&&ue(e,Y,V),e==="focusout"&&V&&Y.type==="number"&&V.memoizedProps.value!=null&&Jc(Y,"number",Y.value)}switch(ue=V?Gs(V):window,e){case"focusin":(bm(ue)||ue.contentEditable==="true")&&(Yi=ue,mu=V,Ws=null);break;case"focusout":Ws=mu=Yi=null;break;case"mousedown":gu=!0;break;case"contextmenu":case"mouseup":case"dragend":gu=!1,Cm(Z,r,q);break;case"selectionchange":if(h2)break;case"keydown":case"keyup":Cm(Z,r,q)}var Se;if(uu)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Vi?pm(e,r)&&(Ce="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ce="onCompositionStart");Ce&&(hm&&r.locale!=="ko"&&(Vi||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Vi&&(Se=om()):(ma=q,su="value"in ma?ma.value:ma.textContent,Vi=!0)),ue=ho(V,Ce),0<ue.length&&(Ce=new dm(Ce,e,null,r,q),Z.push({event:Ce,listeners:ue}),Se?Ce.data=Se:(Se=xm(r),Se!==null&&(Ce.data=Se)))),(Se=a2?i2(e,r):s2(e,r))&&(Ce=ho(V,"onBeforeInput"),0<Ce.length&&(ue=new dm("onBeforeInput","beforeinput",null,r,q),Z.push({event:ue,listeners:Ce}),ue.data=Se)),K2(Z,e,V,r,q)}tp(Z,i)})}function wl(e,i,r){return{instance:e,listener:i,currentTarget:r}}function ho(e,i){for(var r=i+"Capture",c=[];e!==null;){var m=e,p=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||p===null||(m=qs(e,r),m!=null&&c.unshift(wl(e,m,p)),m=qs(e,i),m!=null&&c.push(wl(e,m,p))),e.tag===3)return c;e=e.return}return[]}function eS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ap(e,i,r,c,m){for(var p=i._reactName,y=[];r!==null&&r!==c;){var T=r,D=T.alternate,V=T.stateNode;if(T=T.tag,D!==null&&D===c)break;T!==5&&T!==26&&T!==27||V===null||(D=V,m?(V=qs(r,p),V!=null&&y.unshift(wl(r,V,D))):m||(V=qs(r,p),V!=null&&y.push(wl(r,V,D)))),r=r.return}y.length!==0&&e.push({event:i,listeners:y})}var tS=/\r\n?/g,nS=/\u0000|\uFFFD/g;function ip(e){return(typeof e=="string"?e:""+e).replace(tS,`
`).replace(nS,"")}function sp(e,i){return i=ip(i),ip(e)===i}function Ge(e,i,r,c,m,p){switch(r){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||Bi(e,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&Bi(e,""+c);break;case"className":pr(e,"class",c);break;case"tabIndex":pr(e,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":pr(e,r,c);break;case"style":sm(e,c,p);break;case"data":if(i!=="object"){pr(e,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||r!=="href")){e.removeAttribute(r);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){e.removeAttribute(r);break}c=br(""+c),e.setAttribute(r,c);break;case"action":case"formAction":if(typeof c=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(r==="formAction"?(i!=="input"&&Ge(e,i,"name",m.name,m,null),Ge(e,i,"formEncType",m.formEncType,m,null),Ge(e,i,"formMethod",m.formMethod,m,null),Ge(e,i,"formTarget",m.formTarget,m,null)):(Ge(e,i,"encType",m.encType,m,null),Ge(e,i,"method",m.method,m,null),Ge(e,i,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){e.removeAttribute(r);break}c=br(""+c),e.setAttribute(r,c);break;case"onClick":c!=null&&(e.onclick=Vn);break;case"onScroll":c!=null&&Te("scroll",e);break;case"onScrollEnd":c!=null&&Te("scrollend",e);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(s(61));if(r=c.__html,r!=null){if(m.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"multiple":e.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":e.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){e.removeAttribute("xlink:href");break}r=br(""+c),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?e.setAttribute(r,""+c):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":c===!0?e.setAttribute(r,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?e.setAttribute(r,c):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?e.setAttribute(r,c):e.removeAttribute(r);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?e.removeAttribute(r):e.setAttribute(r,c);break;case"popover":Te("beforetoggle",e),Te("toggle",e),gr(e,"popover",c);break;case"xlinkActuate":$n(e,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":$n(e,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":$n(e,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":$n(e,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":$n(e,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":$n(e,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":$n(e,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":$n(e,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":$n(e,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":gr(e,"is",c);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=E1.get(r)||r,gr(e,r,c))}}function $d(e,i,r,c,m,p){switch(r){case"style":sm(e,c,p);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(s(61));if(r=c.__html,r!=null){if(m.children!=null)throw Error(s(60));e.innerHTML=r}}break;case"children":typeof c=="string"?Bi(e,c):(typeof c=="number"||typeof c=="bigint")&&Bi(e,""+c);break;case"onScroll":c!=null&&Te("scroll",e);break;case"onScrollEnd":c!=null&&Te("scrollend",e);break;case"onClick":c!=null&&(e.onclick=Vn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Kh.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(m=r.endsWith("Capture"),i=r.slice(2,m?r.length-7:void 0),p=e[At]||null,p=p!=null?p[r]:null,typeof p=="function"&&e.removeEventListener(i,p,m),typeof c=="function")){typeof p!="function"&&p!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(i,c,m);break e}r in e?e[r]=c:c===!0?e.setAttribute(r,""):gr(e,r,c)}}}function Nt(e,i,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",e),Te("load",e);var c=!1,m=!1,p;for(p in r)if(r.hasOwnProperty(p)){var y=r[p];if(y!=null)switch(p){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Ge(e,i,p,y,r,null)}}m&&Ge(e,i,"srcSet",r.srcSet,r,null),c&&Ge(e,i,"src",r.src,r,null);return;case"input":Te("invalid",e);var T=p=y=m=null,D=null,V=null;for(c in r)if(r.hasOwnProperty(c)){var q=r[c];if(q!=null)switch(c){case"name":m=q;break;case"type":y=q;break;case"checked":D=q;break;case"defaultChecked":V=q;break;case"value":p=q;break;case"defaultValue":T=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(137,i));break;default:Ge(e,i,c,q,r,null)}}tm(e,p,T,D,V,y,m,!1);return;case"select":Te("invalid",e),c=y=p=null;for(m in r)if(r.hasOwnProperty(m)&&(T=r[m],T!=null))switch(m){case"value":p=T;break;case"defaultValue":y=T;break;case"multiple":c=T;default:Ge(e,i,m,T,r,null)}i=p,r=y,e.multiple=!!c,i!=null?Hi(e,!!c,i,!1):r!=null&&Hi(e,!!c,r,!0);return;case"textarea":Te("invalid",e),p=m=c=null;for(y in r)if(r.hasOwnProperty(y)&&(T=r[y],T!=null))switch(y){case"value":c=T;break;case"defaultValue":m=T;break;case"children":p=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(s(91));break;default:Ge(e,i,y,T,r,null)}am(e,c,m,p);return;case"option":for(D in r)if(r.hasOwnProperty(D)&&(c=r[D],c!=null))switch(D){case"selected":e.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:Ge(e,i,D,c,r,null)}return;case"dialog":Te("beforetoggle",e),Te("toggle",e),Te("cancel",e),Te("close",e);break;case"iframe":case"object":Te("load",e);break;case"video":case"audio":for(c=0;c<_l.length;c++)Te(_l[c],e);break;case"image":Te("error",e),Te("load",e);break;case"details":Te("toggle",e);break;case"embed":case"source":case"link":Te("error",e),Te("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in r)if(r.hasOwnProperty(V)&&(c=r[V],c!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:Ge(e,i,V,c,r,null)}return;default:if(eu(i)){for(q in r)r.hasOwnProperty(q)&&(c=r[q],c!==void 0&&$d(e,i,q,c,r,void 0));return}}for(T in r)r.hasOwnProperty(T)&&(c=r[T],c!=null&&Ge(e,i,T,c,r,null))}function aS(e,i,r,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,p=null,y=null,T=null,D=null,V=null,q=null;for(G in r){var Z=r[G];if(r.hasOwnProperty(G)&&Z!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":D=Z;default:c.hasOwnProperty(G)||Ge(e,i,G,null,c,Z)}}for(var Y in c){var G=c[Y];if(Z=r[Y],c.hasOwnProperty(Y)&&(G!=null||Z!=null))switch(Y){case"type":p=G;break;case"name":m=G;break;case"checked":V=G;break;case"defaultChecked":q=G;break;case"value":y=G;break;case"defaultValue":T=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(s(137,i));break;default:G!==Z&&Ge(e,i,Y,G,c,Z)}}Wc(e,y,T,D,V,q,p,m);return;case"select":G=y=T=Y=null;for(p in r)if(D=r[p],r.hasOwnProperty(p)&&D!=null)switch(p){case"value":break;case"multiple":G=D;default:c.hasOwnProperty(p)||Ge(e,i,p,null,c,D)}for(m in c)if(p=c[m],D=r[m],c.hasOwnProperty(m)&&(p!=null||D!=null))switch(m){case"value":Y=p;break;case"defaultValue":T=p;break;case"multiple":y=p;default:p!==D&&Ge(e,i,m,p,c,D)}i=T,r=y,c=G,Y!=null?Hi(e,!!r,Y,!1):!!c!=!!r&&(i!=null?Hi(e,!!r,i,!0):Hi(e,!!r,r?[]:"",!1));return;case"textarea":G=Y=null;for(T in r)if(m=r[T],r.hasOwnProperty(T)&&m!=null&&!c.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Ge(e,i,T,null,c,m)}for(y in c)if(m=c[y],p=r[y],c.hasOwnProperty(y)&&(m!=null||p!=null))switch(y){case"value":Y=m;break;case"defaultValue":G=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(s(91));break;default:m!==p&&Ge(e,i,y,m,c,p)}nm(e,Y,G);return;case"option":for(var oe in r)if(Y=r[oe],r.hasOwnProperty(oe)&&Y!=null&&!c.hasOwnProperty(oe))switch(oe){case"selected":e.selected=!1;break;default:Ge(e,i,oe,null,c,Y)}for(D in c)if(Y=c[D],G=r[D],c.hasOwnProperty(D)&&Y!==G&&(Y!=null||G!=null))switch(D){case"selected":e.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:Ge(e,i,D,Y,c,G)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var pe in r)Y=r[pe],r.hasOwnProperty(pe)&&Y!=null&&!c.hasOwnProperty(pe)&&Ge(e,i,pe,null,c,Y);for(V in c)if(Y=c[V],G=r[V],c.hasOwnProperty(V)&&Y!==G&&(Y!=null||G!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,i));break;default:Ge(e,i,V,Y,c,G)}return;default:if(eu(i)){for(var qe in r)Y=r[qe],r.hasOwnProperty(qe)&&Y!==void 0&&!c.hasOwnProperty(qe)&&$d(e,i,qe,void 0,c,Y);for(q in c)Y=c[q],G=r[q],!c.hasOwnProperty(q)||Y===G||Y===void 0&&G===void 0||$d(e,i,q,Y,c,G);return}}for(var B in r)Y=r[B],r.hasOwnProperty(B)&&Y!=null&&!c.hasOwnProperty(B)&&Ge(e,i,B,null,c,Y);for(Z in c)Y=c[Z],G=r[Z],!c.hasOwnProperty(Z)||Y===G||Y==null&&G==null||Ge(e,i,Z,Y,c,G)}function lp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,i=0,r=performance.getEntriesByType("resource"),c=0;c<r.length;c++){var m=r[c],p=m.transferSize,y=m.initiatorType,T=m.duration;if(p&&T&&lp(y)){for(y=0,T=m.responseEnd,c+=1;c<r.length;c++){var D=r[c],V=D.startTime;if(V>T)break;var q=D.transferSize,Z=D.initiatorType;q&&lp(Z)&&(D=D.responseEnd,y+=q*(D<T?1:(T-V)/(D-V)))}if(--c,i+=8*(p+y)/(m.duration/1e3),e++,10<e)break}}if(0<e)return i/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Vd=null,Yd=null;function mo(e){return e.nodeType===9?e:e.ownerDocument}function rp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function op(e,i){if(e===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&i==="foreignObject"?0:e}function Gd(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var qd=null;function sS(){var e=window.event;return e&&e.type==="popstate"?e===qd?!1:(qd=e,!0):(qd=null,!1)}var cp=typeof setTimeout=="function"?setTimeout:void 0,lS=typeof clearTimeout=="function"?clearTimeout:void 0,up=typeof Promise=="function"?Promise:void 0,rS=typeof queueMicrotask=="function"?queueMicrotask:typeof up<"u"?function(e){return up.resolve(null).then(e).catch(oS)}:cp;function oS(e){setTimeout(function(){throw e})}function Aa(e){return e==="head"}function dp(e,i){var r=i,c=0;do{var m=r.nextSibling;if(e.removeChild(r),m&&m.nodeType===8)if(r=m.data,r==="/$"||r==="/&"){if(c===0){e.removeChild(m),gs(i);return}c--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")c++;else if(r==="html")jl(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,jl(r);for(var p=r.firstChild;p;){var y=p.nextSibling,T=p.nodeName;p[Ys]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&p.rel.toLowerCase()==="stylesheet"||r.removeChild(p),p=y}}else r==="body"&&jl(e.ownerDocument.body);r=m}while(r);gs(i)}function fp(e,i){var r=e;e=0;do{var c=r.nextSibling;if(r.nodeType===1?i?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(i?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),c&&c.nodeType===8)if(r=c.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=c}while(r)}function Xd(e){var i=e.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var r=i;switch(i=i.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Xd(r),Kc(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function cS(e,i,r,c){for(;e.nodeType===1;){var m=r;if(e.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(c){if(!e[Ys])switch(i){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==m.rel||e.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||e.getAttribute("title")!==(m.title==null?null:m.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(m.src==null?null:m.src)||e.getAttribute("type")!==(m.type==null?null:m.type)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(i==="input"&&e.type==="hidden"){var p=m.name==null?null:""+m.name;if(m.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=hn(e.nextSibling),e===null)break}return null}function uS(e,i,r){if(i==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=hn(e.nextSibling),e===null))return null;return e}function hp(e,i){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=hn(e.nextSibling),e===null))return null;return e}function Id(e){return e.data==="$?"||e.data==="$~"}function Fd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function dS(e,i){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=i;else if(e.data!=="$?"||r.readyState!=="loading")i();else{var c=function(){i(),r.removeEventListener("DOMContentLoaded",c)};r.addEventListener("DOMContentLoaded",c),e._reactRetry=c}}function hn(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return e}var Qd=null;function mp(e){e=e.nextSibling;for(var i=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(i===0)return hn(e.nextSibling);i--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||i++}e=e.nextSibling}return null}function gp(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(i===0)return e;i--}else r!=="/$"&&r!=="/&"||i++}e=e.previousSibling}return null}function pp(e,i,r){switch(i=mo(r),e){case"html":if(e=i.documentElement,!e)throw Error(s(452));return e;case"head":if(e=i.head,!e)throw Error(s(453));return e;case"body":if(e=i.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function jl(e){for(var i=e.attributes;i.length;)e.removeAttributeNode(i[0]);Kc(e)}var mn=new Map,xp=new Set;function go(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var aa=K.d;K.d={f:fS,r:hS,D:mS,C:gS,L:pS,m:xS,X:yS,S:bS,M:vS};function fS(){var e=aa.f(),i=so();return e||i}function hS(e){var i=Ri(e);i!==null&&i.tag===5&&i.type==="form"?Rg(i):aa.r(e)}var fs=typeof document>"u"?null:document;function bp(e,i,r){var c=fs;if(c&&typeof i=="string"&&i){var m=ln(i);m='link[rel="'+e+'"][href="'+m+'"]',typeof r=="string"&&(m+='[crossorigin="'+r+'"]'),xp.has(m)||(xp.add(m),e={rel:e,crossOrigin:r,href:i},c.querySelector(m)===null&&(i=c.createElement("link"),Nt(i,"link",e),bt(i),c.head.appendChild(i)))}}function mS(e){aa.D(e),bp("dns-prefetch",e,null)}function gS(e,i){aa.C(e,i),bp("preconnect",e,i)}function pS(e,i,r){aa.L(e,i,r);var c=fs;if(c&&e&&i){var m='link[rel="preload"][as="'+ln(i)+'"]';i==="image"&&r&&r.imageSrcSet?(m+='[imagesrcset="'+ln(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(m+='[imagesizes="'+ln(r.imageSizes)+'"]')):m+='[href="'+ln(e)+'"]';var p=m;switch(i){case"style":p=hs(e);break;case"script":p=ms(e)}mn.has(p)||(e=b({rel:"preload",href:i==="image"&&r&&r.imageSrcSet?void 0:e,as:i},r),mn.set(p,e),c.querySelector(m)!==null||i==="style"&&c.querySelector(Nl(p))||i==="script"&&c.querySelector(Ml(p))||(i=c.createElement("link"),Nt(i,"link",e),bt(i),c.head.appendChild(i)))}}function xS(e,i){aa.m(e,i);var r=fs;if(r&&e){var c=i&&typeof i.as=="string"?i.as:"script",m='link[rel="modulepreload"][as="'+ln(c)+'"][href="'+ln(e)+'"]',p=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=ms(e)}if(!mn.has(p)&&(e=b({rel:"modulepreload",href:e},i),mn.set(p,e),r.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Ml(p)))return}c=r.createElement("link"),Nt(c,"link",e),bt(c),r.head.appendChild(c)}}}function bS(e,i,r){aa.S(e,i,r);var c=fs;if(c&&e){var m=Oi(c).hoistableStyles,p=hs(e);i=i||"default";var y=m.get(p);if(!y){var T={loading:0,preload:null};if(y=c.querySelector(Nl(p)))T.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":i},r),(r=mn.get(p))&&Zd(e,r);var D=y=c.createElement("link");bt(D),Nt(D,"link",e),D._p=new Promise(function(V,q){D.onload=V,D.onerror=q}),D.addEventListener("load",function(){T.loading|=1}),D.addEventListener("error",function(){T.loading|=2}),T.loading|=4,po(y,i,c)}y={type:"stylesheet",instance:y,count:1,state:T},m.set(p,y)}}}function yS(e,i){aa.X(e,i);var r=fs;if(r&&e){var c=Oi(r).hoistableScripts,m=ms(e),p=c.get(m);p||(p=r.querySelector(Ml(m)),p||(e=b({src:e,async:!0},i),(i=mn.get(m))&&Kd(e,i),p=r.createElement("script"),bt(p),Nt(p,"link",e),r.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(m,p))}}function vS(e,i){aa.M(e,i);var r=fs;if(r&&e){var c=Oi(r).hoistableScripts,m=ms(e),p=c.get(m);p||(p=r.querySelector(Ml(m)),p||(e=b({src:e,async:!0,type:"module"},i),(i=mn.get(m))&&Kd(e,i),p=r.createElement("script"),bt(p),Nt(p,"link",e),r.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(m,p))}}function yp(e,i,r,c){var m=(m=le.current)?go(m):null;if(!m)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(i=hs(r.href),r=Oi(m).hoistableStyles,c=r.get(i),c||(c={type:"style",instance:null,count:0,state:null},r.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=hs(r.href);var p=Oi(m).hoistableStyles,y=p.get(e);if(y||(m=m.ownerDocument||m,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,y),(p=m.querySelector(Nl(e)))&&!p._p&&(y.instance=p,y.state.loading=5),mn.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},mn.set(e,r),p||SS(m,e,r,y.state))),i&&c===null)throw Error(s(528,""));return y}if(i&&c!==null)throw Error(s(529,""));return null;case"script":return i=r.async,r=r.src,typeof r=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ms(r),r=Oi(m).hoistableScripts,c=r.get(i),c||(c={type:"script",instance:null,count:0,state:null},r.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function hs(e){return'href="'+ln(e)+'"'}function Nl(e){return'link[rel="stylesheet"]['+e+"]"}function vp(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function SS(e,i,r,c){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=e.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),Nt(i,"link",r),bt(i),e.head.appendChild(i))}function ms(e){return'[src="'+ln(e)+'"]'}function Ml(e){return"script[async]"+e}function Sp(e,i,r){if(i.count++,i.instance===null)switch(i.type){case"style":var c=e.querySelector('style[data-href~="'+ln(r.href)+'"]');if(c)return i.instance=c,bt(c),c;var m=b({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return c=(e.ownerDocument||e).createElement("style"),bt(c),Nt(c,"style",m),po(c,r.precedence,e),i.instance=c;case"stylesheet":m=hs(r.href);var p=e.querySelector(Nl(m));if(p)return i.state.loading|=4,i.instance=p,bt(p),p;c=vp(r),(m=mn.get(m))&&Zd(c,m),p=(e.ownerDocument||e).createElement("link"),bt(p);var y=p;return y._p=new Promise(function(T,D){y.onload=T,y.onerror=D}),Nt(p,"link",c),i.state.loading|=4,po(p,r.precedence,e),i.instance=p;case"script":return p=ms(r.src),(m=e.querySelector(Ml(p)))?(i.instance=m,bt(m),m):(c=r,(m=mn.get(p))&&(c=b({},r),Kd(c,m)),e=e.ownerDocument||e,m=e.createElement("script"),bt(m),Nt(m,"link",c),e.head.appendChild(m),i.instance=m);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,po(c,r.precedence,e));return i.instance}function po(e,i,r){for(var c=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,p=m,y=0;y<c.length;y++){var T=c[y];if(T.dataset.precedence===i)p=T;else if(p!==m)break}p?p.parentNode.insertBefore(e,p.nextSibling):(i=r.nodeType===9?r.head:r,i.insertBefore(e,i.firstChild))}function Zd(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.title==null&&(e.title=i.title)}function Kd(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.integrity==null&&(e.integrity=i.integrity)}var xo=null;function _p(e,i,r){if(xo===null){var c=new Map,m=xo=new Map;m.set(r,c)}else m=xo,c=m.get(r),c||(c=new Map,m.set(r,c));if(c.has(e))return c;for(c.set(e,null),r=r.getElementsByTagName(e),m=0;m<r.length;m++){var p=r[m];if(!(p[Ys]||p[St]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var y=p.getAttribute(i)||"";y=e+y;var T=c.get(y);T?T.push(p):c.set(y,[p])}}return c}function wp(e,i,r){e=e.ownerDocument||e,e.head.insertBefore(r,i==="title"?e.querySelector("head > title"):null)}function _S(e,i,r){if(r===1||i.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return e=i.disabled,typeof i.precedence=="string"&&e==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function jp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function wS(e,i,r,c){if(r.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var m=hs(c.href),p=i.querySelector(Nl(m));if(p){i=p._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=bo.bind(e),i.then(e,e)),r.state.loading|=4,r.instance=p,bt(p);return}p=i.ownerDocument||i,c=vp(c),(m=mn.get(m))&&Zd(c,m),p=p.createElement("link"),bt(p);var y=p;y._p=new Promise(function(T,D){y.onload=T,y.onerror=D}),Nt(p,"link",c),r.instance=p}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,i),(i=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=bo.bind(e),i.addEventListener("load",r),i.addEventListener("error",r))}}var Pd=0;function jS(e,i){return e.stylesheets&&e.count===0&&vo(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var c=setTimeout(function(){if(e.stylesheets&&vo(e,e.stylesheets),e.unsuspend){var p=e.unsuspend;e.unsuspend=null,p()}},6e4+i);0<e.imgBytes&&Pd===0&&(Pd=62500*iS());var m=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&vo(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>Pd?50:800)+i);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function bo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var yo=null;function vo(e,i){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yo=new Map,i.forEach(NS,e),yo=null,bo.call(e))}function NS(e,i){if(!(i.state.loading&4)){var r=yo.get(e);if(r)var c=r.get(null);else{r=new Map,yo.set(e,r);for(var m=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<m.length;p++){var y=m[p];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(r.set(y.dataset.precedence,y),c=y)}c&&r.set(null,c)}m=i.instance,y=m.getAttribute("data-precedence"),p=r.get(y)||c,p===c&&r.set(null,m),r.set(y,m),this.count++,c=bo.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),p?p.parentNode.insertBefore(m,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(m,e.firstChild)),i.state.loading|=4}}var Tl={$$typeof:k,Provider:null,Consumer:null,_currentValue:fe,_currentValue2:fe,_threadCount:0};function MS(e,i,r,c,m,p,y,T,D){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ic(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ic(0),this.hiddenUpdates=Ic(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=p,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Np(e,i,r,c,m,p,y,T,D,V,q,Z){return e=new MS(e,i,r,y,D,V,q,Z,T),i=1,p===!0&&(i|=24),p=Ft(3,null,null,i),e.current=p,p.stateNode=e,i=Eu(),i.refCount++,e.pooledCache=i,i.refCount++,p.memoizedState={element:c,isDehydrated:r,cache:i},Ru(p),e}function Mp(e){return e?(e=Xi,e):Xi}function Tp(e,i,r,c,m,p){m=Mp(m),c.context===null?c.context=m:c.pendingContext=m,c=va(i),c.payload={element:r},p=p===void 0?null:p,p!==null&&(c.callback=p),r=Sa(e,c,i),r!==null&&(Ht(r,e,i),sl(r,e,i))}function kp(e,i){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<i?r:i}}function Wd(e,i){kp(e,i),(e=e.alternate)&&kp(e,i)}function Cp(e){if(e.tag===13||e.tag===31){var i=ei(e,67108864);i!==null&&Ht(i,e,67108864),Wd(e,67108864)}}function Ep(e){if(e.tag===13||e.tag===31){var i=Wt();i=Fc(i);var r=ei(e,i);r!==null&&Ht(r,e,i),Wd(e,i)}}var So=!0;function TS(e,i,r,c){var m=U.T;U.T=null;var p=K.p;try{K.p=2,Jd(e,i,r,c)}finally{K.p=p,U.T=m}}function kS(e,i,r,c){var m=U.T;U.T=null;var p=K.p;try{K.p=8,Jd(e,i,r,c)}finally{K.p=p,U.T=m}}function Jd(e,i,r,c){if(So){var m=ef(c);if(m===null)Ud(e,i,c,_o,r),Dp(e,c);else if(ES(m,e,i,r,c))c.stopPropagation();else if(Dp(e,c),i&4&&-1<CS.indexOf(e)){for(;m!==null;){var p=Ri(m);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var y=Za(p.pendingLanes);if(y!==0){var T=p;for(T.pendingLanes|=2,T.entangledLanes|=2;y;){var D=1<<31-Xt(y);T.entanglements[1]|=D,y&=~D}Dn(p),(Be&6)===0&&(ao=Gt()+500,Sl(0))}}break;case 31:case 13:T=ei(p,2),T!==null&&Ht(T,p,2),so(),Wd(p,2)}if(p=ef(c),p===null&&Ud(e,i,c,_o,r),p===m)break;m=p}m!==null&&c.stopPropagation()}else Ud(e,i,c,null,r)}}function ef(e){return e=nu(e),tf(e)}var _o=null;function tf(e){if(_o=null,e=zi(e),e!==null){var i=o(e);if(i===null)e=null;else{var r=i.tag;if(r===13){if(e=u(i),e!==null)return e;e=null}else if(r===31){if(e=d(i),e!==null)return e;e=null}else if(r===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;e=null}else i!==e&&(e=null)}}return _o=e,null}function Ap(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(m1()){case Uh:return 2;case $h:return 8;case ur:case g1:return 32;case Vh:return 268435456;default:return 32}default:return 32}}var nf=!1,Da=null,za=null,Ra=null,kl=new Map,Cl=new Map,Oa=[],CS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Dp(e,i){switch(e){case"focusin":case"focusout":Da=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":Ra=null;break;case"pointerover":case"pointerout":kl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cl.delete(i.pointerId)}}function El(e,i,r,c,m,p){return e===null||e.nativeEvent!==p?(e={blockedOn:i,domEventName:r,eventSystemFlags:c,nativeEvent:p,targetContainers:[m]},i!==null&&(i=Ri(i),i!==null&&Cp(i)),e):(e.eventSystemFlags|=c,i=e.targetContainers,m!==null&&i.indexOf(m)===-1&&i.push(m),e)}function ES(e,i,r,c,m){switch(i){case"focusin":return Da=El(Da,e,i,r,c,m),!0;case"dragenter":return za=El(za,e,i,r,c,m),!0;case"mouseover":return Ra=El(Ra,e,i,r,c,m),!0;case"pointerover":var p=m.pointerId;return kl.set(p,El(kl.get(p)||null,e,i,r,c,m)),!0;case"gotpointercapture":return p=m.pointerId,Cl.set(p,El(Cl.get(p)||null,e,i,r,c,m)),!0}return!1}function zp(e){var i=zi(e.target);if(i!==null){var r=o(i);if(r!==null){if(i=r.tag,i===13){if(i=u(r),i!==null){e.blockedOn=i,Fh(e.priority,function(){Ep(r)});return}}else if(i===31){if(i=d(r),i!==null){e.blockedOn=i,Fh(e.priority,function(){Ep(r)});return}}else if(i===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wo(e){if(e.blockedOn!==null)return!1;for(var i=e.targetContainers;0<i.length;){var r=ef(e.nativeEvent);if(r===null){r=e.nativeEvent;var c=new r.constructor(r.type,r);tu=c,r.target.dispatchEvent(c),tu=null}else return i=Ri(r),i!==null&&Cp(i),e.blockedOn=r,!1;i.shift()}return!0}function Rp(e,i,r){wo(e)&&r.delete(i)}function AS(){nf=!1,Da!==null&&wo(Da)&&(Da=null),za!==null&&wo(za)&&(za=null),Ra!==null&&wo(Ra)&&(Ra=null),kl.forEach(Rp),Cl.forEach(Rp)}function jo(e,i){e.blockedOn===i&&(e.blockedOn=null,nf||(nf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,AS)))}var No=null;function Op(e){No!==e&&(No=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){No===e&&(No=null);for(var i=0;i<e.length;i+=3){var r=e[i],c=e[i+1],m=e[i+2];if(typeof c!="function"){if(tf(c||r)===null)continue;break}var p=Ri(r);p!==null&&(e.splice(i,3),i-=3,ed(p,{pending:!0,data:m,method:r.method,action:c},c,m))}}))}function gs(e){function i(D){return jo(D,e)}Da!==null&&jo(Da,e),za!==null&&jo(za,e),Ra!==null&&jo(Ra,e),kl.forEach(i),Cl.forEach(i);for(var r=0;r<Oa.length;r++){var c=Oa[r];c.blockedOn===e&&(c.blockedOn=null)}for(;0<Oa.length&&(r=Oa[0],r.blockedOn===null);)zp(r),r.blockedOn===null&&Oa.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(c=0;c<r.length;c+=3){var m=r[c],p=r[c+1],y=m[At]||null;if(typeof p=="function")y||Op(r);else if(y){var T=null;if(p&&p.hasAttribute("formAction")){if(m=p,y=p[At]||null)T=y.formAction;else if(tf(m)!==null)continue}else T=y.action;typeof T=="function"?r[c+1]=T:(r.splice(c,3),c-=3),Op(r)}}}function Lp(){function e(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(y){return m=y})},focusReset:"manual",scroll:"manual"})}function i(){m!==null&&(m(),m=null),c||setTimeout(r,20)}function r(){if(!c&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(r,100),function(){c=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),m!==null&&(m(),m=null)}}}function af(e){this._internalRoot=e}Mo.prototype.render=af.prototype.render=function(e){var i=this._internalRoot;if(i===null)throw Error(s(409));var r=i.current,c=Wt();Tp(r,c,e,i,null,null)},Mo.prototype.unmount=af.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var i=e.containerInfo;Tp(e.current,2,null,e,null,null),so(),i[Di]=null}};function Mo(e){this._internalRoot=e}Mo.prototype.unstable_scheduleHydration=function(e){if(e){var i=Ih();e={blockedOn:null,target:e,priority:i};for(var r=0;r<Oa.length&&i!==0&&i<Oa[r].priority;r++);Oa.splice(r,0,e),r===0&&zp(e)}};var Hp=t.version;if(Hp!=="19.2.8")throw Error(s(527,Hp,"19.2.8"));K.findDOMNode=function(e){var i=e._reactInternals;if(i===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=g(i),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var DS={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var To=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!To.isDisabled&&To.supportsFiber)try{Us=To.inject(DS),qt=To}catch{}}return Dl.createRoot=function(e,i){if(!l(e))throw Error(s(299));var r=!1,c="",m=qg,p=Xg,y=Ig;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(m=i.onUncaughtError),i.onCaughtError!==void 0&&(p=i.onCaughtError),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),i=Np(e,1,!1,null,null,r,c,null,m,p,y,Lp),e[Di]=i.current,Bd(e),new af(i)},Dl.hydrateRoot=function(e,i,r){if(!l(e))throw Error(s(299));var c=!1,m="",p=qg,y=Xg,T=Ig,D=null;return r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(m=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(y=r.onCaughtError),r.onRecoverableError!==void 0&&(T=r.onRecoverableError),r.formState!==void 0&&(D=r.formState)),i=Np(e,1,!0,i,r??null,c,m,D,p,y,T,Lp),i.context=Mp(null),r=i.current,c=Wt(),c=Fc(c),m=va(c),m.callback=null,Sa(r,m,c),r=c,i.current.lanes=r,Vs(i,r),Dn(i),e[Di]=i.current,Bd(e),new Mo(i)},Dl.version="19.2.8",Dl}var Fp;function qS(){if(Fp)return rf.exports;Fp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),rf.exports=GS(),rf.exports}var XS=qS();const IS=ly(XS);/**
* react-router v7.18.3
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/var th=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,oy=/^[\\/]{2}/;function FS(n,t){return t+n.replace(/\\/g,"/")}var Qp="popstate";function Zp(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function QS(n={}){function t(s,l){var g;let o=(g=l.state)==null?void 0:g.masked,{pathname:u,search:d,hash:f}=o||s.location;return Cf("",{pathname:u,search:d,hash:f},l.state&&l.state.usr||null,l.state&&l.state.key||"default",o?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function a(s,l){return typeof l=="string"?l:Ni(l)}return KS(t,a,null,n)}function tt(n,t){if(n===!1||n===null||typeof n>"u")throw new Error(t)}function xn(n,t){if(!n){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ZS(){return Math.random().toString(36).substring(2,10)}function Kp(n,t){return{usr:n.state,key:n.key,idx:t,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Cf(n,t,a=null,s,l){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof t=="string"?As(t):t,state:a,key:t&&t.key||s||ZS(),mask:l}}function Ni({pathname:n="/",search:t="",hash:a=""}){return t&&t!=="?"&&(n+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(n+=a.charAt(0)==="#"?a:"#"+a),n}function As(n){let t={};if(n){let a=n.indexOf("#");a>=0&&(t.hash=n.substring(a),n=n.substring(0,a));let s=n.indexOf("?");s>=0&&(t.search=n.substring(s),n=n.substring(0,s)),n&&(t.pathname=n)}return t}function KS(n,t,a,s={}){let{window:l=document.defaultView,v5Compat:o=!1}=s,u=l.history,d="POP",f=null,g=x();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function x(){return(u.state||{idx:null}).idx}function b(){d="POP";let S=x(),N=S==null?null:S-g;g=S,f&&f({action:d,location:j.location,delta:N})}function v(S,N){d="PUSH";let C=Zp(S)?S:Cf(j.location,S,N);g=x()+1;let k=Kp(C,g),E=j.createHref(C.mask||C);try{u.pushState(k,"",E)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;l.location.assign(E)}o&&f&&f({action:d,location:j.location,delta:1})}function _(S,N){d="REPLACE";let C=Zp(S)?S:Cf(j.location,S,N);g=x();let k=Kp(C,g),E=j.createHref(C.mask||C);u.replaceState(k,"",E),o&&f&&f({action:d,location:j.location,delta:0})}function M(S){return PS(l,S)}let j={get action(){return d},get location(){return n(l,u)},listen(S){if(f)throw new Error("A history only accepts one active listener");return l.addEventListener(Qp,b),f=S,()=>{l.removeEventListener(Qp,b),f=null}},createHref(S){return t(l,S)},createURL:M,encodeLocation(S){let N=M(S);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:v,replace:_,go(S){return u.go(S)}};return j}function PS(n,t,a=!1){let s="http://localhost";n&&(s=n.location.origin!=="null"?n.location.origin:n.location.href),tt(s,"No window.location.(origin|href) available to create URL");let l=typeof t=="string"?t:Ni(t);return l=l.replace(/ $/,"%20"),!a&&oy.test(l)&&(l=s+l),new URL(l,s)}function cy(n,t,a="/"){return WS(n,t,a,!1)}function WS(n,t,a,s,l){let o=typeof t=="string"?As(t):t,u=da(o.pathname||"/",a);if(u==null)return null;let d=JS(n),f=null,g=u_(u);for(let x=0;f==null&&x<d.length;++x)f=c_(d[x],g,s);return f}function JS(n){let t=uy(n);return e_(t),t}function uy(n,t=[],a=[],s="",l=!1){let o=(u,d,f=l,g)=>{let x={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(s)&&f)return;tt(x.relativePath.startsWith(s),`Absolute route path "${x.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(s.length)}let b=Nn([s,x.relativePath]),v=a.concat(x);u.children&&u.children.length>0&&(tt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),uy(u.children,t,v,b,f)),!(u.path==null&&!u.index)&&t.push({path:b,score:r_(b,u.index),routesMeta:v.map((_,M)=>{let[j,S]=hy(_.relativePath,_.caseSensitive,M===v.length-1);return{..._,matcher:j,compiledParams:S}})})};return n.forEach((u,d)=>{var f;if(u.path===""||!((f=u.path)!=null&&f.includes("?")))o(u,d);else for(let g of dy(u.path))o(u,d,!0,g)}),t}function dy(n){let t=n.split("/");if(t.length===0)return[];let[a,...s]=t,l=a.endsWith("?"),o=a.replace(/\?$/,"");if(s.length===0)return l?[o,""]:[o];let u=dy(s.join("/")),d=[];return d.push(...u.map(f=>f===""?o:[o,f].join("/"))),l&&d.push(...u),d.map(f=>n.startsWith("/")&&f===""?"/":f)}function e_(n){n.sort((t,a)=>t.score!==a.score?a.score-t.score:o_(t.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var t_=/^:[\w-]+$/,n_=3,a_=2,i_=1,s_=10,l_=-2,Pp=n=>n==="*";function r_(n,t){let a=n.split("/"),s=a.length;return a.some(Pp)&&(s+=l_),t&&(s+=a_),a.filter(l=>!Pp(l)).reduce((l,o)=>l+(t_.test(o)?n_:o===""?i_:s_),s)}function o_(n,t){return n.length===t.length&&n.slice(0,-1).every((s,l)=>s===t[l])?n[n.length-1]-t[t.length-1]:0}function c_(n,t,a=!1){let{routesMeta:s}=n,l={},o="/",u=[];for(let d=0;d<s.length;++d){let f=s[d],g=d===s.length-1,x=o==="/"?t:t.slice(o.length)||"/",b={path:f.relativePath,caseSensitive:f.caseSensitive,end:g},v=f.matcher&&f.compiledParams?fy(b,x,f.matcher,f.compiledParams):ic(b,x),_=f.route;if(!v&&g&&a&&!s[s.length-1].route.index&&(v=ic({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},x)),!v)return null;Object.assign(l,v.params),u.push({params:l,pathname:Nn([o,v.pathname]),pathnameBase:h_(Nn([o,v.pathnameBase])),route:_}),v.pathnameBase!=="/"&&(o=Nn([o,v.pathnameBase]))}return u}function ic(n,t){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[a,s]=hy(n.path,n.caseSensitive,n.end);return fy(n,t,a,s)}function fy(n,t,a,s){let l=t.match(a);if(!l)return null;let o=l[0],u=js(o,1),d=l.slice(1);return{params:s.reduce((g,{paramName:x,isOptional:b},v)=>{if(x==="*"){let M=d[v]||"";u=js(o.slice(0,o.length-M.length),1)}const _=d[v];return b&&!_?g[x]=void 0:g[x]=(_||"").replace(/%2F/g,"/"),g},{}),pathname:o,pathnameBase:u,pattern:n}}function hy(n,t=!1,a=!0){xn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let s=[],l="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,f,g,x)=>{if(s.push({paramName:d,isOptional:f!=null}),f){let b=x.charAt(g+u.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(s.push({paramName:"*"}),l+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?l+="\\/*$":n!==""&&n!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),s]}function u_(n){try{return n.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return xn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),n}}function da(n,t){if(t==="/")return n;if(!n.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,s=n.charAt(a);return s&&s!=="/"?null:n.slice(a)||"/"}function d_(n,t="/"){let{pathname:a,search:s="",hash:l=""}=typeof n=="string"?As(n):n,o;return a?(a=my(a),a.startsWith("/")||a.startsWith("\\")?o=Wp(a.substring(1),"/"):o=Wp(a,t)):o=t,{pathname:o,search:m_(s),hash:g_(l)}}function Wp(n,t){let a=js(t).split("/");return n.split("/").forEach(l=>{l===".."?a.length>1&&a.pop():l!=="."&&a.push(l)}),a.length>1?a.join("/"):"/"}function df(n,t,a,s){return`Cannot include a '${n}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function f_(n){return n.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function nh(n){let t=f_(n);return t.map((a,s)=>s===t.length-1?a.pathname:a.pathnameBase)}function Cc(n,t,a,s=!1){let l;typeof n=="string"?l=As(n):(l={...n},tt(!l.pathname||!l.pathname.includes("?"),df("?","pathname","search",l)),tt(!l.pathname||!l.pathname.includes("#"),df("#","pathname","hash",l)),tt(!l.search||!l.search.includes("#"),df("#","search","hash",l)));let o=n===""||l.pathname==="",u=o?"/":l.pathname,d;if(u==null)d=a;else{let b=t.length-1;if(!s&&u.startsWith("..")){let v=u.split("/");for(;v[0]==="..";)v.shift(),b-=1;l.pathname=v.join("/")}d=b>=0?t[b]:"/"}let f=d_(l,d),g=u&&u!=="/"&&u.endsWith("/"),x=(o||u===".")&&a.endsWith("/");return!f.pathname.endsWith("/")&&(g||x)&&(f.pathname+="/"),f}var my=n=>n.replace(/[\\/]{2,}/g,"/"),Nn=n=>my(n.join("/"));function js(n,t=0){let a=n.length;for(;a>t&&n.charCodeAt(a-1)===47;)a--;return a===n.length?n:n.slice(0,a)}var h_=n=>js(n).replace(/^\/*/,"/"),m_=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,g_=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,p_=class{constructor(n,t,a,s=!1){this.status=n,this.statusText=t||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function x_(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function b_(n){let t=n.map(a=>a.route.path).filter(Boolean);return Nn(t)||"/"}var gy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function py(n,t){let a=n;if(typeof a!="string"||!th.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,l=!1;if(gy)try{let o=new URL(window.location.href),u=oy.test(a)?new URL(FS(a,o.protocol)):new URL(a),d=da(u.pathname,t);u.origin===o.origin&&d!=null?a=d+u.search+u.hash:l=!0}catch{xn(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:l,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Jp=new URL("http://localhost");function ah(n){if(n.createURL)return n.createURL("/");try{return new URL(n.createHref("/"),Jp)}catch{return Jp}}function ff(n,t){return n.origin===t.origin&&(n.origin!=="null"||n.protocol===t.protocol&&n.host===t.host)}function y_(n,t){if(n.startsWith("//"))return!0;let a=t.protocol.toLowerCase();return n.toLowerCase().startsWith(a)?t.host===""||n.slice(a.length).startsWith("//"):!1}function ih(n,t,a,s){let l=null;try{l=n==null?null:new URL(n,a)}catch{}let o=new URL(t,a),u=l!=null&&!ff(l,a),d=!ff(o,a);if(s==="reject"){if(u||d)throw new Error("External navigation is not allowed")}else if(d&&(l==null||!y_(n,l)||!ff(l,o)))throw new Error("External navigation is not allowed")}var xy=["POST","PUT","PATCH","DELETE"];new Set(xy);var v_=["GET",...xy];new Set(v_);var S_=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function __(n){try{return S_.includes(new URL(n).protocol)}catch{return!1}}var Ds=w.createContext(null);Ds.displayName="DataRouter";var Ec=w.createContext(null);Ec.displayName="DataRouterState";var by=w.createContext(!1);function w_(){return w.useContext(by)}var yy=w.createContext({isTransitioning:!1});yy.displayName="ViewTransition";var j_=w.createContext(new Map);j_.displayName="Fetchers";var N_=w.createContext(null);N_.displayName="Await";var tn=w.createContext(null);tn.displayName="Navigation";var ir=w.createContext(null);ir.displayName="Location";var Bn=w.createContext({outlet:null,matches:[],isDataRoute:!1});Bn.displayName="Route";var sh=w.createContext(null);sh.displayName="RouteError";var vy="REACT_ROUTER_ERROR",M_="REDIRECT",T_="ROUTE_ERROR_RESPONSE";function k_(n){if(n.startsWith(`${vy}:${M_}:{`))try{let t=JSON.parse(n.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function C_(n){if(n.startsWith(`${vy}:${T_}:{`))try{let t=JSON.parse(n.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new p_(t.status,t.statusText,t.data)}catch{}}function E_(n,{relative:t}={}){tt(zs(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=w.useContext(tn),{hash:l,pathname:o,search:u}=sr(n,{relative:t}),d=o;return a!=="/"&&(d=o==="/"?a:Nn([a,o])),s.createHref({pathname:d,search:u,hash:l})}function zs(){return w.useContext(ir)!=null}function nn(){return tt(zs(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(ir).location}var Sy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function _y(n){w.useContext(tn).static||w.useLayoutEffect(n)}function Ac(){let{isDataRoute:n}=w.useContext(Bn);return n?G_():A_()}function A_(){tt(zs(),"useNavigate() may be used only in the context of a <Router> component.");let n=w.useContext(Ds),{basename:t,navigator:a}=w.useContext(tn),{matches:s}=w.useContext(Bn),{pathname:l}=nn(),o=JSON.stringify(nh(s)),u=w.useRef(!1);return _y(()=>{u.current=!0}),w.useCallback((f,g={})=>{if(xn(u.current,Sy),!u.current)return;if(typeof f=="number"){a.go(f);return}let x=Cc(f,JSON.parse(o),l,g.relative==="path");n==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:Nn([t,x.pathname])),ih(typeof f=="string"?f:Ni(f),a.createHref(x),ah(a),"reject"),(g.replace?a.replace:a.push)(x,g.state,g)},[t,a,o,l,n])}w.createContext(null);function sr(n,{relative:t}={}){let{matches:a}=w.useContext(Bn),{pathname:s}=nn(),l=JSON.stringify(nh(a));return w.useMemo(()=>Cc(n,JSON.parse(l),s,t==="path"),[n,l,s,t])}function D_(n,t){return wy(n,t)}function wy(n,t,a){var S;tt(zs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=w.useContext(tn),{matches:l}=w.useContext(Bn),o=l[l.length-1],u=o?o.params:{},d=o?o.pathname:"/",f=o?o.pathnameBase:"/",g=o&&o.route;{let N=g&&g.path||"";Ny(d,!g||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let x=nn(),b;if(t){let N=typeof t=="string"?As(t):t;tt(f==="/"||((S=N.pathname)==null?void 0:S.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${N.pathname}" was given in the \`location\` prop.`),b=N}else b=x;let v=b.pathname||"/",_=v;if(f!=="/"){let N=f.replace(/^\//,"").split("/");_="/"+v.replace(/^\//,"").split("/").slice(N.length).join("/")}let M=a&&a.state.matches.length?a.state.matches.map(N=>Object.assign(N,{route:a.manifest[N.route.id]||N.route})):cy(n,{pathname:_});xn(g||M!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),xn(M==null||M[M.length-1].route.element!==void 0||M[M.length-1].route.Component!==void 0||M[M.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=H_(M&&M.map(N=>Object.assign({},N,{params:Object.assign({},u,N.params),pathname:Nn([f,s.encodeLocation?s.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?f:Nn([f,s.encodeLocation?s.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),l,a);return t&&j?w.createElement(ir.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...b},navigationType:"POP"}},j):j}function z_(){let n=Y_(),t=x_(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),a=n instanceof Error?n.stack:null,s="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:s},o={padding:"2px 4px",backgroundColor:s},u=null;return console.error("Error handled by React Router default ErrorBoundary:",n),u=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:o},"ErrorBoundary")," or"," ",w.createElement("code",{style:o},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),a?w.createElement("pre",{style:l},a):null,u)}var R_=w.createElement(z_,null),jy=class extends w.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,t){return t.location!==n.location||t.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:t.error,location:t.location,revalidation:n.revalidation||t.revalidation}}componentDidCatch(n,t){this.props.onError?this.props.onError(n,t):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const a=C_(n.digest);a&&(n=a)}let t=n!==void 0?w.createElement(Bn.Provider,{value:this.props.routeContext},w.createElement(sh.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?w.createElement(O_,{error:n},t):t}};jy.contextType=by;var hf=new WeakMap;function O_({children:n,error:t}){let{basename:a,navigator:s}=w.useContext(tn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let l=k_(t.digest);if(l){let o=hf.get(t);if(o)throw o;let u=py(l.location,a),d=u.absoluteURL||u.to;if(ih(l.location,d,ah(s),"allow-explicit"),__(d))throw new Error("Invalid redirect location");if(gy&&!hf.get(t))if(u.isExternal||l.reloadDocument)window.location.href=d;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:l.replace}));throw hf.set(t,f),f}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d}`})}}return n}function L_({routeContext:n,match:t,children:a}){let s=w.useContext(Ds);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Bn.Provider,{value:n},a)}function H_(n,t=[],a){let s=a==null?void 0:a.state;if(n==null){if(!s)return null;if(s.errors)n=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)n=s.matches;else return null}let l=n,o=s==null?void 0:s.errors;if(o!=null){let x=l.findIndex(b=>b.route.id&&(o==null?void 0:o[b.route.id])!==void 0);tt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),l=l.slice(0,Math.min(l.length,x+1))}let u=!1,d=-1;if(a&&s){u=s.renderFallback;for(let x=0;x<l.length;x++){let b=l[x];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(d=x),b.route.id){let{loaderData:v,errors:_}=s,M=b.route.loader&&!v.hasOwnProperty(b.route.id)&&(!_||_[b.route.id]===void 0);if(b.route.lazy||M){a.isStatic&&(u=!0),d>=0?l=l.slice(0,d+1):l=[l[0]];break}}}}let f=a==null?void 0:a.onError,g=s&&f?(x,b)=>{var v,_;f(x,{location:s.location,params:((_=(v=s.matches)==null?void 0:v[0])==null?void 0:_.params)??{},pattern:b_(s.matches),errorInfo:b})}:void 0;return l.reduceRight((x,b,v)=>{let _,M=!1,j=null,S=null;s&&(_=o&&b.route.id?o[b.route.id]:void 0,j=b.route.errorElement||R_,u&&(d<0&&v===0?(Ny("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),M=!0,S=null):d===v&&(M=!0,S=b.route.hydrateFallbackElement||null)));let N=t.concat(l.slice(0,v+1)),C=()=>{let k;return _?k=j:M?k=S:b.route.Component?k=w.createElement(b.route.Component,null):b.route.element?k=b.route.element:k=x,w.createElement(L_,{match:b,routeContext:{outlet:x,matches:N,isDataRoute:s!=null},children:k})};return s&&(b.route.ErrorBoundary||b.route.errorElement||v===0)?w.createElement(jy,{location:s.location,revalidation:s.revalidation,component:j,error:_,children:C(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:g}):C()},null)}function lh(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function B_(n){let t=w.useContext(Ds);return tt(t,lh(n)),t}function U_(n){let t=w.useContext(Ec);return tt(t,lh(n)),t}function $_(n){let t=w.useContext(Bn);return tt(t,lh(n)),t}function rh(n){let t=$_(n),a=t.matches[t.matches.length-1];return tt(a.route.id,`${n} can only be used on routes that contain a unique "id"`),a.route.id}function V_(){return rh("useRouteId")}function Y_(){var s;let n=w.useContext(sh),t=U_("useRouteError"),a=rh("useRouteError");return n!==void 0?n:(s=t.errors)==null?void 0:s[a]}function G_(){let{router:n}=B_("useNavigate"),t=rh("useNavigate"),a=w.useRef(!1);return _y(()=>{a.current=!0}),w.useCallback(async(l,o={})=>{xn(a.current,Sy),a.current&&(typeof l=="number"?await n.navigate(l):await n.navigate(l,{fromRouteId:t,...o}))},[n,t])}var ex={};function Ny(n,t,a){!t&&!ex[n]&&(ex[n]=!0,xn(!1,a))}w.memo(q_);function q_({routes:n,manifest:t,future:a,state:s,isStatic:l,onError:o}){return wy(n,void 0,{manifest:t,state:s,isStatic:l,onError:o})}function My({to:n,replace:t,state:a,relative:s}){tt(zs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l,navigator:o}=w.useContext(tn);xn(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=w.useContext(Bn),{pathname:d}=nn(),f=Ac(),g=Cc(n,nh(u),d,s==="path");ih(typeof n=="string"?n:Ni(n),o.createHref(g),ah(o),"reject");let x=JSON.stringify(g);return w.useEffect(()=>{f(JSON.parse(x),{replace:t,state:a,relative:s})},[f,x,s,t,a]),null}function Ut(n){tt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function X_({basename:n="/",children:t=null,location:a,navigationType:s="POP",navigator:l,static:o=!1,useTransitions:u}){tt(!zs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=n.replace(/^\/*/,"/"),f=w.useMemo(()=>({basename:d,navigator:l,static:o,useTransitions:u,future:{}}),[d,l,o,u]);typeof a=="string"&&(a=As(a));let{pathname:g="/",search:x="",hash:b="",state:v=null,key:_="default",mask:M}=a,j=w.useMemo(()=>{let S=da(g,d);return S==null?null:{location:{pathname:S,search:x,hash:b,state:v,key:_,mask:M},navigationType:s}},[d,g,x,b,v,_,s,M]);return xn(j!=null,`<Router basename="${d}"> is not able to match the URL "${g}${x}${b}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:w.createElement(tn.Provider,{value:f},w.createElement(ir.Provider,{children:t,value:j}))}function I_({children:n,location:t}){return D_(Ef(n),t)}function Ef(n,t=[]){let a=[];return w.Children.forEach(n,(s,l)=>{if(!w.isValidElement(s))return;let o=[...t,l];if(s.type===w.Fragment){a.push.apply(a,Ef(s.props.children,o));return}tt(s.type===Ut,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),tt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let u={id:s.props.id||o.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(u.children=Ef(s.props.children,o)),a.push(u)}),a}var Wo="get",Jo="application/x-www-form-urlencoded";function Dc(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function F_(n){return Dc(n)&&n.tagName.toLowerCase()==="button"}function Q_(n){return Dc(n)&&n.tagName.toLowerCase()==="form"}function Z_(n){return Dc(n)&&n.tagName.toLowerCase()==="input"}function K_(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function P_(n,t){return n.button===0&&(!t||t==="_self")&&!K_(n)}function Af(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((t,a)=>{let s=n[a];return t.concat(Array.isArray(s)?s.map(l=>[a,l]):[[a,s]])},[]))}function W_(n,t){let a=Af(n);return t&&t.forEach((s,l)=>{a.has(l)||t.getAll(l).forEach(o=>{a.append(l,o)})}),a}var ko=null;function J_(){if(ko===null)try{new FormData(document.createElement("form"),0),ko=!1}catch{ko=!0}return ko}var ew=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function mf(n){return n!=null&&!ew.has(n)?(xn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Jo}"`),null):n}function tw(n,t){let a,s,l,o,u;if(Q_(n)){let d=n.getAttribute("action");s=d?da(d,t):null,a=n.getAttribute("method")||Wo,l=mf(n.getAttribute("enctype"))||Jo,o=new FormData(n)}else if(F_(n)||Z_(n)&&(n.type==="submit"||n.type==="image")){let d=n.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=n.getAttribute("formaction")||d.getAttribute("action");if(s=f?da(f,t):null,a=n.getAttribute("formmethod")||d.getAttribute("method")||Wo,l=mf(n.getAttribute("formenctype"))||mf(d.getAttribute("enctype"))||Jo,o=new FormData(d,n),!J_()){let{name:g,type:x,value:b}=n;if(x==="image"){let v=g?`${g}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else g&&o.append(g,b)}}else{if(Dc(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Wo,s=null,l=Jo,u=n}return o&&l==="text/plain"&&(u=o,o=void 0),{action:s,method:a.toLowerCase(),encType:l,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oh(n,t){if(n===!1||n===null||typeof n>"u")throw new Error(t)}function Ty(n,t,a,s){let l=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return a?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${s}`:l.pathname=`${l.pathname}.${s}`:l.pathname==="/"?l.pathname=`_root.${s}`:t&&da(l.pathname,t)==="/"?l.pathname=`${js(t)}/_root.${s}`:l.pathname=`${js(l.pathname)}.${s}`,l}async function nw(n,t){if(n.id in t)return t[n.id];try{let a=await import(n.module);return t[n.id]=a,a}catch(a){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function aw(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function iw(n,t,a){let s=await Promise.all(n.map(async l=>{let o=t.routes[l.route.id];if(o){let u=await nw(o,a);return u.links?u.links():[]}return[]}));return ow(s.flat(1).filter(aw).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function tx(n,t,a,s,l,o){let u=(f,g)=>a[g]?f.route.id!==a[g].route.id:!0,d=(f,g)=>{var x;return a[g].pathname!==f.pathname||((x=a[g].route.path)==null?void 0:x.endsWith("*"))&&a[g].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,g)=>u(f,g)||d(f,g)):o==="data"?t.filter((f,g)=>{var b;let x=s.routes[f.route.id];if(!x||!x.hasLoader)return!1;if(u(f,g)||d(f,g))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((b=a[0])==null?void 0:b.params)||{},nextUrl:new URL(n,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function sw(n,t,{includeHydrateFallback:a}={}){return lw(n.map(s=>{let l=t.routes[s.route.id];if(!l)return[];let o=[l.module];return l.clientActionModule&&(o=o.concat(l.clientActionModule)),l.clientLoaderModule&&(o=o.concat(l.clientLoaderModule)),a&&l.hydrateFallbackModule&&(o=o.concat(l.hydrateFallbackModule)),l.imports&&(o=o.concat(l.imports)),o}).flat(1))}function lw(n){return[...new Set(n)]}function rw(n){let t={},a=Object.keys(n).sort();for(let s of a)t[s]=n[s];return t}function ow(n,t){let a=new Set;return new Set(t),n.reduce((s,l)=>{let o=JSON.stringify(rw(l));return a.has(o)||(a.add(o),s.push({key:o,link:l})),s},[])}function ch(){let n=w.useContext(Ds);return oh(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function cw(){let n=w.useContext(Ec);return oh(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var uh=w.createContext(void 0);uh.displayName="FrameworkContext";function zc(){let n=w.useContext(uh);return oh(n,"You must render this element inside a <HydratedRouter> element"),n}function uw(n,t){let a=w.useContext(uh),[s,l]=w.useState(!1),[o,u]=w.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:g,onMouseLeave:x,onTouchStart:b}=t,v=w.useRef(null);w.useEffect(()=>{if(n==="render"&&u(!0),n==="viewport"){let j=N=>{N.forEach(C=>{u(C.isIntersecting)})},S=new IntersectionObserver(j,{threshold:.5});return v.current&&S.observe(v.current),()=>{S.disconnect()}}},[n]),w.useEffect(()=>{if(s){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[s]);let _=()=>{l(!0)},M=()=>{l(!1),u(!1)};return a?n!=="intent"?[o,v,{}]:[o,v,{onFocus:zl(d,_),onBlur:zl(f,M),onMouseEnter:zl(g,_),onMouseLeave:zl(x,M),onTouchStart:zl(b,_)}]:[!1,v,{}]}function zl(n,t){return a=>{n&&n(a),a.defaultPrevented||t(a)}}function dw({page:n,...t}){let a=w_(),{nonce:s}=zc(),{router:l}=ch(),o=w.useMemo(()=>cy(l.routes,n,l.basename),[l.routes,n,l.basename]);return o?(t.nonce==null&&s&&(t={...t,nonce:s}),a?w.createElement(hw,{page:n,matches:o,...t}):w.createElement(mw,{page:n,matches:o,...t})):null}function fw(n){let{manifest:t,routeModules:a}=zc(),[s,l]=w.useState([]);return w.useEffect(()=>{let o=!1;return iw(n,t,a).then(u=>{o||l(u)}),()=>{o=!0}},[n,t,a]),s}function hw({page:n,matches:t,...a}){let s=nn(),{future:l}=zc(),{basename:o}=ch(),u=w.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let d=Ty(n,o,l.v8_trailingSlashAwareDataRequests,"rsc"),f=!1,g=[];for(let x of t)typeof x.route.shouldRevalidate=="function"?f=!0:g.push(x.route.id);return f&&g.length>0&&d.searchParams.set("_routes",g.join(",")),[d.pathname+d.search]},[o,l.v8_trailingSlashAwareDataRequests,n,s,t]);return w.createElement(w.Fragment,null,u.map(d=>w.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...a})))}function mw({page:n,matches:t,...a}){let s=nn(),{future:l,manifest:o,routeModules:u}=zc(),{basename:d}=ch(),{loaderData:f,matches:g}=cw(),x=w.useMemo(()=>tx(n,t,g,o,s,"data"),[n,t,g,o,s]),b=w.useMemo(()=>tx(n,t,g,o,s,"assets"),[n,t,g,o,s]),v=w.useMemo(()=>{if(n===s.pathname+s.search+s.hash)return[];let j=new Set,S=!1;if(t.forEach(C=>{var E;let k=o.routes[C.route.id];!k||!k.hasLoader||(!x.some(A=>A.route.id===C.route.id)&&C.route.id in f&&((E=u[C.route.id])!=null&&E.shouldRevalidate)||k.hasClientLoader?S=!0:j.add(C.route.id))}),j.size===0)return[];let N=Ty(n,d,l.v8_trailingSlashAwareDataRequests,"data");return S&&j.size>0&&N.searchParams.set("_routes",t.filter(C=>j.has(C.route.id)).map(C=>C.route.id).join(",")),[N.pathname+N.search]},[d,l.v8_trailingSlashAwareDataRequests,f,s,o,x,t,n,u]),_=w.useMemo(()=>sw(b,o),[b,o]),M=fw(b);return w.createElement(w.Fragment,null,v.map(j=>w.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...a})),_.map(j=>w.createElement("link",{key:j,rel:"modulepreload",href:j,...a})),M.map(({key:j,link:S})=>w.createElement("link",{key:j,nonce:a.nonce,...S,crossOrigin:S.crossOrigin??a.crossOrigin})))}function gw(...n){return t=>{n.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var pw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{pw&&(window.__reactRouterVersion="7.18.3")}catch{}function xw({basename:n,children:t,useTransitions:a,window:s}){let l=w.useRef();l.current==null&&(l.current=QS({window:s,v5Compat:!0}));let o=l.current,[u,d]=w.useState({action:o.action,location:o.location}),f=w.useCallback(g=>{a===!1?d(g):w.startTransition(()=>d(g))},[a]);return w.useLayoutEffect(()=>o.listen(f),[o,f]),w.createElement(X_,{basename:n,children:t,location:u.location,navigationType:u.action,navigator:o,useTransitions:a})}var dh=w.forwardRef(function({onClick:t,discover:a="render",prefetch:s="none",relative:l,reloadDocument:o,replace:u,mask:d,state:f,target:g,to:x,preventScrollReset:b,viewTransition:v,defaultShouldRevalidate:_,...M},j){let{basename:S,navigator:N,useTransitions:C}=w.useContext(tn),k=typeof x=="string"&&th.test(x),E=py(x,S);x=E.to;let A=E_(x,{relative:l}),z=nn(),L=null;if(d){let he=Cc(d,[],z.mask?z.mask.pathname:"/",!0);S!=="/"&&(he.pathname=he.pathname==="/"?S:Nn([S,he.pathname])),L=N.createHref(he)}let[R,X,de]=uw(s,M),Q=Sw(x,{replace:u,mask:d,state:f,target:g,preventScrollReset:b,relative:l,viewTransition:v,defaultShouldRevalidate:_,useTransitions:C});function ae(he){t&&t(he),he.defaultPrevented||Q(he)}let Ee=!(E.isExternal||o),Oe=w.createElement("a",{...M,...de,href:(Ee?L:void 0)||E.absoluteURL||A,onClick:Ee?ae:t,ref:gw(j,X),target:g,"data-discover":!k&&a==="render"?"true":void 0});return R&&!k?w.createElement(w.Fragment,null,Oe,w.createElement(dw,{page:A})):Oe});dh.displayName="Link";var bw=w.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:s="",end:l=!1,style:o,to:u,viewTransition:d,children:f,...g},x){let b=sr(u,{relative:g.relative}),v=nn(),_=w.useContext(Ec),{navigator:M,basename:j}=w.useContext(tn),S=_!=null&&Tw(b)&&d===!0,N=M.encodeLocation?M.encodeLocation(b).pathname:b.pathname,C=v.pathname,k=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;a||(C=C.toLowerCase(),k=k?k.toLowerCase():null,N=N.toLowerCase()),k&&j&&(k=da(k,j)||k);const E=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let A=C===N||!l&&C.startsWith(N)&&C.charAt(E)==="/",z=k!=null&&(k===N||!l&&k.startsWith(N)&&k.charAt(N.length)==="/"),L={isActive:A,isPending:z,isTransitioning:S},R=A?t:void 0,X;typeof s=="function"?X=s(L):X=[s,A?"active":null,z?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let de=typeof o=="function"?o(L):o;return w.createElement(dh,{...g,"aria-current":R,className:X,ref:x,style:de,to:u,viewTransition:d},typeof f=="function"?f(L):f)});bw.displayName="NavLink";var yw=w.forwardRef(({discover:n="render",fetcherKey:t,navigate:a,reloadDocument:s,replace:l,state:o,method:u=Wo,action:d,onSubmit:f,relative:g,preventScrollReset:x,viewTransition:b,defaultShouldRevalidate:v,..._},M)=>{let{useTransitions:j}=w.useContext(tn),S=Nw(),N=Mw(d,{relative:g}),C=u.toLowerCase()==="get"?"get":"post",k=typeof d=="string"&&th.test(d),E=A=>{if(f&&f(A),A.defaultPrevented)return;A.preventDefault();let z=A.nativeEvent.submitter,L=(z==null?void 0:z.getAttribute("formmethod"))||u,R=()=>S(z||A.currentTarget,{fetcherKey:t,method:L,navigate:a,replace:l,state:o,relative:g,preventScrollReset:x,viewTransition:b,defaultShouldRevalidate:v});j&&a!==!1?w.startTransition(()=>R()):R()};return w.createElement("form",{ref:M,method:C,action:N,onSubmit:s?f:E,..._,"data-discover":!k&&n==="render"?"true":void 0})});yw.displayName="Form";function vw(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ky(n){let t=w.useContext(Ds);return tt(t,vw(n)),t}function Sw(n,{target:t,replace:a,mask:s,state:l,preventScrollReset:o,relative:u,viewTransition:d,defaultShouldRevalidate:f,useTransitions:g}={}){let x=Ac(),b=nn(),v=sr(n,{relative:u});return w.useCallback(_=>{if(P_(_,t)){_.preventDefault();let M=a!==void 0?a:Ni(b)===Ni(v),j=()=>x(n,{replace:M,mask:s,state:l,preventScrollReset:o,relative:u,viewTransition:d,defaultShouldRevalidate:f});g?w.startTransition(()=>j()):j()}},[b,x,v,a,s,l,t,n,o,u,d,f,g])}function _w(n){xn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=w.useRef(Af(n)),a=w.useRef(!1),s=nn(),l=w.useMemo(()=>W_(s.search,a.current?null:t.current),[s.search]),o=Ac(),u=w.useCallback((d,f)=>{const g=Af(typeof d=="function"?d(new URLSearchParams(l)):d);a.current=!0,o("?"+g,f)},[o,l]);return[l,u]}var ww=0,jw=()=>`__${String(++ww)}__`;function Nw(){let{router:n}=ky("useSubmit"),{basename:t}=w.useContext(tn),a=V_(),s=n.fetch,l=n.navigate;return w.useCallback(async(o,u={})=>{let{action:d,method:f,encType:g,formData:x,body:b}=tw(o,t);if(u.navigate===!1){let v=u.fetcherKey||jw();await s(v,a,u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:x,body:b,formMethod:u.method||f,formEncType:u.encType||g,flushSync:u.flushSync})}else await l(u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:x,body:b,formMethod:u.method||f,formEncType:u.encType||g,replace:u.replace,state:u.state,fromRouteId:a,flushSync:u.flushSync,viewTransition:u.viewTransition})},[s,l,t,a])}function Mw(n,{relative:t}={}){let{basename:a}=w.useContext(tn),s=w.useContext(Bn);tt(s,"useFormAction must be used inside a RouteContext");let[l]=s.matches.slice(-1),o={...sr(n||".",{relative:t})},u=nn();if(n==null){o.search=u.search;let d=new URLSearchParams(o.search),f=d.getAll("index");if(f.some(x=>x==="")){d.delete("index"),f.filter(b=>b).forEach(b=>d.append("index",b));let x=d.toString();o.search=x?`?${x}`:""}}return(!n||n===".")&&l.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(o.pathname=o.pathname==="/"?a:Nn([a,o.pathname])),Ni(o)}function Tw(n,{relative:t}={}){let a=w.useContext(yy);tt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=ky("useViewTransitionState"),l=sr(n,{relative:t});if(!a.isTransitioning)return!1;let o=da(a.currentLocation.pathname,s)||a.currentLocation.pathname,u=da(a.nextLocation.pathname,s)||a.nextLocation.pathname;return ic(l.pathname,u)!=null||ic(l.pathname,o)!=null}/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kw=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Cw=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,s)=>s?s.toUpperCase():a.toLowerCase()),nx=n=>{const t=Cw(n);return t.charAt(0).toUpperCase()+t.slice(1)},Cy=(...n)=>n.filter((t,a,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===a).join(" ").trim(),Ew=n=>{for(const t in n)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Aw={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Dw=w.forwardRef(({color:n="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:l="",children:o,iconNode:u,...d},f)=>w.createElement("svg",{ref:f,...Aw,width:t,height:t,stroke:n,strokeWidth:s?Number(a)*24/Number(t):a,className:Cy("lucide",l),...!o&&!Ew(d)&&{"aria-hidden":"true"},...d},[...u.map(([g,x])=>w.createElement(g,x)),...Array.isArray(o)?o:[o]]));/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ce=(n,t)=>{const a=w.forwardRef(({className:s,...l},o)=>w.createElement(Dw,{ref:o,iconNode:t,className:Cy(`lucide-${kw(nx(n))}`,`lucide-${n}`,s),...l}));return a.displayName=nx(n),a};/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zw=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],Rw=ce("arrow-left-right",zw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ow=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ey=ce("arrow-left",Ow);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Lw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ax=ce("arrow-right",Lw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hw=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Bw=ce("bell",Hw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Uw=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]],$w=ce("bell-ring",Uw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vw=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Xa=ce("calendar",Vw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Yw=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],sc=ce("chart-column",Yw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Gw=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ay=ce("check",Gw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qw=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Wl=ce("chevron-down",qw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Xw=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],_i=ce("chevron-left",Xw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Iw=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],lc=ce("chevron-right",Iw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Fw=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Qw=ce("chevron-up",Fw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Zw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ix=ce("circle-alert",Zw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Kw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Pw=ce("circle-check",Kw);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ww=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Jw=ce("circle-question-mark",Ww);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const e5=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],fh=ce("clock",e5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const t5=[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M16 17H7",key:"pygtm1"}],["path",{d:"M17 21H9",key:"1u2q02"}]],Df=ce("cloud-fog",t5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const n5=[["path",{d:"M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973",key:"1cez44"}],["path",{d:"m13 12-3 5h4l-3 5",key:"1t22er"}]],gf=ce("cloud-lightning",n5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const a5=[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M16 14v6",key:"1j4efv"}],["path",{d:"M8 14v6",key:"17c4r9"}],["path",{d:"M12 16v6",key:"c8a4gj"}]],wn=ce("cloud-rain",a5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const i5=[["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"M8 15h.01",key:"a7atzg"}],["path",{d:"M8 19h.01",key:"puxtts"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M12 21h.01",key:"h35vbk"}],["path",{d:"M16 15h.01",key:"rnfrdf"}],["path",{d:"M16 19h.01",key:"1vcnzz"}]],ps=ce("cloud-snow",i5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const s5=[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}],["path",{d:"M15.947 12.65a4 4 0 0 0-5.925-4.128",key:"dpwdj0"}],["path",{d:"M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z",key:"s09mg5"}]],Dy=ce("cloud-sun",s5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const l5=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],zf=ce("cloud",l5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const r5=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Rc=ce("database",r5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const o5=[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]],c5=ce("droplet",o5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const u5=[["path",{d:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z",key:"1ptgy4"}],["path",{d:"M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97",key:"1sl1rz"}]],lr=ce("droplets",u5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const d5=[["path",{d:"M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z",key:"484a7f"}],["path",{d:"M12 12v.01",key:"u5ubse"}]],f5=ce("fan",d5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const h5=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],zy=ce("flame",h5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const m5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],g5=ce("info",m5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const p5=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],Ry=ce("leaf",p5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const x5=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],b5=ce("lightbulb",x5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const y5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],hh=ce("loader-circle",y5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const v5=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Rf=ce("log-out",v5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const S5=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Oy=ce("map-pin",S5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _5=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],w5=ce("maximize-2",_5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const j5=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],N5=ce("message-square",j5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const M5=[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]],Ly=ce("monitor-cog",M5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const T5=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],k5=ce("monitor",T5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const C5=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],E5=ce("moon",C5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const A5=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Hy=ce("pencil",A5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const D5=[["path",{d:"M13 2a9 9 0 0 1 9 9",key:"1itnx2"}],["path",{d:"M13 6a5 5 0 0 1 5 5",key:"11nki7"}],["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],sx=ce("phone-call",D5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const z5=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],R5=ce("phone",z5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const O5=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],mh=ce("plug",O5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const L5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],rc=ce("plus",L5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const H5=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],B5=ce("power-off",H5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const U5=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],$5=ce("power",U5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const V5=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],oc=ce("refresh-cw",V5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Y5=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],G5=ce("rotate-ccw",Y5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const q5=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],By=ce("save",q5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const X5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],lx=ce("search",X5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const I5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],cc=ce("settings",I5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const F5=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Uy=ce("shield",F5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Q5=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],gh=ce("smartphone",Q5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Z5=[["path",{d:"M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3",key:"139s4v"}],["path",{d:"M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4",key:"1dlkgp"}],["path",{d:"M5 21h14",key:"11awu3"}]],$y=ce("sprout",Z5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const K5=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],en=ce("sun",K5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const P5=[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]],Ns=ce("thermometer",P5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const W5=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Vy=ce("toggle-left",W5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const J5=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],ph=ce("toggle-right",J5);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ej=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],xh=ce("trash-2",ej);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tj=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],nj=ce("trending-up",tj);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aj=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Rs=ce("triangle-alert",aj);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ij=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Of=ce("user",ij);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sj=[["path",{d:"M12.8 19.6A2 2 0 1 0 14 16H2",key:"148xed"}],["path",{d:"M17.5 8a2.5 2.5 0 1 1 2 4H2",key:"1u4tom"}],["path",{d:"M9.8 4.4A2 2 0 1 1 11 8H2",key:"75valh"}]],Oc=ce("wind",sj);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ci=ce("x",lj);/**
* @license lucide-react v0.553.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rj=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Lc=ce("zap",rj);function oj(){const[n,t]=w.useState(!1),[a,s]=w.useState(!1);w.useEffect(()=>{if(typeof window>"u"||!("serviceWorker"in navigator))return;let o=null;const u=x=>{x.data&&x.data.type==="SW_UPDATED"&&window.location.reload()},d=()=>{document.hidden||navigator.serviceWorker.getRegistration().then(x=>x==null?void 0:x.update())},f=()=>{navigator.serviceWorker.getRegistration().then(x=>x==null?void 0:x.update())},g=async()=>{try{const x=await navigator.serviceWorker.register("/sw.js",{scope:"/"});x.addEventListener("updatefound",()=>{const b=x.installing;b&&b.addEventListener("statechange",()=>{b.state==="installed"&&navigator.serviceWorker.controller&&t(!0)})}),navigator.serviceWorker.addEventListener("message",u),o=setInterval(()=>x.update(),6e4),document.addEventListener("visibilitychange",d),window.addEventListener("focus",f)}catch(x){console.error("Service Worker registration failed:",x)}};return document.readyState==="complete"?g():window.addEventListener("load",g,{once:!0}),()=>{o&&clearInterval(o),navigator.serviceWorker.removeEventListener("message",u),document.removeEventListener("visibilitychange",d),window.removeEventListener("focus",f)}},[]);const l=()=>{s(!0),"serviceWorker"in navigator&&navigator.serviceWorker.controller&&navigator.serviceWorker.controller.postMessage({type:"SKIP_WAITING"}),setTimeout(()=>{window.location.reload()},500)};return n?h.jsx("div",{className:"fixed bottom-4 left-4 right-4 md:left-auto md:right-4 md:w-96 z-50 animate-in slide-in-from-bottom-5",children:h.jsxs("div",{className:"bg-white rounded-lg shadow-md border border-indigo-500 p-4 flex items-center gap-3",children:[h.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-indigo-100 rounded-full flex items-center justify-center",children:h.jsx(oc,{className:"w-5 h-5 text-indigo-600"})}),h.jsxs("div",{className:"flex-1",children:[h.jsx("p",{className:"font-semibold text-gray-900 text-sm",children:"نسخه جدید آماده است"}),h.jsx("p",{className:"text-xs text-gray-600 mt-0.5",children:"برای دریافت آخرین تغییرات، اپ را به‌روزرسانی کنید"})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:l,disabled:a,className:"px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white text-sm font-medium rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:a?h.jsxs(h.Fragment,{children:[h.jsx(oc,{className:"w-4 h-4 animate-spin"}),"در حال به‌روزرسانی..."]}):"به‌روزرسانی"}),h.jsx("button",{onClick:()=>t(!1),className:"p-2 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"بستن",children:h.jsx(Ci,{className:"w-4 h-4 text-gray-500"})})]})]})}):null}function Yy(n){var t,a,s="";if(typeof n=="string"||typeof n=="number")s+=n;else if(typeof n=="object")if(Array.isArray(n)){var l=n.length;for(t=0;t<l;t++)n[t]&&(a=Yy(n[t]))&&(s&&(s+=" "),s+=a)}else for(a in n)n[a]&&(s&&(s+=" "),s+=a);return s}function cj(){for(var n,t,a=0,s="",l=arguments.length;a<l;a++)(n=arguments[a])&&(t=Yy(n))&&(s&&(s+=" "),s+=t);return s}const uj=(n,t)=>{const a=new Array(n.length+t.length);for(let s=0;s<n.length;s++)a[s]=n[s];for(let s=0;s<t.length;s++)a[n.length+s]=t[s];return a},dj=(n,t)=>({classGroupId:n,validator:t}),Gy=(n=new Map,t=null,a)=>({nextPart:n,validators:t,classGroupId:a}),uc="-",rx=[],fj="arbitrary..",hj=n=>{const t=gj(n),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=n;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return mj(u);const d=u.split(uc),f=d[0]===""&&d.length>1?1:0;return qy(d,f,t)},getConflictingClassGroupIds:(u,d)=>{if(d){const f=s[u],g=a[u];return f?g?uj(g,f):f:g||rx}return a[u]||rx}}},qy=(n,t,a)=>{if(n.length-t===0)return a.classGroupId;const l=n[t],o=a.nextPart.get(l);if(o){const g=qy(n,t+1,o);if(g)return g}const u=a.validators;if(u===null)return;const d=t===0?n.join(uc):n.slice(t).join(uc),f=u.length;for(let g=0;g<f;g++){const x=u[g];if(x.validator(d))return x.classGroupId}},mj=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=n.slice(1,-1),a=t.indexOf(":"),s=t.slice(0,a);return s?fj+s:void 0})(),gj=n=>{const{theme:t,classGroups:a}=n;return pj(a,t)},pj=(n,t)=>{const a=Gy();for(const s in n){const l=n[s];bh(l,a,s,t)}return a},bh=(n,t,a,s)=>{const l=n.length;for(let o=0;o<l;o++){const u=n[o];xj(u,t,a,s)}},xj=(n,t,a,s)=>{if(typeof n=="string"){bj(n,t,a);return}if(typeof n=="function"){yj(n,t,a,s);return}vj(n,t,a,s)},bj=(n,t,a)=>{const s=n===""?t:Xy(t,n);s.classGroupId=a},yj=(n,t,a,s)=>{if(Sj(n)){bh(n(s),t,a,s);return}t.validators===null&&(t.validators=[]),t.validators.push(dj(a,n))},vj=(n,t,a,s)=>{const l=Object.entries(n),o=l.length;for(let u=0;u<o;u++){const[d,f]=l[u];bh(f,Xy(t,d),a,s)}},Xy=(n,t)=>{let a=n;const s=t.split(uc),l=s.length;for(let o=0;o<l;o++){const u=s[o];let d=a.nextPart.get(u);d||(d=Gy(),a.nextPart.set(u,d)),a=d}return a},Sj=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,_j=n=>{if(n<1)return{get:()=>{},set:()=>{}};let t=0,a=Object.create(null),s=Object.create(null);const l=(o,u)=>{a[o]=u,t++,t>n&&(t=0,s=a,a=Object.create(null))};return{get(o){let u=a[o];if(u!==void 0)return u;if((u=s[o])!==void 0)return l(o,u),u},set(o,u){o in a?a[o]=u:l(o,u)}}},Lf="!",ox=":",wj=[],cx=(n,t,a,s,l)=>({modifiers:n,hasImportantModifier:t,baseClassName:a,maybePostfixModifierPosition:s,isExternal:l}),jj=n=>{const{prefix:t,experimentalParseClassName:a}=n;let s=l=>{const o=[];let u=0,d=0,f=0,g;const x=l.length;for(let j=0;j<x;j++){const S=l[j];if(u===0&&d===0){if(S===ox){o.push(l.slice(f,j)),f=j+1;continue}if(S==="/"){g=j;continue}}S==="["?u++:S==="]"?u--:S==="("?d++:S===")"&&d--}const b=o.length===0?l:l.slice(f);let v=b,_=!1;b.endsWith(Lf)?(v=b.slice(0,-1),_=!0):b.startsWith(Lf)&&(v=b.slice(1),_=!0);const M=g&&g>f?g-f:void 0;return cx(o,_,v,M)};if(t){const l=t+ox,o=s;s=u=>u.startsWith(l)?o(u.slice(l.length)):cx(wj,!1,u,void 0,!0)}if(a){const l=s;s=o=>a({className:o,parseClassName:l})}return s},Nj=n=>{const t=new Map;return n.orderSensitiveModifiers.forEach((a,s)=>{t.set(a,1e6+s)}),a=>{const s=[];let l=[];for(let o=0;o<a.length;o++){const u=a[o],d=u[0]==="[",f=t.has(u);d||f?(l.length>0&&(l.sort(),s.push(...l),l=[]),s.push(u)):l.push(u)}return l.length>0&&(l.sort(),s.push(...l)),s}},Mj=n=>({cache:_j(n.cacheSize),parseClassName:jj(n),sortModifiers:Nj(n),postfixLookupClassGroupIds:Tj(n),...hj(n)}),Tj=n=>{const t=Object.create(null),a=n.postfixLookupClassGroups;if(a)for(let s=0;s<a.length;s++)t[a[s]]=!0;return t},kj=/\s+/,Cj=(n,t)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:l,sortModifiers:o,postfixLookupClassGroupIds:u}=t,d=[],f=n.trim().split(kj);let g="";for(let x=f.length-1;x>=0;x-=1){const b=f[x],{isExternal:v,modifiers:_,hasImportantModifier:M,baseClassName:j,maybePostfixModifierPosition:S}=a(b);if(v){g=b+(g.length>0?" "+g:g);continue}let N=!!S,C;if(N){const L=j.substring(0,S);C=s(L);const R=C&&u[C]?s(j):void 0;R&&R!==C&&(C=R,N=!1)}else C=s(j);if(!C){if(!N){g=b+(g.length>0?" "+g:g);continue}if(C=s(j),!C){g=b+(g.length>0?" "+g:g);continue}N=!1}const k=_.length===0?"":_.length===1?_[0]:o(_).join(":"),E=M?k+Lf:k,A=E+C;if(d.indexOf(A)>-1)continue;d.push(A);const z=l(C,N);for(let L=0;L<z.length;++L){const R=z[L];d.push(E+R)}g=b+(g.length>0?" "+g:g)}return g},Ej=(...n)=>{let t=0,a,s,l="";for(;t<n.length;)(a=n[t++])&&(s=Iy(a))&&(l&&(l+=" "),l+=s);return l},Iy=n=>{if(typeof n=="string")return n;let t,a="";for(let s=0;s<n.length;s++)n[s]&&(t=Iy(n[s]))&&(a&&(a+=" "),a+=t);return a},Aj=(n,...t)=>{let a,s,l,o;const u=f=>{const g=t.reduce((x,b)=>b(x),n());return a=Mj(g),s=a.cache.get,l=a.cache.set,o=d,d(f)},d=f=>{const g=s(f);if(g)return g;const x=Cj(f,a);return l(f,x),x};return o=u,(...f)=>o(Ej(...f))},Dj=[],gt=n=>{const t=a=>a[n]||Dj;return t.isThemeGetter=!0,t},Fy=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qy=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Rj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Oj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Lj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Hj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Bj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ha=n=>zj.test(n),Ne=n=>!!n&&!Number.isNaN(Number(n)),zn=n=>!!n&&Number.isInteger(Number(n)),pf=n=>n.endsWith("%")&&Ne(n.slice(0,-1)),ia=n=>Rj.test(n),Zy=()=>!0,Uj=n=>Oj.test(n)&&!Lj.test(n),yh=()=>!1,$j=n=>Hj.test(n),Vj=n=>Bj.test(n),Yj=n=>!ie(n)&&!se(n),Gj=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),qj=n=>Qa(n,Wy,yh),ie=n=>Fy.test(n),hi=n=>Qa(n,Jy,Uj),ux=n=>Qa(n,Wj,Ne),Xj=n=>Qa(n,tv,Zy),Ij=n=>Qa(n,ev,yh),dx=n=>Qa(n,Ky,yh),Fj=n=>Qa(n,Py,Vj),Co=n=>Qa(n,nv,$j),se=n=>Qy.test(n),Rl=n=>Ei(n,Jy),Qj=n=>Ei(n,ev),fx=n=>Ei(n,Ky),Zj=n=>Ei(n,Wy),Kj=n=>Ei(n,Py),Eo=n=>Ei(n,nv,!0),Pj=n=>Ei(n,tv,!0),Qa=(n,t,a)=>{const s=Fy.exec(n);return s?s[1]?t(s[1]):a(s[2]):!1},Ei=(n,t,a=!1)=>{const s=Qy.exec(n);return s?s[1]?t(s[1]):a:!1},Ky=n=>n==="position"||n==="percentage",Py=n=>n==="image"||n==="url",Wy=n=>n==="length"||n==="size"||n==="bg-size",Jy=n=>n==="length",Wj=n=>n==="number",ev=n=>n==="family-name",tv=n=>n==="number"||n==="weight",nv=n=>n==="shadow",Jj=()=>{const n=gt("color"),t=gt("font"),a=gt("text"),s=gt("font-weight"),l=gt("tracking"),o=gt("leading"),u=gt("breakpoint"),d=gt("container"),f=gt("spacing"),g=gt("radius"),x=gt("shadow"),b=gt("inset-shadow"),v=gt("text-shadow"),_=gt("drop-shadow"),M=gt("blur"),j=gt("perspective"),S=gt("aspect"),N=gt("ease"),C=gt("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...E(),se,ie],z=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],R=()=>[se,ie,f],X=()=>[Ha,"full","auto",...R()],de=()=>[zn,"none","subgrid",se,ie],Q=()=>["auto",{span:["full",zn,se,ie]},zn,se,ie],ae=()=>[zn,"auto",se,ie],Ee=()=>["auto","min","max","fr",se,ie],Oe=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],he=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...R()],K=()=>[Ha,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],fe=()=>[Ha,"screen","full","dvw","lvw","svw","min","max","fit",...R()],we=()=>[Ha,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],P=()=>[n,se,ie],O=()=>[...E(),fx,dx,{position:[se,ie]}],I=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",Zj,qj,{size:[se,ie]}],ee=()=>[pf,Rl,hi],ne=()=>["","none","full",g,se,ie],le=()=>["",Ne,Rl,hi],ge=()=>["solid","dashed","dotted","double"],rt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[Ne,pf,fx,dx],kn=()=>["","none",M,se,ie],re=()=>["none",Ne,se,ie],xe=()=>["none",Ne,se,ie],Ae=()=>[Ne,se,ie],je=()=>[Ha,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ia],breakpoint:[ia],color:[Zy],container:[ia],"drop-shadow":[ia],ease:["in","out","in-out"],font:[Yj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ia],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ia],shadow:[ia],spacing:["px",Ne],text:[ia],"text-shadow":[ia],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ha,ie,se,S]}],container:["container"],"container-type":[{"@container":["","normal","size",se,ie]}],"container-named":[Gj],columns:[{columns:[Ne,ie,se,d]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:X()}],"inset-x":[{"inset-x":X()}],"inset-y":[{"inset-y":X()}],start:[{"inset-s":X(),start:X()}],end:[{"inset-e":X(),end:X()}],"inset-bs":[{"inset-bs":X()}],"inset-be":[{"inset-be":X()}],top:[{top:X()}],right:[{right:X()}],bottom:[{bottom:X()}],left:[{left:X()}],visibility:["visible","invisible","collapse"],z:[{z:[zn,"auto",se,ie]}],basis:[{basis:[Ha,"full","auto",d,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ne,Ha,"auto","initial","none",ie]}],grow:[{grow:["",Ne,se,ie]}],shrink:[{shrink:["",Ne,se,ie]}],order:[{order:[zn,"first","last","none",se,ie]}],"grid-cols":[{"grid-cols":de()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":de()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ee()}],"auto-rows":[{"auto-rows":Ee()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...Oe(),"normal"]}],"justify-items":[{"justify-items":[...he(),"normal"]}],"justify-self":[{"justify-self":["auto",...he()]}],"align-content":[{content:["normal",...Oe()]}],"align-items":[{items:[...he(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...he(),{baseline:["","last"]}]}],"place-content":[{"place-content":Oe()}],"place-items":[{"place-items":[...he(),"baseline"]}],"place-self":[{"place-self":["auto",...he()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mbs:[{mbs:U()}],mbe:[{mbe:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...fe()]}],"min-inline-size":[{"min-inline":["auto",...fe()]}],"max-inline-size":[{"max-inline":["none",...fe()]}],"block-size":[{block:["auto",...we()]}],"min-block-size":[{"min-block":["auto",...we()]}],"max-block-size":[{"max-block":["none",...we()]}],w:[{w:[d,"screen",...K()]}],"min-w":[{"min-w":[d,"screen","none",...K()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",a,Rl,hi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Pj,Xj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",pf,ie]}],"font-family":[{font:[Qj,Ij,t]}],"font-features":[{"font-features":[ie]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,se,ie]}],"line-clamp":[{"line-clamp":[Ne,"none",se,ux]}],leading:[{leading:[o,...R()]}],"list-image":[{"list-image":["none",se,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",se,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ne,"from-font","auto",se,hi]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Ne,"auto",se,ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[zn,se,ie]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se,ie]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},zn,se,ie],radial:["",se,ie],conic:[zn,se,ie]},Kj,Fj]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:le()}],"border-w-x":[{"border-x":le()}],"border-w-y":[{"border-y":le()}],"border-w-s":[{"border-s":le()}],"border-w-e":[{"border-e":le()}],"border-w-bs":[{"border-bs":le()}],"border-w-be":[{"border-be":le()}],"border-w-t":[{"border-t":le()}],"border-w-r":[{"border-r":le()}],"border-w-b":[{"border-b":le()}],"border-w-l":[{"border-l":le()}],"divide-x":[{"divide-x":le()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":le()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ne,se,ie]}],"outline-w":[{outline:["",Ne,Rl,hi]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",x,Eo,Co]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",b,Eo,Co]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Ne,hi]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":le()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",v,Eo,Co]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Ne,se,ie]}],"mix-blend":[{"mix-blend":[...rt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":rt()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[se,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[Ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,ie]}],filter:[{filter:["","none",se,ie]}],blur:[{blur:kn()}],brightness:[{brightness:[Ne,se,ie]}],contrast:[{contrast:[Ne,se,ie]}],"drop-shadow":[{"drop-shadow":["","none",_,Eo,Co]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Ne,se,ie]}],"hue-rotate":[{"hue-rotate":[Ne,se,ie]}],invert:[{invert:["",Ne,se,ie]}],saturate:[{saturate:[Ne,se,ie]}],sepia:[{sepia:["",Ne,se,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",se,ie]}],"backdrop-blur":[{"backdrop-blur":kn()}],"backdrop-brightness":[{"backdrop-brightness":[Ne,se,ie]}],"backdrop-contrast":[{"backdrop-contrast":[Ne,se,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ne,se,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ne,se,ie]}],"backdrop-invert":[{"backdrop-invert":["",Ne,se,ie]}],"backdrop-opacity":[{"backdrop-opacity":[Ne,se,ie]}],"backdrop-saturate":[{"backdrop-saturate":[Ne,se,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",Ne,se,ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",se,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ne,"initial",se,ie]}],ease:[{ease:["linear","initial",N,se,ie]}],delay:[{delay:[Ne,se,ie]}],animate:[{animate:["none",C,se,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,se,ie]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:Ae()}],"skew-x":[{"skew-x":Ae()}],"skew-y":[{"skew-y":Ae()}],transform:[{transform:[se,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:je()}],"translate-x":[{"translate-x":je()}],"translate-y":[{"translate-y":je()}],"translate-z":[{"translate-z":je()}],"translate-none":["translate-none"],zoom:[{zoom:[zn,se,ie]}],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se,ie]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se,ie]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Ne,Rl,hi,ux]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},eN=Aj(Jj);function te(...n){return eN(cj(n))}const hx="selectedDeviceId",mx="selectedDeviceName",av=w.createContext({deviceId:0,deviceName:"",setDevice:()=>{}});function tN({children:n}){const[t,a]=w.useState(0),[s,l]=w.useState("");w.useEffect(()=>{const u=localStorage.getItem(hx),d=localStorage.getItem(mx);u&&(a(Number(u)),l(d||""))},[]);const o=w.useCallback((u,d)=>{a(u),l(d),localStorage.setItem(hx,String(u)),localStorage.setItem(mx,d)},[]);return h.jsx(av.Provider,{value:{deviceId:t,deviceName:s,setDevice:o},children:n})}function Os(){return w.useContext(av)}function nN({pageTitle:n,pageIcon:t,pageInfo:a,iconGradient:s="from-indigo-500 to-purple-600",className:l}){const{deviceName:o}=Os();return h.jsx("header",{className:te("sticky top-0 z-40 bg-white border-b border-gray-200",l),children:h.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-2 flex items-center justify-between gap-3",children:[h.jsx("div",{className:"text-xs text-gray-500 font-medium truncate min-w-0 flex-1",children:o||"دستگاه"}),h.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-shrink-0",children:[h.jsx("div",{className:te("inline-flex items-center justify-center w-7 h-7 rounded-md",s),children:h.jsx(t,{className:"w-4 h-4 text-white"})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-sm md:text-base font-bold text-gray-900 whitespace-nowrap",children:n}),a&&h.jsx("span",{className:"text-[11px] text-gray-500 hidden sm:inline",children:a})]})]}),h.jsx("div",{className:"flex-1"})]})})}function Un(){const n=Ac();return w.useMemo(()=>({push:t=>n(t),replace:t=>n(t,{replace:!0})}),[n])}function rr(){const[n]=_w();return n}function iv(){return nn().pathname}function Hf({href:n,...t}){return h.jsx(dh,{to:n,...t})}const gx=[{label:"پروفایل",icon:Of,route:"/profile",matchPatterns:["/profile"]},{label:"دستگاه",icon:Ly,route:"/device",matchPatterns:["/device"]},{label:"گزارش",icon:sc,route:"/daily-report",matchPatterns:["/daily-report","/calendar","/day-details"]},{label:"آب و هوا",icon:Dy,route:"/weather",matchPatterns:["/weather"]}];function aN(){const n=iv(),t=Un(),{deviceId:a}=Os(),l=(()=>{const u=gx.findIndex(d=>d.matchPatterns.some(f=>n.startsWith(f)));return u>=0?u:2})(),o=u=>{const d=a?`?deviceId=${a}`:"";t.push(`${u.route}${d}`)};return h.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-50 bg-white border-t border-gray-200",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:h.jsx("div",{className:"max-w-7xl mx-auto flex items-center justify-around h-14",children:gx.map((u,d)=>{const f=d===l,g=u.icon;return h.jsxs("button",{onClick:()=>o(u),className:te("flex flex-col items-center justify-center gap-0.5 flex-1 h-full transition-all duration-150","min-w-0 min-h-0 py-1",f?"text-green-600":"text-gray-400 hover:text-gray-500"),children:[h.jsx("div",{className:te("rounded-md p-1.5 transition-colors duration-150",f&&"bg-green-50"),children:h.jsx(g,{className:te("w-5 h-5 transition-transform duration-150",f&&"scale-110")})}),h.jsx("span",{className:te("text-[10px] font-medium leading-tight transition-colors duration-150",f?"text-green-600":"text-gray-400"),children:u.label})]},u.route)})})})}function Mi({children:n,pageTitle:t,pageIcon:a,pageInfo:s,iconGradient:l,hideBottomNav:o=!1}){return h.jsxs("div",{className:"min-h-screen flex flex-col bg-gradient-to-b from-gray-50 to-white",children:[h.jsx(nN,{pageTitle:t,pageIcon:a,pageInfo:s,iconGradient:l}),h.jsx("main",{className:"flex-1 px-4 py-4 md:px-6 md:py-6 max-w-7xl mx-auto w-full",children:n}),!o&&h.jsx(aN,{}),!o&&h.jsx("div",{className:"h-20",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"}})]})}function ht({message:n="در حال بارگذاری...",fullScreen:t=!0}){const a=t?"min-h-screen flex items-center justify-center p-4":"flex items-center justify-center p-8";return h.jsx("div",{className:a,children:h.jsxs("div",{className:"text-center",children:[h.jsxs("div",{className:"relative inline-block",children:[h.jsx(hh,{className:"w-12 h-12 text-green-600 animate-spin mx-auto mb-4"}),h.jsx("div",{className:"absolute inset-0 w-12 h-12 border-4 border-green-200 border-t-green-600 rounded-full animate-spin mx-auto opacity-50"})]}),h.jsx("p",{className:"text-gray-600 font-medium",children:n})]})})}const iN=["/","/login","/verify-code"];function sN(){return typeof window>"u"?!1:!!(localStorage.getItem("authToken")&&localStorage.getItem("user"))}function px(n){return iN.some(t=>n===t||n.startsWith(`${t}/`))}function lN({children:n}){const t=iv(),a=Un(),[s,l]=w.useState(()=>px(t)),[o,u]=w.useState(!1);return w.useEffect(()=>{if(px(t)){u(!0),l(!0);return}if(!sN()){u(!1),l(!0),a.replace("/login");return}u(!0),l(!0)},[t,a]),s?o?h.jsx(h.Fragment,{children:n}):h.jsx(ht,{message:"در حال انتقال به صفحه ورود..."}):h.jsx(ht,{message:"در حال بررسی ورود..."})}function rN(){const n=Un();return w.useEffect(()=>{const t=localStorage.getItem("authToken"),a=localStorage.getItem("user"),s=localStorage.getItem("selectedDeviceId");t&&a?s?n.replace(`/daily-report?deviceId=${s}`):n.replace("/devices"):n.replace("/login")},[n]),h.jsx(ht,{message:"در حال انتقال..."})}const Ke="",oN=15e3,cN=2;function uN(){return typeof window>"u"?null:localStorage.getItem("authToken")}async function Ie(n,t,a=cN){const s=new AbortController,l=setTimeout(()=>s.abort(),oN),o=uN(),u={"Content-Type":"application/json",...t==null?void 0:t.headers};o&&(u.Authorization=`Bearer ${o}`);try{const d=await fetch(n,{...t,headers:u,signal:s.signal});if(!d.ok){let g=`HTTP ${d.status}`;try{const b=await d.json();b.message&&(g=b.message)}catch{}const x=new Error(g);throw x.status=d.status,x}const f=await d.text();return f?JSON.parse(f):void 0}catch(d){const f=((t==null?void 0:t.method)??"GET").toUpperCase(),g=d instanceof DOMException&&d.name==="AbortError",x=d.status,b=x!==void 0&&x>=400&&x<500;if(f==="GET"&&!g&&!b&&a>0)return Ie(n,t,a-1);throw d}finally{clearTimeout(l)}}const We={CheckDevice:(n,t)=>Ie(`${Ke}/api/devices/CheckDevice?deviceName=${n}&password=${t}`),listDevices:()=>Ie(`${Ke}/api/devices`),createDevice:n=>Ie(`${Ke}/api/devices`,{method:"POST",body:JSON.stringify(n)}),listTelemetry:n=>{const t=new URLSearchParams;return n.deviceId&&t.set("deviceId",String(n.deviceId)),n.startUtc&&t.set("startUtc",n.startUtc),n.endUtc&&t.set("endUtc",n.endUtc),n.sinceUtc&&t.set("sinceUtc",n.sinceUtc),n.page&&t.set("page",String(n.page)),n.pageSize&&t.set("pageSize",String(n.pageSize)),Ie(`${Ke}/api/telemetry?${t.toString()}`)},createTelemetry:n=>Ie(`${Ke}/api/telemetry`,{method:"POST",body:JSON.stringify(n)}),minmax:(n,t,a)=>{const s=new URLSearchParams({deviceId:String(n)});return t&&s.set("startUtc",t),a&&s.set("endUtc",a),Ie(`${Ke}/api/telemetry/minmax?${s.toString()}`)},monthDays:(n,t,a)=>Ie(`${Ke}/api/telemetry/days?deviceId=${n}&year=${t}&month=${a}`),activeMonths:(n,t)=>Ie(`${Ke}/api/telemetry/months?deviceId=${n}&year=${t}`),getDeviceSettings:n=>Ie(`${Ke}/api/devicesettings/${n}`),createDeviceSettings:n=>Ie(`${Ke}/api/devicesettings`,{method:"POST",body:JSON.stringify(n)}),updateDeviceSettings:n=>Ie(`${Ke}/api/devicesettings`,{method:"PUT",body:JSON.stringify(n)}),sendCode:n=>Ie(`${Ke}/api/auth/send-code`,{method:"POST",body:JSON.stringify(n)}),verifyCode:n=>Ie(`${Ke}/api/auth/verify-code`,{method:"POST",body:JSON.stringify(n)}),canResend:n=>Ie(`${Ke}/api/auth/can-resend?mobile=${encodeURIComponent(n)}`),me:()=>Ie(`${Ke}/api/auth/me`),getUserDevices:n=>Ie(`${Ke}/api/devices/user/${n}`),getDevicesFiltered:n=>{const t=new URLSearchParams({userId:String(n.userId)});return n.search&&t.set("search",n.search),n.page&&t.set("page",String(n.page)),n.pageSize&&t.set("pageSize",String(n.pageSize)),Ie(`${Ke}/api/devices/filtered?${t.toString()}`)},getDailyReport:(n,t)=>Ie(`${Ke}/api/DailyReport?deviceId=${n}&persianDate=${encodeURIComponent(t)}`),getDisplayParameters:n=>Ie(`${Ke}/api/display-parameters?deviceId=${n}`),getAlertConditions:n=>Ie(`${Ke}/api/alertconditions/device/${n}`),getAlertCondition:n=>Ie(`${Ke}/api/alertconditions/${n}`),createAlertCondition:n=>Ie(`${Ke}/api/alertconditions`,{method:"POST",body:JSON.stringify(n)}),updateAlertCondition:n=>Ie(`${Ke}/api/alertconditions`,{method:"PUT",body:JSON.stringify(n)}),deleteAlertCondition:n=>Ie(`${Ke}/api/alertconditions/${n}`,{method:"DELETE"}),getPowerOutageSummary:(n,t,a)=>{const s=new URLSearchParams({deviceId:String(n)});return t&&s.set("startUtc",t),a&&s.set("endUtc",a),Ie(`${Ke}/api/PowerOutage/summary?${s.toString()}`)}};function dN({value:n,onValueChange:t,className:a,...s}){const l=w.useRef(null),o=w.useCallback(u=>{const f=u.currentTarget.value.replace(/\D/g,"");t(f)},[t]);return w.useEffect(()=>{const u=()=>{setTimeout(()=>{if(l.current){const d=l.current.value;d&&d!==n&&o({currentTarget:{value:d}})}},100)};return u(),window.addEventListener("load",u),()=>{window.removeEventListener("load",u)}},[n,o]),h.jsx("input",{ref:l,type:"tel",inputMode:"numeric",className:te("w-full px-4 py-3 rounded-lg border border-gray-200 bg-gray-50 focus:border-green-500 focus:bg-white focus:outline-none focus:ring-2 focus:ring-green-500/20 transition-all duration-150 text-left",a),placeholder:"09123456789",value:n,onInput:o,maxLength:11,...s})}function fN({length:n=4,value:t,onChange:a,onComplete:s,disabled:l=!1,className:o}){const u=w.useRef([]),d=(x,b)=>{var _;if(!/^\d*$/.test(b))return;const v=[...t];v[x]=b.slice(-1),a(v),b&&x<n-1&&((_=u.current[x+1])==null||_.focus()),v.every(M=>M!=="")&&v.join("").length===n&&(s==null||s(v.join("")))},f=(x,b)=>{var v;b.key==="Backspace"&&!t[x]&&x>0&&((v=u.current[x-1])==null||v.focus())},g=x=>{var v;x.preventDefault();const b=x.clipboardData.getData("text").replace(/\D/g,"").slice(0,n);if(b.length===n){const _=b.split("");a(_),(v=u.current[n-1])==null||v.focus(),s==null||s(b)}};return h.jsx("div",{className:te("flex justify-center gap-3",o),style:{direction:"ltr"},children:Array.from({length:n},(x,b)=>h.jsx("input",{ref:v=>{u.current[b]=v},type:"text",inputMode:"numeric",maxLength:1,value:t[b]||"",onChange:v=>d(b,v.target.value),onKeyDown:v=>f(b,v),onPaste:b===0?g:void 0,className:"w-14 h-14 text-center text-2xl font-bold rounded-lg border border-gray-200 bg-gray-50 focus:border-green-500 focus:bg-white focus:outline-none focus:ring-2 focus:ring-green-500/20 transition-all duration-150",disabled:l},b))})}const hN={default:"bg-white border border-gray-300 hover:border-gray-400 hover:bg-gray-50 text-gray-700",primary:"bg-indigo-600 hover:bg-indigo-700 text-white shadow-sm",secondary:"bg-white border border-orange-300 hover:border-orange-400 hover:bg-orange-50 text-orange-700",outline:"border border-gray-300 hover:bg-gray-50 text-gray-700",ghost:"hover:bg-gray-100 text-gray-700",success:"bg-gradient-to-r from-green-500 to-green-600 hover:from-green-600 hover:to-green-700 text-white shadow-sm",danger:"bg-red-600 hover:bg-red-700 text-white shadow-sm",warning:"bg-gradient-to-r from-orange-500 to-red-600 hover:from-orange-600 hover:to-red-700 text-white shadow-sm",info:"bg-blue-600 hover:bg-blue-700 text-white shadow-sm"},mN={sm:{padding:"px-2 py-1.5",text:"text-xs",icon:"w-3 h-3"},md:{padding:"px-2 sm:px-4 py-2.5",text:"text-xs sm:text-sm",icon:"w-4 h-4 sm:w-5 sm:h-5"},lg:{padding:"px-4 sm:px-6 py-3",text:"text-sm sm:text-base",icon:"w-5 h-5 sm:w-6 sm:h-6"}};function pt({variant:n="default",size:t="md",icon:a,iconPosition:s="left",responsiveText:l,tooltip:o,loading:u=!1,fullWidth:d=!1,children:f,className:g,disabled:x,...b}){const v=mN[t],_=hN[n],M=te("inline-flex items-center justify-center gap-1 sm:gap-2","rounded-lg transition-all duration-150 font-medium","whitespace-nowrap","active:scale-[0.98]","touch-manipulation","select-none","disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",v.padding,v.text,_,d&&"w-full",g),j=te(v.icon,"flex-shrink-0"),S=h.jsxs(h.Fragment,{children:[u?h.jsx(hh,{className:te(j,"animate-spin")}):a&&s==="left"&&h.jsx(a,{className:j}),l?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"hidden sm:inline",children:l.desktop}),h.jsx("span",{className:"sm:hidden",children:l.mobile})]}):h.jsx("span",{children:f}),!u&&a&&s==="right"&&h.jsx(a,{className:j})]});return o?h.jsxs("button",{className:te(M,"group relative"),title:o,disabled:x||u,...b,children:[S,h.jsx("span",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 opacity-0 group-hover:opacity-100 transition-opacity text-[10px] text-gray-500 whitespace-nowrap pointer-events-none hidden sm:block",children:o})]}):h.jsx("button",{className:M,disabled:x||u,...b,children:S})}function gN({value:n,onValueChange:t,onSubmit:a,onClear:s,placeholder:l="جستجو...",showClearButton:o=!0,showSearchButton:u=!0,className:d,...f}){const g=b=>{b.preventDefault(),a==null||a(n)},x=()=>{t(""),s==null||s()};return h.jsxs("form",{onSubmit:g,className:te("flex gap-2",d),children:[h.jsxs("div",{className:"flex-1 relative",children:[h.jsx(lx,{className:"absolute right-4 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),h.jsx("input",{type:"text",value:n,onChange:b=>t(b.target.value),placeholder:l,className:"w-full pr-12 pl-4 py-3 rounded-lg border border-gray-200 bg-gray-50 focus:border-green-500 focus:bg-white focus:outline-none focus:ring-2 focus:ring-green-500/20 transition-all duration-150",...f}),o&&n&&h.jsx("button",{type:"button",onClick:x,className:"absolute left-4 top-1/2 transform -translate-y-1/2 p-1 text-gray-400 hover:text-gray-600 rounded",children:h.jsx(Ci,{className:"w-4 h-4"})})]}),u&&h.jsx(pt,{type:"submit",variant:"primary",icon:lx,children:"جستجو"})]})}function pN({label:n,error:t,className:a,id:s,...l}){const o=w.useId(),u=s||`checkbox-${o}`,d=`${u}-error`;return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"checkbox",id:u,"aria-invalid":t?!0:void 0,"aria-describedby":t?d:void 0,className:te("w-4 h-4 text-green-600 border-gray-300 rounded focus:ring-green-500",a),...l}),n&&h.jsx("label",{htmlFor:u,className:"text-sm font-medium text-gray-700",children:n}),t&&h.jsx("p",{id:d,className:"text-sm text-red-600",children:t})]})}const xN={sm:"max-w-md",md:"max-w-2xl",lg:"max-w-4xl",xl:"max-w-6xl",full:"max-w-full"};function vh({isOpen:n,onClose:t,title:a,children:s,size:l="md",className:o,contentClassName:u,showCloseButton:d=!0}){return w.useEffect(()=>{if(!n)return;const f=x=>{x.key==="Escape"&&t()};document.addEventListener("keydown",f);const g=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",f),document.body.style.overflow=g}},[n,t]),n?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",role:"dialog","aria-modal":"true",children:[h.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t,"aria-hidden":"true"}),h.jsxs("div",{className:te("relative bg-white rounded-lg shadow-lg w-full max-h-[90vh] overflow-y-auto",xN[l],o),children:[a&&h.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 sticky top-0 bg-white z-10",children:[h.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:a}),d&&h.jsx("button",{onClick:t,"aria-label":"بستن",className:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-md transition-colors",children:h.jsx(Ci,{className:"w-5 h-5"})})]}),h.jsx("div",{className:te(u??"p-6"),children:s})]})]}):null}function bN({isOpen:n,onClose:t,title:a,children:s}){return h.jsx(vh,{isOpen:n,onClose:t,title:a,size:"md",contentClassName:"p-6",children:s})}function yN({tabs:n,activeTab:t,className:a,setActiveTab:s}){return h.jsx("div",{className:`bg-gray-100 rounded-lg p-1 flex ${a}`,children:n.map(l=>h.jsx("button",{onClick:()=>s(l.value),className:`flex-1 px-2 py-2.5 text-xs font-medium rounded-md transition-all duration-150 ${t===l.value?"bg-white text-indigo-600 shadow-sm":"text-gray-600 hover:text-gray-900"}`,children:l.label},l.value))})}function vN({tabs:n,activeTab:t,setActiveTab:a,children:s,className:l}){return h.jsxs("div",{className:`bg-white rounded-lg border border-gray-200 overflow-hidden ${l||""}`,children:[h.jsxs("div",{className:"p-3 md:p-6 md:pb-0",children:[h.jsx(yN,{tabs:n,activeTab:t,setActiveTab:a,className:"md:hidden"}),h.jsx("div",{className:"hidden md:flex border-b border-gray-200 -mx-6 -mt-6 mb-6",children:n.map(o=>h.jsx("button",{onClick:()=>a(o.value),className:`flex-1 px-6 py-4 text-sm font-medium transition-all duration-150 whitespace-nowrap ${t===o.value?"text-indigo-600 border-b-2 border-indigo-600":"text-gray-500 hover:text-gray-800"}`,children:o.label},o.value))})]}),s[t]!==null&&s[t]!==void 0&&h.jsx("div",{className:"p-4 md:p-6 md:pt-0",children:s[t]})]})}function Ls({message:n,onClose:t,className:a,fullPage:s=!1,action:l}){return s?h.jsx("div",{className:te("min-h-screen flex items-center justify-center p-4",a),children:h.jsx("div",{className:"w-full max-w-md",children:h.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-8 text-center",children:[h.jsx("div",{className:"text-red-600 mb-4",children:h.jsx(ix,{className:"w-16 h-16 mx-auto"})}),h.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"خطا"}),h.jsx("p",{className:"text-gray-600 mb-6",children:n}),l]})})}):h.jsxs("div",{className:te("p-4 bg-red-50 border border-red-200 rounded-lg",a),children:[h.jsxs("div",{className:"flex items-center gap-2 text-red-700 mb-3",children:[h.jsx(ix,{className:"w-5 h-5 flex-shrink-0"}),h.jsx("span",{className:"flex-1",children:n}),t&&h.jsx("button",{onClick:t,className:"flex-shrink-0 p-1 hover:bg-red-100 rounded-md transition-colors",children:h.jsx(Ci,{className:"w-4 h-4"})})]}),l&&h.jsx("div",{className:"mt-3",children:l})]})}function sv({message:n,onClose:t,className:a}){return h.jsxs("div",{className:te("p-4 bg-green-50 border border-green-200 rounded-lg text-green-700 flex items-center gap-2",a),children:[h.jsx(Pw,{className:"w-5 h-5 flex-shrink-0"}),h.jsx("span",{className:"flex-1",children:n}),t&&h.jsx("button",{onClick:t,className:"flex-shrink-0 p-1 hover:bg-green-100 rounded-md transition-colors",children:h.jsx(Ci,{className:"w-4 h-4"})})]})}function or({icon:n,title:t,message:a,action:s,className:l}){return h.jsxs("div",{className:te("bg-white rounded-lg border border-gray-200 p-8 md:p-12 text-center",l),children:[n&&h.jsx("div",{className:"text-gray-300 mb-4",children:h.jsx(n,{className:"w-14 h-14 mx-auto"})}),t&&h.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-2",children:t}),h.jsx("p",{className:"text-sm text-gray-500 mb-6",children:a}),s&&h.jsx("div",{className:"flex justify-center",children:s})]})}function dc({children:n,className:t,hover:a=!1,padding:s="md"}){const l={sm:"p-4",md:"p-6",lg:"p-8",none:"p-0"};return h.jsx("div",{className:te("bg-white rounded-lg border border-gray-200",l[s],a&&"hover:border-gray-300 hover:shadow-sm transition-all duration-200",t),children:n})}const SN={default:"bg-gray-100 text-gray-800",success:"bg-green-100 text-green-800",warning:"bg-orange-100 text-orange-800",error:"bg-red-100 text-red-800",info:"bg-blue-100 text-blue-800"},_N={sm:"text-xs px-2 py-1",md:"text-sm px-3 py-1.5"};function Bf({children:n,variant:t="default",icon:a,className:s,size:l="md"}){return h.jsxs("span",{className:te("inline-flex items-center gap-1 rounded-full font-medium",SN[t],_N[l],s),children:[a&&h.jsx(a,{className:l==="sm"?"w-3 h-3":"w-4 h-4"}),n]})}const wN={default:"text-gray-600 hover:bg-gray-100",primary:"text-blue-600 hover:bg-blue-50",danger:"text-red-600 hover:bg-red-50",ghost:"text-gray-400 hover:text-gray-600 hover:bg-gray-100"},jN={sm:"p-1.5",md:"p-2",lg:"p-2.5"},NN={sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"};function xx({icon:n,variant:t="default",size:a="md",className:s,...l}){return h.jsx("button",{className:te("rounded-md transition-colors",wN[t],jN[a],s),...l,children:h.jsx(n,{className:NN[a]})})}function MN(){const[n,t]=w.useState(""),[a,s]=w.useState(!1),[l,o]=w.useState(null),u=Un(),d=x=>{const b=x.replace(/\D/g,"");return b.startsWith("9")&&b.length===10?"0"+b:b.startsWith("0098")&&b.length===13?"0"+b.substring(3):b.startsWith("98")&&b.length===12?"0"+b.substring(2):b},f=async x=>{x.preventDefault(),o(null);const b=d(n);if(!b||b.length!==11||!b.startsWith("09")){o("لطفاً شماره موبایل معتبر وارد کنید (مثال: 09123456789)");return}s(!0);try{const v=await We.sendCode({mobile:b});if(v.success){u.push(`/verify-code?mobile=${encodeURIComponent(b)}`);return}else o(v.message||"خطا در ارسال کد")}catch(v){console.error("Error sending code:",v),o(v instanceof Error?v.message:"خطا در ارتباط با سرور")}finally{s(!1)}},g=n.length>=10;return a?h.jsx(ht,{message:"در حال ارسال کد..."}):h.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:h.jsx("div",{className:"w-full max-w-md",children:h.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8 border border-gray-100",children:[h.jsxs("div",{className:"text-center mb-8",children:[h.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-gradient-to-br from-green-500 to-green-600 rounded-2xl shadow-lg mb-4",children:h.jsx(gh,{className:"w-8 h-8 text-white"})}),h.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"ورود با شماره موبایل"}),h.jsx("p",{className:"text-sm text-gray-600",children:"شماره موبایل خود را وارد کنید تا کد فعال‌سازی برای شما ارسال شود"})]}),h.jsxs("form",{onSubmit:f,className:"space-y-5",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"شماره موبایل"}),h.jsx(dN,{value:n,onValueChange:x=>{t(x),o(null)},disabled:a})]}),l&&h.jsx(Ls,{message:l}),h.jsx(pt,{type:"submit",variant:"success",size:"lg",fullWidth:!0,loading:a,disabled:!g,icon:Ey,children:"ارسال کد فعال‌سازی"})]})]})})})}function TN({canResend:n,cooldown:t,onResend:a,loading:s=!1,className:l}){const o=u=>{const d=Math.floor(u/60),f=u%60;return`${d}:${String(f).padStart(2,"0")}`};return h.jsxs("button",{type:"button",onClick:a,disabled:!n||s,className:te("w-full flex items-center justify-center gap-2 py-2.5 rounded-lg font-medium transition-all duration-150",n&&!s?"bg-blue-500 hover:bg-blue-600 text-white":"bg-gray-100 text-gray-400 cursor-not-allowed",l),children:[h.jsx(G5,{className:"w-4 h-4"}),n?"ارسال مجدد کد":`ارسال مجدد (${o(t)})`]})}async function kN(n){return new Promise(t=>{const a=window.confirm(n.message);t(a)})}function CN(){const n=rr(),t=Un(),{setDevice:a}=Os(),s=n.get("mobile")||"",[l,o]=w.useState(["","","",""]),[u,d]=w.useState(!1),[f,g]=w.useState(null),[x,b]=w.useState(120),[v,_]=w.useState(!1),M=w.useCallback(async()=>{try{(await We.canResend(s)).canResend?(_(!0),b(0)):(_(!1),b(120))}catch(C){console.error("Error checking resend status:",C)}},[s]);w.useEffect(()=>{if(!s||s.length!==11){t.push("/login");return}M();const C=setInterval(()=>{b(k=>k<=1?(_(!0),0):k-1)},1e3);return()=>clearInterval(C)},[s,t,M]);const j=async C=>{const k=C||l.join("");if(k.length!==4){g("لطفاً کد ۴ رقمی را کامل وارد کنید");return}d(!0),g(null);try{const E=await We.verifyCode({mobile:s,code:k});if(E.success&&E.token&&E.user){localStorage.setItem("authToken",E.token),localStorage.setItem("user",JSON.stringify(E.user));try{const A=await We.getDevicesFiltered({userId:E.user.id,page:1,pageSize:10});if(A.totalCount===0){g("شما هیچ دستگاهی ندارید. لطفاً با پشتیبانی تماس بگیرید."),localStorage.removeItem("authToken"),localStorage.removeItem("user");return}else if(A.totalCount===1){const z=A.items[0];a(z.id,z.deviceName),localStorage.setItem("selectedDeviceId",String(z.id)),localStorage.setItem("selectedDeviceName",z.deviceName),t.push(`/daily-report?deviceId=${z.id}`);return}else{t.push("/devices");return}}catch(A){console.error("Error fetching devices:",A),t.push("/devices");return}}else g(E.message||"کد وارد شده نادرست است"),o(["","","",""])}catch(E){console.error("Error verifying code:",E),g(E instanceof Error?E.message:"خطا در ارتباط با سرور"),o(["","","",""])}finally{d(!1)}},S=async()=>{if(v){d(!0),g(null),_(!1),b(120);try{const C=await We.sendCode({mobile:s});C.success?(b(C.resendAfterSeconds||120),o(["","","",""])):(g(C.message||"خطا در ارسال مجدد کد"),_(!0))}catch(C){console.error("Error resending code:",C),g(C instanceof Error?C.message:"خطا در ارتباط با سرور"),_(!0)}finally{d(!1)}}},N=C=>(C.length===11,C);return!s||s.length!==11?h.jsx(ht,{message:"در حال انتقال..."}):u&&l.join("").length!==4?h.jsx(ht,{message:"در حال بررسی کد..."}):h.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:h.jsxs("div",{className:"w-full max-w-md",children:[h.jsxs("div",{className:"bg-white rounded-2xl shadow-xl p-8 border border-gray-100",children:[h.jsxs("div",{className:"text-center mb-8",children:[h.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-gradient-to-br from-green-500 to-green-600 rounded-2xl shadow-lg mb-4",children:h.jsx(Uy,{className:"w-8 h-8 text-white"})}),h.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"تایید کد فعال‌سازی"}),h.jsx("p",{className:"text-sm text-gray-600 mb-1",children:"کد ارسال شده به شماره"}),h.jsx("p",{className:"text-sm font-semibold text-gray-900",style:{direction:"ltr"},children:N(s)}),h.jsx("p",{className:"text-sm text-gray-600 mt-2",children:"را وارد کنید"})]}),h.jsxs("form",{onSubmit:C=>{C.preventDefault(),j()},className:"space-y-5",children:[h.jsx(fN,{value:l,onChange:o,onComplete:j,disabled:u}),f&&h.jsx(Ls,{message:f}),h.jsx(pt,{type:"submit",variant:"success",size:"lg",fullWidth:!0,loading:u,disabled:l.join("").length!==4,icon:Ey,children:"تایید و ورود"}),h.jsxs("div",{className:"pt-4 border-t border-gray-200 space-y-3",children:[h.jsx(TN,{canResend:v,cooldown:x,onResend:S,loading:u}),h.jsxs(Hf,{href:"/login",className:"block w-full text-center text-sm text-gray-600 hover:text-gray-900 transition-colors py-2",children:[h.jsx(ax,{className:"w-4 h-4 inline ml-1"}),"تغییر شماره موبایل"]})]})]})]}),h.jsx("div",{className:"mt-6 text-center",children:h.jsxs(Hf,{href:"/",className:"inline-flex items-center gap-2 text-sm text-gray-600 hover:text-gray-900 transition-colors",children:[h.jsx(ax,{className:"w-4 h-4"}),"بازگشت به صفحه اصلی"]})})]})})}function EN(){return h.jsx(w.Suspense,{fallback:h.jsx(ht,{message:"در حال بارگذاری..."}),children:h.jsx(CN,{})})}var xf,bx;function AN(){if(bx)return xf;bx=1,xf={toJalaali:t,toGregorian:a,isValidJalaaliDate:s,isLeapJalaaliYear:l,jalaaliMonthLength:o,jalCal:d,j2d:f,d2j:g,g2d:x,d2g:b,jalaaliToDateObject:_,jalaaliWeek:v};var n=[-61,9,38,199,426,686,756,818,1111,1181,1210,1635,2060,2097,2192,2262,2324,2394,2456,3178];function t(S,N,C){return Object.prototype.toString.call(S)==="[object Date]"&&(C=S.getDate(),N=S.getMonth()+1,S=S.getFullYear()),g(x(S,N,C))}function a(S,N,C){return b(f(S,N,C))}function s(S,N,C){return S>=-61&&S<=3177&&N>=1&&N<=12&&C>=1&&C<=o(S,N)}function l(S){return u(S)===0}function o(S,N){return N<=6?31:N<=11||l(S)?30:29}function u(S){var N=n.length,C=n[0],k,E,A,z,L;if(S<C||S>=n[N-1])throw new Error("Invalid Jalaali year "+S);for(L=1;L<N&&(k=n[L],E=k-C,!(S<k));L+=1)C=k;return z=S-C,E-z<6&&(z=z-E+M(E+4,33)*33),A=j(j(z+1,33)-1,4),A===-1&&(A=4),A}function d(S,N){var C=n.length,k=S+621,E=-14,A=n[0],z,L,R,X,de,Q,ae;if(S<A||S>=n[C-1])throw new Error("Invalid Jalaali year "+S);for(ae=1;ae<C&&(z=n[ae],L=z-A,!(S<z));ae+=1)E=E+M(L,33)*8+M(j(L,33),4),A=z;return Q=S-A,E=E+M(Q,33)*8+M(j(Q,33)+3,4),j(L,33)===4&&L-Q===4&&(E+=1),X=M(k,4)-M((M(k,100)+1)*3,4)-150,de=20+E-X,N?{gy:k,march:de}:(L-Q<6&&(Q=Q-L+M(L+4,33)*33),R=j(j(Q+1,33)-1,4),R===-1&&(R=4),{leap:R,gy:k,march:de})}function f(S,N,C){var k=d(S,!0);return x(k.gy,3,k.march)+(N-1)*31-M(N,7)*(N-7)+C-1}function g(S){var N=b(S).gy,C=N-621,k=d(C,!1),E=x(N,3,k.march),A,z,L;if(L=S-E,L>=0){if(L<=185)return z=1+M(L,31),A=j(L,31)+1,{jy:C,jm:z,jd:A};L-=186}else C-=1,L+=179,k.leap===1&&(L+=1);return z=7+M(L,30),A=j(L,30)+1,{jy:C,jm:z,jd:A}}function x(S,N,C){var k=M((S+M(N-8,6)+100100)*1461,4)+M(153*j(N+9,12)+2,5)+C-34840408;return k=k-M(M(S+100100+M(N-8,6),100)*3,4)+752,k}function b(S){var N,C,k,E,A;return N=4*S+139361631,N=N+M(M(4*S+183187720,146097)*3,4)*4-3908,C=M(j(N,1461),4)*5+308,k=M(j(C,153),5)+1,E=j(M(C,153),12)+1,A=M(N,1461)-100100+M(8-E,6),{gy:A,gm:E,gd:k}}function v(S,N,C){var k=_(S,N,C).getDay(),E=k==6?0:-(k+1),A=6+E;return{saturday:g(f(S,N,C+E)),friday:g(f(S,N,C+A))}}function _(S,N,C,k,E,A,z){var L=a(S,N,C);return new Date(L.gy,L.gm-1,L.gd,k||0,E||0,A||0,z||0)}function M(S,N){return~~(S/N)}function j(S,N){return S-~~(S/N)*N}return xf}var Hc=AN();function Sh(n){const{jy:t,jm:a,jd:s}=Hc.toJalaali(n.getFullYear(),n.getMonth()+1,n.getDate());return{year:t,month:a,day:s}}function Hs(n,t,a){const{gy:s,gm:l,gd:o}=Hc.toGregorian(n,t,a);return new Date(s,l-1,o)}function _h(){return Sh(new Date)}function Ga(){return _h().year}function Ss(){return _h().month}function wh(){return _h().day}function lv(n,t){return Hc.jalaaliMonthLength(n,t)}function rv(n,t){const{gy:a,gm:s,gd:l}=Hc.toGregorian(n,t,1);return(new Date(a,s-1,l).getDay()+1)%7}function yi(n){try{const t=n.split("/");if(t.length!==3)return null;const a=parseInt(t[0]),s=parseInt(t[1]),l=parseInt(t[2]);return isNaN(a)||isNaN(s)||isNaN(l)?null:{year:a,month:s,day:l}}catch{return null}}function fc(n){return`${n.year}/${String(n.month).padStart(2,"0")}/${String(n.day).padStart(2,"0")}`}function DN(n){const t=yi(n);if(!t)return null;const a=Hs(t.year,t.month,t.day);a.setDate(a.getDate()-1);const s=Sh(a);return fc(s)}function zN(n){const t=yi(n);if(!t)return null;const a=Hs(t.year,t.month,t.day);a.setDate(a.getDate()+1);const s=Sh(a);return fc(s)}function RN({device:n,href:t,onClick:a,className:s}){return a?h.jsx("button",{type:"button",onClick:a,className:`group bg-white rounded-lg border border-gray-200 hover:border-green-300 transition-all duration-150 overflow-hidden p-5 relative cursor-pointer text-right w-full ${s||""}`,children:h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsx("div",{className:"flex-shrink-0 w-12 h-12 rounded-lg bg-green-600 flex items-center justify-center group-hover:scale-105 transition-transform duration-150",children:h.jsx(cc,{className:"w-6 h-6 text-white"})}),h.jsxs("div",{className:"flex-1",children:[h.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-1 group-hover:text-green-600 transition-colors",children:n.deviceName}),h.jsx("p",{className:"text-sm text-gray-500 mb-2",children:n.location||"بدون موقعیت"}),h.jsx("div",{className:"flex items-center gap-2 text-xs text-gray-400",children:h.jsxs("span",{children:[n.userName," ",n.userFamily]})})]}),h.jsx("div",{className:"flex-shrink-0",children:h.jsx(Xa,{className:"w-5 h-5 text-gray-400 group-hover:text-green-600 transition-colors"})})]})}):h.jsx(Hf,{href:t||"#",className:`group bg-white rounded-lg border border-gray-200 hover:border-green-300 transition-all duration-150 overflow-hidden p-5 relative ${s||""}`,children:h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsx("div",{className:"flex-shrink-0 w-12 h-12 rounded-lg bg-green-600 flex items-center justify-center group-hover:scale-105 transition-transform duration-150",children:h.jsx(cc,{className:"w-6 h-6 text-white"})}),h.jsxs("div",{className:"flex-1",children:[h.jsx("h3",{className:"text-base font-semibold text-gray-900 mb-1 group-hover:text-green-600 transition-colors",children:n.deviceName}),h.jsx("p",{className:"text-sm text-gray-500 mb-2",children:n.location||"بدون موقعیت"}),h.jsx("div",{className:"flex items-center gap-2 text-xs text-gray-400",children:h.jsxs("span",{children:[n.userName," ",n.userFamily]})})]}),h.jsx("div",{className:"flex-shrink-0",children:h.jsx(Xa,{className:"w-5 h-5 text-gray-400 group-hover:text-green-600 transition-colors"})})]})})}function ON({name:n,isActive:t,stats:a,onClick:s,className:l}){return h.jsxs("button",{onClick:s,disabled:!t,className:te("group relative rounded-lg border p-5 text-center transition-all duration-150",t?"bg-white border-green-200 hover:border-green-400":"bg-gray-50 border-gray-200 opacity-50 cursor-not-allowed",l),children:[h.jsx("div",{className:te("text-base font-semibold mb-2",t?"text-gray-900":"text-gray-400"),children:n}),t&&a?h.jsxs("div",{className:"space-y-1",children:[h.jsxs("div",{className:"inline-flex items-center gap-1 bg-green-600 text-white text-xs rounded-md px-3 py-1.5 font-medium",children:[h.jsx(Rc,{className:"w-3 h-3"}),a.days," روز"]}),h.jsxs("div",{className:"text-xs text-gray-500 mt-2",children:[a.records," رکورد"]})]}):h.jsx("div",{className:"text-xs text-gray-400",children:"بدون داده"})]})}function yx({day:n,hasData:t,recordCount:a=0,onClick:s,className:l}){return t?h.jsxs("button",{onClick:s,className:te("group min-h-[90px] md:min-h-[100px] bg-white border border-green-200 hover:border-green-400 transition-all duration-150 cursor-pointer rounded-lg p-2 md:p-3 flex flex-col items-center justify-center",l),children:[h.jsx("div",{className:"text-base md:text-lg font-semibold text-gray-900 mb-1.5",children:n}),h.jsxs("div",{className:"flex items-center gap-1 bg-green-600 text-white text-xs rounded-md px-2.5 py-1 font-medium",children:[h.jsx(Rc,{className:"w-3 h-3"}),a]})]}):h.jsx("div",{className:te("min-h-[90px] md:min-h-[100px] bg-gray-50 border border-gray-200 rounded-lg p-2 md:p-3 flex items-center justify-center text-gray-400",l),children:h.jsx("div",{className:"text-sm md:text-base",children:n})})}function J(n){const t=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"];return n.toString().replace(/\d/g,a=>t[parseInt(a)])}function Uf({icon:n,label:t,value:a,unit:s,className:l,iconColor:o="text-green-600"}){return h.jsxs("div",{className:te("flex items-center gap-2",l),children:[h.jsx(n,{className:te("w-5 h-5",o)}),h.jsxs("span",{className:"text-sm text-gray-700",children:[h.jsx("span",{className:"font-semibold text-green-700",children:J(a.toString())}),s&&` ${s}`," ",t]})]})}const LN=["شنبه","یکشنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنجشنبه","جمعه"],ov=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"],HN=["ش","ی","د","س","چ","پ","ج"];function BN(n){const t=yi(n);if(!t)return null;const a=Hs(t.year,t.month,t.day),s=LN[(a.getDay()+1)%7],l=ov[t.month-1];return{weekday:s,label:`${s} ${J(String(t.day))} ${l}`,year:t.year,month:t.month,day:t.day}}function UN({selectedDate:n,onPrevious:t,onNext:a,onCalendar:s,onSelectDate:l,isToday:o,className:u}){const[d,f]=w.useState(!1),[g,x]=w.useState(()=>{var z;return((z=yi(n))==null?void 0:z.year)??Ga()}),[b,v]=w.useState(()=>{var z;return((z=yi(n))==null?void 0:z.month)??Ss()}),_=w.useRef(null),M=w.useMemo(()=>BN(n),[n]),j=w.useMemo(()=>yi(n),[n]),S=w.useMemo(()=>({year:Ga(),month:Ss(),day:wh()}),[]),N=(z,L,R)=>z>S.year||z===S.year&&(L>S.month||L===S.month&&R>S.day),C=()=>{const z=yi(n)??{year:Ga(),month:Ss()};x(z.year),v(z.month),f(!0)},k=()=>{const z=fc({year:S.year,month:S.month,day:S.day});l(z),f(!1)},E=z=>{let L=b+z,R=g;L<1?(L=12,R-=1):L>12&&(L=1,R+=1),x(R),v(L)},A=w.useMemo(()=>{const z=rv(g,b),L=lv(g,b),R=[];for(let X=0;X<z;X++)R.push(null);for(let X=1;X<=L;X++)R.push(X);return R},[g,b]);return h.jsxs("div",{ref:_,className:`relative flex items-center justify-center gap-2 ${u||""}`,children:[h.jsxs("div",{className:"relative",children:[h.jsxs("div",{className:"inline-flex items-center gap-0.5 rounded-full border border-gray-200 bg-white p-1 shadow-sm dark:border-slate-700 dark:bg-slate-900",children:[h.jsx("button",{type:"button",onClick:t,"aria-label":"روز قبل",className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 dark:text-slate-400 dark:hover:bg-slate-800",children:h.jsx(lc,{className:"h-4 w-4"})}),h.jsxs("button",{type:"button",onClick:C,"aria-label":"انتخاب تاریخ",className:"flex items-center gap-1.5 rounded-full px-2 py-1.5 text-sm font-medium text-gray-800 transition-colors hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-slate-800",children:[h.jsx(Xa,{className:"h-4 w-4 text-indigo-500"}),h.jsx("span",{className:"whitespace-nowrap",children:(M==null?void 0:M.label)??"انتخاب تاریخ"}),h.jsx(Wl,{className:"h-3.5 w-3.5 text-gray-400"})]}),h.jsx("button",{type:"button",onClick:a,disabled:o,"aria-label":"روز بعد",className:"flex h-8 w-8 items-center justify-center rounded-full text-gray-500 transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-40 dark:text-slate-400 dark:hover:bg-slate-800",children:h.jsx(_i,{className:"h-4 w-4"})})]}),d&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>f(!1)}),h.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-72 rounded-xl border border-gray-200 bg-white p-3 shadow-lg dark:border-slate-700 dark:bg-slate-900",children:[h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[h.jsx("button",{type:"button",onClick:()=>E(-1),"aria-label":"ماه قبل",className:"flex h-7 w-7 items-center justify-center rounded-lg text-gray-500 hover:bg-gray-100 dark:text-slate-400 dark:hover:bg-slate-800",children:h.jsx(lc,{className:"h-4 w-4"})}),h.jsxs("span",{className:"text-sm font-semibold text-gray-800 dark:text-gray-100",children:[ov[b-1]," ",J(String(g))]}),h.jsx("button",{type:"button",onClick:()=>E(1),"aria-label":"ماه بعد",className:"flex h-7 w-7 items-center justify-center rounded-lg text-gray-500 hover:bg-gray-100 dark:text-slate-400 dark:hover:bg-slate-800",children:h.jsx(_i,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"mb-1 grid grid-cols-7 gap-1",children:HN.map(z=>h.jsx("span",{className:"py-1 text-center text-[10px] text-gray-400 dark:text-slate-500",children:z},z))}),h.jsx("div",{className:"grid grid-cols-7 gap-1",children:A.map((z,L)=>z===null?h.jsx("span",{},L):h.jsx("button",{type:"button",disabled:N(g,b,z),onClick:()=>{l(fc({year:g,month:b,day:z})),f(!1)},className:["flex h-8 items-center justify-center rounded-lg text-xs font-medium transition-colors",(j==null?void 0:j.year)===g&&(j==null?void 0:j.month)===b&&(j==null?void 0:j.day)===z?"bg-indigo-600 text-white":N(g,b,z)?"cursor-not-allowed text-gray-300 dark:text-slate-600":S.year===g&&S.month===b&&S.day===z?"text-indigo-600 ring-1 ring-indigo-400 hover:bg-indigo-50 dark:hover:bg-slate-800":"text-gray-700 hover:bg-gray-100 dark:text-gray-200 dark:hover:bg-slate-800"].join(" "),children:J(String(z))},L))}),h.jsxs("div",{className:"mt-2 flex items-center justify-between border-t border-gray-100 pt-2 dark:border-slate-800",children:[h.jsx("button",{type:"button",onClick:k,className:"text-xs font-medium text-indigo-600 hover:text-indigo-700",children:"امروز"}),h.jsx("button",{type:"button",onClick:()=>{f(!1),s()},className:"text-xs text-gray-500 hover:text-gray-700 dark:text-slate-400 dark:hover:text-slate-200",children:"تقویم کامل"})]})]})]})]}),!o&&h.jsx("button",{type:"button",onClick:k,className:"rounded-full border border-indigo-200 bg-indigo-50 px-3 py-1.5 text-xs font-medium text-indigo-600 transition-colors hover:bg-indigo-100 dark:border-indigo-500/30 dark:bg-indigo-500/10 dark:text-indigo-400 dark:hover:bg-indigo-500/20",children:"امروز"})]})}function $N({currentPage:n,totalPages:t,onPageChange:a,className:s,maxVisiblePages:l=5}){if(t<=1)return null;const u=t<=l?Array.from({length:t},(d,f)=>f+1):n<=3?Array.from({length:l},(d,f)=>f+1):n>=t-2?Array.from({length:l},(d,f)=>t-l+f+1):Array.from({length:l},(d,f)=>n-2+f);return h.jsxs("div",{className:te("flex items-center justify-center gap-2",s),children:[h.jsxs("button",{onClick:()=>a(Math.max(1,n-1)),disabled:n===1,className:te("px-4 py-2 rounded-lg transition-all duration-150 flex items-center gap-2",n===1?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-white border border-gray-200 hover:border-green-500 hover:text-green-600 text-gray-700"),children:[h.jsx(lc,{className:"w-4 h-4"}),"قبلی"]}),h.jsx("div",{className:"flex items-center gap-1",children:u.map(d=>h.jsx("button",{onClick:()=>a(d),className:te("w-10 h-10 rounded-lg transition-all duration-150",n===d?"bg-green-600 text-white":"bg-white border border-gray-200 hover:border-green-500 hover:text-green-600 text-gray-700"),children:d},d))}),h.jsxs("button",{onClick:()=>a(Math.min(t,n+1)),disabled:n===t,className:te("px-4 py-2 rounded-lg transition-all duration-150 flex items-center gap-2",n===t?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-white border border-gray-200 hover:border-green-500 hover:text-green-600 text-gray-700"),children:["بعدی",h.jsx(_i,{className:"w-4 h-4"})]})]})}function VN(){const n=Un(),{setDevice:t}=Os(),[a,s]=w.useState(null),[l,o]=w.useState(!0),[u,d]=w.useState(null),[f,g]=w.useState(null),[x,b]=w.useState(""),[v,_]=w.useState(1),[M,j]=w.useState(""),S=10,N=w.useCallback(L=>{t(L.id,L.deviceName);const R=`${Ga()}/${String(Ss()).padStart(2,"0")}/${String(wh()).padStart(2,"0")}`;n.push(`/daily-report?deviceId=${L.id}&date=${encodeURIComponent(R)}`)},[t,n]),C=w.useCallback(async(L,R)=>{if(f){o(!0),d(null);try{const X=await We.getDevicesFiltered({userId:f.id,search:R||void 0,page:L,pageSize:S});if(X.items.length===0&&L===1)d("شما هیچ دستگاهی ندارید. لطفاً با پشتیبانی تماس بگیرید.");else if(X.items.length===1&&X.totalCount===1&&!R){N(X.items[0]);return}else s(X)}catch(X){console.error("Error fetching devices:",X),d("خطا در دریافت لیست دستگاه‌ها")}finally{o(!1)}}},[f,n,N]);w.useEffect(()=>{const L=localStorage.getItem("authToken"),R=localStorage.getItem("user");if(!L||!R){n.push("/");return}try{const X=JSON.parse(R);g(X)}catch{n.push("/")}},[n]),w.useEffect(()=>{f&&C(v,x||void 0)},[f,v,x,C]);const k=L=>{const R=L??M;b(R),j(R),_(1)},E=()=>{localStorage.removeItem("authToken"),localStorage.removeItem("user"),n.push("/")},A=a?Math.ceil(a.totalCount/S):0,z=a&&a.totalCount>S;return l&&!a?h.jsx(ht,{message:"در حال بارگذاری..."}):u&&(!a||a.items.length===0)?h.jsx(Ls,{message:u,fullPage:!0,action:h.jsx(pt,{variant:"outline",fullWidth:!0,onClick:E,icon:Rf,children:"خروج"})}):h.jsx("div",{className:"min-h-screen p-4 md:p-8",children:h.jsxs("div",{className:"max-w-6xl mx-auto",children:[h.jsx("div",{className:"mb-6",children:h.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 bg-gradient-to-br from-green-500 to-green-600 rounded-xl shadow-md",children:h.jsx(cc,{className:"w-6 h-6 text-white"})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-gray-900",children:"انتخاب دستگاه"}),f&&h.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[f.name," ",f.family," (",f.mobile,")"]})]})]}),h.jsx("div",{className:"flex-shrink-0",children:h.jsx(pt,{variant:"outline",size:"sm",onClick:E,icon:Rf,children:"خروج"})})]})}),h.jsxs("div",{className:"mb-6",children:[h.jsx(gN,{value:M,onValueChange:j,onSubmit:k,placeholder:"جستجو در نام دستگاه، نام صاحب، نام خانوادگی صاحب، موقعیت..."}),x&&h.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[h.jsxs("span",{className:"text-sm text-gray-600",children:["نتایج جستجو برای: ",h.jsx("span",{className:"font-semibold",children:x})]}),h.jsx(pt,{variant:"ghost",size:"sm",className:"text-green-600 hover:text-green-700",onClick:()=>{j(""),b(""),_(1)},children:"پاک کردن"})]})]}),a&&h.jsxs("div",{className:"mb-4 text-sm text-gray-600",children:["نمایش ",a.items.length," از ",a.totalCount," دستگاه"]}),a&&a.items.length>0?h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:a.items.map(L=>h.jsx(RN,{device:L,onClick:()=>N(L)},L.id))}),z&&h.jsx($N,{currentPage:v,totalPages:A,onPageChange:_,className:"mt-6"})]}):!l&&h.jsx(or,{message:"هیچ دستگاهی یافت نشد"})]})})}const YN="modulepreload",GN=function(n){return"/"+n},vx={},jh=function(t,a,s){let l=Promise.resolve();if(a&&a.length>0){let u=function(g){return Promise.all(g.map(x=>Promise.resolve(x).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));l=u(a.map(g=>{if(g=GN(g),g in vx)return;vx[g]=!0;const x=g.endsWith(".css"),b=x?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${b}`))return;const v=document.createElement("link");if(v.rel=x?"stylesheet":YN,x||(v.as="script"),v.crossOrigin="",v.href=g,f&&v.setAttribute("nonce",f),document.head.appendChild(v),x)return new Promise((_,M)=>{v.addEventListener("load",_),v.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${g}`)))})}))}function o(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return l.then(u=>{for(const d of u||[])d.status==="rejected"&&o(d.reason);return t().catch(o)})};function cv(n,t,a){const s=t.toString().padStart(2,"0"),l=a.toString().padStart(2,"0");return`${n}/${s}/${l}`}function qN(n){const t=n.split("/");if(t.length!==3)return n;const[a,s,l]=t.map(Number);return cv(a,s,l)}function XN(n){const t=new Date(n);if(isNaN(t.getTime()))return"";const a=t.getHours().toString().padStart(2,"0"),s=t.getMinutes().toString().padStart(2,"0"),l=t.getSeconds().toString().padStart(2,"0");return J(`${a}:${s}:${l}`)}const IN=[{value:"summary",label:"خلاصه"},{value:"charts",label:"نمودار"},{value:"weather",label:"آب و هوا"},{value:"analysis",label:"تحلیل"}],FN={0:{description:"آسمان صاف",icon:en},1:{description:"عمدتاً صاف",icon:en},2:{description:"نیمه ابری",icon:zf},3:{description:"ابری",icon:zf},45:{description:"مه",icon:Df},48:{description:"مه یخ‌زده",icon:Df},51:{description:"نم‌نم باران",icon:wn},53:{description:"نم‌نم باران",icon:wn},55:{description:"نم‌نم باران شدید",icon:wn},61:{description:"باران خفیف",icon:wn},63:{description:"باران متوسط",icon:wn},65:{description:"باران شدید",icon:wn},71:{description:"برف خفیف",icon:ps},73:{description:"برف متوسط",icon:ps},75:{description:"برف شدید",icon:ps},77:{description:"دانه برف",icon:ps},80:{description:"رگبار خفیف",icon:wn},81:{description:"رگبار متوسط",icon:wn},82:{description:"رگبار شدید",icon:wn},85:{description:"بارش برف خفیف",icon:ps},86:{description:"بارش برف شدید",icon:ps},95:{description:"رعد و برق",icon:gf},96:{description:"رعد و برق با تگرگ",icon:gf},99:{description:"رعد و برق شدید",icon:gf}};function Ao(n){return FN[n]||{description:"نامشخص",icon:zf}}const QN=["یکشنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"];function uv(n){const t=new Date(n);return QN[t.getDay()]}const ZN={temperature:{title:"دما",unit:"°C",chartColor:"#ef4444",iconBg:"bg-red-50 dark:bg-red-500/10",iconColor:"text-red-600 dark:text-red-400"},humidity:{title:"رطوبت هوا",unit:"%",chartColor:"#3b82f6",iconBg:"bg-blue-50 dark:bg-blue-500/10",iconColor:"text-blue-600 dark:text-blue-400"},soil:{title:"رطوبت خاک",unit:"%",chartColor:"#16a34a",iconBg:"bg-green-50 dark:bg-green-500/10",iconColor:"text-green-600 dark:text-green-400"},gas:{title:"گاز CO",unit:"ppm",chartColor:"#f59e0b",iconBg:"bg-amber-50 dark:bg-amber-500/10",iconColor:"text-amber-600 dark:text-amber-400"},lux:{title:"نور",unit:"Lux",chartColor:"#a855f7",iconBg:"bg-purple-50 dark:bg-purple-500/10",iconColor:"text-purple-600 dark:text-purple-400"}};function dv(n,t=30){if(n.length<2)return[];const a=[];for(let s=0;s<n.length-1;s++){const l=new Date(n[s]),o=new Date(n[s+1]),d=(o.getTime()-l.getTime())/(1e3*60);if(d>t){const f=l.getHours()*60+l.getMinutes(),g=o.getHours()*60+o.getMinutes();a.push({startMinute:f,endMinute:g,durationMinutes:Math.round(d)})}}return a}function fv(n,t=30,a=2.5){if(n.length<3)return t;const s=[];for(let u=1;u<n.length;u++){const d=new Date(n[u]).getTime()-new Date(n[u-1]).getTime();d>0&&s.push(d/6e4)}if(s.length===0)return t;s.sort((u,d)=>u-d);const l=s[Math.floor(s.length/2)],o=Math.round(l*a);return Math.max(10,Math.min(o,t*4))}function hv(n,t=15){if(n.length<2)return t;const a=[];for(let l=1;l<n.length;l++){const o=new Date(n[l-1]).getTime(),u=new Date(n[l]).getTime();if(Number.isNaN(o)||Number.isNaN(u))continue;const d=u-o;d>0&&a.push(d/6e4)}if(a.length===0)return t;a.sort((l,o)=>l-o);const s=a[Math.floor(a.length/2)];return s<=0?t:Math.max(1,Math.round(s))}function KN(n,t,a){if(a.length===0||n.length<2)return n;const s=[];for(let l=0;l<n.length;l++)if(s.push(n[l]),l<n.length-1){const o=new Date(t[l]),u=new Date(t[l+1]),d=o.getHours()*60+o.getMinutes(),f=u.getHours()*60+u.getMinutes();a.some(x=>d<=x.startMinute&&f>=x.endMinute)&&s.push(null)}return s}function Sx(n,t,a,s){const l=n.filter(d=>d!==null);if(!l.length)return{min:t,max:a};const o=Math.min(...l),u=Math.max(...l);return{min:o<t?Math.floor(o/s)*s:t,max:u>a?Math.ceil(u/s)*s:a}}function PN(n){return n?n.split(",").map(t=>{const a=t.trim();return a==="1"?1:a==="0"?0:null}):[]}function WN(n){return n.map(t=>{const a=t.serverTimestampUtc||t.timestampUtc,s=new Date(a),l=s.getHours(),o=s.getMinutes();return s.getSeconds(),{timestamp:a,minute:l*60+o,label:`${String(l).padStart(2,"0")}:${String(o).padStart(2,"0")}`,soil:Number(t.soilPercent??0),temp:Number(t.temperatureC??0),hum:Number(t.humidityPercent??0),gas:Number(t.gasPPM??0),lux:Number(t.lux??0),power:t.power===0||t.power===1?t.power:null,relays:PN(t.relayStates)}})}const JN=[{key:"temp",title:"دما",seriesLabel:"دما (°C)",color:"#ef4444",bgColor:"#fee2e2",getValue:n=>n.temp,yAxisMin:0},{key:"hum",title:"رطوبت",seriesLabel:"رطوبت (%)",color:"#3b82f6",bgColor:"#dbeafe",getValue:n=>n.hum,yAxisMin:0,yAxisMax:100},{key:"gas",title:"گاز CO",seriesLabel:"CO (ppm)",color:"#f59e0b",bgColor:"#fef3c7",getValue:n=>n.gas,yAxisMin:0,yAxisMax:100},{key:"soil",title:"رطوبت خاک",seriesLabel:"رطوبت خاک (%)",color:"#16a34a",bgColor:"#dcfce7",getValue:n=>n.soil,yAxisMin:0,yAxisMax:100},{key:"lux",title:"نور",seriesLabel:"Lux",color:"#a855f7",bgColor:"#f3e8ff",getValue:n=>n.lux,yAxisMin:0}];function eM({data:n,color:t}){const l=n.length>60?n.filter((b,v)=>v%Math.ceil(n.length/60)===0):n;if(l.length<2)return h.jsx("div",{className:"w-full h-full"});const o=Math.min(...l),d=Math.max(...l)-o||1,f=l.map((b,v)=>{const _=v/(l.length-1)*200,M=54-(b-o)/d*52;return[_,M]}),g=f.map(([b,v],_)=>`${_===0?"M":"L"}${b.toFixed(2)},${v.toFixed(2)}`).join(" "),x=`${g} L${f[f.length-1][0].toFixed(2)},56 L${f[0][0].toFixed(2)},56 Z`;return h.jsxs("svg",{viewBox:"0 0 200 56",preserveAspectRatio:"none",className:"w-full h-full",children:[h.jsx("path",{d:x,fill:`${t}22`,stroke:"none"}),h.jsx("path",{d:g,fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}const tM={temperature:Ns,humidity:lr,soil:$y,gas:zy,lux:en};function Ol({param:n,currentValue:t,minValue:a,maxValue:s,data:l,onClick:o,headlineLabel:u,stale:d=!1}){const f=ZN[n];if(!f)return null;const g=tM[n];return h.jsxs("div",{className:`group flex h-40 flex-col overflow-hidden rounded-xl border border-gray-100 bg-white transition-all duration-150 hover:border-gray-200 hover:shadow-sm dark:border-slate-800 dark:bg-slate-900 dark:hover:border-slate-700 ${o?"cursor-pointer":""}`,onClick:o,children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-4 pt-3.5",children:[h.jsx("span",{className:`flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg ${f.iconBg}`,children:g&&h.jsx(g,{className:`h-4 w-4 ${f.iconColor}`})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("h3",{className:"truncate text-sm font-medium text-gray-700 dark:text-gray-200",children:f.title}),u&&h.jsx("p",{className:"truncate text-[10px] text-gray-400 dark:text-gray-500",children:u})]})]}),h.jsxs("div",{className:"flex items-baseline gap-1.5 px-4 pt-2",children:[h.jsx("span",{className:`text-2xl font-bold leading-none ${d?"text-gray-400 dark:text-gray-500":"text-gray-900 dark:text-white"}`,children:J(t.toFixed(1))}),h.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:f.unit})]}),h.jsx("div",{className:"mt-auto h-12 px-1",children:h.jsx(eM,{data:l,color:f.chartColor})}),h.jsxs("div",{className:"flex items-center justify-between px-4 pb-3 pt-1 text-[10px] text-gray-400 dark:text-gray-500",children:[h.jsxs("span",{children:["حداقل ",J(a.toFixed(1))]}),h.jsxs("span",{children:["حداکثر ",J(s.toFixed(1))]})]})]})}const nM=new Intl.DateTimeFormat("fa-IR",{hour:"2-digit",minute:"2-digit",timeZone:"Asia/Tehran",hour12:!1});function _x(n){const t=new Date(n);return Number.isNaN(t.getTime())?"—":J(nM.format(t))}function wx(n,t){if(n===null)return t?"ادامه دارد":"نامشخص";const a=Math.floor(n/3600),s=Math.floor(n%3600/60);return a>0?`${J(String(a))} ساعت و ${J(String(s))} دقیقه`:`${J(String(s))} دقیقه`}function aM({currentPower:n,outages:t,isToday:a=!0,stale:s=!1}){const l=w.useMemo(()=>{let N=0;const C=Date.now();for(const k of t){if(k.durationSeconds!=null){N+=k.durationSeconds;continue}if(!a)continue;const E=new Date(k.disconnectedAt).getTime();!Number.isNaN(E)&&E<C&&(N+=Math.floor((C-E)/1e3))}return N},[t,a]),o=t.some(N=>N.durationSeconds==null),u=w.useMemo(()=>wx(l,a),[l,a]),d=!a&&o?"نامشخص":u,f=t.length>0,g=a&&!s&&n!==null,x=n===1?$5:n===0?B5:Jw,b=n===1?"bg-emerald-100 dark:bg-emerald-500/20":n===0?"bg-red-100 dark:bg-red-500/20":"bg-gray-100 dark:bg-slate-700",v=n===1?"text-emerald-600 dark:text-emerald-400":n===0?"text-red-600 dark:text-red-400":"text-gray-500 dark:text-slate-400",_=n===1?"text-emerald-700 dark:text-emerald-300":n===0?"text-red-700 dark:text-red-300":"text-gray-700 dark:text-slate-300",M=n===1?"bg-emerald-50 dark:bg-emerald-500/10":n===0?"bg-red-50 dark:bg-red-500/10":"bg-gray-50 dark:bg-slate-800/60",j=n===1?"برق وصل است":n===0?"برق قطع است":"وضعیت برق نامشخص",S=n===1?"برق در حال حاضر وصل است":n===0?"دستگاه در حال حاضر با باتری کار می‌کند":"اطلاعات وضعیت برق ثبت نشده است";return h.jsx("div",{className:"rounded-xl border border-gray-100 bg-white dark:border-slate-800 dark:bg-slate-900 overflow-hidden",children:h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[h.jsx("span",{className:"w-8 h-8 rounded-lg bg-amber-50 dark:bg-amber-500/10 flex items-center justify-center",children:h.jsx(Lc,{className:"w-4 h-4 text-amber-600 dark:text-amber-400"})}),h.jsx("h3",{className:"text-sm font-semibold text-gray-800 dark:text-gray-100",children:"قطعی‌های برق"}),f&&h.jsxs("span",{className:"mr-auto bg-red-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full",children:[J(String(t.length))," قطعی"]})]}),g&&h.jsxs("div",{className:`flex items-center gap-2.5 rounded-lg px-3 py-2.5 ${M}`,children:[h.jsx("div",{className:`w-7 h-7 rounded-md flex items-center justify-center ${b}`,children:h.jsx(x,{className:`w-3.5 h-3.5 ${v}`})}),h.jsxs("div",{children:[h.jsx("p",{className:`text-sm font-semibold ${_}`,children:j}),h.jsx("p",{className:"text-[11px] text-gray-500 dark:text-slate-400 mt-0.5",children:S})]})]}),f?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-center justify-between mt-3 mb-2.5",children:[h.jsx("span",{className:"text-[11px] font-medium text-gray-500 dark:text-slate-400",children:"زمان‌بندی قطعی‌ها"}),h.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-gray-500 dark:text-slate-400",children:[h.jsx(fh,{className:"w-3.5 h-3.5"}),"مجموع: ",d]})]}),h.jsx("div",{className:"space-y-2",children:t.map((N,C)=>h.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-gray-50 dark:bg-slate-800/60 px-3 py-2.5",children:[h.jsx("span",{className:`w-2 h-2 flex-shrink-0 rounded-full ${N.connectedAt?"bg-red-400 dark:bg-red-500":"bg-red-500 animate-pulse"}`}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsxs("p",{className:"text-xs font-medium text-gray-800 dark:text-gray-200 truncate",children:[_x(N.disconnectedAt)," تا"," ",N.connectedAt?_x(N.connectedAt):a?"اکنون":"پایان روز"]})}),h.jsx("span",{className:`flex-shrink-0 text-[11px] font-bold ${N.durationSeconds!=null&&N.durationSeconds>3600?"text-red-600 dark:text-red-400":"text-amber-700 dark:text-amber-400"}`,children:wx(N.durationSeconds??null,a)})]},`${N.disconnectedAt}-${C}`))})]}):h.jsxs("div",{className:"text-center py-6",children:[h.jsx("p",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:"هیچ قطعی برقی ثبت نشده"}),h.jsx("p",{className:"text-xs text-gray-400 dark:text-slate-500 mt-1",children:a?"در این روز هیچ قطعی برقی ثبت نشده است":"برای این روز هیچ قطعی برقی ثبت نشده است"})]})]})})}const ca=[{value:0,label:"سایر",icon:mh,hint:"برای تجهیزات متفرقه یا نامشخص"},{value:1,label:"فن",icon:f5,hint:"برای تهویه و خنک‌سازی گلخانه"},{value:2,label:"هیتر",icon:zy,hint:"برای گرمایش گلخانه"},{value:3,label:"پمپ آب",icon:lr,hint:"برای آبیاری"},{value:4,label:"مه‌پاش",icon:Df,hint:"برای افزایش رطوبت هوا"},{value:5,label:"روشنایی",icon:b5,hint:"برای نور تکمیلی"},{value:6,label:"شیر برقی",icon:c5,hint:"برای کنترل جریان آب یا گاز"}],wi={0:{iconBg:"bg-gray-100",iconText:"text-gray-500",solid:"bg-gradient-to-br from-gray-500 to-gray-600",activeBorder:"border-gray-400",activeBg:"bg-gray-50",text:"text-gray-700"},1:{iconBg:"bg-blue-100",iconText:"text-blue-600",solid:"bg-gradient-to-br from-blue-500 to-blue-600",activeBorder:"border-blue-500",activeBg:"bg-blue-50",text:"text-blue-700"},2:{iconBg:"bg-red-100",iconText:"text-red-600",solid:"bg-gradient-to-br from-red-500 to-red-600",activeBorder:"border-red-500",activeBg:"bg-red-50",text:"text-red-700"},3:{iconBg:"bg-cyan-100",iconText:"text-cyan-600",solid:"bg-gradient-to-br from-cyan-500 to-cyan-600",activeBorder:"border-cyan-500",activeBg:"bg-cyan-50",text:"text-cyan-700"},4:{iconBg:"bg-sky-100",iconText:"text-sky-600",solid:"bg-gradient-to-br from-sky-500 to-sky-600",activeBorder:"border-sky-500",activeBg:"bg-sky-50",text:"text-sky-700"},5:{iconBg:"bg-amber-100",iconText:"text-amber-600",solid:"bg-gradient-to-br from-amber-500 to-orange-500",activeBorder:"border-amber-500",activeBg:"bg-amber-50",text:"text-amber-700"},6:{iconBg:"bg-slate-100",iconText:"text-slate-600",solid:"bg-gradient-to-br from-slate-500 to-slate-600",activeBorder:"border-slate-500",activeBg:"bg-slate-50",text:"text-slate-700"}},iM=[{value:0,label:"روشن شود",icon:ph,hint:"وقتی شرط برقرار شد، رله روشن می‌شود"},{value:1,label:"خاموش شود",icon:Vy,hint:"وقتی شرط برقرار شد، رله خاموش می‌شود"}],hc={0:{chip:"border-red-200 bg-gradient-to-l from-red-50 to-rose-100/40 hover:border-red-300 hover:shadow-sm",bubble:"bg-red-100 text-red-600 border-red-200",label:"text-red-700",mono:"border-red-200 bg-white/90 text-red-800",banner:"bg-gradient-to-l from-red-50 to-rose-100/40 border-red-200",bannerText:"text-red-800"},1:{chip:"border-blue-200 bg-gradient-to-l from-blue-50 to-sky-100/40 hover:border-blue-300 hover:shadow-sm",bubble:"bg-blue-100 text-blue-600 border-blue-200",label:"text-blue-700",mono:"border-blue-200 bg-white/90 text-blue-800",banner:"bg-gradient-to-l from-blue-50 to-sky-100/40 border-blue-200",bannerText:"text-blue-800"},2:{chip:"border-emerald-200 bg-gradient-to-l from-emerald-50 to-green-100/40 hover:border-emerald-300 hover:shadow-sm",bubble:"bg-emerald-100 text-emerald-600 border-emerald-200",label:"text-emerald-700",mono:"border-emerald-200 bg-white/90 text-emerald-800",banner:"bg-gradient-to-l from-emerald-50 to-green-100/40 border-emerald-200",bannerText:"text-emerald-800"},3:{chip:"border-amber-200 bg-gradient-to-l from-amber-50 to-orange-100/40 hover:border-amber-300 hover:shadow-sm",bubble:"bg-amber-100 text-amber-600 border-amber-200",label:"text-amber-700",mono:"border-amber-200 bg-white/90 text-amber-800",banner:"bg-gradient-to-l from-amber-50 to-orange-100/40 border-amber-200",bannerText:"text-amber-800"},4:{chip:"border-violet-200 bg-gradient-to-l from-violet-50 to-purple-100/40 hover:border-violet-300 hover:shadow-sm",bubble:"bg-violet-100 text-violet-600 border-violet-200",label:"text-violet-700",mono:"border-violet-200 bg-white/90 text-violet-800",banner:"bg-gradient-to-l from-violet-50 to-purple-100/40 border-violet-200",bannerText:"text-violet-800"}},mc={0:{iconText:"text-amber-500",badge:"bg-amber-100 text-amber-800 ring-1 ring-amber-200",activeButton:"border-amber-400 bg-amber-50 text-amber-700 ring-2 ring-amber-300/30"},1:{iconText:"text-indigo-500",badge:"bg-indigo-100 text-indigo-700 ring-1 ring-indigo-200",activeButton:"border-indigo-400 bg-indigo-50 text-indigo-700 ring-2 ring-indigo-300/30"},2:{iconText:"text-emerald-500",badge:"bg-emerald-100 text-emerald-700 ring-1 ring-emerald-200",activeButton:"border-emerald-400 bg-emerald-50 text-emerald-700 ring-2 ring-emerald-300/30"}},Do={name:"یک نام دلخواه برای این رله بگذارید تا در گزارش‌ها و هشدارها به‌جای «رله ۱» همین نام نمایش داده شود.",enabled:"اگر این گزینه خاموش باشد، رله در هیچ شرایطی فعال نمی‌شود.",kind:"نوع تجهیز متصل به رله را مشخص کنید تا آیکون و پیشنهادهای مناسب نمایش داده شود.",rules:"شرایطی را تعریف کنید که با برقرار شدن آن، رله روشن یا خاموش شود. می‌توانید چند قانون اضافه کنید."};function sM({relays:n,states:t,isToday:a=!0}){return n.length===0?null:h.jsx("div",{className:"rounded-xl border border-gray-100 bg-white dark:border-slate-800 dark:bg-slate-900 overflow-hidden",children:h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[h.jsx("span",{className:"w-8 h-8 rounded-lg bg-emerald-50 dark:bg-emerald-500/10 flex items-center justify-center",children:h.jsx(ph,{className:"w-4 h-4 text-emerald-600 dark:text-emerald-400"})}),h.jsx("h3",{className:"text-sm font-semibold text-gray-800 dark:text-gray-100",children:"وضعیت رله‌ها"})]}),h.jsx("div",{className:"grid gap-2 grid-cols-1 sm:grid-cols-2",children:n.map(s=>{const l=ca.find(g=>g.value===s.relayKind)??ca[0],o=l.icon,u=wi[s.relayKind]??wi[0],d=t?t[s.relayIndex-1]??0:null,f=s.name||`رله ${s.relayIndex}`;return h.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-gray-50 dark:bg-slate-800/60 px-3 py-2.5",children:[h.jsx("span",{className:te("w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",u.iconBg),children:h.jsx(o,{className:te("w-4 h-4",u.iconText)})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-xs font-medium text-gray-800 dark:text-gray-200 truncate",children:f}),h.jsx("p",{className:"text-[11px] text-gray-400 dark:text-slate-500 mt-0.5",children:l.label})]}),h.jsx("span",{className:te("flex-shrink-0 text-[11px] font-bold px-2 py-1 rounded-full",d===1?"bg-emerald-100 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300":d===0?"bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-300":"bg-gray-100 text-gray-500 dark:bg-slate-700 dark:text-slate-400"),children:d===1?"روشن":d===0?"خاموش":"نامشخص"})]},s.relayIndex)})}),!a&&h.jsx("p",{className:"text-[11px] text-gray-400 dark:text-slate-500 mt-2.5",children:"آخرین وضعیت ثبت‌شده در این روز"})]})})}function lM(n){if(!n)return 0;let t=0;for(let a=1;a<n.daily.length;a++){const s=n.daily[a];s.tempMin<5&&t++,s.tempMax>35&&t++,s.uvIndexMax>8&&t++,s.windSpeedMax>40&&t++,s.precipitation>10&&t++,s.tempMin>=5&&s.tempMin<10&&t++,s.tempMax>=30&&s.tempMax<=35&&t++}return t}function rM({weatherData:n}){const t=w.useMemo(()=>{const l=new Map;for(let o=1;o<n.daily.length;o++){const u=n.daily[o],d=o,f=[];u.tempMin<5&&f.push({type:"danger",title:"⚠️ هشدار یخ‌زدگی",description:`دمای حداقل ${J(Math.round(u.tempMin))}°C پیش‌بینی شده. سیستم گرمایش را آماده کنید و پوشش محافظ روی گیاهان حساس قرار دهید.`,icon:Ns,daysAhead:d,date:u.date}),u.tempMax>35&&f.push({type:"danger",title:"🌡️ هشدار گرمای شدید",description:`دمای حداکثر ${J(Math.round(u.tempMax))}°C پیش‌بینی شده. سایه‌بان‌ها را فعال کنید، تهویه را افزایش دهید و آبیاری را در ساعات خنک انجام دهید.`,icon:en,daysAhead:d,date:u.date}),u.uvIndexMax>8&&f.push({type:"warning",title:"☀️ شاخص UV بالا",description:`شاخص UV ${J(Math.round(u.uvIndexMax))} است. برای گیاهان حساس به نور از سایه‌بان استفاده کنید.`,icon:en,daysAhead:d,date:u.date}),u.windSpeedMax>40&&f.push({type:"warning",title:"💨 باد شدید",description:`سرعت باد به ${J(Math.round(u.windSpeedMax))} کیلومتر بر ساعت می‌رسد. دریچه‌ها و پنجره‌ها را ببندید و سازه را بررسی کنید.`,icon:Oc,daysAhead:d,date:u.date}),u.precipitation>10&&f.push({type:"info",title:"🌧️ بارش قابل توجه",description:`بارش ${J(Math.round(u.precipitation))} میلی‌متر پیش‌بینی شده. سیستم زهکشی را بررسی کنید و آبیاری را کاهش دهید.`,icon:lr,daysAhead:d,date:u.date}),u.tempMin>=5&&u.tempMin<10&&f.push({type:"warning",title:"🌡️ دمای پایین",description:`دمای حداقل ${J(Math.round(u.tempMin))}°C پیش‌بینی شده. مراقب گیاهان حساس به سرما باشید.`,icon:Ns,daysAhead:d,date:u.date}),u.tempMax>=30&&u.tempMax<=35&&f.push({type:"warning",title:"🌡️ دمای بالا",description:`دمای حداکثر ${J(Math.round(u.tempMax))}°C پیش‌بینی شده. تهویه را افزایش دهید و آبیاری را در ساعات صبح انجام دهید.`,icon:en,daysAhead:d,date:u.date}),f.length>0&&l.set(d,f)}return l},[n]);if(t.size===0)return null;const a=Array.from(t.entries()).sort((l,o)=>l[0]-o[0]),s=l=>l===1?"فردا":l===2?"پس فردا":`${J(l)} روز آینده`;return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("h3",{className:"text-lg font-semibold text-gray-800 flex items-center gap-2",children:[h.jsx(Rs,{className:"w-5 h-5 text-amber-500"}),"هشدارهای پیش‌بینی آب و هوا برای روزهای آینده"]}),a.map(([l,o])=>{const u=uv(n.daily[l].date),d=s(l);return h.jsxs("div",{className:"space-y-3",children:[h.jsx("div",{className:"flex items-center gap-2 pb-2 border-b-2 border-gray-200",children:h.jsxs("h4",{className:"text-base font-bold text-gray-800",children:["روز ",u," (",d,")"]})}),o.map((f,g)=>{const x=f.icon;return h.jsx("div",{className:`p-4 rounded-xl border-r-4 shadow-sm ${f.type==="danger"?"bg-red-50 border-red-500":f.type==="warning"?"bg-amber-50 border-amber-500":f.type==="info"?"bg-blue-50 border-blue-500":"bg-green-50 border-green-500"}`,children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(x,{className:`w-5 h-5 mt-0.5 flex-shrink-0 ${f.type==="danger"?"text-red-600":f.type==="warning"?"text-amber-600":f.type==="info"?"text-blue-600":"text-green-600"}`}),h.jsxs("div",{className:"flex-1",children:[h.jsx("p",{className:`font-semibold text-sm mb-1 ${f.type==="danger"?"text-red-700":f.type==="warning"?"text-amber-700":f.type==="info"?"text-blue-700":"text-green-700"}`,children:f.title}),h.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:f.description})]})]})},`${f.date}-${f.type}-${g}`)})]},l)})]})}function oM({alertsCount:n,onClick:t,className:a}){return h.jsx("div",{className:a||"mb-6",children:h.jsxs("button",{onClick:t,className:"w-full p-4 bg-amber-50 border border-amber-200 hover:border-amber-300 rounded-lg transition-all duration-150 text-right flex items-center justify-between group",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-9 h-9 bg-amber-500 rounded-md flex items-center justify-center group-hover:scale-105 transition-transform",children:h.jsx(Rs,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{children:[h.jsxs("p",{className:"font-semibold text-gray-800 text-sm",children:["شما ",J(n)," هشدار آب و هوایی برای روزهای آینده دارید"]}),h.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"برای مشاهده جزئیات و توصیه‌های مدیریت گلخانه کلیک کنید"})]})]}),h.jsx(_i,{className:"w-4 h-4 text-amber-600 group-hover:translate-x-[-4px] transition-transform"})]})})}function Ll(n){if(n.length===0)return{current:0,min:0,max:0,avg:0,count:0};let t=1/0,a=-1/0,s=0;for(const l of n)l<t&&(t=l),l>a&&(a=l),s+=l;return{current:n[n.length-1]??0,min:t,max:a,avg:s/n.length,count:n.length}}function cM({temperature:n,humidity:t,soil:a,gas:s,lux:l,forecastWeather:o,forecastWeatherLoading:u=!1,onCardClick:d,visibleParams:f,currentPower:g,powerOutages:x=[],relays:b=[],relayStates:v=null,isToday:_,stale:M=!1}){const[j,S]=w.useState(!1),N=w.useMemo(()=>lM(o??null),[o]),C=w.useMemo(()=>Ll(n),[n]),k=w.useMemo(()=>Ll(t),[t]),E=w.useMemo(()=>Ll(a),[a]),A=w.useMemo(()=>Ll(s),[s]),z=w.useMemo(()=>Ll(l),[l]),L=n.length>0||t.length>0||a.length>0||s.length>0||l.length>0,R=de=>_?de.current:de.avg,X=()=>_?M?"آخرین مقدار دریافتی":"مقدار فعلی":"میانگین روز";return h.jsxs(h.Fragment,{children:[u?h.jsx("div",{className:"mb-6",children:h.jsx("div",{className:"w-full p-4 bg-amber-50 border border-amber-200 rounded-lg text-right flex items-center justify-between",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-9 h-9 bg-amber-100 rounded-md flex items-center justify-center",children:h.jsx(hh,{className:"w-5 h-5 text-amber-600 animate-spin"})}),h.jsxs("div",{children:[h.jsx("p",{className:"font-semibold text-gray-800",children:"در حال بارگذاری هشدارهای آب و هوایی..."}),h.jsx("p",{className:"text-sm text-gray-500 mt-0.5",children:"لطفاً صبر کنید"})]})]})})}):N>0&&o?h.jsx(oM,{alertsCount:N,onClick:()=>S(!0)}):null,L?h.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",children:[(!f||f.length===0||f.includes("temperature"))&&n.length>0&&h.jsx(Ol,{param:"temperature",currentValue:R(C),minValue:C.min,maxValue:C.max,data:n,headlineLabel:X(),stale:M,onClick:()=>d==null?void 0:d("temperature")}),(!f||f.length===0||f.includes("humidity"))&&t.length>0&&h.jsx(Ol,{param:"humidity",currentValue:R(k),minValue:k.min,maxValue:k.max,data:t,headlineLabel:X(),stale:M,onClick:()=>d==null?void 0:d("humidity")}),(!f||f.length===0||f.includes("gas"))&&s.length>0&&h.jsx(Ol,{param:"gas",currentValue:R(A),minValue:A.min,maxValue:A.max,data:s,headlineLabel:X(),stale:M,onClick:()=>d==null?void 0:d("gas")}),(!f||f.length===0||f.includes("soil"))&&a.length>0&&h.jsx(Ol,{param:"soil",currentValue:R(E),minValue:E.min,maxValue:E.max,data:a,headlineLabel:X(),stale:M,onClick:()=>d==null?void 0:d("soil")}),(!f||f.length===0||f.includes("lux"))&&l.length>0&&h.jsx(Ol,{param:"lux",currentValue:R(z),minValue:z.min,maxValue:z.max,data:l,headlineLabel:X(),stale:M,onClick:()=>d==null?void 0:d("lux")})]}):h.jsxs("div",{className:"rounded-lg border border-dashed border-gray-300 bg-gray-50 p-8 text-center",children:[h.jsx("p",{className:"text-sm font-semibold text-gray-700",children:"داده‌ای برای این روز ثبت نشده است"}),h.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"برای این تاریخ هیچ رکورد تلمتری دریافت نشده است."})]}),h.jsx("div",{className:"mt-6",children:h.jsx(aM,{currentPower:g,outages:x,isToday:_,stale:M})}),b.length>0&&h.jsx("div",{className:"mt-6",children:h.jsx(sM,{relays:b,states:v,isToday:_})}),o&&h.jsx(bN,{isOpen:j,onClose:()=>S(!1),title:"هشدارهای پیش‌بینی آب و هوا",children:h.jsx(rM,{weatherData:o})})]})}function uM(n=34.396748,t=50.865948,a=3.5){const s=new Date,l=Math.floor((s.getTime()-new Date(s.getFullYear(),0,0).getTime())/864e5),o=-23.44*Math.cos(2*Math.PI/365*(l+10)),u=n*Math.PI/180,d=o*Math.PI/180,f=-Math.tan(u)*Math.tan(d);if(Math.abs(f)<=1){const g=Math.acos(f)*180/Math.PI,x=12-g/15+(t/15-a),b=12+g/15+(t/15-a),v=Math.floor(x),_=Math.round((x-v)*60),M=Math.floor(b),j=Math.round((b-M)*60);return{sunrise:{hour:v,minute:_,decimal:x},sunset:{hour:M,minute:j,decimal:b}}}return{sunrise:{hour:6,minute:0,decimal:6},sunset:{hour:18,minute:0,decimal:18}}}function dM({dataGaps:n=[],onReset:t,onToggle:a,isOpen:s=!0}){return h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-3 text-right",children:[h.jsx("span",{className:"text-slate-700 dark:text-slate-300 font-medium text-lg",children:"محدوده زمانی"}),n.length>0&&h.jsxs(Bf,{variant:"warning",icon:Rs,children:[J(n.length)," گپ در داده‌ها"]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{type:"button",onClick:t,className:"px-3 py-1.5 text-sm text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 rounded-lg transition-colors",children:"کل روز"}),a&&h.jsx("button",{type:"button",onClick:a,"aria-label":s?"جمع کردن بازه زمانی":"باز کردن بازه زمانی",className:"p-1.5 rounded-lg text-slate-500 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",children:s?h.jsx(Qw,{className:"w-4 h-4"}):h.jsx(Wl,{className:"w-4 h-4"})})]})]})}function mv(n){return{hour:Math.floor(n/60),minute:n%60}}function Ms(n,t=1439){return(t-n)/t*100}function gv(n,t){return`${J(n.toString().padStart(2,"0"))}:${J(t.toString().padStart(2,"0"))}`}function fM(n,t){const a=t-n+1;return mv(a)}function hM(n,t,a){return`${n} ${gv(t,a)}`}const mM={start:"bg-emerald-500",end:"bg-rose-500"};function gM({minute:n,variant:t="start",className:a}){const{hour:s,min:l,timeStr:o,percent:u}=w.useMemo(()=>{const{hour:d,minute:f}=mv(n),g=gv(d,f),x=Ms(n);return{hour:d,min:f,timeStr:g,percent:x}},[n]);return h.jsx("div",{className:`absolute top-[-8px] z-30 pointer-events-none ${a||""}`,style:{right:`calc(${u}% ${t==="start"?"-":"+"} 4px)`,transform:"translateX(50%)"},children:h.jsx("div",{className:`${mM[t]} text-white px-2 py-1 rounded text-sm font-mono whitespace-nowrap`,children:o})})}const jx=w.memo(gM);function Nx({hour:n,minute:t,decimal:a,label:s,position:l="bottom"}){const o=Ms(a*60),u=hM(s,n,t);return h.jsx("div",{className:`absolute z-30 pointer-events-none bg-gray-100 text-gray-600 px-2 py-1 rounded text-xs font-mono whitespace-nowrap ${l==="top"?"top-[-30px]":"bottom-[-30px]"}`,style:{right:`${o}%`,transform:"translateX(50%)"},children:u})}const pM=[0,2,4,6,8,10,12,14,16,18,20,22];function xM(){return h.jsx(h.Fragment,{children:pM.map(n=>h.jsx("div",{className:"absolute bottom-0 z-20",style:{right:`${(23-n)/23*100}%`,transform:"translateX(50%)"},children:h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsx("span",{className:"text-[10px] text-slate-600 dark:text-slate-400 font-mono",children:J(n.toString().padStart(2,"0"))}),h.jsx("div",{className:"w-px h-2 bg-slate-400 dark:bg-slate-500 mb-1"})]})},n))})}function bM({gap:n,index:t}){const a=Ms(n.startMinute),s=Ms(n.endMinute),l=a-s,o=Math.floor(n.durationMinutes/60),u=n.durationMinutes%60;return h.jsxs("div",{children:[h.jsx("div",{className:"absolute top-0 bottom-0 bg-red-400/30 dark:bg-red-500/40 border-r-2 border-l-2 border-red-500 dark:border-red-400 z-15",style:{right:`${s}%`,width:`${l}%`},title:`گپ ${J(o)}:${J(u.toString().padStart(2,"0"))}`,children:h.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:h.jsx(Rs,{className:"w-4 h-4 text-red-600 dark:text-red-400"})})}),l>5&&h.jsxs("div",{className:"absolute top-[-30px] z-30 pointer-events-none bg-red-500 text-white px-2 py-1 rounded text-xs font-mono whitespace-nowrap",style:{right:`${s+l/2}%`,transform:"translateX(50%)"},children:["گپ ",J(o),":",J(u.toString().padStart(2,"0"))]})]},t)}function yM({dataGaps:n}){return n.length===0?null:h.jsx(h.Fragment,{children:n.map((t,a)=>h.jsx(bM,{gap:t,index:a},a))})}function Mx(n,t=300){const[a,s]=w.useState(n);return w.useEffect(()=>{const l=setTimeout(()=>{s(n)},t);return()=>{clearTimeout(l)}},[n,t]),a}function vM({startMinute:n,endMinute:t,onStartMinuteChange:a,onEndMinuteChange:s}){const[l,o]=w.useState(1439-n),[u,d]=w.useState(1439-t),f=w.useRef(n),g=w.useRef(t),x=w.useRef(t),b=w.useRef(n);w.useEffect(()=>{x.current=t,b.current=n},[n,t]),w.useEffect(()=>{f.current!==n&&(o(1439-n),f.current=n)},[n]),w.useEffect(()=>{g.current!==t&&(d(1439-t),g.current=t)},[t]);const v=Mx(l,600),_=Mx(u,600);w.useEffect(()=>{const S=1439-v,N=x.current,C=b.current;S!==C&&S<=N&&a(S)},[v,a]),w.useEffect(()=>{const S=1439-_,N=b.current,C=x.current;S!==C&&S>=N&&s(S)},[_,s]);const M=S=>{const N=Number(S.target.value);o(N)},j=S=>{const N=Number(S.target.value);d(N)};return h.jsxs("div",{className:"absolute inset-x-0 top-1/2 -translate-y-1/2 h-20",children:[h.jsx("input",{type:"range",min:"0",max:"1439",value:l,onChange:M,className:"absolute inset-0 w-full h-full appearance-none bg-transparent cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-20 [&::-webkit-slider-thumb]:rounded-sm [&::-webkit-slider-thumb]:bg-emerald-500 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:active:cursor-grabbing [&::-moz-range-thumb]:w-3 [&::-moz-range-thumb]:h-20 [&::-moz-range-thumb]:rounded-sm [&::-moz-range-thumb]:bg-emerald-500 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:border-0 pointer-events-none [&::-webkit-slider-thumb]:pointer-events-auto [&::-moz-range-thumb]:pointer-events-auto"}),h.jsx("input",{type:"range",min:"0",max:"1439",value:u,onChange:j,className:"absolute inset-0 w-full h-full appearance-none bg-transparent cursor-pointer [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-20 [&::-webkit-slider-thumb]:rounded-sm [&::-webkit-slider-thumb]:bg-rose-500 [&::-webkit-slider-thumb]:cursor-grab [&::-webkit-slider-thumb]:active:cursor-grabbing [&::-moz-range-thumb]:w-3 [&::-moz-range-thumb]:h-20 [&::-moz-range-thumb]:rounded-sm [&::-moz-range-thumb]:bg-rose-500 [&::-moz-range-thumb]:cursor-grab [&::-moz-range-thumb]:border-0 pointer-events-none [&::-webkit-slider-thumb]:pointer-events-auto [&::-moz-range-thumb]:pointer-events-auto"})]})}const SM=w.memo(vM);function _M({sunTimes:n,dataGaps:t=[]}){const{sunrisePercent:a,sunsetPercent:s}=w.useMemo(()=>({sunrisePercent:Ms(n.sunrise.decimal*60),sunsetPercent:Ms(n.sunset.decimal*60)}),[n.sunrise.decimal,n.sunset.decimal]);return h.jsxs("div",{className:"absolute inset-x-0 top-1/2 -translate-y-1/2 h-20 rounded-lg bg-slate-200 dark:bg-slate-700",children:[h.jsx("div",{className:"absolute top-[-20px] bottom-[-20px] inset-y-0 w-0 border-r-2 border-dashed border-slate-400 dark:border-slate-500 z-10",style:{right:`${a}%`}}),h.jsx("div",{className:"absolute top-[-20px] bottom-[-20px] inset-y-0 w-0 border-r-2 border-dashed border-slate-400 dark:border-slate-500 z-10",style:{right:`${s}%`}}),h.jsx(Nx,{hour:n.sunrise.hour,minute:n.sunrise.minute,decimal:n.sunrise.decimal,label:"طلوع",position:"bottom"}),h.jsx(Nx,{hour:n.sunset.hour,minute:n.sunset.minute,decimal:n.sunset.decimal,label:"غروب",position:"bottom"}),h.jsx("div",{className:"absolute right-0 top-0 bottom-0 bg-gray-300",style:{width:`${s}%`}}),h.jsx("div",{className:"absolute left-0 top-0 bottom-0 bg-gray-300",style:{width:`calc(${100-a}% - 1px)`}}),h.jsx(yM,{dataGaps:t}),h.jsx(xM,{})]})}const wM=w.memo(_M);function jM({startMinute:n,endMinute:t,totalRecords:a}){const{hour:s,minute:l}=fM(n,t);return h.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-slate-200 dark:border-slate-700",children:[h.jsxs("div",{className:"text-slate-600 dark:text-slate-400",children:[h.jsxs("span",{className:"text-2xl font-bold text-slate-800 dark:text-slate-200 font-mono",children:[J(s),":",J(l.toString().padStart(2,"0"))]}),h.jsx("span",{className:"text-sm mr-2",children:"بازه انتخاب شده"})]}),h.jsx("div",{className:"text-slate-500 dark:text-slate-400 text-sm",children:a>0?h.jsxs(h.Fragment,{children:[J(a)," رکورد"]}):h.jsx(h.Fragment,{children:"بدون رکورد"})})]})}function NM({startMinute:n,endMinute:t,onStartMinuteChange:a,onEndMinuteChange:s,totalRecords:l,dataGaps:o=[]}){const[u,d]=w.useState(!0),f=w.useMemo(()=>uM(),[]),g=()=>{a(0),s(1439)},x=()=>{d(b=>!b)};return h.jsxs("div",{className:"p-5",children:[h.jsx(dM,{dataGaps:o,onReset:g,onToggle:x,isOpen:u}),u&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"relative h-32 pt-10 mb-4 select-none",children:[h.jsx(wM,{sunTimes:f,dataGaps:o}),h.jsx(jx,{minute:n,variant:"start"}),h.jsx(jx,{minute:t,variant:"end"}),h.jsx(SM,{startMinute:n,endMinute:t,onStartMinuteChange:a,onEndMinuteChange:s})]}),h.jsx(jM,{startMinute:n,endMinute:t,totalRecords:l})]})]})}/*!
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
*/function cr(n){return n+.5|0}const Ua=(n,t,a)=>Math.max(Math.min(n,a),t);function Yl(n){return Ua(cr(n*2.55),0,255)}function qa(n){return Ua(cr(n*255),0,255)}function oa(n){return Ua(cr(n/2.55)/100,0,1)}function Tx(n){return Ua(cr(n*100),0,100)}const gn={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},$f=[..."0123456789ABCDEF"],MM=n=>$f[n&15],TM=n=>$f[(n&240)>>4]+$f[n&15],zo=n=>(n&240)>>4===(n&15),kM=n=>zo(n.r)&&zo(n.g)&&zo(n.b)&&zo(n.a);function CM(n){var t=n.length,a;return n[0]==="#"&&(t===4||t===5?a={r:255&gn[n[1]]*17,g:255&gn[n[2]]*17,b:255&gn[n[3]]*17,a:t===5?gn[n[4]]*17:255}:(t===7||t===9)&&(a={r:gn[n[1]]<<4|gn[n[2]],g:gn[n[3]]<<4|gn[n[4]],b:gn[n[5]]<<4|gn[n[6]],a:t===9?gn[n[7]]<<4|gn[n[8]]:255})),a}const EM=(n,t)=>n<255?t(n):"";function AM(n){var t=kM(n)?MM:TM;return n?"#"+t(n.r)+t(n.g)+t(n.b)+EM(n.a,t):void 0}const DM=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function pv(n,t,a){const s=t*Math.min(a,1-a),l=(o,u=(o+n/30)%12)=>a-s*Math.max(Math.min(u-3,9-u,1),-1);return[l(0),l(8),l(4)]}function zM(n,t,a){const s=(l,o=(l+n/60)%6)=>a-a*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function RM(n,t,a){const s=pv(n,1,.5);let l;for(t+a>1&&(l=1/(t+a),t*=l,a*=l),l=0;l<3;l++)s[l]*=1-t-a,s[l]+=t;return s}function OM(n,t,a,s,l){return n===l?(t-a)/s+(t<a?6:0):t===l?(a-n)/s+2:(n-t)/s+4}function Nh(n){const a=n.r/255,s=n.g/255,l=n.b/255,o=Math.max(a,s,l),u=Math.min(a,s,l),d=(o+u)/2;let f,g,x;return o!==u&&(x=o-u,g=d>.5?x/(2-o-u):x/(o+u),f=OM(a,s,l,x,o),f=f*60+.5),[f|0,g||0,d]}function Mh(n,t,a,s){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,a,s)).map(qa)}function Th(n,t,a){return Mh(pv,n,t,a)}function LM(n,t,a){return Mh(RM,n,t,a)}function HM(n,t,a){return Mh(zM,n,t,a)}function xv(n){return(n%360+360)%360}function BM(n){const t=DM.exec(n);let a=255,s;if(!t)return;t[5]!==s&&(a=t[6]?Yl(+t[5]):qa(+t[5]));const l=xv(+t[2]),o=+t[3]/100,u=+t[4]/100;return t[1]==="hwb"?s=LM(l,o,u):t[1]==="hsv"?s=HM(l,o,u):s=Th(l,o,u),{r:s[0],g:s[1],b:s[2],a}}function UM(n,t){var a=Nh(n);a[0]=xv(a[0]+t),a=Th(a),n.r=a[0],n.g=a[1],n.b=a[2]}function $M(n){if(!n)return;const t=Nh(n),a=t[0],s=Tx(t[1]),l=Tx(t[2]);return n.a<255?`hsla(${a}, ${s}%, ${l}%, ${oa(n.a)})`:`hsl(${a}, ${s}%, ${l}%)`}const kx={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"},Cx={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 VM(){const n={},t=Object.keys(Cx),a=Object.keys(kx);let s,l,o,u,d;for(s=0;s<t.length;s++){for(u=d=t[s],l=0;l<a.length;l++)o=a[l],d=d.replace(o,kx[o]);o=parseInt(Cx[u],16),n[d]=[o>>16&255,o>>8&255,o&255]}return n}let Ro;function YM(n){Ro||(Ro=VM(),Ro.transparent=[0,0,0,0]);const t=Ro[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const GM=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function qM(n){const t=GM.exec(n);let a=255,s,l,o;if(t){if(t[7]!==s){const u=+t[7];a=t[8]?Yl(u):Ua(u*255,0,255)}return s=+t[1],l=+t[3],o=+t[5],s=255&(t[2]?Yl(s):Ua(s,0,255)),l=255&(t[4]?Yl(l):Ua(l,0,255)),o=255&(t[6]?Yl(o):Ua(o,0,255)),{r:s,g:l,b:o,a}}}function XM(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${oa(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const bf=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,xs=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function IM(n,t,a){const s=xs(oa(n.r)),l=xs(oa(n.g)),o=xs(oa(n.b));return{r:qa(bf(s+a*(xs(oa(t.r))-s))),g:qa(bf(l+a*(xs(oa(t.g))-l))),b:qa(bf(o+a*(xs(oa(t.b))-o))),a:n.a+a*(t.a-n.a)}}function Oo(n,t,a){if(n){let s=Nh(n);s[t]=Math.max(0,Math.min(s[t]+s[t]*a,t===0?360:1)),s=Th(s),n.r=s[0],n.g=s[1],n.b=s[2]}}function bv(n,t){return n&&Object.assign(t||{},n)}function Ex(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=qa(n[3]))):(t=bv(n,{r:0,g:0,b:0,a:1}),t.a=qa(t.a)),t}function FM(n){return n.charAt(0)==="r"?qM(n):BM(n)}class Jl{constructor(t){if(t instanceof Jl)return t;const a=typeof t;let s;a==="object"?s=Ex(t):a==="string"&&(s=CM(t)||YM(t)||FM(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=bv(this._rgb);return t&&(t.a=oa(t.a)),t}set rgb(t){this._rgb=Ex(t)}rgbString(){return this._valid?XM(this._rgb):void 0}hexString(){return this._valid?AM(this._rgb):void 0}hslString(){return this._valid?$M(this._rgb):void 0}mix(t,a){if(t){const s=this.rgb,l=t.rgb;let o;const u=a===o?.5:a,d=2*u-1,f=s.a-l.a,g=((d*f===-1?d:(d+f)/(1+d*f))+1)/2;o=1-g,s.r=255&g*s.r+o*l.r+.5,s.g=255&g*s.g+o*l.g+.5,s.b=255&g*s.b+o*l.b+.5,s.a=u*s.a+(1-u)*l.a,this.rgb=s}return this}interpolate(t,a){return t&&(this._rgb=IM(this._rgb,t._rgb,a)),this}clone(){return new Jl(this.rgb)}alpha(t){return this._rgb.a=qa(t),this}clearer(t){const a=this._rgb;return a.a*=1-t,this}greyscale(){const t=this._rgb,a=cr(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=a,this}opaquer(t){const a=this._rgb;return a.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 Oo(this._rgb,2,t),this}darken(t){return Oo(this._rgb,2,-t),this}saturate(t){return Oo(this._rgb,1,t),this}desaturate(t){return Oo(this._rgb,1,-t),this}rotate(t){return UM(this._rgb,t),this}}/*!
* Chart.js v4.5.1
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/function sa(){}const QM=(()=>{let n=0;return()=>n++})();function Fe(n){return n==null}function vt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Re(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function kt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Rn(n,t){return kt(n)?n:t}function ze(n,t){return typeof n>"u"?t:n}const ZM=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Pe(n,t,a){if(n&&typeof n.call=="function")return n.apply(a,t)}function Ve(n,t,a,s){let l,o,u;if(vt(n))for(o=n.length,l=0;l<o;l++)t.call(a,n[l],l);else if(Re(n))for(u=Object.keys(n),o=u.length,l=0;l<o;l++)t.call(a,n[u[l]],u[l])}function gc(n,t){let a,s,l,o;if(!n||!t||n.length!==t.length)return!1;for(a=0,s=n.length;a<s;++a)if(l=n[a],o=t[a],l.datasetIndex!==o.datasetIndex||l.index!==o.index)return!1;return!0}function pc(n){if(vt(n))return n.map(pc);if(Re(n)){const t=Object.create(null),a=Object.keys(n),s=a.length;let l=0;for(;l<s;++l)t[a[l]]=pc(n[a[l]]);return t}return n}function yv(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function KM(n,t,a,s){if(!yv(n))return;const l=t[n],o=a[n];Re(l)&&Re(o)?er(l,o,s):t[n]=pc(o)}function er(n,t,a){const s=vt(t)?t:[t],l=s.length;if(!Re(n))return n;a=a||{};const o=a.merger||KM;let u;for(let d=0;d<l;++d){if(u=s[d],!Re(u))continue;const f=Object.keys(u);for(let g=0,x=f.length;g<x;++g)o(f[g],n,u,a)}return n}function Xl(n,t){return er(n,t,{merger:PM})}function PM(n,t,a){if(!yv(n))return;const s=t[n],l=a[n];Re(s)&&Re(l)?Xl(s,l):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=pc(l))}const Ax={"":n=>n,x:n=>n.x,y:n=>n.y};function WM(n){const t=n.split("."),a=[];let s="";for(const l of t)s+=l,s.endsWith("\\")?s=s.slice(0,-1)+".":(a.push(s),s="");return a}function JM(n){const t=WM(n);return a=>{for(const s of t){if(s==="")break;a=a&&a[s]}return a}}function xc(n,t){return(Ax[t]||(Ax[t]=JM(t)))(n)}function kh(n){return n.charAt(0).toUpperCase()+n.slice(1)}const bc=n=>typeof n<"u",Ia=n=>typeof n=="function",Dx=(n,t)=>{if(n.size!==t.size)return!1;for(const a of n)if(!t.has(a))return!1;return!0};function e4(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Tt=Math.PI,Mn=2*Tt,t4=Mn+Tt,yc=Number.POSITIVE_INFINITY,n4=Tt/180,jn=Tt/2,mi=Tt/4,zx=Tt*2/3,vv=Math.log10,Ts=Math.sign;function Il(n,t,a){return Math.abs(n-t)<a}function Rx(n){const t=Math.round(n);n=Il(n,t,n/1e3)?t:n;const a=Math.pow(10,Math.floor(vv(n))),s=n/a;return(s<=1?1:s<=2?2:s<=5?5:10)*a}function a4(n){const t=[],a=Math.sqrt(n);let s;for(s=1;s<a;s++)n%s===0&&(t.push(s),t.push(n/s));return a===(a|0)&&t.push(a),t.sort((l,o)=>l-o).pop(),t}function i4(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function tr(n){return!i4(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function s4(n,t){const a=Math.round(n);return a-t<=n&&a+t>=n}function l4(n,t,a){let s,l,o;for(s=0,l=n.length;s<l;s++)o=n[s][a],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function vi(n){return n*(Tt/180)}function r4(n){return n*(180/Tt)}function Ox(n){if(!kt(n))return;let t=1,a=0;for(;Math.round(n*t)/t!==n;)t*=10,a++;return a}function o4(n,t){const a=t.x-n.x,s=t.y-n.y,l=Math.sqrt(a*a+s*s);let o=Math.atan2(s,a);return o<-.5*Tt&&(o+=Mn),{angle:o,distance:l}}function Vf(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function c4(n,t){return(n-t+t4)%Mn-Tt}function Hn(n){return(n%Mn+Mn)%Mn}function Sv(n,t,a,s){const l=Hn(n),o=Hn(t),u=Hn(a),d=Hn(o-l),f=Hn(u-l),g=Hn(l-o),x=Hn(l-u);return l===o||l===u||s&&o===u||d>f&&g<x}function pn(n,t,a){return Math.max(t,Math.min(a,n))}function u4(n){return pn(n,-32768,32767)}function bs(n,t,a,s=1e-6){return n>=Math.min(t,a)-s&&n<=Math.max(t,a)+s}function Ch(n,t,a){a=a||(u=>n[u]<t);let s=n.length-1,l=0,o;for(;s-l>1;)o=l+s>>1,a(o)?l=o:s=o;return{lo:l,hi:s}}const Si=(n,t,a,s)=>Ch(n,a,s?l=>{const o=n[l][t];return o<a||o===a&&n[l+1][t]===a}:l=>n[l][t]<a),d4=(n,t,a)=>Ch(n,a,s=>n[s][t]>=a);function f4(n,t,a){let s=0,l=n.length;for(;s<l&&n[s]<t;)s++;for(;l>s&&n[l-1]>a;)l--;return s>0||l<n.length?n.slice(s,l):n}const _v=["push","pop","shift","splice","unshift"];function h4(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),_v.forEach(a=>{const s="_onData"+kh(a),l=n[a];Object.defineProperty(n,a,{configurable:!0,enumerable:!1,value(...o){const u=l.apply(this,o);return n._chartjs.listeners.forEach(d=>{typeof d[s]=="function"&&d[s](...o)}),u}})})}function Lx(n,t){const a=n._chartjs;if(!a)return;const s=a.listeners,l=s.indexOf(t);l!==-1&&s.splice(l,1),!(s.length>0)&&(_v.forEach(o=>{delete n[o]}),delete n._chartjs)}function m4(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const wv=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function jv(n,t){let a=[],s=!1;return function(...l){a=l,s||(s=!0,wv.call(window,()=>{s=!1,n.apply(t,a)}))}}function g4(n,t){let a;return function(...s){return t?(clearTimeout(a),a=setTimeout(n,t,s)):n.apply(this,s),t}}const Nv=n=>n==="start"?"left":n==="end"?"right":"center",Jt=(n,t,a)=>n==="start"?t:n==="end"?a:(t+a)/2,p4=(n,t,a,s)=>n===(s?"left":"right")?a:n==="center"?(t+a)/2:t;function x4(n,t,a){const s=t.length;let l=0,o=s;if(n._sorted){const{iScale:u,vScale:d,_parsed:f}=n,g=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,x=u.axis,{min:b,max:v,minDefined:_,maxDefined:M}=u.getUserBounds();if(_){if(l=Math.min(Si(f,x,b).lo,a?s:Si(t,x,u.getPixelForValue(b)).lo),g){const j=f.slice(0,l+1).reverse().findIndex(S=>!Fe(S[d.axis]));l-=Math.max(0,j)}l=pn(l,0,s-1)}if(M){let j=Math.max(Si(f,u.axis,v,!0).hi+1,a?0:Si(t,x,u.getPixelForValue(v),!0).hi+1);if(g){const S=f.slice(j-1).findIndex(N=>!Fe(N[d.axis]));j+=Math.max(0,S)}o=pn(j,l,s)-l}else o=s-l}return{start:l,count:o}}function b4(n){const{xScale:t,yScale:a,_scaleRanges:s}=n,l={xmin:t.min,xmax:t.max,ymin:a.min,ymax:a.max};if(!s)return n._scaleRanges=l,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==a.min||s.ymax!==a.max;return Object.assign(s,l),o}const Lo=n=>n===0||n===1,Hx=(n,t,a)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Mn/a)),Bx=(n,t,a)=>Math.pow(2,-10*n)*Math.sin((n-t)*Mn/a)+1,Fl={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*jn)+1,easeOutSine:n=>Math.sin(n*jn),easeInOutSine:n=>-.5*(Math.cos(Tt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Lo(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Lo(n)?n:Hx(n,.075,.3),easeOutElastic:n=>Lo(n)?n:Bx(n,.075,.3),easeInOutElastic(n){return Lo(n)?n:n<.5?.5*Hx(n*2,.1125,.45):.5+.5*Bx(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Fl.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Fl.easeInBounce(n*2)*.5:Fl.easeOutBounce(n*2-1)*.5+.5};function Eh(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ux(n){return Eh(n)?n:new Jl(n)}function yf(n){return Eh(n)?n:new Jl(n).saturate(.5).darken(.1).hexString()}const y4=["x","y","borderWidth","radius","tension"],v4=["color","borderColor","backgroundColor"];function S4(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:v4},numbers:{type:"number",properties:y4}}),n.describe("animations",{_fallback:"animation"}),n.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 _4(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const $x=new Map;function w4(n,t){t=t||{};const a=n+JSON.stringify(t);let s=$x.get(a);return s||(s=new Intl.NumberFormat(n,t),$x.set(a,s)),s}function Mv(n,t,a){return w4(t,a).format(n)}const j4={values(n){return vt(n)?n:""+n},numeric(n,t,a){if(n===0)return"0";const s=this.chart.options.locale;let l,o=n;if(a.length>1){const g=Math.max(Math.abs(a[0].value),Math.abs(a[a.length-1].value));(g<1e-4||g>1e15)&&(l="scientific"),o=N4(n,a)}const u=vv(Math.abs(o)),d=isNaN(u)?1:Math.max(Math.min(-1*Math.floor(u),20),0),f={notation:l,minimumFractionDigits:d,maximumFractionDigits:d};return Object.assign(f,this.options.ticks.format),Mv(n,s,f)}};function N4(n,t){let a=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(a)>=1&&n!==Math.floor(n)&&(a=n-Math.floor(n)),a}var Tv={formatters:j4};function M4(n){n.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,a)=>a.lineWidth,tickColor:(t,a)=>a.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:Tv.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ti=Object.create(null),Yf=Object.create(null);function Ql(n,t){if(!t)return n;const a=t.split(".");for(let s=0,l=a.length;s<l;++s){const o=a[s];n=n[o]||(n[o]=Object.create(null))}return n}function vf(n,t,a){return typeof t=="string"?er(Ql(n,t),a):er(Ql(n,""),t)}class T4{constructor(t,a){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=s=>s.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=(s,l)=>yf(l.backgroundColor),this.hoverBorderColor=(s,l)=>yf(l.borderColor),this.hoverColor=(s,l)=>yf(l.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(a)}set(t,a){return vf(this,t,a)}get(t){return Ql(this,t)}describe(t,a){return vf(Yf,t,a)}override(t,a){return vf(Ti,t,a)}route(t,a,s,l){const o=Ql(this,t),u=Ql(this,s),d="_"+a;Object.defineProperties(o,{[d]:{value:o[a],writable:!0},[a]:{enumerable:!0,get(){const f=this[d],g=u[l];return Re(f)?Object.assign({},g,f):ze(f,g)},set(f){this[d]=f}}})}apply(t){t.forEach(a=>a(this))}}var lt=new T4({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[S4,_4,M4]);function k4(n){return!n||Fe(n.size)||Fe(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Vx(n,t,a,s,l){let o=t[l];return o||(o=t[l]=n.measureText(l).width,a.push(l)),o>s&&(s=o),s}function gi(n,t,a){const s=n.currentDevicePixelRatio,l=a!==0?Math.max(a/2,.5):0;return Math.round((t-l)*s)/s+l}function Yx(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Gf(n,t,a,s){kv(n,t,a,s,null)}function kv(n,t,a,s,l){let o,u,d,f,g,x,b,v;const _=t.pointStyle,M=t.rotation,j=t.radius;let S=(M||0)*n4;if(_&&typeof _=="object"&&(o=_.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(a,s),n.rotate(S),n.drawImage(_,-_.width/2,-_.height/2,_.width,_.height),n.restore();return}if(!(isNaN(j)||j<=0)){switch(n.beginPath(),_){default:l?n.ellipse(a,s,l/2,j,0,0,Mn):n.arc(a,s,j,0,Mn),n.closePath();break;case"triangle":x=l?l/2:j,n.moveTo(a+Math.sin(S)*x,s-Math.cos(S)*j),S+=zx,n.lineTo(a+Math.sin(S)*x,s-Math.cos(S)*j),S+=zx,n.lineTo(a+Math.sin(S)*x,s-Math.cos(S)*j),n.closePath();break;case"rectRounded":g=j*.516,f=j-g,u=Math.cos(S+mi)*f,b=Math.cos(S+mi)*(l?l/2-g:f),d=Math.sin(S+mi)*f,v=Math.sin(S+mi)*(l?l/2-g:f),n.arc(a-b,s-d,g,S-Tt,S-jn),n.arc(a+v,s-u,g,S-jn,S),n.arc(a+b,s+d,g,S,S+jn),n.arc(a-v,s+u,g,S+jn,S+Tt),n.closePath();break;case"rect":if(!M){f=Math.SQRT1_2*j,x=l?l/2:f,n.rect(a-x,s-f,2*x,2*f);break}S+=mi;case"rectRot":b=Math.cos(S)*(l?l/2:j),u=Math.cos(S)*j,d=Math.sin(S)*j,v=Math.sin(S)*(l?l/2:j),n.moveTo(a-b,s-d),n.lineTo(a+v,s-u),n.lineTo(a+b,s+d),n.lineTo(a-v,s+u),n.closePath();break;case"crossRot":S+=mi;case"cross":b=Math.cos(S)*(l?l/2:j),u=Math.cos(S)*j,d=Math.sin(S)*j,v=Math.sin(S)*(l?l/2:j),n.moveTo(a-b,s-d),n.lineTo(a+b,s+d),n.moveTo(a+v,s-u),n.lineTo(a-v,s+u);break;case"star":b=Math.cos(S)*(l?l/2:j),u=Math.cos(S)*j,d=Math.sin(S)*j,v=Math.sin(S)*(l?l/2:j),n.moveTo(a-b,s-d),n.lineTo(a+b,s+d),n.moveTo(a+v,s-u),n.lineTo(a-v,s+u),S+=mi,b=Math.cos(S)*(l?l/2:j),u=Math.cos(S)*j,d=Math.sin(S)*j,v=Math.sin(S)*(l?l/2:j),n.moveTo(a-b,s-d),n.lineTo(a+b,s+d),n.moveTo(a+v,s-u),n.lineTo(a-v,s+u);break;case"line":u=l?l/2:Math.cos(S)*j,d=Math.sin(S)*j,n.moveTo(a-u,s-d),n.lineTo(a+u,s+d);break;case"dash":n.moveTo(a,s),n.lineTo(a+Math.cos(S)*(l?l/2:j),s+Math.sin(S)*j);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function nr(n,t,a){return a=a||.5,!t||n&&n.x>t.left-a&&n.x<t.right+a&&n.y>t.top-a&&n.y<t.bottom+a}function Bc(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Uc(n){n.restore()}function C4(n,t,a,s,l){if(!t)return n.lineTo(a.x,a.y);if(l==="middle"){const o=(t.x+a.x)/2;n.lineTo(o,t.y),n.lineTo(o,a.y)}else l==="after"!=!!s?n.lineTo(t.x,a.y):n.lineTo(a.x,t.y);n.lineTo(a.x,a.y)}function E4(n,t,a,s){if(!t)return n.lineTo(a.x,a.y);n.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?a.cp2x:a.cp1x,s?a.cp2y:a.cp1y,a.x,a.y)}function A4(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),Fe(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function D4(n,t,a,s,l){if(l.strikethrough||l.underline){const o=n.measureText(s),u=t-o.actualBoundingBoxLeft,d=t+o.actualBoundingBoxRight,f=a-o.actualBoundingBoxAscent,g=a+o.actualBoundingBoxDescent,x=l.strikethrough?(f+g)/2:g;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=l.decorationWidth||2,n.moveTo(u,x),n.lineTo(d,x),n.stroke()}}function z4(n,t){const a=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=a}function vc(n,t,a,s,l,o={}){const u=vt(t)?t:[t],d=o.strokeWidth>0&&o.strokeColor!=="";let f,g;for(n.save(),n.font=l.string,A4(n,o),f=0;f<u.length;++f)g=u[f],o.backdrop&&z4(n,o.backdrop),d&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),Fe(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(g,a,s,o.maxWidth)),n.fillText(g,a,s,o.maxWidth),D4(n,a,s,g,o),s+=Number(l.lineHeight);n.restore()}function qf(n,t){const{x:a,y:s,w:l,h:o,radius:u}=t;n.arc(a+u.topLeft,s+u.topLeft,u.topLeft,1.5*Tt,Tt,!0),n.lineTo(a,s+o-u.bottomLeft),n.arc(a+u.bottomLeft,s+o-u.bottomLeft,u.bottomLeft,Tt,jn,!0),n.lineTo(a+l-u.bottomRight,s+o),n.arc(a+l-u.bottomRight,s+o-u.bottomRight,u.bottomRight,jn,0,!0),n.lineTo(a+l,s+u.topRight),n.arc(a+l-u.topRight,s+u.topRight,u.topRight,0,-jn,!0),n.lineTo(a+u.topLeft,s)}const R4=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,O4=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function L4(n,t){const a=(""+n).match(R4);if(!a||a[1]==="normal")return t*1.2;switch(n=+a[2],a[3]){case"px":return n;case"%":n/=100;break}return t*n}const H4=n=>+n||0;function Cv(n,t){const a={},s=Re(t),l=s?Object.keys(t):t,o=Re(n)?s?u=>ze(n[u],n[t[u]]):u=>n[u]:()=>n;for(const u of l)a[u]=H4(o(u));return a}function B4(n){return Cv(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Zl(n){return Cv(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Tn(n){const t=B4(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Yt(n,t){n=n||{},t=t||lt.font;let a=ze(n.size,t.size);typeof a=="string"&&(a=parseInt(a,10));let s=ze(n.style,t.style);s&&!(""+s).match(O4)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const l={family:ze(n.family,t.family),lineHeight:L4(ze(n.lineHeight,t.lineHeight),a),size:a,style:s,weight:ze(n.weight,t.weight),string:""};return l.string=k4(l),l}function Ho(n,t,a,s){let l,o,u;for(l=0,o=n.length;l<o;++l)if(u=n[l],u!==void 0&&u!==void 0)return u}function U4(n,t,a){const{min:s,max:l}=n,o=ZM(t,(l-s)/2),u=(d,f)=>a&&d===0?0:d+f;return{min:u(s,-Math.abs(o)),max:u(l,o)}}function Ai(n,t){return Object.assign(Object.create(n),t)}function Ah(n,t=[""],a,s,l=()=>n[0]){const o=a||n;typeof s>"u"&&(s=zv("_fallback",n));const u={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:s,_getTarget:l,override:d=>Ah([d,...n],t,o,s)};return new Proxy(u,{deleteProperty(d,f){return delete d[f],delete d._keys,delete n[0][f],!0},get(d,f){return Av(d,f,()=>F4(f,t,n,d))},getOwnPropertyDescriptor(d,f){return Reflect.getOwnPropertyDescriptor(d._scopes[0],f)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(d,f){return qx(d).includes(f)},ownKeys(d){return qx(d)},set(d,f,g){const x=d._storage||(d._storage=l());return d[f]=x[f]=g,delete d._keys,!0}})}function ks(n,t,a,s){const l={_cacheable:!1,_proxy:n,_context:t,_subProxy:a,_stack:new Set,_descriptors:Ev(n,s),setContext:o=>ks(n,o,a,s),override:o=>ks(n.override(o),t,a,s)};return new Proxy(l,{deleteProperty(o,u){return delete o[u],delete n[u],!0},get(o,u,d){return Av(o,u,()=>V4(o,u,d))},getOwnPropertyDescriptor(o,u){return o._descriptors.allKeys?Reflect.has(n,u)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,u)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,u){return Reflect.has(n,u)},ownKeys(){return Reflect.ownKeys(n)},set(o,u,d){return n[u]=d,delete o[u],!0}})}function Ev(n,t={scriptable:!0,indexable:!0}){const{_scriptable:a=t.scriptable,_indexable:s=t.indexable,_allKeys:l=t.allKeys}=n;return{allKeys:l,scriptable:a,indexable:s,isScriptable:Ia(a)?a:()=>a,isIndexable:Ia(s)?s:()=>s}}const $4=(n,t)=>n?n+kh(t):t,Dh=(n,t)=>Re(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Av(n,t,a){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const s=a();return n[t]=s,s}function V4(n,t,a){const{_proxy:s,_context:l,_subProxy:o,_descriptors:u}=n;let d=s[t];return Ia(d)&&u.isScriptable(t)&&(d=Y4(t,d,n,a)),vt(d)&&d.length&&(d=G4(t,d,n,u.isIndexable)),Dh(t,d)&&(d=ks(d,l,o&&o[t],u)),d}function Y4(n,t,a,s){const{_proxy:l,_context:o,_subProxy:u,_stack:d}=a;if(d.has(n))throw new Error("Recursion detected: "+Array.from(d).join("->")+"->"+n);d.add(n);let f=t(o,u||s);return d.delete(n),Dh(n,f)&&(f=zh(l._scopes,l,n,f)),f}function G4(n,t,a,s){const{_proxy:l,_context:o,_subProxy:u,_descriptors:d}=a;if(typeof o.index<"u"&&s(n))return t[o.index%t.length];if(Re(t[0])){const f=t,g=l._scopes.filter(x=>x!==f);t=[];for(const x of f){const b=zh(g,l,n,x);t.push(ks(b,o,u&&u[n],d))}}return t}function Dv(n,t,a){return Ia(n)?n(t,a):n}const q4=(n,t)=>n===!0?t:typeof n=="string"?xc(t,n):void 0;function X4(n,t,a,s,l){for(const o of t){const u=q4(a,o);if(u){n.add(u);const d=Dv(u._fallback,a,l);if(typeof d<"u"&&d!==a&&d!==s)return d}else if(u===!1&&typeof s<"u"&&a!==s)return null}return!1}function zh(n,t,a,s){const l=t._rootScopes,o=Dv(t._fallback,a,s),u=[...n,...l],d=new Set;d.add(s);let f=Gx(d,u,a,o||a,s);return f===null||typeof o<"u"&&o!==a&&(f=Gx(d,u,o,f,s),f===null)?!1:Ah(Array.from(d),[""],l,o,()=>I4(t,a,s))}function Gx(n,t,a,s,l){for(;a;)a=X4(n,t,a,s,l);return a}function I4(n,t,a){const s=n._getTarget();t in s||(s[t]={});const l=s[t];return vt(l)&&Re(a)?a:l||{}}function F4(n,t,a,s){let l;for(const o of t)if(l=zv($4(o,n),a),typeof l<"u")return Dh(n,l)?zh(a,s,n,l):l}function zv(n,t){for(const a of t){if(!a)continue;const s=a[n];if(typeof s<"u")return s}}function qx(n){let t=n._keys;return t||(t=n._keys=Q4(n._scopes)),t}function Q4(n){const t=new Set;for(const a of n)for(const s of Object.keys(a).filter(l=>!l.startsWith("_")))t.add(s);return Array.from(t)}const Z4=Number.EPSILON||1e-14,Cs=(n,t)=>t<n.length&&!n[t].skip&&n[t],Rv=n=>n==="x"?"y":"x";function K4(n,t,a,s){const l=n.skip?t:n,o=t,u=a.skip?t:a,d=Vf(o,l),f=Vf(u,o);let g=d/(d+f),x=f/(d+f);g=isNaN(g)?0:g,x=isNaN(x)?0:x;const b=s*g,v=s*x;return{previous:{x:o.x-b*(u.x-l.x),y:o.y-b*(u.y-l.y)},next:{x:o.x+v*(u.x-l.x),y:o.y+v*(u.y-l.y)}}}function P4(n,t,a){const s=n.length;let l,o,u,d,f,g=Cs(n,0);for(let x=0;x<s-1;++x)if(f=g,g=Cs(n,x+1),!(!f||!g)){if(Il(t[x],0,Z4)){a[x]=a[x+1]=0;continue}l=a[x]/t[x],o=a[x+1]/t[x],d=Math.pow(l,2)+Math.pow(o,2),!(d<=9)&&(u=3/Math.sqrt(d),a[x]=l*u*t[x],a[x+1]=o*u*t[x])}}function W4(n,t,a="x"){const s=Rv(a),l=n.length;let o,u,d,f=Cs(n,0);for(let g=0;g<l;++g){if(u=d,d=f,f=Cs(n,g+1),!d)continue;const x=d[a],b=d[s];u&&(o=(x-u[a])/3,d[`cp1${a}`]=x-o,d[`cp1${s}`]=b-o*t[g]),f&&(o=(f[a]-x)/3,d[`cp2${a}`]=x+o,d[`cp2${s}`]=b+o*t[g])}}function J4(n,t="x"){const a=Rv(t),s=n.length,l=Array(s).fill(0),o=Array(s);let u,d,f,g=Cs(n,0);for(u=0;u<s;++u)if(d=f,f=g,g=Cs(n,u+1),!!f){if(g){const x=g[t]-f[t];l[u]=x!==0?(g[a]-f[a])/x:0}o[u]=d?g?Ts(l[u-1])!==Ts(l[u])?0:(l[u-1]+l[u])/2:l[u-1]:l[u]}P4(n,l,o),W4(n,o,t)}function Bo(n,t,a){return Math.max(Math.min(n,a),t)}function e3(n,t){let a,s,l,o,u,d=nr(n[0],t);for(a=0,s=n.length;a<s;++a)u=o,o=d,d=a<s-1&&nr(n[a+1],t),o&&(l=n[a],u&&(l.cp1x=Bo(l.cp1x,t.left,t.right),l.cp1y=Bo(l.cp1y,t.top,t.bottom)),d&&(l.cp2x=Bo(l.cp2x,t.left,t.right),l.cp2y=Bo(l.cp2y,t.top,t.bottom)))}function t3(n,t,a,s,l){let o,u,d,f;if(t.spanGaps&&(n=n.filter(g=>!g.skip)),t.cubicInterpolationMode==="monotone")J4(n,l);else{let g=s?n[n.length-1]:n[0];for(o=0,u=n.length;o<u;++o)d=n[o],f=K4(g,d,n[Math.min(o+1,u-(s?0:1))%u],t.tension),d.cp1x=f.previous.x,d.cp1y=f.previous.y,d.cp2x=f.next.x,d.cp2y=f.next.y,g=d}t.capBezierPoints&&e3(n,a)}function Rh(){return typeof window<"u"&&typeof document<"u"}function Oh(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Sc(n,t,a){let s;return typeof n=="string"?(s=parseInt(n,10),n.indexOf("%")!==-1&&(s=s/100*t.parentNode[a])):s=n,s}const $c=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function n3(n,t){return $c(n).getPropertyValue(t)}const a3=["top","right","bottom","left"];function ji(n,t,a){const s={};a=a?"-"+a:"";for(let l=0;l<4;l++){const o=a3[l];s[o]=parseFloat(n[t+"-"+o+a])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const i3=(n,t,a)=>(n>0||t>0)&&(!a||!a.shadowRoot);function s3(n,t){const a=n.touches,s=a&&a.length?a[0]:n,{offsetX:l,offsetY:o}=s;let u=!1,d,f;if(i3(l,o,n.target))d=l,f=o;else{const g=t.getBoundingClientRect();d=s.clientX-g.left,f=s.clientY-g.top,u=!0}return{x:d,y:f,box:u}}function xi(n,t){if("native"in n)return n;const{canvas:a,currentDevicePixelRatio:s}=t,l=$c(a),o=l.boxSizing==="border-box",u=ji(l,"padding"),d=ji(l,"border","width"),{x:f,y:g,box:x}=s3(n,a),b=u.left+(x&&d.left),v=u.top+(x&&d.top);let{width:_,height:M}=t;return o&&(_-=u.width+d.width,M-=u.height+d.height),{x:Math.round((f-b)/_*a.width/s),y:Math.round((g-v)/M*a.height/s)}}function l3(n,t,a){let s,l;if(t===void 0||a===void 0){const o=n&&Oh(n);if(!o)t=n.clientWidth,a=n.clientHeight;else{const u=o.getBoundingClientRect(),d=$c(o),f=ji(d,"border","width"),g=ji(d,"padding");t=u.width-g.width-f.width,a=u.height-g.height-f.height,s=Sc(d.maxWidth,o,"clientWidth"),l=Sc(d.maxHeight,o,"clientHeight")}}return{width:t,height:a,maxWidth:s||yc,maxHeight:l||yc}}const $a=n=>Math.round(n*10)/10;function r3(n,t,a,s){const l=$c(n),o=ji(l,"margin"),u=Sc(l.maxWidth,n,"clientWidth")||yc,d=Sc(l.maxHeight,n,"clientHeight")||yc,f=l3(n,t,a);let{width:g,height:x}=f;if(l.boxSizing==="content-box"){const v=ji(l,"border","width"),_=ji(l,"padding");g-=_.width+v.width,x-=_.height+v.height}return g=Math.max(0,g-o.width),x=Math.max(0,s?g/s:x-o.height),g=$a(Math.min(g,u,f.maxWidth)),x=$a(Math.min(x,d,f.maxHeight)),g&&!x&&(x=$a(g/2)),(t!==void 0||a!==void 0)&&s&&f.height&&x>f.height&&(x=f.height,g=$a(Math.floor(x*s))),{width:g,height:x}}function Xx(n,t,a){const s=t||1,l=$a(n.height*s),o=$a(n.width*s);n.height=$a(n.height),n.width=$a(n.width);const u=n.canvas;return u.style&&(a||!u.style.height&&!u.style.width)&&(u.style.height=`${n.height}px`,u.style.width=`${n.width}px`),n.currentDevicePixelRatio!==s||u.height!==l||u.width!==o?(n.currentDevicePixelRatio=s,u.height=l,u.width=o,n.ctx.setTransform(s,0,0,s,0,0),!0):!1}const o3=(function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Rh()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function Ix(n,t){const a=n3(n,t),s=a&&a.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function bi(n,t,a,s){return{x:n.x+a*(t.x-n.x),y:n.y+a*(t.y-n.y)}}function c3(n,t,a,s){return{x:n.x+a*(t.x-n.x),y:s==="middle"?a<.5?n.y:t.y:s==="after"?a<1?n.y:t.y:a>0?t.y:n.y}}function u3(n,t,a,s){const l={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},u=bi(n,l,a),d=bi(l,o,a),f=bi(o,t,a),g=bi(u,d,a),x=bi(d,f,a);return bi(g,x,a)}const d3=function(n,t){return{x(a){return n+n+t-a},setWidth(a){t=a},textAlign(a){return a==="center"?a:a==="right"?"left":"right"},xPlus(a,s){return a-s},leftForLtr(a,s){return a-s}}},f3=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function _s(n,t,a){return n?d3(t,a):f3()}function Ov(n,t){let a,s;(t==="ltr"||t==="rtl")&&(a=n.canvas.style,s=[a.getPropertyValue("direction"),a.getPropertyPriority("direction")],a.setProperty("direction",t,"important"),n.prevTextDirection=s)}function Lv(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Hv(n){return n==="angle"?{between:Sv,compare:c4,normalize:Hn}:{between:bs,compare:(t,a)=>t-a,normalize:t=>t}}function Fx({start:n,end:t,count:a,loop:s,style:l}){return{start:n%a,end:t%a,loop:s&&(t-n+1)%a===0,style:l}}function h3(n,t,a){const{property:s,start:l,end:o}=a,{between:u,normalize:d}=Hv(s),f=t.length;let{start:g,end:x,loop:b}=n,v,_;if(b){for(g+=f,x+=f,v=0,_=f;v<_&&u(d(t[g%f][s]),l,o);++v)g--,x--;g%=f,x%=f}return x<g&&(x+=f),{start:g,end:x,loop:b,style:n.style}}function Bv(n,t,a){if(!a)return[n];const{property:s,start:l,end:o}=a,u=t.length,{compare:d,between:f,normalize:g}=Hv(s),{start:x,end:b,loop:v,style:_}=h3(n,t,a),M=[];let j=!1,S=null,N,C,k;const E=()=>f(l,k,N)&&d(l,k)!==0,A=()=>d(o,N)===0||f(o,k,N),z=()=>j||E(),L=()=>!j||A();for(let R=x,X=x;R<=b;++R)C=t[R%u],!C.skip&&(N=g(C[s]),N!==k&&(j=f(N,l,o),S===null&&z()&&(S=d(N,l)===0?R:X),S!==null&&L()&&(M.push(Fx({start:S,end:R,loop:v,count:u,style:_})),S=null),X=R,k=N));return S!==null&&M.push(Fx({start:S,end:b,loop:v,count:u,style:_})),M}function Uv(n,t){const a=[],s=n.segments;for(let l=0;l<s.length;l++){const o=Bv(s[l],n.points,t);o.length&&a.push(...o)}return a}function m3(n,t,a,s){let l=0,o=t-1;if(a&&!s)for(;l<t&&!n[l].skip;)l++;for(;l<t&&n[l].skip;)l++;for(l%=t,a&&(o+=l);o>l&&n[o%t].skip;)o--;return o%=t,{start:l,end:o}}function g3(n,t,a,s){const l=n.length,o=[];let u=t,d=n[t],f;for(f=t+1;f<=a;++f){const g=n[f%l];g.skip||g.stop?d.skip||(s=!1,o.push({start:t%l,end:(f-1)%l,loop:s}),t=u=g.stop?f:null):(u=f,d.skip&&(t=f)),d=g}return u!==null&&o.push({start:t%l,end:u%l,loop:s}),o}function p3(n,t){const a=n.points,s=n.options.spanGaps,l=a.length;if(!l)return[];const o=!!n._loop,{start:u,end:d}=m3(a,l,o,s);if(s===!0)return Qx(n,[{start:u,end:d,loop:o}],a,t);const f=d<u?d+l:d,g=!!n._fullLoop&&u===0&&d===l-1;return Qx(n,g3(a,u,f,g),a,t)}function Qx(n,t,a,s){return!s||!s.setContext||!a?t:x3(n,t,a,s)}function x3(n,t,a,s){const l=n._chart.getContext(),o=Zx(n.options),{_datasetIndex:u,options:{spanGaps:d}}=n,f=a.length,g=[];let x=o,b=t[0].start,v=b;function _(M,j,S,N){const C=d?-1:1;if(M!==j){for(M+=f;a[M%f].skip;)M-=C;for(;a[j%f].skip;)j+=C;M%f!==j%f&&(g.push({start:M%f,end:j%f,loop:S,style:N}),x=N,b=j%f)}}for(const M of t){b=d?b:M.start;let j=a[b%f],S;for(v=b+1;v<=M.end;v++){const N=a[v%f];S=Zx(s.setContext(Ai(l,{type:"segment",p0:j,p1:N,p0DataIndex:(v-1)%f,p1DataIndex:v%f,datasetIndex:u}))),b3(S,x)&&_(b,v-1,M.loop,x),j=N,x=S}b<v-1&&_(b,v-1,M.loop,x)}return g}function Zx(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function b3(n,t){if(!t)return!1;const a=[],s=function(l,o){return Eh(o)?(a.includes(o)||a.push(o),a.indexOf(o)):o};return JSON.stringify(n,s)!==JSON.stringify(t,s)}function Uo(n,t,a){return n.options.clip?n[a]:t[a]}function y3(n,t){const{xScale:a,yScale:s}=n;return a&&s?{left:Uo(a,t,"left"),right:Uo(a,t,"right"),top:Uo(s,t,"top"),bottom:Uo(s,t,"bottom")}:t}function $v(n,t){const a=t._clip;if(a.disabled)return!1;const s=y3(t,n.chartArea);return{left:a.left===!1?0:s.left-(a.left===!0?0:a.left),right:a.right===!1?n.width:s.right+(a.right===!0?0:a.right),top:a.top===!1?0:s.top-(a.top===!0?0:a.top),bottom:a.bottom===!1?n.height:s.bottom+(a.bottom===!0?0:a.bottom)}}/*!
* Chart.js v4.5.1
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*/class v3{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,a,s,l){const o=a.listeners[l],u=a.duration;o.forEach(d=>d({chart:t,initial:a.initial,numSteps:u,currentStep:Math.min(s-a.start,u)}))}_refresh(){this._request||(this._running=!0,this._request=wv.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let a=0;this._charts.forEach((s,l)=>{if(!s.running||!s.items.length)return;const o=s.items;let u=o.length-1,d=!1,f;for(;u>=0;--u)f=o[u],f._active?(f._total>s.duration&&(s.duration=f._total),f.tick(t),d=!0):(o[u]=o[o.length-1],o.pop());d&&(l.draw(),this._notify(l,s,t,"progress")),o.length||(s.running=!1,this._notify(l,s,t,"complete"),s.initial=!1),a+=o.length}),this._lastDate=t,a===0&&(this._running=!1)}_getAnims(t){const a=this._charts;let s=a.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},a.set(t,s)),s}listen(t,a,s){this._getAnims(t).listeners[a].push(s)}add(t,a){!a||!a.length||this._getAnims(t).items.push(...a)}has(t){return this._getAnims(t).items.length>0}start(t){const a=this._charts.get(t);a&&(a.running=!0,a.start=Date.now(),a.duration=a.items.reduce((s,l)=>Math.max(s,l._duration),0),this._refresh())}running(t){if(!this._running)return!1;const a=this._charts.get(t);return!(!a||!a.running||!a.items.length)}stop(t){const a=this._charts.get(t);if(!a||!a.items.length)return;const s=a.items;let l=s.length-1;for(;l>=0;--l)s[l].cancel();a.items=[],this._notify(t,a,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var la=new v3;const Kx="transparent",S3={boolean(n,t,a){return a>.5?t:n},color(n,t,a){const s=Ux(n||Kx),l=s.valid&&Ux(t||Kx);return l&&l.valid?l.mix(s,a).hexString():t},number(n,t,a){return n+(t-n)*a}};class _3{constructor(t,a,s,l){const o=a[s];l=Ho([t.to,l,o,t.from]);const u=Ho([t.from,o,l]);this._active=!0,this._fn=t.fn||S3[t.type||typeof u],this._easing=Fl[t.easing]||Fl.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=a,this._prop=s,this._from=u,this._to=l,this._promises=void 0}active(){return this._active}update(t,a,s){if(this._active){this._notify(!1);const l=this._target[this._prop],o=s-this._start,u=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(u,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ho([t.to,a,l,t.from]),this._from=Ho([t.from,l,a])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const a=t-this._start,s=this._duration,l=this._prop,o=this._from,u=this._loop,d=this._to;let f;if(this._active=o!==d&&(u||a<s),!this._active){this._target[l]=d,this._notify(!0);return}if(a<0){this._target[l]=o;return}f=a/s%2,f=u&&f>1?2-f:f,f=this._easing(Math.min(1,Math.max(0,f))),this._target[l]=this._fn(o,d,f)}wait(){const t=this._promises||(this._promises=[]);return new Promise((a,s)=>{t.push({res:a,rej:s})})}_notify(t){const a=t?"res":"rej",s=this._promises||[];for(let l=0;l<s.length;l++)s[l][a]()}}class Vv{constructor(t,a){this._chart=t,this._properties=new Map,this.configure(a)}configure(t){if(!Re(t))return;const a=Object.keys(lt.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(l=>{const o=t[l];if(!Re(o))return;const u={};for(const d of a)u[d]=o[d];(vt(o.properties)&&o.properties||[l]).forEach(d=>{(d===l||!s.has(d))&&s.set(d,u)})})}_animateOptions(t,a){const s=a.options,l=j3(t,s);if(!l)return[];const o=this._createAnimations(l,s);return s.$shared&&w3(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,a){const s=this._properties,l=[],o=t.$animations||(t.$animations={}),u=Object.keys(a),d=Date.now();let f;for(f=u.length-1;f>=0;--f){const g=u[f];if(g.charAt(0)==="$")continue;if(g==="options"){l.push(...this._animateOptions(t,a));continue}const x=a[g];let b=o[g];const v=s.get(g);if(b)if(v&&b.active()){b.update(v,x,d);continue}else b.cancel();if(!v||!v.duration){t[g]=x;continue}o[g]=b=new _3(v,t,g,x),l.push(b)}return l}update(t,a){if(this._properties.size===0){Object.assign(t,a);return}const s=this._createAnimations(t,a);if(s.length)return la.add(this._chart,s),!0}}function w3(n,t){const a=[],s=Object.keys(t);for(let l=0;l<s.length;l++){const o=n[s[l]];o&&o.active()&&a.push(o.wait())}return Promise.all(a)}function j3(n,t){if(!t)return;let a=n.options;if(!a){n.options=t;return}return a.$shared&&(n.options=a=Object.assign({},a,{$shared:!1,$animations:{}})),a}function Px(n,t){const a=n&&n.options||{},s=a.reverse,l=a.min===void 0?t:0,o=a.max===void 0?t:0;return{start:s?o:l,end:s?l:o}}function N3(n,t,a){if(a===!1)return!1;const s=Px(n,a),l=Px(t,a);return{top:l.end,right:s.end,bottom:l.start,left:s.start}}function M3(n){let t,a,s,l;return Re(n)?(t=n.top,a=n.right,s=n.bottom,l=n.left):t=a=s=l=n,{top:t,right:a,bottom:s,left:l,disabled:n===!1}}function Yv(n,t){const a=[],s=n._getSortedDatasetMetas(t);let l,o;for(l=0,o=s.length;l<o;++l)a.push(s[l].index);return a}function Wx(n,t,a,s={}){const l=n.keys,o=s.mode==="single";let u,d,f,g;if(t===null)return;let x=!1;for(u=0,d=l.length;u<d;++u){if(f=+l[u],f===a){if(x=!0,s.all)continue;break}g=n.values[f],kt(g)&&(o||t===0||Ts(t)===Ts(g))&&(t+=g)}return!x&&!s.all?0:t}function T3(n,t){const{iScale:a,vScale:s}=t,l=a.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",u=Object.keys(n),d=new Array(u.length);let f,g,x;for(f=0,g=u.length;f<g;++f)x=u[f],d[f]={[l]:x,[o]:n[x]};return d}function Sf(n,t){const a=n&&n.options.stacked;return a||a===void 0&&t.stack!==void 0}function k3(n,t,a){return`${n.id}.${t.id}.${a.stack||a.type}`}function C3(n){const{min:t,max:a,minDefined:s,maxDefined:l}=n.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:l?a:Number.POSITIVE_INFINITY}}function E3(n,t,a){const s=n[t]||(n[t]={});return s[a]||(s[a]={})}function Jx(n,t,a,s){for(const l of t.getMatchingVisibleMetas(s).reverse()){const o=n[l.index];if(a&&o>0||!a&&o<0)return l.index}return null}function eb(n,t){const{chart:a,_cachedMeta:s}=n,l=a._stacks||(a._stacks={}),{iScale:o,vScale:u,index:d}=s,f=o.axis,g=u.axis,x=k3(o,u,s),b=t.length;let v;for(let _=0;_<b;++_){const M=t[_],{[f]:j,[g]:S}=M,N=M._stacks||(M._stacks={});v=N[g]=E3(l,x,j),v[d]=S,v._top=Jx(v,u,!0,s.type),v._bottom=Jx(v,u,!1,s.type);const C=v._visualValues||(v._visualValues={});C[d]=S}}function _f(n,t){const a=n.scales;return Object.keys(a).filter(s=>a[s].axis===t).shift()}function A3(n,t){return Ai(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function D3(n,t,a){return Ai(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:a,index:t,mode:"default",type:"data"})}function Hl(n,t){const a=n.controller.index,s=n.vScale&&n.vScale.axis;if(s){t=t||n._parsed;for(const l of t){const o=l._stacks;if(!o||o[s]===void 0||o[s][a]===void 0)return;delete o[s][a],o[s]._visualValues!==void 0&&o[s]._visualValues[a]!==void 0&&delete o[s]._visualValues[a]}}}const wf=n=>n==="reset"||n==="none",tb=(n,t)=>t?n:Object.assign({},n),z3=(n,t,a)=>n&&!t.hidden&&t._stacked&&{keys:Yv(a,!0),values:null};class Kl{constructor(t,a){this.chart=t,this._ctx=t.ctx,this.index=a,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=Sf(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&&Hl(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,a=this._cachedMeta,s=this.getDataset(),l=(b,v,_,M)=>b==="x"?v:b==="r"?M:_,o=a.xAxisID=ze(s.xAxisID,_f(t,"x")),u=a.yAxisID=ze(s.yAxisID,_f(t,"y")),d=a.rAxisID=ze(s.rAxisID,_f(t,"r")),f=a.indexAxis,g=a.iAxisID=l(f,o,u,d),x=a.vAxisID=l(f,u,o,d);a.xScale=this.getScaleForId(o),a.yScale=this.getScaleForId(u),a.rScale=this.getScaleForId(d),a.iScale=this.getScaleForId(g),a.vScale=this.getScaleForId(x)}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 a=this._cachedMeta;return t===a.iScale?a.vScale:a.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Lx(this._data,this),t._stacked&&Hl(t)}_dataCheck(){const t=this.getDataset(),a=t.data||(t.data=[]),s=this._data;if(Re(a)){const l=this._cachedMeta;this._data=T3(a,l)}else if(s!==a){if(s){Lx(s,this);const l=this._cachedMeta;Hl(l),l._parsed=[]}a&&Object.isExtensible(a)&&h4(a,this),this._syncList=[],this._data=a}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const a=this._cachedMeta,s=this.getDataset();let l=!1;this._dataCheck();const o=a._stacked;a._stacked=Sf(a.vScale,a),a.stack!==s.stack&&(l=!0,Hl(a),a.stack=s.stack),this._resyncElements(t),(l||o!==a._stacked)&&(eb(this,a._parsed),a._stacked=Sf(a.vScale,a))}configure(){const t=this.chart.config,a=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),a,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,a){const{_cachedMeta:s,_data:l}=this,{iScale:o,_stacked:u}=s,d=o.axis;let f=t===0&&a===l.length?!0:s._sorted,g=t>0&&s._parsed[t-1],x,b,v;if(this._parsing===!1)s._parsed=l,s._sorted=!0,v=l;else{vt(l[t])?v=this.parseArrayData(s,l,t,a):Re(l[t])?v=this.parseObjectData(s,l,t,a):v=this.parsePrimitiveData(s,l,t,a);const _=()=>b[d]===null||g&&b[d]<g[d];for(x=0;x<a;++x)s._parsed[x+t]=b=v[x],f&&(_()&&(f=!1),g=b);s._sorted=f}u&&eb(this,v)}parsePrimitiveData(t,a,s,l){const{iScale:o,vScale:u}=t,d=o.axis,f=u.axis,g=o.getLabels(),x=o===u,b=new Array(l);let v,_,M;for(v=0,_=l;v<_;++v)M=v+s,b[v]={[d]:x||o.parse(g[M],M),[f]:u.parse(a[M],M)};return b}parseArrayData(t,a,s,l){const{xScale:o,yScale:u}=t,d=new Array(l);let f,g,x,b;for(f=0,g=l;f<g;++f)x=f+s,b=a[x],d[f]={x:o.parse(b[0],x),y:u.parse(b[1],x)};return d}parseObjectData(t,a,s,l){const{xScale:o,yScale:u}=t,{xAxisKey:d="x",yAxisKey:f="y"}=this._parsing,g=new Array(l);let x,b,v,_;for(x=0,b=l;x<b;++x)v=x+s,_=a[v],g[x]={x:o.parse(xc(_,d),v),y:u.parse(xc(_,f),v)};return g}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,a,s){const l=this.chart,o=this._cachedMeta,u=a[t.axis],d={keys:Yv(l,!0),values:a._stacks[t.axis]._visualValues};return Wx(d,u,o.index,{mode:s})}updateRangeFromParsed(t,a,s,l){const o=s[a.axis];let u=o===null?NaN:o;const d=l&&s._stacks[a.axis];l&&d&&(l.values=d,u=Wx(l,o,this._cachedMeta.index)),t.min=Math.min(t.min,u),t.max=Math.max(t.max,u)}getMinMax(t,a){const s=this._cachedMeta,l=s._parsed,o=s._sorted&&t===s.iScale,u=l.length,d=this._getOtherScale(t),f=z3(a,s,this.chart),g={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:x,max:b}=C3(d);let v,_;function M(){_=l[v];const j=_[d.axis];return!kt(_[t.axis])||x>j||b<j}for(v=0;v<u&&!(!M()&&(this.updateRangeFromParsed(g,t,_,f),o));++v);if(o){for(v=u-1;v>=0;--v)if(!M()){this.updateRangeFromParsed(g,t,_,f);break}}return g}getAllParsedValues(t){const a=this._cachedMeta._parsed,s=[];let l,o,u;for(l=0,o=a.length;l<o;++l)u=a[l][t.axis],kt(u)&&s.push(u);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const a=this._cachedMeta,s=a.iScale,l=a.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:l?""+l.getLabelForValue(o[l.axis]):""}}_update(t){const a=this._cachedMeta;this.update(t||"default"),a._clip=M3(ze(this.options.clip,N3(a.xScale,a.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,a=this.chart,s=this._cachedMeta,l=s.data||[],o=a.chartArea,u=[],d=this._drawStart||0,f=this._drawCount||l.length-d,g=this.options.drawActiveElementsOnTop;let x;for(s.dataset&&s.dataset.draw(t,o,d,f),x=d;x<d+f;++x){const b=l[x];b.hidden||(b.active&&g?u.push(b):b.draw(t,o))}for(x=0;x<u.length;++x)u[x].draw(t,o)}getStyle(t,a){const s=a?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,a,s){const l=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const u=this._cachedMeta.data[t];o=u.$context||(u.$context=D3(this.getContext(),t,u)),o.parsed=this.getParsed(t),o.raw=l.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=A3(this.chart.getContext(),this.index)),o.dataset=l,o.index=o.datasetIndex=this.index;return o.active=!!a,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,a){return this._resolveElementOptions(this.dataElementType.id,a,t)}_resolveElementOptions(t,a="default",s){const l=a==="active",o=this._cachedDataOpts,u=t+"-"+a,d=o[u],f=this.enableOptionSharing&&bc(s);if(d)return tb(d,f);const g=this.chart.config,x=g.datasetElementScopeKeys(this._type,t),b=l?[`${t}Hover`,"hover",t,""]:[t,""],v=g.getOptionScopes(this.getDataset(),x),_=Object.keys(lt.elements[t]),M=()=>this.getContext(s,l,a),j=g.resolveNamedOptions(v,_,M,b);return j.$shared&&(j.$shared=f,o[u]=Object.freeze(tb(j,f))),j}_resolveAnimations(t,a,s){const l=this.chart,o=this._cachedDataOpts,u=`animation-${a}`,d=o[u];if(d)return d;let f;if(l.options.animation!==!1){const x=this.chart.config,b=x.datasetAnimationScopeKeys(this._type,a),v=x.getOptionScopes(this.getDataset(),b);f=x.createResolver(v,this.getContext(t,s,a))}const g=new Vv(l,f&&f.animations);return f&&f._cacheable&&(o[u]=Object.freeze(g)),g}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,a){return!a||wf(t)||this.chart._animationsDisabled}_getSharedOptions(t,a){const s=this.resolveDataElementOptions(t,a),l=this._sharedOptions,o=this.getSharedOptions(s),u=this.includeOptions(a,o)||o!==l;return this.updateSharedOptions(o,a,s),{sharedOptions:o,includeOptions:u}}updateElement(t,a,s,l){wf(l)?Object.assign(t,s):this._resolveAnimations(a,l).update(t,s)}updateSharedOptions(t,a,s){t&&!wf(a)&&this._resolveAnimations(void 0,a).update(t,s)}_setStyle(t,a,s,l){t.active=l;const o=this.getStyle(a,l);this._resolveAnimations(a,s,l).update(t,{options:!l&&this.getSharedOptions(o)||o})}removeHoverStyle(t,a,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,a,s){this._setStyle(t,s,"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 a=this._data,s=this._cachedMeta.data;for(const[d,f,g]of this._syncList)this[d](f,g);this._syncList=[];const l=s.length,o=a.length,u=Math.min(o,l);u&&this.parse(0,u),o>l?this._insertElements(l,o-l,t):o<l&&this._removeElements(o,l-o)}_insertElements(t,a,s=!0){const l=this._cachedMeta,o=l.data,u=t+a;let d;const f=g=>{for(g.length+=a,d=g.length-1;d>=u;d--)g[d]=g[d-a]};for(f(o),d=t;d<u;++d)o[d]=new this.dataElementType;this._parsing&&f(l._parsed),this.parse(t,a),s&&this.updateElements(o,t,a,"reset")}updateElements(t,a,s,l){}_removeElements(t,a){const s=this._cachedMeta;if(this._parsing){const l=s._parsed.splice(t,a);s._stacked&&Hl(s,l)}s.data.splice(t,a)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[a,s,l]=t;this[a](s,l)}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,a){a&&this._sync(["_removeElements",t,a]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}_e(Kl,"defaults",{}),_e(Kl,"datasetElementType",null),_e(Kl,"dataElementType",null);class ec extends Kl{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const a=this._cachedMeta,{dataset:s,data:l=[],_dataset:o}=a,u=this.chart._animationsDisabled;let{start:d,count:f}=x4(a,l,u);this._drawStart=d,this._drawCount=f,b4(a)&&(d=0,f=l.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=l;const g=this.resolveDatasetElementOptions(t);this.options.showLine||(g.borderWidth=0),g.segment=this.options.segment,this.updateElement(s,void 0,{animated:!u,options:g},t),this.updateElements(l,d,f,t)}updateElements(t,a,s,l){const o=l==="reset",{iScale:u,vScale:d,_stacked:f,_dataset:g}=this._cachedMeta,{sharedOptions:x,includeOptions:b}=this._getSharedOptions(a,l),v=u.axis,_=d.axis,{spanGaps:M,segment:j}=this.options,S=tr(M)?M:Number.POSITIVE_INFINITY,N=this.chart._animationsDisabled||o||l==="none",C=a+s,k=t.length;let E=a>0&&this.getParsed(a-1);for(let A=0;A<k;++A){const z=t[A],L=N?z:{};if(A<a||A>=C){L.skip=!0;continue}const R=this.getParsed(A),X=Fe(R[_]),de=L[v]=u.getPixelForValue(R[v],A),Q=L[_]=o||X?d.getBasePixel():d.getPixelForValue(f?this.applyStack(d,R,f):R[_],A);L.skip=isNaN(de)||isNaN(Q)||X,L.stop=A>0&&Math.abs(R[v]-E[v])>S,j&&(L.parsed=R,L.raw=g.data[A]),b&&(L.options=x||this.resolveDataElementOptions(A,z.active?"active":l)),N||this.updateElement(z,A,L,l),E=R}}getMaxOverflow(){const t=this._cachedMeta,a=t.dataset,s=a.options&&a.options.borderWidth||0,l=t.data||[];if(!l.length)return s;const o=l[0].size(this.resolveDataElementOptions(0)),u=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(s,o,u)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}_e(ec,"id","line"),_e(ec,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),_e(ec,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function pi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Lh{constructor(t){_e(this,"options");this.options=t||{}}static override(t){Object.assign(Lh.prototype,t)}init(){}formats(){return pi()}parse(){return pi()}format(){return pi()}add(){return pi()}diff(){return pi()}startOf(){return pi()}endOf(){return pi()}}var R3={_date:Lh};function O3(n,t,a,s){const{controller:l,data:o,_sorted:u}=n,d=l._cachedMeta.iScale,f=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(d&&t===d.axis&&t!=="r"&&u&&o.length){const g=d._reversePixels?d4:Si;if(s){if(l._sharedOptions){const x=o[0],b=typeof x.getRange=="function"&&x.getRange(t);if(b){const v=g(o,t,a-b),_=g(o,t,a+b);return{lo:v.lo,hi:_.hi}}}}else{const x=g(o,t,a);if(f){const{vScale:b}=l._cachedMeta,{_parsed:v}=n,_=v.slice(0,x.lo+1).reverse().findIndex(j=>!Fe(j[b.axis]));x.lo-=Math.max(0,_);const M=v.slice(x.hi).findIndex(j=>!Fe(j[b.axis]));x.hi+=Math.max(0,M)}return x}}return{lo:0,hi:o.length-1}}function Vc(n,t,a,s,l){const o=n.getSortedVisibleDatasetMetas(),u=a[t];for(let d=0,f=o.length;d<f;++d){const{index:g,data:x}=o[d],{lo:b,hi:v}=O3(o[d],t,u,l);for(let _=b;_<=v;++_){const M=x[_];M.skip||s(M,g,_)}}}function L3(n){const t=n.indexOf("x")!==-1,a=n.indexOf("y")!==-1;return function(s,l){const o=t?Math.abs(s.x-l.x):0,u=a?Math.abs(s.y-l.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(u,2))}}function jf(n,t,a,s,l){const o=[];return!l&&!n.isPointInArea(t)||Vc(n,a,t,function(d,f,g){!l&&!nr(d,n.chartArea,0)||d.inRange(t.x,t.y,s)&&o.push({element:d,datasetIndex:f,index:g})},!0),o}function H3(n,t,a,s){let l=[];function o(u,d,f){const{startAngle:g,endAngle:x}=u.getProps(["startAngle","endAngle"],s),{angle:b}=o4(u,{x:t.x,y:t.y});Sv(b,g,x)&&l.push({element:u,datasetIndex:d,index:f})}return Vc(n,a,t,o),l}function B3(n,t,a,s,l,o){let u=[];const d=L3(a);let f=Number.POSITIVE_INFINITY;function g(x,b,v){const _=x.inRange(t.x,t.y,l);if(s&&!_)return;const M=x.getCenterPoint(l);if(!(!!o||n.isPointInArea(M))&&!_)return;const S=d(t,M);S<f?(u=[{element:x,datasetIndex:b,index:v}],f=S):S===f&&u.push({element:x,datasetIndex:b,index:v})}return Vc(n,a,t,g),u}function Nf(n,t,a,s,l,o){return!o&&!n.isPointInArea(t)?[]:a==="r"&&!s?H3(n,t,a,l):B3(n,t,a,s,l,o)}function nb(n,t,a,s,l){const o=[],u=a==="x"?"inXRange":"inYRange";let d=!1;return Vc(n,a,t,(f,g,x)=>{f[u]&&f[u](t[a],l)&&(o.push({element:f,datasetIndex:g,index:x}),d=d||f.inRange(t.x,t.y,l))}),s&&!d?[]:o}var U3={modes:{index(n,t,a,s){const l=xi(t,n),o=a.axis||"x",u=a.includeInvisible||!1,d=a.intersect?jf(n,l,o,s,u):Nf(n,l,o,!1,s,u),f=[];return d.length?(n.getSortedVisibleDatasetMetas().forEach(g=>{const x=d[0].index,b=g.data[x];b&&!b.skip&&f.push({element:b,datasetIndex:g.index,index:x})}),f):[]},dataset(n,t,a,s){const l=xi(t,n),o=a.axis||"xy",u=a.includeInvisible||!1;let d=a.intersect?jf(n,l,o,s,u):Nf(n,l,o,!1,s,u);if(d.length>0){const f=d[0].datasetIndex,g=n.getDatasetMeta(f).data;d=[];for(let x=0;x<g.length;++x)d.push({element:g[x],datasetIndex:f,index:x})}return d},point(n,t,a,s){const l=xi(t,n),o=a.axis||"xy",u=a.includeInvisible||!1;return jf(n,l,o,s,u)},nearest(n,t,a,s){const l=xi(t,n),o=a.axis||"xy",u=a.includeInvisible||!1;return Nf(n,l,o,a.intersect,s,u)},x(n,t,a,s){const l=xi(t,n);return nb(n,l,"x",a.intersect,s)},y(n,t,a,s){const l=xi(t,n);return nb(n,l,"y",a.intersect,s)}}};const Gv=["left","top","right","bottom"];function Bl(n,t){return n.filter(a=>a.pos===t)}function ab(n,t){return n.filter(a=>Gv.indexOf(a.pos)===-1&&a.box.axis===t)}function Ul(n,t){return n.sort((a,s)=>{const l=t?s:a,o=t?a:s;return l.weight===o.weight?l.index-o.index:l.weight-o.weight})}function $3(n){const t=[];let a,s,l,o,u,d;for(a=0,s=(n||[]).length;a<s;++a)l=n[a],{position:o,options:{stack:u,stackWeight:d=1}}=l,t.push({index:a,box:l,pos:o,horizontal:l.isHorizontal(),weight:l.weight,stack:u&&o+u,stackWeight:d});return t}function V3(n){const t={};for(const a of n){const{stack:s,pos:l,stackWeight:o}=a;if(!s||!Gv.includes(l))continue;const u=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});u.count++,u.weight+=o}return t}function Y3(n,t){const a=V3(n),{vBoxMaxWidth:s,hBoxMaxHeight:l}=t;let o,u,d;for(o=0,u=n.length;o<u;++o){d=n[o];const{fullSize:f}=d.box,g=a[d.stack],x=g&&d.stackWeight/g.weight;d.horizontal?(d.width=x?x*s:f&&t.availableWidth,d.height=l):(d.width=s,d.height=x?x*l:f&&t.availableHeight)}return a}function G3(n){const t=$3(n),a=Ul(t.filter(g=>g.box.fullSize),!0),s=Ul(Bl(t,"left"),!0),l=Ul(Bl(t,"right")),o=Ul(Bl(t,"top"),!0),u=Ul(Bl(t,"bottom")),d=ab(t,"x"),f=ab(t,"y");return{fullSize:a,leftAndTop:s.concat(o),rightAndBottom:l.concat(f).concat(u).concat(d),chartArea:Bl(t,"chartArea"),vertical:s.concat(l).concat(f),horizontal:o.concat(u).concat(d)}}function ib(n,t,a,s){return Math.max(n[a],t[a])+Math.max(n[s],t[s])}function qv(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function q3(n,t,a,s){const{pos:l,box:o}=a,u=n.maxPadding;if(!Re(l)){a.size&&(n[l]-=a.size);const b=s[a.stack]||{size:0,count:1};b.size=Math.max(b.size,a.horizontal?o.height:o.width),a.size=b.size/b.count,n[l]+=a.size}o.getPadding&&qv(u,o.getPadding());const d=Math.max(0,t.outerWidth-ib(u,n,"left","right")),f=Math.max(0,t.outerHeight-ib(u,n,"top","bottom")),g=d!==n.w,x=f!==n.h;return n.w=d,n.h=f,a.horizontal?{same:g,other:x}:{same:x,other:g}}function X3(n){const t=n.maxPadding;function a(s){const l=Math.max(t[s]-n[s],0);return n[s]+=l,l}n.y+=a("top"),n.x+=a("left"),a("right"),a("bottom")}function I3(n,t){const a=t.maxPadding;function s(l){const o={left:0,top:0,right:0,bottom:0};return l.forEach(u=>{o[u]=Math.max(t[u],a[u])}),o}return s(n?["left","right"]:["top","bottom"])}function Gl(n,t,a,s){const l=[];let o,u,d,f,g,x;for(o=0,u=n.length,g=0;o<u;++o){d=n[o],f=d.box,f.update(d.width||t.w,d.height||t.h,I3(d.horizontal,t));const{same:b,other:v}=q3(t,a,d,s);g|=b&&l.length,x=x||v,f.fullSize||l.push(d)}return g&&Gl(l,t,a,s)||x}function $o(n,t,a,s,l){n.top=a,n.left=t,n.right=t+s,n.bottom=a+l,n.width=s,n.height=l}function sb(n,t,a,s){const l=a.padding;let{x:o,y:u}=t;for(const d of n){const f=d.box,g=s[d.stack]||{placed:0,weight:1},x=d.stackWeight/g.weight||1;if(d.horizontal){const b=t.w*x,v=g.size||f.height;bc(g.start)&&(u=g.start),f.fullSize?$o(f,l.left,u,a.outerWidth-l.right-l.left,v):$o(f,t.left+g.placed,u,b,v),g.start=u,g.placed+=b,u=f.bottom}else{const b=t.h*x,v=g.size||f.width;bc(g.start)&&(o=g.start),f.fullSize?$o(f,o,l.top,v,a.outerHeight-l.bottom-l.top):$o(f,o,t.top+g.placed,v,b),g.start=o,g.placed+=b,o=f.right}}t.x=o,t.y=u}var Va={addBox(n,t){n.boxes||(n.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(a){t.draw(a)}}]},n.boxes.push(t)},removeBox(n,t){const a=n.boxes?n.boxes.indexOf(t):-1;a!==-1&&n.boxes.splice(a,1)},configure(n,t,a){t.fullSize=a.fullSize,t.position=a.position,t.weight=a.weight},update(n,t,a,s){if(!n)return;const l=Tn(n.options.layout.padding),o=Math.max(t-l.width,0),u=Math.max(a-l.height,0),d=G3(n.boxes),f=d.vertical,g=d.horizontal;Ve(n.boxes,j=>{typeof j.beforeLayout=="function"&&j.beforeLayout()});const x=f.reduce((j,S)=>S.box.options&&S.box.options.display===!1?j:j+1,0)||1,b=Object.freeze({outerWidth:t,outerHeight:a,padding:l,availableWidth:o,availableHeight:u,vBoxMaxWidth:o/2/x,hBoxMaxHeight:u/2}),v=Object.assign({},l);qv(v,Tn(s));const _=Object.assign({maxPadding:v,w:o,h:u,x:l.left,y:l.top},l),M=Y3(f.concat(g),b);Gl(d.fullSize,_,b,M),Gl(f,_,b,M),Gl(g,_,b,M)&&Gl(f,_,b,M),X3(_),sb(d.leftAndTop,_,b,M),_.x+=_.w,_.y+=_.h,sb(d.rightAndBottom,_,b,M),n.chartArea={left:_.left,top:_.top,right:_.left+_.w,bottom:_.top+_.h,height:_.h,width:_.w},Ve(d.chartArea,j=>{const S=j.box;Object.assign(S,n.chartArea),S.update(_.w,_.h,{left:0,top:0,right:0,bottom:0})})}};class Xv{acquireContext(t,a){}releaseContext(t){return!1}addEventListener(t,a,s){}removeEventListener(t,a,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,a,s,l){return a=Math.max(0,a||t.width),s=s||t.height,{width:a,height:Math.max(0,l?Math.floor(a/l):s)}}isAttached(t){return!0}updateConfig(t){}}class F3 extends Xv{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const tc="$chartjs",Q3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},lb=n=>n===null||n==="";function Z3(n,t){const a=n.style,s=n.getAttribute("height"),l=n.getAttribute("width");if(n[tc]={initial:{height:s,width:l,style:{display:a.display,height:a.height,width:a.width}}},a.display=a.display||"block",a.boxSizing=a.boxSizing||"border-box",lb(l)){const o=Ix(n,"width");o!==void 0&&(n.width=o)}if(lb(s))if(n.style.height==="")n.height=n.width/(t||2);else{const o=Ix(n,"height");o!==void 0&&(n.height=o)}return n}const Iv=o3?{passive:!0}:!1;function K3(n,t,a){n&&n.addEventListener(t,a,Iv)}function P3(n,t,a){n&&n.canvas&&n.canvas.removeEventListener(t,a,Iv)}function W3(n,t){const a=Q3[n.type]||n.type,{x:s,y:l}=xi(n,t);return{type:a,chart:t,native:n,x:s!==void 0?s:null,y:l!==void 0?l:null}}function _c(n,t){for(const a of n)if(a===t||a.contains(t))return!0}function J3(n,t,a){const s=n.canvas,l=new MutationObserver(o=>{let u=!1;for(const d of o)u=u||_c(d.addedNodes,s),u=u&&!_c(d.removedNodes,s);u&&a()});return l.observe(document,{childList:!0,subtree:!0}),l}function eT(n,t,a){const s=n.canvas,l=new MutationObserver(o=>{let u=!1;for(const d of o)u=u||_c(d.removedNodes,s),u=u&&!_c(d.addedNodes,s);u&&a()});return l.observe(document,{childList:!0,subtree:!0}),l}const ar=new Map;let rb=0;function Fv(){const n=window.devicePixelRatio;n!==rb&&(rb=n,ar.forEach((t,a)=>{a.currentDevicePixelRatio!==n&&t()}))}function tT(n,t){ar.size||window.addEventListener("resize",Fv),ar.set(n,t)}function nT(n){ar.delete(n),ar.size||window.removeEventListener("resize",Fv)}function aT(n,t,a){const s=n.canvas,l=s&&Oh(s);if(!l)return;const o=jv((d,f)=>{const g=l.clientWidth;a(d,f),g<l.clientWidth&&a()},window),u=new ResizeObserver(d=>{const f=d[0],g=f.contentRect.width,x=f.contentRect.height;g===0&&x===0||o(g,x)});return u.observe(l),tT(n,o),u}function Mf(n,t,a){a&&a.disconnect(),t==="resize"&&nT(n)}function iT(n,t,a){const s=n.canvas,l=jv(o=>{n.ctx!==null&&a(W3(o,n))},n);return K3(s,t,l),l}class sT extends Xv{acquireContext(t,a){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Z3(t,a),s):null}releaseContext(t){const a=t.canvas;if(!a[tc])return!1;const s=a[tc].initial;["height","width"].forEach(o=>{const u=s[o];Fe(u)?a.removeAttribute(o):a.setAttribute(o,u)});const l=s.style||{};return Object.keys(l).forEach(o=>{a.style[o]=l[o]}),a.width=a.width,delete a[tc],!0}addEventListener(t,a,s){this.removeEventListener(t,a);const l=t.$proxies||(t.$proxies={}),u={attach:J3,detach:eT,resize:aT}[a]||iT;l[a]=u(t,a,s)}removeEventListener(t,a){const s=t.$proxies||(t.$proxies={}),l=s[a];if(!l)return;({attach:Mf,detach:Mf,resize:Mf}[a]||P3)(t,a,l),s[a]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,a,s,l){return r3(t,a,s,l)}isAttached(t){const a=t&&Oh(t);return!!(a&&a.isConnected)}}function lT(n){return!Rh()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?F3:sT}class Fa{constructor(){_e(this,"x");_e(this,"y");_e(this,"active",!1);_e(this,"options");_e(this,"$animations")}tooltipPosition(t){const{x:a,y:s}=this.getProps(["x","y"],t);return{x:a,y:s}}hasValue(){return tr(this.x)&&tr(this.y)}getProps(t,a){const s=this.$animations;if(!a||!s)return this;const l={};return t.forEach(o=>{l[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),l}}_e(Fa,"defaults",{}),_e(Fa,"defaultRoutes");function rT(n,t){const a=n.options.ticks,s=oT(n),l=Math.min(a.maxTicksLimit||s,s),o=a.major.enabled?uT(t):[],u=o.length,d=o[0],f=o[u-1],g=[];if(u>l)return dT(t,g,o,u/l),g;const x=cT(o,t,l);if(u>0){let b,v;const _=u>1?Math.round((f-d)/(u-1)):null;for(Vo(t,g,x,Fe(_)?0:d-_,d),b=0,v=u-1;b<v;b++)Vo(t,g,x,o[b],o[b+1]);return Vo(t,g,x,f,Fe(_)?t.length:f+_),g}return Vo(t,g,x),g}function oT(n){const t=n.options.offset,a=n._tickSize(),s=n._length/a+(t?0:1),l=n._maxLength/a;return Math.floor(Math.min(s,l))}function cT(n,t,a){const s=fT(n),l=t.length/a;if(!s)return Math.max(l,1);const o=a4(s);for(let u=0,d=o.length-1;u<d;u++){const f=o[u];if(f>l)return f}return Math.max(l,1)}function uT(n){const t=[];let a,s;for(a=0,s=n.length;a<s;a++)n[a].major&&t.push(a);return t}function dT(n,t,a,s){let l=0,o=a[0],u;for(s=Math.ceil(s),u=0;u<n.length;u++)u===o&&(t.push(n[u]),l++,o=a[l*s])}function Vo(n,t,a,s,l){const o=ze(s,0),u=Math.min(ze(l,n.length),n.length);let d=0,f,g,x;for(a=Math.ceil(a),l&&(f=l-s,a=f/Math.floor(f/a)),x=o;x<0;)d++,x=Math.round(o+d*a);for(g=Math.max(o,0);g<u;g++)g===x&&(t.push(n[g]),d++,x=Math.round(o+d*a))}function fT(n){const t=n.length;let a,s;if(t<2)return!1;for(s=n[0],a=1;a<t;++a)if(n[a]-n[a-1]!==s)return!1;return s}const hT=n=>n==="left"?"right":n==="right"?"left":n,ob=(n,t,a)=>t==="top"||t==="left"?n[t]+a:n[t]-a,cb=(n,t)=>Math.min(t||n,n);function ub(n,t){const a=[],s=n.length/t,l=n.length;let o=0;for(;o<l;o+=s)a.push(n[Math.floor(o)]);return a}function mT(n,t,a){const s=n.ticks.length,l=Math.min(t,s-1),o=n._startPixel,u=n._endPixel,d=1e-6;let f=n.getPixelForTick(l),g;if(!(a&&(s===1?g=Math.max(f-o,u-f):t===0?g=(n.getPixelForTick(1)-f)/2:g=(f-n.getPixelForTick(l-1))/2,f+=l<t?g:-g,f<o-d||f>u+d)))return f}function gT(n,t){Ve(n,a=>{const s=a.gc,l=s.length/2;let o;if(l>t){for(o=0;o<l;++o)delete a.data[s[o]];s.splice(0,l)}})}function $l(n){return n.drawTicks?n.tickLength:0}function db(n,t){if(!n.display)return 0;const a=Yt(n.font,t),s=Tn(n.padding);return(vt(n.text)?n.text.length:1)*a.lineHeight+s.height}function pT(n,t){return Ai(n,{scale:t,type:"scale"})}function xT(n,t,a){return Ai(n,{tick:a,index:t,type:"tick"})}function bT(n,t,a){let s=Nv(n);return(a&&t!=="right"||!a&&t==="right")&&(s=hT(s)),s}function yT(n,t,a,s){const{top:l,left:o,bottom:u,right:d,chart:f}=n,{chartArea:g,scales:x}=f;let b=0,v,_,M;const j=u-l,S=d-o;if(n.isHorizontal()){if(_=Jt(s,o,d),Re(a)){const N=Object.keys(a)[0],C=a[N];M=x[N].getPixelForValue(C)+j-t}else a==="center"?M=(g.bottom+g.top)/2+j-t:M=ob(n,a,t);v=d-o}else{if(Re(a)){const N=Object.keys(a)[0],C=a[N];_=x[N].getPixelForValue(C)-S+t}else a==="center"?_=(g.left+g.right)/2-S+t:_=ob(n,a,t);M=Jt(s,u,l),b=a==="left"?-jn:jn}return{titleX:_,titleY:M,maxWidth:v,rotation:b}}class Bs extends Fa{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,a){return t}getUserBounds(){let{_userMin:t,_userMax:a,_suggestedMin:s,_suggestedMax:l}=this;return t=Rn(t,Number.POSITIVE_INFINITY),a=Rn(a,Number.NEGATIVE_INFINITY),s=Rn(s,Number.POSITIVE_INFINITY),l=Rn(l,Number.NEGATIVE_INFINITY),{min:Rn(t,s),max:Rn(a,l),minDefined:kt(t),maxDefined:kt(a)}}getMinMax(t){let{min:a,max:s,minDefined:l,maxDefined:o}=this.getUserBounds(),u;if(l&&o)return{min:a,max:s};const d=this.getMatchingVisibleMetas();for(let f=0,g=d.length;f<g;++f)u=d[f].controller.getMinMax(this,t),l||(a=Math.min(a,u.min)),o||(s=Math.max(s,u.max));return a=o&&a>s?s:a,s=l&&a>s?a:s,{min:Rn(a,Rn(s,a)),max:Rn(s,Rn(a,s))}}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(){Pe(this.options.beforeUpdate,[this])}update(t,a,s){const{beginAtZero:l,grace:o,ticks:u}=this.options,d=u.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=a,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=U4(this,o,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const f=d<this.ticks.length;this._convertTicksToLabels(f?ub(this.ticks,d):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),u.display&&(u.autoSkip||u.source==="auto")&&(this.ticks=rT(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),f&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,a,s;this.isHorizontal()?(a=this.left,s=this.right):(a=this.top,s=this.bottom,t=!t),this._startPixel=a,this._endPixel=s,this._reversePixels=t,this._length=s-a,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Pe(this.options.afterUpdate,[this])}beforeSetDimensions(){Pe(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(){Pe(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Pe(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Pe(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const a=this.options.ticks;let s,l,o;for(s=0,l=t.length;s<l;s++)o=t[s],o.label=Pe(a.callback,[o.value,s,t],this)}afterTickToLabelConversion(){Pe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Pe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,a=t.ticks,s=cb(this.ticks.length,t.ticks.maxTicksLimit),l=a.minRotation||0,o=a.maxRotation;let u=l,d,f,g;if(!this._isVisible()||!a.display||l>=o||s<=1||!this.isHorizontal()){this.labelRotation=l;return}const x=this._getLabelSizes(),b=x.widest.width,v=x.highest.height,_=pn(this.chart.width-b,0,this.maxWidth);d=t.offset?this.maxWidth/s:_/(s-1),b+6>d&&(d=_/(s-(t.offset?.5:1)),f=this.maxHeight-$l(t.grid)-a.padding-db(t.title,this.chart.options.font),g=Math.sqrt(b*b+v*v),u=r4(Math.min(Math.asin(pn((x.highest.height+6)/d,-1,1)),Math.asin(pn(f/g,-1,1))-Math.asin(pn(v/g,-1,1)))),u=Math.max(l,Math.min(o,u))),this.labelRotation=u}afterCalculateLabelRotation(){Pe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Pe(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:a,options:{ticks:s,title:l,grid:o}}=this,u=this._isVisible(),d=this.isHorizontal();if(u){const f=db(l,a.options.font);if(d?(t.width=this.maxWidth,t.height=$l(o)+f):(t.height=this.maxHeight,t.width=$l(o)+f),s.display&&this.ticks.length){const{first:g,last:x,widest:b,highest:v}=this._getLabelSizes(),_=s.padding*2,M=vi(this.labelRotation),j=Math.cos(M),S=Math.sin(M);if(d){const N=s.mirror?0:S*b.width+j*v.height;t.height=Math.min(this.maxHeight,t.height+N+_)}else{const N=s.mirror?0:j*b.width+S*v.height;t.width=Math.min(this.maxWidth,t.width+N+_)}this._calculatePadding(g,x,S,j)}}this._handleMargins(),d?(this.width=this._length=a.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=a.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,a,s,l){const{ticks:{align:o,padding:u},position:d}=this.options,f=this.labelRotation!==0,g=d!=="top"&&this.axis==="x";if(this.isHorizontal()){const x=this.getPixelForTick(0)-this.left,b=this.right-this.getPixelForTick(this.ticks.length-1);let v=0,_=0;f?g?(v=l*t.width,_=s*a.height):(v=s*t.height,_=l*a.width):o==="start"?_=a.width:o==="end"?v=t.width:o!=="inner"&&(v=t.width/2,_=a.width/2),this.paddingLeft=Math.max((v-x+u)*this.width/(this.width-x),0),this.paddingRight=Math.max((_-b+u)*this.width/(this.width-b),0)}else{let x=a.height/2,b=t.height/2;o==="start"?(x=0,b=t.height):o==="end"&&(x=a.height,b=0),this.paddingTop=x+u,this.paddingBottom=b+u}}_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(){Pe(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:a}=this.options;return a==="top"||a==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let a,s;for(a=0,s=t.length;a<s;a++)Fe(t[a].label)&&(t.splice(a,1),s--,a--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const a=this.options.ticks.sampleSize;let s=this.ticks;a<s.length&&(s=ub(s,a)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,a,s){const{ctx:l,_longestTextCache:o}=this,u=[],d=[],f=Math.floor(a/cb(a,s));let g=0,x=0,b,v,_,M,j,S,N,C,k,E,A;for(b=0;b<a;b+=f){if(M=t[b].label,j=this._resolveTickFontOptions(b),l.font=S=j.string,N=o[S]=o[S]||{data:{},gc:[]},C=j.lineHeight,k=E=0,!Fe(M)&&!vt(M))k=Vx(l,N.data,N.gc,k,M),E=C;else if(vt(M))for(v=0,_=M.length;v<_;++v)A=M[v],!Fe(A)&&!vt(A)&&(k=Vx(l,N.data,N.gc,k,A),E+=C);u.push(k),d.push(E),g=Math.max(k,g),x=Math.max(E,x)}gT(o,a);const z=u.indexOf(g),L=d.indexOf(x),R=X=>({width:u[X]||0,height:d[X]||0});return{first:R(0),last:R(a-1),widest:R(z),highest:R(L),widths:u,heights:d}}getLabelForValue(t){return t}getPixelForValue(t,a){return NaN}getValueForPixel(t){}getPixelForTick(t){const a=this.ticks;return t<0||t>a.length-1?null:this.getPixelForValue(a[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const a=this._startPixel+t*this._length;return u4(this._alignToPixels?gi(this.chart,a,0):a)}getDecimalForPixel(t){const a=(t-this._startPixel)/this._length;return this._reversePixels?1-a:a}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:a}=this;return t<0&&a<0?a:t>0&&a>0?t:0}getContext(t){const a=this.ticks||[];if(t>=0&&t<a.length){const s=a[t];return s.$context||(s.$context=xT(this.getContext(),t,s))}return this.$context||(this.$context=pT(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,a=vi(this.labelRotation),s=Math.abs(Math.cos(a)),l=Math.abs(Math.sin(a)),o=this._getLabelSizes(),u=t.autoSkipPadding||0,d=o?o.widest.width+u:0,f=o?o.highest.height+u:0;return this.isHorizontal()?f*s>d*l?d/s:f/l:f*l<d*s?f/s:d/l}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const a=this.axis,s=this.chart,l=this.options,{grid:o,position:u,border:d}=l,f=o.offset,g=this.isHorizontal(),b=this.ticks.length+(f?1:0),v=$l(o),_=[],M=d.setContext(this.getContext()),j=M.display?M.width:0,S=j/2,N=function(U){return gi(s,U,j)};let C,k,E,A,z,L,R,X,de,Q,ae,Ee;if(u==="top")C=N(this.bottom),L=this.bottom-v,X=C-S,Q=N(t.top)+S,Ee=t.bottom;else if(u==="bottom")C=N(this.top),Q=t.top,Ee=N(t.bottom)-S,L=C+S,X=this.top+v;else if(u==="left")C=N(this.right),z=this.right-v,R=C-S,de=N(t.left)+S,ae=t.right;else if(u==="right")C=N(this.left),de=t.left,ae=N(t.right)-S,z=C+S,R=this.left+v;else if(a==="x"){if(u==="center")C=N((t.top+t.bottom)/2+.5);else if(Re(u)){const U=Object.keys(u)[0],K=u[U];C=N(this.chart.scales[U].getPixelForValue(K))}Q=t.top,Ee=t.bottom,L=C+S,X=L+v}else if(a==="y"){if(u==="center")C=N((t.left+t.right)/2);else if(Re(u)){const U=Object.keys(u)[0],K=u[U];C=N(this.chart.scales[U].getPixelForValue(K))}z=C-S,R=z-v,de=t.left,ae=t.right}const Oe=ze(l.ticks.maxTicksLimit,b),he=Math.max(1,Math.ceil(b/Oe));for(k=0;k<b;k+=he){const U=this.getContext(k),K=o.setContext(U),fe=d.setContext(U),we=K.lineWidth,P=K.color,O=fe.dash||[],I=fe.dashOffset,W=K.tickWidth,ee=K.tickColor,ne=K.tickBorderDash||[],le=K.tickBorderDashOffset;E=mT(this,k,f),E!==void 0&&(A=gi(s,E,we),g?z=R=de=ae=A:L=X=Q=Ee=A,_.push({tx1:z,ty1:L,tx2:R,ty2:X,x1:de,y1:Q,x2:ae,y2:Ee,width:we,color:P,borderDash:O,borderDashOffset:I,tickWidth:W,tickColor:ee,tickBorderDash:ne,tickBorderDashOffset:le}))}return this._ticksLength=b,this._borderValue=C,_}_computeLabelItems(t){const a=this.axis,s=this.options,{position:l,ticks:o}=s,u=this.isHorizontal(),d=this.ticks,{align:f,crossAlign:g,padding:x,mirror:b}=o,v=$l(s.grid),_=v+x,M=b?-x:_,j=-vi(this.labelRotation),S=[];let N,C,k,E,A,z,L,R,X,de,Q,ae,Ee="middle";if(l==="top")z=this.bottom-M,L=this._getXAxisLabelAlignment();else if(l==="bottom")z=this.top+M,L=this._getXAxisLabelAlignment();else if(l==="left"){const he=this._getYAxisLabelAlignment(v);L=he.textAlign,A=he.x}else if(l==="right"){const he=this._getYAxisLabelAlignment(v);L=he.textAlign,A=he.x}else if(a==="x"){if(l==="center")z=(t.top+t.bottom)/2+_;else if(Re(l)){const he=Object.keys(l)[0],U=l[he];z=this.chart.scales[he].getPixelForValue(U)+_}L=this._getXAxisLabelAlignment()}else if(a==="y"){if(l==="center")A=(t.left+t.right)/2-_;else if(Re(l)){const he=Object.keys(l)[0],U=l[he];A=this.chart.scales[he].getPixelForValue(U)}L=this._getYAxisLabelAlignment(v).textAlign}a==="y"&&(f==="start"?Ee="top":f==="end"&&(Ee="bottom"));const Oe=this._getLabelSizes();for(N=0,C=d.length;N<C;++N){k=d[N],E=k.label;const he=o.setContext(this.getContext(N));R=this.getPixelForTick(N)+o.labelOffset,X=this._resolveTickFontOptions(N),de=X.lineHeight,Q=vt(E)?E.length:1;const U=Q/2,K=he.color,fe=he.textStrokeColor,we=he.textStrokeWidth;let P=L;u?(A=R,L==="inner"&&(N===C-1?P=this.options.reverse?"left":"right":N===0?P=this.options.reverse?"right":"left":P="center"),l==="top"?g==="near"||j!==0?ae=-Q*de+de/2:g==="center"?ae=-Oe.highest.height/2-U*de+de:ae=-Oe.highest.height+de/2:g==="near"||j!==0?ae=de/2:g==="center"?ae=Oe.highest.height/2-U*de:ae=Oe.highest.height-Q*de,b&&(ae*=-1),j!==0&&!he.showLabelBackdrop&&(A+=de/2*Math.sin(j))):(z=R,ae=(1-Q)*de/2);let O;if(he.showLabelBackdrop){const I=Tn(he.backdropPadding),W=Oe.heights[N],ee=Oe.widths[N];let ne=ae-I.top,le=0-I.left;switch(Ee){case"middle":ne-=W/2;break;case"bottom":ne-=W;break}switch(L){case"center":le-=ee/2;break;case"right":le-=ee;break;case"inner":N===C-1?le-=ee:N>0&&(le-=ee/2);break}O={left:le,top:ne,width:ee+I.width,height:W+I.height,color:he.backdropColor}}S.push({label:E,font:X,textOffset:ae,options:{rotation:j,color:K,strokeColor:fe,strokeWidth:we,textAlign:P,textBaseline:Ee,translation:[A,z],backdrop:O}})}return S}_getXAxisLabelAlignment(){const{position:t,ticks:a}=this.options;if(-vi(this.labelRotation))return t==="top"?"left":"right";let l="center";return a.align==="start"?l="left":a.align==="end"?l="right":a.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(t){const{position:a,ticks:{crossAlign:s,mirror:l,padding:o}}=this.options,u=this._getLabelSizes(),d=t+o,f=u.widest.width;let g,x;return a==="left"?l?(x=this.right+o,s==="near"?g="left":s==="center"?(g="center",x+=f/2):(g="right",x+=f)):(x=this.right-d,s==="near"?g="right":s==="center"?(g="center",x-=f/2):(g="left",x=this.left)):a==="right"?l?(x=this.left+o,s==="near"?g="right":s==="center"?(g="center",x-=f/2):(g="left",x-=f)):(x=this.left+d,s==="near"?g="left":s==="center"?(g="center",x+=f/2):(g="right",x=this.right)):g="right",{textAlign:g,x}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,a=this.options.position;if(a==="left"||a==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(a==="top"||a==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:a},left:s,top:l,width:o,height:u}=this;a&&(t.save(),t.fillStyle=a,t.fillRect(s,l,o,u),t.restore())}getLineWidthForValue(t){const a=this.options.grid;if(!this._isVisible()||!a.display)return 0;const l=this.ticks.findIndex(o=>o.value===t);return l>=0?a.setContext(this.getContext(l)).lineWidth:0}drawGrid(t){const a=this.options.grid,s=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,u;const d=(f,g,x)=>{!x.width||!x.color||(s.save(),s.lineWidth=x.width,s.strokeStyle=x.color,s.setLineDash(x.borderDash||[]),s.lineDashOffset=x.borderDashOffset,s.beginPath(),s.moveTo(f.x,f.y),s.lineTo(g.x,g.y),s.stroke(),s.restore())};if(a.display)for(o=0,u=l.length;o<u;++o){const f=l[o];a.drawOnChartArea&&d({x:f.x1,y:f.y1},{x:f.x2,y:f.y2},f),a.drawTicks&&d({x:f.tx1,y:f.ty1},{x:f.tx2,y:f.ty2},{color:f.tickColor,width:f.tickWidth,borderDash:f.tickBorderDash,borderDashOffset:f.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:a,options:{border:s,grid:l}}=this,o=s.setContext(this.getContext()),u=s.display?o.width:0;if(!u)return;const d=l.setContext(this.getContext(0)).lineWidth,f=this._borderValue;let g,x,b,v;this.isHorizontal()?(g=gi(t,this.left,u)-u/2,x=gi(t,this.right,d)+d/2,b=v=f):(b=gi(t,this.top,u)-u/2,v=gi(t,this.bottom,d)+d/2,g=x=f),a.save(),a.lineWidth=o.width,a.strokeStyle=o.color,a.beginPath(),a.moveTo(g,b),a.lineTo(x,v),a.stroke(),a.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,l=this._computeLabelArea();l&&Bc(s,l);const o=this.getLabelItems(t);for(const u of o){const d=u.options,f=u.font,g=u.label,x=u.textOffset;vc(s,g,0,x,f,d)}l&&Uc(s)}drawTitle(){const{ctx:t,options:{position:a,title:s,reverse:l}}=this;if(!s.display)return;const o=Yt(s.font),u=Tn(s.padding),d=s.align;let f=o.lineHeight/2;a==="bottom"||a==="center"||Re(a)?(f+=u.bottom,vt(s.text)&&(f+=o.lineHeight*(s.text.length-1))):f+=u.top;const{titleX:g,titleY:x,maxWidth:b,rotation:v}=yT(this,f,a,d);vc(t,s.text,0,0,o,{color:s.color,maxWidth:b,rotation:v,textAlign:bT(d,a,l),textBaseline:"middle",translation:[g,x]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,a=t.ticks&&t.ticks.z||0,s=ze(t.grid&&t.grid.z,-1),l=ze(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Bs.prototype.draw?[{z:a,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:a,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const a=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",l=[];let o,u;for(o=0,u=a.length;o<u;++o){const d=a[o];d[s]===this.id&&(!t||d.type===t)&&l.push(d)}return l}_resolveTickFontOptions(t){const a=this.options.ticks.setContext(this.getContext(t));return Yt(a.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Yo{constructor(t,a,s){this.type=t,this.scope=a,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const a=Object.getPrototypeOf(t);let s;_T(a)&&(s=this.register(a));const l=this.items,o=t.id,u=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in l||(l[o]=t,vT(t,u,s),this.override&&lt.override(t.id,t.overrides)),u}get(t){return this.items[t]}unregister(t){const a=this.items,s=t.id,l=this.scope;s in a&&delete a[s],l&&s in lt[l]&&(delete lt[l][s],this.override&&delete Ti[s])}}function vT(n,t,a){const s=er(Object.create(null),[a?lt.get(a):{},lt.get(t),n.defaults]);lt.set(t,s),n.defaultRoutes&&ST(t,n.defaultRoutes),n.descriptors&&lt.describe(t,n.descriptors)}function ST(n,t){Object.keys(t).forEach(a=>{const s=a.split("."),l=s.pop(),o=[n].concat(s).join("."),u=t[a].split("."),d=u.pop(),f=u.join(".");lt.route(o,l,f,d)})}function _T(n){return"id"in n&&"defaults"in n}class wT{constructor(){this.controllers=new Yo(Kl,"datasets",!0),this.elements=new Yo(Fa,"elements"),this.plugins=new Yo(Object,"plugins"),this.scales=new Yo(Bs,"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,a,s){[...a].forEach(l=>{const o=s||this._getRegistryForType(l);s||o.isForType(l)||o===this.plugins&&l.id?this._exec(t,o,l):Ve(l,u=>{const d=s||this._getRegistryForType(u);this._exec(t,d,u)})})}_exec(t,a,s){const l=kh(t);Pe(s["before"+l],[],s),a[t](s),Pe(s["after"+l],[],s)}_getRegistryForType(t){for(let a=0;a<this._typedRegistries.length;a++){const s=this._typedRegistries[a];if(s.isForType(t))return s}return this.plugins}_get(t,a,s){const l=a.get(t);if(l===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return l}}var Ln=new wT;class jT{constructor(){this._init=void 0}notify(t,a,s,l){if(a==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=l?this._descriptors(t).filter(l):this._descriptors(t),u=this._notify(o,t,a,s);return a==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),u}_notify(t,a,s,l){l=l||{};for(const o of t){const u=o.plugin,d=u[s],f=[a,l,o.options];if(Pe(d,f,u)===!1&&l.cancelable)return!1}return!0}invalidate(){Fe(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const a=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),a}_createDescriptors(t,a){const s=t&&t.config,l=ze(s.options&&s.options.plugins,{}),o=NT(s);return l===!1&&!a?[]:TT(t,o,l,a)}_notifyStateChanges(t){const a=this._oldCache||[],s=this._cache,l=(o,u)=>o.filter(d=>!u.some(f=>d.plugin.id===f.plugin.id));this._notify(l(a,s),t,"stop"),this._notify(l(s,a),t,"start")}}function NT(n){const t={},a=[],s=Object.keys(Ln.plugins.items);for(let o=0;o<s.length;o++)a.push(Ln.getPlugin(s[o]));const l=n.plugins||[];for(let o=0;o<l.length;o++){const u=l[o];a.indexOf(u)===-1&&(a.push(u),t[u.id]=!0)}return{plugins:a,localIds:t}}function MT(n,t){return!t&&n===!1?null:n===!0?{}:n}function TT(n,{plugins:t,localIds:a},s,l){const o=[],u=n.getContext();for(const d of t){const f=d.id,g=MT(s[f],l);g!==null&&o.push({plugin:d,options:kT(n.config,{plugin:d,local:a[f]},g,u)})}return o}function kT(n,{plugin:t,local:a},s,l){const o=n.pluginScopeKeys(t),u=n.getOptionScopes(s,o);return a&&t.defaults&&u.push(t.defaults),n.createResolver(u,l,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Xf(n,t){const a=lt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||a.indexAxis||"x"}function CT(n,t){let a=n;return n==="_index_"?a=t:n==="_value_"&&(a=t==="x"?"y":"x"),a}function ET(n,t){return n===t?"_index_":"_value_"}function fb(n){if(n==="x"||n==="y"||n==="r")return n}function AT(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function If(n,...t){if(fb(n))return n;for(const a of t){const s=a.axis||AT(a.position)||n.length>1&&fb(n[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function hb(n,t,a){if(a[t+"AxisID"]===n)return{axis:t}}function DT(n,t){if(t.data&&t.data.datasets){const a=t.data.datasets.filter(s=>s.xAxisID===n||s.yAxisID===n);if(a.length)return hb(n,"x",a[0])||hb(n,"y",a[0])}return{}}function zT(n,t){const a=Ti[n.type]||{scales:{}},s=t.scales||{},l=Xf(n.type,t),o=Object.create(null);return Object.keys(s).forEach(u=>{const d=s[u];if(!Re(d))return console.error(`Invalid scale configuration for scale: ${u}`);if(d._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${u}`);const f=If(u,d,DT(u,n),lt.scales[d.type]),g=ET(f,l),x=a.scales||{};o[u]=Xl(Object.create(null),[{axis:f},d,x[f],x[g]])}),n.data.datasets.forEach(u=>{const d=u.type||n.type,f=u.indexAxis||Xf(d,t),x=(Ti[d]||{}).scales||{};Object.keys(x).forEach(b=>{const v=CT(b,f),_=u[v+"AxisID"]||v;o[_]=o[_]||Object.create(null),Xl(o[_],[{axis:v},s[_],x[b]])})}),Object.keys(o).forEach(u=>{const d=o[u];Xl(d,[lt.scales[d.type],lt.scale])}),o}function Qv(n){const t=n.options||(n.options={});t.plugins=ze(t.plugins,{}),t.scales=zT(n,t)}function Zv(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function RT(n){return n=n||{},n.data=Zv(n.data),Qv(n),n}const mb=new Map,Kv=new Set;function Go(n,t){let a=mb.get(n);return a||(a=t(),mb.set(n,a),Kv.add(a)),a}const Vl=(n,t,a)=>{const s=xc(t,a);s!==void 0&&n.add(s)};class OT{constructor(t){this._config=RT(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=Zv(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(),Qv(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Go(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,a){return Go(`${t}.transition.${a}`,()=>[[`datasets.${t}.transitions.${a}`,`transitions.${a}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,a){return Go(`${t}-${a}`,()=>[[`datasets.${t}.elements.${a}`,`datasets.${t}`,`elements.${a}`,""]])}pluginScopeKeys(t){const a=t.id,s=this.type;return Go(`${s}-plugin-${a}`,()=>[[`plugins.${a}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,a){const s=this._scopeCache;let l=s.get(t);return(!l||a)&&(l=new Map,s.set(t,l)),l}getOptionScopes(t,a,s){const{options:l,type:o}=this,u=this._cachedScopes(t,s),d=u.get(a);if(d)return d;const f=new Set;a.forEach(x=>{t&&(f.add(t),x.forEach(b=>Vl(f,t,b))),x.forEach(b=>Vl(f,l,b)),x.forEach(b=>Vl(f,Ti[o]||{},b)),x.forEach(b=>Vl(f,lt,b)),x.forEach(b=>Vl(f,Yf,b))});const g=Array.from(f);return g.length===0&&g.push(Object.create(null)),Kv.has(a)&&u.set(a,g),g}chartOptionScopes(){const{options:t,type:a}=this;return[t,Ti[a]||{},lt.datasets[a]||{},{type:a},lt,Yf]}resolveNamedOptions(t,a,s,l=[""]){const o={$shared:!0},{resolver:u,subPrefixes:d}=gb(this._resolverCache,t,l);let f=u;if(HT(u,a)){o.$shared=!1,s=Ia(s)?s():s;const g=this.createResolver(t,s,d);f=ks(u,s,g)}for(const g of a)o[g]=f[g];return o}createResolver(t,a,s=[""],l){const{resolver:o}=gb(this._resolverCache,t,s);return Re(a)?ks(o,a,void 0,l):o}}function gb(n,t,a){let s=n.get(t);s||(s=new Map,n.set(t,s));const l=a.join();let o=s.get(l);return o||(o={resolver:Ah(t,a),subPrefixes:a.filter(d=>!d.toLowerCase().includes("hover"))},s.set(l,o)),o}const LT=n=>Re(n)&&Object.getOwnPropertyNames(n).some(t=>Ia(n[t]));function HT(n,t){const{isScriptable:a,isIndexable:s}=Ev(n);for(const l of t){const o=a(l),u=s(l),d=(u||o)&&n[l];if(o&&(Ia(d)||LT(d))||u&&vt(d))return!0}return!1}var BT="4.5.1";const UT=["top","bottom","left","right","chartArea"];function pb(n,t){return n==="top"||n==="bottom"||UT.indexOf(n)===-1&&t==="x"}function xb(n,t){return function(a,s){return a[n]===s[n]?a[t]-s[t]:a[n]-s[n]}}function bb(n){const t=n.chart,a=t.options.animation;t.notifyPlugins("afterRender"),Pe(a&&a.onComplete,[n],t)}function $T(n){const t=n.chart,a=t.options.animation;Pe(a&&a.onProgress,[n],t)}function Pv(n){return Rh()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const nc={},yb=n=>{const t=Pv(n);return Object.values(nc).filter(a=>a.canvas===t).pop()};function VT(n,t,a){const s=Object.keys(n);for(const l of s){const o=+l;if(o>=t){const u=n[l];delete n[l],(a>0||o>t)&&(n[o+a]=u)}}}function YT(n,t,a,s){return!a||n.type==="mouseout"?null:s?t:n}var Ba;let Yc=(Ba=class{static register(...t){Ln.add(...t),vb()}static unregister(...t){Ln.remove(...t),vb()}constructor(t,a){const s=this.config=new OT(a),l=Pv(t),o=yb(l);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const u=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||lT(l)),this.platform.updateConfig(s);const d=this.platform.acquireContext(l,u.aspectRatio),f=d&&d.canvas,g=f&&f.height,x=f&&f.width;if(this.id=QM(),this.ctx=d,this.canvas=f,this.width=x,this.height=g,this._options=u,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 jT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=g4(b=>this.update(b),u.resizeDelay||0),this._dataChanges=[],nc[this.id]=this,!d||!f){console.error("Failed to create chart: can't acquire context from the given item");return}la.listen(this,"complete",bb),la.listen(this,"progress",$T),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:a},width:s,height:l,_aspectRatio:o}=this;return Fe(t)?a&&o?o:l?s/l: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 Ln}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Xx(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Yx(this.canvas,this.ctx),this}stop(){return la.stop(this),this}resize(t,a){la.running(this)?this._resizeBeforeDraw={width:t,height:a}:this._resize(t,a)}_resize(t,a){const s=this.options,l=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,u=this.platform.getMaximumSize(l,t,a,o),d=s.devicePixelRatio||this.platform.getDevicePixelRatio(),f=this.width?"resize":"attach";this.width=u.width,this.height=u.height,this._aspectRatio=this.aspectRatio,Xx(this,d,!0)&&(this.notifyPlugins("resize",{size:u}),Pe(s.onResize,[this,u],this),this.attached&&this._doResize(f)&&this.render())}ensureScalesHaveIDs(){const a=this.options.scales||{};Ve(a,(s,l)=>{s.id=l})}buildOrUpdateScales(){const t=this.options,a=t.scales,s=this.scales,l=Object.keys(s).reduce((u,d)=>(u[d]=!1,u),{});let o=[];a&&(o=o.concat(Object.keys(a).map(u=>{const d=a[u],f=If(u,d),g=f==="r",x=f==="x";return{options:d,dposition:g?"chartArea":x?"bottom":"left",dtype:g?"radialLinear":x?"category":"linear"}}))),Ve(o,u=>{const d=u.options,f=d.id,g=If(f,d),x=ze(d.type,u.dtype);(d.position===void 0||pb(d.position,g)!==pb(u.dposition))&&(d.position=u.dposition),l[f]=!0;let b=null;if(f in s&&s[f].type===x)b=s[f];else{const v=Ln.getScale(x);b=new v({id:f,type:x,ctx:this.ctx,chart:this}),s[b.id]=b}b.init(d,t)}),Ve(l,(u,d)=>{u||delete s[d]}),Ve(s,u=>{Va.configure(this,u,u.options),Va.addBox(this,u)})}_updateMetasets(){const t=this._metasets,a=this.data.datasets.length,s=t.length;if(t.sort((l,o)=>l.index-o.index),s>a){for(let l=a;l<s;++l)this._destroyDatasetMeta(l);t.splice(a,s-a)}this._sortedMetasets=t.slice(0).sort(xb("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:a}}=this;t.length>a.length&&delete this._stacks,t.forEach((s,l)=>{a.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const t=[],a=this.data.datasets;let s,l;for(this._removeUnreferencedMetasets(),s=0,l=a.length;s<l;s++){const o=a[s];let u=this.getDatasetMeta(s);const d=o.type||this.config.type;if(u.type&&u.type!==d&&(this._destroyDatasetMeta(s),u=this.getDatasetMeta(s)),u.type=d,u.indexAxis=o.indexAxis||Xf(d,this.options),u.order=o.order||0,u.index=s,u.label=""+o.label,u.visible=this.isDatasetVisible(s),u.controller)u.controller.updateIndex(s),u.controller.linkScales();else{const f=Ln.getController(d),{datasetElementType:g,dataElementType:x}=lt.datasets[d];Object.assign(f,{dataElementType:Ln.getElement(x),datasetElementType:g&&Ln.getElement(g)}),u.controller=new f(this,s),t.push(u.controller)}}return this._updateMetasets(),t}_resetElements(){Ve(this.data.datasets,(t,a)=>{this.getDatasetMeta(a).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const a=this.config;a.update();const s=this._options=a.createResolver(a.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let u=0;for(let g=0,x=this.data.datasets.length;g<x;g++){const{controller:b}=this.getDatasetMeta(g),v=!l&&o.indexOf(b)===-1;b.buildOrUpdateElements(v),u=Math.max(+b.getMaxOverflow(),u)}u=this._minPadding=s.layout.autoPadding?u:0,this._updateLayout(u),l||Ve(o,g=>{g.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(xb("z","_idx"));const{_active:d,_lastEvent:f}=this;f?this._eventHandler(f,!0):d.length&&this._updateHoverStyles(d,d,!0),this.render()}_updateScales(){Ve(this.scales,t=>{Va.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,a=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Dx(a,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,a=this._getUniformDataChanges()||[];for(const{method:s,start:l,count:o}of a){const u=s==="_removeElements"?-o:o;VT(t,l,u)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const a=this.data.datasets.length,s=o=>new Set(t.filter(u=>u[0]===o).map((u,d)=>d+","+u.splice(1).join(","))),l=s(0);for(let o=1;o<a;o++)if(!Dx(l,s(o)))return;return Array.from(l).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Va.update(this,this.width,this.height,t);const a=this.chartArea,s=a.width<=0||a.height<=0;this._layers=[],Ve(this.boxes,l=>{s&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,o)=>{l._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let a=0,s=this.data.datasets.length;a<s;++a)this.getDatasetMeta(a).controller.configure();for(let a=0,s=this.data.datasets.length;a<s;++a)this._updateDataset(a,Ia(t)?t({datasetIndex:a}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,a){const s=this.getDatasetMeta(t),l={meta:s,index:t,mode:a,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",l)!==!1&&(s.controller._update(a),l.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",l))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(la.has(this)?this.attached&&!la.running(this)&&la.start(this):(this.draw(),bb({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:l}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,l)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const a=this._layers;for(t=0;t<a.length&&a[t].z<=0;++t)a[t].draw(this.chartArea);for(this._drawDatasets();t<a.length;++t)a[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const a=this._sortedMetasets,s=[];let l,o;for(l=0,o=a.length;l<o;++l){const u=a[l];(!t||u.visible)&&s.push(u)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let a=t.length-1;a>=0;--a)this._drawDataset(t[a]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const a=this.ctx,s={meta:t,index:t.index,cancelable:!0},l=$v(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(l&&Bc(a,l),t.controller.draw(),l&&Uc(a),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return nr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,a,s,l){const o=U3.modes[a];return typeof o=="function"?o(this,t,s,l):[]}getDatasetMeta(t){const a=this.data.datasets[t],s=this._metasets;let l=s.filter(o=>o&&o._dataset===a).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:a&&a.order||0,index:t,_dataset:a,_parsed:[],_sorted:!1},s.push(l)),l}getContext(){return this.$context||(this.$context=Ai(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const a=this.data.datasets[t];if(!a)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!a.hidden}setDatasetVisibility(t,a){const s=this.getDatasetMeta(t);s.hidden=!a}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,a,s){const l=s?"show":"hide",o=this.getDatasetMeta(t),u=o.controller._resolveAnimations(void 0,l);bc(a)?(o.data[a].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),u.update(o,{visible:s}),this.update(d=>d.datasetIndex===t?l:void 0))}hide(t,a){this._updateVisibility(t,a,!1)}show(t,a){this._updateVisibility(t,a,!0)}_destroyDatasetMeta(t){const a=this._metasets[t];a&&a.controller&&a.controller._destroy(),delete this._metasets[t]}_stop(){let t,a;for(this.stop(),la.remove(this),t=0,a=this.data.datasets.length;t<a;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:a}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Yx(t,a),this.platform.releaseContext(a),this.canvas=null,this.ctx=null),delete nc[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,a=this.platform,s=(o,u)=>{a.addEventListener(this,o,u),t[o]=u},l=(o,u,d)=>{o.offsetX=u,o.offsetY=d,this._eventHandler(o)};Ve(this.options.events,o=>s(o,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,a=this.platform,s=(f,g)=>{a.addEventListener(this,f,g),t[f]=g},l=(f,g)=>{t[f]&&(a.removeEventListener(this,f,g),delete t[f])},o=(f,g)=>{this.canvas&&this.resize(f,g)};let u;const d=()=>{l("attach",d),this.attached=!0,this.resize(),s("resize",o),s("detach",u)};u=()=>{this.attached=!1,l("resize",o),this._stop(),this._resize(0,0),s("attach",d)},a.isAttached(this.canvas)?d():u()}unbindEvents(){Ve(this._listeners,(t,a)=>{this.platform.removeEventListener(this,a,t)}),this._listeners={},Ve(this._responsiveListeners,(t,a)=>{this.platform.removeEventListener(this,a,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,a,s){const l=s?"set":"remove";let o,u,d,f;for(a==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+l+"DatasetHoverStyle"]()),d=0,f=t.length;d<f;++d){u=t[d];const g=u&&this.getDatasetMeta(u.datasetIndex).controller;g&&g[l+"HoverStyle"](u.element,u.datasetIndex,u.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const a=this._active||[],s=t.map(({datasetIndex:o,index:u})=>{const d=this.getDatasetMeta(o);if(!d)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:d.data[u],index:u}});!gc(s,a)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,a))}notifyPlugins(t,a,s){return this._plugins.notify(this,t,a,s)}isPluginEnabled(t){return this._plugins._cache.filter(a=>a.plugin.id===t).length===1}_updateHoverStyles(t,a,s){const l=this.options.hover,o=(f,g)=>f.filter(x=>!g.some(b=>x.datasetIndex===b.datasetIndex&&x.index===b.index)),u=o(a,t),d=s?t:o(t,a);u.length&&this.updateHoverStyle(u,l.mode,!1),d.length&&l.mode&&this.updateHoverStyle(d,l.mode,!0)}_eventHandler(t,a){const s={event:t,replay:a,cancelable:!0,inChartArea:this.isPointInArea(t)},l=u=>(u.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,l)===!1)return;const o=this._handleEvent(t,a,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,l),(o||s.changed)&&this.render(),this}_handleEvent(t,a,s){const{_active:l=[],options:o}=this,u=a,d=this._getActiveElements(t,l,s,u),f=e4(t),g=YT(t,this._lastEvent,s,f);s&&(this._lastEvent=null,Pe(o.onHover,[t,d,this],this),f&&Pe(o.onClick,[t,d,this],this));const x=!gc(d,l);return(x||a)&&(this._active=d,this._updateHoverStyles(d,l,a)),this._lastEvent=g,x}_getActiveElements(t,a,s,l){if(t.type==="mouseout")return[];if(!s)return a;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,l)}},_e(Ba,"defaults",lt),_e(Ba,"instances",nc),_e(Ba,"overrides",Ti),_e(Ba,"registry",Ln),_e(Ba,"version",BT),_e(Ba,"getChart",yb),Ba);function vb(){return Ve(Yc.instances,n=>n._plugins.invalidate())}function Wv(n,t,a=t){n.lineCap=ze(a.borderCapStyle,t.borderCapStyle),n.setLineDash(ze(a.borderDash,t.borderDash)),n.lineDashOffset=ze(a.borderDashOffset,t.borderDashOffset),n.lineJoin=ze(a.borderJoinStyle,t.borderJoinStyle),n.lineWidth=ze(a.borderWidth,t.borderWidth),n.strokeStyle=ze(a.borderColor,t.borderColor)}function GT(n,t,a){n.lineTo(a.x,a.y)}function qT(n){return n.stepped?C4:n.tension||n.cubicInterpolationMode==="monotone"?E4:GT}function Jv(n,t,a={}){const s=n.length,{start:l=0,end:o=s-1}=a,{start:u,end:d}=t,f=Math.max(l,u),g=Math.min(o,d),x=l<u&&o<u||l>d&&o>d;return{count:s,start:f,loop:t.loop,ilen:g<f&&!x?s+g-f:g-f}}function XT(n,t,a,s){const{points:l,options:o}=t,{count:u,start:d,loop:f,ilen:g}=Jv(l,a,s),x=qT(o);let{move:b=!0,reverse:v}=s||{},_,M,j;for(_=0;_<=g;++_)M=l[(d+(v?g-_:_))%u],!M.skip&&(b?(n.moveTo(M.x,M.y),b=!1):x(n,j,M,v,o.stepped),j=M);return f&&(M=l[(d+(v?g:0))%u],x(n,j,M,v,o.stepped)),!!f}function IT(n,t,a,s){const l=t.points,{count:o,start:u,ilen:d}=Jv(l,a,s),{move:f=!0,reverse:g}=s||{};let x=0,b=0,v,_,M,j,S,N;const C=E=>(u+(g?d-E:E))%o,k=()=>{j!==S&&(n.lineTo(x,S),n.lineTo(x,j),n.lineTo(x,N))};for(f&&(_=l[C(0)],n.moveTo(_.x,_.y)),v=0;v<=d;++v){if(_=l[C(v)],_.skip)continue;const E=_.x,A=_.y,z=E|0;z===M?(A<j?j=A:A>S&&(S=A),x=(b*x+E)/++b):(k(),n.lineTo(E,A),M=z,b=0,j=S=A),N=A}k()}function Ff(n){const t=n.options,a=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!a?IT:XT}function FT(n){return n.stepped?c3:n.tension||n.cubicInterpolationMode==="monotone"?u3:bi}function QT(n,t,a,s){let l=t._path;l||(l=t._path=new Path2D,t.path(l,a,s)&&l.closePath()),Wv(n,t.options),n.stroke(l)}function ZT(n,t,a,s){const{segments:l,options:o}=t,u=Ff(t);for(const d of l)Wv(n,o,d.style),n.beginPath(),u(n,t,d,{start:a,end:a+s-1})&&n.closePath(),n.stroke()}const KT=typeof Path2D=="function";function PT(n,t,a,s){KT&&!t.options.segment?QT(n,t,a,s):ZT(n,t,a,s)}class Ya extends Fa{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,a){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const l=s.spanGaps?this._loop:this._fullLoop;t3(this._points,s,t,l,a),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=p3(this,this.options.segment))}first(){const t=this.segments,a=this.points;return t.length&&a[t[0].start]}last(){const t=this.segments,a=this.points,s=t.length;return s&&a[t[s-1].end]}interpolate(t,a){const s=this.options,l=t[a],o=this.points,u=Uv(this,{property:a,start:l,end:l});if(!u.length)return;const d=[],f=FT(s);let g,x;for(g=0,x=u.length;g<x;++g){const{start:b,end:v}=u[g],_=o[b],M=o[v];if(_===M){d.push(_);continue}const j=Math.abs((l-_[a])/(M[a]-_[a])),S=f(_,M,j,s.stepped);S[a]=t[a],d.push(S)}return d.length===1?d[0]:d}pathSegment(t,a,s){return Ff(this)(t,this,a,s)}path(t,a,s){const l=this.segments,o=Ff(this);let u=this._loop;a=a||0,s=s||this.points.length-a;for(const d of l)u&=o(t,this,d,{start:a,end:a+s-1});return!!u}draw(t,a,s,l){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),PT(t,this,s,l),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}_e(Ya,"id","line"),_e(Ya,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),_e(Ya,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),_e(Ya,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Sb(n,t,a,s){const l=n.options,{[a]:o}=n.getProps([a],s);return Math.abs(t-o)<l.radius+l.hitRadius}class ac extends Fa{constructor(a){super();_e(this,"parsed");_e(this,"skip");_e(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,a&&Object.assign(this,a)}inRange(a,s,l){const o=this.options,{x:u,y:d}=this.getProps(["x","y"],l);return Math.pow(a-u,2)+Math.pow(s-d,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(a,s){return Sb(this,a,"x",s)}inYRange(a,s){return Sb(this,a,"y",s)}getCenterPoint(a){const{x:s,y:l}=this.getProps(["x","y"],a);return{x:s,y:l}}size(a){a=a||this.options||{};let s=a.radius||0;s=Math.max(s,s&&a.hoverRadius||0);const l=s&&a.borderWidth||0;return(s+l)*2}draw(a,s){const l=this.options;this.skip||l.radius<.1||!nr(this,s,this.size(l)/2)||(a.strokeStyle=l.borderColor,a.lineWidth=l.borderWidth,a.fillStyle=l.backgroundColor,Gf(a,l,this.x,this.y))}getRange(){const a=this.options||{};return a.radius+a.hitRadius}}_e(ac,"id","point"),_e(ac,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),_e(ac,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function WT(n,t,a){const s=n.segments,l=n.points,o=t.points,u=[];for(const d of s){let{start:f,end:g}=d;g=Gc(f,g,l);const x=Qf(a,l[f],l[g],d.loop);if(!t.segments){u.push({source:d,target:x,start:l[f],end:l[g]});continue}const b=Uv(t,x);for(const v of b){const _=Qf(a,o[v.start],o[v.end],v.loop),M=Bv(d,l,_);for(const j of M)u.push({source:j,target:v,start:{[a]:_b(x,_,"start",Math.max)},end:{[a]:_b(x,_,"end",Math.min)}})}}return u}function Qf(n,t,a,s){if(s)return;let l=t[n],o=a[n];return n==="angle"&&(l=Hn(l),o=Hn(o)),{property:n,start:l,end:o}}function JT(n,t){const{x:a=null,y:s=null}=n||{},l=t.points,o=[];return t.segments.forEach(({start:u,end:d})=>{d=Gc(u,d,l);const f=l[u],g=l[d];s!==null?(o.push({x:f.x,y:s}),o.push({x:g.x,y:s})):a!==null&&(o.push({x:a,y:f.y}),o.push({x:a,y:g.y}))}),o}function Gc(n,t,a){for(;t>n;t--){const s=a[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function _b(n,t,a,s){return n&&t?s(n[a],t[a]):n?n[a]:t?t[a]:0}function e1(n,t){let a=[],s=!1;return vt(n)?(s=!0,a=n):a=JT(n,t),a.length?new Ya({points:a,options:{tension:0},_loop:s,_fullLoop:s}):null}function wb(n){return n&&n.fill!==!1}function ek(n,t,a){let l=n[t].fill;const o=[t];let u;if(!a)return l;for(;l!==!1&&o.indexOf(l)===-1;){if(!kt(l))return l;if(u=n[l],!u)return!1;if(u.visible)return l;o.push(l),l=u.fill}return!1}function tk(n,t,a){const s=sk(n);if(Re(s))return isNaN(s.value)?!1:s;let l=parseFloat(s);return kt(l)&&Math.floor(l)===l?nk(s[0],t,l,a):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function nk(n,t,a,s){return(n==="-"||n==="+")&&(a=t+a),a===t||a<0||a>=s?!1:a}function ak(n,t){let a=null;return n==="start"?a=t.bottom:n==="end"?a=t.top:Re(n)?a=t.getPixelForValue(n.value):t.getBasePixel&&(a=t.getBasePixel()),a}function ik(n,t,a){let s;return n==="start"?s=a:n==="end"?s=t.options.reverse?t.min:t.max:Re(n)?s=n.value:s=t.getBaseValue(),s}function sk(n){const t=n.options,a=t.fill;let s=ze(a&&a.target,a);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function lk(n){const{scale:t,index:a,line:s}=n,l=[],o=s.segments,u=s.points,d=rk(t,a);d.push(e1({x:null,y:t.bottom},s));for(let f=0;f<o.length;f++){const g=o[f];for(let x=g.start;x<=g.end;x++)ok(l,u[x],d)}return new Ya({points:l,options:{}})}function rk(n,t){const a=[],s=n.getMatchingVisibleMetas("line");for(let l=0;l<s.length;l++){const o=s[l];if(o.index===t)break;o.hidden||a.unshift(o.dataset)}return a}function ok(n,t,a){const s=[];for(let l=0;l<a.length;l++){const o=a[l],{first:u,last:d,point:f}=ck(o,t,"x");if(!(!f||u&&d)){if(u)s.unshift(f);else if(n.push(f),!d)break}}n.push(...s)}function ck(n,t,a){const s=n.interpolate(t,a);if(!s)return{};const l=s[a],o=n.segments,u=n.points;let d=!1,f=!1;for(let g=0;g<o.length;g++){const x=o[g],b=u[x.start][a],v=u[x.end][a];if(bs(l,b,v)){d=l===b,f=l===v;break}}return{first:d,last:f,point:s}}class t1{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,a,s){const{x:l,y:o,radius:u}=this;return a=a||{start:0,end:Mn},t.arc(l,o,u,a.end,a.start,!0),!s.bounds}interpolate(t){const{x:a,y:s,radius:l}=this,o=t.angle;return{x:a+Math.cos(o)*l,y:s+Math.sin(o)*l,angle:o}}}function uk(n){const{chart:t,fill:a,line:s}=n;if(kt(a))return dk(t,a);if(a==="stack")return lk(n);if(a==="shape")return!0;const l=fk(n);return l instanceof t1?l:e1(l,s)}function dk(n,t){const a=n.getDatasetMeta(t);return a&&n.isDatasetVisible(t)?a.dataset:null}function fk(n){return(n.scale||{}).getPointPositionForValue?mk(n):hk(n)}function hk(n){const{scale:t={},fill:a}=n,s=ak(a,t);if(kt(s)){const l=t.isHorizontal();return{x:l?s:null,y:l?null:s}}return null}function mk(n){const{scale:t,fill:a}=n,s=t.options,l=t.getLabels().length,o=s.reverse?t.max:t.min,u=ik(a,t,o),d=[];if(s.grid.circular){const f=t.getPointPositionForValue(0,o);return new t1({x:f.x,y:f.y,radius:t.getDistanceFromCenterForValue(u)})}for(let f=0;f<l;++f)d.push(t.getPointPositionForValue(f,u));return d}function Tf(n,t,a){const s=uk(t),{chart:l,index:o,line:u,scale:d,axis:f}=t,g=u.options,x=g.fill,b=g.backgroundColor,{above:v=b,below:_=b}=x||{},M=l.getDatasetMeta(o),j=$v(l,M);s&&u.points.length&&(Bc(n,a),gk(n,{line:u,target:s,above:v,below:_,area:a,scale:d,axis:f,clip:j}),Uc(n))}function gk(n,t){const{line:a,target:s,above:l,below:o,area:u,scale:d,clip:f}=t,g=a._loop?"angle":t.axis;n.save();let x=o;o!==l&&(g==="x"?(jb(n,s,u.top),kf(n,{line:a,target:s,color:l,scale:d,property:g,clip:f}),n.restore(),n.save(),jb(n,s,u.bottom)):g==="y"&&(Nb(n,s,u.left),kf(n,{line:a,target:s,color:o,scale:d,property:g,clip:f}),n.restore(),n.save(),Nb(n,s,u.right),x=l)),kf(n,{line:a,target:s,color:x,scale:d,property:g,clip:f}),n.restore()}function jb(n,t,a){const{segments:s,points:l}=t;let o=!0,u=!1;n.beginPath();for(const d of s){const{start:f,end:g}=d,x=l[f],b=l[Gc(f,g,l)];o?(n.moveTo(x.x,x.y),o=!1):(n.lineTo(x.x,a),n.lineTo(x.x,x.y)),u=!!t.pathSegment(n,d,{move:u}),u?n.closePath():n.lineTo(b.x,a)}n.lineTo(t.first().x,a),n.closePath(),n.clip()}function Nb(n,t,a){const{segments:s,points:l}=t;let o=!0,u=!1;n.beginPath();for(const d of s){const{start:f,end:g}=d,x=l[f],b=l[Gc(f,g,l)];o?(n.moveTo(x.x,x.y),o=!1):(n.lineTo(a,x.y),n.lineTo(x.x,x.y)),u=!!t.pathSegment(n,d,{move:u}),u?n.closePath():n.lineTo(a,b.y)}n.lineTo(a,t.first().y),n.closePath(),n.clip()}function kf(n,t){const{line:a,target:s,property:l,color:o,scale:u,clip:d}=t,f=WT(a,s,l);for(const{source:g,target:x,start:b,end:v}of f){const{style:{backgroundColor:_=o}={}}=g,M=s!==!0;n.save(),n.fillStyle=_,pk(n,u,d,M&&Qf(l,b,v)),n.beginPath();const j=!!a.pathSegment(n,g);let S;if(M){j?n.closePath():Mb(n,s,v,l);const N=!!s.pathSegment(n,x,{move:j,reverse:!0});S=j&&N,S||Mb(n,s,b,l)}n.closePath(),n.fill(S?"evenodd":"nonzero"),n.restore()}}function pk(n,t,a,s){const l=t.chart.chartArea,{property:o,start:u,end:d}=s||{};if(o==="x"||o==="y"){let f,g,x,b;o==="x"?(f=u,g=l.top,x=d,b=l.bottom):(f=l.left,g=u,x=l.right,b=d),n.beginPath(),a&&(f=Math.max(f,a.left),x=Math.min(x,a.right),g=Math.max(g,a.top),b=Math.min(b,a.bottom)),n.rect(f,g,x-f,b-g),n.clip()}}function Mb(n,t,a,s){const l=t.interpolate(a,s);l&&n.lineTo(l.x,l.y)}var xk={id:"filler",afterDatasetsUpdate(n,t,a){const s=(n.data.datasets||[]).length,l=[];let o,u,d,f;for(u=0;u<s;++u)o=n.getDatasetMeta(u),d=o.dataset,f=null,d&&d.options&&d instanceof Ya&&(f={visible:n.isDatasetVisible(u),index:u,fill:tk(d,u,s),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:d}),o.$filler=f,l.push(f);for(u=0;u<s;++u)f=l[u],!(!f||f.fill===!1)&&(f.fill=ek(l,u,a.propagate))},beforeDraw(n,t,a){const s=a.drawTime==="beforeDraw",l=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let u=l.length-1;u>=0;--u){const d=l[u].$filler;d&&(d.line.updateControlPoints(o,d.axis),s&&d.fill&&Tf(n.ctx,d,o))}},beforeDatasetsDraw(n,t,a){if(a.drawTime!=="beforeDatasetsDraw")return;const s=n.getSortedVisibleDatasetMetas();for(let l=s.length-1;l>=0;--l){const o=s[l].$filler;wb(o)&&Tf(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,a){const s=t.meta.$filler;!wb(s)||a.drawTime!=="beforeDatasetDraw"||Tf(n.ctx,s,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Tb=(n,t)=>{let{boxHeight:a=t,boxWidth:s=t}=n;return n.usePointStyle&&(a=Math.min(a,t),s=n.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:a,itemHeight:Math.max(t,a)}},bk=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class kb extends Fa{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,a,s){this.maxWidth=t,this.maxHeight=a,this._margins=s,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 a=Pe(t.generateLabels,[this.chart],this)||[];t.filter&&(a=a.filter(s=>t.filter(s,this.chart.data))),t.sort&&(a=a.sort((s,l)=>t.sort(s,l,this.chart.data))),this.options.reverse&&a.reverse(),this.legendItems=a}fit(){const{options:t,ctx:a}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,l=Yt(s.font),o=l.size,u=this._computeTitleHeight(),{boxWidth:d,itemHeight:f}=Tb(s,o);let g,x;a.font=l.string,this.isHorizontal()?(g=this.maxWidth,x=this._fitRows(u,o,d,f)+10):(x=this.maxHeight,g=this._fitCols(u,l,d,f)+10),this.width=Math.min(g,t.maxWidth||this.maxWidth),this.height=Math.min(x,t.maxHeight||this.maxHeight)}_fitRows(t,a,s,l){const{ctx:o,maxWidth:u,options:{labels:{padding:d}}}=this,f=this.legendHitBoxes=[],g=this.lineWidths=[0],x=l+d;let b=t;o.textAlign="left",o.textBaseline="middle";let v=-1,_=-x;return this.legendItems.forEach((M,j)=>{const S=s+a/2+o.measureText(M.text).width;(j===0||g[g.length-1]+S+2*d>u)&&(b+=x,g[g.length-(j>0?0:1)]=0,_+=x,v++),f[j]={left:0,top:_,row:v,width:S,height:l},g[g.length-1]+=S+d}),b}_fitCols(t,a,s,l){const{ctx:o,maxHeight:u,options:{labels:{padding:d}}}=this,f=this.legendHitBoxes=[],g=this.columnSizes=[],x=u-t;let b=d,v=0,_=0,M=0,j=0;return this.legendItems.forEach((S,N)=>{const{itemWidth:C,itemHeight:k}=yk(s,a,o,S,l);N>0&&_+k+2*d>x&&(b+=v+d,g.push({width:v,height:_}),M+=v+d,j++,v=_=0),f[N]={left:M,top:_,col:j,width:C,height:k},v=Math.max(v,C),_+=k+d}),b+=v,g.push({width:v,height:_}),b}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:a,options:{align:s,labels:{padding:l},rtl:o}}=this,u=_s(o,this.left,this.width);if(this.isHorizontal()){let d=0,f=Jt(s,this.left+l,this.right-this.lineWidths[d]);for(const g of a)d!==g.row&&(d=g.row,f=Jt(s,this.left+l,this.right-this.lineWidths[d])),g.top+=this.top+t+l,g.left=u.leftForLtr(u.x(f),g.width),f+=g.width+l}else{let d=0,f=Jt(s,this.top+t+l,this.bottom-this.columnSizes[d].height);for(const g of a)g.col!==d&&(d=g.col,f=Jt(s,this.top+t+l,this.bottom-this.columnSizes[d].height)),g.top=f,g.left+=this.left+l,g.left=u.leftForLtr(u.x(g.left),g.width),f+=g.height+l}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Bc(t,this),this._draw(),Uc(t)}}_draw(){const{options:t,columnSizes:a,lineWidths:s,ctx:l}=this,{align:o,labels:u}=t,d=lt.color,f=_s(t.rtl,this.left,this.width),g=Yt(u.font),{padding:x}=u,b=g.size,v=b/2;let _;this.drawTitle(),l.textAlign=f.textAlign("left"),l.textBaseline="middle",l.lineWidth=.5,l.font=g.string;const{boxWidth:M,boxHeight:j,itemHeight:S}=Tb(u,b),N=function(z,L,R){if(isNaN(M)||M<=0||isNaN(j)||j<0)return;l.save();const X=ze(R.lineWidth,1);if(l.fillStyle=ze(R.fillStyle,d),l.lineCap=ze(R.lineCap,"butt"),l.lineDashOffset=ze(R.lineDashOffset,0),l.lineJoin=ze(R.lineJoin,"miter"),l.lineWidth=X,l.strokeStyle=ze(R.strokeStyle,d),l.setLineDash(ze(R.lineDash,[])),u.usePointStyle){const de={radius:j*Math.SQRT2/2,pointStyle:R.pointStyle,rotation:R.rotation,borderWidth:X},Q=f.xPlus(z,M/2),ae=L+v;kv(l,de,Q,ae,u.pointStyleWidth&&M)}else{const de=L+Math.max((b-j)/2,0),Q=f.leftForLtr(z,M),ae=Zl(R.borderRadius);l.beginPath(),Object.values(ae).some(Ee=>Ee!==0)?qf(l,{x:Q,y:de,w:M,h:j,radius:ae}):l.rect(Q,de,M,j),l.fill(),X!==0&&l.stroke()}l.restore()},C=function(z,L,R){vc(l,R.text,z,L+S/2,g,{strikethrough:R.hidden,textAlign:f.textAlign(R.textAlign)})},k=this.isHorizontal(),E=this._computeTitleHeight();k?_={x:Jt(o,this.left+x,this.right-s[0]),y:this.top+x+E,line:0}:_={x:this.left+x,y:Jt(o,this.top+E+x,this.bottom-a[0].height),line:0},Ov(this.ctx,t.textDirection);const A=S+x;this.legendItems.forEach((z,L)=>{l.strokeStyle=z.fontColor,l.fillStyle=z.fontColor;const R=l.measureText(z.text).width,X=f.textAlign(z.textAlign||(z.textAlign=u.textAlign)),de=M+v+R;let Q=_.x,ae=_.y;f.setWidth(this.width),k?L>0&&Q+de+x>this.right&&(ae=_.y+=A,_.line++,Q=_.x=Jt(o,this.left+x,this.right-s[_.line])):L>0&&ae+A>this.bottom&&(Q=_.x=Q+a[_.line].width+x,_.line++,ae=_.y=Jt(o,this.top+E+x,this.bottom-a[_.line].height));const Ee=f.x(Q);if(N(Ee,ae,z),Q=p4(X,Q+M+v,k?Q+de:this.right,t.rtl),C(f.x(Q),ae,z),k)_.x+=de+x;else if(typeof z.text!="string"){const Oe=g.lineHeight;_.y+=n1(z,Oe)+x}else _.y+=A}),Lv(this.ctx,t.textDirection)}drawTitle(){const t=this.options,a=t.title,s=Yt(a.font),l=Tn(a.padding);if(!a.display)return;const o=_s(t.rtl,this.left,this.width),u=this.ctx,d=a.position,f=s.size/2,g=l.top+f;let x,b=this.left,v=this.width;if(this.isHorizontal())v=Math.max(...this.lineWidths),x=this.top+g,b=Jt(t.align,b,this.right-v);else{const M=this.columnSizes.reduce((j,S)=>Math.max(j,S.height),0);x=g+Jt(t.align,this.top,this.bottom-M-t.labels.padding-this._computeTitleHeight())}const _=Jt(d,b,b+v);u.textAlign=o.textAlign(Nv(d)),u.textBaseline="middle",u.strokeStyle=a.color,u.fillStyle=a.color,u.font=s.string,vc(u,a.text,_,x,s)}_computeTitleHeight(){const t=this.options.title,a=Yt(t.font),s=Tn(t.padding);return t.display?a.lineHeight+s.height:0}_getLegendItemAt(t,a){let s,l,o;if(bs(t,this.left,this.right)&&bs(a,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(l=o[s],bs(t,l.left,l.left+l.width)&&bs(a,l.top,l.top+l.height))return this.legendItems[s]}return null}handleEvent(t){const a=this.options;if(!_k(t.type,a))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const l=this._hoveredItem,o=bk(l,s);l&&!o&&Pe(a.onLeave,[t,l,this],this),this._hoveredItem=s,s&&!o&&Pe(a.onHover,[t,s,this],this)}else s&&Pe(a.onClick,[t,s,this],this)}}function yk(n,t,a,s,l){const o=vk(s,n,t,a),u=Sk(l,s,t.lineHeight);return{itemWidth:o,itemHeight:u}}function vk(n,t,a,s){let l=n.text;return l&&typeof l!="string"&&(l=l.reduce((o,u)=>o.length>u.length?o:u)),t+a.size/2+s.measureText(l).width}function Sk(n,t,a){let s=n;return typeof t.text!="string"&&(s=n1(t,a)),s}function n1(n,t){const a=n.text?n.text.length:0;return t*a}function _k(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var wk={id:"legend",_element:kb,start(n,t,a){const s=n.legend=new kb({ctx:n.ctx,options:a,chart:n});Va.configure(n,s,a),Va.addBox(n,s)},stop(n){Va.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,a){const s=n.legend;Va.configure(n,s,a),s.options=a},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,a){const s=t.datasetIndex,l=a.chart;l.isDatasetVisible(s)?(l.hide(s),t.hidden=!0):(l.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:a,pointStyle:s,textAlign:l,color:o,useBorderRadius:u,borderRadius:d}}=n.legend.options;return n._getSortedDatasetMetas().map(f=>{const g=f.controller.getStyle(a?0:void 0),x=Tn(g.borderWidth);return{text:t[f.index].label,fillStyle:g.backgroundColor,fontColor:o,hidden:!f.visible,lineCap:g.borderCapStyle,lineDash:g.borderDash,lineDashOffset:g.borderDashOffset,lineJoin:g.borderJoinStyle,lineWidth:(x.width+x.height)/4,strokeStyle:g.borderColor,pointStyle:s||g.pointStyle,rotation:g.rotation,textAlign:l||g.textAlign,borderRadius:u&&(d||g.borderRadius),datasetIndex:f.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};const ql={average(n){if(!n.length)return!1;let t,a,s=new Set,l=0,o=0;for(t=0,a=n.length;t<a;++t){const d=n[t].element;if(d&&d.hasValue()){const f=d.tooltipPosition();s.add(f.x),l+=f.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((d,f)=>d+f)/s.size,y:l/o}},nearest(n,t){if(!n.length)return!1;let a=t.x,s=t.y,l=Number.POSITIVE_INFINITY,o,u,d;for(o=0,u=n.length;o<u;++o){const f=n[o].element;if(f&&f.hasValue()){const g=f.getCenterPoint(),x=Vf(t,g);x<l&&(l=x,d=f)}}if(d){const f=d.tooltipPosition();a=f.x,s=f.y}return{x:a,y:s}}};function On(n,t){return t&&(vt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function ra(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-1?n.split(`
`):n}function jk(n,t){const{element:a,datasetIndex:s,index:l}=t,o=n.getDatasetMeta(s).controller,{label:u,value:d}=o.getLabelAndValue(l);return{chart:n,label:u,parsed:o.getParsed(l),raw:n.data.datasets[s].data[l],formattedValue:d,dataset:o.getDataset(),dataIndex:l,datasetIndex:s,element:a}}function Cb(n,t){const a=n.chart.ctx,{body:s,footer:l,title:o}=n,{boxWidth:u,boxHeight:d}=t,f=Yt(t.bodyFont),g=Yt(t.titleFont),x=Yt(t.footerFont),b=o.length,v=l.length,_=s.length,M=Tn(t.padding);let j=M.height,S=0,N=s.reduce((E,A)=>E+A.before.length+A.lines.length+A.after.length,0);if(N+=n.beforeBody.length+n.afterBody.length,b&&(j+=b*g.lineHeight+(b-1)*t.titleSpacing+t.titleMarginBottom),N){const E=t.displayColors?Math.max(d,f.lineHeight):f.lineHeight;j+=_*E+(N-_)*f.lineHeight+(N-1)*t.bodySpacing}v&&(j+=t.footerMarginTop+v*x.lineHeight+(v-1)*t.footerSpacing);let C=0;const k=function(E){S=Math.max(S,a.measureText(E).width+C)};return a.save(),a.font=g.string,Ve(n.title,k),a.font=f.string,Ve(n.beforeBody.concat(n.afterBody),k),C=t.displayColors?u+2+t.boxPadding:0,Ve(s,E=>{Ve(E.before,k),Ve(E.lines,k),Ve(E.after,k)}),C=0,a.font=x.string,Ve(n.footer,k),a.restore(),S+=M.width,{width:S,height:j}}function Nk(n,t){const{y:a,height:s}=t;return a<s/2?"top":a>n.height-s/2?"bottom":"center"}function Mk(n,t,a,s){const{x:l,width:o}=s,u=a.caretSize+a.caretPadding;if(n==="left"&&l+o+u>t.width||n==="right"&&l-o-u<0)return!0}function Tk(n,t,a,s){const{x:l,width:o}=a,{width:u,chartArea:{left:d,right:f}}=n;let g="center";return s==="center"?g=l<=(d+f)/2?"left":"right":l<=o/2?g="left":l>=u-o/2&&(g="right"),Mk(g,n,t,a)&&(g="center"),g}function Eb(n,t,a){const s=a.yAlign||t.yAlign||Nk(n,a);return{xAlign:a.xAlign||t.xAlign||Tk(n,t,a,s),yAlign:s}}function kk(n,t){let{x:a,width:s}=n;return t==="right"?a-=s:t==="center"&&(a-=s/2),a}function Ck(n,t,a){let{y:s,height:l}=n;return t==="top"?s+=a:t==="bottom"?s-=l+a:s-=l/2,s}function Ab(n,t,a,s){const{caretSize:l,caretPadding:o,cornerRadius:u}=n,{xAlign:d,yAlign:f}=a,g=l+o,{topLeft:x,topRight:b,bottomLeft:v,bottomRight:_}=Zl(u);let M=kk(t,d);const j=Ck(t,f,g);return f==="center"?d==="left"?M+=g:d==="right"&&(M-=g):d==="left"?M-=Math.max(x,v)+l:d==="right"&&(M+=Math.max(b,_)+l),{x:pn(M,0,s.width-t.width),y:pn(j,0,s.height-t.height)}}function qo(n,t,a){const s=Tn(a.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-s.right:n.x+s.left}function Db(n){return On([],ra(n))}function Ek(n,t,a){return Ai(n,{tooltip:t,tooltipItems:a,type:"tooltip"})}function zb(n,t){const a=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return a?n.override(a):n}const a1={beforeTitle:sa,title(n){if(n.length>0){const t=n[0],a=t.chart.data.labels,s=a?a.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return a[t.dataIndex]}return""},afterTitle:sa,beforeBody:sa,beforeLabel:sa,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const a=n.formattedValue;return Fe(a)||(t+=a),t},labelColor(n){const a=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:a.borderColor,backgroundColor:a.backgroundColor,borderWidth:a.borderWidth,borderDash:a.borderDash,borderDashOffset:a.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const a=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:a.pointStyle,rotation:a.rotation}},afterLabel:sa,afterBody:sa,beforeFooter:sa,footer:sa,afterFooter:sa};function Bt(n,t,a,s){const l=n[t].call(a,s);return typeof l>"u"?a1[t].call(a,s):l}class Zf extends Fa{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 a=this.chart,s=this.options.setContext(this.getContext()),l=s.enabled&&a.options.animation&&s.animations,o=new Vv(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Ek(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,a){const{callbacks:s}=a,l=Bt(s,"beforeTitle",this,t),o=Bt(s,"title",this,t),u=Bt(s,"afterTitle",this,t);let d=[];return d=On(d,ra(l)),d=On(d,ra(o)),d=On(d,ra(u)),d}getBeforeBody(t,a){return Db(Bt(a.callbacks,"beforeBody",this,t))}getBody(t,a){const{callbacks:s}=a,l=[];return Ve(t,o=>{const u={before:[],lines:[],after:[]},d=zb(s,o);On(u.before,ra(Bt(d,"beforeLabel",this,o))),On(u.lines,Bt(d,"label",this,o)),On(u.after,ra(Bt(d,"afterLabel",this,o))),l.push(u)}),l}getAfterBody(t,a){return Db(Bt(a.callbacks,"afterBody",this,t))}getFooter(t,a){const{callbacks:s}=a,l=Bt(s,"beforeFooter",this,t),o=Bt(s,"footer",this,t),u=Bt(s,"afterFooter",this,t);let d=[];return d=On(d,ra(l)),d=On(d,ra(o)),d=On(d,ra(u)),d}_createItems(t){const a=this._active,s=this.chart.data,l=[],o=[],u=[];let d=[],f,g;for(f=0,g=a.length;f<g;++f)d.push(jk(this.chart,a[f]));return t.filter&&(d=d.filter((x,b,v)=>t.filter(x,b,v,s))),t.itemSort&&(d=d.sort((x,b)=>t.itemSort(x,b,s))),Ve(d,x=>{const b=zb(t.callbacks,x);l.push(Bt(b,"labelColor",this,x)),o.push(Bt(b,"labelPointStyle",this,x)),u.push(Bt(b,"labelTextColor",this,x))}),this.labelColors=l,this.labelPointStyles=o,this.labelTextColors=u,this.dataPoints=d,d}update(t,a){const s=this.options.setContext(this.getContext()),l=this._active;let o,u=[];if(!l.length)this.opacity!==0&&(o={opacity:0});else{const d=ql[s.position].call(this,l,this._eventPosition);u=this._createItems(s),this.title=this.getTitle(u,s),this.beforeBody=this.getBeforeBody(u,s),this.body=this.getBody(u,s),this.afterBody=this.getAfterBody(u,s),this.footer=this.getFooter(u,s);const f=this._size=Cb(this,s),g=Object.assign({},d,f),x=Eb(this.chart,s,g),b=Ab(s,g,x,this.chart);this.xAlign=x.xAlign,this.yAlign=x.yAlign,o={opacity:1,x:b.x,y:b.y,width:f.width,height:f.height,caretX:d.x,caretY:d.y}}this._tooltipItems=u,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:a})}drawCaret(t,a,s,l){const o=this.getCaretPosition(t,s,l);a.lineTo(o.x1,o.y1),a.lineTo(o.x2,o.y2),a.lineTo(o.x3,o.y3)}getCaretPosition(t,a,s){const{xAlign:l,yAlign:o}=this,{caretSize:u,cornerRadius:d}=s,{topLeft:f,topRight:g,bottomLeft:x,bottomRight:b}=Zl(d),{x:v,y:_}=t,{width:M,height:j}=a;let S,N,C,k,E,A;return o==="center"?(E=_+j/2,l==="left"?(S=v,N=S-u,k=E+u,A=E-u):(S=v+M,N=S+u,k=E-u,A=E+u),C=S):(l==="left"?N=v+Math.max(f,x)+u:l==="right"?N=v+M-Math.max(g,b)-u:N=this.caretX,o==="top"?(k=_,E=k-u,S=N-u,C=N+u):(k=_+j,E=k+u,S=N+u,C=N-u),A=k),{x1:S,x2:N,x3:C,y1:k,y2:E,y3:A}}drawTitle(t,a,s){const l=this.title,o=l.length;let u,d,f;if(o){const g=_s(s.rtl,this.x,this.width);for(t.x=qo(this,s.titleAlign,s),a.textAlign=g.textAlign(s.titleAlign),a.textBaseline="middle",u=Yt(s.titleFont),d=s.titleSpacing,a.fillStyle=s.titleColor,a.font=u.string,f=0;f<o;++f)a.fillText(l[f],g.x(t.x),t.y+u.lineHeight/2),t.y+=u.lineHeight+d,f+1===o&&(t.y+=s.titleMarginBottom-d)}}_drawColorBox(t,a,s,l,o){const u=this.labelColors[s],d=this.labelPointStyles[s],{boxHeight:f,boxWidth:g}=o,x=Yt(o.bodyFont),b=qo(this,"left",o),v=l.x(b),_=f<x.lineHeight?(x.lineHeight-f)/2:0,M=a.y+_;if(o.usePointStyle){const j={radius:Math.min(g,f)/2,pointStyle:d.pointStyle,rotation:d.rotation,borderWidth:1},S=l.leftForLtr(v,g)+g/2,N=M+f/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Gf(t,j,S,N),t.strokeStyle=u.borderColor,t.fillStyle=u.backgroundColor,Gf(t,j,S,N)}else{t.lineWidth=Re(u.borderWidth)?Math.max(...Object.values(u.borderWidth)):u.borderWidth||1,t.strokeStyle=u.borderColor,t.setLineDash(u.borderDash||[]),t.lineDashOffset=u.borderDashOffset||0;const j=l.leftForLtr(v,g),S=l.leftForLtr(l.xPlus(v,1),g-2),N=Zl(u.borderRadius);Object.values(N).some(C=>C!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,qf(t,{x:j,y:M,w:g,h:f,radius:N}),t.fill(),t.stroke(),t.fillStyle=u.backgroundColor,t.beginPath(),qf(t,{x:S,y:M+1,w:g-2,h:f-2,radius:N}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(j,M,g,f),t.strokeRect(j,M,g,f),t.fillStyle=u.backgroundColor,t.fillRect(S,M+1,g-2,f-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,a,s){const{body:l}=this,{bodySpacing:o,bodyAlign:u,displayColors:d,boxHeight:f,boxWidth:g,boxPadding:x}=s,b=Yt(s.bodyFont);let v=b.lineHeight,_=0;const M=_s(s.rtl,this.x,this.width),j=function(R){a.fillText(R,M.x(t.x+_),t.y+v/2),t.y+=v+o},S=M.textAlign(u);let N,C,k,E,A,z,L;for(a.textAlign=u,a.textBaseline="middle",a.font=b.string,t.x=qo(this,S,s),a.fillStyle=s.bodyColor,Ve(this.beforeBody,j),_=d&&S!=="right"?u==="center"?g/2+x:g+2+x:0,E=0,z=l.length;E<z;++E){for(N=l[E],C=this.labelTextColors[E],a.fillStyle=C,Ve(N.before,j),k=N.lines,d&&k.length&&(this._drawColorBox(a,t,E,M,s),v=Math.max(b.lineHeight,f)),A=0,L=k.length;A<L;++A)j(k[A]),v=b.lineHeight;Ve(N.after,j)}_=0,v=b.lineHeight,Ve(this.afterBody,j),t.y-=o}drawFooter(t,a,s){const l=this.footer,o=l.length;let u,d;if(o){const f=_s(s.rtl,this.x,this.width);for(t.x=qo(this,s.footerAlign,s),t.y+=s.footerMarginTop,a.textAlign=f.textAlign(s.footerAlign),a.textBaseline="middle",u=Yt(s.footerFont),a.fillStyle=s.footerColor,a.font=u.string,d=0;d<o;++d)a.fillText(l[d],f.x(t.x),t.y+u.lineHeight/2),t.y+=u.lineHeight+s.footerSpacing}}drawBackground(t,a,s,l){const{xAlign:o,yAlign:u}=this,{x:d,y:f}=t,{width:g,height:x}=s,{topLeft:b,topRight:v,bottomLeft:_,bottomRight:M}=Zl(l.cornerRadius);a.fillStyle=l.backgroundColor,a.strokeStyle=l.borderColor,a.lineWidth=l.borderWidth,a.beginPath(),a.moveTo(d+b,f),u==="top"&&this.drawCaret(t,a,s,l),a.lineTo(d+g-v,f),a.quadraticCurveTo(d+g,f,d+g,f+v),u==="center"&&o==="right"&&this.drawCaret(t,a,s,l),a.lineTo(d+g,f+x-M),a.quadraticCurveTo(d+g,f+x,d+g-M,f+x),u==="bottom"&&this.drawCaret(t,a,s,l),a.lineTo(d+_,f+x),a.quadraticCurveTo(d,f+x,d,f+x-_),u==="center"&&o==="left"&&this.drawCaret(t,a,s,l),a.lineTo(d,f+b),a.quadraticCurveTo(d,f,d+b,f),a.closePath(),a.fill(),l.borderWidth>0&&a.stroke()}_updateAnimationTarget(t){const a=this.chart,s=this.$animations,l=s&&s.x,o=s&&s.y;if(l||o){const u=ql[t.position].call(this,this._active,this._eventPosition);if(!u)return;const d=this._size=Cb(this,t),f=Object.assign({},u,this._size),g=Eb(a,t,f),x=Ab(t,f,g,a);(l._to!==x.x||o._to!==x.y)&&(this.xAlign=g.xAlign,this.yAlign=g.yAlign,this.width=d.width,this.height=d.height,this.caretX=u.x,this.caretY=u.y,this._resolveAnimations().update(this,x))}}_willRender(){return!!this.opacity}draw(t){const a=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(a);const l={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const u=Tn(a.padding),d=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;a.enabled&&d&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,l,a),Ov(t,a.textDirection),o.y+=u.top,this.drawTitle(o,t,a),this.drawBody(o,t,a),this.drawFooter(o,t,a),Lv(t,a.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,a){const s=this._active,l=t.map(({datasetIndex:d,index:f})=>{const g=this.chart.getDatasetMeta(d);if(!g)throw new Error("Cannot find a dataset at index "+d);return{datasetIndex:d,element:g.data[f],index:f}}),o=!gc(s,l),u=this._positionChanged(l,a);(o||u)&&(this._active=l,this._eventPosition=a,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,a,s=!0){if(a&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,o=this._active||[],u=this._getActiveElements(t,o,a,s),d=this._positionChanged(u,t),f=a||!gc(u,o)||d;return f&&(this._active=u,(l.enabled||l.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,a))),f}_getActiveElements(t,a,s,l){const o=this.options;if(t.type==="mouseout")return[];if(!l)return a.filter(d=>this.chart.data.datasets[d.datasetIndex]&&this.chart.getDatasetMeta(d.datasetIndex).controller.getParsed(d.index)!==void 0);const u=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&u.reverse(),u}_positionChanged(t,a){const{caretX:s,caretY:l,options:o}=this,u=ql[o.position].call(this,t,a);return u!==!1&&(s!==u.x||l!==u.y)}}_e(Zf,"positioners",ql);var Ak={id:"tooltip",_element:Zf,positioners:ql,afterInit(n,t,a){a&&(n.tooltip=new Zf({chart:n,options:a}))},beforeUpdate(n,t,a){n.tooltip&&n.tooltip.initialize(a)},reset(n,t,a){n.tooltip&&n.tooltip.initialize(a)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const a={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...a,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",a)}},afterEvent(n,t){if(n.tooltip){const a=t.replay;n.tooltip.handleEvent(t.event,a,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:(n,t)=>t.bodyFont.size,boxWidth:(n,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:a1},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Dk=(n,t,a,s)=>(typeof t=="string"?(a=n.push(t)-1,s.unshift({index:a,label:t})):isNaN(t)&&(a=null),a);function zk(n,t,a,s){const l=n.indexOf(t);if(l===-1)return Dk(n,t,a,s);const o=n.lastIndexOf(t);return l!==o?a:l}const Rk=(n,t)=>n===null?null:pn(Math.round(n),0,t);function Rb(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Kf extends Bs{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const a=this._addedLabels;if(a.length){const s=this.getLabels();for(const{index:l,label:o}of a)s[l]===o&&s.splice(l,1);this._addedLabels=[]}super.init(t)}parse(t,a){if(Fe(t))return null;const s=this.getLabels();return a=isFinite(a)&&s[a]===t?a:zk(s,t,ze(a,t),this._addedLabels),Rk(a,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:a}=this.getUserBounds();let{min:s,max:l}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),a||(l=this.getLabels().length-1)),this.min=s,this.max=l}buildTicks(){const t=this.min,a=this.max,s=this.options.offset,l=[];let o=this.getLabels();o=t===0&&a===o.length-1?o:o.slice(t,a+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let u=t;u<=a;u++)l.push({value:u});return l}getLabelForValue(t){return Rb.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 a=this.ticks;return t<0||t>a.length-1?null:this.getPixelForValue(a[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}_e(Kf,"id","category"),_e(Kf,"defaults",{ticks:{callback:Rb}});function Ok(n,t){const a=[],{bounds:l,step:o,min:u,max:d,precision:f,count:g,maxTicks:x,maxDigits:b,includeBounds:v}=n,_=o||1,M=x-1,{min:j,max:S}=t,N=!Fe(u),C=!Fe(d),k=!Fe(g),E=(S-j)/(b+1);let A=Rx((S-j)/M/_)*_,z,L,R,X;if(A<1e-14&&!N&&!C)return[{value:j},{value:S}];X=Math.ceil(S/A)-Math.floor(j/A),X>M&&(A=Rx(X*A/M/_)*_),Fe(f)||(z=Math.pow(10,f),A=Math.ceil(A*z)/z),l==="ticks"?(L=Math.floor(j/A)*A,R=Math.ceil(S/A)*A):(L=j,R=S),N&&C&&o&&s4((d-u)/o,A/1e3)?(X=Math.round(Math.min((d-u)/A,x)),A=(d-u)/X,L=u,R=d):k?(L=N?u:L,R=C?d:R,X=g-1,A=(R-L)/X):(X=(R-L)/A,Il(X,Math.round(X),A/1e3)?X=Math.round(X):X=Math.ceil(X));const de=Math.max(Ox(A),Ox(L));z=Math.pow(10,Fe(f)?de:f),L=Math.round(L*z)/z,R=Math.round(R*z)/z;let Q=0;for(N&&(v&&L!==u?(a.push({value:u}),L<u&&Q++,Il(Math.round((L+Q*A)*z)/z,u,Ob(u,E,n))&&Q++):L<u&&Q++);Q<X;++Q){const ae=Math.round((L+Q*A)*z)/z;if(C&&ae>d)break;a.push({value:ae})}return C&&v&&R!==d?a.length&&Il(a[a.length-1].value,d,Ob(d,E,n))?a[a.length-1].value=d:a.push({value:d}):(!C||R===d)&&a.push({value:R}),a}function Ob(n,t,{horizontal:a,minRotation:s}){const l=vi(s),o=(a?Math.sin(l):Math.cos(l))||.001,u=.75*t*(""+n).length;return Math.min(t/o,u)}class Lk extends Bs{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,a){return Fe(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:a,maxDefined:s}=this.getUserBounds();let{min:l,max:o}=this;const u=f=>l=a?l:f,d=f=>o=s?o:f;if(t){const f=Ts(l),g=Ts(o);f<0&&g<0?d(0):f>0&&g>0&&u(0)}if(l===o){let f=o===0?1:Math.abs(o*.05);d(o+f),t||u(l-f)}this.min=l,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:a,stepSize:s}=t,l;return s?(l=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),a=a||11),a&&(l=Math.min(a,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,a=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const l={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:a.precision,step:a.stepSize,count:a.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:a.minRotation||0,includeBounds:a.includeBounds!==!1},o=this._range||this,u=Ok(l,o);return t.bounds==="ticks"&&l4(u,this,"value"),t.reverse?(u.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),u}configure(){const t=this.ticks;let a=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const l=(s-a)/Math.max(t.length-1,1)/2;a-=l,s+=l}this._startValue=a,this._endValue=s,this._valueRange=s-a}getLabelForValue(t){return Mv(t,this.chart.options.locale,this.options.ticks.format)}}class Pf extends Lk{determineDataLimits(){const{min:t,max:a}=this.getMinMax(!0);this.min=kt(t)?t:0,this.max=kt(a)?a:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),a=t?this.width:this.height,s=vi(this.options.ticks.minRotation),l=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(a/Math.min(40,o.lineHeight/l))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}_e(Pf,"id","linear"),_e(Pf,"defaults",{ticks:{callback:Tv.formatters.numeric}});const qc={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}},Vt=Object.keys(qc);function Lb(n,t){return n-t}function Hb(n,t){if(Fe(t))return null;const a=n._adapter,{parser:s,round:l,isoWeekday:o}=n._parseOpts;let u=t;return typeof s=="function"&&(u=s(u)),kt(u)||(u=typeof s=="string"?a.parse(u,s):a.parse(u)),u===null?null:(l&&(u=l==="week"&&(tr(o)||o===!0)?a.startOf(u,"isoWeek",o):a.startOf(u,l)),+u)}function Bb(n,t,a,s){const l=Vt.length;for(let o=Vt.indexOf(n);o<l-1;++o){const u=qc[Vt[o]],d=u.steps?u.steps:Number.MAX_SAFE_INTEGER;if(u.common&&Math.ceil((a-t)/(d*u.size))<=s)return Vt[o]}return Vt[l-1]}function Hk(n,t,a,s,l){for(let o=Vt.length-1;o>=Vt.indexOf(a);o--){const u=Vt[o];if(qc[u].common&&n._adapter.diff(l,s,u)>=t-1)return u}return Vt[a?Vt.indexOf(a):0]}function Bk(n){for(let t=Vt.indexOf(n)+1,a=Vt.length;t<a;++t)if(qc[Vt[t]].common)return Vt[t]}function Ub(n,t,a){if(!a)n[t]=!0;else if(a.length){const{lo:s,hi:l}=Ch(a,t),o=a[s]>=t?a[s]:a[l];n[o]=!0}}function Uk(n,t,a,s){const l=n._adapter,o=+l.startOf(t[0].value,s),u=t[t.length-1].value;let d,f;for(d=o;d<=u;d=+l.add(d,1,s))f=a[d],f>=0&&(t[f].major=!0);return t}function $b(n,t,a){const s=[],l={},o=t.length;let u,d;for(u=0;u<o;++u)d=t[u],l[d]=u,s.push({value:d,major:!1});return o===0||!a?s:Uk(n,s,l,a)}class wc extends Bs{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,a={}){const s=t.time||(t.time={}),l=this._adapter=new R3._date(t.adapters.date);l.init(a),Xl(s.displayFormats,l.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=a.normalized}parse(t,a){return t===void 0?null:Hb(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,a=this._adapter,s=t.time.unit||"day";let{min:l,max:o,minDefined:u,maxDefined:d}=this.getUserBounds();function f(g){!u&&!isNaN(g.min)&&(l=Math.min(l,g.min)),!d&&!isNaN(g.max)&&(o=Math.max(o,g.max))}(!u||!d)&&(f(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&f(this.getMinMax(!1))),l=kt(l)&&!isNaN(l)?l:+a.startOf(Date.now(),s),o=kt(o)&&!isNaN(o)?o:+a.endOf(Date.now(),s)+1,this.min=Math.min(l,o-1),this.max=Math.max(l+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(a=t[0],s=t[t.length-1]),{min:a,max:s}}buildTicks(){const t=this.options,a=t.time,s=t.ticks,l=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&l.length&&(this.min=this._userMin||l[0],this.max=this._userMax||l[l.length-1]);const o=this.min,u=this.max,d=f4(l,o,u);return this._unit=a.unit||(s.autoSkip?Bb(a.minUnit,this.min,this.max,this._getLabelCapacity(o)):Hk(this,d.length,a.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Bk(this._unit),this.initOffsets(l),t.reverse&&d.reverse(),$b(this,d,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let a=0,s=0,l,o;this.options.offset&&t.length&&(l=this.getDecimalForValue(t[0]),t.length===1?a=1-l:a=(this.getDecimalForValue(t[1])-l)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const u=t.length<3?.5:.25;a=pn(a,0,u),s=pn(s,0,u),this._offsets={start:a,end:s,factor:1/(a+1+s)}}_generate(){const t=this._adapter,a=this.min,s=this.max,l=this.options,o=l.time,u=o.unit||Bb(o.minUnit,a,s,this._getLabelCapacity(a)),d=ze(l.ticks.stepSize,1),f=u==="week"?o.isoWeekday:!1,g=tr(f)||f===!0,x={};let b=a,v,_;if(g&&(b=+t.startOf(b,"isoWeek",f)),b=+t.startOf(b,g?"day":u),t.diff(s,a,u)>1e5*d)throw new Error(a+" and "+s+" are too far apart with stepSize of "+d+" "+u);const M=l.ticks.source==="data"&&this.getDataTimestamps();for(v=b,_=0;v<s;v=+t.add(v,d,u),_++)Ub(x,v,M);return(v===s||l.bounds==="ticks"||_===1)&&Ub(x,v,M),Object.keys(x).sort(Lb).map(j=>+j)}getLabelForValue(t){const a=this._adapter,s=this.options.time;return s.tooltipFormat?a.format(t,s.tooltipFormat):a.format(t,s.displayFormats.datetime)}format(t,a){const l=this.options.time.displayFormats,o=this._unit,u=a||l[o];return this._adapter.format(t,u)}_tickFormatFunction(t,a,s,l){const o=this.options,u=o.ticks.callback;if(u)return Pe(u,[t,a,s],this);const d=o.time.displayFormats,f=this._unit,g=this._majorUnit,x=f&&d[f],b=g&&d[g],v=s[a],_=g&&b&&v&&v.major;return this._adapter.format(t,l||(_?b:x))}generateTickLabels(t){let a,s,l;for(a=0,s=t.length;a<s;++a)l=t[a],l.label=this._tickFormatFunction(l.value,a,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const a=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((a.start+s)*a.factor)}getValueForPixel(t){const a=this._offsets,s=this.getDecimalForPixel(t)/a.factor-a.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const a=this.options.ticks,s=this.ctx.measureText(t).width,l=vi(this.isHorizontal()?a.maxRotation:a.minRotation),o=Math.cos(l),u=Math.sin(l),d=this._resolveTickFontOptions(0).size;return{w:s*o+d*u,h:s*u+d*o}}_getLabelCapacity(t){const a=this.options.time,s=a.displayFormats,l=s[a.unit]||s.millisecond,o=this._tickFormatFunction(t,0,$b(this,[t],this._majorUnit),l),u=this._getLabelSize(o),d=Math.floor(this.isHorizontal()?this.width/u.w:this.height/u.h)-1;return d>0?d:1}getDataTimestamps(){let t=this._cache.data||[],a,s;if(t.length)return t;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(a=0,s=l.length;a<s;++a)t=t.concat(l[a].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let a,s;if(t.length)return t;const l=this.getLabels();for(a=0,s=l.length;a<s;++a)t.push(Hb(this,l[a]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return m4(t.sort(Lb))}}_e(wc,"id","time"),_e(wc,"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 Xo(n,t,a){let s=0,l=n.length-1,o,u,d,f;a?(t>=n[s].pos&&t<=n[l].pos&&({lo:s,hi:l}=Si(n,"pos",t)),{pos:o,time:d}=n[s],{pos:u,time:f}=n[l]):(t>=n[s].time&&t<=n[l].time&&({lo:s,hi:l}=Si(n,"time",t)),{time:o,pos:d}=n[s],{time:u,pos:f}=n[l]);const g=u-o;return g?d+(f-d)*(t-o)/g:d}class Vb extends wc{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),a=this._table=this.buildLookupTable(t);this._minPos=Xo(a,this.min),this._tableRange=Xo(a,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:a,max:s}=this,l=[],o=[];let u,d,f,g,x;for(u=0,d=t.length;u<d;++u)g=t[u],g>=a&&g<=s&&l.push(g);if(l.length<2)return[{time:a,pos:0},{time:s,pos:1}];for(u=0,d=l.length;u<d;++u)x=l[u+1],f=l[u-1],g=l[u],Math.round((x+f)/2)!==g&&o.push({time:g,pos:u/(d-1)});return o}_generate(){const t=this.min,a=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(a)||s.length===1)&&s.push(a),s.sort((l,o)=>l-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const a=this.getDataTimestamps(),s=this.getLabelTimestamps();return a.length&&s.length?t=this.normalize(a.concat(s)):t=a.length?a:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Xo(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const a=this._offsets,s=this.getDecimalForPixel(t)/a.factor-a.end;return Xo(this._table,s*this._tableRange+this._minPos,!0)}}_e(Vb,"id","timeseries"),_e(Vb,"defaults",wc.defaults);const i1="label";function Yb(n,t){typeof n=="function"?n(t):n&&(n.current=t)}function $k(n,t){const a=n.options;a&&t&&Object.assign(a,t)}function s1(n,t){n.labels=t}function l1(n,t,a=i1){const s=[];n.datasets=t.map(l=>{const o=n.datasets.find(u=>u[a]===l[a]);return!o||!l.data||s.includes(o)?{...l}:(s.push(o),Object.assign(o,l),o)})}function Vk(n,t=i1){const a={labels:[],datasets:[]};return s1(a,n.labels),l1(a,n.datasets,t),a}function Yk(n,t){const{height:a=150,width:s=300,redraw:l=!1,datasetIdKey:o,type:u,data:d,options:f,plugins:g=[],fallbackContent:x,updateMode:b,...v}=n,_=w.useRef(null),M=w.useRef(null),j=()=>{_.current&&(M.current=new Yc(_.current,{type:u,data:Vk(d,o),options:f&&{...f},plugins:g}),Yb(t,M.current))},S=()=>{Yb(t,null),M.current&&(M.current.destroy(),M.current=null)};return w.useEffect(()=>{!l&&M.current&&f&&$k(M.current,f)},[l,f]),w.useEffect(()=>{!l&&M.current&&s1(M.current.config.data,d.labels)},[l,d.labels]),w.useEffect(()=>{!l&&M.current&&d.datasets&&l1(M.current.config.data,d.datasets,o)},[l,d.datasets]),w.useEffect(()=>{M.current&&(l?(S(),setTimeout(j)):M.current.update(b))},[l,f,d.labels,d.datasets,b]),w.useEffect(()=>{M.current&&(S(),setTimeout(j))},[u]),w.useEffect(()=>(j(),()=>S()),[]),h.jsx("canvas",{ref:_,role:"img",height:a,width:s,...v,children:x})}const Gk=w.forwardRef(Yk);function qk(n,t){return Yc.register(t),w.forwardRef((a,s)=>h.jsx(Gk,{...a,ref:s,type:n}))}const Xk=qk("line",ec);Yc.register(Ya,Kf,Pf,ac,wk,Ak,xk);const Gb="'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif",Ik=10,qb={borderColor:"rgba(239, 68, 68, 0.3)"},Xb={mobile:{pointRadius:.5,pointHoverRadius:3,animationDuration:300},desktop:{pointRadius:1,pointHoverRadius:4,animationDuration:1e3}},Fk={left:0,right:0,top:10,bottom:0},Ib="rgba(0, 0, 0, 0.1)";function jc({title:n,children:t,id:a,stats:s,icon:l}){return h.jsxs("div",{id:a,className:"rounded-xl border border-gray-100 bg-white transition-all duration-200 hover:border-gray-200 hover:shadow-sm overflow-hidden dark:border-slate-800 dark:bg-slate-900 dark:hover:border-slate-700",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1 border-b border-gray-100 px-5 py-3 dark:border-slate-800",children:[h.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold text-gray-900 dark:text-gray-100",children:[l,n]}),s&&s.length>0&&h.jsx("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1",children:s.map((o,u)=>h.jsxs("span",{className:"text-[11px] text-gray-400 dark:text-slate-500",children:[o.label," ",h.jsx("span",{className:"font-semibold text-gray-700 dark:text-gray-200",children:o.value})]},u))})]}),h.jsx("div",{className:"p-4",children:t})]})}function Wf({labels:n,series:t,yAxisMin:a,yAxisMax:s,yStepSize:l,stepped:o,yTickLabels:u,formatTooltipValue:d,heightClass:f="h-48 md:h-56"}){const g=w.useMemo(()=>typeof window<"u"&&window.innerWidth<768,[]),x=w.useMemo(()=>g?Xb.mobile:Xb.desktop,[g]);ry.useMemo(()=>{const N=n.filter(X=>X);if(N.length===0)return{startHour:0,endHour:24,hours:Array.from({length:25},(X,de)=>de)};const C=N[0],k=N[N.length-1];if(!C||!k)return{startHour:0,endHour:24,hours:Array.from({length:25},(X,de)=>de)};const[E]=C.split(":").map(Number),[A]=k.split(":").map(Number),z=E;let L=A;L<=z&&(L=z+24);const R=[];for(let X=z;X<=L;X++)R.push(X%24);return{startHour:z,endHour:L,hours:R}},[n]);const b=w.useMemo(()=>n.map(N=>{if(!N)return null;const[C]=N.split(":").map(Number);return C}),[n]),v=w.useCallback((N,C)=>{if(C<0||C>=b.length)return"";const k=b[C];return k===null||b.findIndex(A=>A===k)!==C?"":J(k.toString())},[b]),_=w.useMemo(()=>({label:N=>{const C=N.dataset.label||"",k=N.parsed.y??null,E=d?d(k):J((k??0).toFixed(2));return`${C}: ${E}`},title:N=>{var k;return`ساعت: ${((k=N[0])==null?void 0:k.label)||""}`}}),[d]),M=w.useMemo(()=>({family:Gb,size:Ik}),[]),j=w.useMemo(()=>t.map((N,C)=>({label:N.label,data:N.data,borderColor:N.borderColor,backgroundColor:N.backgroundColor??N.borderColor,fill:N.fill??!1,tension:.3,stepped:o??!1,pointRadius:x.pointRadius,pointHoverRadius:x.pointHoverRadius,borderWidth:1,spanGaps:!0,segment:{borderDash:k=>{const E=k.p0DataIndex,A=k.p1DataIndex,z=N.data;if(z[E]===null||z[A]===null)return[10,10];const L=Math.min(E,A),R=Math.max(E,A);for(let X=L+1;X<R;X++)if(z[X]===null)return[10,10];return[]},borderColor:k=>{const E=k.p0DataIndex,A=k.p1DataIndex,z=N.data;if(z[E]===null||z[A]===null)return qb.borderColor;const L=Math.min(E,A),R=Math.max(E,A);for(let X=L+1;X<R;X++)if(z[X]===null)return qb.borderColor;return N.borderColor}}})),[t,x,o]),S=w.useMemo(()=>({responsive:!0,maintainAspectRatio:!1,animation:{duration:x.animationDuration},interaction:{intersect:!1,mode:"index"},layout:{padding:Fk},font:{family:Gb},plugins:{legend:{display:!1},tooltip:{displayColors:!1,titleFont:M,bodyFont:M,callbacks:_}},scales:{x:{display:!0,ticks:{font:M,maxRotation:0,minRotation:0,autoSkip:!1,callback:v},grid:{display:!1},border:{display:!0,color:Ib}},y:{display:!0,min:a!==void 0?a:void 0,max:s!==void 0?s:void 0,ticks:{font:M,padding:8,stepSize:l,callback:N=>{if(u){const C=u[Number(N)];return C!==void 0?C:""}return typeof N=="number"||typeof N=="string"?J(N.toString()):""}},grid:{display:!0},border:{display:!0,color:Ib}}}}),[x,M,_,v,a,s,l,u]);return h.jsx("div",{className:`persian-number -mx-2 ${f}`,children:h.jsx(Xk,{data:{labels:n,datasets:j},options:S})})}function Qk({filteredTelemetry:n,filteredDataGaps:t}){const a=w.useMemo(()=>n.map(o=>o.timestamp),[n]),s=w.useMemo(()=>n.map(u=>u.label),[n]);return{charts:w.useMemo(()=>JN.map(o=>{const u=n.map(o.getValue),d=KN(u,a,t);let f=o.yAxisMin,g=o.yAxisMax;if(o.key==="temp"){const x=Sx(d,0,40,10);f=x.min,g=x.max}else if(o.key==="lux"){const x=Sx(d,0,2e3,1e3);f=x.min,g=x.max}return{...o,data:d,yAxisMin:f,yAxisMax:g??f}}),[n,a,t]),chartLabels:s}}const r1="#10b981",Zk="#cbd5e1",Kk="rgba(245, 158, 11, 0.5)",Pk="rgba(148, 163, 184, 0.18)",Fb="rgba(100, 116, 139, 0.5)";function Pl(n){const t=new Date(n);return J(`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`)}function Io(n,t,a){const s=a-t||1;return`${(n-t)/s*100}%`}function Qb(n){const t=Math.round(n/6e4);if(t<60)return`${J(t)} دقیقه`;const a=Math.floor(t/60),s=t%60;return s===0?`${J(a)} ساعت`:`${J(a)}س ${J(s)}د`}function Zb(n,t,a,s){const l=[];for(let u=0;u<n.length;u++){const d=new Date(n[u].timestamp).getTime();if(Number.isNaN(d))continue;const f=u+1<n.length?new Date(n[u+1].timestamp).getTime():s;if(f<=d)continue;const g=u+1<n.length&&f-d>a;l.push({state:g?null:t(n[u]),startMs:d,endMs:f})}const o=[];for(const u of l){const d=o[o.length-1];d&&d.state===u.state&&d.endMs===u.startMs?d.endMs=u.endMs:o.push({...u})}return o}function Wk(n,t){const a=[],s=new Date(n);s.setMinutes(0,0,0),s.getTime()<n&&s.setTime(s.getTime()+36e5);const l=36e5;for(let o=s.getTime();o<=t;o+=l)a.push({ms:o,label:Pl(o)});return a.length===0&&(a.push({ms:n,label:Pl(n)}),t>n&&a.push({ms:t,label:Pl(t)})),a}function Kb(n,t){let a=0;for(const s of n)s.state===t&&(a+=s.endMs-s.startMs);return a}function Jk(n,t,a){const s=a-t||1,l=(n.startMs-t)/s*100,o=(n.endMs-n.startMs)/s*100;return{position:"absolute",top:0,bottom:0,left:`${l}%`,width:`${o}%`,backgroundColor:n.state===null?Kk:n.state===1?r1:Zk}}function eC(n,t){const a=`${Pl(t.startMs)} تا ${Pl(t.endMs)}`;return t.state===null?`${n.label}: بدون داده (${a})`:n.kind==="power"?`${n.label}: ${t.state===1?"وصل":"قطع"} (${a})`:`${n.label}: ${t.state===1?"روشن":"خاموش"} (${a})`}function tC({filteredTelemetry:n,relaysMeta:t}){const a=w.useMemo(()=>n.map(l=>l.timestamp),[n]),s=w.useMemo(()=>{const l=a.map(v=>new Date(v).getTime()).filter(v=>!Number.isNaN(v));if(l.length===0)return null;const o=l[0],u=hv(a,15)*6e4,d=fv(a,30)*6e4,f=Math.min(u,30*6e4),g=l[l.length-1]+f,x=Zb(n,v=>v.power,d,g),b=[{key:"power",label:"برق",kind:"power",color:r1,icon:Lc,iconBg:"bg-emerald-50 dark:bg-emerald-500/10",iconText:"text-emerald-600 dark:text-emerald-400",summary:`وصل ${Qb(Kb(x,1))}`,segments:x},...t.map(v=>{const _=Zb(n,M=>M.relays[v.index]??null,d,g);return{key:`relay-${v.index}`,label:v.label,kind:"relay",color:v.color,icon:v.icon,iconBg:v.iconBg,iconText:v.iconText,summary:`روشن ${Qb(Kb(_,1))}`,segments:_}})];return{axisStartMs:o,axisEndMs:g,rows:b,hourTicks:Wk(o,g),outages:x.filter(v=>v.state===0)}},[a,n,t]);return s?h.jsxs(jc,{title:"تایملاین وضعیت برق و رله‌ها",id:"state-timeline",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 mb-4 text-[11px] text-gray-500 dark:text-slate-400",children:[h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-3 h-3 rounded-full bg-emerald-500"}),"روشن / وصل"]}),h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-3 h-3 rounded bg-slate-300"}),"خاموش / قطع برق"]}),h.jsxs("span",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-3 h-3 rounded bg-amber-400/70"}),"بدون داده"]})]}),h.jsxs("div",{className:"flex gap-3",children:[h.jsx("div",{className:"w-40 sm:w-44 shrink-0 space-y-2",children:s.rows.map(l=>h.jsxs("div",{className:"h-10 flex items-center gap-2 min-w-0",children:[h.jsx("span",{className:te("w-7 h-7 rounded-lg flex items-center justify-center shrink-0",l.iconBg),children:h.jsx(l.icon,{className:te("w-3.5 h-3.5",l.iconText)})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-xs font-medium text-gray-800 dark:text-gray-200 truncate",children:l.label}),h.jsx("p",{className:"text-[10px] text-gray-400 dark:text-slate-500 truncate",children:l.summary})]})]},l.key))}),h.jsxs("div",{className:"relative flex-1",children:[h.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[s.outages.map((l,o)=>h.jsx("div",{className:"absolute top-0 bottom-0",style:{left:Io(l.startMs,s.axisStartMs,s.axisEndMs),width:Io(l.endMs-l.startMs,s.axisStartMs,s.axisEndMs),backgroundColor:Pk,borderLeft:`1px dashed ${Fb}`,borderRight:`1px dashed ${Fb}`}},`outage-${o}`)),s.hourTicks.map(l=>h.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-gray-200/70 dark:bg-slate-700/50",style:{left:Io(l.ms,s.axisStartMs,s.axisEndMs)}},l.ms))]}),h.jsx("div",{className:"relative space-y-2",children:s.rows.map(l=>h.jsx("div",{className:"h-10 relative rounded-lg bg-slate-100/60 dark:bg-slate-800/50 border border-gray-100 dark:border-slate-800 overflow-hidden",children:l.segments.map((o,u)=>h.jsx("div",{className:"absolute top-0 bottom-0",style:Jk(o,s.axisStartMs,s.axisEndMs),title:eC(l,o)},u))},l.key))})]})]}),h.jsxs("div",{className:"flex gap-3 mt-1.5",children:[h.jsx("div",{className:"w-40 sm:w-44 shrink-0"}),h.jsx("div",{className:"relative flex-1 h-4 text-[10px] text-gray-400 dark:text-slate-500",children:s.hourTicks.map(l=>h.jsx("span",{className:"absolute -translate-x-1/2 whitespace-nowrap",style:{left:Io(l.ms,s.axisStartMs,s.axisEndMs)},children:l.label},l.ms))})]})]}):null}const Pb={0:"#64748b",1:"#3b82f6",2:"#ef4444",3:"#06b6d4",4:"#0ea5e9",5:"#f59e0b",6:"#64748b"},Wb=["#3b82f6","#ef4444","#06b6d4","#0ea5e9","#f59e0b","#8b5cf6","#10b981","#f97316"],nC="#10b981";function Fo(n){const t=Math.round(n/6e4);if(t<60)return`${J(t)} دقیقه`;const a=Math.floor(t/60),s=t%60;return s===0?`${J(a)} ساعت`:`${J(a)} ساعت و ${J(s)} دقیقه`}function Jb(n,t){let a=0,s=0;for(let l=0;l<n.length-1;l++){const o=t(n[l]);if(o!==0&&o!==1)continue;const u=new Date(n[l].timestamp).getTime(),d=new Date(n[l+1].timestamp).getTime();if(Number.isNaN(u)||Number.isNaN(d))continue;const f=d-u;f<=0||(o===1?a+=f:s+=f)}return{onMs:a,offMs:s}}function aC({filteredTelemetry:n,chartLabels:t,relays:a=[]}){const s=w.useMemo(()=>n.map(d=>d.power),[n]),l=w.useMemo(()=>{const d=n.reduce((x,b)=>Math.max(x,b.relays.length),0),f=a.reduce((x,b)=>Math.max(x,b.relayIndex),0),g=Math.max(d,f);return g===0?[]:Array.from({length:g},(x,b)=>{var j;const v=a.find(S=>S.relayIndex===b+1),_=v?ca.find(S=>S.value===v.relayKind)??ca[0]:ca[0],M=v?wi[v.relayKind]??wi[0]:wi[0];return{index:b,label:((j=v==null?void 0:v.name)==null?void 0:j.trim())||`رله ${b+1}`,color:v?Pb[v.relayKind]??Pb[0]:Wb[b%Wb.length],icon:_.icon,iconBg:M.iconBg,iconText:M.iconText}})},[n,a]),o=w.useMemo(()=>{const{onMs:d,offMs:f}=Jb(n,g=>g.power);return[{label:"مدت وصل",value:Fo(d)},{label:"مدت قطع",value:Fo(f)}]},[n]),u=w.useMemo(()=>l.map(d=>Jb(n,f=>f.relays[d.index]??null)),[n,l]);return h.jsxs("div",{className:"space-y-4",children:[h.jsx(jc,{title:"وضعیت برق",id:"chart-power",stats:o,children:h.jsx(Wf,{labels:t,series:[{label:"برق",data:s,borderColor:nC,backgroundColor:"rgba(16, 185, 129, 0.12)",fill:!0}],yAxisMin:0,yAxisMax:1,yStepSize:1,stepped:!0,yTickLabels:{0:"قطع",1:"وصل"},formatTooltipValue:d=>d===1?"وصل":d===0?"قطع":"نامشخص",heightClass:"h-20 md:h-20"})}),l.length>0&&h.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:l.map((d,f)=>{const g=u[f]??{onMs:0,offMs:0};return h.jsx(jc,{title:`وضعیت ${d.label}`,id:`chart-relay-${d.index+1}`,icon:h.jsx("span",{className:te("w-6 h-6 rounded-md flex items-center justify-center flex-shrink-0",d.iconBg),children:h.jsx(d.icon,{className:te("w-3.5 h-3.5",d.iconText)})}),stats:[{label:"مدت روشن",value:Fo(g.onMs)},{label:"مدت خاموش",value:Fo(g.offMs)}],children:h.jsx(Wf,{labels:t,series:[{label:d.label,data:n.map(x=>x.relays[d.index]??null),borderColor:d.color,backgroundColor:`${d.color}1f`,fill:!0}],yAxisMin:0,yAxisMax:1,yStepSize:1,stepped:!0,yTickLabels:{0:"خاموش",1:"روشن"},formatTooltipValue:x=>x===1?"روشن":x===0?"خاموش":"نامشخص",heightClass:"h-20 md:h-20"})},d.index)})}),h.jsx(tC,{filteredTelemetry:n,relaysMeta:l})]})}const iC={temperature:"temp",humidity:"hum",gas:"gas",soil:"soil",lux:"lux"},sC={temp:"°C",hum:"%",gas:"ppm",soil:"%",lux:"Lux"};function lC(n,t){const a=n.filter(u=>u!==null);if(a.length===0)return[];const s=Math.min(...a),l=Math.max(...a),o=a.reduce((u,d)=>u+d,0)/a.length;return[{label:"حداقل",value:`${J(s.toFixed(1))} ${t}`},{label:"میانگین",value:`${J(o.toFixed(1))} ${t}`},{label:"حداکثر",value:`${J(l.toFixed(1))} ${t}`}]}const rC=w.memo(function({sortedTelemetry:t,dataGaps:a=[],visibleParams:s,relays:l=[]}){const[o,u]=w.useState(0),[d,f]=w.useState(1439),g=w.useCallback(k=>{u(k)},[]),x=w.useCallback(k=>{f(k)},[]),b=w.useMemo(()=>WN(t),[t]),v=w.useMemo(()=>b.filter(k=>k.minute>=o&&k.minute<=d),[b,o,d]),_=w.useMemo(()=>v.map(k=>k.timestamp),[v]),M=w.useMemo(()=>dv(_,30),[_]),{charts:j,chartLabels:S}=Qk({filteredTelemetry:v,filteredDataGaps:M}),N=w.useMemo(()=>!s||s.length===0?null:new Set(s.map(k=>iC[k]??k)),[s]),C=w.useMemo(()=>j.map(k=>({chart:k,stats:lC(k.data,sC[k.key]??"")})),[j]);return h.jsxs("div",{className:"space-y-4",children:[h.jsx(NM,{startMinute:o,endMinute:d,onStartMinuteChange:g,onEndMinuteChange:x,totalRecords:v.length,dataGaps:M}),v.length===0?h.jsx(or,{icon:sc,title:"داده‌ای موجود نیست",message:"داده‌ای برای این بازه زمانی موجود نیست"}):h.jsxs(h.Fragment,{children:[h.jsx(aC,{filteredTelemetry:v,chartLabels:S,relays:l}),h.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:C.filter(({chart:k})=>!N||N.has(k.key)).map(({chart:k,stats:E})=>h.jsx(jc,{title:k.title,id:`chart-${k.key}`,stats:E,children:h.jsx(Wf,{labels:S,series:[{label:k.seriesLabel,data:k.data,borderColor:k.color,backgroundColor:k.bgColor,fill:!0}],yAxisMin:k.yAxisMin,yAxisMax:k.yAxisMax})},k.key))})]})]})},(n,t)=>{var a,s,l,o,u,d;return n.sortedTelemetry.length===t.sortedTelemetry.length&&(((a=n.dataGaps)==null?void 0:a.length)??0)===(((s=t.dataGaps)==null?void 0:s.length)??0)&&(((l=n.relays)==null?void 0:l.length)??0)===(((o=t.relays)==null?void 0:o.length)??0)&&((u=n.sortedTelemetry[0])==null?void 0:u.id)===((d=t.sortedTelemetry[0])==null?void 0:d.id)}),oC=Object.freeze(Object.defineProperty({__proto__:null,ChartsTab:rC},Symbol.toStringTag,{value:"Module"})),ys=34.396748,vs=50.865948;function cC(n){const t=[],a=n.daily[0];return a.tempMin<5&&t.push({type:"danger",title:"⚠️ هشدار یخ‌زدگی",description:`دمای حداقل امشب ${J(Math.round(a.tempMin))}°C پیش‌بینی شده. سیستم گرمایش را فعال کنید و پوشش محافظ روی گیاهان حساس قرار دهید.`,icon:Ns}),a.tempMax>35&&t.push({type:"danger",title:"🌡️ هشدار گرمای شدید",description:`دمای حداکثر ${J(Math.round(a.tempMax))}°C پیش‌بینی شده. سایه‌بان‌ها را فعال کنید، تهویه را افزایش دهید و آبیاری را در ساعات خنک انجام دهید.`,icon:en}),a.uvIndexMax>8&&t.push({type:"warning",title:"☀️ شاخص UV بالا",description:`شاخص UV ${J(Math.round(a.uvIndexMax))} است. برای گیاهان حساس به نور از سایه‌بان استفاده کنید.`,icon:en}),a.windSpeedMax>40&&t.push({type:"warning",title:"💨 باد شدید",description:`سرعت باد به ${J(Math.round(a.windSpeedMax))} کیلومتر بر ساعت می‌رسد. دریچه‌ها و پنجره‌ها را ببندید و سازه را بررسی کنید.`,icon:Oc}),a.precipitation>10&&t.push({type:"info",title:"🌧️ بارش قابل توجه",description:`بارش ${J(Math.round(a.precipitation))} میلی‌متر پیش‌بینی شده. سیستم زهکشی را بررسی کنید و آبیاری را کاهش دهید.`,icon:lr}),a.tempMin>=10&&a.tempMax<=28&&a.windSpeedMax<30&&a.precipitation<5&&t.push({type:"success",title:"✅ شرایط مناسب",description:"شرایط آب و هوایی امروز برای رشد گیاهان عالی است. می‌توانید تهویه طبیعی را افزایش دهید.",icon:Ry}),t}const Jf="gh:weather:";function o1(){try{return typeof window<"u"&&!!window.localStorage}catch{return!1}}function Nc(n,t){if(!o1())return null;try{const a=window.localStorage.getItem(Jf+n);if(!a)return null;const s=JSON.parse(a);return typeof(s==null?void 0:s.cachedAt)!="number"||Date.now()-s.cachedAt>t?(window.localStorage.removeItem(Jf+n),null):s.data}catch{return null}}function Mc(n,t){if(o1())try{const a={data:t,cachedAt:Date.now()};window.localStorage.setItem(Jf+n,JSON.stringify(a))}catch{}}const Tc="",Qo=60*1e3,kc={current:30*Qo,forecast:360*Qo,historical:720*60*Qo,location:720*60*Qo};function ey(n,t){const a=n.hourly.time.slice(0,24).map((s,l)=>({time:s,temperature:n.hourly.temperature_2m[l],humidity:n.hourly.relative_humidity_2m[l],weatherCode:n.hourly.weather_code[l],precipitation:n.hourly.precipitation[l]}));return{current:{temperature:t.current.temperature_2m,humidity:t.current.relative_humidity_2m,windSpeed:t.current.wind_speed_10m,weatherCode:t.current.weather_code},hourly:a,daily:n.daily.time.map((s,l)=>({date:s,tempMax:n.daily.temperature_2m_max[l],tempMin:n.daily.temperature_2m_min[l],weatherCode:n.daily.weather_code[l],precipitation:n.daily.precipitation_sum[l],precipitationProbability:n.daily.precipitation_probability_max[l],uvIndexMax:n.daily.uv_index_max[l],sunshineDuration:n.daily.sunshine_duration[l],windSpeedMax:n.daily.wind_speed_10m_max[l]}))}}async function uC(n,t,a=!1){const s=`location:${n}:${t}`;if(!a){const l=Nc(s,kc.location);if(l!==null)return l}try{const l=await fetch(`${Tc}/api/weather/location?latitude=${n}&longitude=${t}`);if(!l.ok)throw new Error("Failed to fetch location name");const o=await l.json(),u=o.address||{},d=[];(u.city||u.town||u.village)&&d.push(u.city||u.town||u.village),(u.state||u.province)&&d.push(u.state||u.province),u.country&&d.push(u.country);const f=d.length>0?d.join("، "):o.display_name||"موقعیت نامشخص";return Mc(s,f),f}catch(l){return console.error("Error fetching location name:",l),"کهک قم، ایران"}}async function cE(n,t=!1){var b,v,_,M,j,S,N,C,k,E;const[a,s,l]=n.split("/").map(Number),u=Hs(a,s,l).toISOString().split("T")[0],d=`historical:${u}`;if(!t){const A=Nc(d,kc.historical);if(A!==null)return A}const f=await fetch(`${Tc}/api/weather/historical?latitude=${ys}&longitude=${vs}&start_date=${u}&end_date=${u}`);if(!f.ok)throw new Error("Failed to fetch historical weather data");const g=await f.json(),x={current:{temperature:((b=g.daily.temperature_2m_max)==null?void 0:b[0])||0,humidity:0,windSpeed:((v=g.daily.wind_speed_10m_max)==null?void 0:v[0])||0,weatherCode:((_=g.daily.weather_code)==null?void 0:_[0])||0},hourly:[],daily:[{date:((M=g.daily.time)==null?void 0:M[0])||u,tempMax:((j=g.daily.temperature_2m_max)==null?void 0:j[0])||0,tempMin:((S=g.daily.temperature_2m_min)==null?void 0:S[0])||0,weatherCode:((N=g.daily.weather_code)==null?void 0:N[0])||0,precipitation:((C=g.daily.precipitation_sum)==null?void 0:C[0])||0,precipitationProbability:0,uvIndexMax:0,sunshineDuration:((k=g.daily.sunshine_duration)==null?void 0:k[0])||0,windSpeedMax:((E=g.daily.wind_speed_10m_max)==null?void 0:E[0])||0}]};return Mc(d,x),x}async function c1(n=!1){const t=`forecast:${ys}:${vs}`,a=`current:${ys}:${vs}`;let s=n?null:Nc(t,kc.forecast),l=n?null:Nc(a,kc.current);if(s!==null&&l!==null)return ey(s,l);const o=s===null?fetch(`${Tc}/api/weather/forecast?latitude=${ys}&longitude=${vs}&forecast_days=7`):Promise.resolve(null),u=l===null?fetch(`${Tc}/api/weather/current?latitude=${ys}&longitude=${vs}`):Promise.resolve(null),[d,f]=await Promise.all([o,u]);if(d!==null&&!d.ok)throw new Error("Failed to fetch weather data");if(f!==null&&!f.ok)throw new Error("Failed to fetch weather data");return d!==null&&(s=await d.json(),Mc(t,s)),f!==null&&(l=await f.json(),Mc(a,l)),ey(s,l)}function ty(n){try{const[t,a,s]=n.split("/").map(Number),l=Hs(t,a,s),o=new Date;return o.setHours(0,0,0,0),l.setHours(0,0,0,0),l.getTime()===o.getTime()}catch(t){return console.error("Error checking if today:",t),!1}}function dC({weatherData:n,isToday:t}){var u,d;const a=((u=n.daily[0])==null?void 0:u.tempMin)||0,s=((d=n.daily[0])==null?void 0:d.tempMax)||0,l=a<5,o=s>35;return h.jsxs("div",{className:`rounded-lg p-4 border ${l?"bg-blue-50 border-blue-200":o?"bg-red-50 border-red-200":"bg-green-50 border-green-200"}`,children:[h.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[h.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${l?"bg-blue-500":o?"bg-red-500":"bg-green-500"}`,children:h.jsx(Ns,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-bold text-gray-800",children:t?"دمای امروز":"دمای روز"}),h.jsx("p",{className:`text-xs ${l?"text-blue-600":o?"text-red-600":"text-green-600"}`,children:l?"❄️ سرد!":o?"🔥 گرم!":"✅ مناسب"})]})]}),h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsxs("div",{className:"text-center",children:[h.jsx("p",{className:"text-xs text-gray-500",children:"🌙 شب"}),h.jsxs("p",{className:"text-xl font-bold text-gray-800",children:[J(Math.round(a)),"°"]})]}),h.jsx("div",{className:"text-2xl text-gray-300",children:"←"}),h.jsxs("div",{className:"text-center",children:[h.jsx("p",{className:"text-xs text-gray-500",children:"☀️ روز"}),h.jsxs("p",{className:"text-xl font-bold text-gray-800",children:[J(Math.round(s)),"°"]})]})]})]})}function fC({weatherData:n}){var l;const t=((l=n.daily[0])==null?void 0:l.precipitationProbability)||0,a=t>60,s=t>30;return h.jsxs("div",{className:`rounded-lg p-4 border ${a?"bg-blue-50 border-blue-200":s?"bg-sky-50 border-sky-200":"bg-amber-50 border-amber-200"}`,children:[h.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[h.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${a?"bg-blue-500":s?"bg-sky-400":"bg-amber-400"}`,children:s?h.jsx(wn,{className:"w-5 h-5 text-white"}):h.jsx(en,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-bold text-gray-800",children:"بارش"}),h.jsx("p",{className:`text-xs ${a?"text-blue-600":s?"text-sky-600":"text-amber-600"}`,children:a?"🌧️ باران می‌آید":s?"🌦️ شاید ببارد":"☀️ خشک است"})]})]}),h.jsxs("div",{className:"text-center",children:[h.jsxs("p",{className:"text-3xl font-bold text-gray-800",children:[J(t),"%"]}),h.jsx("p",{className:"text-xs text-gray-500",children:"احتمال بارش"})]})]})}function uE({weatherData:n}){var l;const t=((l=n.daily[0])==null?void 0:l.precipitation)||0,a=t>5,s=t>0;return h.jsxs("div",{className:`rounded-lg p-4 border ${a?"bg-blue-50 border-blue-200":s?"bg-sky-50 border-sky-200":"bg-amber-50 border-amber-200"}`,children:[h.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[h.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${a?"bg-blue-500":s?"bg-sky-400":"bg-amber-400"}`,children:s?h.jsx(wn,{className:"w-5 h-5 text-white"}):h.jsx(en,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-bold text-gray-800",children:"بارش"}),h.jsx("p",{className:`text-xs ${a?"text-blue-600":s?"text-sky-600":"text-amber-600"}`,children:a?"🌧️ بارش زیاد":s?"🌦️ بارش کم":"☀️ بدون بارش"})]})]}),h.jsxs("div",{className:"text-center",children:[h.jsx("p",{className:"text-3xl font-bold text-gray-800",children:J(t.toFixed(1))}),h.jsx("p",{className:"text-xs text-gray-500",children:"میلی‌متر بارش"})]})]})}function hC({weatherData:n}){var s,l;const t=(((s=n.daily[0])==null?void 0:s.sunshineDuration)||0)/3600,a=((l=n.daily[0])==null?void 0:l.uvIndexMax)||0;return h.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:[h.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-lg bg-yellow-400 flex items-center justify-center",children:h.jsx(en,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-bold text-gray-800",children:"نور آفتاب"}),h.jsx("p",{className:"text-xs text-yellow-600",children:t>8?"☀️ آفتاب زیاد":t>4?"🌤️ آفتاب متوسط":"☁️ کم‌آفتاب"})]})]}),h.jsxs("div",{className:"flex justify-between items-end",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-3xl font-bold text-gray-800",children:J(Math.round(t))}),h.jsx("p",{className:"text-xs text-gray-500",children:"ساعت آفتاب"})]}),h.jsxs("div",{className:"text-left",children:[h.jsx("p",{className:"text-xl font-bold text-orange-500",children:J(Math.round(a))}),h.jsx("p",{className:"text-xs text-gray-500",children:"شاخص UV"})]})]})]})}function mC({weatherData:n}){var s;const t=((s=n.daily[0])==null?void 0:s.windSpeedMax)||0,a=n.current.humidity;return h.jsxs("div",{className:"bg-cyan-50 border border-cyan-200 rounded-lg p-4",children:[h.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-lg bg-cyan-400 flex items-center justify-center",children:h.jsx(Oc,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-bold text-gray-800",children:"باد و رطوبت"}),h.jsx("p",{className:"text-xs text-cyan-600",children:t>40?"💨 باد شدید!":t>20?"🍃 وزش باد":"😌 آرام"})]})]}),h.jsxs("div",{className:"flex justify-between items-end",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-2xl font-bold text-gray-800",children:J(Math.round(t))}),h.jsx("p",{className:"text-xs text-gray-500",children:"کیلومتر/ساعت باد"})]}),h.jsxs("div",{className:"text-left",children:[h.jsxs("p",{className:"text-2xl font-bold text-blue-500",children:[J(a),"%"]}),h.jsx("p",{className:"text-xs text-gray-500",children:"رطوبت هوا"})]})]})]})}function gC({weatherData:n,expandedDayIndex:t,onDayToggle:a}){const s=cC(n);return h.jsxs("div",{className:"space-y-6",children:[s.length>0&&h.jsxs("div",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-semibold text-gray-700",children:"🌱 هشدارها و توصیه‌های گلخانه"}),s.map((l,o)=>{const u=l.icon;return h.jsx("div",{className:`p-4 rounded-lg border-r-4 ${l.type==="danger"?"bg-red-50 border-red-500":l.type==="warning"?"bg-amber-50 border-amber-500":l.type==="info"?"bg-blue-50 border-blue-500":"bg-green-50 border-green-500"}`,children:h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(u,{className:`w-5 h-5 mt-0.5 flex-shrink-0 ${l.type==="danger"?"text-red-600":l.type==="warning"?"text-amber-600":l.type==="info"?"text-blue-600":"text-green-600"}`}),h.jsxs("div",{className:"flex-1",children:[h.jsx("p",{className:`font-semibold text-sm ${l.type==="danger"?"text-red-700":l.type==="warning"?"text-amber-700":l.type==="info"?"text-blue-700":"text-green-700"}`,children:l.title}),h.jsx("p",{className:"text-sm text-gray-600 mt-1",children:l.description})]})]})},o)})]}),h.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:[h.jsx("div",{className:"bg-emerald-600 p-5",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"text-white",children:[h.jsx("p",{className:"text-sm opacity-90 mb-1",children:"🌡️ الان"}),h.jsxs("div",{className:"flex items-baseline gap-2",children:[h.jsx("span",{className:"text-5xl font-bold",children:J(Math.round(n.current.temperature))}),h.jsx("span",{className:"text-2xl",children:"درجه"})]})]}),h.jsxs("div",{className:"text-center text-white",children:[(()=>{const l=Ao(n.current.weatherCode).icon;return h.jsx(l,{className:"w-16 h-16"})})(),h.jsx("p",{className:"text-sm mt-1",children:Ao(n.current.weatherCode).description})]})]})}),h.jsxs("div",{className:"p-4 grid grid-cols-2 gap-3",children:[h.jsx(dC,{weatherData:n,isToday:!0}),h.jsx(fC,{weatherData:n}),h.jsx(hC,{weatherData:n}),h.jsx(mC,{weatherData:n})]})]}),h.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 overflow-hidden",children:[h.jsx("div",{className:"bg-indigo-600 p-4",children:h.jsx("h4",{className:"text-sm font-bold text-white flex items-center gap-2",children:"🕐 وضعیت ساعت به ساعت امروز"})}),h.jsxs("div",{className:"p-4",children:[h.jsx("div",{className:"overflow-x-auto pb-2",children:h.jsx("div",{className:"flex gap-2",style:{minWidth:"max-content"},children:n.hourly.map(l=>{const o=new Date(l.time).getHours(),u=o===new Date().getHours(),d=Ao(l.weatherCode).icon,f=l.temperature>35,g=l.temperature<10;return h.jsxs("div",{className:`flex flex-col items-center p-3 rounded-lg min-w-[80px] transition-all ${u?"bg-emerald-500 text-white shadow-sm scale-105":f?"bg-red-50 border border-red-200":g?"bg-blue-50 border border-blue-200":"bg-gray-50 border border-gray-100"}`,children:[h.jsx("p",{className:`text-sm font-bold ${u?"text-white":"text-gray-600"}`,children:u?"⏰ الان":`${J(o)}:۰۰`}),h.jsx("div",{className:`my-2 p-1.5 rounded-full ${u?"bg-white/20":"bg-white"}`,children:h.jsx(d,{className:`w-5 h-5 ${u?"text-white":f?"text-red-500":g?"text-blue-500":"text-gray-500"}`})}),h.jsxs("p",{className:`text-xl font-bold ${u?"text-white":f?"text-red-600":g?"text-blue-600":"text-gray-800"}`,children:[J(Math.round(l.temperature)),"°"]}),h.jsx("div",{className:`flex items-center gap-1 mt-2 text-xs ${u?"text-white/80":"text-blue-500"}`,children:h.jsxs("span",{children:[J(l.humidity),"%"]})}),l.precipitation>0&&h.jsxs("div",{className:`mt-1 px-2 py-0.5 rounded-full text-xs ${u?"bg-white/20 text-white":"bg-blue-100 text-blue-600"}`,children:["🌧️ ",J(l.precipitation.toFixed(1))]})]},l.time)})})}),h.jsx("p",{className:"text-xs text-gray-400 text-center mt-3",children:"👈 برای دیدن ساعت‌های بیشتر به چپ بکشید"})]})]}),h.jsxs("div",{children:[h.jsxs("h3",{className:"text-base font-semibold text-gray-800 mb-4 flex items-center gap-2",children:[h.jsx(Xa,{className:"w-4 h-4 text-emerald-500"}),"پیش‌بینی ۷ روز آینده"]}),h.jsx("div",{className:"space-y-2",children:n.daily.map((l,o)=>{const u=Ao(l.weatherCode),d=u.icon,f=o===0,g=l.tempMin<5,x=l.tempMax>35,b=t===o;return h.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-200",children:[h.jsxs("button",{onClick:()=>a(b?null:o),className:`w-full flex items-center justify-between p-4 transition-all duration-150 ${b?"bg-emerald-500 text-white":f?"bg-emerald-50 hover:bg-emerald-100":g?"bg-blue-50 hover:bg-blue-100":x?"bg-red-50 hover:bg-red-100":"bg-gray-50 hover:bg-gray-100"}`,children:[h.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[h.jsx("div",{className:`w-10 h-10 rounded-lg flex items-center justify-center ${b?"bg-white/20":"bg-white"}`,children:h.jsx(d,{className:`w-5 h-5 ${b?"text-white":"text-gray-600"}`})}),h.jsxs("div",{className:"text-right flex-1",children:[h.jsx("p",{className:`font-bold ${b?"text-white":"text-gray-800"}`,children:f?"امروز":uv(l.date)}),h.jsx("p",{className:`text-sm ${b?"text-white/80":"text-gray-500"}`,children:u.description})]})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"text-center",children:[h.jsxs("p",{className:`text-xl font-bold ${b?"text-white":"text-gray-800"}`,children:[J(Math.round(l.tempMax)),"°"]}),h.jsxs("p",{className:`text-xs ${b?"text-white/60":"text-gray-400"}`,children:[J(Math.round(l.tempMin)),"°"]})]}),h.jsx(Wl,{className:`w-4 h-4 transition-transform ${b?"rotate-180 text-white":"text-gray-400"}`})]})]}),b&&h.jsx("div",{className:"bg-white p-4 border-t border-emerald-100",children:h.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[h.jsxs("div",{className:"bg-gray-50 rounded-lg p-3",children:[h.jsx("div",{className:"flex items-center gap-2 mb-2",children:h.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"دما"})}),h.jsxs("p",{className:"text-xl font-bold text-gray-800",children:[J(Math.round(l.tempMax)),"°"]}),h.jsx("p",{className:"text-xs text-gray-500",children:"حداکثر"}),h.jsxs("p",{className:"text-lg font-bold text-blue-600 mt-2",children:[J(Math.round(l.tempMin)),"°"]}),h.jsx("p",{className:"text-xs text-gray-500",children:"حداقل"})]}),h.jsxs("div",{className:"bg-gray-50 rounded-lg p-3",children:[h.jsx("div",{className:"flex items-center gap-2 mb-2",children:h.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"بارش"})}),h.jsxs("p",{className:"text-xl font-bold text-gray-800",children:[J(l.precipitationProbability),"%"]}),h.jsx("p",{className:"text-xs text-gray-500",children:"احتمال"}),h.jsx("p",{className:"text-lg font-bold text-blue-600 mt-2",children:J(l.precipitation.toFixed(1))}),h.jsx("p",{className:"text-xs text-gray-500",children:"میلی‌متر"})]}),h.jsxs("div",{className:"bg-gray-50 rounded-lg p-3",children:[h.jsx("div",{className:"flex items-center gap-2 mb-2",children:h.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"ساعات آفتابی"})}),h.jsx("p",{className:"text-xl font-bold text-gray-800",children:J(Math.round(l.sunshineDuration/3600))}),h.jsx("p",{className:"text-xs text-gray-500",children:"ساعت"}),h.jsx("p",{className:"text-lg font-bold text-orange-600 mt-2",children:J(Math.round(l.uvIndexMax))}),h.jsx("p",{className:"text-xs text-gray-500",children:"UV Index"})]}),h.jsxs("div",{className:"bg-gray-50 rounded-lg p-3",children:[h.jsx("div",{className:"flex items-center gap-2 mb-2",children:h.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"باد"})}),h.jsx("p",{className:"text-xl font-bold text-gray-800",children:J(Math.round(l.windSpeedMax))}),h.jsx("p",{className:"text-xs text-gray-500",children:"کیلومتر/ساعت"})]})]})})]},l.date)})})]})]})}function pC(n){const t=w.useRef(0),a=w.useRef(!1),[s,l]=w.useState(0);return w.useEffect(()=>{const o=f=>{window.scrollY===0&&(t.current=f.touches[0].clientY)},u=f=>{if(window.scrollY===0&&t.current>0){const x=f.touches[0].clientY-t.current;if(x>0&&!a.current){const b=Math.min(x,150);l(b),x>10&&f.preventDefault()}}},d=async f=>{if(window.scrollY===0&&t.current>0)if(f.changedTouches[0].clientY-t.current>100&&!a.current){a.current=!0,l(0);try{await n()}finally{a.current=!1}}else l(0);t.current=0};return"ontouchstart"in window&&(window.addEventListener("touchstart",o,{passive:!1}),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",d)),()=>{"ontouchstart"in window&&(window.removeEventListener("touchstart",o),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",d))}},[n]),{pullDistance:s,isRefreshing:a.current}}function xC({enabled:n,intervalMs:t=3e4,fetchNewData:a,onNewData:s,onFetch:l}){const o=w.useRef(a),u=w.useRef(s),d=w.useRef(l),f=w.useRef(null);w.useEffect(()=>{o.current=a,u.current=s,d.current=l}),w.useEffect(()=>{if(!n)return;const g=async()=>{var _;try{const M=await o.current();(_=d.current)==null||_.call(d),M.length>0&&u.current(M)}catch{}},x=()=>{f.current&&(clearInterval(f.current),f.current=null)},b=()=>{x(),f.current=setInterval(g,t)},v=()=>{document.hidden?x():(g(),b())};return b(),document.addEventListener("visibilitychange",v),()=>{x(),document.removeEventListener("visibilitychange",v)}},[n,t])}const bC=w.lazy(()=>jh(()=>Promise.resolve().then(()=>oC),[]).then(n=>({default:n.ChartsTab}))),yC=w.lazy(()=>jh(()=>import("./WeatherTab-CRtiHhGA.js"),[]).then(n=>({default:n.WeatherTab}))),vC=w.lazy(()=>jh(()=>import("./AnalysisTab-C68ADY84.js"),[]).then(n=>({default:n.AnalysisTab})));function SC(){const n=Un(),t=rr(),[a,s]=w.useState([]),[l,o]=w.useState([]),[u,d]=w.useState(!0),[f,g]=w.useState("summary"),[x,b]=w.useState(null),[v,_]=w.useState(!1),[M,j]=w.useState(null),[S,N]=w.useState(null),C=w.useRef(null),k=w.useRef(null),E=w.useCallback(re=>({temperature:"temp",humidity:"hum",gas:"gas",soil:"soil",lux:"lux"})[re]||re,[]),A=w.useCallback(re=>{const xe=E(re);g("charts"),setTimeout(()=>{const Ae=document.getElementById(`chart-${xe}`);Ae&&Ae.scrollIntoView({behavior:"smooth",block:"start"})},100)},[E]),z=Number(t.get("deviceId")??"1"),L=t.get("date")??cv(Ga(),Ss(),wh()),R=w.useMemo(()=>{if(!L)return null;try{const re=decodeURIComponent(L);return qN(re)}catch(re){return console.error("Error decoding date parameter:",re),null}},[L]),X=w.useMemo(()=>R?ty(R):!1,[R]),de=w.useCallback(()=>{if(!R)return;const re=DN(R);re&&n.push(`/daily-report?deviceId=${z}&date=${encodeURIComponent(re)}`)},[R,z,n]),Q=w.useCallback(()=>{if(!R||X)return;const re=zN(R);re&&n.push(`/daily-report?deviceId=${z}&date=${encodeURIComponent(re)}`)},[R,X,z,n]),ae=w.useCallback(()=>{n.push(`/calendar?deviceId=${z}`)},[z,n]),Ee=w.useCallback(re=>{n.push(`/daily-report?deviceId=${z}&date=${encodeURIComponent(re)}`)},[z,n]),Oe=w.useCallback(async(re,xe)=>{const Ae=[];let je=1;const Je=1e3;for(;;){const xt=await We.listTelemetry({deviceId:z,startUtc:re,endUtc:xe,page:je,pageSize:Je});if(Ae.push(...xt.items),Ae.length>=xt.totalCount||xt.items.length===0)break;je+=1}return Ae},[z]),he=w.useCallback(async()=>{var re;if(!R){d(!1),N(null);return}d(!0);try{const[xe,Ae,je]=R.split("/").map(Number),Je=Hs(xe,Ae,je);Je.setHours(0,0,0,0);const xt=new Date(Je);xt.setHours(23,59,59,999);const bn=Je.toISOString(),Ct=xt.toISOString(),an=await Oe(bn,Ct);s(an);try{const ot=await We.listTelemetry({deviceId:z,endUtc:bn,pageSize:1});N(((re=ot.items)==null?void 0:re[0])??null)}catch(ot){console.error("Error loading previous telemetry record:",ot),N(null)}try{const ot=await We.getDisplayParameters(z);j(ot??null)}catch(ot){console.error("Error loading display parameters:",ot),j(["gas","temperature","humidity","lux"])}try{const ot=await We.getDeviceSettings(z);o((ot==null?void 0:ot.relays)??[])}catch(ot){console.error("Error loading relay settings:",ot),o([])}}catch(xe){console.error("Error loading telemetry:",xe)}finally{d(!1)}},[z,R,Oe]);pC(he),w.useEffect(()=>{he()},[he,z,R]),w.useEffect(()=>{if(!R||u){b(null),_(!1);return}if(ty(R)){_(!0),b(null);const xe=setTimeout(()=>{c1().then(b).catch(Ae=>{console.error("Error loading forecast weather:",Ae),b(null)}).finally(()=>{_(!1)})},100);return()=>clearTimeout(xe)}else b(null),_(!1)},[R,u]);const U=w.useMemo(()=>[...a].sort((re,xe)=>{const Ae=re.serverTimestampUtc||re.timestampUtc,je=xe.serverTimestampUtc||xe.timestampUtc;return new Date(Ae).getTime()-new Date(je).getTime()}),[a]),{currentPower:K,powerOutages:fe}=w.useMemo(()=>{const re=[],xe=(S==null?void 0:S.power)===0||(S==null?void 0:S.power)===1?S.power:null;let Ae=null,je=xe===0&&((S==null?void 0:S.serverTimestampUtc)||(S==null?void 0:S.timestampUtc))||null;for(const Je of U){const xt=Je.power;if(xt!==0&&xt!==1)continue;Ae=xt;const bn=Je.serverTimestampUtc||Je.timestampUtc;if(xt===0)je===null&&(je=bn);else if(je!==null){const Ct=new Date(je).getTime(),an=new Date(bn).getTime();re.push({disconnectedAt:je,connectedAt:bn,durationSeconds:an>Ct?Math.round((an-Ct)/1e3):0}),je=null}}return je!==null&&re.push({disconnectedAt:je,connectedAt:null,durationSeconds:null}),{currentPower:Ae,powerOutages:re}},[U,S]),we=w.useMemo(()=>{const re=U[U.length-1];return re!=null&&re.relayStates?re.relayStates.split(",").map(xe=>xe==="1"?1:0):null},[U]),{soil:P,temp:O,hum:I,gas:W,lux:ee,lastTimestamp:ne}=w.useMemo(()=>{const re=[],xe=[],Ae=[],je=[],Je=[];let xt=null,bn=Number.NEGATIVE_INFINITY;for(const Ct of U){re.push(Number(Ct.soilPercent??0)),xe.push(Number(Ct.temperatureC??0)),Ae.push(Number(Ct.humidityPercent??0)),je.push(Number(Ct.gasPPM??0)),Je.push(Number(Ct.lux??0));const an=Ct.serverTimestampUtc||Ct.timestampUtc;if(an){const ot=new Date(an).getTime();ot>bn&&(bn=ot,xt=an)}}return{soil:re,temp:xe,hum:Ae,gas:je,lux:Je,lastTimestamp:xt}},[U]),le=w.useMemo(()=>hv(U.map(re=>re.serverTimestampUtc||re.timestampUtc),15),[U]),ge=w.useMemo(()=>{if(!X||!ne)return null;const re=new Date(ne).getTime();if(Number.isNaN(re))return null;const xe=Math.max(0,(Date.now()-re)/6e4),Ae=Math.max(10,le*2),je=Math.max(30,le*10);let Je="fresh";return xe>Ae&&xe<=je?Je="stale":xe>je&&(Je="offline"),{ageMin:xe,status:Je}},[X,ne,le]),rt=(ge==null?void 0:ge.status)==="stale"||(ge==null?void 0:ge.status)==="offline",ye=w.useMemo(()=>{const re=U.map(Ae=>Ae.serverTimestampUtc||Ae.timestampUtc),xe=fv(re,30);return dv(re,xe)},[U]);w.useEffect(()=>{C.current=ne??null},[ne]);const kn=w.useCallback(async()=>{const re=C.current;return re?(await We.listTelemetry({deviceId:z,sinceUtc:re,pageSize:1e3})).items:[]},[z]);return xC({enabled:!u&&!!R&&X,intervalMs:3e4,fetchNewData:kn,onNewData:re=>{s(xe=>{const Ae=new Set(xe.map(Je=>Je.id)),je=re.filter(Je=>!Ae.has(Je.id));return[...xe,...je]})}}),u?h.jsx(ht,{message:"در حال بارگذاری داده‌ها..."}):R?h.jsx(Mi,{pageTitle:"گزارش روزانه",pageIcon:sc,pageInfo:R,iconGradient:"from-indigo-500 to-purple-600",children:h.jsxs("div",{className:"space-y-6",onTouchStart:re=>{var xe;k.current=((xe=re.touches[0])==null?void 0:xe.clientX)??null},onTouchEnd:re=>{var je;const xe=k.current;if(k.current=null,xe===null)return;const Ae=(((je=re.changedTouches[0])==null?void 0:je.clientX)??xe)-xe;Math.abs(Ae)<60||(Ae>0?de():Q())},children:[h.jsx("div",{className:"sticky top-12 z-30 bg-gray-50/90 py-2 backdrop-blur-md",children:h.jsx(UN,{selectedDate:R,onPrevious:de,onNext:Q,onCalendar:ae,onSelectDate:Ee,isToday:X})}),X?ge&&h.jsxs("div",{className:`flex items-center justify-center gap-2 text-xs -mt-2 ${ge.status==="fresh"?"text-emerald-700":ge.status==="stale"?"text-amber-700":"text-red-700"}`,children:[h.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${ge.status==="fresh"?"bg-emerald-500":ge.status==="stale"?"bg-amber-500":"bg-red-500"}`}),h.jsx("span",{children:ge.status==="fresh"?`داده‌ها به‌روز است${ne?` — آخرین داده ساعت ${XN(ne)}`:""}`:ge.status==="stale"?`داده کمی قدیمی است — ${J(String(Math.floor(ge.ageMin)))} دقیقه پیش`:`داده به‌روز نیست — آخرین داده ${J(String(Math.floor(ge.ageMin/60)))} ساعت پیش`})]}):h.jsxs("div",{className:"flex items-center justify-center gap-2 text-xs text-gray-500 -mt-2",children:[h.jsx(fh,{className:"w-4 h-4 flex-shrink-0"}),h.jsx("span",{children:"نمایش داده‌های تاریخی این روز"})]}),h.jsx(vN,{tabs:IN,activeTab:f,setActiveTab:g,className:"md:mx-0 mx-[-1rem] md:rounded-xl rounded-none",children:{summary:h.jsx(cM,{temperature:O,humidity:I,soil:P,gas:W,lux:ee,forecastWeather:x,forecastWeatherLoading:v,onCardClick:A,visibleParams:M,currentPower:K,powerOutages:fe,relays:l,relayStates:we,isToday:X,stale:rt}),charts:h.jsx(w.Suspense,{fallback:h.jsx(ht,{message:"در حال بارگذاری نمودارها..."}),children:h.jsx(bC,{sortedTelemetry:U,dataGaps:ye,visibleParams:M,relays:l})}),weather:R?h.jsx(w.Suspense,{fallback:h.jsx(ht,{message:"در حال بارگذاری اطلاعات آب و هوا..."}),children:h.jsx(yC,{selectedDate:R})}):null,analysis:R?h.jsx(w.Suspense,{fallback:h.jsx(ht,{message:"در حال بارگذاری تحلیل..."}),children:h.jsx(vC,{deviceId:z,selectedDate:R})}):null}})]})}):h.jsx(Mi,{pageTitle:"گزارش روزانه",pageIcon:sc,iconGradient:"from-indigo-500 to-purple-600",children:h.jsx("div",{className:"flex items-center justify-center p-4",children:h.jsxs("div",{className:"text-center",children:[h.jsx(Xa,{className:"w-12 h-12 text-red-500 mx-auto mb-4"}),h.jsx("div",{className:"text-lg text-red-600 mb-4",children:"تاریخ انتخاب نشده است"}),h.jsx(pt,{onClick:ae,variant:"outline",icon:lc,children:"بازگشت به تقویم"})]})})})}function _C(){return h.jsx(w.Suspense,{fallback:h.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"w-16 h-16 border-4 border-indigo-500 border-t-transparent rounded-full animate-spin mx-auto mb-4"}),h.jsx("p",{className:"text-gray-600",children:"در حال بارگذاری گزارش..."})]})}),children:h.jsx(SC,{})})}function wC({years:n,selectedYear:t,onYearChange:a,className:s}){return h.jsxs("div",{className:te("flex flex-wrap items-center justify-center gap-4",s),children:[h.jsxs("label",{className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:[h.jsx(Xa,{className:"w-4 h-4 text-gray-500"}),"انتخاب سال:"]}),h.jsx("select",{className:"px-4 py-2 border border-gray-200 rounded-lg focus:border-green-500 focus:outline-none focus:ring-2 focus:ring-green-500/20 transition-all duration-150 bg-white font-medium",value:t,onChange:l=>a(Number(l.target.value)),children:n.map(l=>h.jsx("option",{value:l,children:l},l))})]})}const jC=["شنبه","یکشنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنجشنبه","جمعه"];function NC({weekdays:n=jC,className:t}){return h.jsx("div",{className:te("grid grid-cols-7 text-center bg-gray-50 border-b border-gray-200",t),children:n.map(a=>h.jsx("div",{className:"p-3 md:p-4 text-sm font-semibold text-gray-700",children:a},a))})}const MC=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"];function TC(){const n=Un(),a=rr().get("deviceId"),[s,l]=w.useState(1),[o,u]=w.useState(Ga()),[d,f]=w.useState([]),[g,x]=w.useState({}),[b,v]=w.useState(!0),_=w.useMemo(()=>Array.from({length:10},(S,N)=>Ga()-2+N),[]);w.useEffect(()=>{a&&l(Number(a))},[a]),w.useEffect(()=>{let S=!0;return x({}),f([]),v(!0),We.activeMonths(s,o).then(async N=>{if(!S)return;f(N);const C=await Promise.all(N.map(async k=>{const E=await We.monthDays(s,o,k),A=E.reduce((z,L)=>z+L.count,0);return[k,{days:E.length,records:A}]}));S&&x(Object.fromEntries(C))}).catch(console.error).finally(()=>{S&&v(!1)}),()=>{S=!1}},[s,o]);const M=w.useMemo(()=>Object.values(g).reduce((S,N)=>S+((N==null?void 0:N.days)??0),0),[g]),j=w.useMemo(()=>Object.values(g).reduce((S,N)=>S+((N==null?void 0:N.records)??0),0),[g]);return b?h.jsx(ht,{message:"در حال بارگذاری تقویم..."}):h.jsx(Mi,{pageTitle:"انتخاب سال و ماه",pageIcon:Xa,iconGradient:"from-green-500 to-green-600",children:h.jsx("div",{className:"max-w-6xl mx-auto",children:h.jsxs(dc,{padding:"lg",children:[h.jsx(wC,{years:_,selectedYear:o,onYearChange:u,className:"mb-6"}),h.jsx("div",{className:"bg-gradient-to-r from-green-50 to-emerald-50 border border-green-200 rounded-xl p-4 mb-6",children:h.jsxs("div",{className:"flex items-center justify-center gap-6 flex-wrap",children:[h.jsx(Uf,{icon:Rc,label:"روز دارای داده",value:M}),h.jsx(Uf,{icon:nj,label:"رکورد",value:j})]})}),h.jsx("div",{className:"grid gap-4 md:grid-cols-3 xl:grid-cols-4",children:MC.map((S,N)=>{const C=N+1,k=d.includes(C),E=g[C];return h.jsx(ON,{name:S,isActive:k,stats:E,onClick:()=>k&&n.replace(`/day-details?deviceId=${s}&year=${o}&month=${C}`)},C)})})]})})})}function kC(){return h.jsx(w.Suspense,{fallback:h.jsx(ht,{message:"در حال بارگذاری تقویم..."}),children:h.jsx(TC,{})})}const CC=["فروردین","اردیبهشت","خرداد","تیر","مرداد","شهریور","مهر","آبان","آذر","دی","بهمن","اسفند"];function EC(){const n=Un(),t=rr(),[a,s]=w.useState([]),[l,o]=w.useState(!0),u=Number(t.get("deviceId")??"1"),d=Number(t.get("year")??Ga()),f=Number(t.get("month")??Ss());w.useEffect(()=>{o(!0),We.monthDays(u,d,f).then(s).catch(console.error).finally(()=>o(!1))},[u,d,f]);const g=w.useMemo(()=>{const _=new Map;return a.forEach(M=>{const j=parseInt(M.persianDate.split("/")[2]);_.set(j,M.count)}),_},[a]),x=w.useMemo(()=>lv(d,f),[d,f]),b=w.useMemo(()=>rv(d,f),[d,f]),v=w.useMemo(()=>{const _=[];for(let M=0;M<b;M++)_.push({type:"empty",day:null});for(let M=1;M<=x;M++)_.push({type:"day",day:M});return _},[b,x]);return l?h.jsx(ht,{message:"در حال بارگذاری تقویم..."}):h.jsx(Mi,{pageTitle:`${CC[f-1]} ${d}`,pageIcon:Xa,iconGradient:"from-green-500 to-green-600",children:h.jsxs("div",{className:"max-w-6xl mx-auto",children:[h.jsxs(dc,{className:"overflow-hidden",padding:"none",children:[h.jsx(NC,{}),h.jsx("div",{className:"grid grid-cols-7 gap-1 p-1 bg-gray-50",children:v.map((_,M)=>{if(_.type==="empty")return h.jsx("div",{className:"min-h-[90px] md:min-h-[100px] bg-transparent"},`empty-${M}`);const j=_.day,S=g.has(j),N=g.get(j)||0;if(S){const C=String(j).padStart(2,"0"),k=String(f).padStart(2,"0"),E=`${d}/${k}/${C}`;return h.jsx(yx,{day:j,hasData:!0,recordCount:N,onClick:()=>n.replace(`/daily-report?deviceId=${u}&date=${encodeURIComponent(E)}`)},j)}else return h.jsx(yx,{day:j,hasData:!1},j)})})]}),h.jsx("div",{className:"mt-6 bg-gradient-to-r from-green-50 to-emerald-50 border border-green-200 rounded-xl p-4 text-center",children:h.jsx(Uf,{icon:Rc,label:`روز دارای داده از ${x} روز ماه`,value:a.length})})]})})}function AC(){return h.jsx(w.Suspense,{fallback:h.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"w-16 h-16 border-4 border-blue-500 border-t-transparent rounded-full animate-spin mx-auto mb-4"}),h.jsx("p",{className:"text-gray-600",children:"در حال بارگذاری..."})]})}),children:h.jsx(EC,{})})}function DC(){const{deviceName:n}=Os(),[t,a]=w.useState(null),[s,l]=w.useState(!1),[o,u]=w.useState(null),[d,f]=w.useState(null),[g,x]=w.useState("در حال دریافت..."),b=w.useCallback(async(_=!1)=>{l(!0),u(null);try{const[M,j]=await Promise.all([c1(_),uC(ys,vs,_)]);a(M),x(j)}catch(M){console.error("Error loading weather:",M),u("خطا در دریافت اطلاعات آب و هوا. لطفاً دوباره تلاش کنید."),x("کهک قم، ایران")}finally{l(!1)}},[]);w.useEffect(()=>{b()},[b]);const v=()=>{a(null),b(!0)};return h.jsx(Mi,{pageTitle:"آب و هوا",pageIcon:Dy,pageInfo:n||void 0,iconGradient:"from-sky-500 to-cyan-600",children:h.jsxs("div",{className:"max-w-4xl mx-auto space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[h.jsx(Oy,{className:"w-5 h-5 text-sky-500"}),h.jsx("span",{className:"font-medium",children:g})]}),h.jsx(pt,{onClick:v,variant:"outline",icon:oc,disabled:s,children:"بروزرسانی"})]}),s&&h.jsx(ht,{message:"در حال دریافت اطلاعات آب و هوا...",fullScreen:!1}),o&&h.jsx(Ls,{message:o,action:h.jsx(pt,{onClick:v,variant:"primary",icon:oc,children:"تلاش مجدد"})}),t&&!s&&h.jsx(gC,{weatherData:t,expandedDayIndex:d,onDayToggle:f})]})})}function zC(){const n=Un(),{deviceId:t}=Os(),[a,s]=w.useState(null);w.useEffect(()=>{const d=localStorage.getItem("user");if(d)try{s(JSON.parse(d))}catch{}},[]);const l=()=>{localStorage.removeItem("authToken"),localStorage.removeItem("user"),n.push("/")},o=()=>{n.push(`/device?deviceId=${t}`)},u=()=>{n.push("/devices")};return h.jsx(Mi,{pageTitle:"پروفایل",pageIcon:Of,iconGradient:"from-green-500 to-emerald-600",children:h.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[h.jsxs(dc,{padding:"lg",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[h.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-green-500 to-emerald-600 rounded-2xl flex items-center justify-center shadow-md",children:h.jsx(Of,{className:"w-8 h-8 text-white"})}),h.jsxs("div",{children:[h.jsx("h2",{className:"text-xl font-bold text-gray-900",children:a?`${a.name} ${a.family}`:"کاربر"}),h.jsxs("p",{className:"text-sm text-gray-500 mt-1 flex items-center gap-1.5",children:[h.jsx(gh,{className:"w-4 h-4"}),(a==null?void 0:a.mobile)||"---"]})]})]}),h.jsx("div",{className:"border-t border-gray-100 pt-4 space-y-3",children:h.jsxs("div",{className:"flex items-center justify-between py-2",children:[h.jsx("span",{className:"text-sm text-gray-600",children:"نقش کاربری"}),h.jsxs("span",{className:"text-sm font-medium text-gray-900 flex items-center gap-1.5",children:[h.jsx(Uy,{className:"w-4 h-4 text-green-600"}),(a==null?void 0:a.role)===1?"مدیر":"کاربر"]})]})})]}),h.jsx(dc,{padding:"lg",children:h.jsxs("div",{className:"space-y-2",children:[h.jsxs("button",{onClick:u,className:"w-full flex items-center justify-between p-4 rounded-xl hover:bg-gray-50 transition-colors group",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 bg-purple-100 rounded-lg flex items-center justify-center group-hover:scale-110 transition-transform",children:h.jsx(k5,{className:"w-5 h-5 text-purple-600"})}),h.jsxs("div",{className:"text-right",children:[h.jsx("p",{className:"font-medium text-gray-900",children:"انتخاب دستگاه"}),h.jsx("p",{className:"text-xs text-gray-500",children:"تغییر دستگاه فعال"})]})]}),h.jsx(_i,{className:"w-5 h-5 text-gray-400 group-hover:-translate-x-1 transition-transform"})]}),h.jsxs("button",{onClick:o,className:"w-full flex items-center justify-between p-4 rounded-xl hover:bg-gray-50 transition-colors group",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center group-hover:scale-110 transition-transform",children:h.jsx(cc,{className:"w-5 h-5 text-blue-600"})}),h.jsxs("div",{className:"text-right",children:[h.jsx("p",{className:"font-medium text-gray-900",children:"تنظیمات دستگاه و رله‌ها"}),h.jsx("p",{className:"text-xs text-gray-500",children:"نام‌گذاری رله‌ها و تعیین شرایط روشن/خاموش شدن"})]})]}),h.jsx(_i,{className:"w-5 h-5 text-gray-400 group-hover:-translate-x-1 transition-transform"})]}),h.jsxs("button",{onClick:l,className:"w-full flex items-center justify-between p-4 rounded-xl hover:bg-red-50 transition-colors group",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 bg-red-100 rounded-lg flex items-center justify-center group-hover:scale-110 transition-transform",children:h.jsx(Rf,{className:"w-5 h-5 text-red-600"})}),h.jsxs("div",{className:"text-right",children:[h.jsx("p",{className:"font-medium text-red-600",children:"خروج از حساب"}),h.jsx("p",{className:"text-xs text-gray-500",children:"خروج از حساب کاربری"})]})]}),h.jsx(_i,{className:"w-5 h-5 text-gray-400 group-hover:-translate-x-1 transition-transform"})]})]})})]})})}function $t({label:n,hint:t,htmlFor:a,onDark:s=!1,children:l,className:o}){return h.jsxs("div",{className:te("space-y-1.5",o),children:[h.jsx("label",{htmlFor:a,className:te("block text-sm font-medium",s?"text-slate-200":"text-gray-700"),children:n}),l,t&&h.jsx("p",{className:te("text-xs leading-5",s?"text-slate-400":"text-gray-400"),children:t})]})}const RC={[-1]:"بهت زنگ بزنم",0:"برات پیامک بفرستم"},ki=[{value:0,label:"دما",icon:Ns,unit:"°C"},{value:1,label:"رطوبت هوا",icon:lr,unit:"%"},{value:2,label:"رطوبت خاک",icon:Ry,unit:"%"},{value:3,label:"گاز",icon:Oc,unit:"PPM"},{value:4,label:"نور",icon:en,unit:"Lux"}],ua=[{value:0,label:"بزرگتر از",icon:()=>h.jsx("span",{className:"text-2xl font-bold",children:">"}),needsMax:!1},{value:1,label:"کوچکتر از",icon:()=>h.jsx("span",{className:"text-2xl font-bold",children:"<"}),needsMax:!1},{value:2,label:"بین",icon:Rw,needsMax:!0},{value:3,label:"خارج از محدوده",icon:w5,needsMax:!0}],Hh=[{value:-1,label:"تماس تلفنی",icon:R5},{value:0,label:"پیامک",icon:N5}],Es=[{value:0,label:"روز",icon:en,description:"فقط در روز بررسی شود"},{value:1,label:"شب",icon:E5,description:"فقط در شب بررسی شود"},{value:2,label:"همیشه",icon:Lc,description:"در هر زمان بررسی شود"}];function OC({rule:n,index:t,onEdit:a,onRemove:s}){const l=ki.find(E=>E.value===n.sensorType),o=ua.find(E=>E.value===n.comparisonType),u=Es.find(E=>E.value===n.timeType),d=iM.find(E=>E.value===n.action),f=l==null?void 0:l.icon,g=u==null?void 0:u.icon,x=d==null?void 0:d.icon,b=hc[n.sensorType]??hc[0],v=mc[n.timeType]??mc[2],_=(l==null?void 0:l.label)??"",M=(l==null?void 0:l.unit)??"",j=n.comparisonType===0?">":n.comparisonType===1?"<":"",S=o!=null&&o.needsMax?`${o.label}: ${n.value1} - ${n.value2??"؟"} ${M}`:`${j} ${n.value1} ${M}`,N=u?n.timeType<2?`در ${u.label}`:u.label:"",k=n.action===0?"bg-emerald-100 text-emerald-700 ring-1 ring-emerald-200":"bg-rose-100 text-rose-600 ring-1 ring-rose-200";return h.jsxs("div",{className:te("group flex items-stretch gap-2 rounded-xl border transition-all",b.chip),title:`ویرایش قانون ${t+1}`,children:[h.jsxs("button",{type:"button",onClick:()=>a(t),className:"flex items-center gap-2.5 flex-1 min-w-0 px-3 py-2.5 text-right",children:[h.jsx("span",{className:te("flex items-center justify-center w-10 h-10 rounded-xl border shrink-0 shadow-sm",b.bubble),children:f&&h.jsx(f,{className:"w-5 h-5"})}),h.jsxs("span",{className:"min-w-0 flex-1 space-y-1",children:[h.jsxs("span",{className:"flex items-center gap-1.5 flex-wrap text-sm",children:[h.jsx("span",{className:te("font-bold",b.label),children:_}),h.jsx("span",{className:te("font-mono text-[11px] font-semibold px-2 py-0.5 rounded-md border bg-white/90",b.mono),children:S})]}),h.jsxs("span",{className:"flex items-center gap-1.5 flex-wrap",children:[h.jsxs("span",{className:te("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-semibold",v.badge),children:[g&&h.jsx(g,{className:"w-3 h-3"}),N]}),h.jsxs("span",{className:te("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-semibold",k),children:[x&&h.jsx(x,{className:"w-3 h-3"}),"رله ",(d==null?void 0:d.label)??""]})]})]})]}),h.jsxs("span",{className:"flex items-center gap-0.5 pl-1.5",children:[h.jsx("button",{type:"button",onClick:()=>a(t),className:"p-1.5 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",title:"ویرایش این قانون",children:h.jsx(Hy,{className:"w-3.5 h-3.5"})}),h.jsx("button",{type:"button",onClick:()=>s(t),className:"p-1.5 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded-lg transition-colors",title:"حذف این قانون",children:h.jsx(xh,{className:"w-3.5 h-3.5"})})]})]})}const ny="w-full appearance-none pl-9 pr-3.5 py-2.5 rounded-xl border border-gray-200 bg-white text-sm text-gray-700 cursor-pointer transition-all",ay="w-full pl-10 pr-3.5 py-2.5 rounded-xl border border-gray-200 bg-white text-sm text-gray-700 text-center transition-all focus:border-green-500 focus:ring-2 focus:ring-green-500/20 focus:outline-none",LC="flex flex-col items-center justify-center gap-1.5 rounded-xl border px-2 py-3 text-xs font-medium transition-all",HC="border-gray-200 bg-white text-gray-500 hover:border-gray-300 hover:text-gray-700",BC={0:"focus:border-red-300 focus:ring-2 focus:ring-red-500/20",1:"focus:border-blue-300 focus:ring-2 focus:ring-blue-500/20",2:"focus:border-emerald-300 focus:ring-2 focus:ring-emerald-500/20",3:"focus:border-amber-300 focus:ring-2 focus:ring-amber-500/20",4:"focus:border-violet-300 focus:ring-2 focus:ring-violet-500/20"};function iy(){return{id:0,sensorType:0,comparisonType:0,value1:30,value2:void 0,action:0,timeType:2,order:0}}function UC({open:n,initial:t,onClose:a,onConfirm:s}){const l=!!t,[o,u]=w.useState(0),[d,f]=w.useState(0),[g,x]=w.useState("30"),[b,v]=w.useState(""),[_,M]=w.useState(2);w.useEffect(()=>{if(!n)return;const Q=t??iy();u(Q.sensorType),f(Q.comparisonType),x(Q.value1!=null?String(Q.value1):""),v(Q.value2!=null?String(Q.value2):""),M(Q.timeType)},[n,t]);const j=_===1,S=ki.find(Q=>Q.value===o),N=S==null?void 0:S.icon,C=(S==null?void 0:S.unit)??"",k=(S==null?void 0:S.label)??"",E=hc[o]??hc[0],A=w.useMemo(()=>{var Q;return!!((Q=ua.find(ae=>ae.value===d))!=null&&Q.needsMax)},[d]),z=ua.find(Q=>Q.value===d),L=Es.find(Q=>Q.value===_),R=w.useMemo(()=>{const Q=(L==null?void 0:L.label)??"";return _<2?`در ${Q}`:Q},[_,L]),X=w.useMemo(()=>{const Q=g===""?"…":g;if(A){const ae=b===""?"…":b;return`وقتی ${k} ${(z==null?void 0:z.label)??""} ${Q} تا ${ae} ${C} شد، رله روشن شود`}return`وقتی ${k} ${(z==null?void 0:z.label)??""} ${Q} ${C} شد، رله روشن شود`},[k,C,z,A,g,b]),de=()=>{const Q=t??iy(),ae=g===""?0:Number(g),Ee=b===""?0:Number(b);s({...Q,sensorType:o,comparisonType:d,value1:Number.isFinite(ae)?ae:0,value2:A&&Number.isFinite(Ee)?Ee:Q.value2??void 0,action:0,timeType:_})};return h.jsxs(vh,{isOpen:n,onClose:a,title:l?"ویرایش قانون":"افزودن قانون جدید",size:"md",contentClassName:"p-0",children:[h.jsxs("div",{className:te("p-5 space-y-5 transition-colors duration-300",j&&"bg-gradient-to-b from-indigo-950 via-slate-900 to-indigo-950"),children:[h.jsxs("div",{className:te("flex items-start gap-3 rounded-xl border px-4 py-3",E.banner),children:[h.jsx("span",{className:te("flex items-center justify-center w-9 h-9 rounded-xl border shrink-0 shadow-sm",E.bubble),children:N&&h.jsx(N,{className:"w-5 h-5"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:te("text-sm font-semibold leading-relaxed",E.bannerText),children:X}),h.jsxs("p",{className:te("text-[11px] mt-1 font-medium opacity-80",E.bannerText),children:[R," بررسی می‌شود"]})]})]}),h.jsxs("div",{children:[h.jsx("span",{className:te("block text-sm font-medium mb-2",j?"text-slate-100":"text-gray-700"),children:"زمان بررسی"}),h.jsx("div",{className:"grid grid-cols-3 gap-2",children:Es.map(Q=>{const ae=Q.icon,Ee=Q.value===_,Oe=mc[Q.value]??mc[2],he=Q.value<2?`در ${Q.label}`:Q.label;return h.jsxs("button",{type:"button",onClick:()=>M(Q.value),className:te(LC,Ee?Oe.activeButton:HC),children:[h.jsx(ae,{className:te("w-4 h-4",Oe.iconText)}),he]},Q.value)})})]}),h.jsxs($t,{label:"شرط (وقتی...)",hint:"یک شرط برای روشن شدن خودکار رله تعریف کنید.",onDark:j,children:[h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[h.jsxs("div",{className:"relative",children:[h.jsx("select",{className:te(ny,"focus:outline-none",BC[o]),value:o,onChange:Q=>u(Number(Q.target.value)),children:ki.map(Q=>h.jsxs("option",{value:Q.value,children:[Q.label," (",Q.unit,")"]},Q.value))}),h.jsx(Wl,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})]}),h.jsxs("div",{className:"relative",children:[h.jsx("select",{className:te(ny,"focus:border-green-500 focus:ring-2 focus:ring-green-500/20 focus:outline-none"),value:d,onChange:Q=>f(Number(Q.target.value)),children:ua.map(Q=>h.jsx("option",{value:Q.value,children:Q.label},Q.value))}),h.jsx(Wl,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-2",children:[h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:"number",step:"0.1",dir:"ltr",inputMode:"decimal",value:g,onChange:Q=>x(Q.target.value),className:ay,placeholder:A?"از":"مقدار"}),h.jsx("span",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-[10px] text-gray-400 pointer-events-none",children:C})]}),A?h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:"number",step:"0.1",dir:"ltr",inputMode:"decimal",value:b,onChange:Q=>v(Q.target.value),className:ay,placeholder:"تا"}),h.jsx("span",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-[10px] text-gray-400 pointer-events-none",children:C})]}):h.jsx("div",{className:"flex items-center justify-center rounded-xl border border-dashed border-gray-200 bg-gray-50 text-xs text-gray-300 select-none",children:"(فقط یک مقدار)"})]})]})]}),h.jsxs("div",{className:"flex items-center justify-end gap-2 px-5 py-4 border-t border-gray-100 bg-gray-50/50 rounded-b-lg",children:[h.jsx(pt,{type:"button",variant:"ghost",size:"md",onClick:a,children:"انصراف"}),h.jsx(pt,{type:"button",variant:"success",size:"md",icon:Ay,onClick:de,children:l?"ذخیره تغییرات":"تأیید و افزودن"})]})]})}function $C(){return{id:0,sensorType:0,comparisonType:0,value1:30,value2:void 0,action:0,timeType:2,order:0}}function VC({relay:n,onChange:t,embedded:a=!1}){var M;const s=((M=ca.find(j=>j.value===n.relayKind))==null?void 0:M.icon)??mh,l=wi[n.relayKind],[o,u]=w.useState({open:!1,editingIndex:null}),d=j=>t({...n,...j}),f=()=>u({open:!0,editingIndex:null}),g=j=>u({open:!0,editingIndex:j}),x=()=>u({open:!1,editingIndex:null}),b=j=>{const S=[...n.rules];o.editingIndex!==null?S[o.editingIndex]={...j,order:o.editingIndex}:S.push({...$C(),...j,id:0,order:n.rules.length}),d({rules:S}),x()},v=j=>{d({rules:n.rules.filter((S,N)=>N!==j).map((S,N)=>({...S,order:N}))})},_=o.editingIndex!==null?n.rules[o.editingIndex]:void 0;return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:te(!a&&"rounded-3xl border border-gray-200 bg-white shadow-sm overflow-hidden"),children:[h.jsxs("div",{className:te("flex items-center justify-between gap-3 px-5 py-4 border-b border-gray-100",n.isEnabled?"bg-gradient-to-l from-gray-50 to-white":"bg-gray-50"),children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("span",{className:"flex items-center justify-center",children:h.jsx(s,{className:te("w-8 h-8",l.iconText)})}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"text-sm font-semibold text-gray-900",children:["رله ",n.relayIndex]}),n.name&&h.jsxs("span",{className:"text-sm text-gray-500",children:["— ",n.name]})]}),h.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:n.isEnabled?"فعال":"غیرفعال"})]})]}),h.jsxs("button",{type:"button",onClick:()=>d({isEnabled:!n.isEnabled}),title:Do.enabled,className:te("inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium transition-colors",n.isEnabled?"bg-green-100 text-green-700":"bg-gray-200 text-gray-600"),children:[n.isEnabled?h.jsx(ph,{className:"w-4 h-4"}):h.jsx(Vy,{className:"w-4 h-4"}),n.isEnabled?"فعال":"غیرفعال"]})]}),h.jsxs("div",{className:"p-5 space-y-5",children:[h.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[h.jsx($t,{label:"نام رله",hint:Do.name,children:h.jsx("input",{type:"text",value:n.name,onChange:j=>d({name:j.target.value}),placeholder:"مثلاً فن، هیتر",className:"w-full px-4 py-2.5 rounded-xl border border-gray-200 bg-gray-50 text-sm text-gray-700 focus:border-green-500 focus:bg-white focus:outline-none focus:ring-2 focus:ring-green-500/20 transition-all"})}),h.jsx($t,{label:"نوع تجهیز",hint:Do.kind,children:h.jsx("select",{value:n.relayKind,onChange:j=>d({relayKind:Number(j.target.value)}),className:"w-full appearance-none px-4 py-2.5 rounded-xl border border-gray-200 bg-gray-50 text-sm text-gray-700 focus:border-green-500 focus:bg-white focus:outline-none focus:ring-2 focus:ring-green-500/20 transition-all cursor-pointer",children:ca.map(j=>h.jsx("option",{value:j.value,children:j.label},j.value))})})]}),h.jsxs("div",{className:"pt-4 border-t border-gray-100",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"text-sm font-medium text-gray-700",children:"قوانین روشن/خاموش شدن"}),n.rules.length>0&&h.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-gray-100 text-gray-500",children:n.rules.length})]}),h.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:Do.rules})]}),h.jsxs("button",{type:"button",onClick:f,className:"inline-flex items-center gap-1.5 px-3 py-2 rounded-xl text-xs font-medium bg-green-50 text-green-700 hover:bg-green-100 transition-colors",children:[h.jsx(rc,{className:"w-3.5 h-3.5"}),"افزودن قانون"]})]}),n.rules.length===0?h.jsxs("button",{type:"button",onClick:f,className:"w-full rounded-2xl border border-dashed border-gray-200 bg-gray-50 py-8 text-center hover:border-green-300 hover:bg-green-50/40 transition-colors",children:[h.jsx(Lc,{className:"w-6 h-6 mx-auto text-gray-300 mb-2"}),h.jsx("p",{className:"text-sm text-gray-400",children:"هنوز قانونی تعریف نشده است. برای تعریف اولین قانون کلیک کنید."})]}):h.jsx("div",{className:"space-y-2",children:n.rules.map((j,S)=>h.jsx(OC,{rule:j,index:S,onEdit:g,onRemove:v},S))})]})]})]}),h.jsx(UC,{open:o.open,initial:_,onClose:x,onConfirm:b})]})}function YC(n){return{id:0,deviceSettingsId:0,relayIndex:n,name:"",isEnabled:!0,relayKind:0,rules:[]}}function GC(n){var l;const t=Math.max(1,n.relayCount||1),a=new Map(((l=n.relays)==null?void 0:l.map(o=>[o.relayIndex,o]))??[]),s=[];for(let o=1;o<=t;o++)s.push(a.get(o)??YC(o));return{...n,relayCount:t,relays:s}}function qC({deviceId:n}){const[t,a]=w.useState(null),[s,l]=w.useState(1),[o,u]=w.useState(!0),[d,f]=w.useState(!1),[g,x]=w.useState(null),[b,v]=w.useState(null),_=w.useCallback(async()=>{try{u(!0),x(null);const N=await We.getDeviceSettings(n);a(GC(N))}catch{x("خطا در بارگذاری تنظیمات رله‌ها")}finally{u(!1)}},[n]);w.useEffect(()=>{_()},[_]);const M=async()=>{if(t)try{f(!0),x(null),v(null),t.id===0?(await We.createDeviceSettings(t),v("تنظیمات رله‌ها ایجاد شد")):(await We.updateDeviceSettings(t),v("تنظیمات رله‌ها ذخیره شد")),await _()}catch{x("خطا در ذخیره تنظیمات")}finally{f(!1)}},j=N=>{a(C=>C&&{...C,relays:C.relays.map(k=>k.relayIndex===N.relayIndex?N:k)})};if(o)return h.jsx(ht,{message:"در حال بارگذاری رله‌ها..."});if(!t)return h.jsx(or,{title:"تنظیمات رله‌ها وجود ندارد",message:"برای این دستگاه هنوز تنظیمات رله‌ای ثبت نشده است"});const S=t.relays.find(N=>N.relayIndex===s)??t.relays[0];return h.jsxs("div",{className:"space-y-4",children:[g&&h.jsx(Ls,{message:g}),b&&h.jsx(sv,{message:b}),h.jsxs("div",{className:"bg-white rounded-2xl border border-gray-200 shadow-sm overflow-hidden",children:[h.jsx("div",{className:"flex border-b border-gray-200 overflow-x-auto",children:t.relays.map(N=>{const C=N.relayIndex===S.relayIndex,k=ca.find(z=>z.value===N.relayKind)??ca[0],E=wi[N.relayKind],A=k.icon;return h.jsxs("button",{type:"button",onClick:()=>l(N.relayIndex),className:te("flex-1 min-w-fit inline-flex items-center justify-center gap-2 px-4 py-3 text-sm font-medium border-b-2 transition-all whitespace-nowrap",E.iconText,C?te(E.activeBorder,E.activeBg):"border-transparent"),children:[h.jsx(A,{className:te("w-4 h-4",E.iconText)}),h.jsxs("span",{children:["رله ",N.relayIndex]}),N.name&&h.jsxs("span",{className:"font-normal",children:["— ",N.name]})]},N.relayIndex)})}),h.jsx(VC,{relay:S,onChange:j,embedded:!0})]}),h.jsx("div",{className:"flex justify-center pb-4",children:h.jsx(pt,{variant:"success",size:"lg",loading:d,icon:By,onClick:M,children:"ذخیره تنظیمات"})})]})}const Zo="w-full px-4 py-2.5 rounded-xl border text-sm text-gray-700 focus:bg-white focus:outline-none focus:ring-2 transition-all",_n={emerald:`${Zo} border-emerald-200 bg-emerald-50/40 focus:border-emerald-500 focus:ring-emerald-500/20`,indigo:`${Zo} border-indigo-200 bg-indigo-50/40 focus:border-indigo-500 focus:ring-indigo-500/20`,sky:`${Zo} border-sky-200 bg-sky-50/40 focus:border-sky-500 focus:ring-sky-500/20`,amber:`${Zo} border-amber-200 bg-amber-50/40 focus:border-amber-500 focus:ring-amber-500/20`};function Ko({icon:n,iconClass:t,title:a,subtitle:s,children:l}){return h.jsxs("div",{className:"rounded-3xl border border-gray-200 bg-white shadow-sm overflow-hidden",children:[h.jsxs("div",{className:"flex items-center gap-3 px-5 py-4 border-b border-gray-100 bg-gradient-to-l from-gray-50 to-white",children:[h.jsx("span",{className:te("flex items-center justify-center w-11 h-11 rounded-2xl shrink-0",t),children:h.jsx(n,{className:"w-5 h-5"})}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("h3",{className:"text-sm font-bold text-gray-900",children:a}),h.jsx("p",{className:"text-xs text-gray-400 mt-0.5 truncate",children:s})]})]}),h.jsx("div",{className:"p-5",children:l})]})}function XC({deviceId:n,deviceName:t}){const[a,s]=w.useState(null),[l,o]=w.useState(!0),[u,d]=w.useState(!1),[f,g]=w.useState(null),[x,b]=w.useState(null),[v,_]=w.useState(""),M=w.useCallback(async()=>{try{o(!0),g(null);const E=await We.getDeviceSettings(n);s(E)}catch{g("خطا در بارگذاری اطلاعات دستگاه")}finally{o(!1)}},[n]);w.useEffect(()=>{M()},[M]);const j=E=>{s(A=>A&&{...A,...E})},S=()=>{if(!a)return;const E=v.replace(/[^\d]/g,"").trim();if(!/^09\d{9}$/.test(E)){window.alert("شماره موبایل معتبر وارد کنید (مثلاً 09123456789)");return}const A=a.smsRecievers.split(",").map(z=>z.trim()).filter(Boolean);if(A.includes(E)){window.alert("این شماره قبلاً اضافه شده است");return}j({smsRecievers:[...A,E].join(",")}),_("")},N=E=>{if(!a)return;const A=a.smsRecievers.split(",").map(z=>z.trim()).filter(Boolean);A.splice(E,1),j({smsRecievers:A.join(",")})},C=async()=>{if(a)try{d(!0),g(null),b(null),a.id===0?(await We.createDeviceSettings(a),b("اطلاعات دستگاه ایجاد شد")):(await We.updateDeviceSettings(a),b("اطلاعات دستگاه ذخیره شد")),await M()}catch{g("خطا در ذخیره اطلاعات")}finally{d(!1)}};if(l)return h.jsx(ht,{message:"در حال بارگذاری اطلاعات دستگاه..."});if(!a)return h.jsx(or,{title:"اطلاعات دستگاه وجود ندارد",message:"برای این دستگاه هنوز تنظیماتی ثبت نشده است"});const k=a.smsRecievers.split(",").map(E=>E.trim()).filter(Boolean);return h.jsxs("div",{className:"space-y-4",children:[f&&h.jsx(Ls,{message:f}),x&&h.jsx(sv,{message:x}),h.jsx(Ko,{icon:Oy,iconClass:"bg-emerald-100 text-emerald-600",title:"موقعیت جغرافیایی",subtitle:"استان، شهر و مختصات محل نصب دستگاه",children:h.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[h.jsx($t,{label:"استان",children:h.jsx("input",{className:_n.emerald,value:a.province,onChange:E=>j({province:E.target.value})})}),h.jsx($t,{label:"شهر",children:h.jsx("input",{className:_n.emerald,value:a.city,onChange:E=>j({city:E.target.value})})}),h.jsx($t,{label:"عرض جغرافیایی",children:h.jsx("input",{type:"number",step:"0.000001",dir:"ltr",className:_n.emerald,value:a.latitude??"",onChange:E=>j({latitude:parseFloat(E.target.value)||void 0})})}),h.jsx($t,{label:"طول جغرافیایی",children:h.jsx("input",{type:"number",step:"0.000001",dir:"ltr",className:_n.emerald,value:a.longitude??"",onChange:E=>j({longitude:parseFloat(E.target.value)||void 0})})})]})}),h.jsx(Ko,{icon:$y,iconClass:"bg-indigo-100 text-indigo-600",title:"نوع دستگاه",subtitle:"مشخصات محصول و ابعاد فضای کشت",children:h.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[h.jsx($t,{label:"نوع محصول",children:h.jsx("input",{className:_n.indigo,value:a.productType,onChange:E=>j({productType:E.target.value})})}),h.jsx($t,{label:"مساحت گلخانه",hint:"متر مربع",children:h.jsx("input",{type:"number",dir:"ltr",className:_n.indigo,value:a.areaSquareMeters??"",onChange:E=>j({areaSquareMeters:parseFloat(E.target.value)||void 0})})})]})}),h.jsx(Ko,{icon:gh,iconClass:"bg-sky-100 text-sky-600",title:"ارتباطات",subtitle:"شماره سیم‌کارت دستگاه و فاصله ارسال داده",children:h.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[h.jsx($t,{label:"شماره تلفن دستگاه",children:h.jsx("input",{dir:"ltr",className:_n.sky,value:a.devicePhoneNumber,onChange:E=>j({devicePhoneNumber:E.target.value})})}),h.jsx($t,{label:"فاصله زمانی آپلود داده",hint:"دقیقه",children:h.jsx("input",{type:"number",dir:"ltr",className:_n.sky,value:a.uploadIntervalMin,onChange:E=>j({uploadIntervalMin:parseInt(E.target.value)||0})})})]})}),h.jsx(Ko,{icon:$w,iconClass:"bg-amber-100 text-amber-600",title:"اطلاع‌رسانی و هشدار",subtitle:"گیرندگان پیامک و محدودیت ارسال برای جلوگیری از مزاحمت",children:h.jsxs("div",{className:"space-y-4",children:[h.jsxs($t,{label:"گیرندگان پیامک",hint:"شماره موبایل دریافت‌کنندگان هشدار را اضافه کنید",children:[h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx("input",{className:te(_n.amber,"pl-10"),value:v,onChange:E=>_(E.target.value),onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),S())},placeholder:"09123456789",inputMode:"tel",dir:"ltr"}),h.jsx(sx,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-amber-400 pointer-events-none"})]}),h.jsx(pt,{variant:"outline",type:"button",onClick:S,className:"shrink-0",children:"افزودن"})]}),k.length>0?h.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:k.map((E,A)=>h.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-amber-50 text-amber-700 text-xs font-medium border border-amber-200",children:[E,h.jsx("button",{type:"button",onClick:()=>N(A),className:"text-amber-500 hover:text-red-500 transition-colors",children:h.jsx(Ci,{className:"w-3.5 h-3.5"})})]},E))}):h.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"هنوز شماره‌ای اضافه نشده است"})]}),h.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 border-t border-amber-100 pt-4",children:[h.jsx($t,{label:"فاصله ارسال پیامک",hint:"حداقل فاصله بین دو پیامک (دقیقه)",children:h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:"number",dir:"ltr",className:te(_n.amber,"pl-10"),value:a.minimumSmsIntervalMinutes,onChange:E=>j({minimumSmsIntervalMinutes:parseInt(E.target.value)||0})}),h.jsx(fh,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-amber-400 pointer-events-none"})]})}),h.jsx($t,{label:"فاصله تماس",hint:"حداقل فاصله بین دو تماس (دقیقه)",children:h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:"number",dir:"ltr",className:te(_n.amber,"pl-10"),value:a.minimumCallIntervalMinutes,onChange:E=>j({minimumCallIntervalMinutes:parseInt(E.target.value)||0})}),h.jsx(sx,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-amber-400 pointer-events-none"})]})})]})]})}),h.jsx("div",{className:"flex justify-center pb-4",children:h.jsx(pt,{variant:"success",size:"lg",loading:u,icon:By,onClick:C,children:"ذخیره اطلاعات"})})]})}const u1=n=>{const t=ki.find(a=>a.value===n);return t?t.icon:Rs},Bh=n=>{const t=ki.find(a=>a.value===n);return(t==null?void 0:t.label)??n.toString()},ws=n=>{const t=ki.find(a=>a.value===n);return(t==null?void 0:t.unit)??""},d1=n=>{const t=ua.find(a=>a.value===n);return(t==null?void 0:t.label)??n.toString()},IC=n=>{const t=Hh.find(a=>a.value===n);return(t==null?void 0:t.label)??n.toString()},FC=n=>{const t=Es.find(a=>a.value===n);return(t==null?void 0:t.label)??n.toString()},QC=n=>{const t=ua.find(s=>s.value===n.comparisonType);return t!=null&&t.needsMax?`${d1(n.comparisonType)}: ${n.value1} - ${n.value2??"?"} ${ws(n.sensorType)}`:`${n.comparisonType===0?">":n.comparisonType===1?"<":"?"} ${n.value1} ${ws(n.sensorType)}`},ZC=(n,t,a)=>{if(n.length===0)return"🤔 هنوز شرطی تعریف نکردی!";const s=RC[t]||"",l=a===0?"فقط توی روز":a===1?"فقط توی شب":"",o=n.map(f=>{const g=Bh(f.sensorType),x=ws(f.sensorType),b=ua.find(v=>v.value===f.comparisonType);if(b!=null&&b.needsMax)return f.comparisonType===2?`${g} بین ${f.value1} تا ${f.value2??"؟"} ${x} باشه`:`${g} از بازه ${f.value1} تا ${f.value2??"؟"} ${x} خارج شه`;{const v=f.comparisonType===0?"بالاتر":"پایین‌تر";return`${g} ${v} از ${f.value1} ${x} بره`}});let u="";if(o.length===1)u=`وقتی ${o[0]}`;else{const f=o[o.length-1];u=`وقتی ${o.slice(0,-1).join(" و ")} و ${f}`}return`${l?`${l}، `:""}${u}، ${s} 📱`};function KC({alert:n,onEdit:t,onDelete:a,onToggleActive:s}){var l,o;return h.jsx("div",{className:`p-6 hover:bg-gray-50 transition-colors ${n.isEnabled?"":"opacity-50"}`,children:h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{className:"flex-1 space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[h.jsx(Bf,{variant:"warning",icon:(l=Hh.find(u=>u.value===n.notificationType))==null?void 0:l.icon,children:IC(n.notificationType)}),h.jsx(Bf,{variant:"info",icon:(o=Es.find(u=>u.value===n.timeType))==null?void 0:o.icon,children:FC(n.timeType)}),h.jsx("button",{onClick:()=>s(n),className:`inline-flex items-center gap-1 px-3 py-1 rounded-md text-sm font-medium transition-colors ${n.isEnabled?"bg-green-100 text-green-800 hover:bg-green-200":"bg-gray-100 text-gray-800 hover:bg-gray-200"}`,children:n.isEnabled?h.jsxs(h.Fragment,{children:[h.jsx(Ay,{className:"w-3 h-3"}),"فعال"]}):h.jsxs(h.Fragment,{children:[h.jsx(Ci,{className:"w-3 h-3"}),"غیرفعال"]})})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("div",{className:"text-sm font-medium text-gray-700",children:"شرایط:"}),h.jsx("div",{className:"flex flex-wrap gap-2",children:n.rules.map((u,d)=>{const f=u1(u.sensorType);return h.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-gray-100 rounded-lg text-sm",children:[h.jsx(f,{className:"w-4 h-4 text-gray-600"}),h.jsx("span",{className:"font-medium",children:Bh(u.sensorType)}),h.jsx("span",{className:"font-mono text-gray-700",children:QC(u)})]},d)})})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(xx,{icon:Hy,variant:"primary",onClick:()=>t(n),title:"ویرایش"}),h.jsx(xx,{icon:xh,variant:"danger",onClick:()=>a(n.id),title:"حذف"})]})]})})}function PC({rules:n,notificationType:t,timeType:a}){return h.jsx("div",{className:"sticky top-[45px] z-10 bg-blue-600 -mx-6 -mt-6",children:h.jsx("div",{className:"px-6 py-4",children:h.jsx("div",{className:"flex items-start gap-3",children:h.jsx("div",{className:"flex-1",children:h.jsx("div",{className:"text-sm md:text-base text-white leading-relaxed font-medium",children:ZC(n,t,a)})})})})})}function WC({value:n,onChange:t}){return h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-2",children:"نوع اطلاع‌رسانی"}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:Hh.map(a=>{const s=a.icon,l=n===a.value;return h.jsxs("button",{type:"button",onClick:()=>t(a.value),className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border transition-all duration-150 text-xs ${l?"border-orange-500 bg-orange-50 text-orange-700":"border-gray-200 bg-white text-gray-600 hover:border-gray-300 hover:bg-gray-50"}`,children:[h.jsx(s,{className:`w-3.5 h-3.5 ${l?"text-orange-500":"text-gray-400"}`}),h.jsx("span",{className:"font-medium",children:a.label})]},a.value)})})]})}function JC({value:n,onChange:t}){return h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-2",children:"زمان بررسی شرایط"}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:Es.map(a=>{const s=a.icon,l=n===a.value;return h.jsxs("button",{type:"button",onClick:()=>t(a.value),title:a.description,className:`inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border transition-all duration-150 text-xs ${l?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-200 bg-white text-gray-600 hover:border-gray-300 hover:bg-gray-50"}`,children:[h.jsx(s,{className:`w-3.5 h-3.5 ${l?"text-blue-500":"text-gray-400"}`}),h.jsx("span",{className:"font-medium",children:a.label})]},a.value)})})]})}function Po(n){let t=n.replace(/[^0-9.\-]/g,"");const a=(t.match(/-/g)||[]).length;a>1?(t=t.replace(/-/g,""),n.startsWith("-")&&(t="-"+t)):a===1&&!t.startsWith("-")&&(t=t.replace(/-/g,""));const s=t.indexOf(".");if(s!==-1){const l=t.slice(0,s+1),o=t.slice(s+1).replace(/\./g,"");t=l+o.slice(0,1)}return t}function eE({rule:n,index:t,totalRules:a,onUpdate:s,onRemove:l}){var C;const o=(C=ua.find(k=>k.value===n.comparisonType))==null?void 0:C.needsMax,u=u1(n.sensorType),d=k=>k!=null?String(k):"",[f,g]=w.useState(d(n.value1)),[x,b]=w.useState(d(n.value2)),v=w.useRef(!1),_=w.useRef(!1),M=v.current?f:d(n.value1),j=_.current?x:d(n.value2),S=w.useCallback(k=>{const E=Po(k),A=E===""||E==="-"||E==="."?0:Number(E);isNaN(A)||s(t,{value1:A})},[t,s]),N=w.useCallback(k=>{const E=Po(k),A=E===""||E==="-"||E==="."?0:Number(E);isNaN(A)||s(t,{value2:A})},[t,s]);return h.jsxs("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-3",children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-bold text-orange-700 bg-white px-2 py-0.5 rounded-md",children:a===1?"⚡ شرط":`⚡ شرط ${t+1}`}),h.jsxs("span",{className:"text-xs text-gray-500 hidden sm:inline",children:[h.jsx(u,{className:"w-3 h-3 inline ml-1"}),Bh(n.sensorType)," | ",d1(n.comparisonType)," | ",n.value1,o?` - ${n.value2??"?"}`:""," ",ws(n.sensorType)]})]}),a>1&&h.jsx("button",{type:"button",onClick:()=>l(t),className:"p-1.5 text-red-500 hover:bg-red-100 rounded-md transition-colors",title:"حذف این شرط",children:h.jsx(xh,{className:"w-3.5 h-3.5"})})]}),h.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx("select",{value:n.sensorType,onChange:k=>s(t,{sensorType:Number(k.target.value)}),className:"w-full appearance-none px-3 py-2 pr-8 bg-white border border-orange-200 rounded-lg text-sm font-medium text-gray-700 focus:ring-2 focus:ring-orange-500 focus:border-orange-500 cursor-pointer",style:{backgroundImage:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e")`,backgroundPosition:"left 0.5rem center",backgroundRepeat:"no-repeat",backgroundSize:"1.25rem"},children:ki.map(k=>h.jsxs("option",{value:k.value,children:[k.label," (",k.unit,")"]},k.value))})}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx("select",{value:n.comparisonType,onChange:k=>s(t,{comparisonType:Number(k.target.value)}),className:"w-full appearance-none px-3 py-2 pr-8 bg-white border border-orange-200 rounded-lg text-sm font-medium text-gray-700 focus:ring-2 focus:ring-orange-500 focus:border-orange-500 cursor-pointer",style:{backgroundImage:`url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e")`,backgroundPosition:"left 0.5rem center",backgroundRepeat:"no-repeat",backgroundSize:"1.25rem"},children:ua.map(k=>h.jsx("option",{value:k.value,children:k.label},k.value))})}),h.jsxs("div",{className:"flex gap-1.5 items-center flex-1",children:[h.jsxs("div",{className:"relative flex-1 min-w-0",children:[h.jsx("input",{type:"text",inputMode:"decimal",dir:"ltr",value:M,onChange:k=>{const E=Po(k.target.value);g(E)},onFocus:()=>{v.current=!0},onBlur:()=>{v.current=!1,S(f)},className:"w-full px-3 py-2 pl-10 bg-white border border-orange-200 rounded-lg text-sm font-medium focus:ring-2 focus:ring-orange-500 focus:border-orange-500",placeholder:o?"از":"مقدار",required:!0}),h.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-xs text-gray-400 font-medium",children:ws(n.sensorType)})]}),o&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-gray-400 text-sm flex-shrink-0",children:"-"}),h.jsxs("div",{className:"relative flex-1 min-w-0",children:[h.jsx("input",{type:"text",inputMode:"decimal",dir:"ltr",value:j,onChange:k=>{const E=Po(k.target.value);b(E)},onFocus:()=>{_.current=!0},onBlur:()=>{_.current=!1,N(x)},className:"w-full px-3 py-2 pl-10 bg-white border border-orange-200 rounded-lg text-sm font-medium focus:ring-2 focus:ring-orange-500 focus:border-orange-500",placeholder:"تا",required:!0}),h.jsx("span",{className:"absolute left-2 top-1/2 -translate-y-1/2 text-xs text-gray-400 font-medium",children:ws(n.sensorType)})]})]})]})]})]})}function tE({isOpen:n,editingAlert:t,saving:a,formData:s,onClose:l,onSubmit:o,onFormDataChange:u,onAddRule:d,onRemoveRule:f,onUpdateRule:g}){return h.jsx(vh,{isOpen:n,onClose:l,title:t?"ویرایش هشدار":"افزودن هشدار جدید",size:"xl",contentClassName:"p-0",children:h.jsxs("form",{onSubmit:o,children:[h.jsx(PC,{rules:s.rules,notificationType:s.notificationType,timeType:s.timeType}),h.jsxs("div",{className:"p-4 space-y-4",children:[h.jsx(WC,{value:s.notificationType,onChange:x=>u({...s,notificationType:x})}),h.jsx(JC,{value:s.timeType,onChange:x=>u({...s,timeType:x})}),h.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"text-xs font-medium text-gray-500 block",children:"شرایط هشدار"}),h.jsx("p",{className:"text-[10px] text-gray-400 mt-0.5",children:s.rules.length===0?"هیچ شرطی تعریف نشده است":s.rules.length===1?"یک شرط تعریف شده است":`${s.rules.length} شرط تعریف شده است`})]}),h.jsx(pt,{type:"button",variant:"success",size:"sm",icon:rc,onClick:d,children:"افزودن شرط"})]}),h.jsx("div",{className:"space-y-2",children:s.rules.map((x,b)=>h.jsx(eE,{rule:x,index:b,totalRules:s.rules.length,onUpdate:g,onRemove:f},b))})]}),h.jsx("div",{className:"flex items-center gap-2",children:h.jsx(pN,{id:"isEnabled",checked:s.isEnabled,onChange:x=>u({...s,isEnabled:x.target.checked}),label:"هشدار فعال باشد",className:"text-orange-600 focus:ring-orange-500"})}),h.jsxs("div",{className:"flex items-center justify-end gap-2 pt-3 border-t border-gray-100",children:[h.jsx(pt,{type:"button",variant:"ghost",size:"sm",onClick:l,disabled:a,children:"انصراف"}),h.jsx(pt,{type:"submit",variant:"warning",size:"sm",disabled:a,children:a?"در حال ذخیره...":t?"ذخیره تغییرات":"افزودن هشدار"})]})]})]})})}function nE({deviceId:n}){const[t,a]=w.useState([]),[s,l]=w.useState(!0),[o,u]=w.useState({open:!1,editing:null}),[d,f]=w.useState(!1),[g,x]=w.useState({deviceId:n,notificationType:0,timeType:2,isEnabled:!0,rules:[{sensorType:0,comparisonType:0,value1:30,order:0}]}),b=w.useCallback(async()=>{l(!0);try{a(await We.getAlertConditions(n))}catch(A){console.error("Error loading alerts:",A)}finally{l(!1)}},[n]);w.useEffect(()=>{b()},[b]);const v=()=>{u({open:!0,editing:null}),x({deviceId:n,notificationType:0,timeType:2,isEnabled:!0,rules:[{sensorType:0,comparisonType:0,value1:30,order:0}]})},_=A=>{u({open:!0,editing:A}),x({notificationType:A.notificationType,timeType:A.timeType,isEnabled:A.isEnabled,deviceId:A.deviceId,rules:A.rules.map((z,L)=>({sensorType:z.sensorType,comparisonType:z.comparisonType,value1:z.value1,value2:z.value2,order:L}))})},M=()=>u({open:!1,editing:null}),j=async A=>{if(A.preventDefault(),!g.rules.length){window.alert("لطفاً حداقل یک قانون اضافه کنید");return}f(!0);try{o.editing?await We.updateAlertCondition({id:o.editing.id,...g}):await We.createAlertCondition(g),await b(),M()}catch(z){console.error("Error saving alert:",z),window.alert("خطا در ذخیره هشدار. لطفاً دوباره تلاش کنید.")}finally{f(!1)}},S=async A=>{if(await kN({message:"آیا از حذف این هشدار اطمینان دارید؟"}))try{await We.deleteAlertCondition(A),await b()}catch(z){console.error("Error deleting alert:",z),window.alert("خطا در حذف هشدار.")}},N=async A=>{try{await We.updateAlertCondition({id:A.id,notificationType:A.notificationType,timeType:A.timeType,isEnabled:!A.isEnabled,rules:A.rules.map((z,L)=>({sensorType:z.sensorType,comparisonType:z.comparisonType,value1:z.value1,value2:z.value2,order:L}))}),await b()}catch(z){console.error("Error toggling alert:",z),window.alert("خطا در تغییر وضعیت هشدار.")}},C=()=>x(A=>({...A,rules:[...A.rules,{sensorType:0,comparisonType:0,value1:30,order:A.rules.length}]})),k=A=>x(z=>({...z,rules:z.rules.filter((L,R)=>R!==A).map((L,R)=>({...L,order:R}))})),E=(A,z)=>x(L=>{const R=[...L.rules];return R[A]={...R[A],...z},{...L,rules:R}});return s?h.jsx(ht,{message:"در حال بارگذاری تنظیمات هشدار..."}):h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"bg-white rounded-2xl shadow-md border border-gray-200 overflow-hidden",children:[h.jsxs("div",{className:"p-6 border-b border-gray-200 flex items-center justify-between",children:[h.jsxs("h2",{className:"text-xl font-bold text-gray-900",children:["لیست هشدارها (",t.length,")"]}),h.jsx(pt,{variant:"warning",icon:rc,onClick:v,children:"افزودن هشدار"})]}),t.length===0?h.jsx(or,{icon:Rs,message:"هیچ هشداری ثبت نشده است",action:h.jsx(pt,{variant:"warning",icon:rc,onClick:v,children:"افزودن اولین هشدار"})}):h.jsx("div",{className:"divide-y divide-gray-200",children:t.map(A=>h.jsx(KC,{alert:A,onEdit:_,onDelete:S,onToggleActive:N},A.id))})]}),h.jsx(tE,{isOpen:o.open,editingAlert:!!o.editing,saving:d,formData:g,onClose:M,onSubmit:j,onFormDataChange:x,onAddRule:C,onRemoveRule:k,onUpdateRule:E})]})}const aE=[{key:"settings",label:"تنظیمات",icon:g5},{key:"relays",label:"رله‌ها",icon:mh},{key:"alerts",label:"هشدارها",icon:Bw}];function iE(){const n=rr(),t=Number(n.get("deviceId")??"1"),a=n.get("deviceName")??"دستگاه",[s,l]=w.useState("relays");return h.jsx(Mi,{pageTitle:a,pageIcon:Ly,iconGradient:"from-green-500 to-emerald-600",children:h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsx("div",{className:"sticky top-[57px] z-20 bg-gray-50/95 backdrop-blur rounded-2xl p-1.5 mb-6 flex gap-1 border border-gray-200 shadow-sm",children:aE.map(o=>{const u=o.icon,d=s===o.key;return h.jsxs("button",{type:"button",onClick:()=>l(o.key),className:te("flex-1 inline-flex items-center justify-center gap-2 px-3 py-2.5 rounded-xl text-sm font-medium transition-all",d?"bg-white text-green-700 shadow-sm":"text-gray-500 hover:text-gray-700"),children:[h.jsx(u,{className:te("w-4 h-4",d?"text-green-600":"text-gray-400")}),o.label]},o.key)})}),s==="relays"&&h.jsx(qC,{deviceId:t}),s==="alerts"&&h.jsx(nE,{deviceId:t}),s==="settings"&&h.jsx(XC,{deviceId:t,deviceName:a})]})})}function sE(){return h.jsx(w.Suspense,{fallback:h.jsx(ht,{message:"در حال بارگذاری..."}),children:h.jsx(iE,{})})}function sy(){const n=nn();return h.jsx(My,{to:`/device${n.search}`,replace:!0})}function lE(){return h.jsxs(h.Fragment,{children:[h.jsx(oj,{}),h.jsx(tN,{children:h.jsx(lN,{children:h.jsxs(I_,{children:[h.jsx(Ut,{path:"/",element:h.jsx(rN,{})}),h.jsx(Ut,{path:"/login",element:h.jsx(MN,{})}),h.jsx(Ut,{path:"/verify-code",element:h.jsx(EN,{})}),h.jsx(Ut,{path:"/devices",element:h.jsx(VN,{})}),h.jsx(Ut,{path:"/daily-report",element:h.jsx(_C,{})}),h.jsx(Ut,{path:"/calendar",element:h.jsx(kC,{})}),h.jsx(Ut,{path:"/day-details",element:h.jsx(AC,{})}),h.jsx(Ut,{path:"/weather",element:h.jsx(DC,{})}),h.jsx(Ut,{path:"/profile",element:h.jsx(zC,{})}),h.jsx(Ut,{path:"/device",element:h.jsx(sE,{})}),h.jsx(Ut,{path:"/device-settings",element:h.jsx(sy,{})}),h.jsx(Ut,{path:"/alert-settings",element:h.jsx(sy,{})}),h.jsx(Ut,{path:"*",element:h.jsx(My,{to:"/",replace:!0})})]})})})]})}IS.createRoot(document.getElementById("root")).render(h.jsx(ry.StrictMode,{children:h.jsx(xw,{children:h.jsx(lE,{})})}));export{pt as B,Ls as E,ht as L,Oy as M,uE as P,ys as Q,oc as R,hC as S,dC as T,mC as W,cE as a,uC as b,vs as c,gC as d,ce as e,c1 as f,ly as g,We as h,ty as i,h as j,or as k,w as r,J as t};