var a8=Object.defineProperty;var XT=e=>{throw TypeError(e)};var s8=(e,t,r)=>t in e?a8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var l8=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var to=(e,t,r)=>s8(e,typeof t!="symbol"?t+"":t,r),hx=(e,t,r)=>t.has(e)||XT("Cannot "+r);var L=(e,t,r)=>(hx(e,t,"read from private field"),r?r.call(e):t.get(e)),Ne=(e,t,r)=>t.has(e)?XT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),xe=(e,t,r,n)=>(hx(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Ge=(e,t,r)=>(hx(e,t,"access private method"),r);var hh=(e,t,r,n)=>({set _(i){xe(e,t,i,r)},get _(){return L(e,t,n)}});var aIe=l8((vIe,qp)=>{function u8(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 mh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ut(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var PR={exports:{}},Jg={},CR={exports:{}},Xe={};/** * @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 Sp=Symbol.for("react.element"),c8=Symbol.for("react.portal"),d8=Symbol.for("react.fragment"),f8=Symbol.for("react.strict_mode"),p8=Symbol.for("react.profiler"),h8=Symbol.for("react.provider"),m8=Symbol.for("react.context"),v8=Symbol.for("react.forward_ref"),g8=Symbol.for("react.suspense"),y8=Symbol.for("react.memo"),b8=Symbol.for("react.lazy"),ZT=Symbol.iterator;function x8(e){return e===null||typeof e!="object"?null:(e=ZT&&e[ZT]||e["@@iterator"],typeof e=="function"?e:null)}var AR={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},TR=Object.assign,OR={};function hc(e,t,r){this.props=e,this.context=t,this.refs=OR,this.updater=r||AR}hc.prototype.isReactComponent={};hc.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")};hc.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _R(){}_R.prototype=hc.prototype;function KE(e,t,r){this.props=e,this.context=t,this.refs=OR,this.updater=r||AR}var qE=KE.prototype=new _R;qE.constructor=KE;TR(qE,hc.prototype);qE.isPureReactComponent=!0;var QT=Array.isArray,jR=Object.prototype.hasOwnProperty,YE={current:null},NR={key:!0,ref:!0,__self:!0,__source:!0};function DR(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)jR.call(t,n)&&!NR.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1>>1,U=I[O];if(0>>1;Oi(ce,j))dei(Z,ce)?(I[O]=Z,I[de]=j,O=de):(I[O]=ce,I[re]=j,O=re);else if(dei(Z,j))I[O]=Z,I[de]=j,O=de;else break e}}return $}function i(I,$){var j=I.sortIndex-$.sortIndex;return j!==0?j: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=[],d=1,c=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 E(I){if(v=!1,x(I),!m)if(r(l)!==null)m=!0,V(S);else{var $=r(u);$!==null&&z(E,$.startTime-I)}}function S(I,$){m=!1,v&&(v=!1,b(A),A=-1),p=!0;var j=f;try{for(x($),c=r(l);c!==null&&(!(c.expirationTime>$)||I&&!N());){var O=c.callback;if(typeof O=="function"){c.callback=null,f=c.priorityLevel;var U=O(c.expirationTime<=$);$=e.unstable_now(),typeof U=="function"?c.callback=U:c===r(l)&&n(l),x($)}else n(l);c=r(l)}if(c!==null)var Y=!0;else{var re=r(u);re!==null&&z(E,re.startTime-$),Y=!1}return Y}finally{c=null,f=j,p=!1}}var P=!1,C=null,A=-1,T=5,D=-1;function N(){return!(e.unstable_now()-DI||125O?(I.sortIndex=j,t(u,I),r(l)===null&&I===r(u)&&(v?(b(A),A=-1):v=!0,z(E,j-O))):(I.sortIndex=U,t(l,I),m||p||(m=!0,V(S))),I},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(I){var $=f;return function(){var j=f;f=$;try{return I.apply(this,arguments)}finally{f=j}}}})(LR);$R.exports=LR;var N8=$R.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 D8=w,mn=N8;function ae(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"),pw=Object.prototype.hasOwnProperty,k8=/^[: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]*$/,eO={},tO={};function M8(e){return pw.call(tO,e)?!0:pw.call(eO,e)?!1:k8.test(e)?tO[e]=!0:(eO[e]=!0,!1)}function I8(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 R8(e,t,r,n){if(t===null||typeof t>"u"||I8(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 Lr(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 hr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){hr[e]=new Lr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];hr[t]=new Lr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){hr[e]=new Lr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){hr[e]=new Lr(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){hr[e]=new Lr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){hr[e]=new Lr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){hr[e]=new Lr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){hr[e]=new Lr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){hr[e]=new Lr(e,5,!1,e.toLowerCase(),null,!1,!1)});var ZE=/[\-:]([a-z])/g;function QE(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(ZE,QE);hr[t]=new Lr(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(ZE,QE);hr[t]=new Lr(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(ZE,QE);hr[t]=new Lr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){hr[e]=new Lr(e,1,!1,e.toLowerCase(),null,!1,!1)});hr.xlinkHref=new Lr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){hr[e]=new Lr(e,1,!1,e.toLowerCase(),null,!0,!0)});function JE(e,t,r,n){var i=hr.hasOwnProperty(t)?hr[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{gx=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?hd(e):""}function $8(e){switch(e.tag){case 5:return hd(e.type);case 16:return hd("Lazy");case 13:return hd("Suspense");case 19:return hd("SuspenseList");case 0:case 2:case 15:return e=yx(e.type,!1),e;case 11:return e=yx(e.type.render,!1),e;case 1:return e=yx(e.type,!0),e;default:return""}}function gw(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 _l:return"Fragment";case Ol:return"Portal";case hw:return"Profiler";case eP:return"StrictMode";case mw:return"Suspense";case vw:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case VR:return(e.displayName||"Context")+".Consumer";case BR:return(e._context.displayName||"Context")+".Provider";case tP:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rP:return t=e.displayName||null,t!==null?t:gw(e.type)||"Memo";case na:t=e._payload,e=e._init;try{return gw(e(t))}catch{}}return null}function L8(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 gw(t);case 8:return t===eP?"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 Ia(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zR(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function F8(e){var t=zR(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 yh(e){e._valueTracker||(e._valueTracker=F8(e))}function WR(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=zR(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Rm(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 yw(e,t){var r=t.checked;return kt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function nO(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ia(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 HR(e,t){t=t.checked,t!=null&&JE(e,"checked",t,!1)}function bw(e,t){HR(e,t);var r=Ia(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")?xw(e,t.type,r):t.hasOwnProperty("defaultValue")&&xw(e,t.type,Ia(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function iO(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 xw(e,t,r){(t!=="number"||Rm(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var md=Array.isArray;function ql(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=bh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Jd(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Od={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},B8=["Webkit","ms","Moz","O"];Object.keys(Od).forEach(function(e){B8.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Od[t]=Od[e]})});function YR(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Od.hasOwnProperty(e)&&Od[e]?(""+t).trim():t+"px"}function XR(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=YR(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var V8=kt({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 Ew(e,t){if(t){if(V8[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ae(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ae(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ae(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ae(62))}}function Pw(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 Cw=null;function nP(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Aw=null,Yl=null,Xl=null;function sO(e){if(e=Cp(e)){if(typeof Aw!="function")throw Error(ae(280));var t=e.stateNode;t&&(t=iy(t),Aw(e.stateNode,e.type,t))}}function ZR(e){Yl?Xl?Xl.push(e):Xl=[e]:Yl=e}function QR(){if(Yl){var e=Yl,t=Xl;if(Xl=Yl=null,sO(e),t)for(e=0;e>>=0,e===0?32:31-(Q8(e)/J8|0)|0}var xh=64,wh=4194304;function vd(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 Bm(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=vd(s):(o&=a,o!==0&&(n=vd(o)))}else a=r&~i,a!==0?n=vd(a):o!==0&&(n=vd(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 Ep(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yi(t),e[t]=r}function nH(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=jd),vO=" ",gO=!1;function y$(e,t){switch(e){case"keyup":return NH.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function b$(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jl=!1;function kH(e,t){switch(e){case"compositionend":return b$(t);case"keypress":return t.which!==32?null:(gO=!0,vO);case"textInput":return e=t.data,e===vO&&gO?null:e;default:return null}}function MH(e,t){if(jl)return e==="compositionend"||!dP&&y$(e,t)?(e=v$(),hm=lP=ya=null,jl=!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=wO(r)}}function E$(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?E$(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function P$(){for(var e=window,t=Rm();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Rm(e.document)}return t}function fP(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 zH(e){var t=P$(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&E$(r.ownerDocument.documentElement,r)){if(n!==null&&fP(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=SO(r,o);var a=SO(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,Nl=null,Dw=null,Dd=null,kw=!1;function EO(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;kw||Nl==null||Nl!==Rm(n)||(n=Nl,"selectionStart"in n&&fP(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}),Dd&&af(Dd,n)||(Dd=n,n=zm(Dw,"onSelect"),0Ml||(e.current=Fw[Ml],Fw[Ml]=null,Ml--)}function bt(e,t){Ml++,Fw[Ml]=e.current,e.current=t}var Ra={},Cr=qa(Ra),Yr=qa(!1),Ws=Ra;function Ou(e,t){var r=e.type.contextTypes;if(!r)return Ra;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 Xr(e){return e=e.childContextTypes,e!=null}function Hm(){Ct(Yr),Ct(Cr)}function jO(e,t,r){if(Cr.current!==Ra)throw Error(ae(168));bt(Cr,t),bt(Yr,r)}function k$(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(ae(108,L8(e)||"Unknown",i));return kt({},r,n)}function Gm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ra,Ws=Cr.current,bt(Cr,e),bt(Yr,Yr.current),!0}function NO(e,t,r){var n=e.stateNode;if(!n)throw Error(ae(169));r?(e=k$(e,t,Ws),n.__reactInternalMemoizedMergedChildContext=e,Ct(Yr),Ct(Cr),bt(Cr,e)):Ct(Yr),bt(Yr,r)}var lo=null,oy=!1,Dx=!1;function M$(e){lo===null?lo=[e]:lo.push(e)}function tG(e){oy=!0,M$(e)}function Ya(){if(!Dx&&lo!==null){Dx=!0;var e=0,t=ft;try{var r=lo;for(ft=1;e>=a,i-=a,co=1<<32-yi(t)+i|r<A?(T=C,C=null):T=C.sibling;var D=f(b,C,x[A],E);if(D===null){C===null&&(C=T);break}e&&C&&D.alternate===null&&t(b,C),y=o(D,y,A),P===null?S=D:P.sibling=D,P=D,C=T}if(A===x.length)return r(b,C),Tt&&cs(b,A),S;if(C===null){for(;AA?(T=C,C=null):T=C.sibling;var N=f(b,C,D.value,E);if(N===null){C===null&&(C=T);break}e&&C&&N.alternate===null&&t(b,C),y=o(N,y,A),P===null?S=N:P.sibling=N,P=N,C=T}if(D.done)return r(b,C),Tt&&cs(b,A),S;if(C===null){for(;!D.done;A++,D=x.next())D=c(b,D.value,E),D!==null&&(y=o(D,y,A),P===null?S=D:P.sibling=D,P=D);return Tt&&cs(b,A),S}for(C=n(b,C);!D.done;A++,D=x.next())D=p(C,b,A,D.value,E),D!==null&&(e&&D.alternate!==null&&C.delete(D.key===null?A:D.key),y=o(D,y,A),P===null?S=D:P.sibling=D,P=D);return e&&C.forEach(function(_){return t(b,_)}),Tt&&cs(b,A),S}function g(b,y,x,E){if(typeof x=="object"&&x!==null&&x.type===_l&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case gh:e:{for(var S=x.key,P=y;P!==null;){if(P.key===S){if(S=x.type,S===_l){if(P.tag===7){r(b,P.sibling),y=i(P,x.props.children),y.return=b,b=y;break e}}else if(P.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===na&&MO(S)===P.type){r(b,P.sibling),y=i(P,x.props),y.ref=Hc(b,P,x),y.return=b,b=y;break e}r(b,P);break}else t(b,P);P=P.sibling}x.type===_l?(y=Fs(x.props.children,b.mode,E,x.key),y.return=b,b=y):(E=Sm(x.type,x.key,x.props,null,b.mode,E),E.ref=Hc(b,y,x),E.return=b,b=E)}return a(b);case Ol:e:{for(P=x.key;y!==null;){if(y.key===P)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=Bx(x,b.mode,E),y.return=b,b=y}return a(b);case na:return P=x._init,g(b,y,P(x._payload),E)}if(md(x))return m(b,y,x,E);if(Bc(x))return v(b,y,x,E);Oh(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=Fx(x,b.mode,E),y.return=b,b=y),a(b)):r(b,y)}return g}var ju=L$(!0),F$=L$(!1),Ym=qa(null),Xm=null,$l=null,vP=null;function gP(){vP=$l=Xm=null}function yP(e){var t=Ym.current;Ct(Ym),e._currentValue=t}function Uw(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 Ql(e,t){Xm=e,vP=$l=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Kr=!0),e.firstContext=null)}function zn(e){var t=e._currentValue;if(vP!==e)if(e={context:e,memoizedValue:t,next:null},$l===null){if(Xm===null)throw Error(ae(308));$l=e,Xm.dependencies={lanes:0,firstContext:e}}else $l=$l.next=e;return t}var xs=null;function bP(e){xs===null?xs=[e]:xs.push(e)}function B$(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,bP(t)):(r.next=i.next,i.next=r),t.interleaved=r,_o(e,n)}function _o(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 ia=!1;function xP(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function V$(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 yo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ca(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ot&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,_o(e,r)}return i=n.interleaved,i===null?(t.next=t,bP(n)):(t.next=i.next,i.next=t),n.interleaved=t,_o(e,r)}function vm(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,oP(e,r)}}function IO(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 Zm(e,t,r,n){var i=e.updateQueue;ia=!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 d=e.alternate;d!==null&&(d=d.updateQueue,s=d.lastBaseUpdate,s!==a&&(s===null?d.firstBaseUpdate=u:s.next=u,d.lastBaseUpdate=l))}if(o!==null){var c=i.baseState;a=0,d=u=l=null,s=o;do{var f=s.lane,p=s.eventTime;if((n&f)===f){d!==null&&(d=d.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"){c=m.call(p,c,f);break e}c=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,f=typeof m=="function"?m.call(p,c,f):m,f==null)break e;c=kt({},c,f);break e;case 2:ia=!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},d===null?(u=d=p,l=c):d=d.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(d===null&&(l=c),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=d,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);Ks|=a,e.lanes=a,e.memoizedState=c}}function RO(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Mx.transition;Mx.transition={};try{e(!1),t()}finally{ft=r,Mx.transition=n}}function i2(){return Wn().memoizedState}function oG(e,t,r){var n=Ta(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},o2(e))a2(t,r);else if(r=B$(e,t,r,n),r!==null){var i=Ir();bi(r,e,n,i),s2(r,t,n)}}function aG(e,t,r){var n=Ta(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(o2(e))a2(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,wi(s,a)){var l=t.interleaved;l===null?(i.next=i,bP(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=B$(e,t,i,n),r!==null&&(i=Ir(),bi(r,e,n,i),s2(r,t,n))}}function o2(e){var t=e.alternate;return e===Dt||t!==null&&t===Dt}function a2(e,t){kd=Jm=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function s2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,oP(e,r)}}var ev={readContext:zn,useCallback:vr,useContext:vr,useEffect:vr,useImperativeHandle:vr,useInsertionEffect:vr,useLayoutEffect:vr,useMemo:vr,useReducer:vr,useRef:vr,useState:vr,useDebugValue:vr,useDeferredValue:vr,useTransition:vr,useMutableSource:vr,useSyncExternalStore:vr,useId:vr,unstable_isNewReconciler:!1},sG={readContext:zn,useCallback:function(e,t){return _i().memoizedState=[e,t===void 0?null:t],e},useContext:zn,useEffect:LO,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ym(4194308,4,J$.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ym(4194308,4,e,t)},useInsertionEffect:function(e,t){return ym(4,2,e,t)},useMemo:function(e,t){var r=_i();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=_i();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=oG.bind(null,Dt,e),[n.memoizedState,e]},useRef:function(e){var t=_i();return e={current:e},t.memoizedState=e},useState:$O,useDebugValue:OP,useDeferredValue:function(e){return _i().memoizedState=e},useTransition:function(){var e=$O(!1),t=e[0];return e=iG.bind(null,e[1]),_i().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Dt,i=_i();if(Tt){if(r===void 0)throw Error(ae(407));r=r()}else{if(r=t(),rr===null)throw Error(ae(349));Gs&30||H$(n,t,r)}i.memoizedState=r;var o={value:r,getSnapshot:t};return i.queue=o,LO(K$.bind(null,n,o,e),[e]),n.flags|=2048,hf(9,G$.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=_i(),t=rr.identifierPrefix;if(Tt){var r=fo,n=co;r=(n&~(1<<32-yi(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=ff++,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[Ii]=t,e[uf]=n,g2(e,t,!1,!1),t.stateNode=e;e:{switch(a=Pw(r,n),r){case"dialog":St("cancel",e),St("close",e),i=n;break;case"iframe":case"object":case"embed":St("load",e),i=n;break;case"video":case"audio":for(i=0;iku&&(t.flags|=128,n=!0,Gc(o,!1),t.lanes=4194304)}else{if(!n)if(e=Qm(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Gc(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Tt)return gr(t),null}else 2*Vt()-o.renderingStartTime>ku&&r!==1073741824&&(t.flags|=128,n=!0,Gc(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=Vt(),t.sibling=null,r=jt.current,bt(jt,n?r&1|2:r&1),t):(gr(t),null);case 22:case 23:return MP(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?nn&1073741824&&(gr(t),t.subtreeFlags&6&&(t.flags|=8192)):gr(t),null;case 24:return null;case 25:return null}throw Error(ae(156,t.tag))}function mG(e,t){switch(hP(t),t.tag){case 1:return Xr(t.type)&&Hm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nu(),Ct(Yr),Ct(Cr),EP(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return SP(t),null;case 13:if(Ct(jt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ae(340));_u()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ct(jt),null;case 4:return Nu(),null;case 10:return yP(t.type._context),null;case 22:case 23:return MP(),null;case 24:return null;default:return null}}var jh=!1,wr=!1,vG=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function Ll(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){$t(e,t,n)}else r.current=null}function Zw(e,t,r){try{r()}catch(n){$t(e,t,n)}}var YO=!1;function gG(e,t){if(Mw=Vm,e=P$(),fP(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,d=0,c=e,f=null;t:for(;;){for(var p;c!==r||i!==0&&c.nodeType!==3||(s=a+i),c!==o||n!==0&&c.nodeType!==3||(l=a+n),c.nodeType===3&&(a+=c.nodeValue.length),(p=c.firstChild)!==null;)f=c,c=p;for(;;){if(c===e)break t;if(f===r&&++u===i&&(s=a),f===o&&++d===n&&(l=a),(p=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=p}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Iw={focusedElem:e,selectionRange:r},Vm=!1,Pe=t;Pe!==null;)if(t=Pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pe=e;else for(;Pe!==null;){t=Pe;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:ei(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(ae(163))}}catch(E){$t(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,Pe=e;break}Pe=t.return}return m=YO,YO=!1,m}function Md(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&&Zw(t,r,o)}i=i.next}while(i!==n)}}function ly(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 Qw(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 x2(e){var t=e.alternate;t!==null&&(e.alternate=null,x2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ii],delete t[uf],delete t[Lw],delete t[JH],delete t[eG])),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 w2(e){return e.tag===5||e.tag===3||e.tag===4}function XO(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||w2(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 Jw(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=Wm));else if(n!==4&&(e=e.child,e!==null))for(Jw(e,t,r),e=e.sibling;e!==null;)Jw(e,t,r),e=e.sibling}function eS(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(eS(e,t,r),e=e.sibling;e!==null;)eS(e,t,r),e=e.sibling}var ur=null,ri=!1;function Zo(e,t,r){for(r=r.child;r!==null;)S2(e,t,r),r=r.sibling}function S2(e,t,r){if(Vi&&typeof Vi.onCommitFiberUnmount=="function")try{Vi.onCommitFiberUnmount(ey,r)}catch{}switch(r.tag){case 5:wr||Ll(r,t);case 6:var n=ur,i=ri;ur=null,Zo(e,t,r),ur=n,ri=i,ur!==null&&(ri?(e=ur,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ur.removeChild(r.stateNode));break;case 18:ur!==null&&(ri?(e=ur,r=r.stateNode,e.nodeType===8?Nx(e.parentNode,r):e.nodeType===1&&Nx(e,r),nf(e)):Nx(ur,r.stateNode));break;case 4:n=ur,i=ri,ur=r.stateNode.containerInfo,ri=!0,Zo(e,t,r),ur=n,ri=i;break;case 0:case 11:case 14:case 15:if(!wr&&(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)&&Zw(r,t,a),i=i.next}while(i!==n)}Zo(e,t,r);break;case 1:if(!wr&&(Ll(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){$t(r,t,s)}Zo(e,t,r);break;case 21:Zo(e,t,r);break;case 22:r.mode&1?(wr=(n=wr)||r.memoizedState!==null,Zo(e,t,r),wr=n):Zo(e,t,r);break;default:Zo(e,t,r)}}function ZO(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new vG),t.forEach(function(n){var i=AG.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Yn(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=a),n&=~o}if(n=i,n=Vt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*bG(n/1960))-n,10e?16:e,ba===null)var n=!1;else{if(e=ba,ba=null,nv=0,ot&6)throw Error(ae(331));var i=ot;for(ot|=4,Pe=e.current;Pe!==null;){var o=Pe,a=o.child;if(Pe.flags&16){var s=o.deletions;if(s!==null){for(var l=0;lVt()-DP?Ls(e,0):NP|=r),Zr(e,t)}function j2(e,t){t===0&&(e.mode&1?(t=wh,wh<<=1,!(wh&130023424)&&(wh=4194304)):t=1);var r=Ir();e=_o(e,t),e!==null&&(Ep(e,t,r),Zr(e,r))}function CG(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),j2(e,r)}function AG(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(ae(314))}n!==null&&n.delete(t),j2(e,r)}var N2;N2=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Yr.current)Kr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Kr=!1,pG(e,t,r);Kr=!!(e.flags&131072)}else Kr=!1,Tt&&t.flags&1048576&&I$(t,qm,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;bm(e,t),e=t.pendingProps;var i=Ou(t,Cr.current);Ql(t,r),i=CP(null,t,n,e,i,r);var o=AP();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,Xr(n)?(o=!0,Gm(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,xP(t),i.updater=sy,t.stateNode=i,i._reactInternals=t,Ww(t,n,e,r),t=Kw(null,t,n,!0,o,r)):(t.tag=0,Tt&&o&&pP(t),Dr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(bm(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=OG(n),e=ei(n,e),i){case 0:t=Gw(null,t,n,e,r);break e;case 1:t=GO(null,t,n,e,r);break e;case 11:t=WO(null,t,n,e,r);break e;case 14:t=HO(null,t,n,ei(n.type,e),r);break e}throw Error(ae(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ei(n,i),Gw(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ei(n,i),GO(e,t,n,i,r);case 3:e:{if(h2(t),e===null)throw Error(ae(387));n=t.pendingProps,o=t.memoizedState,i=o.element,V$(e,t),Zm(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=Du(Error(ae(423)),t),t=KO(e,t,n,r,i);break e}else if(n!==i){i=Du(Error(ae(424)),t),t=KO(e,t,n,r,i);break e}else for(ln=Pa(t.stateNode.containerInfo.firstChild),cn=t,Tt=!0,oi=null,r=F$(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(_u(),n===i){t=jo(e,t,r);break e}Dr(e,t,n,r)}t=t.child}return t;case 5:return U$(t),e===null&&Vw(t),n=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,Rw(n,i)?a=null:o!==null&&Rw(n,o)&&(t.flags|=32),p2(e,t),Dr(e,t,a,r),t.child;case 6:return e===null&&Vw(t),null;case 13:return m2(e,t,r);case 4:return wP(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ju(t,null,n,r):Dr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ei(n,i),WO(e,t,n,i,r);case 7:return Dr(e,t,t.pendingProps,r),t.child;case 8:return Dr(e,t,t.pendingProps.children,r),t.child;case 12:return Dr(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,bt(Ym,n._currentValue),n._currentValue=a,o!==null)if(wi(o.value,a)){if(o.children===i.children&&!Yr.current){t=jo(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=yo(-1,r&-r),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Uw(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(ae(341));a.lanes|=r,s=a.alternate,s!==null&&(s.lanes|=r),Uw(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}Dr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Ql(t,r),i=zn(i),n=n(i),t.flags|=1,Dr(e,t,n,r),t.child;case 14:return n=t.type,i=ei(n,t.pendingProps),i=ei(n.type,i),HO(e,t,n,i,r);case 15:return d2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:ei(n,i),bm(e,t),t.tag=1,Xr(n)?(e=!0,Gm(t)):e=!1,Ql(t,r),l2(t,n,i),Ww(t,n,i,r),Kw(null,t,n,!0,e,r);case 19:return v2(e,t,r);case 22:return f2(e,t,r)}throw Error(ae(156,t.tag))};function D2(e,t){return o$(e,t)}function TG(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 kn(e,t,r,n){return new TG(e,t,r,n)}function RP(e){return e=e.prototype,!(!e||!e.isReactComponent)}function OG(e){if(typeof e=="function")return RP(e)?1:0;if(e!=null){if(e=e.$$typeof,e===tP)return 11;if(e===rP)return 14}return 2}function Oa(e,t){var r=e.alternate;return r===null?(r=kn(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 Sm(e,t,r,n,i,o){var a=2;if(n=e,typeof e=="function")RP(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case _l:return Fs(r.children,i,o,t);case eP:a=8,i|=8;break;case hw:return e=kn(12,r,t,i|2),e.elementType=hw,e.lanes=o,e;case mw:return e=kn(13,r,t,i),e.elementType=mw,e.lanes=o,e;case vw:return e=kn(19,r,t,i),e.elementType=vw,e.lanes=o,e;case UR:return cy(r,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case BR:a=10;break e;case VR:a=9;break e;case tP:a=11;break e;case rP:a=14;break e;case na:a=16,n=null;break e}throw Error(ae(130,e==null?e:typeof e,""))}return t=kn(a,r,t,i),t.elementType=e,t.type=n,t.lanes=o,t}function Fs(e,t,r,n){return e=kn(7,e,n,t),e.lanes=r,e}function cy(e,t,r,n){return e=kn(22,e,n,t),e.elementType=UR,e.lanes=r,e.stateNode={isHidden:!1},e}function Fx(e,t,r){return e=kn(6,e,null,t),e.lanes=r,e}function Bx(e,t,r){return t=kn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _G(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=xx(0),this.expirationTimes=xx(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xx(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $P(e,t,r,n,i,o,a,s,l){return e=new _G(e,t,r,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=kn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},xP(o),e}function jG(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(R2)}catch(e){console.error(e)}}R2(),RR.exports=yn;var Xa=RR.exports;const $2=ut(Xa);var L2,o_=Xa;L2=o_.createRoot,o_.hydrateRoot;var gc=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(){}},Ys=typeof window>"u"||"Deno"in globalThis;function _n(){}function IG(e,t){return typeof e=="function"?e(t):e}function oS(e){return typeof e=="number"&&e>=0&&e!==1/0}function F2(e,t){return Math.max(e+(t||0)-Date.now(),0)}function eu(e,t){return typeof e=="function"?e(t):e}function ai(e,t){return typeof e=="function"?e(t):e}function a_(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:a,stale:s}=e;if(a){if(n){if(t.queryHash!==VP(a,t.options))return!1}else if(!vf(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 s_(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Xs(t.options.mutationKey)!==Xs(o))return!1}else if(!vf(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function VP(e,t){return((t==null?void 0:t.queryKeyHashFn)||Xs)(e)}function Xs(e){return JSON.stringify(e,(t,r)=>aS(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function vf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!vf(e[r],t[r])):!1}function B2(e,t){if(e===t)return e;const r=l_(e)&&l_(t);if(r||aS(e)&&aS(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 sS(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?B2(e,t):t}function $G(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function LG(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var UP=Symbol();function V2(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===UP?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var js,ua,hu,hR,FG=(hR=class extends gc{constructor(){super();Ne(this,js);Ne(this,ua);Ne(this,hu);xe(this,hu,t=>{if(!Ys&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){L(this,ua)||this.setEventListener(L(this,hu))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,ua))==null||t.call(this),xe(this,ua,void 0))}setEventListener(t){var r;xe(this,hu,t),(r=L(this,ua))==null||r.call(this),xe(this,ua,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){L(this,js)!==t&&(xe(this,js,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof L(this,js)=="boolean"?L(this,js):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},js=new WeakMap,ua=new WeakMap,hu=new WeakMap,hR),zP=new FG,mu,ca,vu,mR,BG=(mR=class extends gc{constructor(){super();Ne(this,mu,!0);Ne(this,ca);Ne(this,vu);xe(this,vu,t=>{if(!Ys&&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(){L(this,ca)||this.setEventListener(L(this,vu))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,ca))==null||t.call(this),xe(this,ca,void 0))}setEventListener(t){var r;xe(this,vu,t),(r=L(this,ca))==null||r.call(this),xe(this,ca,t(this.setOnline.bind(this)))}setOnline(t){L(this,mu)!==t&&(xe(this,mu,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return L(this,mu)}},mu=new WeakMap,ca=new WeakMap,vu=new WeakMap,mR),sv=new BG;function lS(){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 VG(e){return Math.min(1e3*2**e,3e4)}function U2(e){return(e??"online")==="online"?sv.isOnline():!0}var z2=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Vx(e){return e instanceof z2}function W2(e){let t=!1,r=0,n=!1,i;const o=lS(),a=v=>{var g;n||(f(new z2(v)),(g=e.abort)==null||g.call(e))},s=()=>{t=!0},l=()=>{t=!1},u=()=>zP.isFocused()&&(e.networkMode==="always"||sv.isOnline())&&e.canRun(),d=()=>U2(e.networkMode)&&e.canRun(),c=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(c).catch(b=>{var P;if(n)return;const y=e.retry??(Ys?0:3),x=e.retryDelay??VG,E=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:d,start:()=>(d()?m():p().then(m),o)}}function UG(){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 Xt=UG(),Ns,vR,H2=(vR=class{constructor(){Ne(this,Ns)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),oS(this.gcTime)&&xe(this,Ns,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ys?1/0:5*60*1e3))}clearGcTimeout(){L(this,Ns)&&(clearTimeout(L(this,Ns)),xe(this,Ns,void 0))}},Ns=new WeakMap,vR),gu,yu,On,yr,yp,Ds,ti,oo,gR,zG=(gR=class extends H2{constructor(t){super();Ne(this,ti);Ne(this,gu);Ne(this,yu);Ne(this,On);Ne(this,yr);Ne(this,yp);Ne(this,Ds);xe(this,Ds,!1),xe(this,yp,t.defaultOptions),this.setOptions(t.options),this.observers=[],xe(this,On,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,xe(this,gu,WG(this.options)),this.state=t.state??L(this,gu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=L(this,yr))==null?void 0:t.promise}setOptions(t){this.options={...L(this,yp),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,On).remove(this)}setData(t,r){const n=sS(this.state.data,t,this.options);return Ge(this,ti,oo).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,ti,oo).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=L(this,yr))==null?void 0:n.promise;return(i=L(this,yr))==null||i.cancel(t),r?r.then(_n).catch(_n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(L(this,gu))}isActive(){return this.observers.some(t=>ai(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===UP||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||!F2(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,yr))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,yr))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,On).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(L(this,yr)&&(L(this,Ds)?L(this,yr).cancel({revert:!0}):L(this,yr).cancelRetry()),this.scheduleGc()),L(this,On).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ge(this,ti,oo).call(this,{type:"invalidate"})}fetch(t,r){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(L(this,yr))return L(this,yr).continueRetry(),L(this,yr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(xe(this,Ds,!0),n.signal)})},o=()=>{const c=V2(this.options,r),f={queryKey:this.queryKey,meta:this.meta};return i(f),xe(this,Ds,!1),this.options.persister?this.options.persister(c,f,this):c(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),xe(this,yu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Ge(this,ti,oo).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const s=c=>{var f,p,m,v;Vx(c)&&c.silent||Ge(this,ti,oo).call(this,{type:"error",error:c}),Vx(c)||((p=(f=L(this,On).config).onError)==null||p.call(f,c,this),(v=(m=L(this,On).config).onSettled)==null||v.call(m,this.state.data,c,this)),this.scheduleGc()};return xe(this,yr,W2({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:c=>{var f,p,m,v;if(c===void 0){s(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(g){s(g);return}(p=(f=L(this,On).config).onSuccess)==null||p.call(f,c,this),(v=(m=L(this,On).config).onSettled)==null||v.call(m,c,this.state.error,this),this.scheduleGc()},onError:s,onFail:(c,f)=>{Ge(this,ti,oo).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{Ge(this,ti,oo).call(this,{type:"pause"})},onContinue:()=>{Ge(this,ti,oo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),L(this,yr).start()}},gu=new WeakMap,yu=new WeakMap,On=new WeakMap,yr=new WeakMap,yp=new WeakMap,Ds=new WeakMap,ti=new WeakSet,oo=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,...G2(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 Vx(i)&&i.revert&&L(this,yu)?{...L(this,yu),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),Xt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),L(this,On).notify({query:this,type:"updated",action:t})})},gR);function G2(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:U2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function WG(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 Ni,yR,HG=(yR=class extends gc{constructor(t={}){super();Ne(this,Ni);this.config=t,xe(this,Ni,new Map)}build(t,r,n){const i=r.queryKey,o=r.queryHash??VP(i,r);let a=this.get(o);return a||(a=new zG({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){L(this,Ni).has(t.queryHash)||(L(this,Ni).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=L(this,Ni).get(t.queryHash);r&&(t.destroy(),r===t&&L(this,Ni).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Xt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Ni).get(t)}getAll(){return[...L(this,Ni).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>a_(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>a_(t,n)):r}notify(t){Xt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Xt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ni=new WeakMap,yR),Di,jr,ks,ki,ea,bR,GG=(bR=class extends H2{constructor(t){super();Ne(this,ki);Ne(this,Di);Ne(this,jr);Ne(this,ks);this.mutationId=t.mutationId,xe(this,jr,t.mutationCache),xe(this,Di,[]),this.state=t.state||K2(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,Di).includes(t)||(L(this,Di).push(t),this.clearGcTimeout(),L(this,jr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){xe(this,Di,L(this,Di).filter(r=>r!==t)),this.scheduleGc(),L(this,jr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Di).length||(this.state.status==="pending"?this.scheduleGc():L(this,jr).remove(this))}continue(){var t;return((t=L(this,ks))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,a,s,l,u,d,c,f,p,m,v,g,b,y,x,E,S,P,C;xe(this,ks,W2({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,T)=>{Ge(this,ki,ea).call(this,{type:"failed",failureCount:A,error:T})},onPause:()=>{Ge(this,ki,ea).call(this,{type:"pause"})},onContinue:()=>{Ge(this,ki,ea).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,jr).canRun(this)}));const r=this.state.status==="pending",n=!L(this,ks).canStart();try{if(!r){Ge(this,ki,ea).call(this,{type:"pending",variables:t,isPaused:n}),await((o=(i=L(this,jr).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,ki,ea).call(this,{type:"pending",context:T,variables:t,isPaused:n})}const A=await L(this,ks).start();return await((u=(l=L(this,jr).config).onSuccess)==null?void 0:u.call(l,A,t,this.state.context,this)),await((c=(d=this.options).onSuccess)==null?void 0:c.call(d,A,t,this.state.context)),await((p=(f=L(this,jr).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,ki,ea).call(this,{type:"success",data:A}),A}catch(A){try{throw await((b=(g=L(this,jr).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=(E=L(this,jr).config).onSettled)==null?void 0:S.call(E,void 0,A,this.state.variables,this.state.context,this)),await((C=(P=this.options).onSettled)==null?void 0:C.call(P,void 0,A,t,this.state.context)),A}finally{Ge(this,ki,ea).call(this,{type:"error",error:A})}}finally{L(this,jr).runNext(this)}}},Di=new WeakMap,jr=new WeakMap,ks=new WeakMap,ki=new WeakSet,ea=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),Xt.batch(()=>{L(this,Di).forEach(n=>{n.onMutationUpdate(t)}),L(this,jr).notify({mutation:this,type:"updated",action:t})})},bR);function K2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rn,bp,xR,KG=(xR=class extends gc{constructor(t={}){super();Ne(this,rn);Ne(this,bp);this.config=t,xe(this,rn,new Map),xe(this,bp,Date.now())}build(t,r,n){const i=new GG({mutationCache:this,mutationId:++hh(this,bp)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){const r=kh(t),n=L(this,rn).get(r)??[];n.push(t),L(this,rn).set(r,n),this.notify({type:"added",mutation:t})}remove(t){var n;const r=kh(t);if(L(this,rn).has(r)){const i=(n=L(this,rn).get(r))==null?void 0:n.filter(o=>o!==t);i&&(i.length===0?L(this,rn).delete(r):L(this,rn).set(r,i))}this.notify({type:"removed",mutation:t})}canRun(t){var n;const r=(n=L(this,rn).get(kh(t)))==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===t}runNext(t){var n;const r=(n=L(this,rn).get(kh(t)))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){Xt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...L(this,rn).values()].flat()}find(t){const r={exact:!0,...t};return this.getAll().find(n=>s_(r,n))}findAll(t={}){return this.getAll().filter(r=>s_(t,r))}notify(t){Xt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Xt.batch(()=>Promise.all(t.map(r=>r.continue().catch(_n))))}},rn=new WeakMap,bp=new WeakMap,xR);function kh(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function c_(e){return{onFetch:(t,r)=>{var d,c,f,p,m;const n=t.options,i=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.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=V2(t.options,t.fetchOptions),y=async(x,E,S)=>{if(v)return Promise.reject();if(E==null&&x.pages.length)return Promise.resolve(x);const P={queryKey:t.queryKey,pageParam:E,direction:S?"backward":"forward",meta:t.options.meta};g(P);const C=await b(P),{maxPages:A}=t.options,T=S?LG:$G;return{pages:T(x.pages,C,A),pageParams:T(x.pageParams,E,A)}};if(i&&o.length){const x=i==="backward",E=x?qG:d_,S={pages:o,pageParams:a},P=E(n,S);s=await y(S,P,x)}else{const x=e??o.length;do{const E=l===0?a[0]??n.initialPageParam:d_(n,s);if(l>0&&E==null)break;s=await y(s,E),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 d_(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 qG(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 Mt,da,fa,bu,xu,pa,wu,Su,wR,YG=(wR=class{constructor(e={}){Ne(this,Mt);Ne(this,da);Ne(this,fa);Ne(this,bu);Ne(this,xu);Ne(this,pa);Ne(this,wu);Ne(this,Su);xe(this,Mt,e.queryCache||new HG),xe(this,da,e.mutationCache||new KG),xe(this,fa,e.defaultOptions||{}),xe(this,bu,new Map),xe(this,xu,new Map),xe(this,pa,0)}mount(){hh(this,pa)._++,L(this,pa)===1&&(xe(this,wu,zP.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Mt).onFocus())})),xe(this,Su,sv.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,Mt).onOnline())})))}unmount(){var e,t;hh(this,pa)._--,L(this,pa)===0&&((e=L(this,wu))==null||e.call(this),xe(this,wu,void 0),(t=L(this,Su))==null||t.call(this),xe(this,Su,void 0))}isFetching(e){return L(this,Mt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,da).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,Mt).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=L(this,Mt).build(this,r);return e.revalidateIfStale&&n.isStaleByTime(eu(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(t)}}getQueriesData(e){return L(this,Mt).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=L(this,Mt).get(n.queryHash),o=i==null?void 0:i.state.data,a=IG(t,o);if(a!==void 0)return L(this,Mt).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return Xt.batch(()=>L(this,Mt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,Mt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=L(this,Mt);Xt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=L(this,Mt),n={type:"active",...e};return Xt.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=Xt.batch(()=>L(this,Mt).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(_n).catch(_n)}invalidateQueries(e={},t={}){return Xt.batch(()=>{if(L(this,Mt).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=Xt.batch(()=>L(this,Mt).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(_n)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(_n)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=L(this,Mt).build(this,t);return r.isStaleByTime(eu(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(_n).catch(_n)}fetchInfiniteQuery(e){return e.behavior=c_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(_n).catch(_n)}ensureInfiniteQueryData(e){return e.behavior=c_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return sv.isOnline()?L(this,da).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,Mt)}getMutationCache(){return L(this,da)}getDefaultOptions(){return L(this,fa)}setDefaultOptions(e){xe(this,fa,e)}setQueryDefaults(e,t){L(this,bu).set(Xs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,bu).values()];let r={};return t.forEach(n=>{vf(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){L(this,xu).set(Xs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,xu).values()];let r={};return t.forEach(n=>{vf(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,fa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=VP(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===UP&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,fa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,Mt).clear(),L(this,da).clear()}},Mt=new WeakMap,da=new WeakMap,fa=new WeakMap,bu=new WeakMap,xu=new WeakMap,pa=new WeakMap,wu=new WeakMap,Su=new WeakMap,wR),zr,et,xp,Nr,Ms,Eu,ha,Mi,wp,Pu,Cu,Is,Rs,ma,Au,dt,yd,uS,cS,dS,fS,pS,hS,mS,q2,SR,XG=(SR=class extends gc{constructor(t,r){super();Ne(this,dt);Ne(this,zr);Ne(this,et);Ne(this,xp);Ne(this,Nr);Ne(this,Ms);Ne(this,Eu);Ne(this,ha);Ne(this,Mi);Ne(this,wp);Ne(this,Pu);Ne(this,Cu);Ne(this,Is);Ne(this,Rs);Ne(this,ma);Ne(this,Au,new Set);this.options=r,xe(this,zr,t),xe(this,Mi,null),xe(this,ha,lS()),this.options.experimental_prefetchInRender||L(this,ha).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&&(L(this,et).addObserver(this),f_(L(this,et),this.options)?Ge(this,dt,yd).call(this):this.updateResult(),Ge(this,dt,fS).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vS(L(this,et),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vS(L(this,et),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ge(this,dt,pS).call(this),Ge(this,dt,hS).call(this),L(this,et).removeObserver(this)}setOptions(t,r){const n=this.options,i=L(this,et);if(this.options=L(this,zr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ai(this.options.enabled,L(this,et))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ge(this,dt,mS).call(this),L(this,et).setOptions(this.options),n._defaulted&&!av(this.options,n)&&L(this,zr).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,et),observer:this});const o=this.hasListeners();o&&p_(L(this,et),i,this.options,n)&&Ge(this,dt,yd).call(this),this.updateResult(r),o&&(L(this,et)!==i||ai(this.options.enabled,L(this,et))!==ai(n.enabled,L(this,et))||eu(this.options.staleTime,L(this,et))!==eu(n.staleTime,L(this,et)))&&Ge(this,dt,uS).call(this);const a=Ge(this,dt,cS).call(this);o&&(L(this,et)!==i||ai(this.options.enabled,L(this,et))!==ai(n.enabled,L(this,et))||a!==L(this,ma))&&Ge(this,dt,dS).call(this,a)}getOptimisticResult(t){const r=L(this,zr).getQueryCache().build(L(this,zr),t),n=this.createResult(r,t);return QG(this,n)&&(xe(this,Nr,n),xe(this,Eu,this.options),xe(this,Ms,L(this,et).state)),n}getCurrentResult(){return L(this,Nr)}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){L(this,Au).add(t)}getCurrentQuery(){return L(this,et)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=L(this,zr).defaultQueryOptions(t),n=L(this,zr).getQueryCache().build(L(this,zr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ge(this,dt,yd).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,Nr)))}createResult(t,r){var A;const n=L(this,et),i=this.options,o=L(this,Nr),a=L(this,Ms),s=L(this,Eu),u=t!==n?t.state:L(this,xp),{state:d}=t;let c={...d},f=!1,p;if(r._optimisticResults){const T=this.hasListeners(),D=!T&&f_(t,r),N=T&&p_(t,n,r,i);(D||N)&&(c={...c,...G2(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:m,errorUpdatedAt:v,status:g}=c;if(r.select&&c.data!==void 0)if(o&&c.data===(a==null?void 0:a.data)&&r.select===L(this,wp))p=L(this,Pu);else try{xe(this,wp,r.select),p=r.select(c.data),p=sS(o==null?void 0:o.data,p,r),xe(this,Pu,p),xe(this,Mi,null)}catch(T){xe(this,Mi,T)}else p=c.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=L(this,Cu))==null?void 0:A.state.data,L(this,Cu)):r.placeholderData,r.select&&T!==void 0)try{T=r.select(T),xe(this,Mi,null)}catch(D){xe(this,Mi,D)}T!==void 0&&(g="success",p=sS(o==null?void 0:o.data,T,r),f=!0)}L(this,Mi)&&(m=L(this,Mi),p=L(this,Pu),v=Date.now(),g="error");const b=c.fetchStatus==="fetching",y=g==="pending",x=g==="error",E=y&&b,S=p!==void 0,C={status:g,fetchStatus:c.fetchStatus,isPending:y,isSuccess:g==="success",isError:x,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:c.dataUpdatedAt,error:m,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!y,isLoadingError:x&&!S,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&S,isStale:WP(t,r),refetch:this.refetch,promise:L(this,ha)};if(this.options.experimental_prefetchInRender){const T=_=>{C.status==="error"?_.reject(C.error):C.data!==void 0&&_.resolve(C.data)},D=()=>{const _=xe(this,ha,C.promise=lS());T(_)},N=L(this,ha);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=L(this,Nr),n=this.createResult(L(this,et),this.options);if(xe(this,Ms,L(this,et).state),xe(this,Eu,this.options),L(this,Ms).data!==void 0&&xe(this,Cu,L(this,et)),av(n,r))return;xe(this,Nr,n);const i={},o=()=>{if(!r)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!L(this,Au).size)return!0;const l=new Set(s??L(this,Au));return this.options.throwOnError&&l.add("error"),Object.keys(L(this,Nr)).some(u=>{const d=u;return L(this,Nr)[d]!==r[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),Ge(this,dt,q2).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ge(this,dt,fS).call(this)}},zr=new WeakMap,et=new WeakMap,xp=new WeakMap,Nr=new WeakMap,Ms=new WeakMap,Eu=new WeakMap,ha=new WeakMap,Mi=new WeakMap,wp=new WeakMap,Pu=new WeakMap,Cu=new WeakMap,Is=new WeakMap,Rs=new WeakMap,ma=new WeakMap,Au=new WeakMap,dt=new WeakSet,yd=function(t){Ge(this,dt,mS).call(this);let r=L(this,et).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(_n)),r},uS=function(){Ge(this,dt,pS).call(this);const t=eu(this.options.staleTime,L(this,et));if(Ys||L(this,Nr).isStale||!oS(t))return;const n=F2(L(this,Nr).dataUpdatedAt,t)+1;xe(this,Is,setTimeout(()=>{L(this,Nr).isStale||this.updateResult()},n))},cS=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,et)):this.options.refetchInterval)??!1},dS=function(t){Ge(this,dt,hS).call(this),xe(this,ma,t),!(Ys||ai(this.options.enabled,L(this,et))===!1||!oS(L(this,ma))||L(this,ma)===0)&&xe(this,Rs,setInterval(()=>{(this.options.refetchIntervalInBackground||zP.isFocused())&&Ge(this,dt,yd).call(this)},L(this,ma)))},fS=function(){Ge(this,dt,uS).call(this),Ge(this,dt,dS).call(this,Ge(this,dt,cS).call(this))},pS=function(){L(this,Is)&&(clearTimeout(L(this,Is)),xe(this,Is,void 0))},hS=function(){L(this,Rs)&&(clearInterval(L(this,Rs)),xe(this,Rs,void 0))},mS=function(){const t=L(this,zr).getQueryCache().build(L(this,zr),this.options);if(t===L(this,et))return;const r=L(this,et);xe(this,et,t),xe(this,xp,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},q2=function(t){Xt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(L(this,Nr))}),L(this,zr).getQueryCache().notify({query:L(this,et),type:"observerResultsUpdated"})})},SR);function ZG(e,t){return ai(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function f_(e,t){return ZG(e,t)||e.state.data!==void 0&&vS(e,t,t.refetchOnMount)}function vS(e,t,r){if(ai(t.enabled,e)!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&WP(e,t)}return!1}function p_(e,t,r,n){return(e!==t||ai(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&WP(e,r)}function WP(e,t){return ai(t.enabled,e)!==!1&&e.isStaleByTime(eu(t.staleTime,e))}function QG(e,t){return!av(e.getCurrentResult(),t)}var va,ga,Wr,uo,Ao,Em,gS,ER,JG=(ER=class extends gc{constructor(r,n){super();Ne(this,Ao);Ne(this,va);Ne(this,ga);Ne(this,Wr);Ne(this,uo);xe(this,va,r),this.setOptions(n),this.bindMethods(),Ge(this,Ao,Em).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=L(this,va).defaultMutationOptions(r),av(this.options,n)||L(this,va).getMutationCache().notify({type:"observerOptionsUpdated",mutation:L(this,Wr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Xs(n.mutationKey)!==Xs(this.options.mutationKey)?this.reset():((i=L(this,Wr))==null?void 0:i.state.status)==="pending"&&L(this,Wr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=L(this,Wr))==null||r.removeObserver(this)}onMutationUpdate(r){Ge(this,Ao,Em).call(this),Ge(this,Ao,gS).call(this,r)}getCurrentResult(){return L(this,ga)}reset(){var r;(r=L(this,Wr))==null||r.removeObserver(this),xe(this,Wr,void 0),Ge(this,Ao,Em).call(this),Ge(this,Ao,gS).call(this)}mutate(r,n){var i;return xe(this,uo,n),(i=L(this,Wr))==null||i.removeObserver(this),xe(this,Wr,L(this,va).getMutationCache().build(L(this,va),this.options)),L(this,Wr).addObserver(this),L(this,Wr).execute(r)}},va=new WeakMap,ga=new WeakMap,Wr=new WeakMap,uo=new WeakMap,Ao=new WeakSet,Em=function(){var n;const r=((n=L(this,Wr))==null?void 0:n.state)??K2();xe(this,ga,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},gS=function(r){Xt.batch(()=>{var n,i,o,a,s,l,u,d;if(L(this,uo)&&this.hasListeners()){const c=L(this,ga).variables,f=L(this,ga).context;(r==null?void 0:r.type)==="success"?((i=(n=L(this,uo)).onSuccess)==null||i.call(n,r.data,c,f),(a=(o=L(this,uo)).onSettled)==null||a.call(o,r.data,null,c,f)):(r==null?void 0:r.type)==="error"&&((l=(s=L(this,uo)).onError)==null||l.call(s,r.error,c,f),(d=(u=L(this,uo)).onSettled)==null||d.call(u,void 0,r.error,c,f))}this.listeners.forEach(c=>{c(L(this,ga))})})},ER),Y2=w.createContext(void 0),Tp=e=>{const t=w.useContext(Y2);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},e9=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(Y2.Provider,{value:e,children:t})),X2=w.createContext(!1),t9=()=>w.useContext(X2);X2.Provider;function r9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var n9=w.createContext(r9()),i9=()=>w.useContext(n9);function Z2(e,t){return typeof e=="function"?e(...t):!!e}function yS(){}var o9=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},a9=e=>{w.useEffect(()=>{e.clearReset()},[e])},s9=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&Z2(r,[e.error,n]),l9=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},u9=(e,t)=>e.isLoading&&e.isFetching&&!t,c9=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,h_=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function d9(e,t,r){var d,c,f,p,m;const n=Tp(),i=t9(),o=i9(),a=n.defaultQueryOptions(e);(c=(d=n.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||c.call(d,a),a._optimisticResults=i?"isRestoring":"optimistic",l9(a),o9(a,o),a9(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?yS:l.subscribe(Xt.batchCalls(v));return l.updateResult(),g},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(a,{listeners:!1})},[a,l]),c9(a,u))throw h_(a,l,o);if(s9({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&&!Ys&&u9(u,i)){const v=s?h_(a,l,o):(m=n.getQueryCache().get(a.queryHash))==null?void 0:m.promise;v==null||v.catch(yS).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?u:l.trackResult(u)}function Q2(e,t){return d9(e,XG)}function tu(e,t){const r=Tp(),[n]=w.useState(()=>new JG(r,e));w.useEffect(()=>{n.setOptions(e)},[n,e]);const i=w.useSyncExternalStore(w.useCallback(a=>n.subscribe(Xt.batchCalls(a)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=w.useCallback((a,s)=>{n.mutate(a,s).catch(yS)},[n]);if(i.error&&Z2(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}var f9=typeof Element<"u",p9=typeof Map=="function",h9=typeof Set=="function",m9=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Pm(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(!Pm(e[n],t[n]))return!1;return!0}var o;if(p9&&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(!Pm(n.value[1],t.get(n.value[0])))return!1;return!0}if(h9&&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(m9&&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(f9&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!Pm(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var v9=function(t,r){try{return Pm(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 g9=ut(v9);var y9=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],d=0;l=new Error(t.replace(/%s/g,function(){return u[d++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},b9=y9;const m_=ut(b9);var x9=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))(J2||{}),Ux={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"]}},v_=Object.values(J2),HP={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},S9=Object.entries(HP).reduce((e,[t,r])=>(e[r]=t,e),{}),ci="data-rh",ru={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},nu=(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},E9=e=>{let t=nu(e,"title");const r=nu(e,ru.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=nu(e,ru.DEFAULT_TITLE);return t||n||void 0},P9=e=>nu(e,ru.ON_CHANGE_CLIENT_STATE)||(()=>{}),zx=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),C9=(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),qc=(e,t,r)=>{const n={};return r.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&A9(`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 d=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:C9(["href"],e),bodyAttributes:zx("bodyAttributes",e),defer:nu(e,ru.DEFER),encode:nu(e,ru.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:zx("htmlAttributes",e),linkTags:qc("link",["rel","href"],e),metaTags:qc("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:qc("noscript",["innerHTML"],e),onChangeClientState:P9(e),scriptTags:qc("script",["src","innerHTML"],e),styleTags:qc("style",["cssText"],e),title:E9(e),titleAttributes:zx("titleAttributes",e),prioritizeSeoTags:T9(e,ru.PRIORITIZE_SEO_TAGS)}),eL=e=>Array.isArray(e)?e.join(""):e,_9=(e,t)=>{const r=Object.keys(e);for(let n=0;nArray.isArray(e)?e.reduce((r,n)=>(_9(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},g_=(e,t)=>({...e,[t]:void 0}),j9=["noscript","script","style"],bS=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),tL=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),N9=(e,t,r,n)=>{const i=tL(r),o=eL(t);return i?`<${e} ${ci}="true" ${i}>${bS(o,n)}`:`<${e} ${ci}="true">${bS(o,n)}`},D9=(e,t,r=!0)=>t.reduce((n,i)=>{const o=i,a=Object.keys(o).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const c=typeof o[d]>"u"?d:`${d}="${bS(o[d],r)}"`;return u?`${u} ${c}`:c},""),s=o.innerHTML||o.cssText||"",l=j9.indexOf(e)===-1;return`${n}<${e} ${ci}="true" ${a}${l?"/>":`>${s}`}`},""),rL=(e,t={})=>Object.keys(e).reduce((r,n)=>{const i=HP[n];return r[i||n]=e[n],r},t),k9=(e,t,r)=>{const n={key:t,[ci]:!0},i=rL(r,n);return[M.createElement("title",i,t)]},Cm=(e,t)=>t.map((r,n)=>{const i={key:n,[ci]:!0};return Object.keys(r).forEach(o=>{const s=HP[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)}),Tn=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>k9(e,t.title,t.titleAttributes),toString:()=>N9(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>rL(t),toString:()=>tL(t)};default:return{toComponent:()=>Cm(e,t),toString:()=>D9(e,t,r)}}},M9=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const i=Wx(e,Ux.meta),o=Wx(t,Ux.link),a=Wx(r,Ux.script);return{priorityMethods:{toComponent:()=>[...Cm("meta",i.priority),...Cm("link",o.priority),...Cm("script",a.priority)],toString:()=>`${Tn("meta",i.priority,n)} ${Tn("link",o.priority,n)} ${Tn("script",a.priority,n)}`},metaTags:i.default,linkTags:o.default,scriptTags:a.default}},I9=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:i,noscriptTags:o,styleTags:a,title:s="",titleAttributes:l,prioritizeSeoTags:u}=e;let{linkTags:d,metaTags:c,scriptTags:f}=e,p={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:p,linkTags:d,metaTags:c,scriptTags:f}=M9(e)),{priority:p,base:Tn("base",t,n),bodyAttributes:Tn("bodyAttributes",r,n),htmlAttributes:Tn("htmlAttributes",i,n),link:Tn("link",d,n),meta:Tn("meta",c,n),noscript:Tn("noscript",o,n),script:Tn("script",f,n),style:Tn("style",a,n),title:Tn("title",{title:s,titleAttributes:l},n)}},xS=I9,Mh=[],nL=!!(typeof window<"u"&&window.document&&window.document.createElement),wS=class{constructor(e,t){to(this,"instances",[]);to(this,"canUseDOM",nL);to(this,"context");to(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Mh:this.instances,add:e=>{(this.canUseDOM?Mh:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Mh:this.instances).indexOf(e);(this.canUseDOM?Mh:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=xS({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},R9={},iL=M.createContext(R9),$s,oL=($s=class extends w.Component{constructor(r){super(r);to(this,"helmetData");this.helmetData=new wS(this.props.context||{},$s.canUseDOM)}render(){return M.createElement(iL.Provider,{value:this.helmetData.value},this.props.children)}},to($s,"canUseDOM",nL),$s),gl=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${ci}]`),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 d=u,c=typeof s[d]>"u"?"":s[d];l.setAttribute(u,c)}l.setAttribute(ci,"true"),i.some((u,d)=>(a=d,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}},SS=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(ci),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(ci):r.getAttribute(ci)!==a.join(",")&&r.setAttribute(ci,a.join(","))},$9=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=eL(e)),SS("title",t)},y_=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:i,linkTags:o,metaTags:a,noscriptTags:s,onChangeClientState:l,scriptTags:u,styleTags:d,title:c,titleAttributes:f}=e;SS("body",n),SS("html",i),$9(c,f);const p={baseTag:gl("base",r),linkTags:gl("link",o),metaTags:gl("meta",a),noscriptTags:gl("noscript",s),scriptTags:gl("script",u),styleTags:gl("style",d)},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)},Yc=null,L9=e=>{Yc&&cancelAnimationFrame(Yc),e.defer?Yc=requestAnimationFrame(()=>{y_(e,()=>{Yc=null})}):(y_(e),Yc=null)},F9=L9,b_=class extends w.Component{constructor(){super(...arguments);to(this,"rendered",!1)}shouldComponentUpdate(t){return!w9(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=O9(t.get().map(o=>{const a={...o.props};return delete a.context,a}));oL.canUseDOM?F9(i):xS&&(n=xS(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}},fw,aL=(fw=class extends w.Component{shouldComponentUpdate(e){return!g9(g_(this.props,"helmetData"),g_(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 m_(v_.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 ${v_.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),m_(!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[S9[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 wS)){const i=n;n=new wS(i.context,!0),delete r.helmetData}return n?M.createElement(b_,{...r,context:n.value}):M.createElement(iL.Consumer,null,i=>M.createElement(b_,{...r,context:i}))}},to(fw,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),fw);function B9(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 sL={exports:{}},lL={};/** * @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 Mu=w;function V9(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var U9=typeof Object.is=="function"?Object.is:V9,z9=Mu.useState,W9=Mu.useEffect,H9=Mu.useLayoutEffect,G9=Mu.useDebugValue;function K9(e,t){var r=t(),n=z9({inst:{value:r,getSnapshot:t}}),i=n[0].inst,o=n[1];return H9(function(){i.value=r,i.getSnapshot=t,Hx(i)&&o({inst:i})},[e,r,t]),W9(function(){return Hx(i)&&o({inst:i}),e(function(){Hx(i)&&o({inst:i})})},[e]),G9(r),r}function Hx(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!U9(e,r)}catch{return!0}}function q9(e,t){return t()}var Y9=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?q9:K9;lL.useSyncExternalStore=Mu.useSyncExternalStore!==void 0?Mu.useSyncExternalStore:Y9;sL.exports=lL;var X9=sL.exports;const Z9=MR.useInsertionEffect,Q9=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",J9=Q9?w.useLayoutEffect:w.useEffect,eK=Z9||J9,uL=e=>{const t=w.useRef([e,(...r)=>t[0](...r)]).current;return eK(()=>{t[0]=e}),t[1]},tK="popstate",GP="pushState",KP="replaceState",rK="hashchange",x_=[tK,GP,KP,rK],nK=e=>{for(const t of x_)addEventListener(t,e);return()=>{for(const t of x_)removeEventListener(t,e)}},cL=(e,t)=>X9.useSyncExternalStore(nK,e,t),iK=()=>location.search,oK=({ssrSearch:e=""}={})=>cL(iK,()=>e),w_=()=>location.pathname,aK=({ssrPath:e}={})=>cL(w_,e?()=>e:w_),sK=(e,{replace:t=!1,state:r=null}={})=>history[t?KP:GP](r,"",e),lK=(e={})=>[aK(e),sK],S_=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[S_]>"u"){for(const e of[GP,KP]){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,S_,{value:!0})}const uK=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",dL=(e="")=>e==="/"?"":e,cK=(e,t)=>e[0]==="~"?e.slice(1):dL(t)+e,dK=(e="",t)=>uK(E_(dL(e)),E_(t)),E_=e=>{try{return decodeURI(e)}catch{return e}},fL={hook:lK,searchHook:oK,parser:B9,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},pL=w.createContext(fL),Op=()=>w.useContext(pL),hL={},mL=w.createContext(hL),fK=()=>w.useContext(mL),my=e=>{const[t,r]=e.hook(e);return[dK(e.base,t),uL((n,i)=>r(cK(n,e.base),i))]},vy=()=>my(Op()),vL=(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((c,f)=>[c,l[f]])):a.groups;let d={...l};return u&&Object.assign(d,u),d})(),...n?[s]:[]]:[!1,null]},gL=({children:e,...t})=>{var d,c;const r=Op(),n=t.hook?fL:r;let i=n;const[o,a]=((d=t.ssrPath)==null?void 0:d.split("?"))??[];a&&(t.ssrSearch=a,t.ssrPath=o),t.hrefs=t.hrefs??((c=t.hook)==null?void 0:c.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(pL.Provider,{value:i,children:e})},P_=({children:e,component:t},r)=>t?w.createElement(t,{params:r}):typeof e=="function"?e(r):e,pK=e=>{let t=w.useRef(hL),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},Xn=({path:e,nest:t,match:r,...n})=>{const i=Op(),[o]=my(i),[a,s,l]=r??vL(i.parser,e,o,t),u=pK({...fK(),...s});if(!a)return null;const d=l?w.createElement(gL,{base:l},P_(n,u)):P_(n,u);return w.createElement(mL.Provider,{value:u,children:d})},_a=w.forwardRef((e,t)=>{const r=Op(),[n,i]=my(r),{to:o="",href:a=o,onClick:s,asChild:l,children:u,className:d,replace:c,state:f,...p}=e,m=uL(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:d!=null&&d.call?d(n===a):d,children:u,ref:t})}),yL=e=>Array.isArray(e)?e.flatMap(t=>yL(t&&t.type===w.Fragment?t.props.children:t)):[e],C_=({children:e,location:t})=>{const r=Op(),[n]=my(r);for(const i of yL(e)){let o=0;if(w.isValidElement(i)&&(o=vL(r.parser,i.props.path,t||n,i.props.nest))[0])return w.cloneElement(i,{match:o})}return null},hK=new YG({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}}}),mK=1,vK=1e6;let Gx=0;function gK(){return Gx=(Gx+1)%Number.MAX_SAFE_INTEGER,Gx.toString()}const Kx=new Map,A_=e=>{if(Kx.has(e))return;const t=setTimeout(()=>{Kx.delete(e),$d({type:"REMOVE_TOAST",toastId:e})},vK);Kx.set(e,t)},yK=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,mK)};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?A_(r):e.toasts.forEach(n=>{A_(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)}}},Am=[];let Tm={toasts:[]};function $d(e){Tm=yK(Tm,e),Am.forEach(t=>{t(Tm)})}function bK({...e}){const t=gK(),r=i=>$d({type:"UPDATE_TOAST",toast:{...i,id:t}}),n=()=>$d({type:"DISMISS_TOAST",toastId:t});return $d({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function _p(){const[e,t]=w.useState(Tm);return w.useEffect(()=>(Am.push(t),()=>{const r=Am.indexOf(t);r>-1&&Am.splice(r,1)}),[e]),{...e,toast:bK,dismiss:r=>$d({type:"DISMISS_TOAST",toastId:r})}}function Ee(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 xK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function gy(...e){return t=>e.forEach(r=>xK(r,t))}function lt(...e){return w.useCallback(gy(...e),e)}function wK(e,t=[]){let r=[];function n(o,a){const s=w.createContext(a),l=r.length;r=[...r,a];function u(c){const{scope:f,children:p,...m}=c,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 d(c,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(`\`${c}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}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,SK(i,...t)]}function SK(...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 c=l(o)[`__scope${u}`];return{...s,...c}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var No=w.forwardRef((e,t)=>{const{children:r,...n}=e,i=w.Children.toArray(r),o=i.find(EK);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(ES,{...n,ref:t,children:w.isValidElement(a)?w.cloneElement(a,void 0,s):null})}return h.jsx(ES,{...n,ref:t,children:r})});No.displayName="Slot";var ES=w.forwardRef((e,t)=>{const{children:r,...n}=e;if(w.isValidElement(r)){const i=CK(r);return w.cloneElement(r,{...PK(n,r.props),ref:t?gy(t,i):i})}return w.Children.count(r)>1?w.Children.only(null):null});ES.displayName="SlotClone";var bL=({children:e})=>h.jsx(h.Fragment,{children:e});function EK(e){return w.isValidElement(e)&&e.type===bL}function PK(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 CK(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 yy(e){const t=e+"CollectionProvider",[r,n]=wK(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=lt(m,b.collectionRef);return h.jsx(No,{ref:y,children:g})});l.displayName=s;const u=e+"CollectionItemSlot",d="data-radix-collection-item",c=M.forwardRef((p,m)=>{const{scope:v,children:g,...b}=p,y=M.useRef(null),x=lt(m,y),E=o(u,v);return M.useEffect(()=>(E.itemMap.set(y,{ref:y,...b}),()=>void E.itemMap.delete(y))),h.jsx(No,{[d]:"",ref:x,children:g})});c.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(`[${d}]`));return Array.from(m.itemMap.values()).sort((E,S)=>b.indexOf(E.ref.current)-b.indexOf(S.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:a,Slot:l,ItemSlot:c},f,n]}function AK(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 yc(e,t=[]){let r=[];function n(o,a){const s=w.createContext(a),l=r.length;r=[...r,a];const u=c=>{var b;const{scope:f,children:p,...m}=c,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 d(c,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(`\`${c}\` must be used within \`${o}\``)}return[u,d]}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,TK(i,...t)]}function TK(...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 c=l(o)[`__scope${u}`];return{...s,...c}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var OK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ke=OK.reduce((e,t)=>{const r=w.forwardRef((n,i)=>{const{asChild:o,...a}=n,s=o?No: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 qP(e,t){e&&Xa.flushSync(()=>e.dispatchEvent(t))}function Ar(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 _K(e,t=globalThis==null?void 0:globalThis.document){const r=Ar(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 jK="DismissableLayer",PS="dismissableLayer.update",NK="dismissableLayer.pointerDownOutside",DK="dismissableLayer.focusOutside",T_,xL=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jp=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=e,u=w.useContext(xL),[d,c]=w.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=w.useState({}),m=lt(t,C=>c(C)),v=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(g),y=d?v.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,E=y>=b,S=MK(C=>{const A=C.target,T=[...u.branches].some(D=>D.contains(A));!E||T||(i==null||i(C),a==null||a(C),C.defaultPrevented||s==null||s())},f),P=IK(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 _K(C=>{y===u.layers.size-1&&(n==null||n(C),!C.defaultPrevented&&s&&(C.preventDefault(),s()))},f),w.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(T_=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),O_(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=T_)}},[d,f,r,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),O_())},[d,u]),w.useEffect(()=>{const C=()=>p({});return document.addEventListener(PS,C),()=>document.removeEventListener(PS,C)},[]),h.jsx(Ke.div,{...l,ref:m,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:Ee(e.onFocusCapture,P.onFocusCapture),onBlurCapture:Ee(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:Ee(e.onPointerDownCapture,S.onPointerDownCapture)})});jp.displayName=jK;var kK="DismissableLayerBranch",wL=w.forwardRef((e,t)=>{const r=w.useContext(xL),n=w.useRef(null),i=lt(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})});wL.displayName=kK;function MK(e,t=globalThis==null?void 0:globalThis.document){const r=Ar(e),n=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!n.current){let l=function(){SL(NK,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 IK(e,t=globalThis==null?void 0:globalThis.document){const r=Ar(e),n=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!n.current&&SL(DK,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 O_(){const e=new CustomEvent(PS);document.dispatchEvent(e)}function SL(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?qP(i,o):i.dispatchEvent(o)}var RK=jp,$K=wL,Tr=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},LK="Portal",Np=w.forwardRef((e,t)=>{var s;const{container:r,...n}=e,[i,o]=w.useState(!1);Tr(()=>o(!0),[]);const a=r||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?$2.createPortal(h.jsx(Ke.div,{...n,ref:t}),a):null});Np.displayName=LK;function FK(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var Uo=e=>{const{present:t,children:r}=e,n=BK(t),i=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),o=lt(n.ref,VK(i));return typeof r=="function"||n.isPresent?w.cloneElement(i,{ref:o}):null};Uo.displayName="Presence";function BK(e){const[t,r]=w.useState(),n=w.useRef({}),i=w.useRef(e),o=w.useRef("none"),a=e?"mounted":"unmounted",[s,l]=FK(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=Ih(n.current);o.current=s==="mounted"?u:"none"},[s]),Tr(()=>{const u=n.current,d=i.current;if(d!==e){const f=o.current,p=Ih(u);e?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Tr(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=p=>{const v=Ih(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=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},f=p=>{p.target===t&&(o.current=Ih(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function Ih(e){return(e==null?void 0:e.animationName)||"none"}function VK(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 Iu({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,i]=UK({defaultProp:t,onChange:r}),o=e!==void 0,a=o?e:n,s=Ar(r),l=w.useCallback(u=>{if(o){const c=typeof u=="function"?u(e):u;c!==e&&s(c)}else i(u)},[o,e,i,s]);return[a,l]}function UK({defaultProp:e,onChange:t}){const r=w.useState(e),[n]=r,i=w.useRef(n),o=Ar(t);return w.useEffect(()=>{i.current!==n&&(o(n),i.current=n)},[n,i,o]),r}var zK="VisuallyHidden",by=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}}));by.displayName=zK;var YP="ToastProvider",[XP,WK,HK]=yy("Toast"),[EL,uIe]=yc("Toast",[HK]),[GK,xy]=EL(YP),PL=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,d]=w.useState(0),c=w.useRef(!1),f=w.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${YP}\`. Expected non-empty \`string\`.`),h.jsx(XP.Provider,{scope:t,children:h.jsx(GK,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:o,toastCount:u,viewport:s,onViewportChange:l,onToastAdd:w.useCallback(()=>d(p=>p+1),[]),onToastRemove:w.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:c,isClosePausedRef:f,children:a})})};PL.displayName=YP;var CL="ToastViewport",KK=["F8"],CS="toast.viewportPause",AS="toast.viewportResume",AL=w.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=KK,label:i="Notifications ({hotkey})",...o}=e,a=xy(CL,r),s=WK(r),l=w.useRef(null),u=w.useRef(null),d=w.useRef(null),c=w.useRef(null),f=lt(t,c,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(E=>b[E]||b.code===E)&&((x=c.current)==null||x.focus())};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[n]),w.useEffect(()=>{const g=l.current,b=c.current;if(m&&g&&b){const y=()=>{if(!a.isClosePausedRef.current){const P=new CustomEvent(CS);b.dispatchEvent(P),a.isClosePausedRef.current=!0}},x=()=>{if(a.isClosePausedRef.current){const P=new CustomEvent(AS);b.dispatchEvent(P),a.isClosePausedRef.current=!1}},E=P=>{!g.contains(P.relatedTarget)&&x()},S=()=>{g.contains(document.activeElement)||x()};return g.addEventListener("focusin",y),g.addEventListener("focusout",E),g.addEventListener("pointermove",y),g.addEventListener("pointerleave",S),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{g.removeEventListener("focusin",y),g.removeEventListener("focusout",E),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 E=x.ref.current,S=[E,...aq(E)];return g==="forwards"?S:S.reverse()});return(g==="forwards"?y.reverse():y).flat()},[s]);return w.useEffect(()=>{const g=c.current;if(g){const b=y=>{var S,P,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 _=v({tabbingDirection:T?"backwards":"forwards"}),F=_.findIndex(k=>k===A);qx(_.slice(F+1))?y.preventDefault():T?(P=u.current)==null||P.focus():(C=d.current)==null||C.focus()}};return g.addEventListener("keydown",b),()=>g.removeEventListener("keydown",b)}},[s,v]),h.jsxs($K,{ref:l,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:m?void 0:"none"},children:[m&&h.jsx(TS,{ref:u,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"forwards"});qx(g)}}),h.jsx(XP.Slot,{scope:r,children:h.jsx(Ke.ol,{tabIndex:-1,...o,ref:f})}),m&&h.jsx(TS,{ref:d,onFocusFromOutsideViewport:()=>{const g=v({tabbingDirection:"backwards"});qx(g)}})]})});AL.displayName=CL;var TL="ToastFocusProxy",TS=w.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,o=xy(TL,r);return h.jsx(by,{"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()}})});TS.displayName=TL;var wy="Toast",qK="toast.swipeStart",YK="toast.swipeMove",XK="toast.swipeCancel",ZK="toast.swipeEnd",OL=w.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:o,...a}=e,[s=!0,l]=Iu({prop:n,defaultProp:i,onChange:o});return h.jsx(Uo,{present:r||s,children:h.jsx(eq,{open:s,...a,ref:t,onClose:()=>l(!1),onPause:Ar(e.onPause),onResume:Ar(e.onResume),onSwipeStart:Ee(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ee(e.onSwipeMove,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${c}px`)}),onSwipeCancel:Ee(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:Ee(e.onSwipeEnd,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${c}px`),l(!1)})})})});OL.displayName=wy;var[QK,JK]=EL(wy,{onClose(){}}),eq=w.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:o,onClose:a,onEscapeKeyDown:s,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:c,onSwipeCancel:f,onSwipeEnd:p,...m}=e,v=xy(wy,r),[g,b]=w.useState(null),y=lt(t,k=>b(k)),x=w.useRef(null),E=w.useRef(null),S=i||v.duration,P=w.useRef(0),C=w.useRef(S),A=w.useRef(0),{onToastAdd:T,onToastRemove:D}=v,N=Ar(()=>{var B;(g==null?void 0:g.contains(document.activeElement))&&((B=v.viewport)==null||B.focus()),a()}),_=w.useCallback(k=>{!k||k===1/0||(window.clearTimeout(A.current),P.current=new Date().getTime(),A.current=window.setTimeout(N,k))},[N]);w.useEffect(()=>{const k=v.viewport;if(k){const B=()=>{_(C.current),u==null||u()},V=()=>{const z=new Date().getTime()-P.current;C.current=C.current-z,window.clearTimeout(A.current),l==null||l()};return k.addEventListener(CS,V),k.addEventListener(AS,B),()=>{k.removeEventListener(CS,V),k.removeEventListener(AS,B)}}},[v.viewport,S,l,u,_]),w.useEffect(()=>{o&&!v.isClosePausedRef.current&&_(S)},[o,S,v.isClosePausedRef,_]),w.useEffect(()=>(T(),()=>D()),[T,D]);const F=w.useMemo(()=>g?IL(g):null,[g]);return v.viewport?h.jsxs(h.Fragment,{children:[F&&h.jsx(tq,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:F}),h.jsx(QK,{scope:r,onClose:N,children:Xa.createPortal(h.jsx(XP.ItemSlot,{scope:r,children:h.jsx(RK,{asChild:!0,onEscapeKeyDown:Ee(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:Ee(e.onKeyDown,k=>{k.key==="Escape"&&(s==null||s(k.nativeEvent),k.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:Ee(e.onPointerDown,k=>{k.button===0&&(x.current={x:k.clientX,y:k.clientY})}),onPointerMove:Ee(e.onPointerMove,k=>{if(!x.current)return;const B=k.clientX-x.current.x,V=k.clientY-x.current.y,z=!!E.current,I=["left","right"].includes(v.swipeDirection),$=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,j=I?$(0,B):0,O=I?0:$(0,V),U=k.pointerType==="touch"?10:2,Y={x:j,y:O},re={originalEvent:k,delta:Y};z?(E.current=Y,Rh(YK,c,re,{discrete:!1})):__(Y,v.swipeDirection,U)?(E.current=Y,Rh(qK,d,re,{discrete:!1}),k.target.setPointerCapture(k.pointerId)):(Math.abs(B)>U||Math.abs(V)>U)&&(x.current=null)}),onPointerUp:Ee(e.onPointerUp,k=>{const B=E.current,V=k.target;if(V.hasPointerCapture(k.pointerId)&&V.releasePointerCapture(k.pointerId),E.current=null,x.current=null,B){const z=k.currentTarget,I={originalEvent:k,delta:B};__(B,v.swipeDirection,v.swipeThreshold)?Rh(ZK,p,I,{discrete:!0}):Rh(XK,f,I,{discrete:!0}),z.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),tq=e=>{const{__scopeToast:t,children:r,...n}=e,i=xy(wy,t),[o,a]=w.useState(!1),[s,l]=w.useState(!1);return iq(()=>a(!0)),w.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),s?null:h.jsx(Np,{asChild:!0,children:h.jsx(by,{...n,children:o&&h.jsxs(h.Fragment,{children:[i.label," ",r]})})})},rq="ToastTitle",_L=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return h.jsx(Ke.div,{...n,ref:t})});_L.displayName=rq;var nq="ToastDescription",jL=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return h.jsx(Ke.div,{...n,ref:t})});jL.displayName=nq;var NL="ToastAction",DL=w.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?h.jsx(ML,{altText:r,asChild:!0,children:h.jsx(ZP,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${NL}\`. Expected non-empty \`string\`.`),null)});DL.displayName=NL;var kL="ToastClose",ZP=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=JK(kL,r);return h.jsx(ML,{asChild:!0,children:h.jsx(Ke.button,{type:"button",...n,ref:t,onClick:Ee(e.onClick,i.onClose)})})});ZP.displayName=kL;var ML=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 IL(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),oq(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(...IL(n))}}),t}function Rh(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?qP(i,o):i.dispatchEvent(o)}var __=(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 iq(e=()=>{}){const t=Ar(e);Tr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function oq(e){return e.nodeType===e.ELEMENT_NODE}function aq(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 qx(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var sq=PL,RL=AL,$L=OL,LL=_L,FL=jL,BL=DL,VL=ZP;function UL(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,N_=lq,Sy=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return N_(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 d=r==null?void 0:r[u],c=o==null?void 0:o[u];if(d===null)return null;const f=j_(d)||j_(c);return i[u][f]}),s=r&&Object.entries(r).reduce((u,d)=>{let[c,f]=d;return f===void 0||(u[c]=f),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:c,className:f,...p}=d;return Object.entries(p).every(m=>{let[v,g]=m;return Array.isArray(g)?g.includes({...o,...s}[v]):{...o,...s}[v]===g})?[...u,c,f]:u},[]);return N_(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 uq=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zL=(...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 cq={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 dq=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,...cq,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:zL("lucide",i),...s},[...a.map(([u,d])=>w.createElement(u,d)),...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 Ze=(e,t)=>{const r=w.forwardRef(({className:n,...i},o)=>w.createElement(dq,{ref:o,iconNode:t,className:zL(`lucide-${uq(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 fq=Ze("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 Yx=Ze("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 WL=Ze("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 pq=Ze("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 hq=Ze("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 xi=Ze("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 Ey=Ze("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 mq=Ze("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 vq=Ze("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 gq=Ze("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 yq=Ze("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 bq=Ze("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 xq=Ze("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 lv=Ze("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 wq=Ze("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 HL=Ze("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 GL=Ze("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 Sq=Ze("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 po=Ze("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 Eq=Ze("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 KL=Ze("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 OS=Ze("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 iu=Ze("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 Pq=Ze("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 Cq=Ze("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 Aq=Ze("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 Tq=Ze("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 uv=Ze("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 qL=Ze("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 gf=Ze("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 D_=Ze("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 QP=Ze("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 Oq=Ze("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=Ze("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 jq=Ze("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 YL=Ze("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 k_=Ze("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 XL(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=kq(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const s=a.split(JP);return s[0]===""&&s.length!==1&&s.shift(),ZL(s,t)||Dq(a)},getConflictingClassGroupIds:(a,s)=>{const l=r[a]||[];return s&&n[a]?[...l,...n[a]]:l}}},ZL=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?ZL(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(JP);return(a=t.validators.find(({validator:s})=>s(o)))==null?void 0:a.classGroupId},M_=/^\[(.+)\]$/,Dq=e=>{if(M_.test(e)){const t=M_.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},kq=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Iq(Object.entries(e.classGroups),r).forEach(([o,a])=>{_S(a,n,o,t)}),n},_S=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:I_(t,i);o.classGroupId=r;return}if(typeof i=="function"){if(Mq(i)){_S(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([o,a])=>{_S(a,I_(t,o),r,n)})})},I_=(e,t)=>{let r=e;return t.split(JP).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Mq=e=>e.isThemeGetter,Iq=(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,Rq=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)}}},QL="!",$q=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],o=t.length,a=s=>{const l=[];let u=0,d=0,c;for(let g=0;gd?c-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:v}};return r?s=>r({className:s,parseClassName:a}):a},Lq=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},Fq=e=>({cache:Rq(e.cacheSize),parseClassName:$q(e),...Nq(e)}),Bq=/\s+/,Vq=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,o=[],a=e.trim().split(Bq);let s="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:d,hasImportantModifier:c,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=Lq(d).join(":"),b=c?g+QL:g,y=b+v;if(o.includes(y))continue;o.push(y);const x=i(v,m);for(let E=0;E0?" "+s:s)}return s};function Uq(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nc(d),e());return r=Fq(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 d=Vq(l,r);return i(l,d),d}return function(){return o(Uq.apply(null,arguments))}}const wt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},eF=/^\[(?:([a-z-]+):)?(.+)\]$/i,Wq=/^\d+\/\d+$/,Hq=new Set(["px","full","screen"]),Gq=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kq=/\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$/,qq=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Yq=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Xq=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ro=e=>ou(e)||Hq.has(e)||Wq.test(e),Qo=e=>bc(e,"length",i7),ou=e=>!!e&&!Number.isNaN(Number(e)),Xx=e=>bc(e,"number",ou),Xc=e=>!!e&&Number.isInteger(Number(e)),Zq=e=>e.endsWith("%")&&ou(e.slice(0,-1)),We=e=>eF.test(e),Jo=e=>Gq.test(e),Qq=new Set(["length","size","percentage"]),Jq=e=>bc(e,Qq,tF),e7=e=>bc(e,"position",tF),t7=new Set(["image","url"]),r7=e=>bc(e,t7,a7),n7=e=>bc(e,"",o7),Zc=()=>!0,bc=(e,t,r)=>{const n=eF.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},i7=e=>Kq.test(e)&&!qq.test(e),tF=()=>!1,o7=e=>Yq.test(e),a7=e=>Xq.test(e),s7=()=>{const e=wt("colors"),t=wt("spacing"),r=wt("blur"),n=wt("brightness"),i=wt("borderColor"),o=wt("borderRadius"),a=wt("borderSpacing"),s=wt("borderWidth"),l=wt("contrast"),u=wt("grayscale"),d=wt("hueRotate"),c=wt("invert"),f=wt("gap"),p=wt("gradientColorStops"),m=wt("gradientColorStopPositions"),v=wt("inset"),g=wt("margin"),b=wt("opacity"),y=wt("padding"),x=wt("saturate"),E=wt("scale"),S=wt("sepia"),P=wt("skew"),C=wt("space"),A=wt("translate"),T=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",We,t],_=()=>[We,t],F=()=>["",ro,Qo],k=()=>["auto",ou,We],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],V=()=>["solid","dashed","dotted","double","none"],z=()=>["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],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[ou,We];return{cacheSize:500,separator:":",theme:{colors:[Zc],spacing:[ro,Qo],blur:["none","",Jo,We],brightness:O(),borderColor:[e],borderRadius:["none","","full",Jo,We],borderSpacing:_(),borderWidth:F(),contrast:O(),grayscale:$(),hueRotate:O(),invert:$(),gap:_(),gradientColorStops:[e],gradientColorStopPositions:[Zq,Qo],inset:N(),margin:N(),opacity:O(),padding:_(),saturate:O(),scale:O(),sepia:$(),skew:O(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",We]}],container:["container"],columns:[{columns:[Jo]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"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:[...B(),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",Xc,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",Xc,We]}],"grid-cols":[{"grid-cols":[Zc]}],"col-start-end":[{col:["auto",{span:["full",Xc,We]},We]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Zc]}],"row-start-end":[{row:["auto",{span:[Xc,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:[Jo]},Jo]}],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",Jo,Qo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xx]}],"font-family":[{font:[Zc]}],"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",ou,Xx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ro,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:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ro,Qo]}],"underline-offset":[{"underline-offset":["auto",ro,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:_()}],"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:[...B(),e7]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jq]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},r7]}],"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:[...V(),"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:V()}],"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:["",...V()]}],"outline-offset":[{"outline-offset":[ro,We]}],"outline-w":[{outline:[ro,Qo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[ro,Qo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Jo,n7]}],"shadow-color":[{shadow:[Zc]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Jo,We]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],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":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"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:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[Xc,We]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"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":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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:[ro,Qo,Xx]}],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"]}}},l7=zq(s7);function ke(...e){return l7(at(e))}const u7=sq,rF=w.forwardRef(({className:e,...t},r)=>h.jsx(RL,{ref:r,className:ke("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}));rF.displayName=RL.displayName;const c7=Sy("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"}}),nF=w.forwardRef(({className:e,variant:t,...r},n)=>h.jsx($L,{ref:n,className:ke(c7({variant:t}),e),...r}));nF.displayName=$L.displayName;const d7=w.forwardRef(({className:e,...t},r)=>h.jsx(BL,{ref:r,className:ke("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}));d7.displayName=BL.displayName;const iF=w.forwardRef(({className:e,...t},r)=>h.jsx(VL,{ref:r,className:ke("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(YL,{className:"h-4 w-4"})}));iF.displayName=VL.displayName;const oF=w.forwardRef(({className:e,...t},r)=>h.jsx(LL,{ref:r,className:ke("text-sm font-semibold",e),...t}));oF.displayName=LL.displayName;const aF=w.forwardRef(({className:e,...t},r)=>h.jsx(FL,{ref:r,className:ke("text-sm opacity-90",e),...t}));aF.displayName=FL.displayName;function f7(){const{toasts:e}=_p();return h.jsxs(u7,{children:[e.map(function({id:t,title:r,description:n,action:i,...o}){return h.jsxs(nF,{...o,children:[h.jsxs("div",{className:"grid gap-1",children:[r&&h.jsx(oF,{children:r}),n&&h.jsx(aF,{children:n})]}),i,h.jsx(iF,{})]},t)}),h.jsx(rF,{})]})}function jS(e,t){return jS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},jS(e,t)}function sF(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,jS(e,t)}function De(){return De=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(Vr(1));return r(lF)(e,t)}if(typeof e!="function")throw new Error(Vr(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function d(){if(l)throw new Error(Vr(3));return o}function c(v){if(typeof v!="function")throw new Error(Vr(4));if(l)throw new Error(Vr(5));var g=!0;return u(),s.push(v),function(){if(g){if(l)throw new Error(Vr(6));g=!1,u();var y=s.indexOf(v);s.splice(y,1),a=null}}}function f(v){if(!v7(v))throw new Error(Vr(7));if(typeof v.type>"u")throw new Error(Vr(8));if(l)throw new Error(Vr(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 AY(e,t){return e===t}function TY(e){var t=e===void 0?{}:e,r=t.connectHOC,n=r===void 0?sY:r,i=t.mapStateToPropsFactories,o=i===void 0?mY:i,a=t.mapDispatchToPropsFactories,s=a===void 0?fY:a,l=t.mergePropsFactories,u=l===void 0?xY:l,d=t.selectorFactory,c=d===void 0?PY:d;return function(p,m,v,g){g===void 0&&(g={});var b=g,y=b.pure,x=y===void 0?!0:y,E=b.areStatesEqual,S=E===void 0?AY:E,P=b.areOwnPropsEqual,C=P===void 0?Qx:P,A=b.areStatePropsEqual,T=A===void 0?Qx:A,D=b.areMergedPropsEqual,N=D===void 0?Qx:D,_=cv(b,CY),F=Jx(p,o,"mapStateToProps"),k=Jx(m,s,"mapDispatchToProps"),B=Jx(v,u,"mergeProps");return n(c,De({methodName:"connect",getDisplayName:function(z){return"Connect("+z+")"},shouldHandleStateChanges:!!p,initMapStateToProps:F,initMapDispatchToProps:k,initMergeProps:B,pure:x,areStatesEqual:S,areOwnPropsEqual:C,areStatePropsEqual:T,areMergedPropsEqual:N},_))}}const OF=TY();P7(Xa.unstable_batchedUpdates);function OY(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=Mn(window,[{eventName:"error",fn:this.onWindowError}])},r.componentDidCatch=function(i){if(i instanceof pv){this.setState({});return}throw i},r.componentWillUnmount=function(){this.unbind()},r.render=function(){return this.props.children(this.setCallbacks)},t}(M.Component),LY=` 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 `,hv=function(t){return t+1},FY=function(t){return` You have lifted an item in position `+hv(t.source.index)+` `},kF=function(t,r){var n=t.droppableId===r.droppableId,i=hv(t.index),o=hv(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+` `},MF=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+` `},BY=function(t){var r=t.destination;if(r)return kF(t.source,r);var n=t.combine;return n?MF(t.draggableId,t.source,n):"You are over an area that cannot be dropped on"},Q_=function(t){return` The item has returned to its starting position of `+hv(t.index)+` `},VY=function(t){if(t.reason==="CANCEL")return` Movement cancelled. `+Q_(t.source)+` `;var r=t.destination,n=t.combine;return r?` You have dropped the item. `+kF(t.source,r)+` `:n?` You have dropped the item. `+MF(t.draggableId,t.source,n)+` `:` The item has been dropped while not over a drop area. `+Q_(t.source)+` `},Om={dragHandleUsageInstructions:LY,onDragStart:FY,onDragUpdate:BY,onDragEnd:VY},ir={x:0,y:0},dr=function(t,r){return{x:t.x+r.x,y:t.y+r.y}},un=function(t,r){return{x:t.x-r.x,y:t.y-r.y}},Na=function(t,r){return t.x===r.x&&t.y===r.y},xc=function(t){return{x:t.x!==0?-t.x:0,y:t.y!==0?-t.y:0}},Zs=function(t,r,n){var i;return n===void 0&&(n=0),i={},i[t]=r,i[t==="x"?"y":"x"]=n,i},xf=function(t,r){return Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))},J_=function(t,r){return Math.min.apply(Math,r.map(function(n){return xf(t,n)}))},IF=function(t){return function(r){return{x:t(r.x),y:t(r.y)}}},UY=function(e,t){var r=di({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},Vp=function(t,r){return{top:t.top+r.y,left:t.left+r.x,bottom:t.bottom+r.y,right:t.right+r.x}},ej=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},WY=function(t,r){return r?Vp(t,r.scroll.diff.displacement):t},HY=function(t,r,n){if(n&&n.increasedBy){var i;return De({},t,(i={},i[r.end]=t[r.end]+n.increasedBy[r.line],i))}return t},GY=function(t,r){return r&&r.shouldClipSubject?UY(r.pageMarginBox,t):di(t)},Ru=function(e){var t=e.page,r=e.withPlaceholder,n=e.axis,i=e.frame,o=WY(t.marginBox,i),a=HY(o,n,r),s=GY(a,i);return{page:t,withPlaceholder:r,active:s}},uC=function(e,t){e.frame||fe();var r=e.frame,n=un(t,r.scroll.initial),i=xc(n),o=De({},r,{scroll:{initial:r.scroll.initial,current:t,diff:{value:n,displacement:i},max:r.scroll.max}}),a=Ru({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o}),s=De({},e,{frame:o,subject:a});return s};function mv(e){return Object.values?Object.values(e):Object.keys(e).map(function(t){return e[t]})}function cC(e,t){if(e.findIndex)return e.findIndex(t);for(var r=0;re.bottom,u=n.lefte.right,d=l&&u;if(d)return!0;var c=l&&a||u&&o;return c}},XY=function(e){var t=Ln(e.top,e.bottom),r=Ln(e.left,e.right);return function(n){var i=t(n.top)&&t(n.bottom)&&r(n.left)&&r(n.right);return i}},fC={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},VF={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},ZY=function(e){return function(t){var r=Ln(t.top,t.bottom),n=Ln(t.left,t.right);return function(i){return e===fC?r(i.top)&&r(i.bottom):n(i.left)&&n(i.right)}}},QY=function(t,r){var n=r.frame?r.frame.scroll.diff.displacement:ir;return Vp(t,n)},JY=function(t,r,n){return r.subject.active?n(r.subject.active)(t):!1},eX=function(t,r,n){return n(r)(t)},pC=function(t){var r=t.target,n=t.destination,i=t.viewport,o=t.withDroppableDisplacement,a=t.isVisibleThroughFrameFn,s=o?QY(r,n):r;return JY(s,n,a)&&eX(s,i,a)},tX=function(t){return pC(De({},t,{isVisibleThroughFrameFn:BF}))},UF=function(t){return pC(De({},t,{isVisibleThroughFrameFn:XY}))},rX=function(t){return pC(De({},t,{isVisibleThroughFrameFn:ZY(t.destination.axis)}))},nX=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 iX(e,t){var r=e.page.marginBox,n={top:t.point.y,right:0,bottom:0,left:t.point.x};return di(sC(r,n))}function Sf(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 d=iX(u,n),c=u.descriptor.id;l.all.push(c);var f=tX({target:d,destination:r,viewport:i,withDroppableDisplacement:!0});if(!f)return l.invisible[u.descriptor.id]=!0,l;var p=nX(c,a,o),m={draggableId:c,shouldAnimate:p};return l.visible[c]=m,l},{all:[],visible:{},invisible:{}})}function oX(e,t){if(!e.length)return 0;var r=e[e.length-1].descriptor.index;return t.inHomeList?r:r+1}function tj(e){var t=e.insideDestination,r=e.inHomeList,n=e.displacedBy,i=e.destination,o=oX(t,{inHomeList:r});return{displaced:wf,displacedBy:n,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:o}}}}function vv(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=Sc(t,n);if(s==null)return tj({insideDestination:r,inHomeList:u,displacedBy:o,destination:n});var d=Za(r,function(v){return v.descriptor.index===s});if(!d)return tj({insideDestination:r,inHomeList:u,displacedBy:o,destination:n});var c=Ly(t,r),f=r.indexOf(d),p=c.slice(f),m=Sf({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 La(e,t){return!!t.effected[e]}var aX=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=La(a,o);return u?t?l:l-1:t?l+1:l},sX=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},lX=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,d=s.at;if(d||fe(),d.type==="REORDER"){var c=sX({isMovingForward:t,isInHomeList:r,location:d.destination,insideDestination:a});return c==null?null:vv({draggable:n,insideDestination:a,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:c})}var f=aX({isMovingForward:t,destination:o,displaced:s.displaced,draggables:i,combine:d.combine,afterCritical:u});return f==null?null:vv({draggable:n,insideDestination:a,destination:o,viewport:l,last:s.displaced,displacedBy:s.displacedBy,index:f})},uX=function(e){var t=e.displaced,r=e.afterCritical,n=e.combineWith,i=e.displacedBy,o=!!(t.visible[n]||t.invisible[n]);return La(n,r)?o?ir:xc(i.point):o?i.point:ir},cX=function(e){var t=e.afterCritical,r=e.impact,n=e.draggables,i=$y(r);i||fe();var o=i.draggableId,a=n[o].page.borderBox.center,s=uX({displaced:r.displaced,afterCritical:t,combineWith:o,displacedBy:r.displacedBy});return dr(a,s)},zF=function(t,r){return r.margin[t.start]+r.borderBox[t.size]/2},dX=function(t,r){return r.margin[t.end]+r.borderBox[t.size]/2},hC=function(t,r,n){return r[t.crossAxisStart]+n.margin[t.crossAxisStart]+n.borderBox[t.crossAxisSize]/2},rj=function(t){var r=t.axis,n=t.moveRelativeTo,i=t.isMoving;return Zs(r.line,n.marginBox[r.end]+zF(r,i),hC(r,n.marginBox,i))},nj=function(t){var r=t.axis,n=t.moveRelativeTo,i=t.isMoving;return Zs(r.line,n.marginBox[r.start]-dX(r,i),hC(r,n.marginBox,i))},fX=function(t){var r=t.axis,n=t.moveInto,i=t.isMoving;return Zs(r.line,n.contentBox[r.start]+zF(r,i),hC(r,n.contentBox,i))},pX=function(e){var t=e.impact,r=e.draggable,n=e.draggables,i=e.droppable,o=e.afterCritical,a=wc(i.descriptor.id,n),s=r.page,l=i.axis;if(!a.length)return fX({axis:l,moveInto:i.page,isMoving:s});var u=t.displaced,d=t.displacedBy,c=u.all[0];if(c){var f=n[c];if(La(c,o))return nj({axis:l,moveRelativeTo:f.page,isMoving:s});var p=dv(f.page,d.point);return nj({axis:l,moveRelativeTo:p,isMoving:s})}var m=a[a.length-1];if(m.descriptor.id===r.descriptor.id)return s.borderBox.center;if(La(m.descriptor.id,o)){var v=dv(m.page,xc(o.displacedBy.point));return rj({axis:l,moveRelativeTo:v,isMoving:s})}return rj({axis:l,moveRelativeTo:m.page,isMoving:s})},NS=function(e,t){var r=e.frame;return r?dr(t,r.scroll.diff.displacement):t},hX=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"?pX({impact:r,draggable:n,draggables:o,droppable:i,afterCritical:a}):cX({impact:r,draggables:o,afterCritical:a})},Fy=function(e){var t=hX(e),r=e.droppable,n=r?NS(r,t):t;return n},WF=function(e,t){var r=un(t,e.scroll.initial),n=xc(r),i=di({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 ij(e,t){return e.map(function(r){return t[r]})}function mX(e,t){for(var r=0;r1?d.sort(function(c,f){return Or(c)[s.start]-Or(f)[s.start]})[0]:u.sort(function(c,f){var p=J_(r,ej(Or(c))),m=J_(r,ej(Or(f)));return p!==m?p-m:Or(c)[s.start]-Or(f)[s.start]})[0]},oj=function(t,r){var n=t.page.borderBox.center;return La(t.descriptor.id,r)?un(n,r.displacedBy.point):n},xX=function(t,r){var n=t.page.borderBox;return La(t.descriptor.id,r)?Vp(n,xc(r.displacedBy.point)):n},wX=function(e){var t=e.pageBorderBoxCenter,r=e.viewport,n=e.destination,i=e.insideDestination,o=e.afterCritical,a=i.filter(function(s){return UF({target:xX(s,o),destination:n,viewport:r.frame,withDroppableDisplacement:!0})}).sort(function(s,l){var u=xf(t,NS(n,oj(s,o))),d=xf(t,NS(n,oj(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=Zs(a.axis.line,t.center[s.line],a.page.borderBox.center[s.crossAxisLine]);return{id:a.descriptor.id,distance:xf(i,l)}}).sort(function(a,s){return s.distance-a.distance});return o[0]?o[0].id:null}function jX(e){var t=e.pageBorderBox,r=e.draggable,n=e.droppables,i=Ry(n).filter(function(o){if(!o.isEnabled)return!1;var a=o.subject.active;if(!a||!OX(t,a))return!1;if(qF(a)(t.center))return!0;var s=o.axis,l=a.center[s.crossAxisLine],u=t[s.crossAxisStart],d=t[s.crossAxisEnd],c=Ln(a[s.crossAxisStart],a[s.crossAxisEnd]),f=c(u),p=c(d);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 YF=function(t,r){return di(Vp(t,r))},NX=function(e,t){var r=e.frame;return r?YF(t,r.scroll.diff.value):t};function XF(e){var t=e.displaced,r=e.id;return!!(t.visible[r]||t.invisible[r])}function DX(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 kX=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=Up(n.axis,r.displaceBy),d=u.value,c=t[l.start],f=t[l.end],p=Ly(r,i),m=Za(p,function(g){var b=g.descriptor.id,y=g.page.borderBox.center[l.line],x=La(b,s),E=XF({displaced:o,id:b});return x?E?f<=y:cb[s.start]+x&&cb[s.start]-u+x&&db[s.start]+u+x&&cb[s.start]+x&&d=lj)return oB;var o=i/lj,a=MS+cZ*o,s=n==="CANCEL"?a*dZ:a;return Number(s.toFixed(2))},pZ=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=dn(t),u=l?s[l]:null,d=s[r.descriptor.droppableId],c=JF({impact:t,draggable:r,draggables:a,afterCritical:o,droppable:u||d,viewport:i}),f=un(c,r.client.borderBox.center);return f},hZ=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=QF({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=De({},n,{displaced:wf});return{impact:l,didDropInsideDroppable:!0}},mZ=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(sZ({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,d=u.draggables[o.critical.draggable.id],c=hZ({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=c.impact,p=c.didDropInsideDroppable,m=p?dC(f):null,v=p?$y(f):null,g={index:l.draggable.index,droppableId:l.droppable.id},b={draggableId:d.descriptor.id,type:d.descriptor.type,source:g,reason:a,mode:o.movementMode,destination:m,combine:v},y=pZ({impact:f,draggable:d,dimensions:u,viewport:o.viewport,afterCritical:o.afterCritical}),x={critical:o.critical,afterCritical:o.afterCritical,result:b,impact:f},E=!Na(o.current.client.offset,y)||!!b.combine;if(!E){r(yC({completed:x}));return}var S=fZ({current:o.current.client.offset,destination:y,reason:a}),P={newHomeClientOffset:y,dropDuration:S,completed:x};r(aZ(P))}}}},aB=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function vZ(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(r){r.target!==window&&r.target!==window.document||e()}}}function gZ(e){var t=e.onWindowScroll;function r(){t(aB())}var n=bf(r),i=vZ(n),o=ja;function a(){return o!==ja}function s(){a()&&fe(),o=Mn(window,[i])}function l(){a()||fe(),n.cancel(),o(),o=ja}return{start:s,stop:l,isActive:a}}var yZ=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},bZ=function(e){var t=gZ({onWindowScroll:function(n){e.dispatch(eZ({newScroll:n}))}});return function(r){return function(n){!t.isActive()&&n.type==="INITIAL_PUBLISH"&&t.start(),t.isActive()&&yZ(n)&&t.stop(),r(n)}}},xZ=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},wZ=function(){var e=[],t=function(o){var a=cC(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}},SZ=function(t,r){return t==null&&r==null?!0:t==null||r==null?!1:t.droppableId===r.droppableId&&t.index===r.index},EZ=function(t,r){return t==null&&r==null?!0:t==null||r==null?!1:t.draggableId===r.draggableId&&t.droppableId===r.droppableId},PZ=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},Qc=function(t,r){r()},$h=function(t,r){return{draggableId:t.draggable.id,type:t.droppable.type,source:{droppableId:t.droppable.id,index:t.draggable.index},mode:r}},n0=function(t,r,n,i){if(!t){n(i(r));return}var o=xZ(n),a={announce:o};t(r,a),o.wasCalled()||n(i(r))},CZ=function(e,t){var r=wZ(),n=null,i=function(f,p){n&&fe(),Qc("onBeforeCapture",function(){var m=e().onBeforeCapture;if(m){var v={draggableId:f,mode:p};m(v)}})},o=function(f,p){n&&fe(),Qc("onBeforeDragStart",function(){var m=e().onBeforeDragStart;m&&m($h(f,p))})},a=function(f,p){n&&fe();var m=$h(f,p);n={mode:p,lastCritical:f,lastLocation:m.source,lastCombine:null},r.add(function(){Qc("onDragStart",function(){return n0(e().onDragStart,m,t,Om.onDragStart)})})},s=function(f,p){var m=dC(p),v=$y(p);n||fe();var g=!PZ(f,n.lastCritical);g&&(n.lastCritical=f);var b=!SZ(n.lastLocation,m);b&&(n.lastLocation=m);var y=!EZ(n.lastCombine,v);if(y&&(n.lastCombine=v),!(!g&&!b&&!y)){var x=De({},$h(f,n.mode),{combine:v,destination:m});r.add(function(){Qc("onDragUpdate",function(){return n0(e().onDragUpdate,x,t,Om.onDragUpdate)})})}},l=function(){n||fe(),r.flush()},u=function(f){n||fe(),n=null,Qc("onDragEnd",function(){return n0(e().onDragEnd,f,t,Om.onDragEnd)})},d=function(){if(n){var f=De({},$h(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:d}},AZ=function(e,t){var r=CZ(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)}}}},TZ=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(yC({completed:n.completed}))}}},OZ=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(iB())}};r=requestAnimationFrame(function(){r=null,t=Mn(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)}}}},jZ=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()}}}}}},NZ=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},DZ=function(e){return function(t){return function(r){return function(n){if(NZ(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())}}}},kZ=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(nB({reason:n.reason})))}}}},MZ=uF,IZ=function(e){var t=e.dimensionMarshal,r=e.focusMarshal,n=e.styleMarshal,i=e.getResponders,o=e.announce,a=e.autoScroller;return lF(HX,MZ(g7(uZ(n),_Z(t),lZ(t),mZ,TZ,OZ,kZ,DZ(a),bZ,jZ(r),AZ(i,o))))},i0=function(){return{additions:{},removals:{},modified:{}}};function RZ(e){var t=e.registry,r=e.callbacks,n=i0(),i=null,o=function(){i||(r.collectionStarting(),i=requestAnimationFrame(function(){i=null;var d=n,c=d.additions,f=d.removals,p=d.modified,m=Object.keys(c).map(function(b){return t.draggable.getById(b).getDimension(ir)}).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=i0(),r.publish(g)}))},a=function(d){var c=d.descriptor.id;n.additions[c]=d,n.modified[d.descriptor.droppableId]=!0,n.removals[c]&&delete n.removals[c],o()},s=function(d){var c=d.descriptor;n.removals[c.id]=!0,n.modified[c.droppableId]=!0,n.additions[c.id]&&delete n.additions[c.id],o()},l=function(){i&&(cancelAnimationFrame(i),i=null,n=i0())};return{add:a,remove:s,stop:l}}var sB=function(e){var t=e.scrollHeight,r=e.scrollWidth,n=e.height,i=e.width,o=un({x:r,y:t},{x:i,y:n}),a={x:Math.max(0,o.x),y:Math.max(0,o.y)};return a},lB=function(){var e=document.documentElement;return e||fe(),e},uB=function(){var e=lB(),t=sB({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight});return t},$Z=function(){var e=aB(),t=uB(),r=e.y,n=e.x,i=lB(),o=i.clientWidth,a=i.clientHeight,s=n+o,l=r+a,u=di({top:r,left:n,right:s,bottom:l}),d={frame:u,scroll:{initial:e,current:e,max:t,diff:{value:ir,displacement:ir}}};return d},LZ=function(e){var t=e.critical,r=e.scrollOptions,n=e.registry,i=$Z(),o=i.scroll.current,a=t.droppable,s=n.droppable.getAllByType(a.type).map(function(c){return c.callbacks.getDimensionAndWatchScroll(o,r)}),l=n.draggable.getAllByType(t.draggable.type).map(function(c){return c.getDimension(o)}),u={draggables:LF(l),droppables:$F(s)},d={dimensions:u,critical:t,viewport:i};return d};function uj(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 FZ=function(e,t){var r=null,n=RZ({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"&&uj(e,m,p.value)&&n.add(p.value),p.type==="REMOVAL"&&uj(e,m,p.value)&&n.remove(p.value)},d=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},LZ({critical:g,registry:e,scrollOptions:p.scrollOptions})},c={updateDroppableIsEnabled:i,updateDroppableIsCombineEnabled:o,scrollDroppable:s,updateDroppableScroll:a,startPublishing:d,stopPublishing:l};return c},cB=function(e,t){return e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP"},BZ=function(e){window.scrollBy(e.x,e.y)},VZ=nr(function(e){return Ry(e).filter(function(t){return!(!t.isEnabled||!t.frame)})}),UZ=function(t,r){var n=Za(VZ(r),function(i){return i.frame||fe(),qF(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=UZ(t,n);return o},Da={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(t){return Math.pow(t,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},WZ=function(e,t){var r=e[t.size]*Da.startFromPercentage,n=e[t.size]*Da.maxScrollAtPercentage,i={startScrollingFrom:r,maxScrollValueAt:n};return i},dB=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},wC=1,HZ=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return Da.maxPixelScroll;if(e===t.startScrollingFrom)return wC;var r=dB({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),n=1-r,i=Da.maxPixelScroll*Da.ease(n);return Math.ceil(i)},cj=Da.durationDampening.accelerateAt,dj=Da.durationDampening.stopDampeningAt,GZ=function(e,t){var r=t,n=dj,i=Date.now(),o=i-r;if(o>=dj)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}},qZ=IF(function(e){return e===0?0:e}),fB=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=pj({container:r,distanceToEdges:a,dragStartTime:t,axis:fC,shouldUseTimeDampening:o}),l=pj({container:r,distanceToEdges:a,dragStartTime:t,axis:VF,shouldUseTimeDampening:o}),u=qZ({x:l,y:s});if(Na(u,ir))return null;var d=KZ({container:r,subject:n,proposedScroll:u});return d?Na(d,ir)?null:d:null},YZ=IF(function(e){return e===0?0:e>0?1:-1}),SC=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=dr(r,i),a={x:e(o.x,n.x),y:e(o.y,n.y)};return Na(a,ir)?null:a}}(),pB=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=YZ(i),s=SC({max:o,current:n,change:a});return!s||a.x!==0&&s.x===0||a.y!==0&&s.y===0},EC=function(t,r){return pB({current:t.scroll.current,max:t.scroll.max,change:r})},XZ=function(t,r){if(!EC(t,r))return null;var n=t.scroll.max,i=t.scroll.current;return SC({current:i,max:n,change:r})},PC=function(t,r){var n=t.frame;return n?pB({current:n.scroll.current,max:n.scroll.max,change:r}):!1},ZZ=function(t,r){var n=t.frame;return!n||!PC(t,r)?null:SC({current:n.scroll.current,max:n.scroll.max,change:r})},QZ=function(e){var t=e.viewport,r=e.subject,n=e.center,i=e.dragStartTime,o=e.shouldUseTimeDampening,a=fB({dragStartTime:i,container:t.frame,subject:r,center:n,shouldUseTimeDampening:o});return a&&EC(t,a)?a:null},JZ=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=fB({dragStartTime:i,container:a.pageMarginBox,subject:r,center:n,shouldUseTimeDampening:o});return s&&PC(t,s)?s:null},hj=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,d=QZ({dragStartTime:r,viewport:u,subject:l,center:a,shouldUseTimeDampening:n});if(d){i(d);return}}var c=zZ({center:a,destination:dn(t.impact),droppables:t.dimensions.droppables});if(c){var f=JZ({dragStartTime:r,droppable:c,subject:l,center:a,shouldUseTimeDampening:n});f&&o(c.descriptor.id,f)}},eQ=function(e){var t=e.scrollWindow,r=e.scrollDroppable,n=bf(t),i=bf(r),o=null,a=function(d){o||fe();var c=o,f=c.shouldUseTimeDampening,p=c.dragStartTime;hj({state:d,scrollWindow:n,scrollDroppable:i,dragStartTime:p,shouldUseTimeDampening:f})},s=function(d){o&&fe();var c=Date.now(),f=!1,p=function(){f=!0};hj({state:d,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:p,scrollDroppable:p}),o={dragStartTime:c,shouldUseTimeDampening:f},f&&a(d)},l=function(){o&&(n.cancel(),i.cancel(),o=null)};return{start:s,stop:l,scroll:a}},tQ=function(e){var t=e.move,r=e.scrollDroppable,n=e.scrollWindow,i=function(u,d){var c=dr(u.current.client.selection,d);t({client:c})},o=function(u,d){if(!PC(u,d))return d;var c=ZZ(u,d);if(!c)return r(u.descriptor.id,d),null;var f=un(d,c);r(u.descriptor.id,f);var p=un(d,f);return p},a=function(u,d,c){if(!u||!EC(d,c))return c;var f=XZ(d,c);if(!f)return n(c),null;var p=un(c,f);n(p);var m=un(c,p);return m},s=function(u){var d=u.scrollJumpRequest;if(d){var c=dn(u.impact);c||fe();var f=o(u.dimensions.droppables[c],d);if(f){var p=u.viewport,m=a(u.isWindowScrollAllowed,p,f);m&&i(u,m)}}};return s},rQ=function(e){var t=e.scrollDroppable,r=e.scrollWindow,n=e.move,i=eQ({scrollWindow:r,scrollDroppable:t}),o=tQ({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},$u="data-rbd",Lu=function(){var e=$u+"-drag-handle";return{base:e,draggableId:e+"-draggable-id",contextId:e+"-context-id"}}(),IS=function(){var e=$u+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),nQ=function(){var e=$u+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),mj={contextId:$u+"-scroll-container-context-id"},iQ=function(t){return function(r){return"["+r+'="'+t+'"]'}},Jc=function(t,r){return t.map(function(n){var i=n.styles[r];return i?n.selector+" { "+i+" }":""}).join(" ")},oQ="pointer-events: none;",aQ=function(e){var t=iQ(e),r=function(){var s=` cursor: -webkit-grab; cursor: grab; `;return{selector:t(Lu.contextId),styles:{always:` -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(0,0,0,0); touch-action: manipulation; `,resting:s,dragging:oQ,dropAnimating:s}}}(),n=function(){var s=` transition: `+Fd.outOfTheWay+`; `;return{selector:t(IS.contextId),styles:{dragging:s,dropAnimating:s,userCancel:s}}}(),i={selector:t(nQ.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:Jc(a,"always"),resting:Jc(a,"resting"),dragging:Jc(a,"dragging"),dropAnimating:Jc(a,"dropAnimating"),userCancel:Jc(a,"userCancel")}},fn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.useLayoutEffect:w.useEffect,o0=function(){var t=document.querySelector("head");return t||fe(),t},vj=function(t){var r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.type="text/css",r};function sQ(e,t){var r=nt(function(){return aQ(e)},[e]),n=w.useRef(null),i=w.useRef(null),o=je(nr(function(c){var f=i.current;f||fe(),f.textContent=c}),[]),a=je(function(c){var f=n.current;f||fe(),f.textContent=c},[]);fn(function(){!n.current&&!i.current||fe();var c=vj(t),f=vj(t);return n.current=c,i.current=f,c.setAttribute($u+"-always",e),f.setAttribute($u+"-dynamic",e),o0().appendChild(c),o0().appendChild(f),a(r.always),o(r.resting),function(){var p=function(v){var g=v.current;g||fe(),o0().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(c){if(c==="DROP"){o(r.dropAnimating);return}o(r.userCancel)},[o,r.dropAnimating,r.userCancel]),u=je(function(){i.current&&o(r.resting)},[o,r.resting]),d=nt(function(){return{dragging:s,dropping:l,resting:u}},[s,l,u]);return d}var hB=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function By(e){return e instanceof hB(e).HTMLElement}function lQ(e,t){var r="["+Lu.contextId+'="'+e+'"]',n=RF(document.querySelectorAll(r));if(!n.length)return null;var i=Za(n,function(o){return o.getAttribute(Lu.draggableId)===t});return!i||!By(i)?null:i}function uQ(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=lQ(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(Lu.draggableId)===f&&(r.current=f)},[]);fn(function(){return i.current=!0,function(){i.current=!1;var f=n.current;f&&cancelAnimationFrame(f)}},[]);var d=nt(function(){return{register:o,tryRecordFocus:u,tryRestoreFocusRecorded:l,tryShiftRecord:s}},[o,u,l,s]);return d}function cQ(){var e={draggables:{},droppables:{}},t=[];function r(c){return t.push(c),function(){var p=t.indexOf(c);p!==-1&&t.splice(p,1)}}function n(c){t.length&&t.forEach(function(f){return f(c)})}function i(c){return e.draggables[c]||null}function o(c){var f=i(c);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 mv(e.draggables).filter(function(p){return p.descriptor.type===f})}};function s(c){return e.droppables[c]||null}function l(c){var f=s(c);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 mv(e.droppables).filter(function(p){return p.descriptor.type===f})}};function d(){e.draggables={},e.droppables={},t.length=0}return{draggable:a,droppable:u,subscribe:r,clean:d}}function dQ(){var e=nt(cQ,[]);return w.useEffect(function(){return function(){requestAnimationFrame(e.clean)}},[e]),e}var CC=M.createContext(null),gv=function(){var e=document.body;return e||fe(),e},fQ={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},pQ=function(t){return"rbd-announcement-"+t};function hQ(e){var t=nt(function(){return pQ(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"),De(o.style,fQ),gv().appendChild(o),function(){setTimeout(function(){var l=gv();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 mQ=0,vQ={separator:"::"};function AC(e,t){return t===void 0&&(t=vQ),nt(function(){return""+e+t.separator+mQ++},[t.separator,e])}function gQ(e){var t=e.contextId,r=e.uniqueId;return"rbd-hidden-text-"+t+"-"+r}function yQ(e){var t=e.contextId,r=e.text,n=AC("hidden-text",{separator:"-"}),i=nt(function(){return gQ({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",gv().appendChild(a),function(){var l=gv();l.contains(a)&&l.removeChild(a)}},[i,r]),i}var Vy=M.createContext(null);function mB(e){var t=w.useRef(e);return w.useEffect(function(){t.current=e}),t}function bQ(){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 xQ=9,wQ=13,TC=27,vB=32,SQ=33,EQ=34,PQ=35,CQ=36,AQ=37,TQ=38,OQ=39,_Q=40,Lh,jQ=(Lh={},Lh[wQ]=!0,Lh[xQ]=!0,Lh),gB=function(e){jQ[e.keyCode]&&e.preventDefault()},Uy=function(){var e="visibilitychange";if(typeof document>"u")return e;var t=[e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],r=Za(t,function(n){return"on"+n in document});return r||e}(),yB=0,gj=5;function NQ(e,t){return Math.abs(t.x-e.x)>=gj||Math.abs(t.y-e.y)>=gj}var yj={type:"IDLE"};function DQ(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===yB){var d={x:l,y:u},c=n();if(c.type==="DRAGGING"){a.preventDefault(),c.actions.move(d);return}c.type!=="PENDING"&&fe();var f=c.point;if(NQ(f,d)){a.preventDefault();var p=c.actions.fluidLift(d);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===TC){a.preventDefault(),t();return}gB(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:Uy,fn:t}]}function kQ(e){var t=w.useRef(yj),r=w.useRef(ja),n=nt(function(){return{eventName:"mousedown",fn:function(c){if(!c.defaultPrevented&&c.button===yB&&!(c.ctrlKey||c.metaKey||c.shiftKey||c.altKey)){var f=e.findClosestDraggableId(c);if(f){var p=e.tryGetLock(f,a,{sourceEvent:c});if(p){c.preventDefault();var m={x:c.clientX,y:c.clientY};r.current(),u(p,m)}}}}}},[e]),i=nt(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(c){if(!c.defaultPrevented){var f=e.findClosestDraggableId(c);if(f){var p=e.findOptionsForDraggable(f);p&&(p.shouldRespectForcePress||e.canGetLock(f)&&c.preventDefault())}}}}},[e]),o=je(function(){var c={passive:!1,capture:!0};r.current=Mn(window,[i,n],c)},[i,n]),a=je(function(){var d=t.current;d.type!=="IDLE"&&(t.current=yj,r.current(),o())},[o]),s=je(function(){var d=t.current;a(),d.type==="DRAGGING"&&d.actions.cancel({shouldBlockNextClick:!0}),d.type==="PENDING"&&d.actions.abort()},[a]),l=je(function(){var c={capture:!0,passive:!1},f=DQ({cancel:s,completed:a,getPhase:function(){return t.current},setPhase:function(m){t.current=m}});r.current=Mn(window,f,c)},[s,a]),u=je(function(c,f){t.current.type!=="IDLE"&&fe(),t.current={type:"PENDING",point:f,actions:c},l()},[l]);fn(function(){return o(),function(){r.current()}},[o])}var yl;function MQ(){}var IQ=(yl={},yl[EQ]=!0,yl[SQ]=!0,yl[CQ]=!0,yl[PQ]=!0,yl);function RQ(e,t){function r(){t(),e.cancel()}function n(){t(),e.drop()}return[{eventName:"keydown",fn:function(o){if(o.keyCode===TC){o.preventDefault(),r();return}if(o.keyCode===vB){o.preventDefault(),n();return}if(o.keyCode===_Q){o.preventDefault(),e.moveDown();return}if(o.keyCode===TQ){o.preventDefault(),e.moveUp();return}if(o.keyCode===OQ){o.preventDefault(),e.moveRight();return}if(o.keyCode===AQ){o.preventDefault(),e.moveLeft();return}if(IQ[o.keyCode]){o.preventDefault();return}gB(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:Uy,fn:r}]}function $Q(e){var t=w.useRef(MQ),r=nt(function(){return{eventName:"keydown",fn:function(o){if(o.defaultPrevented||o.keyCode!==vB)return;var a=e.findClosestDraggableId(o);if(!a)return;var s=e.tryGetLock(a,d,{sourceEvent:o});if(!s)return;o.preventDefault();var l=!0,u=s.snapLift();t.current();function d(){l||fe(),l=!1,t.current(),n()}t.current=Mn(window,RQ(u,d),{capture:!0,passive:!1})}}},[e]),n=je(function(){var o={passive:!1,capture:!0};t.current=Mn(window,[r],o)},[r]);fn(function(){return n(),function(){t.current()}},[n])}var a0={type:"IDLE"},LQ=120,FQ=.15;function BQ(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===TC&&i.preventDefault(),t()}},{eventName:Uy,fn:t}]}function VQ(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,d={x:l,y:u};o.preventDefault(),a.actions.move(d)}},{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>=FQ;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:Uy,fn:t}]}function UQ(e){var t=w.useRef(a0),r=w.useRef(ja),n=je(function(){return t.current},[]),i=je(function(p){t.current=p},[]),o=nt(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(),c(v,x)}}}}}},[e]),a=je(function(){var p={capture:!0,passive:!1};r.current=Mn(window,[o],p)},[o]),s=je(function(){var f=t.current;f.type!=="IDLE"&&(f.type==="PENDING"&&clearTimeout(f.longPressTimerId),i(a0),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=Mn(window,VQ(m),p),g=Mn(window,BQ(m),p);r.current=function(){v(),g()}},[l,n,s]),d=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]),c=je(function(p,m){n().type!=="IDLE"&&fe();var v=setTimeout(d,LQ);i({type:"PENDING",point:m,actions:p,longPressTimerId:v}),u()},[u,n,i,d]);fn(function(){return a(),function(){r.current();var m=n();m.type==="PENDING"&&(clearTimeout(m.longPressTimerId),i(a0))}},[n,a,i]),fn(function(){var p=Mn(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 bB(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:bB(e,t.parentElement)}function WQ(e,t){var r=t.target;return By(r)?bB(e,r):!1}var HQ=function(e){return di(e.getBoundingClientRect()).center};function GQ(e){return e instanceof hB(e).Element}var KQ=function(){var e="matches";if(typeof document>"u")return e;var t=[e,"msMatchesSelector","webkitMatchesSelector"],r=Za(t,function(n){return n in Element.prototype});return r||e}();function xB(e,t){return e==null?null:e[KQ](t)?e:xB(e.parentElement,t)}function qQ(e,t){return e.closest?e.closest(t):xB(e,t)}function YQ(e){return"["+Lu.contextId+'="'+e+'"]'}function XQ(e,t){var r=t.target;if(!GQ(r))return null;var n=YQ(e),i=qQ(r,n);return!i||!By(i)?null:i}function ZQ(e,t){var r=XQ(e,t);return r?r.getAttribute(Lu.draggableId):null}function QQ(e,t){var r="["+IS.contextId+'="'+e+'"]',n=RF(document.querySelectorAll(r)),i=Za(n,function(o){return o.getAttribute(IS.id)===t});return!i||!By(i)?null:i}function JQ(e){e.preventDefault()}function Fh(e){var t=e.expected,r=e.phase,n=e.isLockActive;return e.shouldWarn,!(!n()||t!==r)}function wB(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||!cB(r.getState(),i))}function eJ(e){var t=e.lockAPI,r=e.contextId,n=e.store,i=e.registry,o=e.draggableId,a=e.forceSensorStop,s=e.sourceEvent,l=wB({lockAPI:t,store:n,registry:i,draggableId:o});if(!l)return null;var u=i.draggable.getById(o),d=QQ(r,u.descriptor.id);if(!d||s&&!u.options.canDragInteractiveElements&&WQ(d,s))return null;var c=t.claim(a||ja),f="PRE_DRAG";function p(){return u.options.shouldRespectForcePress}function m(){return t.isActive(c)}function v(P,C){Fh({expected:P,phase:f,isLockActive:m,shouldWarn:!0})&&n.dispatch(C())}var g=v.bind(null,"DRAGGING");function b(P){function C(){t.release(),f="COMPLETED"}f!=="PRE_DRAG"&&(C(),f!=="PRE_DRAG"&&fe()),n.dispatch(KX(P.liftActionArgs)),f="DRAGGING";function A(T,D){if(D===void 0&&(D={shouldBlockNextClick:!1}),P.cleanup(),D.shouldBlockNextClick){var N=Mn(window,[{eventName:"click",fn:JQ,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(N)}C(),n.dispatch(nB({reason:T}))}return De({isActive:function(){return Fh({expected:"DRAGGING",phase:f,isLockActive:m,shouldWarn:!1})},shouldRespectForcePress:p,drop:function(D){return A("DROP",D)},cancel:function(D){return A("CANCEL",D)}},P.actions)}function y(P){var C=bf(function(T){g(function(){return rB({client:T})})}),A=b({liftActionArgs:{id:o,clientSelection:P,movementMode:"FLUID"},cleanup:function(){return C.cancel()},actions:{move:C}});return De({},A,{move:C})}function x(){var P={moveUp:function(){return g(rZ)},moveRight:function(){return g(iZ)},moveDown:function(){return g(nZ)},moveLeft:function(){return g(oZ)}};return b({liftActionArgs:{id:o,clientSelection:HQ(d),movementMode:"SNAP"},cleanup:ja,actions:P})}function E(){var P=Fh({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!0});P&&t.release()}var S={isActive:function(){return Fh({expected:"PRE_DRAG",phase:f,isLockActive:m,shouldWarn:!1})},shouldRespectForcePress:p,fluidLift:y,snapLift:x,abort:E};return S}var tJ=[kQ,$Q,UQ];function rJ(e){var t=e.contextId,r=e.store,n=e.registry,i=e.customSensors,o=e.enableDefaultSensors,a=[].concat(o?tJ:[],i||[]),s=w.useState(function(){return bQ()})[0],l=je(function(y,x){y.isDragging&&!x.isDragging&&s.tryAbandon()},[s]);fn(function(){var y=r.getState(),x=r.subscribe(function(){var E=r.getState();l(y,E),y=E});return x},[s,r,l]),fn(function(){return s.tryAbandon},[s.tryAbandon]);for(var u=je(function(b){return wB({lockAPI:s,registry:n,store:r,draggableId:b})},[s,n,r]),d=je(function(b,y,x){return eJ({lockAPI:s,registry:n,contextId:t,store:r,draggableId:b,forceSensorStop:y,sourceEvent:x&&x.sourceEvent?x.sourceEvent:null})},[t,s,n,r]),c=je(function(b){return ZQ(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(gC()))},[s,r]),m=je(s.isClaimed,[s]),v=nt(function(){return{canGetLock:u,tryGetLock:d,findClosestDraggableId:c,findOptionsForDraggable:f,tryReleaseLock:p,isLockClaimed:m}},[u,d,c,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 zy(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const $S=e=>Array.isArray(e);function OB(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 _C(e,t,r,n){if(typeof t=="function"){const[i,o]=Pj(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]=Pj(n);t=t(r!==void 0?r:e.custom,i,o)}return t}function Wy(e,t,r){const n=e.getProps();return _C(n,t,r!==void 0?r:n.custom,e)}const jC=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],NC=["initial",...jC],zp=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],sl=new Set(zp),bo=e=>e*1e3,xo=e=>e/1e3,ZJ={type:"spring",stiffness:500,damping:25,restSpeed:10},QJ=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),JJ={type:"keyframes",duration:.8},eee={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},tee=(e,{keyframes:t})=>t.length>2?JJ:sl.has(e)?e.startsWith("scale")?QJ(t[1]):ZJ:eee;function DC(e,t){return e?e[t]||e.default||e:void 0}const ree={skipAnimations:!1,useManualTiming:!1},nee=e=>e!==null;function Hy(e,{repeat:t,repeatType:r="loop"},n){const i=e.filter(nee),o=t&&r!=="loop"&&t%2===1?0:i.length-1;return!o||n===void 0?i[o]:n}const pn=e=>e;let LS=pn;function iee(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,d=!1,c=!1)=>{const p=c&&n?t:r;return d&&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 Vh=["read","resolveKeyframes","update","preRender","render","postRender"],oee=40;function _B(e,t){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>r=!0,a=Vh.reduce((b,y)=>(b[y]=iee(o),b),{}),{read:s,resolveKeyframes:l,update:u,preRender:d,render:c,postRender:f}=a,p=()=>{const b=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(b-i.timestamp,oee),1),i.timestamp=b,i.isProcessing=!0,s.process(i),l.process(i),u.process(i),d.process(i),c.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:Vh.reduce((b,y)=>{const x=a[y];return b[y]=(E,S=!1,P=!1)=>(r||m(),x.schedule(E,S,P)),b},{}),cancel:b=>{for(let y=0;y(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,aee=1e-7,see=12;function lee(e,t,r,n,i){let o,a,s=0;do a=t+(r-t)/2,o=jB(a,n,i)-e,o>0?r=a:t=a;while(Math.abs(o)>aee&&++slee(o,0,1,e,r);return o=>o===0||o===1?o:jB(i(o),t,n)}const NB=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,DB=e=>t=>1-e(1-t),kB=Wp(.33,1.53,.69,.99),kC=DB(kB),MB=NB(kC),IB=e=>(e*=2)<1?.5*kC(e):.5*(2-Math.pow(2,-10*(e-1))),MC=e=>1-Math.sin(Math.acos(e)),RB=DB(MC),$B=NB(MC),LB=e=>/^0[^.\s]+$/u.test(e);function uee(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||LB(e):!0}const FB=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),BB=e=>t=>typeof t=="string"&&t.startsWith(e),VB=BB("--"),cee=BB("var(--"),IC=e=>cee(e)?dee.test(e.split("/*")[0].trim()):!1,dee=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,fee=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function pee(e){const t=fee.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}function UB(e,t,r=1){const[n,i]=pee(e);if(!n)return;const o=window.getComputedStyle(t).getPropertyValue(n);if(o){const a=o.trim();return FB(a)?parseFloat(a):a}return IC(i)?UB(i,t,r+1):i}const Do=(e,t,r)=>r>t?t:rtypeof e=="number",parse:parseFloat,transform:e=>e},Cf={...Ec,transform:e=>Do(0,1,e)},Uh={...Ec,default:1},Hp=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ta=Hp("deg"),zi=Hp("%"),Me=Hp("px"),hee=Hp("vh"),mee=Hp("vw"),Cj={...zi,parse:e=>zi.parse(e)/100,transform:e=>zi.transform(e*100)},vee=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Aj=e=>e===Ec||e===Me,Tj=(e,t)=>parseFloat(e.split(", ")[t]),Oj=(e,t)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return Tj(i[1],t);{const o=n.match(/^matrix\((.+)\)$/u);return o?Tj(o[1],e):0}},gee=new Set(["x","y","z"]),yee=zp.filter(e=>!gee.has(e));function bee(e){const t=[];return yee.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const Fu={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:Oj(4,13),y:Oj(5,14)};Fu.translateX=Fu.x;Fu.translateY=Fu.y;const zB=e=>t=>t.test(e),xee={test:e=>e==="auto",parse:e=>e},WB=[Ec,Me,zi,ta,mee,hee,xee],_j=e=>WB.find(zB(e)),Bs=new Set;let FS=!1,BS=!1;function HB(){if(BS){const e=Array.from(Bs).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const i=bee(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)})}BS=!1,FS=!1,Bs.forEach(e=>e.complete()),Bs.clear()}function GB(){Bs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(BS=!0)})}function wee(){GB(),HB()}class RC{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?(Bs.add(this),FS||(FS=!0,At.read(GB),At.resolveKeyframes(HB))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;for(let o=0;oMath.round(e*1e5)/1e5,$C=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function See(e){return e==null}const Eee=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,LC=(e,t)=>r=>!!(typeof r=="string"&&Eee.test(r)&&r.startsWith(e)||t&&!See(r)&&Object.prototype.hasOwnProperty.call(r,t)),KB=(e,t,r)=>n=>{if(typeof n!="string")return n;const[i,o,a,s]=n.match($C);return{[e]:parseFloat(i),[t]:parseFloat(o),[r]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},Pee=e=>Do(0,255,e),c0={...Ec,transform:e=>Math.round(Pee(e))},Ss={test:LC("rgb","red"),parse:KB("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+c0.transform(e)+", "+c0.transform(t)+", "+c0.transform(r)+", "+Bd(Cf.transform(n))+")"};function Cee(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 VS={test:LC("#"),parse:Cee,transform:Ss.transform},Bl={test:LC("hsl","hue"),parse:KB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+zi.transform(Bd(t))+", "+zi.transform(Bd(r))+", "+Bd(Cf.transform(n))+")"},br={test:e=>Ss.test(e)||VS.test(e)||Bl.test(e),parse:e=>Ss.test(e)?Ss.parse(e):Bl.test(e)?Bl.parse(e):VS.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ss.transform(e):Bl.transform(e)},Aee=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Tee(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match($C))===null||t===void 0?void 0:t.length)||0)+(((r=e.match(Aee))===null||r===void 0?void 0:r.length)||0)>0}const qB="number",YB="color",Oee="var",_ee="var(",jj="${}",jee=/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 Af(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let o=0;const s=t.replace(jee,l=>(br.test(l)?(n.color.push(o),i.push(YB),r.push(br.parse(l))):l.startsWith(_ee)?(n.var.push(o),i.push(Oee),r.push(l)):(n.number.push(o),i.push(qB),r.push(parseFloat(l))),++o,jj)).split(jj);return{values:r,split:s,indexes:n,types:i}}function XB(e){return Af(e).values}function ZB(e){const{split:t,types:r}=Af(e),n=t.length;return i=>{let o="";for(let a=0;atypeof e=="number"?0:e;function Dee(e){const t=XB(e);return ZB(e)(t.map(Nee))}const Ba={test:Tee,parse:XB,createTransformer:ZB,getAnimatableNone:Dee},kee=new Set(["brightness","contrast","saturate","opacity"]);function Mee(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match($C)||[];if(!n)return e;const i=r.replace(n,"");let o=kee.has(t)?1:0;return n!==r&&(o*=100),t+"("+o+i+")"}const Iee=/\b([a-z-]*)\(.*?\)/gu,US={...Ba,getAnimatableNone:e=>{const t=e.match(Iee);return t?t.map(Mee).join(" "):e}},Ree={borderWidth:Me,borderTopWidth:Me,borderRightWidth:Me,borderBottomWidth:Me,borderLeftWidth:Me,borderRadius:Me,radius:Me,borderTopLeftRadius:Me,borderTopRightRadius:Me,borderBottomRightRadius:Me,borderBottomLeftRadius:Me,width:Me,maxWidth:Me,height:Me,maxHeight:Me,top:Me,right:Me,bottom:Me,left:Me,padding:Me,paddingTop:Me,paddingRight:Me,paddingBottom:Me,paddingLeft:Me,margin:Me,marginTop:Me,marginRight:Me,marginBottom:Me,marginLeft:Me,backgroundPositionX:Me,backgroundPositionY:Me},$ee={rotate:ta,rotateX:ta,rotateY:ta,rotateZ:ta,scale:Uh,scaleX:Uh,scaleY:Uh,scaleZ:Uh,skew:ta,skewX:ta,skewY:ta,distance:Me,translateX:Me,translateY:Me,translateZ:Me,x:Me,y:Me,z:Me,perspective:Me,transformPerspective:Me,opacity:Cf,originX:Cj,originY:Cj,originZ:Me},Nj={...Ec,transform:Math.round},FC={...Ree,...$ee,zIndex:Nj,size:Me,fillOpacity:Cf,strokeOpacity:Cf,numOctaves:Nj},Lee={...FC,color:br,backgroundColor:br,outlineColor:br,fill:br,stroke:br,borderColor:br,borderTopColor:br,borderRightColor:br,borderBottomColor:br,borderLeftColor:br,filter:US,WebkitFilter:US},BC=e=>Lee[e];function QB(e,t){let r=BC(e);return r!==US&&(r=Ba),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const Fee=new Set(["auto","none","0"]);function Bee(e,t,r){let n=0,i;for(;n{r.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function VC(e){return typeof e=="function"}let _m;function Vee(){_m=void 0}const Wi={now:()=>(_m===void 0&&Wi.set(cr.isProcessing||ree.useManualTiming?cr.timestamp:performance.now()),_m),set:e=>{_m=e,queueMicrotask(Vee)}},Dj=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ba.test(e)||e==="0")&&!e.startsWith("url("));function Uee(e){const t=e[0];if(e.length===1)return!0;for(let r=0;rWee?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&wee(),this._resolved}onKeyframesResolved(t,r){this.resolvedAt=Wi.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(Hy(t,this.options,r)),s==null||s(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,r);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:r,...d},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 Bu=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n},t3=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let o=0;o{const d=u*a,c=d*e,f=d-r,p=zS(u,a),m=Math.exp(-c);return d0-f/p*m},o=u=>{const c=u*a*e,f=c*r+r,p=Math.pow(a,2)*Math.pow(u,2)*e,m=Math.exp(-c),v=zS(Math.pow(u,2),a);return(-i(u)+d0>0?-1:1)*((f-p)*m)/v}):(i=u=>{const d=Math.exp(-u*e),c=(u-r)*e+1;return-d0+d*c},o=u=>{const d=Math.exp(-u*e),c=(r-u)*(e*e);return d*c});const s=5/e,l=qee(i,o,s);if(e=bo(e),isNaN(l))return{stiffness:It.stiffness,damping:It.damping,duration:e};{const u=Math.pow(l,2)*n;return{stiffness:u,damping:a*2*Math.sqrt(n*u),duration:e}}}const Kee=12;function qee(e,t,r){let n=r;for(let i=1;i=WS?1/0:t}const Yee=["duration","bounce"],Xee=["stiffness","damping","mass"];function kj(e,t){return t.some(r=>e[r]!==void 0)}function Zee(e){let t={velocity:It.velocity,stiffness:It.stiffness,damping:It.damping,mass:It.mass,isResolvedFromDuration:!1,...e};if(!kj(e,Xee)&&kj(e,Yee))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,o=2*Do(.05,1,1-e.bounce)*Math.sqrt(i);t={...t,mass:It.mass,stiffness:i,damping:o}}else{const r=Gee(e);t={...t,...r,mass:It.mass},t.isResolvedFromDuration=!0}return t}function o3(e=It.visualDuration,t=It.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:d,duration:c,velocity:f,isResolvedFromDuration:p}=Zee({...r,velocity:-xo(r.velocity||0)}),m=f||0,v=u/(2*Math.sqrt(l*d)),g=a-o,b=xo(Math.sqrt(l/d)),y=Math.abs(g)<5;n||(n=y?It.restSpeed.granular:It.restSpeed.default),i||(i=y?It.restDelta.granular:It.restDelta.default);let x;if(v<1){const S=zS(b,v);x=P=>{const C=Math.exp(-v*b*P);return a-C*((m+v*b*g)/S*Math.sin(S*P)+g*Math.cos(S*P))}}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=P=>{const C=Math.exp(-v*b*P),A=Math.min(S*P,300);return a-C*((m+v*b*g)*Math.sinh(A)+S*g*Math.cosh(A))/S}}const E={calculatedDuration:p&&c||null,next:S=>{const P=x(S);if(p)s.done=S>=c;else{let C=0;v<1&&(C=S===0?bo(m):n3(x,S,P));const A=Math.abs(C)<=n,T=Math.abs(a-P)<=i;s.done=A&&T}return s.value=s.done?a:P,s},toString:()=>{const S=Math.min(i3(E),WS),P=t3(C=>E.next(S*C).value,S,30);return S+"ms "+P}};return E}function Mj({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:d}){const c=e[0],f={done:!1,value:c},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),E=A=>{const T=y(A),D=x(A);f.done=Math.abs(T)<=u,f.value=f.done?b:D};let S,P;const C=A=>{p(f.value)&&(S=A,P=o3({keyframes:[f.value,m(f.value)],velocity:n3(x,A,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:A=>{let T=!1;return!P&&S===void 0&&(T=!0,E(A),C(A)),S!==void 0&&A>=S?P.next(A-S):(!T&&E(A),f)}}}const Qee=Wp(.42,0,1,1),Jee=Wp(0,0,.58,1),a3=Wp(.42,0,.58,1),ete=e=>Array.isArray(e)&&typeof e[0]!="number",UC=e=>Array.isArray(e)&&typeof e[0]=="number",Ij={linear:pn,easeIn:Qee,easeInOut:a3,easeOut:Jee,circIn:MC,circInOut:$B,circOut:RB,backIn:kC,backInOut:MB,backOut:kB,anticipate:IB},Rj=e=>{if(UC(e)){LS(e.length===4);const[t,r,n,i]=e;return Wp(t,r,n,i)}else if(typeof e=="string")return LS(Ij[e]!==void 0),Ij[e];return e},tte=(e,t)=>r=>t(e(r)),Gp=(...e)=>e.reduce(tte),Nt=(e,t,r)=>e+(t-e)*r;function f0(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 rte({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=f0(l,s,e+1/3),o=f0(l,s,e),a=f0(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:n}}function bv(e,t){return r=>r>0?t:e}const p0=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},nte=[VS,Ss,Bl],ite=e=>nte.find(t=>t.test(e));function $j(e){const t=ite(e);if(!t)return!1;let r=t.parse(e);return t===Bl&&(r=rte(r)),r}const Lj=(e,t)=>{const r=$j(e),n=$j(t);if(!r||!n)return bv(e,t);const i={...r};return o=>(i.red=p0(r.red,n.red,o),i.green=p0(r.green,n.green,o),i.blue=p0(r.blue,n.blue,o),i.alpha=Nt(r.alpha,n.alpha,o),Ss.transform(i))},HS=new Set(["none","hidden"]);function ote(e,t){return HS.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function ate(e,t){return r=>Nt(e,t,r)}function zC(e){return typeof e=="number"?ate:typeof e=="string"?IC(e)?bv:br.test(e)?Lj:ute:Array.isArray(e)?s3:typeof e=="object"?br.test(e)?Lj:ste:bv}function s3(e,t){const r=[...e],n=r.length,i=e.map((o,a)=>zC(o)(o,t[a]));return o=>{for(let a=0;a{for(const o in n)r[o]=n[o](i);return r}}function lte(e,t){var r;const n=[],i={color:0,var:0,number:0};for(let o=0;o{const r=Ba.createTransformer(t),n=Af(e),i=Af(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?HS.has(e)&&!i.values.length||HS.has(t)&&!n.values.length?ote(e,t):Gp(s3(lte(n,i),i.values),r):bv(e,t)};function l3(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?Nt(e,t,r):zC(e)(e,t)}function cte(e,t,r){const n=[],i=r||l3,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=cte(t,n,i),s=a.length,l=u=>{let d=0;if(s>1)for(;dl(Do(e[0],e[o-1],u)):l}function fte(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=Bu(0,t,n);e.push(Nt(r,1,i))}}function pte(e){const t=[0];return fte(t,e.length-1),t}function hte(e,t){return e.map(r=>r*t)}function mte(e,t){return e.map(()=>t||a3).splice(0,e.length-1)}function xv({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=ete(n)?n.map(Rj):Rj(n),o={done:!1,value:t[0]},a=hte(r&&r.length===t.length?r:pte(t),e),s=dte(a,t,{ease:Array.isArray(i)?i:mte(t,i)});return{calculatedDuration:e,next:l=>(o.value=s(l),o.done=l>=e,o)}}const vte=e=>{const t=({timestamp:r})=>e(r);return{start:()=>At.update(t,!0),stop:()=>Fa(t),now:()=>cr.isProcessing?cr.timestamp:Wi.now()}},gte={decay:Mj,inertia:Mj,tween:xv,keyframes:xv,spring:o3},yte=e=>e/100;class WC extends e3{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)||RC,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=VC(r)?r:gte[r]||xv;let l,u;s!==xv&&typeof t[0]!="number"&&(l=Gp(yte,l3(t[0],t[1])),t=[0,100]);const d=s({...this.options,keyframes:t});o==="mirror"&&(u=s({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=i3(d));const{calculatedDuration:c}=d,f=c+i,p=f*(n+1)-i;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:c,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:d,resolvedDuration:c}=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-d/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>d;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let x=this.currentTime,E=o;if(p){const A=Math.min(this.currentTime,d)/c;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/c)):m==="mirror"&&(E=a)),x=Do(0,1,D)*c}const S=y?{done:!1,value:l[0]}:E.next(x);s&&(S.value=s(S.value));let{done:P}=S;!y&&u!==null&&(P=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return C&&i!==void 0&&(S.value=Hy(l,this.options,i)),g&&g(S.value),C&&this.finish(),S}get duration(){const{resolved:t}=this;return t?xo(t.calculatedDuration):0}get time(){return xo(this.currentTime)}set time(t){t=bo(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=xo(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=vte,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 bte=new Set(["opacity","clipPath","filter","transform"]);function HC(e){let t;return()=>(t===void 0&&(t=e()),t)}const xte={linearEasing:void 0};function wte(e,t){const r=HC(e);return()=>{var n;return(n=xte[t])!==null&&n!==void 0?n:r()}}const wv=wte(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function u3(e){return!!(typeof e=="function"&&wv()||!e||typeof e=="string"&&(e in GS||wv())||UC(e)||Array.isArray(e)&&e.every(u3))}const bd=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,GS={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:bd([0,.65,.55,1]),circOut:bd([.55,0,1,.45]),backIn:bd([.31,.01,.66,-.59]),backOut:bd([.33,1.53,.69,.99])};function c3(e,t){if(e)return typeof e=="function"&&wv()?t3(e,t):UC(e)?bd(e):Array.isArray(e)?e.map(r=>c3(r,t)||GS.easeOut):GS[e]}function Ste(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 d=c3(s,i);return Array.isArray(d)&&(u.easing=d),e.animate(u,{delay:n,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"})}function Fj(e,t){e.timeline=t,e.onfinish=null}const Ete=HC(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Sv=10,Pte=2e4;function Cte(e){return VC(e.type)||e.type==="spring"||!u3(e.ease)}function Ate(e,t){const r=new WC({...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:d}=this.options;if(!(!((n=l.owner)===null||n===void 0)&&n.current))return!1;if(typeof a=="string"&&wv()&&Tte(a)&&(a=d3[a]),Cte(this.options)){const{onComplete:f,onUpdate:p,motionValue:m,element:v,...g}=this.options,b=Ate(t,g);t=b.keyframes,t.length===1&&(t[1]=t[0]),i=b.duration,o=b.times,a=b.ease,s="keyframes"}const c=Ste(l.owner.current,u,t,{...this.options,duration:i,times:o,ease:a});return c.startTime=d??this.calcStartTime(),this.pendingTimeline?(Fj(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:f}=this.options;l.set(Hy(t,this.options,r)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:c,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 xo(r)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:r}=t;return xo(r.currentTime||0)}set time(t){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=bo(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 pn;const{animation:n}=r;Fj(n,t)}return pn}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:d,onComplete:c,element:f,...p}=this.options,m=new WC({...p,keyframes:n,duration:i,type:o,ease:a,times:s,isGenerator:!0}),v=bo(this.time);u.setWithVelocity(m.sample(v-Sv).value,m.sample(v).value,Sv)}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 Ete()&&n&&bte.has(n)&&r&&r.owner&&r.owner.current instanceof HTMLElement&&!r.owner.getProps().onUpdate&&!i&&o!=="mirror"&&a!==0&&s!=="inertia"}}const Ote=HC(()=>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;nOte()&&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 jte({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const GC=(e,t,r,n={},i,o)=>a=>{const s=DC(n,e)||{},l=s.delay||n.delay||0;let{elapsed:u=0}=n;u=u-bo(l);let d={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};jte(s)||(d={...d,...tee(e,d)}),d.duration&&(d.duration=bo(d.duration)),d.repeatDelay&&(d.repeatDelay=bo(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let c=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(c=!0)),c&&!o&&t.get()!==void 0){const f=Hy(d.keyframes,s);if(f!==void 0)return At.update(()=>{d.onUpdate(f),d.onComplete()}),new _te([])}return!o&&Bj.supports(d)?new Bj(d):new WC(d)},Nte=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Dte=e=>$S(e)?e[e.length-1]||0:e;function KC(e,t){e.indexOf(t)===-1&&e.push(t)}function qC(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class YC{constructor(){this.subscriptions=[]}add(t){return KC(this.subscriptions,t),()=>qC(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 Mte{constructor(t,r={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const o=Wi.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=Wi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=kte(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 YC);const n=this.events[t].add(r);return t==="change"?()=>{n(),At.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=Wi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Vj)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,Vj);return r3(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 Tf(e,t){return new Mte(e,t)}function Ite(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Tf(r))}function Rte(e,t){const r=Wy(e,t);let{transitionEnd:n={},transition:i={},...o}=r||{};o={...o,...n};for(const a in o){const s=Dte(o[a]);Ite(e,a,s)}}const XC=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),$te="framerAppearId",f3="data-"+XC($te);function p3(e){return e.props[f3]}const Er=e=>!!(e&&e.getVelocity);function Lte(e){return!!(Er(e)&&e.add)}function KS(e,t){const r=e.getValue("willChange");if(Lte(r))return r.add(t)}function Fte({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function h3(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=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const c in l){const f=e.getValue(c,(o=e.latestValues[c])!==null&&o!==void 0?o:null),p=l[c];if(p===void 0||d&&Fte(d,c))continue;const m={delay:r,...DC(a||{},c)};let v=!1;if(window.MotionHandoffAnimation){const b=p3(e);if(b){const y=window.MotionHandoffAnimation(b,c,At);y!==null&&(m.startTime=y,v=!0)}}KS(e,c),f.start(GC(c,f,p,e.shouldReduceMotion&&sl.has(c)?{type:!1}:m,e,v));const g=f.animation;g&&u.push(g)}return s&&Promise.all(u).then(()=>{At.update(()=>{s&&Rte(e,s)})}),u}function qS(e,t,r={}){var n;const i=Wy(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(h3(e,i,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:c,staggerDirection:f}=o;return Bte(e,t,d+u,c,f,r)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[a,s]:[s,a];return u().then(()=>d())}else return Promise.all([a(),s(r.delay)])}function Bte(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(Vte).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(qS(u,t,{...o,delay:r+l(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function Vte(e,t){return e.sortNodePosition(t)}function Ute(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(o=>qS(e,o,r));n=Promise.all(i)}else if(typeof t=="string")n=qS(e,t,r);else{const i=typeof t=="function"?Wy(e,t,r.custom):t;n=Promise.all(h3(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}const zte=NC.length;function m3(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?m3(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})=>Ute(e,r,n)))}function Kte(e){let t=Gte(e),r=Uj(),n=!0;const i=l=>(u,d)=>{var c;const f=Wy(e,d,l==="exit"?(c=e.presenceContext)===null||c===void 0?void 0:c.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,d=m3(e.parent)||{},c=[],f=new Set;let p={},m=1/0;for(let g=0;gm&&E,T=!1;const D=Array.isArray(x)?x:[x];let N=D.reduce(i(b),{});S===!1&&(N={});const{prevResolvedValues:_={}}=y,F={..._,...N},k=z=>{A=!0,f.has(z)&&(T=!0,f.delete(z)),y.needsAnimating[z]=!0;const I=e.getValue(z);I&&(I.liveStyle=!1)};for(const z in F){const I=N[z],$=_[z];if(p.hasOwnProperty(z))continue;let j=!1;$S(I)&&$S($)?j=!OB(I,$):j=I!==$,j?I!=null?k(z):f.add(z):I!==void 0&&f.has(z)?k(z):y.protectedKeys[z]=!0}y.prevProp=x,y.prevResolvedValues=N,y.isActive&&(p={...p,...N}),n&&e.blockInitialAnimation&&(A=!1),A&&(!(P&&C)||T)&&c.push(...D.map(z=>({animation:z,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}),c.push({animation:g})}let v=!!c.length;return n&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),n=!1,v?t(c):Promise.resolve()}function s(l,u){var d;if(r[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),r[l].isActive=u;const c=a(l);for(const f in r)r[f].protectedKeys={};return c}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>r,reset:()=>{r=Uj(),n=!0}}}function qte(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!OB(t,e):!1}function ls(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Uj(){return{animate:ls(!0),whileInView:ls(),whileHover:ls(),whileTap:ls(),whileDrag:ls(),whileFocus:ls(),exit:ls()}}class Qa{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Yte extends Qa{constructor(t){super(t),t.animationState||(t.animationState=Kte(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();zy(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 Xte=0;class Zte extends Qa{constructor(){super(...arguments),this.id=Xte++}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 Qte={animation:{Feature:Yte},exit:{Feature:Zte}},Qn={x:!1,y:!1};function v3(){return Qn.x||Qn.y}function Jte(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 g3(e,t){const r=Jte(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function zj(e){return t=>{t.pointerType==="touch"||v3()||e(t)}}function ere(e,t,r={}){const[n,i,o]=g3(e,r),a=zj(s=>{const{target:l}=s,u=t(s);if(!u||!l)return;const d=zj(c=>{u(c),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,i)});return n.forEach(s=>{s.addEventListener("pointerenter",a,i)}),o}const ZC=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,xd=new WeakSet;function Wj(e){return t=>{t.key==="Enter"&&e(t)}}function h0(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const tre=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=Wj(()=>{if(xd.has(r))return;h0(r,"down");const i=Wj(()=>{h0(r,"up")}),o=()=>h0(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)},rre=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function nre(e){return rre.has(e.tagName)||e.tabIndex!==-1}const y3=(e,t)=>t?e===t?!0:y3(e,t.parentElement):!1;function Hj(e){return ZC(e)&&!v3()}function ire(e,t,r={}){const[n,i,o]=g3(e,r),a=s=>{const l=s.currentTarget;if(!Hj(s)||xd.has(l))return;xd.add(l);const u=t(s),d=(p,m)=>{window.removeEventListener("pointerup",c),window.removeEventListener("pointercancel",f),!(!Hj(p)||!xd.has(l))&&(xd.delete(l),u&&u(p,{success:m}))},c=p=>{d(p,r.useGlobalTarget||y3(l,p.target))},f=p=>{d(p,!1)};window.addEventListener("pointerup",c,i),window.addEventListener("pointercancel",f,i)};return n.forEach(s=>{nre(s)||(s.tabIndex=0),(r.useGlobalTarget?window:s).addEventListener("pointerdown",a,i),s.addEventListener("focus",u=>tre(u,i),i)}),o}function ore(e){return e==="x"||e==="y"?Qn[e]?null:(Qn[e]=!0,()=>{Qn[e]=!1}):Qn.x||Qn.y?null:(Qn.x=Qn.y=!0,()=>{Qn.x=Qn.y=!1})}function Kp(e){return{point:{x:e.pageX,y:e.pageY}}}const are=e=>t=>ZC(t)&&e(t,Kp(t));function Of(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function Vd(e,t,r,n){return Of(e,t,are(r),n)}const Gj=(e,t)=>Math.abs(e-t);function sre(e,t){const r=Gj(e.x,t.x),n=Gj(e.y,t.y);return Math.sqrt(r**2+n**2)}class b3{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 c=v0(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=sre(c.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=c,{timestamp:v}=cr;this.history.push({...m,timestamp:v});const{onStart:g,onMove:b}=this.handlers;f||(g&&g(this.lastMoveEvent,c),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,c)},this.handlePointerMove=(c,f)=>{this.lastMoveEvent=c,this.lastMoveEventInfo=m0(f,this.transformPagePoint),At.update(this.updatePoint,!0)},this.handlePointerUp=(c,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=v0(c.type==="pointercancel"?this.lastMoveEventInfo:m0(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(c,g),m&&m(c,g)},!ZC(t))return;this.dragSnapToOrigin=o,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const a=Kp(t),s=m0(a,this.transformPagePoint),{point:l}=s,{timestamp:u}=cr;this.history=[{...l,timestamp:u}];const{onSessionStart:d}=r;d&&d(t,v0(s,this.history)),this.removeListeners=Gp(Vd(this.contextWindow,"pointermove",this.handlePointerMove),Vd(this.contextWindow,"pointerup",this.handlePointerUp),Vd(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Fa(this.updatePoint)}}function m0(e,t){return t?{point:t(e.point)}:e}function Kj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function v0({point:e},t){return{point:e,delta:Kj(e,x3(t)),offset:Kj(e,lre(t)),velocity:ure(t,.1)}}function lre(e){return e[0]}function x3(e){return e[e.length-1]}function ure(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const i=x3(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>bo(t)));)r--;if(!n)return{x:0,y:0};const o=xo(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 Vl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const w3=1e-4,cre=1-w3,dre=1+w3,S3=.01,fre=0-S3,pre=0+S3;function vn(e){return e.max-e.min}function hre(e,t,r){return Math.abs(e-t)<=r}function qj(e,t,r,n=.5){e.origin=n,e.originPoint=Nt(t.min,t.max,e.origin),e.scale=vn(r)/vn(t),e.translate=Nt(r.min,r.max,e.origin)-e.originPoint,(e.scale>=cre&&e.scale<=dre||isNaN(e.scale))&&(e.scale=1),(e.translate>=fre&&e.translate<=pre||isNaN(e.translate))&&(e.translate=0)}function Ud(e,t,r,n){qj(e.x,t.x,r.x,n?n.originX:void 0),qj(e.y,t.y,r.y,n?n.originY:void 0)}function Yj(e,t,r){e.min=r.min+t.min,e.max=e.min+vn(t)}function mre(e,t,r){Yj(e.x,t.x,r.x),Yj(e.y,t.y,r.y)}function Xj(e,t,r){e.min=t.min-r.min,e.max=e.min+vn(t)}function zd(e,t,r){Xj(e.x,t.x,r.x),Xj(e.y,t.y,r.y)}function vre(e,{min:t,max:r},n){return t!==void 0&&er&&(e=n?Nt(r,e,n.max):Math.min(e,r)),e}function Zj(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 gre(e,{top:t,left:r,bottom:n,right:i}){return{x:Zj(e.x,r,i),y:Zj(e.y,t,n)}}function Qj(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.minn?r=Bu(t.min,t.max-n,e.min):n>i&&(r=Bu(e.min,e.max-i,t.min)),Do(0,1,r)}function xre(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 YS=.35;function wre(e=YS){return e===!1?e=0:e===!0&&(e=YS),{x:Jj(e,"left","right"),y:Jj(e,"top","bottom")}}function Jj(e,t,r){return{min:eN(e,t),max:eN(e,r)}}function eN(e,t){return typeof e=="number"?e:e[t]||0}const tN=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ul=()=>({x:tN(),y:tN()}),rN=()=>({min:0,max:0}),Bt=()=>({x:rN(),y:rN()});function An(e){return[e("x"),e("y")]}function E3({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function Sre({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ere(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 g0(e){return e===void 0||e===1}function XS({scale:e,scaleX:t,scaleY:r}){return!g0(e)||!g0(t)||!g0(r)}function ps(e){return XS(e)||P3(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function P3(e){return nN(e.x)||nN(e.y)}function nN(e){return e&&e!=="0%"}function Ev(e,t,r){const n=e-r,i=t*n;return r+i}function iN(e,t,r,n,i){return i!==void 0&&(e=Ev(e,i,n)),Ev(e,r,n)+t}function ZS(e,t=0,r=1,n,i){e.min=iN(e.min,t,r,n,i),e.max=iN(e.max,t,r,n,i)}function C3(e,{x:t,y:r}){ZS(e.x,t.translate,t.scale,t.originPoint),ZS(e.y,r.translate,r.scale,r.originPoint)}const oN=.999999999999,aN=1.0000000000001;function Pre(e,t,r,n=!1){const i=r.length;if(!i)return;t.x=t.y=1;let o,a;for(let s=0;soN&&(t.x=1),t.yoN&&(t.y=1)}function zl(e,t){e.min=e.min+t,e.max=e.max+t}function sN(e,t,r,n,i=.5){const o=Nt(e.min,e.max,i);ZS(e,t,r,o,n)}function Wl(e,t){sN(e.x,t.x,t.scaleX,t.scale,t.originX),sN(e.y,t.y,t.scaleY,t.scale,t.originY)}function A3(e,t){return E3(Ere(e.getBoundingClientRect(),t))}function Cre(e,t,r){const n=A3(e,r),{scroll:i}=t;return i&&(zl(n.x,i.offset.x),zl(n.y,i.offset.y)),n}const T3=({current:e})=>e?e.ownerDocument.defaultView:null,Are=new WeakMap;class Tre{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=Bt(),this.visualElement=t}start(t,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:c}=this.getProps();c?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Kp(d).point)},o=(d,c)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ore(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),An(g=>{let b=this.getAxisMotionValue(g).get()||0;if(zi.test(b)){const{projection:y}=this.visualElement;if(y&&y.layout){const x=y.layout.layoutBox[g];x&&(b=vn(x)*(parseFloat(b)/100))}}this.originPoint[g]=b}),m&&At.postRender(()=>m(d,c)),KS(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},a=(d,c)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:v}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:g}=c;if(p&&this.currentDirection===null){this.currentDirection=Ore(g),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",c.point,g),this.updateAxis("y",c.point,g),this.visualElement.render(),v&&v(d,c)},s=(d,c)=>this.stop(d,c),l=()=>An(d=>{var c;return this.getAnimationState(d)==="paused"&&((c=this.getAxisMotionValue(d).animation)===null||c===void 0?void 0:c.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new b3(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:s,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:T3(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&&At.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||!zh(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(a=vre(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&&Vl(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=gre(i.layoutBox,r):this.constraints=!1,this.elastic=wre(n),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&An(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=xre(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Vl(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Cre(n,i.root,this.visualElement.getTransformPagePoint());let a=yre(i.layout.layoutBox,o);if(r){const s=r(Sre(a));this.hasMutatedConstraints=!!s,s&&(a=E3(s))}return a}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=An(d=>{if(!zh(d,r,this.currentDirection))return;let c=l&&l[d]||{};a&&(c={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:n?t[d]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...o,...c};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(s)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return KS(this.visualElement,t),n.start(GC(t,n,0,r,this.visualElement,!1))}stopAnimation(){An(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){An(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){An(r=>{const{drag:n}=this.getProps();if(!zh(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]-Nt(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Vl(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};An(a=>{const s=this.getAxisMotionValue(a);if(s&&this.constraints!==!1){const l=s.get();i[a]=bre({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(),An(a=>{if(!zh(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(Nt(l,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;Are.set(this.visualElement,this);const t=this.visualElement.current,r=Vd(t,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();Vl(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()),At.read(n);const a=Of(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(An(d=>{const c=this.getAxisMotionValue(d);c&&(this.originPoint[d]+=l[d].translate,c.set(c.get()+l[d].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=YS,dragMomentum:s=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function zh(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function Ore(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 Qa{constructor(t){super(t),this.removeGroupControls=pn,this.removeListeners=pn,this.controls=new Tre(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||pn}unmount(){this.removeGroupControls(),this.removeListeners()}}const lN=e=>(t,r)=>{e&&At.postRender(()=>e(t,r))};class jre extends Qa{constructor(){super(...arguments),this.removePointerDownListener=pn}onPointerDown(t){this.session=new b3(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:T3(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:lN(t),onStart:lN(r),onMove:n,onEnd:(o,a)=>{delete this.session,i&&At.postRender(()=>i(o,a))}}}mount(){this.removePointerDownListener=Vd(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 Gy=w.createContext(null);function Nre(){const e=w.useContext(Gy);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 QC=w.createContext({}),O3=w.createContext({}),jm={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uN(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const td={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Me.test(e))e=parseFloat(e);else return e;const r=uN(e,t.target.x),n=uN(e,t.target.y);return`${r}% ${n}%`}},Dre={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,i=Ba.parse(e);if(i.length>5)return n;const o=Ba.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=Nt(s,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),o(i)}},Pv={};function kre(e){Object.assign(Pv,e)}const{schedule:JC,cancel:cIe}=_B(queueMicrotask,!1);class Mre extends w.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:o}=t;kre(Ire),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()})),jm.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()||At.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),JC.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 _3(e){const[t,r]=Nre(),n=w.useContext(QC);return h.jsx(Mre,{...e,layoutGroup:n,switchLayoutGroup:w.useContext(O3),isPresent:t,safeToRemove:r})}const Ire={borderRadius:{...td,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:td,borderTopRightRadius:td,borderBottomLeftRadius:td,borderBottomRightRadius:td,boxShadow:Dre},j3=["TopLeft","TopRight","BottomLeft","BottomRight"],Rre=j3.length,cN=e=>typeof e=="string"?parseFloat(e):e,dN=e=>typeof e=="number"||Me.test(e);function $re(e,t,r,n,i,o){i?(e.opacity=Nt(0,r.opacity!==void 0?r.opacity:1,Lre(n)),e.opacityExit=Nt(t.opacity!==void 0?t.opacity:1,0,Fre(n))):o&&(e.opacity=Nt(t.opacity!==void 0?t.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let a=0;ant?1:r(Bu(e,t,n))}function pN(e,t){e.min=t.min,e.max=t.max}function Sn(e,t){pN(e.x,t.x),pN(e.y,t.y)}function hN(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function mN(e,t,r,n,i){return e-=t,e=Ev(e,1/r,n),i!==void 0&&(e=Ev(e,1/i,n)),e}function Bre(e,t=0,r=1,n=.5,i,o=e,a=e){if(zi.test(t)&&(t=parseFloat(t),t=Nt(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=Nt(o.min,o.max,n);e===o&&(s-=t),e.min=mN(e.min,t,r,s,i),e.max=mN(e.max,t,r,s,i)}function vN(e,t,[r,n,i],o,a){Bre(e,t[r],t[n],t[i],t.scale,o,a)}const Vre=["x","scaleX","originX"],Ure=["y","scaleY","originY"];function gN(e,t,r,n){vN(e.x,t,Vre,r?r.x:void 0,n?n.x:void 0),vN(e.y,t,Ure,r?r.y:void 0,n?n.y:void 0)}function yN(e){return e.translate===0&&e.scale===1}function D3(e){return yN(e.x)&&yN(e.y)}function bN(e,t){return e.min===t.min&&e.max===t.max}function zre(e,t){return bN(e.x,t.x)&&bN(e.y,t.y)}function xN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function k3(e,t){return xN(e.x,t.x)&&xN(e.y,t.y)}function wN(e){return vn(e.x)/vn(e.y)}function SN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Wre{constructor(){this.members=[]}add(t){KC(this.members,t),t.scheduleRender()}remove(t){if(qC(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 Hre(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:d,rotateX:c,rotateY:f,skewX:p,skewY:m}=r;u&&(n=`perspective(${u}px) ${n}`),d&&(n+=`rotate(${d}deg) `),c&&(n+=`rotateX(${c}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 Gre=(e,t)=>e.depth-t.depth;class Kre{constructor(){this.children=[],this.isDirty=!1}add(t){KC(this.children,t),this.isDirty=!0}remove(t){qC(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Gre),this.isDirty=!1,this.children.forEach(t)}}function Nm(e){const t=Er(e)?e.get():e;return Nte(t)?t.toValue():t}function qre(e,t){const r=Wi.now(),n=({timestamp:i})=>{const o=i-r;o>=t&&(Fa(n),e(o-t))};return At.read(n,!0),()=>Fa(n)}function Yre(e){return e instanceof SVGElement&&e.tagName!=="svg"}function Xre(e,t,r){const n=Er(e)?e:Tf(e);return n.start(GC("",n,t,r)),n.animation}const hs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},wd=typeof window<"u"&&window.MotionDebug!==void 0,y0=["","X","Y","Z"],Zre={visibility:"hidden"},EN=1e3;let Qre=0;function b0(e,t,r,n){const{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function M3(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=p3(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",At,!(i||o))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&M3(n)}function I3({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(a={},s=t==null?void 0:t()){this.id=Qre++,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,wd&&(hs.totalNodes=hs.resolvedTargetDeltas=hs.recalculatedProjection=0),this.nodes.forEach(tne),this.nodes.forEach(ane),this.nodes.forEach(sne),this.nodes.forEach(rne),wd&&window.MotionDebug.record(hs)},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,c&&c(),c=qre(f,250),jm.hasAnimatedSinceResize&&(jm.hasAnimatedSinceResize=!1,this.nodes.forEach(CN))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:c,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||d.getDefaultTransition()||fne,{onLayoutAnimationStart:g,onLayoutAnimationComplete:b}=d.getProps(),y=!this.targetLayout||!k3(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(c,x);const E={...DC(v,"layout"),onPlay:g,onComplete:b};(d.shouldReduceMotion||this.options.layoutRoot)&&(E.delay=0,E.type=!1),this.startAnimation(E)}else f||CN(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,Fa(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(lne),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&&M3(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{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=E/1e3;AN(c.x,a.x,S),AN(c.y,a.y,S),this.setTargetDelta(c),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(zd(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),cne(this.relativeTarget,this.relativeTargetOrigin,f,S),x&&zre(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=Bt()),Sn(x,this.relativeTarget)),v&&(this.animationValues=d,$re(d,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&&(Fa(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=At.update(()=>{jm.hasAnimatedSinceResize=!0,this.currentAnimation=Xre(0,EN,{...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(EN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:d}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&R3(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Bt();const c=vn(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+c;const f=vn(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+f}Sn(s,l),Wl(s,d),Ud(this.projectionDeltaWithTransform,this.layoutCorrected,s,d)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new Wre),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&&b0("z",a,u,this.animationValues);for(let d=0;d{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(PN),this.root.sharedNodes.clear()}}}function Jre(e){e.updateLayout()}function ene(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"?An(c=>{const f=a?r.measuredBox[c]:r.layoutBox[c],p=vn(f);f.min=n[c].min,f.max=f.min+p}):R3(o,r.layoutBox,n)&&An(c=>{const f=a?r.measuredBox[c]:r.layoutBox[c],p=vn(n[c]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[c].max=e.relativeTarget[c].min+p)});const s=Ul();Ud(s,n,r.layoutBox);const l=Ul();a?Ud(l,e.applyTransform(i,!0),r.measuredBox):Ud(l,n,r.layoutBox);const u=!D3(s);let d=!1;if(!e.resumeFrom){const c=e.getClosestProjectingParent();if(c&&!c.resumeFrom){const{snapshot:f,layout:p}=c;if(f&&p){const m=Bt();zd(m,r.layoutBox,f.layoutBox);const v=Bt();zd(v,n,p.layoutBox),k3(m,v)||(d=!0),c.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=m,e.relativeParent=c)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function tne(e){wd&&hs.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 rne(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function nne(e){e.clearSnapshot()}function PN(e){e.clearMeasurements()}function ine(e){e.isLayoutDirty=!1}function one(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function CN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ane(e){e.resolveTargetDelta()}function sne(e){e.calcProjection()}function lne(e){e.resetSkewAndRotation()}function une(e){e.removeLeadSnapshot()}function AN(e,t,r){e.translate=Nt(t.translate,0,r),e.scale=Nt(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function TN(e,t,r,n){e.min=Nt(t.min,r.min,n),e.max=Nt(t.max,r.max,n)}function cne(e,t,r,n){TN(e.x,t.x,r.x,n),TN(e.y,t.y,r.y,n)}function dne(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const fne={duration:.45,ease:[.4,0,.1,1]},ON=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),_N=ON("applewebkit/")&&!ON("chrome/")?Math.round:pn;function jN(e){e.min=_N(e.min),e.max=_N(e.max)}function pne(e){jN(e.x),jN(e.y)}function R3(e,t,r){return e==="position"||e==="preserve-aspect"&&!hre(wN(t),wN(r),.2)}function hne(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const mne=I3({attachResizeListener:(e,t)=>Of(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),x0={current:void 0},$3=I3({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!x0.current){const e=new mne({});e.mount(window),e.setOptions({layoutScroll:!0}),x0.current=e}return x0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),vne={pan:{Feature:jre},drag:{Feature:_re,ProjectionNode:$3,MeasureLayout:_3}};function NN(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&&At.postRender(()=>o(t,Kp(t)))}class gne extends Qa{mount(){const{current:t}=this.node;t&&(this.unmount=ere(t,r=>(NN(this.node,r,"Start"),n=>NN(this.node,n,"End"))))}unmount(){}}class yne extends Qa{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=Gp(Of(this.node.current,"focus",()=>this.onFocus()),Of(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function DN(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&&At.postRender(()=>o(t,Kp(t)))}class bne extends Qa{mount(){const{current:t}=this.node;t&&(this.unmount=ire(t,r=>(DN(this.node,r,"Start"),(n,{success:i})=>DN(this.node,n,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const QS=new WeakMap,w0=new WeakMap,xne=e=>{const t=QS.get(e.target);t&&t(e)},wne=e=>{e.forEach(xne)};function Sne({root:e,...t}){const r=e||document;w0.has(r)||w0.set(r,{});const n=w0.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(wne,{root:e,...t})),n[i]}function Ene(e,t,r){const n=Sne(t);return QS.set(e,r),n.observe(e),()=>{QS.delete(e),n.unobserve(e)}}const Pne={some:0,all:1};class Cne extends Qa{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:Pne[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:d,onViewportLeave:c}=this.node.getProps(),f=u?d:c;f&&f(l)};return Ene(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(Ane(t,r))&&this.startObserver()}unmount(){}}function Ane({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const Tne={inView:{Feature:Cne},tap:{Feature:bne},focus:{Feature:yne},hover:{Feature:gne}},One={layout:{ProjectionNode:$3,MeasureLayout:_3}},eA=w.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Ky=w.createContext({}),tA=typeof window<"u",L3=tA?w.useLayoutEffect:w.useEffect,F3=w.createContext({strict:!1});function _ne(e,t,r,n,i){var o,a;const{visualElement:s}=w.useContext(Ky),l=w.useContext(F3),u=w.useContext(Gy),d=w.useContext(eA).reducedMotion,c=w.useRef(null);n=n||l.renderer,!c.current&&n&&(c.current=n(e,{visualState:t,parent:s,props:r,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d}));const f=c.current,p=w.useContext(O3);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&jne(c.current,r,i,p);const m=w.useRef(!1);w.useInsertionEffect(()=>{f&&m.current&&f.update(r,u)});const v=r[f3],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 L3(()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),JC.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 jne(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:B3(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!a||s&&Vl(s),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:u})}function B3(e){if(e)return e.options.allowProjection!==!1?e.projection:B3(e.parent)}function Nne(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):Vl(r)&&(r.current=n))},[t])}function qy(e){return zy(e.animate)||NC.some(t=>Pf(e[t]))}function V3(e){return!!(qy(e)||e.variants)}function Dne(e,t){if(qy(e)){const{initial:r,animate:n}=e;return{initial:r===!1||Pf(r)?r:void 0,animate:Pf(n)?n:void 0}}return e.inherit!==!1?t:{}}function kne(e){const{initial:t,animate:r}=Dne(e,w.useContext(Ky));return w.useMemo(()=>({initial:t,animate:r}),[kN(t),kN(r)])}function kN(e){return Array.isArray(e)?e.join(" "):e}const MN={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"]},Vu={};for(const e in MN)Vu[e]={isEnabled:t=>MN[e].some(r=>!!t[r])};function Mne(e){for(const t in e)Vu[t]={...Vu[t],...e[t]}}const Ine=Symbol.for("motionComponentSymbol");function Rne({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:n,Component:i}){e&&Mne(e);function o(s,l){let u;const d={...w.useContext(eA),...s,layoutId:$ne(s)},{isStatic:c}=d,f=kne(s),p=n(s,c);if(!c&&tA){Lne();const m=Fne(d);u=m.MeasureLayout,f.visualElement=_ne(i,p,d,t,m.ProjectionNode)}return h.jsxs(Ky.Provider,{value:f,children:[u&&f.visualElement?h.jsx(u,{visualElement:f.visualElement,...d}):null,r(i,s,Nne(p,f.visualElement,l),p,c,f.visualElement)]})}const a=w.forwardRef(o);return a[Ine]=i,a}function $ne({layoutId:e}){const t=w.useContext(QC).id;return t&&e!==void 0?t+"-"+e:e}function Lne(e,t){w.useContext(F3).strict}function Fne(e){const{drag:t,layout:r}=Vu;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 Bne=["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 rA(e){return typeof e!="string"||e.includes("-")?!1:!!(Bne.indexOf(e)>-1||/[A-Z]/u.test(e))}function U3(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 z3=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 W3(e,t,r,n){U3(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(z3.has(i)?i:XC(i),t.attrs[i])}function H3(e,{layout:t,layoutId:r}){return sl.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Pv[e]||e==="opacity")}function nA(e,t,r){var n;const{style:i}=e,o={};for(const a in i)(Er(i[a])||t.style&&Er(t.style[a])||H3(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 G3(e,t,r){const n=nA(e,t,r);for(const i in e)if(Er(e[i])||Er(t[i])){const o=zp.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[o]=e[i]}return n}function iA(e){const t=w.useRef(null);return t.current===null&&(t.current=e()),t.current}function Vne({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:r},n,i,o){const a={latestValues:Une(n,i,o,e),renderState:t()};return r&&(a.mount=s=>r(n,s,a)),a}const K3=e=>(t,r)=>{const n=w.useContext(Ky),i=w.useContext(Gy),o=()=>Vne(e,t,n,i);return r?o():iA(o)};function Une(e,t,r,n){const i={},o=n(e,{});for(const f in o)i[f]=Nm(o[f]);let{initial:a,animate:s}=e;const l=qy(e),u=V3(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let d=r?r.initial===!1:!1;d=d||a===!1;const c=d?s:a;if(c&&typeof c!="boolean"&&!zy(c)){const f=Array.isArray(c)?c:[c];for(let p=0;p({style:{},transform:{},transformOrigin:{},vars:{}}),q3=()=>({...oA(),attrs:{}}),Y3=(e,t)=>t&&typeof e=="number"?t.transform(e):e,zne={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Wne=zp.length;function Hne(e,t,r){let n="",i=!0;for(let o=0;otypeof e=="string"&&e.toLowerCase()==="svg",Xne={useVisualState:K3({scrapeMotionValuesFromProps:G3,createRenderState:q3,onMount:(e,t,{renderState:r,latestValues:n})=>{At.read(()=>{try{r.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),At.render(()=>{sA(r,n,lA(t.tagName),e.transformTemplate),W3(t,r)})}})},Zne={useVisualState:K3({scrapeMotionValuesFromProps:nA,createRenderState:oA})};function X3(e,t,r){for(const n in t)!Er(t[n])&&!H3(n,r)&&(e[n]=t[n])}function Qne({transformTemplate:e},t){return w.useMemo(()=>{const r=oA();return aA(r,t,e),Object.assign({},r.vars,r.style)},[t])}function Jne(e,t){const r=e.style||{},n={};return X3(n,r,e),Object.assign(n,Qne(e,t)),n}function eie(e,t){const r={},n=Jne(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 tie=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 Cv(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||tie.has(e)}let Z3=e=>!Cv(e);function rie(e){e&&(Z3=t=>t.startsWith("on")?!Cv(t):e(t))}try{rie(require("@emotion/is-prop-valid").default)}catch{}function nie(e,t,r){const n={};for(const i in e)i==="values"&&typeof e.values=="object"||(Z3(i)||r===!0&&Cv(i)||!t&&!Cv(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}function iie(e,t,r,n){const i=w.useMemo(()=>{const o=q3();return sA(o,t,lA(n),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};X3(o,e.style,e),i.style={...o,...i.style}}return i}function oie(e=!1){return(r,n,i,{latestValues:o},a)=>{const l=(rA(r)?iie:eie)(n,o,a,r),u=nie(n,typeof r=="string",e),d=r!==w.Fragment?{...u,...l,ref:i}:{},{children:c}=n,f=w.useMemo(()=>Er(c)?c.get():c,[c]);return w.createElement(r,{...d,children:f})}}function aie(e,t){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){const a={...rA(n)?Xne:Zne,preloadedFeatures:e,useRender:oie(i),createVisualElement:t,Component:n};return Rne(a)}}const JS={current:null},Q3={current:!1};function sie(){if(Q3.current=!0,!!tA)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>JS.current=e.matches;e.addListener(t),t()}else JS.current=!1}function lie(e,t,r){for(const n in t){const i=t[n],o=r[n];if(Er(i))e.addValue(n,i);else if(Er(o))e.addValue(n,Tf(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,Tf(a!==void 0?a:i,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const RN=new WeakMap,uie=[...WB,br,Ba],cie=e=>uie.find(zB(e)),$N=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class die{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=RC,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=Wi.now();this.renderScheduledAtthis.bindToMotionValue(n,r)),Q3.current||sie(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:JS.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){RN.delete(this.current),this.projection&&this.projection.unmount(),Fa(this.notifyUpdate),Fa(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=sl.has(t),i=r.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&At.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 Vu){const r=Vu[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):Bt()}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;n<$N.length;n++){const i=$N[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o="on"+i,a=t[o];a&&(this.propEventSubscriptions[i]=this.on(i,a))}this.prevMotionValues=lie(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.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=Tf(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"&&(FB(i)||LB(i))?i=parseFloat(i):!cie(i)&&Ba.test(r)&&(i=QB(t,r)),this.setBaseTarget(t,Er(i)?i.get():i)),Er(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=_C(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&&!Er(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 YC),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}}class J3 extends die{constructor(){super(...arguments),this.KeyframeResolver=JB}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;Er(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function fie(e){return window.getComputedStyle(e)}class pie extends J3{constructor(){super(...arguments),this.type="html",this.renderInstance=U3}readValueFromInstance(t,r){if(sl.has(r)){const n=BC(r);return n&&n.default||0}else{const n=fie(t),i=(VB(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:r}){return A3(t,r)}build(t,r,n){aA(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return nA(t,r,n)}}class hie extends J3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Bt}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(sl.has(r)){const n=BC(r);return n&&n.default||0}return r=z3.has(r)?r:XC(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return G3(t,r,n)}build(t,r,n){sA(t,r,this.isSVGTag,n.transformTemplate)}renderInstance(t,r,n,i){W3(t,r,n,i)}mount(t){this.isSVGTag=lA(t.tagName),super.mount(t)}}const mie=(e,t)=>rA(e)?new hie(t):new pie(t,{allowProjection:e!==w.Fragment}),vie=aie({...Qte,...Tne,...vne,...One},mie),Av=XJ(vie);class gie 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 yie({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(eA);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 d=document.createElement("style");return o&&(d.nonce=o),document.head.appendChild(d),d.sheet&&d.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(d)}},[t]),h.jsx(gie,{isPresent:t,childRef:n,sizeRef:i,children:w.cloneElement(e,{ref:n})})}const bie=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=iA(xie),l=w.useId(),u=w.useCallback(c=>{s.set(c,!0);for(const f of s.values())if(!f)return;n&&n()},[s,n]),d=w.useMemo(()=>({id:l,initial:t,isPresent:r,custom:i,onExitComplete:u,register:c=>(s.set(c,!1),()=>s.delete(c))}),o?[Math.random(),u]:[r,u]);return w.useMemo(()=>{s.forEach((c,f)=>s.set(f,!1))},[r]),w.useEffect(()=>{!r&&!s.size&&n&&n()},[r]),a==="popLayout"&&(e=h.jsx(yie,{isPresent:r,children:e})),h.jsx(Gy.Provider,{value:d,children:e})};function xie(){return new Map}const Wh=e=>e.key||"";function LN(e){const t=[];return w.Children.forEach(e,r=>{w.isValidElement(r)&&t.push(r)}),t}const eV=({children:e,exitBeforeEnter:t,custom:r,initial:n=!0,onExitComplete:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{const s=w.useMemo(()=>LN(e),[e]),l=s.map(Wh),u=w.useRef(!0),d=w.useRef(s),c=iA(()=>new Map),[f,p]=w.useState(s),[m,v]=w.useState(s);L3(()=>{u.current=!1,d.current=s;for(let y=0;y{const x=Wh(y),E=s===m||l.includes(x),S=()=>{if(c.has(x))c.set(x,!0);else return;let P=!0;c.forEach(C=>{C||(P=!1)}),P&&(b==null||b(),v(d.current),i&&i())};return h.jsx(bie,{isPresent:E,initial:!u.current||n?void 0:!1,custom:E?void 0:r,presenceAffectsLayout:o,mode:a,onExitComplete:E?void 0:S,children:y},x)})})};var qp={};(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 j=new OffscreenCanvas(1,1),O=j.getContext("2d");O.fillRect(0,0,1,1);var U=j.transferToImageBitmap();try{O.createPattern(U,"no-repeat")}catch{return!1}return!0}();function l(){}function u(j){var O=r.exports.Promise,U=O!==void 0?O:t.Promise;return typeof U=="function"?new U(j):(j(l,l),null)}var d=function(j,O){return{transform:function(U){if(j)return U;if(O.has(U))return O.get(U);var Y=new OffscreenCanvas(U.width,U.height),re=Y.getContext("2d");return re.drawImage(U,0,0),O.set(U,Y),Y},clear:function(){O.clear()}}}(s,new Map),c=function(){var j=Math.floor(16.666666666666668),O,U,Y={},re=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(O=function(ce){var de=Math.random();return Y[de]=requestAnimationFrame(function Z(ne){re===ne||re+j-1{const a=n?No:"button";return h.jsx(a,{className:ke(uA({variant:t,size:r,className:e})),ref:o,...i})});Be.displayName="Button";var Sie=w.createContext(void 0);function cA(e){const t=w.useContext(Sie);return e||t||"ltr"}var S0=0;function dA(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??FN()),document.body.insertAdjacentElement("beforeend",e[1]??FN()),S0++,()=>{S0===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),S0--}},[])}function FN(){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 E0="focusScope.autoFocusOnMount",P0="focusScope.autoFocusOnUnmount",BN={bubbles:!1,cancelable:!0},Eie="FocusScope",Yy=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[s,l]=w.useState(null),u=Ar(i),d=Ar(o),c=w.useRef(null),f=lt(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 E=x.target;s.contains(E)?c.current=E:ra(c.current,{select:!0})},g=function(x){if(p.paused||!s)return;const E=x.relatedTarget;E!==null&&(s.contains(E)||ra(c.current,{select:!0}))},b=function(x){if(document.activeElement===document.body)for(const S of x)S.removedNodes.length>0&&ra(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){UN.add(p);const v=document.activeElement;if(!s.contains(v)){const b=new CustomEvent(E0,BN);s.addEventListener(E0,u),s.dispatchEvent(b),b.defaultPrevented||(Pie(_ie(tV(s)),{select:!0}),document.activeElement===v&&ra(s))}return()=>{s.removeEventListener(E0,u),setTimeout(()=>{const b=new CustomEvent(P0,BN);s.addEventListener(P0,d),s.dispatchEvent(b),b.defaultPrevented||ra(v??document.body,{select:!0}),s.removeEventListener(P0,d),UN.remove(p)},0)}}},[s,u,d,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,E]=Cie(y);x&&E?!v.shiftKey&&b===E?(v.preventDefault(),r&&ra(x,{select:!0})):v.shiftKey&&b===x&&(v.preventDefault(),r&&ra(E,{select:!0})):b===y&&v.preventDefault()}},[r,n,p.paused]);return h.jsx(Ke.div,{tabIndex:-1,...a,ref:f,onKeyDown:m})});Yy.displayName=Eie;function Pie(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ra(n,{select:t}),document.activeElement!==r)return}function Cie(e){const t=tV(e),r=VN(t,e),n=VN(t.reverse(),e);return[r,n]}function tV(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 VN(e,t){for(const r of e)if(!Aie(r,{upTo:t}))return r}function Aie(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 Tie(e){return e instanceof HTMLInputElement&&"select"in e}function ra(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Tie(e)&&t&&e.select()}}var UN=Oie();function Oie(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=zN(e,t),e.unshift(t)},remove(t){var r;e=zN(e,t),(r=e[0])==null||r.resume()}}}function zN(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 jie=MR.useId||(()=>{}),Nie=0;function wo(e){const[t,r]=w.useState(jie());return Tr(()=>{r(n=>n??String(Nie++))},[e]),t?`radix-${t}`:""}const Die=["top","right","bottom","left"],Va=Math.min,an=Math.max,Tv=Math.round,Hh=Math.floor,Hi=e=>({x:e,y:e}),kie={left:"right",right:"left",bottom:"top",top:"bottom"},Mie={start:"end",end:"start"};function e1(e,t,r){return an(e,Va(t,r))}function ko(e,t){return typeof e=="function"?e(t):e}function Mo(e){return e.split("-")[0]}function Pc(e){return e.split("-")[1]}function fA(e){return e==="x"?"y":"x"}function pA(e){return e==="y"?"height":"width"}function Ua(e){return["top","bottom"].includes(Mo(e))?"y":"x"}function hA(e){return fA(Ua(e))}function Iie(e,t,r){r===void 0&&(r=!1);const n=Pc(e),i=hA(e),o=pA(i);let a=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Ov(a)),[a,Ov(a)]}function Rie(e){const t=Ov(e);return[t1(e),t,t1(t)]}function t1(e){return e.replace(/start|end/g,t=>Mie[t])}function $ie(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 Lie(e,t,r,n){const i=Pc(e);let o=$ie(Mo(e),r==="start",n);return i&&(o=o.map(a=>a+"-"+i),t&&(o=o.concat(o.map(t1)))),o}function Ov(e){return e.replace(/left|right|bottom|top/g,t=>kie[t])}function Fie(e){return{top:0,right:0,bottom:0,left:0,...e}}function rV(e){return typeof e!="number"?Fie(e):{top:e,right:e,bottom:e,left:e}}function _v(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 WN(e,t,r){let{reference:n,floating:i}=e;const o=Ua(t),a=hA(t),s=pA(a),l=Mo(t),u=o==="y",d=n.x+n.width/2-i.width/2,c=n.y+n.height/2-i.height/2,f=n[s]/2-i[s]/2;let p;switch(l){case"top":p={x:d,y:n.y-i.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:c};break;case"left":p={x:n.x-i.width,y:c};break;default:p={x:n.x,y:n.y}}switch(Pc(t)){case"start":p[a]-=f*(r&&u?-1:1);break;case"end":p[a]+=f*(r&&u?-1:1);break}return p}const Bie=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:d,y:c}=WN(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:d=0}=ko(e,t)||{};if(u==null)return{};const c=rV(d),f={x:r,y:n},p=hA(i),m=pA(p),v=await a.getDimensions(u),g=p==="y",b=g?"top":"left",y=g?"bottom":"right",x=g?"clientHeight":"clientWidth",E=o.reference[m]+o.reference[p]-f[p]-o.floating[m],S=f[p]-o.reference[p],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let C=P?P[x]:0;(!C||!await(a.isElement==null?void 0:a.isElement(P)))&&(C=s.floating[x]||o.floating[m]);const A=E/2-S/2,T=C/2-v[m]/2-1,D=Va(c[b],T),N=Va(c[y],T),_=D,F=C-v[m]-N,k=C/2-v[m]/2+A,B=e1(_,k,F),V=!l.arrow&&Pc(i)!=null&&k!==B&&o.reference[m]/2-(k<_?D:N)-v[m]/2<0,z=V?k<_?k-_:k-F:0;return{[p]:f[p]+z,data:{[p]:B,centerOffset:k-B-z,...V&&{alignmentOffset:z}},reset:V}}}),Uie=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:d=!0,crossAxis:c=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=ko(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const b=Mo(i),y=Ua(s),x=Mo(s)===s,E=await(l.isRTL==null?void 0:l.isRTL(u.floating)),S=f||(x||!v?[Ov(s)]:Rie(s)),P=m!=="none";!f&&P&&S.push(...Lie(s,v,m,E));const C=[s,...S],A=await _f(t,g),T=[];let D=((n=o.flip)==null?void 0:n.overflows)||[];if(d&&T.push(A[b]),c){const k=Iie(i,a,E);T.push(A[k[0]],A[k[1]])}if(D=[...D,{placement:i,overflows:T}],!T.every(k=>k<=0)){var N,_;const k=(((N=o.flip)==null?void 0:N.index)||0)+1,B=C[k];if(B)return{data:{index:k,overflows:D},reset:{placement:B}};let V=(_=D.filter(z=>z.overflows[0]<=0).sort((z,I)=>z.overflows[1]-I.overflows[1])[0])==null?void 0:_.placement;if(!V)switch(p){case"bestFit":{var F;const z=(F=D.filter(I=>{if(P){const $=Ua(I.placement);return $===y||$==="y"}return!0}).map(I=>[I.placement,I.overflows.filter($=>$>0).reduce(($,j)=>$+j,0)]).sort((I,$)=>I[1]-$[1])[0])==null?void 0:F[0];z&&(V=z);break}case"initialPlacement":V=s;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function HN(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function GN(e){return Die.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}=ko(e,t);switch(n){case"referenceHidden":{const o=await _f(t,{...i,elementContext:"reference"}),a=HN(o,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:GN(a)}}}case"escaped":{const o=await _f(t,{...i,altBoundary:!0}),a=HN(o,r.floating);return{data:{escapedOffsets:a,escaped:GN(a)}}}default:return{}}}}};async function Wie(e,t){const{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),a=Mo(r),s=Pc(r),l=Ua(r)==="y",u=["left","top"].includes(a)?-1:1,d=o&&l?-1:1,c=ko(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return s&&typeof m=="number"&&(p=s==="end"?m*-1:m),l?{x:p*d,y:f*u}:{x:f*u,y:p*d}}const Hie=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 Wie(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}}}}},Gie=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}=ko(e,t),u={x:r,y:n},d=await _f(t,l),c=Ua(Mo(i)),f=fA(c);let p=u[f],m=u[c];if(o){const g=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=p+d[g],x=p-d[b];p=e1(y,p,x)}if(a){const g=c==="y"?"top":"left",b=c==="y"?"bottom":"right",y=m+d[g],x=m-d[b];m=e1(y,m,x)}const v=s.fn({...t,[f]:p,[c]:m});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[f]:o,[c]:a}}}}}},Kie=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}=ko(e,t),d={x:r,y:n},c=Ua(i),f=fA(c);let p=d[f],m=d[c];const v=ko(s,t),g=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const x=f==="y"?"height":"width",E=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",E=["top","left"].includes(Mo(i)),S=o.reference[c]-o.floating[x]+(E&&((b=a.offset)==null?void 0:b[c])||0)+(E?0:g.crossAxis),P=o.reference[c]+o.reference[x]+(E?0:((y=a.offset)==null?void 0:y[c])||0)-(E?g.crossAxis:0);mP&&(m=P)}return{[f]:p,[c]:m}}}},qie=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}=ko(e,t),d=await _f(t,u),c=Mo(i),f=Pc(i),p=Ua(i)==="y",{width:m,height:v}=o.floating;let g,b;c==="top"||c==="bottom"?(g=c,b=f===(await(a.isRTL==null?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(b=c,g=f==="end"?"top":"bottom");const y=v-d.top-d.bottom,x=m-d.left-d.right,E=Va(v-d[g],y),S=Va(m-d[b],x),P=!t.middlewareData.shift;let C=E,A=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(A=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(C=y),P&&!f){const D=an(d.left,0),N=an(d.right,0),_=an(d.top,0),F=an(d.bottom,0);p?A=m-2*(D!==0||N!==0?D+N:an(d.left,d.right)):C=v-2*(_!==0||F!==0?_+F:an(d.top,d.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 Xy(){return typeof window<"u"}function Cc(e){return nV(e)?(e.nodeName||"").toLowerCase():"#document"}function hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qi(e){var t;return(t=(nV(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function nV(e){return Xy()?e instanceof Node||e instanceof hn(e).Node:!1}function Si(e){return Xy()?e instanceof Element||e instanceof hn(e).Element:!1}function Yi(e){return Xy()?e instanceof HTMLElement||e instanceof hn(e).HTMLElement:!1}function KN(e){return!Xy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof hn(e).ShadowRoot}function Yp(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Ei(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function Yie(e){return["table","td","th"].includes(Cc(e))}function Zy(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function mA(e){const t=vA(),r=Si(e)?Ei(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 Xie(e){let t=za(e);for(;Yi(t)&&!Uu(t);){if(mA(t))return t;if(Zy(t))return null;t=za(t)}return null}function vA(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Uu(e){return["html","body","#document"].includes(Cc(e))}function Ei(e){return hn(e).getComputedStyle(e)}function Qy(e){return Si(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function za(e){if(Cc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||KN(e)&&e.host||Qi(e);return KN(t)?t.host:t}function iV(e){const t=za(e);return Uu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Yi(t)&&Yp(t)?t:iV(t)}function jf(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=iV(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),a=hn(i);if(o){const s=r1(a);return t.concat(a,a.visualViewport||[],Yp(i)?i:[],s&&r?jf(s):[])}return t.concat(i,jf(i,[],r))}function r1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oV(e){const t=Ei(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Yi(e),o=i?e.offsetWidth:r,a=i?e.offsetHeight:n,s=Tv(r)!==o||Tv(n)!==a;return s&&(r=o,n=a),{width:r,height:n,$:s}}function gA(e){return Si(e)?e:e.contextElement}function au(e){const t=gA(e);if(!Yi(t))return Hi(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=oV(t);let a=(o?Tv(r.width):r.width)/n,s=(o?Tv(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const Zie=Hi(0);function aV(e){const t=hn(e);return!vA()||!t.visualViewport?Zie:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qie(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==hn(e)?!1:t}function Qs(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=gA(e);let a=Hi(1);t&&(n?Si(n)&&(a=au(n)):a=au(e));const s=Qie(o,r,n)?aV(o):Hi(0);let l=(i.left+s.x)/a.x,u=(i.top+s.y)/a.y,d=i.width/a.x,c=i.height/a.y;if(o){const f=hn(o),p=n&&Si(n)?hn(n):n;let m=f,v=r1(m);for(;v&&n&&p!==m;){const g=au(v),b=v.getBoundingClientRect(),y=Ei(v),x=b.left+(v.clientLeft+parseFloat(y.paddingLeft))*g.x,E=b.top+(v.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,d*=g.x,c*=g.y,l+=x,u+=E,m=hn(v),v=r1(m)}}return _v({width:d,height:c,x:l,y:u})}function yA(e,t){const r=Qy(e).scrollLeft;return t?t.left+r:Qs(Qi(e)).left+r}function sV(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-(r?0:yA(e,n)),o=n.top+t.scrollTop;return{x:i,y:o}}function Jie(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o=i==="fixed",a=Qi(n),s=t?Zy(t.floating):!1;if(n===a||s&&o)return r;let l={scrollLeft:0,scrollTop:0},u=Hi(1);const d=Hi(0),c=Yi(n);if((c||!c&&!o)&&((Cc(n)!=="body"||Yp(a))&&(l=Qy(n)),Yi(n))){const p=Qs(n);u=au(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const f=a&&!c&&!o?sV(a,l,!0):Hi(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+d.x+f.x,y:r.y*u.y-l.scrollTop*u.y+d.y+f.y}}function eoe(e){return Array.from(e.getClientRects())}function toe(e){const t=Qi(e),r=Qy(e),n=e.ownerDocument.body,i=an(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=an(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+yA(e);const s=-r.scrollTop;return Ei(n).direction==="rtl"&&(a+=an(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:a,y:s}}function roe(e,t){const r=hn(e),n=Qi(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=vA();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}function noe(e,t){const r=Qs(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=Yi(e)?au(e):Hi(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 qN(e,t,r){let n;if(t==="viewport")n=roe(e,r);else if(t==="document")n=toe(Qi(e));else if(Si(t))n=noe(t,r);else{const i=aV(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return _v(n)}function lV(e,t){const r=za(e);return r===t||!Si(r)||Uu(r)?!1:Ei(r).position==="fixed"||lV(r,t)}function ioe(e,t){const r=t.get(e);if(r)return r;let n=jf(e,[],!1).filter(s=>Si(s)&&Cc(s)!=="body"),i=null;const o=Ei(e).position==="fixed";let a=o?za(e):e;for(;Si(a)&&!Uu(a);){const s=Ei(a),l=mA(a);!l&&s.position==="fixed"&&(i=null),(o?!l&&!i:!l&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Yp(a)&&!l&&lV(e,a))?n=n.filter(d=>d!==a):i=s,a=za(a)}return t.set(e,n),n}function ooe(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const a=[...r==="clippingAncestors"?Zy(t)?[]:ioe(t,this._c):[].concat(r),n],s=a[0],l=a.reduce((u,d)=>{const c=qN(t,d,i);return u.top=an(c.top,u.top),u.right=Va(c.right,u.right),u.bottom=Va(c.bottom,u.bottom),u.left=an(c.left,u.left),u},qN(t,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function aoe(e){const{width:t,height:r}=oV(e);return{width:t,height:r}}function soe(e,t,r){const n=Yi(t),i=Qi(t),o=r==="fixed",a=Qs(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Hi(0);if(n||!n&&!o)if((Cc(t)!=="body"||Yp(i))&&(s=Qy(t)),n){const f=Qs(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=yA(i));const u=i&&!n&&!o?sV(i,s):Hi(0),d=a.left+s.scrollLeft-l.x-u.x,c=a.top+s.scrollTop-l.y-u.y;return{x:d,y:c,width:a.width,height:a.height}}function C0(e){return Ei(e).position==="static"}function YN(e,t){if(!Yi(e)||Ei(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Qi(e)===r&&(r=r.ownerDocument.body),r}function uV(e,t){const r=hn(e);if(Zy(e))return r;if(!Yi(e)){let i=za(e);for(;i&&!Uu(i);){if(Si(i)&&!C0(i))return i;i=za(i)}return r}let n=YN(e,t);for(;n&&Yie(n)&&C0(n);)n=YN(n,t);return n&&Uu(n)&&C0(n)&&!mA(n)?r:n||Xie(e)||r}const loe=async function(e){const t=this.getOffsetParent||uV,r=this.getDimensions,n=await r(e.floating);return{reference:soe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function uoe(e){return Ei(e).direction==="rtl"}const coe={convertOffsetParentRelativeRectToViewportRelativeRect:Jie,getDocumentElement:Qi,getClippingRect:ooe,getOffsetParent:uV,getElementRects:loe,getClientRects:eoe,getDimensions:aoe,getScale:au,isElement:Si,isRTL:uoe};function doe(e,t){let r=null,n;const i=Qi(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:d,width:c,height:f}=e.getBoundingClientRect();if(s||t(),!c||!f)return;const p=Hh(d),m=Hh(i.clientWidth-(u+c)),v=Hh(i.clientHeight-(d+f)),g=Hh(u),y={rootMargin:-p+"px "+-m+"px "+-v+"px "+-g+"px",threshold:an(0,Va(1,l))||1};let x=!0;function E(S){const P=S[0].intersectionRatio;if(P!==l){if(!x)return a();P?a(!1,P):n=setTimeout(()=>{a(!1,1e-7)},1e3)}x=!1}try{r=new IntersectionObserver(E,{...y,root:i.ownerDocument})}catch{r=new IntersectionObserver(E,y)}r.observe(e)}return a(!0),o}function foe(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=gA(e),d=i||o?[...u?jf(u):[],...jf(t)]:[];d.forEach(b=>{i&&b.addEventListener("scroll",r,{passive:!0}),o&&b.addEventListener("resize",r)});const c=u&&s?doe(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?Qs(e):null;l&&g();function g(){const b=Qs(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;d.forEach(y=>{i&&y.removeEventListener("scroll",r),o&&y.removeEventListener("resize",r)}),c==null||c(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const poe=Hie,hoe=Gie,moe=Uie,voe=qie,goe=zie,XN=Vie,yoe=Kie,boe=(e,t,r)=>{const n=new Map,i={platform:coe,...r},o={...i.platform,_c:n};return Bie(e,t,{...i,platform:o})};var Dm=typeof document<"u"?w.useLayoutEffect:w.useEffect;function jv(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(!jv(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)&&!jv(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function cV(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ZN(e,t){const r=cV(e);return Math.round(t*r)/r}function A0(e){const t=w.useRef(e);return Dm(()=>{t.current=e}),t}function xoe(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,[d,c]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(n);jv(f,n)||p(n);const[m,v]=w.useState(null),[g,b]=w.useState(null),y=w.useCallback(I=>{I!==P.current&&(P.current=I,v(I))},[]),x=w.useCallback(I=>{I!==C.current&&(C.current=I,b(I))},[]),E=o||m,S=a||g,P=w.useRef(null),C=w.useRef(null),A=w.useRef(d),T=l!=null,D=A0(l),N=A0(i),_=A0(u),F=w.useCallback(()=>{if(!P.current||!C.current)return;const I={placement:t,strategy:r,middleware:f};N.current&&(I.platform=N.current),boe(P.current,C.current,I).then($=>{const j={...$,isPositioned:_.current!==!1};k.current&&!jv(A.current,j)&&(A.current=j,Xa.flushSync(()=>{c(j)}))})},[f,t,r,N,_]);Dm(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,c(I=>({...I,isPositioned:!1})))},[u]);const k=w.useRef(!1);Dm(()=>(k.current=!0,()=>{k.current=!1}),[]),Dm(()=>{if(E&&(P.current=E),S&&(C.current=S),E&&S){if(D.current)return D.current(E,S,F);F()}},[E,S,F,D,T]);const B=w.useMemo(()=>({reference:P,floating:C,setReference:y,setFloating:x}),[y,x]),V=w.useMemo(()=>({reference:E,floating:S}),[E,S]),z=w.useMemo(()=>{const I={position:r,left:0,top:0};if(!V.floating)return I;const $=ZN(V.floating,d.x),j=ZN(V.floating,d.y);return s?{...I,transform:"translate("+$+"px, "+j+"px)",...cV(V.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:j}},[r,s,V.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:F,refs:B,elements:V,floatingStyles:z}),[d,F,B,V,z])}const woe=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?XN({element:n.current,padding:i}).fn(r):{}:n?XN({element:n,padding:i}).fn(r):{}}}},Soe=(e,t)=>({...poe(e),options:[e,t]}),Eoe=(e,t)=>({...hoe(e),options:[e,t]}),Poe=(e,t)=>({...yoe(e),options:[e,t]}),Coe=(e,t)=>({...moe(e),options:[e,t]}),Aoe=(e,t)=>({...voe(e),options:[e,t]}),Toe=(e,t)=>({...goe(e),options:[e,t]}),Ooe=(e,t)=>({...woe(e),options:[e,t]});var _oe="Arrow",dV=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"})})});dV.displayName=_oe;var joe=dV;function Noe(e,t=[]){let r=[];function n(o,a){const s=w.createContext(a),l=r.length;r=[...r,a];function u(c){const{scope:f,children:p,...m}=c,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 d(c,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(`\`${c}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}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,Doe(i,...t)]}function Doe(...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 c=l(o)[`__scope${u}`];return{...s,...c}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}function koe(e){const[t,r]=w.useState(void 0);return Tr(()=>{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 bA="Popper",[fV,Jy]=Noe(bA),[Moe,pV]=fV(bA),hV=e=>{const{__scopePopper:t,children:r}=e,[n,i]=w.useState(null);return h.jsx(Moe,{scope:t,anchor:n,onAnchorChange:i,children:r})};hV.displayName=bA;var mV="PopperAnchor",vV=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=pV(mV,r),a=w.useRef(null),s=lt(t,a);return w.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||a.current)}),n?null:h.jsx(Ke.div,{...i,ref:s})});vV.displayName=mV;var xA="PopperContent",[Ioe,Roe]=fV(xA),gV=w.forwardRef((e,t)=>{var Z,ne,K,J,te,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:d=0,sticky:c="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...v}=e,g=pV(xA,r),[b,y]=w.useState(null),x=lt(t,Ae=>y(Ae)),[E,S]=w.useState(null),P=koe(E),C=(P==null?void 0:P.width)??0,A=(P==null?void 0:P.height)??0,T=n+(o!=="center"?"-"+o:""),D=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},N=Array.isArray(u)?u:[u],_=N.length>0,F={padding:D,boundary:N.filter(Loe),altBoundary:_},{refs:k,floatingStyles:B,placement:V,isPositioned:z,middlewareData:I}=xoe({strategy:"fixed",placement:T,whileElementsMounted:(...Ae)=>foe(...Ae,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[Soe({mainAxis:i+A,alignmentAxis:a}),l&&Eoe({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?Poe():void 0,...F}),l&&Coe({...F}),Aoe({...F,apply:({elements:Ae,rects:ue,availableWidth:$e,availableHeight:Ve})=>{const{width:qe,height:R}=ue.reference,W=Ae.floating.style;W.setProperty("--radix-popper-available-width",`${$e}px`),W.setProperty("--radix-popper-available-height",`${Ve}px`),W.setProperty("--radix-popper-anchor-width",`${qe}px`),W.setProperty("--radix-popper-anchor-height",`${R}px`)}}),E&&Ooe({element:E,padding:s}),Foe({arrowWidth:C,arrowHeight:A}),f&&Toe({strategy:"referenceHidden",...F})]}),[$,j]=xV(V),O=Ar(m);Tr(()=>{z&&(O==null||O())},[z,O]);const U=(Z=I.arrow)==null?void 0:Z.x,Y=(ne=I.arrow)==null?void 0:ne.y,re=((K=I.arrow)==null?void 0:K.centerOffset)!==0,[ce,de]=w.useState();return Tr(()=>{b&&de(window.getComputedStyle(b).zIndex)},[b]),h.jsx("div",{ref:k.setFloating,"data-radix-popper-content-wrapper":"",style:{...B,transform:z?B.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[(J=I.transformOrigin)==null?void 0:J.x,(te=I.transformOrigin)==null?void 0:te.y].join(" "),...((H=I.hide)==null?void 0:H.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(Ioe,{scope:r,placedSide:$,onArrowChange:S,arrowX:U,arrowY:Y,shouldHideArrow:re,children:h.jsx(Ke.div,{"data-side":$,"data-align":j,...v,ref:x,style:{...v.style,animation:z?void 0:"none"}})})})});gV.displayName=xA;var yV="PopperArrow",$oe={top:"bottom",right:"left",bottom:"top",left:"right"},bV=w.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,o=Roe(yV,n),a=$oe[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(joe,{...i,ref:r,style:{...i.style,display:"block"}})})});bV.displayName=yV;function Loe(e){return e!==null}var Foe=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,d]=xV(r),c={start:"0%",center:"50%",end:"100%"}[d],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?c:`${f}px`,v=`${-l}px`):u==="top"?(m=a?c:`${f}px`,v=`${n.floating.height+l}px`):u==="right"?(m=`${-l}px`,v=a?c:`${p}px`):u==="left"&&(m=`${n.floating.width+l}px`,v=a?c:`${p}px`),{data:{x:m,y:v}}}});function xV(e){const[t,r="center"]=e.split("-");return[t,r]}var wV=hV,SV=vV,EV=gV,PV=bV;function Boe(e,t=[]){let r=[];function n(o,a){const s=w.createContext(a),l=r.length;r=[...r,a];function u(c){const{scope:f,children:p,...m}=c,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 d(c,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(`\`${c}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}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,Voe(i,...t)]}function Voe(...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 c=l(o)[`__scope${u}`];return{...s,...c}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}var T0="rovingFocusGroup.onEntryFocus",Uoe={bubbles:!1,cancelable:!0},eb="RovingFocusGroup",[n1,CV,zoe]=yy(eb),[Woe,AV]=Boe(eb,[zoe]),[Hoe,Goe]=Woe(eb),TV=w.forwardRef((e,t)=>h.jsx(n1.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(n1.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Koe,{...e,ref:t})})}));TV.displayName=eb;var Koe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...c}=e,f=w.useRef(null),p=lt(t,f),m=cA(o),[v=null,g]=Iu({prop:a,defaultProp:s,onChange:l}),[b,y]=w.useState(!1),x=Ar(u),E=CV(r),S=w.useRef(!1),[P,C]=w.useState(0);return w.useEffect(()=>{const A=f.current;if(A)return A.addEventListener(T0,x),()=>A.removeEventListener(T0,x)},[x]),h.jsx(Hoe,{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||P===0?-1:0,"data-orientation":n,...c,ref:p,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{S.current=!0}),onFocus:Ee(e.onFocus,A=>{const T=!S.current;if(A.target===A.currentTarget&&T&&!b){const D=new CustomEvent(T0,Uoe);if(A.currentTarget.dispatchEvent(D),!D.defaultPrevented){const N=E().filter(V=>V.focusable),_=N.find(V=>V.active),F=N.find(V=>V.id===v),B=[_,F,...N].filter(Boolean).map(V=>V.ref.current);jV(B,d)}}S.current=!1}),onBlur:Ee(e.onBlur,()=>y(!1))})})}),OV="RovingFocusGroupItem",_V=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,...a}=e,s=wo(),l=o||s,u=Goe(OV,r),d=u.currentTabStopId===l,c=CV(r),{onFocusableItemAdd:f,onFocusableItemRemove:p}=u;return w.useEffect(()=>{if(n)return f(),()=>p()},[n,f,p]),h.jsx(n1.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:h.jsx(Ke.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:Ee(e.onMouseDown,m=>{n?u.onItemFocus(l):m.preventDefault()}),onFocus:Ee(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Ee(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=Xoe(m,u.orientation,u.dir);if(v!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let b=c().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?Zoe(b,y+1):b.slice(y+1)}setTimeout(()=>jV(b))}})})})});_V.displayName=OV;var qoe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Yoe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Xoe(e,t,r){const n=Yoe(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return qoe[n]}function jV(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function Zoe(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Qoe=TV,Joe=_V,eae=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},bl=new WeakMap,Gh=new WeakMap,Kh={},O0=0,NV=function(e){return e&&(e.host||NV(e.parentNode))},tae=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=NV(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})},rae=function(e,t,r,n){var i=tae(t,Array.isArray(e)?e:[e]);Kh[r]||(Kh[r]=new WeakMap);var o=Kh[r],a=[],s=new Set,l=new Set(i),u=function(c){!c||s.has(c)||(s.add(c),u(c.parentNode))};i.forEach(u);var d=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(f){if(s.has(f))d(f);else try{var p=f.getAttribute(n),m=p!==null&&p!=="false",v=(bl.get(f)||0)+1,g=(o.get(f)||0)+1;bl.set(f,v),o.set(f,g),a.push(f),v===1&&m&&Gh.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 d(t),s.clear(),O0++,function(){a.forEach(function(c){var f=bl.get(c)-1,p=o.get(c)-1;bl.set(c,f),o.set(c,p),f||(Gh.has(c)||c.removeAttribute(n),Gh.delete(c)),p||c.removeAttribute(r)}),O0--,O0||(bl=new WeakMap,bl=new WeakMap,Gh=new WeakMap,Kh={})}},wA=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=eae(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),rae(n,i,r,"aria-hidden")):function(){return null}},Ri=function(){return Ri=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return bae;var t=xae(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])}},Sae=IV(),su="data-scroll-locked",Eae=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(iae,` { overflow: hidden `).concat(n,`; padding-right: `).concat(s,"px ").concat(n,`; } body[`).concat(su,`] { 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(km,` { right: `).concat(s,"px ").concat(n,`; } .`).concat(Mm,` { margin-right: `).concat(s,"px ").concat(n,`; } .`).concat(km," .").concat(km,` { right: 0 `).concat(n,`; } .`).concat(Mm," .").concat(Mm,` { margin-right: 0 `).concat(n,`; } body[`).concat(su,`] { `).concat(oae,": ").concat(s,`px; } `)},JN=function(){var e=parseInt(document.body.getAttribute(su)||"0",10);return isFinite(e)?e:0},Pae=function(){w.useEffect(function(){return document.body.setAttribute(su,(JN()+1).toString()),function(){var e=JN()-1;e<=0?document.body.removeAttribute(su):document.body.setAttribute(su,e.toString())}},[])},Cae=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;Pae();var o=w.useMemo(function(){return wae(i)},[i]);return w.createElement(Sae,{styles:Eae(o,!t,i,r?"":"!important")})},i1=!1;if(typeof window<"u")try{var qh=Object.defineProperty({},"passive",{get:function(){return i1=!0,!0}});window.addEventListener("test",qh,qh),window.removeEventListener("test",qh,qh)}catch{i1=!1}var xl=i1?{passive:!1}:!1,Aae=function(e){return e.tagName==="TEXTAREA"},RV=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Aae(e)&&r[t]==="visible")},Tae=function(e){return RV(e,"overflowY")},Oae=function(e){return RV(e,"overflowX")},eD=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=$V(e,n);if(i){var o=LV(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]},jae=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},$V=function(e,t){return e==="v"?Tae(t):Oae(t)},LV=function(e,t){return e==="v"?_ae(t):jae(t)},Nae=function(e,t){return e==="h"&&t==="rtl"?-1:1},Dae=function(e,t,r,n,i){var o=Nae(e,window.getComputedStyle(t).direction),a=o*n,s=r.target,l=t.contains(s),u=!1,d=a>0,c=0,f=0;do{var p=LV(e,s),m=p[0],v=p[1],g=p[2],b=v-g-o*m;(m||b)&&$V(e,s)&&(c+=b,f+=m),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(d&&(Math.abs(c)<1||!i)||!d&&(Math.abs(f)<1||!i))&&(u=!0),u},Yh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tD=function(e){return[e.deltaX,e.deltaY]},rD=function(e){return e&&"current"in e?e.current:e},kae=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Mae=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},Iae=0,wl=[];function Rae(e){var t=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),i=w.useState(Iae++)[0],o=w.useState(IV)[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=nae([e.lockRef.current],(e.shards||[]).map(rD),!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=Yh(v),y=r.current,x="deltaX"in v?v.deltaX:y[0]-b[0],E="deltaY"in v?v.deltaY:y[1]-b[1],S,P=v.target,C=Math.abs(x)>Math.abs(E)?"h":"v";if("touches"in v&&C==="h"&&P.type==="range")return!1;var A=eD(C,P);if(!A)return!0;if(A?S=C:(S=C==="v"?"h":"v",A=eD(C,P)),!A)return!1;if(!n.current&&"changedTouches"in v&&(x||E)&&(n.current=S),!S)return!0;var T=n.current||S;return Dae(T,g,v,T==="h"?x:E,!0)},[]),l=w.useCallback(function(v){var g=v;if(!(!wl.length||wl[wl.length-1]!==o)){var b="deltaY"in g?tD(g):Yh(g),y=t.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&kae(S.delta,b)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var x=(a.current.shards||[]).map(rD).filter(Boolean).filter(function(S){return S.contains(g.target)}),E=x.length>0?s(g,x[0]):!a.current.noIsolation;E&&g.cancelable&&g.preventDefault()}}},[]),u=w.useCallback(function(v,g,b,y){var x={name:v,delta:g,target:b,should:y,shadowParent:$ae(b)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(E){return E!==x})},1)},[]),d=w.useCallback(function(v){r.current=Yh(v),n.current=void 0},[]),c=w.useCallback(function(v){u(v.type,tD(v),v.target,s(v,e.lockRef.current))},[]),f=w.useCallback(function(v){u(v.type,Yh(v),v.target,s(v,e.lockRef.current))},[]);w.useEffect(function(){return wl.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:f}),document.addEventListener("wheel",l,xl),document.addEventListener("touchmove",l,xl),document.addEventListener("touchstart",d,xl),function(){wl=wl.filter(function(v){return v!==o}),document.removeEventListener("wheel",l,xl),document.removeEventListener("touchmove",l,xl),document.removeEventListener("touchstart",d,xl)}},[]);var p=e.removeScrollBar,m=e.inert;return w.createElement(w.Fragment,null,m?w.createElement(o,{styles:Mae(i)}):null,p?w.createElement(Cae,{gapMode:e.gapMode}):null)}function $ae(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Lae=fae(MV,Rae);var rb=w.forwardRef(function(e,t){return w.createElement(tb,Ri({},e,{ref:t,sideCar:Lae}))});rb.classNames=tb.classNames;var o1=["Enter"," "],Fae=["ArrowDown","PageUp","Home"],FV=["ArrowUp","PageDown","End"],Bae=[...Fae,...FV],Vae={ltr:[...o1,"ArrowRight"],rtl:[...o1,"ArrowLeft"]},Uae={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Xp="Menu",[Nf,zae,Wae]=yy(Xp),[ll,BV]=yc(Xp,[Wae,Jy,AV]),nb=Jy(),VV=AV(),[Hae,ul]=ll(Xp),[Gae,Zp]=ll(Xp),UV=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:o,modal:a=!0}=e,s=nb(t),[l,u]=w.useState(null),d=w.useRef(!1),c=Ar(o),f=cA(i);return w.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>d.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(wV,{...s,children:h.jsx(Hae,{scope:t,open:r,onOpenChange:c,content:l,onContentChange:u,children:h.jsx(Gae,{scope:t,onClose:w.useCallback(()=>c(!1),[c]),isUsingKeyboardRef:d,dir:f,modal:a,children:n})})})};UV.displayName=Xp;var Kae="MenuAnchor",SA=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=nb(r);return h.jsx(SV,{...i,...n,ref:t})});SA.displayName=Kae;var EA="MenuPortal",[qae,zV]=ll(EA,{forceMount:void 0}),WV=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,o=ul(EA,t);return h.jsx(qae,{scope:t,forceMount:r,children:h.jsx(Uo,{present:r||o.open,children:h.jsx(Np,{asChild:!0,container:i,children:n})})})};WV.displayName=EA;var Fn="MenuContent",[Yae,PA]=ll(Fn),HV=w.forwardRef((e,t)=>{const r=zV(Fn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=ul(Fn,e.__scopeMenu),a=Zp(Fn,e.__scopeMenu);return h.jsx(Nf.Provider,{scope:e.__scopeMenu,children:h.jsx(Uo,{present:n||o.open,children:h.jsx(Nf.Slot,{scope:e.__scopeMenu,children:a.modal?h.jsx(Xae,{...i,ref:t}):h.jsx(Zae,{...i,ref:t})})})})}),Xae=w.forwardRef((e,t)=>{const r=ul(Fn,e.__scopeMenu),n=w.useRef(null),i=lt(t,n);return w.useEffect(()=>{const o=n.current;if(o)return wA(o)},[]),h.jsx(CA,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ee(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),Zae=w.forwardRef((e,t)=>{const r=ul(Fn,e.__scopeMenu);return h.jsx(CA,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),CA=w.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...v}=e,g=ul(Fn,r),b=Zp(Fn,r),y=nb(r),x=VV(r),E=zae(r),[S,P]=w.useState(null),C=w.useRef(null),A=lt(t,C,g.onContentChange),T=w.useRef(0),D=w.useRef(""),N=w.useRef(0),_=w.useRef(null),F=w.useRef("right"),k=w.useRef(0),B=m?rb:w.Fragment,V=m?{as:No,allowPinchZoom:!0}:void 0,z=$=>{var Z,ne;const j=D.current+$,O=E().filter(K=>!K.disabled),U=document.activeElement,Y=(Z=O.find(K=>K.ref.current===U))==null?void 0:Z.textValue,re=O.map(K=>K.textValue),ce=use(re,j,Y),de=(ne=O.find(K=>K.textValue===ce))==null?void 0:ne.ref.current;(function K(J){D.current=J,window.clearTimeout(T.current),J!==""&&(T.current=window.setTimeout(()=>K(""),1e3))})(j),de&&setTimeout(()=>de.focus())};w.useEffect(()=>()=>window.clearTimeout(T.current),[]),dA();const I=w.useCallback($=>{var O,U;return F.current===((O=_.current)==null?void 0:O.side)&&dse($,(U=_.current)==null?void 0:U.area)},[]);return h.jsx(Yae,{scope:r,searchRef:D,onItemEnter:w.useCallback($=>{I($)&&$.preventDefault()},[I]),onItemLeave:w.useCallback($=>{var j;I($)||((j=C.current)==null||j.focus(),P(null))},[I]),onTriggerLeave:w.useCallback($=>{I($)&&$.preventDefault()},[I]),pointerGraceTimerRef:N,onPointerGraceIntentChange:w.useCallback($=>{_.current=$},[]),children:h.jsx(B,{...V,children:h.jsx(Yy,{asChild:!0,trapped:i,onMountAutoFocus:Ee(o,$=>{var j;$.preventDefault(),(j=C.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:h.jsx(jp,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:f,onDismiss:p,children:h.jsx(Qoe,{asChild:!0,...x,dir:b.dir,orientation:"vertical",loop:n,currentTabStopId:S,onCurrentTabStopIdChange:P,onEntryFocus:Ee(l,$=>{b.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(EV,{role:"menu","aria-orientation":"vertical","data-state":s4(g.open),"data-radix-menu-content":"",dir:b.dir,...y,...v,ref:A,style:{outline:"none",...v.style},onKeyDown:Ee(v.onKeyDown,$=>{const O=$.target.closest("[data-radix-menu-content]")===$.currentTarget,U=$.ctrlKey||$.altKey||$.metaKey,Y=$.key.length===1;O&&($.key==="Tab"&&$.preventDefault(),!U&&Y&&z($.key));const re=C.current;if($.target!==re||!Bae.includes($.key))return;$.preventDefault();const de=E().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);FV.includes($.key)&&de.reverse(),sse(de)}),onBlur:Ee(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(T.current),D.current="")}),onPointerMove:Ee(e.onPointerMove,Df($=>{const j=$.target,O=k.current!==$.clientX;if($.currentTarget.contains(j)&&O){const U=$.clientX>k.current?"right":"left";F.current=U,k.current=$.clientX}}))})})})})})})});HV.displayName=Fn;var Qae="MenuGroup",AA=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return h.jsx(Ke.div,{role:"group",...n,ref:t})});AA.displayName=Qae;var Jae="MenuLabel",GV=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return h.jsx(Ke.div,{...n,ref:t})});GV.displayName=Jae;var Nv="MenuItem",nD="menu.itemSelect",ib=w.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,o=w.useRef(null),a=Zp(Nv,e.__scopeMenu),s=PA(Nv,e.__scopeMenu),l=lt(t,o),u=w.useRef(!1),d=()=>{const c=o.current;if(!r&&c){const f=new CustomEvent(nD,{bubbles:!0,cancelable:!0});c.addEventListener(nD,p=>n==null?void 0:n(p),{once:!0}),qP(c,f),f.defaultPrevented?u.current=!1:a.onClose()}};return h.jsx(KV,{...i,ref:l,disabled:r,onClick:Ee(e.onClick,d),onPointerDown:c=>{var f;(f=e.onPointerDown)==null||f.call(e,c),u.current=!0},onPointerUp:Ee(e.onPointerUp,c=>{var f;u.current||(f=c.currentTarget)==null||f.click()}),onKeyDown:Ee(e.onKeyDown,c=>{const f=s.searchRef.current!=="";r||f&&c.key===" "||o1.includes(c.key)&&(c.currentTarget.click(),c.preventDefault())})})});ib.displayName=Nv;var KV=w.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...o}=e,a=PA(Nv,r),s=VV(r),l=w.useRef(null),u=lt(t,l),[d,c]=w.useState(!1),[f,p]=w.useState("");return w.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[o.children]),h.jsx(Nf.ItemSlot,{scope:r,disabled:n,textValue:i??f,children:h.jsx(Joe,{asChild:!0,...s,focusable:!n,children:h.jsx(Ke.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:u,onPointerMove:Ee(e.onPointerMove,Df(m=>{n?a.onItemLeave(m):(a.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ee(e.onPointerLeave,Df(m=>a.onItemLeave(m))),onFocus:Ee(e.onFocus,()=>c(!0)),onBlur:Ee(e.onBlur,()=>c(!1))})})})}),ese="MenuCheckboxItem",qV=w.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...i}=e;return h.jsx(JV,{scope:e.__scopeMenu,checked:r,children:h.jsx(ib,{role:"menuitemcheckbox","aria-checked":Dv(r)?"mixed":r,...i,ref:t,"data-state":OA(r),onSelect:Ee(i.onSelect,()=>n==null?void 0:n(Dv(r)?!0:!r),{checkForDefaultPrevented:!1})})})});qV.displayName=ese;var YV="MenuRadioGroup",[tse,rse]=ll(YV,{value:void 0,onValueChange:()=>{}}),XV=w.forwardRef((e,t)=>{const{value:r,onValueChange:n,...i}=e,o=Ar(n);return h.jsx(tse,{scope:e.__scopeMenu,value:r,onValueChange:o,children:h.jsx(AA,{...i,ref:t})})});XV.displayName=YV;var ZV="MenuRadioItem",QV=w.forwardRef((e,t)=>{const{value:r,...n}=e,i=rse(ZV,e.__scopeMenu),o=r===i.value;return h.jsx(JV,{scope:e.__scopeMenu,checked:o,children:h.jsx(ib,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":OA(o),onSelect:Ee(n.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,r)},{checkForDefaultPrevented:!1})})})});QV.displayName=ZV;var TA="MenuItemIndicator",[JV,nse]=ll(TA,{checked:!1}),e4=w.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...i}=e,o=nse(TA,r);return h.jsx(Uo,{present:n||Dv(o.checked)||o.checked===!0,children:h.jsx(Ke.span,{...i,ref:t,"data-state":OA(o.checked)})})});e4.displayName=TA;var ise="MenuSeparator",t4=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return h.jsx(Ke.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});t4.displayName=ise;var ose="MenuArrow",r4=w.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=nb(r);return h.jsx(PV,{...i,...n,ref:t})});r4.displayName=ose;var ase="MenuSub",[fIe,n4]=ll(ase),Sd="MenuSubTrigger",i4=w.forwardRef((e,t)=>{const r=ul(Sd,e.__scopeMenu),n=Zp(Sd,e.__scopeMenu),i=n4(Sd,e.__scopeMenu),o=PA(Sd,e.__scopeMenu),a=w.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=w.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return w.useEffect(()=>d,[d]),w.useEffect(()=>{const c=s.current;return()=>{window.clearTimeout(c),l(null)}},[s,l]),h.jsx(SA,{asChild:!0,...u,children:h.jsx(KV,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":s4(r.open),...e,ref:gy(t,i.onTriggerChange),onClick:c=>{var f;(f=e.onClick)==null||f.call(e,c),!(e.disabled||c.defaultPrevented)&&(c.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ee(e.onPointerMove,Df(c=>{o.onItemEnter(c),!c.defaultPrevented&&!e.disabled&&!r.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:Ee(e.onPointerLeave,Df(c=>{var p,m;d();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:c.clientX+b,y:c.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(c),c.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ee(e.onKeyDown,c=>{var p;const f=o.searchRef.current!=="";e.disabled||f&&c.key===" "||Vae[n.dir].includes(c.key)&&(r.onOpenChange(!0),(p=r.content)==null||p.focus(),c.preventDefault())})})})});i4.displayName=Sd;var o4="MenuSubContent",a4=w.forwardRef((e,t)=>{const r=zV(Fn,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,o=ul(Fn,e.__scopeMenu),a=Zp(Fn,e.__scopeMenu),s=n4(o4,e.__scopeMenu),l=w.useRef(null),u=lt(t,l);return h.jsx(Nf.Provider,{scope:e.__scopeMenu,children:h.jsx(Uo,{present:n||o.open,children:h.jsx(Nf.Slot,{scope:e.__scopeMenu,children:h.jsx(CA,{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:d=>{var c;a.isUsingKeyboardRef.current&&((c=l.current)==null||c.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:Ee(e.onFocusOutside,d=>{d.target!==s.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Ee(e.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:Ee(e.onKeyDown,d=>{var p;const c=d.currentTarget.contains(d.target),f=Uae[a.dir].includes(d.key);c&&f&&(o.onOpenChange(!1),(p=s.trigger)==null||p.focus(),d.preventDefault())})})})})})});a4.displayName=o4;function s4(e){return e?"open":"closed"}function Dv(e){return e==="indeterminate"}function OA(e){return Dv(e)?"indeterminate":e?"checked":"unchecked"}function sse(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function lse(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function use(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=lse(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 cse(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,a=t.length-1;on!=d>n&&r<(u-s)*(n-l)/(d-l)+s&&(i=!i)}return i}function dse(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return cse(r,t)}function Df(e){return t=>t.pointerType==="mouse"?e(t):void 0}var fse=UV,pse=SA,hse=WV,mse=HV,vse=AA,gse=GV,yse=ib,bse=qV,xse=XV,wse=QV,Sse=e4,Ese=t4,Pse=r4,Cse=i4,Ase=a4,_A="DropdownMenu",[Tse,pIe]=yc(_A,[BV]),Fr=BV(),[Ose,l4]=Tse(_A),u4=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:o,onOpenChange:a,modal:s=!0}=e,l=Fr(t),u=w.useRef(null),[d=!1,c]=Iu({prop:i,defaultProp:o,onChange:a});return h.jsx(Ose,{scope:t,triggerId:wo(),triggerRef:u,contentId:wo(),open:d,onOpenChange:c,onOpenToggle:w.useCallback(()=>c(f=>!f),[c]),modal:s,children:h.jsx(fse,{...l,open:d,onOpenChange:c,dir:n,modal:s,children:r})})};u4.displayName=_A;var c4="DropdownMenuTrigger",d4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,o=l4(c4,r),a=Fr(r);return h.jsx(pse,{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:gy(t,o.triggerRef),onPointerDown:Ee(e.onPointerDown,s=>{!n&&s.button===0&&s.ctrlKey===!1&&(o.onOpenToggle(),o.open||s.preventDefault())}),onKeyDown:Ee(e.onKeyDown,s=>{n||(["Enter"," "].includes(s.key)&&o.onOpenToggle(),s.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});d4.displayName=c4;var _se="DropdownMenuPortal",f4=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Fr(t);return h.jsx(hse,{...n,...r})};f4.displayName=_se;var p4="DropdownMenuContent",h4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=l4(p4,r),o=Fr(r),a=w.useRef(!1);return h.jsx(mse,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...n,ref:t,onCloseAutoFocus:Ee(e.onCloseAutoFocus,s=>{var l;a.current||(l=i.triggerRef.current)==null||l.focus(),a.current=!1,s.preventDefault()}),onInteractOutside:Ee(e.onInteractOutside,s=>{const l=s.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!i.modal||d)&&(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)"}})});h4.displayName=p4;var jse="DropdownMenuGroup",Nse=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return h.jsx(vse,{...i,...n,ref:t})});Nse.displayName=jse;var Dse="DropdownMenuLabel",m4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return h.jsx(gse,{...i,...n,ref:t})});m4.displayName=Dse;var kse="DropdownMenuItem",v4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return h.jsx(yse,{...i,...n,ref:t})});v4.displayName=kse;var Mse="DropdownMenuCheckboxItem",g4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return h.jsx(bse,{...i,...n,ref:t})});g4.displayName=Mse;var Ise="DropdownMenuRadioGroup",Rse=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return h.jsx(xse,{...i,...n,ref:t})});Rse.displayName=Ise;var $se="DropdownMenuRadioItem",y4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return h.jsx(wse,{...i,...n,ref:t})});y4.displayName=$se;var Lse="DropdownMenuItemIndicator",b4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return h.jsx(Sse,{...i,...n,ref:t})});b4.displayName=Lse;var Fse="DropdownMenuSeparator",x4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return h.jsx(Ese,{...i,...n,ref:t})});x4.displayName=Fse;var Bse="DropdownMenuArrow",Vse=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return h.jsx(Pse,{...i,...n,ref:t})});Vse.displayName=Bse;var Use="DropdownMenuSubTrigger",w4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return h.jsx(Cse,{...i,...n,ref:t})});w4.displayName=Use;var zse="DropdownMenuSubContent",S4=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Fr(r);return h.jsx(Ase,{...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)"}})});S4.displayName=zse;var Wse=u4,Hse=d4,Gse=f4,E4=h4,P4=m4,C4=v4,A4=g4,T4=y4,O4=b4,_4=x4,j4=w4,N4=S4;const D4=Wse,k4=Hse,Kse=w.forwardRef(({className:e,inset:t,children:r,...n},i)=>h.jsxs(j4,{ref:i,className:ke("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(mq,{className:"ml-auto h-4 w-4"})]}));Kse.displayName=j4.displayName;const qse=w.forwardRef(({className:e,...t},r)=>h.jsx(N4,{ref:r,className:ke("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}));qse.displayName=N4.displayName;const jA=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>h.jsx(Gse,{children:h.jsx(E4,{ref:n,sideOffset:t,className:ke("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})}));jA.displayName=E4.displayName;const Es=w.forwardRef(({className:e,inset:t,...r},n)=>h.jsx(C4,{ref:n,className:ke("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}));Es.displayName=C4.displayName;const Yse=w.forwardRef(({className:e,children:t,checked:r,...n},i)=>h.jsxs(A4,{ref:i,className:ke("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(O4,{children:h.jsx(xi,{className:"h-4 w-4"})})}),t]}));Yse.displayName=A4.displayName;const Xse=w.forwardRef(({className:e,children:t,...r},n)=>h.jsxs(T4,{ref:n,className:ke("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(O4,{children:h.jsx(xq,{className:"h-2 w-2 fill-current"})})}),t]}));Xse.displayName=T4.displayName;const M4=w.forwardRef(({className:e,inset:t,...r},n)=>h.jsx(P4,{ref:n,className:ke("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));M4.displayName=P4.displayName;const I4=w.forwardRef(({className:e,...t},r)=>h.jsx(_4,{ref:r,className:ke("-mx-1 my-1 h-px bg-muted",e),...t}));I4.displayName=_4.displayName;var Qp=e=>e.type==="checkbox",Ps=e=>e instanceof Date,kr=e=>e==null;const R4=e=>typeof e=="object";var zt=e=>!kr(e)&&!Array.isArray(e)&&R4(e)&&!Ps(e),$4=e=>zt(e)&&e.target?Qp(e.target)?e.target.checked:e.target.value:e,Zse=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,L4=(e,t)=>e.has(Zse(t)),Qse=e=>{const t=e.constructor&&e.constructor.prototype;return zt(t)&&t.hasOwnProperty("isPrototypeOf")},NA=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ur(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(!(NA&&(e instanceof Blob||e instanceof FileList))&&(r||zt(e)))if(t=r?[]:{},!r&&!Qse(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Ur(e[n]));else return e;return t}var ob=e=>Array.isArray(e)?e.filter(Boolean):[],Lt=e=>e===void 0,me=(e,t,r)=>{if(!t||!zt(e))return r;const n=ob(t.split(/[,[\].]+?/)).reduce((i,o)=>kr(i)?i:i[o],e);return Lt(n)||n===e?Lt(e[t])?r:e[t]:n},jn=e=>typeof e=="boolean",DA=e=>/^\w*$/.test(e),F4=e=>ob(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ct=(e,t,r)=>{let n=-1;const i=DA(t)?[t]:F4(t),o=i.length,a=o-1;for(;++nM.useContext(B4),Jse=e=>{const{children:t,...r}=e;return M.createElement(B4.Provider,{value:r},t)};var V4=(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]!==li.all&&(t._proxyFormState[a]=!n||li.all),r&&(r[a]=!0),e[a]}});return i},Hr=e=>zt(e)&&!Object.keys(e).length,U4=(e,t,r,n)=>{r(e);const{name:i,...o}=e;return Hr(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||li.all))},Wd=e=>Array.isArray(e)?e:[e],z4=(e,t,r)=>!e||!t||e===t||Wd(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function kA(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 ele(e){const t=ab(),{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}),d=M.useRef(i);return d.current=i,kA({disabled:n,next:c=>l.current&&z4(d.current,c.name,o)&&U4(c,u.current,r._updateFormState)&&s({...r._formState,...c}),subject:r._subjects.state}),M.useEffect(()=>(l.current=!0,u.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),V4(a,r,u.current,!1)}var $i=e=>typeof e=="string",W4=(e,t,r,n,i)=>$i(e)?(n&&t.watch.add(e),me(r,e,i)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),me(r,o))):(n&&(t.watchAll=!0),r);function tle(e){const t=ab(),{control:r=t.control,name:n,defaultValue:i,disabled:o,exact:a}=e||{},s=M.useRef(n);s.current=n,kA({disabled:o,subject:r._subjects.values,next:d=>{z4(s.current,d.name,a)&&u(Ur(W4(s.current,r._names,d.values||r._formValues,!1,i)))}});const[l,u]=M.useState(r._getWatch(n,i));return M.useEffect(()=>r._removeUnmounted()),l}function rle(e){const t=ab(),{name:r,disabled:n,control:i=t.control,shouldUnregister:o}=e,a=L4(i._names.array,r),s=tle({control:i,name:r,defaultValue:me(i._formValues,r,me(i._defaultValues,r,e.defaultValue)),exact:!0}),l=ele({control:i,name:r,exact:!0}),u=M.useRef(i.register(r,{...e.rules,value:s,...jn(e.disabled)?{disabled:e.disabled}:{}}));return M.useEffect(()=>{const d=i._options.shouldUnregister||o,c=(f,p)=>{const m=me(i._fields,f);m&&m._f&&(m._f.mount=p)};if(c(r,!0),d){const f=Ur(me(i._options.defaultValues,r));ct(i._defaultValues,r,f),Lt(me(i._formValues,r))&&ct(i._formValues,r,f)}return()=>{(a?d&&!i._state.action:d)?i.unregister(r):c(r,!1)}},[r,i,a,o]),M.useEffect(()=>{me(i._fields,r)&&i._updateDisabledField({disabled:n,fields:i._fields,name:r,value:me(i._fields,r)._f.value})},[n,r,i]),{field:{name:r,value:s,...jn(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:M.useCallback(d=>u.current.onChange({target:{value:$4(d),name:r},type:kv.CHANGE}),[r]),onBlur:M.useCallback(()=>u.current.onBlur({target:{value:me(i._formValues,r),name:r},type:kv.BLUR}),[r,i]),ref:M.useCallback(d=>{const c=me(i._fields,r);c&&d&&(c._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:f=>d.setCustomValidity(f),reportValidity:()=>d.reportValidity()})},[i._fields,r])},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!me(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!me(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!me(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!me(l.validatingFields,r)},error:{enumerable:!0,get:()=>me(l.errors,r)}})}}const nle=e=>e.render(rle(e));var H4=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},iD=e=>({isOnSubmit:!e||e===li.onSubmit,isOnBlur:e===li.onBlur,isOnChange:e===li.onChange,isOnAll:e===li.all,isOnTouch:e===li.onTouched}),oD=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Hd=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const o=me(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(Hd(s,t))break}else if(zt(s)&&Hd(s,t))break}}};var ile=(e,t,r)=>{const n=Wd(me(e,r));return ct(n,"root",t[r]),ct(e,r,n),e},MA=e=>e.type==="file",ho=e=>typeof e=="function",Mv=e=>{if(!NA)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Im=e=>$i(e),IA=e=>e.type==="radio",Iv=e=>e instanceof RegExp;const aD={value:!1,isValid:!1},sD={value:!0,isValid:!0};var G4=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&&!Lt(e[0].attributes.value)?Lt(e[0].value)||e[0].value===""?sD:{value:e[0].value,isValid:!0}:sD:aD}return aD};const lD={isValid:!1,value:null};var K4=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,lD):lD;function uD(e,t,r="validate"){if(Im(e)||Array.isArray(e)&&e.every(Im)||jn(e)&&!e)return{type:r,message:Im(e)?e:"",ref:t}}var Sl=e=>zt(e)&&!Iv(e)?e:{value:e,message:""},cD=async(e,t,r,n,i)=>{const{ref:o,refs:a,required:s,maxLength:l,minLength:u,min:d,max:c,pattern:f,validate:p,name:m,valueAsNumber:v,mount:g,disabled:b}=e._f,y=me(t,m);if(!g||b)return{};const x=a?a[0]:o,E=_=>{n&&x.reportValidity&&(x.setCustomValidity(jn(_)?"":_||""),x.reportValidity())},S={},P=IA(o),C=Qp(o),A=P||C,T=(v||MA(o))&&Lt(o.value)&&Lt(y)||Mv(o)&&o.value===""||y===""||Array.isArray(y)&&!y.length,D=H4.bind(null,m,r,S),N=(_,F,k,B=no.maxLength,V=no.minLength)=>{const z=_?F:k;S[m]={type:_?B:V,message:z,ref:o,...D(_?B:V,z)}};if(i?!Array.isArray(y)||!y.length:s&&(!A&&(T||kr(y))||jn(y)&&!y||C&&!G4(a).isValid||P&&!K4(a).isValid)){const{value:_,message:F}=Im(s)?{value:!!s,message:s}:Sl(s);if(_&&(S[m]={type:no.required,message:F,ref:x,...D(no.required,F)},!r))return E(F),S}if(!T&&(!kr(d)||!kr(c))){let _,F;const k=Sl(c),B=Sl(d);if(!kr(y)&&!isNaN(y)){const V=o.valueAsNumber||y&&+y;kr(k.value)||(_=V>k.value),kr(B.value)||(F=Vnew Date(new Date().toDateString()+" "+j),I=o.type=="time",$=o.type=="week";$i(k.value)&&y&&(_=I?z(y)>z(k.value):$?y>k.value:V>new Date(k.value)),$i(B.value)&&y&&(F=I?z(y)+_.value,B=!kr(F.value)&&y.length<+F.value;if((k||B)&&(N(k,_.message,F.message),!r))return E(S[m].message),S}if(f&&!T&&$i(y)){const{value:_,message:F}=Sl(f);if(Iv(_)&&!y.match(_)&&(S[m]={type:no.pattern,message:F,ref:o,...D(no.pattern,F)},!r))return E(F),S}if(p){if(ho(p)){const _=await p(y,t),F=uD(_,x);if(F&&(S[m]={...F,...D(no.validate,F.message)},!r))return E(F.message),S}else if(zt(p)){let _={};for(const F in p){if(!Hr(_)&&!r)break;const k=uD(await p[F](y,t),x,F);k&&(_={...k,...D(F,k.message)},E(k.message),r&&(S[m]=_))}if(!Hr(_)&&(S[m]={ref:x,..._},!r))return S}}return E(!0),S};function ole(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=[]}}},a1=e=>kr(e)||!R4(e);function la(e,t){if(a1(e)||a1(t))return e===t;if(Ps(e)&&Ps(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(Ps(o)&&Ps(a)||zt(o)&&zt(a)||Array.isArray(o)&&Array.isArray(a)?!la(o,a):o!==a)return!1}}return!0}var q4=e=>e.type==="select-multiple",sle=e=>IA(e)||Qp(e),k0=e=>Mv(e)&&e.isConnected,Y4=e=>{for(const t in e)if(ho(e[t]))return!0;return!1};function Rv(e,t={}){const r=Array.isArray(e);if(zt(e)||r)for(const n in e)Array.isArray(e[n])||zt(e[n])&&!Y4(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Rv(e[n],t[n])):kr(e[n])||(t[n]=!0);return t}function X4(e,t,r){const n=Array.isArray(e);if(zt(e)||n)for(const i in e)Array.isArray(e[i])||zt(e[i])&&!Y4(e[i])?Lt(t)||a1(r[i])?r[i]=Array.isArray(e[i])?Rv(e[i],[]):{...Rv(e[i])}:X4(e[i],kr(t)?{}:t[i],r[i]):r[i]=!la(e[i],t[i]);return r}var rd=(e,t)=>X4(e,t,Rv(t)),Z4=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Lt(e)?e:t?e===""?NaN:e&&+e:r&&$i(e)?new Date(e):n?n(e):e;function M0(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return MA(t)?t.files:IA(t)?K4(e.refs).value:q4(t)?[...t.selectedOptions].map(({value:r})=>r):Qp(t)?G4(e.refs).value:Z4(Lt(t.value)?e.ref.value:t.value,e)}var lle=(e,t,r,n)=>{const i={};for(const o of e){const a=me(t,o);a&&ct(i,o,a._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},nd=e=>Lt(e)?e:Iv(e)?e.source:zt(e)?Iv(e.value)?e.value.source:e.value:e;const dD="AsyncFunction";var ule=e=>(!e||!e.validate)&&!!(ho(e.validate)&&e.validate.constructor.name===dD||zt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===dD)),cle=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function fD(e,t,r){const n=me(e,r);if(n||DA(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const o=i.join("."),a=me(t,o),s=me(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 dle=(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,fle=(e,t)=>!ob(me(e,t)).length&&qt(e,t);const ple={mode:li.onSubmit,reValidateMode:li.onChange,shouldFocusError:!0};function hle(e={}){let t={...ple,...e},r={submitCount:0,isDirty:!1,isLoading:ho(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=zt(t.defaultValues)||zt(t.values)?Ur(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:Ur(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 d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},c={values:D0(),array:D0(),state:D0()},f=iD(t.mode),p=iD(t.reValidateMode),m=t.criteriaMode===li.all,v=R=>W=>{clearTimeout(u),u=setTimeout(R,W)},g=async R=>{if(!e.disabled&&(d.isValid||R)){const W=t.resolver?Hr((await A()).errors):await D(n,!0);W!==r.isValid&&c.state.next({isValid:W})}},b=(R,W)=>{!e.disabled&&(d.isValidating||d.validatingFields)&&((R||Array.from(s.mount)).forEach(G=>{G&&(W?ct(r.validatingFields,G,W):qt(r.validatingFields,G))}),c.state.next({validatingFields:r.validatingFields,isValidating:!Hr(r.validatingFields)}))},y=(R,W=[],G,pe,le=!0,ie=!0)=>{if(pe&&G&&!e.disabled){if(a.action=!0,ie&&Array.isArray(me(n,R))){const Oe=G(me(n,R),pe.argA,pe.argB);le&&ct(n,R,Oe)}if(ie&&Array.isArray(me(r.errors,R))){const Oe=G(me(r.errors,R),pe.argA,pe.argB);le&&ct(r.errors,R,Oe),fle(r.errors,R)}if(d.touchedFields&&ie&&Array.isArray(me(r.touchedFields,R))){const Oe=G(me(r.touchedFields,R),pe.argA,pe.argB);le&&ct(r.touchedFields,R,Oe)}d.dirtyFields&&(r.dirtyFields=rd(i,o)),c.state.next({name:R,isDirty:_(R,W),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ct(o,R,W)},x=(R,W)=>{ct(r.errors,R,W),c.state.next({errors:r.errors})},E=R=>{r.errors=R,c.state.next({errors:r.errors,isValid:!1})},S=(R,W,G,pe)=>{const le=me(n,R);if(le){const ie=me(o,R,Lt(G)?me(i,R):G);Lt(ie)||pe&&pe.defaultChecked||W?ct(o,R,W?ie:M0(le._f)):B(R,ie),a.mount&&g()}},P=(R,W,G,pe,le)=>{let ie=!1,Oe=!1;const Fe={name:R};if(!e.disabled){const _t=!!(me(n,R)&&me(n,R)._f&&me(n,R)._f.disabled);if(!G||pe){d.isDirty&&(Oe=r.isDirty,r.isDirty=Fe.isDirty=_(),ie=Oe!==Fe.isDirty);const xt=_t||la(me(i,R),W);Oe=!!(!_t&&me(r.dirtyFields,R)),xt||_t?qt(r.dirtyFields,R):ct(r.dirtyFields,R,!0),Fe.dirtyFields=r.dirtyFields,ie=ie||d.dirtyFields&&Oe!==!xt}if(G){const xt=me(r.touchedFields,R);xt||(ct(r.touchedFields,R,G),Fe.touchedFields=r.touchedFields,ie=ie||d.touchedFields&&xt!==G)}ie&&le&&c.state.next(Fe)}return ie?Fe:{}},C=(R,W,G,pe)=>{const le=me(r.errors,R),ie=d.isValid&&jn(W)&&r.isValid!==W;if(e.delayError&&G?(l=v(()=>x(R,G)),l(e.delayError)):(clearTimeout(u),l=null,G?ct(r.errors,R,G):qt(r.errors,R)),(G?!la(le,G):le)||!Hr(pe)||ie){const Oe={...pe,...ie&&jn(W)?{isValid:W}:{},errors:r.errors,name:R};r={...r,...Oe},c.state.next(Oe)}},A=async R=>{b(R,!0);const W=await t.resolver(o,t.context,lle(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=me(W,G);pe?ct(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 le=R[pe];if(le){const{_f:ie,...Oe}=le;if(ie){const Fe=s.array.has(ie.name),_t=le._f&&ule(le._f);_t&&d.validatingFields&&b([pe],!0);const xt=await cD(le,o,m,t.shouldUseNativeValidation&&!W,Fe);if(_t&&d.validatingFields&&b([pe]),xt[ie.name]&&(G.valid=!1,W))break;!W&&(me(xt,ie.name)?Fe?ile(r.errors,xt,ie.name):ct(r.errors,ie.name,xt[ie.name]):qt(r.errors,ie.name))}!Hr(Oe)&&await D(Oe,W,G)}}return G.valid},N=()=>{for(const R of s.unMount){const W=me(n,R);W&&(W._f.refs?W._f.refs.every(G=>!k0(G)):!k0(W._f.ref))&&de(R)}s.unMount=new Set},_=(R,W)=>!e.disabled&&(R&&W&&ct(o,R,W),!la(O(),i)),F=(R,W,G)=>W4(R,s,{...a.mount?o:Lt(W)?i:$i(R)?{[R]:W}:W},G,W),k=R=>ob(me(a.mount?o:i,R,e.shouldUnregister?me(i,R,[]):[])),B=(R,W,G={})=>{const pe=me(n,R);let le=W;if(pe){const ie=pe._f;ie&&(!ie.disabled&&ct(o,R,Z4(W,ie)),le=Mv(ie.ref)&&kr(W)?"":W,q4(ie.ref)?[...ie.ref.options].forEach(Oe=>Oe.selected=le.includes(Oe.value)):ie.refs?Qp(ie.ref)?ie.refs.length>1?ie.refs.forEach(Oe=>(!Oe.defaultChecked||!Oe.disabled)&&(Oe.checked=Array.isArray(le)?!!le.find(Fe=>Fe===Oe.value):le===Oe.value)):ie.refs[0]&&(ie.refs[0].checked=!!le):ie.refs.forEach(Oe=>Oe.checked=Oe.value===le):MA(ie.ref)?ie.ref.value="":(ie.ref.value=le,ie.ref.type||c.values.next({name:R,values:{...o}})))}(G.shouldDirty||G.shouldTouch)&&P(R,le,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&j(R)},V=(R,W,G)=>{for(const pe in W){const le=W[pe],ie=`${R}.${pe}`,Oe=me(n,ie);(s.array.has(R)||zt(le)||Oe&&!Oe._f)&&!Ps(le)?V(ie,le,G):B(ie,le,G)}},z=(R,W,G={})=>{const pe=me(n,R),le=s.array.has(R),ie=Ur(W);ct(o,R,ie),le?(c.array.next({name:R,values:{...o}}),(d.isDirty||d.dirtyFields)&&G.shouldDirty&&c.state.next({name:R,dirtyFields:rd(i,o),isDirty:_(R,ie)})):pe&&!pe._f&&!kr(ie)?V(R,ie,G):B(R,ie,G),oD(R,s)&&c.state.next({...r}),c.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 le=me(n,G),ie=()=>W.type?M0(le._f):$4(R),Oe=Fe=>{pe=Number.isNaN(Fe)||Ps(Fe)&&isNaN(Fe.getTime())||la(Fe,me(o,G,Fe))};if(le){let Fe,_t;const xt=ie(),qn=R.type===kv.BLUR||R.type===kv.FOCUS_OUT,hl=!cle(le._f)&&!t.resolver&&!me(r.errors,G)&&!le._f.deps||dle(qn,me(r.touchedFields,G),r.isSubmitted,p,f),Xo=oD(G,s,qn);ct(o,G,xt),qn?(le._f.onBlur&&le._f.onBlur(R),l&&l(0)):le._f.onChange&&le._f.onChange(R);const eo=P(G,xt,qn,!1),ml=!Hr(eo)||Xo;if(!qn&&c.values.next({name:G,type:R.type,values:{...o}}),hl)return d.isValid&&(e.mode==="onBlur"?qn&&g():g()),ml&&c.state.next({name:G,...Xo?{}:eo});if(!qn&&Xo&&c.state.next({...r}),t.resolver){const{errors:q}=await A([G]);if(Oe(xt),pe){const ee=fD(r.errors,n,G),Q=fD(q,n,ee.name||G);Fe=Q.error,G=Q.name,_t=Hr(q)}}else b([G],!0),Fe=(await cD(le,o,m,t.shouldUseNativeValidation))[G],b([G]),Oe(xt),pe&&(Fe?_t=!1:d.isValid&&(_t=await D(n,!0)));pe&&(le._f.deps&&j(le._f.deps),C(G,_t,Fe,eo))}},$=(R,W)=>{if(me(r.errors,W)&&R.focus)return R.focus(),1},j=async(R,W={})=>{let G,pe;const le=Wd(R);if(t.resolver){const ie=await T(Lt(R)?R:le);G=Hr(ie),pe=R?!le.some(Oe=>me(ie,Oe)):G}else R?(pe=(await Promise.all(le.map(async ie=>{const Oe=me(n,ie);return await D(Oe&&Oe._f?{[ie]:Oe}:Oe)}))).every(Boolean),!(!pe&&!r.isValid)&&g()):pe=G=await D(n);return c.state.next({...!$i(R)||d.isValid&&G!==r.isValid?{}:{name:R},...t.resolver||!R?{isValid:G}:{},errors:r.errors}),W.shouldFocus&&!pe&&Hd(n,$,R?le:s.mount),pe},O=R=>{const W={...a.mount?o:i};return Lt(R)?W:$i(R)?me(W,R):R.map(G=>me(W,G))},U=(R,W)=>({invalid:!!me((W||r).errors,R),isDirty:!!me((W||r).dirtyFields,R),error:me((W||r).errors,R),isValidating:!!me(r.validatingFields,R),isTouched:!!me((W||r).touchedFields,R)}),Y=R=>{R&&Wd(R).forEach(W=>qt(r.errors,W)),c.state.next({errors:R?r.errors:{}})},re=(R,W,G)=>{const pe=(me(n,R,{_f:{}})._f||{}).ref,le=me(r.errors,R)||{},{ref:ie,message:Oe,type:Fe,..._t}=le;ct(r.errors,R,{..._t,...W,ref:pe}),c.state.next({name:R,errors:r.errors,isValid:!1}),G&&G.shouldFocus&&pe&&pe.focus&&pe.focus()},ce=(R,W)=>ho(R)?c.values.subscribe({next:G=>R(F(void 0,W),G)}):F(R,W,!0),de=(R,W={})=>{for(const G of R?Wd(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);c.values.next({values:{...o}}),c.state.next({...r,...W.keepDirty?{isDirty:_()}:{}}),!W.keepIsValid&&g()},Z=({disabled:R,name:W,field:G,fields:pe,value:le})=>{if(jn(R)&&a.mount||R){const ie=R?void 0:Lt(le)?M0(G?G._f:me(pe,W)._f):le;ct(o,W,ie),P(W,ie,!1,!1,!0)}},ne=(R,W={})=>{let G=me(n,R);const pe=jn(W.disabled)||jn(e.disabled);return ct(n,R,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:R}},name:R,mount:!0,...W}}),s.mount.add(R),G?Z({field:G,disabled:jn(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:nd(W.min),max:nd(W.max),minLength:nd(W.minLength),maxLength:nd(W.maxLength),pattern:nd(W.pattern)}:{},name:R,onChange:I,onBlur:I,ref:le=>{if(le){ne(R,W),G=me(n,R);const ie=Lt(le.value)&&le.querySelectorAll&&le.querySelectorAll("input,select,textarea")[0]||le,Oe=sle(ie),Fe=G._f.refs||[];if(Oe?Fe.find(_t=>_t===ie):ie===G._f.ref)return;ct(n,R,{_f:{...G._f,...Oe?{refs:[...Fe.filter(k0),ie,...Array.isArray(me(i,R))?[{}]:[]],ref:{type:ie.type,name:R}}:{ref:ie}}}),S(R,!1,void 0,ie)}else G=me(n,R,{}),G._f&&(G._f.mount=!1),(t.shouldUnregister||W.shouldUnregister)&&!(L4(s.array,R)&&a.action)&&s.unMount.add(R)}}},K=()=>t.shouldFocusError&&Hd(n,$,s.mount),J=R=>{jn(R)&&(c.state.next({disabled:R}),Hd(n,(W,G)=>{const pe=me(n,G);pe&&(W.disabled=pe._f.disabled||R,Array.isArray(pe._f.refs)&&pe._f.refs.forEach(le=>{le.disabled=pe._f.disabled||R}))},0,!1))},te=(R,W)=>async G=>{let pe;G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let le=Ur(o);if(c.state.next({isSubmitting:!0}),t.resolver){const{errors:ie,values:Oe}=await A();r.errors=ie,le=Oe}else await D(n);if(qt(r.errors,"root"),Hr(r.errors)){c.state.next({errors:{}});try{await R(le,G)}catch(ie){pe=ie}}else W&&await W({...r.errors},G),K(),setTimeout(K);if(c.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Hr(r.errors)&&!pe,submitCount:r.submitCount+1,errors:r.errors}),pe)throw pe},H=(R,W={})=>{me(n,R)&&(Lt(W.defaultValue)?z(R,Ur(me(i,R))):(z(R,W.defaultValue),ct(i,R,Ur(W.defaultValue))),W.keepTouched||qt(r.touchedFields,R),W.keepDirty||(qt(r.dirtyFields,R),r.isDirty=W.defaultValue?_(R,Ur(me(i,R))):_()),W.keepError||(qt(r.errors,R),d.isValid&&g()),c.state.next({...r}))},Ae=(R,W={})=>{const G=R?Ur(R):i,pe=Ur(G),le=Hr(R),ie=le?i:pe;if(W.keepDefaultValues||(i=G),!W.keepValues){if(W.keepDirtyValues){const Oe=new Set([...s.mount,...Object.keys(rd(i,o))]);for(const Fe of Array.from(Oe))me(r.dirtyFields,Fe)?ct(ie,Fe,me(o,Fe)):z(Fe,me(ie,Fe))}else{if(NA&&Lt(R))for(const Oe of s.mount){const Fe=me(n,Oe);if(Fe&&Fe._f){const _t=Array.isArray(Fe._f.refs)?Fe._f.refs[0]:Fe._f.ref;if(Mv(_t)){const xt=_t.closest("form");if(xt){xt.reset();break}}}}n={}}o=e.shouldUnregister?W.keepDefaultValues?Ur(i):{}:Ur(ie),c.array.next({values:{...ie}}),c.values.next({values:{...ie}})}s={mount:W.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!W.keepIsValid||!!W.keepDirtyValues,a.watch=!!e.shouldUnregister,c.state.next({submitCount:W.keepSubmitCount?r.submitCount:0,isDirty:le?!1:W.keepDirty?r.isDirty:!!(W.keepDefaultValues&&!la(R,i)),isSubmitted:W.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:le?{}:W.keepDirtyValues?W.keepDefaultValues&&o?rd(i,o):r.dirtyFields:W.keepDefaultValues&&R?rd(i,R):W.keepDirty?r.dirtyFields:{},touchedFields:W.keepTouched?r.touchedFields:{},errors:W.keepErrors?r.errors:{},isSubmitSuccessful:W.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},ue=(R,W)=>Ae(ho(R)?R(o):R,W);return{control:{register:ne,unregister:de,getFieldState:U,handleSubmit:te,setError:re,_executeSchema:A,_getWatch:F,_getDirty:_,_updateValid:g,_removeUnmounted:N,_updateFieldArray:y,_updateDisabledField:Z,_getFieldArray:k,_reset:Ae,_resetDefaultValues:()=>ho(t.defaultValues)&&t.defaultValues().then(R=>{ue(R,t.resetOptions),c.state.next({isLoading:!1})}),_updateFormState:R=>{r={...r,...R}},_disableForm:J,_subjects:c,_proxyFormState:d,_setErrors:E,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:j,register:ne,handleSubmit:te,watch:ce,setValue:z,getValues:O,reset:ue,resetField:H,clearErrors:Y,unregister:de,setError:re,setFocus:(R,W={})=>{const G=me(n,R),pe=G&&G._f;if(pe){const le=pe.refs?pe.refs[0]:pe.ref;le.focus&&(le.focus(),W.shouldSelect&&le.select())}},getFieldState:U}}function sb(e={}){const t=M.useRef(),r=M.useRef(),[n,i]=M.useState({isDirty:!1,isValidating:!1,isLoading:ho(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ho(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...hle(e),formState:n});const o=t.current.control;return o._options=e,kA({subject:o._subjects.state,next:a=>{U4(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&&!la(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=V4(n,o),t.current}const pD=(e,t,r)=>{if(e&&"reportValidity"in e){const n=me(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Q4=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?pD(n.ref,r,e):n.refs&&n.refs.forEach(i=>pD(i,r,e))}},mle=(e,t)=>{t.shouldUseNativeValidation&&Q4(e,t);const r={};for(const n in e){const i=me(t.fields,n),o=Object.assign(e[n]||{},{ref:i&&i.ref});if(vle(t.names||Object.keys(e),n)){const a=Object.assign({},me(r,n));ct(a,"root",o),ct(r,n,a)}else ct(r,n,o)}return r},vle=(e,t)=>e.some(r=>r.startsWith(t+"."));var gle=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(d){return d.errors.forEach(function(c){return e.push(c)})}),t){var l=r[a].types,u=l&&l[n.code];r[a]=H4(a,t,r,i,u?[].concat(u,n.message):n.message)}e.shift()}return r},lb=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&&Q4({},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:mle(gle(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}}},it;(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})(it||(it={}));var hD;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(hD||(hD={}));const we=it.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ys=e=>{switch(typeof e){case"undefined":return we.undefined;case"string":return we.string;case"number":return isNaN(e)?we.nan:we.number;case"boolean":return we.boolean;case"function":return we.function;case"bigint":return we.bigint;case"symbol":return we.symbol;case"object":return Array.isArray(e)?we.array:e===null?we.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?we.promise:typeof Map<"u"&&e instanceof Map?we.map:typeof Set<"u"&&e instanceof Set?we.set:typeof Date<"u"&&e instanceof Date?we.date:we.object;default:return we.unknown}},se=it.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 Bn 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()}}Bn.create=e=>new Bn(e);const kf=(e,t)=>{let r;switch(e.code){case se.invalid_type:e.received===we.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case se.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,it.jsonStringifyReplacer)}`;break;case se.unrecognized_keys:r=`Unrecognized key(s) in object: ${it.joinValues(e.keys,", ")}`;break;case se.invalid_union:r="Invalid input";break;case se.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${it.joinValues(e.options)}`;break;case se.invalid_enum_value:r=`Invalid enum value. Expected ${it.joinValues(e.options)}, received '${e.received}'`;break;case se.invalid_arguments:r="Invalid function arguments";break;case se.invalid_return_type:r="Invalid function return type";break;case se.invalid_date:r="Invalid date";break;case se.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}"`:it.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case se.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 se.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 se.custom:r="Invalid input";break;case se.invalid_intersection_types:r="Intersection results could not be merged";break;case se.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case se.not_finite:r="Number must be finite";break;default:r=t.defaultError,it.assertNever(e)}return{message:r}};let yle=kf;function s1(){return yle}const l1=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=s1(),n=l1({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===kf?void 0:kf].filter(i=>!!i)});e.common.issues.push(n)}class Rr{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 Le;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 Rr.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 Le;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 Le=Object.freeze({status:"aborted"}),Ed=e=>({status:"dirty",value:e}),Qr=e=>({status:"valid",value:e}),mD=e=>e.status==="aborted",vD=e=>e.status==="dirty",$v=e=>e.status==="valid",Lv=e=>typeof Promise<"u"&&e instanceof Promise;function Fv(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 J4(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 Pd,Cd;class Xi{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 gD=(e,t)=>{if($v(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 Bn(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:d}=e;return a.code==="invalid_enum_value"?{message:d??s.defaultError}:typeof s.data>"u"?{message:(l=d??n)!==null&&l!==void 0?l:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(u=d??r)!==null&&u!==void 0?u:s.defaultError}},description:i}}class Ye{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 ys(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ys(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Rr,ctx:{common:t.parent.common,data:t.data,parsedType:ys(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Lv(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:ys(t)},o=this._parseSync({data:t,path:i.path,parent:i});return gD(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:ys(t)},i=this._parse({data:t,path:n.path,parent:n}),o=await(Lv(i)?i:Promise.resolve(i));return gD(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:se.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 Ro({schema:this,typeName:Re.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return So.create(this,this._def)}nullable(){return el.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gi.create(this,this._def)}promise(){return If.create(this,this._def)}or(t){return Uv.create([this,t],this._def)}and(t){return zv.create(this,t,this._def)}transform(t){return new Ro({...ze(this._def),schema:this,typeName:Re.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new qv({...ze(this._def),innerType:this,defaultValue:r,typeName:Re.ZodDefault})}brand(){return new nU({typeName:Re.ZodBranded,type:this,...ze(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Yv({...ze(this._def),innerType:this,catchValue:r,typeName:Re.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ub.create(this,t)}readonly(){return Xv.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ble=/^c[^\s-]{8,}$/i,xle=/^[0-9a-z]+$/,wle=/^[0-9A-HJKMNP-TV-Z]{26}$/,Sle=/^[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,Ele=/^[a-z0-9_-]{21}$/i,Ple=/^[-+]?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)?)??$/,Cle=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ale="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let I0;const Tle=/^(?:(?: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])$/,Ole=/^(([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}=))?$/,eU="((\\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])))",jle=new RegExp(`^${eU}$`);function tU(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 Nle(e){return new RegExp(`^${tU(e)}$`)}function Dle(e){let t=`${eU}T${tU(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 kle(e,t){return!!((t==="v4"||!t)&&Tle.test(e)||(t==="v6"||!t)&&Ole.test(e))}class mo extends Ye{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==we.string){const o=this._getOrReturnCtx(t);return ye(o,{code:se.invalid_type,expected:we.string,received:o.parsedType}),Le}const n=new Rr;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:se.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:se.invalid_string,..._e.errToObj(n)})}_addCheck(t){return new mo({...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 mo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mo({...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 mo({checks:[],typeName:Re.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ze(e)})};function Mle(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 zu extends Ye{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)!==we.number){const o=this._getOrReturnCtx(t);return ye(o,{code:se.invalid_type,expected:we.number,received:o.parsedType}),Le}let n;const i=new Rr;for(const o of this._def.checks)o.kind==="int"?it.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ye(n,{code:se.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:se.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Mle(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),ye(n,{code:se.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:se.not_finite,message:o.message}),i.dirty()):it.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 zu({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_e.toString(i)}]})}_addCheck(t){return new zu({...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"&&it.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 zu({checks:[],typeName:Re.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...ze(e)});class Wu extends Ye{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)!==we.bigint){const o=this._getOrReturnCtx(t);return ye(o,{code:se.invalid_type,expected:we.bigint,received:o.parsedType}),Le}let n;const i=new Rr;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:se.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:se.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):it.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 Wu({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_e.toString(i)}]})}_addCheck(t){return new Wu({...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 Wu({checks:[],typeName:Re.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...ze(e)})};class u1 extends Ye{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==we.boolean){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:we.boolean,received:n.parsedType}),Le}return Qr(t.data)}}u1.create=e=>new u1({typeName:Re.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...ze(e)});class Mf extends Ye{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==we.date){const o=this._getOrReturnCtx(t);return ye(o,{code:se.invalid_type,expected:we.date,received:o.parsedType}),Le}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return ye(o,{code:se.invalid_date}),Le}const n=new Rr;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:se.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):it.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Mf({...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 Mf({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Re.ZodDate,...ze(e)});class c1 extends Ye{_parse(t){if(this._getType(t)!==we.symbol){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:we.symbol,received:n.parsedType}),Le}return Qr(t.data)}}c1.create=e=>new c1({typeName:Re.ZodSymbol,...ze(e)});class Bv extends Ye{_parse(t){if(this._getType(t)!==we.undefined){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:we.undefined,received:n.parsedType}),Le}return Qr(t.data)}}Bv.create=e=>new Bv({typeName:Re.ZodUndefined,...ze(e)});class Vv extends Ye{_parse(t){if(this._getType(t)!==we.null){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:we.null,received:n.parsedType}),Le}return Qr(t.data)}}Vv.create=e=>new Vv({typeName:Re.ZodNull,...ze(e)});class d1 extends Ye{constructor(){super(...arguments),this._any=!0}_parse(t){return Qr(t.data)}}d1.create=e=>new d1({typeName:Re.ZodAny,...ze(e)});class lu extends Ye{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Qr(t.data)}}lu.create=e=>new lu({typeName:Re.ZodUnknown,...ze(e)});class Wa extends Ye{_parse(t){const r=this._getOrReturnCtx(t);return ye(r,{code:se.invalid_type,expected:we.never,received:r.parsedType}),Le}}Wa.create=e=>new Wa({typeName:Re.ZodNever,...ze(e)});class f1 extends Ye{_parse(t){if(this._getType(t)!==we.undefined){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:we.void,received:n.parsedType}),Le}return Qr(t.data)}}f1.create=e=>new f1({typeName:Re.ZodVoid,...ze(e)});class Gi extends Ye{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==we.array)return ye(r,{code:se.invalid_type,expected:we.array,received:r.parsedType}),Le;if(i.exactLength!==null){const a=r.data.length>i.exactLength.value,s=r.data.lengthi.maxLength.value&&(ye(r,{code:se.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 Xi(r,a,r.path,s)))).then(a=>Rr.mergeArray(n,a));const o=[...r.data].map((a,s)=>i.type._parseSync(new Xi(r,a,r.path,s)));return Rr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new Gi({...this._def,minLength:{value:t,message:_e.toString(r)}})}max(t,r){return new Gi({...this._def,maxLength:{value:t,message:_e.toString(r)}})}length(t,r){return new Gi({...this._def,exactLength:{value:t,message:_e.toString(r)}})}nonempty(t){return this.min(1,t)}}Gi.create=(e,t)=>new Gi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Re.ZodArray,...ze(t)});function Al(e){if(e instanceof Rt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=So.create(Al(n))}return new Rt({...e._def,shape:()=>t})}else return e instanceof Gi?new Gi({...e._def,type:Al(e.element)}):e instanceof So?So.create(Al(e.unwrap())):e instanceof el?el.create(Al(e.unwrap())):e instanceof Io?Io.create(e.items.map(t=>Al(t))):e}class Rt extends Ye{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=it.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==we.object){const u=this._getOrReturnCtx(t);return ye(u,{code:se.invalid_type,expected:we.object,received:u.parsedType}),Le}const{status:n,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Wa&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||s.push(u);const l=[];for(const u of a){const d=o[u],c=i.data[u];l.push({key:{status:"valid",value:u},value:d._parse(new Xi(i,c,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Wa){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of s)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")s.length>0&&(ye(i,{code:se.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 d of s){const c=i.data[d];l.push({key:{status:"valid",value:d},value:u._parse(new Xi(i,c,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of l){const c=await d.key,f=await d.value;u.push({key:c,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>Rr.mergeObjectSync(n,u)):Rr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return _e.errToObj,new Rt({...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 Rt({...this._def,unknownKeys:"strip"})}passthrough(){return new Rt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Rt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Rt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Re.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Rt({...this._def,catchall:t})}pick(t){const r={};return it.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}omit(t){const r={};return it.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Rt({...this._def,shape:()=>r})}deepPartial(){return Al(this)}partial(t){const r={};return it.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}),new Rt({...this._def,shape:()=>r})}required(t){const r={};return it.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof So;)o=o._def.innerType;r[n]=o}}),new Rt({...this._def,shape:()=>r})}keyof(){return rU(it.objectKeys(this.shape))}}Rt.create=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strip",catchall:Wa.create(),typeName:Re.ZodObject,...ze(t)});Rt.strictCreate=(e,t)=>new Rt({shape:()=>e,unknownKeys:"strict",catchall:Wa.create(),typeName:Re.ZodObject,...ze(t)});Rt.lazycreate=(e,t)=>new Rt({shape:e,unknownKeys:"strip",catchall:Wa.create(),typeName:Re.ZodObject,...ze(t)});class Uv extends Ye{_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 Bn(s.ctx.common.issues));return ye(r,{code:se.invalid_union,unionErrors:a}),Le}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},d=l._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,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 Bn(l));return ye(r,{code:se.invalid_union,unionErrors:s}),Le}}get options(){return this._def.options}}Uv.create=(e,t)=>new Uv({options:e,typeName:Re.ZodUnion,...ze(t)});const ao=e=>e instanceof Hv?ao(e.schema):e instanceof Ro?ao(e.innerType()):e instanceof Gv?[e.value]:e instanceof Js?e.options:e instanceof Kv?it.objectValues(e.enum):e instanceof qv?ao(e._def.innerType):e instanceof Bv?[void 0]:e instanceof Vv?[null]:e instanceof So?[void 0,...ao(e.unwrap())]:e instanceof el?[null,...ao(e.unwrap())]:e instanceof nU||e instanceof Xv?ao(e.unwrap()):e instanceof Yv?ao(e._def.innerType):[];class RA extends Ye{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==we.object)return ye(r,{code:se.invalid_type,expected:we.object,received:r.parsedType}),Le;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:se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Le)}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=ao(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 RA({typeName:Re.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...ze(n)})}}function p1(e,t){const r=ys(e),n=ys(t);if(e===t)return{valid:!0,data:e};if(r===we.object&&n===we.object){const i=it.objectKeys(t),o=it.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const l=p1(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(r===we.array&&n===we.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o{if(mD(o)||mD(a))return Le;const s=p1(o.value,a.value);return s.valid?((vD(o)||vD(a))&&r.dirty(),{status:r.value,value:s.data}):(ye(n,{code:se.invalid_intersection_types}),Le)};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}))}}zv.create=(e,t,r)=>new zv({left:e,right:t,typeName:Re.ZodIntersection,...ze(r)});class Io extends Ye{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==we.array)return ye(n,{code:se.invalid_type,expected:we.array,received:n.parsedType}),Le;if(n.data.lengththis._def.items.length&&(ye(n,{code:se.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 Xi(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>Rr.mergeArray(r,a)):Rr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new Io({...this._def,rest:t})}}Io.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Io({items:e,typeName:Re.ZodTuple,rest:null,...ze(t)})};class Wv extends Ye{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!==we.object)return ye(n,{code:se.invalid_type,expected:we.object,received:n.parsedType}),Le;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in n.data)i.push({key:o._parse(new Xi(n,s,n.path,s)),value:a._parse(new Xi(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Rr.mergeObjectAsync(r,i):Rr.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ye?new Wv({keyType:t,valueType:r,typeName:Re.ZodRecord,...ze(n)}):new Wv({keyType:mo.create(),valueType:t,typeName:Re.ZodRecord,...ze(r)})}}class h1 extends Ye{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!==we.map)return ye(n,{code:se.invalid_type,expected:we.map,received:n.parsedType}),Le;const i=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([s,l],u)=>({key:i._parse(new Xi(n,s,n.path,[u,"key"])),value:o._parse(new Xi(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,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return Le;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(u.value,d.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of a){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return Le;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(u.value,d.value)}return{status:r.value,value:s}}}}h1.create=(e,t,r)=>new h1({valueType:t,keyType:e,typeName:Re.ZodMap,...ze(r)});class Hu extends Ye{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==we.set)return ye(n,{code:se.invalid_type,expected:we.set,received:n.parsedType}),Le;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(ye(n,{code:se.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 d of l){if(d.status==="aborted")return Le;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const s=[...n.data.values()].map((l,u)=>o._parse(new Xi(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,r){return new Hu({...this._def,minSize:{value:t,message:_e.toString(r)}})}max(t,r){return new Hu({...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)}}Hu.create=(e,t)=>new Hu({valueType:e,minSize:null,maxSize:null,typeName:Re.ZodSet,...ze(t)});class Gd extends Ye{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==we.function)return ye(r,{code:se.invalid_type,expected:we.function,received:r.parsedType}),Le;function n(s,l){return l1({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,s1(),kf].filter(u=>!!u),issueData:{code:se.invalid_arguments,argumentsError:l}})}function i(s,l){return l1({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,s1(),kf].filter(u=>!!u),issueData:{code:se.invalid_return_type,returnTypeError:l}})}const o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof If){const s=this;return Qr(async function(...l){const u=new Bn([]),d=await s._def.args.parseAsync(l,o).catch(p=>{throw u.addIssue(n(l,p)),u}),c=await Reflect.apply(a,this,d);return await s._def.returns._def.type.parseAsync(c,o).catch(p=>{throw u.addIssue(i(c,p)),u})})}else{const s=this;return Qr(function(...l){const u=s._def.args.safeParse(l,o);if(!u.success)throw new Bn([n(l,u.error)]);const d=Reflect.apply(a,this,u.data),c=s._def.returns.safeParse(d,o);if(!c.success)throw new Bn([i(d,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Gd({...this._def,args:Io.create(t).rest(lu.create())})}returns(t){return new Gd({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Gd({args:t||Io.create([]).rest(lu.create()),returns:r||lu.create(),typeName:Re.ZodFunction,...ze(n)})}}class Hv extends Ye{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})}}Hv.create=(e,t)=>new Hv({getter:e,typeName:Re.ZodLazy,...ze(t)});class Gv extends Ye{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ye(r,{received:r.data,code:se.invalid_literal,expected:this._def.value}),Le}return{status:"valid",value:t.data}}get value(){return this._def.value}}Gv.create=(e,t)=>new Gv({value:e,typeName:Re.ZodLiteral,...ze(t)});function rU(e,t){return new Js({values:e,typeName:Re.ZodEnum,...ze(t)})}class Js extends Ye{constructor(){super(...arguments),Pd.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ye(r,{expected:it.joinValues(n),received:r.parsedType,code:se.invalid_type}),Le}if(Fv(this,Pd)||J4(this,Pd,new Set(this._def.values)),!Fv(this,Pd).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ye(r,{received:r.data,code:se.invalid_enum_value,options:n}),Le}return Qr(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 Js.create(t,{...this._def,...r})}exclude(t,r=this._def){return Js.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Pd=new WeakMap;Js.create=rU;class Kv extends Ye{constructor(){super(...arguments),Cd.set(this,void 0)}_parse(t){const r=it.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==we.string&&n.parsedType!==we.number){const i=it.objectValues(r);return ye(n,{expected:it.joinValues(i),received:n.parsedType,code:se.invalid_type}),Le}if(Fv(this,Cd)||J4(this,Cd,new Set(it.getValidEnumValues(this._def.values))),!Fv(this,Cd).has(t.data)){const i=it.objectValues(r);return ye(n,{received:n.data,code:se.invalid_enum_value,options:i}),Le}return Qr(t.data)}get enum(){return this._def.values}}Cd=new WeakMap;Kv.create=(e,t)=>new Kv({values:e,typeName:Re.ZodNativeEnum,...ze(t)});class If extends Ye{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==we.promise&&r.common.async===!1)return ye(r,{code:se.invalid_type,expected:we.promise,received:r.parsedType}),Le;const n=r.parsedType===we.promise?r.data:Promise.resolve(r.data);return Qr(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}If.create=(e,t)=>new If({type:e,typeName:Re.ZodPromise,...ze(t)});class Ro extends Ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Re.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 Le;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?Le:l.status==="dirty"||r.value==="dirty"?Ed(l.value):l});{if(r.value==="aborted")return Le;const s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?Le:s.status==="dirty"||r.value==="dirty"?Ed(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"?Le:(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"?Le:(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(!$v(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=>$v(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:r.value,value:s})):a);it.assertNever(i)}}Ro.create=(e,t,r)=>new Ro({schema:e,typeName:Re.ZodEffects,effect:t,...ze(r)});Ro.createWithPreprocess=(e,t,r)=>new Ro({schema:t,effect:{type:"preprocess",transform:e},typeName:Re.ZodEffects,...ze(r)});class So extends Ye{_parse(t){return this._getType(t)===we.undefined?Qr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}So.create=(e,t)=>new So({innerType:e,typeName:Re.ZodOptional,...ze(t)});class el extends Ye{_parse(t){return this._getType(t)===we.null?Qr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}el.create=(e,t)=>new el({innerType:e,typeName:Re.ZodNullable,...ze(t)});class qv extends Ye{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===we.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}qv.create=(e,t)=>new qv({innerType:e,typeName:Re.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ze(t)});class Yv extends Ye{_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 Lv(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Bn(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Yv.create=(e,t)=>new Yv({innerType:e,typeName:Re.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ze(t)});class m1 extends Ye{_parse(t){if(this._getType(t)!==we.nan){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:we.nan,received:n.parsedType}),Le}return{status:"valid",value:t.data}}}m1.create=e=>new m1({typeName:Re.ZodNaN,...ze(e)});class nU extends Ye{_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 ub extends Ye{_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"?Le:o.status==="dirty"?(r.dirty(),Ed(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"?Le: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 ub({in:t,out:r,typeName:Re.ZodPipeline})}}class Xv extends Ye{_parse(t){const r=this._def.innerType._parse(t),n=i=>($v(i)&&(i.value=Object.freeze(i.value)),i);return Lv(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}Xv.create=(e,t)=>new Xv({innerType:e,typeName:Re.ZodReadonly,...ze(t)});Rt.lazycreate;var Re;(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"})(Re||(Re={}));const Li=mo.create;zu.create;m1.create;Wu.create;u1.create;Mf.create;c1.create;Bv.create;Vv.create;d1.create;lu.create;Wa.create;f1.create;Gi.create;const cb=Rt.create;Rt.strictCreate;Uv.create;RA.create;zv.create;Io.create;Wv.create;h1.create;Hu.create;Gd.create;Hv.create;Gv.create;Js.create;Kv.create;If.create;Ro.create;So.create;el.create;Ro.createWithPreprocess;ub.create;var $A="Dialog",[iU,oU]=yc($A),[Ile,Ci]=iU($A),aU=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,d]=Iu({prop:n,defaultProp:i,onChange:o});return h.jsx(Ile,{scope:t,triggerRef:s,contentRef:l,contentId:wo(),titleId:wo(),descriptionId:wo(),open:u,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(c=>!c),[d]),modal:a,children:r})};aU.displayName=$A;var sU="DialogTrigger",lU=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ci(sU,r),o=lt(t,i.triggerRef);return h.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":BA(i.open),...n,ref:o,onClick:Ee(e.onClick,i.onOpenToggle)})});lU.displayName=sU;var LA="DialogPortal",[Rle,uU]=iU(LA,{forceMount:void 0}),cU=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=Ci(LA,t);return h.jsx(Rle,{scope:t,forceMount:r,children:w.Children.map(n,a=>h.jsx(Uo,{present:r||o.open,children:h.jsx(Np,{asChild:!0,container:i,children:a})}))})};cU.displayName=LA;var Zv="DialogOverlay",dU=w.forwardRef((e,t)=>{const r=uU(Zv,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=Ci(Zv,e.__scopeDialog);return o.modal?h.jsx(Uo,{present:n||o.open,children:h.jsx($le,{...i,ref:t})}):null});dU.displayName=Zv;var $le=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ci(Zv,r);return h.jsx(rb,{as:No,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(Ke.div,{"data-state":BA(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),tl="DialogContent",fU=w.forwardRef((e,t)=>{const r=uU(tl,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=Ci(tl,e.__scopeDialog);return h.jsx(Uo,{present:n||o.open,children:o.modal?h.jsx(Lle,{...i,ref:t}):h.jsx(Fle,{...i,ref:t})})});fU.displayName=tl;var Lle=w.forwardRef((e,t)=>{const r=Ci(tl,e.__scopeDialog),n=w.useRef(null),i=lt(t,r.contentRef,n);return w.useEffect(()=>{const o=n.current;if(o)return wA(o)},[]),h.jsx(pU,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:Ee(e.onFocusOutside,o=>o.preventDefault())})}),Fle=w.forwardRef((e,t)=>{const r=Ci(tl,e.__scopeDialog),n=w.useRef(!1),i=w.useRef(!1);return h.jsx(pU,{...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()}})}),pU=w.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=e,s=Ci(tl,r),l=w.useRef(null),u=lt(t,l);return dA(),h.jsxs(h.Fragment,{children:[h.jsx(Yy,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(jp,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":BA(s.open),...a,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(Vle,{titleId:s.titleId}),h.jsx(zle,{contentRef:l,descriptionId:s.descriptionId})]})]})}),FA="DialogTitle",hU=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ci(FA,r);return h.jsx(Ke.h2,{id:i.titleId,...n,ref:t})});hU.displayName=FA;var mU="DialogDescription",vU=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ci(mU,r);return h.jsx(Ke.p,{id:i.descriptionId,...n,ref:t})});vU.displayName=mU;var gU="DialogClose",yU=w.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ci(gU,r);return h.jsx(Ke.button,{type:"button",...n,ref:t,onClick:Ee(e.onClick,()=>i.onOpenChange(!1))})});yU.displayName=gU;function BA(e){return e?"open":"closed"}var bU="DialogTitleWarning",[Ble,xU]=AK(bU,{contentName:tl,titleName:FA,docsSlug:"dialog"}),Vle=({titleId:e})=>{const t=xU(bU),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},Ule="DialogDescriptionWarning",zle=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xU(Ule).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},wU=aU,Wle=lU,SU=cU,VA=dU,UA=fU,zA=hU,WA=vU,HA=yU;const Ja=wU,Hle=SU,EU=w.forwardRef(({className:e,...t},r)=>h.jsx(VA,{ref:r,className:ke("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}));EU.displayName=VA.displayName;const zo=w.forwardRef(({className:e,children:t,...r},n)=>h.jsxs(Hle,{children:[h.jsx(EU,{}),h.jsxs(UA,{ref:n,className:ke("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(HA,{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(YL,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zo.displayName=UA.displayName;const Wo=({className:e,...t})=>h.jsx("div",{className:ke("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Wo.displayName="DialogHeader";const PU=({className:e,...t})=>h.jsx("div",{className:ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});PU.displayName="DialogFooter";const Ho=w.forwardRef(({className:e,...t},r)=>h.jsx(zA,{ref:r,className:ke("text-lg font-semibold leading-none tracking-tight",e),...t}));Ho.displayName=zA.displayName;const cl=w.forwardRef(({className:e,...t},r)=>h.jsx(WA,{ref:r,className:ke("text-sm text-muted-foreground",e),...t}));cl.displayName=WA.displayName;var Gle="Label",CU=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())}}));CU.displayName=Gle;var AU=CU;const Kle=Sy("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Cs=w.forwardRef(({className:e,...t},r)=>h.jsx(AU,{ref:r,className:ke(Kle(),e),...t}));Cs.displayName=AU.displayName;const db=Jse,TU=w.createContext({}),Fi=({...e})=>h.jsx(TU.Provider,{value:{name:e.name},children:h.jsx(nle,{...e})}),fb=()=>{const e=w.useContext(TU),t=w.useContext(OU),{getFieldState:r,formState:n}=ab(),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}},OU=w.createContext({}),fi=w.forwardRef(({className:e,...t},r)=>{const n=w.useId();return h.jsx(OU.Provider,{value:{id:n},children:h.jsx("div",{ref:r,className:ke("space-y-2",e),...t})})});fi.displayName="FormItem";const pi=w.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:i}=fb();return h.jsx(Cs,{ref:r,className:ke(n&&"text-destructive",e),htmlFor:i,...t})});pi.displayName="FormLabel";const hi=w.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:i,formMessageId:o}=fb();return h.jsx(No,{ref:t,id:n,"aria-describedby":r?`${i} ${o}`:`${i}`,"aria-invalid":!!r,...e})});hi.displayName="FormControl";const qle=w.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=fb();return h.jsx("p",{ref:r,id:n,className:ke("text-sm text-muted-foreground",e),...t})});qle.displayName="FormDescription";const mi=w.forwardRef(({className:e,children:t,...r},n)=>{const{error:i,formMessageId:o}=fb(),a=i?String(i==null?void 0:i.message):t;return a?h.jsx("p",{ref:n,id:o,className:ke("text-sm font-medium text-destructive",e),...r,children:a}):null});mi.displayName="FormMessage";const Pr=w.forwardRef(({className:e,type:t,...r},n)=>h.jsx("input",{type:t,className:ke("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}));Pr.displayName="Input";const Yle=cb({name:Li().min(2,{message:"Exercise name must be at least 2 characters."}),weight:Li().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Weight must be a positive number."}),reps:Li().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Reps must be a positive number."}),sets:Li().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Sets must be a positive number."})});function Xle({open:e,onOpenChange:t,onSubmit:r}){const n=sb({resolver:lb(Yle),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(Ja,{open:e,onOpenChange:t,children:h.jsxs(zo,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[h.jsxs(Wo,{children:[h.jsx(Ho,{children:"Add Exercise"}),h.jsx(cl,{children:"What's your next challenge?"})]}),h.jsx(db,{...n,children:h.jsxs("form",{onSubmit:n.handleSubmit(i),className:"space-y-4",children:[h.jsx(Fi,{control:n.control,name:"name",render:({field:o})=>h.jsxs(fi,{children:[h.jsx(pi,{className:"text-foreground",children:"Exercise Name"}),h.jsx(hi,{children:h.jsx(Pr,{placeholder:"e.g. Bench Press",...o})}),h.jsx(mi,{})]})}),h.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[h.jsx(Fi,{control:n.control,name:"weight",render:({field:o})=>h.jsxs(fi,{children:[h.jsx(pi,{className:"text-foreground",children:"Weight (kg)"}),h.jsx(hi,{children:h.jsx(Pr,{type:"number",step:"any",placeholder:"e.g. 70.5",className:"placeholder:text-muted-foreground",...o})}),h.jsx(mi,{})]})}),h.jsx(Fi,{control:n.control,name:"reps",render:({field:o})=>h.jsxs(fi,{children:[h.jsx(pi,{className:"text-foreground",children:"Reps"}),h.jsx(hi,{children:h.jsx(Pr,{type:"number",placeholder:"e.g. 8",className:"placeholder:text-muted-foreground",...o})}),h.jsx(mi,{})]})}),h.jsx(Fi,{control:n.control,name:"sets",render:({field:o})=>h.jsxs(fi,{children:[h.jsx(pi,{className:"text-foreground",children:"Sets"}),h.jsx(hi,{children:h.jsx(Pr,{type:"number",placeholder:"e.g. 3",className:"placeholder:text-muted-foreground",...o})}),h.jsx(mi,{})]})})]}),h.jsx(Be,{type:"submit",className:"w-full",children:"Add Exercise"})]})})]})})}var _U="AlertDialog",[Zle,hIe]=yc(_U,[oU]),Go=oU(),jU=e=>{const{__scopeAlertDialog:t,...r}=e,n=Go(t);return h.jsx(wU,{...n,...r,modal:!0})};jU.displayName=_U;var Qle="AlertDialogTrigger",Jle=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=Go(r);return h.jsx(Wle,{...i,...n,ref:t})});Jle.displayName=Qle;var eue="AlertDialogPortal",NU=e=>{const{__scopeAlertDialog:t,...r}=e,n=Go(t);return h.jsx(SU,{...n,...r})};NU.displayName=eue;var tue="AlertDialogOverlay",DU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=Go(r);return h.jsx(VA,{...i,...n,ref:t})});DU.displayName=tue;var uu="AlertDialogContent",[rue,nue]=Zle(uu),kU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...i}=e,o=Go(r),a=w.useRef(null),s=lt(t,a),l=w.useRef(null);return h.jsx(Ble,{contentName:uu,titleName:MU,docsSlug:"alert-dialog",children:h.jsx(rue,{scope:r,cancelRef:l,children:h.jsxs(UA,{role:"alertdialog",...o,...i,ref:s,onOpenAutoFocus:Ee(i.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[h.jsx(bL,{children:n}),h.jsx(oue,{contentRef:a})]})})})});kU.displayName=uu;var MU="AlertDialogTitle",IU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=Go(r);return h.jsx(zA,{...i,...n,ref:t})});IU.displayName=MU;var RU="AlertDialogDescription",$U=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=Go(r);return h.jsx(WA,{...i,...n,ref:t})});$U.displayName=RU;var iue="AlertDialogAction",LU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=Go(r);return h.jsx(HA,{...i,...n,ref:t})});LU.displayName=iue;var FU="AlertDialogCancel",BU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:i}=nue(FU,r),o=Go(r),a=lt(t,i);return h.jsx(HA,{...o,...n,ref:a})});BU.displayName=FU;var oue=({contentRef:e})=>{const t=`\`${uu}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${uu}\` by passing a \`${RU}\` 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 \`${uu}\`. 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},aue=jU,sue=NU,VU=DU,UU=kU,zU=LU,WU=BU,HU=IU,GU=$U;const GA=aue,lue=sue,KU=w.forwardRef(({className:e,...t},r)=>h.jsx(VU,{className:ke("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}));KU.displayName=VU.displayName;const pb=w.forwardRef(({className:e,...t},r)=>h.jsxs(lue,{children:[h.jsx(KU,{}),h.jsx(UU,{ref:r,className:ke("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})]}));pb.displayName=UU.displayName;const hb=({className:e,...t})=>h.jsx("div",{className:ke("flex flex-col space-y-2 text-center sm:text-left",e),...t});hb.displayName="AlertDialogHeader";const mb=({className:e,...t})=>h.jsx("div",{className:ke("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});mb.displayName="AlertDialogFooter";const vb=w.forwardRef(({className:e,...t},r)=>h.jsx(HU,{ref:r,className:ke("text-lg font-semibold",e),...t}));vb.displayName=HU.displayName;const gb=w.forwardRef(({className:e,...t},r)=>h.jsx(GU,{ref:r,className:ke("text-sm text-muted-foreground",e),...t}));gb.displayName=GU.displayName;const yb=w.forwardRef(({className:e,...t},r)=>h.jsx(zU,{ref:r,className:ke(uA(),e),...t}));yb.displayName=zU.displayName;const bb=w.forwardRef(({className:e,...t},r)=>h.jsx(WU,{ref:r,className:ke(uA({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));bb.displayName=WU.displayName;const uue=cb({weight:Li().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Weight must be a positive number."}),reps:Li().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Reps must be a positive number."}),sets:Li().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Sets must be a positive number."})});function cue({exercise:e,open:t,onOpenChange:r,onDelete:n,onRefresh:i}){const[o,a]=w.useState(!1),[s,l]=w.useState(e.name),[u,d]=w.useState([]),[c,f]=w.useState(!1),[p,m]=w.useState({open:!1,variationId:null,variationInfo:""}),{toast:v}=_p(),[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=sb({resolver:lb(uue),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();d(D)}else console.error("Failed to fetch variations:",T.status,T.statusText),d([])}catch(T){console.error("Error fetching variations:",T),d([])}finally{f(!1)}},E=async T=>{const D=Number(T.weight),N=Number(T.reps),_=Number(T.sets);if(u.some(k=>k.targetWeight===D&&k.targetReps===N&&k.targetSets===_)){v({title:"Variation Already Exists",description:`A variation with ${D}kg × ${N} reps × ${_} 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:_,isActive:!0})});if(k.ok){const B=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)}},P=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(Ja,{open:t,onOpenChange:r,children:[h.jsxs(zo,{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(Wo,{children:[h.jsx(Ho,{className:"flex items-center justify-start gap-4",children:o?h.jsxs(h.Fragment,{children:[h.jsx(Pr,{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(Be,{type:"button",variant:"ghost",size:"sm",onClick:C,className:"h-8 w-8 p-0 flex-shrink-0",children:h.jsx(xi,{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(Be,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>a(!0),children:h.jsx(OS,{className:"h-3 w-3"})})]})}),h.jsx(cl,{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(db,{...y,children:h.jsxs("form",{onSubmit:y.handleSubmit(E),className:"space-y-3",children:[h.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[h.jsx(Fi,{control:y.control,name:"weight",render:({field:T})=>h.jsxs(fi,{children:[h.jsx(pi,{className:"text-foreground text-sm",children:"Weight (kg)"}),h.jsx(hi,{children:h.jsx(Pr,{type:"number",step:"any",placeholder:"e.g. 70.5",className:"placeholder:text-muted-foreground",...T})}),h.jsx(mi,{})]})}),h.jsx(Fi,{control:y.control,name:"reps",render:({field:T})=>h.jsxs(fi,{children:[h.jsx(pi,{className:"text-foreground text-sm",children:"Reps"}),h.jsx(hi,{children:h.jsx(Pr,{type:"number",placeholder:"e.g. 8",className:"placeholder:text-muted-foreground",...T})}),h.jsx(mi,{})]})}),h.jsx(Fi,{control:y.control,name:"sets",render:({field:T})=>h.jsxs(fi,{children:[h.jsx(pi,{className:"text-foreground text-sm",children:"Sets"}),h.jsx(hi,{children:h.jsx(Pr,{type:"number",placeholder:"e.g. 3",className:"placeholder:text-muted-foreground",...T})}),h.jsx(mi,{})]})})]}),h.jsxs(Be,{type:"submit",size:"sm",disabled:c,className:"flex items-center gap-1",children:[h.jsx(iu,{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:c?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,_)=>(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?"✓":"✗"},_))),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,_)=>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"},_))})})]}),h.jsx("div",{className:"flex items-center ml-3",children:h.jsx(Be,{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(gf,{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,_)=>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"},_))})]}),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(iu,{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(Be,{type:"button",variant:"destructive",size:"sm",onClick:()=>{n(),r(!1)},className:"px-3",children:h.jsx(gf,{className:"h-4 w-4"})}),h.jsx(Be,{type:"button",onClick:()=>r(!1),variant:"outline",className:"bg-white hover:bg-gray-50",children:"End"})]})]}),h.jsx(GA,{open:p.open,onOpenChange:T=>m({...p,open:T}),children:h.jsxs(pb,{children:[h.jsxs(hb,{children:[h.jsx(vb,{children:"Drop this variation?"}),h.jsxs(gb,{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(mb,{children:[h.jsx(bb,{children:"Keep it"}),h.jsx(yb,{onClick:P,className:"bg-red-600 hover:bg-red-700",children:"Delete variation"})]})]})})]})}function due({open:e,onOpenChange:t,onConfirm:r,isSuccess:n}){return h.jsx(Ja,{open:e,onOpenChange:t,children:h.jsxs(zo,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[h.jsxs(Wo,{children:[h.jsx(Ho,{children:"Delete last exercise?"}),h.jsx(cl,{children:"This will remove the most recent workout completion."})]}),h.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[h.jsx(Be,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(Be,{onClick:()=>{r(),t(!1)},children:"Delete"})]})]})})}const fue=cb({name:Li().min(2,{message:"Routine name must be at least 2 characters."})});function pue({open:e,onOpenChange:t,onSubmit:r,onDelete:n,routine:i,mode:o,existingRoutines:a}){const s=sb({resolver:lb(fue),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(d){r(d.name),s.reset(),t(!1)}const u=a.length===1;return h.jsx(Ja,{open:e,onOpenChange:t,children:h.jsxs(zo,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[h.jsxs(Wo,{children:[h.jsx(Ho,{children:o==="create"?"Create Routine":"Edit Routine"}),h.jsx(cl,{children:o==="create"?"Create a new routine.":"Edit routine name or delete the routine."})]}),h.jsx(db,{...s,children:h.jsxs("form",{onSubmit:s.handleSubmit(l),className:"space-y-4",children:[h.jsx(Fi,{control:s.control,name:"name",render:({field:d})=>h.jsxs(fi,{children:[h.jsx(pi,{className:"text-foreground",children:"Routine Name"}),h.jsx(hi,{children:h.jsx(Pr,{placeholder:"e.g. Upper Body",...d})}),h.jsx(mi,{})]})}),h.jsxs("div",{className:"flex justify-between pt-4",children:[o==="edit"&&n&&!u&&h.jsx(Be,{type:"button",variant:"destructive",className:"px-3",onClick:()=>{n(),t(!1)},children:h.jsx(gf,{className:"h-4 w-4"})}),h.jsxs("div",{className:`space-x-2 ${o==="create"||u?"ml-auto":""}`,children:[h.jsx(Be,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(Be,{type:"submit",children:o==="create"?"Create Routine":"Save Changes"})]})]})]})})]})})}const qU=w.forwardRef(({className:e,...t},r)=>h.jsx("textarea",{className:ke("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}));qU.displayName="Textarea";const yD=300;function hue({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=yD-i.length;return h.jsx(Ja,{open:e,onOpenChange:t,children:h.jsxs(zo,{className:"sm:max-w-md sm:top-[20%] top-[10%] translate-y-0",children:[h.jsx(Wo,{children:h.jsxs(Ho,{className:"flex items-center gap-2",children:[h.jsx(KL,{className:"h-5 w-5"}),"Gym diary time! 📝"]})}),h.jsxs("div",{className:"space-y-4",children:[h.jsx(qU,{value:i,onChange:u=>o(u.target.value),placeholder:"Add a note for this exercise...",maxLength:yD,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(PU,{className:"gap-2",children:[h.jsx(Be,{variant:"outline",onClick:s,disabled:i.length===0,children:"Clear"}),h.jsx(Be,{onClick:a,children:"Save"})]})]})})}function mue({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(Ja,{open:e,onOpenChange:t,children:h.jsxs(zo,{className:"sm:max-w-[425px]",children:[h.jsxs(Wo,{children:[h.jsx(Ho,{children:"Edit Exercise Name"}),h.jsx(cl,{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(Cs,{htmlFor:"name",children:"Exercise Name"}),h.jsx(Pr,{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(Be,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(Be,{onClick:a,children:"Save"})]})]})]})})}function bD(e,[t,r]){return Math.min(r,Math.max(t,e))}function vue(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 gue=[" ","Enter","ArrowUp","ArrowDown"],yue=[" ","Enter"],Jp="Select",[xb,wb,bue]=yy(Jp),[Ac,mIe]=yc(Jp,[bue,Jy]),Sb=Jy(),[xue,es]=Ac(Jp),[wue,Sue]=Ac(Jp),YU=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:o,value:a,defaultValue:s,onValueChange:l,dir:u,name:d,autoComplete:c,disabled:f,required:p,form:m}=e,v=Sb(t),[g,b]=w.useState(null),[y,x]=w.useState(null),[E,S]=w.useState(!1),P=cA(u),[C=!1,A]=Iu({prop:n,defaultProp:i,onChange:o}),[T,D]=Iu({prop:a,defaultProp:s,onChange:l}),N=w.useRef(null),_=g?m||!!g.closest("form"):!0,[F,k]=w.useState(new Set),B=Array.from(F).map(V=>V.props.value).join(";");return h.jsx(wV,{...v,children:h.jsxs(xue,{required:p,scope:t,trigger:g,onTriggerChange:b,valueNode:y,onValueNodeChange:x,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:wo(),value:T,onValueChange:D,open:C,onOpenChange:A,dir:P,triggerPointerDownPosRef:N,disabled:f,children:[h.jsx(xb.Provider,{scope:t,children:h.jsx(wue,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(V=>{k(z=>new Set(z).add(V))},[]),onNativeOptionRemove:w.useCallback(V=>{k(z=>{const I=new Set(z);return I.delete(V),I})},[]),children:r})}),_?h.jsxs(x5,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:c,value:T,onChange:V=>D(V.target.value),disabled:f,form:m,children:[T===void 0?h.jsx("option",{value:""}):null,Array.from(F)]},B):null]})})};YU.displayName=Jp;var XU="SelectTrigger",ZU=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,o=Sb(r),a=es(XU,r),s=a.disabled||n,l=lt(t,a.onTriggerChange),u=wb(r),d=w.useRef("touch"),[c,f,p]=w5(v=>{const g=u().filter(x=>!x.disabled),b=g.find(x=>x.value===a.value),y=S5(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(SV,{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":b5(a.value)?"":void 0,...i,ref:l,onClick:Ee(i.onClick,v=>{v.currentTarget.focus(),d.current!=="mouse"&&m(v)}),onPointerDown:Ee(i.onPointerDown,v=>{d.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:Ee(i.onKeyDown,v=>{const g=c.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(g&&v.key===" ")&&gue.includes(v.key)&&(m(),v.preventDefault())})})})});ZU.displayName=XU;var QU="SelectValue",JU=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:o,placeholder:a="",...s}=e,l=es(QU,r),{onValueNodeHasChildrenChange:u}=l,d=o!==void 0,c=lt(t,l.onValueNodeChange);return Tr(()=>{u(d)},[u,d]),h.jsx(Ke.span,{...s,ref:c,style:{pointerEvents:"none"},children:b5(l.value)?h.jsx(h.Fragment,{children:a}):o})});JU.displayName=QU;var Eue="SelectIcon",e5=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return h.jsx(Ke.span,{"aria-hidden":!0,...i,ref:t,children:n||"â–ŧ"})});e5.displayName=Eue;var Pue="SelectPortal",t5=e=>h.jsx(Np,{asChild:!0,...e});t5.displayName=Pue;var rl="SelectContent",r5=w.forwardRef((e,t)=>{const r=es(rl,e.__scopeSelect),[n,i]=w.useState();if(Tr(()=>{i(new DocumentFragment)},[]),!r.open){const o=n;return o?Xa.createPortal(h.jsx(n5,{scope:e.__scopeSelect,children:h.jsx(xb.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),o):null}return h.jsx(i5,{...e,ref:t})});r5.displayName=rl;var Jn=10,[n5,ts]=Ac(rl),Cue="SelectContentImpl",i5=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:c,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:g,...b}=e,y=es(rl,r),[x,E]=w.useState(null),[S,P]=w.useState(null),C=lt(t,Z=>E(Z)),[A,T]=w.useState(null),[D,N]=w.useState(null),_=wb(r),[F,k]=w.useState(!1),B=w.useRef(!1);w.useEffect(()=>{if(x)return wA(x)},[x]),dA();const V=w.useCallback(Z=>{const[ne,...K]=_().map(H=>H.ref.current),[J]=K.slice(-1),te=document.activeElement;for(const H of Z)if(H===te||(H==null||H.scrollIntoView({block:"nearest"}),H===ne&&S&&(S.scrollTop=0),H===J&&S&&(S.scrollTop=S.scrollHeight),H==null||H.focus(),document.activeElement!==te))return},[_,S]),z=w.useCallback(()=>V([A,x]),[V,A,x]);w.useEffect(()=>{F&&z()},[F,z]);const{onOpenChange:I,triggerPointerDownPosRef:$}=y;w.useEffect(()=>{if(x){let Z={x:0,y:0};const ne=J=>{var te,H;Z={x:Math.abs(Math.round(J.pageX)-(((te=$.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(J.pageY)-(((H=$.current)==null?void 0:H.y)??0))}},K=J=>{Z.x<=10&&Z.y<=10?J.preventDefault():x.contains(J.target)||I(!1),document.removeEventListener("pointermove",ne),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",K,{capture:!0})}}},[x,I,$]),w.useEffect(()=>{const Z=()=>I(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[I]);const[j,O]=w5(Z=>{const ne=_().filter(te=>!te.disabled),K=ne.find(te=>te.ref.current===document.activeElement),J=S5(ne,Z,K);J&&setTimeout(()=>J.ref.current.focus())}),U=w.useCallback((Z,ne,K)=>{const J=!B.current&&!K;(y.value!==void 0&&y.value===ne||J)&&(T(Z),J&&(B.current=!0))},[y.value]),Y=w.useCallback(()=>x==null?void 0:x.focus(),[x]),re=w.useCallback((Z,ne,K)=>{const J=!B.current&&!K;(y.value!==void 0&&y.value===ne||J)&&N(Z)},[y.value]),ce=n==="popper"?v1:o5,de=ce===v1?{side:s,sideOffset:l,align:u,alignOffset:d,arrowPadding:c,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:g}:{};return h.jsx(n5,{scope:r,content:x,viewport:S,onViewportChange:P,itemRefCallback:U,selectedItem:A,onItemLeave:Y,itemTextRefCallback:re,focusSelectedItem:z,selectedItemText:D,position:n,isPositioned:F,searchRef:j,children:h.jsx(rb,{as:No,allowPinchZoom:!0,children:h.jsx(Yy,{asChild:!0,trapped:y.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:Ee(i,Z=>{var ne;(ne=y.trigger)==null||ne.focus({preventScroll:!0}),Z.preventDefault()}),children:h.jsx(jp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:h.jsx(ce,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:Z=>Z.preventDefault(),...b,...de,onPlaced:()=>k(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ee(b.onKeyDown,Z=>{const ne=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!ne&&Z.key.length===1&&O(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let J=_().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const te=Z.target,H=J.indexOf(te);J=J.slice(H+1)}setTimeout(()=>V(J)),Z.preventDefault()}})})})})})})});i5.displayName=Cue;var Aue="SelectItemAlignedPosition",o5=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,o=es(rl,r),a=ts(rl,r),[s,l]=w.useState(null),[u,d]=w.useState(null),c=lt(t,C=>d(C)),f=wb(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 te=D.left-A.left,H=T.left-te,Ae=C.left-H,ue=C.width+Ae,$e=Math.max(ue,A.width),Ve=window.innerWidth-Jn,qe=bD(H,[Jn,Math.max(Jn,Ve-$e)]);s.style.minWidth=ue+"px",s.style.left=qe+"px"}else{const te=A.right-D.right,H=window.innerWidth-T.right-te,Ae=window.innerWidth-C.right-H,ue=C.width+Ae,$e=Math.max(ue,A.width),Ve=window.innerWidth-Jn,qe=bD(H,[Jn,Math.max(Jn,Ve-$e)]);s.style.minWidth=ue+"px",s.style.right=qe+"px"}const N=f(),_=window.innerHeight-Jn*2,F=v.scrollHeight,k=window.getComputedStyle(u),B=parseInt(k.borderTopWidth,10),V=parseInt(k.paddingTop,10),z=parseInt(k.borderBottomWidth,10),I=parseInt(k.paddingBottom,10),$=B+V+F+I+z,j=Math.min(g.offsetHeight*5,$),O=window.getComputedStyle(v),U=parseInt(O.paddingTop,10),Y=parseInt(O.paddingBottom,10),re=C.top+C.height/2-Jn,ce=_-re,de=g.offsetHeight/2,Z=g.offsetTop+de,ne=B+V+Z,K=$-ne;if(ne<=re){const te=N.length>0&&g===N[N.length-1].ref.current;s.style.bottom="0px";const H=u.clientHeight-v.offsetTop-v.offsetHeight,Ae=Math.max(ce,de+(te?Y:0)+H+z),ue=ne+Ae;s.style.height=ue+"px"}else{const te=N.length>0&&g===N[0].ref.current;s.style.top="0px";const Ae=Math.max(re,B+v.offsetTop+(te?U:0)+de)+K;s.style.height=Ae+"px",v.scrollTop=ne-re+v.offsetTop}s.style.margin=`${Jn}px 0`,s.style.minHeight=j+"px",s.style.maxHeight=_+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[f,o.trigger,o.valueNode,s,u,v,g,b,o.dir,n]);Tr(()=>x(),[x]);const[E,S]=w.useState();Tr(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const P=w.useCallback(C=>{C&&m.current===!0&&(x(),y==null||y(),m.current=!1)},[x,y]);return h.jsx(Oue,{scope:r,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:P,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:h.jsx(Ke.div,{...i,ref:c,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});o5.displayName=Aue;var Tue="SelectPopperPosition",v1=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Jn,...o}=e,a=Sb(r);return h.jsx(EV,{...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)"}})});v1.displayName=Tue;var[Oue,KA]=Ac(rl,{}),g1="SelectViewport",a5=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...i}=e,o=ts(g1,r),a=KA(g1,r),s=lt(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(xb.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:Ee(i.onScroll,u=>{const d=u.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&c){const p=Math.abs(l.current-d.scrollTop);if(p>0){const m=window.innerHeight-Jn*2,v=parseFloat(c.style.minHeight),g=parseFloat(c.style.height),b=Math.max(v,g);if(b0?E:0,c.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});a5.displayName=g1;var s5="SelectGroup",[_ue,jue]=Ac(s5),Nue=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=wo();return h.jsx(_ue,{scope:r,id:i,children:h.jsx(Ke.div,{role:"group","aria-labelledby":i,...n,ref:t})})});Nue.displayName=s5;var l5="SelectLabel",u5=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=jue(l5,r);return h.jsx(Ke.div,{id:i.id,...n,ref:t})});u5.displayName=l5;var Qv="SelectItem",[Due,c5]=Ac(Qv),d5=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:o,...a}=e,s=es(Qv,r),l=ts(Qv,r),u=s.value===n,[d,c]=w.useState(o??""),[f,p]=w.useState(!1),m=lt(t,y=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,y,n,i)}),v=wo(),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(Due,{scope:r,value:n,disabled:i,textId:v,isSelected:u,onItemTextChange:w.useCallback(y=>{c(x=>x||((y==null?void 0:y.textContent)??"").trim())},[]),children:h.jsx(xb.ItemSlot,{scope:r,value:n,disabled:i,textValue:d,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:Ee(a.onFocus,()=>p(!0)),onBlur:Ee(a.onBlur,()=>p(!1)),onClick:Ee(a.onClick,()=>{g.current!=="mouse"&&b()}),onPointerUp:Ee(a.onPointerUp,()=>{g.current==="mouse"&&b()}),onPointerDown:Ee(a.onPointerDown,y=>{g.current=y.pointerType}),onPointerMove:Ee(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:Ee(a.onPointerLeave,y=>{var x;y.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:Ee(a.onKeyDown,y=>{var E;((E=l.searchRef)==null?void 0:E.current)!==""&&y.key===" "||(yue.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});d5.displayName=Qv;var Ad="SelectItemText",f5=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...o}=e,a=es(Ad,r),s=ts(Ad,r),l=c5(Ad,r),u=Sue(Ad,r),[d,c]=w.useState(null),f=lt(t,b=>c(b),l.onItemTextChange,b=>{var y;return(y=s.itemTextRefCallback)==null?void 0:y.call(s,b,l.value,l.disabled)}),p=d==null?void 0:d.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 Tr(()=>(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?Xa.createPortal(o.children,a.valueNode):null]})});f5.displayName=Ad;var p5="SelectItemIndicator",h5=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c5(p5,r).isSelected?h.jsx(Ke.span,{"aria-hidden":!0,...n,ref:t}):null});h5.displayName=p5;var y1="SelectScrollUpButton",m5=w.forwardRef((e,t)=>{const r=ts(y1,e.__scopeSelect),n=KA(y1,e.__scopeSelect),[i,o]=w.useState(!1),a=lt(t,n.onScrollButtonChange);return Tr(()=>{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(g5,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop-l.offsetHeight)}}):null});m5.displayName=y1;var b1="SelectScrollDownButton",v5=w.forwardRef((e,t)=>{const r=ts(b1,e.__scopeSelect),n=KA(b1,e.__scopeSelect),[i,o]=w.useState(!1),a=lt(t,n.onScrollButtonChange);return Tr(()=>{if(r.viewport&&r.isPositioned){let s=function(){const u=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",s)}},[r.viewport,r.isPositioned]),i?h.jsx(g5,{...e,ref:a,onAutoScroll:()=>{const{viewport:s,selectedItem:l}=r;s&&l&&(s.scrollTop=s.scrollTop+l.offsetHeight)}}):null});v5.displayName=b1;var g5=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,o=ts("SelectScrollButton",r),a=w.useRef(null),s=wb(r),l=w.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),Tr(()=>{var d;const u=s().find(c=>c.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[s]),h.jsx(Ke.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ee(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(n,50))}),onPointerMove:Ee(i.onPointerMove,()=>{var u;(u=o.onItemLeave)==null||u.call(o),a.current===null&&(a.current=window.setInterval(n,50))}),onPointerLeave:Ee(i.onPointerLeave,()=>{l()})})}),kue="SelectSeparator",y5=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return h.jsx(Ke.div,{"aria-hidden":!0,...n,ref:t})});y5.displayName=kue;var x1="SelectArrow",Mue=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Sb(r),o=es(x1,r),a=ts(x1,r);return o.open&&a.position==="popper"?h.jsx(PV,{...i,...n,ref:t}):null});Mue.displayName=x1;function b5(e){return e===""||e===void 0}var x5=w.forwardRef((e,t)=>{const{value:r,...n}=e,i=w.useRef(null),o=lt(t,i),a=vue(r);return w.useEffect(()=>{const s=i.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==r&&d){const c=new Event("change",{bubbles:!0});d.call(s,r),s.dispatchEvent(c)}},[a,r]),h.jsx(by,{asChild:!0,children:h.jsx("select",{...n,ref:o,defaultValue:r})})});x5.displayName="BubbleSelect";function w5(e){const t=Ar(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 S5(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=Iue(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 Iue(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Rue=YU,E5=ZU,$ue=JU,Lue=e5,Fue=t5,P5=r5,Bue=a5,C5=u5,A5=d5,Vue=f5,Uue=h5,T5=m5,O5=v5,_5=y5;const zue=Rue,Wue=$ue,j5=w.forwardRef(({className:e,children:t,...r},n)=>h.jsxs(E5,{ref:n,className:ke("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(Lue,{asChild:!0,children:h.jsx(Ey,{className:"h-4 w-4 opacity-50"})})]}));j5.displayName=E5.displayName;const N5=w.forwardRef(({className:e,...t},r)=>h.jsx(T5,{ref:r,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(vq,{className:"h-4 w-4"})}));N5.displayName=T5.displayName;const D5=w.forwardRef(({className:e,...t},r)=>h.jsx(O5,{ref:r,className:ke("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(Ey,{className:"h-4 w-4"})}));D5.displayName=O5.displayName;const k5=w.forwardRef(({className:e,children:t,position:r="popper",...n},i)=>h.jsx(Fue,{children:h.jsxs(P5,{ref:i,className:ke("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(N5,{}),h.jsx(Bue,{className:ke("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),h.jsx(D5,{})]})}));k5.displayName=P5.displayName;const Hue=w.forwardRef(({className:e,...t},r)=>h.jsx(C5,{ref:r,className:ke("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Hue.displayName=C5.displayName;const M5=w.forwardRef(({className:e,children:t,...r},n)=>h.jsxs(A5,{ref:n,className:ke("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(Uue,{children:h.jsx(xi,{className:"h-4 w-4"})})}),h.jsx(Vue,{children:t})]}));M5.displayName=A5.displayName;const Gue=w.forwardRef(({className:e,...t},r)=>h.jsx(_5,{ref:r,className:ke("-mx-1 my-1 h-px bg-muted",e),...t}));Gue.displayName=_5.displayName;function Kue({open:e,onOpenChange:t,currentMetrics:r,routines:n,currentRoutineId:i,onSave:o,onDelete:a}){const[s,l]=w.useState(r.weight.toString()),[u,d]=w.useState(r.reps.toString()),[c,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(c);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(Ja,{open:e,onOpenChange:t,children:h.jsxs(zo,{className:"sm:max-w-[425px]",children:[h.jsxs(Wo,{children:[h.jsx(Ho,{children:"Edit Exercise Metrics"}),h.jsx(cl,{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(Cs,{htmlFor:"routine",children:"Routine"}),h.jsxs(zue,{value:p,onValueChange:m,children:[h.jsx(j5,{id:"routine",children:h.jsx(Wue,{placeholder:"Select routine"})}),h.jsx(k5,{children:n.map(g=>h.jsx(M5,{value:g.id.toString(),children:g.name},g.id))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Cs,{htmlFor:"weight",children:"Weight (kg)"}),h.jsx(Pr,{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(Cs,{htmlFor:"reps",children:"Reps"}),h.jsx(Pr,{id:"reps",type:"number",value:u,onChange:g=>d(g.target.value),placeholder:"Enter reps"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(Cs,{htmlFor:"sets",children:"Sets"}),h.jsx(Pr,{id:"sets",type:"number",value:c,onChange:g=>f(g.target.value),placeholder:"Enter sets"})]}),h.jsxs("div",{className:"flex justify-between items-center",children:[a&&h.jsx(Be,{variant:"ghost",onClick:()=>{a(),t(!1)},className:"text-red-600 hover:text-red-700 hover:bg-red-50",children:h.jsx(gf,{className:"h-4 w-4"})}),h.jsxs("div",{className:`flex space-x-2 ${a?"":"ml-auto"}`,children:[h.jsx(Be,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(Be,{onClick:v,children:"Save"})]})]})]})]})})}async function R0(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 que(){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 Eb(){const e=Tp(),{data:t,error:r,isLoading:n}=Q2({queryKey:["user"],queryFn:que,staleTime:1/0,retry:!1}),i=tu({mutationFn:s=>R0("/api/login","POST",s),onSuccess:()=>{e.invalidateQueries({queryKey:["user"]})}}),o=tu({mutationFn:()=>R0("/api/logout","POST"),onSuccess:()=>{e.invalidateQueries({queryKey:["user"]}),window.location.href="/"}}),a=tu({mutationFn:s=>R0("/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 I5=w.forwardRef((e,t)=>{const{textSize:r}=o8(),[n,i]=w.useState(0),[o,a]=w.useState(!1),[s,l]=w.useState(!1),[u,d]=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=()=>{d(Date.now()-n),a(!0),l(!0)},m=()=>{i(0),a(!1),d(null),l(!1)},v=()=>{i(0),d(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),E=y%60;return`${x.toString().padStart(2,"0")}:${E.toString().padStart(2,"0")}`};return h.jsx(eV,{children:s&&h.jsx(Av.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)})})})})})});I5.displayName="TimerDialog";function Yue({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(k_,{className:"h-4 w-4 text-orange-500"})},{text:"Add 2-3 more reps to challenge yourself",icon:h.jsx(iu,{className:"h-4 w-4 text-blue-500"})},{text:"Throw in an extra set for volume",icon:h.jsx(uv,{className:"h-4 w-4 text-purple-500"})},{text:"Try a slower, more controlled tempo",icon:h.jsx(lv,{className:"h-4 w-4 text-indigo-500"})},{text:"Reduce rest time between sets",icon:h.jsx(qL,{className:"h-4 w-4 text-red-500"})}],footer:"Progress is progress, no matter how small!",icon:h.jsx(QP,{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(D_,{className:"h-4 w-4 text-red-500"})},{text:"Focus on 2-3 fewer reps with perfect form",icon:h.jsx(uv,{className:"h-4 w-4 text-green-500"})},{text:"Take an extra day to recover fully",icon:h.jsx(lv,{className:"h-4 w-4 text-blue-500"})},{text:"Try lighter warm-up sets first",icon:h.jsx(k_,{className:"h-4 w-4 text-yellow-500"})},{text:"Check your sleep and nutrition",icon:h.jsx(xi,{className:"h-4 w-4 text-purple-500"})}],footer:"Remember: Form > Weight. You've got this!",icon:h.jsx(D_,{className:"h-10 w-10 text-red-500"})}};return h.jsx(Ja,{open:e,onOpenChange:t,children:h.jsxs(zo,{className:"max-w-md",children:[h.jsxs(Wo,{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(Ho,{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(Be,{variant:"outline",onClick:()=>t(!1),children:"Got it"}),h.jsx(Be,{onClick:()=>{n==null||n(),t(!1)},children:"Edit Exercise"})]})]})})}var Xue=Array.isArray,Jr=Xue,Zue=typeof mh=="object"&&mh&&mh.Object===Object&&mh,R5=Zue,Que=R5,Jue=typeof self=="object"&&self&&self.Object===Object&&self,ece=Que||Jue||Function("return this")(),Ji=ece,tce=Ji,rce=tce.Symbol,eh=rce,xD=eh,$5=Object.prototype,nce=$5.hasOwnProperty,ice=$5.toString,id=xD?xD.toStringTag:void 0;function oce(e){var t=nce.call(e,id),r=e[id];try{e[id]=void 0;var n=!0}catch{}var i=ice.call(e);return n&&(t?e[id]=r:delete e[id]),i}var ace=oce,sce=Object.prototype,lce=sce.toString;function uce(e){return lce.call(e)}var cce=uce,wD=eh,dce=ace,fce=cce,pce="[object Null]",hce="[object Undefined]",SD=wD?wD.toStringTag:void 0;function mce(e){return e==null?e===void 0?hce:pce:SD&&SD in Object(e)?dce(e):fce(e)}var Ko=mce;function vce(e){return e!=null&&typeof e=="object"}var qo=vce,gce=Ko,yce=qo,bce="[object Symbol]";function xce(e){return typeof e=="symbol"||yce(e)&&gce(e)==bce}var Tc=xce,wce=Jr,Sce=Tc,Ece=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pce=/^\w*$/;function Cce(e,t){if(wce(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||Sce(e)?!0:Pce.test(e)||!Ece.test(e)||t!=null&&e in Object(t)}var qA=Cce;function Ace(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var rs=Ace;const Oc=ut(rs);var Tce=Ko,Oce=rs,_ce="[object AsyncFunction]",jce="[object Function]",Nce="[object GeneratorFunction]",Dce="[object Proxy]";function kce(e){if(!Oce(e))return!1;var t=Tce(e);return t==jce||t==Nce||t==_ce||t==Dce}var YA=kce;const tt=ut(YA);var Mce=Ji,Ice=Mce["__core-js_shared__"],Rce=Ice,$0=Rce,ED=function(){var e=/[^.]+$/.exec($0&&$0.keys&&$0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function $ce(e){return!!ED&&ED in e}var Lce=$ce,Fce=Function.prototype,Bce=Fce.toString;function Vce(e){if(e!=null){try{return Bce.call(e)}catch{}try{return e+""}catch{}}return""}var L5=Vce,Uce=YA,zce=Lce,Wce=rs,Hce=L5,Gce=/[\\^$.*+?()[\]{}|]/g,Kce=/^\[object .+?Constructor\]$/,qce=Function.prototype,Yce=Object.prototype,Xce=qce.toString,Zce=Yce.hasOwnProperty,Qce=RegExp("^"+Xce.call(Zce).replace(Gce,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Jce(e){if(!Wce(e)||zce(e))return!1;var t=Uce(e)?Qce:Kce;return t.test(Hce(e))}var ede=Jce;function tde(e,t){return e==null?void 0:e[t]}var rde=tde,nde=ede,ide=rde;function ode(e,t){var r=ide(e,t);return nde(r)?r:void 0}var dl=ode,ade=dl,sde=ade(Object,"create"),Pb=sde,PD=Pb;function lde(){this.__data__=PD?PD(null):{},this.size=0}var ude=lde;function cde(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var dde=cde,fde=Pb,pde="__lodash_hash_undefined__",hde=Object.prototype,mde=hde.hasOwnProperty;function vde(e){var t=this.__data__;if(fde){var r=t[e];return r===pde?void 0:r}return mde.call(t,e)?t[e]:void 0}var gde=vde,yde=Pb,bde=Object.prototype,xde=bde.hasOwnProperty;function wde(e){var t=this.__data__;return yde?t[e]!==void 0:xde.call(t,e)}var Sde=wde,Ede=Pb,Pde="__lodash_hash_undefined__";function Cde(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ede&&t===void 0?Pde:t,this}var Ade=Cde,Tde=ude,Ode=dde,_de=gde,jde=Sde,Nde=Ade;function _c(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t-1}var qde=Kde,Yde=Cb;function Xde(e,t){var r=this.__data__,n=Yde(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var Zde=Xde,Qde=Mde,Jde=Ude,efe=Hde,tfe=qde,rfe=Zde;function jc(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},As=function(t){return th(t)&&t.indexOf("%")===t.length-1},be=function(t){return Ppe(t)&&!rh(t)},Qt=function(t){return be(t)||th(t)},Ope=0,nh=function(t){var r=++Ope;return"".concat(t||"").concat(r)},nl=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)&&!th(t))return n;var o;if(As(t)){var a=t.indexOf("%");o=r*parseFloat(t.slice(0,a))/100}else o=+t;return rh(o)&&(o=n),i&&o>r&&(o=r),o},Tl=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 Ipe(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 S1(e){"@babel/helpers - typeof";return S1=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},S1(e)}var ND={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},Eo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},DD=null,F0=null,oT=function e(t){if(t===DD&&Array.isArray(F0))return F0;var r=[];return w.Children.forEach(t,function(n){Je(n)||(bpe.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),F0=r,DD=t,r};function Un(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Eo(i)}):n=[Eo(t)],oT(e).forEach(function(i){var o=Vn(i,"type.displayName")||Vn(i,"type.name");n.indexOf(o)!==-1&&r.push(i)}),r}function on(e,t){var r=Un(e,t);return r&&r[0]}var kD=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)},Rpe=["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"],$pe=function(t){return t&&t.type&&th(t.type)&&Rpe.indexOf(t.type)>=0},Lpe=function(t){return t&&S1(t)==="object"&&"clipDot"in t},Fpe=function(t,r,n,i){var o,a=(o=L0==null?void 0:L0[i])!==null&&o!==void 0?o:[];return!tt(t)&&(i&&a.includes(r)||Npe.includes(r))||n&&iT.includes(r)},rt=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(w.isValidElement(t)&&(i=t.props),!Oc(i))return null;var o={};return Object.keys(i).forEach(function(a){var s;Fpe((s=i)===null||s===void 0?void 0:s[a],a,r,n)&&(o[a]=i[a])}),o},E1=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 MD(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 Wpe(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){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,Upe),d=i||{width:r,height:n,x:0,y:0},c=at("recharts-surface",o);return M.createElement("svg",P1({},rt(u,!0,"svg"),{className:c,width:r,height:n,style:a,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),M.createElement("title",null,s),M.createElement("desc",null,l),t)}var Hpe=["children","className"];function A1(){return A1=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 Kpe(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 Ut=M.forwardRef(function(e,t){var r=e.children,n=e.className,i=Gpe(e,Hpe),o=at("recharts-layer",n);return M.createElement("g",A1({className:o},rt(i,!0),{ref:t}),r)}),Vs=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:Xpe(e,t,r)}var Qpe=Zpe,Jpe="\\ud800-\\udfff",ehe="\\u0300-\\u036f",the="\\ufe20-\\ufe2f",rhe="\\u20d0-\\u20ff",nhe=ehe+the+rhe,ihe="\\ufe0e\\ufe0f",ohe="\\u200d",ahe=RegExp("["+ohe+Jpe+nhe+ihe+"]");function she(e){return ahe.test(e)}var q5=she;function lhe(e){return e.split("")}var uhe=lhe,Y5="\\ud800-\\udfff",che="\\u0300-\\u036f",dhe="\\ufe20-\\ufe2f",fhe="\\u20d0-\\u20ff",phe=che+dhe+fhe,hhe="\\ufe0e\\ufe0f",mhe="["+Y5+"]",T1="["+phe+"]",O1="\\ud83c[\\udffb-\\udfff]",vhe="(?:"+T1+"|"+O1+")",X5="[^"+Y5+"]",Z5="(?:\\ud83c[\\udde6-\\uddff]){2}",Q5="[\\ud800-\\udbff][\\udc00-\\udfff]",ghe="\\u200d",J5=vhe+"?",ez="["+hhe+"]?",yhe="(?:"+ghe+"(?:"+[X5,Z5,Q5].join("|")+")"+ez+J5+")*",bhe=ez+J5+yhe,xhe="(?:"+[X5+T1+"?",T1,Z5,Q5,mhe].join("|")+")",whe=RegExp(O1+"(?="+O1+")|"+xhe+bhe,"g");function She(e){return e.match(whe)||[]}var Ehe=She,Phe=uhe,Che=q5,Ahe=Ehe;function The(e){return Che(e)?Ahe(e):Phe(e)}var Ohe=The,_he=Qpe,jhe=q5,Nhe=Ohe,Dhe=U5;function khe(e){return function(t){t=Dhe(t);var r=jhe(t)?Nhe(t):void 0,n=r?r[0]:t.charAt(0),i=r?_he(r,1).join(""):t.slice(1);return n[e]()+i}}var Mhe=khe,Ihe=Mhe,Rhe=Ihe("toUpperCase"),$he=Rhe;const Fb=ut($he);function yt(e){return function(){return e}}const tz=Math.cos,rg=Math.sin,Ai=Math.sqrt,ng=Math.PI,Bb=2*ng,_1=Math.PI,j1=2*_1,ms=1e-6,Lhe=j1-ms;function rz(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return rz;const r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;ims)if(!(Math.abs(c*l-u*d)>ms)||!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((_1-Math.acos((v+f-g)/(2*b*y)))/2),E=x/y,S=x/b;Math.abs(E-1)>ms&&this._append`L${t+E*d},${r+E*c}`,this._append`A${o},${o},0,0,${+(c*p>d*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,d=r+l,c=1^a,f=a?i-o:o-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>ms||Math.abs(this._y1-d)>ms)&&this._append`L${u},${d}`,n&&(f<0&&(f=f%j1+j1),f>Lhe?this._append`A${n},${n},0,1,${c},${t-s},${r-l}A${n},${n},0,1,${c},${this._x1=u},${this._y1=d}`:f>ms&&this._append`A${n},${n},0,${+(f>=_1)},${c},${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 aT(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 Bhe(t)}function sT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nz(e){this._context=e}nz.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 Vb(e){return new nz(e)}function iz(e){return e[0]}function oz(e){return e[1]}function az(e,t){var r=yt(!0),n=null,i=Vb,o=null,a=aT(s);e=typeof e=="function"?e:e===void 0?iz:yt(e),t=typeof t=="function"?t:t===void 0?oz:yt(t);function s(l){var u,d=(l=sT(l)).length,c,f=!1,p;for(n==null&&(o=i(p=a())),u=0;u<=d;++u)!(u=p;--m)s.point(x[m],E[m]);s.lineEnd(),s.areaEnd()}b&&(x[f]=+e(g,f,c),E[f]=+t(g,f,c),s.point(n?+n(g,f,c):x[f],r?+r(g,f,c):E[f]))}if(y)return s=null,y+""||null}function d(){return az().defined(i).curve(a).context(o)}return u.x=function(c){return arguments.length?(e=typeof c=="function"?c:yt(+c),n=null,u):e},u.x0=function(c){return arguments.length?(e=typeof c=="function"?c:yt(+c),u):e},u.x1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:yt(+c),u):n},u.y=function(c){return arguments.length?(t=typeof c=="function"?c:yt(+c),r=null,u):t},u.y0=function(c){return arguments.length?(t=typeof c=="function"?c:yt(+c),u):t},u.y1=function(c){return arguments.length?(r=c==null?null:typeof c=="function"?c:yt(+c),u):r},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(r)},u.lineX1=function(){return d().x(n).y(t)},u.defined=function(c){return arguments.length?(i=typeof c=="function"?c:yt(!!c),u):i},u.curve=function(c){return arguments.length?(a=c,o!=null&&(s=a(o)),u):a},u.context=function(c){return arguments.length?(c==null?o=s=null:s=a(o=c),u):o},u}class sz{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 Vhe(e){return new sz(e,!0)}function Uhe(e){return new sz(e,!1)}const lT={draw(e,t){const r=Ai(t/ng);e.moveTo(r,0),e.arc(0,0,r,0,Bb)}},zhe={draw(e,t){const r=Ai(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()}},lz=Ai(1/3),Whe=lz*2,Hhe={draw(e,t){const r=Ai(t/Whe),n=r*lz;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Ghe={draw(e,t){const r=Ai(t),n=-r/2;e.rect(n,n,r,r)}},Khe=.8908130915292852,uz=rg(ng/10)/rg(7*ng/10),qhe=rg(Bb/10)*uz,Yhe=-tz(Bb/10)*uz,Xhe={draw(e,t){const r=Ai(t*Khe),n=qhe*r,i=Yhe*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){const a=Bb*o/5,s=tz(a),l=rg(a);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},B0=Ai(3),Zhe={draw(e,t){const r=-Ai(t/(B0*3));e.moveTo(0,r*2),e.lineTo(-B0*r,-r),e.lineTo(B0*r,-r),e.closePath()}},En=-.5,Pn=Ai(3)/2,N1=1/Ai(12),Qhe=(N1/2+1)*3,Jhe={draw(e,t){const r=Ai(t/Qhe),n=r/2,i=r*N1,o=n,a=r*N1+r,s=-o,l=a;e.moveTo(n,i),e.lineTo(o,a),e.lineTo(s,l),e.lineTo(En*n-Pn*i,Pn*n+En*i),e.lineTo(En*o-Pn*a,Pn*o+En*a),e.lineTo(En*s-Pn*l,Pn*s+En*l),e.lineTo(En*n+Pn*i,En*i-Pn*n),e.lineTo(En*o+Pn*a,En*a-Pn*o),e.lineTo(En*s+Pn*l,En*l-Pn*s),e.closePath()}};function eme(e,t){let r=null,n=aT(i);e=typeof e=="function"?e:yt(e||lT),t=typeof t=="function"?t:yt(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:yt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:yt(+o),i):t},i.context=function(o){return arguments.length?(r=o??null,i):r},i}function ig(){}function og(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 cz(e){this._context=e}cz.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:og(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:og(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function tme(e){return new cz(e)}function dz(e){this._context=e}dz.prototype={areaStart:ig,areaEnd:ig,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:og(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rme(e){return new dz(e)}function fz(e){this._context=e}fz.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:og(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nme(e){return new fz(e)}function pz(e){this._context=e}pz.prototype={areaStart:ig,areaEnd:ig,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 ime(e){return new pz(e)}function RD(e){return e<0?-1:1}function $D(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(RD(o)+RD(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function LD(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function V0(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 ag(e){this._context=e}ag.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:V0(this,this._t0,LD(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,V0(this,LD(this,r=$D(this,e,t)),r);break;default:V0(this,this._t0,r=$D(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function hz(e){this._context=new mz(e)}(hz.prototype=Object.create(ag.prototype)).point=function(e,t){ag.prototype.point.call(this,t,e)};function mz(e){this._context=e}mz.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 ome(e){return new ag(e)}function ame(e){return new hz(e)}function vz(e){this._context=e}vz.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=FD(e),i=FD(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 lme(e){return new Ub(e,.5)}function ume(e){return new Ub(e,0)}function cme(e){return new Ub(e,1)}function Gu(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 dme(e,t){return e[t]}function fme(e){const t=[];return t.key=e,t}function pme(){var e=yt([]),t=D1,r=Gu,n=dme;function i(o){var a=Array.from(e.apply(this,arguments),fme),s,l=a.length,u=-1,d;for(const c 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 Sme(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 gz={symbolCircle:lT,symbolCross:zhe,symbolDiamond:Hhe,symbolSquare:Ghe,symbolStar:Xhe,symbolTriangle:Zhe,symbolWye:Jhe},Eme=Math.PI/180,Pme=function(t){var r="symbol".concat(Fb(t));return gz[r]||lT},Cme=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*Eme;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}},Ame=function(t,r){gz["symbol".concat(Fb(t))]=r},uT=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=wme(t,gme),u=VD(VD({},l),{},{type:n,size:o,sizeType:s}),d=function(){var g=Pme(n),b=eme().type(g).size(Cme(o,s,n));return b()},c=u.className,f=u.cx,p=u.cy,m=rt(u,!0);return f===+f&&p===+p&&o===+o?M.createElement("path",k1({},m,{className:at("recharts-symbols",c),transform:"translate(".concat(f,", ").concat(p,")"),d:d()})):null};uT.registerSymbol=Ame;function Ku(e){"@babel/helpers - typeof";return Ku=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},Ku(e)}function M1(){return M1=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var y=p.inactive?u:p.color;return M.createElement("li",M1({className:g,style:c,key:"legend-item-".concat(m)},tg(n.props,p,m)),M.createElement(C1,{width:a,height:a,viewBox:d,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);$f(cT,"displayName","Legend");$f(cT,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Rme=Ab;function $me(){this.__data__=new Rme,this.size=0}var Lme=$me;function Fme(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Bme=Fme;function Vme(e){return this.__data__.get(e)}var Ume=Vme;function zme(e){return this.__data__.has(e)}var Wme=zme,Hme=Ab,Gme=ZA,Kme=QA,qme=200;function Yme(e,t){var r=this.__data__;if(r instanceof Hme){var n=r.__data__;if(!Gme||n.lengths))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var c=-1,f=!0,p=r&gve?new pve:void 0;for(o.set(e,t),o.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=wge}var hT=Sge,Ege=Ko,Pge=hT,Cge=qo,Age="[object Arguments]",Tge="[object Array]",Oge="[object Boolean]",_ge="[object Date]",jge="[object Error]",Nge="[object Function]",Dge="[object Map]",kge="[object Number]",Mge="[object Object]",Ige="[object RegExp]",Rge="[object Set]",$ge="[object String]",Lge="[object WeakMap]",Fge="[object ArrayBuffer]",Bge="[object DataView]",Vge="[object Float32Array]",Uge="[object Float64Array]",zge="[object Int8Array]",Wge="[object Int16Array]",Hge="[object Int32Array]",Gge="[object Uint8Array]",Kge="[object Uint8ClampedArray]",qge="[object Uint16Array]",Yge="[object Uint32Array]",Et={};Et[Vge]=Et[Uge]=Et[zge]=Et[Wge]=Et[Hge]=Et[Gge]=Et[Kge]=Et[qge]=Et[Yge]=!0;Et[Age]=Et[Tge]=Et[Fge]=Et[Oge]=Et[Bge]=Et[_ge]=Et[jge]=Et[Nge]=Et[Dge]=Et[kge]=Et[Mge]=Et[Ige]=Et[Rge]=Et[$ge]=Et[Lge]=!1;function Xge(e){return Cge(e)&&Pge(e.length)&&!!Et[Ege(e)]}var Zge=Xge;function Qge(e){return function(t){return e(t)}}var Oz=Qge,cg={exports:{}};cg.exports;(function(e,t){var r=R5,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})(cg,cg.exports);var Jge=cg.exports,eye=Zge,tye=Oz,qD=Jge,YD=qD&&qD.isTypedArray,rye=YD?tye(YD):eye,_z=rye,nye=age,iye=fT,oye=Jr,aye=Tz,sye=pT,lye=_z,uye=Object.prototype,cye=uye.hasOwnProperty;function dye(e,t){var r=oye(e),n=!r&&iye(e),i=!r&&!n&&aye(e),o=!r&&!n&&!i&&lye(e),a=r||n||i||o,s=a?nye(e.length,String):[],l=s.length;for(var u in e)(t||cye.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||sye(u,l)))&&s.push(u);return s}var fye=dye,pye=Object.prototype;function hye(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||pye;return e===r}var mye=hye;function vye(e,t){return function(r){return e(t(r))}}var jz=vye,gye=jz,yye=gye(Object.keys,Object),bye=yye,xye=mye,wye=bye,Sye=Object.prototype,Eye=Sye.hasOwnProperty;function Pye(e){if(!xye(e))return wye(e);var t=[];for(var r in Object(e))Eye.call(e,r)&&r!="constructor"&&t.push(r);return t}var Cye=Pye,Aye=YA,Tye=hT;function Oye(e){return e!=null&&Tye(e.length)&&!Aye(e)}var zb=Oye,_ye=fye,jye=Cye,Nye=zb;function Dye(e){return Nye(e)?_ye(e):jye(e)}var mT=Dye,kye=qve,Mye=ige,Iye=mT;function Rye(e){return kye(e,Iye,Mye)}var $ye=Rye,XD=$ye,Lye=1,Fye=Object.prototype,Bye=Fye.hasOwnProperty;function Vye(e,t,r,n,i,o){var a=r&Lye,s=XD(e),l=s.length,u=XD(t),d=u.length;if(l!=d&&!a)return!1;for(var c=l;c--;){var f=s[c];if(!(a?f in t:Bye.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;++c-1}var Bxe=Fxe;function Vxe(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=r0e){var u=t?null:e0e(e);if(u)return t0e(u);a=!1,i=Jxe,l=new Xxe}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function y0e(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 b0e(e){return e.value}function x0e(e,t){if(M.isValidElement(e))return M.cloneElement(e,t);if(typeof e=="function")return M.createElement(e,t);t.ref;var r=g0e(t,u0e);return M.createElement(cT,r)}var fk=1,du=function(e){function t(){var r;c0e(this,t);for(var n=arguments.length,i=new Array(n),o=0;ofk||Math.abs(i.height-this.lastBoundingBox.height)>fk)&&(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?io({},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,d=i.chartHeight,c,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();c={left:((u||0)-p.width)/2}}else c=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:((d||0)-m.height)/2}}else f=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return io(io({},c),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,d=i.payload,c=io(io({position:"absolute",width:a||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return M.createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(p){n.wrapperNode=p}},x0e(o,io(io({},this.props),{},{payload:Rz(d,u,b0e)})))}}],[{key:"getWithHeight",value:function(n,i){var o=io(io({},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);Wb(du,"displayName","Legend");Wb(du,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var pk=eh,w0e=fT,S0e=Jr,hk=pk?pk.isConcatSpreadable:void 0;function E0e(e){return S0e(e)||w0e(e)||!!(hk&&e&&e[hk])}var P0e=E0e,C0e=Cz,A0e=P0e;function Fz(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=A0e),i||(i=[]);++o0&&r(s)?t>1?Fz(s,t-1,r,n,i):C0e(i,s):n||(i[i.length]=s)}return i}var Bz=Fz;function T0e(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 O0e=T0e,_0e=O0e,j0e=_0e(),N0e=j0e,D0e=N0e,k0e=mT;function M0e(e,t){return e&&D0e(e,t,k0e)}var Vz=M0e,I0e=zb;function R0e(e,t){return function(r,n){if(r==null)return r;if(!I0e(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 X0e=Y0e,H0=eT,Z0e=tT,Q0e=Ic,J0e=Uz,ewe=H0e,twe=Oz,rwe=X0e,nwe=Mc,iwe=Jr;function owe(e,t,r){t.length?t=H0(t,function(o){return iwe(o)?function(a){return Z0e(a,o.length===1?o[0]:o)}:o}):t=[nwe];var n=-1;t=H0(t,twe(Q0e));var i=J0e(e,function(o,a,s){var l=H0(t,function(u){return u(o)});return{criteria:l,index:++n,value:o}});return ewe(i,function(o,a){return rwe(o,a,r)})}var awe=owe;function swe(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 lwe=swe,uwe=lwe,vk=Math.max;function cwe(e,t,r){return t=vk(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=vk(n.length-t,0),a=Array(o);++i0){if(++t>=xwe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Pwe=Ewe,Cwe=bwe,Awe=Pwe,Twe=Awe(Cwe),Owe=Twe,_we=Mc,jwe=dwe,Nwe=Owe;function Dwe(e,t){return Nwe(jwe(e,t,_we),e+"")}var kwe=Dwe,Mwe=XA,Iwe=zb,Rwe=pT,$we=rs;function Lwe(e,t,r){if(!$we(r))return!1;var n=typeof t;return(n=="number"?Iwe(r)&&Rwe(t,r.length):n=="string"&&t in r)?Mwe(r[t],e):!1}var Hb=Lwe,Fwe=Bz,Bwe=awe,Vwe=kwe,yk=Hb,Uwe=Vwe(function(e,t){if(e==null)return[];var r=t.length;return r>1&&yk(e,t[0],t[1])?t=[]:r>2&&yk(t[0],t[1],t[2])&&(t=[t[0]]),Bwe(e,Fwe(t,1),[])}),zwe=Uwe;const yT=ut(zwe);function Lf(e){"@babel/helpers - typeof";return Lf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lf(e)}function U1(){return U1=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(od,"-left"),be(r)&&t&&be(t.x)&&r=t.y),"".concat(od,"-top"),be(n)&&t&&be(t.y)&&nv?Math.max(d,l[n]):Math.max(c,l[n])}function iSe(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 oSe(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,d,c;return a.height>0&&a.width>0&&r?(d=wk({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:o,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),c=wk({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:o,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),u=iSe({translateX:d,translateY:c,useTranslate3d:s})):u=rSe,{cssProperties:u,cssClasses:nSe({translateX:d,translateY:c,coordinate:r})}}function Yu(e){"@babel/helpers - typeof";return Yu=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},Yu(e)}function Sk(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 Ek(e){for(var t=1;tPk||Math.abs(n.height-this.state.lastBoundingBox.height)>Pk)&&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,d=i.coordinate,c=i.hasPayload,f=i.isAnimationActive,p=i.offset,m=i.position,v=i.reverseDirection,g=i.useTranslate3d,b=i.viewBox,y=i.wrapperStyle,x=oSe({allowEscapeViewBox:a,coordinate:d,offsetTopLeft:p,position:m,reverseDirection:v,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:b}),E=x.cssClasses,S=x.cssProperties,P=Ek(Ek({transition:f&&o?"transform ".concat(s,"ms ").concat(l):void 0},S),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&c?"visible":"hidden",position:"absolute",top:0,left:0},y);return M.createElement("div",{tabIndex:-1,className:E,style:P,ref:function(A){n.wrapperNode=A}},u)}}])}(w.PureComponent),mSe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Po={isSsr:mSe(),get:function(t){return Po[t]},set:function(t,r){if(typeof t=="string")Po[t]=r;else{var n=Object.keys(t);n&&n.length&&n.forEach(function(i){Po[i]=t[i]})}}};function Xu(e){"@babel/helpers - typeof";return Xu=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},Xu(e)}function Ck(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 Ak(e){for(var t=1;t0;return M.createElement(hSe,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:f,active:o,coordinate:d,hasPayload:P,offset:p,position:g,reverseDirection:b,useTranslate3d:y,viewBox:x,wrapperStyle:E},CSe(u,Ak(Ak({},this.props),{},{payload:S})))}}])}(w.PureComponent);bT(ji,"displayName","Tooltip");bT(ji,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Po.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 ASe=Ji,TSe=function(){return ASe.Date.now()},OSe=TSe,_Se=/\s/;function jSe(e){for(var t=e.length;t--&&_Se.test(e.charAt(t)););return t}var NSe=jSe,DSe=NSe,kSe=/^\s+/;function MSe(e){return e&&e.slice(0,DSe(e)+1).replace(kSe,"")}var ISe=MSe,RSe=ISe,Tk=rs,$Se=Tc,Ok=NaN,LSe=/^[-+]0x[0-9a-f]+$/i,FSe=/^0b[01]+$/i,BSe=/^0o[0-7]+$/i,VSe=parseInt;function USe(e){if(typeof e=="number")return e;if($Se(e))return Ok;if(Tk(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Tk(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=RSe(e);var r=FSe.test(e);return r||BSe.test(e)?VSe(e.slice(2),r?2:8):LSe.test(e)?Ok:+e}var qz=USe,zSe=rs,K0=OSe,_k=qz,WSe="Expected a function",HSe=Math.max,GSe=Math.min;function KSe(e,t,r){var n,i,o,a,s,l,u=0,d=!1,c=!1,f=!0;if(typeof e!="function")throw new TypeError(WSe);t=_k(t)||0,zSe(r)&&(d=!!r.leading,c="maxWait"in r,o=c?HSe(_k(r.maxWait)||0,t):o,f="trailing"in r?!!r.trailing:f);function p(P){var C=n,A=i;return n=i=void 0,u=P,a=e.apply(A,C),a}function m(P){return u=P,s=setTimeout(b,t),d?p(P):a}function v(P){var C=P-l,A=P-u,T=t-C;return c?GSe(T,o-A):T}function g(P){var C=P-l,A=P-u;return l===void 0||C>=t||C<0||c&&A>=o}function b(){var P=K0();if(g(P))return y(P);s=setTimeout(b,v(P))}function y(P){return s=void 0,f&&n?p(P):(n=i=void 0,a)}function x(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function E(){return s===void 0?a:y(K0())}function S(){var P=K0(),C=g(P);if(n=arguments,i=this,l=P,C){if(s===void 0)return m(l);if(c)return clearTimeout(s),s=setTimeout(b,t),p(l)}return s===void 0&&(s=setTimeout(b,t)),a}return S.cancel=x,S.flush=E,S}var qSe=KSe,YSe=qSe,XSe=rs,ZSe="Expected a function";function QSe(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(ZSe);return XSe(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),YSe(e,t,{leading:n,maxWait:t,trailing:i})}var JSe=QSe;const Yz=ut(JSe);function Bf(e){"@babel/helpers - typeof";return Bf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bf(e)}function 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 Jh(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(F=Yz(F,v,{trailing:!0,leading:!1}));var k=new ResizeObserver(F),B=S.current.getBoundingClientRect(),V=B.width,z=B.height;return N(V,z),k.observe(S.current),function(){k.disconnect()}},[N,v]);var _=w.useMemo(function(){var F=T.containerWidth,k=T.containerHeight;if(F<0||k<0)return null;Vs(As(a)||As(l),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,a,l),Vs(!r||r>0,"The aspect(%s) must be greater than zero.",r);var B=As(a)?F:a,V=As(l)?k:l;r&&r>0&&(B?V=B/r:V&&(B=V*r),f&&V>f&&(V=f)),Vs(B>0||V>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.`,B,V,a,l,d,c,r);var z=!Array.isArray(p)&&Eo(p.type).endsWith("Chart");return M.Children.map(p,function(I){return M.isValidElement(I)?w.cloneElement(I,Jh({width:B,height:V},z?{style:Jh({height:"100%",width:"100%",maxHeight:V,maxWidth:B},I.props.style)}:{})):I})},[r,p,l,f,c,d,T,a]);return M.createElement("div",{id:g?"".concat(g):void 0,className:at("recharts-responsive-container",b),style:Jh(Jh({},E),{},{width:a,height:l,minWidth:d,minHeight:c,maxHeight:f}),ref:S},_)}),Xz=function(t){return null};Xz.displayName="Cell";function Vf(e){"@babel/helpers - typeof";return Vf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vf(e)}function Dk(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 G1(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Po.isSsr)return{width:0,height:0};var n=h1e(r),i=JSON.stringify({text:t,copyStyle:n});if(El.widthCache[i])return El.widthCache[i];try{var o=document.getElementById(kk);o||(o=document.createElement("span"),o.setAttribute("id",kk),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var a=G1(G1({},p1e),n);Object.assign(o.style,a),o.textContent="".concat(t);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return El.widthCache[i]=l,++El.cacheCount>f1e&&(El.cacheCount=0,El.widthCache={}),l}catch{return{width:0,height:0}}},m1e=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Uf(e){"@babel/helpers - typeof";return Uf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uf(e)}function hg(e,t){return b1e(e)||y1e(e,t)||g1e(e,t)||v1e()}function v1e(){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 g1e(e,t){if(e){if(typeof e=="string")return Mk(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 Mk(e,t)}}function Mk(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 k1e(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 Bk(e,t){return $1e(e)||R1e(e,t)||I1e(e,t)||M1e()}function M1e(){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 I1e(e,t){if(e){if(typeof e=="string")return Vk(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 Vk(e,t)}}function Vk(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 B.reduce(function(V,z){var I=z.word,$=z.width,j=V[V.length-1];if(j&&(i==null||o||j.width+$+nz.width?V:z})};if(!d)return p;for(var v="â€Ļ",g=function(B){var V=c.slice(0,B),z=eW({breakAll:u,style:l,children:V+v}).wordsWithComputedWidth,I=f(z),$=I.length>a||m(I).width>Number(i);return[$,I]},b=0,y=c.length-1,x=0,E;b<=y&&x<=c.length-1;){var S=Math.floor((b+y)/2),P=S-1,C=g(P),A=Bk(C,2),T=A[0],D=A[1],N=g(S),_=Bk(N,1),F=_[0];if(!T&&!F&&(b=S+1),T&&F&&(y=S-1),!T&&F){E=D;break}x++}return E||p},Uk=function(t){var r=Je(t)?[]:t.toString().split(Jz);return[{words:r}]},F1e=function(t){var r=t.width,n=t.scaleToFit,i=t.children,o=t.style,a=t.breakAll,s=t.maxLines;if((r||n)&&!Po.isSsr){var l,u,d=eW({breakAll:a,children:i,style:o});if(d){var c=d.wordsWithComputedWidth,f=d.spaceWidth;l=c,u=f}else return Uk(i);return L1e({breakAll:a,children:i,maxLines:s,style:o},l,u,r,n)}return Uk(i)},zk="#808080",mg=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,d=t.scaleToFit,c=d===void 0?!1:d,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?zk:g,y=Fk(t,N1e),x=w.useMemo(function(){return F1e({breakAll:y.breakAll,children:y.children,maxLines:y.maxLines,scaleToFit:c,style:y.style,width:y.width})},[y.breakAll,y.children,y.maxLines,c,y.style,y.width]),E=y.dx,S=y.dy,P=y.angle,C=y.className,A=y.breakAll,T=Fk(y,D1e);if(!Qt(n)||!Qt(o))return null;var D=n+(be(E)?E:0),N=o+(be(S)?S:0),_;switch(v){case"start":_=q0("calc(".concat(u,")"));break;case"middle":_=q0("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:_=q0("calc(".concat(x.length-1," * -").concat(s,")"));break}var F=[];if(c){var k=x[0].width,B=y.width;F.push("scale(".concat((be(B)?B/k:1)/k,")"))}return P&&F.push("rotate(".concat(P,", ").concat(D,", ").concat(N,")")),F.length&&(T.transform=F.join(" ")),M.createElement("text",K1({},rt(T,!0),{x:D,y:N,className:at("recharts-text",C),textAnchor:p,fill:b.includes("url")?zk:b}),x.map(function(V,z){var I=V.words.join(A?"":" ");return M.createElement("tspan",{x:D,dy:z===0?_:s,key:"".concat(I,"-").concat(z)},I)}))};function ka(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function B1e(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function xT(e){let t,r,n;e.length!==2?(t=ka,r=(s,l)=>ka(e(s),l),n=(s,l)=>e(s)-l):(t=e===ka||e===B1e?e:V1e,r=e,n=e);function i(s,l,u=0,d=s.length){if(u>>1;r(s[c],l)<0?u=c+1:d=c}while(u>>1;r(s[c],l)<=0?u=c+1:d=c}while(uu&&n(s[c-1],l)>-n(s[c],l)?c-1:c}return{left:i,center:a,right:o}}function V1e(){return 0}function tW(e){return e===null?NaN:+e}function*U1e(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const z1e=xT(ka),ih=z1e.right;xT(tW).center;class Wk extends Map{constructor(t,r=G1e){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(Hk(this,t))}has(t){return super.has(Hk(this,t))}set(t,r){return super.set(W1e(this,t),r)}delete(t){return super.delete(H1e(this,t))}}function Hk({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function W1e({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function H1e({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function G1e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function K1e(e=ka){if(e===ka)return rW;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 rW(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const q1e=Math.sqrt(50),Y1e=Math.sqrt(10),X1e=Math.sqrt(2);function vg(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>=q1e?10:o>=Y1e?5:o>=X1e?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 Kk(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function nW(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?rW:K1e(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,d=Math.log(l),c=.5*Math.exp(2*d/3),f=.5*Math.sqrt(d*c*(l-c)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(t-u*c/l+f)),m=Math.min(n,Math.floor(t+(l-u)*c/l+f));nW(e,t,p,m,i)}const o=e[t];let a=r,s=n;for(ad(e,r,t),i(e[n],o)>0&&ad(e,r,n);a0;)--s}i(e[r],o)===0?ad(e,r,s):(++s,ad(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function ad(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Z1e(e,t,r){if(e=Float64Array.from(U1e(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Kk(e);if(t>=1)return Gk(e);var n,i=(n-1)*t,o=Math.floor(i),a=Gk(nW(e,o).subarray(0,o+1)),s=Kk(e.subarray(o+1));return a+(s-a)*(i-o)}}function Q1e(e,t,r=tW){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 J1e(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?tm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?tm(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=tEe.exec(e))?new qr(t[1],t[2],t[3],1):(t=rEe.exec(e))?new qr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nEe.exec(e))?tm(t[1],t[2],t[3],t[4]):(t=iEe.exec(e))?tm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=oEe.exec(e))?eM(t[1],t[2]/100,t[3]/100,1):(t=aEe.exec(e))?eM(t[1],t[2]/100,t[3]/100,t[4]):qk.hasOwnProperty(e)?Zk(qk[e]):e==="transparent"?new qr(NaN,NaN,NaN,0):null}function Zk(e){return new qr(e>>16&255,e>>8&255,e&255,1)}function tm(e,t,r,n){return n<=0&&(e=t=r=NaN),new qr(e,t,r,n)}function uEe(e){return e instanceof oh||(e=Gf(e)),e?(e=e.rgb(),new qr(e.r,e.g,e.b,e.opacity)):new qr}function Q1(e,t,r,n){return arguments.length===1?uEe(e):new qr(e,t,r,n??1)}function qr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}ST(qr,Q1,oW(oh,{brighter(e){return e=e==null?gg:Math.pow(gg,e),new qr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wf:Math.pow(Wf,e),new qr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new qr(Us(this.r),Us(this.g),Us(this.b),yg(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:Qk,formatHex:Qk,formatHex8:cEe,formatRgb:Jk,toString:Jk}));function Qk(){return`#${Ts(this.r)}${Ts(this.g)}${Ts(this.b)}`}function cEe(){return`#${Ts(this.r)}${Ts(this.g)}${Ts(this.b)}${Ts((isNaN(this.opacity)?1:this.opacity)*255)}`}function Jk(){const e=yg(this.opacity);return`${e===1?"rgb(":"rgba("}${Us(this.r)}, ${Us(this.g)}, ${Us(this.b)}${e===1?")":`, ${e})`}`}function yg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Us(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ts(e){return e=Us(e),(e<16?"0":"")+e.toString(16)}function eM(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ui(e,t,r,n)}function aW(e){if(e instanceof ui)return new ui(e.h,e.s,e.l,e.opacity);if(e instanceof oh||(e=Gf(e)),!e)return new ui;if(e instanceof ui)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 ui(a,s,l,e.opacity)}function dEe(e,t,r,n){return arguments.length===1?aW(e):new ui(e,t,r,n??1)}function ui(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}ST(ui,dEe,oW(oh,{brighter(e){return e=e==null?gg:Math.pow(gg,e),new ui(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wf:Math.pow(Wf,e),new ui(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 qr(Y0(e>=240?e-240:e+120,i,n),Y0(e,i,n),Y0(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ui(tM(this.h),rm(this.s),rm(this.l),yg(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=yg(this.opacity);return`${e===1?"hsl(":"hsla("}${tM(this.h)}, ${rm(this.s)*100}%, ${rm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function tM(e){return e=(e||0)%360,e<0?e+360:e}function rm(e){return Math.max(0,Math.min(1,e||0))}function Y0(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 ET=e=>()=>e;function fEe(e,t){return function(r){return e+r*t}}function pEe(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 hEe(e){return(e=+e)==1?sW:function(t,r){return r-t?pEe(t,r,e):ET(isNaN(t)?r:t)}}function sW(e,t){var r=t-e;return r?fEe(e,r):ET(isNaN(e)?t:e)}const rM=function e(t){var r=hEe(t);function n(i,o){var a=r((i=Q1(i)).r,(o=Q1(o)).r),s=r(i.g,o.g),l=r(i.b,o.b),u=sW(i.opacity,o.opacity);return function(d){return i.r=a(d),i.g=s(d),i.b=l(d),i.opacity=u(d),i+""}}return n.gamma=e,n}(1);function mEe(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:bg(n,i)})),r=X0.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function AEe(e,t,r){var n=e[0],i=e[1],o=t[0],a=t[1];return i2?TEe:AEe,l=u=null,c}function c(f){return f==null||isNaN(f=+f)?o:(l||(l=s(e.map(n),t,r)))(n(a(f)))}return c.invert=function(f){return a(i((u||(u=s(t,e.map(n),bg)))(f)))},c.domain=function(f){return arguments.length?(e=Array.from(f,xg),d()):e.slice()},c.range=function(f){return arguments.length?(t=Array.from(f),d()):t.slice()},c.rangeRound=function(f){return t=Array.from(f),r=PT,d()},c.clamp=function(f){return arguments.length?(a=f?!0:Mr,d()):a!==Mr},c.interpolate=function(f){return arguments.length?(r=f,d()):r},c.unknown=function(f){return arguments.length?(o=f,c):o},function(f,p){return n=f,i=p,d()}}function CT(){return Gb()(Mr,Mr)}function OEe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function wg(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 Zu(e){return e=wg(Math.abs(e)),e?e[1]:NaN}function _Ee(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 jEe(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var NEe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Kf(e){if(!(t=NEe.exec(e)))throw new Error("invalid format: "+e);var t;return new AT({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]})}Kf.prototype=AT.prototype;function AT(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+""}AT.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 DEe(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 lW;function kEe(e,t){var r=wg(e,t);if(!r)return e+"";var n=r[0],i=r[1],o=i-(lW=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")+wg(e,Math.max(0,t+o-1))[0]}function iM(e,t){var r=wg(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 oM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:OEe,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)=>iM(e*100,t),r:iM,s:kEe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function aM(e){return e}var sM=Array.prototype.map,lM=["y","z","a","f","p","n","Âĩ","m","","k","M","G","T","P","E","Z","Y"];function MEe(e){var t=e.grouping===void 0||e.thousands===void 0?aM:_Ee(sM.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?aM:jEe(sM.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(c){c=Kf(c);var f=c.fill,p=c.align,m=c.sign,v=c.symbol,g=c.zero,b=c.width,y=c.comma,x=c.precision,E=c.trim,S=c.type;S==="n"?(y=!0,S="g"):oM[S]||(x===void 0&&(x=12),E=!0,S="g"),(g||f==="0"&&p==="=")&&(g=!0,f="0",p="=");var P=v==="$"?r:v==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",C=v==="$"?n:/[%p]/.test(S)?a:"",A=oM[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 _=P,F=C,k,B,V;if(S==="c")F=A(N)+F,N="";else{N=+N;var z=N<0||1/N<0;if(N=isNaN(N)?l:A(Math.abs(N),x),E&&(N=DEe(N)),z&&+N==0&&m!=="+"&&(z=!1),_=(z?m==="("?m:s:m==="-"||m==="("?"":m)+_,F=(S==="s"?lM[8+lW/3]:"")+F+(z&&m==="("?")":""),T){for(k=-1,B=N.length;++kV||V>57){F=(V===46?i+N.slice(k+1):N.slice(k))+F,N=N.slice(0,k);break}}}y&&!g&&(N=t(N,1/0));var I=_.length+N.length+F.length,$=I>1)+_+N+F+$.slice(I);break;default:N=$+_+N+F;break}return o(N)}return D.toString=function(){return c+""},D}function d(c,f){var p=u((c=Kf(c),c.type="f",c)),m=Math.max(-8,Math.min(8,Math.floor(Zu(f)/3)))*3,v=Math.pow(10,-m),g=lM[8+m/3];return function(b){return p(v*b)+g}}return{format:u,formatPrefix:d}}var nm,TT,uW;IEe({thousands:",",grouping:[3],currency:["$",""]});function IEe(e){return nm=MEe(e),TT=nm.format,uW=nm.formatPrefix,nm}function REe(e){return Math.max(0,-Zu(Math.abs(e)))}function $Ee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Zu(t)/3)))*3-Zu(Math.abs(e)))}function LEe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Zu(t)-Zu(e))+1}function cW(e,t,r,n){var i=X1(e,t,r),o;switch(n=Kf(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=$Ee(i,a))&&(n.precision=o),uW(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=LEe(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=REe(i))&&(n.precision=o-(n.type==="%")*2);break}}return TT(n)}function ns(e){var t=e.domain;return e.ticks=function(r){var n=t();return q1(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return cW(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,d=10;for(s0;){if(u=Y1(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 Sg(){var e=CT();return e.copy=function(){return ah(e,Sg())},Kn.apply(e,arguments),ns(e)}function dW(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,xg),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return dW(e).unknown(t)},e=arguments.length?Array.from(e,xg):[0,1],ns(r)}function fW(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 zEe(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 dM(e){return(t,r)=>-e(-t,r)}function OT(e){const t=e(uM,cM),r=t.domain;let n=10,i,o;function a(){return i=zEe(n),o=UEe(n),r()[0]<0?(i=dM(i),o=dM(o),e(FEe,BEe)):e(uM,cM),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],d=l[l.length-1];const c=d0){for(;f<=p;++f)for(m=1;md)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),!(vd)break;b.push(v)}b.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Kf(l)).precision==null&&(l.trim=!0),l=TT(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return d=>{let c=d/o(Math.round(i(d)));return c*nr(fW(r(),{floor:s=>o(Math.floor(i(s))),ceil:s=>o(Math.ceil(i(s)))})),t}function pW(){const e=OT(Gb()).domain([1,10]);return e.copy=()=>ah(e,pW()).base(e.base()),Kn.apply(e,arguments),e}function fM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function pM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function _T(e){var t=1,r=e(fM(t),pM(t));return r.constant=function(n){return arguments.length?e(fM(t=+n),pM(t)):t},ns(r)}function hW(){var e=_T(Gb());return e.copy=function(){return ah(e,hW()).constant(e.constant())},Kn.apply(e,arguments)}function hM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function WEe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function HEe(e){return e<0?-e*e:e*e}function jT(e){var t=e(Mr,Mr),r=1;function n(){return r===1?e(Mr,Mr):r===.5?e(WEe,HEe):e(hM(r),hM(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},ns(t)}function NT(){var e=jT(Gb());return e.copy=function(){return ah(e,NT()).exponent(e.exponent())},Kn.apply(e,arguments),e}function GEe(){return NT.apply(null,arguments).exponent(.5)}function mM(e){return Math.sign(e)*e*e}function KEe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function mW(){var e=CT(),t=[0,1],r=!1,n;function i(o){var a=KEe(e(o));return isNaN(a)?n:r?Math.round(a):a}return i.invert=function(o){return e.invert(mM(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,xg)).map(mM)),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 mW(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Kn.apply(i,arguments),ns(i)}function vW(){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 gW().domain([e,t]).range(i).unknown(o)},Kn.apply(ns(a),arguments)}function yW(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[ih(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 yW().domain(e).range(t).unknown(r)},Kn.apply(i,arguments)}const Z0=new Date,Q0=new Date;function Jt(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(uJt(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)=>(Z0.setTime(+o),Q0.setTime(+a),e(Z0),e(Q0),Math.floor(r(Z0,Q0))),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 Eg=Jt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Eg.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Jt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Eg);Eg.range;const vo=1e3,In=vo*60,go=In*60,$o=go*24,DT=$o*7,vM=$o*30,J0=$o*365,Os=Jt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*vo)},(e,t)=>(t-e)/vo,e=>e.getUTCSeconds());Os.range;const kT=Jt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vo)},(e,t)=>{e.setTime(+e+t*In)},(e,t)=>(t-e)/In,e=>e.getMinutes());kT.range;const MT=Jt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*In)},(e,t)=>(t-e)/In,e=>e.getUTCMinutes());MT.range;const IT=Jt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vo-e.getMinutes()*In)},(e,t)=>{e.setTime(+e+t*go)},(e,t)=>(t-e)/go,e=>e.getHours());IT.range;const RT=Jt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*go)},(e,t)=>(t-e)/go,e=>e.getUTCHours());RT.range;const sh=Jt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*In)/$o,e=>e.getDate()-1);sh.range;const Kb=Jt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$o,e=>e.getUTCDate()-1);Kb.range;const bW=Jt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$o,e=>Math.floor(e/$o));bW.range;function fl(e){return Jt(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())*In)/DT)}const qb=fl(0),Pg=fl(1),qEe=fl(2),YEe=fl(3),Qu=fl(4),XEe=fl(5),ZEe=fl(6);qb.range;Pg.range;qEe.range;YEe.range;Qu.range;XEe.range;ZEe.range;function pl(e){return Jt(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)/DT)}const Yb=pl(0),Cg=pl(1),QEe=pl(2),JEe=pl(3),Ju=pl(4),ePe=pl(5),tPe=pl(6);Yb.range;Cg.range;QEe.range;JEe.range;Ju.range;ePe.range;tPe.range;const $T=Jt(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());$T.range;const LT=Jt(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());LT.range;const Lo=Jt(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());Lo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Jt(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)});Lo.range;const Fo=Jt(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());Fo.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Jt(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)});Fo.range;function xW(e,t,r,n,i,o){const a=[[Os,1,vo],[Os,5,5*vo],[Os,15,15*vo],[Os,30,30*vo],[o,1,In],[o,5,5*In],[o,15,15*In],[o,30,30*In],[i,1,go],[i,3,3*go],[i,6,6*go],[i,12,12*go],[n,1,$o],[n,2,2*$o],[r,1,DT],[t,1,vM],[t,3,3*vM],[e,1,J0]];function s(u,d,c){const f=dg).right(a,f);if(p===a.length)return e.every(X1(u/J0,d/J0,c));if(p===0)return Eg.every(Math.max(X1(u,d,c),1));const[m,v]=a[f/a[p-1][2]53)return null;"w"in H||(H.w=1),"Z"in H?(ue=tw(sd(H.y,0,1)),$e=ue.getUTCDay(),ue=$e>4||$e===0?Cg.ceil(ue):Cg(ue),ue=Kb.offset(ue,(H.V-1)*7),H.y=ue.getUTCFullYear(),H.m=ue.getUTCMonth(),H.d=ue.getUTCDate()+(H.w+6)%7):(ue=ew(sd(H.y,0,1)),$e=ue.getDay(),ue=$e>4||$e===0?Pg.ceil(ue):Pg(ue),ue=sh.offset(ue,(H.V-1)*7),H.y=ue.getFullYear(),H.m=ue.getMonth(),H.d=ue.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),$e="Z"in H?tw(sd(H.y,0,1)).getUTCDay():ew(sd(H.y,0,1)).getDay(),H.m=0,H.d="W"in H?(H.w+6)%7+H.W*7-($e+5)%7:H.w+H.U*7-($e+6)%7);return"Z"in H?(H.H+=H.Z/100|0,H.M+=H.Z%100,tw(H)):ew(H)}}function A(K,J,te,H){for(var Ae=0,ue=J.length,$e=te.length,Ve,qe;Ae=$e)return-1;if(Ve=J.charCodeAt(Ae++),Ve===37){if(Ve=J.charAt(Ae++),qe=S[Ve in gM?J.charAt(Ae++):Ve],!qe||(H=qe(K,te,H))<0)return-1}else if(Ve!=te.charCodeAt(H++))return-1}return H}function T(K,J,te){var H=u.exec(J.slice(te));return H?(K.p=d.get(H[0].toLowerCase()),te+H[0].length):-1}function D(K,J,te){var H=p.exec(J.slice(te));return H?(K.w=m.get(H[0].toLowerCase()),te+H[0].length):-1}function N(K,J,te){var H=c.exec(J.slice(te));return H?(K.w=f.get(H[0].toLowerCase()),te+H[0].length):-1}function _(K,J,te){var H=b.exec(J.slice(te));return H?(K.m=y.get(H[0].toLowerCase()),te+H[0].length):-1}function F(K,J,te){var H=v.exec(J.slice(te));return H?(K.m=g.get(H[0].toLowerCase()),te+H[0].length):-1}function k(K,J,te){return A(K,t,J,te)}function B(K,J,te){return A(K,r,J,te)}function V(K,J,te){return A(K,n,J,te)}function z(K){return a[K.getDay()]}function I(K){return o[K.getDay()]}function $(K){return l[K.getMonth()]}function j(K){return s[K.getMonth()]}function O(K){return i[+(K.getHours()>=12)]}function U(K){return 1+~~(K.getMonth()/3)}function Y(K){return a[K.getUTCDay()]}function re(K){return o[K.getUTCDay()]}function ce(K){return l[K.getUTCMonth()]}function de(K){return s[K.getUTCMonth()]}function Z(K){return i[+(K.getUTCHours()>=12)]}function ne(K){return 1+~~(K.getUTCMonth()/3)}return{format:function(K){var J=P(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=P(K+="",E);return J.toString=function(){return K},J},utcParse:function(K){var J=C(K+="",!0);return J.toString=function(){return K},J}}}var gM={"-":"",_:" ",0:"0"},ar=/^\s*\d+/,sPe=/^%/,lPe=/[\\^$*+?|[\]().{}]/g;function st(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function cPe(e,t,r){var n=ar.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function dPe(e,t,r){var n=ar.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function fPe(e,t,r){var n=ar.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function pPe(e,t,r){var n=ar.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function hPe(e,t,r){var n=ar.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function yM(e,t,r){var n=ar.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function bM(e,t,r){var n=ar.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function mPe(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 vPe(e,t,r){var n=ar.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function gPe(e,t,r){var n=ar.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function xM(e,t,r){var n=ar.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function yPe(e,t,r){var n=ar.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function wM(e,t,r){var n=ar.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function bPe(e,t,r){var n=ar.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function xPe(e,t,r){var n=ar.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function wPe(e,t,r){var n=ar.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function SPe(e,t,r){var n=ar.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function EPe(e,t,r){var n=sPe.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function PPe(e,t,r){var n=ar.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function CPe(e,t,r){var n=ar.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function SM(e,t){return st(e.getDate(),t,2)}function APe(e,t){return st(e.getHours(),t,2)}function TPe(e,t){return st(e.getHours()%12||12,t,2)}function OPe(e,t){return st(1+sh.count(Lo(e),e),t,3)}function wW(e,t){return st(e.getMilliseconds(),t,3)}function _Pe(e,t){return wW(e,t)+"000"}function jPe(e,t){return st(e.getMonth()+1,t,2)}function NPe(e,t){return st(e.getMinutes(),t,2)}function DPe(e,t){return st(e.getSeconds(),t,2)}function kPe(e){var t=e.getDay();return t===0?7:t}function MPe(e,t){return st(qb.count(Lo(e)-1,e),t,2)}function SW(e){var t=e.getDay();return t>=4||t===0?Qu(e):Qu.ceil(e)}function IPe(e,t){return e=SW(e),st(Qu.count(Lo(e),e)+(Lo(e).getDay()===4),t,2)}function RPe(e){return e.getDay()}function $Pe(e,t){return st(Pg.count(Lo(e)-1,e),t,2)}function LPe(e,t){return st(e.getFullYear()%100,t,2)}function FPe(e,t){return e=SW(e),st(e.getFullYear()%100,t,2)}function BPe(e,t){return st(e.getFullYear()%1e4,t,4)}function VPe(e,t){var r=e.getDay();return e=r>=4||r===0?Qu(e):Qu.ceil(e),st(e.getFullYear()%1e4,t,4)}function UPe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+st(t/60|0,"0",2)+st(t%60,"0",2)}function EM(e,t){return st(e.getUTCDate(),t,2)}function zPe(e,t){return st(e.getUTCHours(),t,2)}function WPe(e,t){return st(e.getUTCHours()%12||12,t,2)}function HPe(e,t){return st(1+Kb.count(Fo(e),e),t,3)}function EW(e,t){return st(e.getUTCMilliseconds(),t,3)}function GPe(e,t){return EW(e,t)+"000"}function KPe(e,t){return st(e.getUTCMonth()+1,t,2)}function qPe(e,t){return st(e.getUTCMinutes(),t,2)}function YPe(e,t){return st(e.getUTCSeconds(),t,2)}function XPe(e){var t=e.getUTCDay();return t===0?7:t}function ZPe(e,t){return st(Yb.count(Fo(e)-1,e),t,2)}function PW(e){var t=e.getUTCDay();return t>=4||t===0?Ju(e):Ju.ceil(e)}function QPe(e,t){return e=PW(e),st(Ju.count(Fo(e),e)+(Fo(e).getUTCDay()===4),t,2)}function JPe(e){return e.getUTCDay()}function eCe(e,t){return st(Cg.count(Fo(e)-1,e),t,2)}function tCe(e,t){return st(e.getUTCFullYear()%100,t,2)}function rCe(e,t){return e=PW(e),st(e.getUTCFullYear()%100,t,2)}function nCe(e,t){return st(e.getUTCFullYear()%1e4,t,4)}function iCe(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ju(e):Ju.ceil(e),st(e.getUTCFullYear()%1e4,t,4)}function oCe(){return"+0000"}function PM(){return"%"}function CM(e){return+e}function AM(e){return Math.floor(+e/1e3)}var Pl,CW,AW;aCe({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 aCe(e){return Pl=aPe(e),CW=Pl.format,Pl.parse,AW=Pl.utcFormat,Pl.utcParse,Pl}function sCe(e){return new Date(e)}function lCe(e){return e instanceof Date?+e:+new Date(+e)}function FT(e,t,r,n,i,o,a,s,l,u){var d=CT(),c=d.invert,f=d.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"),E=u("%Y");function S(P){return(l(P)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>Z1e(e,o/n))},r.copy=function(){return jW(t).domain(e)},Yo.apply(r,arguments)}function Zb(){var e=0,t=.5,r=1,n=1,i,o,a,s,l,u=Mr,d,c=!1,f;function p(v){return isNaN(v=+v)?f:(v=.5+((v=+d(v))-o)*(n*vt}var vCe=mCe,gCe=MW,yCe=vCe,bCe=Mc;function xCe(e){return e&&e.length?gCe(e,bCe,yCe):void 0}var wCe=xCe;const Qb=ut(wCe);function SCe(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};Ce.decimalPlaces=Ce.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Pt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Ce.dividedBy=Ce.div=function(e){return Co(this,new this.constructor(e))};Ce.dividedToIntegerBy=Ce.idiv=function(e){var t=this,r=t.constructor;return vt(Co(t,new r(e),0,1),r.precision)};Ce.equals=Ce.eq=function(e){return!this.cmp(e)};Ce.exponent=function(){return Gt(this)};Ce.greaterThan=Ce.gt=function(e){return this.cmp(e)>0};Ce.greaterThanOrEqualTo=Ce.gte=function(e){return this.cmp(e)>=0};Ce.isInteger=Ce.isint=function(){return this.e>this.d.length-2};Ce.isNegative=Ce.isneg=function(){return this.s<0};Ce.isPositive=Ce.ispos=function(){return this.s>0};Ce.isZero=function(){return this.s===0};Ce.lessThan=Ce.lt=function(e){return this.cmp(e)<0};Ce.lessThanOrEqualTo=Ce.lte=function(e){return this.cmp(e)<1};Ce.logarithm=Ce.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(sn))throw Error(Hn+"NaN");if(r.s<1)throw Error(Hn+(r.s?"NaN":"-Infinity"));return r.eq(sn)?new n(0):(Ot=!1,t=Co(qf(r,o),qf(e,o),o),Ot=!0,vt(t,i))};Ce.minus=Ce.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?LW(t,e):RW(t,(e.s=-e.s,e))};Ce.modulo=Ce.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Hn+"NaN");return r.s?(Ot=!1,t=Co(r,e,0,1).times(e),Ot=!0,r.minus(t)):vt(new n(r),i)};Ce.naturalExponential=Ce.exp=function(){return $W(this)};Ce.naturalLogarithm=Ce.ln=function(){return qf(this)};Ce.negated=Ce.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ce.plus=Ce.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?RW(t,e):LW(t,(e.s=-e.s,e))};Ce.precision=Ce.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(zs+e);if(t=Gt(i)+1,n=i.d.length-1,r=n*Pt+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};Ce.squareRoot=Ce.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(Hn+"NaN")}for(e=Gt(s),Ot=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=Bi(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Lc((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(Co(s,o,a+2)).times(.5),Bi(o.d).slice(0,a)===(t=Bi(n.d)).slice(0,a)){if(t=t.slice(a-3,a+1),i==a&&t=="4999"){if(vt(o,r+1,0),o.times(o).eq(s)){n=o;break}}else if(t!="9999")break;a+=4}return Ot=!0,vt(n,r)};Ce.times=Ce.mul=function(e){var t,r,n,i,o,a,s,l,u,d=this,c=d.constructor,f=d.d,p=(e=new c(e)).d;if(!d.s||!e.s)return new c(0);for(e.s*=d.s,r=d.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%er|0,t=s/er|0;o[i]=(o[i]+t)%er|0}for(;!o[--a];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,Ot?vt(e,c.precision):e};Ce.toDecimalPlaces=Ce.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Zi(e,0,$c),t===void 0?t=n.rounding:Zi(t,0,8),vt(r,e+Gt(r)+1,t))};Ce.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=il(n,!0):(Zi(e,0,$c),t===void 0?t=i.rounding:Zi(t,0,8),n=vt(new i(n),e+1,t),r=il(n,!0,e+1)),r};Ce.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?il(i):(Zi(e,0,$c),t===void 0?t=o.rounding:Zi(t,0,8),n=vt(new o(i),e+Gt(i)+1,t),r=il(n.abs(),!1,e+Gt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};Ce.toInteger=Ce.toint=function(){var e=this,t=e.constructor;return vt(new t(e),Gt(e)+1,t.rounding)};Ce.toNumber=function(){return+this};Ce.toPower=Ce.pow=function(e){var t,r,n,i,o,a,s=this,l=s.constructor,u=12,d=+(e=new l(e));if(!e.s)return new l(sn);if(s=new l(s),!s.s){if(e.s<1)throw Error(Hn+"Infinity");return s}if(s.eq(sn))return s;if(n=l.precision,e.eq(sn))return vt(s,n);if(t=e.e,r=e.d.length-1,a=t>=r,o=s.s,a){if((r=d<0?-d:d)<=IW){for(i=new l(sn),t=Math.ceil(n/Pt+4),Ot=!1;r%2&&(i=i.times(s),_M(i.d,t)),r=Lc(r/2),r!==0;)s=s.times(s),_M(s.d,t);return Ot=!0,e.s<0?new l(sn).div(i):vt(i,n)}}else if(o<0)throw Error(Hn+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,Ot=!1,i=e.times(qf(s,n+u)),Ot=!0,i=$W(i),i.s=o,i};Ce.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=Gt(i),n=il(i,r<=o.toExpNeg||r>=o.toExpPos)):(Zi(e,1,$c),t===void 0?t=o.rounding:Zi(t,0,8),i=vt(new o(i),e,t),r=Gt(i),n=il(i,e<=r||r<=o.toExpNeg,e)),n};Ce.toSignificantDigits=Ce.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Zi(e,1,$c),t===void 0?t=n.rounding:Zi(t,0,8)),vt(new n(r),e,t)};Ce.toString=Ce.valueOf=Ce.val=Ce.toJSON=Ce[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Gt(e),r=e.constructor;return il(e,t<=r.toExpNeg||t>=r.toExpPos)};function RW(e,t){var r,n,i,o,a,s,l,u,d=e.constructor,c=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),Ot?vt(t,c):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(c/Pt),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)/er|0,l[o]%=er;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,Ot?vt(t,c):t}function Zi(e,t,r){if(e!==~~e||er)throw Error(zs+e)}function Bi(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,d,c,f,p,m,v,g,b,y,x,E,S,P,C,A,T=n.constructor,D=n.s==i.s?1:-1,N=n.d,_=i.d;if(!n.s)return new T(n);if(!i.s)throw Error(Hn+"Division by zero");for(l=n.e-i.e,C=_.length,S=N.length,p=new T(D),m=p.d=[],u=0;_[u]==(N[u]||0);)++u;if(_[u]>(N[u]||0)&&--l,o==null?y=o=T.precision:a?y=o+(Gt(n)-Gt(i))+1:y=o,y<0)return new T(0);if(y=y/Pt+2|0,u=0,C==1)for(d=0,_=_[0],y++;(u1&&(_=e(_,d),N=e(N,d),C=_.length,S=N.length),E=C,v=N.slice(0,C),g=v.length;g=er/2&&++P;do d=0,s=t(_,v,C,g),s<0?(b=v[0],C!=g&&(b=b*er+(v[1]||0)),d=b/P|0,d>1?(d>=er&&(d=er-1),c=e(_,d),f=c.length,g=v.length,s=t(c,v,f,g),s==1&&(d--,r(c,C16)throw Error(UT+Gt(e));if(!e.s)return new d(sn);for(t==null?(Ot=!1,s=c):s=t,a=new d(.03125);e.abs().gte(.1);)e=e.times(a),u+=5;for(n=Math.log(gs(2,u))/Math.LN10*2+5|0,s+=n,r=i=o=new d(sn),d.precision=s;;){if(i=vt(i.times(e),s),r=r.times(++l),a=o.plus(Co(i,r,s)),Bi(a.d).slice(0,s)===Bi(o.d).slice(0,s)){for(;u--;)o=vt(o.times(o),s);return d.precision=c,t==null?(Ot=!0,vt(o,c)):o}o=a}}function Gt(e){for(var t=e.e*Pt,r=e.d[0];r>=10;r/=10)t++;return t}function rw(e,t,r){if(t>e.LN10.sd())throw Ot=!0,r&&(e.precision=r),Error(Hn+"LN10 precision limit exceeded");return vt(new e(e.LN10),t)}function oa(e){for(var t="";e--;)t+="0";return t}function qf(e,t){var r,n,i,o,a,s,l,u,d,c=1,f=10,p=e,m=p.d,v=p.constructor,g=v.precision;if(p.s<1)throw Error(Hn+(p.s?"NaN":"-Infinity"));if(p.eq(sn))return new v(0);if(t==null?(Ot=!1,u=g):u=t,p.eq(10))return t==null&&(Ot=!0),rw(v,u);if(u+=f,v.precision=u,r=Bi(m),n=r.charAt(0),o=Gt(p),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=Bi(p.d),n=r.charAt(0),c++;o=Gt(p),n>1?(p=new v("0."+r),o++):p=new v(n+"."+r.slice(1))}else return l=rw(v,u+2,g).times(o+""),p=qf(new v(n+"."+r.slice(1)),u-f).plus(l),v.precision=g,t==null?(Ot=!0,vt(p,g)):p;for(s=a=p=Co(p.minus(sn),p.plus(sn),u),d=vt(p.times(p),u),i=3;;){if(a=vt(a.times(d),u),l=s.plus(Co(a,new v(i),u)),Bi(l.d).slice(0,u)===Bi(s.d).slice(0,u))return s=s.times(2),o!==0&&(s=s.plus(rw(v,u+2,g).times(o+""))),s=Co(s,new v(c),u),v.precision=g,t==null?(Ot=!0,vt(s,g)):s;s=l,i+=2}}function OM(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=Lc(r/Pt),e.d=[],n=(r+1)%Pt,r<0&&(n+=Pt),nAg||e.e<-Ag))throw Error(UT+r)}else e.s=0,e.e=0,e.d=[0];return e}function vt(e,t,r){var n,i,o,a,s,l,u,d,c=e.d;for(a=1,o=c[0];o>=10;o/=10)a++;if(n=t-a,n<0)n+=Pt,i=t,u=c[d=0];else{if(d=Math.ceil((n+1)/Pt),o=c.length,d>=o)return e;for(u=o=c[d],a=1;o>=10;o/=10)a++;n%=Pt,i=n-Pt+a}if(r!==void 0&&(o=gs(10,a-i-1),s=u/o%10|0,l=t<0||c[d+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/gs(10,a-i):0:c[d-1])%10&1||r==(e.s<0?8:7))),t<1||!c[0])return l?(o=Gt(e),c.length=1,t=t-o-1,c[0]=gs(10,(Pt-t%Pt)%Pt),e.e=Lc(-t/Pt)||0):(c.length=1,c[0]=e.e=e.s=0),e;if(n==0?(c.length=d,o=1,d--):(c.length=d+1,o=gs(10,Pt-n),c[d]=i>0?(u/gs(10,a-i)%gs(10,i)|0)*o:0),l)for(;;)if(d==0){(c[0]+=o)==er&&(c[0]=1,++e.e);break}else{if(c[d]+=o,c[d]!=er)break;c[d--]=0,o=1}for(n=c.length;c[--n]===0;)c.pop();if(Ot&&(e.e>Ag||e.e<-Ag))throw Error(UT+Gt(e));return e}function LW(e,t){var r,n,i,o,a,s,l,u,d,c,f=e.constructor,p=f.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new f(e),Ot?vt(t,p):t;if(l=e.d,c=t.d,n=t.e,u=e.e,l=l.slice(),a=u-n,a){for(d=a<0,d?(r=l,a=-a,s=c.length):(r=c,n=u,s=l.length),i=Math.max(Math.ceil(p/Pt),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=c.length,d=i0;--i)l[s++]=0;for(i=c.length;i>a;){if(l[--i]0?o=o.charAt(0)+"."+o.slice(1)+oa(n):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+oa(-i-1)+o,r&&(n=r-a)>0&&(o+=oa(n))):i>=a?(o+=oa(i+1-a),r&&(n=r-i-1)>0&&(o=o+"."+oa(n))):((n=i+1)0&&(i+1===a&&(o+="."),o+=oa(n))),e.s<0?"-"+o:o}function _M(e,t){if(e.length>t)return e.length=t,!0}function FW(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(zs+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 OM(a,o.toString())}else if(typeof o!="string")throw Error(zs+o);if(o.charCodeAt(0)===45?(o=o.slice(1),a.s=-1):a.s=1,WCe.test(o))OM(a,o);else throw Error(zs+o)}if(i.prototype=Ce,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=FW,i.config=i.set=HCe,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(zs+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(zs+r+": "+n);return this}var zT=FW(zCe);sn=new zT(1);const mt=zT;function GCe(e){return XCe(e)||YCe(e)||qCe(e)||KCe()}function KCe(){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 qCe(e,t){if(e){if(typeof e=="string")return tE(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 tE(e,t)}}function YCe(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function XCe(e){if(Array.isArray(e))return tE(e)}function tE(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,jM(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 dAe(e){if(Array.isArray(e))return e}function WW(e){var t=Yf(e,2),r=t[0],n=t[1],i=r,o=n;return r>n&&(i=n,o=r),[i,o]}function HW(e,t,r){if(e.lte(0))return new mt(0);var n=rx.getDigitCount(e.toNumber()),i=new mt(10).pow(n),o=e.div(i),a=n!==1?.05:.1,s=new mt(Math.ceil(o.div(a).toNumber())).add(r).mul(a),l=s.mul(i);return t?l:new mt(Math.ceil(l))}function fAe(e,t,r){var n=1,i=new mt(e);if(!i.isint()&&r){var o=Math.abs(e);o<1?(n=new mt(10).pow(rx.getDigitCount(e)-1),i=new mt(Math.floor(i.div(n).toNumber())).mul(n)):o>1&&(i=new mt(Math.floor(e)))}else e===0?i=new mt(Math.floor((t-1)/2)):r||(i=new mt(Math.floor(e)));var a=Math.floor((t-1)/2),s=eAe(JCe(function(l){return i.add(new mt(l-a).mul(n)).toNumber()}),rE);return s(0,t)}function GW(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 mt(0),tickMin:new mt(0),tickMax:new mt(0)};var o=HW(new mt(t).sub(e).div(r-1),n,i),a;e<=0&&t>=0?a=new mt(0):(a=new mt(e).add(t).div(2),a=a.sub(new mt(a).mod(o)));var s=Math.ceil(a.sub(e).div(o).toNumber()),l=Math.ceil(new mt(t).sub(a).div(o).toNumber()),u=s+l+1;return u>r?GW(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:o,tickMin:a.sub(new mt(s).mul(o)),tickMax:a.add(new mt(l).mul(o))})}function pAe(e){var t=Yf(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=WW([r,n]),l=Yf(s,2),u=l[0],d=l[1];if(u===-1/0||d===1/0){var c=d===1/0?[u].concat(iE(rE(0,i-1).map(function(){return 1/0}))):[].concat(iE(rE(0,i-1).map(function(){return-1/0})),[d]);return r>n?nE(c):c}if(u===d)return fAe(u,i,o);var f=GW(u,d,a,o),p=f.step,m=f.tickMin,v=f.tickMax,g=rx.rangeStep(m,v.add(new mt(.1).mul(p)),p);return r>n?nE(g):g}function hAe(e,t){var r=Yf(e,2),n=r[0],i=r[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=WW([n,i]),s=Yf(a,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var d=Math.max(t,2),c=HW(new mt(u).sub(l).div(d-1),o,0),f=[].concat(iE(rx.rangeStep(new mt(l),new mt(u).sub(new mt(.99).mul(c)),c)),[u]);return n>i?nE(f):f}var mAe=UW(pAe),vAe=UW(hAe),gAe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ec(e){"@babel/helpers - typeof";return ec=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},ec(e)}function Tg(){return Tg=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 PAe(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 CAe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function AAe(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,c=i[u].coordinate,f=u>=s-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(vi(c-d)!==vi(f-c)){var m=[];if(vi(f-c)===vi(l[1]-l[0])){p=f;var v=c+l[1]-l[0];m[0]=Math.min(v,(v+d)/2),m[1]=Math.max(v,(v+d)/2)}else{p=d;var g=f+l[1]-l[0];m[0]=Math.min(c,(g+c)/2),m[1]=Math.max(c,(g+c)/2)}var b=[Math.min(c,(p+c)/2),Math.max(c,(p+c)/2)];if(t>b[0]&&t<=b[1]||t>=m[0]&&t<=m[1]){a=i[u].index;break}}else{var y=Math.min(d,f),x=Math.max(d,f);if(t>(y+c)/2&&t<=(x+c)/2){a=i[u].index;break}}}else for(var E=0;E0&&E(n[E].coordinate+n[E-1].coordinate)/2&&t<=(n[E].coordinate+n[E+1].coordinate)/2||E===s-1&&t>(n[E].coordinate+n[E-1].coordinate)/2){a=n[E].index;break}return a},WT=function(t){var r,n=t,i=n.type.displayName,o=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ft(Ft({},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?Ft(Ft({},y),b[0].props):b[0].props,E=x.barSize,S=x[g];a[S]||(a[S]=[]);var P=Je(E)?r:E;a[S].push({item:b[0],stackList:b.slice(1),barSize:Je(P)?void 0:nl(P,n,0)})}}return a},WAe=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=nl(r,i,0,!0),d,c=[];if(a[0].barSize===+a[0].barSize){var f=!1,p=i/l,m=a.reduce(function(E,S){return E+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};d=a.reduce(function(E,S){var P={item:S.item,position:{offset:g.offset+g.size+u,size:f?p:S.barSize}},C=[].concat(kM(E),[P]);return g=C[C.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(A){C.push({item:A,position:g})}),C},c)}else{var b=nl(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;d=a.reduce(function(E,S,P){var C=[].concat(kM(E),[{item:S.item,position:{offset:b+(y+u)*P+(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},c)}return d},HAe=function(t,r,n,i){var o=n.children,a=n.width,s=n.margin,l=a-(s.left||0)-(s.right||0),u=XW({children:o,legendWidth:l});if(u){var d=i||{},c=d.width,f=d.height,p=u.align,m=u.verticalAlign,v=u.layout;if((v==="vertical"||v==="horizontal"&&m==="middle")&&p!=="center"&&be(t[p]))return Ft(Ft({},t),{},pu({},p,t[p]+(c||0)));if((v==="horizontal"||v==="vertical"&&p==="center")&&m!=="middle"&&be(t[m]))return Ft(Ft({},t),{},pu({},m,t[m]+(f||0)))}return t},GAe=function(t,r,n){return Je(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},ZW=function(t,r,n,i,o){var a=r.props.children,s=Un(a,lh).filter(function(u){return GAe(i,o,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var c=gn(d,n);if(Je(c))return u;var f=Array.isArray(c)?[Jb(c),Qb(c)]:[c,c],p=l.reduce(function(m,v){var g=gn(d,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},KAe=function(t,r,n,i,o){var a=r.map(function(s){return ZW(t,s,n,o,i)}).filter(function(s){return!Je(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},QW=function(t,r,n,i,o){var a=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&ZW(t,l,u,i)||Yd(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 d=0,c=u.length;d=2?vi(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(c){var f=o?o.indexOf(c):c;return{coordinate:i(f)+u,value:c,offset:u}});return d.filter(function(c){return!rh(c.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(c,f){return{coordinate:i(c)+u,value:c,index:f,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(c){return{coordinate:i(c)+u,value:c,offset:u}}):i.domain().map(function(c,f){return{coordinate:i(c)+u,value:o?o[c]:c,index:f,offset:u}})},nw=new WeakMap,im=function(t,r){if(typeof r!="function")return t;nw.has(t)||nw.set(t,new WeakMap);var n=nw.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},qAe=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:zf(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:Sg(),realScaleType:"linear"}:o==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:qd(),realScaleType:"point"}:o==="category"?{scale:zf(),realScaleType:"band"}:{scale:Sg(),realScaleType:"linear"};if(th(i)){var l="scale".concat(Fb(i));return{scale:(TM[l]||qd)(),realScaleType:TM[l]?l:"point"}}return tt(i)?{scale:i}:{scale:qd(),realScaleType:"point"}},IM=1e-4,YAe=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])-IM,a=Math.max(i[0],i[1])+IM,s=t(r[0]),l=t(r[n-1]);(sa||la)&&t.domain([r[0],r[n-1]])}},XAe=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])}},JAe=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)}},eTe={sign:QAe,expand:hme,none:Gu,silhouette:mme,wiggle:vme,positive:JAe},tTe=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),o=eTe[n],a=pme().keys(i).value(function(s,l){return+gn(s,l,0)}).order(D1).offset(o);return a(t)},rTe=function(t,r,n,i,o,a){if(!t)return null;var s=a?r.reverse():r,l={},u=s.reduce(function(c,f){var p,m=(p=f.type)!==null&&p!==void 0&&p.defaultProps?Ft(Ft({},f.type.defaultProps),f.props):f.props,v=m.stackId,g=m.hide;if(g)return c;var b=m[n],y=c[b]||{hasStack:!1,stackGroups:{}};if(Qt(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[nh("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[f]};return Ft(Ft({},c),{},pu({},b,y))},l),d={};return Object.keys(u).reduce(function(c,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 Ft(Ft({},v),{},pu({},g,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:tTe(t,b.items,o)}))},m)}return Ft(Ft({},c),{},pu({},f,p))},d)},nTe=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 d=mAe(u,o,s);return t.domain([Jb(d),Qb(d)]),{niceTicks:d}}if(o&&i==="number"){var c=t.domain(),f=vAe(c,o,s);return{niceTicks:f}}return null};function RM(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&&!Je(i[t.dataKey])){var s=Jv(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[o]?r[o].coordinate+n/2:null}var l=gn(i,Je(a)?t.dataKey:a);return Je(l)?null:t.scale(l)}var $M=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=gn(a,r.dataKey,r.domain[s]);return Je(l)?null:r.scale(l)-o/2+i},iTe=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]},oTe=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ft(Ft({},t.type.defaultProps),t.props):t.props,o=i.stackId;if(Qt(o)){var a=r[o];if(a){var s=a.items.indexOf(t);return s>=0?a.stackedData[s]:null}}return null},aTe=function(t){return t.reduce(function(r,n){return[Jb(n.concat([r[0]]).filter(be)),Qb(n.concat([r[1]]).filter(be))]},[1/0,-1/0])},e6=function(t,r,n){return Object.keys(t).reduce(function(i,o){var a=t[o],s=a.stackedData,l=s.reduce(function(u,d){var c=aTe(d.slice(r,n+1));return[Math.min(u[0],c[0]),Math.max(u[1],c[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})},LM=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,FM=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,lE=function(t,r,n){if(tt(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(LM.test(t[0])){var o=+LM.exec(t[0])[1];i[0]=r[0]-o}else tt(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(FM.test(t[1])){var a=+FM.exec(t[1])[1];i[1]=r[1]+a}else tt(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},_g=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=yT(r,function(c){return c.coordinate}),a=1/0,s=1,l=o.length;sa&&(u=2*Math.PI-u),{radius:s,angle:cTe(u),angleInRadian:u}},pTe=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}},hTe=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},zM=function(t,r){var n=t.x,i=t.y,o=fTe({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 d=pTe(r),c=d.startAngle,f=d.endAngle,p=s,m;if(c<=f){for(;p>f;)p-=360;for(;p=c&&p<=f}else{for(;p>c;)p-=360;for(;p=f&&p<=c}return m?UM(UM({},r),{},{radius:a,angle:hTe(p,r)}):null};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)}var mTe=["offset"];function vTe(e){return xTe(e)||bTe(e)||yTe(e)||gTe()}function gTe(){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 uE(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 uE(e,t)}}function bTe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xTe(e){if(Array.isArray(e))return uE(e)}function uE(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 STe(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 WM(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 Kt(e){for(var t=1;t=0?1:-1,x,E;i==="insideStart"?(x=p+y*a,E=v):i==="insideEnd"?(x=m-y*a,E=!v):i==="end"&&(x=m+y*a,E=v),E=b<=0?E:!E;var S=fr(u,d,g,x),P=fr(u,d,g,x+(E?1:-1)*359),C="M".concat(S.x,",").concat(S.y,` A`).concat(g,",").concat(g,",0,1,").concat(E?0:1,`, `).concat(P.x,",").concat(P.y),A=Je(t.id)?nh("recharts-radial-line-"):t.id;return M.createElement("text",ep({},n,{dominantBaseline:"central",className:at("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,d=o.startAngle,c=o.endAngle,f=(d+c)/2;if(i==="outside"){var p=fr(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=fr(a,s,g,f),y=b.x,x=b.y;return{x:y,y:x,textAnchor:"middle",verticalAnchor:"middle"}},jTe=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,d=a.height,c=d>=0?1:-1,f=c*i,p=c>0?"end":"start",m=c>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-c*i,textAnchor:"middle",verticalAnchor:p};return Kt(Kt({},x),n?{height:Math.max(l-n.y,0),width:u}:{})}if(o==="bottom"){var E={x:s+u/2,y:l+d+f,textAnchor:"middle",verticalAnchor:m};return Kt(Kt({},E),n?{height:Math.max(n.y+n.height-(l+d),0),width:u}:{})}if(o==="left"){var S={x:s-g,y:l+d/2,textAnchor:b,verticalAnchor:"middle"};return Kt(Kt({},S),n?{width:Math.max(S.x-n.x,0),height:d}:{})}if(o==="right"){var P={x:s+u+g,y:l+d/2,textAnchor:y,verticalAnchor:"middle"};return Kt(Kt({},P),n?{width:Math.max(n.x+n.width-P.x,0),height:d}:{})}var C=n?{width:u,height:d}:{};return o==="insideLeft"?Kt({x:s+g,y:l+d/2,textAnchor:y,verticalAnchor:"middle"},C):o==="insideRight"?Kt({x:s+u-g,y:l+d/2,textAnchor:b,verticalAnchor:"middle"},C):o==="insideTop"?Kt({x:s+u/2,y:l+f,textAnchor:"middle",verticalAnchor:m},C):o==="insideBottom"?Kt({x:s+u/2,y:l+d-f,textAnchor:"middle",verticalAnchor:p},C):o==="insideTopLeft"?Kt({x:s+g,y:l+f,textAnchor:y,verticalAnchor:m},C):o==="insideTopRight"?Kt({x:s+u-g,y:l+f,textAnchor:b,verticalAnchor:m},C):o==="insideBottomLeft"?Kt({x:s+g,y:l+d-f,textAnchor:y,verticalAnchor:p},C):o==="insideBottomRight"?Kt({x:s+u-g,y:l+d-f,textAnchor:b,verticalAnchor:p},C):Oc(o)&&(be(o.x)||As(o.x))&&(be(o.y)||As(o.y))?Kt({x:s+nl(o.x,u),y:l+nl(o.y,d),textAnchor:"end",verticalAnchor:"end"},C):Kt({x:s+u/2,y:l+d/2,textAnchor:"middle",verticalAnchor:"middle"},C)},NTe=function(t){return"cx"in t&&be(t.cx)};function Sr(e){var t=e.offset,r=t===void 0?5:t,n=wTe(e,mTe),i=Kt({offset:r},n),o=i.viewBox,a=i.position,s=i.value,l=i.children,u=i.content,d=i.className,c=d===void 0?"":d,f=i.textBreakAll;if(!o||Je(s)&&Je(l)&&!w.isValidElement(u)&&!tt(u))return null;if(w.isValidElement(u))return w.cloneElement(u,i);var p;if(tt(u)){if(p=w.createElement(u,i),w.isValidElement(p))return p}else p=ATe(i);var m=NTe(o),v=rt(i,!0);if(m&&(a==="insideStart"||a==="insideEnd"||a==="end"))return OTe(i,p,v);var g=m?_Te(i):jTe(i);return M.createElement(mg,ep({className:at("recharts-label",c)},v,g,{breakAll:f}),p)}Sr.displayName="Label";var r6=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,d=t.outerRadius,c=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(c)&&be(f))return{x:c,y:f,width:v,height:g};if(be(p)&&be(m))return{x:p,y:m,width:v,height:g}}return be(c)&&be(f)?{x:c,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:d||l||s||0,clockWise:b}:t.viewBox?t.viewBox:{}},DTe=function(t,r){return t?t===!0?M.createElement(Sr,{key:"label-implicit",viewBox:r}):Qt(t)?M.createElement(Sr,{key:"label-implicit",viewBox:r,value:t}):w.isValidElement(t)?t.type===Sr?w.cloneElement(t,{key:"label-implicit",viewBox:r}):M.createElement(Sr,{key:"label-implicit",content:t,viewBox:r}):tt(t)?M.createElement(Sr,{key:"label-implicit",content:t,viewBox:r}):Oc(t)?M.createElement(Sr,ep({viewBox:r},t,{key:"label-implicit"})):null:null},kTe=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=r6(t),a=Un(i,Sr).map(function(l,u){return w.cloneElement(l,{viewBox:r||o,key:"label-".concat(u)})});if(!n)return a;var s=DTe(t.label,r||o);return[s].concat(vTe(a))};Sr.parseViewBox=r6;Sr.renderCallByParent=kTe;function MTe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var ITe=MTe;const RTe=ut(ITe);function tp(e){"@babel/helpers - typeof";return tp=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},tp(e)}var $Te=["valueAccessor"],LTe=["data","dataKey","clockWise","id","textBreakAll"];function FTe(e){return zTe(e)||UTe(e)||VTe(e)||BTe()}function BTe(){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 VTe(e,t){if(e){if(typeof e=="string")return cE(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 cE(e,t)}}function UTe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zTe(e){if(Array.isArray(e))return cE(e)}function cE(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 KTe(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 qTe=function(t){return Array.isArray(t.value)?RTe(t.value):t.value};function Ma(e){var t=e.valueAccessor,r=t===void 0?qTe:t,n=KM(e,$Te),i=n.data,o=n.dataKey,a=n.clockWise,s=n.id,l=n.textBreakAll,u=KM(n,LTe);return!i||!i.length?null:M.createElement(Ut,{className:"recharts-label-list"},i.map(function(d,c){var f=Je(o)?r(d,c):gn(d&&d.payload,o),p=Je(s)?{}:{id:"".concat(s,"-").concat(c)};return M.createElement(Sr,Ng({},rt(d,!0),u,p,{parentViewBox:d.parentViewBox,value:f,textBreakAll:l,viewBox:Sr.parseViewBox(Je(a)?d:GM(GM({},d),{},{clockWise:a})),key:"label-".concat(c),index:c}))}))}Ma.displayName="LabelList";function YTe(e,t){return e?e===!0?M.createElement(Ma,{key:"labelList-implicit",data:t}):M.isValidElement(e)||tt(e)?M.createElement(Ma,{key:"labelList-implicit",data:t,content:e}):Oc(e)?M.createElement(Ma,Ng({data:t},e,{key:"labelList-implicit"})):null:null}function XTe(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=Un(n,Ma).map(function(a,s){return w.cloneElement(a,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var o=YTe(e.label,t);return[o].concat(FTe(i))}Ma.renderCallByParent=XTe;function rp(e){"@babel/helpers - typeof";return rp=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},rp(e)}function dE(){return dE=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(a>u),`, `).concat(c.x,",").concat(c.y,` `);if(i>0){var p=fr(r,n,i,a),m=fr(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},tOe=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,d=t.endAngle,c=vi(d-u),f=om({cx:r,cy:n,radius:o,angle:u,sign:c,cornerRadius:a,cornerIsExternal:l}),p=f.circleTangency,m=f.lineTangency,v=f.theta,g=om({cx:r,cy:n,radius:o,angle:d,sign:-c,cornerRadius:a,cornerIsExternal:l}),b=g.circleTangency,y=g.lineTangency,x=g.theta,E=l?Math.abs(u-d):Math.abs(u-d)-v-x;if(E<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 `):n6({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:u,endAngle:d});var S="M ".concat(m.x,",").concat(m.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(c<0),",").concat(p.x,",").concat(p.y,` A`).concat(o,",").concat(o,",0,").concat(+(E>180),",").concat(+(c<0),",").concat(b.x,",").concat(b.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(c<0),",").concat(y.x,",").concat(y.y,` `);if(i>0){var P=om({cx:r,cy:n,radius:i,angle:u,sign:c,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),C=P.circleTangency,A=P.lineTangency,T=P.theta,D=om({cx:r,cy:n,radius:i,angle:d,sign:-c,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),N=D.circleTangency,_=D.lineTangency,F=D.theta,k=l?Math.abs(u-d):Math.abs(u-d)-T-F;if(k<0&&a===0)return"".concat(S,"L").concat(r,",").concat(n,"Z");S+="L".concat(_.x,",").concat(_.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(c<0),",").concat(N.x,",").concat(N.y,` A`).concat(i,",").concat(i,",0,").concat(+(k>180),",").concat(+(c>0),",").concat(C.x,",").concat(C.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(c<0),",").concat(A.x,",").concat(A.y,"Z")}else S+="L".concat(r,",").concat(n,"Z");return S},rOe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},i6=function(t){var r=YM(YM({},rOe),t),n=r.cx,i=r.cy,o=r.innerRadius,a=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,c=r.endAngle,f=r.className;if(a0&&Math.abs(d-c)<360?g=tOe({cx:n,cy:i,innerRadius:o,outerRadius:a,cornerRadius:Math.min(v,m/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:c}):g=n6({cx:n,cy:i,innerRadius:o,outerRadius:a,startAngle:d,endAngle:c}),M.createElement("path",dE({},rt(r,!0),{className:p,d:g,role:"img"}))};function np(e){"@babel/helpers - typeof";return np=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},np(e)}function fE(){return fE=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 fOe(e,t){return Fc(e.getTime(),t.getTime())}function nI(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,d=0;(s=l.next())&&!s.done;){var c=a.value,f=c[0],p=c[1],m=s.value,v=m[0],g=m[1];!u&&!n[d]&&(u=r.equals(f,v,o,d,e,t,r)&&r.equals(p,g,f,v,e,t,r))&&(n[d]=!0),d++}if(!u)return!1;o++}return!0}function pOe(e,t,r){var n=rI(e),i=n.length;if(rI(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===a6&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!o6(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function fd(e,t,r){var n=eI(e),i=n.length;if(eI(t).length!==i)return!1;for(var o,a,s;i-- >0;)if(o=n[i],o===a6&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!o6(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=tI(e,o),s=tI(t,o),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function hOe(e,t){return Fc(e.valueOf(),t.valueOf())}function mOe(e,t){return e.source===t.source&&e.flags===t.flags}function iI(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 vOe(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 gOe="[object Arguments]",yOe="[object Boolean]",bOe="[object Date]",xOe="[object Map]",wOe="[object Number]",SOe="[object Object]",EOe="[object RegExp]",POe="[object Set]",COe="[object String]",AOe=Array.isArray,oI=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,aI=Object.assign,TOe=Object.prototype.toString.call.bind(Object.prototype.toString);function OOe(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(d,c,f){if(d===c)return!0;if(d==null||c==null||typeof d!="object"||typeof c!="object")return d!==d&&c!==c;var p=d.constructor;if(p!==c.constructor)return!1;if(p===Object)return i(d,c,f);if(AOe(d))return t(d,c,f);if(oI!=null&&oI(d))return l(d,c,f);if(p===Date)return r(d,c,f);if(p===RegExp)return a(d,c,f);if(p===Map)return n(d,c,f);if(p===Set)return s(d,c,f);var m=TOe(d);return m===bOe?r(d,c,f):m===EOe?a(d,c,f):m===xOe?n(d,c,f):m===POe?s(d,c,f):m===SOe?typeof d.then!="function"&&typeof c.then!="function"&&i(d,c,f):m===gOe?i(d,c,f):m===yOe||m===wOe||m===COe?o(d,c,f):!1}}function _Oe(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?fd:dOe,areDatesEqual:fOe,areMapsEqual:n?JM(nI,fd):nI,areObjectsEqual:n?fd:pOe,arePrimitiveWrappersEqual:hOe,areRegExpsEqual:mOe,areSetsEqual:n?JM(iI,fd):iI,areTypedArraysEqual:n?fd:vOe};if(r&&(i=aI({},i,r(i))),t){var o=sm(i.areArraysEqual),a=sm(i.areMapsEqual),s=sm(i.areObjectsEqual),l=sm(i.areSetsEqual);i=aI({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return i}function jOe(e){return function(t,r,n,i,o,a,s){return e(t,r,s)}}function NOe(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(l,u){var d=n(),c=d.cache,f=c===void 0?t?new WeakMap:void 0:c,p=d.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 DOe=os();os({strict:!0});os({circular:!0});os({circular:!0,strict:!0});os({createInternalComparator:function(){return Fc}});os({strict:!0,createInternalComparator:function(){return Fc}});os({circular:!0,createInternalComparator:function(){return Fc}});os({circular:!0,createInternalComparator:function(){return Fc},strict:!0});function os(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=OOe(s),u=n?n(l):jOe(l);return NOe({circular:r,comparator:l,createState:i,equals:u,strict:a})}function kOe(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function sI(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):kOe(i)};requestAnimationFrame(n)}function hE(e){"@babel/helpers - typeof";return hE=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},hE(e)}function MOe(e){return LOe(e)||$Oe(e)||ROe(e)||IOe()}function IOe(){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 ROe(e,t){if(e){if(typeof e=="string")return lI(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 lI(e,t)}}function lI(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,E=0;E<8;++E){var S=c(x)-y,P=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(d,c,f){var p=-(d-c)*n,m=f*o,v=f+(p-m)*s/1e3,g=f*s/1e3+d;return Math.abs(g-c)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 m_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 iw(e){return b_e(e)||y_e(e)||g_e(e)||v_e()}function v_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 g_e(e,t){if(e){if(typeof e=="string")return bE(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 bE(e,t)}}function y_e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function b_e(e){if(Array.isArray(e))return bE(e)}function bE(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 Mg(e){return Mg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mg(e)}var Bo=function(e){P_e(r,e);var t=C_e(r);function r(n,i){var o;x_e(this,r),o=t.call(this,n,i);var a=o.props,s=a.isActive,l=a.attributeName,u=a.from,d=a.to,c=a.steps,f=a.children,p=a.duration;if(o.handleStyleChange=o.handleStyleChange.bind(SE(o)),o.changeStyle=o.changeStyle.bind(SE(o)),!s||p<=0)return o.state={style:{}},typeof f=="function"&&(o.state={style:d}),wE(o);if(c&&c.length)o.state={style:c[0].style};else if(u){if(typeof f=="function")return o.state={style:u},wE(o);o.state={style:l?Td({},l,u):u}}else o.state={style:{}};return o}return S_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,d=o.to,c=o.from,f=this.state.style;if(s){if(!a){var p={style:l?Td({},l,d):d};this.state&&f&&(l&&f[l]!==d||!l&&f!==d)&&this.setState(p);return}if(!(DOe(i.to,d)&&i.canBegin&&i.isActive)){var m=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var v=m||u?c:i.to;if(this.state&&f){var g={style:l?Td({},l,v):v};(l&&f[l]!==v||!l&&f!==v)&&this.setState(g)}this.runAnimation(Zn(Zn({},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,d=i.begin,c=i.onAnimationEnd,f=i.onAnimationStart,p=f_e(a,s,t_e(u),l,this.changeStyle),m=function(){o.stopJSAnimation=p()};this.manager.start([f,d,m,l,c])}},{key:"runStepAnimation",value:function(i){var o=this,a=i.steps,s=i.begin,l=i.onAnimationStart,u=a[0],d=u.style,c=u.duration,f=c===void 0?0:c,p=function(v,g,b){if(b===0)return v;var y=g.duration,x=g.easing,E=x===void 0?"ease":x,S=g.style,P=g.properties,C=g.onAnimationEnd,A=b>0?a[b-1]:g,T=P||Object.keys(S);if(typeof E=="function"||E==="spring")return[].concat(iw(v),[o.runJSAnimation.bind(o,{from:A.style,to:S,duration:y,easing:E}),y]);var D=dI(T,y,E),N=Zn(Zn(Zn({},A.style),S),{},{transition:D});return[].concat(iw(v),[N,y,C]).filter(zOe)};return this.manager.start([l].concat(iw(a.reduce(p,[d,Math.max(f,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=FOe());var o=i.begin,a=i.duration,s=i.attributeName,l=i.to,u=i.easing,d=i.onAnimationStart,c=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?Td({},s,l):l,g=dI(Object.keys(v),a,u);m.start([d,o,Zn(Zn({},v),{},{transition:g}),a,c])}},{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=h_e(i,p_e),u=w.Children.count(o),d=this.state.style;if(typeof o=="function")return o(d);if(!s||u===0||a<=0)return o;var c=function(p){var m=p.props,v=m.style,g=v===void 0?{}:v,b=m.className,y=w.cloneElement(p,Zn(Zn({},l),{},{style:Zn(Zn({},g),d),className:b}));return y};return u===1?c(w.Children.only(o)):M.createElement("div",null,w.Children.map(o,function(f){return c(f)}))}}]),r}(w.PureComponent);Bo.displayName="Animate";Bo.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Bo.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 ap(e){"@babel/helpers - typeof";return ap=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},ap(e)}function Ig(){return Ig=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,d;if(a>0&&o instanceof Array){for(var c=[0,0,0,0],f=0,p=4;fa?a:o[f];d="M".concat(t,",").concat(r+s*c[0]),c[0]>0&&(d+="A ".concat(c[0],",").concat(c[0],",0,0,").concat(u,",").concat(t+l*c[0],",").concat(r)),d+="L ".concat(t+n-l*c[1],",").concat(r),c[1]>0&&(d+="A ".concat(c[1],",").concat(c[1],",0,0,").concat(u,`, `).concat(t+n,",").concat(r+s*c[1])),d+="L ".concat(t+n,",").concat(r+i-s*c[2]),c[2]>0&&(d+="A ".concat(c[2],",").concat(c[2],",0,0,").concat(u,`, `).concat(t+n-l*c[2],",").concat(r+i)),d+="L ".concat(t+l*c[3],",").concat(r+i),c[3]>0&&(d+="A ".concat(c[3],",").concat(c[3],",0,0,").concat(u,`, `).concat(t,",").concat(r+i-s*c[3])),d+="Z"}else if(a>0&&o===+o&&o>0){var m=Math.min(a,o);d="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 d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return d},I_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),d=Math.max(o,o+s),c=Math.min(a,a+l),f=Math.max(a,a+l);return n>=u&&n<=d&&i>=c&&i<=f}return!1},R_e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},HT=function(t){var r=bI(bI({},R_e),t),n=w.useRef(),i=w.useState(-1),o=T_e(i,2),a=o[0],s=o[1];w.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var E=n.current.getTotalLength();E&&s(E)}catch{}},[]);var l=r.x,u=r.y,d=r.width,c=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||d!==+d||c!==+c||d===0||c===0)return null;var x=at("recharts-rectangle",p);return y?M.createElement(Bo,{canBegin:a>0,from:{width:d,height:c,x:l,y:u},to:{width:d,height:c,x:l,y:u},duration:v,animationEasing:m,isActive:y},function(E){var S=E.width,P=E.height,C=E.x,A=E.y;return M.createElement(Bo,{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",Ig({},rt(r,!0),{className:x,d:xI(C,A,S,P,f),ref:n})))}):M.createElement("path",Ig({},rt(r,!0),{className:x,d:xI(l,u,d,c,f)}))};function EE(){return EE=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 W_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)},H_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,d=t.width,c=d===void 0?0:d,f=t.height,p=f===void 0?0:f,m=t.className,v=U_e(t,$_e),g=L_e({x:n,y:o,top:s,left:u,width:c,height:p},v);return!be(n)||!be(o)||!be(c)||!be(p)||!be(s)||!be(u)?null:M.createElement("path",PE({},rt(g,!0),{className:at("recharts-cross",m),d:W_e(n,o,c,p,s,u)}))},G_e=jz,K_e=G_e(Object.getPrototypeOf,Object),q_e=K_e,Y_e=Ko,X_e=q_e,Z_e=qo,Q_e="[object Object]",J_e=Function.prototype,eje=Object.prototype,p6=J_e.toString,tje=eje.hasOwnProperty,rje=p6.call(Object);function nje(e){if(!Z_e(e)||Y_e(e)!=Q_e)return!1;var t=X_e(e);if(t===null)return!0;var r=tje.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&p6.call(r)==rje}var ije=nje;const oje=ut(ije);var aje=Ko,sje=qo,lje="[object Boolean]";function uje(e){return e===!0||e===!1||sje(e)&&aje(e)==lje}var cje=uje;const dje=ut(cje);function lp(e){"@babel/helpers - typeof";return lp=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},lp(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);r0,from:{upperWidth:0,lowerWidth:0,height:f,x:l,y:u},to:{upperWidth:d,lowerWidth:c,height:f,x:l,y:u},duration:v,animationEasing:m,isActive:b},function(x){var E=x.upperWidth,S=x.lowerWidth,P=x.height,C=x.x,A=x.y;return M.createElement(Bo,{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",Rg({},rt(r,!0),{className:y,d:CI(C,A,E,S,P),ref:n})))}):M.createElement("g",null,M.createElement("path",Rg({},rt(r,!0),{className:y,d:CI(l,u,d,c,f)})))},Sje=["option","shapeType","propTransformer","activeClassName","isActive"];function up(e){"@babel/helpers - typeof";return up=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},up(e)}function Eje(e,t){if(e==null)return{};var r=Pje(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 Pje(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 AI(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 $g(e){for(var t=1;t0&&n.handleDrag(i.changedTouches[0])}),tn(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()}),tn(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),tn(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),tn(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),tn(n,"handleSlideDragStart",function(i){var o=kI(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 uNe(t,e),oNe(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,d=u.length-1,c=Math.min(i,o),f=Math.max(i,o),p=t.getIndexInRange(a,c),m=t.getIndexInRange(a,f);return{startIndex:p-p%l,endIndex:m===d?d:m-m%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,o=i.data,a=i.tickFormatter,s=i.dataKey,l=gn(o[n],s,n);return tt(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,d=l.width,c=l.travellerWidth,f=l.startIndex,p=l.endIndex,m=l.onChange,v=n.pageX-o;v>0?v=Math.min(v,u+d-c-s,u+d-c-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=kI(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],d=this.props,c=d.x,f=d.width,p=d.travellerWidth,m=d.onChange,v=d.gap,g=d.data,b={startX:this.state.startX,endX:this.state.endX},y=n.pageX-o;y>0?y=Math.min(y,c+f-p-u):y<0&&(y=Math.max(y,c-u)),b[a]=u+y;var x=this.getIndex(b),E=x.startIndex,S=x.endIndex,P=function(){var A=g.length-1;return a==="startX"&&(s>l?E%v===0:S%v===0)||sl?S%v===0:E%v===0)||s>l&&S===A};this.setState(tn(tn({},a,u+y),"brushMoveStartX",n.pageX),function(){m&&P()&&m(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var o=this,a=this.state,s=a.scaleValues,l=a.startX,u=a.endX,d=this.state[i],c=s.indexOf(d);if(c!==-1){var f=c+n;if(!(f===-1||f>=s.length)){var p=s[f];i==="startX"&&p>=u||i==="endX"&&p<=l||this.setState(tn({},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,d=n.padding,c=w.Children.only(u);return c?M.cloneElement(c,{x:i,y:o,width:a,height:s,margin:d,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var o,a,s=this,l=this.props,u=l.y,d=l.travellerWidth,c=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=aw(aw({},rt(this.props,!1)),{},{x:b,y:u,width:d,height:c}),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(Ut,{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,d=Math.min(n,i)+u,c=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:d,y:a,width:c,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,d=this.state,c=d.startX,f=d.endX,p=5,m={pointerEvents:"none",fill:u};return M.createElement(Ut,{className:"recharts-brush-texts"},M.createElement(mg,Fg({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,f)-p,y:a+s/2},m),this.getTextOfTick(i)),M.createElement(mg,Fg({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,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,d=n.height,c=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(d)||u<=0||d<=0)return null;var x=at("recharts-brush",o),E=M.Children.count(a)===1,S=nNe("userSelect","none");return M.createElement(Ut,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:S},this.renderBackground(),E&&this.renderPanorama(),this.renderSlide(p,m),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(m,"endX"),(v||g||b||y||c)&&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):tt(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,d=n.startIndex,c=n.endIndex;if(o!==i.prevData||u!==i.prevUpdateId)return aw({prevData:o,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:a},o&&o.length?dNe({data:o,width:a,x:s,travellerWidth:l,startIndex:d,endIndex:c}):{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);tn(nc,"displayName","Brush");tn(nc,"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 fNe=gT;function pNe(e,t){var r;return fNe(e,function(n,i,o){return r=t(n,i,o),!r}),!!r}var hNe=pNe,mNe=Sz,vNe=Ic,gNe=hNe,yNe=Jr,bNe=Hb;function xNe(e,t,r){var n=yNe(e)?mNe:gNe;return r&&bNe(e,t,r)&&(t=void 0),n(e,vNe(t))}var wNe=xNe;const SNe=ut(wNe);var qi=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},MI=zz;function ENe(e,t,r){t=="__proto__"&&MI?MI(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var PNe=ENe,CNe=PNe,ANe=Vz,TNe=Ic;function ONe(e,t){var r={};return t=TNe(t),ANe(e,function(n,i,o){CNe(r,i,t(n,i,o))}),r}var _Ne=ONe;const jNe=ut(_Ne);function NNe(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 YNe(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 XNe(e,t){var r=e.x,n=e.y,i=qNe(e,WNe),o="".concat(r),a=parseInt(o,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),d=parseInt(u,10),c="".concat(t.width||i.width),f=parseInt(c,10);return pd(pd(pd(pd(pd({},t),i),a?{x:a}:{}),l?{y:l}:{}),{},{height:d,width:f,name:t.name,radius:t.radius})}function RI(e){return M.createElement(Nje,AE({shapeType:"rectangle",propTransformer:XNe,activeClassName:"recharts-active-bar"},e))}var ZNe=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||$a(),r)}},QNe=["value","background"],g6;function ic(e){"@babel/helpers - typeof";return ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ic(e)}function JNe(e,t){if(e==null)return{};var r=eDe(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 eDe(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 Vg(){return Vg=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(B)0&&Math.abs(k)0&&(F=Math.min((re||0)-(k[ce-1]||0),F))}),Number.isFinite(F)){var B=F/_,V=v.layout==="vertical"?n.height:n.width;if(v.padding==="gap"&&(C=B*V/2),v.padding==="no-gap"){var z=nl(t.barCategoryGap,B*V),I=B*V/2;C=I-z-(I-z)/V*z}}}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 $=qAe(v,o,f),j=$.scale,O=$.realScaleType;j.domain(b).range(A),YAe(j);var U=nTe(j,ni(ni({},v),{},{realScaleType:O}));i==="xAxis"?(N=g==="top"&&!E||g==="bottom"&&E,T=n.left,D=c[P]-N*v.height):i==="yAxis"&&(N=g==="left"&&!E||g==="right"&&E,T=c[P]-N*v.width,D=n.top);var Y=ni(ni(ni({},v),U),{},{realScaleType:O,x:T,y:D,scale:j,width:i==="xAxis"?n.width:v.width,height:i==="yAxis"?n.height:v.height});return Y.bandSize=_g(Y,U),!v.hide&&i==="xAxis"?c[P]+=(N?-1:1)*Y.height:v.hide||(c[P]+=(N?-1:1)*Y.width),ni(ni({},p),{},ox({},m,Y))},{})},w6=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)}},fDe=function(t){var r=t.x1,n=t.y1,i=t.x2,o=t.y2;return w6({x:r,y:n},{x:i,y:o})},S6=function(){function e(t){lDe(this,e),this.scale=t}return uDe(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)}}])}();ox(S6,"EPS",1e-4);var KT=function(t){var r=Object.keys(t).reduce(function(n,i){return ni(ni({},n),{},ox({},i,S6.create(t[i])))},{});return ni(ni({},r),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=o.bandAware,s=o.position;return jNe(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 pDe(e){return(e%180+180)%180}var hDe=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=pDe(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 tke(e,t){return F6(e,t+1)}function rke(e,t,r,n,i){for(var o=(n||[]).slice(),a=t.start,s=t.end,l=0,u=1,d=a,c=function(){var m=n==null?void 0:n[l];if(m===void 0)return{v:F6(n,u)};var v=l,g,b=function(){return g===void 0&&(g=r(m,v)),g},y=m.coordinate,x=l===0||Gg(e,y,b,d,s);x||(l=0,d=a,u+=1),x&&(d=y+e*(b()/2+i),l+=u)},f;u<=o.length;)if(f=c(),f)return f.v;return[]}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 YI(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 xr(e){for(var t=1;t0?p.coordinate-g*e:p.coordinate})}else o[f]=p=xr(xr({},p),{},{tickCoord:p.coordinate});var b=Gg(e,p.tickCoord,v,s,l);b&&(l=p.tickCoord-e*(v()/2+i),o[f]=xr(xr({},p),{},{isShow:!0}))},d=a-1;d>=0;d--)u(d);return o}function ske(e,t,r,n,i,o){var a=(n||[]).slice(),s=a.length,l=t.start,u=t.end;if(o){var d=n[s-1],c=r(d,s-1),f=e*(d.coordinate+e*c/2-u);a[s-1]=d=xr(xr({},d),{},{tickCoord:f>0?d.coordinate-f*e:d.coordinate});var p=Gg(e,d.tickCoord,function(){return c},l,u);p&&(u=d.tickCoord-e*(c/2+i),a[s-1]=xr(xr({},d),{},{isShow:!0}))}for(var m=o?s-1:s,v=function(y){var x=a[y],E,S=function(){return E===void 0&&(E=r(x,y)),E};if(y===0){var P=e*(x.coordinate-e*S()/2-l);a[y]=x=xr(xr({},x),{},{tickCoord:P<0?x.coordinate-P*e:x.coordinate})}else a[y]=x=xr(xr({},x),{},{tickCoord:x.coordinate});var C=Gg(e,x.tickCoord,S,l,u);C&&(l=x.tickCoord+e*(S()/2+i),a[y]=xr(xr({},x),{},{isShow:!0}))},g=0;g=2?vi(i[1].coordinate-i[0].coordinate):1,b=eke(o,g,p);return l==="equidistantPreserveStart"?rke(g,b,v,i,a):(l==="preserveStart"||l==="preserveStartEnd"?f=ske(g,b,v,i,a,l==="preserveStartEnd"):f=ake(g,b,v,i,a),f.filter(function(y){return y.isShow}))}var uke=["viewBox"],cke=["viewBox"],dke=["ticks"];function lc(e){"@babel/helpers - typeof";return lc=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},lc(e)}function Gl(){return Gl=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 fke(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 pke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZI(e,t){for(var r=0;r0?l(this.props):l(p)),a<=0||s<=0||!m||!m.length?null:M.createElement(Ut,{className:at("recharts-cartesian-axis",u),ref:function(g){n.layerReference=g}},o&&this.renderAxisLine(),this.renderTicks(m,this.state.fontSize,this.state.letterSpacing),Sr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,o){var a;return M.isValidElement(n)?a=M.cloneElement(n,i):tt(n)?a=n(i):a=M.createElement(mg,Gl({},i,{className:"recharts-cartesian-axis-tick-value"}),o),a}}])}(w.Component);YT(cx,"displayName","CartesianAxis");YT(cx,"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 xke=["type","layout","connectNulls","ref"],wke=["key"];function uc(e){"@babel/helpers - typeof";return uc=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},uc(e)}function QI(e,t){if(e==null)return{};var r=Ske(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 Ske(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 Zd(){return Zd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rc){p=[].concat(Cl(l.slice(0,m)),[c-v]);break}var g=p.length%2===0?[0,f]:[f];return[].concat(Cl(t.repeat(l,d)),Cl(p),g).map(function(b){return"".concat(b,"px")}).join(", ")}),ii(r,"id",nh("recharts-line-")),ii(r,"pathRef",function(a){r.mainCurve=a}),ii(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),ii(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Dke(t,e),Oke(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,d=o.children,c=Un(d,lh);if(!c)return null;var f=function(v,g){return{x:v.x,y:v.y,value:v.value,errorVal:gn(v.payload,g)}},p={clipPath:n?"url(#clipPath-".concat(i,")"):null};return M.createElement(Ut,p,c.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,d=s.dataKey,c=rt(this.props,!1),f=rt(l,!0),p=u.map(function(v,g){var b=en(en(en({key:"dot-".concat(g),r:3},c),f),{},{value:v.value,dataKey:d,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(Ut,Zd({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,d=s.connectNulls;s.ref;var c=QI(s,xke),f=en(en(en({},rt(c,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:n},a),{},{type:l,layout:u,connectNulls:d});return M.createElement(pE,Zd({},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,d=a.animationBegin,c=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(Bo,{begin:d,duration:c,isActive:u,easing:f,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(E){var S=E.t;if(y){var P=y.length/s.length,C=s.map(function(_,F){var k=Math.floor(F*P);if(y[k]){var B=y[k],V=si(B.x,_.x),z=si(B.y,_.y);return en(en({},_),{},{x:V(S),y:z(S)})}if(m){var I=si(v*2,_.x),$=si(g/2,_.y);return en(en({},_),{},{x:I(S),y:$(S)})}return en(en({},_),{},{x:_.x,y:_.y})});return o.renderCurveStatically(C,n,i)}var A=si(0,x),T=A(S),D;if(l){var N="".concat(l).split(/[,\s]+/gim).map(function(_){return parseFloat(_)});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,d=l.totalLength;return s&&a&&a.length&&(!u&&d>0||!ex(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,d=i.yAxis,c=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=at("recharts-line",l),E=u&&u.allowDataOverflow,S=d&&d.allowDataOverflow,P=E||S,C=Je(g)?this.id:g,A=(n=rt(a,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},T=A.r,D=T===void 0?3:T,N=A.strokeWidth,_=N===void 0?2:N,F=Lpe(a)?a:{},k=F.clipDot,B=k===void 0?!0:k,V=D*2+_;return M.createElement(Ut,{className:x},E||S?M.createElement("defs",null,M.createElement("clipPath",{id:"clipPath-".concat(C)},M.createElement("rect",{x:E?f:f-p/2,y:S?c:c-m/2,width:E?p:p*2,height:S?m:m*2})),!B&&M.createElement("clipPath",{id:"clipPath-dots-".concat(C)},M.createElement("rect",{x:f-V/2,y:c-V/2,width:p+V,height:m+V}))):null,!y&&this.renderCurve(P,C),this.renderErrorBar(P,C),(y||a)&&this.renderDots(P,B,C),(!v||b)&&Ma.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(Cl(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 wMe(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 SMe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EMe(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 n8(e){return e==="number"?[0,"auto"]:void 0}var HE=function(t,r,n,i){var o=t.graphicalItems,a=t.tooltipAxis,s=px(r,t);return n<0||!o||!o.length||n>=s.length?null:o.reduce(function(l,u){var d,c=(d=u.props.data)!==null&&d!==void 0?d:r;c&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(c=c.slice(t.dataStartIndex,t.dataEndIndex+1));var f;if(a.dataKey&&!a.allowDuplicatedCategory){var p=c===void 0?s:c;f=Jv(p,a.dataKey,i)}else f=c&&c[n]||s[n];return f?[].concat(pc(l),[t6(u,f)]):l},[])},aR=function(t,r,n,i){var o=i||{x:t.chartX,y:t.chartY},a=IMe(o,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,d=UAe(a,s,u,l);if(d>=0&&u){var c=u[d]&&u[d].value,f=HE(t,r,d,c),p=RMe(n,s,d,o);return{activeTooltipIndex:d,activeLabel:c,activePayload:f,activeCoordinate:p}}return null},$Me=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,d=t.layout,c=t.children,f=t.stackOffset,p=JW(d,o);return n.reduce(function(m,v){var g,b=v.type.defaultProps!==void 0?X(X({},v.type.defaultProps),v.props):v.props,y=b.type,x=b.dataKey,E=b.allowDataOverflow,S=b.allowDuplicatedCategory,P=b.scale,C=b.ticks,A=b.includeHidden,T=b[a];if(m[T])return m;var D=px(t.data,{graphicalItems:i.filter(function(U){var Y,re=a in U.props?U.props[a]:(Y=U.type.defaultProps)===null||Y===void 0?void 0:Y[a];return re===T}),dataStartIndex:l,dataEndIndex:u}),N=D.length,_,F,k;uMe(b.domain,E,y)&&(_=lE(b.domain,null,E),p&&(y==="number"||P!=="auto")&&(k=Yd(D,x,"category")));var B=n8(y);if(!_||_.length===0){var V,z=(V=b.domain)!==null&&V!==void 0?V:B;if(x){if(_=Yd(D,x,y),y==="category"&&p){var I=_pe(_);S&&I?(F=_,_=Lg(0,N)):S||(_=BM(z,_,v).reduce(function(U,Y){return U.indexOf(Y)>=0?U:[].concat(pc(U),[Y])},[]))}else if(y==="category")S?_=_.filter(function(U){return U!==""&&!Je(U)}):_=BM(z,_,v).reduce(function(U,Y){return U.indexOf(Y)>=0||Y===""||Je(Y)?U:[].concat(pc(U),[Y])},[]);else if(y==="number"){var $=KAe(D,i.filter(function(U){var Y,re,ce=a in U.props?U.props[a]:(Y=U.type.defaultProps)===null||Y===void 0?void 0:Y[a],de="hide"in U.props?U.props.hide:(re=U.type.defaultProps)===null||re===void 0?void 0:re.hide;return ce===T&&(A||!de)}),x,o,d);$&&(_=$)}p&&(y==="number"||P!=="auto")&&(k=Yd(D,x,"category"))}else p?_=Lg(0,N):s&&s[T]&&s[T].hasStack&&y==="number"?_=f==="expand"?[0,1]:e6(s[T].stackGroups,l,u):_=QW(D,i.filter(function(U){var Y=a in U.props?U.props[a]:U.type.defaultProps[a],re="hide"in U.props?U.props.hide:U.type.defaultProps.hide;return Y===T&&(A||!re)}),y,d,!0);if(y==="number")_=UE(c,_,T,o,C),z&&(_=lE(z,_,E));else if(y==="category"&&z){var j=z,O=_.every(function(U){return j.indexOf(U)>=0});O&&(_=j)}}return X(X({},m),{},Ie({},T,X(X({},b),{},{axisType:o,domain:_,categoricalDomain:k,duplicateDomain:F,originalDomain:(g=b.domain)!==null&&g!==void 0?g:B,isCategorical:p,layout:d})))},{})},LMe=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,d=t.layout,c=t.children,f=px(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),p=f.length,m=JW(d,o),v=-1;return n.reduce(function(g,b){var y=b.type.defaultProps!==void 0?X(X({},b.type.defaultProps),b.props):b.props,x=y[a],E=n8("number");if(!g[x]){v++;var S;return m?S=Lg(0,p):s&&s[x]&&s[x].hasStack?(S=e6(s[x].stackGroups,l,u),S=UE(c,S,x,o)):(S=lE(E,QW(f,n.filter(function(P){var C,A,T=a in P.props?P.props[a]:(C=P.type.defaultProps)===null||C===void 0?void 0:C[a],D="hide"in P.props?P.props.hide:(A=P.type.defaultProps)===null||A===void 0?void 0:A.hide;return T===x&&!D}),"number",d),i.defaultProps.allowDataOverflow),S=UE(c,S,x,o)),X(X({},g),{},Ie({},x,X(X({axisType:o},i.defaultProps),{},{hide:!0,orientation:Vn(kMe,"".concat(o,".").concat(v%2),null),domain:S,originalDomain:E,isCategorical:m,layout:d})))}return g},{})},FMe=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,d=t.children,c="".concat(i,"Id"),f=Un(d,o),p={};return f&&f.length?p=$Me(t,{axes:f,graphicalItems:a,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):a&&a.length&&(p=LMe(t,{Axis:o,graphicalItems:a,axisType:i,axisIdKey:c,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),p},BMe=function(t){var r=Tl(t),n=_s(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:yT(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:_g(r,n)}},sR=function(t){var r=t.children,n=t.defaultShowTooltip,i=on(r,nc),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}},VMe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Eo(r&&r.type);return n&&n.indexOf("Bar")>=0})},lR=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"}},UMe=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,d=n.height,c=n.children,f=n.margin||{},p=on(c,nc),m=on(c,du),v=Object.keys(l).reduce(function(S,P){var C=l[P],A=C.orientation;return!C.mirror&&!C.hide?X(X({},S),{},Ie({},A,S[A]+C.width)):S},{left:f.left||0,right:f.right||0}),g=Object.keys(a).reduce(function(S,P){var C=a[P],A=C.orientation;return!C.mirror&&!C.hide?X(X({},S),{},Ie({},A,Vn(S,"".concat(A))+C.height)):S},{top:f.top||0,bottom:f.bottom||0}),b=X(X({},g),v),y=b.bottom;p&&(b.bottom+=p.props.height||nc.defaultProps.height),m&&r&&(b=HAe(b,i,n,r));var x=u-b.left-b.right,E=d-b.top-b.bottom;return X(X({brushBottom:y},b),{},{width:Math.max(x,0),height:Math.max(E,0)})},zMe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},WMe=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,d=t.formatAxisMap,c=t.defaultProps,f=function(b,y){var x=y.graphicalItems,E=y.stackGroups,S=y.offset,P=y.updateId,C=y.dataStartIndex,A=y.dataEndIndex,T=b.barSize,D=b.layout,N=b.barGap,_=b.barCategoryGap,F=b.maxBarSize,k=lR(D),B=k.numericAxisName,V=k.cateAxisName,z=VMe(x),I=[];return x.forEach(function($,j){var O=px(b.data,{graphicalItems:[$],dataStartIndex:C,dataEndIndex:A}),U=$.type.defaultProps!==void 0?X(X({},$.type.defaultProps),$.props):$.props,Y=U.dataKey,re=U.maxBarSize,ce=U["".concat(B,"Id")],de=U["".concat(V,"Id")],Z={},ne=l.reduce(function(pe,le){var ie=y["".concat(le.axisType,"Map")],Oe=U["".concat(le.axisType,"Id")];ie&&ie[Oe]||le.axisType==="zAxis"||$a();var Fe=ie[Oe];return X(X({},pe),{},Ie(Ie({},le.axisType,Fe),"".concat(le.axisType,"Ticks"),_s(Fe)))},Z),K=ne[V],J=ne["".concat(V,"Ticks")],te=E&&E[ce]&&E[ce].hasStack&&oTe($,E[ce].stackGroups),H=Eo($.type).indexOf("Bar")>=0,Ae=_g(K,J),ue=[],$e=z&&zAe({barSize:T,stackGroups:E,totalSize:zMe(ne,V)});if(H){var Ve,qe,R=Je(re)?F:re,W=(Ve=(qe=_g(K,J,!0))!==null&&qe!==void 0?qe:R)!==null&&Ve!==void 0?Ve:0;ue=WAe({barGap:N,barCategoryGap:_,bandSize:W!==Ae?W:Ae,sizeList:$e[de],maxBarSize:R}),W!==Ae&&(ue=ue.map(function(pe){return X(X({},pe),{},{position:X(X({},pe.position),{},{offset:pe.position.offset-W/2})})}))}var G=$&&$.type&&$.type.getComposedData;G&&I.push({props:X(X({},G(X(X({},ne),{},{displayedData:O,props:b,dataKey:Y,item:$,bandSize:Ae,barPosition:ue,offset:S,stackedData:te,layout:D,dataStartIndex:C,dataEndIndex:A}))),{},Ie(Ie(Ie({key:$.key||"item-".concat(j)},B,ne[B]),V,ne[V]),"animationId",P)),childIndex:Vpe($,b.children),item:$})}),I},p=function(b,y){var x=b.props,E=b.dataStartIndex,S=b.dataEndIndex,P=b.updateId;if(!kD({props:x}))return null;var C=x.children,A=x.layout,T=x.stackOffset,D=x.data,N=x.reverseStackOrder,_=lR(A),F=_.numericAxisName,k=_.cateAxisName,B=Un(C,n),V=rTe(D,B,"".concat(F,"Id"),"".concat(k,"Id"),T,N),z=l.reduce(function(U,Y){var re="".concat(Y.axisType,"Map");return X(X({},U),{},Ie({},re,FMe(x,X(X({},Y),{},{graphicalItems:B,stackGroups:Y.axisType===F&&V,dataStartIndex:E,dataEndIndex:S}))))},{}),I=UMe(X(X({},z),{},{props:x,graphicalItems:B}),y==null?void 0:y.legendBBox);Object.keys(z).forEach(function(U){z[U]=d(x,z[U],I,U.replace("Map",""),r)});var $=z["".concat(k,"Map")],j=BMe($),O=f(x,X(X({},z),{},{dataStartIndex:E,dataEndIndex:S,updateId:P,graphicalItems:B,stackGroups:V,offset:I}));return X(X({formattedGraphicalItems:O,graphicalItems:B,offset:I,stackGroups:V},j),z)},m=function(g){function b(y){var x,E,S;return SMe(this,b),S=CMe(this,b,[y]),Ie(S,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ie(S,"accessibilityManager",new lMe),Ie(S,"handleLegendBBoxUpdate",function(P){if(P){var C=S.state,A=C.dataStartIndex,T=C.dataEndIndex,D=C.updateId;S.setState(X({legendBBox:P},p({props:S.props,dataStartIndex:A,dataEndIndex:T,updateId:D},X(X({},S.state),{},{legendBBox:P}))))}}),Ie(S,"handleReceiveSyncEvent",function(P,C,A){if(S.props.syncId===P){if(A===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(C)}}),Ie(S,"handleBrushChange",function(P){var C=P.startIndex,A=P.endIndex;if(C!==S.state.dataStartIndex||A!==S.state.dataEndIndex){var T=S.state.updateId;S.setState(function(){return X({dataStartIndex:C,dataEndIndex:A},p({props:S.props,dataStartIndex:C,dataEndIndex:A,updateId:T},S.state))}),S.triggerSyncEvent({dataStartIndex:C,dataEndIndex:A})}}),Ie(S,"handleMouseEnter",function(P){var C=S.getMouseInfo(P);if(C){var A=X(X({},C),{},{isTooltipActive:!0});S.setState(A),S.triggerSyncEvent(A);var T=S.props.onMouseEnter;tt(T)&&T(A,P)}}),Ie(S,"triggeredAfterMouseMove",function(P){var C=S.getMouseInfo(P),A=C?X(X({},C),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(A),S.triggerSyncEvent(A);var T=S.props.onMouseMove;tt(T)&&T(A,P)}),Ie(S,"handleItemMouseEnter",function(P){S.setState(function(){return{isTooltipActive:!0,activeItem:P,activePayload:P.tooltipPayload,activeCoordinate:P.tooltipPosition||{x:P.cx,y:P.cy}}})}),Ie(S,"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Ie(S,"handleMouseMove",function(P){P.persist(),S.throttleTriggeredAfterMouseMove(P)}),Ie(S,"handleMouseLeave",function(P){S.throttleTriggeredAfterMouseMove.cancel();var C={isTooltipActive:!1};S.setState(C),S.triggerSyncEvent(C);var A=S.props.onMouseLeave;tt(A)&&A(C,P)}),Ie(S,"handleOuterEvent",function(P){var C=Bpe(P),A=Vn(S.props,"".concat(C));if(C&&tt(A)){var T,D;/.*touch.*/i.test(C)?D=S.getMouseInfo(P.changedTouches[0]):D=S.getMouseInfo(P),A((T=D)!==null&&T!==void 0?T:{},P)}}),Ie(S,"handleClick",function(P){var C=S.getMouseInfo(P);if(C){var A=X(X({},C),{},{isTooltipActive:!0});S.setState(A),S.triggerSyncEvent(A);var T=S.props.onClick;tt(T)&&T(A,P)}}),Ie(S,"handleMouseDown",function(P){var C=S.props.onMouseDown;if(tt(C)){var A=S.getMouseInfo(P);C(A,P)}}),Ie(S,"handleMouseUp",function(P){var C=S.props.onMouseUp;if(tt(C)){var A=S.getMouseInfo(P);C(A,P)}}),Ie(S,"handleTouchMove",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(P.changedTouches[0])}),Ie(S,"handleTouchStart",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&S.handleMouseDown(P.changedTouches[0])}),Ie(S,"handleTouchEnd",function(P){P.changedTouches!=null&&P.changedTouches.length>0&&S.handleMouseUp(P.changedTouches[0])}),Ie(S,"triggerSyncEvent",function(P){S.props.syncId!==void 0&&lw.emit(uw,S.props.syncId,P,S.eventEmitterSymbol)}),Ie(S,"applySyncEvent",function(P){var C=S.props,A=C.layout,T=C.syncMethod,D=S.state.updateId,N=P.dataStartIndex,_=P.dataEndIndex;if(P.dataStartIndex!==void 0||P.dataEndIndex!==void 0)S.setState(X({dataStartIndex:N,dataEndIndex:_},p({props:S.props,dataStartIndex:N,dataEndIndex:_,updateId:D},S.state)));else if(P.activeTooltipIndex!==void 0){var F=P.chartX,k=P.chartY,B=P.activeTooltipIndex,V=S.state,z=V.offset,I=V.tooltipTicks;if(!z)return;if(typeof T=="function")B=T(I,P);else if(T==="value"){B=-1;for(var $=0;$=0){var te,H;if(F.dataKey&&!F.allowDuplicatedCategory){var Ae=typeof F.dataKey=="function"?J:"payload.".concat(F.dataKey.toString());te=Jv($,Ae,B),H=j&&O&&Jv(O,Ae,B)}else te=$==null?void 0:$[k],H=j&&O&&O[k];if(de||ce){var ue=P.props.activeIndex!==void 0?P.props.activeIndex:k;return[w.cloneElement(P,X(X(X({},T.props),ne),{},{activeIndex:ue})),null,null]}if(!Je(te))return[K].concat(pc(S.renderActivePoints({item:T,activePoint:te,basePoint:H,childIndex:k,isRange:j})))}else{var $e,Ve=($e=S.getItemByXY(S.state.activeCoordinate))!==null&&$e!==void 0?$e:{graphicalItem:K},qe=Ve.graphicalItem,R=qe.item,W=R===void 0?P:R,G=qe.childIndex,pe=X(X(X({},T.props),ne),{},{activeIndex:G});return[w.cloneElement(W,pe),null,null]}return j?[K,null,null]:[K,null]}),Ie(S,"renderCustomized",function(P,C,A){return w.cloneElement(P,X(X({key:"recharts-customized-".concat(A)},S.props),S.state))}),Ie(S,"renderMap",{CartesianGrid:{handler:um,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:um},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:um},YAxis:{handler:um},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:nh("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=Yz(S.triggeredAfterMouseMove,(E=y.throttleDelay)!==null&&E!==void 0?E:1e3/60),S.state={},S}return OMe(b,g),PMe(b,[{key:"componentDidMount",value:function(){var x,E;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,E=x.children,S=x.data,P=x.height,C=x.layout,A=on(E,ji);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=HE(this.state,S,T,D),_=this.state.tooltipTicks[T].coordinate,F=(this.state.offset.top+P)/2,k=C==="horizontal",B=k?{x:_,y:F}:{y:_,x:F},V=this.state.formattedGraphicalItems.find(function(I){var $=I.item;return $.type.name==="Scatter"});V&&(B=X(X({},B),V.props.points[T].tooltipPosition),N=V.props.points[T].tooltipPayload);var z={activeTooltipIndex:T,isTooltipActive:!0,activeLabel:D,activePayload:N,activeCoordinate:B};this.setState(z),this.renderCursor(A),this.accessibilityManager.setIndex(T)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,E){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==E.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,P;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(P=this.props.margin.top)!==null&&P!==void 0?P:0}})}return null}},{key:"componentDidUpdate",value:function(x){E1([on(x.children,ji)],[on(this.props.children,ji)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=on(this.props.children,ji);if(x&&typeof x.props.shared=="boolean"){var E=x.props.shared?"axis":"item";return s.indexOf(E)>=0?E:o}return o}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var E=this.container,S=E.getBoundingClientRect(),P=m1e(S),C={chartX:Math.round(x.pageX-P.left),chartY:Math.round(x.pageY-P.top)},A=S.width/E.offsetWidth||1,T=this.inRange(C.chartX,C.chartY,A);if(!T)return null;var D=this.state,N=D.xAxisMap,_=D.yAxisMap,F=this.getTooltipEventType();if(F!=="axis"&&N&&_){var k=Tl(N).scale,B=Tl(_).scale,V=k&&k.invert?k.invert(C.chartX):null,z=B&&B.invert?B.invert(C.chartY):null;return X(X({},C),{},{xValue:V,yValue:z})}var I=aR(this.state,this.props.data,this.props.layout,T);return I?X(X({},C),I):null}},{key:"inRange",value:function(x,E){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,P=this.props.layout,C=x/S,A=E/S;if(P==="horizontal"||P==="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,_=N.angleAxisMap,F=N.radiusAxisMap;if(_&&F){var k=Tl(_);return zM({x:C,y:A},k)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,E=this.getTooltipEventType(),S=on(x,ji),P={};S&&E==="axis"&&(S.props.trigger==="click"?P={onClick:this.handleClick}:P={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var C=eg(this.props,this.handleOuterEvent);return X(X({},C),P)}},{key:"addListener",value:function(){lw.on(uw,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){lw.removeListener(uw,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,E,S){for(var P=this.state.formattedGraphicalItems,C=0,A=P.length;C{const s=[],l=new Date;for(let u=29;u>=0;u--){const d=new Date(l);d.setDate(l.getDate()-u);const c=d.toISOString().split("T")[0],f=u===0;let p=0,m=0,v=0,g=!1;e.forEach(b=>{b.exercises&&Array.isArray(b.exercises)&&b.exercises.forEach(y=>{y.completedSets&&Array.isArray(y.completedSets)&&y.completedSets.forEach(x=>{if(new Date(x.timestamp).toISOString().split("T")[0]===c&&x.metrics){g=!0;const S=(x.metrics.weight||0)*(x.metrics.reps||0);p+=S,x.completed?m+=S:v+=S}})})}),s.push({date:c,hasActivity:g,totalWeight:p,completedWeight:m,failedWeight:v,isToday:f})}return s},[e]),i=w.useMemo(()=>{const s=[],l=new Date,u=new Set;e.forEach(d=>{d.exercises&&Array.isArray(d.exercises)&&d.exercises.forEach(c=>{c.completedSets&&Array.isArray(c.completedSets)&&c.completedSets.forEach(f=>{if(f.timestamp){const p=new Date(f.timestamp).toISOString().split("T")[0];u.add(p)}})})});for(let d=51;d>=0;d--){const c=new Date(l);c.setDate(l.getDate()-d*7);const f=new Date(c);f.setDate(c.getDate()-6);let p=0;for(let g=0;g<7;g++){const b=new Date(f);b.setDate(f.getDate()+g);const y=b.toISOString().split("T")[0];u.has(y)&&p++}const m=f.getMonth(),v=["J","F","M","A","M","J","J","A","S","O","N","D"];s.push({weekLabel:v[m],weekStart:f.toISOString().split("T")[0],daysActive:p,monthIndex:m,isFirstWeekOfMonth:f.getDate()<=7})}return s},[e]),o=w.useMemo(()=>{const s=[],l=["J","F","M","A","M","J","J","A","S","O","N","D"];let u=-1,d=0,c=!1;if(i.forEach((f,p)=>{if(f.monthIndex!==u){if(u!==-1){const m=Math.floor((d+p-1)/2);s.push({start:d,end:p-1,shade:c,label:l[u],centerIdx:m}),c=!c}u=f.monthIndex,d=p}}),i.length>0){const f=Math.floor((d+i.length-1)/2);s.push({start:d,end:i.length-1,shade:c,label:l[u],centerIdx:f})}return s},[i]),a=w.useMemo(()=>{for(let s=n.length-1;s>=0;s--)if(n[s].hasActivity){const l=new Date,u=new Date(n[s].date),d=Math.abs(l.getTime()-u.getTime());return Math.floor(d/(1e3*60*60*24))}return 30},[n]);return h.jsxs("div",{className:"mb-4 bg-gray-50/80 border border-gray-300 rounded-lg overflow-hidden cursor-pointer",onClick:()=>r(!t),children:[h.jsxs("div",{className:"flex items-center justify-between p-3",children:[h.jsx("h3",{className:"text-xs font-medium text-black",children:a===0?"Last workout was today":a>=30?"No workouts in last 30 days":`Last workout ${a} ${a===1?"day":"days"} ago`}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs text-black",children:"Today"}),h.jsx(Av.div,{animate:{rotate:t?180:0},transition:{duration:.2},children:h.jsx(Ey,{className:"h-4 w-4 text-black"})})]})]}),h.jsx("div",{className:"pb-3 px-3",children:h.jsx("div",{className:"flex gap-0.5 h-2.5 rounded overflow-hidden",children:n.map(s=>h.jsx("div",{className:`flex-1 transition-colors ${s.hasActivity?"bg-blue-500":"bg-gray-200"}`,title:`${new Date(s.date).toLocaleDateString()} - ${s.hasActivity?`${s.totalWeight.toLocaleString()} kg total (${s.completedWeight.toLocaleString()} completed, ${s.failedWeight.toLocaleString()} failed)`:"No activity"}`},s.date))})}),h.jsx(eV,{children:t&&h.jsx(Av.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(l1e,{width:"100%",height:"100%",children:h.jsxs(HMe,{data:i,margin:{top:5,right:5,bottom:5,left:5},children:[h.jsx(dx,{dataKey:"weekLabel",tick:{fontSize:10,fill:"#9CA3AF"},tickLine:!1,axisLine:!1,tickFormatter:(s,l)=>{const u=o.find(d=>d.centerIdx===l);return u?u.label:""},interval:0}),h.jsx(fx,{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(s=>h.jsx(ax,{y:s,stroke:"#E5E7EB",strokeDasharray:"3 3"},s)),o.filter(s=>s.shade).map((s,l)=>h.jsx(ch,{x1:s.start,x2:s.end,fill:"#F3F4F6",fillOpacity:1},l)),h.jsx(ji,{content:({active:s,payload:l})=>{if(s&&l&&l.length){const u=l[0].payload;return h.jsxs("div",{className:"bg-black text-white text-xs px-2 py-1 rounded shadow",children:["Week of ",u.weekLabel,": ",u.daysActive," day",u.daysActive!==1?"s":""," active"]})}return null}}),h.jsx(dh,{type:"monotone",dataKey:"daysActive",stroke:"#3B82F6",strokeWidth:2,dot:!1,activeDot:{r:4,fill:"#3B82F6"}})]})})})]})})})]})}function KMe({open:e,onOpenChange:t,onConfirm:r,title:n,description:i,confirmText:o="Delete",cancelText:a="Cancel"}){const s=()=>{r(),t(!1)};return h.jsx(GA,{open:e,onOpenChange:t,children:h.jsxs(pb,{children:[h.jsxs(hb,{children:[h.jsx(vb,{children:n}),h.jsx(gb,{children:i})]}),h.jsxs(mb,{children:[h.jsx(bb,{onClick:()=>t(!1),children:a}),h.jsx(yb,{onClick:s,className:"bg-red-600 hover:bg-red-700",children:o})]})]})})}const uR="selected-routine-id",cR=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 dR(){return h.jsx("div",{className:"flex items-center justify-center p-4",children:h.jsx(po,{className:"h-6 w-6 animate-spin text-primary"})})}function cm(){var ml;const{user:e,logout:t}=Eb(),{textSize:r}=o8(),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="w-1.5 h-3",[u,d]=w.useState([]),[c,f]=w.useState(null),[p,m]=w.useState({index:-1,exercise:null}),[v,g]=w.useState(null);w.useState(null);const[b,y]=w.useState({open:!1,mode:"create"}),[x,E]=w.useState(!1),[S,P]=w.useState(!1),[C,A]=w.useState(null),[T,D]=w.useState(new Set),[N,_]=w.useState(!1),[F,k]=w.useState(null),[B,V]=w.useState(null),[z,I]=w.useState(!1),$=_p(),[j,O]=w.useState({}),[U,Y]=w.useState({open:!1,type:"routine",id:0,name:""}),[re,ce]=w.useState(null),[de,Z]=w.useState(null),[ne,K]=w.useState(null),[J,te]=w.useState({}),[H,Ae]=w.useState(null);w.useEffect(()=>{let q=!0;return(async()=>{if(!e){o(!1);return}try{o(!0);const Q=localStorage.getItem(uR),Se=await fetch("/api/routines",{credentials:"include"});if(!Se.ok)throw new Error("Failed to fetch routines");const ge=await Se.json();if(q){const ve=ge.map(oe=>({...oe,exercises:oe.exercises.map(Te=>({...Te,date:Te.date||Te.updatedAt||oe.updatedAt||new Date().toISOString(),notes:Te.notes||""}))}));d(ve);const he=Q?ve.find(oe=>oe.id===parseInt(Q)):ve[0];he?(f(he),xt(he).then(oe=>{q&&(f(oe),d(Te=>Te.map(Ue=>Ue.id===he.id?oe:Ue)))}).catch(oe=>{console.error("Error loading complete routine data:",oe)})):f(ve[0])}k(!!e)}catch(Q){console.error("Error initializing data:",Q),q&&(d([]),f(null))}finally{q&&o(!1)}})(),()=>{q=!1}},[e]),w.useEffect(()=>{e&&c&&c.id!=null&&localStorage.setItem(uR,c.id.toString())},[e,c==null?void 0:c.id]),w.useEffect(()=>{if(!x)return;const q=setTimeout(()=>{const ee=()=>{E(!1)};return window.addEventListener("click",ee),()=>window.removeEventListener("click",ee)},500);return()=>clearTimeout(q)},[x]),w.useEffect(()=>{if(x&&!S){const q=setTimeout(()=>{const ee={title:"Ready to crush it? đŸ’Ē",description:"Tap Success or Fail once you've completed all your sets!",duration:5e3};$.toast(ee),P(!0)},300);return()=>clearTimeout(q)}},[x,S,$]),w.useEffect(()=>{if(c!=null&&c.exercises){const q={};c.exercises.forEach(ee=>{var Se;const Q=((Se=ee.completedSets)==null?void 0:Se.filter(ge=>ge.metrics.weight===ee.weight&&ge.metrics.reps===ee.reps&&ge.metrics.sets===ee.sets))||[];if(Q.length>=4){const ge=Q.slice(-4),ve=ge.every(oe=>oe.completed),he=ge.every(oe=>!oe.completed);ve||he?q[ee.id]=ve?"increase":"decrease":q[ee.id]=null}else q[ee.id]=null}),O(q)}},[c==null?void 0:c.exercises]);const ue=async(q,ee)=>{if(!(!c||!e))try{const Q=`/api/routines/${c.id}/exercises/${q}/notes`,Se=await fetch(Q,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({notes:ee||""}),credentials:"include"});if(!Se.ok){const ge=await Se.text();throw console.error("Failed to update note:",ge),new Error("Failed to update note")}d(ge=>{const ve=ge.map(oe=>oe.id===c.id?{...oe,exercises:oe.exercises.map(Te=>Te.id===q?{...Te,notes:ee||""}:Te)}:oe),he=ve.find(oe=>oe.id===c.id);return he&&f(he),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"})}},$e=async(q,ee)=>{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:ee}),credentials:"include"})).ok)throw new Error("Failed to update exercise name");d(ge=>{const ve=ge.map(oe=>oe.id===c.id?{...oe,exercises:oe.exercises.map(Te=>Te.id===q?{...Te,name:ee}:Te)}:oe),he=ve.find(oe=>oe.id===c.id);return he&&f(he),ve})}catch(Q){console.error("Error updating exercise name:",Q),$.toast({title:"Failed to update exercise name",description:"Please try again.",variant:"destructive"})}},Ve=async(q,ee)=>{var Q;if(c)try{if(ee.routineId&&ee.routineId!==c.id){if(console.log("Moving exercise",q,"to routine",ee.routineId),!c.exercises.find(Te=>Te.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:ee.routineId,targetOrder:0}),credentials:"include"})).ok)throw new Error("Failed to move exercise to new routine");const oe=await fetch("/api/routines",{credentials:"include"});if(oe.ok){const Te=await oe.json();d(Te);const Ue=Te.find(Qe=>Qe.id===c.id);Ue&&f(Ue)}$.toast({title:"Exercise moved",description:`Moved to ${(Q=u.find(Te=>Te.id===ee.routineId))==null?void 0:Q.name}`});return}const Se=await fetch(`/api/v2/exercises/${q}/variations`,{credentials:"include"});if(Se.ok){const ge=await Se.json();console.log("Checking for existing variation with metrics:",ee),console.log("Existing variations:",ge.map(he=>({id:he.id,weight:he.targetWeight,reps:he.targetReps,sets:he.targetSets})));const ve=ge.find(he=>{const oe=Math.abs(he.targetWeight-ee.weight)<.01,Te=he.targetReps===ee.reps,Ue=he.targetSets===ee.sets;return oe&&Te&&Ue});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:ee.weight,targetReps:ee.reps,targetSets:ee.sets,isActive:!0}),credentials:"include"})).ok)throw new Error("Failed to create new variation");console.log("Successfully created new variation")}}if(te(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();d(ve);const he=ve.find(oe=>oe.id===c.id);he&&f(he)}}}catch(Se){console.error("Error updating exercise metrics:",Se),$.toast({title:"Failed to update exercise metrics",description:"Please try again.",variant:"destructive"})}},qe=async q=>{if(!(!c||!e))try{const ee=`/api/routines/${c.id}/exercises`,Q=await fetch(ee,{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 Se=await Q.json();d(ge=>{const ve=ge.map(oe=>{if(oe.id===c.id){const Te=oe.exercises||[];return Te.length===0&&E(!0),{...oe,exercises:[...Te,{...Se,date:Se.date||new Date().toISOString()}],updatedAt:new Date().toISOString()}}return oe}),he=ve.find(oe=>oe.id===c.id);return he&&f(he),ve})}catch(ee){console.error("Error saving exercise:",ee)}},R=(q,ee,Q)=>{let Se=!1;te(ge=>{var oe,Te,Ue;const ve=ge[q]||new Set,he=new Set(ve);return he.has(ee)?(he.delete(ee),(oe=n.current)==null||oe.reset()):(he.add(ee),he.size===Q?((Te=n.current)==null||Te.reset(),Se=!0):(Ue=n.current)==null||Ue.resetAndStart()),{...ge,[q]:he}}),Se&&(Ae({exerciseId:q,setNumber:ee}),setTimeout(()=>{Ae(null),W(q,!0)},500))},W=(q,ee)=>{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 Se;ee!==void 0?Se=ee:Se=(J[q]||new Set).size===Q.sets,G(q,Se)},G=async(q,ee)=>{E(!1),P(!1),te(ge=>{const ve={...ge};return delete ve[q],ve}),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),ee&&wie({particleCount:100,spread:70,origin:{y:.6}});const Q=new Date().toISOString(),Se=(ge,ve)=>{const he=ve.filter(oe=>oe.metrics.weight===ge.weight&&oe.metrics.reps===ge.reps&&oe.metrics.sets===ge.sets);if(he.length>=4){const oe=he.slice(-4),Te=oe.every(Qe=>Qe.completed),Ue=oe.every(Qe=>!Qe.completed);if(Te||Ue){let Qe=!1;he.length===4?Qe=!0:he.length>4&&(Qe=he[he.length-5].completed!==oe[0].completed),Qe&&setTimeout(()=>{V({open:!0,type:Te?"increase":"decrease"})},1e3)}}};try{const ge=`/api/routines/${c==null?void 0:c.id}/exercises/${q}/status`,ve=await fetch(ge,{method:"PATCH",headers:{"Content-Type":"application/json","Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"},body:JSON.stringify({success:ee,date:Q}),credentials:"include"});if(!ve.ok)throw new Error("Failed to update exercise status");const he=await ve.json();e?(d(oe=>oe.map(Te=>Te.id===(c==null?void 0:c.id)?{...Te,exercises:Te.exercises.map(Ue=>Ue.id===q?{...Ue,...he,date:Q,completedSets:he.completedSets||[],success:he.success||!1}:Ue)}:Te)),f(oe=>{if(!oe)return null;const Te={...oe,exercises:oe.exercises.map(Qe=>Qe.id===q?{...Qe,...he,date:Q,completedSets:he.completedSets||[],success:he.success||!1}:Qe)},Ue=Te.exercises.find(Qe=>Qe.id===q);return Ue&&Se(Ue,Ue.completedSets),Te})):d(oe=>{const Te=oe.map(Qe=>{if(Qe.id===(c==null?void 0:c.id)){const Ti=Qe.exercises.map(mr=>{if(mr.id===q){const Br=[...mr.completedSets,{completed:ee,timestamp:Q,metrics:{weight:mr.weight,reps:mr.reps,sets:mr.sets}}],fh={...mr,completedSets:Br,success:Br.every(ph=>ph.completed),date:Q};return Se(fh,Br),fh}return mr});return{...Qe,exercises:Ti,updatedAt:Q}}return Qe}),Ue=Te.find(Qe=>Qe.id===(c==null?void 0:c.id));return Ue&&f(Ue),Te})}catch(ge){console.error("Error updating exercise status:",ge)}},pe=async()=>{if(!v||!c)return;console.log("đŸ—‘ī¸ Deleting log for",e?"authenticated":"demo","user"),_(!0);const q=`${v.exerciseId}-${v.setIndex}`;D(ee=>new Set(ee).add(q)),setTimeout(async()=>{var ee,Q;try{let Se=!1;if(e){console.log("🔐 AUTHENTICATED USER: Processing deletion...");const ge=c.exercises.find(he=>he.id===v.exerciseId);if(!ge||!ge.completedSets||v.setIndex>=ge.completedSets.length){console.error("❌ AUTHENTICATED: Exercise or set not found",{exerciseFound:!!ge,completedSetsLength:((ee=ge==null?void 0:ge.completedSets)==null?void 0:ee.length)||0,requestedIndex:v.setIndex});return}const ve=ge.completedSets[v.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 he=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(he.ok){const oe=await he.json();console.log("✅ AUTHENTICATED: Server delete response:",oe),oe.verified?(Se=!0,console.log("✅ AUTHENTICATED: Backend verified deletion:",oe.deletedId)):(console.warn("âš ī¸ AUTHENTICATED: Backend did not verify deletion"),Se=!1)}else console.error("Server deletion failed, status:",he.status),Se=!1}catch(he){console.error("Error deleting completion from server:",he),Se=!1}else console.log("â„šī¸ AUTHENTICATED: No server-side completion to delete (newly added log), proceeding with client-side deletion"),Se=!0;if(Se){const he=ge.completedSets.filter((Te,Ue)=>Ue!==v.setIndex),oe={...ge,completedSets:he,success:he.length>0?(Q=he[he.length-1])==null?void 0:Q.completed:!1,date:he.length>0?he[he.length-1].timestamp:ge.date};d(Te=>Te.map(Ue=>Ue.id===c.id?{...Ue,exercises:Ue.exercises.map(Qe=>Qe.id===ge.id?oe:Qe),updatedAt:new Date().toISOString()}:Ue)),f(Te=>Te?{...Te,exercises:Te.exercises.map(Ue=>Ue.id===ge.id?oe:Ue),updatedAt:new Date().toISOString()}:null),console.log("✅ AUTHENTICATED: UI state updated - deleted log removed")}}}catch(Se){console.error("❌ FATAL ERROR in handleRemoveSet:",Se),_(!1)}D(Se=>{const ge=new Set(Se);return ge.delete(q),ge}),g(null),_(!1),console.log("🏁 REMOVE SET: Process completed")},300)},le=async q=>{e&&(A(q),setTimeout(async()=>{m({index:-1,exercise:null});try{const ee=`/api/routines/${c==null?void 0:c.id}/exercises/${q}`,Q=await fetch(ee,{method:"DELETE",credentials:"include"});if(!Q.ok)throw new Error("Failed to delete exercise");const Se=await Q.json();f(Se),d(ge=>ge.map(ve=>ve.id===Se.id?Se:ve))}catch(ee){console.error("Error deleting exercise:",ee)}finally{A(null)}},300))},ie=q=>{Y({open:!0,type:"exercise",id:q.id,name:q.name})},Oe=()=>{U.type==="routine"?qn(U.id):le(U.id)},Fe=async q=>{if(e)try{const ee=await fetch("/api/routines",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:q}),credentials:"include"});if(!ee.ok)throw new Error("Failed to add routine");const Q=await ee.json();d([...u,Q]),f(Q)}catch(ee){console.error("Error adding routine:",ee)}},_t=async(q,ee)=>{if(e)try{const Q=await fetch(`/api/routines/${q}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ee}),credentials:"include"});if(!Q.ok)throw new Error("Failed to edit routine");const Se=await Q.json();d(ge=>ge.map(ve=>ve.id===q?Se:ve)),f(Se)}catch(Q){console.error("Error editing routine:",Q)}},xt=async q=>{if(!q.exercises||q.exercises.length===0)return q;try{const ee=await Promise.all(q.exercises.map(async Q=>{var Se,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 he=await ve.json();if(he&&he.length>0){const oe=he.find(Ue=>Ue.isCurrent)||he[0],Te=((Se=oe==null?void 0:oe.completions)==null?void 0:Se.map(Ue=>({completed:Ue.success,timestamp:Ue.completedAt||new Date().toISOString(),completionId:Ue.id,metrics:{weight:oe.targetWeight,reps:oe.targetReps,sets:oe.targetSets}})))||[];return{...Q,weight:(oe==null?void 0:oe.targetWeight)||Q.weight,reps:(oe==null?void 0:oe.targetReps)||Q.reps,sets:(oe==null?void 0:oe.targetSets)||Q.sets,completedSets:Te,success:Te.length>0?(ge=Te[Te.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:ee}}catch(ee){return console.error("Error loading complete routine data:",ee),q}},qn=async q=>{if(e)try{const ee=`/api/routines/${q}`,Q=await fetch(ee,{method:"DELETE",credentials:"include"});if(!Q.ok)throw new Error("Failed to delete routine");const Se=await Q.json();if(d(Se),Se.length>0){const ge=Se[0],ve=await xt(ge),he=Se.map(oe=>oe.id===ge.id?ve:oe);d(he),f(ve)}else f(null)}catch(ee){console.error("Error deleting routine:",ee)}},hl=q=>{Y({open:!0,type:"routine",id:q.id,name:q.name})},Xo=(q,ee)=>{const Q=(q==null?void 0:q.filter(ve=>ve.metrics.weight===ee.weight&&ve.metrics.reps===ee.reps&&ve.metrics.sets===ee.sets))||[];if(Q.length===0)return null;const Se=Q.length-1,ge=Q[Se];return h.jsx("div",{className:"mt-2 cursor-pointer hover:opacity-70 transition-opacity",onClick:()=>g({exerciseId:ee.id,setIndex:Se,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-0.5",children:Q.map((ve,he)=>h.jsx("div",{className:`${l} transition-all duration-300 ${ve.completed?"bg-green-400":"bg-red-400"} ${T.has(`${ee.id}-${Se}`)&&he===Se?"log-fade-out":""} ${he===Se&&!T.has(`${ee.id}-${Se}`)?"animate-pulse-square":""}`},he))}),cR(ee)&&h.jsxs("div",{className:`flex items-center gap-1 ${s.date} text-muted-foreground`,children:[h.jsx(lv,{className:"h-3 w-3"}),h.jsx("span",{children:cR(ee).split(" @ ")[0]})]})]})})},eo=async q=>{if(!q.destination||!(c!=null&&c.exercises))return;const ee=q.source.index,Q=q.destination.index,Se=[...u],ge=c;try{const ve=Array.from(c.exercises),[he]=ve.splice(ee,1);ve.splice(Q,0,he);const oe=ve.map((mr,Br)=>({...mr,order:Br})),Te={...c,exercises:oe,updatedAt:new Date().toISOString()};d(mr=>mr.map(Br=>Br.id===Te.id?Te:Br)),f(Te);const Ue=`/api/routines/${c.id}/exercises/reorder`,Qe=await fetch(Ue,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({exercises:oe}),credentials:"include"});if(!Qe.ok)throw new Error("Failed to save exercise order");const Ti=await Qe.json();d(mr=>mr.map(Br=>Br.id===Ti.id?Ti:Br)),f(Ti)}catch(ve){console.error("Error saving exercise order:",ve),d(Se),f(ge)}};return h.jsx(sJ,{onDragEnd:eo,children:h.jsx(w.Suspense,{fallback:h.jsx(dR,{}),children:h.jsx("div",{className:"w-full pb-24 px-4",children:i?h.jsx(dR,{}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"py-4 space-y-4",children:c&&h.jsxs(h.Fragment,{children:[h.jsx(GMe,{routines:u}),h.jsx("div",{className:"flex items-center gap-2",children:h.jsxs(D4,{children:[h.jsx(k4,{asChild:!0,children:h.jsxs(Be,{variant:"ghost",className:`flex-1 justify-center h-12 ${s.routineDropdown} hover:bg-transparent`,children:[c.name,h.jsx(Ey,{className:"ml-2 h-5 w-5"})]})}),h.jsxs(jA,{className:"w-[var(--radix-dropdown-menu-trigger-width)]",children:[u.map(q=>h.jsxs(Es,{className:"flex items-center justify-between pr-2 py-2.5",onClick:()=>f(q),children:[h.jsx("span",{className:"font-medium",children:q.name}),h.jsx(Be,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 ml-2",onClick:ee=>{ee.stopPropagation(),y({open:!0,mode:"edit"}),f(q)},children:h.jsx(OS,{className:"h-3 w-3"})})]},q.id)),h.jsx("div",{className:"border-t border-gray-100 my-1"}),h.jsxs(Es,{className:"flex items-center gap-2 py-2.5 text-muted-foreground",onClick:()=>y({open:!0,mode:"create"}),children:[h.jsx(iu,{className:"h-4 w-4"}),h.jsx("span",{children:"New routine"})]})]})]})}),h.jsx(TB,{droppableId:`exercises-${c.id}`,children:q=>{var ee;return h.jsxs("div",{...q.droppableProps,ref:q.innerRef,className:"space-y-6 !mt-0",children:[((ee=c.exercises)==null?void 0:ee.length)>0?c.exercises.map((Q,Se)=>h.jsx(WJ,{draggableId:Q.id.toString(),index:Se,children:(ge,ve)=>{var he,oe;return h.jsxs(Av.div,{ref:ge.innerRef,...ge.draggableProps,className:`transition-all duration-300 ${C===Q.id?"exercise-fade-out":""}`,children:[h.jsx("div",{className:`border rounded-lg bg-white ${ve.isDragging?"shadow-lg":""}`,children:h.jsxs("div",{className:"flex",children:[h.jsxs("div",{className:"flex-1 p-4 space-y-2",children:[h.jsx("h3",{className:`${s.exerciseName} font-bold truncate cursor-pointer hover:text-primary transition-colors`,onClick:()=>Z({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:()=>K({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(OS,{className:"h-3.5 w-3.5 text-gray-400 cursor-pointer hover:text-primary transition-colors",onClick:()=>K({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},(Te,Ue)=>{var ph;const Qe=Ue+1,Ti=((ph=J[Q.id])==null?void 0:ph.has(Qe))||!1,mr=J[Q.id]||new Set;let Br=null;for(let as=1;as<=Q.sets;as++)if(!mr.has(as)){Br=as;break}const fh=!Ti&&Qe===Br&&mr.size>0;return h.jsx(Be,{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 ${Ti?"set-button-tapped shadow-md":"set-button-untapped"} ${fh?"animate-pulse-green":""} ${(H==null?void 0:H.exerciseId)===Q.id&&(H==null?void 0:H.setNumber)===Qe?"animate-explode-shake":""}`,style:{WebkitTapHighlightColor:"transparent"},onClick:as=>{as.preventDefault(),R(Q.id,Qe,Q.sets),as.currentTarget.blur()},children:Ti?h.jsx(xi,{className:"h-4 w-4 stroke-[3] text-white"}):Qe},Qe)}),(((he=J[Q.id])==null?void 0:he.size)||0)>0&&h.jsx(Be,{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 ${(((oe=J[Q.id])==null?void 0:oe.size)||0)===Q.sets?"animate-pulse-finished":""}`,style:{WebkitTapHighlightColor:"transparent"},onClick:Te=>{Te.preventDefault(),W(Q.id),Te.currentTarget.blur()},children:"End"})]}),h.jsx("div",{className:"mt-3 cursor-pointer hover:bg-gray-50 rounded px-2 pt-2 transition-colors",onClick:()=>ce({open:!0,exerciseId:Q.id,currentNote:Q.notes||""}),children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(KL,{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"})]})})]}),h.jsx("div",{...ge.dragHandleProps,className:"flex items-center px-2 border-l",children:h.jsx(Sq,{className:"h-4 w-4 text-gray-400"})})]})}),h.jsx("div",{className:"pl-4",children:Xo(Q.completedSets,Q)})]})}},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(Be,{onClick:()=>I(!0),className:"inline-flex items-center gap-2",children:[h.jsx(iu,{className:"h-4 w-4"}),"Add First Exercise"]})]}),q.placeholder]})}}),((ml=c.exercises)==null?void 0:ml.length)>0&&h.jsxs(Be,{className:"w-full mb-8",onClick:()=>I(!0),children:[h.jsx(iu,{className:"h-4 w-4 mr-2"}),"Add Exercise"]})]})}),h.jsx(Xle,{open:z,onOpenChange:I,onSubmit:qe}),p.exercise&&h.jsx(cue,{open:p.index!==-1,onOpenChange:async q=>{if(!q){if(console.log("🔄 Edit dialog closing - refreshing data..."),e&&c){const ee=await xt(c);f(ee),d(Q=>Q.map(Se=>Se.id===c.id?ee:Se)),console.log("✅ Refreshed routine data after edit dialog close")}m({index:-1,exercise:null})}},exercise:p.exercise,onDelete:()=>ie(p.exercise),onRefresh:async()=>{if(console.log("🔄 Refreshing after variant change..."),e&&c){const q=await xt(c);f(q),d(ee=>ee.map(Q=>Q.id===c.id?q:Q)),console.log("✅ Refreshed routine data after variant change")}}}),h.jsx(pue,{open:b.open,onOpenChange:q=>y({...b,open:q}),onSubmit:b.mode==="create"?Fe:q=>_t(c.id,q),onDelete:b.mode==="edit"?()=>hl(c):void 0,routine:b.mode==="edit"&&c||void 0,mode:b.mode,existingRoutines:u}),v&&h.jsx(due,{open:!!v,onOpenChange:()=>g(null),onConfirm:pe,isSuccess:v.isSuccess}),B&&h.jsx(Yue,{open:B.open,onOpenChange:q=>V(q?B:null),type:B.type,onEditExercise:()=>{const q=c==null?void 0:c.exercises.find(ee=>ee.completedSets.length>=4&&(B.type==="increase"&&ee.completedSets.slice(-4).every(Q=>Q.completed)||B.type==="decrease"&&ee.completedSets.slice(-4).every(Q=>!Q.completed)));if(q){const ee=c==null?void 0:c.exercises.indexOf(q);ee!==void 0&&ee!==-1&&m({index:ee,exercise:q})}}}),h.jsx(I5,{ref:n}),re&&h.jsx(hue,{open:re.open,onOpenChange:q=>ce(q?re:null),initialNote:re.currentNote,onSave:q=>ue(re.exerciseId,q)}),de&&h.jsx(mue,{open:de.open,onOpenChange:q=>Z(q?de:null),currentName:de.currentName,onSave:q=>$e(de.exerciseId,q)}),ne&&h.jsx(Kue,{open:ne.open,onOpenChange:q=>K(q?ne:null),currentMetrics:ne.currentMetrics,routines:u.map(q=>({id:q.id,name:q.name})),currentRoutineId:c==null?void 0:c.id,onSave:q=>Ve(ne.exerciseId,q),onDelete:()=>{const q=c==null?void 0:c.exercises.find(ee=>ee.id===ne.exerciseId);q&&ie(q)}}),h.jsx(KMe,{open:U.open,onOpenChange:q=>Y(ee=>({...ee,open:q})),onConfirm:Oe,title:U.type==="routine"?"Drop this routine?":"Cut this exercise?",description:`This will delete "${U.name}" ${U.type==="routine"?"and all its exercises.":"and all its variations and workout logs."} This action can't be undone.`,confirmText:"Delete",cancelText:"Cancel"})]})})})})}const Rn=w.forwardRef(({className:e,...t},r)=>h.jsx("div",{ref:r,className:ke("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Rn.displayName="Card";const Ha=w.forwardRef(({className:e,...t},r)=>h.jsx("div",{ref:r,className:ke("flex flex-col space-y-1.5 p-6",e),...t}));Ha.displayName="CardHeader";const Ga=w.forwardRef(({className:e,...t},r)=>h.jsx("h3",{ref:r,className:ke("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ga.displayName="CardTitle";const gp=w.forwardRef(({className:e,...t},r)=>h.jsx("p",{ref:r,className:ke("text-sm text-muted-foreground",e),...t}));gp.displayName="CardDescription";const gi=w.forwardRef(({className:e,...t},r)=>h.jsx("div",{ref:r,className:ke("p-6 pt-0",e),...t}));gi.displayName="CardContent";const Qg=w.forwardRef(({className:e,...t},r)=>h.jsx("div",{ref:r,className:ke("flex items-center p-6 pt-0",e),...t}));Qg.displayName="CardFooter";const qMe=Sy("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 GE({className:e,variant:t,...r}){return h.jsx("div",{className:ke(qMe({variant:t}),e),...r})}function YMe(){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 dw(){const e=[{icon:h.jsx(HL,{className:"h-6 w-6"}),title:"Simple Workout Logging",description:"Quick and intuitive workout tracking without the complexity"},{icon:h.jsx(qL,{className:"h-6 w-6"}),title:"Rest Timer",description:"Built-in timer to track breaks between sets"},{icon:h.jsx(QP,{className:"h-6 w-6"}),title:"Progress Tracking",description:"Monitor your improvement over time with clear workout history"},{icon:h.jsx(Aq,{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(GE,{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(_a,{href:"/login",children:h.jsxs(Be,{size:"lg",className:"px-8 py-6 text-lg",children:["Get Started",h.jsx(Yx,{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(GE,{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(pq,{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(WL,{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(GL,{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(Rn,{className:"border-muted hover:border-primary/20 transition-colors bg-white",children:[h.jsx(Ha,{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(Ga,{className:"text-lg",children:r.title})]})}),h.jsx(gi,{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(uv,{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(xi,{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(Rn,{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(_a,{href:"/login",children:h.jsxs(Be,{className:"w-full",children:["Start Your First Workout",h.jsx(Yx,{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(_a,{href:"/login",children:h.jsxs(Be,{size:"lg",className:"px-8 py-6 text-lg",children:["Get Started",h.jsx(Yx,{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(YMe,{})]})}const XMe=cb({email:Li().email("Please enter a valid email address"),password:Li().min(6,"Password must be at least 6 characters")});function fR({mode:e}){const{login:t,register:r}=Eb(),{toast:n}=_p(),[i,o]=w.useState(!1),a=sb({resolver:lb(XMe),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(d){n({variant:"destructive",title:"Oops! That didn't go as planned! 😅",description:d.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 d=await fetch("/api/magic-link/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:u})}),c=await d.json();if(!d.ok)throw new Error(c.message||"Failed to send magic link");n({title:"Magic link sent! ✨",description:"Check your email for the login link"})}catch(d){n({variant:"destructive",title:"Failed to send link",description:d.message})}finally{o(!1)}};return h.jsx("div",{className:"flex items-center justify-center px-4 pt-8",children:h.jsxs(Rn,{className:"w-full max-w-md",children:[h.jsxs(Ha,{children:[h.jsx(Ga,{children:e==="login"?"Welcome Back! đŸ’Ē":"Let's go! 🚀"}),h.jsx(gp,{children:e==="login"?"Track your workouts and see your progress":"Create an account to start tracking your fitness journey"})]}),h.jsxs(gi,{children:[h.jsx(db,{...a,children:h.jsxs("form",{onSubmit:a.handleSubmit(s),className:"space-y-4",children:[h.jsx(Fi,{control:a.control,name:"email",render:({field:u})=>h.jsxs(fi,{children:[h.jsx(pi,{children:"Email"}),h.jsx(hi,{children:h.jsx(Pr,{placeholder:"john@example.com",type:"email",autoComplete:"email",autoFocus:!0,...u})}),h.jsx(mi,{})]})}),h.jsx(Fi,{control:a.control,name:"password",render:({field:u})=>h.jsxs(fi,{children:[h.jsx(pi,{children:"Password"}),h.jsx(hi,{children:h.jsx(Pr,{type:"password",placeholder:"â€ĸâ€ĸâ€ĸâ€ĸâ€ĸâ€ĸ",autoComplete:"current-password",...u})}),h.jsx(mi,{})]})}),h.jsxs(Be,{type:"submit",className:"w-full",disabled:a.formState.isSubmitting,children:[a.formState.isSubmitting&&h.jsx(po,{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(Be,{type:"button",variant:"outline",className:"w-full mt-4",disabled:i,onClick:l,children:[i?h.jsx(po,{className:"mr-2 h-4 w-4 animate-spin"}):h.jsx(jq,{className:"mr-2 h-4 w-4"}),"Email me a login link"]})]}),h.jsxs(Qg,{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(_a,{href:e==="login"?"/register":"/login",children:h.jsx(Be,{variant:"link",className:"mt-1",type:"button",children:e==="login"?"Sign up now":"Login instead"})})]})]})})}function ZMe(){const{user:e,logout:t}=Eb(),[,r]=vy(),{toast:n}=_p(),i=Tp(),[o,a]=M.useState(null);M.useEffect(()=>{e!=null&&e.isAdmin||r("/")},[e,r]);const{data:s,isLoading:l,error:u}=Q2({queryKey:["/api/admin/users"],enabled:!!(e!=null&&e.isAdmin)}),d=tu({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})}}),c=tu({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=tu({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(po,{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(Rn,{className:"w-full max-w-md mx-4",children:h.jsxs(gi,{className:"pt-6",children:[h.jsxs("div",{className:"flex mb-4 gap-2",children:[h.jsx(Oq,{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(Be,{variant:"outline",onClick:()=>t(),className:"flex items-center gap-2",children:[h.jsx(Eq,{className:"h-4 w-4"}),"Logout"]})]}),h.jsxs(Rn,{className:"mb-6",children:[h.jsx(Ha,{children:h.jsxs(Ga,{className:"flex items-center gap-2",children:[h.jsx(wq,{className:"h-5 w-5"}),"Demo Account Management"]})}),h.jsx(gi,{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(Be,{onClick:()=>c.mutate(),disabled:c.isPending||f.isPending,className:"flex items-center gap-2",variant:"outline",children:c.isPending?h.jsxs(h.Fragment,{children:[h.jsx(po,{className:"h-4 w-4 animate-spin"}),"Generating..."]}):h.jsxs(h.Fragment,{children:[h.jsx(Pq,{className:"h-4 w-4"}),"Generate Demo Data"]})}),h.jsx(Be,{onClick:()=>f.mutate(),disabled:f.isPending||c.isPending,className:"flex items-center gap-2",variant:"destructive",children:f.isPending?h.jsxs(h.Fragment,{children:[h.jsx(po,{className:"h-4 w-4 animate-spin"}),"Deleting..."]}):h.jsxs(h.Fragment,{children:[h.jsx(gf,{className:"h-4 w-4"}),"Clear All Completions"]})})]})]})})]}),h.jsxs(Rn,{children:[h.jsx(Ha,{children:h.jsx(Ga,{children:"User Management"})}),h.jsx(gi,{children:h.jsx("div",{className:"space-y-6",children:s==null?void 0:s.map(p=>h.jsx(Rn,{className:"border-l-4 border-l-blue-500",children:h.jsxs(gi,{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(WL,{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(Be,{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(fq,{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(uv,{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(QP,{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(GL,{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(lv,{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(GA,{open:!!o,onOpenChange:()=>a(null),children:h.jsxs(pb,{children:[h.jsxs(hb,{children:[h.jsx(vb,{children:"Are you sure?"}),h.jsxs(gb,{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(mb,{children:[h.jsx(bb,{children:"Cancel"}),h.jsx(yb,{onClick:()=>o&&d.mutate(o.id),className:"bg-red-600 hover:bg-red-700",children:d.isPending?h.jsx(po,{className:"h-4 w-4 animate-spin"}):"Delete"})]})]})})]}):null}function QMe(){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(Rn,{className:"w-[280px] flex-shrink-0 snap-center",children:h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsxs(Ha,{children:[h.jsxs("div",{className:"flex justify-between items-start",children:[h.jsxs("div",{children:[h.jsx(Ga,{className:"text-2xl",children:"Free"}),h.jsx(gp,{children:"Perfect for getting started"})]}),h.jsx(HL,{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(gi,{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(xi,{className:"h-4 w-4 text-primary"}),h.jsx("span",{children:r})]},n))})}),h.jsx(Qg,{children:h.jsx(_a,{href:"/register",children:h.jsx(Be,{className:"w-full",children:"Get Started"})})})]})}),h.jsxs(Rn,{className:"w-[280px] flex-shrink-0 snap-center relative border-dashed",children:[h.jsx("div",{className:"absolute -top-1 -right-1",children:h.jsxs(GE,{variant:"secondary",className:"font-semibold",children:[h.jsx(Tq,{className:"h-3 w-3 mr-1"}),"Coming Soon"]})}),h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsxs(Ha,{children:[h.jsxs("div",{className:"flex justify-between items-start",children:[h.jsxs("div",{children:[h.jsx(Ga,{className:"text-2xl",children:"Pro"}),h.jsx(gp,{children:"For the dedicated athlete"})]}),h.jsx(hq,{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(gi,{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(xi,{className:"h-4 w-4 text-muted-foreground"}),h.jsx("span",{className:"text-muted-foreground",children:r})]},n))})}),h.jsx(Qg,{children:h.jsx(Be,{className:"w-full",variant:"outline",disabled:!0,children:"Coming Soon"})})]})]})]})})]})}function JMe(){const[,e]=vy(),t=Tp(),[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 d;try{d=await u.json()}catch{throw new Error("Server error - invalid response")}if(!u.ok)throw new Error(d.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(Rn,{className:"w-full max-w-md",children:[h.jsxs(Ha,{children:[h.jsxs(Ga,{children:[r==="loading"&&"Verifying...",r==="success"&&"Welcome! 🎉",r==="error"&&"Verification Failed"]}),h.jsxs(gp,{children:[r==="loading"&&"Please wait while we log you in",r==="success"&&"Redirecting to your workouts...",r==="error"&&i]})]}),h.jsxs(gi,{className:"flex justify-center py-8",children:[r==="loading"&&h.jsx(po,{className:"h-12 w-12 animate-spin text-primary"}),r==="success"&&h.jsx(yq,{className:"h-12 w-12 text-green-500"}),r==="error"&&h.jsxs("div",{className:"flex flex-col items-center gap-4",children:[h.jsx(bq,{className:"h-12 w-12 text-destructive"}),h.jsx(Be,{onClick:()=>e("/login"),children:"Go to Login"})]})]})]})})}function eIe({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(aL,{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 tIe({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(aL,{children:h.jsx("script",{type:"application/ld+json",children:JSON.stringify(r)})})}function rIe(){const[e]=vy(),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,d=`${i}/${a.slice(0,l+1).join("/")}`;let c=s.charAt(0).toUpperCase()+s.slice(1);s==="workout"&&(c="Workout Tracker"),s==="login"&&(c="Login"),s==="register"&&(c="Sign Up"),s==="subscription"&&(c="Premium Features"),o.push({"@type":"ListItem",position:u,name:c,item:d})}),o})(e)};return h.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(r)}})}const i8=w.createContext({textSize:"normal",setTextSize:()=>{}}),o8=()=>w.useContext(i8),pR="lift-easy-text-size",nIe=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 iIe(){const{user:e,isLoading:t,logout:r}=Eb(),[n,i]=vy(),[o,a]=w.useState(()=>localStorage.getItem(pR)||"normal"),s=c=>{a(c),localStorage.setItem(pR,c)};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(po,{className:"h-8 w-8 animate-spin text-border"})});const l=nIe(n),u=n==="/"&&!e,d=u;return h.jsxs(i8.Provider,{value:{textSize:o,setTextSize:s},children:[h.jsx(eIe,{...l}),h.jsx(tIe,{pathname:n}),h.jsx(rIe,{}),h.jsx("div",{className:"border-b",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(_a,{href:e?"/workout":"/",children:h.jsxs(Be,{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(D4,{children:[h.jsx(k4,{asChild:!0,children:h.jsx(Be,{variant:"ghost",size:"icon",children:h.jsx(Cq,{className:"h-5 w-5"})})}),h.jsxs(jA,{align:"end",className:"w-48",children:[h.jsx(M4,{children:"Text Size"}),h.jsxs(Es,{onClick:()=>s("normal"),children:[h.jsx(xi,{className:`mr-2 h-4 w-4 ${o==="normal"?"opacity-100":"opacity-0"}`}),"Normal"]}),h.jsxs(Es,{onClick:()=>s("large"),children:[h.jsx(xi,{className:`mr-2 h-4 w-4 ${o==="large"?"opacity-100":"opacity-0"}`}),"Large"]}),h.jsxs(Es,{onClick:()=>s("extra-large"),children:[h.jsx(xi,{className:`mr-2 h-4 w-4 ${o==="extra-large"?"opacity-100":"opacity-0"}`}),"Extra Large"]}),h.jsx(I4,{}),h.jsx(Es,{onClick:()=>r(),children:"Logout"})]})]}):h.jsxs(h.Fragment,{children:[h.jsx(_a,{href:"/login",children:h.jsx(Be,{variant:"ghost",children:"Login"})}),h.jsx(_a,{href:"/register",children:h.jsx(Be,{variant:"default",children:"Sign Up"})})]})})]})})}),d?h.jsxs(C_,{children:[h.jsx(Xn,{path:"/",children:()=>e?h.jsx("div",{className:"min-h-screen bg-gray-50",children:h.jsx(cm,{})}):h.jsx(dw,{})}),h.jsx(Xn,{path:"/workout",children:()=>h.jsx("div",{className:"min-h-screen bg-gray-50",children:h.jsx(cm,{})})}),h.jsx(Xn,{children:()=>h.jsx(dw,{})})]}):h.jsxs(C_,{children:[h.jsx(Xn,{path:"/",children:()=>e?h.jsx("div",{className:"min-h-screen bg-gray-50",children:h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(cm,{})})}):h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(dw,{})})}),h.jsx(Xn,{path:"/workout",children:()=>h.jsx("div",{className:"min-h-screen bg-gray-50",children:h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(cm,{})})})}),h.jsx(Xn,{path:"/login",children:()=>h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(fR,{mode:"login"})})}),h.jsx(Xn,{path:"/register",children:()=>h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(fR,{mode:"register"})})}),h.jsx(Xn,{path:"/subscription",children:()=>h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(QMe,{})})}),h.jsx(Xn,{path:"/verify-magic-link",children:()=>h.jsx(JMe,{})}),h.jsx(Xn,{path:"/admin",children:()=>h.jsx("div",{className:"max-w-4xl mx-auto",children:h.jsx(ZMe,{})})}),h.jsx(Xn,{children:()=>h.jsx("div",{className:"max-w-md mx-auto",children:h.jsx(oIe,{})})})]})]})}function oIe(){return h.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:h.jsx(Rn,{className:"w-full max-w-md mx-4",children:h.jsxs(gi,{className:"pt-6",children:[h.jsxs("div",{className:"flex mb-4 gap-2",children:[h.jsx(gq,{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."})]})})})}L2(document.getElementById("root")).render(h.jsx(w.StrictMode,{children:h.jsx(gL,{children:h.jsx(oL,{children:h.jsxs(e9,{client:hK,children:[h.jsx(iIe,{}),h.jsx(f7,{})]})})})}))});export default aIe();