var p8=Object.defineProperty;var eO=e=>{throw TypeError(e)};var h8=(e,t,r)=>t in e?p8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var m8=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var uo=(e,t,r)=>h8(e,typeof t!="symbol"?t+"":t,r),gx=(e,t,r)=>t.has(e)||eO("Cannot "+r);var F=(e,t,r)=>(gx(e,t,"read from private field"),r?r.call(e):t.get(e)),De=(e,t,r)=>t.has(e)?eO("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Se=(e,t,r,n)=>(gx(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Ge=(e,t,r)=>(gx(e,t,"access private method"),r);var Ph=(e,t,r,n)=>({set _(i){Se(e,t,i,r)},get _(){return F(e,t,n)}});var yIe=m8((OIe,ih)=>{function v8(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();var Eh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _R={exports:{}},sy={},jR={exports:{}},Ze={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Dp=Symbol.for("react.element"),g8=Symbol.for("react.portal"),y8=Symbol.for("react.fragment"),b8=Symbol.for("react.strict_mode"),x8=Symbol.for("react.profiler"),w8=Symbol.for("react.provider"),S8=Symbol.for("react.context"),P8=Symbol.for("react.forward_ref"),E8=Symbol.for("react.suspense"),C8=Symbol.for("react.memo"),A8=Symbol.for("react.lazy"),tO=Symbol.iterator;function T8(e){return e===null||typeof e!="object"?null:(e=tO&&e[tO]||e["@@iterator"],typeof e=="function"?e:null)}var NR={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},DR=Object.assign,kR={};function xc(e,t,r){this.props=e,this.context=t,this.refs=kR,this.updater=r||NR}xc.prototype.isReactComponent={};xc.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};xc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function MR(){}MR.prototype=xc.prototype;function XP(e,t,r){this.props=e,this.context=t,this.refs=kR,this.updater=r||NR}var ZP=XP.prototype=new MR;ZP.constructor=XP;DR(ZP,xc.prototype);ZP.isPureReactComponent=!0;var rO=Array.isArray,IR=Object.prototype.hasOwnProperty,QP={current:null},RR={key:!0,ref:!0,__self:!0,__source:!0};function $R(e,t,r){var n,i={},o=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)IR.call(t,n)&&!RR.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,z=I[O];if(0>>1;Oi(se,_))dei(X,se)?(I[O]=X,I[de]=_,O=de):(I[O]=se,I[re]=_,O=re);else if(dei(X,_))I[O]=X,I[de]=_,O=de;else break e}}return $}function i(I,$){var _=I.sortIndex-$.sortIndex;return _!==0?_:I.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,p=!1,m=!1,v=!1,g=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(I){for(var $=r(u);$!==null;){if($.callback===null)n(u);else if($.startTime<=I)n(u),$.sortIndex=$.expirationTime,t(l,$);else break;$=r(u)}}function P(I){if(v=!1,x(I),!m)if(r(l)!==null)m=!0,B(S);else{var $=r(u);$!==null&&U(P,$.startTime-I)}}function S(I,$){m=!1,v&&(v=!1,b(A),A=-1),p=!0;var _=f;try{for(x($),d=r(l);d!==null&&(!(d.expirationTime>$)||I&&!N());){var O=d.callback;if(typeof O=="function"){d.callback=null,f=d.priorityLevel;var z=O(d.expirationTime<=$);$=e.unstable_now(),typeof z=="function"?d.callback=z:d===r(l)&&n(l),x($)}else n(l);d=r(l)}if(d!==null)var Y=!0;else{var re=r(u);re!==null&&U(P,re.startTime-$),Y=!1}return Y}finally{d=null,f=_,p=!1}}var E=!1,C=null,A=-1,T=5,D=-1;function N(){return!(e.unstable_now()-DI||125O?(I.sortIndex=_,t(u,I),r(l)===null&&I===r(u)&&(v?(b(A),A=-1):v=!0,U(P,_-O))):(I.sortIndex=z,t(l,I),m||p||(m=!0,B(S))),I},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(I){var $=f;return function(){var _=f;f=$;try{return I.apply(this,arguments)}finally{f=_}}}})(zR);UR.exports=zR;var L8=UR.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var F8=w,jn=L8;function ie(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vw=Object.prototype.hasOwnProperty,B8=/^[: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]*$/,iO={},oO={};function V8(e){return vw.call(oO,e)?!0:vw.call(iO,e)?!1:B8.test(e)?oO[e]=!0:(iO[e]=!0,!1)}function U8(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function z8(e,t,r,n){if(t===null||typeof t>"u"||U8(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function zr(e,t,r,n,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var xr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){xr[e]=new zr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];xr[t]=new zr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){xr[e]=new zr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){xr[e]=new zr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){xr[e]=new zr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){xr[e]=new zr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){xr[e]=new zr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){xr[e]=new zr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){xr[e]=new zr(e,5,!1,e.toLowerCase(),null,!1,!1)});var eE=/[\-:]([a-z])/g;function tE(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(eE,tE);xr[t]=new zr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(eE,tE);xr[t]=new zr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(eE,tE);xr[t]=new zr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){xr[e]=new zr(e,1,!1,e.toLowerCase(),null,!1,!1)});xr.xlinkHref=new zr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){xr[e]=new zr(e,1,!1,e.toLowerCase(),null,!0,!0)});function rE(e,t,r,n){var i=xr.hasOwnProperty(t)?xr[t]:null;(i!==null?i.type!==0:n||!(2s||i[a]!==o[s]){var l=` `+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{xx=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Cd(e):""}function W8(e){switch(e.tag){case 5:return Cd(e.type);case 16:return Cd("Lazy");case 13:return Cd("Suspense");case 19:return Cd("SuspenseList");case 0:case 2:case 15:return e=wx(e.type,!1),e;case 11:return e=wx(e.type.render,!1),e;case 1:return e=wx(e.type,!0),e;default:return""}}function xw(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Il:return"Fragment";case Ml:return"Portal";case gw:return"Profiler";case nE:return"StrictMode";case yw:return"Suspense";case bw:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case GR:return(e.displayName||"Context")+".Consumer";case HR:return(e._context.displayName||"Context")+".Provider";case iE:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case oE:return t=e.displayName||null,t!==null?t:xw(e.type)||"Memo";case ca:t=e._payload,e=e._init;try{return xw(e(t))}catch{}}return null}function H8(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xw(t);case 8:return t===nE?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Va(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qR(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function G8(e){var t=qR(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){n=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Th(e){e._valueTracker||(e._valueTracker=G8(e))}function YR(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=qR(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Hm(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ww(e,t){var r=t.checked;return Rt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function sO(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Va(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function XR(e,t){t=t.checked,t!=null&&rE(e,"checked",t,!1)}function Sw(e,t){XR(e,t);var r=Va(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Pw(e,t.type,r):t.hasOwnProperty("defaultValue")&&Pw(e,t.type,Va(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function lO(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Pw(e,t,r){(t!=="number"||Hm(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ad=Array.isArray;function eu(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Oh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function df(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Fd={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},K8=["Webkit","ms","Moz","O"];Object.keys(Fd).forEach(function(e){K8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fd[t]=Fd[e]})});function e2(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Fd.hasOwnProperty(e)&&Fd[e]?(""+t).trim():t+"px"}function t2(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=e2(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var q8=Rt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Aw(e,t){if(t){if(q8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ie(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ie(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ie(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ie(62))}}function Tw(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ow=null;function aE(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _w=null,tu=null,ru=null;function dO(e){if(e=Ip(e)){if(typeof _w!="function")throw Error(ie(280));var t=e.stateNode;t&&(t=fy(t),_w(e.stateNode,e.type,t))}}function r2(e){tu?ru?ru.push(e):ru=[e]:tu=e}function n2(){if(tu){var e=tu,t=ru;if(ru=tu=null,dO(e),t)for(e=0;e>>=0,e===0?32:31-(oH(e)/aH|0)|0}var _h=64,jh=4194304;function Td(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ym(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,o=e.pingedLanes,a=r&268435455;if(a!==0){var s=a&~i;s!==0?n=Td(s):(o&=a,o!==0&&(n=Td(o)))}else a=r&~i,a!==0?n=Td(a):o!==0&&(n=Td(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function kp(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ti(t),e[t]=r}function cH(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=Vd),xO=" ",wO=!1;function P2(e,t){switch(e){case"keyup":return LH.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function E2(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rl=!1;function BH(e,t){switch(e){case"compositionend":return E2(t);case"keypress":return t.which!==32?null:(wO=!0,xO);case"textInput":return e=t.data,e===xO&&wO?null:e;default:return null}}function VH(e,t){if(Rl)return e==="compositionend"||!hE&&P2(e,t)?(e=w2(),Pm=dE=Ca=null,Rl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=CO(r)}}function O2(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?O2(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _2(){for(var e=window,t=Hm();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Hm(e.document)}return t}function mE(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function XH(e){var t=_2(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&O2(r.ownerDocument.documentElement,r)){if(n!==null&&mE(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,o=Math.min(n.start,i);n=n.end===void 0?o:Math.min(n.end,i),!e.extend&&o>n&&(i=n,n=o,o=i),i=AO(r,o);var a=AO(r,n);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,$l=null,Iw=null,zd=null,Rw=!1;function TO(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Rw||$l==null||$l!==Hm(n)||(n=$l,"selectionStart"in n&&mE(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),zd&&gf(zd,n)||(zd=n,n=Qm(Iw,"onSelect"),0Bl||(e.current=Uw[Bl],Uw[Bl]=null,Bl--)}function St(e,t){Bl++,Uw[Bl]=e.current,e.current=t}var Ua={},_r=Ja(Ua),on=Ja(!1),Xs=Ua;function Mu(e,t){var r=e.type.contextTypes;if(!r)return Ua;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in r)i[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function an(e){return e=e.childContextTypes,e!=null}function ev(){Ot(on),Ot(_r)}function MO(e,t,r){if(_r.current!==Ua)throw Error(ie(168));St(_r,t),St(on,r)}function L2(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(ie(108,H8(e)||"Unknown",i));return Rt({},r,n)}function tv(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ua,Xs=_r.current,St(_r,e),St(on,on.current),!0}function IO(e,t,r){var n=e.stateNode;if(!n)throw Error(ie(169));r?(e=L2(e,t,Xs),n.__reactInternalMemoizedMergedChildContext=e,Ot(on),Ot(_r),St(_r,e)):Ot(on),St(on,r)}var go=null,py=!1,Ix=!1;function F2(e){go===null?go=[e]:go.push(e)}function lG(e){py=!0,F2(e)}function es(){if(!Ix&&go!==null){Ix=!0;var e=0,t=ft;try{var r=go;for(ft=1;e>=a,i-=a,bo=1<<32-Ti(t)+i|r<A?(T=C,C=null):T=C.sibling;var D=f(b,C,x[A],P);if(D===null){C===null&&(C=T);break}e&&C&&D.alternate===null&&t(b,C),y=o(D,y,A),E===null?S=D:E.sibling=D,E=D,C=T}if(A===x.length)return r(b,C),jt&&vs(b,A),S;if(C===null){for(;AA?(T=C,C=null):T=C.sibling;var N=f(b,C,D.value,P);if(N===null){C===null&&(C=T);break}e&&C&&N.alternate===null&&t(b,C),y=o(N,y,A),E===null?S=N:E.sibling=N,E=N,C=T}if(D.done)return r(b,C),jt&&vs(b,A),S;if(C===null){for(;!D.done;A++,D=x.next())D=d(b,D.value,P),D!==null&&(y=o(D,y,A),E===null?S=D:E.sibling=D,E=D);return jt&&vs(b,A),S}for(C=n(b,C);!D.done;A++,D=x.next())D=p(C,b,A,D.value,P),D!==null&&(e&&D.alternate!==null&&C.delete(D.key===null?A:D.key),y=o(D,y,A),E===null?S=D:E.sibling=D,E=D);return e&&C.forEach(function(j){return t(b,j)}),jt&&vs(b,A),S}function g(b,y,x,P){if(typeof x=="object"&&x!==null&&x.type===Il&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ah:e:{for(var S=x.key,E=y;E!==null;){if(E.key===S){if(S=x.type,S===Il){if(E.tag===7){r(b,E.sibling),y=i(E,x.props.children),y.return=b,b=y;break e}}else if(E.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ca&&LO(S)===E.type){r(b,E.sibling),y=i(E,x.props),y.ref=rd(b,E,x),y.return=b,b=y;break e}r(b,E);break}else t(b,E);E=E.sibling}x.type===Il?(y=Hs(x.props.children,b.mode,P,x.key),y.return=b,b=y):(P=Nm(x.type,x.key,x.props,null,b.mode,P),P.ref=rd(b,y,x),P.return=b,b=P)}return a(b);case Ml:e:{for(E=x.key;y!==null;){if(y.key===E)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){r(b,y.sibling),y=i(y,x.children||[]),y.return=b,b=y;break e}else{r(b,y);break}else t(b,y);y=y.sibling}y=zx(x,b.mode,P),y.return=b,b=y}return a(b);case ca:return E=x._init,g(b,y,E(x._payload),P)}if(Ad(x))return m(b,y,x,P);if(Zc(x))return v(b,y,x,P);$h(b,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(r(b,y.sibling),y=i(y,x),y.return=b,b=y):(r(b,y),y=Ux(x,b.mode,P),y.return=b,b=y),a(b)):r(b,y)}return g}var Ru=z2(!0),W2=z2(!1),iv=Ja(null),ov=null,zl=null,bE=null;function xE(){bE=zl=ov=null}function wE(e){var t=iv.current;Ot(iv),e._currentValue=t}function Hw(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function iu(e,t){ov=e,bE=zl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qr=!0),e.firstContext=null)}function ni(e){var t=e._currentValue;if(bE!==e)if(e={context:e,memoizedValue:t,next:null},zl===null){if(ov===null)throw Error(ie(308));zl=e,ov.dependencies={lanes:0,firstContext:e}}else zl=zl.next=e;return t}var As=null;function SE(e){As===null?As=[e]:As.push(e)}function H2(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,SE(t)):(r.next=i.next,i.next=r),t.interleaved=r,Ro(e,n)}function Ro(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var da=!1;function PE(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function G2(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Co(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Da(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,it&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Ro(e,r)}return i=n.interleaved,i===null?(t.next=t,SE(n)):(t.next=i.next,i.next=t),n.interleaved=t,Ro(e,r)}function Cm(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,lE(e,r)}}function FO(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?i=o=a:o=o.next=a,r=r.next}while(r!==null);o===null?i=o=t:o=o.next=t}else i=o=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function av(e,t,r,n){var i=e.updateQueue;da=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,a===null?o=u:a.next=u,a=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;a=0,c=u=l=null,s=o;do{var f=s.lane,p=s.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var m=e,v=s;switch(f=t,p=r,v.tag){case 1:if(m=v.payload,typeof m=="function"){d=m.call(p,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,f=typeof m=="function"?m.call(p,d,f):m,f==null)break e;d=Rt({},d,f);break e;case 2:da=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,a|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Js|=a,e.lanes=a,e.memoizedState=d}}function BO(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=$x.transition;$x.transition={};try{e(!1),t()}finally{ft=r,$x.transition=n}}function u$(){return ii().memoizedState}function fG(e,t,r){var n=Ma(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},c$(e))d$(t,r);else if(r=H2(e,t,r,n),r!==null){var i=Br();Oi(r,e,n,i),f$(r,t,n)}}function pG(e,t,r){var n=Ma(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(c$(e))d$(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,r);if(i.hasEagerState=!0,i.eagerState=s,ji(s,a)){var l=t.interleaved;l===null?(i.next=i,SE(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=H2(e,t,i,n),r!==null&&(i=Br(),Oi(r,e,n,i),f$(r,t,n))}}function c$(e){var t=e.alternate;return e===It||t!==null&&t===It}function d$(e,t){Wd=lv=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function f$(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,lE(e,r)}}var uv={readContext:ni,useCallback:wr,useContext:wr,useEffect:wr,useImperativeHandle:wr,useInsertionEffect:wr,useLayoutEffect:wr,useMemo:wr,useReducer:wr,useRef:wr,useState:wr,useDebugValue:wr,useDeferredValue:wr,useTransition:wr,useMutableSource:wr,useSyncExternalStore:wr,useId:wr,unstable_isNewReconciler:!1},hG={readContext:ni,useCallback:function(e,t){return Li().memoizedState=[e,t===void 0?null:t],e},useContext:ni,useEffect:UO,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Tm(4194308,4,i$.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Tm(4194308,4,e,t)},useInsertionEffect:function(e,t){return Tm(4,2,e,t)},useMemo:function(e,t){var r=Li();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Li();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=fG.bind(null,It,e),[n.memoizedState,e]},useRef:function(e){var t=Li();return e={current:e},t.memoizedState=e},useState:VO,useDebugValue:NE,useDeferredValue:function(e){return Li().memoizedState=e},useTransition:function(){var e=VO(!1),t=e[0];return e=dG.bind(null,e[1]),Li().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=It,i=Li();if(jt){if(r===void 0)throw Error(ie(407));r=r()}else{if(r=t(),sr===null)throw Error(ie(349));Qs&30||X2(n,t,r)}i.memoizedState=r;var o={value:r,getSnapshot:t};return i.queue=o,UO(Q2.bind(null,n,o,e),[e]),n.flags|=2048,Cf(9,Z2.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=Li(),t=sr.identifierPrefix;if(jt){var r=xo,n=bo;r=(n&~(1<<32-Ti(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Pf++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[Wi]=t,e[xf]=n,S$(e,t,!1,!1),t.stateNode=e;e:{switch(a=Tw(r,n),r){case"dialog":Ct("cancel",e),Ct("close",e),i=n;break;case"iframe":case"object":case"embed":Ct("load",e),i=n;break;case"video":case"audio":for(i=0;iFu&&(t.flags|=128,n=!0,nd(o,!1),t.lanes=4194304)}else{if(!n)if(e=sv(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),nd(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!jt)return Sr(t),null}else 2*Ht()-o.renderingStartTime>Fu&&r!==1073741824&&(t.flags|=128,n=!0,nd(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(r=o.last,r!==null?r.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ht(),t.sibling=null,r=kt.current,St(kt,n?r&1|2:r&1),t):(Sr(t),null);case 22:case 23:return $E(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?mn&1073741824&&(Sr(t),t.subtreeFlags&6&&(t.flags|=8192)):Sr(t),null;case 24:return null;case 25:return null}throw Error(ie(156,t.tag))}function SG(e,t){switch(gE(t),t.tag){case 1:return an(t.type)&&ev(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $u(),Ot(on),Ot(_r),AE(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return CE(t),null;case 13:if(Ot(kt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ie(340));Iu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ot(kt),null;case 4:return $u(),null;case 10:return wE(t.type._context),null;case 22:case 23:return $E(),null;case 24:return null;default:return null}}var Fh=!1,Ar=!1,PG=typeof WeakSet=="function"?WeakSet:Set,Ae=null;function Wl(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Vt(e,t,n)}else r.current=null}function eS(e,t,r){try{r()}catch(n){Vt(e,t,n)}}var JO=!1;function EG(e,t){if($w=Xm,e=_2(),mE(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var a=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==r||i!==0&&d.nodeType!==3||(s=a+i),d!==o||n!==0&&d.nodeType!==3||(l=a+n),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++u===i&&(s=a),f===o&&++c===n&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Lw={focusedElem:e,selectionRange:r},Xm=!1,Ae=t;Ae!==null;)if(t=Ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ae=e;else for(;Ae!==null;){t=Ae;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,g=m.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?v:pi(t.type,v),g);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(P){Vt(t,t.return,P)}if(e=t.sibling,e!==null){e.return=t.return,Ae=e;break}Ae=t.return}return m=JO,JO=!1,m}function Hd(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&eS(t,r,o)}i=i.next}while(i!==n)}}function vy(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function tS(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function C$(e){var t=e.alternate;t!==null&&(e.alternate=null,C$(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wi],delete t[xf],delete t[Vw],delete t[aG],delete t[sG])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function A$(e){return e.tag===5||e.tag===3||e.tag===4}function e_(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||A$(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rS(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Jm));else if(n!==4&&(e=e.child,e!==null))for(rS(e,t,r),e=e.sibling;e!==null;)rS(e,t,r),e=e.sibling}function nS(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(nS(e,t,r),e=e.sibling;e!==null;)nS(e,t,r),e=e.sibling}var hr=null,mi=!1;function ia(e,t,r){for(r=r.child;r!==null;)T$(e,t,r),r=r.sibling}function T$(e,t,r){if(qi&&typeof qi.onCommitFiberUnmount=="function")try{qi.onCommitFiberUnmount(ly,r)}catch{}switch(r.tag){case 5:Ar||Wl(r,t);case 6:var n=hr,i=mi;hr=null,ia(e,t,r),hr=n,mi=i,hr!==null&&(mi?(e=hr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):hr.removeChild(r.stateNode));break;case 18:hr!==null&&(mi?(e=hr,r=r.stateNode,e.nodeType===8?Mx(e.parentNode,r):e.nodeType===1&&Mx(e,r),mf(e)):Mx(hr,r.stateNode));break;case 4:n=hr,i=mi,hr=r.stateNode.containerInfo,mi=!0,ia(e,t,r),hr=n,mi=i;break;case 0:case 11:case 14:case 15:if(!Ar&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&eS(r,t,a),i=i.next}while(i!==n)}ia(e,t,r);break;case 1:if(!Ar&&(Wl(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Vt(r,t,s)}ia(e,t,r);break;case 21:ia(e,t,r);break;case 22:r.mode&1?(Ar=(n=Ar)||r.memoizedState!==null,ia(e,t,r),Ar=n):ia(e,t,r);break;default:ia(e,t,r)}}function t_(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new PG),t.forEach(function(n){var i=kG.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ui(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=a),n&=~o}if(n=i,n=Ht()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*AG(n/1960))-n,10e?16:e,Aa===null)var n=!1;else{if(e=Aa,Aa=null,fv=0,it&6)throw Error(ie(331));var i=it;for(it|=4,Ae=e.current;Ae!==null;){var o=Ae,a=o.child;if(Ae.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lHt()-IE?Ws(e,0):ME|=r),sn(e,t)}function I$(e,t){t===0&&(e.mode&1?(t=jh,jh<<=1,!(jh&130023424)&&(jh=4194304)):t=1);var r=Br();e=Ro(e,t),e!==null&&(kp(e,t,r),sn(e,r))}function DG(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),I$(e,r)}function kG(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ie(314))}n!==null&&n.delete(t),I$(e,r)}var R$;R$=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||on.current)Qr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Qr=!1,xG(e,t,r);Qr=!!(e.flags&131072)}else Qr=!1,jt&&t.flags&1048576&&B2(t,nv,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Om(e,t),e=t.pendingProps;var i=Mu(t,_r.current);iu(t,r),i=OE(null,t,n,e,i,r);var o=_E();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,an(n)?(o=!0,tv(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,PE(t),i.updater=my,t.stateNode=i,i._reactInternals=t,Kw(t,n,e,r),t=Xw(null,t,n,!0,o,r)):(t.tag=0,jt&&o&&vE(t),Rr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Om(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=IG(n),e=pi(n,e),i){case 0:t=Yw(null,t,n,e,r);break e;case 1:t=XO(null,t,n,e,r);break e;case 11:t=qO(null,t,n,e,r);break e;case 14:t=YO(null,t,n,pi(n.type,e),r);break e}throw Error(ie(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:pi(n,i),Yw(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:pi(n,i),XO(e,t,n,i,r);case 3:e:{if(b$(t),e===null)throw Error(ie(387));n=t.pendingProps,o=t.memoizedState,i=o.element,G2(e,t),av(t,n,null,r);var a=t.memoizedState;if(n=a.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Lu(Error(ie(423)),t),t=ZO(e,t,n,r,i);break e}else if(n!==i){i=Lu(Error(ie(424)),t),t=ZO(e,t,n,r,i);break e}else for(bn=Na(t.stateNode.containerInfo.firstChild),Pn=t,jt=!0,yi=null,r=W2(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Iu(),n===i){t=$o(e,t,r);break e}Rr(e,t,n,r)}t=t.child}return t;case 5:return K2(t),e===null&&Ww(t),n=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,Fw(n,i)?a=null:o!==null&&Fw(n,o)&&(t.flags|=32),y$(e,t),Rr(e,t,a,r),t.child;case 6:return e===null&&Ww(t),null;case 13:return x$(e,t,r);case 4:return EE(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ru(t,null,n,r):Rr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:pi(n,i),qO(e,t,n,i,r);case 7:return Rr(e,t,t.pendingProps,r),t.child;case 8:return Rr(e,t,t.pendingProps.children,r),t.child;case 12:return Rr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,St(iv,n._currentValue),n._currentValue=a,o!==null)if(ji(o.value,a)){if(o.children===i.children&&!on.current){t=$o(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(o.tag===1){l=Co(-1,r&-r),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Hw(o.return,r,t),s.lanes|=r;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(ie(341));a.lanes|=r,s=a.alternate,s!==null&&(s.lanes|=r),Hw(a,r,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}Rr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,iu(t,r),i=ni(i),n=n(i),t.flags|=1,Rr(e,t,n,r),t.child;case 14:return n=t.type,i=pi(n,t.pendingProps),i=pi(n.type,i),YO(e,t,n,i,r);case 15:return v$(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:pi(n,i),Om(e,t),t.tag=1,an(n)?(e=!0,tv(t)):e=!1,iu(t,r),p$(t,n,i),Kw(t,n,i,r),Xw(null,t,n,!0,e,r);case 19:return w$(e,t,r);case 22:return g$(e,t,r)}throw Error(ie(156,t.tag))};function $$(e,t){return c2(e,t)}function MG(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(e,t,r,n){return new MG(e,t,r,n)}function FE(e){return e=e.prototype,!(!e||!e.isReactComponent)}function IG(e){if(typeof e=="function")return FE(e)?1:0;if(e!=null){if(e=e.$$typeof,e===iE)return 11;if(e===oE)return 14}return 2}function Ia(e,t){var r=e.alternate;return r===null?(r=qn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Nm(e,t,r,n,i,o){var a=2;if(n=e,typeof e=="function")FE(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Il:return Hs(r.children,i,o,t);case nE:a=8,i|=8;break;case gw:return e=qn(12,r,t,i|2),e.elementType=gw,e.lanes=o,e;case yw:return e=qn(13,r,t,i),e.elementType=yw,e.lanes=o,e;case bw:return e=qn(19,r,t,i),e.elementType=bw,e.lanes=o,e;case KR:return yy(r,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case HR:a=10;break e;case GR:a=9;break e;case iE:a=11;break e;case oE:a=14;break e;case ca:a=16,n=null;break e}throw Error(ie(130,e==null?e:typeof e,""))}return t=qn(a,r,t,i),t.elementType=e,t.type=n,t.lanes=o,t}function Hs(e,t,r,n){return e=qn(7,e,n,t),e.lanes=r,e}function yy(e,t,r,n){return e=qn(22,e,n,t),e.elementType=KR,e.lanes=r,e.stateNode={isHidden:!1},e}function Ux(e,t,r){return e=qn(6,e,null,t),e.lanes=r,e}function zx(e,t,r){return t=qn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function RG(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Px(0),this.expirationTimes=Px(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Px(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function BE(e,t,r,n,i,o,a,s,l){return e=new RG(e,t,r,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=qn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},PE(o),e}function $G(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(V$)}catch(e){console.error(e)}}V$(),VR.exports=kn;var ts=VR.exports;const U$=lt(ts);var z$,u_=ts;z$=u_.createRoot,u_.hydrateRoot;var Pc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},tl=typeof window>"u"||"Deno"in globalThis;function Wn(){}function UG(e,t){return typeof e=="function"?e(t):e}function lS(e){return typeof e=="number"&&e>=0&&e!==1/0}function W$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function au(e,t){return typeof e=="function"?e(t):e}function bi(e,t){return typeof e=="function"?e(t):e}function c_(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(n){if(t.queryHash!==WE(a,t.options))return!1}else if(!Tf(t.queryKey,a))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||o&&!o(t))}function d_(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(rl(t.options.mutationKey)!==rl(o))return!1}else if(!Tf(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function WE(e,t){return((t==null?void 0:t.queryKeyHashFn)||rl)(e)}function rl(e){return JSON.stringify(e,(t,r)=>uS(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Tf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!Tf(e[r],t[r])):!1}function H$(e,t){if(e===t)return e;const r=f_(e)&&f_(t);if(r||uS(e)&&uS(t)){const n=r?e:Object.keys(e),i=n.length,o=r?t:Object.keys(t),a=o.length,s=r?[]:{};let l=0;for(let u=0;u{setTimeout(t,e)})}function cS(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?H$(e,t):t}function WG(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function HG(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var HE=Symbol();function G$(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===HE?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Rs,va,xu,bR,GG=(bR=class extends Pc{constructor(){super();De(this,Rs);De(this,va);De(this,xu);Se(this,xu,t=>{if(!tl&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){F(this,va)||this.setEventListener(F(this,xu))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,va))==null||t.call(this),Se(this,va,void 0))}setEventListener(t){var r;Se(this,xu,t),(r=F(this,va))==null||r.call(this),Se(this,va,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){F(this,Rs)!==t&&(Se(this,Rs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof F(this,Rs)=="boolean"?F(this,Rs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Rs=new WeakMap,va=new WeakMap,xu=new WeakMap,bR),GE=new GG,wu,ga,Su,xR,KG=(xR=class extends Pc{constructor(){super();De(this,wu,!0);De(this,ga);De(this,Su);Se(this,Su,t=>{if(!tl&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){F(this,ga)||this.setEventListener(F(this,Su))}onUnsubscribe(){var t;this.hasListeners()||((t=F(this,ga))==null||t.call(this),Se(this,ga,void 0))}setEventListener(t){var r;Se(this,Su,t),(r=F(this,ga))==null||r.call(this),Se(this,ga,t(this.setOnline.bind(this)))}setOnline(t){F(this,wu)!==t&&(Se(this,wu,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return F(this,wu)}},wu=new WeakMap,ga=new WeakMap,Su=new WeakMap,xR),vv=new KG;function dS(){let e,t;const r=new Promise((i,o)=>{e=i,t=o});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}function qG(e){return Math.min(1e3*2**e,3e4)}function K$(e){return(e??"online")==="online"?vv.isOnline():!0}var q$=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Wx(e){return e instanceof q$}function Y$(e){let t=!1,r=0,n=!1,i;const o=dS(),a=v=>{var g;n||(f(new q$(v)),(g=e.abort)==null||g.call(e))},s=()=>{t=!0},l=()=>{t=!1},u=()=>GE.isFocused()&&(e.networkMode==="always"||vv.isOnline())&&e.canRun(),c=()=>K$(e.networkMode)&&e.canRun(),d=v=>{var g;n||(n=!0,(g=e.onSuccess)==null||g.call(e,v),i==null||i(),o.resolve(v))},f=v=>{var g;n||(n=!0,(g=e.onError)==null||g.call(e,v),i==null||i(),o.reject(v))},p=()=>new Promise(v=>{var g;i=b=>{(n||u())&&v(b)},(g=e.onPause)==null||g.call(e)}).then(()=>{var v;i=void 0,n||(v=e.onContinue)==null||v.call(e)}),m=()=>{if(n)return;let v;const g=r===0?e.initialPromise:void 0;try{v=g??e.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(d).catch(b=>{var E;if(n)return;const y=e.retry??(tl?0:3),x=e.retryDelay??qG,P=typeof x=="function"?x(r,b):x,S=y===!0||typeof y=="number"&&ru()?void 0:p()).then(()=>{t?f(b):m()})})};return{promise:o,cancel:a,continue:()=>(i==null||i(),o),cancelRetry:s,continueRetry:l,canStart:c,start:()=>(c()?m():p().then(m),o)}}function YG(){let e=[],t=0,r=s=>{s()},n=s=>{s()},i=s=>setTimeout(s,0);const o=s=>{t?e.push(s):i(()=>{r(s)})},a=()=>{const s=e;e=[],s.length&&i(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||a()}return l},batchCalls:s=>(...l)=>{o(()=>{s(...l)})},schedule:o,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{i=s}}}var er=YG(),$s,wR,X$=(wR=class{constructor(){De(this,$s)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),lS(this.gcTime)&&Se(this,$s,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(tl?1/0:5*60*1e3))}clearGcTimeout(){F(this,$s)&&(clearTimeout(F(this,$s)),Se(this,$s,void 0))}},$s=new WeakMap,wR),Pu,Eu,zn,Pr,Op,Ls,hi,ho,SR,XG=(SR=class extends X${constructor(t){super();De(this,hi);De(this,Pu);De(this,Eu);De(this,zn);De(this,Pr);De(this,Op);De(this,Ls);Se(this,Ls,!1),Se(this,Op,t.defaultOptions),this.setOptions(t.options),this.observers=[],Se(this,zn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Se(this,Pu,ZG(this.options)),this.state=t.state??F(this,Pu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=F(this,Pr))==null?void 0:t.promise}setOptions(t){this.options={...F(this,Op),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,zn).remove(this)}setData(t,r){const n=cS(this.state.data,t,this.options);return Ge(this,hi,ho).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Ge(this,hi,ho).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=F(this,Pr))==null?void 0:n.promise;return(i=F(this,Pr))==null||i.cancel(t),r?r.then(Wn).catch(Wn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(F(this,Pu))}isActive(){return this.observers.some(t=>bi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===HE||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!W$(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,Pr))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=F(this,Pr))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),F(this,zn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(F(this,Pr)&&(F(this,Ls)?F(this,Pr).cancel({revert:!0}):F(this,Pr).cancelRetry()),this.scheduleGc()),F(this,zn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ge(this,hi,ho).call(this,{type:"invalidate"})}fetch(t,r){var l,u,c;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(F(this,Pr))return F(this,Pr).continueRetry(),F(this,Pr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const n=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(Se(this,Ls,!0),n.signal)})},o=()=>{const d=G$(this.options,r),f={queryKey:this.queryKey,meta:this.meta};return i(f),Se(this,Ls,!1),this.options.persister?this.options.persister(d,f,this):d(f)},a={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(a),(l=this.options.behavior)==null||l.onFetch(a,this),Se(this,Eu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Ge(this,hi,ho).call(this,{type:"fetch",meta:(c=a.fetchOptions)==null?void 0:c.meta});const s=d=>{var f,p,m,v;Wx(d)&&d.silent||Ge(this,hi,ho).call(this,{type:"error",error:d}),Wx(d)||((p=(f=F(this,zn).config).onError)==null||p.call(f,d,this),(v=(m=F(this,zn).config).onSettled)==null||v.call(m,this.state.data,d,this)),this.scheduleGc()};return Se(this,Pr,Y$({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:d=>{var f,p,m,v;if(d===void 0){s(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(g){s(g);return}(p=(f=F(this,zn).config).onSuccess)==null||p.call(f,d,this),(v=(m=F(this,zn).config).onSettled)==null||v.call(m,d,this.state.error,this),this.scheduleGc()},onError:s,onFail:(d,f)=>{Ge(this,hi,ho).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{Ge(this,hi,ho).call(this,{type:"pause"})},onContinue:()=>{Ge(this,hi,ho).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),F(this,Pr).start()}},Pu=new WeakMap,Eu=new WeakMap,zn=new WeakMap,Pr=new WeakMap,Op=new WeakMap,Ls=new WeakMap,hi=new WeakSet,ho=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Z$(n.data,this.options),fetchMeta:t.meta??null};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Wx(i)&&i.revert&&F(this,Eu)?{...F(this,Eu),fetchStatus:"idle"}:{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),er.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),F(this,zn).notify({query:this,type:"updated",action:t})})},SR);function Z$(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:K$(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ZG(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Bi,PR,QG=(PR=class extends Pc{constructor(t={}){super();De(this,Bi);this.config=t,Se(this,Bi,new Map)}build(t,r,n){const i=r.queryKey,o=r.queryHash??WE(i,r);let a=this.get(o);return a||(a=new XG({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){F(this,Bi).has(t.queryHash)||(F(this,Bi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=F(this,Bi).get(t.queryHash);r&&(t.destroy(),r===t&&F(this,Bi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){er.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return F(this,Bi).get(t)}getAll(){return[...F(this,Bi).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>c_(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>c_(t,n)):r}notify(t){er.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){er.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){er.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Bi=new WeakMap,PR),Vi,Mr,Fs,Ui,sa,ER,JG=(ER=class extends X${constructor(t){super();De(this,Ui);De(this,Vi);De(this,Mr);De(this,Fs);this.mutationId=t.mutationId,Se(this,Mr,t.mutationCache),Se(this,Vi,[]),this.state=t.state||Q$(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){F(this,Vi).includes(t)||(F(this,Vi).push(t),this.clearGcTimeout(),F(this,Mr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Se(this,Vi,F(this,Vi).filter(r=>r!==t)),this.scheduleGc(),F(this,Mr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){F(this,Vi).length||(this.state.status==="pending"?this.scheduleGc():F(this,Mr).remove(this))}continue(){var t;return((t=F(this,Fs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,a,s,l,u,c,d,f,p,m,v,g,b,y,x,P,S,E,C;Se(this,Fs,Y$({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,T)=>{Ge(this,Ui,sa).call(this,{type:"failed",failureCount:A,error:T})},onPause:()=>{Ge(this,Ui,sa).call(this,{type:"pause"})},onContinue:()=>{Ge(this,Ui,sa).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,Mr).canRun(this)}));const r=this.state.status==="pending",n=!F(this,Fs).canStart();try{if(!r){Ge(this,Ui,sa).call(this,{type:"pending",variables:t,isPaused:n}),await((o=(i=F(this,Mr).config).onMutate)==null?void 0:o.call(i,t,this));const T=await((s=(a=this.options).onMutate)==null?void 0:s.call(a,t));T!==this.state.context&&Ge(this,Ui,sa).call(this,{type:"pending",context:T,variables:t,isPaused:n})}const A=await F(this,Fs).start();return await((u=(l=F(this,Mr).config).onSuccess)==null?void 0:u.call(l,A,t,this.state.context,this)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,A,t,this.state.context)),await((p=(f=F(this,Mr).config).onSettled)==null?void 0:p.call(f,A,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,A,null,t,this.state.context)),Ge(this,Ui,sa).call(this,{type:"success",data:A}),A}catch(A){try{throw await((b=(g=F(this,Mr).config).onError)==null?void 0:b.call(g,A,t,this.state.context,this)),await((x=(y=this.options).onError)==null?void 0:x.call(y,A,t,this.state.context)),await((S=(P=F(this,Mr).config).onSettled)==null?void 0:S.call(P,void 0,A,this.state.variables,this.state.context,this)),await((C=(E=this.options).onSettled)==null?void 0:C.call(E,void 0,A,t,this.state.context)),A}finally{Ge(this,Ui,sa).call(this,{type:"error",error:A})}}finally{F(this,Mr).runNext(this)}}},Vi=new WeakMap,Mr=new WeakMap,Fs=new WeakMap,Ui=new WeakSet,sa=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),er.batch(()=>{F(this,Vi).forEach(n=>{n.onMutationUpdate(t)}),F(this,Mr).notify({mutation:this,type:"updated",action:t})})},ER);function Q$(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var hn,_p,CR,e9=(CR=class extends Pc{constructor(t={}){super();De(this,hn);De(this,_p);this.config=t,Se(this,hn,new Map),Se(this,_p,Date.now())}build(t,r,n){const i=new JG({mutationCache:this,mutationId:++Ph(this,_p)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){const r=Uh(t),n=F(this,hn).get(r)??[];n.push(t),F(this,hn).set(r,n),this.notify({type:"added",mutation:t})}remove(t){var n;const r=Uh(t);if(F(this,hn).has(r)){const i=(n=F(this,hn).get(r))==null?void 0:n.filter(o=>o!==t);i&&(i.length===0?F(this,hn).delete(r):F(this,hn).set(r,i))}this.notify({type:"removed",mutation:t})}canRun(t){var n;const r=(n=F(this,hn).get(Uh(t)))==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===t}runNext(t){var n;const r=(n=F(this,hn).get(Uh(t)))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){er.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...F(this,hn).values()].flat()}find(t){const r={exact:!0,...t};return this.getAll().find(n=>d_(r,n))}findAll(t={}){return this.getAll().filter(r=>d_(t,r))}notify(t){er.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return er.batch(()=>Promise.all(t.map(r=>r.continue().catch(Wn))))}},hn=new WeakMap,_p=new WeakMap,CR);function Uh(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function h_(e){return{onFetch:(t,r)=>{var c,d,f,p,m;const n=t.options,i=(f=(d=(c=t.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],a=((m=t.state.data)==null?void 0:m.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let v=!1;const g=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},b=G$(t.options,t.fetchOptions),y=async(x,P,S)=>{if(v)return Promise.reject();if(P==null&&x.pages.length)return Promise.resolve(x);const E={queryKey:t.queryKey,pageParam:P,direction:S?"backward":"forward",meta:t.options.meta};g(E);const C=await b(E),{maxPages:A}=t.options,T=S?HG:WG;return{pages:T(x.pages,C,A),pageParams:T(x.pageParams,P,A)}};if(i&&o.length){const x=i==="backward",P=x?t9:m_,S={pages:o,pageParams:a},E=P(n,S);s=await y(S,E,x)}else{const x=e??o.length;do{const P=l===0?a[0]??n.initialPageParam:m_(n,s);if(l>0&&P==null)break;s=await y(s,P),l++}while(l{var v,g;return(g=(v=t.options).persister)==null?void 0:g.call(v,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function m_(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function t9(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Lt,ya,ba,Cu,Au,xa,Tu,Ou,AR,r9=(AR=class{constructor(e={}){De(this,Lt);De(this,ya);De(this,ba);De(this,Cu);De(this,Au);De(this,xa);De(this,Tu);De(this,Ou);Se(this,Lt,e.queryCache||new QG),Se(this,ya,e.mutationCache||new e9),Se(this,ba,e.defaultOptions||{}),Se(this,Cu,new Map),Se(this,Au,new Map),Se(this,xa,0)}mount(){Ph(this,xa)._++,F(this,xa)===1&&(Se(this,Tu,GE.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,Lt).onFocus())})),Se(this,Ou,vv.subscribe(async e=>{e&&(await this.resumePausedMutations(),F(this,Lt).onOnline())})))}unmount(){var e,t;Ph(this,xa)._--,F(this,xa)===0&&((e=F(this,Tu))==null||e.call(this),Se(this,Tu,void 0),(t=F(this,Ou))==null||t.call(this),Se(this,Ou,void 0))}isFetching(e){return F(this,Lt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return F(this,ya).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,Lt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const r=this.defaultQueryOptions(e),n=F(this,Lt).build(this,r);return e.revalidateIfStale&&n.isStaleByTime(au(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(t)}}getQueriesData(e){return F(this,Lt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=F(this,Lt).get(n.queryHash),o=i==null?void 0:i.state.data,a=UG(t,o);if(a!==void 0)return F(this,Lt).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return er.batch(()=>F(this,Lt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=F(this,Lt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=F(this,Lt);er.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=F(this,Lt),n={type:"active",...e};return er.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=er.batch(()=>F(this,Lt).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Wn).catch(Wn)}invalidateQueries(e={},t={}){return er.batch(()=>{if(F(this,Lt).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},n=er.batch(()=>F(this,Lt).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(Wn)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(Wn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=F(this,Lt).build(this,t);return r.isStaleByTime(au(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Wn).catch(Wn)}fetchInfiniteQuery(e){return e.behavior=h_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Wn).catch(Wn)}ensureInfiniteQueryData(e){return e.behavior=h_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return vv.isOnline()?F(this,ya).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,Lt)}getMutationCache(){return F(this,ya)}getDefaultOptions(){return F(this,ba)}setDefaultOptions(e){Se(this,ba,e)}setQueryDefaults(e,t){F(this,Cu).set(rl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...F(this,Cu).values()];let r={};return t.forEach(n=>{Tf(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){F(this,Au).set(rl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...F(this,Au).values()];let r={};return t.forEach(n=>{Tf(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...F(this,ba).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=WE(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===HE&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...F(this,ba).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){F(this,Lt).clear(),F(this,ya).clear()}},Lt=new WeakMap,ya=new WeakMap,ba=new WeakMap,Cu=new WeakMap,Au=new WeakMap,xa=new WeakMap,Tu=new WeakMap,Ou=new WeakMap,AR),qr,Je,jp,Ir,Bs,_u,wa,zi,Np,ju,Nu,Vs,Us,Sa,Du,ct,_d,fS,pS,hS,mS,vS,gS,yS,J$,TR,n9=(TR=class extends Pc{constructor(t,r){super();De(this,ct);De(this,qr);De(this,Je);De(this,jp);De(this,Ir);De(this,Bs);De(this,_u);De(this,wa);De(this,zi);De(this,Np);De(this,ju);De(this,Nu);De(this,Vs);De(this,Us);De(this,Sa);De(this,Du,new Set);this.options=r,Se(this,qr,t),Se(this,zi,null),Se(this,wa,dS()),this.options.experimental_prefetchInRender||F(this,wa).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Je).addObserver(this),v_(F(this,Je),this.options)?Ge(this,ct,_d).call(this):this.updateResult(),Ge(this,ct,mS).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bS(F(this,Je),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bS(F(this,Je),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ge(this,ct,vS).call(this),Ge(this,ct,gS).call(this),F(this,Je).removeObserver(this)}setOptions(t,r){const n=this.options,i=F(this,Je);if(this.options=F(this,qr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bi(this.options.enabled,F(this,Je))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ge(this,ct,yS).call(this),F(this,Je).setOptions(this.options),n._defaulted&&!mv(this.options,n)&&F(this,qr).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Je),observer:this});const o=this.hasListeners();o&&g_(F(this,Je),i,this.options,n)&&Ge(this,ct,_d).call(this),this.updateResult(r),o&&(F(this,Je)!==i||bi(this.options.enabled,F(this,Je))!==bi(n.enabled,F(this,Je))||au(this.options.staleTime,F(this,Je))!==au(n.staleTime,F(this,Je)))&&Ge(this,ct,fS).call(this);const a=Ge(this,ct,pS).call(this);o&&(F(this,Je)!==i||bi(this.options.enabled,F(this,Je))!==bi(n.enabled,F(this,Je))||a!==F(this,Sa))&&Ge(this,ct,hS).call(this,a)}getOptimisticResult(t){const r=F(this,qr).getQueryCache().build(F(this,qr),t),n=this.createResult(r,t);return o9(this,n)&&(Se(this,Ir,n),Se(this,_u,this.options),Se(this,Bs,F(this,Je).state)),n}getCurrentResult(){return F(this,Ir)}trackResult(t,r){const n={};return Object.keys(t).forEach(i=>{Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),r==null||r(i),t[i])})}),n}trackProp(t){F(this,Du).add(t)}getCurrentQuery(){return F(this,Je)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=F(this,qr).defaultQueryOptions(t),n=F(this,qr).getQueryCache().build(F(this,qr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ge(this,ct,_d).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,Ir)))}createResult(t,r){var A;const n=F(this,Je),i=this.options,o=F(this,Ir),a=F(this,Bs),s=F(this,_u),u=t!==n?t.state:F(this,jp),{state:c}=t;let d={...c},f=!1,p;if(r._optimisticResults){const T=this.hasListeners(),D=!T&&v_(t,r),N=T&&g_(t,n,r,i);(D||N)&&(d={...d,...Z$(c.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:v,status:g}=d;if(r.select&&d.data!==void 0)if(o&&d.data===(a==null?void 0:a.data)&&r.select===F(this,Np))p=F(this,ju);else try{Se(this,Np,r.select),p=r.select(d.data),p=cS(o==null?void 0:o.data,p,r),Se(this,ju,p),Se(this,zi,null)}catch(T){Se(this,zi,T)}else p=d.data;if(r.placeholderData!==void 0&&p===void 0&&g==="pending"){let T;if(o!=null&&o.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData))T=o.data;else if(T=typeof r.placeholderData=="function"?r.placeholderData((A=F(this,Nu))==null?void 0:A.state.data,F(this,Nu)):r.placeholderData,r.select&&T!==void 0)try{T=r.select(T),Se(this,zi,null)}catch(D){Se(this,zi,D)}T!==void 0&&(g="success",p=cS(o==null?void 0:o.data,T,r),f=!0)}F(this,zi)&&(m=F(this,zi),p=F(this,ju),v=Date.now(),g="error");const b=d.fetchStatus==="fetching",y=g==="pending",x=g==="error",P=y&&b,S=p!==void 0,C={status:g,fetchStatus:d.fetchStatus,isPending:y,isSuccess:g==="success",isError:x,isInitialLoading:P,isLoading:P,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!y,isLoadingError:x&&!S,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&S,isStale:KE(t,r),refetch:this.refetch,promise:F(this,wa)};if(this.options.experimental_prefetchInRender){const T=j=>{C.status==="error"?j.reject(C.error):C.data!==void 0&&j.resolve(C.data)},D=()=>{const j=Se(this,wa,C.promise=dS());T(j)},N=F(this,wa);switch(N.status){case"pending":t.queryHash===n.queryHash&&T(N);break;case"fulfilled":(C.status==="error"||C.data!==N.value)&&D();break;case"rejected":(C.status!=="error"||C.error!==N.reason)&&D();break}}return C}updateResult(t){const r=F(this,Ir),n=this.createResult(F(this,Je),this.options);if(Se(this,Bs,F(this,Je).state),Se(this,_u,this.options),F(this,Bs).data!==void 0&&Se(this,Nu,F(this,Je)),mv(n,r))return;Se(this,Ir,n);const i={},o=()=>{if(!r)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!F(this,Du).size)return!0;const l=new Set(s??F(this,Du));return this.options.throwOnError&&l.add("error"),Object.keys(F(this,Ir)).some(u=>{const c=u;return F(this,Ir)[c]!==r[c]&&l.has(c)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),Ge(this,ct,J$).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ge(this,ct,mS).call(this)}},qr=new WeakMap,Je=new WeakMap,jp=new WeakMap,Ir=new WeakMap,Bs=new WeakMap,_u=new WeakMap,wa=new WeakMap,zi=new WeakMap,Np=new WeakMap,ju=new WeakMap,Nu=new WeakMap,Vs=new WeakMap,Us=new WeakMap,Sa=new WeakMap,Du=new WeakMap,ct=new WeakSet,_d=function(t){Ge(this,ct,yS).call(this);let r=F(this,Je).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Wn)),r},fS=function(){Ge(this,ct,vS).call(this);const t=au(this.options.staleTime,F(this,Je));if(tl||F(this,Ir).isStale||!lS(t))return;const n=W$(F(this,Ir).dataUpdatedAt,t)+1;Se(this,Vs,setTimeout(()=>{F(this,Ir).isStale||this.updateResult()},n))},pS=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(F(this,Je)):this.options.refetchInterval)??!1},hS=function(t){Ge(this,ct,gS).call(this),Se(this,Sa,t),!(tl||bi(this.options.enabled,F(this,Je))===!1||!lS(F(this,Sa))||F(this,Sa)===0)&&Se(this,Us,setInterval(()=>{(this.options.refetchIntervalInBackground||GE.isFocused())&&Ge(this,ct,_d).call(this)},F(this,Sa)))},mS=function(){Ge(this,ct,fS).call(this),Ge(this,ct,hS).call(this,Ge(this,ct,pS).call(this))},vS=function(){F(this,Vs)&&(clearTimeout(F(this,Vs)),Se(this,Vs,void 0))},gS=function(){F(this,Us)&&(clearInterval(F(this,Us)),Se(this,Us,void 0))},yS=function(){const t=F(this,qr).getQueryCache().build(F(this,qr),this.options);if(t===F(this,Je))return;const r=F(this,Je);Se(this,Je,t),Se(this,jp,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},J$=function(t){er.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(F(this,Ir))}),F(this,qr).getQueryCache().notify({query:F(this,Je),type:"observerResultsUpdated"})})},TR);function i9(e,t){return bi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function v_(e,t){return i9(e,t)||e.state.data!==void 0&&bS(e,t,t.refetchOnMount)}function bS(e,t,r){if(bi(t.enabled,e)!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&KE(e,t)}return!1}function g_(e,t,r,n){return(e!==t||bi(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&KE(e,r)}function KE(e,t){return bi(t.enabled,e)!==!1&&e.isStaleByTime(au(t.staleTime,e))}function o9(e,t){return!mv(e.getCurrentResult(),t)}var Pa,Ea,Yr,yo,ko,Dm,xS,OR,a9=(OR=class extends Pc{constructor(r,n){super();De(this,ko);De(this,Pa);De(this,Ea);De(this,Yr);De(this,yo);Se(this,Pa,r),this.setOptions(n),this.bindMethods(),Ge(this,ko,Dm).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var i;const n=this.options;this.options=F(this,Pa).defaultMutationOptions(r),mv(this.options,n)||F(this,Pa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,Yr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&rl(n.mutationKey)!==rl(this.options.mutationKey)?this.reset():((i=F(this,Yr))==null?void 0:i.state.status)==="pending"&&F(this,Yr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=F(this,Yr))==null||r.removeObserver(this)}onMutationUpdate(r){Ge(this,ko,Dm).call(this),Ge(this,ko,xS).call(this,r)}getCurrentResult(){return F(this,Ea)}reset(){var r;(r=F(this,Yr))==null||r.removeObserver(this),Se(this,Yr,void 0),Ge(this,ko,Dm).call(this),Ge(this,ko,xS).call(this)}mutate(r,n){var i;return Se(this,yo,n),(i=F(this,Yr))==null||i.removeObserver(this),Se(this,Yr,F(this,Pa).getMutationCache().build(F(this,Pa),this.options)),F(this,Yr).addObserver(this),F(this,Yr).execute(r)}},Pa=new WeakMap,Ea=new WeakMap,Yr=new WeakMap,yo=new WeakMap,ko=new WeakSet,Dm=function(){var n;const r=((n=F(this,Yr))==null?void 0:n.state)??Q$();Se(this,Ea,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},xS=function(r){er.batch(()=>{var n,i,o,a,s,l,u,c;if(F(this,yo)&&this.hasListeners()){const d=F(this,Ea).variables,f=F(this,Ea).context;(r==null?void 0:r.type)==="success"?((i=(n=F(this,yo)).onSuccess)==null||i.call(n,r.data,d,f),(a=(o=F(this,yo)).onSettled)==null||a.call(o,r.data,null,d,f)):(r==null?void 0:r.type)==="error"&&((l=(s=F(this,yo)).onError)==null||l.call(s,r.error,d,f),(c=(u=F(this,yo)).onSettled)==null||c.call(u,void 0,r.error,d,f))}this.listeners.forEach(d=>{d(F(this,Ea))})})},OR),eL=w.createContext(void 0),$p=e=>{const t=w.useContext(eL);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},s9=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(eL.Provider,{value:e,children:t})),tL=w.createContext(!1),l9=()=>w.useContext(tL);tL.Provider;function u9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var c9=w.createContext(u9()),d9=()=>w.useContext(c9);function rL(e,t){return typeof e=="function"?e(...t):!!e}function wS(){}var f9=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},p9=e=>{w.useEffect(()=>{e.clearReset()},[e])},h9=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&rL(r,[e.error,n]),m9=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},v9=(e,t)=>e.isLoading&&e.isFetching&&!t,g9=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,y_=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function y9(e,t,r){var c,d,f,p,m;const n=$p(),i=l9(),o=d9(),a=n.defaultQueryOptions(e);(d=(c=n.getDefaultOptions().queries)==null?void 0:c._experimental_beforeQuery)==null||d.call(c,a),a._optimisticResults=i?"isRestoring":"optimistic",m9(a),f9(a,o),p9(o);const s=!n.getQueryCache().get(a.queryHash),[l]=w.useState(()=>new t(n,a)),u=l.getOptimisticResult(a);if(w.useSyncExternalStore(w.useCallback(v=>{const g=i?wS:l.subscribe(er.batchCalls(v));return l.updateResult(),g},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(a,{listeners:!1})},[a,l]),g9(a,u))throw y_(a,l,o);if(h9({result:u,errorResetBoundary:o,throwOnError:a.throwOnError,query:n.getQueryCache().get(a.queryHash)}))throw u.error;if((p=(f=n.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||p.call(f,a,u),a.experimental_prefetchInRender&&!tl&&v9(u,i)){const v=s?y_(a,l,o):(m=n.getQueryCache().get(a.queryHash))==null?void 0:m.promise;v==null||v.catch(wS).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?u:l.trackResult(u)}function nL(e,t){return y9(e,n9)}function su(e,t){const r=$p(),[n]=w.useState(()=>new a9(r,e));w.useEffect(()=>{n.setOptions(e)},[n,e]);const i=w.useSyncExternalStore(w.useCallback(a=>n.subscribe(er.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=w.useCallback((a,s)=>{n.mutate(a,s).catch(wS)},[n]);if(i.error&&rL(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var b9=typeof Element<"u",x9=typeof Map=="function",w9=typeof Set=="function",S9=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function km(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!km(e[n],t[n]))return!1;return!0}var o;if(x9&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(n=o.next()).done;)if(!t.has(n.value[0]))return!1;for(o=e.entries();!(n=o.next()).done;)if(!km(n.value[1],t.get(n.value[0])))return!1;return!0}if(w9&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(n=o.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(S9&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;if(b9&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!km(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var P9=function(t,r){try{return km(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const E9=lt(P9);var C9=function(e,t,r,n,i,o,a,s){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,i,o,a,s],c=0;l=new Error(t.replace(/%s/g,function(){return u[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},A9=C9;const b_=lt(A9);var T9=function(t,r,n,i){var o=n?n.call(i,t,r):void 0;if(o!==void 0)return!!o;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var a=Object.keys(t),s=Object.keys(r);if(a.length!==s.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(r),u=0;u(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(iL||{}),Hx={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},x_=Object.values(iL),qE={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},_9=Object.entries(qE).reduce((e,[t,r])=>(e[r]=t,e),{}),Pi="data-rh",lu={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},uu=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},j9=e=>{let t=uu(e,"title");const r=uu(e,lu.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=uu(e,lu.DEFAULT_TITLE);return t||n||void 0},N9=e=>uu(e,lu.ON_CHANGE_CLIENT_STATE)||(()=>{}),Gx=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),D9=(e,t)=>t.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const i=Object.keys(n);for(let o=0;oconsole&&typeof console.warn=="function"&&console.warn(e),od=(e,t,r)=>{const n={};return r.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&k9(`Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`),!1)).map(i=>i[e]).reverse().reduce((i,o)=>{const a={};o.filter(l=>{let u;const c=Object.keys(l);for(let f=0;fi.push(l));const s=Object.keys(a);for(let l=0;l{if(Array.isArray(e)&&e.length){for(let r=0;r({baseTag:D9(["href"],e),bodyAttributes:Gx("bodyAttributes",e),defer:uu(e,lu.DEFER),encode:uu(e,lu.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Gx("htmlAttributes",e),linkTags:od("link",["rel","href"],e),metaTags:od("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:od("noscript",["innerHTML"],e),onChangeClientState:N9(e),scriptTags:od("script",["src","innerHTML"],e),styleTags:od("style",["cssText"],e),title:j9(e),titleAttributes:Gx("titleAttributes",e),prioritizeSeoTags:M9(e,lu.PRIORITIZE_SEO_TAGS)}),oL=e=>Array.isArray(e)?e.join(""):e,R9=(e,t)=>{const r=Object.keys(e);for(let n=0;nArray.isArray(e)?e.reduce((r,n)=>(R9(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},w_=(e,t)=>({...e,[t]:void 0}),$9=["noscript","script","style"],SS=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),aL=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),L9=(e,t,r,n)=>{const i=aL(r),o=oL(t);return i?`<${e} ${Pi}="true" ${i}>${SS(o,n)}`:`<${e} ${Pi}="true">${SS(o,n)}`},F9=(e,t,r=!0)=>t.reduce((n,i)=>{const o=i,a=Object.keys(o).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,c)=>{const d=typeof o[c]>"u"?c:`${c}="${SS(o[c],r)}"`;return u?`${u} ${d}`:d},""),s=o.innerHTML||o.cssText||"",l=$9.indexOf(e)===-1;return`${n}<${e} ${Pi}="true" ${a}${l?"/>":`>${s}`}`},""),sL=(e,t={})=>Object.keys(e).reduce((r,n)=>{const i=qE[n];return r[i||n]=e[n],r},t),B9=(e,t,r)=>{const n={key:t,[Pi]:!0},i=sL(r,n);return[M.createElement("title",i,t)]},Mm=(e,t)=>t.map((r,n)=>{const i={key:n,[Pi]:!0};return Object.keys(r).forEach(o=>{const s=qE[o]||o;if(s==="innerHTML"||s==="cssText"){const l=r.innerHTML||r.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[s]=r[o]}),M.createElement(e,i)}),Un=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>B9(e,t.title,t.titleAttributes),toString:()=>L9(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>sL(t),toString:()=>aL(t)};default:return{toComponent:()=>Mm(e,t),toString:()=>F9(e,t,r)}}},V9=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const i=Kx(e,Hx.meta),o=Kx(t,Hx.link),a=Kx(r,Hx.script);return{priorityMethods:{toComponent:()=>[...Mm("meta",i.priority),...Mm("link",o.priority),...Mm("script",a.priority)],toString:()=>`${Un("meta",i.priority,n)} ${Un("link",o.priority,n)} ${Un("script",a.priority,n)}`},metaTags:i.default,linkTags:o.default,scriptTags:a.default}},U9=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:i,noscriptTags:o,styleTags:a,title:s="",titleAttributes:l,prioritizeSeoTags:u}=e;let{linkTags:c,metaTags:d,scriptTags:f}=e,p={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:p,linkTags:c,metaTags:d,scriptTags:f}=V9(e)),{priority:p,base:Un("base",t,n),bodyAttributes:Un("bodyAttributes",r,n),htmlAttributes:Un("htmlAttributes",i,n),link:Un("link",c,n),meta:Un("meta",d,n),noscript:Un("noscript",o,n),script:Un("script",f,n),style:Un("style",a,n),title:Un("title",{title:s,titleAttributes:l},n)}},PS=U9,zh=[],lL=!!(typeof window<"u"&&window.document&&window.document.createElement),ES=class{constructor(e,t){uo(this,"instances",[]);uo(this,"canUseDOM",lL);uo(this,"context");uo(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?zh:this.instances,add:e=>{(this.canUseDOM?zh:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?zh:this.instances).indexOf(e);(this.canUseDOM?zh:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=PS({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},z9={},uL=M.createContext(z9),zs,cL=(zs=class extends w.Component{constructor(r){super(r);uo(this,"helmetData");this.helmetData=new ES(this.props.context||{},zs.canUseDOM)}render(){return M.createElement(uL.Provider,{value:this.helmetData.value},this.props.children)}},uo(zs,"canUseDOM",lL),zs),Pl=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${Pi}]`),i=[].slice.call(n),o=[];let a;return t&&t.length&&t.forEach(s=>{const l=document.createElement(e);for(const u in s)if(Object.prototype.hasOwnProperty.call(s,u))if(u==="innerHTML")l.innerHTML=s.innerHTML;else if(u==="cssText")l.styleSheet?l.styleSheet.cssText=s.cssText:l.appendChild(document.createTextNode(s.cssText));else{const c=u,d=typeof s[c]>"u"?"":s[c];l.setAttribute(u,d)}l.setAttribute(Pi,"true"),i.some((u,c)=>(a=c,l.isEqualNode(u)))?i.splice(a,1):o.push(l)}),i.forEach(s=>{var l;return(l=s.parentNode)==null?void 0:l.removeChild(s)}),o.forEach(s=>r.appendChild(s)),{oldTags:i,newTags:o}},CS=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(Pi),i=n?n.split(","):[],o=[...i],a=Object.keys(t);for(const s of a){const l=t[s]||"";r.getAttribute(s)!==l&&r.setAttribute(s,l),i.indexOf(s)===-1&&i.push(s);const u=o.indexOf(s);u!==-1&&o.splice(u,1)}for(let s=o.length-1;s>=0;s-=1)r.removeAttribute(o[s]);i.length===o.length?r.removeAttribute(Pi):r.getAttribute(Pi)!==a.join(",")&&r.setAttribute(Pi,a.join(","))},W9=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=oL(e)),CS("title",t)},S_=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:i,linkTags:o,metaTags:a,noscriptTags:s,onChangeClientState:l,scriptTags:u,styleTags:c,title:d,titleAttributes:f}=e;CS("body",n),CS("html",i),W9(d,f);const p={baseTag:Pl("base",r),linkTags:Pl("link",o),metaTags:Pl("meta",a),noscriptTags:Pl("noscript",s),scriptTags:Pl("script",u),styleTags:Pl("style",c)},m={},v={};Object.keys(p).forEach(g=>{const{newTags:b,oldTags:y}=p[g];b.length&&(m[g]=b),y.length&&(v[g]=p[g].oldTags)}),t&&t(),l(e,m,v)},ad=null,H9=e=>{ad&&cancelAnimationFrame(ad),e.defer?ad=requestAnimationFrame(()=>{S_(e,()=>{ad=null})}):(S_(e),ad=null)},G9=H9,P_=class extends w.Component{constructor(){super(...arguments);uo(this,"rendered",!1)}shouldComponentUpdate(t){return!O9(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:r}=this.props.context;let n=null;const i=I9(t.get().map(o=>{const a={...o.props};return delete a.context,a}));cL.canUseDOM?G9(i):PS&&(n=PS(i)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},mw,dL=(mw=class extends w.Component{shouldComponentUpdate(e){return!E9(w_(this.props,"helmetData"),w_(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,r,n){return{...t,[e.type]:[...t[e.type]||[],{...r,...this.mapNestedChildrenToProps(e,n)}]}}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return{...t,[e.type]:n,titleAttributes:{...r}};case"body":return{...t,bodyAttributes:{...r}};case"html":return{...t,htmlAttributes:{...r}};default:return{...t,[e.type]:{...r}}}}mapArrayTypeChildrenToProps(e,t){let r={...t};return Object.keys(e).forEach(n=>{r={...r,[n]:e[n]}}),r}warnOnInvalidChildren(e,t){return b_(x_.some(r=>e.type===r),typeof e.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${x_.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),b_(!t||typeof t=="string"||Array.isArray(t)&&!t.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let r={};return M.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:i,...o}=n.props,a=Object.keys(o).reduce((l,u)=>(l[_9[u]||u]=o[u],l),{});let{type:s}=n;switch(typeof s=="symbol"?s=s.toString():this.warnOnInvalidChildren(n,i),s){case"Symbol(react.fragment)":t=this.mapChildrenToProps(i,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,a,i);break;default:t=this.mapObjectTypeChildren(n,t,a,i);break}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const{children:e,...t}=this.props;let r={...t},{helmetData:n}=t;if(e&&(r=this.mapChildrenToProps(e,r)),n&&!(n instanceof ES)){const i=n;n=new ES(i.context,!0),delete r.helmetData}return n?M.createElement(P_,{...r,context:n.value}):M.createElement(uL.Consumer,null,i=>M.createElement(P_,{...r,context:i}))}},uo(mw,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),mw);function K9(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,i,o,a=[],s="",l=e.split("/");for(l[0]||l.shift();i=l.shift();)r=i[0],r==="*"?(a.push(r),s+=i[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(n=i.indexOf("?",1),o=i.indexOf(".",1),a.push(i.substring(1,~n?n:~o?o:i.length)),s+=~n&&!~o?"(?:/([^/]+?))?":"/([^/]+?)",~o&&(s+=(~n?"?":"")+"\\"+i.substring(o))):s+="/"+i;return{keys:a,pattern:new RegExp("^"+s+(t?"(?=$|/)":"/?$"),"i")}}var fL={exports:{}},pL={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Bu=w;function q9(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Y9=typeof Object.is=="function"?Object.is:q9,X9=Bu.useState,Z9=Bu.useEffect,Q9=Bu.useLayoutEffect,J9=Bu.useDebugValue;function eK(e,t){var r=t(),n=X9({inst:{value:r,getSnapshot:t}}),i=n[0].inst,o=n[1];return Q9(function(){i.value=r,i.getSnapshot=t,qx(i)&&o({inst:i})},[e,r,t]),Z9(function(){return qx(i)&&o({inst:i}),e(function(){qx(i)&&o({inst:i})})},[e]),J9(r),r}function qx(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Y9(e,r)}catch{return!0}}function tK(e,t){return t()}var rK=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?tK:eK;pL.useSyncExternalStore=Bu.useSyncExternalStore!==void 0?Bu.useSyncExternalStore:rK;fL.exports=pL;var nK=fL.exports;const iK=FR.useInsertionEffect,oK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",aK=oK?w.useLayoutEffect:w.useEffect,sK=iK||aK,hL=e=>{const t=w.useRef([e,(...r)=>t[0](...r)]).current;return sK(()=>{t[0]=e}),t[1]},lK="popstate",YE="pushState",XE="replaceState",uK="hashchange",E_=[lK,YE,XE,uK],cK=e=>{for(const t of E_)addEventListener(t,e);return()=>{for(const t of E_)removeEventListener(t,e)}},mL=(e,t)=>nK.useSyncExternalStore(cK,e,t),dK=()=>location.search,fK=({ssrSearch:e=""}={})=>mL(dK,()=>e),C_=()=>location.pathname,pK=({ssrPath:e}={})=>mL(C_,e?()=>e:C_),hK=(e,{replace:t=!1,state:r=null}={})=>history[t?XE:YE](r,"",e),mK=(e={})=>[pK(e),hK],A_=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[A_]>"u"){for(const e of[YE,XE]){const t=history[e];history[e]=function(){const r=t.apply(this,arguments),n=new Event(e);return n.arguments=arguments,dispatchEvent(n),r}}Object.defineProperty(window,A_,{value:!0})}const vK=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",vL=(e="")=>e==="/"?"":e,gK=(e,t)=>e[0]==="~"?e.slice(1):vL(t)+e,yK=(e="",t)=>vK(T_(vL(e)),T_(t)),T_=e=>{try{return decodeURI(e)}catch{return e}},gL={hook:mK,searchHook:fK,parser:K9,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},yL=w.createContext(gL),Lp=()=>w.useContext(yL),bL={},xL=w.createContext(bL),bK=()=>w.useContext(xL),Py=e=>{const[t,r]=e.hook(e);return[yK(e.base,t),hL((n,i)=>r(gK(n,e.base),i))]},Fp=()=>Py(Lp()),wL=(e,t,r,n)=>{const{pattern:i,keys:o}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",n),a=i.exec(r)||[],[s,...l]=a;return s!==void 0?[!0,(()=>{const u=o!==!1?Object.fromEntries(o.map((d,f)=>[d,l[f]])):a.groups;let c={...l};return u&&Object.assign(c,u),c})(),...n?[s]:[]]:[!1,null]},SL=({children:e,...t})=>{var c,d;const r=Lp(),n=t.hook?gL:r;let i=n;const[o,a]=((c=t.ssrPath)==null?void 0:c.split("?"))??[];a&&(t.ssrSearch=a,t.ssrPath=o),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs);let s=w.useRef({}),l=s.current,u=l;for(let f in n){const p=f==="base"?n[f]+(t[f]||""):t[f]||n[f];l===u&&p!==u[f]&&(s.current=u={...u}),u[f]=p,p!==n[f]&&(i=u)}return w.createElement(yL.Provider,{value:i,children:e})},O_=({children:e,component:t},r)=>t?w.createElement(t,{params:r}):typeof e=="function"?e(r):e,xK=e=>{let t=w.useRef(bL),r=t.current;for(const n in e)e[n]!==r[n]&&(r=e);return Object.keys(e).length===0&&(r=e),t.current=r},dn=({path:e,nest:t,match:r,...n})=>{const i=Lp(),[o]=Py(i),[a,s,l]=r??wL(i.parser,e,o,t),u=xK({...bK(),...s});if(!a)return null;const c=l?w.createElement(SL,{base:l},O_(n,u)):O_(n,u);return w.createElement(xL.Provider,{value:u,children:c})},ln=w.forwardRef((e,t)=>{const r=Lp(),[n,i]=Py(r),{to:o="",href:a=o,onClick:s,asChild:l,children:u,className:c,replace:d,state:f,...p}=e,m=hL(g=>{g.ctrlKey||g.metaKey||g.altKey||g.shiftKey||g.button!==0||(s==null||s(g),g.defaultPrevented||(g.preventDefault(),i(a,e)))}),v=r.hrefs(a[0]==="~"?a.slice(1):r.base+a,r);return l&&w.isValidElement(u)?w.cloneElement(u,{onClick:m,href:v}):w.createElement("a",{...p,onClick:m,href:v,className:c!=null&&c.call?c(n===a):c,children:u,ref:t})}),PL=e=>Array.isArray(e)?e.flatMap(t=>PL(t&&t.type===w.Fragment?t.props.children:t)):[e],__=({children:e,location:t})=>{const r=Lp(),[n]=Py(r);for(const i of PL(e)){let o=0;if(w.isValidElement(i)&&(o=wL(r.parser,i.props.path,t||n,i.props.nest))[0])return w.cloneElement(i,{match:o})}return null},wK=new r9({defaultOptions:{queries:{queryFn:async({queryKey:e})=>{const t=await fetch(e[0],{credentials:"include"});if(!t.ok)throw t.status>=500?new Error(`${t.status}: ${t.statusText}`):new Error(`${t.status}: ${await t.text()}`);return t.json()},refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0,retry:!1},mutations:{retry:!1}}}),SK=1,PK=1e6;let Yx=0;function EK(){return Yx=(Yx+1)%Number.MAX_SAFE_INTEGER,Yx.toString()}const Xx=new Map,j_=e=>{if(Xx.has(e))return;const t=setTimeout(()=>{Xx.delete(e),qd({type:"REMOVE_TOAST",toastId:e})},PK);Xx.set(e,t)},CK=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,SK)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?j_(r):e.toasts.forEach(n=>{j_(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Im=[];let Rm={toasts:[]};function qd(e){Rm=CK(Rm,e),Im.forEach(t=>{t(Rm)})}function AK({...e}){const t=EK(),r=i=>qd({type:"UPDATE_TOAST",toast:{...i,id:t}}),n=()=>qd({type:"DISMISS_TOAST",toastId:t});return qd({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function pl(){const[e,t]=w.useState(Rm);return w.useEffect(()=>(Im.push(t),()=>{const r=Im.indexOf(t);r>-1&&Im.splice(r,1)}),[e]),{...e,toast:AK,dismiss:r=>qd({type:"DISMISS_TOAST",toastId:r})}}function Ce(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function TK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Ey(...e){return t=>e.forEach(r=>TK(r,t))}function st(...e){return w.useCallback(Ey(...e),e)}function OK(e,t=[]){let r=[];function n(o,a){const s=w.createContext(a),l=r.length;r=[...r,a];function u(d){const{scope:f,children:p,...m}=d,v=(f==null?void 0:f[e][l])||s,g=w.useMemo(()=>m,Object.values(m));return h.jsx(v.Provider,{value:g,children:p})}function c(d,f){const p=(f==null?void 0:f[e][l])||s,m=w.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,c]}const i=()=>{const o=r.map(a=>w.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[n,_K(i,...t)]}function _K(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=n.reduce((s,{useScope:l,scopeName:u})=>{const d=l(o)[`__scope${u}`];return{...s,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var Lo=w.forwardRef((e,t)=>{const{children:r,...n}=e,i=w.Children.toArray(r),o=i.find(jK);if(o){const a=o.props.children,s=i.map(l=>l===o?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return h.jsx(AS,{...n,ref:t,children:w.isValidElement(a)?w.cloneElement(a,void 0,s):null})}return h.jsx(AS,{...n,ref:t,children:r})});Lo.displayName="Slot";var AS=w.forwardRef((e,t)=>{const{children:r,...n}=e;if(w.isValidElement(r)){const i=DK(r);return w.cloneElement(r,{...NK(n,r.props),ref:t?Ey(t,i):i})}return w.Children.count(r)>1?w.Children.only(null):null});AS.displayName="SlotClone";var EL=({children:e})=>h.jsx(h.Fragment,{children:e});function jK(e){return w.isValidElement(e)&&e.type===EL}function NK(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...s)=>{o(...s),i(...s)}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function DK(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Cy(e){const t=e+"CollectionProvider",[r,n]=OK(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),a=p=>{const{scope:m,children:v}=p,g=M.useRef(null),b=M.useRef(new Map).current;return h.jsx(i,{scope:m,itemMap:b,collectionRef:g,children:v})};a.displayName=t;const s=e+"CollectionSlot",l=M.forwardRef((p,m)=>{const{scope:v,children:g}=p,b=o(s,v),y=st(m,b.collectionRef);return h.jsx(Lo,{ref:y,children:g})});l.displayName=s;const u=e+"CollectionItemSlot",c="data-radix-collection-item",d=M.forwardRef((p,m)=>{const{scope:v,children:g,...b}=p,y=M.useRef(null),x=st(m,y),P=o(u,v);return M.useEffect(()=>(P.itemMap.set(y,{ref:y,...b}),()=>void P.itemMap.delete(y))),h.jsx(Lo,{[c]:"",ref:x,children:g})});d.displayName=u;function f(p){const m=o(e+"CollectionConsumer",p);return M.useCallback(()=>{const g=m.collectionRef.current;if(!g)return[];const b=Array.from(g.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((P,S)=>b.indexOf(P.ref.current)-b.indexOf(S.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},f,n]}function kK(e,t){const r=w.createContext(t),n=o=>{const{children:a,...s}=o,l=w.useMemo(()=>s,Object.values(s));return h.jsx(r.Provider,{value:l,children:a})};n.displayName=e+"Provider";function i(o){const a=w.useContext(r);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,i]}function Ec(e,t=[]){let r=[];function n(o,a){const s=w.createContext(a),l=r.length;r=[...r,a];const u=d=>{var b;const{scope:f,children:p,...m}=d,v=((b=f==null?void 0:f[e])==null?void 0:b[l])||s,g=w.useMemo(()=>m,Object.values(m));return h.jsx(v.Provider,{value:g,children:p})};u.displayName=o+"Provider";function c(d,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[l])||s,m=w.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[u,c]}const i=()=>{const o=r.map(a=>w.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[n,MK(i,...t)]}function MK(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=n.reduce((s,{useScope:l,scopeName:u})=>{const d=l(o)[`__scope${u}`];return{...s,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var IK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ke=IK.reduce((e,t)=>{const r=w.forwardRef((n,i)=>{const{asChild:o,...a}=n,s=o?Lo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(s,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ZE(e,t){e&&ts.flushSync(()=>e.dispatchEvent(t))}function jr(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function RK(e,t=globalThis==null?void 0:globalThis.document){const r=jr(e);w.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var $K="DismissableLayer",TS="dismissableLayer.update",LK="dismissableLayer.pointerDownOutside",FK="dismissableLayer.focusOutside",N_,CL=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Bp=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=e,u=w.useContext(CL),[c,d]=w.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=w.useState({}),m=st(t,C=>d(C)),v=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(g),y=c?v.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,P=y>=b,S=VK(C=>{const A=C.target,T=[...u.branches].some(D=>D.contains(A));!P||T||(i==null||i(C),a==null||a(C),C.defaultPrevented||s==null||s())},f),E=UK(C=>{const A=C.target;[...u.branches].some(D=>D.contains(A))||(o==null||o(C),a==null||a(C),C.defaultPrevented||s==null||s())},f);return RK(C=>{y===u.layers.size-1&&(n==null||n(C),!C.defaultPrevented&&s&&(C.preventDefault(),s()))},f),w.useEffect(()=>{if(c)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(N_=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),D_(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=N_)}},[c,f,r,u]),w.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),D_())},[c,u]),w.useEffect(()=>{const C=()=>p({});return document.addEventListener(TS,C),()=>document.removeEventListener(TS,C)},[]),h.jsx(Ke.div,{...l,ref:m,style:{pointerEvents:x?P?"auto":"none":void 0,...e.style},onFocusCapture:Ce(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Ce(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ce(e.onPointerDownCapture,S.onPointerDownCapture)})});Bp.displayName=$K;var BK="DismissableLayerBranch",AL=w.forwardRef((e,t)=>{const r=w.useContext(CL),n=w.useRef(null),i=st(t,n);return w.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),h.jsx(Ke.div,{...e,ref:i})});AL.displayName=BK;function VK(e,t=globalThis==null?void 0:globalThis.document){const r=jr(e),n=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!n.current){let l=function(){TL(LK,r,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function UK(e,t=globalThis==null?void 0:globalThis.document){const r=jr(e),n=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!n.current&&TL(FK,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function D_(){const e=new CustomEvent(TS);document.dispatchEvent(e)}function TL(e,t,r,{discrete:n}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?ZE(i,o):i.dispatchEvent(o)}var zK=Bp,WK=AL,Nr=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},HK="Portal",Vp=w.forwardRef((e,t)=>{var s;const{container:r,...n}=e,[i,o]=w.useState(!1);Nr(()=>o(!0),[]);const a=r||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?U$.createPortal(h.jsx(Ke.div,{...n,ref:t}),a):null});Vp.displayName=HK;function GK(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var Yo=e=>{const{present:t,children:r}=e,n=KK(t),i=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),o=st(n.ref,qK(i));return typeof r=="function"||n.isPresent?w.cloneElement(i,{ref:o}):null};Yo.displayName="Presence";function KK(e){const[t,r]=w.useState(),n=w.useRef({}),i=w.useRef(e),o=w.useRef("none"),a=e?"mounted":"unmounted",[s,l]=GK(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=Wh(n.current);o.current=s==="mounted"?u:"none"},[s]),Nr(()=>{const u=n.current,c=i.current;if(c!==e){const f=o.current,p=Wh(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Nr(()=>{if(t){let u;const c=t.ownerDocument.defaultView??window,d=p=>{const v=Wh(n.current).includes(p.animationName);if(p.target===t&&v&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=c.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},f=p=>{p.target===t&&(o.current=Wh(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{c.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function Wh(e){return(e==null?void 0:e.animationName)||"none"}function qK(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Vu({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,i]=YK({defaultProp:t,onChange:r}),o=e!==void 0,a=o?e:n,s=jr(r),l=w.useCallback(u=>{if(o){const d=typeof u=="function"?u(e):u;d!==e&&s(d)}else i(u)},[o,e,i,s]);return[a,l]}function YK({defaultProp:e,onChange:t}){const r=w.useState(e),[n]=r,i=w.useRef(n),o=jr(t);return w.useEffect(()=>{i.current!==n&&(o(n),i.current=n)},[n,i,o]),r}var XK="VisuallyHidden",Ay=w.forwardRef((e,t)=>h.jsx(Ke.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Ay.displayName=XK;var QE="ToastProvider",[JE,ZK,QK]=Cy("Toast"),[OL,wIe]=Ec("Toast",[QK]),[JK,Ty]=OL(QE),_L=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:a}=e,[s,l]=w.useState(null),[u,c]=w.useState(0),d=w.useRef(!1),f=w.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${QE}\`. Expected non-empty \`string\`.`),h.jsx(JE.Provider,{scope:t,children:h.jsx(JK,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:o,toastCount:u,viewport:s,onViewportChange:l,onToastAdd:w.useCallback(()=>c(p=>p+1),[]),onToastRemove:w.useCallback(()=>c(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:a})})};_L.displayName=QE;var jL="ToastViewport",eq=["F8"],OS="toast.viewportPause",_S="toast.viewportResume",NL=w.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=eq,label:i="Notifications ({hotkey})",...o}=e,a=Ty(jL,r),s=ZK(r),l=w.useRef(null),u=w.useRef(null),c=w.useRef(null),d=w.useRef(null),f=st(t,d,a.onViewportChange),p=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),m=a.toastCount>0;w.useEffect(()=>{const g=b=>{var x;n.length!==0&&n.every(P=>b[P]||b.code===P)&&((x=d.current)==null||x.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),w.useEffect(()=>{const g=l.current,b=d.current;if(m&&g&&b){const y=()=>{if(!a.isClosePausedRef.current){const E=new CustomEvent(OS);b.dispatchEvent(E),a.isClosePausedRef.current=!0}},x=()=>{if(a.isClosePausedRef.current){const E=new CustomEvent(_S);b.dispatchEvent(E),a.isClosePausedRef.current=!1}},P=E=>{!g.contains(E.relatedTarget)&&x()},S=()=>{g.contains(document.activeElement)||x()};return g.addEventListener("focusin",y),g.addEventListener("focusout",P),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",S),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",P),g.removeEventListener("pointermove",y),g.removeEventListener("pointerleave",S),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[m,a.isClosePausedRef]);const v=w.useCallback(({tabbingDirection:g})=>{const y=s().map(x=>{const P=x.ref.current,S=[P,...pq(P)];return g==="forwards"?S:S.reverse()});return(g==="forwards"?y.reverse():y).flat()},[s]);return w.useEffect(()=>{const g=d.current;if(g){const b=y=>{var S,E,C;const x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){const A=document.activeElement,T=y.shiftKey;if(y.target===g&&T){(S=u.current)==null||S.focus();return}const j=v({tabbingDirection:T?"backwards":"forwards"}),L=j.findIndex(k=>k===A);Zx(j.slice(L+1))?y.preventDefault():T?(E=u.current)==null||E.focus():(C=c.current)==null||C.focus()}};return g.addEventListener("keydown",b),()=>g.removeEventListener("keydown",b)}},[s,v]),h.jsxs(WK,{ref:l,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&h.jsx(jS,{ref:u,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"forwards"});Zx(g)}}),h.jsx(JE.Slot,{scope:r,children:h.jsx(Ke.ol,{tabIndex:-1,...o,ref:f})}),m&&h.jsx(jS,{ref:c,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"backwards"});Zx(g)}})]})});NL.displayName=jL;var DL="ToastFocusProxy",jS=w.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,o=Ty(DL,r);return h.jsx(Ay,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:a=>{var u;const s=a.relatedTarget;!((u=o.viewport)!=null&&u.contains(s))&&n()}})});jS.displayName=DL;var Oy="Toast",tq="toast.swipeStart",rq="toast.swipeMove",nq="toast.swipeCancel",iq="toast.swipeEnd",kL=w.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:o,...a}=e,[s=!0,l]=Vu({prop:n,defaultProp:i,onChange:o});return h.jsx(Yo,{present:r||s,children:h.jsx(sq,{open:s,...a,ref:t,onClose:()=>l(!1),onPause:jr(e.onPause),onResume:jr(e.onResume),onSwipeStart:Ce(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ce(e.onSwipeMove,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:Ce(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ce(e.onSwipeEnd,u=>{const{x:c,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});kL.displayName=Oy;var[oq,aq]=OL(Oy,{onClose(){}}),sq=w.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,v=Ty(Oy,r),[g,b]=w.useState(null),y=st(t,k=>b(k)),x=w.useRef(null),P=w.useRef(null),S=i||v.duration,E=w.useRef(0),C=w.useRef(S),A=w.useRef(0),{onToastAdd:T,onToastRemove:D}=v,N=jr(()=>{var V;(g==null?void 0:g.contains(document.activeElement))&&((V=v.viewport)==null||V.focus()),a()}),j=w.useCallback(k=>{!k||k===1/0||(window.clearTimeout(A.current),E.current=new Date().getTime(),A.current=window.setTimeout(N,k))},[N]);w.useEffect(()=>{const k=v.viewport;if(k){const V=()=>{j(C.current),u==null||u()},B=()=>{const U=new Date().getTime()-E.current;C.current=C.current-U,window.clearTimeout(A.current),l==null||l()};return k.addEventListener(OS,B),k.addEventListener(_S,V),()=>{k.removeEventListener(OS,B),k.removeEventListener(_S,V)}}},[v.viewport,S,l,u,j]),w.useEffect(()=>{o&&!v.isClosePausedRef.current&&j(S)},[o,S,v.isClosePausedRef,j]),w.useEffect(()=>(T(),()=>D()),[T,D]);const L=w.useMemo(()=>g?BL(g):null,[g]);return v.viewport?h.jsxs(h.Fragment,{children:[L&&h.jsx(lq,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),h.jsx(oq,{scope:r,onClose:N,children:ts.createPortal(h.jsx(JE.ItemSlot,{scope:r,children:h.jsx(zK,{asChild:!0,onEscapeKeyDown:Ce(s,()=>{v.isFocusedToastEscapeKeyDownRef.current||N(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:h.jsx(Ke.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":v.swipeDirection,...m,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Ce(e.onKeyDown,k=>{k.key==="Escape"&&(s==null||s(k.nativeEvent),k.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:Ce(e.onPointerDown,k=>{k.button===0&&(x.current={x:k.clientX,y:k.clientY})}),onPointerMove:Ce(e.onPointerMove,k=>{if(!x.current)return;const V=k.clientX-x.current.x,B=k.clientY-x.current.y,U=!!P.current,I=["left","right"].includes(v.swipeDirection),$=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,_=I?$(0,V):0,O=I?0:$(0,B),z=k.pointerType==="touch"?10:2,Y={x:_,y:O},re={originalEvent:k,delta:Y};U?(P.current=Y,Hh(rq,d,re,{discrete:!1})):k_(Y,v.swipeDirection,z)?(P.current=Y,Hh(tq,c,re,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(V)>z||Math.abs(B)>z)&&(x.current=null)}),onPointerUp:Ce(e.onPointerUp,k=>{const V=P.current,B=k.target;if(B.hasPointerCapture(k.pointerId)&&B.releasePointerCapture(k.pointerId),P.current=null,x.current=null,V){const U=k.currentTarget,I={originalEvent:k,delta:V};k_(V,v.swipeDirection,v.swipeThreshold)?Hh(iq,p,I,{discrete:!0}):Hh(nq,f,I,{discrete:!0}),U.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),lq=e=>{const{__scopeToast:t,children:r,...n}=e,i=Ty(Oy,t),[o,a]=w.useState(!1),[s,l]=w.useState(!1);return dq(()=>a(!0)),w.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),s?null:h.jsx(Vp,{asChild:!0,children:h.jsx(Ay,{...n,children:o&&h.jsxs(h.Fragment,{children:[i.label," ",r]})})})},uq="ToastTitle",ML=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return h.jsx(Ke.div,{...n,ref:t})});ML.displayName=uq;var cq="ToastDescription",IL=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return h.jsx(Ke.div,{...n,ref:t})});IL.displayName=cq;var RL="ToastAction",$L=w.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?h.jsx(FL,{altText:r,asChild:!0,children:h.jsx(eC,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${RL}\`. Expected non-empty \`string\`.`),null)});$L.displayName=RL;var LL="ToastClose",eC=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=aq(LL,r);return h.jsx(FL,{asChild:!0,children:h.jsx(Ke.button,{type:"button",...n,ref:t,onClick:Ce(e.onClick,i.onClose)})})});eC.displayName=LL;var FL=w.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return h.jsx(Ke.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:t})});function BL(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),fq(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const a=n.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...BL(n))}}),t}function Hh(e,t,r,{discrete:n}){const i=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?ZE(i,o):i.dispatchEvent(o)}var k_=(e,t,r=0)=>{const n=Math.abs(e.x),i=Math.abs(e.y),o=n>i;return t==="left"||t==="right"?o&&n>r:!o&&i>r};function dq(e=()=>{}){const t=jr(e);Nr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function fq(e){return e.nodeType===e.ELEMENT_NODE}function pq(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Zx(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var hq=_L,VL=NL,UL=kL,zL=ML,WL=IL,HL=$L,GL=eC;function KL(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,I_=mq,_y=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return I_(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:o}=t,a=Object.keys(i).map(u=>{const c=r==null?void 0:r[u],d=o==null?void 0:o[u];if(c===null)return null;const f=M_(c)||M_(d);return i[u][f]}),s=r&&Object.entries(r).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:d,className:f,...p}=c;return Object.entries(p).every(m=>{let[v,g]=m;return Array.isArray(g)?g.includes({...o,...s}[v]):{...o,...s}[v]===g})?[...u,d,f]:u},[]);return I_(e,a,l,r==null?void 0:r.class,r==null?void 0:r.className)};/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qL=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var gq={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.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yq=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:o,iconNode:a,...s},l)=>w.createElement("svg",{ref:l,...gq,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:qL("lucide",i),...s},[...a.map(([u,c])=>w.createElement(u,c)),...Array.isArray(o)?o:[o]]));/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qe=(e,t)=>{const r=w.forwardRef(({className:n,...i},o)=>w.createElement(yq,{ref:o,iconNode:t,className:qL(`lucide-${vq(e)}`,n),...i}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bq=qe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const R_=qe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qx=qe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const YL=qe("Calendar",[["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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xq=qe("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wq=qe("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _i=qe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jy=qe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sq=qe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pq=qe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Eq=qe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cq=qe("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Aq=qe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const XL=qe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tq=qe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gv=qe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Oq=qe("Database",[["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"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ZL=qe("Dumbbell",[["path",{d:"M14.4 14.4 9.6 9.6",key:"ic80wn"}],["path",{d:"M18.657 21.485a2 2 0 1 1-2.829-2.828l-1.767 1.768a2 2 0 1 1-2.829-2.829l6.364-6.364a2 2 0 1 1 2.829 2.829l-1.768 1.767a2 2 0 1 1 2.828 2.829z",key:"nnl7wr"}],["path",{d:"m21.5 21.5-1.4-1.4",key:"1f1ice"}],["path",{d:"M3.9 3.9 2.5 2.5",key:"1evmna"}],["path",{d:"M6.404 12.768a2 2 0 1 1-2.829-2.829l1.768-1.767a2 2 0 1 1-2.828-2.829l2.828-2.828a2 2 0 1 1 2.829 2.828l1.767-1.768a2 2 0 1 1 2.829 2.829z",key:"yhosts"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const QL=qe("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _q=qe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ei=qe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jq=qe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nq=qe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const JL=qe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const NS=qe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cu=qe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Dq=qe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kq=qe("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mq=qe("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Iq=qe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yv=qe("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const eF=qe("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Of=qe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $_=qe("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tC=qe("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rq=qe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $q=qe("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Lq=qe("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tF=qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const L_=qe("Zap",[["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"}]]);function rF(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=Vq(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const s=a.split(rC);return s[0]===""&&s.length!==1&&s.shift(),nF(s,t)||Bq(a)},getConflictingClassGroupIds:(a,s)=>{const l=r[a]||[];return s&&n[a]?[...l,...n[a]]:l}}},nF=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?nF(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(rC);return(a=t.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},F_=/^\[(.+)\]$/,Bq=e=>{if(F_.test(e)){const t=F_.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Vq=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return zq(Object.entries(e.classGroups),r).forEach(([o,a])=>{DS(a,n,o,t)}),n},DS=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:B_(t,i);o.classGroupId=r;return}if(typeof i=="function"){if(Uq(i)){DS(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([o,a])=>{DS(a,B_(t,o),r,n)})})},B_=(e,t)=>{let r=e;return t.split(rC).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Uq=e=>e.isThemeGetter,zq=(e,t)=>t?e.map(([r,n])=>{const i=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([a,s])=>[t+a,s])):o);return[r,i]}):e,Wq=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let a=r.get(o);if(a!==void 0)return a;if((a=n.get(o))!==void 0)return i(o,a),a},set(o,a){r.has(o)?r.set(o,a):i(o,a)}}},iF="!",Hq=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],o=t.length,a=s=>{const l=[];let u=0,c=0,d;for(let g=0;gc?d-c:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:v}};return r?s=>r({className:s,parseClassName:a}):a},Gq=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Kq=e=>({cache:Wq(e.cacheSize),parseClassName:Hq(e),...Fq(e)}),qq=/\s+/,Yq=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(qq);let s="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(u);let m=!!p,v=n(m?f.substring(0,p):f);if(!v){if(!m){s=u+(s.length>0?" "+s:s);continue}if(v=n(f),!v){s=u+(s.length>0?" "+s:s);continue}m=!1}const g=Gq(c).join(":"),b=d?g+iF:g,y=b+v;if(o.includes(y))continue;o.push(y);const x=i(v,m);for(let P=0;P0?" "+s:s)}return s};function Xq(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nd(c),e());return r=Kq(u),n=r.cache.get,i=r.cache.set,o=s,s(l)}function s(l){const u=n(l);if(u)return u;const c=Yq(l,r);return i(l,c),c}return function(){return o(Xq.apply(null,arguments))}}const Et=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},aF=/^\[(?:([a-z-]+):)?(.+)\]$/i,Qq=/^\d+\/\d+$/,Jq=new Set(["px","full","screen"]),e7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,t7=/\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$/,r7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,n7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,i7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,co=e=>du(e)||Jq.has(e)||Qq.test(e),oa=e=>Cc(e,"length",f7),du=e=>!!e&&!Number.isNaN(Number(e)),Jx=e=>Cc(e,"number",du),sd=e=>!!e&&Number.isInteger(Number(e)),o7=e=>e.endsWith("%")&&du(e.slice(0,-1)),We=e=>aF.test(e),aa=e=>e7.test(e),a7=new Set(["length","size","percentage"]),s7=e=>Cc(e,a7,sF),l7=e=>Cc(e,"position",sF),u7=new Set(["image","url"]),c7=e=>Cc(e,u7,h7),d7=e=>Cc(e,"",p7),ld=()=>!0,Cc=(e,t,r)=>{const n=aF.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},f7=e=>t7.test(e)&&!r7.test(e),sF=()=>!1,p7=e=>n7.test(e),h7=e=>i7.test(e),m7=()=>{const e=Et("colors"),t=Et("spacing"),r=Et("blur"),n=Et("brightness"),i=Et("borderColor"),o=Et("borderRadius"),a=Et("borderSpacing"),s=Et("borderWidth"),l=Et("contrast"),u=Et("grayscale"),c=Et("hueRotate"),d=Et("invert"),f=Et("gap"),p=Et("gradientColorStops"),m=Et("gradientColorStopPositions"),v=Et("inset"),g=Et("margin"),b=Et("opacity"),y=Et("padding"),x=Et("saturate"),P=Et("scale"),S=Et("sepia"),E=Et("skew"),C=Et("space"),A=Et("translate"),T=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",We,t],j=()=>[We,t],L=()=>["",co,oa],k=()=>["auto",du,We],V=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],B=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",We],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[du,We];return{cacheSize:500,separator:":",theme:{colors:[ld],spacing:[co,oa],blur:["none","",aa,We],brightness:O(),borderColor:[e],borderRadius:["none","","full",aa,We],borderSpacing:j(),borderWidth:L(),contrast:O(),grayscale:$(),hueRotate:O(),invert:$(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[o7,oa],inset:N(),margin:N(),opacity:O(),padding:j(),saturate:O(),scale:O(),sepia:$(),skew:O(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",We]}],container:["container"],columns:[{columns:[aa]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...V(),We]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",sd,We]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",We]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",sd,We]}],"grid-cols":[{"grid-cols":[ld]}],"col-start-end":[{col:["auto",{span:["full",sd,We]},We]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[ld]}],"row-start-end":[{row:["auto",{span:[sd,We]},We]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",We]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",We]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...I()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...I(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...I(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",We,t]}],"min-w":[{"min-w":[We,t,"min","max","fit"]}],"max-w":[{"max-w":[We,t,"none","full","min","max","fit","prose",{screen:[aa]},aa]}],h:[{h:[We,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[We,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[We,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[We,t,"auto","min","max","fit"]}],"font-size":[{text:["base",aa,oa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Jx]}],"font-family":[{font:[ld]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",We]}],"line-clamp":[{"line-clamp":["none",du,Jx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",co,We]}],"list-image":[{"list-image":["none",We]}],"list-style-type":[{list:["none","disc","decimal",We]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",co,oa]}],"underline-offset":[{"underline-offset":["auto",co,We]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",We]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",We]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...V(),l7]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",s7]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},c7]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...B(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:B()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...B()]}],"outline-offset":[{"outline-offset":[co,We]}],"outline-w":[{outline:[co,oa]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[co,oa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",aa,d7]}],"shadow-color":[{shadow:[ld]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",aa,We]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",We]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",We]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",We]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[P]}],"scale-x":[{"scale-x":[P]}],"scale-y":[{"scale-y":[P]}],rotate:[{rotate:[sd,We]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",We]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",We]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",We]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[co,oa,Jx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},v7=Zq(m7);function Me(...e){return v7(ot(e))}const g7=hq,lF=w.forwardRef(({className:e,...t},r)=>h.jsx(VL,{ref:r,className:Me("fixed bottom-0 z-[100] flex max-h-screen w-full flex-col p-4 sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]",e),...t}));lF.displayName=VL.displayName;const y7=_y("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-gray-800 text-white shadow-lg border-gray-700",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),uF=w.forwardRef(({className:e,variant:t,...r},n)=>h.jsx(UL,{ref:n,className:Me(y7({variant:t}),e),...r}));uF.displayName=UL.displayName;const b7=w.forwardRef(({className:e,...t},r)=>h.jsx(HL,{ref:r,className:Me("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));b7.displayName=HL.displayName;const cF=w.forwardRef(({className:e,...t},r)=>h.jsx(GL,{ref:r,className:Me("absolute right-2 top-2 rounded-md p-1 text-gray-300 opacity-100 transition-opacity hover:text-white focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:h.jsx(tF,{className:"h-4 w-4"})}));cF.displayName=GL.displayName;const dF=w.forwardRef(({className:e,...t},r)=>h.jsx(zL,{ref:r,className:Me("text-sm font-semibold",e),...t}));dF.displayName=zL.displayName;const fF=w.forwardRef(({className:e,...t},r)=>h.jsx(WL,{ref:r,className:Me("text-sm opacity-90",e),...t}));fF.displayName=WL.displayName;function x7(){const{toasts:e}=pl();return h.jsxs(g7,{children:[e.map(function({id:t,title:r,description:n,action:i,...o}){return h.jsxs(uF,{...o,children:[h.jsxs("div",{className:"grid gap-1",children:[r&&h.jsx(dF,{children:r}),n&&h.jsx(fF,{children:n})]}),i,h.jsx(cF,{})]},t)}),h.jsx(lF,{})]})}function kS(e,t){return kS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},kS(e,t)}function pF(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,kS(e,t)}function ke(){return ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Gr(1));return r(hF)(e,t)}if(typeof e!="function")throw new Error(Gr(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(Gr(3));return o}function d(v){if(typeof v!="function")throw new Error(Gr(4));if(l)throw new Error(Gr(5));var g=!0;return u(),s.push(v),function(){if(g){if(l)throw new Error(Gr(6));g=!1,u();var y=s.indexOf(v);s.splice(y,1),a=null}}}function f(v){if(!E7(v))throw new Error(Gr(7));if(typeof v.type>"u")throw new Error(Gr(8));if(l)throw new Error(Gr(9));try{l=!0,o=i(o,v)}finally{l=!1}for(var g=a=s,b=0;b=0;n--){var i=t[n](e);if(i)return i}return function(o,a){throw new Error("Invalid value of type "+typeof e+" for "+r+" argument when connecting component "+a.wrappedComponentName+".")}}function MY(e,t){return e===t}function IY(e){var t=e===void 0?{}:e,r=t.connectHOC,n=r===void 0?mY:r,i=t.mapStateToPropsFactories,o=i===void 0?PY:i,a=t.mapDispatchToPropsFactories,s=a===void 0?xY:a,l=t.mergePropsFactories,u=l===void 0?OY:l,c=t.selectorFactory,d=c===void 0?DY:c;return function(p,m,v,g){g===void 0&&(g={});var b=g,y=b.pure,x=y===void 0?!0:y,P=b.areStatesEqual,S=P===void 0?MY:P,E=b.areOwnPropsEqual,C=E===void 0?t0:E,A=b.areStatePropsEqual,T=A===void 0?t0:A,D=b.areMergedPropsEqual,N=D===void 0?t0:D,j=bv(b,kY),L=r0(p,o,"mapStateToProps"),k=r0(m,s,"mapDispatchToProps"),V=r0(v,u,"mergeProps");return n(d,ke({methodName:"connect",getDisplayName:function(U){return"Connect("+U+")"},shouldHandleStateChanges:!!p,initMapStateToProps:L,initMapDispatchToProps:k,initMergeProps:V,pure:x,areStatesEqual:S,areOwnPropsEqual:C,areStatePropsEqual:T,areMergedPropsEqual:N},j))}}const MF=IY();D7(ts.unstable_batchedUpdates);function RY(e,t){if(e.length!==t.length)return!1;for(var r=0;r");return n.callbacks},n.setCallbacks=function(s){n.callbacks=s},n}var r=t.prototype;return r.componentDidMount=function(){this.unbind=Yn(window,[{eventName:"error",fn:this.onWindowError}])},r.componentDidCatch=function(i){if(i instanceof Sv){this.setState({});return}throw i},r.componentWillUnmount=function(){this.unbind()},r.render=function(){return this.props.children(this.setCallbacks)},t}(M.Component),GY=` Press space bar to start a drag. When dragging you can use the arrow keys to move the item around and escape to cancel. Some screen readers may require you to be in focus mode or to use your pass through key `,Pv=function(t){return t+1},KY=function(t){return` You have lifted an item in position `+Pv(t.source.index)+` `},FF=function(t,r){var n=t.droppableId===r.droppableId,i=Pv(t.index),o=Pv(r.index);return n?` You have moved the item from position `+i+` to position `+o+` `:` You have moved the item from position `+i+` in list `+t.droppableId+` to list `+r.droppableId+` in position `+o+` `},BF=function(t,r,n){var i=r.droppableId===n.droppableId;return i?` The item `+t+` has been combined with `+n.draggableId:` The item `+t+` in list `+r.droppableId+` has been combined with `+n.draggableId+` in list `+n.droppableId+` `},qY=function(t){var r=t.destination;if(r)return FF(t.source,r);var n=t.combine;return n?BF(t.draggableId,t.source,n):"You are over an area that cannot be dropped on"},nj=function(t){return` The item has returned to its starting position of `+Pv(t.index)+` `},YY=function(t){if(t.reason==="CANCEL")return` Movement cancelled. `+nj(t.source)+` `;var r=t.destination,n=t.combine;return r?` You have dropped the item. `+FF(t.source,r)+` `:n?` You have dropped the item. `+BF(t.draggableId,t.source,n)+` `:` The item has been dropped while not over a drop area. `+nj(t.source)+` `},$m={dragHandleUsageInstructions:GY,onDragStart:KY,onDragUpdate:qY,onDragEnd:YY},ur={x:0,y:0},vr=function(t,r){return{x:t.x+r.x,y:t.y+r.y}},xn=function(t,r){return{x:t.x-r.x,y:t.y-r.y}},$a=function(t,r){return t.x===r.x&&t.y===r.y},Ac=function(t){return{x:t.x!==0?-t.x:0,y:t.y!==0?-t.y:0}},nl=function(t,r,n){var i;return n===void 0&&(n=0),i={},i[t]=r,i[t==="x"?"y":"x"]=n,i},Nf=function(t,r){return Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))},ij=function(t,r){return Math.min.apply(Math,r.map(function(n){return Nf(t,n)}))},VF=function(t){return function(r){return{x:t(r.x),y:t(r.y)}}},XY=function(e,t){var r=Ci({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return r.width<=0||r.height<=0?null:r},Zp=function(t,r){return{top:t.top+r.y,left:t.left+r.x,bottom:t.bottom+r.y,right:t.right+r.x}},oj=function(t){return[{x:t.left,y:t.top},{x:t.right,y:t.top},{x:t.left,y:t.bottom},{x:t.right,y:t.bottom}]},ZY={top:0,right:0,bottom:0,left:0},QY=function(t,r){return r?Zp(t,r.scroll.diff.displacement):t},JY=function(t,r,n){if(n&&n.increasedBy){var i;return ke({},t,(i={},i[r.end]=t[r.end]+n.increasedBy[r.line],i))}return t},eX=function(t,r){return r&&r.shouldClipSubject?XY(r.pageMarginBox,t):Ci(t)},Uu=function(e){var t=e.page,r=e.withPlaceholder,n=e.axis,i=e.frame,o=QY(t.marginBox,i),a=JY(o,n,r),s=eX(a,i);return{page:t,withPlaceholder:r,active:s}},fC=function(e,t){e.frame||fe();var r=e.frame,n=xn(t,r.scroll.initial),i=Ac(n),o=ke({},r,{scroll:{initial:r.scroll.initial,current:t,diff:{value:n,displacement:i},max:r.scroll.max}}),a=Uu({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o}),s=ke({},e,{frame:o,subject:a});return s};function Ev(e){return Object.values?Object.values(e):Object.keys(e).map(function(t){return e[t]})}function pC(e,t){if(e.findIndex)return e.findIndex(t);for(var r=0;re.bottom,u=n.lefte.right,c=l&&u;if(c)return!0;var d=l&&a||u&&o;return d}},iX=function(e){var t=Qn(e.top,e.bottom),r=Qn(e.left,e.right);return function(n){var i=t(n.top)&&t(n.bottom)&&r(n.left)&&r(n.right);return i}},mC={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},KF={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},oX=function(e){return function(t){var r=Qn(t.top,t.bottom),n=Qn(t.left,t.right);return function(i){return e===mC?r(i.top)&&r(i.bottom):n(i.left)&&n(i.right)}}},aX=function(t,r){var n=r.frame?r.frame.scroll.diff.displacement:ur;return Zp(t,n)},sX=function(t,r,n){return r.subject.active?n(r.subject.active)(t):!1},lX=function(t,r,n){return n(r)(t)},vC=function(t){var r=t.target,n=t.destination,i=t.viewport,o=t.withDroppableDisplacement,a=t.isVisibleThroughFrameFn,s=o?aX(r,n):r;return sX(s,n,a)&&lX(s,i,a)},uX=function(t){return vC(ke({},t,{isVisibleThroughFrameFn:GF}))},qF=function(t){return vC(ke({},t,{isVisibleThroughFrameFn:iX}))},cX=function(t){return vC(ke({},t,{isVisibleThroughFrameFn:oX(t.destination.axis)}))},dX=function(t,r,n){if(typeof n=="boolean")return n;if(!r)return!0;var i=r.invisible,o=r.visible;if(i[t])return!1;var a=o[t];return a?a.shouldAnimate:!0};function fX(e,t){var r=e.page.marginBox,n={top:t.point.y,right:0,bottom:0,left:t.point.x};return Ci(cC(r,n))}function kf(e){var t=e.afterDragging,r=e.destination,n=e.displacedBy,i=e.viewport,o=e.forceShouldAnimate,a=e.last;return t.reduce(function(l,u){var c=fX(u,n),d=u.descriptor.id;l.all.push(d);var f=uX({target:c,destination:r,viewport:i,withDroppableDisplacement:!0});if(!f)return l.invisible[u.descriptor.id]=!0,l;var p=dX(d,a,o),m={draggableId:d,shouldAnimate:p};return l.visible[d]=m,l},{all:[],visible:{},invisible:{}})}function pX(e,t){if(!e.length)return 0;var r=e[e.length-1].descriptor.index;return t.inHomeList?r:r+1}function aj(e){var t=e.insideDestination,r=e.inHomeList,n=e.displacedBy,i=e.destination,o=pX(t,{inHomeList:r});return{displaced:Df,displacedBy:n,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:o}}}}function Cv(e){var t=e.draggable,r=e.insideDestination,n=e.destination,i=e.viewport,o=e.displacedBy,a=e.last,s=e.index,l=e.forceShouldAnimate,u=Oc(t,n);if(s==null)return aj({insideDestination:r,inHomeList:u,displacedBy:o,destination:n});var c=rs(r,function(v){return v.descriptor.index===s});if(!c)return aj({insideDestination:r,inHomeList:u,displacedBy:o,destination:n});var d=Hy(t,r),f=r.indexOf(c),p=d.slice(f),m=kf({afterDragging:p,destination:n,displacedBy:o,last:a,viewport:i.frame,forceShouldAnimate:l});return{displaced:m,displacedBy:o,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:s}}}}function Wa(e,t){return!!t.effected[e]}var hX=function(e){var t=e.isMovingForward,r=e.destination,n=e.draggables,i=e.combine,o=e.afterCritical;if(!r.isCombineEnabled)return null;var a=i.draggableId,s=n[a],l=s.descriptor.index,u=Wa(a,o);return u?t?l:l-1:t?l+1:l},mX=function(e){var t=e.isMovingForward,r=e.isInHomeList,n=e.insideDestination,i=e.location;if(!n.length)return null;var o=i.index,a=t?o+1:o-1,s=n[0].descriptor.index,l=n[n.length-1].descriptor.index,u=r?l:l+1;return au?null:a},vX=function(e){var t=e.isMovingForward,r=e.isInHomeList,n=e.draggable,i=e.draggables,o=e.destination,a=e.insideDestination,s=e.previousImpact,l=e.viewport,u=e.afterCritical,c=s.at;if(c||fe(),c.type==="REORDER"){var d=mX({isMovingForward:t,isInHomeList:r,location:c.destination,insideDestination:a});return d==null?null:Cv({draggable:n,insideDestination:a,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:d})}var f=hX({isMovingForward:t,destination:o,displaced:s.displaced,draggables:i,combine:c.combine,afterCritical:u});return f==null?null:Cv({draggable:n,insideDestination:a,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:f})},gX=function(e){var t=e.displaced,r=e.afterCritical,n=e.combineWith,i=e.displacedBy,o=!!(t.visible[n]||t.invisible[n]);return Wa(n,r)?o?ur:Ac(i.point):o?i.point:ur},yX=function(e){var t=e.afterCritical,r=e.impact,n=e.draggables,i=Wy(r);i||fe();var o=i.draggableId,a=n[o].page.borderBox.center,s=gX({displaced:r.displaced,afterCritical:t,combineWith:o,displacedBy:r.displacedBy});return vr(a,s)},YF=function(t,r){return r.margin[t.start]+r.borderBox[t.size]/2},bX=function(t,r){return r.margin[t.end]+r.borderBox[t.size]/2},gC=function(t,r,n){return r[t.crossAxisStart]+n.margin[t.crossAxisStart]+n.borderBox[t.crossAxisSize]/2},sj=function(t){var r=t.axis,n=t.moveRelativeTo,i=t.isMoving;return nl(r.line,n.marginBox[r.end]+YF(r,i),gC(r,n.marginBox,i))},lj=function(t){var r=t.axis,n=t.moveRelativeTo,i=t.isMoving;return nl(r.line,n.marginBox[r.start]-bX(r,i),gC(r,n.marginBox,i))},xX=function(t){var r=t.axis,n=t.moveInto,i=t.isMoving;return nl(r.line,n.contentBox[r.start]+YF(r,i),gC(r,n.contentBox,i))},wX=function(e){var t=e.impact,r=e.draggable,n=e.draggables,i=e.droppable,o=e.afterCritical,a=Tc(i.descriptor.id,n),s=r.page,l=i.axis;if(!a.length)return xX({axis:l,moveInto:i.page,isMoving:s});var u=t.displaced,c=t.displacedBy,d=u.all[0];if(d){var f=n[d];if(Wa(d,o))return lj({axis:l,moveRelativeTo:f.page,isMoving:s});var p=xv(f.page,c.point);return lj({axis:l,moveRelativeTo:p,isMoving:s})}var m=a[a.length-1];if(m.descriptor.id===r.descriptor.id)return s.borderBox.center;if(Wa(m.descriptor.id,o)){var v=xv(m.page,Ac(o.displacedBy.point));return sj({axis:l,moveRelativeTo:v,isMoving:s})}return sj({axis:l,moveRelativeTo:m.page,isMoving:s})},MS=function(e,t){var r=e.frame;return r?vr(t,r.scroll.diff.displacement):t},SX=function(t){var r=t.impact,n=t.draggable,i=t.droppable,o=t.draggables,a=t.afterCritical,s=n.page.borderBox.center,l=r.at;return!i||!l?s:l.type==="REORDER"?wX({impact:r,draggable:n,draggables:o,droppable:i,afterCritical:a}):yX({impact:r,draggables:o,afterCritical:a})},Gy=function(e){var t=SX(e),r=e.droppable,n=r?MS(r,t):t;return n},XF=function(e,t){var r=xn(t,e.scroll.initial),n=Ac(r),i=Ci({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),o={frame:i,scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:r,displacement:n}}};return o};function uj(e,t){return e.map(function(r){return t[r]})}function PX(e,t){for(var r=0;r1?c.sort(function(d,f){return Dr(d)[s.start]-Dr(f)[s.start]})[0]:u.sort(function(d,f){var p=ij(r,oj(Dr(d))),m=ij(r,oj(Dr(f)));return p!==m?p-m:Dr(d)[s.start]-Dr(f)[s.start]})[0]},cj=function(t,r){var n=t.page.borderBox.center;return Wa(t.descriptor.id,r)?xn(n,r.displacedBy.point):n},OX=function(t,r){var n=t.page.borderBox;return Wa(t.descriptor.id,r)?Zp(n,Ac(r.displacedBy.point)):n},_X=function(e){var t=e.pageBorderBoxCenter,r=e.viewport,n=e.destination,i=e.insideDestination,o=e.afterCritical,a=i.filter(function(s){return qF({target:OX(s,o),destination:n,viewport:r.frame,withDroppableDisplacement:!0})}).sort(function(s,l){var u=Nf(t,MS(n,cj(s,o))),c=Nf(t,MS(n,cj(l,o)));return ut.left&&e.topt.top}function $X(e){var t=e.pageBorderBox,r=e.draggable,n=e.candidates,i=r.page.borderBox.center,o=n.map(function(a){var s=a.axis,l=nl(a.axis.line,t.center[s.line],a.page.borderBox.center[s.crossAxisLine]);return{id:a.descriptor.id,distance:Nf(i,l)}}).sort(function(a,s){return s.distance-a.distance});return o[0]?o[0].id:null}function LX(e){var t=e.pageBorderBox,r=e.draggable,n=e.droppables,i=zy(n).filter(function(o){if(!o.isEnabled)return!1;var a=o.subject.active;if(!a||!RX(t,a))return!1;if(eB(a)(t.center))return!0;var s=o.axis,l=a.center[s.crossAxisLine],u=t[s.crossAxisStart],c=t[s.crossAxisEnd],d=Qn(a[s.crossAxisStart],a[s.crossAxisEnd]),f=d(u),p=d(c);return!f&&!p?!0:f?ul});return i.length?i.length===1?i[0].descriptor.id:$X({pageBorderBox:t,draggable:r,candidates:i}):null}var tB=function(t,r){return Ci(Zp(t,r))},FX=function(e,t){var r=e.frame;return r?tB(t,r.scroll.diff.value):t};function rB(e){var t=e.displaced,r=e.id;return!!(t.visible[r]||t.invisible[r])}function BX(e){var t=e.draggable,r=e.closest,n=e.inHomeList;return r?n&&r.descriptor.index>t.descriptor.index?r.descriptor.index-1:r.descriptor.index:null}var VX=function(e){var t=e.pageBorderBoxWithDroppableScroll,r=e.draggable,n=e.destination,i=e.insideDestination,o=e.last,a=e.viewport,s=e.afterCritical,l=n.axis,u=Qp(n.axis,r.displaceBy),c=u.value,d=t[l.start],f=t[l.end],p=Hy(r,i),m=rs(p,function(g){var b=g.descriptor.id,y=g.page.borderBox.center[l.line],x=Wa(b,s),P=rB({displaced:o,id:b});return x?P?f<=y:db[s.start]+x&&db[s.start]-u+x&&cb[s.start]+u+x&&db[s.start]+x&&c=pj)return dB;var o=i/pj,a=$S+yZ*o,s=n==="CANCEL"?a*bZ:a;return Number(s.toFixed(2))},wZ=function(e){var t=e.impact,r=e.draggable,n=e.dimensions,i=e.viewport,o=e.afterCritical,a=n.draggables,s=n.droppables,l=En(t),u=l?s[l]:null,c=s[r.descriptor.droppableId],d=oB({impact:t,draggable:r,draggables:a,afterCritical:o,droppable:u||c,viewport:i}),f=xn(d,r.client.borderBox.center);return f},SZ=function(e){var t=e.draggables,r=e.reason,n=e.lastImpact,i=e.home,o=e.viewport,a=e.onLiftImpact;if(!n.at||r!=="DROP"){var s=iB({draggables:t,impact:a,destination:i,viewport:o,forceShouldAnimate:!0});return{impact:s,didDropInsideDroppable:!1}}if(n.at.type==="REORDER")return{impact:n,didDropInsideDroppable:!0};var l=ke({},n,{displaced:Df});return{impact:l,didDropInsideDroppable:!0}},PZ=function(e){var t=e.getState,r=e.dispatch;return function(n){return function(i){if(i.type!=="DROP"){n(i);return}var o=t(),a=i.payload.reason;if(o.phase==="COLLECTING"){r(mZ({reason:a}));return}if(o.phase!=="IDLE"){var s=o.phase==="DROP_PENDING"&&o.isWaiting;s&&fe(),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||fe();var l=o.critical,u=o.dimensions,c=u.draggables[o.critical.draggable.id],d=SZ({reason:a,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),f=d.impact,p=d.didDropInsideDroppable,m=p?hC(f):null,v=p?Wy(f):null,g={index:l.draggable.index,droppableId:l.droppable.id},b={draggableId:c.descriptor.id,type:c.descriptor.type,source:g,reason:a,mode:o.movementMode,destination:m,combine:v},y=wZ({impact:f,draggable:c,dimensions:u,viewport:o.viewport,afterCritical:o.afterCritical}),x={critical:o.critical,afterCritical:o.afterCritical,result:b,impact:f},P=!$a(o.current.client.offset,y)||!!b.combine;if(!P){r(wC({completed:x}));return}var S=xZ({current:o.current.client.offset,destination:y,reason:a}),E={newHomeClientOffset:y,dropDuration:S,completed:x};r(hZ(E))}}}},fB=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function EZ(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(r){r.target!==window&&r.target!==window.document||e()}}}function CZ(e){var t=e.onWindowScroll;function r(){t(fB())}var n=jf(r),i=EZ(n),o=Ra;function a(){return o!==Ra}function s(){a()&&fe(),o=Yn(window,[i])}function l(){a()||fe(),n.cancel(),o(),o=Ra}return{start:s,stop:l,isActive:a}}var AZ=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},TZ=function(e){var t=CZ({onWindowScroll:function(n){e.dispatch(lZ({newScroll:n}))}});return function(r){return function(n){!t.isActive()&&n.type==="INITIAL_PUBLISH"&&t.start(),t.isActive()&&AZ(n)&&t.stop(),r(n)}}},OZ=function(e){var t=!1,r=!1,n=setTimeout(function(){r=!0}),i=function(a){t||r||(t=!0,e(a),clearTimeout(n))};return i.wasCalled=function(){return t},i},_Z=function(){var e=[],t=function(o){var a=pC(e,function(u){return u.timerId===o});a===-1&&fe();var s=e.splice(a,1),l=s[0];l.callback()},r=function(o){var a=setTimeout(function(){return t(a)}),s={timerId:a,callback:o};e.push(s)},n=function(){if(e.length){var o=[].concat(e);e.length=0,o.forEach(function(a){clearTimeout(a.timerId),a.callback()})}};return{add:r,flush:n}},jZ=function(t,r){return t==null&&r==null?!0:t==null||r==null?!1:t.droppableId===r.droppableId&&t.index===r.index},NZ=function(t,r){return t==null&&r==null?!0:t==null||r==null?!1:t.draggableId===r.draggableId&&t.droppableId===r.droppableId},DZ=function(t,r){if(t===r)return!0;var n=t.draggable.id===r.draggable.id&&t.draggable.droppableId===r.draggable.droppableId&&t.draggable.type===r.draggable.type&&t.draggable.index===r.draggable.index,i=t.droppable.id===r.droppable.id&&t.droppable.type===r.droppable.type;return n&&i},ud=function(t,r){r()},Gh=function(t,r){return{draggableId:t.draggable.id,type:t.droppable.type,source:{droppableId:t.droppable.id,index:t.draggable.index},mode:r}},a0=function(t,r,n,i){if(!t){n(i(r));return}var o=OZ(n),a={announce:o};t(r,a),o.wasCalled()||n(i(r))},kZ=function(e,t){var r=_Z(),n=null,i=function(f,p){n&&fe(),ud("onBeforeCapture",function(){var m=e().onBeforeCapture;if(m){var v={draggableId:f,mode:p};m(v)}})},o=function(f,p){n&&fe(),ud("onBeforeDragStart",function(){var m=e().onBeforeDragStart;m&&m(Gh(f,p))})},a=function(f,p){n&&fe();var m=Gh(f,p);n={mode:p,lastCritical:f,lastLocation:m.source,lastCombine:null},r.add(function(){ud("onDragStart",function(){return a0(e().onDragStart,m,t,$m.onDragStart)})})},s=function(f,p){var m=hC(p),v=Wy(p);n||fe();var g=!DZ(f,n.lastCritical);g&&(n.lastCritical=f);var b=!jZ(n.lastLocation,m);b&&(n.lastLocation=m);var y=!NZ(n.lastCombine,v);if(y&&(n.lastCombine=v),!(!g&&!b&&!y)){var x=ke({},Gh(f,n.mode),{combine:v,destination:m});r.add(function(){ud("onDragUpdate",function(){return a0(e().onDragUpdate,x,t,$m.onDragUpdate)})})}},l=function(){n||fe(),r.flush()},u=function(f){n||fe(),n=null,ud("onDragEnd",function(){return a0(e().onDragEnd,f,t,$m.onDragEnd)})},c=function(){if(n){var f=ke({},Gh(n.lastCritical,n.mode),{combine:null,destination:null,reason:"CANCEL"});u(f)}};return{beforeCapture:i,beforeStart:o,start:a,update:s,flush:l,drop:u,abort:c}},MZ=function(e,t){var r=kZ(e,t);return function(n){return function(i){return function(o){if(o.type==="BEFORE_INITIAL_CAPTURE"){r.beforeCapture(o.payload.draggableId,o.payload.movementMode);return}if(o.type==="INITIAL_PUBLISH"){var a=o.payload.critical;r.beforeStart(a,o.payload.movementMode),i(o),r.start(a,o.payload.movementMode);return}if(o.type==="DROP_COMPLETE"){var s=o.payload.completed.result;r.flush(),i(o),r.drop(s);return}if(i(o),o.type==="FLUSH"){r.abort();return}var l=n.getState();l.phase==="DRAGGING"&&r.update(l.critical,l.impact)}}}},IZ=function(e){return function(t){return function(r){if(r.type!=="DROP_ANIMATION_FINISHED"){t(r);return}var n=e.getState();n.phase!=="DROP_ANIMATING"&&fe(),e.dispatch(wC({completed:n.completed}))}}},RZ=function(e){var t=null,r=null;function n(){r&&(cancelAnimationFrame(r),r=null),t&&(t(),t=null)}return function(i){return function(o){if((o.type==="FLUSH"||o.type==="DROP_COMPLETE"||o.type==="DROP_ANIMATION_FINISHED")&&n(),i(o),o.type==="DROP_ANIMATE"){var a={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var l=e.getState();l.phase==="DROP_ANIMATING"&&e.dispatch(cB())}};r=requestAnimationFrame(function(){r=null,t=Yn(window,[a])})}}}},$Z=function(e){return function(){return function(t){return function(r){(r.type==="DROP_COMPLETE"||r.type==="FLUSH"||r.type==="DROP_ANIMATE")&&e.stopPublishing(),t(r)}}}},LZ=function(e){var t=!1;return function(){return function(r){return function(n){if(n.type==="INITIAL_PUBLISH"){t=!0,e.tryRecordFocus(n.payload.critical.draggable.id),r(n),e.tryRestoreFocusRecorded();return}if(r(n),!!t){if(n.type==="FLUSH"){t=!1,e.tryRestoreFocusRecorded();return}if(n.type==="DROP_COMPLETE"){t=!1;var i=n.payload.completed.result;i.combine&&e.tryShiftRecord(i.draggableId,i.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}},FZ=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},BZ=function(e){return function(t){return function(r){return function(n){if(FZ(n)){e.stop(),r(n);return}if(n.type==="INITIAL_PUBLISH"){r(n);var i=t.getState();i.phase!=="DRAGGING"&&fe(),e.start(i);return}r(n),e.scroll(t.getState())}}}},VZ=function(e){return function(t){return function(r){if(t(r),r.type==="PUBLISH_WHILE_DRAGGING"){var n=e.getState();n.phase==="DROP_PENDING"&&(n.isWaiting||e.dispatch(uB({reason:n.reason})))}}}},UZ=mF,zZ=function(e){var t=e.dimensionMarshal,r=e.focusMarshal,n=e.styleMarshal,i=e.getResponders,o=e.announce,a=e.autoScroller;return hF(JX,UZ(C7(gZ(n),$Z(t),vZ(t),PZ,IZ,RZ,VZ,BZ(a),TZ,LZ(r),MZ(i,o))))},s0=function(){return{additions:{},removals:{},modified:{}}};function WZ(e){var t=e.registry,r=e.callbacks,n=s0(),i=null,o=function(){i||(r.collectionStarting(),i=requestAnimationFrame(function(){i=null;var c=n,d=c.additions,f=c.removals,p=c.modified,m=Object.keys(d).map(function(b){return t.draggable.getById(b).getDimension(ur)}).sort(function(b,y){return b.descriptor.index-y.descriptor.index}),v=Object.keys(p).map(function(b){var y=t.droppable.getById(b),x=y.callbacks.getScrollWhileDragging();return{droppableId:b,scroll:x}}),g={additions:m,removals:Object.keys(f),modified:v};n=s0(),r.publish(g)}))},a=function(c){var d=c.descriptor.id;n.additions[d]=c,n.modified[c.descriptor.droppableId]=!0,n.removals[d]&&delete n.removals[d],o()},s=function(c){var d=c.descriptor;n.removals[d.id]=!0,n.modified[d.droppableId]=!0,n.additions[d.id]&&delete n.additions[d.id],o()},l=function(){i&&(cancelAnimationFrame(i),i=null,n=s0())};return{add:a,remove:s,stop:l}}var pB=function(e){var t=e.scrollHeight,r=e.scrollWidth,n=e.height,i=e.width,o=xn({x:r,y:t},{x:i,y:n}),a={x:Math.max(0,o.x),y:Math.max(0,o.y)};return a},hB=function(){var e=document.documentElement;return e||fe(),e},mB=function(){var e=hB(),t=pB({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight});return t},HZ=function(){var e=fB(),t=mB(),r=e.y,n=e.x,i=hB(),o=i.clientWidth,a=i.clientHeight,s=n+o,l=r+a,u=Ci({top:r,left:n,right:s,bottom:l}),c={frame:u,scroll:{initial:e,current:e,max:t,diff:{value:ur,displacement:ur}}};return c},GZ=function(e){var t=e.critical,r=e.scrollOptions,n=e.registry,i=HZ(),o=i.scroll.current,a=t.droppable,s=n.droppable.getAllByType(a.type).map(function(d){return d.callbacks.getDimensionAndWatchScroll(o,r)}),l=n.draggable.getAllByType(t.draggable.type).map(function(d){return d.getDimension(o)}),u={draggables:WF(l),droppables:zF(s)},c={dimensions:u,critical:t,viewport:i};return c};function hj(e,t,r){if(r.descriptor.id===t.id||r.descriptor.type!==t.type)return!1;var n=e.droppable.getById(r.descriptor.droppableId);return n.descriptor.mode==="virtual"}var KZ=function(e,t){var r=null,n=WZ({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=function(p,m){e.droppable.exists(p)||fe(),r&&t.updateDroppableIsEnabled({id:p,isEnabled:m})},o=function(p,m){r&&(e.droppable.exists(p)||fe(),t.updateDroppableIsCombineEnabled({id:p,isCombineEnabled:m}))},a=function(p,m){r&&(e.droppable.exists(p)||fe(),t.updateDroppableScroll({id:p,newScroll:m}))},s=function(p,m){r&&e.droppable.getById(p).callbacks.scroll(m)},l=function(){if(r){n.stop();var p=r.critical.droppable;e.droppable.getAllByType(p.type).forEach(function(m){return m.callbacks.dragStopped()}),r.unsubscribe(),r=null}},u=function(p){r||fe();var m=r.critical.draggable;p.type==="ADDITION"&&hj(e,m,p.value)&&n.add(p.value),p.type==="REMOVAL"&&hj(e,m,p.value)&&n.remove(p.value)},c=function(p){r&&fe();var m=e.draggable.getById(p.draggableId),v=e.droppable.getById(m.descriptor.droppableId),g={draggable:m.descriptor,droppable:v.descriptor},b=e.subscribe(u);return r={critical:g,unsubscribe:b},GZ({critical:g,registry:e,scrollOptions:p.scrollOptions})},d={updateDroppableIsEnabled:i,updateDroppableIsCombineEnabled:o,scrollDroppable:s,updateDroppableScroll:a,startPublishing:c,stopPublishing:l};return d},vB=function(e,t){return e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP"},qZ=function(e){window.scrollBy(e.x,e.y)},YZ=lr(function(e){return zy(e).filter(function(t){return!(!t.isEnabled||!t.frame)})}),XZ=function(t,r){var n=rs(YZ(r),function(i){return i.frame||fe(),eB(i.frame.pageMarginBox)(t)});return n},ZZ=function(e){var t=e.center,r=e.destination,n=e.droppables;if(r){var i=n[r];return i.frame?i:null}var o=XZ(t,n);return o},La={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(t){return Math.pow(t,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},QZ=function(e,t){var r=e[t.size]*La.startFromPercentage,n=e[t.size]*La.maxScrollAtPercentage,i={startScrollingFrom:r,maxScrollValueAt:n};return i},gB=function(e){var t=e.startOfRange,r=e.endOfRange,n=e.current,i=r-t;if(i===0)return 0;var o=n-t,a=o/i;return a},EC=1,JZ=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return La.maxPixelScroll;if(e===t.startScrollingFrom)return EC;var r=gB({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),n=1-r,i=La.maxPixelScroll*La.ease(n);return Math.ceil(i)},mj=La.durationDampening.accelerateAt,vj=La.durationDampening.stopDampeningAt,eQ=function(e,t){var r=t,n=vj,i=Date.now(),o=i-r;if(o>=vj)return e;if(ot.height,o=r.width>t.width;return!o&&!i?n:o&&i?null:{x:o?0:n.x,y:i?0:n.y}},rQ=VF(function(e){return e===0?0:e}),yB=function(e){var t=e.dragStartTime,r=e.container,n=e.subject,i=e.center,o=e.shouldUseTimeDampening,a={top:i.y-r.top,right:r.right-i.x,bottom:r.bottom-i.y,left:i.x-r.left},s=yj({container:r,distanceToEdges:a,dragStartTime:t,axis:mC,shouldUseTimeDampening:o}),l=yj({container:r,distanceToEdges:a,dragStartTime:t,axis:KF,shouldUseTimeDampening:o}),u=rQ({x:l,y:s});if($a(u,ur))return null;var c=tQ({container:r,subject:n,proposedScroll:u});return c?$a(c,ur)?null:c:null},nQ=VF(function(e){return e===0?0:e>0?1:-1}),CC=function(){var e=function(r,n){return r<0?r:r>n?r-n:0};return function(t){var r=t.current,n=t.max,i=t.change,o=vr(r,i),a={x:e(o.x,n.x),y:e(o.y,n.y)};return $a(a,ur)?null:a}}(),bB=function(t){var r=t.max,n=t.current,i=t.change,o={x:Math.max(n.x,r.x),y:Math.max(n.y,r.y)},a=nQ(i),s=CC({max:o,current:n,change:a});return!s||a.x!==0&&s.x===0||a.y!==0&&s.y===0},AC=function(t,r){return bB({current:t.scroll.current,max:t.scroll.max,change:r})},iQ=function(t,r){if(!AC(t,r))return null;var n=t.scroll.max,i=t.scroll.current;return CC({current:i,max:n,change:r})},TC=function(t,r){var n=t.frame;return n?bB({current:n.scroll.current,max:n.scroll.max,change:r}):!1},oQ=function(t,r){var n=t.frame;return!n||!TC(t,r)?null:CC({current:n.scroll.current,max:n.scroll.max,change:r})},aQ=function(e){var t=e.viewport,r=e.subject,n=e.center,i=e.dragStartTime,o=e.shouldUseTimeDampening,a=yB({dragStartTime:i,container:t.frame,subject:r,center:n,shouldUseTimeDampening:o});return a&&AC(t,a)?a:null},sQ=function(e){var t=e.droppable,r=e.subject,n=e.center,i=e.dragStartTime,o=e.shouldUseTimeDampening,a=t.frame;if(!a)return null;var s=yB({dragStartTime:i,container:a.pageMarginBox,subject:r,center:n,shouldUseTimeDampening:o});return s&&TC(t,s)?s:null},bj=function(e){var t=e.state,r=e.dragStartTime,n=e.shouldUseTimeDampening,i=e.scrollWindow,o=e.scrollDroppable,a=t.current.page.borderBoxCenter,s=t.dimensions.draggables[t.critical.draggable.id],l=s.page.marginBox;if(t.isWindowScrollAllowed){var u=t.viewport,c=aQ({dragStartTime:r,viewport:u,subject:l,center:a,shouldUseTimeDampening:n});if(c){i(c);return}}var d=ZZ({center:a,destination:En(t.impact),droppables:t.dimensions.droppables});if(d){var f=sQ({dragStartTime:r,droppable:d,subject:l,center:a,shouldUseTimeDampening:n});f&&o(d.descriptor.id,f)}},lQ=function(e){var t=e.scrollWindow,r=e.scrollDroppable,n=jf(t),i=jf(r),o=null,a=function(c){o||fe();var d=o,f=d.shouldUseTimeDampening,p=d.dragStartTime;bj({state:c,scrollWindow:n,scrollDroppable:i,dragStartTime:p,shouldUseTimeDampening:f})},s=function(c){o&&fe();var d=Date.now(),f=!1,p=function(){f=!0};bj({state:c,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:p,scrollDroppable:p}),o={dragStartTime:d,shouldUseTimeDampening:f},f&&a(c)},l=function(){o&&(n.cancel(),i.cancel(),o=null)};return{start:s,stop:l,scroll:a}},uQ=function(e){var t=e.move,r=e.scrollDroppable,n=e.scrollWindow,i=function(u,c){var d=vr(u.current.client.selection,c);t({client:d})},o=function(u,c){if(!TC(u,c))return c;var d=oQ(u,c);if(!d)return r(u.descriptor.id,c),null;var f=xn(c,d);r(u.descriptor.id,f);var p=xn(c,f);return p},a=function(u,c,d){if(!u||!AC(c,d))return d;var f=iQ(c,d);if(!f)return n(d),null;var p=xn(d,f);n(p);var m=xn(d,p);return m},s=function(u){var c=u.scrollJumpRequest;if(c){var d=En(u.impact);d||fe();var f=o(u.dimensions.droppables[d],c);if(f){var p=u.viewport,m=a(u.isWindowScrollAllowed,p,f);m&&i(u,m)}}};return s},cQ=function(e){var t=e.scrollDroppable,r=e.scrollWindow,n=e.move,i=lQ({scrollWindow:r,scrollDroppable:t}),o=uQ({move:n,scrollWindow:r,scrollDroppable:t}),a=function(u){if(u.phase==="DRAGGING"){if(u.movementMode==="FLUID"){i.scroll(u);return}u.scrollJumpRequest&&o(u)}},s={scroll:a,start:i.start,stop:i.stop};return s},zu="data-rbd",Wu=function(){var e=zu+"-drag-handle";return{base:e,draggableId:e+"-draggable-id",contextId:e+"-context-id"}}(),LS=function(){var e=zu+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),dQ=function(){var e=zu+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),xj={contextId:zu+"-scroll-container-context-id"},fQ=function(t){return function(r){return"["+r+'="'+t+'"]'}},cd=function(t,r){return t.map(function(n){var i=n.styles[r];return i?n.selector+" { "+i+" }":""}).join(" ")},pQ="pointer-events: none;",hQ=function(e){var t=fQ(e),r=function(){var s=` cursor: -webkit-grab; cursor: grab; `;return{selector:t(Wu.contextId),styles:{always:` -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(0,0,0,0); touch-action: manipulation; `,resting:s,dragging:pQ,dropAnimating:s}}}(),n=function(){var s=` transition: `+Xd.outOfTheWay+`; `;return{selector:t(LS.contextId),styles:{dragging:s,dropAnimating:s,userCancel:s}}}(),i={selector:t(dQ.contextId),styles:{always:"overflow-anchor: none;"}},o={selector:"body",styles:{dragging:` cursor: grabbing; cursor: -webkit-grabbing; user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; overflow-anchor: none; `}},a=[n,r,i,o];return{always:cd(a,"always"),resting:cd(a,"resting"),dragging:cd(a,"dragging"),dropAnimating:cd(a,"dropAnimating"),userCancel:cd(a,"userCancel")}},Cn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect,l0=function(){var t=document.querySelector("head");return t||fe(),t},wj=function(t){var r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.type="text/css",r};function mQ(e,t){var r=rt(function(){return hQ(e)},[e]),n=w.useRef(null),i=w.useRef(null),o=je(lr(function(d){var f=i.current;f||fe(),f.textContent=d}),[]),a=je(function(d){var f=n.current;f||fe(),f.textContent=d},[]);Cn(function(){!n.current&&!i.current||fe();var d=wj(t),f=wj(t);return n.current=d,i.current=f,d.setAttribute(zu+"-always",e),f.setAttribute(zu+"-dynamic",e),l0().appendChild(d),l0().appendChild(f),a(r.always),o(r.resting),function(){var p=function(v){var g=v.current;g||fe(),l0().removeChild(g),v.current=null};p(n),p(i)}},[t,a,o,r.always,r.resting,e]);var s=je(function(){return o(r.dragging)},[o,r.dragging]),l=je(function(d){if(d==="DROP"){o(r.dropAnimating);return}o(r.userCancel)},[o,r.dropAnimating,r.userCancel]),u=je(function(){i.current&&o(r.resting)},[o,r.resting]),c=rt(function(){return{dragging:s,dropping:l,resting:u}},[s,l,u]);return c}var xB=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function Ky(e){return e instanceof xB(e).HTMLElement}function vQ(e,t){var r="["+Wu.contextId+'="'+e+'"]',n=UF(document.querySelectorAll(r));if(!n.length)return null;var i=rs(n,function(o){return o.getAttribute(Wu.draggableId)===t});return!i||!Ky(i)?null:i}function gQ(e){var t=w.useRef({}),r=w.useRef(null),n=w.useRef(null),i=w.useRef(!1),o=je(function(f,p){var m={id:f,focus:p};return t.current[f]=m,function(){var g=t.current,b=g[f];b!==m&&delete g[f]}},[]),a=je(function(f){var p=vQ(e,f);p&&p!==document.activeElement&&p.focus()},[e]),s=je(function(f,p){r.current===f&&(r.current=p)},[]),l=je(function(){n.current||i.current&&(n.current=requestAnimationFrame(function(){n.current=null;var f=r.current;f&&a(f)}))},[a]),u=je(function(f){r.current=null;var p=document.activeElement;p&&p.getAttribute(Wu.draggableId)===f&&(r.current=f)},[]);Cn(function(){return i.current=!0,function(){i.current=!1;var f=n.current;f&&cancelAnimationFrame(f)}},[]);var c=rt(function(){return{register:o,tryRecordFocus:u,tryRestoreFocusRecorded:l,tryShiftRecord:s}},[o,u,l,s]);return c}function yQ(){var e={draggables:{},droppables:{}},t=[];function r(d){return t.push(d),function(){var p=t.indexOf(d);p!==-1&&t.splice(p,1)}}function n(d){t.length&&t.forEach(function(f){return f(d)})}function i(d){return e.draggables[d]||null}function o(d){var f=i(d);return f||fe(),f}var a={register:function(f){e.draggables[f.descriptor.id]=f,n({type:"ADDITION",value:f})},update:function(f,p){var m=e.draggables[p.descriptor.id];m&&m.uniqueId===f.uniqueId&&(delete e.draggables[p.descriptor.id],e.draggables[f.descriptor.id]=f)},unregister:function(f){var p=f.descriptor.id,m=i(p);m&&f.uniqueId===m.uniqueId&&(delete e.draggables[p],n({type:"REMOVAL",value:f}))},getById:o,findById:i,exists:function(f){return!!i(f)},getAllByType:function(f){return Ev(e.draggables).filter(function(p){return p.descriptor.type===f})}};function s(d){return e.droppables[d]||null}function l(d){var f=s(d);return f||fe(),f}var u={register:function(f){e.droppables[f.descriptor.id]=f},unregister:function(f){var p=s(f.descriptor.id);p&&f.uniqueId===p.uniqueId&&delete e.droppables[f.descriptor.id]},getById:l,findById:s,exists:function(f){return!!s(f)},getAllByType:function(f){return Ev(e.droppables).filter(function(p){return p.descriptor.type===f})}};function c(){e.draggables={},e.droppables={},t.length=0}return{draggable:a,droppable:u,subscribe:r,clean:c}}function bQ(){var e=rt(yQ,[]);return w.useEffect(function(){return function(){requestAnimationFrame(e.clean)}},[e]),e}var OC=M.createContext(null),Av=function(){var e=document.body;return e||fe(),e},xQ={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},wQ=function(t){return"rbd-announcement-"+t};function SQ(e){var t=rt(function(){return wQ(e)},[e]),r=w.useRef(null);w.useEffect(function(){var o=document.createElement("div");return r.current=o,o.id=t,o.setAttribute("aria-live","assertive"),o.setAttribute("aria-atomic","true"),ke(o.style,xQ),Av().appendChild(o),function(){setTimeout(function(){var l=Av();l.contains(o)&&l.removeChild(o),o===r.current&&(r.current=null)})}},[t]);var n=je(function(i){var o=r.current;if(o){o.textContent=i;return}},[]);return n}var PQ=0,EQ={separator:"::"};function _C(e,t){return t===void 0&&(t=EQ),rt(function(){return""+e+t.separator+PQ++},[t.separator,e])}function CQ(e){var t=e.contextId,r=e.uniqueId;return"rbd-hidden-text-"+t+"-"+r}function AQ(e){var t=e.contextId,r=e.text,n=_C("hidden-text",{separator:"-"}),i=rt(function(){return CQ({contextId:t,uniqueId:n})},[n,t]);return w.useEffect(function(){var a=document.createElement("div");return a.id=i,a.textContent=r,a.style.display="none",Av().appendChild(a),function(){var l=Av();l.contains(a)&&l.removeChild(a)}},[i,r]),i}var qy=M.createContext(null);function wB(e){var t=w.useRef(e);return w.useEffect(function(){t.current=e}),t}function TQ(){var e=null;function t(){return!!e}function r(a){return a===e}function n(a){e&&fe();var s={abandon:a};return e=s,s}function i(){e||fe(),e=null}function o(){e&&(e.abandon(),i())}return{isClaimed:t,isActive:r,claim:n,release:i,tryAbandon:o}}var OQ=9,_Q=13,jC=27,SB=32,jQ=33,NQ=34,DQ=35,kQ=36,MQ=37,IQ=38,RQ=39,$Q=40,Kh,LQ=(Kh={},Kh[_Q]=!0,Kh[OQ]=!0,Kh),PB=function(e){LQ[e.keyCode]&&e.preventDefault()},Yy=function(){var e="visibilitychange";if(typeof document>"u")return e;var t=[e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],r=rs(t,function(n){return"on"+n in document});return r||e}(),EB=0,Sj=5;function FQ(e,t){return Math.abs(t.x-e.x)>=Sj||Math.abs(t.y-e.y)>=Sj}var Pj={type:"IDLE"};function BQ(e){var t=e.cancel,r=e.completed,n=e.getPhase,i=e.setPhase;return[{eventName:"mousemove",fn:function(a){var s=a.button,l=a.clientX,u=a.clientY;if(s===EB){var c={x:l,y:u},d=n();if(d.type==="DRAGGING"){a.preventDefault(),d.actions.move(c);return}d.type!=="PENDING"&&fe();var f=d.point;if(FQ(f,c)){a.preventDefault();var p=d.actions.fluidLift(c);i({type:"DRAGGING",actions:p})}}}},{eventName:"mouseup",fn:function(a){var s=n();if(s.type!=="DRAGGING"){t();return}a.preventDefault(),s.actions.drop({shouldBlockNextClick:!0}),r()}},{eventName:"mousedown",fn:function(a){n().type==="DRAGGING"&&a.preventDefault(),t()}},{eventName:"keydown",fn:function(a){var s=n();if(s.type==="PENDING"){t();return}if(a.keyCode===jC){a.preventDefault(),t();return}PB(a)}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){n().type==="PENDING"&&t()}},{eventName:"webkitmouseforcedown",fn:function(a){var s=n();if(s.type==="IDLE"&&fe(),s.actions.shouldRespectForcePress()){t();return}a.preventDefault()}},{eventName:Yy,fn:t}]}function VQ(e){var t=w.useRef(Pj),r=w.useRef(Ra),n=rt(function(){return{eventName:"mousedown",fn:function(d){if(!d.defaultPrevented&&d.button===EB&&!(d.ctrlKey||d.metaKey||d.shiftKey||d.altKey)){var f=e.findClosestDraggableId(d);if(f){var p=e.tryGetLock(f,a,{sourceEvent:d});if(p){d.preventDefault();var m={x:d.clientX,y:d.clientY};r.current(),u(p,m)}}}}}},[e]),i=rt(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(d){if(!d.defaultPrevented){var f=e.findClosestDraggableId(d);if(f){var p=e.findOptionsForDraggable(f);p&&(p.shouldRespectForcePress||e.canGetLock(f)&&d.preventDefault())}}}}},[e]),o=je(function(){var d={passive:!1,capture:!0};r.current=Yn(window,[i,n],d)},[i,n]),a=je(function(){var c=t.current;c.type!=="IDLE"&&(t.current=Pj,r.current(),o())},[o]),s=je(function(){var c=t.current;a(),c.type==="DRAGGING"&&c.actions.cancel({shouldBlockNextClick:!0}),c.type==="PENDING"&&c.actions.abort()},[a]),l=je(function(){var d={capture:!0,passive:!1},f=BQ({cancel:s,completed:a,getPhase:function(){return t.current},setPhase:function(m){t.current=m}});r.current=Yn(window,f,d)},[s,a]),u=je(function(d,f){t.current.type!=="IDLE"&&fe(),t.current={type:"PENDING",point:f,actions:d},l()},[l]);Cn(function(){return o(),function(){r.current()}},[o])}var El;function UQ(){}var zQ=(El={},El[NQ]=!0,El[jQ]=!0,El[kQ]=!0,El[DQ]=!0,El);function WQ(e,t){function r(){t(),e.cancel()}function n(){t(),e.drop()}return[{eventName:"keydown",fn:function(o){if(o.keyCode===jC){o.preventDefault(),r();return}if(o.keyCode===SB){o.preventDefault(),n();return}if(o.keyCode===$Q){o.preventDefault(),e.moveDown();return}if(o.keyCode===IQ){o.preventDefault(),e.moveUp();return}if(o.keyCode===RQ){o.preventDefault(),e.moveRight();return}if(o.keyCode===MQ){o.preventDefault(),e.moveLeft();return}if(zQ[o.keyCode]){o.preventDefault();return}PB(o)}},{eventName:"mousedown",fn:r},{eventName:"mouseup",fn:r},{eventName:"click",fn:r},{eventName:"touchstart",fn:r},{eventName:"resize",fn:r},{eventName:"wheel",fn:r,options:{passive:!0}},{eventName:Yy,fn:r}]}function HQ(e){var t=w.useRef(UQ),r=rt(function(){return{eventName:"keydown",fn:function(o){if(o.defaultPrevented||o.keyCode!==SB)return;var a=e.findClosestDraggableId(o);if(!a)return;var s=e.tryGetLock(a,c,{sourceEvent:o});if(!s)return;o.preventDefault();var l=!0,u=s.snapLift();t.current();function c(){l||fe(),l=!1,t.current(),n()}t.current=Yn(window,WQ(u,c),{capture:!0,passive:!1})}}},[e]),n=je(function(){var o={passive:!1,capture:!0};t.current=Yn(window,[r],o)},[r]);Cn(function(){return n(),function(){t.current()}},[n])}var u0={type:"IDLE"},GQ=120,KQ=.15;function qQ(e){var t=e.cancel,r=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(i){i.preventDefault()}},{eventName:"keydown",fn:function(i){if(r().type!=="DRAGGING"){t();return}i.keyCode===jC&&i.preventDefault(),t()}},{eventName:Yy,fn:t}]}function YQ(e){var t=e.cancel,r=e.completed,n=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(o){var a=n();if(a.type!=="DRAGGING"){t();return}a.hasMoved=!0;var s=o.touches[0],l=s.clientX,u=s.clientY,c={x:l,y:u};o.preventDefault(),a.actions.move(c)}},{eventName:"touchend",fn:function(o){var a=n();if(a.type!=="DRAGGING"){t();return}o.preventDefault(),a.actions.drop({shouldBlockNextClick:!0}),r()}},{eventName:"touchcancel",fn:function(o){if(n().type!=="DRAGGING"){t();return}o.preventDefault(),t()}},{eventName:"touchforcechange",fn:function(o){var a=n();a.type==="IDLE"&&fe();var s=o.touches[0];if(s){var l=s.force>=KQ;if(l){var u=a.actions.shouldRespectForcePress();if(a.type==="PENDING"){u&&t();return}if(u){if(a.hasMoved){o.preventDefault();return}t();return}o.preventDefault()}}}},{eventName:Yy,fn:t}]}function XQ(e){var t=w.useRef(u0),r=w.useRef(Ra),n=je(function(){return t.current},[]),i=je(function(p){t.current=p},[]),o=rt(function(){return{eventName:"touchstart",fn:function(p){if(!p.defaultPrevented){var m=e.findClosestDraggableId(p);if(m){var v=e.tryGetLock(m,s,{sourceEvent:p});if(v){var g=p.touches[0],b=g.clientX,y=g.clientY,x={x:b,y};r.current(),d(v,x)}}}}}},[e]),a=je(function(){var p={capture:!0,passive:!1};r.current=Yn(window,[o],p)},[o]),s=je(function(){var f=t.current;f.type!=="IDLE"&&(f.type==="PENDING"&&clearTimeout(f.longPressTimerId),i(u0),r.current(),a())},[a,i]),l=je(function(){var f=t.current;s(),f.type==="DRAGGING"&&f.actions.cancel({shouldBlockNextClick:!0}),f.type==="PENDING"&&f.actions.abort()},[s]),u=je(function(){var p={capture:!0,passive:!1},m={cancel:l,completed:s,getPhase:n},v=Yn(window,YQ(m),p),g=Yn(window,qQ(m),p);r.current=function(){v(),g()}},[l,n,s]),c=je(function(){var p=n();p.type!=="PENDING"&&fe();var m=p.actions.fluidLift(p.point);i({type:"DRAGGING",actions:m,hasMoved:!1})},[n,i]),d=je(function(p,m){n().type!=="IDLE"&&fe();var v=setTimeout(c,GQ);i({type:"PENDING",point:m,actions:p,longPressTimerId:v}),u()},[u,n,i,c]);Cn(function(){return a(),function(){r.current();var m=n();m.type==="PENDING"&&(clearTimeout(m.longPressTimerId),i(u0))}},[n,a,i]),Cn(function(){var p=Yn(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return p},[])}var ZQ={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function CB(e,t){if(t==null)return!1;var r=!!ZQ[t.tagName.toLowerCase()];if(r)return!0;var n=t.getAttribute("contenteditable");return n==="true"||n===""?!0:t===e?!1:CB(e,t.parentElement)}function QQ(e,t){var r=t.target;return Ky(r)?CB(e,r):!1}var JQ=function(e){return Ci(e.getBoundingClientRect()).center};function eJ(e){return e instanceof xB(e).Element}var tJ=function(){var e="matches";if(typeof document>"u")return e;var t=[e,"msMatchesSelector","webkitMatchesSelector"],r=rs(t,function(n){return n in Element.prototype});return r||e}();function AB(e,t){return e==null?null:e[tJ](t)?e:AB(e.parentElement,t)}function rJ(e,t){return e.closest?e.closest(t):AB(e,t)}function nJ(e){return"["+Wu.contextId+'="'+e+'"]'}function iJ(e,t){var r=t.target;if(!eJ(r))return null;var n=nJ(e),i=rJ(r,n);return!i||!Ky(i)?null:i}function oJ(e,t){var r=iJ(e,t);return r?r.getAttribute(Wu.draggableId):null}function aJ(e,t){var r="["+LS.contextId+'="'+e+'"]',n=UF(document.querySelectorAll(r)),i=rs(n,function(o){return o.getAttribute(LS.id)===t});return!i||!Ky(i)?null:i}function sJ(e){e.preventDefault()}function qh(e){var t=e.expected,r=e.phase,n=e.isLockActive;return e.shouldWarn,!(!n()||t!==r)}function TB(e){var t=e.lockAPI,r=e.store,n=e.registry,i=e.draggableId;if(t.isClaimed())return!1;var o=n.draggable.findById(i);return!(!o||!o.options.isEnabled||!vB(r.getState(),i))}function lJ(e){var t=e.lockAPI,r=e.contextId,n=e.store,i=e.registry,o=e.draggableId,a=e.forceSensorStop,s=e.sourceEvent,l=TB({lockAPI:t,store:n,registry:i,draggableId:o});if(!l)return null;var u=i.draggable.getById(o),c=aJ(r,u.descriptor.id);if(!c||s&&!u.options.canDragInteractiveElements&&QQ(c,s))return null;var d=t.claim(a||Ra),f="PRE_DRAG";function p(){return u.options.shouldRespectForcePress}function m(){return t.isActive(d)}function v(E,C){qh({expected:E,phase:f,isLockActive:m,shouldWarn:!0})&&n.dispatch(C())}var g=v.bind(null,"DRAGGING");function b(E){function C(){t.release(),f="COMPLETED"}f!=="PRE_DRAG"&&(C(),f!=="PRE_DRAG"&&fe()),n.dispatch(tZ(E.liftActionArgs)),f="DRAGGING";function A(T,D){if(D===void 0&&(D={shouldBlockNextClick:!1}),E.cleanup(),D.shouldBlockNextClick){var N=Yn(window,[{eventName:"click",fn:sJ,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(N)}C(),n.dispatch(uB({reason:T}))}return ke({isActive:function(){return qh({expected:"DRAGGING",phase:f,isLockActive:m,shouldWarn:!1})},shouldRespectForcePress:p,drop:function(D){return A("DROP",D)},cancel:function(D){return A("CANCEL",D)}},E.actions)}function y(E){var C=jf(function(T){g(function(){return lB({client:T})})}),A=b({liftActionArgs:{id:o,clientSelection:E,movementMode:"FLUID"},cleanup:function(){return C.cancel()},actions:{move:C}});return ke({},A,{move:C})}function x(){var E={moveUp:function(){return g(cZ)},moveRight:function(){return g(fZ)},moveDown:function(){return g(dZ)},moveLeft:function(){return g(pZ)}};return b({liftActionArgs:{id:o,clientSelection:JQ(c),movementMode:"SNAP"},cleanup:Ra,actions:E})}function P(){var E=qh({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!0});E&&t.release()}var S={isActive:function(){return qh({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!1})},shouldRespectForcePress:p,fluidLift:y,snapLift:x,abort:P};return S}var uJ=[VQ,HQ,XQ];function cJ(e){var t=e.contextId,r=e.store,n=e.registry,i=e.customSensors,o=e.enableDefaultSensors,a=[].concat(o?uJ:[],i||[]),s=w.useState(function(){return TQ()})[0],l=je(function(y,x){y.isDragging&&!x.isDragging&&s.tryAbandon()},[s]);Cn(function(){var y=r.getState(),x=r.subscribe(function(){var P=r.getState();l(y,P),y=P});return x},[s,r,l]),Cn(function(){return s.tryAbandon},[s.tryAbandon]);for(var u=je(function(b){return TB({lockAPI:s,registry:n,store:r,draggableId:b})},[s,n,r]),c=je(function(b,y,x){return lJ({lockAPI:s,registry:n,contextId:t,store:r,draggableId:b,forceSensorStop:y,sourceEvent:x&&x.sourceEvent?x.sourceEvent:null})},[t,s,n,r]),d=je(function(b){return oJ(t,b)},[t]),f=je(function(b){var y=n.draggable.findById(b);return y?y.options:null},[n.draggable]),p=je(function(){s.isClaimed()&&(s.tryAbandon(),r.getState().phase!=="IDLE"&&r.dispatch(xC()))},[s,r]),m=je(s.isClaimed,[s]),v=rt(function(){return{canGetLock:u,tryGetLock:c,findClosestDraggableId:d,findOptionsForDraggable:f,tryReleaseLock:p,isLockClaimed:m}},[u,c,d,f,p,m]),g=0;g"u")return e;const t=new Map,r=(...n)=>e(...n);return new Proxy(r,{get:(n,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}function Xy(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const BS=e=>Array.isArray(e);function MB(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function DC(e,t,r,n){if(typeof t=="function"){const[i,o]=_j(n);t=t(r!==void 0?r:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=_j(n);t=t(r!==void 0?r:e.custom,i,o)}return t}function Zy(e,t,r){const n=e.getProps();return DC(n,t,r!==void 0?r:n.custom,e)}const kC=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],MC=["initial",...kC],Jp=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],hl=new Set(Jp),Ao=e=>e*1e3,To=e=>e/1e3,oee={type:"spring",stiffness:500,damping:25,restSpeed:10},aee=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),see={type:"keyframes",duration:.8},lee={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},uee=(e,{keyframes:t})=>t.length>2?see:hl.has(e)?e.startsWith("scale")?aee(t[1]):oee:lee;function IC(e,t){return e?e[t]||e.default||e:void 0}const cee={skipAnimations:!1,useManualTiming:!1},dee=e=>e!==null;function Qy(e,{repeat:t,repeatType:r="loop"},n){const i=e.filter(dee),o=t&&r!=="loop"&&t%2===1?0:i.length-1;return!o||n===void 0?i[o]:n}const An=e=>e;let VS=An;function fee(e){let t=new Set,r=new Set,n=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function s(u){o.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,c=!1,d=!1)=>{const p=d&&n?t:r;return c&&o.add(u),p.has(u)||p.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(a=u,n){i=!0;return}n=!0,[t,r]=[r,t],t.forEach(s),t.clear(),n=!1,i&&(i=!1,l.process(u))}};return l}const Xh=["read","resolveKeyframes","update","preRender","render","postRender"],pee=40;function IB(e,t){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>r=!0,a=Xh.reduce((b,y)=>(b[y]=fee(o),b),{}),{read:s,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=a,p=()=>{const b=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(b-i.timestamp,pee),1),i.timestamp=b,i.isProcessing=!0,s.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(p))},m=()=>{r=!0,n=!0,i.isProcessing||e(p)};return{schedule:Xh.reduce((b,y)=>{const x=a[y];return b[y]=(P,S=!1,E=!1)=>(r||m(),x.schedule(P,S,E)),b},{}),cancel:b=>{for(let y=0;y(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,hee=1e-7,mee=12;function vee(e,t,r,n,i){let o,a,s=0;do a=t+(r-t)/2,o=RB(a,n,i)-e,o>0?r=a:t=a;while(Math.abs(o)>hee&&++svee(o,0,1,e,r);return o=>o===0||o===1?o:RB(i(o),t,n)}const $B=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,LB=e=>t=>1-e(1-t),FB=eh(.33,1.53,.69,.99),RC=LB(FB),BB=$B(RC),VB=e=>(e*=2)<1?.5*RC(e):.5*(2-Math.pow(2,-10*(e-1))),$C=e=>1-Math.sin(Math.acos(e)),UB=LB($C),zB=$B($C),WB=e=>/^0[^.\s]+$/u.test(e);function gee(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||WB(e):!0}const HB=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),GB=e=>t=>typeof t=="string"&&t.startsWith(e),KB=GB("--"),yee=GB("var(--"),LC=e=>yee(e)?bee.test(e.split("/*")[0].trim()):!1,bee=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,xee=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function wee(e){const t=xee.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}function qB(e,t,r=1){const[n,i]=wee(e);if(!n)return;const o=window.getComputedStyle(t).getPropertyValue(n);if(o){const a=o.trim();return HB(a)?parseFloat(a):a}return LC(i)?qB(i,t,r+1):i}const Fo=(e,t,r)=>r>t?t:rtypeof e=="number",parse:parseFloat,transform:e=>e},Rf={..._c,transform:e=>Fo(0,1,e)},Zh={..._c,default:1},th=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),la=th("deg"),Xi=th("%"),Ie=th("px"),See=th("vh"),Pee=th("vw"),jj={...Xi,parse:e=>Xi.parse(e)/100,transform:e=>Xi.transform(e*100)},Eee=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Nj=e=>e===_c||e===Ie,Dj=(e,t)=>parseFloat(e.split(", ")[t]),kj=(e,t)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return Dj(i[1],t);{const o=n.match(/^matrix\((.+)\)$/u);return o?Dj(o[1],e):0}},Cee=new Set(["x","y","z"]),Aee=Jp.filter(e=>!Cee.has(e));function Tee(e){const t=[];return Aee.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const Hu={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:kj(4,13),y:kj(5,14)};Hu.translateX=Hu.x;Hu.translateY=Hu.y;const YB=e=>t=>t.test(e),Oee={test:e=>e==="auto",parse:e=>e},XB=[_c,Ie,Xi,la,Pee,See,Oee],Mj=e=>XB.find(YB(e)),Gs=new Set;let US=!1,zS=!1;function ZB(){if(zS){const e=Array.from(Gs).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const i=Tee(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([o,a])=>{var s;(s=n.getValue(o))===null||s===void 0||s.set(a)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}zS=!1,US=!1,Gs.forEach(e=>e.complete()),Gs.clear()}function QB(){Gs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(zS=!0)})}function _ee(){QB(),ZB()}class FC{constructor(t,r,n,i,o,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=o,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Gs.add(this),US||(US=!0,_t.read(QB),_t.resolveKeyframes(ZB))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;for(let o=0;oMath.round(e*1e5)/1e5,BC=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jee(e){return e==null}const Nee=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,VC=(e,t)=>r=>!!(typeof r=="string"&&Nee.test(r)&&r.startsWith(e)||t&&!jee(r)&&Object.prototype.hasOwnProperty.call(r,t)),JB=(e,t,r)=>n=>{if(typeof n!="string")return n;const[i,o,a,s]=n.match(BC);return{[e]:parseFloat(i),[t]:parseFloat(o),[r]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},Dee=e=>Fo(0,255,e),p0={..._c,transform:e=>Math.round(Dee(e))},Os={test:VC("rgb","red"),parse:JB("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+p0.transform(e)+", "+p0.transform(t)+", "+p0.transform(r)+", "+Zd(Rf.transform(n))+")"};function kee(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const WS={test:VC("#"),parse:kee,transform:Os.transform},Gl={test:VC("hsl","hue"),parse:JB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Xi.transform(Zd(t))+", "+Xi.transform(Zd(r))+", "+Zd(Rf.transform(n))+")"},Er={test:e=>Os.test(e)||WS.test(e)||Gl.test(e),parse:e=>Os.test(e)?Os.parse(e):Gl.test(e)?Gl.parse(e):WS.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Os.transform(e):Gl.transform(e)},Mee=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Iee(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(BC))===null||t===void 0?void 0:t.length)||0)+(((r=e.match(Mee))===null||r===void 0?void 0:r.length)||0)>0}const e3="number",t3="color",Ree="var",$ee="var(",Ij="${}",Lee=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function $f(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let o=0;const s=t.replace(Lee,l=>(Er.test(l)?(n.color.push(o),i.push(t3),r.push(Er.parse(l))):l.startsWith($ee)?(n.var.push(o),i.push(Ree),r.push(l)):(n.number.push(o),i.push(e3),r.push(parseFloat(l))),++o,Ij)).split(Ij);return{values:r,split:s,indexes:n,types:i}}function r3(e){return $f(e).values}function n3(e){const{split:t,types:r}=$f(e),n=t.length;return i=>{let o="";for(let a=0;atypeof e=="number"?0:e;function Bee(e){const t=r3(e);return n3(e)(t.map(Fee))}const Ga={test:Iee,parse:r3,createTransformer:n3,getAnimatableNone:Bee},Vee=new Set(["brightness","contrast","saturate","opacity"]);function Uee(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(BC)||[];if(!n)return e;const i=r.replace(n,"");let o=Vee.has(t)?1:0;return n!==r&&(o*=100),t+"("+o+i+")"}const zee=/\b([a-z-]*)\(.*?\)/gu,HS={...Ga,getAnimatableNone:e=>{const t=e.match(zee);return t?t.map(Uee).join(" "):e}},Wee={borderWidth:Ie,borderTopWidth:Ie,borderRightWidth:Ie,borderBottomWidth:Ie,borderLeftWidth:Ie,borderRadius:Ie,radius:Ie,borderTopLeftRadius:Ie,borderTopRightRadius:Ie,borderBottomRightRadius:Ie,borderBottomLeftRadius:Ie,width:Ie,maxWidth:Ie,height:Ie,maxHeight:Ie,top:Ie,right:Ie,bottom:Ie,left:Ie,padding:Ie,paddingTop:Ie,paddingRight:Ie,paddingBottom:Ie,paddingLeft:Ie,margin:Ie,marginTop:Ie,marginRight:Ie,marginBottom:Ie,marginLeft:Ie,backgroundPositionX:Ie,backgroundPositionY:Ie},Hee={rotate:la,rotateX:la,rotateY:la,rotateZ:la,scale:Zh,scaleX:Zh,scaleY:Zh,scaleZ:Zh,skew:la,skewX:la,skewY:la,distance:Ie,translateX:Ie,translateY:Ie,translateZ:Ie,x:Ie,y:Ie,z:Ie,perspective:Ie,transformPerspective:Ie,opacity:Rf,originX:jj,originY:jj,originZ:Ie},Rj={..._c,transform:Math.round},UC={...Wee,...Hee,zIndex:Rj,size:Ie,fillOpacity:Rf,strokeOpacity:Rf,numOctaves:Rj},Gee={...UC,color:Er,backgroundColor:Er,outlineColor:Er,fill:Er,stroke:Er,borderColor:Er,borderTopColor:Er,borderRightColor:Er,borderBottomColor:Er,borderLeftColor:Er,filter:HS,WebkitFilter:HS},zC=e=>Gee[e];function i3(e,t){let r=zC(e);return r!==HS&&(r=Ga),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const Kee=new Set(["auto","none","0"]);function qee(e,t,r){let n=0,i;for(;n{r.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function WC(e){return typeof e=="function"}let Lm;function Yee(){Lm=void 0}const Zi={now:()=>(Lm===void 0&&Zi.set(mr.isProcessing||cee.useManualTiming?mr.timestamp:performance.now()),Lm),set:e=>{Lm=e,queueMicrotask(Yee)}},$j=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ga.test(e)||e==="0")&&!e.startsWith("url("));function Xee(e){const t=e[0];if(e.length===1)return!0;for(let r=0;rQee?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&_ee(),this._resolved}onKeyframesResolved(t,r){this.resolvedAt=Zi.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:o,delay:a,onComplete:s,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Zee(t,n,i,o))if(a)this.options.duration=0;else{l==null||l(Qy(t,this.options,r)),s==null||s(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,r);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:r,...c},this.onPostResolved())}onPostResolved(){}then(t,r){return this.currentFinishedPromise.then(t,r)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Gu=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n},s3=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let o=0;o{const c=u*a,d=c*e,f=c-r,p=GS(u,a),m=Math.exp(-d);return h0-f/p*m},o=u=>{const d=u*a*e,f=d*r+r,p=Math.pow(a,2)*Math.pow(u,2)*e,m=Math.exp(-d),v=GS(Math.pow(u,2),a);return(-i(u)+h0>0?-1:1)*((f-p)*m)/v}):(i=u=>{const c=Math.exp(-u*e),d=(u-r)*e+1;return-h0+c*d},o=u=>{const c=Math.exp(-u*e),d=(r-u)*(e*e);return c*d});const s=5/e,l=rte(i,o,s);if(e=Ao(e),isNaN(l))return{stiffness:Ft.stiffness,damping:Ft.damping,duration:e};{const u=Math.pow(l,2)*n;return{stiffness:u,damping:a*2*Math.sqrt(n*u),duration:e}}}const tte=12;function rte(e,t,r){let n=r;for(let i=1;i=KS?1/0:t}const nte=["duration","bounce"],ite=["stiffness","damping","mass"];function Lj(e,t){return t.some(r=>e[r]!==void 0)}function ote(e){let t={velocity:Ft.velocity,stiffness:Ft.stiffness,damping:Ft.damping,mass:Ft.mass,isResolvedFromDuration:!1,...e};if(!Lj(e,ite)&&Lj(e,nte))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,o=2*Fo(.05,1,1-e.bounce)*Math.sqrt(i);t={...t,mass:Ft.mass,stiffness:i,damping:o}}else{const r=ete(e);t={...t,...r,mass:Ft.mass},t.isResolvedFromDuration=!0}return t}function d3(e=Ft.visualDuration,t=Ft.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:i}=r;const o=r.keyframes[0],a=r.keyframes[r.keyframes.length-1],s={done:!1,value:o},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:p}=ote({...r,velocity:-To(r.velocity||0)}),m=f||0,v=u/(2*Math.sqrt(l*c)),g=a-o,b=To(Math.sqrt(l/c)),y=Math.abs(g)<5;n||(n=y?Ft.restSpeed.granular:Ft.restSpeed.default),i||(i=y?Ft.restDelta.granular:Ft.restDelta.default);let x;if(v<1){const S=GS(b,v);x=E=>{const C=Math.exp(-v*b*E);return a-C*((m+v*b*g)/S*Math.sin(S*E)+g*Math.cos(S*E))}}else if(v===1)x=S=>a-Math.exp(-b*S)*(g+(m+b*g)*S);else{const S=b*Math.sqrt(v*v-1);x=E=>{const C=Math.exp(-v*b*E),A=Math.min(S*E,300);return a-C*((m+v*b*g)*Math.sinh(A)+S*g*Math.cosh(A))/S}}const P={calculatedDuration:p&&d||null,next:S=>{const E=x(S);if(p)s.done=S>=d;else{let C=0;v<1&&(C=S===0?Ao(m):u3(x,S,E));const A=Math.abs(C)<=n,T=Math.abs(a-E)<=i;s.done=A&&T}return s.value=s.done?a:E,s},toString:()=>{const S=Math.min(c3(P),KS),E=s3(C=>P.next(S*C).value,S,30);return S+"ms "+E}};return P}function Fj({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},p=A=>s!==void 0&&Al,m=A=>s===void 0?l:l===void 0||Math.abs(s-A)-v*Math.exp(-A/n),x=A=>b+y(A),P=A=>{const T=y(A),D=x(A);f.done=Math.abs(T)<=u,f.value=f.done?b:D};let S,E;const C=A=>{p(f.value)&&(S=A,E=d3({keyframes:[f.value,m(f.value)],velocity:u3(x,A,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return C(0),{calculatedDuration:null,next:A=>{let T=!1;return!E&&S===void 0&&(T=!0,P(A),C(A)),S!==void 0&&A>=S?E.next(A-S):(!T&&P(A),f)}}}const ate=eh(.42,0,1,1),ste=eh(0,0,.58,1),f3=eh(.42,0,.58,1),lte=e=>Array.isArray(e)&&typeof e[0]!="number",HC=e=>Array.isArray(e)&&typeof e[0]=="number",Bj={linear:An,easeIn:ate,easeInOut:f3,easeOut:ste,circIn:$C,circInOut:zB,circOut:UB,backIn:RC,backInOut:BB,backOut:FB,anticipate:VB},Vj=e=>{if(HC(e)){VS(e.length===4);const[t,r,n,i]=e;return eh(t,r,n,i)}else if(typeof e=="string")return VS(Bj[e]!==void 0),Bj[e];return e},ute=(e,t)=>r=>t(e(r)),rh=(...e)=>e.reduce(ute),Mt=(e,t,r)=>e+(t-e)*r;function m0(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function cte({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,o=0,a=0;if(!t)i=o=a=r;else{const s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;i=m0(l,s,e+1/3),o=m0(l,s,e),a=m0(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:n}}function Ov(e,t){return r=>r>0?t:e}const v0=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},dte=[WS,Os,Gl],fte=e=>dte.find(t=>t.test(e));function Uj(e){const t=fte(e);if(!t)return!1;let r=t.parse(e);return t===Gl&&(r=cte(r)),r}const zj=(e,t)=>{const r=Uj(e),n=Uj(t);if(!r||!n)return Ov(e,t);const i={...r};return o=>(i.red=v0(r.red,n.red,o),i.green=v0(r.green,n.green,o),i.blue=v0(r.blue,n.blue,o),i.alpha=Mt(r.alpha,n.alpha,o),Os.transform(i))},qS=new Set(["none","hidden"]);function pte(e,t){return qS.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function hte(e,t){return r=>Mt(e,t,r)}function GC(e){return typeof e=="number"?hte:typeof e=="string"?LC(e)?Ov:Er.test(e)?zj:gte:Array.isArray(e)?p3:typeof e=="object"?Er.test(e)?zj:mte:Ov}function p3(e,t){const r=[...e],n=r.length,i=e.map((o,a)=>GC(o)(o,t[a]));return o=>{for(let a=0;a{for(const o in n)r[o]=n[o](i);return r}}function vte(e,t){var r;const n=[],i={color:0,var:0,number:0};for(let o=0;o{const r=Ga.createTransformer(t),n=$f(e),i=$f(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?qS.has(e)&&!i.values.length||qS.has(t)&&!n.values.length?pte(e,t):rh(p3(vte(n,i),i.values),r):Ov(e,t)};function h3(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?Mt(e,t,r):GC(e)(e,t)}function yte(e,t,r){const n=[],i=r||h3,o=e.length-1;for(let a=0;at[0];if(o===2&&e[0]===e[1])return()=>t[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=yte(t,n,i),s=a.length,l=u=>{let c=0;if(s>1)for(;cl(Fo(e[0],e[o-1],u)):l}function xte(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=Gu(0,t,n);e.push(Mt(r,1,i))}}function wte(e){const t=[0];return xte(t,e.length-1),t}function Ste(e,t){return e.map(r=>r*t)}function Pte(e,t){return e.map(()=>t||f3).splice(0,e.length-1)}function _v({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=lte(n)?n.map(Vj):Vj(n),o={done:!1,value:t[0]},a=Ste(r&&r.length===t.length?r:wte(t),e),s=bte(a,t,{ease:Array.isArray(i)?i:Pte(t,i)});return{calculatedDuration:e,next:l=>(o.value=s(l),o.done=l>=e,o)}}const Ete=e=>{const t=({timestamp:r})=>e(r);return{start:()=>_t.update(t,!0),stop:()=>Ha(t),now:()=>mr.isProcessing?mr.timestamp:Zi.now()}},Cte={decay:Fj,inertia:Fj,tween:_v,keyframes:_v,spring:d3},Ate=e=>e/100;class KC extends a3{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:r,motionValue:n,element:i,keyframes:o}=this.options,a=(i==null?void 0:i.KeyframeResolver)||FC,s=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new a(o,s,r,n,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:r="keyframes",repeat:n=0,repeatDelay:i=0,repeatType:o,velocity:a=0}=this.options,s=WC(r)?r:Cte[r]||_v;let l,u;s!==_v&&typeof t[0]!="number"&&(l=rh(Ate,h3(t[0],t[1])),t=[0,100]);const c=s({...this.options,keyframes:t});o==="mirror"&&(u=s({...this.options,keyframes:[...t].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=c3(c));const{calculatedDuration:d}=c,f=d+i,p=f*(n+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,r=!1){const{resolved:n}=this;if(!n){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:a,mapPercentToKeyframes:s,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:d}=n;if(this.startTime===null)return o.next(0);const{delay:f,repeat:p,repeatType:m,repeatDelay:v,onUpdate:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),r?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-f*(this.speed>=0?1:-1),y=this.speed>=0?b<0:b>c;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let x=this.currentTime,P=o;if(p){const A=Math.min(this.currentTime,c)/d;let T=Math.floor(A),D=A%1;!D&&A>=1&&(D=1),D===1&&T--,T=Math.min(T,p+1),!!(T%2)&&(m==="reverse"?(D=1-D,v&&(D-=v/d)):m==="mirror"&&(P=a)),x=Fo(0,1,D)*d}const S=y?{done:!1,value:l[0]}:P.next(x);s&&(S.value=s(S.value));let{done:E}=S;!y&&u!==null&&(E=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return C&&i!==void 0&&(S.value=Qy(l,this.options,i)),g&&g(S.value),C&&this.finish(),S}get duration(){const{resolved:t}=this;return t?To(t.calculatedDuration):0}get time(){return To(this.currentTime)}set time(t){t=Ao(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=To(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Ete,onPlay:r,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),r&&r();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Tte=new Set(["opacity","clipPath","filter","transform"]);function qC(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ote={linearEasing:void 0};function _te(e,t){const r=qC(e);return()=>{var n;return(n=Ote[t])!==null&&n!==void 0?n:r()}}const jv=_te(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function m3(e){return!!(typeof e=="function"&&jv()||!e||typeof e=="string"&&(e in YS||jv())||HC(e)||Array.isArray(e)&&e.every(m3))}const jd=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,YS={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jd([0,.65,.55,1]),circOut:jd([.55,0,1,.45]),backIn:jd([.31,.01,.66,-.59]),backOut:jd([.33,1.53,.69,.99])};function v3(e,t){if(e)return typeof e=="function"&&jv()?s3(e,t):HC(e)?jd(e):Array.isArray(e)?e.map(r=>v3(r,t)||YS.easeOut):YS[e]}function jte(e,t,r,{delay:n=0,duration:i=300,repeat:o=0,repeatType:a="loop",ease:s="easeInOut",times:l}={}){const u={[t]:r};l&&(u.offset=l);const c=v3(s,i);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"})}function Wj(e,t){e.timeline=t,e.onfinish=null}const Nte=qC(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Nv=10,Dte=2e4;function kte(e){return WC(e.type)||e.type==="spring"||!m3(e.ease)}function Mte(e,t){const r=new KC({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const i=[];let o=0;for(;!n.done&&othis.onKeyframesResolved(a,s),r,n,i),this.resolver.scheduleResolve()}initPlayback(t,r){var n;let{duration:i=300,times:o,ease:a,type:s,motionValue:l,name:u,startTime:c}=this.options;if(!(!((n=l.owner)===null||n===void 0)&&n.current))return!1;if(typeof a=="string"&&jv()&&Ite(a)&&(a=g3[a]),kte(this.options)){const{onComplete:f,onUpdate:p,motionValue:m,element:v,...g}=this.options,b=Mte(t,g);t=b.keyframes,t.length===1&&(t[1]=t[0]),i=b.duration,o=b.times,a=b.ease,s="keyframes"}const d=jte(l.owner.current,u,t,{...this.options,duration:i,times:o,ease:a});return d.startTime=c??this.calcStartTime(),this.pendingTimeline?(Wj(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Qy(t,this.options,r)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:o,type:s,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:r}=t;return To(r)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:r}=t;return To(r.currentTime||0)}set time(t){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=Ao(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:r}=t;return r.playbackRate}set speed(t){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:r}=t;return r.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:r}=t;return r.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:r}=this;if(!r)return An;const{animation:n}=r;Wj(n,t)}return An}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.playState==="finished"&&this.updateFinishedPromise(),r.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:r,keyframes:n,duration:i,type:o,ease:a,times:s}=t;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:d,element:f,...p}=this.options,m=new KC({...p,keyframes:n,duration:i,type:o,ease:a,times:s,isGenerator:!0}),v=Ao(this.time);u.setWithVelocity(m.sample(v-Nv).value,m.sample(v).value,Nv)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:r,name:n,repeatDelay:i,repeatType:o,damping:a,type:s}=t;return Nte()&&n&&Tte.has(n)&&r&&r.owner&&r.owner.current instanceof HTMLElement&&!r.owner.getProps().onUpdate&&!i&&o!=="mirror"&&a!==0&&s!=="inertia"}}const Rte=qC(()=>window.ScrollTimeline!==void 0);class $te{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,r){return Promise.all(this.animations).then(t).catch(r)}getAll(t){return this.animations[0][t]}setAll(t,r){for(let n=0;nRte()&&i.attachTimeline?i.attachTimeline(t):r(i));return()=>{n.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let r=0;rr[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function Lte({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const YC=(e,t,r,n={},i,o)=>a=>{const s=IC(n,e)||{},l=s.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Ao(l);let c={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-u,onUpdate:f=>{t.set(f),s.onUpdate&&s.onUpdate(f)},onComplete:()=>{a(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:o?void 0:i};Lte(s)||(c={...c,...uee(e,c)}),c.duration&&(c.duration=Ao(c.duration)),c.repeatDelay&&(c.repeatDelay=Ao(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),d&&!o&&t.get()!==void 0){const f=Qy(c.keyframes,s);if(f!==void 0)return _t.update(()=>{c.onUpdate(f),c.onComplete()}),new $te([])}return!o&&Hj.supports(c)?new Hj(c):new KC(c)},Fte=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Bte=e=>BS(e)?e[e.length-1]||0:e;function XC(e,t){e.indexOf(t)===-1&&e.push(t)}function ZC(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class QC{constructor(){this.subscriptions=[]}add(t){return XC(this.subscriptions,t),()=>ZC(this.subscriptions,t)}notify(t,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let o=0;o!isNaN(parseFloat(e));class Ute{constructor(t,r={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const o=Zi.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Zi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Vte(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new QC);const n=this.events[t].add(r);return t==="change"?()=>{n(),_t.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t,r=!0){!r||!this.passiveEffect?this.updateAndNotify(t,r):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Zi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Gj)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,Gj);return l3(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Lf(e,t){return new Ute(e,t)}function zte(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Lf(r))}function Wte(e,t){const r=Zy(e,t);let{transitionEnd:n={},transition:i={},...o}=r||{};o={...o,...n};for(const a in o){const s=Bte(o[a]);zte(e,a,s)}}const JC=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Hte="framerAppearId",y3="data-"+JC(Hte);function b3(e){return e.props[y3]}const Or=e=>!!(e&&e.getVelocity);function Gte(e){return!!(Or(e)&&e.add)}function XS(e,t){const r=e.getValue("willChange");if(Gte(r))return r.add(t)}function Kte({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function x3(e,t,{delay:r=0,transitionOverride:n,type:i}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=t;n&&(a=n);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in l){const f=e.getValue(d,(o=e.latestValues[d])!==null&&o!==void 0?o:null),p=l[d];if(p===void 0||c&&Kte(c,d))continue;const m={delay:r,...IC(a||{},d)};let v=!1;if(window.MotionHandoffAnimation){const b=b3(e);if(b){const y=window.MotionHandoffAnimation(b,d,_t);y!==null&&(m.startTime=y,v=!0)}}XS(e,d),f.start(YC(d,f,p,e.shouldReduceMotion&&hl.has(d)?{type:!1}:m,e,v));const g=f.animation;g&&u.push(g)}return s&&Promise.all(u).then(()=>{_t.update(()=>{s&&Wte(e,s)})}),u}function ZS(e,t,r={}){var n;const i=Zy(e,t,r.type==="exit"?(n=e.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(o=r.transitionOverride);const a=i?()=>Promise.all(x3(e,i,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=o;return qte(e,t,c+u,d,f,r)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,c]=l==="beforeChildren"?[a,s]:[s,a];return u().then(()=>c())}else return Promise.all([a(),s(r.delay)])}function qte(e,t,r=0,n=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*n,l=i===1?(u=0)=>u*n:(u=0)=>s-u*n;return Array.from(e.variantChildren).sort(Yte).forEach((u,c)=>{u.notify("AnimationStart",t),a.push(ZS(u,t,{...o,delay:r+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function Yte(e,t){return e.sortNodePosition(t)}function Xte(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(o=>ZS(e,o,r));n=Promise.all(i)}else if(typeof t=="string")n=ZS(e,t,r);else{const i=typeof t=="function"?Zy(e,t,r.custom):t;n=Promise.all(x3(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}const Zte=MC.length;function w3(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?w3(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const t={};for(let r=0;rPromise.all(t.map(({animation:r,options:n})=>Xte(e,r,n)))}function tre(e){let t=ere(e),r=Kj(),n=!0;const i=l=>(u,c)=>{var d;const f=Zy(e,c,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:m,...v}=f;u={...u,...v,...m}}return u};function o(l){t=l(e)}function a(l){const{props:u}=e,c=w3(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let g=0;gm&&P,T=!1;const D=Array.isArray(x)?x:[x];let N=D.reduce(i(b),{});S===!1&&(N={});const{prevResolvedValues:j={}}=y,L={...j,...N},k=U=>{A=!0,f.has(U)&&(T=!0,f.delete(U)),y.needsAnimating[U]=!0;const I=e.getValue(U);I&&(I.liveStyle=!1)};for(const U in L){const I=N[U],$=j[U];if(p.hasOwnProperty(U))continue;let _=!1;BS(I)&&BS($)?_=!MB(I,$):_=I!==$,_?I!=null?k(U):f.add(U):I!==void 0&&f.has(U)?k(U):y.protectedKeys[U]=!0}y.prevProp=x,y.prevResolvedValues=N,y.isActive&&(p={...p,...N}),n&&e.blockInitialAnimation&&(A=!1),A&&(!(E&&C)||T)&&d.push(...D.map(U=>({animation:U,options:{type:b}})))}if(f.size){const g={};f.forEach(b=>{const y=e.getBaseTarget(b),x=e.getValue(b);x&&(x.liveStyle=!0),g[b]=y??null}),d.push({animation:g})}let v=!!d.length;return n&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),n=!1,v?t(d):Promise.resolve()}function s(l,u){var c;if(r[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),r[l].isActive=u;const d=a(l);for(const f in r)r[f].protectedKeys={};return d}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>r,reset:()=>{r=Kj(),n=!0}}}function rre(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!MB(t,e):!1}function hs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Kj(){return{animate:hs(!0),whileInView:hs(),whileHover:hs(),whileTap:hs(),whileDrag:hs(),whileFocus:hs(),exit:hs()}}class ns{constructor(t){this.isMounted=!1,this.node=t}update(){}}class nre extends ns{constructor(t){super(t),t.animationState||(t.animationState=tre(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xy(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let ire=0;class ore extends ns{constructor(){super(...arguments),this.id=ire++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);r&&!t&&i.then(()=>r(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const are={animation:{Feature:nre},exit:{Feature:ore}},di={x:!1,y:!1};function S3(){return di.x||di.y}function sre(e,t,r){var n;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const o=(n=void 0)!==null&&n!==void 0?n:i.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function P3(e,t){const r=sre(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function qj(e){return t=>{t.pointerType==="touch"||S3()||e(t)}}function lre(e,t,r={}){const[n,i,o]=P3(e,r),a=qj(s=>{const{target:l}=s,u=t(s);if(!u||!l)return;const c=qj(d=>{u(d),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,i)});return n.forEach(s=>{s.addEventListener("pointerenter",a,i)}),o}const eA=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Nd=new WeakSet;function Yj(e){return t=>{t.key==="Enter"&&e(t)}}function g0(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const ure=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=Yj(()=>{if(Nd.has(r))return;g0(r,"down");const i=Yj(()=>{g0(r,"up")}),o=()=>g0(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",o,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)},cre=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function dre(e){return cre.has(e.tagName)||e.tabIndex!==-1}const E3=(e,t)=>t?e===t?!0:E3(e,t.parentElement):!1;function Xj(e){return eA(e)&&!S3()}function fre(e,t,r={}){const[n,i,o]=P3(e,r),a=s=>{const l=s.currentTarget;if(!Xj(s)||Nd.has(l))return;Nd.add(l);const u=t(s),c=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!Xj(p)||!Nd.has(l))&&(Nd.delete(l),u&&u(p,{success:m}))},d=p=>{c(p,r.useGlobalTarget||E3(l,p.target))},f=p=>{c(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return n.forEach(s=>{dre(s)||(s.tabIndex=0),(r.useGlobalTarget?window:s).addEventListener("pointerdown",a,i),s.addEventListener("focus",u=>ure(u,i),i)}),o}function pre(e){return e==="x"||e==="y"?di[e]?null:(di[e]=!0,()=>{di[e]=!1}):di.x||di.y?null:(di.x=di.y=!0,()=>{di.x=di.y=!1})}function nh(e){return{point:{x:e.pageX,y:e.pageY}}}const hre=e=>t=>eA(t)&&e(t,nh(t));function Ff(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function Qd(e,t,r,n){return Ff(e,t,hre(r),n)}const Zj=(e,t)=>Math.abs(e-t);function mre(e,t){const r=Zj(e.x,t.x),n=Zj(e.y,t.y);return Math.sqrt(r**2+n**2)}class C3{constructor(t,r,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=b0(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=mre(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=d,{timestamp:v}=mr;this.history.push({...m,timestamp:v});const{onStart:g,onMove:b}=this.handlers;f||(g&&g(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=y0(f,this.transformPagePoint),_t.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=b0(d.type==="pointercancel"?this.lastMoveEventInfo:y0(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,g),m&&m(d,g)},!eA(t))return;this.dragSnapToOrigin=o,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const a=nh(t),s=y0(a,this.transformPagePoint),{point:l}=s,{timestamp:u}=mr;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=r;c&&c(t,b0(s,this.history)),this.removeListeners=rh(Qd(this.contextWindow,"pointermove",this.handlePointerMove),Qd(this.contextWindow,"pointerup",this.handlePointerUp),Qd(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Ha(this.updatePoint)}}function y0(e,t){return t?{point:t(e.point)}:e}function Qj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function b0({point:e},t){return{point:e,delta:Qj(e,A3(t)),offset:Qj(e,vre(t)),velocity:gre(t,.1)}}function vre(e){return e[0]}function A3(e){return e[e.length-1]}function gre(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const i=A3(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>Ao(t)));)r--;if(!n)return{x:0,y:0};const o=To(i.timestamp-n.timestamp);if(o===0)return{x:0,y:0};const a={x:(i.x-n.x)/o,y:(i.y-n.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Kl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const T3=1e-4,yre=1-T3,bre=1+T3,O3=.01,xre=0-O3,wre=0+O3;function Nn(e){return e.max-e.min}function Sre(e,t,r){return Math.abs(e-t)<=r}function Jj(e,t,r,n=.5){e.origin=n,e.originPoint=Mt(t.min,t.max,e.origin),e.scale=Nn(r)/Nn(t),e.translate=Mt(r.min,r.max,e.origin)-e.originPoint,(e.scale>=yre&&e.scale<=bre||isNaN(e.scale))&&(e.scale=1),(e.translate>=xre&&e.translate<=wre||isNaN(e.translate))&&(e.translate=0)}function Jd(e,t,r,n){Jj(e.x,t.x,r.x,n?n.originX:void 0),Jj(e.y,t.y,r.y,n?n.originY:void 0)}function eN(e,t,r){e.min=r.min+t.min,e.max=e.min+Nn(t)}function Pre(e,t,r){eN(e.x,t.x,r.x),eN(e.y,t.y,r.y)}function tN(e,t,r){e.min=t.min-r.min,e.max=e.min+Nn(t)}function ef(e,t,r){tN(e.x,t.x,r.x),tN(e.y,t.y,r.y)}function Ere(e,{min:t,max:r},n){return t!==void 0&&er&&(e=n?Mt(r,e,n.max):Math.min(e,r)),e}function rN(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function Cre(e,{top:t,left:r,bottom:n,right:i}){return{x:rN(e.x,r,i),y:rN(e.y,t,n)}}function nN(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.minn?r=Gu(t.min,t.max-n,e.min):n>i&&(r=Gu(e.min,e.max-i,t.min)),Fo(0,1,r)}function Ore(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const QS=.35;function _re(e=QS){return e===!1?e=0:e===!0&&(e=QS),{x:iN(e,"left","right"),y:iN(e,"top","bottom")}}function iN(e,t,r){return{min:oN(e,t),max:oN(e,r)}}function oN(e,t){return typeof e=="number"?e:e[t]||0}const aN=()=>({translate:0,scale:1,origin:0,originPoint:0}),ql=()=>({x:aN(),y:aN()}),sN=()=>({min:0,max:0}),Wt=()=>({x:sN(),y:sN()});function Vn(e){return[e("x"),e("y")]}function _3({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function jre({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Nre(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function x0(e){return e===void 0||e===1}function JS({scale:e,scaleX:t,scaleY:r}){return!x0(e)||!x0(t)||!x0(r)}function bs(e){return JS(e)||j3(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function j3(e){return lN(e.x)||lN(e.y)}function lN(e){return e&&e!=="0%"}function Dv(e,t,r){const n=e-r,i=t*n;return r+i}function uN(e,t,r,n,i){return i!==void 0&&(e=Dv(e,i,n)),Dv(e,r,n)+t}function e1(e,t=0,r=1,n,i){e.min=uN(e.min,t,r,n,i),e.max=uN(e.max,t,r,n,i)}function N3(e,{x:t,y:r}){e1(e.x,t.translate,t.scale,t.originPoint),e1(e.y,r.translate,r.scale,r.originPoint)}const cN=.999999999999,dN=1.0000000000001;function Dre(e,t,r,n=!1){const i=r.length;if(!i)return;t.x=t.y=1;let o,a;for(let s=0;scN&&(t.x=1),t.ycN&&(t.y=1)}function Yl(e,t){e.min=e.min+t,e.max=e.max+t}function fN(e,t,r,n,i=.5){const o=Mt(e.min,e.max,i);e1(e,t,r,o,n)}function Xl(e,t){fN(e.x,t.x,t.scaleX,t.scale,t.originX),fN(e.y,t.y,t.scaleY,t.scale,t.originY)}function D3(e,t){return _3(Nre(e.getBoundingClientRect(),t))}function kre(e,t,r){const n=D3(e,r),{scroll:i}=t;return i&&(Yl(n.x,i.offset.x),Yl(n.y,i.offset.y)),n}const k3=({current:e})=>e?e.ownerDocument.defaultView:null,Mre=new WeakMap;class Ire{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Wt(),this.visualElement=t}start(t,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(nh(c).point)},o=(c,d)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=pre(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Vn(g=>{let b=this.getAxisMotionValue(g).get()||0;if(Xi.test(b)){const{projection:y}=this.visualElement;if(y&&y.layout){const x=y.layout.layoutBox[g];x&&(b=Nn(x)*(parseFloat(b)/100))}}this.originPoint[g]=b}),m&&_t.postRender(()=>m(c,d)),XS(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(c,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:v}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:g}=d;if(p&&this.currentDirection===null){this.currentDirection=Rre(g),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,g),this.updateAxis("y",d.point,g),this.visualElement.render(),v&&v(c,d)},s=(c,d)=>this.stop(c,d),l=()=>Vn(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new C3(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:s,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:k3(this.visualElement)})}stop(t,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&_t.postRender(()=>o(t,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){const{drag:i}=this.getProps();if(!n||!Qh(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(a=Ere(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){var t;const{dragConstraints:r,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;r&&Kl(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=Cre(i.layoutBox,r):this.constraints=!1,this.elastic=_re(n),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Vn(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Ore(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Kl(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=kre(n,i.root,this.visualElement.getTransformPagePoint());let a=Are(i.layout.layoutBox,o);if(r){const s=r(jre(a));this.hasMutatedConstraints=!!s,s&&(a=_3(s))}return a}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=Vn(c=>{if(!Qh(c,r,this.currentDirection))return;let d=l&&l[c]||{};a&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:n?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(s)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return XS(this.visualElement,t),n.start(YC(t,n,0,r,this.visualElement,!1))}stopAnimation(){Vn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Vn(t=>{var r;return(r=this.getAxisMotionValue(t).animation)===null||r===void 0?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)===null||r===void 0?void 0:r.state}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Vn(r=>{const{drag:n}=this.getProps();if(!Qh(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(r);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[r];o.set(t[r]-Mt(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Kl(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Vn(a=>{const s=this.getAxisMotionValue(a);if(s&&this.constraints!==!1){const l=s.get();i[a]=Tre({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Vn(a=>{if(!Qh(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(Mt(l,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;Mre.set(this.visualElement,this);const t=this.visualElement.current,r=Qd(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();Kl(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),_t.read(n);const a=Ff(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Vn(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{a(),r(),o(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=QS,dragMomentum:s=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function Qh(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function Rre(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class $re extends ns{constructor(t){super(t),this.removeGroupControls=An,this.removeListeners=An,this.controls=new Ire(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||An}unmount(){this.removeGroupControls(),this.removeListeners()}}const pN=e=>(t,r)=>{e&&_t.postRender(()=>e(t,r))};class Lre extends ns{constructor(){super(...arguments),this.removePointerDownListener=An}onPointerDown(t){this.session=new C3(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:k3(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:pN(t),onStart:pN(r),onMove:n,onEnd:(o,a)=>{delete this.session,i&&_t.postRender(()=>i(o,a))}}}mount(){this.removePointerDownListener=Qd(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Jy=w.createContext(null);function Fre(){const e=w.useContext(Jy);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:r,register:n}=e,i=w.useId();w.useEffect(()=>n(i),[]);const o=w.useCallback(()=>r&&r(i),[i,r]);return!t&&r?[!1,o]:[!0]}const tA=w.createContext({}),M3=w.createContext({}),Fm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function hN(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const fd={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ie.test(e))e=parseFloat(e);else return e;const r=hN(e,t.target.x),n=hN(e,t.target.y);return`${r}% ${n}%`}},Bre={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,i=Ga.parse(e);if(i.length>5)return n;const o=Ga.createTransformer(e),a=typeof i[0]!="number"?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;i[0+a]/=s,i[1+a]/=l;const u=Mt(s,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),o(i)}},kv={};function Vre(e){Object.assign(kv,e)}const{schedule:rA,cancel:SIe}=IB(queueMicrotask,!1);class Ure extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;Vre(zre),o&&(r.group&&r.group.add(o),n&&n.register&&i&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Fm.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:i,isPresent:o}=this.props,a=n.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==r||r===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||_t.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),rA.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function I3(e){const[t,r]=Fre(),n=w.useContext(tA);return h.jsx(Ure,{...e,layoutGroup:n,switchLayoutGroup:w.useContext(M3),isPresent:t,safeToRemove:r})}const zre={borderRadius:{...fd,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:fd,borderTopRightRadius:fd,borderBottomLeftRadius:fd,borderBottomRightRadius:fd,boxShadow:Bre},R3=["TopLeft","TopRight","BottomLeft","BottomRight"],Wre=R3.length,mN=e=>typeof e=="string"?parseFloat(e):e,vN=e=>typeof e=="number"||Ie.test(e);function Hre(e,t,r,n,i,o){i?(e.opacity=Mt(0,r.opacity!==void 0?r.opacity:1,Gre(n)),e.opacityExit=Mt(t.opacity!==void 0?t.opacity:1,0,Kre(n))):o&&(e.opacity=Mt(t.opacity!==void 0?t.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let a=0;ant?1:r(Gu(e,t,n))}function yN(e,t){e.min=t.min,e.max=t.max}function $n(e,t){yN(e.x,t.x),yN(e.y,t.y)}function bN(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function xN(e,t,r,n,i){return e-=t,e=Dv(e,1/r,n),i!==void 0&&(e=Dv(e,1/i,n)),e}function qre(e,t=0,r=1,n=.5,i,o=e,a=e){if(Xi.test(t)&&(t=parseFloat(t),t=Mt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=Mt(o.min,o.max,n);e===o&&(s-=t),e.min=xN(e.min,t,r,s,i),e.max=xN(e.max,t,r,s,i)}function wN(e,t,[r,n,i],o,a){qre(e,t[r],t[n],t[i],t.scale,o,a)}const Yre=["x","scaleX","originX"],Xre=["y","scaleY","originY"];function SN(e,t,r,n){wN(e.x,t,Yre,r?r.x:void 0,n?n.x:void 0),wN(e.y,t,Xre,r?r.y:void 0,n?n.y:void 0)}function PN(e){return e.translate===0&&e.scale===1}function L3(e){return PN(e.x)&&PN(e.y)}function EN(e,t){return e.min===t.min&&e.max===t.max}function Zre(e,t){return EN(e.x,t.x)&&EN(e.y,t.y)}function CN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function F3(e,t){return CN(e.x,t.x)&&CN(e.y,t.y)}function AN(e){return Nn(e.x)/Nn(e.y)}function TN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Qre{constructor(){this.members=[]}add(t){XC(this.members,t),t.scheduleRender()}remove(t){if(ZC(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){const r=this.members.findIndex(i=>t===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){n=o;break}}return n?(this.promote(n),!0):!1}promote(t,r){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Jre(e,t,r){let n="";const i=e.x.translate/t.x,o=e.y.translate/t.y,a=(r==null?void 0:r.z)||0;if((i||o||a)&&(n=`translate3d(${i}px, ${o}px, ${a}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:p,skewY:m}=r;u&&(n=`perspective(${u}px) ${n}`),c&&(n+=`rotate(${c}deg) `),d&&(n+=`rotateX(${d}deg) `),f&&(n+=`rotateY(${f}deg) `),p&&(n+=`skewX(${p}deg) `),m&&(n+=`skewY(${m}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return(s!==1||l!==1)&&(n+=`scale(${s}, ${l})`),n||"none"}const ene=(e,t)=>e.depth-t.depth;class tne{constructor(){this.children=[],this.isDirty=!1}add(t){XC(this.children,t),this.isDirty=!0}remove(t){ZC(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ene),this.isDirty=!1,this.children.forEach(t)}}function Bm(e){const t=Or(e)?e.get():e;return Fte(t)?t.toValue():t}function rne(e,t){const r=Zi.now(),n=({timestamp:i})=>{const o=i-r;o>=t&&(Ha(n),e(o-t))};return _t.read(n,!0),()=>Ha(n)}function nne(e){return e instanceof SVGElement&&e.tagName!=="svg"}function ine(e,t,r){const n=Or(e)?e:Lf(e);return n.start(YC("",n,t,r)),n.animation}const xs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Dd=typeof window<"u"&&window.MotionDebug!==void 0,w0=["","X","Y","Z"],one={visibility:"hidden"},ON=1e3;let ane=0;function S0(e,t,r,n){const{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function B3(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=b3(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",_t,!(i||o))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&B3(n)}function V3({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(a={},s=t==null?void 0:t()){this.id=ane++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Dd&&(xs.totalNodes=xs.resolvedTargetDeltas=xs.recalculatedProjection=0),this.nodes.forEach(une),this.nodes.forEach(hne),this.nodes.forEach(mne),this.nodes.forEach(cne),Dd&&window.MotionDebug.record(xs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=rne(f,250),Fm.hasAnimatedSinceResize&&(Fm.hasAnimatedSinceResize=!1,this.nodes.forEach(jN))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||c.getDefaultTransition()||xne,{onLayoutAnimationStart:g,onLayoutAnimationComplete:b}=c.getProps(),y=!this.targetLayout||!F3(this.targetLayout,m)||p,x=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,x);const P={...IC(v,"layout"),onPlay:g,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P)}else f||jN(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ha(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(vne),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&B3(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const S=P/1e3;NN(d.x,a.x,S),NN(d.y,a.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ef(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),yne(this.relativeTarget,this.relativeTargetOrigin,f,S),x&&Zre(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Wt()),$n(x,this.relativeTarget)),v&&(this.animationValues=c,Hre(c,u,this.latestValues,S,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ha(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_t.update(()=>{Fm.hasAnimatedSinceResize=!0,this.currentAnimation=ine(0,ON,{...a,onUpdate:s=>{this.mixTargetDelta(s),a.onUpdate&&a.onUpdate(s)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ON),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&U3(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Wt();const d=Nn(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+d;const f=Nn(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+f}$n(s,l),Xl(s,c),Jd(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new Qre),this.sharedNodes.get(a).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(s=!0),!s)return;const u={};l.z&&S0("z",a,u,this.animationValues);for(let c=0;c{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(_N),this.root.sharedNodes.clear()}}}function sne(e){e.updateLayout()}function lne(e){var t;const r=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:o}=e.options,a=r.source!==e.layout.source;o==="size"?Vn(d=>{const f=a?r.measuredBox[d]:r.layoutBox[d],p=Nn(f);f.min=n[d].min,f.max=f.min+p}):U3(o,r.layoutBox,n)&&Vn(d=>{const f=a?r.measuredBox[d]:r.layoutBox[d],p=Nn(n[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const s=ql();Jd(s,n,r.layoutBox);const l=ql();a?Jd(l,e.applyTransform(i,!0),r.measuredBox):Jd(l,n,r.layoutBox);const u=!L3(s);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const m=Wt();ef(m,r.layoutBox,f.layoutBox);const v=Wt();ef(v,n,p.layoutBox),F3(m,v)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function une(e){Dd&&xs.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function cne(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function dne(e){e.clearSnapshot()}function _N(e){e.clearMeasurements()}function fne(e){e.isLayoutDirty=!1}function pne(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function jN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function hne(e){e.resolveTargetDelta()}function mne(e){e.calcProjection()}function vne(e){e.resetSkewAndRotation()}function gne(e){e.removeLeadSnapshot()}function NN(e,t,r){e.translate=Mt(t.translate,0,r),e.scale=Mt(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function DN(e,t,r,n){e.min=Mt(t.min,r.min,n),e.max=Mt(t.max,r.max,n)}function yne(e,t,r,n){DN(e.x,t.x,r.x,n),DN(e.y,t.y,r.y,n)}function bne(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const xne={duration:.45,ease:[.4,0,.1,1]},kN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),MN=kN("applewebkit/")&&!kN("chrome/")?Math.round:An;function IN(e){e.min=MN(e.min),e.max=MN(e.max)}function wne(e){IN(e.x),IN(e.y)}function U3(e,t,r){return e==="position"||e==="preserve-aspect"&&!Sre(AN(t),AN(r),.2)}function Sne(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const Pne=V3({attachResizeListener:(e,t)=>Ff(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),P0={current:void 0},z3=V3({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!P0.current){const e=new Pne({});e.mount(window),e.setOptions({layoutScroll:!0}),P0.current=e}return P0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ene={pan:{Feature:Lre},drag:{Feature:$re,ProjectionNode:z3,MeasureLayout:I3}};function RN(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const i="onHover"+r,o=n[i];o&&_t.postRender(()=>o(t,nh(t)))}class Cne extends ns{mount(){const{current:t}=this.node;t&&(this.unmount=lre(t,r=>(RN(this.node,r,"Start"),n=>RN(this.node,n,"End"))))}unmount(){}}class Ane extends ns{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=rh(Ff(this.node.current,"focus",()=>this.onFocus()),Ff(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function $N(e,t,r){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const i="onTap"+(r==="End"?"":r),o=n[i];o&&_t.postRender(()=>o(t,nh(t)))}class Tne extends ns{mount(){const{current:t}=this.node;t&&(this.unmount=fre(t,r=>($N(this.node,r,"Start"),(n,{success:i})=>$N(this.node,n,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const t1=new WeakMap,E0=new WeakMap,One=e=>{const t=t1.get(e.target);t&&t(e)},_ne=e=>{e.forEach(One)};function jne({root:e,...t}){const r=e||document;E0.has(r)||E0.set(r,{});const n=E0.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(_ne,{root:e,...t})),n[i]}function Nne(e,t,r){const n=jne(t);return t1.set(e,r),n.observe(e),()=>{t1.delete(e),n.unobserve(e)}}const Dne={some:0,all:1};class kne extends ns{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:o}=t,a={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:Dne[i]},s=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return Nne(this.node.current,a,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(Mne(t,r))&&this.startObserver()}unmount(){}}function Mne({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const Ine={inView:{Feature:kne},tap:{Feature:Tne},focus:{Feature:Ane},hover:{Feature:Cne}},Rne={layout:{ProjectionNode:z3,MeasureLayout:I3}},nA=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),eb=w.createContext({}),iA=typeof window<"u",W3=iA?w.useLayoutEffect:w.useEffect,H3=w.createContext({strict:!1});function $ne(e,t,r,n,i){var o,a;const{visualElement:s}=w.useContext(eb),l=w.useContext(H3),u=w.useContext(Jy),c=w.useContext(nA).reducedMotion,d=w.useRef(null);n=n||l.renderer,!d.current&&n&&(d.current=n(e,{visualState:t,parent:s,props:r,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=d.current,p=w.useContext(M3);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Lne(d.current,r,i,p);const m=w.useRef(!1);w.useInsertionEffect(()=>{f&&m.current&&f.update(r,u)});const v=r[y3],g=w.useRef(!!v&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,v))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,v)));return W3(()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),rA.render(f.render),g.current&&f.animationState&&f.animationState.animateChanges())}),w.useEffect(()=>{f&&(!g.current&&f.animationState&&f.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,v)}),g.current=!1))}),f}function Lne(e,t,r,n){const{layoutId:i,layout:o,drag:a,dragConstraints:s,layoutScroll:l,layoutRoot:u}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:G3(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!a||s&&Kl(s),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:u})}function G3(e){if(e)return e.options.allowProjection!==!1?e.projection:G3(e.parent)}function Fne(e,t,r){return w.useCallback(n=>{n&&e.mount&&e.mount(n),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):Kl(r)&&(r.current=n))},[t])}function tb(e){return Xy(e.animate)||MC.some(t=>If(e[t]))}function K3(e){return!!(tb(e)||e.variants)}function Bne(e,t){if(tb(e)){const{initial:r,animate:n}=e;return{initial:r===!1||If(r)?r:void 0,animate:If(n)?n:void 0}}return e.inherit!==!1?t:{}}function Vne(e){const{initial:t,animate:r}=Bne(e,w.useContext(eb));return w.useMemo(()=>({initial:t,animate:r}),[LN(t),LN(r)])}function LN(e){return Array.isArray(e)?e.join(" "):e}const FN={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ku={};for(const e in FN)Ku[e]={isEnabled:t=>FN[e].some(r=>!!t[r])};function Une(e){for(const t in e)Ku[t]={...Ku[t],...e[t]}}const zne=Symbol.for("motionComponentSymbol");function Wne({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:n,Component:i}){e&&Une(e);function o(s,l){let u;const c={...w.useContext(nA),...s,layoutId:Hne(s)},{isStatic:d}=c,f=Vne(s),p=n(s,d);if(!d&&iA){Gne();const m=Kne(c);u=m.MeasureLayout,f.visualElement=$ne(i,p,c,t,m.ProjectionNode)}return h.jsxs(eb.Provider,{value:f,children:[u&&f.visualElement?h.jsx(u,{visualElement:f.visualElement,...c}):null,r(i,s,Fne(p,f.visualElement,l),p,d,f.visualElement)]})}const a=w.forwardRef(o);return a[zne]=i,a}function Hne({layoutId:e}){const t=w.useContext(tA).id;return t&&e!==void 0?t+"-"+e:e}function Gne(e,t){w.useContext(H3).strict}function Kne(e){const{drag:t,layout:r}=Ku;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:t!=null&&t.isEnabled(e)||r!=null&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}const qne=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function oA(e){return typeof e!="string"||e.includes("-")?!1:!!(qne.indexOf(e)>-1||/[A-Z]/u.test(e))}function q3(e,{style:t,vars:r},n,i){Object.assign(e.style,t,i&&i.getProjectionStyles(n));for(const o in r)e.style.setProperty(o,r[o])}const Y3=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function X3(e,t,r,n){q3(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(Y3.has(i)?i:JC(i),t.attrs[i])}function Z3(e,{layout:t,layoutId:r}){return hl.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!kv[e]||e==="opacity")}function aA(e,t,r){var n;const{style:i}=e,o={};for(const a in i)(Or(i[a])||t.style&&Or(t.style[a])||Z3(a,e)||((n=r==null?void 0:r.getValue(a))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(o[a]=i[a]);return o}function Q3(e,t,r){const n=aA(e,t,r);for(const i in e)if(Or(e[i])||Or(t[i])){const o=Jp.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[o]=e[i]}return n}function sA(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}function Yne({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:r},n,i,o){const a={latestValues:Xne(n,i,o,e),renderState:t()};return r&&(a.mount=s=>r(n,s,a)),a}const J3=e=>(t,r)=>{const n=w.useContext(eb),i=w.useContext(Jy),o=()=>Yne(e,t,n,i);return r?o():sA(o)};function Xne(e,t,r,n){const i={},o=n(e,{});for(const f in o)i[f]=Bm(o[f]);let{initial:a,animate:s}=e;const l=tb(e),u=K3(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let c=r?r.initial===!1:!1;c=c||a===!1;const d=c?s:a;if(d&&typeof d!="boolean"&&!Xy(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p({style:{},transform:{},transformOrigin:{},vars:{}}),eV=()=>({...lA(),attrs:{}}),tV=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Zne={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Qne=Jp.length;function Jne(e,t,r){let n="",i=!0;for(let o=0;otypeof e=="string"&&e.toLowerCase()==="svg",iie={useVisualState:J3({scrapeMotionValuesFromProps:Q3,createRenderState:eV,onMount:(e,t,{renderState:r,latestValues:n})=>{_t.read(()=>{try{r.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),_t.render(()=>{cA(r,n,dA(t.tagName),e.transformTemplate),X3(t,r)})}})},oie={useVisualState:J3({scrapeMotionValuesFromProps:aA,createRenderState:lA})};function rV(e,t,r){for(const n in t)!Or(t[n])&&!Z3(n,r)&&(e[n]=t[n])}function aie({transformTemplate:e},t){return w.useMemo(()=>{const r=lA();return uA(r,t,e),Object.assign({},r.vars,r.style)},[t])}function sie(e,t){const r=e.style||{},n={};return rV(n,r,e),Object.assign(n,aie(e,t)),n}function lie(e,t){const r={},n=sie(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}const uie=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Mv(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||uie.has(e)}let nV=e=>!Mv(e);function cie(e){e&&(nV=t=>t.startsWith("on")?!Mv(t):e(t))}try{cie(require("@emotion/is-prop-valid").default)}catch{}function die(e,t,r){const n={};for(const i in e)i==="values"&&typeof e.values=="object"||(nV(i)||r===!0&&Mv(i)||!t&&!Mv(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}function fie(e,t,r,n){const i=w.useMemo(()=>{const o=eV();return cA(o,t,dA(n),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};rV(o,e.style,e),i.style={...o,...i.style}}return i}function pie(e=!1){return(r,n,i,{latestValues:o},a)=>{const l=(oA(r)?fie:lie)(n,o,a,r),u=die(n,typeof r=="string",e),c=r!==w.Fragment?{...u,...l,ref:i}:{},{children:d}=n,f=w.useMemo(()=>Or(d)?d.get():d,[d]);return w.createElement(r,{...c,children:f})}}function hie(e,t){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){const a={...oA(n)?iie:oie,preloadedFeatures:e,useRender:pie(i),createVisualElement:t,Component:n};return Wne(a)}}const r1={current:null},iV={current:!1};function mie(){if(iV.current=!0,!!iA)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>r1.current=e.matches;e.addListener(t),t()}else r1.current=!1}function vie(e,t,r){for(const n in t){const i=t[n],o=r[n];if(Or(i))e.addValue(n,i);else if(Or(o))e.addValue(n,Lf(i,{owner:e}));else if(o!==i)if(e.hasValue(n)){const a=e.getValue(n);a.liveStyle===!0?a.jump(i):a.hasAnimated||a.set(i)}else{const a=e.getStaticValue(n);e.addValue(n,Lf(a!==void 0?a:i,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const VN=new WeakMap,gie=[...XB,Er,Ga],yie=e=>gie.find(YB(e)),UN=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class bie{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:o,visualState:a},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=FC,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Zi.now();this.renderScheduledAtthis.bindToMotionValue(n,r)),iV.current||mie(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:r1.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){VN.delete(this.current),this.projection&&this.projection.unmount(),Ha(this.notifyUpdate),Ha(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=hl.has(t),i=r.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&_t.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),o=r.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{i(),o(),a&&a(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ku){const r=Ku[t];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Wt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(t)}addValue(t,r){const n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=Lf(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){var n;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(HB(i)||WB(i))?i=parseFloat(i):!yie(i)&&Ga.test(r)&&(i=i3(t,r)),this.setBaseTarget(t,Or(i)?i.get():i)),Or(i)?i.get():i}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var r;const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const a=DC(this.props,n,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);a&&(i=a[t])}if(n&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Or(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new QC),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}}class oV extends bie{constructor(){super(...arguments),this.KeyframeResolver=o3}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Or(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function xie(e){return window.getComputedStyle(e)}class wie extends oV{constructor(){super(...arguments),this.type="html",this.renderInstance=q3}readValueFromInstance(t,r){if(hl.has(r)){const n=zC(r);return n&&n.default||0}else{const n=xie(t),i=(KB(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:r}){return D3(t,r)}build(t,r,n){uA(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return aA(t,r,n)}}class Sie extends oV{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Wt}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(hl.has(r)){const n=zC(r);return n&&n.default||0}return r=Y3.has(r)?r:JC(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return Q3(t,r,n)}build(t,r,n){cA(t,r,this.isSVGTag,n.transformTemplate)}renderInstance(t,r,n,i){X3(t,r,n,i)}mount(t){this.isSVGTag=dA(t.tagName),super.mount(t)}}const Pie=(e,t)=>oA(e)?new Sie(t):new wie(t,{allowProjection:e!==w.Fragment}),Eie=hie({...are,...Ine,...Ene,...Rne},Pie),Iv=iee(Eie);class Cie extends w.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Aie({children:e,isPresent:t}){const r=w.useId(),n=w.useRef(null),i=w.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=w.useContext(nA);return w.useInsertionEffect(()=>{const{width:a,height:s,top:l,left:u}=i.current;if(t||!n.current||!a||!s)return;n.current.dataset.motionPopId=r;const c=document.createElement("style");return o&&(c.nonce=o),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${a}px !important; height: ${s}px !important; top: ${l}px !important; left: ${u}px !important; } `),()=>{document.head.removeChild(c)}},[t]),h.jsx(Cie,{isPresent:t,childRef:n,sizeRef:i,children:w.cloneElement(e,{ref:n})})}const Tie=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=sA(Oie),l=w.useId(),u=w.useCallback(d=>{s.set(d,!0);for(const f of s.values())if(!f)return;n&&n()},[s,n]),c=w.useMemo(()=>({id:l,initial:t,isPresent:r,custom:i,onExitComplete:u,register:d=>(s.set(d,!1),()=>s.delete(d))}),o?[Math.random(),u]:[r,u]);return w.useMemo(()=>{s.forEach((d,f)=>s.set(f,!1))},[r]),w.useEffect(()=>{!r&&!s.size&&n&&n()},[r]),a==="popLayout"&&(e=h.jsx(Aie,{isPresent:r,children:e})),h.jsx(Jy.Provider,{value:c,children:e})};function Oie(){return new Map}const Jh=e=>e.key||"";function zN(e){const t=[];return w.Children.forEach(e,r=>{w.isValidElement(r)&&t.push(r)}),t}const aV=({children:e,exitBeforeEnter:t,custom:r,initial:n=!0,onExitComplete:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{const s=w.useMemo(()=>zN(e),[e]),l=s.map(Jh),u=w.useRef(!0),c=w.useRef(s),d=sA(()=>new Map),[f,p]=w.useState(s),[m,v]=w.useState(s);W3(()=>{u.current=!1,c.current=s;for(let y=0;y{const x=Jh(y),P=s===m||l.includes(x),S=()=>{if(d.has(x))d.set(x,!0);else return;let E=!0;d.forEach(C=>{C||(E=!1)}),E&&(b==null||b(),v(c.current),i&&i())};return h.jsx(Tie,{isPresent:P,initial:!u.current||n?void 0:!1,custom:P?void 0:r,presenceAffectsLayout:o,mode:a,onExitComplete:P?void 0:S,children:y},x)})})};var ih={};(function e(t,r,n,i){var o=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),a=typeof Path2D=="function"&&typeof DOMMatrix=="function",s=function(){if(!t.OffscreenCanvas)return!1;var _=new OffscreenCanvas(1,1),O=_.getContext("2d");O.fillRect(0,0,1,1);var z=_.transferToImageBitmap();try{O.createPattern(z,"no-repeat")}catch{return!1}return!0}();function l(){}function u(_){var O=r.exports.Promise,z=O!==void 0?O:t.Promise;return typeof z=="function"?new z(_):(_(l,l),null)}var c=function(_,O){return{transform:function(z){if(_)return z;if(O.has(z))return O.get(z);var Y=new OffscreenCanvas(z.width,z.height),re=Y.getContext("2d");return re.drawImage(z,0,0),O.set(z,Y),Y},clear:function(){O.clear()}}}(s,new Map),d=function(){var _=Math.floor(16.666666666666668),O,z,Y={},re=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(O=function(se){var de=Math.random();return Y[de]=requestAnimationFrame(function X(oe){re===oe||re+_-1{const a=n?Lo:"button";return h.jsx(a,{className:Me(fA({variant:t,size:r,className:e})),ref:o,...i})});Ne.displayName="Button";var jie=w.createContext(void 0);function pA(e){const t=w.useContext(jie);return e||t||"ltr"}var C0=0;function hA(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??WN()),document.body.insertAdjacentElement("beforeend",e[1]??WN()),C0++,()=>{C0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),C0--}},[])}function WN(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var A0="focusScope.autoFocusOnMount",T0="focusScope.autoFocusOnUnmount",HN={bubbles:!1,cancelable:!0},Nie="FocusScope",rb=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=w.useState(null),u=jr(i),c=jr(o),d=w.useRef(null),f=st(t,v=>l(v)),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let v=function(x){if(p.paused||!s)return;const P=x.target;s.contains(P)?d.current=P:ua(d.current,{select:!0})},g=function(x){if(p.paused||!s)return;const P=x.relatedTarget;P!==null&&(s.contains(P)||ua(d.current,{select:!0}))},b=function(x){if(document.activeElement===document.body)for(const S of x)S.removedNodes.length>0&&ua(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",g);const y=new MutationObserver(b);return s&&y.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",g),y.disconnect()}}},[n,s,p.paused]),w.useEffect(()=>{if(s){KN.add(p);const v=document.activeElement;if(!s.contains(v)){const b=new CustomEvent(A0,HN);s.addEventListener(A0,u),s.dispatchEvent(b),b.defaultPrevented||(Die($ie(sV(s)),{select:!0}),document.activeElement===v&&ua(s))}return()=>{s.removeEventListener(A0,u),setTimeout(()=>{const b=new CustomEvent(T0,HN);s.addEventListener(T0,c),s.dispatchEvent(b),b.defaultPrevented||ua(v??document.body,{select:!0}),s.removeEventListener(T0,c),KN.remove(p)},0)}}},[s,u,c,p]);const m=w.useCallback(v=>{if(!r&&!n||p.paused)return;const g=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(g&&b){const y=v.currentTarget,[x,P]=kie(y);x&&P?!v.shiftKey&&b===P?(v.preventDefault(),r&&ua(x,{select:!0})):v.shiftKey&&b===x&&(v.preventDefault(),r&&ua(P,{select:!0})):b===y&&v.preventDefault()}},[r,n,p.paused]);return h.jsx(Ke.div,{tabIndex:-1,...a,ref:f,onKeyDown:m})});rb.displayName=Nie;function Die(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ua(n,{select:t}),document.activeElement!==r)return}function kie(e){const t=sV(e),r=GN(t,e),n=GN(t.reverse(),e);return[r,n]}function sV(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function GN(e,t){for(const r of e)if(!Mie(r,{upTo:t}))return r}function Mie(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Iie(e){return e instanceof HTMLInputElement&&"select"in e}function ua(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Iie(e)&&t&&e.select()}}var KN=Rie();function Rie(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=qN(e,t),e.unshift(t)},remove(t){var r;e=qN(e,t),(r=e[0])==null||r.resume()}}}function qN(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function $ie(e){return e.filter(t=>t.tagName!=="A")}var Lie=FR.useId||(()=>{}),Fie=0;function Oo(e){const[t,r]=w.useState(Lie());return Nr(()=>{r(n=>n??String(Fie++))},[e]),t?`radix-${t}`:""}const Bie=["top","right","bottom","left"],Ka=Math.min,gn=Math.max,Rv=Math.round,em=Math.floor,Qi=e=>({x:e,y:e}),Vie={left:"right",right:"left",bottom:"top",top:"bottom"},Uie={start:"end",end:"start"};function n1(e,t,r){return gn(e,Ka(t,r))}function Bo(e,t){return typeof e=="function"?e(t):e}function Vo(e){return e.split("-")[0]}function jc(e){return e.split("-")[1]}function mA(e){return e==="x"?"y":"x"}function vA(e){return e==="y"?"height":"width"}function qa(e){return["top","bottom"].includes(Vo(e))?"y":"x"}function gA(e){return mA(qa(e))}function zie(e,t,r){r===void 0&&(r=!1);const n=jc(e),i=gA(e),o=vA(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=$v(a)),[a,$v(a)]}function Wie(e){const t=$v(e);return[i1(e),t,i1(t)]}function i1(e){return e.replace(/start|end/g,t=>Uie[t])}function Hie(e,t,r){const n=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:n:t?n:i;case"left":case"right":return t?o:a;default:return[]}}function Gie(e,t,r,n){const i=jc(e);let o=Hie(Vo(e),r==="start",n);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(i1)))),o}function $v(e){return e.replace(/left|right|bottom|top/g,t=>Vie[t])}function Kie(e){return{top:0,right:0,bottom:0,left:0,...e}}function lV(e){return typeof e!="number"?Kie(e):{top:e,right:e,bottom:e,left:e}}function Lv(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function YN(e,t,r){let{reference:n,floating:i}=e;const o=qa(t),a=gA(t),s=vA(a),l=Vo(t),u=o==="y",c=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,f=n[s]/2-i[s]/2;let p;switch(l){case"top":p={x:c,y:n.y-i.height};break;case"bottom":p={x:c,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:d};break;case"left":p={x:n.x-i.width,y:d};break;default:p={x:n.x,y:n.y}}switch(jc(t)){case"start":p[a]-=f*(r&&u?-1:1);break;case"end":p[a]+=f*(r&&u?-1:1);break}return p}const qie=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=YN(u,n,l),f=n,p={},m=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=Bo(e,t)||{};if(u==null)return{};const d=lV(c),f={x:r,y:n},p=gA(i),m=vA(p),v=await a.getDimensions(u),g=p==="y",b=g?"top":"left",y=g?"bottom":"right",x=g?"clientHeight":"clientWidth",P=o.reference[m]+o.reference[p]-f[p]-o.floating[m],S=f[p]-o.reference[p],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let C=E?E[x]:0;(!C||!await(a.isElement==null?void 0:a.isElement(E)))&&(C=s.floating[x]||o.floating[m]);const A=P/2-S/2,T=C/2-v[m]/2-1,D=Ka(d[b],T),N=Ka(d[y],T),j=D,L=C-v[m]-N,k=C/2-v[m]/2+A,V=n1(j,k,L),B=!l.arrow&&jc(i)!=null&&k!==V&&o.reference[m]/2-(kk<=0)){var N,j;const k=(((N=o.flip)==null?void 0:N.index)||0)+1,V=C[k];if(V)return{data:{index:k,overflows:D},reset:{placement:V}};let B=(j=D.filter(U=>U.overflows[0]<=0).sort((U,I)=>U.overflows[1]-I.overflows[1])[0])==null?void 0:j.placement;if(!B)switch(p){case"bestFit":{var L;const U=(L=D.filter(I=>{if(E){const $=qa(I.placement);return $===y||$==="y"}return!0}).map(I=>[I.placement,I.overflows.filter($=>$>0).reduce(($,_)=>$+_,0)]).sort((I,$)=>I[1]-$[1])[0])==null?void 0:L[0];U&&(B=U);break}case"initialPlacement":B=s;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function XN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ZN(e){return Bie.some(t=>e[t]>=0)}const Zie=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=Bo(e,t);switch(n){case"referenceHidden":{const o=await Bf(t,{...i,elementContext:"reference"}),a=XN(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ZN(a)}}}case"escaped":{const o=await Bf(t,{...i,altBoundary:!0}),a=XN(o,r.floating);return{data:{escapedOffsets:a,escaped:ZN(a)}}}default:return{}}}}};async function Qie(e,t){const{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=Vo(r),s=jc(r),l=qa(r)==="y",u=["left","top"].includes(a)?-1:1,c=o&&l?-1:1,d=Bo(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*c,y:f*u}:{x:f*u,y:p*c}}const Jie=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await Qie(t,e);return a===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},eoe=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:g=>{let{x:b,y}=g;return{x:b,y}}},...l}=Bo(e,t),u={x:r,y:n},c=await Bf(t,l),d=qa(Vo(i)),f=mA(d);let p=u[f],m=u[d];if(o){const g=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=p+c[g],x=p-c[b];p=n1(y,p,x)}if(a){const g=d==="y"?"top":"left",b=d==="y"?"bottom":"right",y=m+c[g],x=m-c[b];m=n1(y,m,x)}const v=s.fn({...t,[f]:p,[d]:m});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[f]:o,[d]:a}}}}}},toe=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=Bo(e,t),c={x:r,y:n},d=qa(i),f=mA(d);let p=c[f],m=c[d];const v=Bo(s,t),g=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const x=f==="y"?"height":"width",P=o.reference[f]-o.floating[x]+g.mainAxis,S=o.reference[f]+o.reference[x]-g.mainAxis;pS&&(p=S)}if(u){var b,y;const x=f==="y"?"width":"height",P=["top","left"].includes(Vo(i)),S=o.reference[d]-o.floating[x]+(P&&((b=a.offset)==null?void 0:b[d])||0)+(P?0:g.crossAxis),E=o.reference[d]+o.reference[x]+(P?0:((y=a.offset)==null?void 0:y[d])||0)-(P?g.crossAxis:0);mE&&(m=E)}return{[f]:p,[d]:m}}}},roe=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:o,platform:a,elements:s}=t,{apply:l=()=>{},...u}=Bo(e,t),c=await Bf(t,u),d=Vo(i),f=jc(i),p=qa(i)==="y",{width:m,height:v}=o.floating;let g,b;d==="top"||d==="bottom"?(g=d,b=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=d,g=f==="end"?"top":"bottom");const y=v-c.top-c.bottom,x=m-c.left-c.right,P=Ka(v-c[g],y),S=Ka(m-c[b],x),E=!t.middlewareData.shift;let C=P,A=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(A=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=y),E&&!f){const D=gn(c.left,0),N=gn(c.right,0),j=gn(c.top,0),L=gn(c.bottom,0);p?A=m-2*(D!==0||N!==0?D+N:gn(c.left,c.right)):C=v-2*(j!==0||L!==0?j+L:gn(c.top,c.bottom))}await l({...t,availableWidth:A,availableHeight:C});const T=await a.getDimensions(s.floating);return m!==T.width||v!==T.height?{reset:{rects:!0}}:{}}}};function nb(){return typeof window<"u"}function Nc(e){return uV(e)?(e.nodeName||"").toLowerCase():"#document"}function Tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ao(e){var t;return(t=(uV(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function uV(e){return nb()?e instanceof Node||e instanceof Tn(e).Node:!1}function Ni(e){return nb()?e instanceof Element||e instanceof Tn(e).Element:!1}function no(e){return nb()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function QN(e){return!nb()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}function oh(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Di(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function noe(e){return["table","td","th"].includes(Nc(e))}function ib(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function yA(e){const t=bA(),r=Ni(e)?Di(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function ioe(e){let t=Ya(e);for(;no(t)&&!qu(t);){if(yA(t))return t;if(ib(t))return null;t=Ya(t)}return null}function bA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function qu(e){return["html","body","#document"].includes(Nc(e))}function Di(e){return Tn(e).getComputedStyle(e)}function ob(e){return Ni(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ya(e){if(Nc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||QN(e)&&e.host||ao(e);return QN(t)?t.host:t}function cV(e){const t=Ya(e);return qu(t)?e.ownerDocument?e.ownerDocument.body:e.body:no(t)&&oh(t)?t:cV(t)}function Vf(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=cV(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),a=Tn(i);if(o){const s=o1(a);return t.concat(a,a.visualViewport||[],oh(i)?i:[],s&&r?Vf(s):[])}return t.concat(i,Vf(i,[],r))}function o1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dV(e){const t=Di(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=no(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=Rv(r)!==o||Rv(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function xA(e){return Ni(e)?e:e.contextElement}function fu(e){const t=xA(e);if(!no(t))return Qi(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=dV(t);let a=(o?Rv(r.width):r.width)/n,s=(o?Rv(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const ooe=Qi(0);function fV(e){const t=Tn(e);return!bA()||!t.visualViewport?ooe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function aoe(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Tn(e)?!1:t}function il(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=xA(e);let a=Qi(1);t&&(n?Ni(n)&&(a=fu(n)):a=fu(e));const s=aoe(o,r,n)?fV(o):Qi(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,c=i.width/a.x,d=i.height/a.y;if(o){const f=Tn(o),p=n&&Ni(n)?Tn(n):n;let m=f,v=o1(m);for(;v&&n&&p!==m;){const g=fu(v),b=v.getBoundingClientRect(),y=Di(v),x=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*g.x,P=b.top+(v.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,d*=g.y,l+=x,u+=P,m=Tn(v),v=o1(m)}}return Lv({width:c,height:d,x:l,y:u})}function wA(e,t){const r=ob(e).scrollLeft;return t?t.left+r:il(ao(e)).left+r}function pV(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-(r?0:wA(e,n)),o=n.top+t.scrollTop;return{x:i,y:o}}function soe(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o=i==="fixed",a=ao(n),s=t?ib(t.floating):!1;if(n===a||s&&o)return r;let l={scrollLeft:0,scrollTop:0},u=Qi(1);const c=Qi(0),d=no(n);if((d||!d&&!o)&&((Nc(n)!=="body"||oh(a))&&(l=ob(n)),no(n))){const p=il(n);u=fu(n),c.x=p.x+n.clientLeft,c.y=p.y+n.clientTop}const f=a&&!d&&!o?pV(a,l,!0):Qi(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}}function loe(e){return Array.from(e.getClientRects())}function uoe(e){const t=ao(e),r=ob(e),n=e.ownerDocument.body,i=gn(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=gn(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+wA(e);const s=-r.scrollTop;return Di(n).direction==="rtl"&&(a+=gn(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:a,y:s}}function coe(e,t){const r=Tn(e),n=ao(e),i=r.visualViewport;let o=n.clientWidth,a=n.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const u=bA();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function doe(e,t){const r=il(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=no(e)?fu(e):Qi(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=i*o.x,u=n*o.y;return{width:a,height:s,x:l,y:u}}function JN(e,t,r){let n;if(t==="viewport")n=coe(e,r);else if(t==="document")n=uoe(ao(e));else if(Ni(t))n=doe(t,r);else{const i=fV(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Lv(n)}function hV(e,t){const r=Ya(e);return r===t||!Ni(r)||qu(r)?!1:Di(r).position==="fixed"||hV(r,t)}function foe(e,t){const r=t.get(e);if(r)return r;let n=Vf(e,[],!1).filter(s=>Ni(s)&&Nc(s)!=="body"),i=null;const o=Di(e).position==="fixed";let a=o?Ya(e):e;for(;Ni(a)&&!qu(a);){const s=Di(a),l=yA(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||oh(a)&&!l&&hV(e,a))?n=n.filter(c=>c!==a):i=s,a=Ya(a)}return t.set(e,n),n}function poe(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const a=[...r==="clippingAncestors"?ib(t)?[]:foe(t,this._c):[].concat(r),n],s=a[0],l=a.reduce((u,c)=>{const d=JN(t,c,i);return u.top=gn(d.top,u.top),u.right=Ka(d.right,u.right),u.bottom=Ka(d.bottom,u.bottom),u.left=gn(d.left,u.left),u},JN(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function hoe(e){const{width:t,height:r}=dV(e);return{width:t,height:r}}function moe(e,t,r){const n=no(t),i=ao(t),o=r==="fixed",a=il(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Qi(0);if(n||!n&&!o)if((Nc(t)!=="body"||oh(i))&&(s=ob(t)),n){const f=il(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=wA(i));const u=i&&!n&&!o?pV(i,s):Qi(0),c=a.left+s.scrollLeft-l.x-u.x,d=a.top+s.scrollTop-l.y-u.y;return{x:c,y:d,width:a.width,height:a.height}}function O0(e){return Di(e).position==="static"}function eD(e,t){if(!no(e)||Di(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ao(e)===r&&(r=r.ownerDocument.body),r}function mV(e,t){const r=Tn(e);if(ib(e))return r;if(!no(e)){let i=Ya(e);for(;i&&!qu(i);){if(Ni(i)&&!O0(i))return i;i=Ya(i)}return r}let n=eD(e,t);for(;n&&noe(n)&&O0(n);)n=eD(n,t);return n&&qu(n)&&O0(n)&&!yA(n)?r:n||ioe(e)||r}const voe=async function(e){const t=this.getOffsetParent||mV,r=this.getDimensions,n=await r(e.floating);return{reference:moe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function goe(e){return Di(e).direction==="rtl"}const yoe={convertOffsetParentRelativeRectToViewportRelativeRect:soe,getDocumentElement:ao,getClippingRect:poe,getOffsetParent:mV,getElementRects:voe,getClientRects:loe,getDimensions:hoe,getScale:fu,isElement:Ni,isRTL:goe};function boe(e,t){let r=null,n;const i=ao(e);function o(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const p=em(c),m=em(i.clientWidth-(u+d)),v=em(i.clientHeight-(c+f)),g=em(u),y={rootMargin:-p+"px "+-m+"px "+-v+"px "+-g+"px",threshold:gn(0,Ka(1,l))||1};let x=!0;function P(S){const E=S[0].intersectionRatio;if(E!==l){if(!x)return a();E?a(!1,E):n=setTimeout(()=>{a(!1,1e-7)},1e3)}x=!1}try{r=new IntersectionObserver(P,{...y,root:i.ownerDocument})}catch{r=new IntersectionObserver(P,y)}r.observe(e)}return a(!0),o}function xoe(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=xA(e),c=i||o?[...u?Vf(u):[],...Vf(t)]:[];c.forEach(b=>{i&&b.addEventListener("scroll",r,{passive:!0}),o&&b.addEventListener("resize",r)});const d=u&&s?boe(u,r):null;let f=-1,p=null;a&&(p=new ResizeObserver(b=>{let[y]=b;y&&y.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),r()}),u&&!l&&p.observe(u),p.observe(t));let m,v=l?il(e):null;l&&g();function g(){const b=il(e);v&&(b.x!==v.x||b.y!==v.y||b.width!==v.width||b.height!==v.height)&&r(),v=b,m=requestAnimationFrame(g)}return r(),()=>{var b;c.forEach(y=>{i&&y.removeEventListener("scroll",r),o&&y.removeEventListener("resize",r)}),d==null||d(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const woe=Jie,Soe=eoe,Poe=Xie,Eoe=roe,Coe=Zie,tD=Yie,Aoe=toe,Toe=(e,t,r)=>{const n=new Map,i={platform:yoe,...r},o={...i.platform,_c:n};return qie(e,t,{...i,platform:o})};var Vm=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Fv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Fv(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!Fv(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function vV(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rD(e,t){const r=vV(e);return Math.round(t*r)/r}function _0(e){const t=w.useRef(e);return Vm(()=>{t.current=e}),t}function Ooe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,d]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(n);Fv(f,n)||p(n);const[m,v]=w.useState(null),[g,b]=w.useState(null),y=w.useCallback(I=>{I!==E.current&&(E.current=I,v(I))},[]),x=w.useCallback(I=>{I!==C.current&&(C.current=I,b(I))},[]),P=o||m,S=a||g,E=w.useRef(null),C=w.useRef(null),A=w.useRef(c),T=l!=null,D=_0(l),N=_0(i),j=_0(u),L=w.useCallback(()=>{if(!E.current||!C.current)return;const I={placement:t,strategy:r,middleware:f};N.current&&(I.platform=N.current),Toe(E.current,C.current,I).then($=>{const _={...$,isPositioned:j.current!==!1};k.current&&!Fv(A.current,_)&&(A.current=_,ts.flushSync(()=>{d(_)}))})},[f,t,r,N,j]);Vm(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(I=>({...I,isPositioned:!1})))},[u]);const k=w.useRef(!1);Vm(()=>(k.current=!0,()=>{k.current=!1}),[]),Vm(()=>{if(P&&(E.current=P),S&&(C.current=S),P&&S){if(D.current)return D.current(P,S,L);L()}},[P,S,L,D,T]);const V=w.useMemo(()=>({reference:E,floating:C,setReference:y,setFloating:x}),[y,x]),B=w.useMemo(()=>({reference:P,floating:S}),[P,S]),U=w.useMemo(()=>{const I={position:r,left:0,top:0};if(!B.floating)return I;const $=rD(B.floating,c.x),_=rD(B.floating,c.y);return s?{...I,transform:"translate("+$+"px, "+_+"px)",...vV(B.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:_}},[r,s,B.floating,c.x,c.y]);return w.useMemo(()=>({...c,update:L,refs:V,elements:B,floatingStyles:U}),[c,L,V,B,U])}const _oe=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?tD({element:n.current,padding:i}).fn(r):{}:n?tD({element:n,padding:i}).fn(r):{}}}},joe=(e,t)=>({...woe(e),options:[e,t]}),Noe=(e,t)=>({...Soe(e),options:[e,t]}),Doe=(e,t)=>({...Aoe(e),options:[e,t]}),koe=(e,t)=>({...Poe(e),options:[e,t]}),Moe=(e,t)=>({...Eoe(e),options:[e,t]}),Ioe=(e,t)=>({...Coe(e),options:[e,t]}),Roe=(e,t)=>({..._oe(e),options:[e,t]});var $oe="Arrow",gV=w.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...o}=e;return h.jsx(Ke.svg,{...o,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});gV.displayName=$oe;var Loe=gV;function Foe(e,t=[]){let r=[];function n(o,a){const s=w.createContext(a),l=r.length;r=[...r,a];function u(d){const{scope:f,children:p,...m}=d,v=(f==null?void 0:f[e][l])||s,g=w.useMemo(()=>m,Object.values(m));return h.jsx(v.Provider,{value:g,children:p})}function c(d,f){const p=(f==null?void 0:f[e][l])||s,m=w.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,c]}const i=()=>{const o=r.map(a=>w.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[n,Boe(i,...t)]}function Boe(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=n.reduce((s,{useScope:l,scopeName:u})=>{const d=l(o)[`__scope${u}`];return{...s,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function Voe(e){const[t,r]=w.useState(void 0);return Nr(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var SA="Popper",[yV,ab]=Foe(SA),[Uoe,bV]=yV(SA),xV=e=>{const{__scopePopper:t,children:r}=e,[n,i]=w.useState(null);return h.jsx(Uoe,{scope:t,anchor:n,onAnchorChange:i,children:r})};xV.displayName=SA;var wV="PopperAnchor",SV=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=bV(wV,r),a=w.useRef(null),s=st(t,a);return w.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:h.jsx(Ke.div,{...i,ref:s})});SV.displayName=wV;var PA="PopperContent",[zoe,Woe]=yV(PA),PV=w.forwardRef((e,t)=>{var X,oe,K,J,ee,H;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:o="center",alignOffset:a=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...v}=e,g=bV(PA,r),[b,y]=w.useState(null),x=st(t,Pe=>y(Pe)),[P,S]=w.useState(null),E=Voe(P),C=(E==null?void 0:E.width)??0,A=(E==null?void 0:E.height)??0,T=n+(o!=="center"?"-"+o:""),D=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},N=Array.isArray(u)?u:[u],j=N.length>0,L={padding:D,boundary:N.filter(Goe),altBoundary:j},{refs:k,floatingStyles:V,placement:B,isPositioned:U,middlewareData:I}=Ooe({strategy:"fixed",placement:T,whileElementsMounted:(...Pe)=>xoe(...Pe,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[joe({mainAxis:i+A,alignmentAxis:a}),l&&Noe({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Doe():void 0,...L}),l&&koe({...L}),Moe({...L,apply:({elements:Pe,rects:le,availableWidth:Le,availableHeight:Ue})=>{const{width:Ye,height:R}=le.reference,W=Pe.floating.style;W.setProperty("--radix-popper-available-width",`${Le}px`),W.setProperty("--radix-popper-available-height",`${Ue}px`),W.setProperty("--radix-popper-anchor-width",`${Ye}px`),W.setProperty("--radix-popper-anchor-height",`${R}px`)}}),P&&Roe({element:P,padding:s}),Koe({arrowWidth:C,arrowHeight:A}),f&&Ioe({strategy:"referenceHidden",...L})]}),[$,_]=AV(B),O=jr(m);Nr(()=>{U&&(O==null||O())},[U,O]);const z=(X=I.arrow)==null?void 0:X.x,Y=(oe=I.arrow)==null?void 0:oe.y,re=((K=I.arrow)==null?void 0:K.centerOffset)!==0,[se,de]=w.useState();return Nr(()=>{b&&de(window.getComputedStyle(b).zIndex)},[b]),h.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:U?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(J=I.transformOrigin)==null?void 0:J.x,(ee=I.transformOrigin)==null?void 0:ee.y].join(" "),...((H=I.hide)==null?void 0:H.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(zoe,{scope:r,placedSide:$,onArrowChange:S,arrowX:z,arrowY:Y,shouldHideArrow:re,children:h.jsx(Ke.div,{"data-side":$,"data-align":_,...v,ref:x,style:{...v.style,animation:U?void 0:"none"}})})})});PV.displayName=PA;var EV="PopperArrow",Hoe={top:"bottom",right:"left",bottom:"top",left:"right"},CV=w.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,o=Woe(EV,n),a=Hoe[o.placedSide];return h.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:h.jsx(Loe,{...i,ref:r,style:{...i.style,display:"block"}})})});CV.displayName=EV;function Goe(e){return e!==null}var Koe=e=>({name:"transformOrigin",options:e,fn(t){var g,b,y;const{placement:r,rects:n,middlewareData:i}=t,a=((g=i.arrow)==null?void 0:g.centerOffset)!==0,s=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[u,c]=AV(r),d={start:"0%",center:"50%",end:"100%"}[c],f=(((b=i.arrow)==null?void 0:b.x)??0)+s/2,p=(((y=i.arrow)==null?void 0:y.y)??0)+l/2;let m="",v="";return u==="bottom"?(m=a?d:`${f}px`,v=`${-l}px`):u==="top"?(m=a?d:`${f}px`,v=`${n.floating.height+l}px`):u==="right"?(m=`${-l}px`,v=a?d:`${p}px`):u==="left"&&(m=`${n.floating.width+l}px`,v=a?d:`${p}px`),{data:{x:m,y:v}}}});function AV(e){const[t,r="center"]=e.split("-");return[t,r]}var TV=xV,OV=SV,_V=PV,jV=CV;function qoe(e,t=[]){let r=[];function n(o,a){const s=w.createContext(a),l=r.length;r=[...r,a];function u(d){const{scope:f,children:p,...m}=d,v=(f==null?void 0:f[e][l])||s,g=w.useMemo(()=>m,Object.values(m));return h.jsx(v.Provider,{value:g,children:p})}function c(d,f){const p=(f==null?void 0:f[e][l])||s,m=w.useContext(p);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,c]}const i=()=>{const o=r.map(a=>w.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return i.scopeName=e,[n,Yoe(i,...t)]}function Yoe(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=n.reduce((s,{useScope:l,scopeName:u})=>{const d=l(o)[`__scope${u}`];return{...s,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var j0="rovingFocusGroup.onEntryFocus",Xoe={bubbles:!1,cancelable:!0},sb="RovingFocusGroup",[a1,NV,Zoe]=Cy(sb),[Qoe,DV]=qoe(sb,[Zoe]),[Joe,eae]=Qoe(sb),kV=w.forwardRef((e,t)=>h.jsx(a1.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(a1.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(tae,{...e,ref:t})})}));kV.displayName=sb;var tae=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,f=w.useRef(null),p=st(t,f),m=pA(o),[v=null,g]=Vu({prop:a,defaultProp:s,onChange:l}),[b,y]=w.useState(!1),x=jr(u),P=NV(r),S=w.useRef(!1),[E,C]=w.useState(0);return w.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(j0,x),()=>A.removeEventListener(j0,x)},[x]),h.jsx(Joe,{scope:r,orientation:n,dir:m,loop:i,currentTabStopId:v,onItemFocus:w.useCallback(A=>g(A),[g]),onItemShiftTab:w.useCallback(()=>y(!0),[]),onFocusableItemAdd:w.useCallback(()=>C(A=>A+1),[]),onFocusableItemRemove:w.useCallback(()=>C(A=>A-1),[]),children:h.jsx(Ke.div,{tabIndex:b||E===0?-1:0,"data-orientation":n,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Ce(e.onMouseDown,()=>{S.current=!0}),onFocus:Ce(e.onFocus,A=>{const T=!S.current;if(A.target===A.currentTarget&&T&&!b){const D=new CustomEvent(j0,Xoe);if(A.currentTarget.dispatchEvent(D),!D.defaultPrevented){const N=P().filter(B=>B.focusable),j=N.find(B=>B.active),L=N.find(B=>B.id===v),V=[j,L,...N].filter(Boolean).map(B=>B.ref.current);RV(V,c)}}S.current=!1}),onBlur:Ce(e.onBlur,()=>y(!1))})})}),MV="RovingFocusGroupItem",IV=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,...a}=e,s=Oo(),l=o||s,u=eae(MV,r),c=u.currentTabStopId===l,d=NV(r),{onFocusableItemAdd:f,onFocusableItemRemove:p}=u;return w.useEffect(()=>{if(n)return f(),()=>p()},[n,f,p]),h.jsx(a1.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:h.jsx(Ke.span,{tabIndex:c?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:Ce(e.onMouseDown,m=>{n?u.onItemFocus(l):m.preventDefault()}),onFocus:Ce(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Ce(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=iae(m,u.orientation,u.dir);if(v!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let b=d().filter(y=>y.focusable).map(y=>y.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const y=b.indexOf(m.currentTarget);b=u.loop?oae(b,y+1):b.slice(y+1)}setTimeout(()=>RV(b))}})})})});IV.displayName=MV;var rae={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function nae(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function iae(e,t,r){const n=nae(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return rae[n]}function RV(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function oae(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var aae=kV,sae=IV,lae=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Cl=new WeakMap,tm=new WeakMap,rm={},N0=0,$V=function(e){return e&&(e.host||$V(e.parentNode))},uae=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=$V(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},cae=function(e,t,r,n){var i=uae(t,Array.isArray(e)?e:[e]);rm[r]||(rm[r]=new WeakMap);var o=rm[r],a=[],s=new Set,l=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(s.has(f))c(f);else try{var p=f.getAttribute(n),m=p!==null&&p!=="false",v=(Cl.get(f)||0)+1,g=(o.get(f)||0)+1;Cl.set(f,v),o.set(f,g),a.push(f),v===1&&m&&tm.set(f,!0),g===1&&f.setAttribute(r,"true"),m||f.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return c(t),s.clear(),N0++,function(){a.forEach(function(d){var f=Cl.get(d)-1,p=o.get(d)-1;Cl.set(d,f),o.set(d,p),f||(tm.has(d)||d.removeAttribute(n),tm.delete(d)),p||d.removeAttribute(r)}),N0--,N0||(Cl=new WeakMap,Cl=new WeakMap,tm=new WeakMap,rm={})}},EA=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=lae(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),cae(n,i,r,"aria-hidden")):function(){return null}},Hi=function(){return Hi=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return Tae;var t=Oae(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},jae=VV(),pu="data-scroll-locked",Nae=function(e,t,r,n){var i=e.left,o=e.top,a=e.right,s=e.gap;return r===void 0&&(r="margin"),` .`.concat(fae,` { overflow: hidden `).concat(n,`; padding-right: `).concat(s,"px ").concat(n,`; } body[`).concat(pu,`] { overflow: hidden `).concat(n,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` padding-left: `.concat(i,`px; padding-top: `).concat(o,`px; padding-right: `).concat(a,`px; margin-left:0; margin-top:0; margin-right: `).concat(s,"px ").concat(n,`; `),r==="padding"&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),` } .`).concat(Um,` { right: `).concat(s,"px ").concat(n,`; } .`).concat(zm,` { margin-right: `).concat(s,"px ").concat(n,`; } .`).concat(Um," .").concat(Um,` { right: 0 `).concat(n,`; } .`).concat(zm," .").concat(zm,` { margin-right: 0 `).concat(n,`; } body[`).concat(pu,`] { `).concat(pae,": ").concat(s,`px; } `)},iD=function(){var e=parseInt(document.body.getAttribute(pu)||"0",10);return isFinite(e)?e:0},Dae=function(){w.useEffect(function(){return document.body.setAttribute(pu,(iD()+1).toString()),function(){var e=iD()-1;e<=0?document.body.removeAttribute(pu):document.body.setAttribute(pu,e.toString())}},[])},kae=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;Dae();var o=w.useMemo(function(){return _ae(i)},[i]);return w.createElement(jae,{styles:Nae(o,!t,i,r?"":"!important")})},s1=!1;if(typeof window<"u")try{var nm=Object.defineProperty({},"passive",{get:function(){return s1=!0,!0}});window.addEventListener("test",nm,nm),window.removeEventListener("test",nm,nm)}catch{s1=!1}var Al=s1?{passive:!1}:!1,Mae=function(e){return e.tagName==="TEXTAREA"},UV=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Mae(e)&&r[t]==="visible")},Iae=function(e){return UV(e,"overflowY")},Rae=function(e){return UV(e,"overflowX")},oD=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=zV(e,n);if(i){var o=WV(e,n),a=o[1],s=o[2];if(a>s)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},$ae=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Lae=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},zV=function(e,t){return e==="v"?Iae(t):Rae(t)},WV=function(e,t){return e==="v"?$ae(t):Lae(t)},Fae=function(e,t){return e==="h"&&t==="rtl"?-1:1},Bae=function(e,t,r,n,i){var o=Fae(e,window.getComputedStyle(t).direction),a=o*n,s=r.target,l=t.contains(s),u=!1,c=a>0,d=0,f=0;do{var p=WV(e,s),m=p[0],v=p[1],g=p[2],b=v-g-o*m;(m||b)&&zV(e,s)&&(d+=b,f+=m),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(c&&(Math.abs(d)<1||!i)||!c&&(Math.abs(f)<1||!i))&&(u=!0),u},im=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},aD=function(e){return[e.deltaX,e.deltaY]},sD=function(e){return e&&"current"in e?e.current:e},Vae=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Uae=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},zae=0,Tl=[];function Wae(e){var t=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),i=w.useState(zae++)[0],o=w.useState(VV)[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=dae([e.lockRef.current],(e.shards||[]).map(sD),!0).filter(Boolean);return v.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var s=w.useCallback(function(v,g){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var b=im(v),y=r.current,x="deltaX"in v?v.deltaX:y[0]-b[0],P="deltaY"in v?v.deltaY:y[1]-b[1],S,E=v.target,C=Math.abs(x)>Math.abs(P)?"h":"v";if("touches"in v&&C==="h"&&E.type==="range")return!1;var A=oD(C,E);if(!A)return!0;if(A?S=C:(S=C==="v"?"h":"v",A=oD(C,E)),!A)return!1;if(!n.current&&"changedTouches"in v&&(x||P)&&(n.current=S),!S)return!0;var T=n.current||S;return Bae(T,g,v,T==="h"?x:P,!0)},[]),l=w.useCallback(function(v){var g=v;if(!(!Tl.length||Tl[Tl.length-1]!==o)){var b="deltaY"in g?aD(g):im(g),y=t.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&Vae(S.delta,b)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var x=(a.current.shards||[]).map(sD).filter(Boolean).filter(function(S){return S.contains(g.target)}),P=x.length>0?s(g,x[0]):!a.current.noIsolation;P&&g.cancelable&&g.preventDefault()}}},[]),u=w.useCallback(function(v,g,b,y){var x={name:v,delta:g,target:b,should:y,shadowParent:Hae(b)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(P){return P!==x})},1)},[]),c=w.useCallback(function(v){r.current=im(v),n.current=void 0},[]),d=w.useCallback(function(v){u(v.type,aD(v),v.target,s(v,e.lockRef.current))},[]),f=w.useCallback(function(v){u(v.type,im(v),v.target,s(v,e.lockRef.current))},[]);w.useEffect(function(){return Tl.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Al),document.addEventListener("touchmove",l,Al),document.addEventListener("touchstart",c,Al),function(){Tl=Tl.filter(function(v){return v!==o}),document.removeEventListener("wheel",l,Al),document.removeEventListener("touchmove",l,Al),document.removeEventListener("touchstart",c,Al)}},[]);var p=e.removeScrollBar,m=e.inert;return w.createElement(w.Fragment,null,m?w.createElement(o,{styles:Uae(i)}):null,p?w.createElement(kae,{gapMode:e.gapMode}):null)}function Hae(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Gae=xae(BV,Wae);var ub=w.forwardRef(function(e,t){return w.createElement(lb,Hi({},e,{ref:t,sideCar:Gae}))});ub.classNames=lb.classNames;var l1=["Enter"," "],Kae=["ArrowDown","PageUp","Home"],HV=["ArrowUp","PageDown","End"],qae=[...Kae,...HV],Yae={ltr:[...l1,"ArrowRight"],rtl:[...l1,"ArrowLeft"]},Xae={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ah="Menu",[Uf,Zae,Qae]=Cy(ah),[ml,GV]=Ec(ah,[Qae,ab,DV]),cb=ab(),KV=DV(),[Jae,vl]=ml(ah),[ese,sh]=ml(ah),qV=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:o,modal:a=!0}=e,s=cb(t),[l,u]=w.useState(null),c=w.useRef(!1),d=jr(o),f=pA(i);return w.useEffect(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),h.jsx(TV,{...s,children:h.jsx(Jae,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:h.jsx(ese,{scope:t,onClose:w.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:f,modal:a,children:n})})})};qV.displayName=ah;var tse="MenuAnchor",CA=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=cb(r);return h.jsx(OV,{...i,...n,ref:t})});CA.displayName=tse;var AA="MenuPortal",[rse,YV]=ml(AA,{forceMount:void 0}),XV=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,o=vl(AA,t);return h.jsx(rse,{scope:t,forceMount:r,children:h.jsx(Yo,{present:r||o.open,children:h.jsx(Vp,{asChild:!0,container:i,children:n})})})};XV.displayName=AA;var Jn="MenuContent",[nse,TA]=ml(Jn),ZV=w.forwardRef((e,t)=>{const r=YV(Jn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=vl(Jn,e.__scopeMenu),a=sh(Jn,e.__scopeMenu);return h.jsx(Uf.Provider,{scope:e.__scopeMenu,children:h.jsx(Yo,{present:n||o.open,children:h.jsx(Uf.Slot,{scope:e.__scopeMenu,children:a.modal?h.jsx(ise,{...i,ref:t}):h.jsx(ose,{...i,ref:t})})})})}),ise=w.forwardRef((e,t)=>{const r=vl(Jn,e.__scopeMenu),n=w.useRef(null),i=st(t,n);return w.useEffect(()=>{const o=n.current;if(o)return EA(o)},[]),h.jsx(OA,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),ose=w.forwardRef((e,t)=>{const r=vl(Jn,e.__scopeMenu);return h.jsx(OA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),OA=w.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...v}=e,g=vl(Jn,r),b=sh(Jn,r),y=cb(r),x=KV(r),P=Zae(r),[S,E]=w.useState(null),C=w.useRef(null),A=st(t,C,g.onContentChange),T=w.useRef(0),D=w.useRef(""),N=w.useRef(0),j=w.useRef(null),L=w.useRef("right"),k=w.useRef(0),V=m?ub:w.Fragment,B=m?{as:Lo,allowPinchZoom:!0}:void 0,U=$=>{var X,oe;const _=D.current+$,O=P().filter(K=>!K.disabled),z=document.activeElement,Y=(X=O.find(K=>K.ref.current===z))==null?void 0:X.textValue,re=O.map(K=>K.textValue),se=gse(re,_,Y),de=(oe=O.find(K=>K.textValue===se))==null?void 0:oe.ref.current;(function K(J){D.current=J,window.clearTimeout(T.current),J!==""&&(T.current=window.setTimeout(()=>K(""),1e3))})(_),de&&setTimeout(()=>de.focus())};w.useEffect(()=>()=>window.clearTimeout(T.current),[]),hA();const I=w.useCallback($=>{var O,z;return L.current===((O=j.current)==null?void 0:O.side)&&bse($,(z=j.current)==null?void 0:z.area)},[]);return h.jsx(nse,{scope:r,searchRef:D,onItemEnter:w.useCallback($=>{I($)&&$.preventDefault()},[I]),onItemLeave:w.useCallback($=>{var _;I($)||((_=C.current)==null||_.focus(),E(null))},[I]),onTriggerLeave:w.useCallback($=>{I($)&&$.preventDefault()},[I]),pointerGraceTimerRef:N,onPointerGraceIntentChange:w.useCallback($=>{j.current=$},[]),children:h.jsx(V,{...B,children:h.jsx(rb,{asChild:!0,trapped:i,onMountAutoFocus:Ce(o,$=>{var _;$.preventDefault(),(_=C.current)==null||_.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(Bp,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:h.jsx(aae,{asChild:!0,...x,dir:b.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:E,onEntryFocus:Ce(l,$=>{b.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(_V,{role:"menu","aria-orientation":"vertical","data-state":p4(g.open),"data-radix-menu-content":"",dir:b.dir,...y,...v,ref:A,style:{outline:"none",...v.style},onKeyDown:Ce(v.onKeyDown,$=>{const O=$.target.closest("[data-radix-menu-content]")===$.currentTarget,z=$.ctrlKey||$.altKey||$.metaKey,Y=$.key.length===1;O&&($.key==="Tab"&&$.preventDefault(),!z&&Y&&U($.key));const re=C.current;if($.target!==re||!qae.includes($.key))return;$.preventDefault();const de=P().filter(X=>!X.disabled).map(X=>X.ref.current);HV.includes($.key)&&de.reverse(),mse(de)}),onBlur:Ce(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(T.current),D.current="")}),onPointerMove:Ce(e.onPointerMove,zf($=>{const _=$.target,O=k.current!==$.clientX;if($.currentTarget.contains(_)&&O){const z=$.clientX>k.current?"right":"left";L.current=z,k.current=$.clientX}}))})})})})})})});ZV.displayName=Jn;var ase="MenuGroup",_A=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return h.jsx(Ke.div,{role:"group",...n,ref:t})});_A.displayName=ase;var sse="MenuLabel",QV=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return h.jsx(Ke.div,{...n,ref:t})});QV.displayName=sse;var Bv="MenuItem",lD="menu.itemSelect",db=w.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,o=w.useRef(null),a=sh(Bv,e.__scopeMenu),s=TA(Bv,e.__scopeMenu),l=st(t,o),u=w.useRef(!1),c=()=>{const d=o.current;if(!r&&d){const f=new CustomEvent(lD,{bubbles:!0,cancelable:!0});d.addEventListener(lD,p=>n==null?void 0:n(p),{once:!0}),ZE(d,f),f.defaultPrevented?u.current=!1:a.onClose()}};return h.jsx(JV,{...i,ref:l,disabled:r,onClick:Ce(e.onClick,c),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),u.current=!0},onPointerUp:Ce(e.onPointerUp,d=>{var f;u.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Ce(e.onKeyDown,d=>{const f=s.searchRef.current!=="";r||f&&d.key===" "||l1.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});db.displayName=Bv;var JV=w.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=e,a=TA(Bv,r),s=KV(r),l=w.useRef(null),u=st(t,l),[c,d]=w.useState(!1),[f,p]=w.useState("");return w.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[o.children]),h.jsx(Uf.ItemSlot,{scope:r,disabled:n,textValue:i??f,children:h.jsx(sae,{asChild:!0,...s,focusable:!n,children:h.jsx(Ke.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:u,onPointerMove:Ce(e.onPointerMove,zf(m=>{n?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ce(e.onPointerLeave,zf(m=>a.onItemLeave(m))),onFocus:Ce(e.onFocus,()=>d(!0)),onBlur:Ce(e.onBlur,()=>d(!1))})})})}),lse="MenuCheckboxItem",e4=w.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...i}=e;return h.jsx(o4,{scope:e.__scopeMenu,checked:r,children:h.jsx(db,{role:"menuitemcheckbox","aria-checked":Vv(r)?"mixed":r,...i,ref:t,"data-state":NA(r),onSelect:Ce(i.onSelect,()=>n==null?void 0:n(Vv(r)?!0:!r),{checkForDefaultPrevented:!1})})})});e4.displayName=lse;var t4="MenuRadioGroup",[use,cse]=ml(t4,{value:void 0,onValueChange:()=>{}}),r4=w.forwardRef((e,t)=>{const{value:r,onValueChange:n,...i}=e,o=jr(n);return h.jsx(use,{scope:e.__scopeMenu,value:r,onValueChange:o,children:h.jsx(_A,{...i,ref:t})})});r4.displayName=t4;var n4="MenuRadioItem",i4=w.forwardRef((e,t)=>{const{value:r,...n}=e,i=cse(n4,e.__scopeMenu),o=r===i.value;return h.jsx(o4,{scope:e.__scopeMenu,checked:o,children:h.jsx(db,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":NA(o),onSelect:Ce(n.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,r)},{checkForDefaultPrevented:!1})})})});i4.displayName=n4;var jA="MenuItemIndicator",[o4,dse]=ml(jA,{checked:!1}),a4=w.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...i}=e,o=dse(jA,r);return h.jsx(Yo,{present:n||Vv(o.checked)||o.checked===!0,children:h.jsx(Ke.span,{...i,ref:t,"data-state":NA(o.checked)})})});a4.displayName=jA;var fse="MenuSeparator",s4=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return h.jsx(Ke.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});s4.displayName=fse;var pse="MenuArrow",l4=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=cb(r);return h.jsx(jV,{...i,...n,ref:t})});l4.displayName=pse;var hse="MenuSub",[EIe,u4]=ml(hse),kd="MenuSubTrigger",c4=w.forwardRef((e,t)=>{const r=vl(kd,e.__scopeMenu),n=sh(kd,e.__scopeMenu),i=u4(kd,e.__scopeMenu),o=TA(kd,e.__scopeMenu),a=w.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},c=w.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return w.useEffect(()=>c,[c]),w.useEffect(()=>{const d=s.current;return()=>{window.clearTimeout(d),l(null)}},[s,l]),h.jsx(CA,{asChild:!0,...u,children:h.jsx(JV,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":p4(r.open),...e,ref:Ey(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ce(e.onPointerMove,zf(d=>{o.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),c()},100))})),onPointerLeave:Ce(e.onPointerLeave,zf(d=>{var p,m;c();const f=(p=r.content)==null?void 0:p.getBoundingClientRect();if(f){const v=(m=r.content)==null?void 0:m.dataset.side,g=v==="right",b=g?-5:5,y=f[g?"left":"right"],x=f[g?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+b,y:d.clientY},{x:y,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:y,y:f.bottom}],side:v}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ce(e.onKeyDown,d=>{var p;const f=o.searchRef.current!=="";e.disabled||f&&d.key===" "||Yae[n.dir].includes(d.key)&&(r.onOpenChange(!0),(p=r.content)==null||p.focus(),d.preventDefault())})})})});c4.displayName=kd;var d4="MenuSubContent",f4=w.forwardRef((e,t)=>{const r=YV(Jn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=vl(Jn,e.__scopeMenu),a=sh(Jn,e.__scopeMenu),s=u4(d4,e.__scopeMenu),l=w.useRef(null),u=st(t,l);return h.jsx(Uf.Provider,{scope:e.__scopeMenu,children:h.jsx(Yo,{present:n||o.open,children:h.jsx(Uf.Slot,{scope:e.__scopeMenu,children:h.jsx(OA,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:Ce(e.onFocusOutside,c=>{c.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ce(e.onEscapeKeyDown,c=>{a.onClose(),c.preventDefault()}),onKeyDown:Ce(e.onKeyDown,c=>{var p;const d=c.currentTarget.contains(c.target),f=Xae[a.dir].includes(c.key);d&&f&&(o.onOpenChange(!1),(p=s.trigger)==null||p.focus(),c.preventDefault())})})})})})});f4.displayName=d4;function p4(e){return e?"open":"closed"}function Vv(e){return e==="indeterminate"}function NA(e){return Vv(e)?"indeterminate":e?"checked":"unchecked"}function mse(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function vse(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function gse(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=vse(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function yse(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,a=t.length-1;on!=c>n&&r<(u-s)*(n-l)/(c-l)+s&&(i=!i)}return i}function bse(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return yse(r,t)}function zf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var xse=qV,wse=CA,Sse=XV,Pse=ZV,Ese=_A,Cse=QV,Ase=db,Tse=e4,Ose=r4,_se=i4,jse=a4,Nse=s4,Dse=l4,kse=c4,Mse=f4,DA="DropdownMenu",[Ise,CIe]=Ec(DA,[GV]),Wr=GV(),[Rse,h4]=Ise(DA),m4=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=Wr(t),u=w.useRef(null),[c=!1,d]=Vu({prop:i,defaultProp:o,onChange:a});return h.jsx(Rse,{scope:t,triggerId:Oo(),triggerRef:u,contentId:Oo(),open:c,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(f=>!f),[d]),modal:s,children:h.jsx(xse,{...l,open:c,onOpenChange:d,dir:n,modal:s,children:r})})};m4.displayName=DA;var v4="DropdownMenuTrigger",g4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,o=h4(v4,r),a=Wr(r);return h.jsx(wse,{asChild:!0,...a,children:h.jsx(Ke.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:Ey(t,o.triggerRef),onPointerDown:Ce(e.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Ce(e.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});g4.displayName=v4;var $se="DropdownMenuPortal",y4=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Wr(t);return h.jsx(Sse,{...n,...r})};y4.displayName=$se;var b4="DropdownMenuContent",x4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=h4(b4,r),o=Wr(r),a=w.useRef(!1);return h.jsx(Pse,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...n,ref:t,onCloseAutoFocus:Ce(e.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Ce(e.onInteractOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;(!i.modal||c)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});x4.displayName=b4;var Lse="DropdownMenuGroup",Fse=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Wr(r);return h.jsx(Ese,{...i,...n,ref:t})});Fse.displayName=Lse;var Bse="DropdownMenuLabel",w4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Wr(r);return h.jsx(Cse,{...i,...n,ref:t})});w4.displayName=Bse;var Vse="DropdownMenuItem",S4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Wr(r);return h.jsx(Ase,{...i,...n,ref:t})});S4.displayName=Vse;var Use="DropdownMenuCheckboxItem",P4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Wr(r);return h.jsx(Tse,{...i,...n,ref:t})});P4.displayName=Use;var zse="DropdownMenuRadioGroup",Wse=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Wr(r);return h.jsx(Ose,{...i,...n,ref:t})});Wse.displayName=zse;var Hse="DropdownMenuRadioItem",E4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Wr(r);return h.jsx(_se,{...i,...n,ref:t})});E4.displayName=Hse;var Gse="DropdownMenuItemIndicator",C4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Wr(r);return h.jsx(jse,{...i,...n,ref:t})});C4.displayName=Gse;var Kse="DropdownMenuSeparator",A4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Wr(r);return h.jsx(Nse,{...i,...n,ref:t})});A4.displayName=Kse;var qse="DropdownMenuArrow",Yse=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Wr(r);return h.jsx(Dse,{...i,...n,ref:t})});Yse.displayName=qse;var Xse="DropdownMenuSubTrigger",T4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Wr(r);return h.jsx(kse,{...i,...n,ref:t})});T4.displayName=Xse;var Zse="DropdownMenuSubContent",O4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Wr(r);return h.jsx(Mse,{...i,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});O4.displayName=Zse;var Qse=m4,Jse=g4,ele=y4,_4=x4,j4=w4,N4=S4,D4=P4,k4=E4,M4=C4,I4=A4,R4=T4,$4=O4;const L4=Qse,F4=Jse,tle=w.forwardRef(({className:e,inset:t,children:r,...n},i)=>h.jsxs(R4,{ref:i,className:Me("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,h.jsx(Sq,{className:"ml-auto h-4 w-4"})]}));tle.displayName=R4.displayName;const rle=w.forwardRef(({className:e,...t},r)=>h.jsx($4,{ref:r,className:Me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-xl duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-90 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));rle.displayName=$4.displayName;const kA=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>h.jsx(ele,{children:h.jsx(_4,{ref:n,sideOffset:t,className:Me("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-xl duration-300 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-90 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));kA.displayName=_4.displayName;const _s=w.forwardRef(({className:e,inset:t,...r},n)=>h.jsx(N4,{ref:n,className:Me("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r}));_s.displayName=N4.displayName;const nle=w.forwardRef(({className:e,children:t,checked:r,...n},i)=>h.jsxs(D4,{ref:i,className:Me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(M4,{children:h.jsx(_i,{className:"h-4 w-4"})})}),t]}));nle.displayName=D4.displayName;const ile=w.forwardRef(({className:e,children:t,...r},n)=>h.jsxs(k4,{ref:n,className:Me("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(M4,{children:h.jsx(Tq,{className:"h-2 w-2 fill-current"})})}),t]}));ile.displayName=k4.displayName;const B4=w.forwardRef(({className:e,inset:t,...r},n)=>h.jsx(j4,{ref:n,className:Me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));B4.displayName=j4.displayName;const V4=w.forwardRef(({className:e,...t},r)=>h.jsx(I4,{ref:r,className:Me("-mx-1 my-1 h-px bg-muted",e),...t}));V4.displayName=I4.displayName;var lh=e=>e.type==="checkbox",js=e=>e instanceof Date,$r=e=>e==null;const U4=e=>typeof e=="object";var Kt=e=>!$r(e)&&!Array.isArray(e)&&U4(e)&&!js(e),z4=e=>Kt(e)&&e.target?lh(e.target)?e.target.checked:e.target.value:e,ole=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,W4=(e,t)=>e.has(ole(t)),ale=e=>{const t=e.constructor&&e.constructor.prototype;return Kt(t)&&t.hasOwnProperty("isPrototypeOf")},MA=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Kr(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(MA&&(e instanceof Blob||e instanceof FileList))&&(r||Kt(e)))if(t=r?[]:{},!r&&!ale(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Kr(e[n]));else return e;return t}var fb=e=>Array.isArray(e)?e.filter(Boolean):[],Ut=e=>e===void 0,he=(e,t,r)=>{if(!t||!Kt(e))return r;const n=fb(t.split(/[,[\].]+?/)).reduce((i,o)=>$r(i)?i:i[o],e);return Ut(n)||n===e?Ut(e[t])?r:e[t]:n},Hn=e=>typeof e=="boolean",IA=e=>/^\w*$/.test(e),H4=e=>fb(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ut=(e,t,r)=>{let n=-1;const i=IA(t)?[t]:H4(t),o=i.length,a=o-1;for(;++nM.useContext(G4),sle=e=>{const{children:t,...r}=e;return M.createElement(G4.Provider,{value:r},t)};var K4=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const a=o;return t._proxyFormState[a]!==wi.all&&(t._proxyFormState[a]=!n||wi.all),r&&(r[a]=!0),e[a]}});return i},Xr=e=>Kt(e)&&!Object.keys(e).length,q4=(e,t,r,n)=>{r(e);const{name:i,...o}=e;return Xr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||wi.all))},tf=e=>Array.isArray(e)?e:[e],Y4=(e,t,r)=>!e||!t||e===t||tf(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function RA(e){const t=M.useRef(e);t.current=e,M.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function lle(e){const t=pb(),{control:r=t.control,disabled:n,name:i,exact:o}=e||{},[a,s]=M.useState(r._formState),l=M.useRef(!0),u=M.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=M.useRef(i);return c.current=i,RA({disabled:n,next:d=>l.current&&Y4(c.current,d.name,o)&&q4(d,u.current,r._updateFormState)&&s({...r._formState,...d}),subject:r._subjects.state}),M.useEffect(()=>(l.current=!0,u.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),K4(a,r,u.current,!1)}var Gi=e=>typeof e=="string",X4=(e,t,r,n,i)=>Gi(e)?(n&&t.watch.add(e),he(r,e,i)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),he(r,o))):(n&&(t.watchAll=!0),r);function ule(e){const t=pb(),{control:r=t.control,name:n,defaultValue:i,disabled:o,exact:a}=e||{},s=M.useRef(n);s.current=n,RA({disabled:o,subject:r._subjects.values,next:c=>{Y4(s.current,c.name,a)&&u(Kr(X4(s.current,r._names,c.values||r._formValues,!1,i)))}});const[l,u]=M.useState(r._getWatch(n,i));return M.useEffect(()=>r._removeUnmounted()),l}function cle(e){const t=pb(),{name:r,disabled:n,control:i=t.control,shouldUnregister:o}=e,a=W4(i._names.array,r),s=ule({control:i,name:r,defaultValue:he(i._formValues,r,he(i._defaultValues,r,e.defaultValue)),exact:!0}),l=lle({control:i,name:r,exact:!0}),u=M.useRef(i.register(r,{...e.rules,value:s,...Hn(e.disabled)?{disabled:e.disabled}:{}}));return M.useEffect(()=>{const c=i._options.shouldUnregister||o,d=(f,p)=>{const m=he(i._fields,f);m&&m._f&&(m._f.mount=p)};if(d(r,!0),c){const f=Kr(he(i._options.defaultValues,r));ut(i._defaultValues,r,f),Ut(he(i._formValues,r))&&ut(i._formValues,r,f)}return()=>{(a?c&&!i._state.action:c)?i.unregister(r):d(r,!1)}},[r,i,a,o]),M.useEffect(()=>{he(i._fields,r)&&i._updateDisabledField({disabled:n,fields:i._fields,name:r,value:he(i._fields,r)._f.value})},[n,r,i]),{field:{name:r,value:s,...Hn(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:M.useCallback(c=>u.current.onChange({target:{value:z4(c),name:r},type:Uv.CHANGE}),[r]),onBlur:M.useCallback(()=>u.current.onBlur({target:{value:he(i._formValues,r),name:r},type:Uv.BLUR}),[r,i]),ref:M.useCallback(c=>{const d=he(i._fields,r);d&&c&&(d._f.ref={focus:()=>c.focus(),select:()=>c.select(),setCustomValidity:f=>c.setCustomValidity(f),reportValidity:()=>c.reportValidity()})},[i._fields,r])},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!he(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!he(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!he(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!he(l.validatingFields,r)},error:{enumerable:!0,get:()=>he(l.errors,r)}})}}const dle=e=>e.render(cle(e));var Z4=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},uD=e=>({isOnSubmit:!e||e===wi.onSubmit,isOnBlur:e===wi.onBlur,isOnChange:e===wi.onChange,isOnAll:e===wi.all,isOnTouch:e===wi.onTouched}),cD=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const rf=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const o=he(e,i);if(o){const{_f:a,...s}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],i)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(rf(s,t))break}else if(Kt(s)&&rf(s,t))break}}};var fle=(e,t,r)=>{const n=tf(he(e,r));return ut(n,"root",t[r]),ut(e,r,n),e},$A=e=>e.type==="file",wo=e=>typeof e=="function",zv=e=>{if(!MA)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Wm=e=>Gi(e),LA=e=>e.type==="radio",Wv=e=>e instanceof RegExp;const dD={value:!1,isValid:!1},fD={value:!0,isValid:!0};var Q4=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ut(e[0].attributes.value)?Ut(e[0].value)||e[0].value===""?fD:{value:e[0].value,isValid:!0}:fD:dD}return dD};const pD={isValid:!1,value:null};var J4=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,pD):pD;function hD(e,t,r="validate"){if(Wm(e)||Array.isArray(e)&&e.every(Wm)||Hn(e)&&!e)return{type:r,message:Wm(e)?e:"",ref:t}}var Ol=e=>Kt(e)&&!Wv(e)?e:{value:e,message:""},mD=async(e,t,r,n,i)=>{const{ref:o,refs:a,required:s,maxLength:l,minLength:u,min:c,max:d,pattern:f,validate:p,name:m,valueAsNumber:v,mount:g,disabled:b}=e._f,y=he(t,m);if(!g||b)return{};const x=a?a[0]:o,P=j=>{n&&x.reportValidity&&(x.setCustomValidity(Hn(j)?"":j||""),x.reportValidity())},S={},E=LA(o),C=lh(o),A=E||C,T=(v||$A(o))&&Ut(o.value)&&Ut(y)||zv(o)&&o.value===""||y===""||Array.isArray(y)&&!y.length,D=Z4.bind(null,m,r,S),N=(j,L,k,V=fo.maxLength,B=fo.minLength)=>{const U=j?L:k;S[m]={type:j?V:B,message:U,ref:o,...D(j?V:B,U)}};if(i?!Array.isArray(y)||!y.length:s&&(!A&&(T||$r(y))||Hn(y)&&!y||C&&!Q4(a).isValid||E&&!J4(a).isValid)){const{value:j,message:L}=Wm(s)?{value:!!s,message:s}:Ol(s);if(j&&(S[m]={type:fo.required,message:L,ref:x,...D(fo.required,L)},!r))return P(L),S}if(!T&&(!$r(c)||!$r(d))){let j,L;const k=Ol(d),V=Ol(c);if(!$r(y)&&!isNaN(y)){const B=o.valueAsNumber||y&&+y;$r(k.value)||(j=B>k.value),$r(V.value)||(L=Bnew Date(new Date().toDateString()+" "+_),I=o.type=="time",$=o.type=="week";Gi(k.value)&&y&&(j=I?U(y)>U(k.value):$?y>k.value:B>new Date(k.value)),Gi(V.value)&&y&&(L=I?U(y)+j.value,V=!$r(L.value)&&y.length<+L.value;if((k||V)&&(N(k,j.message,L.message),!r))return P(S[m].message),S}if(f&&!T&&Gi(y)){const{value:j,message:L}=Ol(f);if(Wv(j)&&!y.match(j)&&(S[m]={type:fo.pattern,message:L,ref:o,...D(fo.pattern,L)},!r))return P(L),S}if(p){if(wo(p)){const j=await p(y,t),L=hD(j,x);if(L&&(S[m]={...L,...D(fo.validate,L.message)},!r))return P(L.message),S}else if(Kt(p)){let j={};for(const L in p){if(!Xr(j)&&!r)break;const k=hD(await p[L](y,t),x,L);k&&(j={...k,...D(L,k.message)},P(k.message),r&&(S[m]=j))}if(!Xr(j)&&(S[m]={ref:x,...j},!r))return S}}return P(!0),S};function ple(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{let e=[];return{get observers(){return e},next:i=>{for(const o of e)o.next&&o.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(o=>o!==i)}}),unsubscribe:()=>{e=[]}}},u1=e=>$r(e)||!U4(e);function ma(e,t){if(u1(e)||u1(t))return e===t;if(js(e)&&js(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const o=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const a=t[i];if(js(o)&&js(a)||Kt(o)&&Kt(a)||Array.isArray(o)&&Array.isArray(a)?!ma(o,a):o!==a)return!1}}return!0}var eU=e=>e.type==="select-multiple",mle=e=>LA(e)||lh(e),R0=e=>zv(e)&&e.isConnected,tU=e=>{for(const t in e)if(wo(e[t]))return!0;return!1};function Hv(e,t={}){const r=Array.isArray(e);if(Kt(e)||r)for(const n in e)Array.isArray(e[n])||Kt(e[n])&&!tU(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Hv(e[n],t[n])):$r(e[n])||(t[n]=!0);return t}function rU(e,t,r){const n=Array.isArray(e);if(Kt(e)||n)for(const i in e)Array.isArray(e[i])||Kt(e[i])&&!tU(e[i])?Ut(t)||u1(r[i])?r[i]=Array.isArray(e[i])?Hv(e[i],[]):{...Hv(e[i])}:rU(e[i],$r(t)?{}:t[i],r[i]):r[i]=!ma(e[i],t[i]);return r}var pd=(e,t)=>rU(e,t,Hv(t)),nU=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ut(e)?e:t?e===""?NaN:e&&+e:r&&Gi(e)?new Date(e):n?n(e):e;function $0(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return $A(t)?t.files:LA(t)?J4(e.refs).value:eU(t)?[...t.selectedOptions].map(({value:r})=>r):lh(t)?Q4(e.refs).value:nU(Ut(t.value)?e.ref.value:t.value,e)}var vle=(e,t,r,n)=>{const i={};for(const o of e){const a=he(t,o);a&&ut(i,o,a._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},hd=e=>Ut(e)?e:Wv(e)?e.source:Kt(e)?Wv(e.value)?e.value.source:e.value:e;const vD="AsyncFunction";var gle=e=>(!e||!e.validate)&&!!(wo(e.validate)&&e.validate.constructor.name===vD||Kt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===vD)),yle=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function gD(e,t,r){const n=he(e,r);if(n||IA(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const o=i.join("."),a=he(t,o),s=he(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(s&&s.type)return{name:o,error:s};i.pop()}return{name:r}}var ble=(e,t,r,n,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:(r?n.isOnChange:i.isOnChange)?e:!0,xle=(e,t)=>!fb(he(e,t)).length&&Qt(e,t);const wle={mode:wi.onSubmit,reValidateMode:wi.onChange,shouldFocusError:!0};function Sle(e={}){let t={...wle,...e},r={submitCount:0,isDirty:!1,isLoading:wo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=Kt(t.defaultValues)||Kt(t.values)?Kr(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Kr(i),a={action:!1,mount:!1,watch:!1},s={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:I0(),array:I0(),state:I0()},f=uD(t.mode),p=uD(t.reValidateMode),m=t.criteriaMode===wi.all,v=R=>W=>{clearTimeout(u),u=setTimeout(R,W)},g=async R=>{if(!e.disabled&&(c.isValid||R)){const W=t.resolver?Xr((await A()).errors):await D(n,!0);W!==r.isValid&&d.state.next({isValid:W})}},b=(R,W)=>{!e.disabled&&(c.isValidating||c.validatingFields)&&((R||Array.from(s.mount)).forEach(G=>{G&&(W?ut(r.validatingFields,G,W):Qt(r.validatingFields,G))}),d.state.next({validatingFields:r.validatingFields,isValidating:!Xr(r.validatingFields)}))},y=(R,W=[],G,pe,ue=!0,ne=!0)=>{if(pe&&G&&!e.disabled){if(a.action=!0,ne&&Array.isArray(he(n,R))){const Oe=G(he(n,R),pe.argA,pe.argB);ue&&ut(n,R,Oe)}if(ne&&Array.isArray(he(r.errors,R))){const Oe=G(he(r.errors,R),pe.argA,pe.argB);ue&&ut(r.errors,R,Oe),xle(r.errors,R)}if(c.touchedFields&&ne&&Array.isArray(he(r.touchedFields,R))){const Oe=G(he(r.touchedFields,R),pe.argA,pe.argB);ue&&ut(r.touchedFields,R,Oe)}c.dirtyFields&&(r.dirtyFields=pd(i,o)),d.state.next({name:R,isDirty:j(R,W),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ut(o,R,W)},x=(R,W)=>{ut(r.errors,R,W),d.state.next({errors:r.errors})},P=R=>{r.errors=R,d.state.next({errors:r.errors,isValid:!1})},S=(R,W,G,pe)=>{const ue=he(n,R);if(ue){const ne=he(o,R,Ut(G)?he(i,R):G);Ut(ne)||pe&&pe.defaultChecked||W?ut(o,R,W?ne:$0(ue._f)):V(R,ne),a.mount&&g()}},E=(R,W,G,pe,ue)=>{let ne=!1,Oe=!1;const Be={name:R};if(!e.disabled){const Dt=!!(he(n,R)&&he(n,R)._f&&he(n,R)._f.disabled);if(!G||pe){c.isDirty&&(Oe=r.isDirty,r.isDirty=Be.isDirty=j(),ne=Oe!==Be.isDirty);const $t=Dt||ma(he(i,R),W);Oe=!!(!Dt&&he(r.dirtyFields,R)),$t||Dt?Qt(r.dirtyFields,R):ut(r.dirtyFields,R,!0),Be.dirtyFields=r.dirtyFields,ne=ne||c.dirtyFields&&Oe!==!$t}if(G){const $t=he(r.touchedFields,R);$t||(ut(r.touchedFields,R,G),Be.touchedFields=r.touchedFields,ne=ne||c.touchedFields&&$t!==G)}ne&&ue&&d.state.next(Be)}return ne?Be:{}},C=(R,W,G,pe)=>{const ue=he(r.errors,R),ne=c.isValid&&Hn(W)&&r.isValid!==W;if(e.delayError&&G?(l=v(()=>x(R,G)),l(e.delayError)):(clearTimeout(u),l=null,G?ut(r.errors,R,G):Qt(r.errors,R)),(G?!ma(ue,G):ue)||!Xr(pe)||ne){const Oe={...pe,...ne&&Hn(W)?{isValid:W}:{},errors:r.errors,name:R};r={...r,...Oe},d.state.next(Oe)}},A=async R=>{b(R,!0);const W=await t.resolver(o,t.context,vle(R||s.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return b(R),W},T=async R=>{const{errors:W}=await A(R);if(R)for(const G of R){const pe=he(W,G);pe?ut(r.errors,G,pe):Qt(r.errors,G)}else r.errors=W;return W},D=async(R,W,G={valid:!0})=>{for(const pe in R){const ue=R[pe];if(ue){const{_f:ne,...Oe}=ue;if(ne){const Be=s.array.has(ne.name),Dt=ue._f&&gle(ue._f);Dt&&c.validatingFields&&b([pe],!0);const $t=await mD(ue,o,m,t.shouldUseNativeValidation&&!W,Be);if(Dt&&c.validatingFields&&b([pe]),$t[ne.name]&&(G.valid=!1,W))break;!W&&(he($t,ne.name)?Be?fle(r.errors,$t,ne.name):ut(r.errors,ne.name,$t[ne.name]):Qt(r.errors,ne.name))}!Xr(Oe)&&await D(Oe,W,G)}}return G.valid},N=()=>{for(const R of s.unMount){const W=he(n,R);W&&(W._f.refs?W._f.refs.every(G=>!R0(G)):!R0(W._f.ref))&&de(R)}s.unMount=new Set},j=(R,W)=>!e.disabled&&(R&&W&&ut(o,R,W),!ma(O(),i)),L=(R,W,G)=>X4(R,s,{...a.mount?o:Ut(W)?i:Gi(R)?{[R]:W}:W},G,W),k=R=>fb(he(a.mount?o:i,R,e.shouldUnregister?he(i,R,[]):[])),V=(R,W,G={})=>{const pe=he(n,R);let ue=W;if(pe){const ne=pe._f;ne&&(!ne.disabled&&ut(o,R,nU(W,ne)),ue=zv(ne.ref)&&$r(W)?"":W,eU(ne.ref)?[...ne.ref.options].forEach(Oe=>Oe.selected=ue.includes(Oe.value)):ne.refs?lh(ne.ref)?ne.refs.length>1?ne.refs.forEach(Oe=>(!Oe.defaultChecked||!Oe.disabled)&&(Oe.checked=Array.isArray(ue)?!!ue.find(Be=>Be===Oe.value):ue===Oe.value)):ne.refs[0]&&(ne.refs[0].checked=!!ue):ne.refs.forEach(Oe=>Oe.checked=Oe.value===ue):$A(ne.ref)?ne.ref.value="":(ne.ref.value=ue,ne.ref.type||d.values.next({name:R,values:{...o}})))}(G.shouldDirty||G.shouldTouch)&&E(R,ue,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&_(R)},B=(R,W,G)=>{for(const pe in W){const ue=W[pe],ne=`${R}.${pe}`,Oe=he(n,ne);(s.array.has(R)||Kt(ue)||Oe&&!Oe._f)&&!js(ue)?B(ne,ue,G):V(ne,ue,G)}},U=(R,W,G={})=>{const pe=he(n,R),ue=s.array.has(R),ne=Kr(W);ut(o,R,ne),ue?(d.array.next({name:R,values:{...o}}),(c.isDirty||c.dirtyFields)&&G.shouldDirty&&d.state.next({name:R,dirtyFields:pd(i,o),isDirty:j(R,ne)})):pe&&!pe._f&&!$r(ne)?B(R,ne,G):V(R,ne,G),cD(R,s)&&d.state.next({...r}),d.values.next({name:a.mount?R:void 0,values:{...o}})},I=async R=>{a.mount=!0;const W=R.target;let G=W.name,pe=!0;const ue=he(n,G),ne=()=>W.type?$0(ue._f):z4(R),Oe=Be=>{pe=Number.isNaN(Be)||js(Be)&&isNaN(Be.getTime())||ma(Be,he(o,G,Be))};if(ue){let Be,Dt;const $t=ne(),Hr=R.type===Uv.BLUR||R.type===Uv.FOCUS_OUT,wl=!yle(ue._f)&&!t.resolver&&!he(r.errors,G)&&!ue._f.deps||ble(Hr,he(r.touchedFields,G),r.isSubmitted,p,f),na=cD(G,s,Hr);ut(o,G,$t),Hr?(ue._f.onBlur&&ue._f.onBlur(R),l&&l(0)):ue._f.onChange&&ue._f.onChange(R);const lo=E(G,$t,Hr,!1),Xc=!Xr(lo)||na;if(!Hr&&d.values.next({name:G,type:R.type,values:{...o}}),wl)return c.isValid&&(e.mode==="onBlur"?Hr&&g():g()),Xc&&d.state.next({name:G,...na?{}:lo});if(!Hr&&na&&d.state.next({...r}),t.resolver){const{errors:ds}=await A([G]);if(Oe($t),pe){const Sh=gD(r.errors,n,G),q=gD(ds,n,Sh.name||G);Be=q.error,G=q.name,Dt=Xr(ds)}}else b([G],!0),Be=(await mD(ue,o,m,t.shouldUseNativeValidation))[G],b([G]),Oe($t),pe&&(Be?Dt=!1:c.isValid&&(Dt=await D(n,!0)));pe&&(ue._f.deps&&_(ue._f.deps),C(G,Dt,Be,lo))}},$=(R,W)=>{if(he(r.errors,W)&&R.focus)return R.focus(),1},_=async(R,W={})=>{let G,pe;const ue=tf(R);if(t.resolver){const ne=await T(Ut(R)?R:ue);G=Xr(ne),pe=R?!ue.some(Oe=>he(ne,Oe)):G}else R?(pe=(await Promise.all(ue.map(async ne=>{const Oe=he(n,ne);return await D(Oe&&Oe._f?{[ne]:Oe}:Oe)}))).every(Boolean),!(!pe&&!r.isValid)&&g()):pe=G=await D(n);return d.state.next({...!Gi(R)||c.isValid&&G!==r.isValid?{}:{name:R},...t.resolver||!R?{isValid:G}:{},errors:r.errors}),W.shouldFocus&&!pe&&rf(n,$,R?ue:s.mount),pe},O=R=>{const W={...a.mount?o:i};return Ut(R)?W:Gi(R)?he(W,R):R.map(G=>he(W,G))},z=(R,W)=>({invalid:!!he((W||r).errors,R),isDirty:!!he((W||r).dirtyFields,R),error:he((W||r).errors,R),isValidating:!!he(r.validatingFields,R),isTouched:!!he((W||r).touchedFields,R)}),Y=R=>{R&&tf(R).forEach(W=>Qt(r.errors,W)),d.state.next({errors:R?r.errors:{}})},re=(R,W,G)=>{const pe=(he(n,R,{_f:{}})._f||{}).ref,ue=he(r.errors,R)||{},{ref:ne,message:Oe,type:Be,...Dt}=ue;ut(r.errors,R,{...Dt,...W,ref:pe}),d.state.next({name:R,errors:r.errors,isValid:!1}),G&&G.shouldFocus&&pe&&pe.focus&&pe.focus()},se=(R,W)=>wo(R)?d.values.subscribe({next:G=>R(L(void 0,W),G)}):L(R,W,!0),de=(R,W={})=>{for(const G of R?tf(R):s.mount)s.mount.delete(G),s.array.delete(G),W.keepValue||(Qt(n,G),Qt(o,G)),!W.keepError&&Qt(r.errors,G),!W.keepDirty&&Qt(r.dirtyFields,G),!W.keepTouched&&Qt(r.touchedFields,G),!W.keepIsValidating&&Qt(r.validatingFields,G),!t.shouldUnregister&&!W.keepDefaultValue&&Qt(i,G);d.values.next({values:{...o}}),d.state.next({...r,...W.keepDirty?{isDirty:j()}:{}}),!W.keepIsValid&&g()},X=({disabled:R,name:W,field:G,fields:pe,value:ue})=>{if(Hn(R)&&a.mount||R){const ne=R?void 0:Ut(ue)?$0(G?G._f:he(pe,W)._f):ue;ut(o,W,ne),E(W,ne,!1,!1,!0)}},oe=(R,W={})=>{let G=he(n,R);const pe=Hn(W.disabled)||Hn(e.disabled);return ut(n,R,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:R}},name:R,mount:!0,...W}}),s.mount.add(R),G?X({field:G,disabled:Hn(W.disabled)?W.disabled:e.disabled,name:R,value:W.value}):S(R,!0,W.value),{...pe?{disabled:W.disabled||e.disabled}:{},...t.progressive?{required:!!W.required,min:hd(W.min),max:hd(W.max),minLength:hd(W.minLength),maxLength:hd(W.maxLength),pattern:hd(W.pattern)}:{},name:R,onChange:I,onBlur:I,ref:ue=>{if(ue){oe(R,W),G=he(n,R);const ne=Ut(ue.value)&&ue.querySelectorAll&&ue.querySelectorAll("input,select,textarea")[0]||ue,Oe=mle(ne),Be=G._f.refs||[];if(Oe?Be.find(Dt=>Dt===ne):ne===G._f.ref)return;ut(n,R,{_f:{...G._f,...Oe?{refs:[...Be.filter(R0),ne,...Array.isArray(he(i,R))?[{}]:[]],ref:{type:ne.type,name:R}}:{ref:ne}}}),S(R,!1,void 0,ne)}else G=he(n,R,{}),G._f&&(G._f.mount=!1),(t.shouldUnregister||W.shouldUnregister)&&!(W4(s.array,R)&&a.action)&&s.unMount.add(R)}}},K=()=>t.shouldFocusError&&rf(n,$,s.mount),J=R=>{Hn(R)&&(d.state.next({disabled:R}),rf(n,(W,G)=>{const pe=he(n,G);pe&&(W.disabled=pe._f.disabled||R,Array.isArray(pe._f.refs)&&pe._f.refs.forEach(ue=>{ue.disabled=pe._f.disabled||R}))},0,!1))},ee=(R,W)=>async G=>{let pe;G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let ue=Kr(o);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:ne,values:Oe}=await A();r.errors=ne,ue=Oe}else await D(n);if(Qt(r.errors,"root"),Xr(r.errors)){d.state.next({errors:{}});try{await R(ue,G)}catch(ne){pe=ne}}else W&&await W({...r.errors},G),K(),setTimeout(K);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Xr(r.errors)&&!pe,submitCount:r.submitCount+1,errors:r.errors}),pe)throw pe},H=(R,W={})=>{he(n,R)&&(Ut(W.defaultValue)?U(R,Kr(he(i,R))):(U(R,W.defaultValue),ut(i,R,Kr(W.defaultValue))),W.keepTouched||Qt(r.touchedFields,R),W.keepDirty||(Qt(r.dirtyFields,R),r.isDirty=W.defaultValue?j(R,Kr(he(i,R))):j()),W.keepError||(Qt(r.errors,R),c.isValid&&g()),d.state.next({...r}))},Pe=(R,W={})=>{const G=R?Kr(R):i,pe=Kr(G),ue=Xr(R),ne=ue?i:pe;if(W.keepDefaultValues||(i=G),!W.keepValues){if(W.keepDirtyValues){const Oe=new Set([...s.mount,...Object.keys(pd(i,o))]);for(const Be of Array.from(Oe))he(r.dirtyFields,Be)?ut(ne,Be,he(o,Be)):U(Be,he(ne,Be))}else{if(MA&&Ut(R))for(const Oe of s.mount){const Be=he(n,Oe);if(Be&&Be._f){const Dt=Array.isArray(Be._f.refs)?Be._f.refs[0]:Be._f.ref;if(zv(Dt)){const $t=Dt.closest("form");if($t){$t.reset();break}}}}n={}}o=e.shouldUnregister?W.keepDefaultValues?Kr(i):{}:Kr(ne),d.array.next({values:{...ne}}),d.values.next({values:{...ne}})}s={mount:W.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!c.isValid||!!W.keepIsValid||!!W.keepDirtyValues,a.watch=!!e.shouldUnregister,d.state.next({submitCount:W.keepSubmitCount?r.submitCount:0,isDirty:ue?!1:W.keepDirty?r.isDirty:!!(W.keepDefaultValues&&!ma(R,i)),isSubmitted:W.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:ue?{}:W.keepDirtyValues?W.keepDefaultValues&&o?pd(i,o):r.dirtyFields:W.keepDefaultValues&&R?pd(i,R):W.keepDirty?r.dirtyFields:{},touchedFields:W.keepTouched?r.touchedFields:{},errors:W.keepErrors?r.errors:{},isSubmitSuccessful:W.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},le=(R,W)=>Pe(wo(R)?R(o):R,W);return{control:{register:oe,unregister:de,getFieldState:z,handleSubmit:ee,setError:re,_executeSchema:A,_getWatch:L,_getDirty:j,_updateValid:g,_removeUnmounted:N,_updateFieldArray:y,_updateDisabledField:X,_getFieldArray:k,_reset:Pe,_resetDefaultValues:()=>wo(t.defaultValues)&&t.defaultValues().then(R=>{le(R,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:R=>{r={...r,...R}},_disableForm:J,_subjects:d,_proxyFormState:c,_setErrors:P,get _fields(){return n},get _formValues(){return o},get _state(){return a},set _state(R){a=R},get _defaultValues(){return i},get _names(){return s},set _names(R){s=R},get _formState(){return r},set _formState(R){r=R},get _options(){return t},set _options(R){t={...t,...R}}},trigger:_,register:oe,handleSubmit:ee,watch:se,setValue:U,getValues:O,reset:le,resetField:H,clearErrors:Y,unregister:de,setError:re,setFocus:(R,W={})=>{const G=he(n,R),pe=G&&G._f;if(pe){const ue=pe.refs?pe.refs[0]:pe.ref;ue.focus&&(ue.focus(),W.shouldSelect&&ue.select())}},getFieldState:z}}function Dc(e={}){const t=M.useRef(),r=M.useRef(),[n,i]=M.useState({isDirty:!1,isValidating:!1,isLoading:wo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:wo(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Sle(e),formState:n});const o=t.current.control;return o._options=e,RA({subject:o._subjects.state,next:a=>{q4(a,o._proxyFormState,o._updateFormState,!0)&&i({...o._formState})}}),M.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),M.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==n.isDirty&&o._subjects.state.next({isDirty:a})}},[o,n.isDirty]),M.useEffect(()=>{e.values&&!ma(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,i(a=>({...a}))):o._resetDefaultValues()},[e.values,o]),M.useEffect(()=>{e.errors&&o._setErrors(e.errors)},[e.errors,o]),M.useEffect(()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),M.useEffect(()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})},[e.shouldUnregister,o]),M.useEffect(()=>{t.current&&(t.current.watch=t.current.watch.bind({}))},[n]),t.current.formState=K4(n,o),t.current}const yD=(e,t,r)=>{if(e&&"reportValidity"in e){const n=he(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},iU=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?yD(n.ref,r,e):n.refs&&n.refs.forEach(i=>yD(i,r,e))}},Ple=(e,t)=>{t.shouldUseNativeValidation&&iU(e,t);const r={};for(const n in e){const i=he(t.fields,n),o=Object.assign(e[n]||{},{ref:i&&i.ref});if(Ele(t.names||Object.keys(e),n)){const a=Object.assign({},he(r,n));ut(a,"root",o),ut(r,n,a)}else ut(r,n,o)}return r},Ele=(e,t)=>e.some(r=>r.startsWith(t+"."));var Cle=function(e,t){for(var r={};e.length;){var n=e[0],i=n.code,o=n.message,a=n.path.join(".");if(!r[a])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[a]={message:s.message,type:s.code}}else r[a]={message:o,type:i};if("unionErrors"in n&&n.unionErrors.forEach(function(c){return c.errors.forEach(function(d){return e.push(d)})}),t){var l=r[a].types,u=l&&l[n.code];r[a]=Z4(a,t,r,i,u?[].concat(u,n.message):n.message)}e.shift()}return r},kc=function(e,t,r){return r===void 0&&(r={}),function(n,i,o){try{return Promise.resolve(function(a,s){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return o.shouldUseNativeValidation&&iU({},o),{errors:{},values:r.raw?n:u}})}catch(u){return s(u)}return l&&l.then?l.then(void 0,s):l}(0,function(a){if(function(s){return Array.isArray(s==null?void 0:s.errors)}(a))return{values:{},errors:Ple(Cle(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},nt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function r(i){throw new Error}e.assertNever=r,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(nt||(nt={}));var bD;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(bD||(bD={}));const Ee=nt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Es=e=>{switch(typeof e){case"undefined":return Ee.undefined;case"string":return Ee.string;case"number":return isNaN(e)?Ee.nan:Ee.number;case"boolean":return Ee.boolean;case"function":return Ee.function;case"bigint":return Ee.bigint;case"symbol":return Ee.symbol;case"object":return Array.isArray(e)?Ee.array:e===null?Ee.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ee.promise:typeof Map<"u"&&e instanceof Map?Ee.map:typeof Set<"u"&&e instanceof Set?Ee.set:typeof Date<"u"&&e instanceof Date?Ee.date:Ee.object;default:return Ee.unknown}},ae=nt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ei extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(o){return o.message},n={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,l=0;for(;lr.message){const r={},n=[];for(const i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}ei.create=e=>new ei(e);const Wf=(e,t)=>{let r;switch(e.code){case ae.invalid_type:e.received===Ee.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ae.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,nt.jsonStringifyReplacer)}`;break;case ae.unrecognized_keys:r=`Unrecognized key(s) in object: ${nt.joinValues(e.keys,", ")}`;break;case ae.invalid_union:r="Invalid input";break;case ae.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${nt.joinValues(e.options)}`;break;case ae.invalid_enum_value:r=`Invalid enum value. Expected ${nt.joinValues(e.options)}, received '${e.received}'`;break;case ae.invalid_arguments:r="Invalid function arguments";break;case ae.invalid_return_type:r="Invalid function return type";break;case ae.invalid_date:r="Invalid date";break;case ae.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:nt.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ae.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ae.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ae.custom:r="Invalid input";break;case ae.invalid_intersection_types:r="Intersection results could not be merged";break;case ae.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ae.not_finite:r="Number must be finite";break;default:r=t.defaultError,nt.assertNever(e)}return{message:r}};let Ale=Wf;function c1(){return Ale}const d1=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,o=[...r,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)s=u(a,{data:t,defaultError:s}).message;return{...i,path:o,message:s}};function ye(e,t){const r=c1(),n=d1({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Wf?void 0:Wf].filter(i=>!!i)});e.common.issues.push(n)}class Vr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const i of r){if(i.status==="aborted")return Fe;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const i of r){const o=await i.key,a=await i.value;n.push({key:o,value:a})}return Vr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return Fe;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(n[o.value]=a.value)}return{status:t.value,value:n}}}const Fe=Object.freeze({status:"aborted"}),Md=e=>({status:"dirty",value:e}),un=e=>({status:"valid",value:e}),xD=e=>e.status==="aborted",wD=e=>e.status==="dirty",Gv=e=>e.status==="valid",Kv=e=>typeof Promise<"u"&&e instanceof Promise;function qv(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function oU(e,t,r,n,i){if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var _e;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(_e||(_e={}));var Id,Rd;class io{constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const SD=(e,t)=>{if(Gv(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new ei(e.common.issues);return this._error=r,this._error}}};function ze(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>{var l,u;const{message:c}=e;return a.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:(l=c??n)!==null&&l!==void 0?l:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(u=c??r)!==null&&u!==void 0?u:s.defaultError}},description:i}}class Xe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Es(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Es(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Vr,ctx:{common:t.parent.common,data:t.data,parsedType:Es(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Kv(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Es(t)},o=this._parseSync({data:t,path:i.path,parent:i});return SD(i,o)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Es(t)},i=this._parse({data:t,path:n.path,parent:n}),o=await(Kv(i)?i:Promise.resolve(i));return SD(n,o)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:ae.custom,...n(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new zo({schema:this,typeName:$e.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return _o.create(this,this._def)}nullable(){return al.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ji.create(this,this._def)}promise(){return Gf.create(this,this._def)}or(t){return Zv.create([this,t],this._def)}and(t){return Qv.create(this,t,this._def)}transform(t){return new zo({...ze(this._def),schema:this,typeName:$e.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new ng({...ze(this._def),innerType:this,defaultValue:r,typeName:$e.ZodDefault})}brand(){return new uU({typeName:$e.ZodBranded,type:this,...ze(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new ig({...ze(this._def),innerType:this,catchValue:r,typeName:$e.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return hb.create(this,t)}readonly(){return og.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Tle=/^c[^\s-]{8,}$/i,Ole=/^[0-9a-z]+$/,_le=/^[0-9A-HJKMNP-TV-Z]{26}$/,jle=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Nle=/^[a-z0-9_-]{21}$/i,Dle=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,kle=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Mle="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let L0;const Ile=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rle=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,$le=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aU="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Lle=new RegExp(`^${aU}$`);function sU(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function Fle(e){return new RegExp(`^${sU(e)}$`)}function Ble(e){let t=`${aU}T${sU(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Vle(e,t){return!!((t==="v4"||!t)&&Ile.test(e)||(t==="v6"||!t)&&Rle.test(e))}class So extends Xe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ee.string){const o=this._getOrReturnCtx(t);return ye(o,{code:ae.invalid_type,expected:Ee.string,received:o.parsedType}),Fe}const n=new Vr;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.lengtho.value&&(i=this._getOrReturnCtx(t,i),ye(i,{code:ae.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.lengtht.test(i),{validation:r,code:ae.invalid_string,..._e.errToObj(n)})}_addCheck(t){return new So({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",..._e.errToObj(t)})}url(t){return this._addCheck({kind:"url",..._e.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",..._e.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",..._e.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",..._e.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",..._e.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",..._e.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",..._e.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",..._e.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",..._e.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,..._e.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,..._e.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",..._e.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,..._e.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,..._e.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,..._e.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,..._e.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,..._e.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,..._e.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,..._e.errToObj(r)})}nonempty(t){return this.min(1,_e.errToObj(t))}trim(){return new So({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new So({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new So({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new So({checks:[],typeName:$e.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ze(e)})};function Ule(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class Yu extends Xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ee.number){const o=this._getOrReturnCtx(t);return ye(o,{code:ae.invalid_type,expected:Ee.number,received:o.parsedType}),Fe}let n;const i=new Vr;for(const o of this._def.checks)o.kind==="int"?nt.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ye(n,{code:ae.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),ye(n,{code:ae.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Ule(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),ye(n,{code:ae.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ye(n,{code:ae.not_finite,message:o.message}),i.dirty()):nt.assertNever(o);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,_e.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_e.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_e.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_e.toString(r))}setLimit(t,r,n,i){return new Yu({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_e.toString(i)}]})}_addCheck(t){return new Yu({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:_e.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_e.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:_e.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_e.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_e.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&nt.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew Yu({checks:[],typeName:$e.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ze(e)});class Xu extends Xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Ee.bigint){const o=this._getOrReturnCtx(t);return ye(o,{code:ae.invalid_type,expected:Ee.bigint,received:o.parsedType}),Fe}let n;const i=new Vr;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.datao.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),ye(n,{code:ae.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ye(n,{code:ae.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):nt.assertNever(o);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,_e.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_e.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_e.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_e.toString(r))}setLimit(t,r,n,i){return new Xu({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_e.toString(i)}]})}_addCheck(t){return new Xu({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_e.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_e.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_e.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new Xu({checks:[],typeName:$e.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ze(e)})};class f1 extends Xe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ee.boolean){const n=this._getOrReturnCtx(t);return ye(n,{code:ae.invalid_type,expected:Ee.boolean,received:n.parsedType}),Fe}return un(t.data)}}f1.create=e=>new f1({typeName:$e.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ze(e)});class Hf extends Xe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ee.date){const o=this._getOrReturnCtx(t);return ye(o,{code:ae.invalid_type,expected:Ee.date,received:o.parsedType}),Fe}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ye(o,{code:ae.invalid_date}),Fe}const n=new Vr;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()o.value&&(i=this._getOrReturnCtx(t,i),ye(i,{code:ae.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):nt.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Hf({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:_e.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:_e.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Hf({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:$e.ZodDate,...ze(e)});class p1 extends Xe{_parse(t){if(this._getType(t)!==Ee.symbol){const n=this._getOrReturnCtx(t);return ye(n,{code:ae.invalid_type,expected:Ee.symbol,received:n.parsedType}),Fe}return un(t.data)}}p1.create=e=>new p1({typeName:$e.ZodSymbol,...ze(e)});class Yv extends Xe{_parse(t){if(this._getType(t)!==Ee.undefined){const n=this._getOrReturnCtx(t);return ye(n,{code:ae.invalid_type,expected:Ee.undefined,received:n.parsedType}),Fe}return un(t.data)}}Yv.create=e=>new Yv({typeName:$e.ZodUndefined,...ze(e)});class Xv extends Xe{_parse(t){if(this._getType(t)!==Ee.null){const n=this._getOrReturnCtx(t);return ye(n,{code:ae.invalid_type,expected:Ee.null,received:n.parsedType}),Fe}return un(t.data)}}Xv.create=e=>new Xv({typeName:$e.ZodNull,...ze(e)});class h1 extends Xe{constructor(){super(...arguments),this._any=!0}_parse(t){return un(t.data)}}h1.create=e=>new h1({typeName:$e.ZodAny,...ze(e)});class hu extends Xe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return un(t.data)}}hu.create=e=>new hu({typeName:$e.ZodUnknown,...ze(e)});class Xa extends Xe{_parse(t){const r=this._getOrReturnCtx(t);return ye(r,{code:ae.invalid_type,expected:Ee.never,received:r.parsedType}),Fe}}Xa.create=e=>new Xa({typeName:$e.ZodNever,...ze(e)});class m1 extends Xe{_parse(t){if(this._getType(t)!==Ee.undefined){const n=this._getOrReturnCtx(t);return ye(n,{code:ae.invalid_type,expected:Ee.void,received:n.parsedType}),Fe}return un(t.data)}}m1.create=e=>new m1({typeName:$e.ZodVoid,...ze(e)});class Ji extends Xe{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==Ee.array)return ye(r,{code:ae.invalid_type,expected:Ee.array,received:r.parsedType}),Fe;if(i.exactLength!==null){const a=r.data.length>i.exactLength.value,s=r.data.lengthi.maxLength.value&&(ye(r,{code:ae.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>i.type._parseAsync(new io(r,a,r.path,s)))).then(a=>Vr.mergeArray(n,a));const o=[...r.data].map((a,s)=>i.type._parseSync(new io(r,a,r.path,s)));return Vr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new Ji({...this._def,minLength:{value:t,message:_e.toString(r)}})}max(t,r){return new Ji({...this._def,maxLength:{value:t,message:_e.toString(r)}})}length(t,r){return new Ji({...this._def,exactLength:{value:t,message:_e.toString(r)}})}nonempty(t){return this.min(1,t)}}Ji.create=(e,t)=>new Ji({type:e,minLength:null,maxLength:null,exactLength:null,typeName:$e.ZodArray,...ze(t)});function Dl(e){if(e instanceof Bt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=_o.create(Dl(n))}return new Bt({...e._def,shape:()=>t})}else return e instanceof Ji?new Ji({...e._def,type:Dl(e.element)}):e instanceof _o?_o.create(Dl(e.unwrap())):e instanceof al?al.create(Dl(e.unwrap())):e instanceof Uo?Uo.create(e.items.map(t=>Dl(t))):e}class Bt extends Xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=nt.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==Ee.object){const u=this._getOrReturnCtx(t);return ye(u,{code:ae.invalid_type,expected:Ee.object,received:u.parsedType}),Fe}const{status:n,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Xa&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||s.push(u);const l=[];for(const u of a){const c=o[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new io(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Xa){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")s.length>0&&(ye(i,{code:ae.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new io(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>Vr.mergeObjectSync(n,u)):Vr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return _e.errToObj,new Bt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,o,a,s;const l=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,r,n).message)!==null&&a!==void 0?a:n.defaultError;return r.code==="unrecognized_keys"?{message:(s=_e.errToObj(t).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new Bt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Bt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Bt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:$e.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Bt({...this._def,catchall:t})}pick(t){const r={};return nt.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Bt({...this._def,shape:()=>r})}omit(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Bt({...this._def,shape:()=>r})}deepPartial(){return Dl(this)}partial(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}),new Bt({...this._def,shape:()=>r})}required(t){const r={};return nt.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof _o;)o=o._def.innerType;r[n]=o}}),new Bt({...this._def,shape:()=>r})}keyof(){return lU(nt.objectKeys(this.shape))}}Bt.create=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strip",catchall:Xa.create(),typeName:$e.ZodObject,...ze(t)});Bt.strictCreate=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strict",catchall:Xa.create(),typeName:$e.ZodObject,...ze(t)});Bt.lazycreate=(e,t)=>new Bt({shape:e,unknownKeys:"strip",catchall:Xa.create(),typeName:$e.ZodObject,...ze(t)});class Zv extends Xe{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new ei(s.ctx.common.issues));return ye(r,{code:ae.invalid_union,unionErrors:a}),Fe}if(r.common.async)return Promise.all(n.map(async o=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},c=l._parseSync({data:r.data,path:r.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new ei(l));return ye(r,{code:ae.invalid_union,unionErrors:s}),Fe}}get options(){return this._def.options}}Zv.create=(e,t)=>new Zv({options:e,typeName:$e.ZodUnion,...ze(t)});const mo=e=>e instanceof eg?mo(e.schema):e instanceof zo?mo(e.innerType()):e instanceof tg?[e.value]:e instanceof ol?e.options:e instanceof rg?nt.objectValues(e.enum):e instanceof ng?mo(e._def.innerType):e instanceof Yv?[void 0]:e instanceof Xv?[null]:e instanceof _o?[void 0,...mo(e.unwrap())]:e instanceof al?[null,...mo(e.unwrap())]:e instanceof uU||e instanceof og?mo(e.unwrap()):e instanceof ig?mo(e._def.innerType):[];class FA extends Xe{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ee.object)return ye(r,{code:ae.invalid_type,expected:Ee.object,received:r.parsedType}),Fe;const n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(ye(r,{code:ae.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Fe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const i=new Map;for(const o of r){const a=mo(o.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new FA({typeName:$e.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...ze(n)})}}function v1(e,t){const r=Es(e),n=Es(t);if(e===t)return{valid:!0,data:e};if(r===Ee.object&&n===Ee.object){const i=nt.objectKeys(t),o=nt.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const l=v1(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(r===Ee.array&&n===Ee.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o{if(xD(o)||xD(a))return Fe;const s=v1(o.value,a.value);return s.valid?((wD(o)||wD(a))&&r.dirty(),{status:r.value,value:s.data}):(ye(n,{code:ae.invalid_intersection_types}),Fe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Qv.create=(e,t,r)=>new Qv({left:e,right:t,typeName:$e.ZodIntersection,...ze(r)});class Uo extends Xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ee.array)return ye(n,{code:ae.invalid_type,expected:Ee.array,received:n.parsedType}),Fe;if(n.data.lengththis._def.items.length&&(ye(n,{code:ae.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((a,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new io(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>Vr.mergeArray(r,a)):Vr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Uo({...this._def,rest:t})}}Uo.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Uo({items:e,typeName:$e.ZodTuple,rest:null,...ze(t)})};class Jv extends Xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ee.object)return ye(n,{code:ae.invalid_type,expected:Ee.object,received:n.parsedType}),Fe;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in n.data)i.push({key:o._parse(new io(n,s,n.path,s)),value:a._parse(new io(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Vr.mergeObjectAsync(r,i):Vr.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Xe?new Jv({keyType:t,valueType:r,typeName:$e.ZodRecord,...ze(n)}):new Jv({keyType:So.create(),valueType:t,typeName:$e.ZodRecord,...ze(r)})}}class g1 extends Xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ee.map)return ye(n,{code:ae.invalid_type,expected:Ee.map,received:n.parsedType}),Fe;const i=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([s,l],u)=>({key:i._parse(new io(n,s,n.path,[u,"key"])),value:o._parse(new io(n,l,n.path,[u,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return Fe;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),s.set(u.value,c.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of a){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return Fe;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),s.set(u.value,c.value)}return{status:r.value,value:s}}}}g1.create=(e,t,r)=>new g1({valueType:t,keyType:e,typeName:$e.ZodMap,...ze(r)});class Zu extends Xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ee.set)return ye(n,{code:ae.invalid_type,expected:Ee.set,received:n.parsedType}),Fe;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(ye(n,{code:ae.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const o=this._def.valueType;function a(l){const u=new Set;for(const c of l){if(c.status==="aborted")return Fe;c.status==="dirty"&&r.dirty(),u.add(c.value)}return{status:r.value,value:u}}const s=[...n.data.values()].map((l,u)=>o._parse(new io(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,r){return new Zu({...this._def,minSize:{value:t,message:_e.toString(r)}})}max(t,r){return new Zu({...this._def,maxSize:{value:t,message:_e.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Zu.create=(e,t)=>new Zu({valueType:e,minSize:null,maxSize:null,typeName:$e.ZodSet,...ze(t)});class nf extends Xe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ee.function)return ye(r,{code:ae.invalid_type,expected:Ee.function,received:r.parsedType}),Fe;function n(s,l){return d1({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,c1(),Wf].filter(u=>!!u),issueData:{code:ae.invalid_arguments,argumentsError:l}})}function i(s,l){return d1({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,c1(),Wf].filter(u=>!!u),issueData:{code:ae.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Gf){const s=this;return un(async function(...l){const u=new ei([]),c=await s._def.args.parseAsync(l,o).catch(p=>{throw u.addIssue(n(l,p)),u}),d=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(p=>{throw u.addIssue(i(d,p)),u})})}else{const s=this;return un(function(...l){const u=s._def.args.safeParse(l,o);if(!u.success)throw new ei([n(l,u.error)]);const c=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new ei([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new nf({...this._def,args:Uo.create(t).rest(hu.create())})}returns(t){return new nf({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new nf({args:t||Uo.create([]).rest(hu.create()),returns:r||hu.create(),typeName:$e.ZodFunction,...ze(n)})}}class eg extends Xe{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}eg.create=(e,t)=>new eg({getter:e,typeName:$e.ZodLazy,...ze(t)});class tg extends Xe{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ye(r,{received:r.data,code:ae.invalid_literal,expected:this._def.value}),Fe}return{status:"valid",value:t.data}}get value(){return this._def.value}}tg.create=(e,t)=>new tg({value:e,typeName:$e.ZodLiteral,...ze(t)});function lU(e,t){return new ol({values:e,typeName:$e.ZodEnum,...ze(t)})}class ol extends Xe{constructor(){super(...arguments),Id.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ye(r,{expected:nt.joinValues(n),received:r.parsedType,code:ae.invalid_type}),Fe}if(qv(this,Id)||oU(this,Id,new Set(this._def.values)),!qv(this,Id).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ye(r,{received:r.data,code:ae.invalid_enum_value,options:n}),Fe}return un(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ol.create(t,{...this._def,...r})}exclude(t,r=this._def){return ol.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Id=new WeakMap;ol.create=lU;class rg extends Xe{constructor(){super(...arguments),Rd.set(this,void 0)}_parse(t){const r=nt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Ee.string&&n.parsedType!==Ee.number){const i=nt.objectValues(r);return ye(n,{expected:nt.joinValues(i),received:n.parsedType,code:ae.invalid_type}),Fe}if(qv(this,Rd)||oU(this,Rd,new Set(nt.getValidEnumValues(this._def.values))),!qv(this,Rd).has(t.data)){const i=nt.objectValues(r);return ye(n,{received:n.data,code:ae.invalid_enum_value,options:i}),Fe}return un(t.data)}get enum(){return this._def.values}}Rd=new WeakMap;rg.create=(e,t)=>new rg({values:e,typeName:$e.ZodNativeEnum,...ze(t)});class Gf extends Xe{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ee.promise&&r.common.async===!1)return ye(r,{code:ae.invalid_type,expected:Ee.promise,received:r.parsedType}),Fe;const n=r.parsedType===Ee.promise?r.data:Promise.resolve(r.data);return un(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Gf.create=(e,t)=>new Gf({type:e,typeName:$e.ZodPromise,...ze(t)});class zo extends Xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{ye(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return Fe;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?Fe:l.status==="dirty"||r.value==="dirty"?Md(l.value):l});{if(r.value==="aborted")return Fe;const s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?Fe:s.status==="dirty"||r.value==="dirty"?Md(s.value):s}}if(i.type==="refinement"){const a=s=>{const l=i.refinement(s,o);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Fe:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?Fe:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Gv(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Gv(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:r.value,value:s})):a);nt.assertNever(i)}}zo.create=(e,t,r)=>new zo({schema:e,typeName:$e.ZodEffects,effect:t,...ze(r)});zo.createWithPreprocess=(e,t,r)=>new zo({schema:t,effect:{type:"preprocess",transform:e},typeName:$e.ZodEffects,...ze(r)});class _o extends Xe{_parse(t){return this._getType(t)===Ee.undefined?un(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}_o.create=(e,t)=>new _o({innerType:e,typeName:$e.ZodOptional,...ze(t)});class al extends Xe{_parse(t){return this._getType(t)===Ee.null?un(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}al.create=(e,t)=>new al({innerType:e,typeName:$e.ZodNullable,...ze(t)});class ng extends Xe{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===Ee.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}ng.create=(e,t)=>new ng({innerType:e,typeName:$e.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ze(t)});class ig extends Xe{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Kv(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ei(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ei(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}ig.create=(e,t)=>new ig({innerType:e,typeName:$e.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ze(t)});class y1 extends Xe{_parse(t){if(this._getType(t)!==Ee.nan){const n=this._getOrReturnCtx(t);return ye(n,{code:ae.invalid_type,expected:Ee.nan,received:n.parsedType}),Fe}return{status:"valid",value:t.data}}}y1.create=e=>new y1({typeName:$e.ZodNaN,...ze(e)});class uU extends Xe{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class hb extends Xe{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Fe:o.status==="dirty"?(r.dirty(),Md(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Fe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new hb({in:t,out:r,typeName:$e.ZodPipeline})}}class og extends Xe{_parse(t){const r=this._def.innerType._parse(t),n=i=>(Gv(i)&&(i.value=Object.freeze(i.value)),i);return Kv(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}og.create=(e,t)=>new og({innerType:e,typeName:$e.ZodReadonly,...ze(t)});Bt.lazycreate;var $e;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})($e||($e={}));const wn=So.create;Yu.create;y1.create;Xu.create;f1.create;Hf.create;p1.create;Yv.create;Xv.create;h1.create;hu.create;Xa.create;m1.create;Ji.create;const Mc=Bt.create;Bt.strictCreate;Zv.create;FA.create;Qv.create;Uo.create;Jv.create;g1.create;Zu.create;nf.create;eg.create;tg.create;ol.create;rg.create;Gf.create;zo.create;_o.create;al.create;zo.createWithPreprocess;hb.create;var BA="Dialog",[cU,dU]=Ec(BA),[zle,Mi]=cU(BA),fU=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=w.useRef(null),l=w.useRef(null),[u=!1,c]=Vu({prop:n,defaultProp:i,onChange:o});return h.jsx(zle,{scope:t,triggerRef:s,contentRef:l,contentId:Oo(),titleId:Oo(),descriptionId:Oo(),open:u,onOpenChange:c,onOpenToggle:w.useCallback(()=>c(d=>!d),[c]),modal:a,children:r})};fU.displayName=BA;var pU="DialogTrigger",hU=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Mi(pU,r),o=st(t,i.triggerRef);return h.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":zA(i.open),...n,ref:o,onClick:Ce(e.onClick,i.onOpenToggle)})});hU.displayName=pU;var VA="DialogPortal",[Wle,mU]=cU(VA,{forceMount:void 0}),vU=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=Mi(VA,t);return h.jsx(Wle,{scope:t,forceMount:r,children:w.Children.map(n,a=>h.jsx(Yo,{present:r||o.open,children:h.jsx(Vp,{asChild:!0,container:i,children:a})}))})};vU.displayName=VA;var ag="DialogOverlay",gU=w.forwardRef((e,t)=>{const r=mU(ag,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=Mi(ag,e.__scopeDialog);return o.modal?h.jsx(Yo,{present:n||o.open,children:h.jsx(Hle,{...i,ref:t})}):null});gU.displayName=ag;var Hle=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Mi(ag,r);return h.jsx(ub,{as:Lo,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(Ke.div,{"data-state":zA(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),sl="DialogContent",yU=w.forwardRef((e,t)=>{const r=mU(sl,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=Mi(sl,e.__scopeDialog);return h.jsx(Yo,{present:n||o.open,children:o.modal?h.jsx(Gle,{...i,ref:t}):h.jsx(Kle,{...i,ref:t})})});yU.displayName=sl;var Gle=w.forwardRef((e,t)=>{const r=Mi(sl,e.__scopeDialog),n=w.useRef(null),i=st(t,r.contentRef,n);return w.useEffect(()=>{const o=n.current;if(o)return EA(o)},[]),h.jsx(bU,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ce(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ce(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Ce(e.onFocusOutside,o=>o.preventDefault())})}),Kle=w.forwardRef((e,t)=>{const r=Mi(sl,e.__scopeDialog),n=w.useRef(!1),i=w.useRef(!1);return h.jsx(bU,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=e.onCloseAutoFocus)==null||a.call(e,o),o.defaultPrevented||(n.current||(s=r.triggerRef.current)==null||s.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((u=r.triggerRef.current)==null?void 0:u.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),bU=w.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=Mi(sl,r),l=w.useRef(null),u=st(t,l);return hA(),h.jsxs(h.Fragment,{children:[h.jsx(rb,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(Bp,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":zA(s.open),...a,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Yle,{titleId:s.titleId}),h.jsx(Zle,{contentRef:l,descriptionId:s.descriptionId})]})]})}),UA="DialogTitle",xU=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Mi(UA,r);return h.jsx(Ke.h2,{id:i.titleId,...n,ref:t})});xU.displayName=UA;var wU="DialogDescription",SU=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Mi(wU,r);return h.jsx(Ke.p,{id:i.descriptionId,...n,ref:t})});SU.displayName=wU;var PU="DialogClose",EU=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Mi(PU,r);return h.jsx(Ke.button,{type:"button",...n,ref:t,onClick:Ce(e.onClick,()=>i.onOpenChange(!1))})});EU.displayName=PU;function zA(e){return e?"open":"closed"}var CU="DialogTitleWarning",[qle,AU]=kK(CU,{contentName:sl,titleName:UA,docsSlug:"dialog"}),Yle=({titleId:e})=>{const t=AU(CU),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Xle="DialogDescriptionWarning",Zle=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${AU(Xle).contentName}}.`;return w.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},TU=fU,Qle=hU,OU=vU,WA=gU,HA=yU,GA=xU,KA=SU,qA=EU;const is=TU,Jle=OU,_U=w.forwardRef(({className:e,...t},r)=>h.jsx(WA,{ref:r,className:Me("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-500",e),...t}));_U.displayName=WA.displayName;const Xo=w.forwardRef(({className:e,children:t,...r},n)=>h.jsxs(Jle,{children:[h.jsx(_U,{}),h.jsxs(HA,{ref:n,className:Me("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-90 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[60%] sm:rounded-lg backdrop-blur-sm",e),...r,children:[t,h.jsxs(qA,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(tF,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Xo.displayName=HA.displayName;const Zo=({className:e,...t})=>h.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Zo.displayName="DialogHeader";const jU=({className:e,...t})=>h.jsx("div",{className:Me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});jU.displayName="DialogFooter";const Qo=w.forwardRef(({className:e,...t},r)=>h.jsx(GA,{ref:r,className:Me("text-lg font-semibold leading-none tracking-tight",e),...t}));Qo.displayName=GA.displayName;const gl=w.forwardRef(({className:e,...t},r)=>h.jsx(KA,{ref:r,className:Me("text-sm text-muted-foreground",e),...t}));gl.displayName=KA.displayName;var eue="Label",NU=w.forwardRef((e,t)=>h.jsx(Ke.label,{...e,ref:t,onMouseDown:r=>{var i;r.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));NU.displayName=eue;var DU=NU;const tue=_y("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ns=w.forwardRef(({className:e,...t},r)=>h.jsx(DU,{ref:r,className:Me(tue(),e),...t}));Ns.displayName=DU.displayName;const Ic=sle,kU=w.createContext({}),Sn=({...e})=>h.jsx(kU.Provider,{value:{name:e.name},children:h.jsx(dle,{...e})}),mb=()=>{const e=w.useContext(kU),t=w.useContext(MU),{getFieldState:r,formState:n}=pb(),i=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},MU=w.createContext({}),Jr=w.forwardRef(({className:e,...t},r)=>{const n=w.useId();return h.jsx(MU.Provider,{value:{id:n},children:h.jsx("div",{ref:r,className:Me("space-y-2",e),...t})})});Jr.displayName="FormItem";const en=w.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:i}=mb();return h.jsx(Ns,{ref:r,className:Me(n&&"text-destructive",e),htmlFor:i,...t})});en.displayName="FormLabel";const tn=w.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:i,formMessageId:o}=mb();return h.jsx(Lo,{ref:t,id:n,"aria-describedby":r?`${i} ${o}`:`${i}`,"aria-invalid":!!r,...e})});tn.displayName="FormControl";const rue=w.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=mb();return h.jsx("p",{ref:r,id:n,className:Me("text-sm text-muted-foreground",e),...t})});rue.displayName="FormDescription";const rn=w.forwardRef(({className:e,children:t,...r},n)=>{const{error:i,formMessageId:o}=mb(),a=i?String(i==null?void 0:i.message):t;return a?h.jsx("p",{ref:n,id:o,className:Me("text-sm font-medium text-destructive",e),...r,children:a}):null});rn.displayName="FormMessage";const rr=w.forwardRef(({className:e,type:t,...r},n)=>h.jsx("input",{type:t,className:Me("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...r}));rr.displayName="Input";const nue=Mc({name:wn().min(2,{message:"Exercise name must be at least 2 characters."}),weight:wn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Weight must be a positive number."}),reps:wn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Reps must be a positive number."}),sets:wn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Sets must be a positive number."})});function iue({open:e,onOpenChange:t,onSubmit:r}){const n=Dc({resolver:kc(nue),defaultValues:{name:"",weight:"",reps:"",sets:""}});function i(o){r({name:o.name,weight:Number(o.weight),reps:Number(o.reps),sets:Number(o.sets)}),n.reset(),t(!1)}return h.jsx(is,{open:e,onOpenChange:t,children:h.jsxs(Xo,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[h.jsxs(Zo,{children:[h.jsx(Qo,{children:"Add Exercise"}),h.jsx(gl,{children:"What's your next challenge?"})]}),h.jsx(Ic,{...n,children:h.jsxs("form",{onSubmit:n.handleSubmit(i),className:"space-y-4",children:[h.jsx(Sn,{control:n.control,name:"name",render:({field:o})=>h.jsxs(Jr,{children:[h.jsx(en,{className:"text-foreground",children:"Exercise Name"}),h.jsx(tn,{children:h.jsx(rr,{placeholder:"e.g. Bench Press",...o})}),h.jsx(rn,{})]})}),h.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[h.jsx(Sn,{control:n.control,name:"weight",render:({field:o})=>h.jsxs(Jr,{children:[h.jsx(en,{className:"text-foreground",children:"Weight (kg)"}),h.jsx(tn,{children:h.jsx(rr,{type:"number",step:"any",placeholder:"e.g. 70.5",className:"placeholder:text-muted-foreground",...o})}),h.jsx(rn,{})]})}),h.jsx(Sn,{control:n.control,name:"reps",render:({field:o})=>h.jsxs(Jr,{children:[h.jsx(en,{className:"text-foreground",children:"Reps"}),h.jsx(tn,{children:h.jsx(rr,{type:"number",placeholder:"e.g. 8",className:"placeholder:text-muted-foreground",...o})}),h.jsx(rn,{})]})}),h.jsx(Sn,{control:n.control,name:"sets",render:({field:o})=>h.jsxs(Jr,{children:[h.jsx(en,{className:"text-foreground",children:"Sets"}),h.jsx(tn,{children:h.jsx(rr,{type:"number",placeholder:"e.g. 3",className:"placeholder:text-muted-foreground",...o})}),h.jsx(rn,{})]})})]}),h.jsx(Ne,{type:"submit",className:"w-full",children:"Add Exercise"})]})})]})})}var IU="AlertDialog",[oue,AIe]=Ec(IU,[dU]),Jo=dU(),RU=e=>{const{__scopeAlertDialog:t,...r}=e,n=Jo(t);return h.jsx(TU,{...n,...r,modal:!0})};RU.displayName=IU;var aue="AlertDialogTrigger",sue=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=Jo(r);return h.jsx(Qle,{...i,...n,ref:t})});sue.displayName=aue;var lue="AlertDialogPortal",$U=e=>{const{__scopeAlertDialog:t,...r}=e,n=Jo(t);return h.jsx(OU,{...n,...r})};$U.displayName=lue;var uue="AlertDialogOverlay",LU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=Jo(r);return h.jsx(WA,{...i,...n,ref:t})});LU.displayName=uue;var mu="AlertDialogContent",[cue,due]=oue(mu),FU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...i}=e,o=Jo(r),a=w.useRef(null),s=st(t,a),l=w.useRef(null);return h.jsx(qle,{contentName:mu,titleName:BU,docsSlug:"alert-dialog",children:h.jsx(cue,{scope:r,cancelRef:l,children:h.jsxs(HA,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Ce(i.onOpenAutoFocus,u=>{var c;u.preventDefault(),(c=l.current)==null||c.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[h.jsx(EL,{children:n}),h.jsx(pue,{contentRef:a})]})})})});FU.displayName=mu;var BU="AlertDialogTitle",VU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=Jo(r);return h.jsx(GA,{...i,...n,ref:t})});VU.displayName=BU;var UU="AlertDialogDescription",zU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=Jo(r);return h.jsx(KA,{...i,...n,ref:t})});zU.displayName=UU;var fue="AlertDialogAction",WU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=Jo(r);return h.jsx(qA,{...i,...n,ref:t})});WU.displayName=fue;var HU="AlertDialogCancel",GU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:i}=due(HU,r),o=Jo(r),a=st(t,i);return h.jsx(qA,{...o,...n,ref:a})});GU.displayName=HU;var pue=({contentRef:e})=>{const t=`\`${mu}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${mu}\` by passing a \`${UU}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${mu}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},hue=RU,mue=$U,KU=LU,qU=FU,YU=WU,XU=GU,ZU=VU,QU=zU;const YA=hue,vue=mue,JU=w.forwardRef(({className:e,...t},r)=>h.jsx(KU,{className:Me("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 duration-500",e),...t,ref:r}));JU.displayName=KU.displayName;const vb=w.forwardRef(({className:e,...t},r)=>h.jsxs(vue,{children:[h.jsx(JU,{}),h.jsx(qU,{ref:r,className:Me("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-90 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[60%] sm:rounded-lg backdrop-blur-sm",e),...t})]}));vb.displayName=qU.displayName;const gb=({className:e,...t})=>h.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});gb.displayName="AlertDialogHeader";const yb=({className:e,...t})=>h.jsx("div",{className:Me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});yb.displayName="AlertDialogFooter";const bb=w.forwardRef(({className:e,...t},r)=>h.jsx(ZU,{ref:r,className:Me("text-lg font-semibold",e),...t}));bb.displayName=ZU.displayName;const xb=w.forwardRef(({className:e,...t},r)=>h.jsx(QU,{ref:r,className:Me("text-sm text-muted-foreground",e),...t}));xb.displayName=QU.displayName;const wb=w.forwardRef(({className:e,...t},r)=>h.jsx(YU,{ref:r,className:Me(fA(),e),...t}));wb.displayName=YU.displayName;const Sb=w.forwardRef(({className:e,...t},r)=>h.jsx(XU,{ref:r,className:Me(fA({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Sb.displayName=XU.displayName;const gue=Mc({weight:wn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Weight must be a positive number."}),reps:wn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Reps must be a positive number."}),sets:wn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Sets must be a positive number."})});function yue({exercise:e,open:t,onOpenChange:r,onDelete:n,onRefresh:i}){const[o,a]=w.useState(!1),[s,l]=w.useState(e.name),[u,c]=w.useState([]),[d,f]=w.useState(!1),[p,m]=w.useState({open:!1,variationId:null,variationInfo:""}),{toast:v}=pl(),[g,b]=w.useState(null);M.useEffect(()=>{(async()=>{try{const D=await fetch("/api/user",{credentials:"include"});if(D.ok){const N=await D.json();b(N)}}catch{console.log("User not authenticated")}})()},[]);const y=Dc({resolver:kc(gue),defaultValues:{weight:e.weight.toString(),reps:e.reps.toString(),sets:e.sets.toString()}});w.useEffect(()=>{t&&e.id&&(x(),l(e.name),a(!1))},[t,e.id]),w.useEffect(()=>{if(t&&u.length>0){const T=u[0];y.reset({weight:T.targetWeight.toString(),reps:T.targetReps.toString(),sets:T.targetSets.toString()})}else t&&y.reset({weight:e.weight.toString(),reps:e.reps.toString(),sets:e.sets.toString()})},[t,u,e,y]);const x=async()=>{try{f(!0);const T=await fetch(`/api/v2/exercises/${e.id}/variations`,{credentials:"include"});if(T.ok){const D=await T.json();c(D)}else console.error("Failed to fetch variations:",T.status,T.statusText),c([])}catch(T){console.error("Error fetching variations:",T),c([])}finally{f(!1)}},P=async T=>{const D=Number(T.weight),N=Number(T.reps),j=Number(T.sets);if(u.some(k=>k.targetWeight===D&&k.targetReps===N&&k.targetSets===j)){v({title:"Variation Already Exists",description:`A variation with ${D}kg × ${N} reps × ${j} sets already exists for this exercise.`,variant:"destructive"});return}try{f(!0);const k=await fetch(`/api/v2/exercises/${e.id}/variations`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({targetWeight:D,targetReps:N,targetSets:j,isActive:!0})});if(k.ok){const V=await k.json();await x(),y.reset()}else throw new Error("Failed to create variation")}catch(k){console.error("Error creating variation:",k),v({title:"That variation didn't want to join the party!",description:"Failed to add variation",variant:"destructive"})}finally{f(!1)}},S=async T=>{try{if(f(!0),(await fetch(`/api/v2/exercises/${e.id}/variations/${T}/set-current`,{method:"PUT",credentials:"include"})).ok)await x();else throw new Error("Failed to set variation as current")}catch(D){console.error("Error setting variation as current:",D),v({title:"That variation is being stubborn!",description:"Failed to update current variation",variant:"destructive"})}finally{f(!1)}},E=async()=>{if(p.variationId){if(u.length<=1){v({title:"Hold up! Can't drop your last rep!",description:"You need at least one variation. To delete the entire exercise, use the delete button below.",variant:"destructive"}),m({open:!1,variationId:null,variationInfo:""});return}try{if(!g)return;const T=`/api/v2/variations/${p.variationId}`;if(!(await fetch(T,{method:"DELETE",credentials:"include"})).ok)throw new Error("Failed to delete variation");await x(),v({title:"Set variation dropped like it's hot! ⚡",description:"Successfully removed variation and its workout logs."})}catch(T){console.error("Error deleting variation:",T),v({title:"That variation is holding on tight!",description:"Couldn't delete the variation. Please try again.",variant:"destructive"})}finally{m({open:!1,variationId:null,variationInfo:""})}}},C=async()=>{if(s.trim()===e.name||!s.trim()){a(!1),l(e.name);return}if(g)try{const T=`/api/v2/exercises/${e.id}/name`;if(!(await fetch(T,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.trim()}),credentials:"include"})).ok)throw new Error("Failed to update exercise name");v({title:"Exercise leveled up! đŸ’Ē",description:"Successfully renamed the exercise."}),a(!1),i()}catch(T){console.error("Error updating exercise name:",T),v({title:"That name didn't stick!",description:"Couldn't update the exercise name. Please try again.",variant:"destructive"}),l(e.name)}},A=T=>{T.key==="Enter"?C():T.key==="Escape"&&(a(!1),l(e.name))};return h.jsxs(is,{open:t,onOpenChange:r,children:[h.jsxs(Xo,{className:"sm:max-w-[500px] max-h-[85vh] h-auto flex flex-col overflow-y-auto !fixed !top-[5vh] !left-1/2 !-translate-x-1/2 !translate-y-0 !transform-none data-[state=open]:!animate-none",children:[h.jsxs(Zo,{children:[h.jsx(Qo,{className:"flex items-center justify-start gap-4",children:o?h.jsxs(h.Fragment,{children:[h.jsx(rr,{value:s,onChange:T=>l(T.target.value),className:"text-lg font-semibold max-w-[300px]",autoFocus:!0,onKeyDown:A,onBlur:()=>{s.trim()!==e.name?C():a(!1)}}),h.jsx(Ne,{type:"button",variant:"ghost",size:"sm",onClick:C,className:"h-8 w-8 p-0 flex-shrink-0",children:h.jsx(_i,{className:"h-4 w-4 text-green-600"})})]}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-lg font-semibold",children:e.name}),h.jsx(Ne,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>a(!0),children:h.jsx(NS,{className:"h-3 w-3"})})]})}),h.jsx(gl,{className:"text-left",children:"Add new exercise variations and view existing ones."})]}),h.jsxs("div",{className:"flex-1 flex flex-col space-y-6 overflow-hidden",children:[h.jsx("div",{className:"flex-shrink-0",children:h.jsx(Ic,{...y,children:h.jsxs("form",{onSubmit:y.handleSubmit(P),className:"space-y-3",children:[h.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[h.jsx(Sn,{control:y.control,name:"weight",render:({field:T})=>h.jsxs(Jr,{children:[h.jsx(en,{className:"text-foreground text-sm",children:"Weight (kg)"}),h.jsx(tn,{children:h.jsx(rr,{type:"number",step:"any",placeholder:"e.g. 70.5",className:"placeholder:text-muted-foreground",...T})}),h.jsx(rn,{})]})}),h.jsx(Sn,{control:y.control,name:"reps",render:({field:T})=>h.jsxs(Jr,{children:[h.jsx(en,{className:"text-foreground text-sm",children:"Reps"}),h.jsx(tn,{children:h.jsx(rr,{type:"number",placeholder:"e.g. 8",className:"placeholder:text-muted-foreground",...T})}),h.jsx(rn,{})]})}),h.jsx(Sn,{control:y.control,name:"sets",render:({field:T})=>h.jsxs(Jr,{children:[h.jsx(en,{className:"text-foreground text-sm",children:"Sets"}),h.jsx(tn,{children:h.jsx(rr,{type:"number",placeholder:"e.g. 3",className:"placeholder:text-muted-foreground",...T})}),h.jsx(rn,{})]})})]}),h.jsxs(Ne,{type:"submit",size:"sm",disabled:d,className:"flex items-center gap-1",children:[h.jsx(cu,{className:"h-3 w-3"}),"Add Variation"]})]})})}),h.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden relative",children:[h.jsx("div",{className:"flex items-center justify-between mb-3 flex-shrink-0",children:h.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Exercise variants"})}),h.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent",children:d?h.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading variations..."}):u.length===0?h.jsx("div",{className:"text-sm text-muted-foreground",children:"No variations yet. Add one above to get started."}):h.jsxs("div",{className:"space-y-2 pr-1",children:[u.map(T=>{const D=T.isCurrent;return h.jsx("div",{className:"flex items-center gap-2 transition-all duration-200 min-h-[60px]",children:h.jsx("div",{className:`flex ${D?"w-full":"w-full justify-center"}`,children:h.jsxs("div",{onClick:()=>!D&&S(T.id),className:`flex items-center justify-between p-3 rounded border transition-all duration-200 ${D?"border-slate-900 shadow-lg w-full":"border-gray-200 hover:bg-gray-50 cursor-pointer w-[95%]"}`,children:[h.jsxs("div",{className:"flex-1",children:[h.jsx("div",{className:"mb-2",children:h.jsxs("span",{className:"text-sm font-medium",children:[T.targetWeight,"kg | ",T.targetReps," reps | ",T.targetSets," sets"]})}),h.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:T.completions&&T.completions.length>0?h.jsxs(h.Fragment,{children:[T.completions.slice(-10).map((N,j)=>(console.log("Completion object structure:",{id:N.id,success:N.success,completedAt:N.completedAt,fullObject:N}),h.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded-full text-xs ${N.success?"bg-green-100 text-green-700 border border-green-200":"bg-red-100 text-red-700 border border-red-200"}`,title:`${N.success?"Success":"Failed"} - ${new Date(N.completedAt).toLocaleString()}`,children:N.success?"✓":"✗"},j))),T.completions.length>10&&h.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",T.completions.length-10," more"]})]}):h.jsx(h.Fragment,{children:Array.from({length:3}).map((N,j)=>h.jsx("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full border-2 border-dashed border-gray-300 bg-gray-50",title:"No logs yet"},j))})})]}),h.jsx("div",{className:"flex items-center ml-3",children:h.jsx(Ne,{variant:"ghost",size:"sm",className:"w-6 h-6 p-0 text-red-500 hover:text-red-700 hover:bg-red-50 flex-shrink-0",onClick:N=>{N.stopPropagation(),m({open:!0,variationId:T.id,variationInfo:`${T.targetWeight}kg | ${T.targetReps} reps | ${T.targetSets} sets`})},children:h.jsx(Of,{className:"h-3 w-3"})})})]})})},T.id)}),u.length===1&&h.jsx(h.Fragment,{children:Array.from({length:2}).map((T,D)=>h.jsx("div",{className:"flex items-center gap-2 transition-all duration-200 min-h-[60px] opacity-50",children:h.jsx("div",{className:"flex w-full justify-center",children:h.jsxs("div",{className:"flex items-center justify-between p-3 rounded border border-dashed border-gray-300 bg-gray-50 cursor-default w-[95%]",children:[h.jsxs("div",{className:"flex-1",children:[h.jsx("div",{className:"mb-2",children:h.jsx("span",{className:"text-sm font-medium text-gray-500",children:"Add more variations above"})}),h.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:Array.from({length:3}).map((N,j)=>h.jsx("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full border-2 border-dashed border-gray-300 bg-gray-100",title:"Add variation to track workouts"},j))})]}),h.jsx("div",{className:"flex items-center ml-3",children:h.jsx("div",{className:"w-6 h-6 p-0 flex-shrink-0 opacity-30",children:h.jsx(cu,{className:"h-3 w-3 text-gray-400"})})})]})})},`placeholder-${D}`))})]})}),u.length>3&&h.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-4 bg-gradient-to-t from-background to-transparent pointer-events-none"})]})]}),h.jsxs("div",{className:"flex justify-between items-center pt-4 border-t flex-shrink-0",children:[h.jsx(Ne,{type:"button",variant:"destructive",size:"sm",onClick:()=>{n(),r(!1)},className:"px-3",children:h.jsx(Of,{className:"h-4 w-4"})}),h.jsx(Ne,{type:"button",onClick:()=>r(!1),variant:"outline",className:"bg-white hover:bg-gray-50",children:"End"})]})]}),h.jsx(YA,{open:p.open,onOpenChange:T=>m({...p,open:T}),children:h.jsxs(vb,{children:[h.jsxs(gb,{children:[h.jsx(bb,{children:"Drop this variation?"}),h.jsxs(xb,{children:['This will delete "',p.variationInfo,'" and all its workout logs.',h.jsx("br",{}),h.jsx("br",{}),"This action can't be undone."]})]}),h.jsxs(yb,{children:[h.jsx(Sb,{children:"Keep it"}),h.jsx(wb,{onClick:E,className:"bg-red-600 hover:bg-red-700",children:"Delete variation"})]})]})})]})}function bue({open:e,onOpenChange:t,onConfirm:r,isSuccess:n}){return h.jsx(is,{open:e,onOpenChange:t,children:h.jsxs(Xo,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[h.jsxs(Zo,{children:[h.jsx(Qo,{children:"Delete last exercise?"}),h.jsx(gl,{children:"This will remove the most recent workout completion."})]}),h.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[h.jsx(Ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(Ne,{onClick:()=>{r(),t(!1)},children:"Delete"})]})]})})}const xue=Mc({name:wn().min(2,{message:"Routine name must be at least 2 characters."})});function wue({open:e,onOpenChange:t,onSubmit:r,onDelete:n,routine:i,mode:o,existingRoutines:a}){const s=Dc({resolver:kc(xue),defaultValues:{name:(i==null?void 0:i.name)||""}});M.useEffect(()=>{e&&(i!=null&&i.name)&&s.reset({name:i.name})},[e,i==null?void 0:i.name,s]);function l(c){r(c.name),s.reset(),t(!1)}const u=a.length===1;return h.jsx(is,{open:e,onOpenChange:t,children:h.jsxs(Xo,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[h.jsxs(Zo,{children:[h.jsx(Qo,{children:o==="create"?"Create Routine":"Edit Routine"}),h.jsx(gl,{children:o==="create"?"Create a new routine.":"Edit routine name or delete the routine."})]}),h.jsx(Ic,{...s,children:h.jsxs("form",{onSubmit:s.handleSubmit(l),className:"space-y-4",children:[h.jsx(Sn,{control:s.control,name:"name",render:({field:c})=>h.jsxs(Jr,{children:[h.jsx(en,{className:"text-foreground",children:"Routine Name"}),h.jsx(tn,{children:h.jsx(rr,{placeholder:"e.g. Upper Body",...c})}),h.jsx(rn,{})]})}),h.jsxs("div",{className:"flex justify-between pt-4",children:[o==="edit"&&n&&!u&&h.jsx(Ne,{type:"button",variant:"destructive",className:"px-3",onClick:()=>{n(),t(!1)},children:h.jsx(Of,{className:"h-4 w-4"})}),h.jsxs("div",{className:`space-x-2 ${o==="create"||u?"ml-auto":""}`,children:[h.jsx(Ne,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(Ne,{type:"submit",children:o==="create"?"Create Routine":"Save Changes"})]})]})]})})]})})}const e5=w.forwardRef(({className:e,...t},r)=>h.jsx("textarea",{className:Me("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));e5.displayName="Textarea";const PD=300;function Sue({open:e,onOpenChange:t,initialNote:r,onSave:n}){const[i,o]=w.useState(r||"");w.useEffect(()=>{e&&o(r||"")},[e,r]);const a=()=>{n(i.trim()),t(!1)},s=()=>{o("")},l=PD-i.length;return h.jsx(is,{open:e,onOpenChange:t,children:h.jsxs(Xo,{className:"sm:max-w-md sm:top-[20%] top-[10%] translate-y-0",children:[h.jsx(Zo,{children:h.jsxs(Qo,{className:"flex items-center gap-2",children:[h.jsx(JL,{className:"h-5 w-5"}),"Gym diary time! 📝"]})}),h.jsxs("div",{className:"space-y-4",children:[h.jsx(e5,{value:i,onChange:u=>o(u.target.value),placeholder:"Add a note for this exercise...",maxLength:PD,rows:4,className:"resize-none"}),h.jsx("div",{className:"flex justify-between items-center text-sm",children:h.jsxs("span",{className:`${l<20?"text-orange-500":"text-gray-500"}`,children:[l," characters remaining"]})})]}),h.jsxs(jU,{className:"gap-2",children:[h.jsx(Ne,{variant:"outline",onClick:s,disabled:i.length===0,children:"Clear"}),h.jsx(Ne,{onClick:a,children:"Save"})]})]})})}function Pue({open:e,onOpenChange:t,currentName:r,onSave:n}){const[i,o]=w.useState(r),a=()=>{i.trim()&&(n(i.trim()),t(!1))};return h.jsx(is,{open:e,onOpenChange:t,children:h.jsxs(Xo,{className:"sm:max-w-[425px]",children:[h.jsxs(Zo,{children:[h.jsx(Qo,{children:"Edit Exercise Name"}),h.jsx(gl,{children:"Update the name of this exercise."})]}),h.jsxs("div",{className:"space-y-4 pt-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(Ns,{htmlFor:"name",children:"Exercise Name"}),h.jsx(rr,{id:"name",value:i,onChange:s=>o(s.target.value),placeholder:"Enter exercise name",onKeyDown:s=>{s.key==="Enter"&&a()}})]}),h.jsxs("div",{className:"flex justify-end space-x-2",children:[h.jsx(Ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(Ne,{onClick:a,children:"Save"})]})]})]})})}function ED(e,[t,r]){return Math.min(r,Math.max(t,e))}function Eue(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Cue=[" ","Enter","ArrowUp","ArrowDown"],Aue=[" ","Enter"],uh="Select",[Pb,Eb,Tue]=Cy(uh),[Rc,TIe]=Ec(uh,[Tue,ab]),Cb=ab(),[Oue,os]=Rc(uh),[_ue,jue]=Rc(uh),t5=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:u,name:c,autoComplete:d,disabled:f,required:p,form:m}=e,v=Cb(t),[g,b]=w.useState(null),[y,x]=w.useState(null),[P,S]=w.useState(!1),E=pA(u),[C=!1,A]=Vu({prop:n,defaultProp:i,onChange:o}),[T,D]=Vu({prop:a,defaultProp:s,onChange:l}),N=w.useRef(null),j=g?m||!!g.closest("form"):!0,[L,k]=w.useState(new Set),V=Array.from(L).map(B=>B.props.value).join(";");return h.jsx(TV,{...v,children:h.jsxs(Oue,{required:p,scope:t,trigger:g,onTriggerChange:b,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:P,onValueNodeHasChildrenChange:S,contentId:Oo(),value:T,onValueChange:D,open:C,onOpenChange:A,dir:E,triggerPointerDownPosRef:N,disabled:f,children:[h.jsx(Pb.Provider,{scope:t,children:h.jsx(_ue,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(B=>{k(U=>new Set(U).add(B))},[]),onNativeOptionRemove:w.useCallback(B=>{k(U=>{const I=new Set(U);return I.delete(B),I})},[]),children:r})}),j?h.jsxs(A5,{"aria-hidden":!0,required:p,tabIndex:-1,name:c,autoComplete:d,value:T,onChange:B=>D(B.target.value),disabled:f,form:m,children:[T===void 0?h.jsx("option",{value:""}):null,Array.from(L)]},V):null]})})};t5.displayName=uh;var r5="SelectTrigger",n5=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,o=Cb(r),a=os(r5,r),s=a.disabled||n,l=st(t,a.onTriggerChange),u=Eb(r),c=w.useRef("touch"),[d,f,p]=T5(v=>{const g=u().filter(x=>!x.disabled),b=g.find(x=>x.value===a.value),y=O5(g,v,b);y!==void 0&&a.onValueChange(y.value)}),m=v=>{s||(a.onOpenChange(!0),p()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return h.jsx(OV,{asChild:!0,...o,children:h.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":C5(a.value)?"":void 0,...i,ref:l,onClick:Ce(i.onClick,v=>{v.currentTarget.focus(),c.current!=="mouse"&&m(v)}),onPointerDown:Ce(i.onPointerDown,v=>{c.current=v.pointerType;const g=v.target;g.hasPointerCapture(v.pointerId)&&g.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(m(v),v.preventDefault())}),onKeyDown:Ce(i.onKeyDown,v=>{const g=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(g&&v.key===" ")&&Cue.includes(v.key)&&(m(),v.preventDefault())})})})});n5.displayName=r5;var i5="SelectValue",o5=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:o,placeholder:a="",...s}=e,l=os(i5,r),{onValueNodeHasChildrenChange:u}=l,c=o!==void 0,d=st(t,l.onValueNodeChange);return Nr(()=>{u(c)},[u,c]),h.jsx(Ke.span,{...s,ref:d,style:{pointerEvents:"none"},children:C5(l.value)?h.jsx(h.Fragment,{children:a}):o})});o5.displayName=i5;var Nue="SelectIcon",a5=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return h.jsx(Ke.span,{"aria-hidden":!0,...i,ref:t,children:n||"â–ŧ"})});a5.displayName=Nue;var Due="SelectPortal",s5=e=>h.jsx(Vp,{asChild:!0,...e});s5.displayName=Due;var ll="SelectContent",l5=w.forwardRef((e,t)=>{const r=os(ll,e.__scopeSelect),[n,i]=w.useState();if(Nr(()=>{i(new DocumentFragment)},[]),!r.open){const o=n;return o?ts.createPortal(h.jsx(u5,{scope:e.__scopeSelect,children:h.jsx(Pb.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),o):null}return h.jsx(c5,{...e,ref:t})});l5.displayName=ll;var fi=10,[u5,as]=Rc(ll),kue="SelectContentImpl",c5=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:g,...b}=e,y=os(ll,r),[x,P]=w.useState(null),[S,E]=w.useState(null),C=st(t,X=>P(X)),[A,T]=w.useState(null),[D,N]=w.useState(null),j=Eb(r),[L,k]=w.useState(!1),V=w.useRef(!1);w.useEffect(()=>{if(x)return EA(x)},[x]),hA();const B=w.useCallback(X=>{const[oe,...K]=j().map(H=>H.ref.current),[J]=K.slice(-1),ee=document.activeElement;for(const H of X)if(H===ee||(H==null||H.scrollIntoView({block:"nearest"}),H===oe&&S&&(S.scrollTop=0),H===J&&S&&(S.scrollTop=S.scrollHeight),H==null||H.focus(),document.activeElement!==ee))return},[j,S]),U=w.useCallback(()=>B([A,x]),[B,A,x]);w.useEffect(()=>{L&&U()},[L,U]);const{onOpenChange:I,triggerPointerDownPosRef:$}=y;w.useEffect(()=>{if(x){let X={x:0,y:0};const oe=J=>{var ee,H;X={x:Math.abs(Math.round(J.pageX)-(((ee=$.current)==null?void 0:ee.x)??0)),y:Math.abs(Math.round(J.pageY)-(((H=$.current)==null?void 0:H.y)??0))}},K=J=>{X.x<=10&&X.y<=10?J.preventDefault():x.contains(J.target)||I(!1),document.removeEventListener("pointermove",oe),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",K,{capture:!0})}}},[x,I,$]),w.useEffect(()=>{const X=()=>I(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[I]);const[_,O]=T5(X=>{const oe=j().filter(ee=>!ee.disabled),K=oe.find(ee=>ee.ref.current===document.activeElement),J=O5(oe,X,K);J&&setTimeout(()=>J.ref.current.focus())}),z=w.useCallback((X,oe,K)=>{const J=!V.current&&!K;(y.value!==void 0&&y.value===oe||J)&&(T(X),J&&(V.current=!0))},[y.value]),Y=w.useCallback(()=>x==null?void 0:x.focus(),[x]),re=w.useCallback((X,oe,K)=>{const J=!V.current&&!K;(y.value!==void 0&&y.value===oe||J)&&N(X)},[y.value]),se=n==="popper"?b1:d5,de=se===b1?{side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:g}:{};return h.jsx(u5,{scope:r,content:x,viewport:S,onViewportChange:E,itemRefCallback:z,selectedItem:A,onItemLeave:Y,itemTextRefCallback:re,focusSelectedItem:U,selectedItemText:D,position:n,isPositioned:L,searchRef:_,children:h.jsx(ub,{as:Lo,allowPinchZoom:!0,children:h.jsx(rb,{asChild:!0,trapped:y.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:Ce(i,X=>{var oe;(oe=y.trigger)==null||oe.focus({preventScroll:!0}),X.preventDefault()}),children:h.jsx(Bp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:h.jsx(se,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:X=>X.preventDefault(),...b,...de,onPlaced:()=>k(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ce(b.onKeyDown,X=>{const oe=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!oe&&X.key.length===1&&O(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let J=j().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);if(["ArrowUp","End"].includes(X.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const ee=X.target,H=J.indexOf(ee);J=J.slice(H+1)}setTimeout(()=>B(J)),X.preventDefault()}})})})})})})});c5.displayName=kue;var Mue="SelectItemAlignedPosition",d5=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,o=os(ll,r),a=as(ll,r),[s,l]=w.useState(null),[u,c]=w.useState(null),d=st(t,C=>c(C)),f=Eb(r),p=w.useRef(!1),m=w.useRef(!0),{viewport:v,selectedItem:g,selectedItemText:b,focusSelectedItem:y}=a,x=w.useCallback(()=>{if(o.trigger&&o.valueNode&&s&&u&&v&&g&&b){const C=o.trigger.getBoundingClientRect(),A=u.getBoundingClientRect(),T=o.valueNode.getBoundingClientRect(),D=b.getBoundingClientRect();if(o.dir!=="rtl"){const ee=D.left-A.left,H=T.left-ee,Pe=C.left-H,le=C.width+Pe,Le=Math.max(le,A.width),Ue=window.innerWidth-fi,Ye=ED(H,[fi,Math.max(fi,Ue-Le)]);s.style.minWidth=le+"px",s.style.left=Ye+"px"}else{const ee=A.right-D.right,H=window.innerWidth-T.right-ee,Pe=window.innerWidth-C.right-H,le=C.width+Pe,Le=Math.max(le,A.width),Ue=window.innerWidth-fi,Ye=ED(H,[fi,Math.max(fi,Ue-Le)]);s.style.minWidth=le+"px",s.style.right=Ye+"px"}const N=f(),j=window.innerHeight-fi*2,L=v.scrollHeight,k=window.getComputedStyle(u),V=parseInt(k.borderTopWidth,10),B=parseInt(k.paddingTop,10),U=parseInt(k.borderBottomWidth,10),I=parseInt(k.paddingBottom,10),$=V+B+L+I+U,_=Math.min(g.offsetHeight*5,$),O=window.getComputedStyle(v),z=parseInt(O.paddingTop,10),Y=parseInt(O.paddingBottom,10),re=C.top+C.height/2-fi,se=j-re,de=g.offsetHeight/2,X=g.offsetTop+de,oe=V+B+X,K=$-oe;if(oe<=re){const ee=N.length>0&&g===N[N.length-1].ref.current;s.style.bottom="0px";const H=u.clientHeight-v.offsetTop-v.offsetHeight,Pe=Math.max(se,de+(ee?Y:0)+H+U),le=oe+Pe;s.style.height=le+"px"}else{const ee=N.length>0&&g===N[0].ref.current;s.style.top="0px";const Pe=Math.max(re,V+v.offsetTop+(ee?z:0)+de)+K;s.style.height=Pe+"px",v.scrollTop=oe-re+v.offsetTop}s.style.margin=`${fi}px 0`,s.style.minHeight=_+"px",s.style.maxHeight=j+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[f,o.trigger,o.valueNode,s,u,v,g,b,o.dir,n]);Nr(()=>x(),[x]);const[P,S]=w.useState();Nr(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const E=w.useCallback(C=>{C&&m.current===!0&&(x(),y==null||y(),m.current=!1)},[x,y]);return h.jsx(Rue,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:h.jsx(Ke.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});d5.displayName=Mue;var Iue="SelectPopperPosition",b1=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=fi,...o}=e,a=Cb(r);return h.jsx(_V,{...a,...o,ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});b1.displayName=Iue;var[Rue,XA]=Rc(ll,{}),x1="SelectViewport",f5=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...i}=e,o=as(x1,r),a=XA(x1,r),s=st(t,o.onViewportChange),l=w.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),h.jsx(Pb.Slot,{scope:r,children:h.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ce(i.onScroll,u=>{const c=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const p=Math.abs(l.current-c.scrollTop);if(p>0){const m=window.innerHeight-fi*2,v=parseFloat(d.style.minHeight),g=parseFloat(d.style.height),b=Math.max(v,g);if(b0?P:0,d.style.justifyContent="flex-end")}}}l.current=c.scrollTop})})})]})});f5.displayName=x1;var p5="SelectGroup",[$ue,Lue]=Rc(p5),Fue=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Oo();return h.jsx($ue,{scope:r,id:i,children:h.jsx(Ke.div,{role:"group","aria-labelledby":i,...n,ref:t})})});Fue.displayName=p5;var h5="SelectLabel",m5=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Lue(h5,r);return h.jsx(Ke.div,{id:i.id,...n,ref:t})});m5.displayName=h5;var sg="SelectItem",[Bue,v5]=Rc(sg),g5=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:o,...a}=e,s=os(sg,r),l=as(sg,r),u=s.value===n,[c,d]=w.useState(o??""),[f,p]=w.useState(!1),m=st(t,y=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,y,n,i)}),v=Oo(),g=w.useRef("touch"),b=()=>{i||(s.onValueChange(n),s.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(Bue,{scope:r,value:n,disabled:i,textId:v,isSelected:u,onItemTextChange:w.useCallback(y=>{d(x=>x||((y==null?void 0:y.textContent)??"").trim())},[]),children:h.jsx(Pb.ItemSlot,{scope:r,value:n,disabled:i,textValue:c,children:h.jsx(Ke.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:m,onFocus:Ce(a.onFocus,()=>p(!0)),onBlur:Ce(a.onBlur,()=>p(!1)),onClick:Ce(a.onClick,()=>{g.current!=="mouse"&&b()}),onPointerUp:Ce(a.onPointerUp,()=>{g.current==="mouse"&&b()}),onPointerDown:Ce(a.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:Ce(a.onPointerMove,y=>{var x;g.current=y.pointerType,i?(x=l.onItemLeave)==null||x.call(l):g.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ce(a.onPointerLeave,y=>{var x;y.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:Ce(a.onKeyDown,y=>{var P;((P=l.searchRef)==null?void 0:P.current)!==""&&y.key===" "||(Aue.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});g5.displayName=sg;var $d="SelectItemText",y5=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...o}=e,a=os($d,r),s=as($d,r),l=v5($d,r),u=jue($d,r),[c,d]=w.useState(null),f=st(t,b=>d(b),l.onItemTextChange,b=>{var y;return(y=s.itemTextRefCallback)==null?void 0:y.call(s,b,l.value,l.disabled)}),p=c==null?void 0:c.textContent,m=w.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:g}=u;return Nr(()=>(v(m),()=>g(m)),[v,g,m]),h.jsxs(h.Fragment,{children:[h.jsx(Ke.span,{id:l.textId,...o,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ts.createPortal(o.children,a.valueNode):null]})});y5.displayName=$d;var b5="SelectItemIndicator",x5=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return v5(b5,r).isSelected?h.jsx(Ke.span,{"aria-hidden":!0,...n,ref:t}):null});x5.displayName=b5;var w1="SelectScrollUpButton",w5=w.forwardRef((e,t)=>{const r=as(w1,e.__scopeSelect),n=XA(w1,e.__scopeSelect),[i,o]=w.useState(!1),a=st(t,n.onScrollButtonChange);return Nr(()=>{if(r.viewport&&r.isPositioned){let s=function(){const u=l.scrollTop>0;o(u)};const l=r.viewport;return s(),l.addEventListener("scroll",s),()=>l.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),i?h.jsx(P5,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});w5.displayName=w1;var S1="SelectScrollDownButton",S5=w.forwardRef((e,t)=>{const r=as(S1,e.__scopeSelect),n=XA(S1,e.__scopeSelect),[i,o]=w.useState(!1),a=st(t,n.onScrollButtonChange);return Nr(()=>{if(r.viewport&&r.isPositioned){let s=function(){const u=l.scrollHeight-l.clientHeight,c=Math.ceil(l.scrollTop)l.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),i?h.jsx(P5,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});S5.displayName=S1;var P5=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,o=as("SelectScrollButton",r),a=w.useRef(null),s=Eb(r),l=w.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),Nr(()=>{var c;const u=s().find(d=>d.ref.current===document.activeElement);(c=u==null?void 0:u.ref.current)==null||c.scrollIntoView({block:"nearest"})},[s]),h.jsx(Ke.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ce(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:Ce(i.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:Ce(i.onPointerLeave,()=>{l()})})}),Vue="SelectSeparator",E5=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return h.jsx(Ke.div,{"aria-hidden":!0,...n,ref:t})});E5.displayName=Vue;var P1="SelectArrow",Uue=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Cb(r),o=os(P1,r),a=as(P1,r);return o.open&&a.position==="popper"?h.jsx(jV,{...i,...n,ref:t}):null});Uue.displayName=P1;function C5(e){return e===""||e===void 0}var A5=w.forwardRef((e,t)=>{const{value:r,...n}=e,i=w.useRef(null),o=st(t,i),a=Eue(r);return w.useEffect(()=>{const s=i.current,l=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==r&&c){const d=new Event("change",{bubbles:!0});c.call(s,r),s.dispatchEvent(d)}},[a,r]),h.jsx(Ay,{asChild:!0,children:h.jsx("select",{...n,ref:o,defaultValue:r})})});A5.displayName="BubbleSelect";function T5(e){const t=jr(e),r=w.useRef(""),n=w.useRef(0),i=w.useCallback(a=>{const s=r.current+a;t(s),function l(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(s)},[t]),o=w.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,o]}function O5(e,t,r){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=zue(e,Math.max(o,0));i.length===1&&(a=a.filter(u=>u!==r));const l=a.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function zue(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Wue=t5,_5=n5,Hue=o5,Gue=a5,Kue=s5,j5=l5,que=f5,N5=m5,D5=g5,Yue=y5,Xue=x5,k5=w5,M5=S5,I5=E5;const Zue=Wue,Que=Hue,R5=w.forwardRef(({className:e,children:t,...r},n)=>h.jsxs(_5,{ref:n,className:Me("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,h.jsx(Gue,{asChild:!0,children:h.jsx(jy,{className:"h-4 w-4 opacity-50"})})]}));R5.displayName=_5.displayName;const $5=w.forwardRef(({className:e,...t},r)=>h.jsx(k5,{ref:r,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(Pq,{className:"h-4 w-4"})}));$5.displayName=k5.displayName;const L5=w.forwardRef(({className:e,...t},r)=>h.jsx(M5,{ref:r,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(jy,{className:"h-4 w-4"})}));L5.displayName=M5.displayName;const F5=w.forwardRef(({className:e,children:t,position:r="popper",...n},i)=>h.jsx(Kue,{children:h.jsxs(j5,{ref:i,className:Me("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[h.jsx($5,{}),h.jsx(que,{className:Me("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),h.jsx(L5,{})]})}));F5.displayName=j5.displayName;const Jue=w.forwardRef(({className:e,...t},r)=>h.jsx(N5,{ref:r,className:Me("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Jue.displayName=N5.displayName;const B5=w.forwardRef(({className:e,children:t,...r},n)=>h.jsxs(D5,{ref:n,className:Me("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(Xue,{children:h.jsx(_i,{className:"h-4 w-4"})})}),h.jsx(Yue,{children:t})]}));B5.displayName=D5.displayName;const ece=w.forwardRef(({className:e,...t},r)=>h.jsx(I5,{ref:r,className:Me("-mx-1 my-1 h-px bg-muted",e),...t}));ece.displayName=I5.displayName;function tce({open:e,onOpenChange:t,currentMetrics:r,routines:n,currentRoutineId:i,onSave:o,onDelete:a}){const[s,l]=w.useState(r.weight.toString()),[u,c]=w.useState(r.reps.toString()),[d,f]=w.useState(r.sets.toString()),[p,m]=w.useState((i==null?void 0:i.toString())||"");w.useEffect(()=>{e&&i&&m(i.toString())},[e,i]);const v=()=>{const g=parseFloat(s),b=parseInt(u),y=parseInt(d);if(!isNaN(g)&&!isNaN(b)&&!isNaN(y)&&g>0&&b>0&&y>0){const x=parseInt(p);o({weight:g,reps:b,sets:y,routineId:i&&x!==i?x:void 0}),t(!1)}};return h.jsx(is,{open:e,onOpenChange:t,children:h.jsxs(Xo,{className:"sm:max-w-[425px]",children:[h.jsxs(Zo,{children:[h.jsx(Qo,{children:"Edit Exercise Metrics"}),h.jsx(gl,{children:"Update the weight, reps, and sets for this exercise."})]}),h.jsxs("div",{className:"space-y-4 pt-4",children:[n&&n.length>1&&h.jsxs("div",{className:"space-y-2",children:[h.jsx(Ns,{htmlFor:"routine",children:"Routine"}),h.jsxs(Zue,{value:p,onValueChange:m,children:[h.jsx(R5,{id:"routine",children:h.jsx(Que,{placeholder:"Select routine"})}),h.jsx(F5,{children:n.map(g=>h.jsx(B5,{value:g.id.toString(),children:g.name},g.id))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Ns,{htmlFor:"weight",children:"Weight (kg)"}),h.jsx(rr,{id:"weight",type:"number",step:"0.01",value:s,onChange:g=>l(g.target.value),placeholder:"Enter weight"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Ns,{htmlFor:"reps",children:"Reps"}),h.jsx(rr,{id:"reps",type:"number",value:u,onChange:g=>c(g.target.value),placeholder:"Enter reps"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Ns,{htmlFor:"sets",children:"Sets"}),h.jsx(rr,{id:"sets",type:"number",value:d,onChange:g=>f(g.target.value),placeholder:"Enter sets"})]}),h.jsxs("div",{className:"flex justify-between items-center",children:[a&&h.jsx(Ne,{variant:"ghost",onClick:()=>{a(),t(!1)},className:"text-red-600 hover:text-red-700 hover:bg-red-50",children:h.jsx(Of,{className:"h-4 w-4"})}),h.jsxs("div",{className:`flex space-x-2 ${a?"":"ml-auto"}`,children:[h.jsx(Ne,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(Ne,{onClick:v,children:"Save"})]})]})]})]})})}async function F0(e,t,r){try{const n=await fetch(e,{method:t,headers:r?{"Content-Type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0,credentials:"include"});return n.ok?{ok:!0}:n.status>=500?{ok:!1,message:n.statusText}:{ok:!1,message:await n.text()}}catch(n){return{ok:!1,message:n.toString()}}}async function rce(){const e=await fetch("/api/user",{credentials:"include"});if(!e.ok){if(e.status===401)return null;throw e.status>=500?new Error(`${e.status}: ${e.statusText}`):new Error(`${e.status}: ${await e.text()}`)}return e.json()}function Ab(){const e=$p(),{data:t,error:r,isLoading:n}=nL({queryKey:["user"],queryFn:rce,staleTime:1/0,retry:!1}),i=su({mutationFn:s=>F0("/api/login","POST",s),onSuccess:()=>{e.invalidateQueries({queryKey:["user"]})}}),o=su({mutationFn:()=>F0("/api/logout","POST"),onSuccess:()=>{e.invalidateQueries({queryKey:["user"]}),window.location.href="/"}}),a=su({mutationFn:s=>F0("/api/register","POST",s),onSuccess:()=>{e.invalidateQueries({queryKey:["user"]})}});return{user:t,isLoading:n,error:r,login:i.mutateAsync,logout:o.mutateAsync,register:a.mutateAsync}}const V5=w.forwardRef((e,t)=>{const{textSize:r}=d8(),[n,i]=w.useState(0),[o,a]=w.useState(!1),[s,l]=w.useState(!1),[u,c]=w.useState(null),f=(()=>{switch(r){case"large":return{text:"text-6xl"};case"extra-large":return{text:"text-7xl"};default:return{text:"text-5xl"}}})();w.useEffect(()=>{let b;return o&&u&&(b=window.setInterval(()=>{i(Date.now()-u)},10)),()=>{b&&clearInterval(b)}},[o,u]);const p=()=>{c(Date.now()-n),a(!0),l(!0)},m=()=>{i(0),a(!1),c(null),l(!1)},v=()=>{i(0),c(Date.now()),a(!0),l(!0)};w.useImperativeHandle(t,()=>({start:p,reset:m,resetAndStart:v,isRunning:()=>o}));const g=b=>{const y=Math.floor(b/1e3),x=Math.floor(y/60),P=y%60;return`${x.toString().padStart(2,"0")}:${P.toString().padStart(2,"0")}`};return h.jsx(aV,{children:s&&h.jsx(Iv.div,{initial:{y:100,opacity:0},animate:{y:0,opacity:1},exit:{y:100,opacity:0},transition:{type:"spring",damping:25,stiffness:300},className:"fixed bottom-0 left-0 right-0 z-50 pb-safe px-4 pb-4",children:h.jsx("div",{className:"w-full max-w-md mx-auto bg-black border-2 border-gray-800 rounded-lg shadow-2xl overflow-hidden",children:h.jsx("div",{className:"px-4 py-3 flex items-center justify-center",children:h.jsx("div",{className:`${f.text} font-mono font-bold text-white whitespace-nowrap`,children:g(n)})})})})})});V5.displayName="TimerDialog";function nce({open:e,onOpenChange:t,type:r,onEditExercise:n}){const i={increase:{title:"Time to Level Up!",subtitle:"You're crushing these sets! Consider:",suggestions:[{text:"Bump up the weight by 2.5-5kg",icon:h.jsx(L_,{className:"h-4 w-4 text-orange-500"})},{text:"Add 2-3 more reps to challenge yourself",icon:h.jsx(cu,{className:"h-4 w-4 text-blue-500"})},{text:"Throw in an extra set for volume",icon:h.jsx(yv,{className:"h-4 w-4 text-purple-500"})},{text:"Try a slower, more controlled tempo",icon:h.jsx(gv,{className:"h-4 w-4 text-indigo-500"})},{text:"Reduce rest time between sets",icon:h.jsx(eF,{className:"h-4 w-4 text-red-500"})}],footer:"Progress is progress, no matter how small!",icon:h.jsx(tC,{className:"h-10 w-10 text-green-500"})},decrease:{title:"Let's Find Your Sweet Spot",subtitle:"Everyone has off days! Try:",suggestions:[{text:"Drop the weight by 10-15%",icon:h.jsx($_,{className:"h-4 w-4 text-red-500"})},{text:"Focus on 2-3 fewer reps with perfect form",icon:h.jsx(yv,{className:"h-4 w-4 text-green-500"})},{text:"Take an extra day to recover fully",icon:h.jsx(gv,{className:"h-4 w-4 text-blue-500"})},{text:"Try lighter warm-up sets first",icon:h.jsx(L_,{className:"h-4 w-4 text-yellow-500"})},{text:"Check your sleep and nutrition",icon:h.jsx(_i,{className:"h-4 w-4 text-purple-500"})}],footer:"Remember: Form > Weight. You've got this!",icon:h.jsx($_,{className:"h-10 w-10 text-red-500"})}};return h.jsx(is,{open:e,onOpenChange:t,children:h.jsxs(Xo,{className:"max-w-md",children:[h.jsxs(Zo,{children:[h.jsxs("div",{className:"flex flex-col items-center text-center gap-4 mb-6",children:[h.jsx("div",{className:"p-4 rounded-full bg-gray-50 border-2",children:i[r].icon}),h.jsx(Qo,{className:"text-2xl font-bold",children:i[r].title})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsx("p",{className:"text-base text-gray-700 text-center font-medium",children:i[r].subtitle}),h.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:h.jsx("ul",{className:"space-y-3 text-left",children:i[r].suggestions.map((o,a)=>h.jsxs("li",{className:"flex items-start gap-3 text-base",children:[h.jsx("span",{className:"mt-0.5 flex-shrink-0",children:o.icon}),h.jsx("span",{className:"text-gray-700",children:o.text})]},a))})}),h.jsx("p",{className:"text-sm text-gray-600 text-center italic",children:i[r].footer})]})]}),h.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[h.jsx(Ne,{variant:"outline",onClick:()=>t(!1),children:"Got it"}),h.jsx(Ne,{onClick:()=>{n==null||n(),t(!1)},children:"Edit Exercise"})]})]})})}var ice=Array.isArray,cn=ice,oce=typeof Eh=="object"&&Eh&&Eh.Object===Object&&Eh,U5=oce,ace=U5,sce=typeof self=="object"&&self&&self.Object===Object&&self,lce=ace||sce||Function("return this")(),so=lce,uce=so,cce=uce.Symbol,ch=cce,CD=ch,z5=Object.prototype,dce=z5.hasOwnProperty,fce=z5.toString,md=CD?CD.toStringTag:void 0;function pce(e){var t=dce.call(e,md),r=e[md];try{e[md]=void 0;var n=!0}catch{}var i=fce.call(e);return n&&(t?e[md]=r:delete e[md]),i}var hce=pce,mce=Object.prototype,vce=mce.toString;function gce(e){return vce.call(e)}var yce=gce,AD=ch,bce=hce,xce=yce,wce="[object Null]",Sce="[object Undefined]",TD=AD?AD.toStringTag:void 0;function Pce(e){return e==null?e===void 0?Sce:wce:TD&&TD in Object(e)?bce(e):xce(e)}var ea=Pce;function Ece(e){return e!=null&&typeof e=="object"}var ta=Ece,Cce=ea,Ace=ta,Tce="[object Symbol]";function Oce(e){return typeof e=="symbol"||Ace(e)&&Cce(e)==Tce}var $c=Oce,_ce=cn,jce=$c,Nce=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Dce=/^\w*$/;function kce(e,t){if(_ce(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||jce(e)?!0:Dce.test(e)||!Nce.test(e)||t!=null&&e in Object(t)}var ZA=kce;function Mce(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var ss=Mce;const Lc=lt(ss);var Ice=ea,Rce=ss,$ce="[object AsyncFunction]",Lce="[object Function]",Fce="[object GeneratorFunction]",Bce="[object Proxy]";function Vce(e){if(!Rce(e))return!1;var t=Ice(e);return t==Lce||t==Fce||t==$ce||t==Bce}var QA=Vce;const et=lt(QA);var Uce=so,zce=Uce["__core-js_shared__"],Wce=zce,B0=Wce,OD=function(){var e=/[^.]+$/.exec(B0&&B0.keys&&B0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Hce(e){return!!OD&&OD in e}var Gce=Hce,Kce=Function.prototype,qce=Kce.toString;function Yce(e){if(e!=null){try{return qce.call(e)}catch{}try{return e+""}catch{}}return""}var W5=Yce,Xce=QA,Zce=Gce,Qce=ss,Jce=W5,ede=/[\\^$.*+?()[\]{}|]/g,tde=/^\[object .+?Constructor\]$/,rde=Function.prototype,nde=Object.prototype,ide=rde.toString,ode=nde.hasOwnProperty,ade=RegExp("^"+ide.call(ode).replace(ede,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function sde(e){if(!Qce(e)||Zce(e))return!1;var t=Xce(e)?ade:tde;return t.test(Jce(e))}var lde=sde;function ude(e,t){return e==null?void 0:e[t]}var cde=ude,dde=lde,fde=cde;function pde(e,t){var r=fde(e,t);return dde(r)?r:void 0}var yl=pde,hde=yl,mde=hde(Object,"create"),Tb=mde,_D=Tb;function vde(){this.__data__=_D?_D(null):{},this.size=0}var gde=vde;function yde(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var bde=yde,xde=Tb,wde="__lodash_hash_undefined__",Sde=Object.prototype,Pde=Sde.hasOwnProperty;function Ede(e){var t=this.__data__;if(xde){var r=t[e];return r===wde?void 0:r}return Pde.call(t,e)?t[e]:void 0}var Cde=Ede,Ade=Tb,Tde=Object.prototype,Ode=Tde.hasOwnProperty;function _de(e){var t=this.__data__;return Ade?t[e]!==void 0:Ode.call(t,e)}var jde=_de,Nde=Tb,Dde="__lodash_hash_undefined__";function kde(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Nde&&t===void 0?Dde:t,this}var Mde=kde,Ide=gde,Rde=bde,$de=Cde,Lde=jde,Fde=Mde;function Fc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1}var rfe=tfe,nfe=Ob;function ife(e,t){var r=this.__data__,n=nfe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var ofe=ife,afe=Ude,sfe=Xde,lfe=Jde,ufe=rfe,cfe=ofe;function Bc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},Ds=function(t){return dh(t)&&t.indexOf("%")===t.length-1},be=function(t){return Dpe(t)&&!fh(t)},nr=function(t){return be(t)||dh(t)},Rpe=0,ph=function(t){var r=++Rpe;return"".concat(t||"").concat(r)},ul=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!be(t)&&!dh(t))return n;var o;if(Ds(t)){var a=t.indexOf("%");o=r*parseFloat(t.slice(0,a))/100}else o=+t;return fh(o)&&(o=n),i&&o>r&&(o=r),o},kl=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},$pe=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zpe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function C1(e){"@babel/helpers - typeof";return C1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C1(e)}var RD={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},jo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},$D=null,U0=null,lT=function e(t){if(t===$D&&Array.isArray(U0))return U0;var r=[];return w.Children.forEach(t,function(n){Qe(n)||(Tpe.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),U0=r,$D=t,r};function ri(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return jo(i)}):n=[jo(t)],lT(e).forEach(function(i){var o=ti(i,"type.displayName")||ti(i,"type.name");n.indexOf(o)!==-1&&r.push(i)}),r}function vn(e,t){var r=ri(e,t);return r&&r[0]}var LD=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!be(n)||n<=0||!be(i)||i<=0)},Wpe=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Hpe=function(t){return t&&t.type&&dh(t.type)&&Wpe.indexOf(t.type)>=0},Gpe=function(t){return t&&C1(t)==="object"&&"clipDot"in t},Kpe=function(t,r,n,i){var o,a=(o=V0==null?void 0:V0[i])!==null&&o!==void 0?o:[];return!et(t)&&(i&&a.includes(r)||Fpe.includes(r))||n&&sT.includes(r)},tt=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(w.isValidElement(t)&&(i=t.props),!Lc(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;Kpe((s=i)===null||s===void 0?void 0:s[a],a,r,n)&&(o[a]=i[a])}),o},A1=function e(t,r){if(t===r)return!0;var n=w.Children.count(t);if(n!==w.Children.count(r))return!1;if(n===0)return!0;if(n===1)return FD(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Qpe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function O1(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,o=e.className,a=e.style,s=e.title,l=e.desc,u=Zpe(e,Xpe),c=i||{width:r,height:n,x:0,y:0},d=ot("recharts-surface",o);return M.createElement("svg",T1({},tt(u,!0,"svg"),{className:d,width:r,height:n,style:a,viewBox:"".concat(c.x," ").concat(c.y," ").concat(c.width," ").concat(c.height)}),M.createElement("title",null,s),M.createElement("desc",null,l),t)}var Jpe=["children","className"];function _1(){return _1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function the(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Gt=M.forwardRef(function(e,t){var r=e.children,n=e.className,i=ehe(e,Jpe),o=ot("recharts-layer",n);return M.createElement("g",_1({className:o},tt(i,!0),{ref:t}),r)}),Ks=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;oi?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n=n?e:ihe(e,t,r)}var ahe=ohe,she="\\ud800-\\udfff",lhe="\\u0300-\\u036f",uhe="\\ufe20-\\ufe2f",che="\\u20d0-\\u20ff",dhe=lhe+uhe+che,fhe="\\ufe0e\\ufe0f",phe="\\u200d",hhe=RegExp("["+phe+she+dhe+fhe+"]");function mhe(e){return hhe.test(e)}var ez=mhe;function vhe(e){return e.split("")}var ghe=vhe,tz="\\ud800-\\udfff",yhe="\\u0300-\\u036f",bhe="\\ufe20-\\ufe2f",xhe="\\u20d0-\\u20ff",whe=yhe+bhe+xhe,She="\\ufe0e\\ufe0f",Phe="["+tz+"]",j1="["+whe+"]",N1="\\ud83c[\\udffb-\\udfff]",Ehe="(?:"+j1+"|"+N1+")",rz="[^"+tz+"]",nz="(?:\\ud83c[\\udde6-\\uddff]){2}",iz="[\\ud800-\\udbff][\\udc00-\\udfff]",Che="\\u200d",oz=Ehe+"?",az="["+She+"]?",Ahe="(?:"+Che+"(?:"+[rz,nz,iz].join("|")+")"+az+oz+")*",The=az+oz+Ahe,Ohe="(?:"+[rz+j1+"?",j1,nz,iz,Phe].join("|")+")",_he=RegExp(N1+"(?="+N1+")|"+Ohe+The,"g");function jhe(e){return e.match(_he)||[]}var Nhe=jhe,Dhe=ghe,khe=ez,Mhe=Nhe;function Ihe(e){return khe(e)?Mhe(e):Dhe(e)}var Rhe=Ihe,$he=ahe,Lhe=ez,Fhe=Rhe,Bhe=q5;function Vhe(e){return function(t){t=Bhe(t);var r=Lhe(t)?Fhe(t):void 0,n=r?r[0]:t.charAt(0),i=r?$he(r,1).join(""):t.slice(1);return n[e]()+i}}var Uhe=Vhe,zhe=Uhe,Whe=zhe("toUpperCase"),Hhe=Whe;const Ub=lt(Hhe);function wt(e){return function(){return e}}const sz=Math.cos,dg=Math.sin,Ii=Math.sqrt,fg=Math.PI,zb=2*fg,D1=Math.PI,k1=2*D1,ws=1e-6,Ghe=k1-ws;function lz(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return lz;const r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;iws)if(!(Math.abs(d*l-u*c)>ws)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-a,m=i-s,v=l*l+u*u,g=p*p+m*m,b=Math.sqrt(v),y=Math.sqrt(f),x=o*Math.tan((D1-Math.acos((v+f-g)/(2*b*y)))/2),P=x/y,S=x/b;Math.abs(P-1)>ws&&this._append`L${t+P*c},${r+P*d}`,this._append`A${o},${o},0,0,${+(d*p>c*m)},${this._x1=t+S*l},${this._y1=r+S*u}`}}arc(t,r,n,i,o,a){if(t=+t,r=+r,n=+n,a=!!a,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,c=r+l,d=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>ws||Math.abs(this._y1-c)>ws)&&this._append`L${u},${c}`,n&&(f<0&&(f=f%k1+k1),f>Ghe?this._append`A${n},${n},0,1,${d},${t-s},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=c}`:f>ws&&this._append`A${n},${n},0,${+(f>=D1)},${d},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function uT(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new qhe(t)}function cT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function uz(e){this._context=e}uz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Wb(e){return new uz(e)}function cz(e){return e[0]}function dz(e){return e[1]}function fz(e,t){var r=wt(!0),n=null,i=Wb,o=null,a=uT(s);e=typeof e=="function"?e:e===void 0?cz:wt(e),t=typeof t=="function"?t:t===void 0?dz:wt(t);function s(l){var u,c=(l=cT(l)).length,d,f=!1,p;for(n==null&&(o=i(p=a())),u=0;u<=c;++u)!(u=p;--m)s.point(x[m],P[m]);s.lineEnd(),s.areaEnd()}b&&(x[f]=+e(g,f,d),P[f]=+t(g,f,d),s.point(n?+n(g,f,d):x[f],r?+r(g,f,d):P[f]))}if(y)return s=null,y+""||null}function c(){return fz().defined(i).curve(a).context(o)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:wt(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:wt(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:wt(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:wt(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:wt(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:wt(+d),u):r},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(r)},u.lineX1=function(){return c().x(n).y(t)},u.defined=function(d){return arguments.length?(i=typeof d=="function"?d:wt(!!d),u):i},u.curve=function(d){return arguments.length?(a=d,o!=null&&(s=a(o)),u):a},u.context=function(d){return arguments.length?(d==null?o=s=null:s=a(o=d),u):o},u}class pz{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Yhe(e){return new pz(e,!0)}function Xhe(e){return new pz(e,!1)}const dT={draw(e,t){const r=Ii(t/fg);e.moveTo(r,0),e.arc(0,0,r,0,zb)}},Zhe={draw(e,t){const r=Ii(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},hz=Ii(1/3),Qhe=hz*2,Jhe={draw(e,t){const r=Ii(t/Qhe),n=r*hz;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},eme={draw(e,t){const r=Ii(t),n=-r/2;e.rect(n,n,r,r)}},tme=.8908130915292852,mz=dg(fg/10)/dg(7*fg/10),rme=dg(zb/10)*mz,nme=-sz(zb/10)*mz,ime={draw(e,t){const r=Ii(t*tme),n=rme*r,i=nme*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){const a=zb*o/5,s=sz(a),l=dg(a);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},z0=Ii(3),ome={draw(e,t){const r=-Ii(t/(z0*3));e.moveTo(0,r*2),e.lineTo(-z0*r,-r),e.lineTo(z0*r,-r),e.closePath()}},Ln=-.5,Fn=Ii(3)/2,M1=1/Ii(12),ame=(M1/2+1)*3,sme={draw(e,t){const r=Ii(t/ame),n=r/2,i=r*M1,o=n,a=r*M1+r,s=-o,l=a;e.moveTo(n,i),e.lineTo(o,a),e.lineTo(s,l),e.lineTo(Ln*n-Fn*i,Fn*n+Ln*i),e.lineTo(Ln*o-Fn*a,Fn*o+Ln*a),e.lineTo(Ln*s-Fn*l,Fn*s+Ln*l),e.lineTo(Ln*n+Fn*i,Ln*i-Fn*n),e.lineTo(Ln*o+Fn*a,Ln*a-Fn*o),e.lineTo(Ln*s+Fn*l,Ln*l-Fn*s),e.closePath()}};function lme(e,t){let r=null,n=uT(i);e=typeof e=="function"?e:wt(e||dT),t=typeof t=="function"?t:wt(t===void 0?64:+t);function i(){let o;if(r||(r=o=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),o)return r=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:wt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:wt(+o),i):t},i.context=function(o){return arguments.length?(r=o??null,i):r},i}function pg(){}function hg(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function vz(e){this._context=e}vz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:hg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:hg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ume(e){return new vz(e)}function gz(e){this._context=e}gz.prototype={areaStart:pg,areaEnd:pg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:hg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cme(e){return new gz(e)}function yz(e){this._context=e}yz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:hg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dme(e){return new yz(e)}function bz(e){this._context=e}bz.prototype={areaStart:pg,areaEnd:pg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function fme(e){return new bz(e)}function VD(e){return e<0?-1:1}function UD(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),a=(r-e._y1)/(i||n<0&&-0),s=(o*i+a*n)/(n+i);return(VD(o)+VD(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function zD(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function W0(e,t,r){var n=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-n)/3;e._context.bezierCurveTo(n+s,i+s*t,o-s,a-s*r,o,a)}function mg(e){this._context=e}mg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:W0(this,this._t0,zD(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,W0(this,zD(this,r=UD(this,e,t)),r);break;default:W0(this,this._t0,r=UD(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function xz(e){this._context=new wz(e)}(xz.prototype=Object.create(mg.prototype)).point=function(e,t){mg.prototype.point.call(this,t,e)};function wz(e){this._context=e}wz.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}};function pme(e){return new mg(e)}function hme(e){return new xz(e)}function Sz(e){this._context=e}Sz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=WD(e),i=WD(t),o=0,a=1;a=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function vme(e){return new Hb(e,.5)}function gme(e){return new Hb(e,0)}function yme(e){return new Hb(e,1)}function Qu(e,t){if((a=e.length)>1)for(var r=1,n,i,o=e[t[0]],a,s=o.length;r=0;)r[t]=t;return r}function bme(e,t){return e[t]}function xme(e){const t=[];return t.key=e,t}function wme(){var e=wt([]),t=I1,r=Qu,n=bme;function i(o){var a=Array.from(e.apply(this,arguments),xme),s,l=a.length,u=-1,c;for(const d of o)for(s=0,++u;s0){for(var r,n,i=0,o=e[0].length,a;i0){for(var r=0,n=e[t[0]],i,o=n.length;r0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,a;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jme(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Pz={symbolCircle:dT,symbolCross:Zhe,symbolDiamond:Jhe,symbolSquare:eme,symbolStar:ime,symbolTriangle:ome,symbolWye:sme},Nme=Math.PI/180,Dme=function(t){var r="symbol".concat(Ub(t));return Pz[r]||dT},kme=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*Nme;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},Mme=function(t,r){Pz["symbol".concat(Ub(t))]=r},fT=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,o=i===void 0?64:i,a=t.sizeType,s=a===void 0?"area":a,l=_me(t,Cme),u=GD(GD({},l),{},{type:n,size:o,sizeType:s}),c=function(){var g=Dme(n),b=lme().type(g).size(kme(o,s,n));return b()},d=u.className,f=u.cx,p=u.cy,m=tt(u,!0);return f===+f&&p===+p&&o===+o?M.createElement("path",R1({},m,{className:ot("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:c()})):null};fT.registerSymbol=Mme;function Ju(e){"@babel/helpers - typeof";return Ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ju(e)}function $1(){return $1=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var y=p.inactive?u:p.color;return M.createElement("li",$1({className:g,style:d,key:"legend-item-".concat(m)},cg(n.props,p,m)),M.createElement(O1,{width:a,height:a,viewBox:c,style:f},n.renderIcon(p)),M.createElement("span",{className:"recharts-legend-item-text",style:{color:y}},v?v(b,p,m):b))})}},{key:"render",value:function(){var n=this.props,i=n.payload,o=n.layout,a=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:o==="horizontal"?a:"left"};return M.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(w.PureComponent);qf(pT,"displayName","Legend");qf(pT,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Wme=_b;function Hme(){this.__data__=new Wme,this.size=0}var Gme=Hme;function Kme(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var qme=Kme;function Yme(e){return this.__data__.get(e)}var Xme=Yme;function Zme(e){return this.__data__.has(e)}var Qme=Zme,Jme=_b,eve=eT,tve=tT,rve=200;function nve(e,t){var r=this.__data__;if(r instanceof Jme){var n=r.__data__;if(!eve||n.lengths))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,p=r&Cve?new wve:void 0;for(o.set(e,t),o.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=_ge}var gT=jge,Nge=ea,Dge=gT,kge=ta,Mge="[object Arguments]",Ige="[object Array]",Rge="[object Boolean]",$ge="[object Date]",Lge="[object Error]",Fge="[object Function]",Bge="[object Map]",Vge="[object Number]",Uge="[object Object]",zge="[object RegExp]",Wge="[object Set]",Hge="[object String]",Gge="[object WeakMap]",Kge="[object ArrayBuffer]",qge="[object DataView]",Yge="[object Float32Array]",Xge="[object Float64Array]",Zge="[object Int8Array]",Qge="[object Int16Array]",Jge="[object Int32Array]",eye="[object Uint8Array]",tye="[object Uint8ClampedArray]",rye="[object Uint16Array]",nye="[object Uint32Array]",At={};At[Yge]=At[Xge]=At[Zge]=At[Qge]=At[Jge]=At[eye]=At[tye]=At[rye]=At[nye]=!0;At[Mge]=At[Ige]=At[Kge]=At[Rge]=At[qge]=At[$ge]=At[Lge]=At[Fge]=At[Bge]=At[Vge]=At[Uge]=At[zge]=At[Wge]=At[Hge]=At[Gge]=!1;function iye(e){return kge(e)&&Dge(e.length)&&!!At[Nge(e)]}var oye=iye;function aye(e){return function(t){return e(t)}}var Mz=aye,bg={exports:{}};bg.exports;(function(e,t){var r=U5,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===n,a=o&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();e.exports=s})(bg,bg.exports);var sye=bg.exports,lye=oye,uye=Mz,JD=sye,ek=JD&&JD.isTypedArray,cye=ek?uye(ek):lye,Iz=cye,dye=hge,fye=mT,pye=cn,hye=kz,mye=vT,vye=Iz,gye=Object.prototype,yye=gye.hasOwnProperty;function bye(e,t){var r=pye(e),n=!r&&fye(e),i=!r&&!n&&hye(e),o=!r&&!n&&!i&&vye(e),a=r||n||i||o,s=a?dye(e.length,String):[],l=s.length;for(var u in e)(t||yye.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||mye(u,l)))&&s.push(u);return s}var xye=bye,wye=Object.prototype;function Sye(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||wye;return e===r}var Pye=Sye;function Eye(e,t){return function(r){return e(t(r))}}var Rz=Eye,Cye=Rz,Aye=Cye(Object.keys,Object),Tye=Aye,Oye=Pye,_ye=Tye,jye=Object.prototype,Nye=jye.hasOwnProperty;function Dye(e){if(!Oye(e))return _ye(e);var t=[];for(var r in Object(e))Nye.call(e,r)&&r!="constructor"&&t.push(r);return t}var kye=Dye,Mye=QA,Iye=gT;function Rye(e){return e!=null&&Iye(e.length)&&!Mye(e)}var Gb=Rye,$ye=xye,Lye=kye,Fye=Gb;function Bye(e){return Fye(e)?$ye(e):Lye(e)}var yT=Bye,Vye=rge,Uye=fge,zye=yT;function Wye(e){return Vye(e,zye,Uye)}var Hye=Wye,tk=Hye,Gye=1,Kye=Object.prototype,qye=Kye.hasOwnProperty;function Yye(e,t,r,n,i,o){var a=r&Gye,s=tk(e),l=s.length,u=tk(t),c=u.length;if(l!=c&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in t:qye.call(t,f)))return!1}var p=o.get(e),m=o.get(t);if(p&&m)return p==t&&m==e;var v=!0;o.set(e,t),o.set(t,e);for(var g=a;++d-1}var qxe=Kxe;function Yxe(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=c0e){var u=t?null:l0e(e);if(u)return u0e(u);a=!1,i=s0e,l=new i0e}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function A0e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function T0e(e){return e.value}function O0e(e,t){if(M.isValidElement(e))return M.cloneElement(e,t);if(typeof e=="function")return M.createElement(e,t);t.ref;var r=C0e(t,g0e);return M.createElement(pT,r)}var gk=1,gu=function(e){function t(){var r;y0e(this,t);for(var n=arguments.length,i=new Array(n),o=0;ogk||Math.abs(i.height-this.lastBoundingBox.height)>gk)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?po({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,o=i.layout,a=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,c=i.chartHeight,d,f;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(a==="center"&&o==="vertical"){var p=this.getBBoxSnapshot();d={left:((u||0)-p.width)/2}}else d=a==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var m=this.getBBoxSnapshot();f={top:((c||0)-m.height)/2}}else f=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return po(po({},d),f)}},{key:"render",value:function(){var n=this,i=this.props,o=i.content,a=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,c=i.payload,d=po(po({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return M.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){n.wrapperNode=p}},O0e(o,po(po({},this.props),{},{payload:Uz(c,u,T0e)})))}}],[{key:"getWithHeight",value:function(n,i){var o=po(po({},this.defaultProps),n.props),a=o.layout;return a==="vertical"&&be(n.props.height)?{height:n.props.height}:a==="horizontal"?{width:n.props.width||i}:null}}])}(w.PureComponent);Kb(gu,"displayName","Legend");Kb(gu,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var yk=ch,_0e=mT,j0e=cn,bk=yk?yk.isConcatSpreadable:void 0;function N0e(e){return j0e(e)||_0e(e)||!!(bk&&e&&e[bk])}var D0e=N0e,k0e=Nz,M0e=D0e;function Hz(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=M0e),i||(i=[]);++o0&&r(s)?t>1?Hz(s,t-1,r,n,i):k0e(i,s):n||(i[i.length]=s)}return i}var Gz=Hz;function I0e(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var l=a[e?s:++i];if(r(o[l],l,o)===!1)break}return t}}var R0e=I0e,$0e=R0e,L0e=$0e(),F0e=L0e,B0e=F0e,V0e=yT;function U0e(e,t){return e&&B0e(e,t,V0e)}var Kz=U0e,z0e=Gb;function W0e(e,t){return function(r,n){if(r==null)return r;if(!z0e(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=Object(r);(t?o--:++ot||o&&a&&l&&!s&&!u||n&&a&&l||!r&&l||!i)return 1;if(!n&&!o&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var iwe=nwe,q0=nT,owe=iT,awe=Hc,swe=qz,lwe=J0e,uwe=Mz,cwe=iwe,dwe=Wc,fwe=cn;function pwe(e,t,r){t.length?t=q0(t,function(o){return fwe(o)?function(a){return owe(a,o.length===1?o[0]:o)}:o}):t=[dwe];var n=-1;t=q0(t,uwe(awe));var i=swe(e,function(o,a,s){var l=q0(t,function(u){return u(o)});return{criteria:l,index:++n,value:o}});return lwe(i,function(o,a){return cwe(o,a,r)})}var hwe=pwe;function mwe(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var vwe=mwe,gwe=vwe,wk=Math.max;function ywe(e,t,r){return t=wk(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=wk(n.length-t,0),a=Array(o);++i0){if(++t>=Owe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Dwe=Nwe,kwe=Twe,Mwe=Dwe,Iwe=Mwe(kwe),Rwe=Iwe,$we=Wc,Lwe=bwe,Fwe=Rwe;function Bwe(e,t){return Fwe(Lwe(e,t,$we),e+"")}var Vwe=Bwe,Uwe=JA,zwe=Gb,Wwe=vT,Hwe=ss;function Gwe(e,t,r){if(!Hwe(r))return!1;var n=typeof t;return(n=="number"?zwe(r)&&Wwe(t,r.length):n=="string"&&t in r)?Uwe(r[t],e):!1}var qb=Gwe,Kwe=Gz,qwe=hwe,Ywe=Vwe,Pk=qb,Xwe=Ywe(function(e,t){if(e==null)return[];var r=t.length;return r>1&&Pk(e,t[0],t[1])?t=[]:r>2&&Pk(t[0],t[1],t[2])&&(t=[t[0]]),qwe(e,Kwe(t,1),[])}),Zwe=Xwe;const wT=lt(Zwe);function Yf(e){"@babel/helpers - typeof";return Yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yf(e)}function H1(){return H1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(vd,"-left"),be(r)&&t&&be(t.x)&&r=t.y),"".concat(vd,"-top"),be(n)&&t&&be(t.y)&&nv?Math.max(c,l[n]):Math.max(d,l[n])}function fSe(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function pSe(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,o=e.reverseDirection,a=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,c,d;return a.height>0&&a.width>0&&r?(c=Ak({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),d=Ak({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),u=fSe({translateX:c,translateY:d,useTranslate3d:s})):u=cSe,{cssProperties:u,cssClasses:dSe({translateX:c,translateY:d,coordinate:r})}}function tc(e){"@babel/helpers - typeof";return tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tc(e)}function Tk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ok(e){for(var t=1;t_k||Math.abs(n.height-this.state.lastBoundingBox.height)>_k)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,o=i.active,a=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,c=i.coordinate,d=i.hasPayload,f=i.isAnimationActive,p=i.offset,m=i.position,v=i.reverseDirection,g=i.useTranslate3d,b=i.viewBox,y=i.wrapperStyle,x=pSe({allowEscapeViewBox:a,coordinate:c,offsetTopLeft:p,position:m,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:b}),P=x.cssClasses,S=x.cssProperties,E=Ok(Ok({transition:f&&o?"transform ".concat(s,"ms ").concat(l):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&d?"visible":"hidden",position:"absolute",top:0,left:0},y);return M.createElement("div",{tabIndex:-1,className:P,style:E,ref:function(A){n.wrapperNode=A}},u)}}])}(w.PureComponent),PSe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},No={isSsr:PSe(),get:function(t){return No[t]},set:function(t,r){if(typeof t=="string")No[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(i){No[i]=t[i]})}}};function rc(e){"@babel/helpers - typeof";return rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rc(e)}function jk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Nk(e){for(var t=1;t0;return M.createElement(SSe,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:f,active:o,coordinate:c,hasPayload:E,offset:p,position:g,reverseDirection:b,useTranslate3d:y,viewBox:x,wrapperStyle:P},kSe(u,Nk(Nk({},this.props),{},{payload:S})))}}])}(w.PureComponent);ST(Fi,"displayName","Tooltip");ST(Fi,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!No.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var MSe=so,ISe=function(){return MSe.Date.now()},RSe=ISe,$Se=/\s/;function LSe(e){for(var t=e.length;t--&&$Se.test(e.charAt(t)););return t}var FSe=LSe,BSe=FSe,VSe=/^\s+/;function USe(e){return e&&e.slice(0,BSe(e)+1).replace(VSe,"")}var zSe=USe,WSe=zSe,Dk=ss,HSe=$c,kk=NaN,GSe=/^[-+]0x[0-9a-f]+$/i,KSe=/^0b[01]+$/i,qSe=/^0o[0-7]+$/i,YSe=parseInt;function XSe(e){if(typeof e=="number")return e;if(HSe(e))return kk;if(Dk(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Dk(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=WSe(e);var r=KSe.test(e);return r||qSe.test(e)?YSe(e.slice(2),r?2:8):GSe.test(e)?kk:+e}var eW=XSe,ZSe=ss,X0=RSe,Mk=eW,QSe="Expected a function",JSe=Math.max,e1e=Math.min;function t1e(e,t,r){var n,i,o,a,s,l,u=0,c=!1,d=!1,f=!0;if(typeof e!="function")throw new TypeError(QSe);t=Mk(t)||0,ZSe(r)&&(c=!!r.leading,d="maxWait"in r,o=d?JSe(Mk(r.maxWait)||0,t):o,f="trailing"in r?!!r.trailing:f);function p(E){var C=n,A=i;return n=i=void 0,u=E,a=e.apply(A,C),a}function m(E){return u=E,s=setTimeout(b,t),c?p(E):a}function v(E){var C=E-l,A=E-u,T=t-C;return d?e1e(T,o-A):T}function g(E){var C=E-l,A=E-u;return l===void 0||C>=t||C<0||d&&A>=o}function b(){var E=X0();if(g(E))return y(E);s=setTimeout(b,v(E))}function y(E){return s=void 0,f&&n?p(E):(n=i=void 0,a)}function x(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function P(){return s===void 0?a:y(X0())}function S(){var E=X0(),C=g(E);if(n=arguments,i=this,l=E,C){if(s===void 0)return m(l);if(d)return clearTimeout(s),s=setTimeout(b,t),p(l)}return s===void 0&&(s=setTimeout(b,t)),a}return S.cancel=x,S.flush=P,S}var r1e=t1e,n1e=r1e,i1e=ss,o1e="Expected a function";function a1e(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(o1e);return i1e(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),n1e(e,t,{leading:n,maxWait:t,trailing:i})}var s1e=a1e;const tW=lt(s1e);function Zf(e){"@babel/helpers - typeof";return Zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zf(e)}function Ik(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function lm(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(L=tW(L,v,{trailing:!0,leading:!1}));var k=new ResizeObserver(L),V=S.current.getBoundingClientRect(),B=V.width,U=V.height;return N(B,U),k.observe(S.current),function(){k.disconnect()}},[N,v]);var j=w.useMemo(function(){var L=T.containerWidth,k=T.containerHeight;if(L<0||k<0)return null;Ks(Ds(a)||Ds(l),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,a,l),Ks(!r||r>0,"The aspect(%s) must be greater than zero.",r);var V=Ds(a)?L:a,B=Ds(l)?k:l;r&&r>0&&(V?B=V/r:B&&(V=B*r),f&&B>f&&(B=f)),Ks(V>0||B>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,V,B,a,l,c,d,r);var U=!Array.isArray(p)&&jo(p.type).endsWith("Chart");return M.Children.map(p,function(I){return M.isValidElement(I)?w.cloneElement(I,lm({width:V,height:B},U?{style:lm({height:"100%",width:"100%",maxHeight:B,maxWidth:V},I.props.style)}:{})):I})},[r,p,l,f,d,c,T,a]);return M.createElement("div",{id:g?"".concat(g):void 0,className:ot("recharts-responsive-container",b),style:lm(lm({},P),{},{width:a,height:l,minWidth:c,minHeight:d,maxHeight:f}),ref:S},j)}),rW=function(t){return null};rW.displayName="Cell";function Qf(e){"@babel/helpers - typeof";return Qf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qf(e)}function $k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Y1(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||No.isSsr)return{width:0,height:0};var n=S1e(r),i=JSON.stringify({text:t,copyStyle:n});if(_l.widthCache[i])return _l.widthCache[i];try{var o=document.getElementById(Lk);o||(o=document.createElement("span"),o.setAttribute("id",Lk),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=Y1(Y1({},w1e),n);Object.assign(o.style,a),o.textContent="".concat(t);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return _l.widthCache[i]=l,++_l.cacheCount>x1e&&(_l.cacheCount=0,_l.widthCache={}),l}catch{return{width:0,height:0}}},P1e=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Jf(e){"@babel/helpers - typeof";return Jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jf(e)}function Pg(e,t){return T1e(e)||A1e(e,t)||C1e(e,t)||E1e()}function E1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C1e(e,t){if(e){if(typeof e=="string")return Fk(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fk(e,t)}}function Fk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function V1e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Hk(e,t){return H1e(e)||W1e(e,t)||z1e(e,t)||U1e()}function U1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z1e(e,t){if(e){if(typeof e=="string")return Gk(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gk(e,t)}}function Gk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return V.reduce(function(B,U){var I=U.word,$=U.width,_=B[B.length-1];if(_&&(i==null||o||_.width+$+nU.width?B:U})};if(!c)return p;for(var v="â€Ļ",g=function(V){var B=d.slice(0,V),U=aW({breakAll:u,style:l,children:B+v}).wordsWithComputedWidth,I=f(U),$=I.length>a||m(I).width>Number(i);return[$,I]},b=0,y=d.length-1,x=0,P;b<=y&&x<=d.length-1;){var S=Math.floor((b+y)/2),E=S-1,C=g(E),A=Hk(C,2),T=A[0],D=A[1],N=g(S),j=Hk(N,1),L=j[0];if(!T&&!L&&(b=S+1),T&&L&&(y=S-1),!T&&L){P=D;break}x++}return P||p},Kk=function(t){var r=Qe(t)?[]:t.toString().split(oW);return[{words:r}]},K1e=function(t){var r=t.width,n=t.scaleToFit,i=t.children,o=t.style,a=t.breakAll,s=t.maxLines;if((r||n)&&!No.isSsr){var l,u,c=aW({breakAll:a,children:i,style:o});if(c){var d=c.wordsWithComputedWidth,f=c.spaceWidth;l=d,u=f}else return Kk(i);return G1e({breakAll:a,children:i,maxLines:s,style:o},l,u,r,n)}return Kk(i)},qk="#808080",Eg=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,o=i===void 0?0:i,a=t.lineHeight,s=a===void 0?"1em":a,l=t.capHeight,u=l===void 0?"0.71em":l,c=t.scaleToFit,d=c===void 0?!1:c,f=t.textAnchor,p=f===void 0?"start":f,m=t.verticalAnchor,v=m===void 0?"end":m,g=t.fill,b=g===void 0?qk:g,y=Wk(t,F1e),x=w.useMemo(function(){return K1e({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:d,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,d,y.style,y.width]),P=y.dx,S=y.dy,E=y.angle,C=y.className,A=y.breakAll,T=Wk(y,B1e);if(!nr(n)||!nr(o))return null;var D=n+(be(P)?P:0),N=o+(be(S)?S:0),j;switch(v){case"start":j=Z0("calc(".concat(u,")"));break;case"middle":j=Z0("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:j=Z0("calc(".concat(x.length-1," * -").concat(s,")"));break}var L=[];if(d){var k=x[0].width,V=y.width;L.push("scale(".concat((be(V)?V/k:1)/k,")"))}return E&&L.push("rotate(".concat(E,", ").concat(D,", ").concat(N,")")),L.length&&(T.transform=L.join(" ")),M.createElement("text",X1({},tt(T,!0),{x:D,y:N,className:ot("recharts-text",C),textAnchor:p,fill:b.includes("url")?qk:b}),x.map(function(B,U){var I=B.words.join(A?"":" ");return M.createElement("tspan",{x:D,dy:U===0?j:s,key:"".concat(I,"-").concat(U)},I)}))};function Fa(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function q1e(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function PT(e){let t,r,n;e.length!==2?(t=Fa,r=(s,l)=>Fa(e(s),l),n=(s,l)=>e(s)-l):(t=e===Fa||e===q1e?e:Y1e,r=e,n=e);function i(s,l,u=0,c=s.length){if(u>>1;r(s[d],l)<0?u=d+1:c=d}while(u>>1;r(s[d],l)<=0?u=d+1:c=d}while(uu&&n(s[d-1],l)>-n(s[d],l)?d-1:d}return{left:i,center:a,right:o}}function Y1e(){return 0}function sW(e){return e===null?NaN:+e}function*X1e(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const Z1e=PT(Fa),hh=Z1e.right;PT(sW).center;class Yk extends Map{constructor(t,r=ePe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Xk(this,t))}has(t){return super.has(Xk(this,t))}set(t,r){return super.set(Q1e(this,t),r)}delete(t){return super.delete(J1e(this,t))}}function Xk({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function Q1e({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function J1e({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function ePe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function tPe(e=Fa){if(e===Fa)return lW;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function lW(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const rPe=Math.sqrt(50),nPe=Math.sqrt(10),iPe=Math.sqrt(2);function Cg(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),a=o>=rPe?10:o>=nPe?5:o>=iPe?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/a,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*a,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=o-i+1,l=new Array(s);if(n)if(a<0)for(let u=0;u=n)&&(r=n);return r}function Qk(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function uW(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?lW:tPe(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,c=Math.log(l),d=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*d*(l-d)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(t-u*d/l+f)),m=Math.min(n,Math.floor(t+(l-u)*d/l+f));uW(e,t,p,m,i)}const o=e[t];let a=r,s=n;for(gd(e,r,t),i(e[n],o)>0&&gd(e,r,n);a0;)--s}i(e[r],o)===0?gd(e,r,s):(++s,gd(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function gd(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function oPe(e,t,r){if(e=Float64Array.from(X1e(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Qk(e);if(t>=1)return Zk(e);var n,i=(n-1)*t,o=Math.floor(i),a=Zk(uW(e,o).subarray(0,o+1)),s=Qk(e.subarray(o+1));return a+(s-a)*(i-o)}}function aPe(e,t,r=sW){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),a=+r(e[o],o,e),s=+r(e[o+1],o+1,e);return a+(s-a)*(i-o)}}function sPe(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?cm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?cm(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=uPe.exec(e))?new nn(t[1],t[2],t[3],1):(t=cPe.exec(e))?new nn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=dPe.exec(e))?cm(t[1],t[2],t[3],t[4]):(t=fPe.exec(e))?cm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pPe.exec(e))?oM(t[1],t[2]/100,t[3]/100,1):(t=hPe.exec(e))?oM(t[1],t[2]/100,t[3]/100,t[4]):Jk.hasOwnProperty(e)?rM(Jk[e]):e==="transparent"?new nn(NaN,NaN,NaN,0):null}function rM(e){return new nn(e>>16&255,e>>8&255,e&255,1)}function cm(e,t,r,n){return n<=0&&(e=t=r=NaN),new nn(e,t,r,n)}function gPe(e){return e instanceof mh||(e=np(e)),e?(e=e.rgb(),new nn(e.r,e.g,e.b,e.opacity)):new nn}function tP(e,t,r,n){return arguments.length===1?gPe(e):new nn(e,t,r,n??1)}function nn(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}CT(nn,tP,dW(mh,{brighter(e){return e=e==null?Ag:Math.pow(Ag,e),new nn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tp:Math.pow(tp,e),new nn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nn(qs(this.r),qs(this.g),qs(this.b),Tg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:nM,formatHex:nM,formatHex8:yPe,formatRgb:iM,toString:iM}));function nM(){return`#${ks(this.r)}${ks(this.g)}${ks(this.b)}`}function yPe(){return`#${ks(this.r)}${ks(this.g)}${ks(this.b)}${ks((isNaN(this.opacity)?1:this.opacity)*255)}`}function iM(){const e=Tg(this.opacity);return`${e===1?"rgb(":"rgba("}${qs(this.r)}, ${qs(this.g)}, ${qs(this.b)}${e===1?")":`, ${e})`}`}function Tg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ks(e){return e=qs(e),(e<16?"0":"")+e.toString(16)}function oM(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Si(e,t,r,n)}function fW(e){if(e instanceof Si)return new Si(e.h,e.s,e.l,e.opacity);if(e instanceof mh||(e=np(e)),!e)return new Si;if(e instanceof Si)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(r-n)/s+(r0&&l<1?0:a,new Si(a,s,l,e.opacity)}function bPe(e,t,r,n){return arguments.length===1?fW(e):new Si(e,t,r,n??1)}function Si(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}CT(Si,bPe,dW(mh,{brighter(e){return e=e==null?Ag:Math.pow(Ag,e),new Si(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tp:Math.pow(tp,e),new Si(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new nn(Q0(e>=240?e-240:e+120,i,n),Q0(e,i,n),Q0(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Si(aM(this.h),dm(this.s),dm(this.l),Tg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Tg(this.opacity);return`${e===1?"hsl(":"hsla("}${aM(this.h)}, ${dm(this.s)*100}%, ${dm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function aM(e){return e=(e||0)%360,e<0?e+360:e}function dm(e){return Math.max(0,Math.min(1,e||0))}function Q0(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const AT=e=>()=>e;function xPe(e,t){return function(r){return e+r*t}}function wPe(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function SPe(e){return(e=+e)==1?pW:function(t,r){return r-t?wPe(t,r,e):AT(isNaN(t)?r:t)}}function pW(e,t){var r=t-e;return r?xPe(e,r):AT(isNaN(e)?t:e)}const sM=function e(t){var r=SPe(t);function n(i,o){var a=r((i=tP(i)).r,(o=tP(o)).r),s=r(i.g,o.g),l=r(i.b,o.b),u=pW(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return n.gamma=e,n}(1);function PPe(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;ir&&(o=t.slice(r,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Og(n,i)})),r=J0.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function MPe(e,t,r){var n=e[0],i=e[1],o=t[0],a=t[1];return i2?IPe:MPe,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?o:(l||(l=s(e.map(n),t,r)))(n(a(f)))}return d.invert=function(f){return a(i((u||(u=s(t,e.map(n),Og)))(f)))},d.domain=function(f){return arguments.length?(e=Array.from(f,_g),c()):e.slice()},d.range=function(f){return arguments.length?(t=Array.from(f),c()):t.slice()},d.rangeRound=function(f){return t=Array.from(f),r=TT,c()},d.clamp=function(f){return arguments.length?(a=f?!0:Lr,c()):a!==Lr},d.interpolate=function(f){return arguments.length?(r=f,c()):r},d.unknown=function(f){return arguments.length?(o=f,d):o},function(f,p){return n=f,i=p,c()}}function OT(){return Yb()(Lr,Lr)}function RPe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function jg(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function nc(e){return e=jg(Math.abs(e)),e?e[1]:NaN}function $Pe(e,t){return function(r,n){for(var i=r.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),o.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}function LPe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var FPe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ip(e){if(!(t=FPe.exec(e)))throw new Error("invalid format: "+e);var t;return new _T({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}ip.prototype=_T.prototype;function _T(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}_T.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function BPe(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var hW;function VPe(e,t){var r=jg(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(hW=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,a=n.length;return o===a?n:o>a?n+new Array(o-a+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+jg(e,Math.max(0,t+o-1))[0]}function uM(e,t){var r=jg(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const cM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:RPe,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>uM(e*100,t),r:uM,s:VPe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function dM(e){return e}var fM=Array.prototype.map,pM=["y","z","a","f","p","n","Âĩ","m","","k","M","G","T","P","E","Z","Y"];function UPe(e){var t=e.grouping===void 0||e.thousands===void 0?dM:$Pe(fM.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?dM:LPe(fM.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(d){d=ip(d);var f=d.fill,p=d.align,m=d.sign,v=d.symbol,g=d.zero,b=d.width,y=d.comma,x=d.precision,P=d.trim,S=d.type;S==="n"?(y=!0,S="g"):cM[S]||(x===void 0&&(x=12),P=!0,S="g"),(g||f==="0"&&p==="=")&&(g=!0,f="0",p="=");var E=v==="$"?r:v==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",C=v==="$"?n:/[%p]/.test(S)?a:"",A=cM[S],T=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function D(N){var j=E,L=C,k,V,B;if(S==="c")L=A(N)+L,N="";else{N=+N;var U=N<0||1/N<0;if(N=isNaN(N)?l:A(Math.abs(N),x),P&&(N=BPe(N)),U&&+N==0&&m!=="+"&&(U=!1),j=(U?m==="("?m:s:m==="-"||m==="("?"":m)+j,L=(S==="s"?pM[8+hW/3]:"")+L+(U&&m==="("?")":""),T){for(k=-1,V=N.length;++kB||B>57){L=(B===46?i+N.slice(k+1):N.slice(k))+L,N=N.slice(0,k);break}}}y&&!g&&(N=t(N,1/0));var I=j.length+N.length+L.length,$=I>1)+j+N+L+$.slice(I);break;default:N=$+j+N+L;break}return o(N)}return D.toString=function(){return d+""},D}function c(d,f){var p=u((d=ip(d),d.type="f",d)),m=Math.max(-8,Math.min(8,Math.floor(nc(f)/3)))*3,v=Math.pow(10,-m),g=pM[8+m/3];return function(b){return p(v*b)+g}}return{format:u,formatPrefix:c}}var fm,jT,mW;zPe({thousands:",",grouping:[3],currency:["$",""]});function zPe(e){return fm=UPe(e),jT=fm.format,mW=fm.formatPrefix,fm}function WPe(e){return Math.max(0,-nc(Math.abs(e)))}function HPe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(nc(t)/3)))*3-nc(Math.abs(e)))}function GPe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,nc(t)-nc(e))+1}function vW(e,t,r,n){var i=J1(e,t,r),o;switch(n=ip(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=HPe(i,a))&&(n.precision=o),mW(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=GPe(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=WPe(i))&&(n.precision=o-(n.type==="%")*2);break}}return jT(n)}function ls(e){var t=e.domain;return e.ticks=function(r){var n=t();return Z1(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return vW(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,a=n[i],s=n[o],l,u,c=10;for(s0;){if(u=Q1(a,s,r),u===l)return n[i]=a,n[o]=s,t(n);if(u>0)a=Math.floor(a/u)*u,s=Math.ceil(s/u)*u;else if(u<0)a=Math.ceil(a*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function Ng(){var e=OT();return e.copy=function(){return vh(e,Ng())},si.apply(e,arguments),ls(e)}function gW(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,_g),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return gW(e).unknown(t)},e=arguments.length?Array.from(e,_g):[0,1],ls(r)}function yW(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],a;return oMath.pow(e,t)}function ZPe(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function vM(e){return(t,r)=>-e(-t,r)}function NT(e){const t=e(hM,mM),r=t.domain;let n=10,i,o;function a(){return i=ZPe(n),o=XPe(n),r()[0]<0?(i=vM(i),o=vM(o),e(KPe,qPe)):e(hM,mM),t}return t.base=function(s){return arguments.length?(n=+s,a()):n},t.domain=function(s){return arguments.length?(r(s),a()):r()},t.ticks=s=>{const l=r();let u=l[0],c=l[l.length-1];const d=c0){for(;f<=p;++f)for(m=1;mc)break;b.push(v)}}else for(;f<=p;++f)for(m=n-1;m>=1;--m)if(v=f>0?m/o(-f):m*o(f),!(vc)break;b.push(v)}b.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=ip(l)).precision==null&&(l.trim=!0),l=jT(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return c=>{let d=c/o(Math.round(i(c)));return d*nr(yW(r(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function bW(){const e=NT(Yb()).domain([1,10]);return e.copy=()=>vh(e,bW()).base(e.base()),si.apply(e,arguments),e}function gM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function yM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function DT(e){var t=1,r=e(gM(t),yM(t));return r.constant=function(n){return arguments.length?e(gM(t=+n),yM(t)):t},ls(r)}function xW(){var e=DT(Yb());return e.copy=function(){return vh(e,xW()).constant(e.constant())},si.apply(e,arguments)}function bM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function QPe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function JPe(e){return e<0?-e*e:e*e}function kT(e){var t=e(Lr,Lr),r=1;function n(){return r===1?e(Lr,Lr):r===.5?e(QPe,JPe):e(bM(r),bM(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},ls(t)}function MT(){var e=kT(Yb());return e.copy=function(){return vh(e,MT()).exponent(e.exponent())},si.apply(e,arguments),e}function eEe(){return MT.apply(null,arguments).exponent(.5)}function xM(e){return Math.sign(e)*e*e}function tEe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function wW(){var e=OT(),t=[0,1],r=!1,n;function i(o){var a=tEe(e(o));return isNaN(a)?n:r?Math.round(a):a}return i.invert=function(o){return e.invert(xM(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,_g)).map(xM)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return wW(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},si.apply(i,arguments),ls(i)}function SW(){var e=[],t=[],r=[],n;function i(){var a=0,s=Math.max(1,t.length);for(r=new Array(s-1);++a0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},a.unknown=function(l){return arguments.length&&(o=l),a},a.thresholds=function(){return n.slice()},a.copy=function(){return PW().domain([e,t]).range(i).unknown(o)},si.apply(ls(a),arguments)}function EW(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[hh(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var a=t.indexOf(o);return[e[a-1],e[a]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return EW().domain(e).range(t).unknown(r)},si.apply(i,arguments)}const ew=new Date,tw=new Date;function ir(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const a=i(o),s=i.ceil(o);return o-a(t(o=new Date(+o),a==null?1:Math.floor(a)),o),i.range=(o,a,s)=>{const l=[];if(o=i.ceil(o),s=s==null?1:Math.floor(s),!(o0))return l;let u;do l.push(u=new Date(+o)),t(o,s),e(o);while(uir(a=>{if(a>=a)for(;e(a),!o(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!o(a););else for(;--s>=0;)for(;t(a,1),!o(a););}),r&&(i.count=(o,a)=>(ew.setTime(+o),tw.setTime(+a),e(ew),e(tw),Math.floor(r(ew,tw))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?a=>n(a)%o===0:a=>i.count(0,a)%o===0):i)),i}const Dg=ir(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Dg.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ir(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Dg);Dg.range;const Po=1e3,Xn=Po*60,Eo=Xn*60,Wo=Eo*24,IT=Wo*7,wM=Wo*30,rw=Wo*365,Ms=ir(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Po)},(e,t)=>(t-e)/Po,e=>e.getUTCSeconds());Ms.range;const RT=ir(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Po)},(e,t)=>{e.setTime(+e+t*Xn)},(e,t)=>(t-e)/Xn,e=>e.getMinutes());RT.range;const $T=ir(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Xn)},(e,t)=>(t-e)/Xn,e=>e.getUTCMinutes());$T.range;const LT=ir(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Po-e.getMinutes()*Xn)},(e,t)=>{e.setTime(+e+t*Eo)},(e,t)=>(t-e)/Eo,e=>e.getHours());LT.range;const FT=ir(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Eo)},(e,t)=>(t-e)/Eo,e=>e.getUTCHours());FT.range;const gh=ir(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Xn)/Wo,e=>e.getDate()-1);gh.range;const Xb=ir(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Wo,e=>e.getUTCDate()-1);Xb.range;const CW=ir(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Wo,e=>Math.floor(e/Wo));CW.range;function bl(e){return ir(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Xn)/IT)}const Zb=bl(0),kg=bl(1),rEe=bl(2),nEe=bl(3),ic=bl(4),iEe=bl(5),oEe=bl(6);Zb.range;kg.range;rEe.range;nEe.range;ic.range;iEe.range;oEe.range;function xl(e){return ir(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/IT)}const Qb=xl(0),Mg=xl(1),aEe=xl(2),sEe=xl(3),oc=xl(4),lEe=xl(5),uEe=xl(6);Qb.range;Mg.range;aEe.range;sEe.range;oc.range;lEe.range;uEe.range;const BT=ir(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());BT.range;const VT=ir(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());VT.range;const Ho=ir(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ho.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ir(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Ho.range;const Go=ir(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Go.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ir(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Go.range;function AW(e,t,r,n,i,o){const a=[[Ms,1,Po],[Ms,5,5*Po],[Ms,15,15*Po],[Ms,30,30*Po],[o,1,Xn],[o,5,5*Xn],[o,15,15*Xn],[o,30,30*Xn],[i,1,Eo],[i,3,3*Eo],[i,6,6*Eo],[i,12,12*Eo],[n,1,Wo],[n,2,2*Wo],[r,1,IT],[t,1,wM],[t,3,3*wM],[e,1,rw]];function s(u,c,d){const f=cg).right(a,f);if(p===a.length)return e.every(J1(u/rw,c/rw,d));if(p===0)return Dg.every(Math.max(J1(u,c,d),1));const[m,v]=a[f/a[p-1][2]53)return null;"w"in H||(H.w=1),"Z"in H?(le=iw(yd(H.y,0,1)),Le=le.getUTCDay(),le=Le>4||Le===0?Mg.ceil(le):Mg(le),le=Xb.offset(le,(H.V-1)*7),H.y=le.getUTCFullYear(),H.m=le.getUTCMonth(),H.d=le.getUTCDate()+(H.w+6)%7):(le=nw(yd(H.y,0,1)),Le=le.getDay(),le=Le>4||Le===0?kg.ceil(le):kg(le),le=gh.offset(le,(H.V-1)*7),H.y=le.getFullYear(),H.m=le.getMonth(),H.d=le.getDate()+(H.w+6)%7)}else("W"in H||"U"in H)&&("w"in H||(H.w="u"in H?H.u%7:"W"in H?1:0),Le="Z"in H?iw(yd(H.y,0,1)).getUTCDay():nw(yd(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-(Le+5)%7:H.w+H.U*7-(Le+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,iw(H)):nw(H)}}function A(K,J,ee,H){for(var Pe=0,le=J.length,Le=ee.length,Ue,Ye;Pe=Le)return-1;if(Ue=J.charCodeAt(Pe++),Ue===37){if(Ue=J.charAt(Pe++),Ye=S[Ue in SM?J.charAt(Pe++):Ue],!Ye||(H=Ye(K,ee,H))<0)return-1}else if(Ue!=ee.charCodeAt(H++))return-1}return H}function T(K,J,ee){var H=u.exec(J.slice(ee));return H?(K.p=c.get(H[0].toLowerCase()),ee+H[0].length):-1}function D(K,J,ee){var H=p.exec(J.slice(ee));return H?(K.w=m.get(H[0].toLowerCase()),ee+H[0].length):-1}function N(K,J,ee){var H=d.exec(J.slice(ee));return H?(K.w=f.get(H[0].toLowerCase()),ee+H[0].length):-1}function j(K,J,ee){var H=b.exec(J.slice(ee));return H?(K.m=y.get(H[0].toLowerCase()),ee+H[0].length):-1}function L(K,J,ee){var H=v.exec(J.slice(ee));return H?(K.m=g.get(H[0].toLowerCase()),ee+H[0].length):-1}function k(K,J,ee){return A(K,t,J,ee)}function V(K,J,ee){return A(K,r,J,ee)}function B(K,J,ee){return A(K,n,J,ee)}function U(K){return a[K.getDay()]}function I(K){return o[K.getDay()]}function $(K){return l[K.getMonth()]}function _(K){return s[K.getMonth()]}function O(K){return i[+(K.getHours()>=12)]}function z(K){return 1+~~(K.getMonth()/3)}function Y(K){return a[K.getUTCDay()]}function re(K){return o[K.getUTCDay()]}function se(K){return l[K.getUTCMonth()]}function de(K){return s[K.getUTCMonth()]}function X(K){return i[+(K.getUTCHours()>=12)]}function oe(K){return 1+~~(K.getUTCMonth()/3)}return{format:function(K){var J=E(K+="",x);return J.toString=function(){return K},J},parse:function(K){var J=C(K+="",!1);return J.toString=function(){return K},J},utcFormat:function(K){var J=E(K+="",P);return J.toString=function(){return K},J},utcParse:function(K){var J=C(K+="",!0);return J.toString=function(){return K},J}}}var SM={"-":"",_:" ",0:"0"},dr=/^\s*\d+/,mEe=/^%/,vEe=/[\\^$*+?|[\]().{}]/g;function at(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function yEe(e,t,r){var n=dr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function bEe(e,t,r){var n=dr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function xEe(e,t,r){var n=dr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function wEe(e,t,r){var n=dr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function SEe(e,t,r){var n=dr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function PM(e,t,r){var n=dr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function EM(e,t,r){var n=dr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function PEe(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function EEe(e,t,r){var n=dr.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function CEe(e,t,r){var n=dr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function CM(e,t,r){var n=dr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function AEe(e,t,r){var n=dr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function AM(e,t,r){var n=dr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function TEe(e,t,r){var n=dr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function OEe(e,t,r){var n=dr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function _Ee(e,t,r){var n=dr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function jEe(e,t,r){var n=dr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function NEe(e,t,r){var n=mEe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function DEe(e,t,r){var n=dr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function kEe(e,t,r){var n=dr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function TM(e,t){return at(e.getDate(),t,2)}function MEe(e,t){return at(e.getHours(),t,2)}function IEe(e,t){return at(e.getHours()%12||12,t,2)}function REe(e,t){return at(1+gh.count(Ho(e),e),t,3)}function TW(e,t){return at(e.getMilliseconds(),t,3)}function $Ee(e,t){return TW(e,t)+"000"}function LEe(e,t){return at(e.getMonth()+1,t,2)}function FEe(e,t){return at(e.getMinutes(),t,2)}function BEe(e,t){return at(e.getSeconds(),t,2)}function VEe(e){var t=e.getDay();return t===0?7:t}function UEe(e,t){return at(Zb.count(Ho(e)-1,e),t,2)}function OW(e){var t=e.getDay();return t>=4||t===0?ic(e):ic.ceil(e)}function zEe(e,t){return e=OW(e),at(ic.count(Ho(e),e)+(Ho(e).getDay()===4),t,2)}function WEe(e){return e.getDay()}function HEe(e,t){return at(kg.count(Ho(e)-1,e),t,2)}function GEe(e,t){return at(e.getFullYear()%100,t,2)}function KEe(e,t){return e=OW(e),at(e.getFullYear()%100,t,2)}function qEe(e,t){return at(e.getFullYear()%1e4,t,4)}function YEe(e,t){var r=e.getDay();return e=r>=4||r===0?ic(e):ic.ceil(e),at(e.getFullYear()%1e4,t,4)}function XEe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+at(t/60|0,"0",2)+at(t%60,"0",2)}function OM(e,t){return at(e.getUTCDate(),t,2)}function ZEe(e,t){return at(e.getUTCHours(),t,2)}function QEe(e,t){return at(e.getUTCHours()%12||12,t,2)}function JEe(e,t){return at(1+Xb.count(Go(e),e),t,3)}function _W(e,t){return at(e.getUTCMilliseconds(),t,3)}function eCe(e,t){return _W(e,t)+"000"}function tCe(e,t){return at(e.getUTCMonth()+1,t,2)}function rCe(e,t){return at(e.getUTCMinutes(),t,2)}function nCe(e,t){return at(e.getUTCSeconds(),t,2)}function iCe(e){var t=e.getUTCDay();return t===0?7:t}function oCe(e,t){return at(Qb.count(Go(e)-1,e),t,2)}function jW(e){var t=e.getUTCDay();return t>=4||t===0?oc(e):oc.ceil(e)}function aCe(e,t){return e=jW(e),at(oc.count(Go(e),e)+(Go(e).getUTCDay()===4),t,2)}function sCe(e){return e.getUTCDay()}function lCe(e,t){return at(Mg.count(Go(e)-1,e),t,2)}function uCe(e,t){return at(e.getUTCFullYear()%100,t,2)}function cCe(e,t){return e=jW(e),at(e.getUTCFullYear()%100,t,2)}function dCe(e,t){return at(e.getUTCFullYear()%1e4,t,4)}function fCe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?oc(e):oc.ceil(e),at(e.getUTCFullYear()%1e4,t,4)}function pCe(){return"+0000"}function _M(){return"%"}function jM(e){return+e}function NM(e){return Math.floor(+e/1e3)}var jl,NW,DW;hCe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function hCe(e){return jl=hEe(e),NW=jl.format,jl.parse,DW=jl.utcFormat,jl.utcParse,jl}function mCe(e){return new Date(e)}function vCe(e){return e instanceof Date?+e:+new Date(+e)}function UT(e,t,r,n,i,o,a,s,l,u){var c=OT(),d=c.invert,f=c.domain,p=u(".%L"),m=u(":%S"),v=u("%I:%M"),g=u("%I %p"),b=u("%a %d"),y=u("%b %d"),x=u("%B"),P=u("%Y");function S(E){return(l(E)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>oPe(e,o/n))},r.copy=function(){return RW(t).domain(e)},ra.apply(r,arguments)}function ex(){var e=0,t=.5,r=1,n=1,i,o,a,s,l,u=Lr,c,d=!1,f;function p(v){return isNaN(v=+v)?f:(v=.5+((v=+c(v))-o)*(n*vt}var ECe=PCe,CCe=BW,ACe=ECe,TCe=Wc;function OCe(e){return e&&e.length?CCe(e,TCe,ACe):void 0}var _Ce=OCe;const tx=lt(_Ce);function jCe(e,t){return ee.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};Te.decimalPlaces=Te.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Tt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Te.dividedBy=Te.div=function(e){return Do(this,new this.constructor(e))};Te.dividedToIntegerBy=Te.idiv=function(e){var t=this,r=t.constructor;return gt(Do(t,new r(e),0,1),r.precision)};Te.equals=Te.eq=function(e){return!this.cmp(e)};Te.exponent=function(){return Xt(this)};Te.greaterThan=Te.gt=function(e){return this.cmp(e)>0};Te.greaterThanOrEqualTo=Te.gte=function(e){return this.cmp(e)>=0};Te.isInteger=Te.isint=function(){return this.e>this.d.length-2};Te.isNegative=Te.isneg=function(){return this.s<0};Te.isPositive=Te.ispos=function(){return this.s>0};Te.isZero=function(){return this.s===0};Te.lessThan=Te.lt=function(e){return this.cmp(e)<0};Te.lessThanOrEqualTo=Te.lte=function(e){return this.cmp(e)<1};Te.logarithm=Te.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(yn))throw Error(oi+"NaN");if(r.s<1)throw Error(oi+(r.s?"NaN":"-Infinity"));return r.eq(yn)?new n(0):(Nt=!1,t=Do(op(r,o),op(e,o),o),Nt=!0,gt(t,i))};Te.minus=Te.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?WW(t,e):UW(t,(e.s=-e.s,e))};Te.modulo=Te.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(oi+"NaN");return r.s?(Nt=!1,t=Do(r,e,0,1).times(e),Nt=!0,r.minus(t)):gt(new n(r),i)};Te.naturalExponential=Te.exp=function(){return zW(this)};Te.naturalLogarithm=Te.ln=function(){return op(this)};Te.negated=Te.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Te.plus=Te.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?UW(t,e):WW(t,(e.s=-e.s,e))};Te.precision=Te.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ys+e);if(t=Xt(i)+1,n=i.d.length-1,r=n*Tt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Te.squareRoot=Te.sqrt=function(){var e,t,r,n,i,o,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(oi+"NaN")}for(e=Xt(s),Nt=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=Ki(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=qc((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=a=r+3;;)if(o=n,n=o.plus(Do(s,o,a+2)).times(.5),Ki(o.d).slice(0,a)===(t=Ki(n.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(gt(o,r+1,0),o.times(o).eq(s)){n=o;break}}else if(t!="9999")break;a+=4}return Nt=!0,gt(n,r)};Te.times=Te.mul=function(e){var t,r,n,i,o,a,s,l,u,c=this,d=c.constructor,f=c.d,p=(e=new d(e)).d;if(!c.s||!e.s)return new d(0);for(e.s*=c.s,r=c.e+e.e,l=f.length,u=p.length,l=0;){for(t=0,i=l+n;i>n;)s=o[i]+p[n]*f[i-n-1]+t,o[i--]=s%or|0,t=s/or|0;o[i]=(o[i]+t)%or|0}for(;!o[--a];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,Nt?gt(e,d.precision):e};Te.toDecimalPlaces=Te.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(oo(e,0,Kc),t===void 0?t=n.rounding:oo(t,0,8),gt(r,e+Xt(r)+1,t))};Te.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=cl(n,!0):(oo(e,0,Kc),t===void 0?t=i.rounding:oo(t,0,8),n=gt(new i(n),e+1,t),r=cl(n,!0,e+1)),r};Te.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?cl(i):(oo(e,0,Kc),t===void 0?t=o.rounding:oo(t,0,8),n=gt(new o(i),e+Xt(i)+1,t),r=cl(n.abs(),!1,e+Xt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};Te.toInteger=Te.toint=function(){var e=this,t=e.constructor;return gt(new t(e),Xt(e)+1,t.rounding)};Te.toNumber=function(){return+this};Te.toPower=Te.pow=function(e){var t,r,n,i,o,a,s=this,l=s.constructor,u=12,c=+(e=new l(e));if(!e.s)return new l(yn);if(s=new l(s),!s.s){if(e.s<1)throw Error(oi+"Infinity");return s}if(s.eq(yn))return s;if(n=l.precision,e.eq(yn))return gt(s,n);if(t=e.e,r=e.d.length-1,a=t>=r,o=s.s,a){if((r=c<0?-c:c)<=VW){for(i=new l(yn),t=Math.ceil(n/Tt+4),Nt=!1;r%2&&(i=i.times(s),MM(i.d,t)),r=qc(r/2),r!==0;)s=s.times(s),MM(s.d,t);return Nt=!0,e.s<0?new l(yn).div(i):gt(i,n)}}else if(o<0)throw Error(oi+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,Nt=!1,i=e.times(op(s,n+u)),Nt=!0,i=zW(i),i.s=o,i};Te.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=Xt(i),n=cl(i,r<=o.toExpNeg||r>=o.toExpPos)):(oo(e,1,Kc),t===void 0?t=o.rounding:oo(t,0,8),i=gt(new o(i),e,t),r=Xt(i),n=cl(i,e<=r||r<=o.toExpNeg,e)),n};Te.toSignificantDigits=Te.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(oo(e,1,Kc),t===void 0?t=n.rounding:oo(t,0,8)),gt(new n(r),e,t)};Te.toString=Te.valueOf=Te.val=Te.toJSON=Te[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Xt(e),r=e.constructor;return cl(e,t<=r.toExpNeg||t>=r.toExpPos)};function UW(e,t){var r,n,i,o,a,s,l,u,c=e.constructor,d=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),Nt?gt(t,d):t;if(l=e.d,u=t.d,a=e.e,i=t.e,l=l.slice(),o=a-i,o){for(o<0?(n=l,o=-o,s=u.length):(n=u,i=a,s=l.length),a=Math.ceil(d/Tt),s=a>s?a+1:s+1,o>s&&(o=s,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(s=l.length,o=u.length,s-o<0&&(o=s,n=u,u=l,l=n),r=0;o;)r=(l[--o]=l[o]+u[o]+r)/or|0,l[o]%=or;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,Nt?gt(t,d):t}function oo(e,t,r){if(e!==~~e||er)throw Error(Ys+e)}function Ki(e){var t,r,n,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;ta?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,o){for(var a=0;o--;)n[o]-=a,a=n[o]1;)n.shift()}return function(n,i,o,a){var s,l,u,c,d,f,p,m,v,g,b,y,x,P,S,E,C,A,T=n.constructor,D=n.s==i.s?1:-1,N=n.d,j=i.d;if(!n.s)return new T(n);if(!i.s)throw Error(oi+"Division by zero");for(l=n.e-i.e,C=j.length,S=N.length,p=new T(D),m=p.d=[],u=0;j[u]==(N[u]||0);)++u;if(j[u]>(N[u]||0)&&--l,o==null?y=o=T.precision:a?y=o+(Xt(n)-Xt(i))+1:y=o,y<0)return new T(0);if(y=y/Tt+2|0,u=0,C==1)for(c=0,j=j[0],y++;(u1&&(j=e(j,c),N=e(N,c),C=j.length,S=N.length),P=C,v=N.slice(0,C),g=v.length;g=or/2&&++E;do c=0,s=t(j,v,C,g),s<0?(b=v[0],C!=g&&(b=b*or+(v[1]||0)),c=b/E|0,c>1?(c>=or&&(c=or-1),d=e(j,c),f=d.length,g=v.length,s=t(d,v,f,g),s==1&&(c--,r(d,C16)throw Error(HT+Xt(e));if(!e.s)return new c(yn);for(t==null?(Nt=!1,s=d):s=t,a=new c(.03125);e.abs().gte(.1);)e=e.times(a),u+=5;for(n=Math.log(Ps(2,u))/Math.LN10*2+5|0,s+=n,r=i=o=new c(yn),c.precision=s;;){if(i=gt(i.times(e),s),r=r.times(++l),a=o.plus(Do(i,r,s)),Ki(a.d).slice(0,s)===Ki(o.d).slice(0,s)){for(;u--;)o=gt(o.times(o),s);return c.precision=d,t==null?(Nt=!0,gt(o,d)):o}o=a}}function Xt(e){for(var t=e.e*Tt,r=e.d[0];r>=10;r/=10)t++;return t}function ow(e,t,r){if(t>e.LN10.sd())throw Nt=!0,r&&(e.precision=r),Error(oi+"LN10 precision limit exceeded");return gt(new e(e.LN10),t)}function fa(e){for(var t="";e--;)t+="0";return t}function op(e,t){var r,n,i,o,a,s,l,u,c,d=1,f=10,p=e,m=p.d,v=p.constructor,g=v.precision;if(p.s<1)throw Error(oi+(p.s?"NaN":"-Infinity"));if(p.eq(yn))return new v(0);if(t==null?(Nt=!1,u=g):u=t,p.eq(10))return t==null&&(Nt=!0),ow(v,u);if(u+=f,v.precision=u,r=Ki(m),n=r.charAt(0),o=Xt(p),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=Ki(p.d),n=r.charAt(0),d++;o=Xt(p),n>1?(p=new v("0."+r),o++):p=new v(n+"."+r.slice(1))}else return l=ow(v,u+2,g).times(o+""),p=op(new v(n+"."+r.slice(1)),u-f).plus(l),v.precision=g,t==null?(Nt=!0,gt(p,g)):p;for(s=a=p=Do(p.minus(yn),p.plus(yn),u),c=gt(p.times(p),u),i=3;;){if(a=gt(a.times(c),u),l=s.plus(Do(a,new v(i),u)),Ki(l.d).slice(0,u)===Ki(s.d).slice(0,u))return s=s.times(2),o!==0&&(s=s.plus(ow(v,u+2,g).times(o+""))),s=Do(s,new v(d),u),v.precision=g,t==null?(Nt=!0,gt(s,g)):s;s=l,i+=2}}function kM(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=qc(r/Tt),e.d=[],n=(r+1)%Tt,r<0&&(n+=Tt),nIg||e.e<-Ig))throw Error(HT+r)}else e.s=0,e.e=0,e.d=[0];return e}function gt(e,t,r){var n,i,o,a,s,l,u,c,d=e.d;for(a=1,o=d[0];o>=10;o/=10)a++;if(n=t-a,n<0)n+=Tt,i=t,u=d[c=0];else{if(c=Math.ceil((n+1)/Tt),o=d.length,c>=o)return e;for(u=o=d[c],a=1;o>=10;o/=10)a++;n%=Tt,i=n-Tt+a}if(r!==void 0&&(o=Ps(10,a-i-1),s=u/o%10|0,l=t<0||d[c+1]!==void 0||u%o,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/Ps(10,a-i):0:d[c-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(o=Xt(e),d.length=1,t=t-o-1,d[0]=Ps(10,(Tt-t%Tt)%Tt),e.e=qc(-t/Tt)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=c,o=1,c--):(d.length=c+1,o=Ps(10,Tt-n),d[c]=i>0?(u/Ps(10,a-i)%Ps(10,i)|0)*o:0),l)for(;;)if(c==0){(d[0]+=o)==or&&(d[0]=1,++e.e);break}else{if(d[c]+=o,d[c]!=or)break;d[c--]=0,o=1}for(n=d.length;d[--n]===0;)d.pop();if(Nt&&(e.e>Ig||e.e<-Ig))throw Error(HT+Xt(e));return e}function WW(e,t){var r,n,i,o,a,s,l,u,c,d,f=e.constructor,p=f.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new f(e),Nt?gt(t,p):t;if(l=e.d,d=t.d,n=t.e,u=e.e,l=l.slice(),a=u-n,a){for(c=a<0,c?(r=l,a=-a,s=d.length):(r=d,n=u,s=l.length),i=Math.max(Math.ceil(p/Tt),s)+2,a>i&&(a=i,r.length=1),r.reverse(),i=a;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=d.length,c=i0;--i)l[s++]=0;for(i=d.length;i>a;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+fa(n):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+fa(-i-1)+o,r&&(n=r-a)>0&&(o+=fa(n))):i>=a?(o+=fa(i+1-a),r&&(n=r-i-1)>0&&(o=o+"."+fa(n))):((n=i+1)0&&(i+1===a&&(o+="."),o+=fa(n))),e.s<0?"-"+o:o}function MM(e,t){if(e.length>t)return e.length=t,!0}function HW(e){var t,r,n;function i(o){var a=this;if(!(a instanceof i))return new i(o);if(a.constructor=i,o instanceof i){a.s=o.s,a.e=o.e,a.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Ys+o);if(o>0)a.s=1;else if(o<0)o=-o,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(o===~~o&&o<1e7){a.e=0,a.d=[o];return}return kM(a,o.toString())}else if(typeof o!="string")throw Error(Ys+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,QCe.test(o))kM(a,o);else throw Error(Ys+o)}if(i.prototype=Te,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=HW,i.config=i.set=JCe,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Ys+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ys+r+": "+n);return this}var GT=HW(ZCe);yn=new GT(1);const vt=GT;function eAe(e){return iAe(e)||nAe(e)||rAe(e)||tAe()}function tAe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rAe(e,t){if(e){if(typeof e=="string")return iP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return iP(e,t)}}function nAe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function iAe(e){if(Array.isArray(e))return iP(e)}function iP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-a,IM(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,o=void 0;try{for(var a=e[Symbol.iterator](),s;!(n=(s=a.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,o=l}finally{try{!n&&a.return!=null&&a.return()}finally{if(i)throw o}}return r}}function bAe(e){if(Array.isArray(e))return e}function XW(e){var t=ap(e,2),r=t[0],n=t[1],i=r,o=n;return r>n&&(i=n,o=r),[i,o]}function ZW(e,t,r){if(e.lte(0))return new vt(0);var n=ox.getDigitCount(e.toNumber()),i=new vt(10).pow(n),o=e.div(i),a=n!==1?.05:.1,s=new vt(Math.ceil(o.div(a).toNumber())).add(r).mul(a),l=s.mul(i);return t?l:new vt(Math.ceil(l))}function xAe(e,t,r){var n=1,i=new vt(e);if(!i.isint()&&r){var o=Math.abs(e);o<1?(n=new vt(10).pow(ox.getDigitCount(e)-1),i=new vt(Math.floor(i.div(n).toNumber())).mul(n)):o>1&&(i=new vt(Math.floor(e)))}else e===0?i=new vt(Math.floor((t-1)/2)):r||(i=new vt(Math.floor(e)));var a=Math.floor((t-1)/2),s=lAe(sAe(function(l){return i.add(new vt(l-a).mul(n)).toNumber()}),oP);return s(0,t)}function QW(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new vt(0),tickMin:new vt(0),tickMax:new vt(0)};var o=ZW(new vt(t).sub(e).div(r-1),n,i),a;e<=0&&t>=0?a=new vt(0):(a=new vt(e).add(t).div(2),a=a.sub(new vt(a).mod(o)));var s=Math.ceil(a.sub(e).div(o).toNumber()),l=Math.ceil(new vt(t).sub(a).div(o).toNumber()),u=s+l+1;return u>r?QW(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:o,tickMin:a.sub(new vt(s).mul(o)),tickMax:a.add(new vt(l).mul(o))})}function wAe(e){var t=ap(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(i,2),s=XW([r,n]),l=ap(s,2),u=l[0],c=l[1];if(u===-1/0||c===1/0){var d=c===1/0?[u].concat(sP(oP(0,i-1).map(function(){return 1/0}))):[].concat(sP(oP(0,i-1).map(function(){return-1/0})),[c]);return r>n?aP(d):d}if(u===c)return xAe(u,i,o);var f=QW(u,c,a,o),p=f.step,m=f.tickMin,v=f.tickMax,g=ox.rangeStep(m,v.add(new vt(.1).mul(p)),p);return r>n?aP(g):g}function SAe(e,t){var r=ap(e,2),n=r[0],i=r[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=XW([n,i]),s=ap(a,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var c=Math.max(t,2),d=ZW(new vt(u).sub(l).div(c-1),o,0),f=[].concat(sP(ox.rangeStep(new vt(l),new vt(u).sub(new vt(.99).mul(d)),d)),[u]);return n>i?aP(f):f}var PAe=qW(wAe),EAe=qW(SAe),CAe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ac(e){"@babel/helpers - typeof";return ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ac(e)}function Rg(){return Rg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function DAe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function kAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MAe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,a=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var l=o.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,d=i[u].coordinate,f=u>=s-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(Ai(d-c)!==Ai(f-d)){var m=[];if(Ai(f-d)===Ai(l[1]-l[0])){p=f;var v=d+l[1]-l[0];m[0]=Math.min(v,(v+c)/2),m[1]=Math.max(v,(v+c)/2)}else{p=c;var g=f+l[1]-l[0];m[0]=Math.min(d,(g+d)/2),m[1]=Math.max(d,(g+d)/2)}var b=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(t>b[0]&&t<=b[1]||t>=m[0]&&t<=m[1]){a=i[u].index;break}}else{var y=Math.min(c,f),x=Math.max(c,f);if(t>(y+d)/2&&t<=(x+d)/2){a=i[u].index;break}}}else for(var P=0;P0&&P(n[P].coordinate+n[P-1].coordinate)/2&&t<=(n[P].coordinate+n[P+1].coordinate)/2||P===s-1&&t>(n[P].coordinate+n[P-1].coordinate)/2){a=n[P].index;break}return a},KT=function(t){var r,n=t,i=n.type.displayName,o=(r=t.type)!==null&&r!==void 0&&r.defaultProps?zt(zt({},t.type.defaultProps),t.props):t.props,a=o.stroke,s=o.fill,l;switch(i){case"Line":l=a;break;case"Area":case"Radar":l=a&&a!=="none"?a:s;break;default:l=s;break}return l},ZAe=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var a={},s=Object.keys(o),l=0,u=s.length;l=0});if(b&&b.length){var y=b[0].type.defaultProps,x=y!==void 0?zt(zt({},y),b[0].props):b[0].props,P=x.barSize,S=x[g];a[S]||(a[S]=[]);var E=Qe(P)?r:P;a[S].push({item:b[0],stackList:b.slice(1),barSize:Qe(E)?void 0:ul(E,n,0)})}}return a},QAe=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,o=t.sizeList,a=o===void 0?[]:o,s=t.maxBarSize,l=a.length;if(l<1)return null;var u=ul(r,i,0,!0),c,d=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=i/l,m=a.reduce(function(P,S){return P+S.barSize||0},0);m+=(l-1)*u,m>=i&&(m-=(l-1)*u,u=0),m>=i&&p>0&&(f=!0,p*=.9,m=l*p);var v=(i-m)/2>>0,g={offset:v-u,size:0};c=a.reduce(function(P,S){var E={item:S.item,position:{offset:g.offset+g.size+u,size:f?p:S.barSize}},C=[].concat(LM(P),[E]);return g=C[C.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(A){C.push({item:A,position:g})}),C},d)}else{var b=ul(n,i,0,!0);i-2*b-(l-1)*u<=0&&(u=0);var y=(i-2*b-(l-1)*u)/l;y>1&&(y>>=0);var x=s===+s?Math.min(y,s):y;c=a.reduce(function(P,S,E){var C=[].concat(LM(P),[{item:S.item,position:{offset:b+(y+u)*E+(y-x)/2,size:x}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(A){C.push({item:A,position:C[C.length-1].position})}),C},d)}return c},JAe=function(t,r,n,i){var o=n.children,a=n.width,s=n.margin,l=a-(s.left||0)-(s.right||0),u=r6({children:o,legendWidth:l});if(u){var c=i||{},d=c.width,f=c.height,p=u.align,m=u.verticalAlign,v=u.layout;if((v==="vertical"||v==="horizontal"&&m==="middle")&&p!=="center"&&be(t[p]))return zt(zt({},t),{},bu({},p,t[p]+(d||0)));if((v==="horizontal"||v==="vertical"&&p==="center")&&m!=="middle"&&be(t[m]))return zt(zt({},t),{},bu({},m,t[m]+(f||0)))}return t},eTe=function(t,r,n){return Qe(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},n6=function(t,r,n,i,o){var a=r.props.children,s=ri(a,yh).filter(function(u){return eTe(i,o,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,c){var d=Dn(c,n);if(Qe(d))return u;var f=Array.isArray(d)?[rx(d),tx(d)]:[d,d],p=l.reduce(function(m,v){var g=Dn(c,v,0),b=f[0]-Math.abs(Array.isArray(g)?g[0]:g),y=f[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(b,m[0]),Math.max(y,m[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},tTe=function(t,r,n,i,o){var a=r.map(function(s){return n6(t,s,n,o,i)}).filter(function(s){return!Qe(s)});return a&&a.length?a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},i6=function(t,r,n,i,o){var a=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&n6(t,l,u,i)||sf(t,u,n,o)});if(n==="number")return a.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return a.reduce(function(l,u){for(var c=0,d=u.length;c=2?Ai(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var c=(t.ticks||t.niceTicks).map(function(d){var f=o?o.indexOf(d):d;return{coordinate:i(f)+u,value:d,offset:u}});return c.filter(function(d){return!fh(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,f){return{coordinate:i(d)+u,value:d,index:f,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(d){return{coordinate:i(d)+u,value:d,offset:u}}):i.domain().map(function(d,f){return{coordinate:i(d)+u,value:o?o[d]:d,index:f,offset:u}})},aw=new WeakMap,pm=function(t,r){if(typeof r!="function")return t;aw.has(t)||aw.set(t,new WeakMap);var n=aw.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},rTe=function(t,r,n){var i=t.scale,o=t.type,a=t.layout,s=t.axisType;if(i==="auto")return a==="radial"&&s==="radiusAxis"?{scale:ep(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:Ng(),realScaleType:"linear"}:o==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:af(),realScaleType:"point"}:o==="category"?{scale:ep(),realScaleType:"band"}:{scale:Ng(),realScaleType:"linear"};if(dh(i)){var l="scale".concat(Ub(i));return{scale:(DM[l]||af)(),realScaleType:DM[l]?l:"point"}}return et(i)?{scale:i}:{scale:af(),realScaleType:"point"}},BM=1e-4,nTe=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),o=Math.min(i[0],i[1])-BM,a=Math.max(i[0],i[1])+BM,s=t(r[0]),l=t(r[n-1]);(sa||la)&&t.domain([r[0],r[n-1]])}},iTe=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1]):(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1])}},sTe=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[a][n][0]=o,t[a][n][1]=o+s,o=t[a][n][1]):(t[a][n][0]=0,t[a][n][1]=0)}},lTe={sign:aTe,expand:Sme,none:Qu,silhouette:Pme,wiggle:Eme,positive:sTe},uTe=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),o=lTe[n],a=wme().keys(i).value(function(s,l){return+Dn(s,l,0)}).order(I1).offset(o);return a(t)},cTe=function(t,r,n,i,o,a){if(!t)return null;var s=a?r.reverse():r,l={},u=s.reduce(function(d,f){var p,m=(p=f.type)!==null&&p!==void 0&&p.defaultProps?zt(zt({},f.type.defaultProps),f.props):f.props,v=m.stackId,g=m.hide;if(g)return d;var b=m[n],y=d[b]||{hasStack:!1,stackGroups:{}};if(nr(v)){var x=y.stackGroups[v]||{numericAxisId:n,cateAxisId:i,items:[]};x.items.push(f),y.hasStack=!0,y.stackGroups[v]=x}else y.stackGroups[ph("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[f]};return zt(zt({},d),{},bu({},b,y))},l),c={};return Object.keys(u).reduce(function(d,f){var p=u[f];if(p.hasStack){var m={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(v,g){var b=p.stackGroups[g];return zt(zt({},v),{},bu({},g,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:uTe(t,b.items,o)}))},m)}return zt(zt({},d),{},bu({},f,p))},c)},dTe=function(t,r){var n=r.realScaleType,i=r.type,o=r.tickCount,a=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(o&&i==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var u=t.domain();if(!u.length)return null;var c=PAe(u,o,s);return t.domain([rx(c),tx(c)]),{niceTicks:c}}if(o&&i==="number"){var d=t.domain(),f=EAe(d,o,s);return{niceTicks:f}}return null};function VM(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,a=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Qe(i[t.dataKey])){var s=lg(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[o]?r[o].coordinate+n/2:null}var l=Dn(i,Qe(a)?t.dataKey:a);return Qe(l)?null:t.scale(l)}var UM=function(t){var r=t.axis,n=t.ticks,i=t.offset,o=t.bandSize,a=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=Dn(a,r.dataKey,r.domain[s]);return Qe(l)?null:r.scale(l)-o/2+i},fTe=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return i<=0&&o>=0?0:o<0?o:i}return n[0]},pTe=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?zt(zt({},t.type.defaultProps),t.props):t.props,o=i.stackId;if(nr(o)){var a=r[o];if(a){var s=a.items.indexOf(t);return s>=0?a.stackedData[s]:null}}return null},hTe=function(t){return t.reduce(function(r,n){return[rx(n.concat([r[0]]).filter(be)),tx(n.concat([r[1]]).filter(be))]},[1/0,-1/0])},a6=function(t,r,n){return Object.keys(t).reduce(function(i,o){var a=t[o],s=a.stackedData,l=s.reduce(function(u,c){var d=hTe(c.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},zM=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,WM=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,dP=function(t,r,n){if(et(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(be(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(zM.test(t[0])){var o=+zM.exec(t[0])[1];i[0]=r[0]-o}else et(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(be(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(WM.test(t[1])){var a=+WM.exec(t[1])[1];i[1]=r[1]+a}else et(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},Lg=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var o=wT(r,function(d){return d.coordinate}),a=1/0,s=1,l=o.length;sa&&(u=2*Math.PI-u),{radius:s,angle:yTe(u),angleInRadian:u}},wTe=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360),a=Math.min(i,o);return{startAngle:r-a*360,endAngle:n-a*360}},STe=function(t,r){var n=r.startAngle,i=r.endAngle,o=Math.floor(n/360),a=Math.floor(i/360),s=Math.min(o,a);return t+s*360},qM=function(t,r){var n=t.x,i=t.y,o=xTe({x:n,y:i},r),a=o.radius,s=o.angle,l=r.innerRadius,u=r.outerRadius;if(au)return!1;if(a===0)return!0;var c=wTe(r),d=c.startAngle,f=c.endAngle,p=s,m;if(d<=f){for(;p>f;)p-=360;for(;p=d&&p<=f}else{for(;p>d;)p-=360;for(;p=f&&p<=d}return m?KM(KM({},r),{},{radius:a,angle:STe(p,r)}):null};function cp(e){"@babel/helpers - typeof";return cp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cp(e)}var PTe=["offset"];function ETe(e){return OTe(e)||TTe(e)||ATe(e)||CTe()}function CTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ATe(e,t){if(e){if(typeof e=="string")return fP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fP(e,t)}}function TTe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function OTe(e){if(Array.isArray(e))return fP(e)}function fP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jTe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function YM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zt(e){for(var t=1;t=0?1:-1,x,P;i==="insideStart"?(x=p+y*a,P=v):i==="insideEnd"?(x=m-y*a,P=!v):i==="end"&&(x=m+y*a,P=v),P=b<=0?P:!P;var S=gr(u,c,g,x),E=gr(u,c,g,x+(P?1:-1)*359),C="M".concat(S.x,",").concat(S.y,` A`).concat(g,",").concat(g,",0,1,").concat(P?0:1,`, `).concat(E.x,",").concat(E.y),A=Qe(t.id)?ph("recharts-radial-line-"):t.id;return M.createElement("text",dp({},n,{dominantBaseline:"central",className:ot("recharts-radial-bar-label",s)}),M.createElement("defs",null,M.createElement("path",{id:A,d:C})),M.createElement("textPath",{xlinkHref:"#".concat(A)},r))},$Te=function(t){var r=t.viewBox,n=t.offset,i=t.position,o=r,a=o.cx,s=o.cy,l=o.innerRadius,u=o.outerRadius,c=o.startAngle,d=o.endAngle,f=(c+d)/2;if(i==="outside"){var p=gr(a,s,u+n,f),m=p.x,v=p.y;return{x:m,y:v,textAnchor:m>=a?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var g=(l+u)/2,b=gr(a,s,g,f),y=b.x,x=b.y;return{x:y,y:x,textAnchor:"middle",verticalAnchor:"middle"}},LTe=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,o=t.position,a=r,s=a.x,l=a.y,u=a.width,c=a.height,d=c>=0?1:-1,f=d*i,p=d>0?"end":"start",m=d>0?"start":"end",v=u>=0?1:-1,g=v*i,b=v>0?"end":"start",y=v>0?"start":"end";if(o==="top"){var x={x:s+u/2,y:l-d*i,textAnchor:"middle",verticalAnchor:p};return Zt(Zt({},x),n?{height:Math.max(l-n.y,0),width:u}:{})}if(o==="bottom"){var P={x:s+u/2,y:l+c+f,textAnchor:"middle",verticalAnchor:m};return Zt(Zt({},P),n?{height:Math.max(n.y+n.height-(l+c),0),width:u}:{})}if(o==="left"){var S={x:s-g,y:l+c/2,textAnchor:b,verticalAnchor:"middle"};return Zt(Zt({},S),n?{width:Math.max(S.x-n.x,0),height:c}:{})}if(o==="right"){var E={x:s+u+g,y:l+c/2,textAnchor:y,verticalAnchor:"middle"};return Zt(Zt({},E),n?{width:Math.max(n.x+n.width-E.x,0),height:c}:{})}var C=n?{width:u,height:c}:{};return o==="insideLeft"?Zt({x:s+g,y:l+c/2,textAnchor:y,verticalAnchor:"middle"},C):o==="insideRight"?Zt({x:s+u-g,y:l+c/2,textAnchor:b,verticalAnchor:"middle"},C):o==="insideTop"?Zt({x:s+u/2,y:l+f,textAnchor:"middle",verticalAnchor:m},C):o==="insideBottom"?Zt({x:s+u/2,y:l+c-f,textAnchor:"middle",verticalAnchor:p},C):o==="insideTopLeft"?Zt({x:s+g,y:l+f,textAnchor:y,verticalAnchor:m},C):o==="insideTopRight"?Zt({x:s+u-g,y:l+f,textAnchor:b,verticalAnchor:m},C):o==="insideBottomLeft"?Zt({x:s+g,y:l+c-f,textAnchor:y,verticalAnchor:p},C):o==="insideBottomRight"?Zt({x:s+u-g,y:l+c-f,textAnchor:b,verticalAnchor:p},C):Lc(o)&&(be(o.x)||Ds(o.x))&&(be(o.y)||Ds(o.y))?Zt({x:s+ul(o.x,u),y:l+ul(o.y,c),textAnchor:"end",verticalAnchor:"end"},C):Zt({x:s+u/2,y:l+c/2,textAnchor:"middle",verticalAnchor:"middle"},C)},FTe=function(t){return"cx"in t&&be(t.cx)};function Tr(e){var t=e.offset,r=t===void 0?5:t,n=_Te(e,PTe),i=Zt({offset:r},n),o=i.viewBox,a=i.position,s=i.value,l=i.children,u=i.content,c=i.className,d=c===void 0?"":c,f=i.textBreakAll;if(!o||Qe(s)&&Qe(l)&&!w.isValidElement(u)&&!et(u))return null;if(w.isValidElement(u))return w.cloneElement(u,i);var p;if(et(u)){if(p=w.createElement(u,i),w.isValidElement(p))return p}else p=MTe(i);var m=FTe(o),v=tt(i,!0);if(m&&(a==="insideStart"||a==="insideEnd"||a==="end"))return RTe(i,p,v);var g=m?$Te(i):LTe(i);return M.createElement(Eg,dp({className:ot("recharts-label",d)},v,g,{breakAll:f}),p)}Tr.displayName="Label";var l6=function(t){var r=t.cx,n=t.cy,i=t.angle,o=t.startAngle,a=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,c=t.outerRadius,d=t.x,f=t.y,p=t.top,m=t.left,v=t.width,g=t.height,b=t.clockWise,y=t.labelViewBox;if(y)return y;if(be(v)&&be(g)){if(be(d)&&be(f))return{x:d,y:f,width:v,height:g};if(be(p)&&be(m))return{x:p,y:m,width:v,height:g}}return be(d)&&be(f)?{x:d,y:f,width:0,height:0}:be(r)&&be(n)?{cx:r,cy:n,startAngle:o||i||0,endAngle:a||i||0,innerRadius:u||0,outerRadius:c||l||s||0,clockWise:b}:t.viewBox?t.viewBox:{}},BTe=function(t,r){return t?t===!0?M.createElement(Tr,{key:"label-implicit",viewBox:r}):nr(t)?M.createElement(Tr,{key:"label-implicit",viewBox:r,value:t}):w.isValidElement(t)?t.type===Tr?w.cloneElement(t,{key:"label-implicit",viewBox:r}):M.createElement(Tr,{key:"label-implicit",content:t,viewBox:r}):et(t)?M.createElement(Tr,{key:"label-implicit",content:t,viewBox:r}):Lc(t)?M.createElement(Tr,dp({viewBox:r},t,{key:"label-implicit"})):null:null},VTe=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,o=l6(t),a=ri(i,Tr).map(function(l,u){return w.cloneElement(l,{viewBox:r||o,key:"label-".concat(u)})});if(!n)return a;var s=BTe(t.label,r||o);return[s].concat(ETe(a))};Tr.parseViewBox=l6;Tr.renderCallByParent=VTe;function UTe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var zTe=UTe;const WTe=lt(zTe);function fp(e){"@babel/helpers - typeof";return fp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fp(e)}var HTe=["valueAccessor"],GTe=["data","dataKey","clockWise","id","textBreakAll"];function KTe(e){return ZTe(e)||XTe(e)||YTe(e)||qTe()}function qTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YTe(e,t){if(e){if(typeof e=="string")return pP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pP(e,t)}}function XTe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ZTe(e){if(Array.isArray(e))return pP(e)}function pP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tOe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var rOe=function(t){return Array.isArray(t.value)?WTe(t.value):t.value};function Ba(e){var t=e.valueAccessor,r=t===void 0?rOe:t,n=QM(e,HTe),i=n.data,o=n.dataKey,a=n.clockWise,s=n.id,l=n.textBreakAll,u=QM(n,GTe);return!i||!i.length?null:M.createElement(Gt,{className:"recharts-label-list"},i.map(function(c,d){var f=Qe(o)?r(c,d):Dn(c&&c.payload,o),p=Qe(s)?{}:{id:"".concat(s,"-").concat(d)};return M.createElement(Tr,Bg({},tt(c,!0),u,p,{parentViewBox:c.parentViewBox,value:f,textBreakAll:l,viewBox:Tr.parseViewBox(Qe(a)?c:ZM(ZM({},c),{},{clockWise:a})),key:"label-".concat(d),index:d}))}))}Ba.displayName="LabelList";function nOe(e,t){return e?e===!0?M.createElement(Ba,{key:"labelList-implicit",data:t}):M.isValidElement(e)||et(e)?M.createElement(Ba,{key:"labelList-implicit",data:t,content:e}):Lc(e)?M.createElement(Ba,Bg({data:t},e,{key:"labelList-implicit"})):null:null}function iOe(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=ri(n,Ba).map(function(a,s){return w.cloneElement(a,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var o=nOe(e.label,t);return[o].concat(KTe(i))}Ba.renderCallByParent=iOe;function pp(e){"@babel/helpers - typeof";return pp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pp(e)}function hP(){return hP=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(a>u),`, `).concat(d.x,",").concat(d.y,` `);if(i>0){var p=gr(r,n,i,a),m=gr(r,n,i,u);f+="L ".concat(m.x,",").concat(m.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(l)>180),",").concat(+(a<=u),`, `).concat(p.x,",").concat(p.y," Z")}else f+="L ".concat(r,",").concat(n," Z");return f},uOe=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,a=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,c=t.endAngle,d=Ai(c-u),f=hm({cx:r,cy:n,radius:o,angle:u,sign:d,cornerRadius:a,cornerIsExternal:l}),p=f.circleTangency,m=f.lineTangency,v=f.theta,g=hm({cx:r,cy:n,radius:o,angle:c,sign:-d,cornerRadius:a,cornerIsExternal:l}),b=g.circleTangency,y=g.lineTangency,x=g.theta,P=l?Math.abs(u-c):Math.abs(u-c)-v-x;if(P<0)return s?"M ".concat(m.x,",").concat(m.y,` a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0 a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0 `):u6({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:u,endAngle:c});var S="M ".concat(m.x,",").concat(m.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,` A`).concat(o,",").concat(o,",0,").concat(+(P>180),",").concat(+(d<0),",").concat(b.x,",").concat(b.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(y.x,",").concat(y.y,` `);if(i>0){var E=hm({cx:r,cy:n,radius:i,angle:u,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),C=E.circleTangency,A=E.lineTangency,T=E.theta,D=hm({cx:r,cy:n,radius:i,angle:c,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),N=D.circleTangency,j=D.lineTangency,L=D.theta,k=l?Math.abs(u-c):Math.abs(u-c)-T-L;if(k<0&&a===0)return"".concat(S,"L").concat(r,",").concat(n,"Z");S+="L".concat(j.x,",").concat(j.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(N.x,",").concat(N.y,` A`).concat(i,",").concat(i,",0,").concat(+(k>180),",").concat(+(d>0),",").concat(C.x,",").concat(C.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(d<0),",").concat(A.x,",").concat(A.y,"Z")}else S+="L".concat(r,",").concat(n,"Z");return S},cOe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},c6=function(t){var r=eI(eI({},cOe),t),n=r.cx,i=r.cy,o=r.innerRadius,a=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,c=r.startAngle,d=r.endAngle,f=r.className;if(a0&&Math.abs(c-d)<360?g=uOe({cx:n,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(v,m/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:c,endAngle:d}):g=u6({cx:n,cy:i,innerRadius:o,outerRadius:a,startAngle:c,endAngle:d}),M.createElement("path",hP({},tt(r,!0),{className:p,d:g,role:"img"}))};function hp(e){"@babel/helpers - typeof";return hp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hp(e)}function mP(){return mP=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function xOe(e,t){return Yc(e.getTime(),t.getTime())}function lI(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),o=0,a,s;(a=i.next())&&!a.done;){for(var l=t.entries(),u=!1,c=0;(s=l.next())&&!s.done;){var d=a.value,f=d[0],p=d[1],m=s.value,v=m[0],g=m[1];!u&&!n[c]&&(u=r.equals(f,v,o,c,e,t,r)&&r.equals(p,g,f,v,e,t,r))&&(n[c]=!0),c++}if(!u)return!1;o++}return!0}function wOe(e,t,r){var n=sI(e),i=n.length;if(sI(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===f6&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!d6(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function Pd(e,t,r){var n=oI(e),i=n.length;if(oI(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=n[i],o===f6&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!d6(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=aI(e,o),s=aI(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function SOe(e,t){return Yc(e.valueOf(),t.valueOf())}function POe(e,t){return e.source===t.source&&e.flags===t.flags}function uI(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var s=t.values(),l=!1,u=0;(a=s.next())&&!a.done;)!l&&!n[u]&&(l=r.equals(o.value,a.value,o.value,a.value,e,t,r))&&(n[u]=!0),u++;if(!l)return!1}return!0}function EOe(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}var COe="[object Arguments]",AOe="[object Boolean]",TOe="[object Date]",OOe="[object Map]",_Oe="[object Number]",jOe="[object Object]",NOe="[object RegExp]",DOe="[object Set]",kOe="[object String]",MOe=Array.isArray,cI=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,dI=Object.assign,IOe=Object.prototype.toString.call.bind(Object.prototype.toString);function ROe(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,l=e.areTypedArraysEqual;return function(c,d,f){if(c===d)return!0;if(c==null||d==null||typeof c!="object"||typeof d!="object")return c!==c&&d!==d;var p=c.constructor;if(p!==d.constructor)return!1;if(p===Object)return i(c,d,f);if(MOe(c))return t(c,d,f);if(cI!=null&&cI(c))return l(c,d,f);if(p===Date)return r(c,d,f);if(p===RegExp)return a(c,d,f);if(p===Map)return n(c,d,f);if(p===Set)return s(c,d,f);var m=IOe(c);return m===TOe?r(c,d,f):m===NOe?a(c,d,f):m===OOe?n(c,d,f):m===DOe?s(c,d,f):m===jOe?typeof c.then!="function"&&typeof d.then!="function"&&i(c,d,f):m===COe?i(c,d,f):m===AOe||m===_Oe||m===kOe?o(c,d,f):!1}}function $Oe(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?Pd:bOe,areDatesEqual:xOe,areMapsEqual:n?iI(lI,Pd):lI,areObjectsEqual:n?Pd:wOe,arePrimitiveWrappersEqual:SOe,areRegExpsEqual:POe,areSetsEqual:n?iI(uI,Pd):uI,areTypedArraysEqual:n?Pd:EOe};if(r&&(i=dI({},i,r(i))),t){var o=vm(i.areArraysEqual),a=vm(i.areMapsEqual),s=vm(i.areObjectsEqual),l=vm(i.areSetsEqual);i=dI({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function LOe(e){return function(t,r,n,i,o,a,s){return e(t,r,s)}}function FOe(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(l,u){var c=n(),d=c.cache,f=d===void 0?t?new WeakMap:void 0:d,p=c.meta;return r(l,u,{cache:f,equals:i,meta:p,strict:o})};if(t)return function(l,u){return r(l,u,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,u){return r(l,u,a)}}var BOe=cs();cs({strict:!0});cs({circular:!0});cs({circular:!0,strict:!0});cs({createInternalComparator:function(){return Yc}});cs({strict:!0,createInternalComparator:function(){return Yc}});cs({circular:!0,createInternalComparator:function(){return Yc}});cs({circular:!0,createInternalComparator:function(){return Yc},strict:!0});function cs(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,s=$Oe(e),l=ROe(s),u=n?n(l):LOe(l);return FOe({circular:r,comparator:l,createState:i,equals:u,strict:a})}function VOe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function fI(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(o){r<0&&(r=o),o-r>t?(e(o),r=-1):VOe(i)};requestAnimationFrame(n)}function gP(e){"@babel/helpers - typeof";return gP=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gP(e)}function UOe(e){return GOe(e)||HOe(e)||WOe(e)||zOe()}function zOe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WOe(e,t){if(e){if(typeof e=="string")return pI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pI(e,t)}}function pI(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:b<0?0:b},v=function(b){for(var y=b>1?1:b,x=y,P=0;P<8;++P){var S=d(x)-y,E=p(x);if(Math.abs(S-y)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,o=i===void 0?8:i,a=t.dt,s=a===void 0?17:a,l=function(c,d,f){var p=-(c-d)*n,m=f*o,v=f+(p-m)*s/1e3,g=f*s/1e3+c;return Math.abs(g-d)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function P_e(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}function sw(e){return T_e(e)||A_e(e)||C_e(e)||E_e()}function E_e(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function C_e(e,t){if(e){if(typeof e=="string")return SP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return SP(e,t)}}function A_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function T_e(e){if(Array.isArray(e))return SP(e)}function SP(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zg(e){return zg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zg(e)}var Ko=function(e){D_e(r,e);var t=k_e(r);function r(n,i){var o;O_e(this,r),o=t.call(this,n,i);var a=o.props,s=a.isActive,l=a.attributeName,u=a.from,c=a.to,d=a.steps,f=a.children,p=a.duration;if(o.handleStyleChange=o.handleStyleChange.bind(CP(o)),o.changeStyle=o.changeStyle.bind(CP(o)),!s||p<=0)return o.state={style:{}},typeof f=="function"&&(o.state={style:c}),EP(o);if(d&&d.length)o.state={style:d[0].style};else if(u){if(typeof f=="function")return o.state={style:u},EP(o);o.state={style:l?Ld({},l,u):u}}else o.state={style:{}};return o}return j_e(r,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,a=i.canBegin;this.mounted=!0,!(!o||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isActive,s=o.canBegin,l=o.attributeName,u=o.shouldReAnimate,c=o.to,d=o.from,f=this.state.style;if(s){if(!a){var p={style:l?Ld({},l,c):c};this.state&&f&&(l&&f[l]!==c||!l&&f!==c)&&this.setState(p);return}if(!(BOe(i.to,c)&&i.canBegin&&i.isActive)){var m=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=m||u?d:i.to;if(this.state&&f){var g={style:l?Ld({},l,v):v};(l&&f[l]!==v||!l&&f!==v)&&this.setState(g)}this.runAnimation(ci(ci({},this.props),{},{from:v,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,a=i.from,s=i.to,l=i.duration,u=i.easing,c=i.begin,d=i.onAnimationEnd,f=i.onAnimationStart,p=x_e(a,s,u_e(u),l,this.changeStyle),m=function(){o.stopJSAnimation=p()};this.manager.start([f,c,m,l,d])}},{key:"runStepAnimation",value:function(i){var o=this,a=i.steps,s=i.begin,l=i.onAnimationStart,u=a[0],c=u.style,d=u.duration,f=d===void 0?0:d,p=function(v,g,b){if(b===0)return v;var y=g.duration,x=g.easing,P=x===void 0?"ease":x,S=g.style,E=g.properties,C=g.onAnimationEnd,A=b>0?a[b-1]:g,T=E||Object.keys(S);if(typeof P=="function"||P==="spring")return[].concat(sw(v),[o.runJSAnimation.bind(o,{from:A.style,to:S,duration:y,easing:P}),y]);var D=vI(T,y,P),N=ci(ci(ci({},A.style),S),{},{transition:D});return[].concat(sw(v),[N,y,C]).filter(ZOe)};return this.manager.start([l].concat(sw(a.reduce(p,[c,Math.max(f,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=KOe());var o=i.begin,a=i.duration,s=i.attributeName,l=i.to,u=i.easing,c=i.onAnimationStart,d=i.onAnimationEnd,f=i.steps,p=i.children,m=this.manager;if(this.unSubscribe=m.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(f.length>1){this.runStepAnimation(i);return}var v=s?Ld({},s,l):l,g=vI(Object.keys(v),a,u);m.start([c,o,ci(ci({},v),{},{transition:g}),a,d])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var a=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=S_e(i,w_e),u=w.Children.count(o),c=this.state.style;if(typeof o=="function")return o(c);if(!s||u===0||a<=0)return o;var d=function(p){var m=p.props,v=m.style,g=v===void 0?{}:v,b=m.className,y=w.cloneElement(p,ci(ci({},l),{},{style:ci(ci({},g),c),className:b}));return y};return u===1?d(w.Children.only(o)):M.createElement("div",null,w.Children.map(o,function(f){return d(f)}))}}]),r}(w.PureComponent);Ko.displayName="Animate";Ko.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Ko.propTypes={from:He.oneOfType([He.object,He.string]),to:He.oneOfType([He.object,He.string]),attributeName:He.string,duration:He.number,begin:He.number,easing:He.oneOfType([He.string,He.func]),steps:He.arrayOf(He.shape({duration:He.number.isRequired,style:He.object.isRequired,easing:He.oneOfType([He.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),He.func]),properties:He.arrayOf("string"),onAnimationEnd:He.func})),children:He.oneOfType([He.node,He.func]),isActive:He.bool,canBegin:He.bool,onAnimationEnd:He.func,shouldReAnimate:He.bool,onAnimationStart:He.func,onAnimationReStart:He.func};He.object,He.object,He.object,He.element;He.object,He.object,He.object,He.oneOfType([He.array,He.element]),He.any;function gp(e){"@babel/helpers - typeof";return gp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gp(e)}function Wg(){return Wg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,c;if(a>0&&o instanceof Array){for(var d=[0,0,0,0],f=0,p=4;fa?a:o[f];c="M".concat(t,",").concat(r+s*d[0]),d[0]>0&&(c+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+l*d[0],",").concat(r)),c+="L ".concat(t+n-l*d[1],",").concat(r),d[1]>0&&(c+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`, `).concat(t+n,",").concat(r+s*d[1])),c+="L ".concat(t+n,",").concat(r+i-s*d[2]),d[2]>0&&(c+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`, `).concat(t+n-l*d[2],",").concat(r+i)),c+="L ".concat(t+l*d[3],",").concat(r+i),d[3]>0&&(c+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`, `).concat(t,",").concat(r+i-s*d[3])),c+="Z"}else if(a>0&&o===+o&&o>0){var m=Math.min(a,o);c="M ".concat(t,",").concat(r+s*m,` A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+l*m,",").concat(r,` L `).concat(t+n-l*m,",").concat(r,` A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+n,",").concat(r+s*m,` L `).concat(t+n,",").concat(r+i-s*m,` A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t+n-l*m,",").concat(r+i,` L `).concat(t+l*m,",").concat(r+i,` A `).concat(m,",").concat(m,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*m," Z")}else c="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return c},z_e=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,o=r.x,a=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(o,o+s),c=Math.max(o,o+s),d=Math.min(a,a+l),f=Math.max(a,a+l);return n>=u&&n<=c&&i>=d&&i<=f}return!1},W_e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},qT=function(t){var r=EI(EI({},W_e),t),n=w.useRef(),i=w.useState(-1),o=I_e(i,2),a=o[0],s=o[1];w.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var P=n.current.getTotalLength();P&&s(P)}catch{}},[]);var l=r.x,u=r.y,c=r.width,d=r.height,f=r.radius,p=r.className,m=r.animationEasing,v=r.animationDuration,g=r.animationBegin,b=r.isAnimationActive,y=r.isUpdateAnimationActive;if(l!==+l||u!==+u||c!==+c||d!==+d||c===0||d===0)return null;var x=ot("recharts-rectangle",p);return y?M.createElement(Ko,{canBegin:a>0,from:{width:c,height:d,x:l,y:u},to:{width:c,height:d,x:l,y:u},duration:v,animationEasing:m,isActive:y},function(P){var S=P.width,E=P.height,C=P.x,A=P.y;return M.createElement(Ko,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,isActive:b,easing:m},M.createElement("path",Wg({},tt(r,!0),{className:x,d:CI(C,A,S,E,f),ref:n})))}):M.createElement("path",Wg({},tt(r,!0),{className:x,d:CI(l,u,c,d,f)}))};function AP(){return AP=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Z_e(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Q_e=function(t,r,n,i,o,a){return"M".concat(t,",").concat(o,"v").concat(i,"M").concat(a,",").concat(r,"h").concat(n)},J_e=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,o=i===void 0?0:i,a=t.top,s=a===void 0?0:a,l=t.left,u=l===void 0?0:l,c=t.width,d=c===void 0?0:c,f=t.height,p=f===void 0?0:f,m=t.className,v=X_e(t,H_e),g=G_e({x:n,y:o,top:s,left:u,width:d,height:p},v);return!be(n)||!be(o)||!be(d)||!be(p)||!be(s)||!be(u)?null:M.createElement("path",TP({},tt(g,!0),{className:ot("recharts-cross",m),d:Q_e(n,o,d,p,s,u)}))},eje=Rz,tje=eje(Object.getPrototypeOf,Object),rje=tje,nje=ea,ije=rje,oje=ta,aje="[object Object]",sje=Function.prototype,lje=Object.prototype,b6=sje.toString,uje=lje.hasOwnProperty,cje=b6.call(Object);function dje(e){if(!oje(e)||nje(e)!=aje)return!1;var t=ije(e);if(t===null)return!0;var r=uje.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&b6.call(r)==cje}var fje=dje;const pje=lt(fje);var hje=ea,mje=ta,vje="[object Boolean]";function gje(e){return e===!0||e===!1||mje(e)&&hje(e)==vje}var yje=gje;const bje=lt(yje);function bp(e){"@babel/helpers - typeof";return bp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bp(e)}function Hg(){return Hg=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:f,x:l,y:u},to:{upperWidth:c,lowerWidth:d,height:f,x:l,y:u},duration:v,animationEasing:m,isActive:b},function(x){var P=x.upperWidth,S=x.lowerWidth,E=x.height,C=x.x,A=x.y;return M.createElement(Ko,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:v,easing:m},M.createElement("path",Hg({},tt(r,!0),{className:y,d:jI(C,A,P,S,E),ref:n})))}):M.createElement("g",null,M.createElement("path",Hg({},tt(r,!0),{className:y,d:jI(l,u,c,d,f)})))},jje=["option","shapeType","propTransformer","activeClassName","isActive"];function xp(e){"@babel/helpers - typeof";return xp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xp(e)}function Nje(e,t){if(e==null)return{};var r=Dje(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dje(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function NI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Gg(e){for(var t=1;t0&&n.handleDrag(i.changedTouches[0])}),pn(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,o=i.endIndex,a=i.onDragEnd,s=i.startIndex;a==null||a({endIndex:o,startIndex:s})}),n.detachDragEndListener()}),pn(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),pn(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),pn(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),pn(n,"handleSlideDragStart",function(i){var o=LI(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return gNe(t,e),pNe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,o=n.endX,a=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,c=u.length-1,d=Math.min(i,o),f=Math.max(i,o),p=t.getIndexInRange(a,d),m=t.getIndexInRange(a,f);return{startIndex:p-p%l,endIndex:m===c?c:m-m%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,l=Dn(o[n],s,n);return et(a)?a(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,o=i.slideMoveStartX,a=i.startX,s=i.endX,l=this.props,u=l.x,c=l.width,d=l.travellerWidth,f=l.startIndex,p=l.endIndex,m=l.onChange,v=n.pageX-o;v>0?v=Math.min(v,u+c-d-s,u+c-d-a):v<0&&(v=Math.max(v,u-a,u-s));var g=this.getIndex({startX:a+v,endX:s+v});(g.startIndex!==f||g.endIndex!==p)&&m&&m(g),this.setState({startX:a+v,endX:s+v,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var o=LI(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,o=i.brushMoveStartX,a=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[a],c=this.props,d=c.x,f=c.width,p=c.travellerWidth,m=c.onChange,v=c.gap,g=c.data,b={startX:this.state.startX,endX:this.state.endX},y=n.pageX-o;y>0?y=Math.min(y,d+f-p-u):y<0&&(y=Math.max(y,d-u)),b[a]=u+y;var x=this.getIndex(b),P=x.startIndex,S=x.endIndex,E=function(){var A=g.length-1;return a==="startX"&&(s>l?P%v===0:S%v===0)||sl?S%v===0:P%v===0)||s>l&&S===A};this.setState(pn(pn({},a,u+y),"brushMoveStartX",n.pageX),function(){m&&E()&&m(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var o=this,a=this.state,s=a.scaleValues,l=a.startX,u=a.endX,c=this.state[i],d=s.indexOf(c);if(d!==-1){var f=d+n;if(!(f===-1||f>=s.length)){var p=s[f];i==="startX"&&p>=u||i==="endX"&&p<=l||this.setState(pn({},i,p),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,o=n.y,a=n.width,s=n.height,l=n.fill,u=n.stroke;return M.createElement("rect",{stroke:u,fill:l,x:i,y:o,width:a,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,o=n.y,a=n.width,s=n.height,l=n.data,u=n.children,c=n.padding,d=w.Children.only(u);return d?M.cloneElement(d,{x:i,y:o,width:a,height:s,margin:c,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var o,a,s=this,l=this.props,u=l.y,c=l.travellerWidth,d=l.height,f=l.traveller,p=l.ariaLabel,m=l.data,v=l.startIndex,g=l.endIndex,b=Math.max(n,this.props.x),y=uw(uw({},tt(this.props,!1)),{},{x:b,y:u,width:c,height:d}),x=p||"Min value: ".concat((o=m[v])===null||o===void 0?void 0:o.name,", Max value: ").concat((a=m[g])===null||a===void 0?void 0:a.name);return M.createElement(Gt,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(S){["ArrowLeft","ArrowRight"].includes(S.key)&&(S.preventDefault(),S.stopPropagation(),s.handleTravellerMoveKeyboard(S.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(f,y))}},{key:"renderSlide",value:function(n,i){var o=this.props,a=o.y,s=o.height,l=o.stroke,u=o.travellerWidth,c=Math.min(n,i)+u,d=Math.max(Math.abs(i-n)-u,0);return M.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:c,y:a,width:d,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,o=n.endIndex,a=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,c=this.state,d=c.startX,f=c.endX,p=5,m={pointerEvents:"none",fill:u};return M.createElement(Gt,{className:"recharts-brush-texts"},M.createElement(Eg,qg({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,f)-p,y:a+s/2},m),this.getTextOfTick(i)),M.createElement(Eg,qg({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,f)+l+p,y:a+s/2},m),this.getTextOfTick(o)))}},{key:"render",value:function(){var n=this.props,i=n.data,o=n.className,a=n.children,s=n.x,l=n.y,u=n.width,c=n.height,d=n.alwaysShowText,f=this.state,p=f.startX,m=f.endX,v=f.isTextActive,g=f.isSlideMoving,b=f.isTravellerMoving,y=f.isTravellerFocused;if(!i||!i.length||!be(s)||!be(l)||!be(u)||!be(c)||u<=0||c<=0)return null;var x=ot("recharts-brush",o),P=M.Children.count(a)===1,S=dNe("userSelect","none");return M.createElement(Gt,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),P&&this.renderPanorama(),this.renderSlide(p,m),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(m,"endX"),(v||g||b||y||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,o=n.y,a=n.width,s=n.height,l=n.stroke,u=Math.floor(o+s/2)-1;return M.createElement(M.Fragment,null,M.createElement("rect",{x:i,y:o,width:a,height:s,fill:l,stroke:"none"}),M.createElement("line",{x1:i+1,y1:u,x2:i+a-1,y2:u,fill:"none",stroke:"#fff"}),M.createElement("line",{x1:i+1,y1:u+2,x2:i+a-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var o;return M.isValidElement(n)?o=M.cloneElement(n,i):et(n)?o=n(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(n,i){var o=n.data,a=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,c=n.startIndex,d=n.endIndex;if(o!==i.prevData||u!==i.prevUpdateId)return uw({prevData:o,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:a},o&&o.length?bNe({data:o,width:a,x:s,travellerWidth:l,startIndex:c,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(a!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+a-l]);var f=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:o,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:a,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:f}}return null}},{key:"getIndexInRange",value:function(n,i){for(var o=n.length,a=0,s=o-1;s-a>1;){var l=Math.floor((a+s)/2);n[l]>i?s=l:a=l}return i>=n[s]?s:a}}])}(w.PureComponent);pn(uc,"displayName","Brush");pn(uc,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var xNe=xT;function wNe(e,t){var r;return xNe(e,function(n,i,o){return r=t(n,i,o),!r}),!!r}var SNe=wNe,PNe=Oz,ENe=Hc,CNe=SNe,ANe=cn,TNe=qb;function ONe(e,t,r){var n=ANe(e)?PNe:CNe;return r&&TNe(e,t,r)&&(t=void 0),n(e,ENe(t))}var _Ne=ONe;const jNe=lt(_Ne);var to=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},FI=Yz;function NNe(e,t,r){t=="__proto__"&&FI?FI(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var DNe=NNe,kNe=DNe,MNe=Kz,INe=Hc;function RNe(e,t){var r={};return t=INe(t),MNe(e,function(n,i,o){kNe(r,i,t(n,i,o))}),r}var $Ne=RNe;const LNe=lt($Ne);function FNe(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nDe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function iDe(e,t){var r=e.x,n=e.y,i=rDe(e,QNe),o="".concat(r),a=parseInt(o,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),c=parseInt(u,10),d="".concat(t.width||i.width),f=parseInt(d,10);return Ed(Ed(Ed(Ed(Ed({},t),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:c,width:f,name:t.name,radius:t.radius})}function VI(e){return M.createElement(Fje,_P({shapeType:"rectangle",propTransformer:iDe,activeClassName:"recharts-active-bar"},e))}var oDe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var o=typeof n=="number";return o?t(n,i):(o||za(),r)}},aDe=["value","background"],P6;function cc(e){"@babel/helpers - typeof";return cc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cc(e)}function sDe(e,t){if(e==null)return{};var r=lDe(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lDe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Xg(){return Xg=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(V)0&&Math.abs(k)0&&(L=Math.min((re||0)-(k[se-1]||0),L))}),Number.isFinite(L)){var V=L/j,B=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(C=V*B/2),v.padding==="no-gap"){var U=ul(t.barCategoryGap,V*B),I=V*B/2;C=I-U-(I-U)/B*U}}}i==="xAxis"?A=[n.left+(x.left||0)+(C||0),n.left+n.width-(x.right||0)-(C||0)]:i==="yAxis"?A=l==="horizontal"?[n.top+n.height-(x.bottom||0),n.top+(x.top||0)]:[n.top+(x.top||0)+(C||0),n.top+n.height-(x.bottom||0)-(C||0)]:A=v.range,S&&(A=[A[1],A[0]]);var $=rTe(v,o,f),_=$.scale,O=$.realScaleType;_.domain(b).range(A),nTe(_);var z=dTe(_,vi(vi({},v),{},{realScaleType:O}));i==="xAxis"?(N=g==="top"&&!P||g==="bottom"&&P,T=n.left,D=d[E]-N*v.height):i==="yAxis"&&(N=g==="left"&&!P||g==="right"&&P,T=d[E]-N*v.width,D=n.top);var Y=vi(vi(vi({},v),z),{},{realScaleType:O,x:T,y:D,scale:_,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return Y.bandSize=Lg(Y,z),!v.hide&&i==="xAxis"?d[E]+=(N?-1:1)*Y.height:v.hide||(d[E]+=(N?-1:1)*Y.width),vi(vi({},p),{},lx({},m,Y))},{})},T6=function(t,r){var n=t.x,i=t.y,o=r.x,a=r.y;return{x:Math.min(n,o),y:Math.min(i,a),width:Math.abs(o-n),height:Math.abs(a-i)}},xDe=function(t){var r=t.x1,n=t.y1,i=t.x2,o=t.y2;return T6({x:r,y:n},{x:i,y:o})},O6=function(){function e(t){vDe(this,e),this.scale=t}return gDe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,o=n.position;if(r!==void 0){if(o)switch(o){case"start":return this.scale(r);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],o=n[n.length-1];return i<=o?r>=i&&r<=o:r>=o&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();lx(O6,"EPS",1e-4);var XT=function(t){var r=Object.keys(t).reduce(function(n,i){return vi(vi({},n),{},lx({},i,O6.create(t[i])))},{});return vi(vi({},r),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return LNe(i,function(l,u){return r[u].apply(l,{bandAware:a,position:s})})},isInRange:function(i){return ZNe(i,function(o,a){return r[a].isInRange(o)})}})};function wDe(e){return(e%180+180)%180}var SDe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=wDe(i),a=o*Math.PI/180,s=Math.atan(n/r),l=a>s&&ae.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function uke(e,t){return H6(e,t+1)}function cke(e,t,r,n,i){for(var o=(n||[]).slice(),a=t.start,s=t.end,l=0,u=1,c=a,d=function(){var m=n==null?void 0:n[l];if(m===void 0)return{v:H6(n,u)};var v=l,g,b=function(){return g===void 0&&(g=r(m,v)),g},y=m.coordinate,x=l===0||ty(e,y,b,c,s);x||(l=0,c=a,u+=1),x&&(c=y+e*(b()/2+i),l+=u)},f;u<=o.length;)if(f=d(),f)return f.v;return[]}function Cp(e){"@babel/helpers - typeof";return Cp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cp(e)}function eR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Cr(e){for(var t=1;t0?p.coordinate-g*e:p.coordinate})}else o[f]=p=Cr(Cr({},p),{},{tickCoord:p.coordinate});var b=ty(e,p.tickCoord,v,s,l);b&&(l=p.tickCoord-e*(v()/2+i),o[f]=Cr(Cr({},p),{},{isShow:!0}))},c=a-1;c>=0;c--)u(c);return o}function mke(e,t,r,n,i,o){var a=(n||[]).slice(),s=a.length,l=t.start,u=t.end;if(o){var c=n[s-1],d=r(c,s-1),f=e*(c.coordinate+e*d/2-u);a[s-1]=c=Cr(Cr({},c),{},{tickCoord:f>0?c.coordinate-f*e:c.coordinate});var p=ty(e,c.tickCoord,function(){return d},l,u);p&&(u=c.tickCoord-e*(d/2+i),a[s-1]=Cr(Cr({},c),{},{isShow:!0}))}for(var m=o?s-1:s,v=function(y){var x=a[y],P,S=function(){return P===void 0&&(P=r(x,y)),P};if(y===0){var E=e*(x.coordinate-e*S()/2-l);a[y]=x=Cr(Cr({},x),{},{tickCoord:E<0?x.coordinate-E*e:x.coordinate})}else a[y]=x=Cr(Cr({},x),{},{tickCoord:x.coordinate});var C=ty(e,x.tickCoord,S,l,u);C&&(l=x.tickCoord+e*(S()/2+i),a[y]=Cr(Cr({},x),{},{isShow:!0}))},g=0;g=2?Ai(i[1].coordinate-i[0].coordinate):1,b=lke(o,g,p);return l==="equidistantPreserveStart"?cke(g,b,v,i,a):(l==="preserveStart"||l==="preserveStartEnd"?f=mke(g,b,v,i,a,l==="preserveStartEnd"):f=hke(g,b,v,i,a),f.filter(function(y){return y.isShow}))}var gke=["viewBox"],yke=["viewBox"],bke=["ticks"];function hc(e){"@babel/helpers - typeof";return hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hc(e)}function Ql(){return Ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xke(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rR(e,t){for(var r=0;r0?l(this.props):l(p)),a<=0||s<=0||!m||!m.length?null:M.createElement(Gt,{className:ot("recharts-cartesian-axis",u),ref:function(g){n.layerReference=g}},o&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),Tr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,o){var a;return M.isValidElement(n)?a=M.cloneElement(n,i):et(n)?a=n(i):a=M.createElement(Eg,Ql({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}])}(w.Component);QT(px,"displayName","CartesianAxis");QT(px,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Oke=["type","layout","connectNulls","ref"],_ke=["key"];function mc(e){"@babel/helpers - typeof";return mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mc(e)}function nR(e,t){if(e==null)return{};var r=jke(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jke(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uf(){return uf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rd){p=[].concat(Nl(l.slice(0,m)),[d-v]);break}var g=p.length%2===0?[0,f]:[f];return[].concat(Nl(t.repeat(l,c)),Nl(p),g).map(function(b){return"".concat(b,"px")}).join(", ")}),gi(r,"id",ph("recharts-line-")),gi(r,"pathRef",function(a){r.mainCurve=a}),gi(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),gi(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Bke(t,e),Rke(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.points,s=o.xAxis,l=o.yAxis,u=o.layout,c=o.children,d=ri(c,yh);if(!d)return null;var f=function(v,g){return{x:v.x,y:v.y,value:v.value,errorVal:Dn(v.payload,g)}},p={clipPath:n?"url(#clipPath-".concat(i,")"):null};return M.createElement(Gt,p,d.map(function(m){return M.cloneElement(m,{key:"bar-".concat(m.props.dataKey),data:a,xAxis:s,yAxis:l,layout:u,dataPointFormatter:f})}))}},{key:"renderDots",value:function(n,i,o){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,c=s.dataKey,d=tt(this.props,!1),f=tt(l,!0),p=u.map(function(v,g){var b=fn(fn(fn({key:"dot-".concat(g),r:3},d),f),{},{value:v.value,dataKey:c,cx:v.x,cy:v.y,index:g,payload:v.payload});return t.renderDotItem(l,b)}),m={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return M.createElement(Gt,uf({className:"recharts-line-dots",key:"dots"},m),p)}},{key:"renderCurveStatically",value:function(n,i,o,a){var s=this.props,l=s.type,u=s.layout,c=s.connectNulls;s.ref;var d=nR(s,Oke),f=fn(fn(fn({},tt(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:n},a),{},{type:l,layout:u,connectNulls:c});return M.createElement(vP,uf({},f,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var o=this,a=this.props,s=a.points,l=a.strokeDasharray,u=a.isAnimationActive,c=a.animationBegin,d=a.animationDuration,f=a.animationEasing,p=a.animationId,m=a.animateNewValues,v=a.width,g=a.height,b=this.state,y=b.prevPoints,x=b.totalLength;return M.createElement(Ko,{begin:c,duration:d,isActive:u,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(P){var S=P.t;if(y){var E=y.length/s.length,C=s.map(function(j,L){var k=Math.floor(L*E);if(y[k]){var V=y[k],B=xi(V.x,j.x),U=xi(V.y,j.y);return fn(fn({},j),{},{x:B(S),y:U(S)})}if(m){var I=xi(v*2,j.x),$=xi(g/2,j.y);return fn(fn({},j),{},{x:I(S),y:$(S)})}return fn(fn({},j),{},{x:j.x,y:j.y})});return o.renderCurveStatically(C,n,i)}var A=xi(0,x),T=A(S),D;if(l){var N="".concat(l).split(/[,\s]+/gim).map(function(j){return parseFloat(j)});D=o.getStrokeDasharray(T,x,N)}else D=o.generateSimpleStrokeDasharray(x,T);return o.renderCurveStatically(s,n,i,{strokeDasharray:D})})}},{key:"renderCurve",value:function(n,i){var o=this.props,a=o.points,s=o.isAnimationActive,l=this.state,u=l.prevPoints,c=l.totalLength;return s&&a&&a.length&&(!u&&c>0||!nx(u,a))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(a,n,i)}},{key:"render",value:function(){var n,i=this.props,o=i.hide,a=i.dot,s=i.points,l=i.className,u=i.xAxis,c=i.yAxis,d=i.top,f=i.left,p=i.width,m=i.height,v=i.isAnimationActive,g=i.id;if(o||!s||!s.length)return null;var b=this.state.isAnimationFinished,y=s.length===1,x=ot("recharts-line",l),P=u&&u.allowDataOverflow,S=c&&c.allowDataOverflow,E=P||S,C=Qe(g)?this.id:g,A=(n=tt(a,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},T=A.r,D=T===void 0?3:T,N=A.strokeWidth,j=N===void 0?2:N,L=Gpe(a)?a:{},k=L.clipDot,V=k===void 0?!0:k,B=D*2+j;return M.createElement(Gt,{className:x},P||S?M.createElement("defs",null,M.createElement("clipPath",{id:"clipPath-".concat(C)},M.createElement("rect",{x:P?f:f-p/2,y:S?d:d-m/2,width:P?p:p*2,height:S?m:m*2})),!V&&M.createElement("clipPath",{id:"clipPath-dots-".concat(C)},M.createElement("rect",{x:f-B/2,y:d-B/2,width:p+B,height:m+B}))):null,!y&&this.renderCurve(E,C),this.renderErrorBar(E,C),(y||a)&&this.renderDots(E,V,C),(!v||b)&&Ba.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var o=n.length%2!==0?[].concat(Nl(n),[0]):n,a=[],s=0;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _Me(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function jMe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NMe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?a:t&&t.length&&be(i)&&be(o)?t.slice(i,o+1):[]};function u8(e){return e==="number"?[0,"auto"]:void 0}var qP=function(t,r,n,i){var o=t.graphicalItems,a=t.tooltipAxis,s=vx(r,t);return n<0||!o||!o.length||n>=s.length?null:o.reduce(function(l,u){var c,d=(c=u.props.data)!==null&&c!==void 0?c:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var f;if(a.dataKey&&!a.allowDuplicatedCategory){var p=d===void 0?s:d;f=lg(p,a.dataKey,i)}else f=d&&d[n]||s[n];return f?[].concat(bc(l),[s6(u,f)]):l},[])},dR=function(t,r,n,i){var o=i||{x:t.chartX,y:t.chartY},a=zMe(o,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,c=XAe(a,s,u,l);if(c>=0&&u){var d=u[c]&&u[c].value,f=qP(t,r,c,d),p=WMe(n,s,c,o);return{activeTooltipIndex:c,activeLabel:d,activePayload:f,activeCoordinate:p}}return null},HMe=function(t,r){var n=r.axes,i=r.graphicalItems,o=r.axisType,a=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.layout,d=t.children,f=t.stackOffset,p=o6(c,o);return n.reduce(function(m,v){var g,b=v.type.defaultProps!==void 0?Z(Z({},v.type.defaultProps),v.props):v.props,y=b.type,x=b.dataKey,P=b.allowDataOverflow,S=b.allowDuplicatedCategory,E=b.scale,C=b.ticks,A=b.includeHidden,T=b[a];if(m[T])return m;var D=vx(t.data,{graphicalItems:i.filter(function(z){var Y,re=a in z.props?z.props[a]:(Y=z.type.defaultProps)===null||Y===void 0?void 0:Y[a];return re===T}),dataStartIndex:l,dataEndIndex:u}),N=D.length,j,L,k;gMe(b.domain,P,y)&&(j=dP(b.domain,null,P),p&&(y==="number"||E!=="auto")&&(k=sf(D,x,"category")));var V=u8(y);if(!j||j.length===0){var B,U=(B=b.domain)!==null&&B!==void 0?B:V;if(x){if(j=sf(D,x,y),y==="category"&&p){var I=$pe(j);S&&I?(L=j,j=Kg(0,N)):S||(j=HM(U,j,v).reduce(function(z,Y){return z.indexOf(Y)>=0?z:[].concat(bc(z),[Y])},[]))}else if(y==="category")S?j=j.filter(function(z){return z!==""&&!Qe(z)}):j=HM(U,j,v).reduce(function(z,Y){return z.indexOf(Y)>=0||Y===""||Qe(Y)?z:[].concat(bc(z),[Y])},[]);else if(y==="number"){var $=tTe(D,i.filter(function(z){var Y,re,se=a in z.props?z.props[a]:(Y=z.type.defaultProps)===null||Y===void 0?void 0:Y[a],de="hide"in z.props?z.props.hide:(re=z.type.defaultProps)===null||re===void 0?void 0:re.hide;return se===T&&(A||!de)}),x,o,c);$&&(j=$)}p&&(y==="number"||E!=="auto")&&(k=sf(D,x,"category"))}else p?j=Kg(0,N):s&&s[T]&&s[T].hasStack&&y==="number"?j=f==="expand"?[0,1]:a6(s[T].stackGroups,l,u):j=i6(D,i.filter(function(z){var Y=a in z.props?z.props[a]:z.type.defaultProps[a],re="hide"in z.props?z.props.hide:z.type.defaultProps.hide;return Y===T&&(A||!re)}),y,c,!0);if(y==="number")j=HP(d,j,T,o,C),U&&(j=dP(U,j,P));else if(y==="category"&&U){var _=U,O=j.every(function(z){return _.indexOf(z)>=0});O&&(j=_)}}return Z(Z({},m),{},Re({},T,Z(Z({},b),{},{axisType:o,domain:j,categoricalDomain:k,duplicateDomain:L,originalDomain:(g=b.domain)!==null&&g!==void 0?g:V,isCategorical:p,layout:c})))},{})},GMe=function(t,r){var n=r.graphicalItems,i=r.Axis,o=r.axisType,a=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.layout,d=t.children,f=vx(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),p=f.length,m=o6(c,o),v=-1;return n.reduce(function(g,b){var y=b.type.defaultProps!==void 0?Z(Z({},b.type.defaultProps),b.props):b.props,x=y[a],P=u8("number");if(!g[x]){v++;var S;return m?S=Kg(0,p):s&&s[x]&&s[x].hasStack?(S=a6(s[x].stackGroups,l,u),S=HP(d,S,x,o)):(S=dP(P,i6(f,n.filter(function(E){var C,A,T=a in E.props?E.props[a]:(C=E.type.defaultProps)===null||C===void 0?void 0:C[a],D="hide"in E.props?E.props.hide:(A=E.type.defaultProps)===null||A===void 0?void 0:A.hide;return T===x&&!D}),"number",c),i.defaultProps.allowDataOverflow),S=HP(d,S,x,o)),Z(Z({},g),{},Re({},x,Z(Z({axisType:o},i.defaultProps),{},{hide:!0,orientation:ti(VMe,"".concat(o,".").concat(v%2),null),domain:S,originalDomain:P,isCategorical:m,layout:c})))}return g},{})},KMe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,o=r.AxisComp,a=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,c=t.children,d="".concat(i,"Id"),f=ri(c,o),p={};return f&&f.length?p=HMe(t,{axes:f,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):a&&a.length&&(p=GMe(t,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),p},qMe=function(t){var r=kl(t),n=Is(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:wT(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Lg(r,n)}},fR=function(t){var r=t.children,n=t.defaultShowTooltip,i=vn(r,uc),o=0,a=0;return t.data&&t.data.length!==0&&(a=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(a=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},YMe=function(t){return!t||!t.length?!1:t.some(function(r){var n=jo(r&&r.type);return n&&n.indexOf("Bar")>=0})},pR=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},XMe=function(t,r){var n=t.props,i=t.graphicalItems,o=t.xAxisMap,a=o===void 0?{}:o,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,c=n.height,d=n.children,f=n.margin||{},p=vn(d,uc),m=vn(d,gu),v=Object.keys(l).reduce(function(S,E){var C=l[E],A=C.orientation;return!C.mirror&&!C.hide?Z(Z({},S),{},Re({},A,S[A]+C.width)):S},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(S,E){var C=a[E],A=C.orientation;return!C.mirror&&!C.hide?Z(Z({},S),{},Re({},A,ti(S,"".concat(A))+C.height)):S},{top:f.top||0,bottom:f.bottom||0}),b=Z(Z({},g),v),y=b.bottom;p&&(b.bottom+=p.props.height||uc.defaultProps.height),m&&r&&(b=JAe(b,i,n,r));var x=u-b.left-b.right,P=c-b.top-b.bottom;return Z(Z({brushBottom:y},b),{},{width:Math.max(x,0),height:Math.max(P,0)})},ZMe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},QMe=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,a=t.validateTooltipEventTypes,s=a===void 0?["axis"]:a,l=t.axisComponents,u=t.legendContent,c=t.formatAxisMap,d=t.defaultProps,f=function(b,y){var x=y.graphicalItems,P=y.stackGroups,S=y.offset,E=y.updateId,C=y.dataStartIndex,A=y.dataEndIndex,T=b.barSize,D=b.layout,N=b.barGap,j=b.barCategoryGap,L=b.maxBarSize,k=pR(D),V=k.numericAxisName,B=k.cateAxisName,U=YMe(x),I=[];return x.forEach(function($,_){var O=vx(b.data,{graphicalItems:[$],dataStartIndex:C,dataEndIndex:A}),z=$.type.defaultProps!==void 0?Z(Z({},$.type.defaultProps),$.props):$.props,Y=z.dataKey,re=z.maxBarSize,se=z["".concat(V,"Id")],de=z["".concat(B,"Id")],X={},oe=l.reduce(function(pe,ue){var ne=y["".concat(ue.axisType,"Map")],Oe=z["".concat(ue.axisType,"Id")];ne&&ne[Oe]||ue.axisType==="zAxis"||za();var Be=ne[Oe];return Z(Z({},pe),{},Re(Re({},ue.axisType,Be),"".concat(ue.axisType,"Ticks"),Is(Be)))},X),K=oe[B],J=oe["".concat(B,"Ticks")],ee=P&&P[se]&&P[se].hasStack&&pTe($,P[se].stackGroups),H=jo($.type).indexOf("Bar")>=0,Pe=Lg(K,J),le=[],Le=U&&ZAe({barSize:T,stackGroups:P,totalSize:ZMe(oe,B)});if(H){var Ue,Ye,R=Qe(re)?L:re,W=(Ue=(Ye=Lg(K,J,!0))!==null&&Ye!==void 0?Ye:R)!==null&&Ue!==void 0?Ue:0;le=QAe({barGap:N,barCategoryGap:j,bandSize:W!==Pe?W:Pe,sizeList:Le[de],maxBarSize:R}),W!==Pe&&(le=le.map(function(pe){return Z(Z({},pe),{},{position:Z(Z({},pe.position),{},{offset:pe.position.offset-W/2})})}))}var G=$&&$.type&&$.type.getComposedData;G&&I.push({props:Z(Z({},G(Z(Z({},oe),{},{displayedData:O,props:b,dataKey:Y,item:$,bandSize:Pe,barPosition:le,offset:S,stackedData:ee,layout:D,dataStartIndex:C,dataEndIndex:A}))),{},Re(Re(Re({key:$.key||"item-".concat(_)},V,oe[V]),B,oe[B]),"animationId",E)),childIndex:Ype($,b.children),item:$})}),I},p=function(b,y){var x=b.props,P=b.dataStartIndex,S=b.dataEndIndex,E=b.updateId;if(!LD({props:x}))return null;var C=x.children,A=x.layout,T=x.stackOffset,D=x.data,N=x.reverseStackOrder,j=pR(A),L=j.numericAxisName,k=j.cateAxisName,V=ri(C,n),B=cTe(D,V,"".concat(L,"Id"),"".concat(k,"Id"),T,N),U=l.reduce(function(z,Y){var re="".concat(Y.axisType,"Map");return Z(Z({},z),{},Re({},re,KMe(x,Z(Z({},Y),{},{graphicalItems:V,stackGroups:Y.axisType===L&&B,dataStartIndex:P,dataEndIndex:S}))))},{}),I=XMe(Z(Z({},U),{},{props:x,graphicalItems:V}),y==null?void 0:y.legendBBox);Object.keys(U).forEach(function(z){U[z]=c(x,U[z],I,z.replace("Map",""),r)});var $=U["".concat(k,"Map")],_=qMe($),O=f(x,Z(Z({},U),{},{dataStartIndex:P,dataEndIndex:S,updateId:E,graphicalItems:V,stackGroups:B,offset:I}));return Z(Z({formattedGraphicalItems:O,graphicalItems:V,offset:I,stackGroups:B},_),U)},m=function(g){function b(y){var x,P,S;return jMe(this,b),S=kMe(this,b,[y]),Re(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Re(S,"accessibilityManager",new vMe),Re(S,"handleLegendBBoxUpdate",function(E){if(E){var C=S.state,A=C.dataStartIndex,T=C.dataEndIndex,D=C.updateId;S.setState(Z({legendBBox:E},p({props:S.props,dataStartIndex:A,dataEndIndex:T,updateId:D},Z(Z({},S.state),{},{legendBBox:E}))))}}),Re(S,"handleReceiveSyncEvent",function(E,C,A){if(S.props.syncId===E){if(A===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(C)}}),Re(S,"handleBrushChange",function(E){var C=E.startIndex,A=E.endIndex;if(C!==S.state.dataStartIndex||A!==S.state.dataEndIndex){var T=S.state.updateId;S.setState(function(){return Z({dataStartIndex:C,dataEndIndex:A},p({props:S.props,dataStartIndex:C,dataEndIndex:A,updateId:T},S.state))}),S.triggerSyncEvent({dataStartIndex:C,dataEndIndex:A})}}),Re(S,"handleMouseEnter",function(E){var C=S.getMouseInfo(E);if(C){var A=Z(Z({},C),{},{isTooltipActive:!0});S.setState(A),S.triggerSyncEvent(A);var T=S.props.onMouseEnter;et(T)&&T(A,E)}}),Re(S,"triggeredAfterMouseMove",function(E){var C=S.getMouseInfo(E),A=C?Z(Z({},C),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(A),S.triggerSyncEvent(A);var T=S.props.onMouseMove;et(T)&&T(A,E)}),Re(S,"handleItemMouseEnter",function(E){S.setState(function(){return{isTooltipActive:!0,activeItem:E,activePayload:E.tooltipPayload,activeCoordinate:E.tooltipPosition||{x:E.cx,y:E.cy}}})}),Re(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Re(S,"handleMouseMove",function(E){E.persist(),S.throttleTriggeredAfterMouseMove(E)}),Re(S,"handleMouseLeave",function(E){S.throttleTriggeredAfterMouseMove.cancel();var C={isTooltipActive:!1};S.setState(C),S.triggerSyncEvent(C);var A=S.props.onMouseLeave;et(A)&&A(C,E)}),Re(S,"handleOuterEvent",function(E){var C=qpe(E),A=ti(S.props,"".concat(C));if(C&&et(A)){var T,D;/.*touch.*/i.test(C)?D=S.getMouseInfo(E.changedTouches[0]):D=S.getMouseInfo(E),A((T=D)!==null&&T!==void 0?T:{},E)}}),Re(S,"handleClick",function(E){var C=S.getMouseInfo(E);if(C){var A=Z(Z({},C),{},{isTooltipActive:!0});S.setState(A),S.triggerSyncEvent(A);var T=S.props.onClick;et(T)&&T(A,E)}}),Re(S,"handleMouseDown",function(E){var C=S.props.onMouseDown;if(et(C)){var A=S.getMouseInfo(E);C(A,E)}}),Re(S,"handleMouseUp",function(E){var C=S.props.onMouseUp;if(et(C)){var A=S.getMouseInfo(E);C(A,E)}}),Re(S,"handleTouchMove",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(E.changedTouches[0])}),Re(S,"handleTouchStart",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&S.handleMouseDown(E.changedTouches[0])}),Re(S,"handleTouchEnd",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&S.handleMouseUp(E.changedTouches[0])}),Re(S,"triggerSyncEvent",function(E){S.props.syncId!==void 0&&dw.emit(fw,S.props.syncId,E,S.eventEmitterSymbol)}),Re(S,"applySyncEvent",function(E){var C=S.props,A=C.layout,T=C.syncMethod,D=S.state.updateId,N=E.dataStartIndex,j=E.dataEndIndex;if(E.dataStartIndex!==void 0||E.dataEndIndex!==void 0)S.setState(Z({dataStartIndex:N,dataEndIndex:j},p({props:S.props,dataStartIndex:N,dataEndIndex:j,updateId:D},S.state)));else if(E.activeTooltipIndex!==void 0){var L=E.chartX,k=E.chartY,V=E.activeTooltipIndex,B=S.state,U=B.offset,I=B.tooltipTicks;if(!U)return;if(typeof T=="function")V=T(I,E);else if(T==="value"){V=-1;for(var $=0;$=0){var ee,H;if(L.dataKey&&!L.allowDuplicatedCategory){var Pe=typeof L.dataKey=="function"?J:"payload.".concat(L.dataKey.toString());ee=lg($,Pe,V),H=_&&O&&lg(O,Pe,V)}else ee=$==null?void 0:$[k],H=_&&O&&O[k];if(de||se){var le=E.props.activeIndex!==void 0?E.props.activeIndex:k;return[w.cloneElement(E,Z(Z(Z({},T.props),oe),{},{activeIndex:le})),null,null]}if(!Qe(ee))return[K].concat(bc(S.renderActivePoints({item:T,activePoint:ee,basePoint:H,childIndex:k,isRange:_})))}else{var Le,Ue=(Le=S.getItemByXY(S.state.activeCoordinate))!==null&&Le!==void 0?Le:{graphicalItem:K},Ye=Ue.graphicalItem,R=Ye.item,W=R===void 0?E:R,G=Ye.childIndex,pe=Z(Z(Z({},T.props),oe),{},{activeIndex:G});return[w.cloneElement(W,pe),null,null]}return _?[K,null,null]:[K,null]}),Re(S,"renderCustomized",function(E,C,A){return w.cloneElement(E,Z(Z({key:"recharts-customized-".concat(A)},S.props),S.state))}),Re(S,"renderMap",{CartesianGrid:{handler:ym,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:ym},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:ym},YAxis:{handler:ym},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat((x=y.id)!==null&&x!==void 0?x:ph("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=tW(S.triggeredAfterMouseMove,(P=y.throttleDelay)!==null&&P!==void 0?P:1e3/60),S.state={},S}return RMe(b,g),DMe(b,[{key:"componentDidMount",value:function(){var x,P;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,P=x.children,S=x.data,E=x.height,C=x.layout,A=vn(P,Fi);if(A){var T=A.props.defaultIndex;if(!(typeof T!="number"||T<0||T>this.state.tooltipTicks.length-1)){var D=this.state.tooltipTicks[T]&&this.state.tooltipTicks[T].value,N=qP(this.state,S,T,D),j=this.state.tooltipTicks[T].coordinate,L=(this.state.offset.top+E)/2,k=C==="horizontal",V=k?{x:j,y:L}:{y:j,x:L},B=this.state.formattedGraphicalItems.find(function(I){var $=I.item;return $.type.name==="Scatter"});B&&(V=Z(Z({},V),B.props.points[T].tooltipPosition),N=B.props.points[T].tooltipPayload);var U={activeTooltipIndex:T,isTooltipActive:!0,activeLabel:D,activePayload:N,activeCoordinate:V};this.setState(U),this.renderCursor(A),this.accessibilityManager.setIndex(T)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,P){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==P.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var S,E;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0}})}return null}},{key:"componentDidUpdate",value:function(x){A1([vn(x.children,Fi)],[vn(this.props.children,Fi)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=vn(this.props.children,Fi);if(x&&typeof x.props.shared=="boolean"){var P=x.props.shared?"axis":"item";return s.indexOf(P)>=0?P:o}return o}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var P=this.container,S=P.getBoundingClientRect(),E=P1e(S),C={chartX:Math.round(x.pageX-E.left),chartY:Math.round(x.pageY-E.top)},A=S.width/P.offsetWidth||1,T=this.inRange(C.chartX,C.chartY,A);if(!T)return null;var D=this.state,N=D.xAxisMap,j=D.yAxisMap,L=this.getTooltipEventType();if(L!=="axis"&&N&&j){var k=kl(N).scale,V=kl(j).scale,B=k&&k.invert?k.invert(C.chartX):null,U=V&&V.invert?V.invert(C.chartY):null;return Z(Z({},C),{},{xValue:B,yValue:U})}var I=dR(this.state,this.props.data,this.props.layout,T);return I?Z(Z({},C),I):null}},{key:"inRange",value:function(x,P){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=this.props.layout,C=x/S,A=P/S;if(E==="horizontal"||E==="vertical"){var T=this.state.offset,D=C>=T.left&&C<=T.left+T.width&&A>=T.top&&A<=T.top+T.height;return D?{x:C,y:A}:null}var N=this.state,j=N.angleAxisMap,L=N.radiusAxisMap;if(j&&L){var k=kl(j);return qM({x:C,y:A},k)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,P=this.getTooltipEventType(),S=vn(x,Fi),E={};S&&P==="axis"&&(S.props.trigger==="click"?E={onClick:this.handleClick}:E={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var C=ug(this.props,this.handleOuterEvent);return Z(Z({},C),E)}},{key:"addListener",value:function(){dw.on(fw,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){dw.removeListener(fw,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,P,S){for(var E=this.state.formattedGraphicalItems,C=0,A=E.length;C{const a=[],s=new Date;for(let l=29;l>=0;l--){const u=new Date(s);u.setDate(s.getDate()-l);const c=u.toISOString().split("T")[0],d=l===0;let f=0,p=0,m=0,v=!1;e.forEach(g=>{g.exercises&&Array.isArray(g.exercises)&&g.exercises.forEach(b=>{b.completedSets&&Array.isArray(b.completedSets)&&b.completedSets.forEach(y=>{if(new Date(y.timestamp).toISOString().split("T")[0]===c&&y.metrics){v=!0;const P=(y.metrics.weight||0)*(y.metrics.reps||0);f+=P,y.completed?p+=P:m+=P}})})}),a.push({date:c,hasActivity:v,totalWeight:f,completedWeight:p,failedWeight:m,isToday:d})}return a},[e]),i=w.useMemo(()=>{const a=[],s=new Date,l=new Set;e.forEach(u=>{u.exercises&&Array.isArray(u.exercises)&&u.exercises.forEach(c=>{c.completedSets&&Array.isArray(c.completedSets)&&c.completedSets.forEach(d=>{if(d.timestamp){const f=new Date(d.timestamp).toISOString().split("T")[0];l.add(f)}})})});for(let u=51;u>=0;u--){const c=new Date(s);c.setDate(s.getDate()-u*7);const d=new Date(c);d.setDate(c.getDate()-6);let f=0;for(let v=0;v<7;v++){const g=new Date(d);g.setDate(d.getDate()+v);const b=g.toISOString().split("T")[0];l.has(b)&&f++}const p=d.getMonth(),m=["J","F","M","A","M","J","J","A","S","O","N","D"];a.push({weekLabel:m[p],weekStart:d.toISOString().split("T")[0],daysActive:f,monthIndex:p,isFirstWeekOfMonth:d.getDate()<=7})}return a},[e]),o=w.useMemo(()=>{const a=[],s=["J","F","M","A","M","J","J","A","S","O","N","D"];let l=-1,u=0,c=!1;if(i.forEach((d,f)=>{if(d.monthIndex!==l){if(l!==-1){const p=Math.floor((u+f-1)/2);a.push({start:u,end:f-1,shade:c,label:s[l],centerIdx:p}),c=!c}l=d.monthIndex,u=f}}),i.length>0){const d=Math.floor((u+i.length-1)/2);a.push({start:u,end:i.length-1,shade:c,label:s[l],centerIdx:d})}return a},[i]);return w.useMemo(()=>{for(let a=n.length-1;a>=0;a--)if(n[a].hasActivity){const s=new Date,l=new Date(n[a].date),u=Math.abs(s.getTime()-l.getTime());return Math.floor(u/(1e3*60*60*24))}return 30},[n]),h.jsxs("div",{className:"mb-4 bg-white rounded-xl overflow-hidden cursor-pointer shadow-sm",onClick:()=>r(!t),children:[h.jsxs("div",{className:"flex items-center justify-between px-4 pt-3 pb-2",children:[h.jsx("h3",{className:"text-sm font-medium text-gray-900",children:"Activity"}),h.jsx(Iv.div,{animate:{rotate:t?180:0},transition:{duration:.2},children:h.jsx(jy,{className:"h-4 w-4 text-gray-400"})})]}),h.jsx("div",{className:"px-4 pb-2",children:h.jsx("div",{className:"flex gap-[3px] items-center h-4",children:n.map(a=>h.jsx("div",{className:`flex-1 h-full rounded-full transition-colors ${a.hasActivity?"bg-blue-500":"bg-gray-200"}`,title:`${new Date(a.date).toLocaleDateString()} - ${a.hasActivity?`${a.totalWeight.toLocaleString()} kg total (${a.completedWeight.toLocaleString()} completed, ${a.failedWeight.toLocaleString()} failed)`:"No activity"}`},a.date))})}),h.jsxs("div",{className:"flex items-center justify-between px-4 pb-3",children:[h.jsx("span",{className:"text-xs text-gray-400",children:"30d ago"}),h.jsx("span",{className:"text-xs text-gray-400",children:"Today"})]}),h.jsx(aV,{children:t&&h.jsx(Iv.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3},className:"overflow-hidden",children:h.jsxs("div",{className:"px-3 pb-3 pt-2 border-t border-gray-200",children:[h.jsx("h4",{className:"text-xs font-medium text-black mb-2",children:"Days active per week (last 52 weeks)"}),h.jsx("div",{className:"h-32",children:h.jsx(v1e,{width:"100%",height:"100%",children:h.jsxs(JMe,{data:i,margin:{top:5,right:5,bottom:5,left:5},children:[h.jsx(hx,{dataKey:"weekLabel",tick:{fontSize:10,fill:"#9CA3AF"},tickLine:!1,axisLine:!1,tickFormatter:(a,s)=>{const l=o.find(u=>u.centerIdx===s);return l?l.label:""},interval:0}),h.jsx(mx,{domain:[0,7],ticks:[1,2,3,4,5,6,7],tick:!1,tickLine:!1,axisLine:!1,width:1}),[1,2,3,4,5,6,7].map(a=>h.jsx(ux,{y:a,stroke:"#E5E7EB",strokeDasharray:"3 3"},a)),o.filter(a=>a.shade).map((a,s)=>h.jsx(xh,{x1:a.start,x2:a.end,fill:"#F3F4F6",fillOpacity:1},s)),h.jsx(Fi,{content:({active:a,payload:s})=>{if(a&&s&&s.length){const l=s[0].payload;return h.jsxs("div",{className:"bg-black text-white text-xs px-2 py-1 rounded shadow",children:["Week of ",l.weekLabel,": ",l.daysActive," day",l.daysActive!==1?"s":""," active"]})}return null}}),h.jsx(wh,{type:"monotone",dataKey:"daysActive",stroke:"#3B82F6",strokeWidth:2,dot:!1,activeDot:{r:4,fill:"#3B82F6"}})]})})})]})})})]})}function tIe({open:e,onOpenChange:t,onConfirm:r,title:n,description:i,confirmText:o="Delete",cancelText:a="Cancel"}){const s=()=>{r(),t(!1)};return h.jsx(YA,{open:e,onOpenChange:t,children:h.jsxs(vb,{children:[h.jsxs(gb,{children:[h.jsx(bb,{children:n}),h.jsx(xb,{children:i})]}),h.jsxs(yb,{children:[h.jsx(Sb,{onClick:()=>t(!1),children:a}),h.jsx(wb,{onClick:s,className:"bg-red-600 hover:bg-red-700",children:o})]})]})})}const hR="selected-routine-id",mR=e=>{if(!e.completedSets||e.completedSets.length===0)return"";const t=[...e.completedSets].sort((r,n)=>new Date(n.timestamp).getTime()-new Date(r.timestamp).getTime())[0];if(!(t!=null&&t.timestamp))return"";try{const r=new Date(t.timestamp);if(isNaN(r.getTime()))return console.error("Invalid date:",t.timestamp),"";const n=r.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),i=r.getDate(),o=r.toLocaleString("en-US",{weekday:"short"}),a=r.toLocaleString("en-US",{month:"short"});return`${o} ${i} ${a} @ ${n}`}catch(r){return console.error("Error formatting date:",r),""}};function vR(){return h.jsx("div",{className:"flex items-center justify-center p-4",children:h.jsx(Ei,{className:"h-6 w-6 animate-spin text-primary"})})}function bm(){var ds,Sh;const{user:e,logout:t}=Ab(),{textSize:r}=d8(),n=w.useRef(null),[i,o]=w.useState(!0),s=(()=>{switch(r){case"large":return{exerciseName:"text-2xl",exerciseMetrics:"text-base font-medium",setButton:"text-base",buttonSize:"w-12 h-12",buttonHeight:"h-12",date:"text-xs",noteText:"text-sm",routineDropdown:"text-3xl font-semibold"};case"extra-large":return{exerciseName:"text-3xl",exerciseMetrics:"text-lg font-medium",setButton:"text-lg",buttonSize:"w-14 h-14",buttonHeight:"h-14",date:"text-sm",noteText:"text-base",routineDropdown:"text-4xl font-semibold"};default:return{exerciseName:"text-xl",exerciseMetrics:"text-sm font-medium",setButton:"text-sm",buttonSize:"w-10 h-10",buttonHeight:"h-10",date:"text-xs",noteText:"text-xs",routineDropdown:"text-2xl font-semibold"}}})(),[l,u]=w.useState([]),[c,d]=w.useState(null),[f,p]=w.useState({index:-1,exercise:null}),[m,v]=w.useState(null);w.useState(null);const[g,b]=w.useState({open:!1,mode:"create"}),[y,x]=w.useState(!1),[P,S]=w.useState(!1),[E,C]=w.useState(null),[A,T]=w.useState(new Set),[D,N]=w.useState(!1),[j,L]=w.useState(null),[k,V]=w.useState(null),[B,U]=w.useState(null),[I,$]=w.useState(!1),_=pl(),[O,z]=w.useState({}),[Y,re]=w.useState({open:!1,type:"routine",id:0,name:""}),[se,de]=w.useState(null),[X,oe]=w.useState(null),[K,J]=w.useState(null),[ee,H]=w.useState({}),[Pe,le]=w.useState(null);w.useEffect(()=>{let q=!0;return(async()=>{if(!e){o(!1);return}try{o(!0);const Q=localStorage.getItem(hR),xe=await fetch("/api/routines",{credentials:"include"});if(!xe.ok)throw new Error("Failed to fetch routines");const ge=await xe.json();if(q){const ve=ge.map(ce=>({...ce,exercises:ce.exercises.map(we=>({...we,date:we.date||we.updatedAt||ce.updatedAt||new Date().toISOString(),notes:we.notes||""}))}));u(ve);const me=Q?ve.find(ce=>ce.id===parseInt(Q)):ve[0];me?(d(me),Hr(me).then(ce=>{q&&(d(ce),u(we=>we.map(Ve=>Ve.id===me.id?ce:Ve)))}).catch(ce=>{console.error("Error loading complete routine data:",ce)})):d(ve[0])}L(!!e)}catch(Q){console.error("Error initializing data:",Q),q&&(u([]),d(null))}finally{q&&o(!1)}})(),()=>{q=!1}},[e]),w.useEffect(()=>{e&&c&&c.id!=null&&localStorage.setItem(hR,c.id.toString())},[e,c==null?void 0:c.id]),w.useEffect(()=>{if(!y)return;const q=setTimeout(()=>{const te=()=>{x(!1)};return window.addEventListener("click",te),()=>window.removeEventListener("click",te)},500);return()=>clearTimeout(q)},[y]),w.useEffect(()=>{if(y&&!P){const q=setTimeout(()=>{const te={title:"Ready to crush it? đŸ’Ē",description:"Tap Success or Fail once you've completed all your sets!",duration:5e3};_.toast(te),S(!0)},300);return()=>clearTimeout(q)}},[y,P,_]),w.useEffect(()=>{if(c!=null&&c.exercises){const q={};c.exercises.forEach(te=>{var xe;const Q=((xe=te.completedSets)==null?void 0:xe.filter(ge=>ge.metrics.weight===te.weight&&ge.metrics.reps===te.reps&&ge.metrics.sets===te.sets))||[];if(Q.length>=4){const ge=Q.slice(-4),ve=ge.every(ce=>ce.completed),me=ge.every(ce=>!ce.completed);ve||me?q[te.id]=ve?"increase":"decrease":q[te.id]=null}else q[te.id]=null}),z(q)}},[c==null?void 0:c.exercises]);const Le=async(q,te)=>{if(!(!c||!e))try{const Q=`/api/routines/${c.id}/exercises/${q}/notes`,xe=await fetch(Q,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({notes:te||""}),credentials:"include"});if(!xe.ok){const ge=await xe.text();throw console.error("Failed to update note:",ge),new Error("Failed to update note")}u(ge=>{const ve=ge.map(ce=>ce.id===c.id?{...ce,exercises:ce.exercises.map(we=>we.id===q?{...we,notes:te||""}:we)}:ce),me=ve.find(ce=>ce.id===c.id);return me&&d(me),ve})}catch(Q){console.error("Error updating note:",Q),_.toast({title:"Oops! Your note got away from us!",description:"Failed to save note. Please try again.",variant:"destructive"})}},Ue=async(q,te)=>{if(!(!c||!e))try{const Q=`/api/v2/exercises/${q}/name`;if(!(await fetch(Q,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:te}),credentials:"include"})).ok)throw new Error("Failed to update exercise name");u(ge=>{const ve=ge.map(ce=>ce.id===c.id?{...ce,exercises:ce.exercises.map(we=>we.id===q?{...we,name:te}:we)}:ce),me=ve.find(ce=>ce.id===c.id);return me&&d(me),ve})}catch(Q){console.error("Error updating exercise name:",Q),_.toast({title:"Failed to update exercise name",description:"Please try again.",variant:"destructive"})}},Ye=async(q,te)=>{var Q;if(c)try{if(te.routineId&&te.routineId!==c.id){if(console.log("Moving exercise",q,"to routine",te.routineId),!c.exercises.find(we=>we.id===q))return;const ve=`/api/routines/${c.id}/exercises/${q}/move`;if(!(await fetch(ve,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetRoutineId:te.routineId,targetOrder:0}),credentials:"include"})).ok)throw new Error("Failed to move exercise to new routine");const ce=await fetch("/api/routines",{credentials:"include"});if(ce.ok){const we=await ce.json();u(we);const Ve=we.find(mt=>mt.id===c.id);Ve&&d(Ve)}_.toast({title:"Exercise moved",description:`Moved to ${(Q=l.find(we=>we.id===te.routineId))==null?void 0:Q.name}`});return}const xe=await fetch(`/api/v2/exercises/${q}/variations`,{credentials:"include"});if(xe.ok){const ge=await xe.json();console.log("Checking for existing variation with metrics:",te),console.log("Existing variations:",ge.map(me=>({id:me.id,weight:me.targetWeight,reps:me.targetReps,sets:me.targetSets})));const ve=ge.find(me=>{const ce=Math.abs(me.targetWeight-te.weight)<.01,we=me.targetReps===te.reps,Ve=me.targetSets===te.sets;return ce&&we&&Ve});if(ve){if(console.log("Found existing variation:",ve.id,"Switching to it..."),!(await fetch(`/api/v2/exercises/${q}/variations/${ve.id}/set-current`,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include"})).ok)throw new Error("Failed to switch to existing variation");console.log("Successfully switched to existing variation")}else{if(console.log("No existing variation found, creating new one..."),!(await fetch(`/api/v2/exercises/${q}/variations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetWeight:te.weight,targetReps:te.reps,targetSets:te.sets,isActive:!0}),credentials:"include"})).ok)throw new Error("Failed to create new variation");console.log("Successfully created new variation")}}if(H(ge=>{const ve={...ge};return delete ve[q],ve}),e){const ge=await fetch("/api/routines",{credentials:"include"});if(ge.ok){const ve=await ge.json();u(ve);const me=ve.find(ce=>ce.id===c.id);me&&d(me)}}}catch(xe){console.error("Error updating exercise metrics:",xe),_.toast({title:"Failed to update exercise metrics",description:"Please try again.",variant:"destructive"})}},R=async q=>{if(!(!c||!e))try{const te=`/api/routines/${c.id}/exercises`,Q=await fetch(te,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...q,order:(c.exercises||[]).length,date:new Date().toISOString()}),credentials:"include"});if(!Q.ok)throw new Error("Failed to save exercise");const xe=await Q.json();u(ge=>{const ve=ge.map(ce=>{if(ce.id===c.id){const we=ce.exercises||[];return we.length===0&&x(!0),{...ce,exercises:[...we,{...xe,date:xe.date||new Date().toISOString()}],updatedAt:new Date().toISOString()}}return ce}),me=ve.find(ce=>ce.id===c.id);return me&&d(me),ve})}catch(te){console.error("Error saving exercise:",te)}},W=(q,te,Q)=>{let xe=!1;H(ge=>{var ce,we,Ve;const ve=ge[q]||new Set,me=new Set(ve);return me.has(te)?(me.delete(te),(ce=n.current)==null||ce.reset()):(me.add(te),me.size===Q?((we=n.current)==null||we.reset(),xe=!0):(Ve=n.current)==null||Ve.resetAndStart()),{...ge,[q]:me}}),xe&&(Math.random()<.25?(le({exerciseId:q,setNumber:te}),setTimeout(()=>{_ie({particleCount:100,spread:70,origin:{y:.6}})},400),setTimeout(()=>{le(null),G(q,!0)},600)):G(q,!0))},G=(q,te)=>{var ge;(ge=n.current)==null||ge.reset();const Q=c==null?void 0:c.exercises.find(ve=>ve.id===q);if(!Q)return;let xe;te!==void 0?xe=te:xe=(ee[q]||new Set).size===Q.sets,pe(q,xe)},pe=async(q,te)=>{var ce;x(!1),S(!1),H(we=>{const Ve={...we};return delete Ve[q],Ve}),document.activeElement instanceof HTMLElement&&document.activeElement.blur();const Q=c==null?void 0:c.exercises.find(we=>we.id===q),ge=(((ce=Q==null?void 0:Q.completedSets)==null?void 0:ce.filter(we=>we.metrics.weight===Q.weight&&we.metrics.reps===Q.reps&&we.metrics.sets===Q.sets))||[]).length;setTimeout(()=>{V({exerciseId:q,isSuccess:te,pillIndex:ge})},100),setTimeout(()=>{V(null)},1500);const ve=new Date().toISOString(),me=(we,Ve)=>{const mt=Ve.filter(dt=>dt.metrics.weight===we.weight&&dt.metrics.reps===we.reps&&dt.metrics.sets===we.sets);if(mt.length>=4){const dt=mt.slice(-4),Pt=dt.every(xt=>xt.completed),bt=dt.every(xt=>!xt.completed);if(Pt||bt){let xt=!1;mt.length===4?xt=!0:mt.length>4&&(xt=mt[mt.length-5].completed!==dt[0].completed),xt&&setTimeout(()=>{U({open:!0,type:Pt?"increase":"decrease"})},1e3)}}};try{const we=`/api/routines/${c==null?void 0:c.id}/exercises/${q}/status`,Ve=await fetch(we,{method:"PATCH",headers:{"Content-Type":"application/json","Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"},body:JSON.stringify({success:te,date:ve}),credentials:"include"});if(!Ve.ok)throw new Error("Failed to update exercise status");const mt=await Ve.json();e?(u(dt=>dt.map(Pt=>Pt.id===(c==null?void 0:c.id)?{...Pt,exercises:Pt.exercises.map(bt=>bt.id===q?{...bt,...mt,date:ve,completedSets:mt.completedSets||[],success:mt.success||!1}:bt)}:Pt)),d(dt=>{if(!dt)return null;const Pt={...dt,exercises:dt.exercises.map(xt=>xt.id===q?{...xt,...mt,date:ve,completedSets:mt.completedSets||[],success:mt.success||!1}:xt)},bt=Pt.exercises.find(xt=>xt.id===q);return bt&&me(bt,bt.completedSets),Pt})):u(dt=>{const Pt=dt.map(xt=>{if(xt.id===(c==null?void 0:c.id)){const fs=xt.exercises.map(Ri=>{if(Ri.id===q){const li=[...Ri.completedSets,{completed:te,timestamp:ve,metrics:{weight:Ri.weight,reps:Ri.reps,sets:Ri.sets}}],JT={...Ri,completedSets:li,success:li.every(f8=>f8.completed),date:ve};return me(JT,li),JT}return Ri});return{...xt,exercises:fs,updatedAt:ve}}return xt}),bt=Pt.find(xt=>xt.id===(c==null?void 0:c.id));return bt&&d(bt),Pt})}catch(we){console.error("Error updating exercise status:",we)}},ue=async()=>{if(!m||!c)return;console.log("đŸ—‘ī¸ Deleting log for",e?"authenticated":"demo","user"),N(!0);const q=`${m.exerciseId}-${m.setIndex}`;T(te=>new Set(te).add(q)),setTimeout(async()=>{var te,Q;try{let xe=!1;if(e){console.log("🔐 AUTHENTICATED USER: Processing deletion...");const ge=c.exercises.find(me=>me.id===m.exerciseId);if(!ge||!ge.completedSets||m.setIndex>=ge.completedSets.length){console.error("❌ AUTHENTICATED: Exercise or set not found",{exerciseFound:!!ge,completedSetsLength:((te=ge==null?void 0:ge.completedSets)==null?void 0:te.length)||0,requestedIndex:m.setIndex});return}const ve=ge.completedSets[m.setIndex];if(console.log("đŸŽ¯ AUTHENTICATED: Target set to remove:",{setToRemove:ve,hasCompletionId:!!ve.completionId,completionId:ve.completionId}),ve&&ve.completionId)try{console.log("📤 AUTHENTICATED: Sending delete request for completion:",ve.completionId);const me=await fetch(`/api/v2/completions/${ve.completionId}`,{method:"DELETE",credentials:"include",headers:{"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(me.ok){const ce=await me.json();console.log("✅ AUTHENTICATED: Server delete response:",ce),ce.verified?(xe=!0,console.log("✅ AUTHENTICATED: Backend verified deletion:",ce.deletedId)):(console.warn("âš ī¸ AUTHENTICATED: Backend did not verify deletion"),xe=!1)}else console.error("Server deletion failed, status:",me.status),xe=!1}catch(me){console.error("Error deleting completion from server:",me),xe=!1}else console.log("â„šī¸ AUTHENTICATED: No server-side completion to delete (newly added log), proceeding with client-side deletion"),xe=!0;if(xe){const me=ge.completedSets.filter((we,Ve)=>Ve!==m.setIndex),ce={...ge,completedSets:me,success:me.length>0?(Q=me[me.length-1])==null?void 0:Q.completed:!1,date:me.length>0?me[me.length-1].timestamp:ge.date};u(we=>we.map(Ve=>Ve.id===c.id?{...Ve,exercises:Ve.exercises.map(mt=>mt.id===ge.id?ce:mt),updatedAt:new Date().toISOString()}:Ve)),d(we=>we?{...we,exercises:we.exercises.map(Ve=>Ve.id===ge.id?ce:Ve),updatedAt:new Date().toISOString()}:null),console.log("✅ AUTHENTICATED: UI state updated - deleted log removed")}}}catch(xe){console.error("❌ FATAL ERROR in handleRemoveSet:",xe),N(!1)}T(xe=>{const ge=new Set(xe);return ge.delete(q),ge}),v(null),N(!1),console.log("🏁 REMOVE SET: Process completed")},300)},ne=async q=>{e&&(C(q),setTimeout(async()=>{p({index:-1,exercise:null});try{const te=`/api/routines/${c==null?void 0:c.id}/exercises/${q}`,Q=await fetch(te,{method:"DELETE",credentials:"include"});if(!Q.ok)throw new Error("Failed to delete exercise");const xe=await Q.json();d(xe),u(ge=>ge.map(ve=>ve.id===xe.id?xe:ve))}catch(te){console.error("Error deleting exercise:",te)}finally{C(null)}},300))},Oe=q=>{re({open:!0,type:"exercise",id:q.id,name:q.name})},Be=()=>{Y.type==="routine"?wl(Y.id):ne(Y.id)},Dt=async q=>{if(e)try{const te=await fetch("/api/routines",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:q}),credentials:"include"});if(!te.ok)throw new Error("Failed to add routine");const Q=await te.json();u([...l,Q]),d(Q)}catch(te){console.error("Error adding routine:",te)}},$t=async(q,te)=>{if(e)try{const Q=await fetch(`/api/routines/${q}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:te}),credentials:"include"});if(!Q.ok)throw new Error("Failed to edit routine");const xe=await Q.json();u(ge=>ge.map(ve=>ve.id===q?xe:ve)),d(xe)}catch(Q){console.error("Error editing routine:",Q)}},Hr=async q=>{if(!q.exercises||q.exercises.length===0)return q;try{const te=await Promise.all(q.exercises.map(async Q=>{var xe,ge;try{const ve=await fetch(`/api/v2/exercises/${Q.id}/variations`,{credentials:"include",headers:{"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(ve.ok){const me=await ve.json();if(me&&me.length>0){const ce=me.find(Ve=>Ve.isCurrent)||me[0],we=((xe=ce==null?void 0:ce.completions)==null?void 0:xe.map(Ve=>({completed:Ve.success,timestamp:Ve.completedAt||new Date().toISOString(),completionId:Ve.id,metrics:{weight:ce.targetWeight,reps:ce.targetReps,sets:ce.targetSets}})))||[];return{...Q,weight:(ce==null?void 0:ce.targetWeight)||Q.weight,reps:(ce==null?void 0:ce.targetReps)||Q.reps,sets:(ce==null?void 0:ce.targetSets)||Q.sets,completedSets:we,success:we.length>0?(ge=we[we.length-1])==null?void 0:ge.completed:!1}}}}catch(ve){console.error(`Error fetching variations for exercise ${Q.id}:`,ve)}return Q}));return{...q,exercises:te}}catch(te){return console.error("Error loading complete routine data:",te),q}},wl=async q=>{if(e)try{const te=`/api/routines/${q}`,Q=await fetch(te,{method:"DELETE",credentials:"include"});if(!Q.ok)throw new Error("Failed to delete routine");const xe=await Q.json();if(u(xe),xe.length>0){const ge=xe[0],ve=await Hr(ge),me=xe.map(ce=>ce.id===ge.id?ve:ce);u(me),d(ve)}else d(null)}catch(te){console.error("Error deleting routine:",te)}},na=q=>{re({open:!0,type:"routine",id:q.id,name:q.name})},lo=(q,te)=>{const Q=(q==null?void 0:q.filter(me=>me.metrics.weight===te.weight&&me.metrics.reps===te.reps&&me.metrics.sets===te.sets))||[];if(Q.length===0)return null;const xe=Q.length-1,ge=Q[xe],ve=(k==null?void 0:k.exerciseId)===te.id;return h.jsx("div",{className:"mt-3 cursor-pointer hover:opacity-70 transition-opacity",onClick:()=>v({exerciseId:te.id,setIndex:xe,isSuccess:ge.completed}),title:"Click to delete most recent completion",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"flex gap-[3px] items-center h-4",children:Q.map((me,ce)=>{const we=ce===xe,Ve=ve&&(k==null?void 0:k.pillIndex)===ce;return h.jsx("div",{className:`w-2 h-full rounded-full ${me.completed?"bg-green-400":"bg-red-400"} ${A.has(`${te.id}-${xe}`)&&we?"log-fade-out":""} ${Ve?"animate-pill-bounce":""}`},ce)})}),h.jsx("div",{className:`flex items-center gap-1 ${s.date} text-muted-foreground transition-opacity duration-300 ${ve?"opacity-0":"opacity-100"}`,children:mR(te)&&h.jsxs(h.Fragment,{children:[h.jsx(gv,{className:"h-3 w-3"}),h.jsx("span",{children:mR(te).split(" @ ")[0]})]})})]})})},Xc=async q=>{if(!q.destination||!(c!=null&&c.exercises))return;const te=q.source.index,Q=q.destination.index,xe=[...l],ge=c;try{const ve=Array.from(c.exercises),[me]=ve.splice(te,1);ve.splice(Q,0,me);const ce=ve.map((Pt,bt)=>({...Pt,order:bt})),we={...c,exercises:ce,updatedAt:new Date().toISOString()};u(Pt=>Pt.map(bt=>bt.id===we.id?we:bt)),d(we);const Ve=`/api/routines/${c.id}/exercises/reorder`,mt=await fetch(Ve,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({exercises:ce}),credentials:"include"});if(!mt.ok)throw new Error("Failed to save exercise order");const dt=await mt.json();u(Pt=>Pt.map(bt=>bt.id===dt.id?dt:bt)),d(dt)}catch(ve){console.error("Error saving exercise order:",ve),u(xe),d(ge)}};return h.jsx(mJ,{onDragEnd:Xc,children:h.jsx(w.Suspense,{fallback:h.jsx(vR,{}),children:h.jsx("div",{className:"w-full pb-24 px-4",children:i?h.jsx(vR,{}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"py-4 space-y-4",children:c&&h.jsxs(h.Fragment,{children:[h.jsx(eIe,{routines:l}),((ds=c.exercises)==null?void 0:ds.length)>0&&h.jsxs("div",{className:"border border-b-0 rounded-t-xl bg-[#fbfbfe] shadow-sm p-4",children:[h.jsx("div",{className:"flex items-center gap-2 mb-1",children:h.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full uppercase tracking-wide",style:{background:"#f3f4f6",border:"1px solid #e5e7eb",color:"#6b7280"},children:"Routine"})}),h.jsxs(L4,{children:[h.jsx(F4,{asChild:!0,children:h.jsxs("button",{className:"flex items-center gap-1 text-3xl font-bold text-gray-900 hover:text-gray-700 transition-colors cursor-pointer",children:[c.name,h.jsx(jy,{className:"h-5 w-5 text-gray-400"})]})}),h.jsxs(kA,{className:"w-56",children:[l.map(q=>h.jsxs(_s,{className:"flex items-center justify-between pr-2 py-2.5",onClick:()=>d(q),children:[h.jsx("span",{className:"font-medium",children:q.name}),h.jsx(Ne,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 ml-2",onClick:te=>{te.stopPropagation(),b({open:!0,mode:"edit"}),d(q)},children:h.jsx(NS,{className:"h-3 w-3"})})]},q.id)),h.jsx("div",{className:"border-t border-gray-100 my-1"}),h.jsxs(_s,{className:"flex items-center gap-2 py-2.5 text-muted-foreground",onClick:()=>b({open:!0,mode:"create"}),children:[h.jsx(cu,{className:"h-4 w-4"}),h.jsx("span",{children:"New routine"})]})]})]}),h.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Last activity: ",(()=>{var ge;let q=0;if((ge=c.exercises)==null||ge.forEach(ve=>{var me;(me=ve.completedSets)==null||me.forEach(ce=>{if(ce.timestamp){const we=new Date(ce.timestamp).getTime();we>q&&(q=we)}})}),q===0)return"No activity yet";const Q=Math.abs(new Date().getTime()-q),xe=Math.floor(Q/(1e3*60*60*24));return xe===0?"Today":xe===1?"1 day ago":`${xe} days ago`})()]})]}),h.jsx(kB,{droppableId:`exercises-${c.id}`,children:q=>{var te;return h.jsxs("div",{...q.droppableProps,ref:q.innerRef,className:"!mt-0",children:[((te=c.exercises)==null?void 0:te.length)>0?c.exercises.map((Q,xe)=>h.jsx(QJ,{draggableId:Q.id.toString(),index:xe,children:(ge,ve)=>{var me,ce,we;return h.jsx(Iv.div,{ref:ge.innerRef,...ge.draggableProps,className:`transition-all duration-300 ${E===Q.id?"exercise-fade-out":""}`,children:h.jsx("div",{className:`border-x border-b bg-white shadow-sm ${xe===0?"border-t":""} ${xe===(((me=c.exercises)==null?void 0:me.length)||0)-1?"rounded-b-xl":""} ${ve.isDragging?"shadow-lg rounded-xl":""}`,children:h.jsxs("div",{className:"flex",children:[h.jsx("div",{className:"py-3 pl-3",children:(()=>{var xt;const Ve=new Date().toISOString().split("T")[0],mt=((xt=Q.completedSets)==null?void 0:xt.filter(fs=>fs.timestamp&&fs.timestamp.split("T")[0]===Ve))||[],dt=mt.length>0?mt[mt.length-1]:null,Pt=(k==null?void 0:k.exerciseId)===Q.id;let bt="bg-gray-200";return dt&&!Pt&&(bt=dt.completed?"bg-green-400":"bg-red-400"),h.jsx("div",{className:`w-1.5 h-full rounded-full transition-colors duration-500 ${bt}`})})()}),h.jsxs("div",{className:"flex-1 p-4 pl-3 space-y-2",children:[h.jsx("h3",{className:`${s.exerciseName} font-bold truncate cursor-pointer hover:text-primary transition-colors`,onClick:()=>oe({open:!0,exerciseId:Q.id,currentName:Q.name}),children:Q.name}),h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[h.jsxs("p",{className:`${s.exerciseMetrics} text-gray-600 cursor-pointer hover:text-primary transition-colors`,onClick:()=>J({open:!0,exerciseId:Q.id,currentMetrics:{weight:Q.weight,reps:Q.reps,sets:Q.sets}}),children:[Q.weight%1===0?Math.floor(Q.weight):Q.weight,"kg | ",Q.reps," reps | ",Q.sets," sets"]}),h.jsx(NS,{className:"h-3.5 w-3.5 text-gray-400 cursor-pointer hover:text-primary transition-colors",onClick:()=>J({open:!0,exerciseId:Q.id,currentMetrics:{weight:Q.weight,reps:Q.reps,sets:Q.sets}})})]}),h.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[Array.from({length:Q.sets},(Ve,mt)=>{var Ri;const dt=mt+1,Pt=((Ri=ee[Q.id])==null?void 0:Ri.has(dt))||!1,bt=ee[Q.id]||new Set;let xt=null;for(let li=1;li<=Q.sets;li++)if(!bt.has(li)){xt=li;break}const fs=!Pt&&dt===xt&&bt.size>0;return h.jsx(Ne,{variant:"outline",size:"sm",className:`${s.setButton} ${s.buttonSize} transition-colors relative overflow-hidden rounded-full p-0 flex items-center justify-center border-2 font-semibold outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-0 active:outline-none touch-none select-none ${Pt?"set-button-tapped shadow-md":"set-button-untapped"} ${fs?"animate-pulse-green":""} ${(Pe==null?void 0:Pe.exerciseId)===Q.id&&(Pe==null?void 0:Pe.setNumber)===dt?"animate-explode-shake":""}`,style:{WebkitTapHighlightColor:"transparent"},onClick:li=>{li.preventDefault(),W(Q.id,dt,Q.sets),li.currentTarget.blur()},children:Pt?h.jsx(_i,{className:"h-4 w-4 stroke-[3] text-white"}):dt},dt)}),(((ce=ee[Q.id])==null?void 0:ce.size)||0)>0&&h.jsx(Ne,{variant:"outline",size:"sm",className:`${s.setButton} ${s.buttonHeight} bg-white text-green-600 rounded-full px-6 border-2 border-gray-300 font-semibold transition-colors outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-0 active:outline-none touch-none select-none ${(((we=ee[Q.id])==null?void 0:we.size)||0)===Q.sets?"animate-pulse-finished":""}`,style:{WebkitTapHighlightColor:"transparent"},onClick:Ve=>{Ve.preventDefault(),G(Q.id),Ve.currentTarget.blur()},children:"End"})]}),h.jsx("div",{className:"mt-3 cursor-pointer hover:bg-gray-50 rounded px-2 py-2 transition-colors",onClick:()=>de({open:!0,exerciseId:Q.id,currentNote:Q.notes||""}),children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(JL,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),Q.notes&&typeof Q.notes=="string"&&Q.notes.trim()?h.jsx("p",{className:`${s.noteText} text-gray-400 line-clamp-2 break-words`,children:Q.notes}):h.jsx("p",{className:`${s.noteText} text-gray-400 italic`,children:"Note to self"})]})}),lo(Q.completedSets,Q)]}),h.jsx("div",{...ge.dragHandleProps,className:"flex items-center px-3",children:h.jsx(_q,{className:"h-6 w-6 text-gray-300"})})]})})})}},Q.id.toString())):h.jsxs("div",{className:"border-2 border-dashed border-gray-200 rounded-lg p-8 text-center",children:[h.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-1",children:"No exercises yet"}),h.jsx("p",{className:"text-gray-500 mb-4",children:"Add your first exercise to get started with your routine"}),h.jsxs(Ne,{onClick:()=>$(!0),className:"inline-flex items-center gap-2",children:[h.jsx(cu,{className:"h-4 w-4"}),"Add First Exercise"]})]}),q.placeholder]})}}),((Sh=c.exercises)==null?void 0:Sh.length)>0&&h.jsxs(Ne,{className:"w-full mb-8",onClick:()=>$(!0),children:[h.jsx(cu,{className:"h-4 w-4 mr-2"}),"Add Exercise"]})]})}),h.jsx(iue,{open:I,onOpenChange:$,onSubmit:R}),f.exercise&&h.jsx(yue,{open:f.index!==-1,onOpenChange:async q=>{if(!q){if(console.log("🔄 Edit dialog closing - refreshing data..."),e&&c){const te=await Hr(c);d(te),u(Q=>Q.map(xe=>xe.id===c.id?te:xe)),console.log("✅ Refreshed routine data after edit dialog close")}p({index:-1,exercise:null})}},exercise:f.exercise,onDelete:()=>Oe(f.exercise),onRefresh:async()=>{if(console.log("🔄 Refreshing after variant change..."),e&&c){const q=await Hr(c);d(q),u(te=>te.map(Q=>Q.id===c.id?q:Q)),console.log("✅ Refreshed routine data after variant change")}}}),h.jsx(wue,{open:g.open,onOpenChange:q=>b({...g,open:q}),onSubmit:g.mode==="create"?Dt:q=>$t(c.id,q),onDelete:g.mode==="edit"?()=>na(c):void 0,routine:g.mode==="edit"&&c||void 0,mode:g.mode,existingRoutines:l}),m&&h.jsx(bue,{open:!!m,onOpenChange:()=>v(null),onConfirm:ue,isSuccess:m.isSuccess}),B&&h.jsx(nce,{open:B.open,onOpenChange:q=>U(q?B:null),type:B.type,onEditExercise:()=>{const q=c==null?void 0:c.exercises.find(te=>te.completedSets.length>=4&&(B.type==="increase"&&te.completedSets.slice(-4).every(Q=>Q.completed)||B.type==="decrease"&&te.completedSets.slice(-4).every(Q=>!Q.completed)));if(q){const te=c==null?void 0:c.exercises.indexOf(q);te!==void 0&&te!==-1&&p({index:te,exercise:q})}}}),h.jsx(V5,{ref:n}),se&&h.jsx(Sue,{open:se.open,onOpenChange:q=>de(q?se:null),initialNote:se.currentNote,onSave:q=>Le(se.exerciseId,q)}),X&&h.jsx(Pue,{open:X.open,onOpenChange:q=>oe(q?X:null),currentName:X.currentName,onSave:q=>Ue(X.exerciseId,q)}),K&&h.jsx(tce,{open:K.open,onOpenChange:q=>J(q?K:null),currentMetrics:K.currentMetrics,routines:l.map(q=>({id:q.id,name:q.name})),currentRoutineId:c==null?void 0:c.id,onSave:q=>Ye(K.exerciseId,q),onDelete:()=>{const q=c==null?void 0:c.exercises.find(te=>te.id===K.exerciseId);q&&Oe(q)}}),h.jsx(tIe,{open:Y.open,onOpenChange:q=>re(te=>({...te,open:q})),onConfirm:Be,title:Y.type==="routine"?"Drop this routine?":"Cut this exercise?",description:`This will delete "${Y.name}" ${Y.type==="routine"?"and all its exercises.":"and all its variations and workout logs."} This action can't be undone.`,confirmText:"Delete",cancelText:"Cancel"})]})})})})}const yr=w.forwardRef(({className:e,...t},r)=>h.jsx("div",{ref:r,className:Me("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));yr.displayName="Card";const On=w.forwardRef(({className:e,...t},r)=>h.jsx("div",{ref:r,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));On.displayName="CardHeader";const _n=w.forwardRef(({className:e,...t},r)=>h.jsx("h3",{ref:r,className:Me("text-2xl font-semibold leading-none tracking-tight",e),...t}));_n.displayName="CardTitle";const ro=w.forwardRef(({className:e,...t},r)=>h.jsx("p",{ref:r,className:Me("text-sm text-muted-foreground",e),...t}));ro.displayName="CardDescription";const Fr=w.forwardRef(({className:e,...t},r)=>h.jsx("div",{ref:r,className:Me("p-6 pt-0",e),...t}));Fr.displayName="CardContent";const Za=w.forwardRef(({className:e,...t},r)=>h.jsx("div",{ref:r,className:Me("flex items-center p-6 pt-0",e),...t}));Za.displayName="CardFooter";const rIe=_y("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function YP({className:e,variant:t,...r}){return h.jsx("div",{className:Me(rIe({variant:t}),e),...r})}function nIe(){const e={"@context":"https://schema.org","@type":"FAQPage",mainEntity:[{"@type":"Question",name:"What is LiftEasy?",acceptedAnswer:{"@type":"Answer",text:"LiftEasy is a simple workout tracking app that helps you log exercises, track progress, and achieve your fitness goals. It's designed to be intuitive and focused on what matters - your fitness journey."}},{"@type":"Question",name:"How do I track my workouts with LiftEasy?",acceptedAnswer:{"@type":"Answer",text:"Simply select your exercises from our database, log your sets, reps, and weights. LiftEasy automatically tracks your progress over time and provides insights into your fitness journey."}},{"@type":"Question",name:"Is LiftEasy free to use?",acceptedAnswer:{"@type":"Answer",text:"Yes, LiftEasy offers free workout tracking with core features. You can log workouts, track progress, and access our exercise database at no cost."}},{"@type":"Question",name:"Can I use LiftEasy on my mobile device?",acceptedAnswer:{"@type":"Answer",text:"Absolutely! LiftEasy is a Progressive Web App (PWA) that works seamlessly on mobile devices. You can install it on your phone for a native app-like experience."}},{"@type":"Question",name:"Does LiftEasy work offline?",acceptedAnswer:{"@type":"Answer",text:"Yes, LiftEasy has offline capabilities. You can track your workouts even without an internet connection, and your data will sync when you're back online."}},{"@type":"Question",name:"What types of exercises can I track?",acceptedAnswer:{"@type":"Answer",text:"LiftEasy includes a comprehensive exercise database covering strength training, bodybuilding, powerlifting, and general fitness exercises. You can track sets, reps, weights, and time for various exercise types."}}]};return h.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})}function hw(){const e=[{icon:h.jsx(ZL,{className:"h-6 w-6"}),title:"Simple Workout Logging",description:"Quick and intuitive workout tracking without the complexity"},{icon:h.jsx(eF,{className:"h-6 w-6"}),title:"Rest Timer",description:"Built-in timer to track breaks between sets"},{icon:h.jsx(tC,{className:"h-6 w-6"}),title:"Progress Tracking",description:"Monitor your improvement over time with clear workout history"},{icon:h.jsx(Mq,{className:"h-6 w-6"}),title:"Cross-Device Sync",description:"Access your workouts anywhere with seamless device synchronization"}],t=["No cluttered interface or overwhelming features","Start tracking immediately with no setup required","Works seamlessly across all your devices","Focus on your workout, not the app","Reliable data storage and sync"];return h.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-100/45 via-purple-100/45 to-pink-100/45",children:[h.jsx("div",{className:"container mx-auto px-4 pt-8 pb-8",children:h.jsxs("div",{className:"text-center max-w-4xl mx-auto",children:[h.jsx("div",{className:"flex justify-center mb-6",children:h.jsx("img",{src:"/128.png",alt:"LiftEasy app icon",className:"w-20 h-20 rounded-2xl shadow-lg"})}),h.jsx(YP,{variant:"secondary",className:"mb-4 bg-gray-900 text-white hover:bg-gray-800",children:"Simple. Powerful. Effective."}),h.jsxs("h1",{className:"text-4xl md:text-6xl font-bold tracking-tight mb-6",children:["Track Workouts",h.jsx("span",{className:"block text-primary",children:"The Simple Way"})]}),h.jsx("p",{className:"text-xl text-muted-foreground mb-8 max-w-2xl mx-auto leading-relaxed",children:"LiftEasy cuts through the noise. No complicated features, no overwhelming dashboards. Just clean, focused workout tracking that helps you stay consistent and see real progress."}),h.jsx("div",{className:"flex justify-center items-center mb-6",children:h.jsx(ln,{href:"/login",children:h.jsxs(Ne,{size:"lg",className:"px-8 py-6 text-lg",children:["Get Started",h.jsx(Qx,{className:"ml-2 h-5 w-5"})]})})}),h.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Free to use â€ĸ No credit card required"}),h.jsxs("div",{className:"flex justify-center items-center gap-4",children:[h.jsx("img",{src:"/ios-app-logo.png",alt:"Download on the App Store",className:"h-10 cursor-pointer hover:opacity-80 transition-opacity"}),h.jsx("img",{src:"/android-app-logo.png",alt:"Get it on Google Play",className:"h-10 cursor-pointer hover:opacity-80 transition-opacity"})]})]})}),h.jsx("div",{className:"bg-gradient-to-br from-purple-100/55 via-blue-100/55 to-pink-100/55 py-16",children:h.jsx("div",{className:"container mx-auto px-4",children:h.jsxs("div",{className:"max-w-6xl mx-auto",children:[h.jsxs("div",{className:"text-center mb-12",children:[h.jsx("h2",{className:"text-3xl font-bold tracking-tight mb-4",children:"Clean, Focused Interface"}),h.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"A simple design that gets out of your way so you can focus on your workout."})]}),h.jsx("div",{className:"flex justify-center",children:h.jsx("div",{className:"bg-white rounded-3xl p-1 shadow-2xl border border-gray-200",children:h.jsx("img",{src:"/screenshot.PNG",alt:"LiftEasy mobile app interface showing workout tracking with exercises like bench press, row, and inclined press",className:"rounded-3xl max-w-xs w-full"})})})]})})}),h.jsx("div",{className:"container mx-auto px-4 py-16",children:h.jsx("div",{className:"max-w-6xl mx-auto",children:h.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[h.jsxs("div",{children:[h.jsx(YP,{variant:"secondary",className:"mb-4 bg-gradient-to-r from-purple-600 to-blue-600 text-white",children:"Advanced Analytics"}),h.jsxs("h2",{className:"text-3xl font-bold tracking-tight mb-6",children:["Track Your Progress with",h.jsx("span",{className:"block text-primary",children:"Smart Analytics"})]}),h.jsx("p",{className:"text-lg text-muted-foreground mb-8 leading-relaxed",children:"Get powerful insights into your fitness journey with our comprehensive activity tracking. Monitor your consistency, track your improvement, and build lasting workout streaks."}),h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsx("div",{className:"p-2 bg-purple-100 rounded-lg",children:h.jsx(xq,{className:"h-6 w-6 text-purple-600"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Daily Activity Visualization"}),h.jsx("p",{className:"text-muted-foreground",children:"See your workout patterns at a glance with intuitive activity bars and completion rates."})]})]}),h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:h.jsx(YL,{className:"h-6 w-6 text-blue-600"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Progress Comparison"}),h.jsx("p",{className:"text-muted-foreground",children:"Compare your current performance against previous periods to track real improvement."})]})]}),h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsx("div",{className:"p-2 bg-orange-100 rounded-lg",children:h.jsx(QL,{className:"h-6 w-6 text-orange-600"})}),h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Workout Streaks"}),h.jsx("p",{className:"text-muted-foreground",children:"Build consistency with streak tracking that motivates you to keep going week after week."})]})]})]})]}),h.jsx("div",{className:"flex justify-center lg:justify-end",children:h.jsxs("div",{className:"relative",children:[h.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-400/20 via-blue-400/20 to-pink-400/20 rounded-2xl blur-xl transform rotate-1"}),h.jsx("div",{className:"relative bg-white rounded-2xl p-4 shadow-2xl border border-gray-200 max-w-sm",children:h.jsx("img",{src:"/stats lift easy.PNG",alt:"LiftEasy analytics dashboard showing activity tracking with 8 active days, 44,160 kg lifted in 30 days, 27.3% improvement vs previous period, and 9-week workout streak",className:"rounded-xl w-full"})})]})})]})})}),h.jsxs("div",{className:"container mx-auto px-4 py-16",children:[h.jsxs("div",{className:"text-center mb-12",children:[h.jsx("h2",{className:"text-3xl font-bold tracking-tight mb-4",children:"Everything You Need, Nothing You Don't"}),h.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Built for people who want to focus on their fitness, not learn complicated software."})]}),h.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto",children:e.map((r,n)=>h.jsxs(yr,{className:"border-muted hover:border-primary/20 transition-colors bg-white",children:[h.jsx(On,{className:"pb-3",children:h.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[h.jsx("div",{className:"p-2 bg-primary/10 rounded-lg text-primary",children:r.icon}),h.jsx(_n,{className:"text-lg",children:r.title})]})}),h.jsx(Fr,{children:h.jsx("p",{className:"text-muted-foreground leading-relaxed",children:r.description})})]},n))})]}),h.jsx("div",{className:"bg-gradient-to-br from-pink-100/55 via-purple-100/55 to-blue-100/55 py-16",children:h.jsx("div",{className:"container mx-auto px-4",children:h.jsxs("div",{className:"max-w-4xl mx-auto",children:[h.jsxs("div",{className:"text-center mb-12",children:[h.jsx(yv,{className:"h-12 w-12 text-primary mx-auto mb-4"}),h.jsx("h2",{className:"text-3xl font-bold tracking-tight mb-4",children:"Why Choose LiftEasy?"}),h.jsx("p",{className:"text-lg text-muted-foreground",children:"We believe fitness tracking should enhance your workout, not complicate it."})]}),h.jsxs("div",{className:"grid md:grid-cols-2 gap-8 items-center",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"text-2xl font-semibold mb-6",children:"Built for Real Workouts"}),h.jsx("div",{className:"space-y-4",children:t.map((r,n)=>h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx(_i,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),h.jsx("p",{className:"text-muted-foreground",children:r})]},n))})]}),h.jsx(yr,{className:"p-8 bg-white border rounded-lg",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"text-3xl font-bold text-primary mb-2",children:"No Setup Required"}),h.jsx("p",{className:"text-muted-foreground mb-6",children:"Start tracking your first workout in under 30 seconds. No tutorials, no configuration, no complexity."}),h.jsx(ln,{href:"/login",children:h.jsxs(Ne,{className:"w-full",children:["Start Your First Workout",h.jsx(Qx,{className:"ml-2 h-4 w-4"})]})})]})})]})]})})}),h.jsx("div",{className:"container mx-auto px-4 py-16",children:h.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[h.jsx("h2",{className:"text-3xl font-bold tracking-tight mb-4",children:"Ready to Simplify Your Fitness Journey?"}),h.jsx("p",{className:"text-lg text-muted-foreground mb-8",children:"Join others who've discovered that the best workout tracker is the one you actually use."}),h.jsx("div",{className:"flex justify-center items-center mb-6",children:h.jsx(ln,{href:"/login",children:h.jsxs(Ne,{size:"lg",className:"px-8 py-6 text-lg",children:["Get Started",h.jsx(Qx,{className:"ml-2 h-5 w-5"})]})})}),h.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"Free to use â€ĸ No credit card required"}),h.jsxs("div",{className:"flex justify-center items-center gap-4",children:[h.jsx("img",{src:"/ios-app-logo.png",alt:"Download on the App Store",className:"h-10 cursor-pointer hover:opacity-80 transition-opacity"}),h.jsx("img",{src:"/android-app-logo.png",alt:"Get it on Google Play",className:"h-10 cursor-pointer hover:opacity-80 transition-opacity"})]})]})}),h.jsx("footer",{className:"border-t bg-white py-8",children:h.jsx("div",{className:"container mx-auto px-4",children:h.jsxs("div",{className:"text-center",children:[h.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[h.jsx("img",{src:"/64.png",alt:"LiftEasy app icon",className:"w-8 h-8 rounded-lg"}),h.jsx("span",{className:"text-xl font-bold",children:"LiftEasy"})]}),h.jsx("p",{className:"text-muted-foreground",children:"Simple workout tracking for focused fitness"})]})})}),h.jsx(nIe,{})]})}const iIe=Mc({email:wn().email("Please enter a valid email address"),password:wn().min(6,"Password must be at least 6 characters")});function gR({mode:e}){const{login:t,register:r}=Ab(),{toast:n}=pl(),[i,o]=w.useState(!1),a=Dc({resolver:kc(iIe),defaultValues:{email:"",password:""}}),s=async u=>{try{const f=await(e==="login"?t:r)(u);if(!f.ok)throw new Error(f.message);n({title:`${e==="login"?"Welcome back, champion! đŸ’Ē":"You're in! Let's get swole! 🎉"}`,description:`Successfully ${e==="login"?"logged in":"registered"}!`}),window.location.href="/workout"}catch(c){n({variant:"destructive",title:"Oops! That didn't go as planned! 😅",description:c.message})}},l=async()=>{const u=a.getValues("email");if(!u||!u.includes("@")){n({variant:"destructive",title:"Email required",description:"Please enter your email address"});return}o(!0);try{const c=await fetch("/api/magic-link/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:u})}),d=await c.json();if(!c.ok)throw new Error(d.message||"Failed to send magic link");n({title:"Magic link sent! ✨",description:"Check your email for the login link"})}catch(c){n({variant:"destructive",title:"Failed to send link",description:c.message})}finally{o(!1)}};return h.jsx("div",{className:"flex items-center justify-center px-4 pt-8",children:h.jsxs(yr,{className:"w-full max-w-md",children:[h.jsxs(On,{children:[h.jsx(_n,{children:e==="login"?"Welcome Back! đŸ’Ē":"Let's go! 🚀"}),h.jsx(ro,{children:e==="login"?"Track your workouts and see your progress":"Create an account to start tracking your fitness journey"})]}),h.jsxs(Fr,{children:[h.jsx(Ic,{...a,children:h.jsxs("form",{onSubmit:a.handleSubmit(s),className:"space-y-4",children:[h.jsx(Sn,{control:a.control,name:"email",render:({field:u})=>h.jsxs(Jr,{children:[h.jsx(en,{children:"Email"}),h.jsx(tn,{children:h.jsx(rr,{placeholder:"john@example.com",type:"email",autoComplete:"email",autoFocus:!0,...u})}),h.jsx(rn,{})]})}),h.jsx(Sn,{control:a.control,name:"password",render:({field:u})=>h.jsxs(Jr,{children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx(en,{children:"Password"}),e==="login"&&h.jsx(ln,{href:"/forgot-password",children:h.jsx(Ne,{variant:"link",className:"px-0 h-auto font-normal text-xs",type:"button",children:"Forgot password?"})})]}),h.jsx(tn,{children:h.jsx(rr,{type:"password",placeholder:"â€ĸâ€ĸâ€ĸâ€ĸâ€ĸâ€ĸ",autoComplete:"current-password",...u})}),h.jsx(rn,{})]})}),h.jsxs(Ne,{type:"submit",className:"w-full",disabled:a.formState.isSubmitting,children:[a.formState.isSubmitting&&h.jsx(Ei,{className:"mr-2 h-4 w-4 animate-spin"}),e==="login"?"Login":"Sign Up"]})]})}),e==="login"&&h.jsxs("div",{className:"mt-4 relative",children:[h.jsx("div",{className:"absolute inset-0 flex items-center",children:h.jsx("span",{className:"w-full border-t"})}),h.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:h.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or"})})]}),e==="login"&&h.jsxs(Ne,{type:"button",variant:"outline",className:"w-full mt-4",disabled:i,onClick:l,children:[i?h.jsx(Ei,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(Lq,{className:"mr-2 h-4 w-4"}),"Email me a login link"]})]}),h.jsxs(Za,{className:"flex flex-col items-center",children:[h.jsx("p",{className:"text-sm text-muted-foreground",children:e==="login"?"Don't have an account?":"Already have an account?"}),h.jsx(ln,{href:e==="login"?"/register":"/login",children:h.jsx(Ne,{variant:"link",className:"mt-1",type:"button",children:e==="login"?"Sign up now":"Login instead"})})]})]})})}function oIe(){const{user:e,logout:t}=Ab(),[,r]=Fp(),{toast:n}=pl(),i=$p(),[o,a]=M.useState(null);M.useEffect(()=>{e!=null&&e.isAdmin||r("/")},[e,r]);const{data:s,isLoading:l,error:u}=nL({queryKey:["/api/admin/users"],enabled:!!(e!=null&&e.isAdmin)}),c=su({mutationFn:async p=>{const m=await fetch(`/api/admin/users/${p}`,{method:"DELETE",credentials:"include"});if(!m.ok)throw new Error(await m.text());return m.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["/api/admin/users"]}),n({title:"User successfully yeeted! ✨",description:"User and all associated data have been removed."}),a(null)},onError:p=>{n({variant:"destructive",title:"Couldn't complete the deletion mission!",description:p.message})}}),d=su({mutationFn:async()=>{const p=await fetch("/api/admin/generate-demo-data",{method:"POST",credentials:"include"});if(!p.ok)throw new Error(await p.text());return p.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["/api/admin/users"]}),n({title:"Demo gains unlocked! đŸ”Ĩ",description:"Successfully generated 2 months of workout completion data for demo account."})},onError:p=>{n({variant:"destructive",title:"Demo gains are being stubborn!",description:p.message})}}),f=su({mutationFn:async()=>{const p=await fetch("/api/admin/demo-completions",{method:"DELETE",credentials:"include"});if(!p.ok)throw new Error(await p.text());return p.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["/api/admin/users"]}),n({title:"Demo slate wiped clean! ✨",description:"Successfully deleted all workout completions for demo account."})},onError:p=>{n({variant:"destructive",title:"Demo data is being stubborn!",description:p.message})}});return e!=null&&e.isAdmin?l?h.jsx("div",{className:"flex items-center justify-center min-h-screen",children:h.jsx(Ei,{className:"h-8 w-8 animate-spin text-border"})}):u?h.jsx("div",{className:"flex items-center justify-center min-h-screen",children:h.jsx(yr,{className:"w-full max-w-md mx-4",children:h.jsxs(Fr,{className:"pt-6",children:[h.jsxs("div",{className:"flex mb-4 gap-2",children:[h.jsx(Rq,{className:"h-8 w-8 text-red-500"}),h.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Error Loading Users"})]}),h.jsx("p",{className:"mt-4 text-sm text-gray-600",children:u instanceof Error?u.message:"Failed to load users"})]})})}):h.jsxs("div",{className:"container mx-auto p-4 max-w-4xl",children:[h.jsxs("div",{className:"flex items-center justify-between mb-6",children:[h.jsx("h1",{className:"text-xl font-bold tracking-tight font-display",children:"đŸ’Ē Lifteasy Admin"}),h.jsxs(Ne,{variant:"outline",onClick:()=>t(),className:"flex items-center gap-2",children:[h.jsx(jq,{className:"h-4 w-4"}),"Logout"]})]}),h.jsxs(yr,{className:"mb-6",children:[h.jsx(On,{children:h.jsxs(_n,{className:"flex items-center gap-2",children:[h.jsx(Oq,{className:"h-5 w-5"}),"Demo Account Management"]})}),h.jsx(Fr,{children:h.jsxs("div",{className:"bg-blue-50 p-4 rounded-lg border border-blue-200",children:[h.jsx("h3",{className:"font-semibold text-blue-800 mb-2",children:"Demo Workout Data Management"}),h.jsx("p",{className:"text-sm text-blue-700 mb-4",children:"Manage workout completion data for the demo account (emailrobaherne+demo@gmail.com). Generate creates 2 months of realistic success/fail logs with 70% success rate, spaced every 3-4 days."}),h.jsxs("div",{className:"flex gap-3",children:[h.jsx(Ne,{onClick:()=>d.mutate(),disabled:d.isPending||f.isPending,className:"flex items-center gap-2",variant:"outline",children:d.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Ei,{className:"h-4 w-4 animate-spin"}),"Generating..."]}):h.jsxs(h.Fragment,{children:[h.jsx(Dq,{className:"h-4 w-4"}),"Generate Demo Data"]})}),h.jsx(Ne,{onClick:()=>f.mutate(),disabled:f.isPending||d.isPending,className:"flex items-center gap-2",variant:"destructive",children:f.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Ei,{className:"h-4 w-4 animate-spin"}),"Deleting..."]}):h.jsxs(h.Fragment,{children:[h.jsx(Of,{className:"h-4 w-4"}),"Clear All Completions"]})})]})]})})]}),h.jsxs(yr,{children:[h.jsx(On,{children:h.jsx(_n,{children:"User Management"})}),h.jsx(Fr,{children:h.jsx("div",{className:"space-y-6",children:s==null?void 0:s.map(p=>h.jsx(yr,{className:"border-l-4 border-l-blue-500",children:h.jsxs(Fr,{className:"pt-4",children:[h.jsxs("div",{className:"flex items-start justify-between mb-4",children:[h.jsxs("div",{children:[h.jsx("h3",{className:"font-semibold text-lg",children:p.email}),h.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[h.jsx(YL,{className:"h-4 w-4 text-gray-500"}),h.jsxs("span",{className:"text-sm text-gray-600",children:["Joined ",new Date(p.createdAt).toLocaleDateString()," (",p.daysSinceJoined," days ago)"]})]})]}),h.jsx("div",{className:"flex items-center gap-2",children:p.isAdmin?h.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-3 py-1 rounded-full font-medium",children:"Admin"}):h.jsxs(Ne,{variant:"destructive",size:"sm",onClick:()=>a(p),children:[h.jsx($q,{className:"h-4 w-4 mr-2"}),"Delete"]})})]}),h.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[h.jsxs("div",{className:"bg-blue-50 p-3 rounded-lg",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[h.jsx(bq,{className:"h-4 w-4 text-blue-600"}),h.jsx("span",{className:"text-sm font-medium text-blue-800",children:"Routines"})]}),h.jsx("div",{className:"text-xl font-bold text-blue-700",children:p.routinesCount})]}),h.jsxs("div",{className:"bg-green-50 p-3 rounded-lg",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[h.jsx(yv,{className:"h-4 w-4 text-green-600"}),h.jsx("span",{className:"text-sm font-medium text-green-800",children:"Exercises"})]}),h.jsx("div",{className:"text-xl font-bold text-green-700",children:p.exercisesCount})]}),h.jsxs("div",{className:"bg-purple-50 p-3 rounded-lg",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[h.jsx(tC,{className:"h-4 w-4 text-purple-600"}),h.jsx("span",{className:"text-sm font-medium text-purple-800",children:"Total Logs"})]}),h.jsx("div",{className:"text-xl font-bold text-purple-700",children:p.totalLogs}),h.jsxs("div",{className:"text-xs text-purple-600 mt-1",children:[p.completedLogs," completed, ",p.failedLogs," failed"]})]}),h.jsxs("div",{className:"bg-orange-50 p-3 rounded-lg",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[h.jsx(QL,{className:"h-4 w-4 text-orange-600"}),h.jsx("span",{className:"text-sm font-medium text-orange-800",children:"Streak"})]}),h.jsx("div",{className:"text-xl font-bold text-orange-700",children:p.weekStreak}),h.jsx("div",{className:"text-xs text-orange-600 mt-1",children:p.weekStreak===1?"week":"weeks"})]})]}),p.lastLogDate&&h.jsx("div",{className:"mt-4 pt-3 border-t border-gray-200",children:h.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[h.jsx(gv,{className:"h-4 w-4"}),h.jsxs("span",{children:["Last activity: ",new Date(p.lastLogDate).toLocaleString()]}),h.jsxs("span",{className:"text-gray-400",children:["(",Math.floor((Date.now()-new Date(p.lastLogDate).getTime())/(1e3*60*60*24))," days ago)"]})]})}),!p.lastLogDate&&p.totalLogs===0&&h.jsx("div",{className:"mt-4 pt-3 border-t border-gray-200",children:h.jsx("div",{className:"text-sm text-gray-500 italic",children:"No routine activity yet"})})]})},p.id))})})]}),h.jsx(YA,{open:!!o,onOpenChange:()=>a(null),children:h.jsxs(vb,{children:[h.jsxs(gb,{children:[h.jsx(bb,{children:"Are you sure?"}),h.jsxs(xb,{children:["This will permanently delete the user account for ",o==null?void 0:o.email," and all associated routines and exercises. This action cannot be undone."]})]}),h.jsxs(yb,{children:[h.jsx(Sb,{children:"Cancel"}),h.jsx(wb,{onClick:()=>o&&c.mutate(o.id),className:"bg-red-600 hover:bg-red-700",children:c.isPending?h.jsx(Ei,{className:"h-4 w-4 animate-spin"}):"Delete"})]})]})})]}):null}function aIe(){const e=["Unlimited workouts","Exercise tracking","Progress tracking","Timer functionality","Cloud sync","Mobile friendly"],t=["Everything in Free, plus:","Advanced analytics","Progress insights","Performance metrics","Goal setting & tracking"];return h.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted flex flex-col items-center px-4 py-16",children:[h.jsxs("div",{className:"text-center mb-12 max-w-2xl",children:[h.jsx("h1",{className:"text-4xl font-bold tracking-tight mb-4",children:"Less Setup, More Gains"}),h.jsx("p",{className:"text-lg text-muted-foreground",children:"The simplest way to track your fitness progress"})]}),h.jsx("div",{className:"w-full max-w-5xl px-4 pt-4",children:h.jsxs("div",{className:"flex space-x-6 pb-4 overflow-x-auto snap-x snap-mandatory",children:[h.jsx(yr,{className:"w-[280px] flex-shrink-0 snap-center",children:h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsxs(On,{children:[h.jsxs("div",{className:"flex justify-between items-start",children:[h.jsxs("div",{children:[h.jsx(_n,{className:"text-2xl",children:"Free"}),h.jsx(ro,{children:"Perfect for getting started"})]}),h.jsx(ZL,{className:"h-6 w-6 text-primary"})]}),h.jsxs("div",{className:"mt-4",children:[h.jsx("span",{className:"text-3xl font-bold",children:"ÂŖ0"}),h.jsx("span",{className:"text-muted-foreground",children:"/month"})]})]}),h.jsx(Fr,{className:"flex-grow",children:h.jsx("ul",{className:"space-y-3",children:e.map((r,n)=>h.jsxs("li",{className:"flex items-center gap-2",children:[h.jsx(_i,{className:"h-4 w-4 text-primary"}),h.jsx("span",{children:r})]},n))})}),h.jsx(Za,{children:h.jsx(ln,{href:"/register",children:h.jsx(Ne,{className:"w-full",children:"Get Started"})})})]})}),h.jsxs(yr,{className:"w-[280px] flex-shrink-0 snap-center relative border-dashed",children:[h.jsx("div",{className:"absolute -top-1 -right-1",children:h.jsxs(YP,{variant:"secondary",className:"font-semibold",children:[h.jsx(Iq,{className:"h-3 w-3 mr-1"}),"Coming Soon"]})}),h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsxs(On,{children:[h.jsxs("div",{className:"flex justify-between items-start",children:[h.jsxs("div",{children:[h.jsx(_n,{className:"text-2xl",children:"Pro"}),h.jsx(ro,{children:"For the dedicated athlete"})]}),h.jsx(wq,{className:"h-6 w-6 text-primary"})]}),h.jsxs("div",{className:"mt-4",children:[h.jsx("span",{className:"text-3xl font-bold",children:"ÂŖ2"}),h.jsx("span",{className:"text-muted-foreground",children:"/month"})]})]}),h.jsx(Fr,{className:"flex-grow",children:h.jsx("ul",{className:"space-y-3",children:t.map((r,n)=>h.jsxs("li",{className:"flex items-center gap-2",children:[h.jsx(_i,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{className:"text-muted-foreground",children:r})]},n))})}),h.jsx(Za,{children:h.jsx(Ne,{className:"w-full",variant:"outline",disabled:!0,children:"Coming Soon"})})]})]})]})})]})}function sIe(){const[,e]=Fp(),t=$p(),[r,n]=w.useState("loading"),[i,o]=w.useState("");return w.useEffect(()=>{(async()=>{try{const l=new URLSearchParams(window.location.search).get("token");if(!l){n("error"),o("No verification token found");return}const u=await fetch("/api/magic-link/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:l})});let c;try{c=await u.json()}catch{throw new Error("Server error - invalid response")}if(!u.ok)throw new Error(c.message||"Verification failed");n("success"),o("Successfully logged in!"),await t.invalidateQueries({queryKey:["user"]}),setTimeout(()=>{window.location.href="/workout"},1500)}catch(s){n("error"),o(s.message||"Failed to verify magic link")}})()},[e,t]),h.jsx("div",{className:"flex items-center justify-center min-h-screen px-4",children:h.jsxs(yr,{className:"w-full max-w-md",children:[h.jsxs(On,{children:[h.jsxs(_n,{children:[r==="loading"&&"Verifying...",r==="success"&&"Welcome! 🎉",r==="error"&&"Verification Failed"]}),h.jsxs(ro,{children:[r==="loading"&&"Please wait while we log you in",r==="success"&&"Redirecting to your workouts...",r==="error"&&i]})]}),h.jsxs(Fr,{className:"flex justify-center py-8",children:[r==="loading"&&h.jsx(Ei,{className:"h-12 w-12 animate-spin text-primary"}),r==="success"&&h.jsx(Aq,{className:"h-12 w-12 text-green-500"}),r==="error"&&h.jsxs("div",{className:"flex flex-col items-center gap-4",children:[h.jsx(XL,{className:"h-12 w-12 text-destructive"}),h.jsx(Ne,{onClick:()=>e("/login"),children:"Go to Login"})]})]})]})})}const lIe=Mc({email:wn().email("Please enter a valid email address")});function uIe(){const{toast:e}=pl(),[t,r]=w.useState(!1),[n,i]=w.useState(!1),o=Dc({resolver:kc(lIe),defaultValues:{email:""}}),a=async s=>{r(!0);try{const l=await fetch("/api/password-reset/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s.email})}),u=await l.json();if(!l.ok)throw new Error(u.message||"Failed to send reset email");i(!0),e({title:"Check your email",description:"If an account exists, you'll receive a reset link."})}catch(l){e({variant:"destructive",title:"Something went wrong",description:l.message})}finally{r(!1)}};return n?h.jsx("div",{className:"flex items-center justify-center px-4 pt-8",children:h.jsxs(yr,{className:"w-full max-w-md",children:[h.jsxs(On,{className:"text-center",children:[h.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:h.jsx(Nq,{className:"h-6 w-6 text-primary"})}),h.jsx(_n,{children:"Check your email"}),h.jsx(ro,{children:"If an account exists with that email, we've sent a password reset link."})]}),h.jsxs(Fr,{className:"text-center text-sm text-muted-foreground",children:[h.jsx("p",{children:"The link will expire in 1 hour."}),h.jsx("p",{className:"mt-2",children:"Didn't receive the email? Check your spam folder or try again."})]}),h.jsxs(Za,{className:"flex flex-col gap-2",children:[h.jsx(Ne,{variant:"outline",className:"w-full",onClick:()=>i(!1),children:"Try a different email"}),h.jsx(ln,{href:"/login",className:"w-full",children:h.jsxs(Ne,{variant:"ghost",className:"w-full",children:[h.jsx(R_,{className:"mr-2 h-4 w-4"}),"Back to login"]})})]})]})}):h.jsx("div",{className:"flex items-center justify-center px-4 pt-8",children:h.jsxs(yr,{className:"w-full max-w-md",children:[h.jsxs(On,{children:[h.jsx(_n,{children:"Forgot your password?"}),h.jsx(ro,{children:"Enter your email and we'll send you a link to reset your password."})]}),h.jsx(Fr,{children:h.jsx(Ic,{...o,children:h.jsxs("form",{onSubmit:o.handleSubmit(a),className:"space-y-4",children:[h.jsx(Sn,{control:o.control,name:"email",render:({field:s})=>h.jsxs(Jr,{children:[h.jsx(en,{children:"Email"}),h.jsx(tn,{children:h.jsx(rr,{placeholder:"john@example.com",type:"email",autoComplete:"email",autoFocus:!0,...s})}),h.jsx(rn,{})]})}),h.jsxs(Ne,{type:"submit",className:"w-full",disabled:t,children:[t&&h.jsx(Ei,{className:"mr-2 h-4 w-4 animate-spin"}),"Send reset link"]})]})})}),h.jsx(Za,{children:h.jsx(ln,{href:"/login",className:"w-full",children:h.jsxs(Ne,{variant:"ghost",className:"w-full",children:[h.jsx(R_,{className:"mr-2 h-4 w-4"}),"Back to login"]})})})]})})}const cIe=Mc({password:wn().min(6,"Password must be at least 6 characters"),confirmPassword:wn().min(6,"Password must be at least 6 characters")}).refine(e=>e.password===e.confirmPassword,{message:"Passwords don't match",path:["confirmPassword"]});function dIe(){const{toast:e}=pl();Fp();const[t,r]=w.useState(!1),[n,i]=w.useState("form"),[o,a]=w.useState(null);w.useEffect(()=>{const c=new URLSearchParams(window.location.search).get("token");c?a(c):i("error")},[]);const s=Dc({resolver:kc(cIe),defaultValues:{password:"",confirmPassword:""}}),l=async u=>{if(!o){i("error");return}r(!0);try{const c=await fetch("/api/password-reset/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:o,newPassword:u.password})}),d=await c.json();if(!c.ok)throw new Error(d.message||"Failed to reset password");i("success"),e({title:"Password updated!",description:"You can now log in with your new password."})}catch(c){e({variant:"destructive",title:"Failed to reset password",description:c.message}),(c.message.includes("expired")||c.message.includes("Invalid"))&&i("error")}finally{r(!1)}};return n==="success"?h.jsx("div",{className:"flex items-center justify-center px-4 pt-8",children:h.jsxs(yr,{className:"w-full max-w-md",children:[h.jsxs(On,{className:"text-center",children:[h.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-green-100",children:h.jsx(Cq,{className:"h-6 w-6 text-green-600"})}),h.jsx(_n,{children:"Password updated!"}),h.jsx(ro,{children:"Your password has been successfully reset."})]}),h.jsx(Za,{children:h.jsx(ln,{href:"/login",className:"w-full",children:h.jsx(Ne,{className:"w-full",children:"Go to login"})})})]})}):n==="error"?h.jsx("div",{className:"flex items-center justify-center px-4 pt-8",children:h.jsxs(yr,{className:"w-full max-w-md",children:[h.jsxs(On,{className:"text-center",children:[h.jsx("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-red-100",children:h.jsx(XL,{className:"h-6 w-6 text-red-600"})}),h.jsx(_n,{children:"Invalid or expired link"}),h.jsx(ro,{children:"This password reset link is invalid or has expired."})]}),h.jsx(Fr,{className:"text-center text-sm text-muted-foreground",children:h.jsx("p",{children:"Reset links expire after 1 hour and can only be used once."})}),h.jsxs(Za,{className:"flex flex-col gap-2",children:[h.jsx(ln,{href:"/forgot-password",className:"w-full",children:h.jsx(Ne,{className:"w-full",children:"Request a new link"})}),h.jsx(ln,{href:"/login",className:"w-full",children:h.jsx(Ne,{variant:"ghost",className:"w-full",children:"Back to login"})})]})]})}):h.jsx("div",{className:"flex items-center justify-center px-4 pt-8",children:h.jsxs(yr,{className:"w-full max-w-md",children:[h.jsxs(On,{children:[h.jsx(_n,{children:"Set new password"}),h.jsx(ro,{children:"Enter your new password below."})]}),h.jsx(Fr,{children:h.jsx(Ic,{...s,children:h.jsxs("form",{onSubmit:s.handleSubmit(l),className:"space-y-4",children:[h.jsx(Sn,{control:s.control,name:"password",render:({field:u})=>h.jsxs(Jr,{children:[h.jsx(en,{children:"New Password"}),h.jsx(tn,{children:h.jsx(rr,{type:"password",placeholder:"â€ĸâ€ĸâ€ĸâ€ĸâ€ĸâ€ĸ",autoComplete:"new-password",autoFocus:!0,...u})}),h.jsx(rn,{})]})}),h.jsx(Sn,{control:s.control,name:"confirmPassword",render:({field:u})=>h.jsxs(Jr,{children:[h.jsx(en,{children:"Confirm Password"}),h.jsx(tn,{children:h.jsx(rr,{type:"password",placeholder:"â€ĸâ€ĸâ€ĸâ€ĸâ€ĸâ€ĸ",autoComplete:"new-password",...u})}),h.jsx(rn,{})]})}),h.jsxs(Ne,{type:"submit",className:"w-full",disabled:t,children:[t&&h.jsx(Ei,{className:"mr-2 h-4 w-4 animate-spin"}),"Reset password"]})]})})})]})})}function fIe({title:e="LiftEasy - Simple Workout Tracking App",description:t="Track your workouts with ease using LiftEasy. A simple, intuitive workout tracking app that helps you focus on what matters - your fitness journey.",canonicalUrl:r="https://lifteasy.app",ogImage:n=""}){return h.jsxs(dL,{children:[h.jsx("title",{children:e}),h.jsx("meta",{name:"description",content:t}),h.jsx("link",{rel:"canonical",href:r}),h.jsx("meta",{property:"og:site_name",content:"LiftEasy"}),h.jsx("meta",{property:"og:title",content:e}),h.jsx("meta",{property:"og:description",content:t}),h.jsx("meta",{property:"og:type",content:"website"}),h.jsx("meta",{property:"og:url",content:r}),h.jsx("meta",{name:"twitter:card",content:"summary"}),h.jsx("meta",{name:"twitter:title",content:e}),h.jsx("meta",{name:"twitter:description",content:t}),h.jsx("meta",{name:"robots",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),h.jsx("meta",{name:"googlebot",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),h.jsx("meta",{name:"bingbot",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),h.jsx("meta",{name:"author",content:"LiftEasy"}),h.jsx("meta",{name:"revisit-after",content:"1 days"}),h.jsx("meta",{httpEquiv:"Content-Language",content:"en-US"}),h.jsx("meta",{name:"application-name",content:"LiftEasy"}),h.jsx("meta",{name:"mobile-web-app-capable",content:"yes"}),h.jsx("meta",{name:"apple-mobile-web-app-capable",content:"yes"}),h.jsx("meta",{name:"apple-mobile-web-app-title",content:"LiftEasy"}),h.jsx("link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/favicon-32x32.png"}),h.jsx("link",{rel:"icon",type:"image/png",sizes:"16x16",href:"/favicon-16x16.png"}),h.jsx("link",{rel:"mask-icon",href:"/safari-pinned-tab.svg",color:"#5bbad5"}),h.jsx("meta",{name:"msapplication-TileColor",content:"#ffffff"}),h.jsx("meta",{name:"theme-color",content:"#2563eb"})]})}function pIe({url:e="https://lifteasy.app",pathname:t="/"}){const r={"@context":"https://schema.org","@graph":[{"@type":"WebApplication","@id":`${e}/#website`,url:e,name:"LiftEasy",description:"Track your workouts with ease using LiftEasy. A simple, intuitive workout tracking app that helps you focus on what matters - your fitness journey.",applicationCategory:"HealthAndFitnessApplication",operatingSystem:"Any",browserRequirements:"Requires JavaScript. Requires HTML5.",softwareVersion:"2.0",datePublished:"2024-01-01",dateModified:new Date().toISOString().split("T")[0],author:{"@type":"Organization",name:"LiftEasy"},offers:{"@type":"Offer",price:"0",priceCurrency:"USD"}},{"@type":"Organization","@id":`${e}/#organization`,name:"LiftEasy",url:e,description:"Simple workout tracking made easy",logo:{"@type":"ImageObject","@id":`${e}/#logo`,url:`${e}/192.png`,contentUrl:`${e}/192.png`,caption:"LiftEasy Logo",width:192,height:192},sameAs:[],contactPoint:{"@type":"ContactPoint",contactType:"customer support",availableLanguage:"English"}},{"@type":"SoftwareApplication",name:"LiftEasy",operatingSystem:["iOS","Android","Windows","MacOS","Linux"],applicationCategory:"HealthAndFitnessApplication",downloadUrl:e,installUrl:e,screenshot:`${e}/512.png`,aggregateRating:{"@type":"AggregateRating",ratingValue:"4.8",ratingCount:"150",bestRating:"5",worstRating:"1"},featureList:["Workout tracking and logging","Exercise database and management","Progress monitoring and analytics","Built-in timer functionality","Cloud synchronization across devices","Mobile-first responsive design","Offline capability","Progressive Web App (PWA) support"],requirements:"Internet connection required for sync",memoryRequirements:"50MB",storageRequirements:"10MB"},{"@type":"WebSite","@id":`${e}/#website`,url:e,name:"LiftEasy",description:"Simple workout tracking made easy",publisher:{"@id":`${e}/#organization`},potentialAction:[{"@type":"SearchAction",target:{"@type":"EntryPoint",urlTemplate:`${e}/search?q={search_term_string}`},"query-input":"required name=search_term_string"}]}]};return h.jsx(dL,{children:h.jsx("script",{type:"application/ld+json",children:JSON.stringify(r)})})}function hIe(){const[e]=Fp(),r={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:(n=>{const i="https://lifteasy.app",o=[{"@type":"ListItem",position:1,name:"Home",item:i}];if(n==="/")return o;const a=n.split("/").filter(Boolean);return a.forEach((s,l)=>{const u=l+2,c=`${i}/${a.slice(0,l+1).join("/")}`;let d=s.charAt(0).toUpperCase()+s.slice(1);s==="workout"&&(d="Workout Tracker"),s==="login"&&(d="Login"),s==="register"&&(d="Sign Up"),s==="subscription"&&(d="Premium Features"),o.push({"@type":"ListItem",position:u,name:d,item:c})}),o})(e)};return h.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(r)}})}const c8=w.createContext({textSize:"normal",setTextSize:()=>{}}),d8=()=>w.useContext(c8),yR="lift-easy-text-size",mIe=e=>{switch(e){case"/":return{title:"LiftEasy - Simple Workout Tracking Made Easy",description:"The simplest way to track your workouts. No complexity, no clutter - just focused fitness tracking that helps you stay consistent and see real progress."};case"/workout":return{title:"Workout Tracker - LiftEasy",description:"Track your workouts with ease using LiftEasy. A simple, intuitive workout tracking app that helps you focus on what matters - your fitness journey."};case"/login":return{title:"Login - LiftEasy",description:"Log in to your LiftEasy account to track your workouts and continue your fitness journey."};case"/register":return{title:"Sign Up - LiftEasy",description:"Create your LiftEasy account and start tracking your workouts with our simple, intuitive app."};case"/subscription":return{title:"Premium Features - LiftEasy",description:"Upgrade your LiftEasy experience with premium features for advanced workout tracking."};case"/admin":return{title:"Admin Dashboard - LiftEasy",description:"LiftEasy administrative dashboard for managing app settings and users."};default:return{title:"LiftEasy - Simple Workout Tracking Made Easy",description:"The simplest way to track your workouts. No complexity, no clutter - just focused fitness tracking that helps you stay consistent and see real progress."}}};function vIe(){const{user:e,isLoading:t,logout:r}=Ab(),[n,i]=Fp(),[o,a]=w.useState(()=>localStorage.getItem(yR)||"normal"),s=d=>{a(d),localStorage.setItem(yR,d)};if(w.useEffect(()=>{t||(e!=null&&e.isAdmin?i("/admin"):e&&n==="/"?i("/workout",{replace:!0}):!e&&n==="/workout"&&i("/login",{replace:!0}))},[e,t,n,i]),t)return h.jsx("div",{className:"flex items-center justify-center min-h-screen",children:h.jsx(Ei,{className:"h-8 w-8 animate-spin text-border"})});const l=mIe(n),u=n==="/"&&!e,c=u;return h.jsxs(c8.Provider,{value:{textSize:o,setTextSize:s},children:[h.jsx(fIe,{...l}),h.jsx(pIe,{pathname:n}),h.jsx(hIe,{}),h.jsx("div",{className:"bg-[#f6f7fb]",children:h.jsx("div",{className:`px-4 ${u?"max-w-7xl mx-auto":"max-w-md mx-auto"}`,children:h.jsxs("div",{className:"flex items-center justify-between py-4",children:[h.jsx("div",{className:"flex items-center gap-4",children:h.jsx(ln,{href:e?"/workout":"/",children:h.jsxs(Ne,{variant:"link",className:"text-xl font-bold tracking-tight font-display p-0 no-underline hover:no-underline flex items-center gap-2 group",children:[h.jsxs("div",{className:"w-6 h-6 overflow-hidden relative",children:[h.jsx("img",{src:"/flexed-biceps_1f4aa.gif",alt:"Flexed biceps animated",className:"w-6 h-6 opacity-0 group-hover:opacity-100 transition-opacity duration-200 absolute top-0 left-0"}),h.jsx("img",{src:"/muscle frame.gif",alt:"Flexed biceps static",className:"w-6 h-6 group-hover:opacity-0 transition-opacity duration-200"})]}),"LiftEasy"]})})}),h.jsx("div",{className:"flex gap-2",children:e?h.jsxs(L4,{children:[h.jsx(F4,{asChild:!0,children:h.jsx(Ne,{variant:"ghost",size:"icon",className:"bg-white rounded-full shadow-sm hover:bg-gray-50",children:h.jsx(kq,{className:"h-5 w-5"})})}),h.jsxs(kA,{align:"end",className:"w-48",children:[h.jsx(B4,{children:"Text Size"}),h.jsxs(_s,{onClick:()=>s("normal"),children:[h.jsx(_i,{className:`mr-2 h-4 w-4 ${o==="normal"?"opacity-100":"opacity-0"}`}),"Normal"]}),h.jsxs(_s,{onClick:()=>s("large"),children:[h.jsx(_i,{className:`mr-2 h-4 w-4 ${o==="large"?"opacity-100":"opacity-0"}`}),"Large"]}),h.jsxs(_s,{onClick:()=>s("extra-large"),children:[h.jsx(_i,{className:`mr-2 h-4 w-4 ${o==="extra-large"?"opacity-100":"opacity-0"}`}),"Extra Large"]}),h.jsx(V4,{}),h.jsx(_s,{onClick:()=>r(),children:"Logout"})]})]}):h.jsxs(h.Fragment,{children:[h.jsx(ln,{href:"/login",children:h.jsx(Ne,{variant:"ghost",children:"Login"})}),h.jsx(ln,{href:"/register",children:h.jsx(Ne,{variant:"default",children:"Sign Up"})})]})})]})})}),c?h.jsxs(__,{children:[h.jsx(dn,{path:"/",children:()=>e?h.jsx("div",{className:"min-h-screen bg-[#f6f7fb]",children:h.jsx(bm,{})}):h.jsx(hw,{})}),h.jsx(dn,{path:"/workout",children:()=>h.jsx("div",{className:"min-h-screen bg-[#f6f7fb]",children:h.jsx(bm,{})})}),h.jsx(dn,{children:()=>h.jsx(hw,{})})]}):h.jsxs(__,{children:[h.jsx(dn,{path:"/",children:()=>e?h.jsx("div",{className:"min-h-screen bg-[#f6f7fb]",children:h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(bm,{})})}):h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(hw,{})})}),h.jsx(dn,{path:"/workout",children:()=>h.jsx("div",{className:"min-h-screen bg-[#f6f7fb]",children:h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(bm,{})})})}),h.jsx(dn,{path:"/login",children:()=>h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(gR,{mode:"login"})})}),h.jsx(dn,{path:"/register",children:()=>h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(gR,{mode:"register"})})}),h.jsx(dn,{path:"/subscription",children:()=>h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(aIe,{})})}),h.jsx(dn,{path:"/verify-magic-link",children:()=>h.jsx(sIe,{})}),h.jsx(dn,{path:"/forgot-password",children:()=>h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(uIe,{})})}),h.jsx(dn,{path:"/reset-password",children:()=>h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(dIe,{})})}),h.jsx(dn,{path:"/admin",children:()=>h.jsx("div",{className:"max-w-4xl mx-auto",children:h.jsx(oIe,{})})}),h.jsx(dn,{children:()=>h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(gIe,{})})})]})]})}function gIe(){return h.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:h.jsx(yr,{className:"w-full max-w-md mx-4",children:h.jsxs(Fr,{className:"pt-6",children:[h.jsxs("div",{className:"flex mb-4 gap-2",children:[h.jsx(Eq,{className:"h-8 w-8 text-red-500"}),h.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),h.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Sorry, the page you're looking for cannot be found."})]})})})}z$(document.getElementById("root")).render(h.jsx(w.StrictMode,{children:h.jsx(SL,{children:h.jsx(cL,{children:h.jsxs(s9,{client:wK,children:[h.jsx(vIe,{}),h.jsx(x7,{})]})})})}))});export default yIe();