var Hj=Object.defineProperty;var R0=e=>{throw TypeError(e)};var Gj=(e,t,r)=>t in e?Hj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Kj=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Mn=(e,t,r)=>Gj(e,typeof t!="symbol"?t+"":t,r),Yp=(e,t,r)=>t.has(e)||R0("Cannot "+r);var j=(e,t,r)=>(Yp(e,t,"read from private field"),r?r.call(e):t.get(e)),ve=(e,t,r)=>t.has(e)?R0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),se=(e,t,r,n)=>(Yp(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Ne=(e,t,r)=>(Yp(e,t,"access private method"),r);var Xc=(e,t,r,n)=>({set _(i){se(e,t,i,r)},get _(){return j(e,t,n)}});var B7=Kj((X7,Gc)=>{function qj(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 s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();function Sa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hC={exports:{}},Df={},mC={exports:{}},Ie={};/** * @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 wc=Symbol.for("react.element"),Qj=Symbol.for("react.portal"),Yj=Symbol.for("react.fragment"),Zj=Symbol.for("react.strict_mode"),Xj=Symbol.for("react.profiler"),Jj=Symbol.for("react.provider"),eI=Symbol.for("react.context"),tI=Symbol.for("react.forward_ref"),rI=Symbol.for("react.suspense"),nI=Symbol.for("react.memo"),iI=Symbol.for("react.lazy"),j0=Symbol.iterator;function sI(e){return e===null||typeof e!="object"?null:(e=j0&&e[j0]||e["@@iterator"],typeof e=="function"?e:null)}var gC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vC=Object.assign,yC={};function Ca(e,t,r){this.props=e,this.context=t,this.refs=yC,this.updater=r||gC}Ca.prototype.isReactComponent={};Ca.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")};Ca.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xC(){}xC.prototype=Ca.prototype;function Dv(e,t,r){this.props=e,this.context=t,this.refs=yC,this.updater=r||gC}var Av=Dv.prototype=new xC;Av.constructor=Dv;vC(Av,Ca.prototype);Av.isPureReactComponent=!0;var I0=Array.isArray,wC=Object.prototype.hasOwnProperty,Nv={current:null},bC={key:!0,ref:!0,__self:!0,__source:!0};function SC(e,t,r){var n,i={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)wC.call(t,n)&&!bC.hasOwnProperty(n)&&(i[n]=t[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1>>1,H=F[P];if(0>>1;Pi(de,A))uei(re,de)?(F[P]=re,F[ue]=A,P=ue):(F[P]=de,F[ae]=A,P=ae);else if(uei(re,A))F[P]=re,F[ue]=A,P=ue;else break e}}return $}function i(F,$){var A=F.sortIndex-$.sortIndex;return A!==0?A:F.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,p=3,h=!1,g=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,x=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 b(F){for(var $=r(c);$!==null;){if($.callback===null)n(c);else if($.startTime<=F)n(c),$.sortIndex=$.expirationTime,t(l,$);else break;$=r(c)}}function S(F){if(v=!1,b(F),!g)if(r(l)!==null)g=!0,J(C);else{var $=r(c);$!==null&&X(S,$.startTime-F)}}function C(F,$){g=!1,v&&(v=!1,x(k),k=-1),h=!0;var A=p;try{for(b($),d=r(l);d!==null&&(!(d.expirationTime>$)||F&&!W());){var P=d.callback;if(typeof P=="function"){d.callback=null,p=d.priorityLevel;var H=P(d.expirationTime<=$);$=e.unstable_now(),typeof H=="function"?d.callback=H:d===r(l)&&n(l),b($)}else n(l);d=r(l)}if(d!==null)var ne=!0;else{var ae=r(c);ae!==null&&X(S,ae.startTime-$),ne=!1}return ne}finally{d=null,p=A,h=!1}}var D=!1,N=null,k=-1,R=5,M=-1;function W(){return!(e.unstable_now()-MF||125P?(F.sortIndex=A,t(c,F),r(l)===null&&F===r(c)&&(v?(x(k),k=-1):v=!0,X(S,A-P))):(F.sortIndex=H,t(l,F),g||h||(g=!0,J(C))),F},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(F){var $=p;return function(){var A=p;p=$;try{return F.apply(this,arguments)}finally{p=A}}}})(AC);DC.exports=AC;var gI=DC.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 vI=m,yr=gI;function K(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"),Sm=Object.prototype.hasOwnProperty,yI=/^[: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]*$/,O0={},_0={};function xI(e){return Sm.call(_0,e)?!0:Sm.call(O0,e)?!1:yI.test(e)?_0[e]=!0:(O0[e]=!0,!1)}function wI(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 bI(e,t,r,n){if(t===null||typeof t>"u"||wI(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 qt(e,t,r,n,i,s,o){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=s,this.removeEmptyString=o}var Rt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Rt[e]=new qt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Rt[t]=new qt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Rt[e]=new qt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Rt[e]=new qt(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){Rt[e]=new qt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Rt[e]=new qt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Rt[e]=new qt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Rt[e]=new qt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Rt[e]=new qt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Rv=/[\-:]([a-z])/g;function jv(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(Rv,jv);Rt[t]=new qt(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(Rv,jv);Rt[t]=new qt(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(Rv,jv);Rt[t]=new qt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Rt[e]=new qt(e,1,!1,e.toLowerCase(),null,!1,!1)});Rt.xlinkHref=new qt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Rt[e]=new qt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Iv(e,t,r,n){var i=Rt.hasOwnProperty(t)?Rt[t]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var l=` `+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Jp=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?el(e):""}function SI(e){switch(e.tag){case 5:return el(e.type);case 16:return el("Lazy");case 13:return el("Suspense");case 19:return el("SuspenseList");case 0:case 2:case 15:return e=eh(e.type,!1),e;case 11:return e=eh(e.type.render,!1),e;case 1:return e=eh(e.type,!0),e;default:return""}}function Pm(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 uo:return"Fragment";case co:return"Portal";case Cm:return"Profiler";case Mv:return"StrictMode";case Em:return"Suspense";case Tm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case RC:return(e.displayName||"Context")+".Consumer";case kC:return(e._context.displayName||"Context")+".Provider";case Ov:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _v:return t=e.displayName||null,t!==null?t:Pm(e.type)||"Memo";case gi:t=e._payload,e=e._init;try{return Pm(e(t))}catch{}}return null}function CI(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 Pm(t);case 8:return t===Mv?"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 zi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function IC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function EI(e){var t=IC(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,s=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tu(e){e._valueTracker||(e._valueTracker=EI(e))}function MC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=IC(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function ld(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 Dm(e,t){var r=t.checked;return nt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function F0(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=zi(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 OC(e,t){t=t.checked,t!=null&&Iv(e,"checked",t,!1)}function Am(e,t){OC(e,t);var r=zi(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")?Nm(e,t.type,r):t.hasOwnProperty("defaultValue")&&Nm(e,t.type,zi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function V0(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 Nm(e,t,r){(t!=="number"||ld(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var tl=Array.isArray;function Do(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=ru.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ol(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var pl={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},TI=["Webkit","ms","Moz","O"];Object.keys(pl).forEach(function(e){TI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),pl[t]=pl[e]})});function VC(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||pl.hasOwnProperty(e)&&pl[e]?(""+t).trim():t+"px"}function $C(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=VC(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var PI=nt({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 jm(e,t){if(t){if(PI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function Im(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 Mm=null;function Lv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Om=null,Ao=null,No=null;function U0(e){if(e=Cc(e)){if(typeof Om!="function")throw Error(K(280));var t=e.stateNode;t&&(t=jf(t),Om(e.stateNode,e.type,t))}}function BC(e){Ao?No?No.push(e):No=[e]:Ao=e}function UC(){if(Ao){var e=Ao,t=No;if(No=Ao=null,U0(e),t)for(e=0;e>>=0,e===0?32:31-(LI(e)/FI|0)|0}var nu=64,iu=4194304;function rl(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 fd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,s=e.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=rl(a):(s&=o,s!==0&&(n=rl(s)))}else o=r&~i,o!==0?n=rl(o):s!==0&&(n=rl(s));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,s=t&-t,i>=s||i===16&&(s&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 bc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-nn(t),e[t]=r}function UI(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=ml),Z0=" ",X0=!1;function lE(e,t){switch(e){case"keyup":return gM.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cE(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fo=!1;function yM(e,t){switch(e){case"compositionend":return cE(t);case"keypress":return t.which!==32?null:(X0=!0,Z0);case"textInput":return e=t.data,e===Z0&&X0?null:e;default:return null}}function xM(e,t){if(fo)return e==="compositionend"||!Hv&&lE(e,t)?(e=oE(),$u=Uv=ki=null,fo=!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=rw(r)}}function pE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hE(){for(var e=window,t=ld();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ld(e.document)}return t}function Gv(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 AM(e){var t=hE(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&pE(r.ownerDocument.documentElement,r)){if(n!==null&&Gv(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,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!e.extend&&s>n&&(i=n,n=s,s=i),i=nw(r,s);var o=nw(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,po=null,Bm=null,vl=null,Um=!1;function iw(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Um||po==null||po!==ld(n)||(n=po,"selectionStart"in n&&Gv(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}),vl&&Bl(vl,n)||(vl=n,n=md(Bm,"onSelect"),0go||(e.current=qm[go],qm[go]=null,go--)}function Ke(e,t){go++,qm[go]=e.current,e.current=t}var Wi={},Ft=ts(Wi),nr=ts(!1),Ms=Wi;function ia(e,t){var r=e.type.contextTypes;if(!r)return Wi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ir(e){return e=e.childContextTypes,e!=null}function vd(){Ze(nr),Ze(Ft)}function dw(e,t,r){if(Ft.current!==Wi)throw Error(K(168));Ke(Ft,t),Ke(nr,r)}function CE(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(K(108,CI(e)||"Unknown",i));return nt({},r,n)}function yd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wi,Ms=Ft.current,Ke(Ft,e),Ke(nr,nr.current),!0}function fw(e,t,r){var n=e.stateNode;if(!n)throw Error(K(169));r?(e=CE(e,t,Ms),n.__reactInternalMemoizedMergedChildContext=e,Ze(nr),Ze(Ft),Ke(Ft,e)):Ze(nr),Ke(nr,r)}var $n=null,If=!1,hh=!1;function EE(e){$n===null?$n=[e]:$n.push(e)}function $M(e){If=!0,EE(e)}function rs(){if(!hh&&$n!==null){hh=!0;var e=0,t=ze;try{var r=$n;for(ze=1;e>=o,i-=o,Un=1<<32-nn(t)+i|r<k?(R=N,N=null):R=N.sibling;var M=p(x,N,b[k],S);if(M===null){N===null&&(N=R);break}e&&N&&M.alternate===null&&t(x,N),y=s(M,y,k),D===null?C=M:D.sibling=M,D=M,N=R}if(k===b.length)return r(x,N),Je&&us(x,k),C;if(N===null){for(;kk?(R=N,N=null):R=N.sibling;var W=p(x,N,M.value,S);if(W===null){N===null&&(N=R);break}e&&N&&W.alternate===null&&t(x,N),y=s(W,y,k),D===null?C=W:D.sibling=W,D=W,N=R}if(M.done)return r(x,N),Je&&us(x,k),C;if(N===null){for(;!M.done;k++,M=b.next())M=d(x,M.value,S),M!==null&&(y=s(M,y,k),D===null?C=M:D.sibling=M,D=M);return Je&&us(x,k),C}for(N=n(x,N);!M.done;k++,M=b.next())M=h(N,x,k,M.value,S),M!==null&&(e&&M.alternate!==null&&N.delete(M.key===null?k:M.key),y=s(M,y,k),D===null?C=M:D.sibling=M,D=M);return e&&N.forEach(function(V){return t(x,V)}),Je&&us(x,k),C}function w(x,y,b,S){if(typeof b=="object"&&b!==null&&b.type===uo&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case eu:e:{for(var C=b.key,D=y;D!==null;){if(D.key===C){if(C=b.type,C===uo){if(D.tag===7){r(x,D.sibling),y=i(D,b.props.children),y.return=x,x=y;break e}}else if(D.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===gi&&mw(C)===D.type){r(x,D.sibling),y=i(D,b.props),y.ref=Ba(x,D,b),y.return=x,x=y;break e}r(x,D);break}else t(x,D);D=D.sibling}b.type===uo?(y=Rs(b.props.children,x.mode,S,b.key),y.return=x,x=y):(S=qu(b.type,b.key,b.props,null,x.mode,S),S.ref=Ba(x,y,b),S.return=x,x=S)}return o(x);case co:e:{for(D=b.key;y!==null;){if(y.key===D)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){r(x,y.sibling),y=i(y,b.children||[]),y.return=x,x=y;break e}else{r(x,y);break}else t(x,y);y=y.sibling}y=Sh(b,x.mode,S),y.return=x,x=y}return o(x);case gi:return D=b._init,w(x,y,D(b._payload),S)}if(tl(b))return g(x,y,b,S);if(_a(b))return v(x,y,b,S);du(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(r(x,y.sibling),y=i(y,b),y.return=x,x=y):(r(x,y),y=bh(b,x.mode,S),y.return=x,x=y),o(x)):r(x,y)}return w}var oa=AE(!0),NE=AE(!1),bd=ts(null),Sd=null,xo=null,Yv=null;function Zv(){Yv=xo=Sd=null}function Xv(e){var t=bd.current;Ze(bd),e._currentValue=t}function Zm(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 Ro(e,t){Sd=e,Yv=xo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(rr=!0),e.firstContext=null)}function Vr(e){var t=e._currentValue;if(Yv!==e)if(e={context:e,memoizedValue:t,next:null},xo===null){if(Sd===null)throw Error(K(308));xo=e,Sd.dependencies={lanes:0,firstContext:e}}else xo=xo.next=e;return t}var vs=null;function Jv(e){vs===null?vs=[e]:vs.push(e)}function kE(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Jv(t)):(r.next=i.next,i.next=r),t.interleaved=r,ei(e,n)}function ei(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 vi=!1;function ey(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function RE(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 Gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function _i(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Le&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,ei(e,r)}return i=n.interleaved,i===null?(t.next=t,Jv(n)):(t.next=i.next,i.next=t),n.interleaved=t,ei(e,r)}function Uu(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,Vv(e,r)}}function gw(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,s=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};s===null?i=s=o:s=s.next=o,r=r.next}while(r!==null);s===null?i=s=t:s=s.next=t}else i=s=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:s,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 Cd(e,t,r,n){var i=e.updateQueue;vi=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;o=0,u=c=l=null,a=s;do{var p=a.lane,h=a.eventTime;if((n&p)===p){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,v=a;switch(p=t,h=r,v.tag){case 1:if(g=v.payload,typeof g=="function"){d=g.call(h,d,p);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,p=typeof g=="function"?g.call(h,d,p):g,p==null)break e;d=nt({},d,p);break e;case 2:vi=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=d):u=u.next=h,o|=p;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;p=a,a=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Ls|=o,e.lanes=o,e.memoizedState=d}}function vw(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=gh.transition;gh.transition={};try{e(!1),t()}finally{ze=r,gh.transition=n}}function qE(){return $r().memoizedState}function WM(e,t,r){var n=Fi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},QE(e))YE(t,r);else if(r=kE(e,t,r,n),r!==null){var i=Wt();sn(r,e,n,i),ZE(r,t,n)}}function HM(e,t,r){var n=Fi(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(QE(e))YE(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,on(a,o)){var l=t.interleaved;l===null?(i.next=i,Jv(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=kE(e,t,i,n),r!==null&&(i=Wt(),sn(r,e,n,i),ZE(r,t,n))}}function QE(e){var t=e.alternate;return e===rt||t!==null&&t===rt}function YE(e,t){yl=Td=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function ZE(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Vv(e,r)}}var Pd={readContext:Vr,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useInsertionEffect:jt,useLayoutEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useMutableSource:jt,useSyncExternalStore:jt,useId:jt,unstable_isNewReconciler:!1},GM={readContext:Vr,useCallback:function(e,t){return pn().memoizedState=[e,t===void 0?null:t],e},useContext:Vr,useEffect:xw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Wu(4194308,4,zE.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Wu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Wu(4,2,e,t)},useMemo:function(e,t){var r=pn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=pn();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=WM.bind(null,rt,e),[n.memoizedState,e]},useRef:function(e){var t=pn();return e={current:e},t.memoizedState=e},useState:yw,useDebugValue:ly,useDeferredValue:function(e){return pn().memoizedState=e},useTransition:function(){var e=yw(!1),t=e[0];return e=zM.bind(null,e[1]),pn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=rt,i=pn();if(Je){if(r===void 0)throw Error(K(407));r=r()}else{if(r=t(),St===null)throw Error(K(349));_s&30||OE(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,xw(LE.bind(null,n,s,e),[e]),n.flags|=2048,Ql(9,_E.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=pn(),t=St.identifierPrefix;if(Je){var r=zn,n=Un;r=(n&~(1<<32-nn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Kl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[yn]=t,e[Wl]=n,aT(e,t,!1,!1),t.stateNode=e;e:{switch(o=Im(r,n),r){case"dialog":Ye("cancel",e),Ye("close",e),i=n;break;case"iframe":case"object":case"embed":Ye("load",e),i=n;break;case"video":case"audio":for(i=0;ica&&(t.flags|=128,n=!0,Ua(s,!1),t.lanes=4194304)}else{if(!n)if(e=Ed(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ua(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Je)return It(t),null}else 2*ht()-s.renderingStartTime>ca&&r!==1073741824&&(t.flags|=128,n=!0,Ua(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(r=s.last,r!==null?r.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ht(),t.sibling=null,r=et.current,Ke(et,n?r&1|2:r&1),t):(It(t),null);case 22:case 23:return hy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?cr&1073741824&&(It(t),t.subtreeFlags&6&&(t.flags|=8192)):It(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function e2(e,t){switch(qv(t),t.tag){case 1:return ir(t.type)&&vd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(),Ze(nr),Ze(Ft),ny(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ry(t),null;case 13:if(Ze(et),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ze(et),null;case 4:return aa(),null;case 10:return Xv(t.type._context),null;case 22:case 23:return hy(),null;case 24:return null;default:return null}}var pu=!1,_t=!1,t2=typeof WeakSet=="function"?WeakSet:Set,le=null;function wo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ct(e,t,n)}else r.current=null}function og(e,t,r){try{r()}catch(n){ct(e,t,n)}}var kw=!1;function r2(e,t){if(zm=pd,e=hE(),Gv(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,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,c=0,u=0,d=e,p=null;t:for(;;){for(var h;d!==r||i!==0&&d.nodeType!==3||(a=o+i),d!==s||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===r&&++c===i&&(a=o),p===s&&++u===n&&(l=o),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Wm={focusedElem:e,selectionRange:r},pd=!1,le=t;le!==null;)if(t=le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,le=e;else for(;le!==null;){t=le;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,w=g.memoizedState,x=t.stateNode,y=x.getSnapshotBeforeUpdate(t.elementType===t.type?v:zr(t.type,v),w);x.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(S){ct(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,le=e;break}le=t.return}return g=kw,kw=!1,g}function xl(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 s=i.destroy;i.destroy=void 0,s!==void 0&&og(t,r,s)}i=i.next}while(i!==n)}}function _f(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 ag(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 uT(e){var t=e.alternate;t!==null&&(e.alternate=null,uT(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yn],delete t[Wl],delete t[Km],delete t[FM],delete t[VM])),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 dT(e){return e.tag===5||e.tag===3||e.tag===4}function Rw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dT(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 lg(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=gd));else if(n!==4&&(e=e.child,e!==null))for(lg(e,t,r),e=e.sibling;e!==null;)lg(e,t,r),e=e.sibling}function cg(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(cg(e,t,r),e=e.sibling;e!==null;)cg(e,t,r),e=e.sibling}var Dt=null,Hr=!1;function ui(e,t,r){for(r=r.child;r!==null;)fT(e,t,r),r=r.sibling}function fT(e,t,r){if(En&&typeof En.onCommitFiberUnmount=="function")try{En.onCommitFiberUnmount(Af,r)}catch{}switch(r.tag){case 5:_t||wo(r,t);case 6:var n=Dt,i=Hr;Dt=null,ui(e,t,r),Dt=n,Hr=i,Dt!==null&&(Hr?(e=Dt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Dt.removeChild(r.stateNode));break;case 18:Dt!==null&&(Hr?(e=Dt,r=r.stateNode,e.nodeType===8?ph(e.parentNode,r):e.nodeType===1&&ph(e,r),Vl(e)):ph(Dt,r.stateNode));break;case 4:n=Dt,i=Hr,Dt=r.stateNode.containerInfo,Hr=!0,ui(e,t,r),Dt=n,Hr=i;break;case 0:case 11:case 14:case 15:if(!_t&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&og(r,t,o),i=i.next}while(i!==n)}ui(e,t,r);break;case 1:if(!_t&&(wo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){ct(r,t,a)}ui(e,t,r);break;case 21:ui(e,t,r);break;case 22:r.mode&1?(_t=(n=_t)||r.memoizedState!==null,ui(e,t,r),_t=n):ui(e,t,r);break;default:ui(e,t,r)}}function jw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new t2),t.forEach(function(n){var i=d2.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Br(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=ht()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*i2(n/1960))-n,10e?16:e,Ri===null)var n=!1;else{if(e=Ri,Ri=null,Nd=0,Le&6)throw Error(K(331));var i=Le;for(Le|=4,le=e.current;le!==null;){var s=le,o=s.child;if(le.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lht()-fy?ks(e,0):dy|=r),sr(e,t)}function wT(e,t){t===0&&(e.mode&1?(t=iu,iu<<=1,!(iu&130023424)&&(iu=4194304)):t=1);var r=Wt();e=ei(e,t),e!==null&&(bc(e,t,r),sr(e,r))}function u2(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),wT(e,r)}function d2(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(K(314))}n!==null&&n.delete(t),wT(e,r)}var bT;bT=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||nr.current)rr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return rr=!1,XM(e,t,r);rr=!!(e.flags&131072)}else rr=!1,Je&&t.flags&1048576&&TE(t,wd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Hu(e,t),e=t.pendingProps;var i=ia(t,Ft.current);Ro(t,r),i=sy(null,t,n,e,i,r);var s=oy();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,ir(n)?(s=!0,yd(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,ey(t),i.updater=Of,t.stateNode=i,i._reactInternals=t,Jm(t,n,e,r),t=rg(null,t,n,!0,s,r)):(t.tag=0,Je&&s&&Kv(t),Ut(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Hu(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=p2(n),e=zr(n,e),i){case 0:t=tg(null,t,n,e,r);break e;case 1:t=Dw(null,t,n,e,r);break e;case 11:t=Tw(null,t,n,e,r);break e;case 14:t=Pw(null,t,n,zr(n.type,e),r);break e}throw Error(K(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:zr(n,i),tg(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:zr(n,i),Dw(e,t,n,i,r);case 3:e:{if(iT(t),e===null)throw Error(K(387));n=t.pendingProps,s=t.memoizedState,i=s.element,RE(e,t),Cd(t,n,null,r);var o=t.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=la(Error(K(423)),t),t=Aw(e,t,n,r,i);break e}else if(n!==i){i=la(Error(K(424)),t),t=Aw(e,t,n,r,i);break e}else for(dr=Oi(t.stateNode.containerInfo.firstChild),pr=t,Je=!0,Gr=null,r=NE(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(sa(),n===i){t=ti(e,t,r);break e}Ut(e,t,n,r)}t=t.child}return t;case 5:return jE(t),e===null&&Ym(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Hm(n,i)?o=null:s!==null&&Hm(n,s)&&(t.flags|=32),nT(e,t),Ut(e,t,o,r),t.child;case 6:return e===null&&Ym(t),null;case 13:return sT(e,t,r);case 4:return ty(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=oa(t,null,n,r):Ut(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:zr(n,i),Tw(e,t,n,i,r);case 7:return Ut(e,t,t.pendingProps,r),t.child;case 8:return Ut(e,t,t.pendingProps.children,r),t.child;case 12:return Ut(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Ke(bd,n._currentValue),n._currentValue=o,s!==null)if(on(s.value,o)){if(s.children===i.children&&!nr.current){t=ti(e,t,r);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(s.tag===1){l=Gn(-1,r&-r),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),Zm(s.return,r,t),a.lanes|=r;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(K(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Zm(o,r,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ut(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,Ro(t,r),i=Vr(i),n=n(i),t.flags|=1,Ut(e,t,n,r),t.child;case 14:return n=t.type,i=zr(n,t.pendingProps),i=zr(n.type,i),Pw(e,t,n,i,r);case 15:return tT(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:zr(n,i),Hu(e,t),t.tag=1,ir(n)?(e=!0,yd(t)):e=!1,Ro(t,r),XE(t,n,i),Jm(t,n,i,r),rg(null,t,n,!0,e,r);case 19:return oT(e,t,r);case 22:return rT(e,t,r)}throw Error(K(156,t.tag))};function ST(e,t){return QC(e,t)}function f2(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 jr(e,t,r,n){return new f2(e,t,r,n)}function gy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function p2(e){if(typeof e=="function")return gy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ov)return 11;if(e===_v)return 14}return 2}function Vi(e,t){var r=e.alternate;return r===null?(r=jr(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 qu(e,t,r,n,i,s){var o=2;if(n=e,typeof e=="function")gy(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case uo:return Rs(r.children,i,s,t);case Mv:o=8,i|=8;break;case Cm:return e=jr(12,r,t,i|2),e.elementType=Cm,e.lanes=s,e;case Em:return e=jr(13,r,t,i),e.elementType=Em,e.lanes=s,e;case Tm:return e=jr(19,r,t,i),e.elementType=Tm,e.lanes=s,e;case jC:return Ff(r,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case kC:o=10;break e;case RC:o=9;break e;case Ov:o=11;break e;case _v:o=14;break e;case gi:o=16,n=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=jr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function Rs(e,t,r,n){return e=jr(7,e,n,t),e.lanes=r,e}function Ff(e,t,r,n){return e=jr(22,e,n,t),e.elementType=jC,e.lanes=r,e.stateNode={isHidden:!1},e}function bh(e,t,r){return e=jr(6,e,null,t),e.lanes=r,e}function Sh(e,t,r){return t=jr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function h2(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=rh(0),this.expirationTimes=rh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rh(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function vy(e,t,r,n,i,s,o,a,l){return e=new h2(e,t,r,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=jr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ey(s),e}function m2(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(PT)}catch(e){console.error(e)}}PT(),PC.exports=wr;var Pa=PC.exports;const DT=Sa(Pa);var AT,$w=Pa;AT=$w.createRoot,$w.hydrateRoot;var Da=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(){}},Vs=typeof window>"u"||"Deno"in globalThis;function Ar(){}function w2(e,t){return typeof e=="function"?e(t):e}function hg(e){return typeof e=="number"&&e>=0&&e!==1/0}function NT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Io(e,t){return typeof e=="function"?e(t):e}function Kr(e,t){return typeof e=="function"?e(t):e}function Bw(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==by(o,t.options))return!1}else if(!Zl(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function Uw(e,t){const{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if($s(t.options.mutationKey)!==$s(s))return!1}else if(!Zl(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function by(e,t){return((t==null?void 0:t.queryKeyHashFn)||$s)(e)}function $s(e){return JSON.stringify(e,(t,r)=>mg(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Zl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!Zl(e[r],t[r])):!1}function kT(e,t){if(e===t)return e;const r=zw(e)&&zw(t);if(r||mg(e)&&mg(t)){const n=r?e:Object.keys(e),i=n.length,s=r?t:Object.keys(t),o=s.length,a=r?[]:{};let l=0;for(let c=0;c{setTimeout(t,e)})}function gg(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?kT(e,t):t}function S2(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function C2(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Sy=Symbol();function RT(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Sy?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Ss,bi,Wo,iC,E2=(iC=class extends Da{constructor(){super();ve(this,Ss);ve(this,bi);ve(this,Wo);se(this,Wo,t=>{if(!Vs&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){j(this,bi)||this.setEventListener(j(this,Wo))}onUnsubscribe(){var t;this.hasListeners()||((t=j(this,bi))==null||t.call(this),se(this,bi,void 0))}setEventListener(t){var r;se(this,Wo,t),(r=j(this,bi))==null||r.call(this),se(this,bi,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){j(this,Ss)!==t&&(se(this,Ss,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof j(this,Ss)=="boolean"?j(this,Ss):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ss=new WeakMap,bi=new WeakMap,Wo=new WeakMap,iC),Cy=new E2,Ho,Si,Go,sC,T2=(sC=class extends Da{constructor(){super();ve(this,Ho,!0);ve(this,Si);ve(this,Go);se(this,Go,t=>{if(!Vs&&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(){j(this,Si)||this.setEventListener(j(this,Go))}onUnsubscribe(){var t;this.hasListeners()||((t=j(this,Si))==null||t.call(this),se(this,Si,void 0))}setEventListener(t){var r;se(this,Go,t),(r=j(this,Si))==null||r.call(this),se(this,Si,t(this.setOnline.bind(this)))}setOnline(t){j(this,Ho)!==t&&(se(this,Ho,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return j(this,Ho)}},Ho=new WeakMap,Si=new WeakMap,Go=new WeakMap,sC),Id=new T2;function vg(){let e,t;const r=new Promise((i,s)=>{e=i,t=s});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 P2(e){return Math.min(1e3*2**e,3e4)}function jT(e){return(e??"online")==="online"?Id.isOnline():!0}var IT=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ch(e){return e instanceof IT}function MT(e){let t=!1,r=0,n=!1,i;const s=vg(),o=v=>{var w;n||(p(new IT(v)),(w=e.abort)==null||w.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>Cy.isFocused()&&(e.networkMode==="always"||Id.isOnline())&&e.canRun(),u=()=>jT(e.networkMode)&&e.canRun(),d=v=>{var w;n||(n=!0,(w=e.onSuccess)==null||w.call(e,v),i==null||i(),s.resolve(v))},p=v=>{var w;n||(n=!0,(w=e.onError)==null||w.call(e,v),i==null||i(),s.reject(v))},h=()=>new Promise(v=>{var w;i=x=>{(n||c())&&v(x)},(w=e.onPause)==null||w.call(e)}).then(()=>{var v;i=void 0,n||(v=e.onContinue)==null||v.call(e)}),g=()=>{if(n)return;let v;const w=r===0?e.initialPromise:void 0;try{v=w??e.fn()}catch(x){v=Promise.reject(x)}Promise.resolve(v).then(d).catch(x=>{var D;if(n)return;const y=e.retry??(Vs?0:3),b=e.retryDelay??P2,S=typeof b=="function"?b(r,x):b,C=y===!0||typeof y=="number"&&rc()?void 0:h()).then(()=>{t?p(x):g()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?g():h().then(g),s)}}function D2(){let e=[],t=0,r=a=>{a()},n=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{t?e.push(a):i(()=>{r(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{n(()=>{a.forEach(l=>{r(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{i=a}}}var xt=D2(),Cs,oC,OT=(oC=class{constructor(){ve(this,Cs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),hg(this.gcTime)&&se(this,Cs,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Vs?1/0:5*60*1e3))}clearGcTimeout(){j(this,Cs)&&(clearTimeout(j(this,Cs)),se(this,Cs,void 0))}},Cs=new WeakMap,oC),Ko,qo,Dr,Mt,gc,Es,Wr,Ln,aC,A2=(aC=class extends OT{constructor(t){super();ve(this,Wr);ve(this,Ko);ve(this,qo);ve(this,Dr);ve(this,Mt);ve(this,gc);ve(this,Es);se(this,Es,!1),se(this,gc,t.defaultOptions),this.setOptions(t.options),this.observers=[],se(this,Dr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,se(this,Ko,N2(this.options)),this.state=t.state??j(this,Ko),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=j(this,Mt))==null?void 0:t.promise}setOptions(t){this.options={...j(this,gc),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&j(this,Dr).remove(this)}setData(t,r){const n=gg(this.state.data,t,this.options);return Ne(this,Wr,Ln).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Ne(this,Wr,Ln).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=j(this,Mt))==null?void 0:n.promise;return(i=j(this,Mt))==null||i.cancel(t),r?r.then(Ar).catch(Ar):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(j(this,Ko))}isActive(){return this.observers.some(t=>Kr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Sy||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||!NT(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=j(this,Mt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=j(this,Mt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),j(this,Dr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(j(this,Mt)&&(j(this,Es)?j(this,Mt).cancel({revert:!0}):j(this,Mt).cancelRetry()),this.scheduleGc()),j(this,Dr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ne(this,Wr,Ln).call(this,{type:"invalidate"})}fetch(t,r){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(j(this,Mt))return j(this,Mt).continueRetry(),j(this,Mt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(p=>p.options.queryFn);d&&this.setOptions(d.options)}const n=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(se(this,Es,!0),n.signal)})},s=()=>{const d=RT(this.options,r),p={queryKey:this.queryKey,meta:this.meta};return i(p),se(this,Es,!1),this.options.persister?this.options.persister(d,p,this):d(p)},o={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),se(this,qo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&Ne(this,Wr,Ln).call(this,{type:"fetch",meta:(u=o.fetchOptions)==null?void 0:u.meta});const a=d=>{var p,h,g,v;Ch(d)&&d.silent||Ne(this,Wr,Ln).call(this,{type:"error",error:d}),Ch(d)||((h=(p=j(this,Dr).config).onError)==null||h.call(p,d,this),(v=(g=j(this,Dr).config).onSettled)==null||v.call(g,this.state.data,d,this)),this.scheduleGc()};return se(this,Mt,MT({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:d=>{var p,h,g,v;if(d===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(w){a(w);return}(h=(p=j(this,Dr).config).onSuccess)==null||h.call(p,d,this),(v=(g=j(this,Dr).config).onSettled)==null||v.call(g,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,p)=>{Ne(this,Wr,Ln).call(this,{type:"failed",failureCount:d,error:p})},onPause:()=>{Ne(this,Wr,Ln).call(this,{type:"pause"})},onContinue:()=>{Ne(this,Wr,Ln).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),j(this,Mt).start()}},Ko=new WeakMap,qo=new WeakMap,Dr=new WeakMap,Mt=new WeakMap,gc=new WeakMap,Es=new WeakMap,Wr=new WeakSet,Ln=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,..._T(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 Ch(i)&&i.revert&&j(this,qo)?{...j(this,qo),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()}),j(this,Dr).notify({query:this,type:"updated",action:t})})},aC);function _T(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:jT(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function N2(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 hn,lC,k2=(lC=class extends Da{constructor(t={}){super();ve(this,hn);this.config=t,se(this,hn,new Map)}build(t,r,n){const i=r.queryKey,s=r.queryHash??by(i,r);let o=this.get(s);return o||(o=new A2({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){j(this,hn).has(t.queryHash)||(j(this,hn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=j(this,hn).get(t.queryHash);r&&(t.destroy(),r===t&&j(this,hn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){xt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return j(this,hn).get(t)}getAll(){return[...j(this,hn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Bw(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Bw(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()})})}},hn=new WeakMap,lC),mn,$t,Ts,gn,pi,cC,R2=(cC=class extends OT{constructor(t){super();ve(this,gn);ve(this,mn);ve(this,$t);ve(this,Ts);this.mutationId=t.mutationId,se(this,$t,t.mutationCache),se(this,mn,[]),this.state=t.state||LT(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){j(this,mn).includes(t)||(j(this,mn).push(t),this.clearGcTimeout(),j(this,$t).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){se(this,mn,j(this,mn).filter(r=>r!==t)),this.scheduleGc(),j(this,$t).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){j(this,mn).length||(this.state.status==="pending"?this.scheduleGc():j(this,$t).remove(this))}continue(){var t;return((t=j(this,Ts))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,c,u,d,p,h,g,v,w,x,y,b,S,C,D,N;se(this,Ts,MT({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,R)=>{Ne(this,gn,pi).call(this,{type:"failed",failureCount:k,error:R})},onPause:()=>{Ne(this,gn,pi).call(this,{type:"pause"})},onContinue:()=>{Ne(this,gn,pi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>j(this,$t).canRun(this)}));const r=this.state.status==="pending",n=!j(this,Ts).canStart();try{if(!r){Ne(this,gn,pi).call(this,{type:"pending",variables:t,isPaused:n}),await((s=(i=j(this,$t).config).onMutate)==null?void 0:s.call(i,t,this));const R=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));R!==this.state.context&&Ne(this,gn,pi).call(this,{type:"pending",context:R,variables:t,isPaused:n})}const k=await j(this,Ts).start();return await((c=(l=j(this,$t).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,k,t,this.state.context)),await((h=(p=j(this,$t).config).onSettled)==null?void 0:h.call(p,k,null,this.state.variables,this.state.context,this)),await((v=(g=this.options).onSettled)==null?void 0:v.call(g,k,null,t,this.state.context)),Ne(this,gn,pi).call(this,{type:"success",data:k}),k}catch(k){try{throw await((x=(w=j(this,$t).config).onError)==null?void 0:x.call(w,k,t,this.state.context,this)),await((b=(y=this.options).onError)==null?void 0:b.call(y,k,t,this.state.context)),await((C=(S=j(this,$t).config).onSettled)==null?void 0:C.call(S,void 0,k,this.state.variables,this.state.context,this)),await((N=(D=this.options).onSettled)==null?void 0:N.call(D,void 0,k,t,this.state.context)),k}finally{Ne(this,gn,pi).call(this,{type:"error",error:k})}}finally{j(this,$t).runNext(this)}}},mn=new WeakMap,$t=new WeakMap,Ts=new WeakMap,gn=new WeakSet,pi=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(()=>{j(this,mn).forEach(n=>{n.onMutationUpdate(t)}),j(this,$t).notify({mutation:this,type:"updated",action:t})})},cC);function LT(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var lr,vc,uC,j2=(uC=class extends Da{constructor(t={}){super();ve(this,lr);ve(this,vc);this.config=t,se(this,lr,new Map),se(this,vc,Date.now())}build(t,r,n){const i=new R2({mutationCache:this,mutationId:++Xc(this,vc)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){const r=gu(t),n=j(this,lr).get(r)??[];n.push(t),j(this,lr).set(r,n),this.notify({type:"added",mutation:t})}remove(t){var n;const r=gu(t);if(j(this,lr).has(r)){const i=(n=j(this,lr).get(r))==null?void 0:n.filter(s=>s!==t);i&&(i.length===0?j(this,lr).delete(r):j(this,lr).set(r,i))}this.notify({type:"removed",mutation:t})}canRun(t){var n;const r=(n=j(this,lr).get(gu(t)))==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===t}runNext(t){var n;const r=(n=j(this,lr).get(gu(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[...j(this,lr).values()].flat()}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Uw(r,n))}findAll(t={}){return this.getAll().filter(r=>Uw(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(Ar))))}},lr=new WeakMap,vc=new WeakMap,uC);function gu(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Hw(e){return{onFetch:(t,r)=>{var u,d,p,h,g;const n=t.options,i=(p=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const w=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},x=RT(t.options,t.fetchOptions),y=async(b,S,C)=>{if(v)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const D={queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};w(D);const N=await x(D),{maxPages:k}=t.options,R=C?C2:S2;return{pages:R(b.pages,N,k),pageParams:R(b.pageParams,S,k)}};if(i&&s.length){const b=i==="backward",S=b?I2:Gw,C={pages:s,pageParams:o},D=S(n,C);a=await y(C,D,b)}else{const b=e??s.length;do{const S=l===0?o[0]??n.initialPageParam:Gw(n,a);if(l>0&&S==null)break;a=await y(a,S),l++}while(l{var v,w;return(w=(v=t.options).persister)==null?void 0:w.call(v,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=c}}}function Gw(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 I2(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 ot,Ci,Ei,Qo,Yo,Ti,Zo,Xo,dC,M2=(dC=class{constructor(e={}){ve(this,ot);ve(this,Ci);ve(this,Ei);ve(this,Qo);ve(this,Yo);ve(this,Ti);ve(this,Zo);ve(this,Xo);se(this,ot,e.queryCache||new k2),se(this,Ci,e.mutationCache||new j2),se(this,Ei,e.defaultOptions||{}),se(this,Qo,new Map),se(this,Yo,new Map),se(this,Ti,0)}mount(){Xc(this,Ti)._++,j(this,Ti)===1&&(se(this,Zo,Cy.subscribe(async e=>{e&&(await this.resumePausedMutations(),j(this,ot).onFocus())})),se(this,Xo,Id.subscribe(async e=>{e&&(await this.resumePausedMutations(),j(this,ot).onOnline())})))}unmount(){var e,t;Xc(this,Ti)._--,j(this,Ti)===0&&((e=j(this,Zo))==null||e.call(this),se(this,Zo,void 0),(t=j(this,Xo))==null||t.call(this),se(this,Xo,void 0))}isFetching(e){return j(this,ot).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return j(this,Ci).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=j(this,ot).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=j(this,ot).build(this,r);return e.revalidateIfStale&&n.isStaleByTime(Io(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(t)}}getQueriesData(e){return j(this,ot).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=j(this,ot).get(n.queryHash),s=i==null?void 0:i.state.data,o=w2(t,s);if(o!==void 0)return j(this,ot).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return xt.batch(()=>j(this,ot).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=j(this,ot).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=j(this,ot);xt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=j(this,ot),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(()=>j(this,ot).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Ar).catch(Ar)}invalidateQueries(e={},t={}){return xt.batch(()=>{if(j(this,ot).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(()=>j(this,ot).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Ar)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Ar)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=j(this,ot).build(this,t);return r.isStaleByTime(Io(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ar).catch(Ar)}fetchInfiniteQuery(e){return e.behavior=Hw(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ar).catch(Ar)}ensureInfiniteQueryData(e){return e.behavior=Hw(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Id.isOnline()?j(this,Ci).resumePausedMutations():Promise.resolve()}getQueryCache(){return j(this,ot)}getMutationCache(){return j(this,Ci)}getDefaultOptions(){return j(this,Ei)}setDefaultOptions(e){se(this,Ei,e)}setQueryDefaults(e,t){j(this,Qo).set($s(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...j(this,Qo).values()];let r={};return t.forEach(n=>{Zl(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){j(this,Yo).set($s(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...j(this,Yo).values()];let r={};return t.forEach(n=>{Zl(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...j(this,Ei).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=by(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===Sy&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...j(this,Ei).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){j(this,ot).clear(),j(this,Ci).clear()}},ot=new WeakMap,Ci=new WeakMap,Ei=new WeakMap,Qo=new WeakMap,Yo=new WeakMap,Ti=new WeakMap,Zo=new WeakMap,Xo=new WeakMap,dC),Xt,Me,yc,Bt,Ps,Jo,Pi,vn,xc,ea,ta,Ds,As,Di,ra,Ue,il,yg,xg,wg,bg,Sg,Cg,Eg,FT,fC,O2=(fC=class extends Da{constructor(t,r){super();ve(this,Ue);ve(this,Xt);ve(this,Me);ve(this,yc);ve(this,Bt);ve(this,Ps);ve(this,Jo);ve(this,Pi);ve(this,vn);ve(this,xc);ve(this,ea);ve(this,ta);ve(this,Ds);ve(this,As);ve(this,Di);ve(this,ra,new Set);this.options=r,se(this,Xt,t),se(this,vn,null),se(this,Pi,vg()),this.options.experimental_prefetchInRender||j(this,Pi).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&&(j(this,Me).addObserver(this),Kw(j(this,Me),this.options)?Ne(this,Ue,il).call(this):this.updateResult(),Ne(this,Ue,bg).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Tg(j(this,Me),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Tg(j(this,Me),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ne(this,Ue,Sg).call(this),Ne(this,Ue,Cg).call(this),j(this,Me).removeObserver(this)}setOptions(t,r){const n=this.options,i=j(this,Me);if(this.options=j(this,Xt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Kr(this.options.enabled,j(this,Me))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ne(this,Ue,Eg).call(this),j(this,Me).setOptions(this.options),n._defaulted&&!jd(this.options,n)&&j(this,Xt).getQueryCache().notify({type:"observerOptionsUpdated",query:j(this,Me),observer:this});const s=this.hasListeners();s&&qw(j(this,Me),i,this.options,n)&&Ne(this,Ue,il).call(this),this.updateResult(r),s&&(j(this,Me)!==i||Kr(this.options.enabled,j(this,Me))!==Kr(n.enabled,j(this,Me))||Io(this.options.staleTime,j(this,Me))!==Io(n.staleTime,j(this,Me)))&&Ne(this,Ue,yg).call(this);const o=Ne(this,Ue,xg).call(this);s&&(j(this,Me)!==i||Kr(this.options.enabled,j(this,Me))!==Kr(n.enabled,j(this,Me))||o!==j(this,Di))&&Ne(this,Ue,wg).call(this,o)}getOptimisticResult(t){const r=j(this,Xt).getQueryCache().build(j(this,Xt),t),n=this.createResult(r,t);return L2(this,n)&&(se(this,Bt,n),se(this,Jo,this.options),se(this,Ps,j(this,Me).state)),n}getCurrentResult(){return j(this,Bt)}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){j(this,ra).add(t)}getCurrentQuery(){return j(this,Me)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=j(this,Xt).defaultQueryOptions(t),n=j(this,Xt).getQueryCache().build(j(this,Xt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Ne(this,Ue,il).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),j(this,Bt)))}createResult(t,r){var k;const n=j(this,Me),i=this.options,s=j(this,Bt),o=j(this,Ps),a=j(this,Jo),c=t!==n?t.state:j(this,yc),{state:u}=t;let d={...u},p=!1,h;if(r._optimisticResults){const R=this.hasListeners(),M=!R&&Kw(t,r),W=R&&qw(t,n,r,i);(M||W)&&(d={...d,..._T(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:v,status:w}=d;if(r.select&&d.data!==void 0)if(s&&d.data===(o==null?void 0:o.data)&&r.select===j(this,xc))h=j(this,ea);else try{se(this,xc,r.select),h=r.select(d.data),h=gg(s==null?void 0:s.data,h,r),se(this,ea,h),se(this,vn,null)}catch(R){se(this,vn,R)}else h=d.data;if(r.placeholderData!==void 0&&h===void 0&&w==="pending"){let R;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))R=s.data;else if(R=typeof r.placeholderData=="function"?r.placeholderData((k=j(this,ta))==null?void 0:k.state.data,j(this,ta)):r.placeholderData,r.select&&R!==void 0)try{R=r.select(R),se(this,vn,null)}catch(M){se(this,vn,M)}R!==void 0&&(w="success",h=gg(s==null?void 0:s.data,R,r),p=!0)}j(this,vn)&&(g=j(this,vn),h=j(this,ea),v=Date.now(),w="error");const x=d.fetchStatus==="fetching",y=w==="pending",b=w==="error",S=y&&x,C=h!==void 0,N={status:w,fetchStatus:d.fetchStatus,isPending:y,isSuccess:w==="success",isError:b,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!y,isLoadingError:b&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:b&&C,isStale:Ey(t,r),refetch:this.refetch,promise:j(this,Pi)};if(this.options.experimental_prefetchInRender){const R=V=>{N.status==="error"?V.reject(N.error):N.data!==void 0&&V.resolve(N.data)},M=()=>{const V=se(this,Pi,N.promise=vg());R(V)},W=j(this,Pi);switch(W.status){case"pending":t.queryHash===n.queryHash&&R(W);break;case"fulfilled":(N.status==="error"||N.data!==W.value)&&M();break;case"rejected":(N.status!=="error"||N.error!==W.reason)&&M();break}}return N}updateResult(t){const r=j(this,Bt),n=this.createResult(j(this,Me),this.options);if(se(this,Ps,j(this,Me).state),se(this,Jo,this.options),j(this,Ps).data!==void 0&&se(this,ta,j(this,Me)),jd(n,r))return;se(this,Bt,n);const i={},s=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!j(this,ra).size)return!0;const l=new Set(a??j(this,ra));return this.options.throwOnError&&l.add("error"),Object.keys(j(this,Bt)).some(c=>{const u=c;return j(this,Bt)[u]!==r[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),Ne(this,Ue,FT).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ne(this,Ue,bg).call(this)}},Xt=new WeakMap,Me=new WeakMap,yc=new WeakMap,Bt=new WeakMap,Ps=new WeakMap,Jo=new WeakMap,Pi=new WeakMap,vn=new WeakMap,xc=new WeakMap,ea=new WeakMap,ta=new WeakMap,Ds=new WeakMap,As=new WeakMap,Di=new WeakMap,ra=new WeakMap,Ue=new WeakSet,il=function(t){Ne(this,Ue,Eg).call(this);let r=j(this,Me).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Ar)),r},yg=function(){Ne(this,Ue,Sg).call(this);const t=Io(this.options.staleTime,j(this,Me));if(Vs||j(this,Bt).isStale||!hg(t))return;const n=NT(j(this,Bt).dataUpdatedAt,t)+1;se(this,Ds,setTimeout(()=>{j(this,Bt).isStale||this.updateResult()},n))},xg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(j(this,Me)):this.options.refetchInterval)??!1},wg=function(t){Ne(this,Ue,Cg).call(this),se(this,Di,t),!(Vs||Kr(this.options.enabled,j(this,Me))===!1||!hg(j(this,Di))||j(this,Di)===0)&&se(this,As,setInterval(()=>{(this.options.refetchIntervalInBackground||Cy.isFocused())&&Ne(this,Ue,il).call(this)},j(this,Di)))},bg=function(){Ne(this,Ue,yg).call(this),Ne(this,Ue,wg).call(this,Ne(this,Ue,xg).call(this))},Sg=function(){j(this,Ds)&&(clearTimeout(j(this,Ds)),se(this,Ds,void 0))},Cg=function(){j(this,As)&&(clearInterval(j(this,As)),se(this,As,void 0))},Eg=function(){const t=j(this,Xt).getQueryCache().build(j(this,Xt),this.options);if(t===j(this,Me))return;const r=j(this,Me);se(this,Me,t),se(this,yc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},FT=function(t){xt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(j(this,Bt))}),j(this,Xt).getQueryCache().notify({query:j(this,Me),type:"observerResultsUpdated"})})},fC);function _2(e,t){return Kr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Kw(e,t){return _2(e,t)||e.state.data!==void 0&&Tg(e,t,t.refetchOnMount)}function Tg(e,t,r){if(Kr(t.enabled,e)!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ey(e,t)}return!1}function qw(e,t,r,n){return(e!==t||Kr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ey(e,r)}function Ey(e,t){return Kr(t.enabled,e)!==!1&&e.isStaleByTime(Io(t.staleTime,e))}function L2(e,t){return!jd(e.getCurrentResult(),t)}var Ai,Ni,Jt,Bn,Zn,Qu,Pg,pC,F2=(pC=class extends Da{constructor(r,n){super();ve(this,Zn);ve(this,Ai);ve(this,Ni);ve(this,Jt);ve(this,Bn);se(this,Ai,r),this.setOptions(n),this.bindMethods(),Ne(this,Zn,Qu).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=j(this,Ai).defaultMutationOptions(r),jd(this.options,n)||j(this,Ai).getMutationCache().notify({type:"observerOptionsUpdated",mutation:j(this,Jt),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&$s(n.mutationKey)!==$s(this.options.mutationKey)?this.reset():((i=j(this,Jt))==null?void 0:i.state.status)==="pending"&&j(this,Jt).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=j(this,Jt))==null||r.removeObserver(this)}onMutationUpdate(r){Ne(this,Zn,Qu).call(this),Ne(this,Zn,Pg).call(this,r)}getCurrentResult(){return j(this,Ni)}reset(){var r;(r=j(this,Jt))==null||r.removeObserver(this),se(this,Jt,void 0),Ne(this,Zn,Qu).call(this),Ne(this,Zn,Pg).call(this)}mutate(r,n){var i;return se(this,Bn,n),(i=j(this,Jt))==null||i.removeObserver(this),se(this,Jt,j(this,Ai).getMutationCache().build(j(this,Ai),this.options)),j(this,Jt).addObserver(this),j(this,Jt).execute(r)}},Ai=new WeakMap,Ni=new WeakMap,Jt=new WeakMap,Bn=new WeakMap,Zn=new WeakSet,Qu=function(){var n;const r=((n=j(this,Jt))==null?void 0:n.state)??LT();se(this,Ni,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Pg=function(r){xt.batch(()=>{var n,i,s,o,a,l,c,u;if(j(this,Bn)&&this.hasListeners()){const d=j(this,Ni).variables,p=j(this,Ni).context;(r==null?void 0:r.type)==="success"?((i=(n=j(this,Bn)).onSuccess)==null||i.call(n,r.data,d,p),(o=(s=j(this,Bn)).onSettled)==null||o.call(s,r.data,null,d,p)):(r==null?void 0:r.type)==="error"&&((l=(a=j(this,Bn)).onError)==null||l.call(a,r.error,d,p),(u=(c=j(this,Bn)).onSettled)==null||u.call(c,void 0,r.error,d,p))}this.listeners.forEach(d=>{d(j(this,Ni))})})},pC),VT=m.createContext(void 0),zf=e=>{const t=m.useContext(VT);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},V2=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(VT.Provider,{value:e,children:t})),$T=m.createContext(!1),$2=()=>m.useContext($T);$T.Provider;function B2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var U2=m.createContext(B2()),z2=()=>m.useContext(U2);function BT(e,t){return typeof e=="function"?e(...t):!!e}function Dg(){}var W2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},H2=e=>{m.useEffect(()=>{e.clearReset()},[e])},G2=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&BT(r,[e.error,n]),K2=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},q2=(e,t)=>e.isLoading&&e.isFetching&&!t,Q2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Qw=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Y2(e,t,r){var u,d,p,h,g;const n=zf(),i=$2(),s=z2(),o=n.defaultQueryOptions(e);(d=(u=n.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||d.call(u,o),o._optimisticResults=i?"isRestoring":"optimistic",K2(o),W2(o,s),H2(s);const a=!n.getQueryCache().get(o.queryHash),[l]=m.useState(()=>new t(n,o)),c=l.getOptimisticResult(o);if(m.useSyncExternalStore(m.useCallback(v=>{const w=i?Dg:l.subscribe(xt.batchCalls(v));return l.updateResult(),w},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),m.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),Q2(o,c))throw Qw(o,l,s);if(G2({result:c,errorResetBoundary:s,throwOnError:o.throwOnError,query:n.getQueryCache().get(o.queryHash)}))throw c.error;if((h=(p=n.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||h.call(p,o,c),o.experimental_prefetchInRender&&!Vs&&q2(c,i)){const v=a?Qw(o,l,s):(g=n.getQueryCache().get(o.queryHash))==null?void 0:g.promise;v==null||v.catch(Dg).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function UT(e,t){return Y2(e,O2)}function Mo(e,t){const r=zf(),[n]=m.useState(()=>new F2(r,e));m.useEffect(()=>{n.setOptions(e)},[n,e]);const i=m.useSyncExternalStore(m.useCallback(o=>n.subscribe(xt.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=m.useCallback((o,a)=>{n.mutate(o,a).catch(Dg)},[n]);if(i.error&&BT(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var Z2=typeof Element<"u",X2=typeof Map=="function",J2=typeof Set=="function",eO=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Yu(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(!Yu(e[n],t[n]))return!1;return!0}var s;if(X2&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;for(s=e.entries();!(n=s.next()).done;)if(!Yu(n.value[1],t.get(n.value[0])))return!1;return!0}if(J2&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s=e.entries();!(n=s.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(eO&&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(Z2&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!Yu(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var tO=function(t,r){try{return Yu(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 rO=Sa(tO);var nO=function(e,t,r,n,i,s,o,a){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 c=[r,n,i,s,o,a],u=0;l=new Error(t.replace(/%s/g,function(){return c[u++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},iO=nO;const Yw=Sa(iO);var sO=function(t,r,n,i){var s=n?n.call(i,t,r):void 0;if(s!==void 0)return!!s;if(t===r)return!0;if(typeof t!="object"||!t||typeof r!="object"||!r)return!1;var o=Object.keys(t),a=Object.keys(r);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(r),c=0;c(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))(zT||{}),Eh={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"]}},Zw=Object.values(zT),Ty={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},aO=Object.entries(Ty).reduce((e,[t,r])=>(e[r]=t,e),{}),Yr="data-rh",Oo={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},_o=(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},lO=e=>{let t=_o(e,"title");const r=_o(e,Oo.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=_o(e,Oo.DEFAULT_TITLE);return t||n||void 0},cO=e=>_o(e,Oo.ON_CHANGE_CLIENT_STATE)||(()=>{}),Th=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),uO=(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 s=0;sconsole&&typeof console.warn=="function"&&console.warn(e),Wa=(e,t,r)=>{const n={};return r.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&dO(`Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`),!1)).map(i=>i[e]).reverse().reduce((i,s)=>{const o={};s.filter(l=>{let c;const u=Object.keys(l);for(let p=0;pi.push(l));const a=Object.keys(o);for(let l=0;l{if(Array.isArray(e)&&e.length){for(let r=0;r({baseTag:uO(["href"],e),bodyAttributes:Th("bodyAttributes",e),defer:_o(e,Oo.DEFER),encode:_o(e,Oo.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Th("htmlAttributes",e),linkTags:Wa("link",["rel","href"],e),metaTags:Wa("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:Wa("noscript",["innerHTML"],e),onChangeClientState:cO(e),scriptTags:Wa("script",["src","innerHTML"],e),styleTags:Wa("style",["cssText"],e),title:lO(e),titleAttributes:Th("titleAttributes",e),prioritizeSeoTags:fO(e,Oo.PRIORITIZE_SEO_TAGS)}),WT=e=>Array.isArray(e)?e.join(""):e,hO=(e,t)=>{const r=Object.keys(e);for(let n=0;nArray.isArray(e)?e.reduce((r,n)=>(hO(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},Xw=(e,t)=>({...e,[t]:void 0}),mO=["noscript","script","style"],Ag=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),HT=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),gO=(e,t,r,n)=>{const i=HT(r),s=WT(t);return i?`<${e} ${Yr}="true" ${i}>${Ag(s,n)}`:`<${e} ${Yr}="true">${Ag(s,n)}`},vO=(e,t,r=!0)=>t.reduce((n,i)=>{const s=i,o=Object.keys(s).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,u)=>{const d=typeof s[u]>"u"?u:`${u}="${Ag(s[u],r)}"`;return c?`${c} ${d}`:d},""),a=s.innerHTML||s.cssText||"",l=mO.indexOf(e)===-1;return`${n}<${e} ${Yr}="true" ${o}${l?"/>":`>${a}`}`},""),GT=(e,t={})=>Object.keys(e).reduce((r,n)=>{const i=Ty[n];return r[i||n]=e[n],r},t),yO=(e,t,r)=>{const n={key:t,[Yr]:!0},i=GT(r,n);return[ee.createElement("title",i,t)]},Zu=(e,t)=>t.map((r,n)=>{const i={key:n,[Yr]:!0};return Object.keys(r).forEach(s=>{const a=Ty[s]||s;if(a==="innerHTML"||a==="cssText"){const l=r.innerHTML||r.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[a]=r[s]}),ee.createElement(e,i)}),Pr=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>yO(e,t.title,t.titleAttributes),toString:()=>gO(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>GT(t),toString:()=>HT(t)};default:return{toComponent:()=>Zu(e,t),toString:()=>vO(e,t,r)}}},xO=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const i=Ph(e,Eh.meta),s=Ph(t,Eh.link),o=Ph(r,Eh.script);return{priorityMethods:{toComponent:()=>[...Zu("meta",i.priority),...Zu("link",s.priority),...Zu("script",o.priority)],toString:()=>`${Pr("meta",i.priority,n)} ${Pr("link",s.priority,n)} ${Pr("script",o.priority,n)}`},metaTags:i.default,linkTags:s.default,scriptTags:o.default}},wO=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:i,noscriptTags:s,styleTags:o,title:a="",titleAttributes:l,prioritizeSeoTags:c}=e;let{linkTags:u,metaTags:d,scriptTags:p}=e,h={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:h,linkTags:u,metaTags:d,scriptTags:p}=xO(e)),{priority:h,base:Pr("base",t,n),bodyAttributes:Pr("bodyAttributes",r,n),htmlAttributes:Pr("htmlAttributes",i,n),link:Pr("link",u,n),meta:Pr("meta",d,n),noscript:Pr("noscript",s,n),script:Pr("script",p,n),style:Pr("style",o,n),title:Pr("title",{title:a,titleAttributes:l},n)}},Ng=wO,vu=[],KT=!!(typeof window<"u"&&window.document&&window.document.createElement),kg=class{constructor(e,t){Mn(this,"instances",[]);Mn(this,"canUseDOM",KT);Mn(this,"context");Mn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?vu:this.instances,add:e=>{(this.canUseDOM?vu:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?vu:this.instances).indexOf(e);(this.canUseDOM?vu:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=Ng({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},bO={},qT=ee.createContext(bO),Ns,QT=(Ns=class extends m.Component{constructor(r){super(r);Mn(this,"helmetData");this.helmetData=new kg(this.props.context||{},Ns.canUseDOM)}render(){return ee.createElement(qT.Provider,{value:this.helmetData.value},this.props.children)}},Mn(Ns,"canUseDOM",KT),Ns),ro=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${Yr}]`),i=[].slice.call(n),s=[];let o;return t&&t.length&&t.forEach(a=>{const l=document.createElement(e);for(const c in a)if(Object.prototype.hasOwnProperty.call(a,c))if(c==="innerHTML")l.innerHTML=a.innerHTML;else if(c==="cssText")l.styleSheet?l.styleSheet.cssText=a.cssText:l.appendChild(document.createTextNode(a.cssText));else{const u=c,d=typeof a[u]>"u"?"":a[u];l.setAttribute(c,d)}l.setAttribute(Yr,"true"),i.some((c,u)=>(o=u,l.isEqualNode(c)))?i.splice(o,1):s.push(l)}),i.forEach(a=>{var l;return(l=a.parentNode)==null?void 0:l.removeChild(a)}),s.forEach(a=>r.appendChild(a)),{oldTags:i,newTags:s}},Rg=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(Yr),i=n?n.split(","):[],s=[...i],o=Object.keys(t);for(const a of o){const l=t[a]||"";r.getAttribute(a)!==l&&r.setAttribute(a,l),i.indexOf(a)===-1&&i.push(a);const c=s.indexOf(a);c!==-1&&s.splice(c,1)}for(let a=s.length-1;a>=0;a-=1)r.removeAttribute(s[a]);i.length===s.length?r.removeAttribute(Yr):r.getAttribute(Yr)!==o.join(",")&&r.setAttribute(Yr,o.join(","))},SO=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=WT(e)),Rg("title",t)},Jw=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:i,linkTags:s,metaTags:o,noscriptTags:a,onChangeClientState:l,scriptTags:c,styleTags:u,title:d,titleAttributes:p}=e;Rg("body",n),Rg("html",i),SO(d,p);const h={baseTag:ro("base",r),linkTags:ro("link",s),metaTags:ro("meta",o),noscriptTags:ro("noscript",a),scriptTags:ro("script",c),styleTags:ro("style",u)},g={},v={};Object.keys(h).forEach(w=>{const{newTags:x,oldTags:y}=h[w];x.length&&(g[w]=x),y.length&&(v[w]=h[w].oldTags)}),t&&t(),l(e,g,v)},Ha=null,CO=e=>{Ha&&cancelAnimationFrame(Ha),e.defer?Ha=requestAnimationFrame(()=>{Jw(e,()=>{Ha=null})}):(Jw(e),Ha=null)},EO=CO,eb=class extends m.Component{constructor(){super(...arguments);Mn(this,"rendered",!1)}shouldComponentUpdate(t){return!oO(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=pO(t.get().map(s=>{const o={...s.props};return delete o.context,o}));QT.canUseDOM?EO(i):Ng&&(n=Ng(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}},bm,YT=(bm=class extends m.Component{shouldComponentUpdate(e){return!rO(Xw(this.props,"helmetData"),Xw(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 Yw(Zw.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 ${Zw.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),Yw(!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 ee.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:i,...s}=n.props,o=Object.keys(s).reduce((l,c)=>(l[aO[c]||c]=s[c],l),{});let{type:a}=n;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(n,i),a){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,o,i);break;default:t=this.mapObjectTypeChildren(n,t,o,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 kg)){const i=n;n=new kg(i.context,!0),delete r.helmetData}return n?ee.createElement(eb,{...r,context:n.value}):ee.createElement(qT.Consumer,null,i=>ee.createElement(eb,{...r,context:i}))}},Mn(bm,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),bm);function TO(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,n,i,s,o=[],a="",l=e.split("/");for(l[0]||l.shift();i=l.shift();)r=i[0],r==="*"?(o.push(r),a+=i[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(n=i.indexOf("?",1),s=i.indexOf(".",1),o.push(i.substring(1,~n?n:~s?s:i.length)),a+=~n&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(a+=(~n?"?":"")+"\\"+i.substring(s))):a+="/"+i;return{keys:o,pattern:new RegExp("^"+a+(t?"(?=$|/)":"/?$"),"i")}}var ZT={exports:{}},XT={};/** * @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 ua=m;function PO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var DO=typeof Object.is=="function"?Object.is:PO,AO=ua.useState,NO=ua.useEffect,kO=ua.useLayoutEffect,RO=ua.useDebugValue;function jO(e,t){var r=t(),n=AO({inst:{value:r,getSnapshot:t}}),i=n[0].inst,s=n[1];return kO(function(){i.value=r,i.getSnapshot=t,Dh(i)&&s({inst:i})},[e,r,t]),NO(function(){return Dh(i)&&s({inst:i}),e(function(){Dh(i)&&s({inst:i})})},[e]),RO(r),r}function Dh(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!DO(e,r)}catch{return!0}}function IO(e,t){return t()}var MO=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?IO:jO;XT.useSyncExternalStore=ua.useSyncExternalStore!==void 0?ua.useSyncExternalStore:MO;ZT.exports=XT;var OO=ZT.exports;const _O=EC.useInsertionEffect,LO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",FO=LO?m.useLayoutEffect:m.useEffect,VO=_O||FO,JT=e=>{const t=m.useRef([e,(...r)=>t[0](...r)]).current;return VO(()=>{t[0]=e}),t[1]},$O="popstate",Py="pushState",Dy="replaceState",BO="hashchange",tb=[$O,Py,Dy,BO],UO=e=>{for(const t of tb)addEventListener(t,e);return()=>{for(const t of tb)removeEventListener(t,e)}},eP=(e,t)=>OO.useSyncExternalStore(UO,e,t),zO=()=>location.search,WO=({ssrSearch:e=""}={})=>eP(zO,()=>e),rb=()=>location.pathname,HO=({ssrPath:e}={})=>eP(rb,e?()=>e:rb),GO=(e,{replace:t=!1,state:r=null}={})=>history[t?Dy:Py](r,"",e),KO=(e={})=>[HO(e),GO],nb=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[nb]>"u"){for(const e of[Py,Dy]){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,nb,{value:!0})}const qO=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",tP=(e="")=>e==="/"?"":e,QO=(e,t)=>e[0]==="~"?e.slice(1):tP(t)+e,YO=(e="",t)=>qO(ib(tP(e)),ib(t)),ib=e=>{try{return decodeURI(e)}catch{return e}},rP={hook:KO,searchHook:WO,parser:TO,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},nP=m.createContext(rP),Tc=()=>m.useContext(nP),iP={},sP=m.createContext(iP),ZO=()=>m.useContext(sP),Wf=e=>{const[t,r]=e.hook(e);return[YO(e.base,t),JT((n,i)=>r(QO(n,e.base),i))]},Hf=()=>Wf(Tc()),oP=(e,t,r,n)=>{const{pattern:i,keys:s}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",n),o=i.exec(r)||[],[a,...l]=o;return a!==void 0?[!0,(()=>{const c=s!==!1?Object.fromEntries(s.map((d,p)=>[d,l[p]])):o.groups;let u={...l};return c&&Object.assign(u,c),u})(),...n?[a]:[]]:[!1,null]},aP=({children:e,...t})=>{var u,d;const r=Tc(),n=t.hook?rP:r;let i=n;const[s,o]=((u=t.ssrPath)==null?void 0:u.split("?"))??[];o&&(t.ssrSearch=o,t.ssrPath=s),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs);let a=m.useRef({}),l=a.current,c=l;for(let p in n){const h=p==="base"?n[p]+(t[p]||""):t[p]||n[p];l===c&&h!==c[p]&&(a.current=c={...c}),c[p]=h,h!==n[p]&&(i=c)}return m.createElement(nP.Provider,{value:i,children:e})},sb=({children:e,component:t},r)=>t?m.createElement(t,{params:r}):typeof e=="function"?e(r):e,XO=e=>{let t=m.useRef(iP),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},fn=({path:e,nest:t,match:r,...n})=>{const i=Tc(),[s]=Wf(i),[o,a,l]=r??oP(i.parser,e,s,t),c=XO({...ZO(),...a});if(!o)return null;const u=l?m.createElement(aP,{base:l},sb(n,c)):sb(n,c);return m.createElement(sP.Provider,{value:c,children:u})},qr=m.forwardRef((e,t)=>{const r=Tc(),[n,i]=Wf(r),{to:s="",href:o=s,onClick:a,asChild:l,children:c,className:u,replace:d,state:p,...h}=e,g=JT(w=>{w.ctrlKey||w.metaKey||w.altKey||w.shiftKey||w.button!==0||(a==null||a(w),w.defaultPrevented||(w.preventDefault(),i(o,e)))}),v=r.hrefs(o[0]==="~"?o.slice(1):r.base+o,r);return l&&m.isValidElement(c)?m.cloneElement(c,{onClick:g,href:v}):m.createElement("a",{...h,onClick:g,href:v,className:u!=null&&u.call?u(n===o):u,children:c,ref:t})}),lP=e=>Array.isArray(e)?e.flatMap(t=>lP(t&&t.type===m.Fragment?t.props.children:t)):[e],ob=({children:e,location:t})=>{const r=Tc(),[n]=Wf(r);for(const i of lP(e)){let s=0;if(m.isValidElement(i)&&(s=oP(r.parser,i.props.path,t||n,i.props.nest))[0])return m.cloneElement(i,{match:s})}return null},JO=new M2({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}}}),e_=1,t_=1e6;let Ah=0;function r_(){return Ah=(Ah+1)%Number.MAX_SAFE_INTEGER,Ah.toString()}const Nh=new Map,ab=e=>{if(Nh.has(e))return;const t=setTimeout(()=>{Nh.delete(e),Sl({type:"REMOVE_TOAST",toastId:e})},t_);Nh.set(e,t)},n_=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,e_)};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?ab(r):e.toasts.forEach(n=>{ab(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)}}},Xu=[];let Ju={toasts:[]};function Sl(e){Ju=n_(Ju,e),Xu.forEach(t=>{t(Ju)})}function i_({...e}){const t=r_(),r=i=>Sl({type:"UPDATE_TOAST",toast:{...i,id:t}}),n=()=>Sl({type:"DISMISS_TOAST",toastId:t});return Sl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function Pc(){const[e,t]=m.useState(Ju);return m.useEffect(()=>(Xu.push(t),()=>{const r=Xu.indexOf(t);r>-1&&Xu.splice(r,1)}),[e]),{...e,toast:i_,dismiss:r=>Sl({type:"DISMISS_TOAST",toastId:r})}}function he(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 s_(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Gf(...e){return t=>e.forEach(r=>s_(r,t))}function it(...e){return m.useCallback(Gf(...e),e)}function o_(e,t=[]){let r=[];function n(s,o){const a=m.createContext(o),l=r.length;r=[...r,o];function c(d){const{scope:p,children:h,...g}=d,v=(p==null?void 0:p[e][l])||a,w=m.useMemo(()=>g,Object.values(g));return f.jsx(v.Provider,{value:w,children:h})}function u(d,p){const h=(p==null?void 0:p[e][l])||a,g=m.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=r.map(o=>m.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[n,a_(i,...t)]}function a_(...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(s){const o=n.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Hi=m.forwardRef((e,t)=>{const{children:r,...n}=e,i=m.Children.toArray(r),s=i.find(l_);if(s){const o=s.props.children,a=i.map(l=>l===s?m.Children.count(o)>1?m.Children.only(null):m.isValidElement(o)?o.props.children:null:l);return f.jsx(jg,{...n,ref:t,children:m.isValidElement(o)?m.cloneElement(o,void 0,a):null})}return f.jsx(jg,{...n,ref:t,children:r})});Hi.displayName="Slot";var jg=m.forwardRef((e,t)=>{const{children:r,...n}=e;if(m.isValidElement(r)){const i=u_(r);return m.cloneElement(r,{...c_(n,r.props),ref:t?Gf(t,i):i})}return m.Children.count(r)>1?m.Children.only(null):null});jg.displayName="SlotClone";var Ay=({children:e})=>f.jsx(f.Fragment,{children:e});function l_(e){return m.isValidElement(e)&&e.type===Ay}function c_(e,t){const r={...t};for(const n in t){const i=e[n],s=t[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...e,...r}}function u_(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 Ny(e){const t=e+"CollectionProvider",[r,n]=o_(t),[i,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=h=>{const{scope:g,children:v}=h,w=ee.useRef(null),x=ee.useRef(new Map).current;return f.jsx(i,{scope:g,itemMap:x,collectionRef:w,children:v})};o.displayName=t;const a=e+"CollectionSlot",l=ee.forwardRef((h,g)=>{const{scope:v,children:w}=h,x=s(a,v),y=it(g,x.collectionRef);return f.jsx(Hi,{ref:y,children:w})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=ee.forwardRef((h,g)=>{const{scope:v,children:w,...x}=h,y=ee.useRef(null),b=it(g,y),S=s(c,v);return ee.useEffect(()=>(S.itemMap.set(y,{ref:y,...x}),()=>void S.itemMap.delete(y))),f.jsx(Hi,{[u]:"",ref:b,children:w})});d.displayName=c;function p(h){const g=s(e+"CollectionConsumer",h);return ee.useCallback(()=>{const w=g.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${u}]`));return Array.from(g.itemMap.values()).sort((S,C)=>x.indexOf(S.ref.current)-x.indexOf(C.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:l,ItemSlot:d},p,n]}function d_(e,t){const r=m.createContext(t),n=s=>{const{children:o,...a}=s,l=m.useMemo(()=>a,Object.values(a));return f.jsx(r.Provider,{value:l,children:o})};n.displayName=e+"Provider";function i(s){const o=m.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[n,i]}function Aa(e,t=[]){let r=[];function n(s,o){const a=m.createContext(o),l=r.length;r=[...r,o];const c=d=>{var x;const{scope:p,children:h,...g}=d,v=((x=p==null?void 0:p[e])==null?void 0:x[l])||a,w=m.useMemo(()=>g,Object.values(g));return f.jsx(v.Provider,{value:w,children:h})};c.displayName=s+"Provider";function u(d,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[l])||a,g=m.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,u]}const i=()=>{const s=r.map(o=>m.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[n,f_(i,...t)]}function f_(...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(s){const o=n.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var p_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],We=p_.reduce((e,t)=>{const r=m.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?Hi:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(a,{...o,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ky(e,t){e&&Pa.flushSync(()=>e.dispatchEvent(t))}function Ht(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function h_(e,t=globalThis==null?void 0:globalThis.document){const r=Ht(e);m.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 m_="DismissableLayer",Ig="dismissableLayer.update",g_="dismissableLayer.pointerDownOutside",v_="dismissableLayer.focusOutside",lb,cP=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Dc=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=e,c=m.useContext(cP),[u,d]=m.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=m.useState({}),g=it(t,N=>d(N)),v=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(w),y=u?v.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=x,C=x_(N=>{const k=N.target,R=[...c.branches].some(M=>M.contains(k));!S||R||(i==null||i(N),o==null||o(N),N.defaultPrevented||a==null||a())},p),D=w_(N=>{const k=N.target;[...c.branches].some(M=>M.contains(k))||(s==null||s(N),o==null||o(N),N.defaultPrevented||a==null||a())},p);return h_(N=>{y===c.layers.size-1&&(n==null||n(N),!N.defaultPrevented&&a&&(N.preventDefault(),a()))},p),m.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(lb=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),cb(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=lb)}},[u,p,r,c]),m.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),cb())},[u,c]),m.useEffect(()=>{const N=()=>h({});return document.addEventListener(Ig,N),()=>document.removeEventListener(Ig,N)},[]),f.jsx(We.div,{...l,ref:g,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:he(e.onFocusCapture,D.onFocusCapture),onBlurCapture:he(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:he(e.onPointerDownCapture,C.onPointerDownCapture)})});Dc.displayName=m_;var y_="DismissableLayerBranch",uP=m.forwardRef((e,t)=>{const r=m.useContext(cP),n=m.useRef(null),i=it(t,n);return m.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),f.jsx(We.div,{...e,ref:i})});uP.displayName=y_;function x_(e,t=globalThis==null?void 0:globalThis.document){const r=Ht(e),n=m.useRef(!1),i=m.useRef(()=>{});return m.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let l=function(){dP(g_,r,c,{discrete:!0})};const c={originalEvent:a};a.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},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function w_(e,t=globalThis==null?void 0:globalThis.document){const r=Ht(e),n=m.useRef(!1);return m.useEffect(()=>{const i=s=>{s.target&&!n.current&&dP(v_,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function cb(){const e=new CustomEvent(Ig);document.dispatchEvent(e)}function dP(e,t,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?ky(i,s):i.dispatchEvent(s)}var b_=Dc,S_=uP,Gi=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},C_="Portal",Kf=m.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[i,s]=m.useState(!1);Gi(()=>s(!0),[]);const o=r||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?DT.createPortal(f.jsx(We.div,{...n,ref:t}),o):null});Kf.displayName=C_;function E_(e,t){return m.useReducer((r,n)=>t[r][n]??r,e)}var jn=e=>{const{present:t,children:r}=e,n=T_(t),i=typeof r=="function"?r({present:n.isPresent}):m.Children.only(r),s=it(n.ref,P_(i));return typeof r=="function"||n.isPresent?m.cloneElement(i,{ref:s}):null};jn.displayName="Presence";function T_(e){const[t,r]=m.useState(),n=m.useRef({}),i=m.useRef(e),s=m.useRef("none"),o=e?"mounted":"unmounted",[a,l]=E_(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=yu(n.current);s.current=a==="mounted"?c:"none"},[a]),Gi(()=>{const c=n.current,u=i.current;if(u!==e){const p=s.current,h=yu(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Gi(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const v=yu(n.current).includes(h.animationName);if(h.target===t&&v&&(l("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},p=h=>{h.target===t&&(s.current=yu(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function yu(e){return(e==null?void 0:e.animationName)||"none"}function P_(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 Ac({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,i]=D_({defaultProp:t,onChange:r}),s=e!==void 0,o=s?e:n,a=Ht(r),l=m.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else i(c)},[s,e,i,a]);return[o,l]}function D_({defaultProp:e,onChange:t}){const r=m.useState(e),[n]=r,i=m.useRef(n),s=Ht(t);return m.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}var A_="VisuallyHidden",qf=m.forwardRef((e,t)=>f.jsx(We.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}}));qf.displayName=A_;var N_=qf,Ry="ToastProvider",[jy,k_,R_]=Ny("Toast"),[fP,W7]=Aa("Toast",[R_]),[j_,Qf]=fP(Ry),pP=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=e,[a,l]=m.useState(null),[c,u]=m.useState(0),d=m.useRef(!1),p=m.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ry}\`. Expected non-empty \`string\`.`),f.jsx(jy.Provider,{scope:t,children:f.jsx(j_,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:m.useCallback(()=>u(h=>h+1),[]),onToastRemove:m.useCallback(()=>u(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:p,children:o})})};pP.displayName=Ry;var hP="ToastViewport",I_=["F8"],Mg="toast.viewportPause",Og="toast.viewportResume",mP=m.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=I_,label:i="Notifications ({hotkey})",...s}=e,o=Qf(hP,r),a=k_(r),l=m.useRef(null),c=m.useRef(null),u=m.useRef(null),d=m.useRef(null),p=it(t,d,o.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;m.useEffect(()=>{const w=x=>{var b;n.length!==0&&n.every(S=>x[S]||x.code===S)&&((b=d.current)==null||b.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),m.useEffect(()=>{const w=l.current,x=d.current;if(g&&w&&x){const y=()=>{if(!o.isClosePausedRef.current){const D=new CustomEvent(Mg);x.dispatchEvent(D),o.isClosePausedRef.current=!0}},b=()=>{if(o.isClosePausedRef.current){const D=new CustomEvent(Og);x.dispatchEvent(D),o.isClosePausedRef.current=!1}},S=D=>{!w.contains(D.relatedTarget)&&b()},C=()=>{w.contains(document.activeElement)||b()};return w.addEventListener("focusin",y),w.addEventListener("focusout",S),w.addEventListener("pointermove",y),w.addEventListener("pointerleave",C),window.addEventListener("blur",y),window.addEventListener("focus",b),()=>{w.removeEventListener("focusin",y),w.removeEventListener("focusout",S),w.removeEventListener("pointermove",y),w.removeEventListener("pointerleave",C),window.removeEventListener("blur",y),window.removeEventListener("focus",b)}}},[g,o.isClosePausedRef]);const v=m.useCallback(({tabbingDirection:w})=>{const y=a().map(b=>{const S=b.ref.current,C=[S,...G_(S)];return w==="forwards"?C:C.reverse()});return(w==="forwards"?y.reverse():y).flat()},[a]);return m.useEffect(()=>{const w=d.current;if(w){const x=y=>{var C,D,N;const b=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!b){const k=document.activeElement,R=y.shiftKey;if(y.target===w&&R){(C=c.current)==null||C.focus();return}const V=v({tabbingDirection:R?"backwards":"forwards"}),q=V.findIndex(B=>B===k);kh(V.slice(q+1))?y.preventDefault():R?(D=c.current)==null||D.focus():(N=u.current)==null||N.focus()}};return w.addEventListener("keydown",x),()=>w.removeEventListener("keydown",x)}},[a,v]),f.jsxs(S_,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&f.jsx(_g,{ref:c,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"forwards"});kh(w)}}),f.jsx(jy.Slot,{scope:r,children:f.jsx(We.ol,{tabIndex:-1,...s,ref:p})}),g&&f.jsx(_g,{ref:u,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"backwards"});kh(w)}})]})});mP.displayName=hP;var gP="ToastFocusProxy",_g=m.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,s=Qf(gP,r);return f.jsx(qf,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:o=>{var c;const a=o.relatedTarget;!((c=s.viewport)!=null&&c.contains(a))&&n()}})});_g.displayName=gP;var Yf="Toast",M_="toast.swipeStart",O_="toast.swipeMove",__="toast.swipeCancel",L_="toast.swipeEnd",vP=m.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:s,...o}=e,[a=!0,l]=Ac({prop:n,defaultProp:i,onChange:s});return f.jsx(jn,{present:r||a,children:f.jsx($_,{open:a,...o,ref:t,onClose:()=>l(!1),onPause:Ht(e.onPause),onResume:Ht(e.onResume),onSwipeStart:he(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:he(e.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:he(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:he(e.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});vP.displayName=Yf;var[F_,V_]=fP(Yf,{onClose(){}}),$_=m.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:p,onSwipeEnd:h,...g}=e,v=Qf(Yf,r),[w,x]=m.useState(null),y=it(t,B=>x(B)),b=m.useRef(null),S=m.useRef(null),C=i||v.duration,D=m.useRef(0),N=m.useRef(C),k=m.useRef(0),{onToastAdd:R,onToastRemove:M}=v,W=Ht(()=>{var te;(w==null?void 0:w.contains(document.activeElement))&&((te=v.viewport)==null||te.focus()),o()}),V=m.useCallback(B=>{!B||B===1/0||(window.clearTimeout(k.current),D.current=new Date().getTime(),k.current=window.setTimeout(W,B))},[W]);m.useEffect(()=>{const B=v.viewport;if(B){const te=()=>{V(N.current),c==null||c()},J=()=>{const X=new Date().getTime()-D.current;N.current=N.current-X,window.clearTimeout(k.current),l==null||l()};return B.addEventListener(Mg,J),B.addEventListener(Og,te),()=>{B.removeEventListener(Mg,J),B.removeEventListener(Og,te)}}},[v.viewport,C,l,c,V]),m.useEffect(()=>{s&&!v.isClosePausedRef.current&&V(C)},[s,C,v.isClosePausedRef,V]),m.useEffect(()=>(R(),()=>M()),[R,M]);const q=m.useMemo(()=>w?EP(w):null,[w]);return v.viewport?f.jsxs(f.Fragment,{children:[q&&f.jsx(B_,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:q}),f.jsx(F_,{scope:r,onClose:W,children:Pa.createPortal(f.jsx(jy.ItemSlot,{scope:r,children:f.jsx(b_,{asChild:!0,onEscapeKeyDown:he(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||W(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:f.jsx(We.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":v.swipeDirection,...g,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:he(e.onKeyDown,B=>{B.key==="Escape"&&(a==null||a(B.nativeEvent),B.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,W()))}),onPointerDown:he(e.onPointerDown,B=>{B.button===0&&(b.current={x:B.clientX,y:B.clientY})}),onPointerMove:he(e.onPointerMove,B=>{if(!b.current)return;const te=B.clientX-b.current.x,J=B.clientY-b.current.y,X=!!S.current,F=["left","right"].includes(v.swipeDirection),$=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,A=F?$(0,te):0,P=F?0:$(0,J),H=B.pointerType==="touch"?10:2,ne={x:A,y:P},ae={originalEvent:B,delta:ne};X?(S.current=ne,xu(O_,d,ae,{discrete:!1})):ub(ne,v.swipeDirection,H)?(S.current=ne,xu(M_,u,ae,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(te)>H||Math.abs(J)>H)&&(b.current=null)}),onPointerUp:he(e.onPointerUp,B=>{const te=S.current,J=B.target;if(J.hasPointerCapture(B.pointerId)&&J.releasePointerCapture(B.pointerId),S.current=null,b.current=null,te){const X=B.currentTarget,F={originalEvent:B,delta:te};ub(te,v.swipeDirection,v.swipeThreshold)?xu(L_,h,F,{discrete:!0}):xu(__,p,F,{discrete:!0}),X.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),B_=e=>{const{__scopeToast:t,children:r,...n}=e,i=Qf(Yf,t),[s,o]=m.useState(!1),[a,l]=m.useState(!1);return W_(()=>o(!0)),m.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:f.jsx(Kf,{asChild:!0,children:f.jsx(qf,{...n,children:s&&f.jsxs(f.Fragment,{children:[i.label," ",r]})})})},U_="ToastTitle",yP=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return f.jsx(We.div,{...n,ref:t})});yP.displayName=U_;var z_="ToastDescription",xP=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return f.jsx(We.div,{...n,ref:t})});xP.displayName=z_;var wP="ToastAction",bP=m.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?f.jsx(CP,{altText:r,asChild:!0,children:f.jsx(Iy,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${wP}\`. Expected non-empty \`string\`.`),null)});bP.displayName=wP;var SP="ToastClose",Iy=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=V_(SP,r);return f.jsx(CP,{asChild:!0,children:f.jsx(We.button,{type:"button",...n,ref:t,onClick:he(e.onClick,i.onClose)})})});Iy.displayName=SP;var CP=m.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return f.jsx(We.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:t})});function EP(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),H_(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...EP(n))}}),t}function xu(e,t,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?ky(i,s):i.dispatchEvent(s)}var ub=(e,t,r=0)=>{const n=Math.abs(e.x),i=Math.abs(e.y),s=n>i;return t==="left"||t==="right"?s&&n>r:!s&&i>r};function W_(e=()=>{}){const t=Ht(e);Gi(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function H_(e){return e.nodeType===e.ELEMENT_NODE}function G_(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 kh(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var K_=pP,TP=mP,PP=vP,DP=yP,AP=xP,NP=bP,kP=Iy;function RP(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,fb=q_,Nc=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return fb(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(c=>{const u=r==null?void 0:r[c],d=s==null?void 0:s[c];if(u===null)return null;const p=db(u)||db(d);return i[c][p]}),a=r&&Object.entries(r).reduce((c,u)=>{let[d,p]=u;return p===void 0||(c[d]=p),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:d,className:p,...h}=u;return Object.entries(h).every(g=>{let[v,w]=g;return Array.isArray(w)?w.includes({...s,...a}[v]):{...s,...a}[v]===w})?[...c,d,p]:c},[]);return fb(e,o,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 Q_=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jP=(...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 Y_={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 Z_=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:s,iconNode:o,...a},l)=>m.createElement("svg",{ref:l,...Y_,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:jP("lucide",i),...a},[...o.map(([c,u])=>m.createElement(c,u)),...Array.isArray(s)?s:[s]]));/** * @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 Re=(e,t)=>{const r=m.forwardRef(({className:n,...i},s)=>m.createElement(Z_,{ref:s,iconNode:t,className:jP(`lucide-${Q_(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 X_=Re("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 Rh=Re("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 My=Re("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 J_=Re("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 eL=Re("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 Kn=Re("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 IP=Re("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 tL=Re("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 rL=Re("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 nL=Re("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 Md=Re("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 iL=Re("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 MP=Re("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 Oy=Re("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 sL=Re("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 xs=Re("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 oL=Re("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 OP=Re("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 aL=Re("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** * @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 _P=Re("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 lL=Re("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @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 Lo=Re("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 cL=Re("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 uL=Re("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @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 dL=Re("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** * @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 fL=Re("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @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 pL=Re("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 hL=Re("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 Od=Re("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 _y=Re("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 _d=Re("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 Cl=Re("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 Fo=Re("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 mL=Re("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 gL=Re("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 vL=Re("Weight",[["circle",{cx:"12",cy:"5",r:"3",key:"rqqgnr"}],["path",{d:"M6.5 8a2 2 0 0 0-1.905 1.46L2.1 18.5A2 2 0 0 0 4 21h16a2 2 0 0 0 1.925-2.54L19.4 9.5A2 2 0 0 0 17.48 8Z",key:"56o5sh"}]]);/** * @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 El=Re("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 pb=Re("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 LP(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=bL(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const a=o.split(Ly);return a[0]===""&&a.length!==1&&a.shift(),FP(a,t)||wL(o)},getConflictingClassGroupIds:(o,a)=>{const l=r[o]||[];return a&&n[o]?[...l,...n[o]]:l}}},FP=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?FP(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(Ly);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},hb=/^\[(.+)\]$/,wL=e=>{if(hb.test(e)){const t=hb.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},bL=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return CL(Object.entries(e.classGroups),r).forEach(([s,o])=>{Lg(o,n,s,t)}),n},Lg=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:mb(t,i);s.classGroupId=r;return}if(typeof i=="function"){if(SL(i)){Lg(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,o])=>{Lg(o,mb(t,s),r,n)})})},mb=(e,t)=>{let r=e;return t.split(Ly).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},SL=e=>e.isThemeGetter,CL=(e,t)=>t?e.map(([r,n])=>{const i=n.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([o,a])=>[t+o,a])):s);return[r,i]}):e,EL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(s,o)=>{r.set(s,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let o=r.get(s);if(o!==void 0)return o;if((o=n.get(s))!==void 0)return i(s,o),o},set(s,o){r.has(s)?r.set(s,o):i(s,o)}}},VP="!",TL=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],s=t.length,o=a=>{const l=[];let c=0,u=0,d;for(let w=0;wu?d-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:v}};return r?a=>r({className:a,parseClassName:o}):o},PL=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},DL=e=>({cache:EL(e.cacheSize),parseClassName:TL(e),...xL(e)}),AL=/\s+/,NL=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(AL);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:u,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=r(c);let g=!!h,v=n(g?p.substring(0,h):p);if(!v){if(!g){a=c+(a.length>0?" "+a:a);continue}if(v=n(p),!v){a=c+(a.length>0?" "+a:a);continue}g=!1}const w=PL(u).join(":"),x=d?w+VP:w,y=x+v;if(s.includes(y))continue;s.push(y);const b=i(v,g);for(let S=0;S0?" "+a:a)}return a};function kL(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nd(u),e());return r=DL(c),n=r.cache.get,i=r.cache.set,s=a,a(l)}function a(l){const c=n(l);if(c)return c;const u=NL(l,r);return i(l,u),u}return function(){return s(kL.apply(null,arguments))}}const Qe=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},BP=/^\[(?:([a-z-]+):)?(.+)\]$/i,jL=/^\d+\/\d+$/,IL=new Set(["px","full","screen"]),ML=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,OL=/\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$/,_L=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,LL=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,FL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,On=e=>Vo(e)||IL.has(e)||jL.test(e),di=e=>Na(e,"length",GL),Vo=e=>!!e&&!Number.isNaN(Number(e)),jh=e=>Na(e,"number",Vo),Ga=e=>!!e&&Number.isInteger(Number(e)),VL=e=>e.endsWith("%")&&Vo(e.slice(0,-1)),De=e=>BP.test(e),fi=e=>ML.test(e),$L=new Set(["length","size","percentage"]),BL=e=>Na(e,$L,UP),UL=e=>Na(e,"position",UP),zL=new Set(["image","url"]),WL=e=>Na(e,zL,qL),HL=e=>Na(e,"",KL),Ka=()=>!0,Na=(e,t,r)=>{const n=BP.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},GL=e=>OL.test(e)&&!_L.test(e),UP=()=>!1,KL=e=>LL.test(e),qL=e=>FL.test(e),QL=()=>{const e=Qe("colors"),t=Qe("spacing"),r=Qe("blur"),n=Qe("brightness"),i=Qe("borderColor"),s=Qe("borderRadius"),o=Qe("borderSpacing"),a=Qe("borderWidth"),l=Qe("contrast"),c=Qe("grayscale"),u=Qe("hueRotate"),d=Qe("invert"),p=Qe("gap"),h=Qe("gradientColorStops"),g=Qe("gradientColorStopPositions"),v=Qe("inset"),w=Qe("margin"),x=Qe("opacity"),y=Qe("padding"),b=Qe("saturate"),S=Qe("scale"),C=Qe("sepia"),D=Qe("skew"),N=Qe("space"),k=Qe("translate"),R=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto",De,t],V=()=>[De,t],q=()=>["",On,di],B=()=>["auto",Vo,De],te=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",De],A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[Vo,De];return{cacheSize:500,separator:":",theme:{colors:[Ka],spacing:[On,di],blur:["none","",fi,De],brightness:P(),borderColor:[e],borderRadius:["none","","full",fi,De],borderSpacing:V(),borderWidth:q(),contrast:P(),grayscale:$(),hueRotate:P(),invert:$(),gap:V(),gradientColorStops:[e],gradientColorStopPositions:[VL,di],inset:W(),margin:W(),opacity:P(),padding:V(),saturate:P(),scale:P(),sepia:$(),skew:P(),space:V(),translate:V()},classGroups:{aspect:[{aspect:["auto","square","video",De]}],container:["container"],columns:[{columns:[fi]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:[...te(),De]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],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",Ga,De]}],basis:[{basis:W()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",De]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",Ga,De]}],"grid-cols":[{"grid-cols":[Ka]}],"col-start-end":[{col:["auto",{span:["full",Ga,De]},De]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[Ka]}],"row-start-end":[{row:["auto",{span:[Ga,De]},De]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",De]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",De]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"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:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[N]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[N]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",De,t]}],"min-w":[{"min-w":[De,t,"min","max","fit"]}],"max-w":[{"max-w":[De,t,"none","full","min","max","fit","prose",{screen:[fi]},fi]}],h:[{h:[De,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[De,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[De,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[De,t,"auto","min","max","fit"]}],"font-size":[{text:["base",fi,di]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",jh]}],"font-family":[{font:[Ka]}],"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",De]}],"line-clamp":[{"line-clamp":["none",Vo,jh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",On,De]}],"list-image":[{"list-image":["none",De]}],"list-style-type":[{list:["none","disc","decimal",De]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",On,di]}],"underline-offset":[{"underline-offset":["auto",On,De]}],"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:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",De]}],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",De]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...te(),UL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",BL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},WL]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...J(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:J()}],"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:["",...J()]}],"outline-offset":[{"outline-offset":[On,De]}],"outline-w":[{outline:[On,di]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[On,di]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",fi,HL]}],"shadow-color":[{shadow:[Ka]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",fi,De]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",De]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",De]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",De]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Ga,De]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",De]}],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",De]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"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",De]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[On,di,jh]}],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"]}}},YL=RL(QL);function Ce(...e){return YL(yL(e))}const ZL=K_,zP=m.forwardRef(({className:e,...t},r)=>f.jsx(TP,{ref:r,className:Ce("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}));zP.displayName=TP.displayName;const XL=Nc("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"}}),WP=m.forwardRef(({className:e,variant:t,...r},n)=>f.jsx(PP,{ref:n,className:Ce(XL({variant:t}),e),...r}));WP.displayName=PP.displayName;const JL=m.forwardRef(({className:e,...t},r)=>f.jsx(NP,{ref:r,className:Ce("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}));JL.displayName=NP.displayName;const HP=m.forwardRef(({className:e,...t},r)=>f.jsx(kP,{ref:r,className:Ce("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:f.jsx(El,{className:"h-4 w-4"})}));HP.displayName=kP.displayName;const GP=m.forwardRef(({className:e,...t},r)=>f.jsx(DP,{ref:r,className:Ce("text-sm font-semibold",e),...t}));GP.displayName=DP.displayName;const KP=m.forwardRef(({className:e,...t},r)=>f.jsx(AP,{ref:r,className:Ce("text-sm opacity-90",e),...t}));KP.displayName=AP.displayName;function eF(){const{toasts:e}=Pc();return f.jsxs(ZL,{children:[e.map(function({id:t,title:r,description:n,action:i,...s}){return f.jsxs(WP,{...s,children:[f.jsxs("div",{className:"grid gap-1",children:[r&&f.jsx(GP,{children:r}),n&&f.jsx(KP,{children:n})]}),i,f.jsx(HP,{})]},t)}),f.jsx(zP,{})]})}function Fg(e,t){return Fg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Fg(e,t)}function qP(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Fg(e,t)}function ye(){return ye=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(Yt(1));return r(QP)(e,t)}if(typeof e!="function")throw new Error(Yt(2));var i=e,s=t,o=[],a=o,l=!1;function c(){a===o&&(a=o.slice())}function u(){if(l)throw new Error(Yt(3));return s}function d(v){if(typeof v!="function")throw new Error(Yt(4));if(l)throw new Error(Yt(5));var w=!0;return c(),a.push(v),function(){if(w){if(l)throw new Error(Yt(6));w=!1,c();var y=a.indexOf(v);a.splice(y,1),o=null}}}function p(v){if(!iF(v))throw new Error(Yt(7));if(typeof v.type>"u")throw new Error(Yt(8));if(l)throw new Error(Yt(9));try{l=!0,s=i(s,v)}finally{l=!1}for(var w=o=a,x=0;x=0;n--){var i=t[n](e);if(i)return i}return function(s,o){throw new Error("Invalid value of type "+typeof e+" for "+r+" argument when connecting component "+o.wrappedComponentName+".")}}function cV(e,t){return e===t}function uV(e){var t=e===void 0?{}:e,r=t.connectHOC,n=r===void 0?WF:r,i=t.mapStateToPropsFactories,s=i===void 0?XF:i,o=t.mapDispatchToPropsFactories,a=o===void 0?QF:o,l=t.mergePropsFactories,c=l===void 0?nV:l,u=t.selectorFactory,d=u===void 0?aV:u;return function(h,g,v,w){w===void 0&&(w={});var x=w,y=x.pure,b=y===void 0?!0:y,S=x.areStatesEqual,C=S===void 0?cV:S,D=x.areOwnPropsEqual,N=D===void 0?Mh:D,k=x.areStatePropsEqual,R=k===void 0?Mh:k,M=x.areMergedPropsEqual,W=M===void 0?Mh:M,V=Ld(x,lV),q=Oh(h,s,"mapStateToProps"),B=Oh(g,a,"mapDispatchToProps"),te=Oh(v,c,"mergeProps");return n(d,ye({methodName:"connect",getDisplayName:function(X){return"Connect("+X+")"},shouldHandleStateChanges:!!h,initMapStateToProps:q,initMapDispatchToProps:B,initMergeProps:te,pure:b,areStatesEqual:C,areOwnPropsEqual:N,areStatePropsEqual:R,areMergedPropsEqual:W},V))}}const fD=uV();aF(Pa.unstable_batchedUpdates);function dV(e,t){if(e.length!==t.length)return!1;for(var r=0;r");return n.callbacks},n.setCallbacks=function(a){n.callbacks=a},n}var r=t.prototype;return r.componentDidMount=function(){this.unbind=Ir(window,[{eventName:"error",fn:this.onWindowError}])},r.componentDidCatch=function(i){if(i instanceof $d){this.setState({});return}throw i},r.componentWillUnmount=function(){this.unbind()},r.render=function(){return this.props.children(this.setCallbacks)},t}(ee.Component),SV=` 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 `,Bd=function(t){return t+1},CV=function(t){return` You have lifted an item in position `+Bd(t.source.index)+` `},vD=function(t,r){var n=t.droppableId===r.droppableId,i=Bd(t.index),s=Bd(r.index);return n?` You have moved the item from position `+i+` to position `+s+` `:` You have moved the item from position `+i+` in list `+t.droppableId+` to list `+r.droppableId+` in position `+s+` `},yD=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+` `},EV=function(t){var r=t.destination;if(r)return vD(t.source,r);var n=t.combine;return n?yD(t.draggableId,t.source,n):"You are over an area that cannot be dropped on"},jb=function(t){return` The item has returned to its starting position of `+Bd(t.index)+` `},TV=function(t){if(t.reason==="CANCEL")return` Movement cancelled. `+jb(t.source)+` `;var r=t.destination,n=t.combine;return r?` You have dropped the item. `+vD(t.source,r)+` `:n?` You have dropped the item. `+yD(t.draggableId,t.source,n)+` `:` The item has been dropped while not over a drop area. `+jb(t.source)+` `},ed={dragHandleUsageInstructions:SV,onDragStart:CV,onDragUpdate:EV,onDragEnd:TV},Et={x:0,y:0},Nt=function(t,r){return{x:t.x+r.x,y:t.y+r.y}},fr=function(t,r){return{x:t.x-r.x,y:t.y-r.y}},Bi=function(t,r){return t.x===r.x&&t.y===r.y},ka=function(t){return{x:t.x!==0?-t.x:0,y:t.y!==0?-t.y:0}},Bs=function(t,r,n){var i;return n===void 0&&(n=0),i={},i[t]=r,i[t==="x"?"y":"x"]=n,i},ec=function(t,r){return Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))},Ib=function(t,r){return Math.min.apply(Math,r.map(function(n){return ec(t,n)}))},xD=function(t){return function(r){return{x:t(r.x),y:t(r.y)}}},PV=function(e,t){var r=Zr({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},Vc=function(t,r){return{top:t.top+r.y,left:t.left+r.x,bottom:t.bottom+r.y,right:t.right+r.x}},Mb=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}]},DV={top:0,right:0,bottom:0,left:0},AV=function(t,r){return r?Vc(t,r.scroll.diff.displacement):t},NV=function(t,r,n){if(n&&n.increasedBy){var i;return ye({},t,(i={},i[r.end]=t[r.end]+n.increasedBy[r.line],i))}return t},kV=function(t,r){return r&&r.shouldClipSubject?PV(r.pageMarginBox,t):Zr(t)},da=function(e){var t=e.page,r=e.withPlaceholder,n=e.axis,i=e.frame,s=AV(t.marginBox,i),o=NV(s,n,r),a=kV(o,i);return{page:t,withPlaceholder:r,active:a}},Ky=function(e,t){e.frame||Y();var r=e.frame,n=fr(t,r.scroll.initial),i=ka(n),s=ye({},r,{scroll:{initial:r.scroll.initial,current:t,diff:{value:n,displacement:i},max:r.scroll.max}}),o=da({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:s}),a=ye({},e,{frame:s,subject:o});return a};function Ud(e){return Object.values?Object.values(e):Object.keys(e).map(function(t){return e[t]})}function qy(e,t){if(e.findIndex)return e.findIndex(t);for(var r=0;re.bottom,c=n.lefte.right,u=l&&c;if(u)return!0;var d=l&&o||c&&s;return d}},MV=function(e){var t=_r(e.top,e.bottom),r=_r(e.left,e.right);return function(n){var i=t(n.top)&&t(n.bottom)&&r(n.left)&&r(n.right);return i}},Yy={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},TD={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},OV=function(e){return function(t){var r=_r(t.top,t.bottom),n=_r(t.left,t.right);return function(i){return e===Yy?r(i.top)&&r(i.bottom):n(i.left)&&n(i.right)}}},_V=function(t,r){var n=r.frame?r.frame.scroll.diff.displacement:Et;return Vc(t,n)},LV=function(t,r,n){return r.subject.active?n(r.subject.active)(t):!1},FV=function(t,r,n){return n(r)(t)},Zy=function(t){var r=t.target,n=t.destination,i=t.viewport,s=t.withDroppableDisplacement,o=t.isVisibleThroughFrameFn,a=s?_V(r,n):r;return LV(a,n,o)&&FV(a,i,o)},VV=function(t){return Zy(ye({},t,{isVisibleThroughFrameFn:ED}))},PD=function(t){return Zy(ye({},t,{isVisibleThroughFrameFn:MV}))},$V=function(t){return Zy(ye({},t,{isVisibleThroughFrameFn:OV(t.destination.axis)}))},BV=function(t,r,n){if(typeof n=="boolean")return n;if(!r)return!0;var i=r.invisible,s=r.visible;if(i[t])return!1;var o=s[t];return o?o.shouldAnimate:!0};function UV(e,t){var r=e.page.marginBox,n={top:t.point.y,right:0,bottom:0,left:t.point.x};return Zr(Hy(r,n))}function rc(e){var t=e.afterDragging,r=e.destination,n=e.displacedBy,i=e.viewport,s=e.forceShouldAnimate,o=e.last;return t.reduce(function(l,c){var u=UV(c,n),d=c.descriptor.id;l.all.push(d);var p=VV({target:u,destination:r,viewport:i,withDroppableDisplacement:!0});if(!p)return l.invisible[c.descriptor.id]=!0,l;var h=BV(d,o,s),g={draggableId:d,shouldAnimate:h};return l.visible[d]=g,l},{all:[],visible:{},invisible:{}})}function zV(e,t){if(!e.length)return 0;var r=e[e.length-1].descriptor.index;return t.inHomeList?r:r+1}function Ob(e){var t=e.insideDestination,r=e.inHomeList,n=e.displacedBy,i=e.destination,s=zV(t,{inHomeList:r});return{displaced:tc,displacedBy:n,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:s}}}}function zd(e){var t=e.draggable,r=e.insideDestination,n=e.destination,i=e.viewport,s=e.displacedBy,o=e.last,a=e.index,l=e.forceShouldAnimate,c=ja(t,n);if(a==null)return Ob({insideDestination:r,inHomeList:c,displacedBy:s,destination:n});var u=ns(r,function(v){return v.descriptor.index===a});if(!u)return Ob({insideDestination:r,inHomeList:c,displacedBy:s,destination:n});var d=dp(t,r),p=r.indexOf(u),h=d.slice(p),g=rc({afterDragging:h,destination:n,displacedBy:s,last:o,viewport:i.frame,forceShouldAnimate:l});return{displaced:g,displacedBy:s,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:a}}}}function Ki(e,t){return!!t.effected[e]}var WV=function(e){var t=e.isMovingForward,r=e.destination,n=e.draggables,i=e.combine,s=e.afterCritical;if(!r.isCombineEnabled)return null;var o=i.draggableId,a=n[o],l=a.descriptor.index,c=Ki(o,s);return c?t?l:l-1:t?l+1:l},HV=function(e){var t=e.isMovingForward,r=e.isInHomeList,n=e.insideDestination,i=e.location;if(!n.length)return null;var s=i.index,o=t?s+1:s-1,a=n[0].descriptor.index,l=n[n.length-1].descriptor.index,c=r?l:l+1;return oc?null:o},GV=function(e){var t=e.isMovingForward,r=e.isInHomeList,n=e.draggable,i=e.draggables,s=e.destination,o=e.insideDestination,a=e.previousImpact,l=e.viewport,c=e.afterCritical,u=a.at;if(u||Y(),u.type==="REORDER"){var d=HV({isMovingForward:t,isInHomeList:r,location:u.destination,insideDestination:o});return d==null?null:zd({draggable:n,insideDestination:o,destination:s,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:d})}var p=WV({isMovingForward:t,destination:s,displaced:a.displaced,draggables:i,combine:u.combine,afterCritical:c});return p==null?null:zd({draggable:n,insideDestination:o,destination:s,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:p})},KV=function(e){var t=e.displaced,r=e.afterCritical,n=e.combineWith,i=e.displacedBy,s=!!(t.visible[n]||t.invisible[n]);return Ki(n,r)?s?Et:ka(i.point):s?i.point:Et},qV=function(e){var t=e.afterCritical,r=e.impact,n=e.draggables,i=up(r);i||Y();var s=i.draggableId,o=n[s].page.borderBox.center,a=KV({displaced:r.displaced,afterCritical:t,combineWith:s,displacedBy:r.displacedBy});return Nt(o,a)},DD=function(t,r){return r.margin[t.start]+r.borderBox[t.size]/2},QV=function(t,r){return r.margin[t.end]+r.borderBox[t.size]/2},Xy=function(t,r,n){return r[t.crossAxisStart]+n.margin[t.crossAxisStart]+n.borderBox[t.crossAxisSize]/2},_b=function(t){var r=t.axis,n=t.moveRelativeTo,i=t.isMoving;return Bs(r.line,n.marginBox[r.end]+DD(r,i),Xy(r,n.marginBox,i))},Lb=function(t){var r=t.axis,n=t.moveRelativeTo,i=t.isMoving;return Bs(r.line,n.marginBox[r.start]-QV(r,i),Xy(r,n.marginBox,i))},YV=function(t){var r=t.axis,n=t.moveInto,i=t.isMoving;return Bs(r.line,n.contentBox[r.start]+DD(r,i),Xy(r,n.contentBox,i))},ZV=function(e){var t=e.impact,r=e.draggable,n=e.draggables,i=e.droppable,s=e.afterCritical,o=Ra(i.descriptor.id,n),a=r.page,l=i.axis;if(!o.length)return YV({axis:l,moveInto:i.page,isMoving:a});var c=t.displaced,u=t.displacedBy,d=c.all[0];if(d){var p=n[d];if(Ki(d,s))return Lb({axis:l,moveRelativeTo:p.page,isMoving:a});var h=Fd(p.page,u.point);return Lb({axis:l,moveRelativeTo:h,isMoving:a})}var g=o[o.length-1];if(g.descriptor.id===r.descriptor.id)return a.borderBox.center;if(Ki(g.descriptor.id,s)){var v=Fd(g.page,ka(s.displacedBy.point));return _b({axis:l,moveRelativeTo:v,isMoving:a})}return _b({axis:l,moveRelativeTo:g.page,isMoving:a})},Vg=function(e,t){var r=e.frame;return r?Nt(t,r.scroll.diff.displacement):t},XV=function(t){var r=t.impact,n=t.draggable,i=t.droppable,s=t.draggables,o=t.afterCritical,a=n.page.borderBox.center,l=r.at;return!i||!l?a:l.type==="REORDER"?ZV({impact:r,draggable:n,draggables:s,droppable:i,afterCritical:o}):qV({impact:r,draggables:s,afterCritical:o})},fp=function(e){var t=XV(e),r=e.droppable,n=r?Vg(r,t):t;return n},AD=function(e,t){var r=fr(t,e.scroll.initial),n=ka(r),i=Zr({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),s={frame:i,scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:r,displacement:n}}};return s};function Fb(e,t){return e.map(function(r){return t[r]})}function JV(e,t){for(var r=0;r1?u.sort(function(d,p){return Vt(d)[a.start]-Vt(p)[a.start]})[0]:c.sort(function(d,p){var h=Ib(r,Mb(Vt(d))),g=Ib(r,Mb(Vt(p)));return h!==g?h-g:Vt(d)[a.start]-Vt(p)[a.start]})[0]},Vb=function(t,r){var n=t.page.borderBox.center;return Ki(t.descriptor.id,r)?fr(n,r.displacedBy.point):n},i$=function(t,r){var n=t.page.borderBox;return Ki(t.descriptor.id,r)?Vc(n,ka(r.displacedBy.point)):n},s$=function(e){var t=e.pageBorderBoxCenter,r=e.viewport,n=e.destination,i=e.insideDestination,s=e.afterCritical,o=i.filter(function(a){return PD({target:i$(a,s),destination:n,viewport:r.frame,withDroppableDisplacement:!0})}).sort(function(a,l){var c=ec(t,Vg(n,Vb(a,s))),u=ec(t,Vg(n,Vb(l,s)));return ct.left&&e.topt.top}function p$(e){var t=e.pageBorderBox,r=e.draggable,n=e.candidates,i=r.page.borderBox.center,s=n.map(function(o){var a=o.axis,l=Bs(o.axis.line,t.center[a.line],o.page.borderBox.center[a.crossAxisLine]);return{id:o.descriptor.id,distance:ec(i,l)}}).sort(function(o,a){return a.distance-o.distance});return s[0]?s[0].id:null}function h$(e){var t=e.pageBorderBox,r=e.draggable,n=e.droppables,i=cp(n).filter(function(s){if(!s.isEnabled)return!1;var o=s.subject.active;if(!o||!f$(t,o))return!1;if(jD(o)(t.center))return!0;var a=s.axis,l=o.center[a.crossAxisLine],c=t[a.crossAxisStart],u=t[a.crossAxisEnd],d=_r(o[a.crossAxisStart],o[a.crossAxisEnd]),p=d(c),h=d(u);return!p&&!h?!0:p?cl});return i.length?i.length===1?i[0].descriptor.id:p$({pageBorderBox:t,draggable:r,candidates:i}):null}var ID=function(t,r){return Zr(Vc(t,r))},m$=function(e,t){var r=e.frame;return r?ID(t,r.scroll.diff.value):t};function MD(e){var t=e.displaced,r=e.id;return!!(t.visible[r]||t.invisible[r])}function g$(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 v$=function(e){var t=e.pageBorderBoxWithDroppableScroll,r=e.draggable,n=e.destination,i=e.insideDestination,s=e.last,o=e.viewport,a=e.afterCritical,l=n.axis,c=$c(n.axis,r.displaceBy),u=c.value,d=t[l.start],p=t[l.end],h=dp(r,i),g=ns(h,function(w){var x=w.descriptor.id,y=w.page.borderBox.center[l.line],b=Ki(x,a),S=MD({displaced:s,id:x});return b?S?p<=y:dx[a.start]+b&&dx[a.start]-c+b&&ux[a.start]+c+b&&dx[a.start]+b&&u=Ub)return zD;var s=i/Ub,o=Ug+q$*s,a=n==="CANCEL"?o*Q$:o;return Number(a.toFixed(2))},Z$=function(e){var t=e.impact,r=e.draggable,n=e.dimensions,i=e.viewport,s=e.afterCritical,o=n.draggables,a=n.droppables,l=hr(t),c=l?a[l]:null,u=a[r.descriptor.droppableId],d=LD({impact:t,draggable:r,draggables:o,afterCritical:s,droppable:c||u,viewport:i}),p=fr(d,r.client.borderBox.center);return p},X$=function(e){var t=e.draggables,r=e.reason,n=e.lastImpact,i=e.home,s=e.viewport,o=e.onLiftImpact;if(!n.at||r!=="DROP"){var a=_D({draggables:t,impact:o,destination:i,viewport:s,forceShouldAnimate:!0});return{impact:a,didDropInsideDroppable:!1}}if(n.at.type==="REORDER")return{impact:n,didDropInsideDroppable:!0};var l=ye({},n,{displaced:tc});return{impact:l,didDropInsideDroppable:!0}},J$=function(e){var t=e.getState,r=e.dispatch;return function(n){return function(i){if(i.type!=="DROP"){n(i);return}var s=t(),o=i.payload.reason;if(s.phase==="COLLECTING"){r(H$({reason:o}));return}if(s.phase!=="IDLE"){var a=s.phase==="DROP_PENDING"&&s.isWaiting;a&&Y(),s.phase==="DRAGGING"||s.phase==="DROP_PENDING"||Y();var l=s.critical,c=s.dimensions,u=c.draggables[s.critical.draggable.id],d=X$({reason:o,lastImpact:s.impact,afterCritical:s.afterCritical,onLiftImpact:s.onLiftImpact,home:s.dimensions.droppables[s.critical.droppable.id],viewport:s.viewport,draggables:s.dimensions.draggables}),p=d.impact,h=d.didDropInsideDroppable,g=h?Qy(p):null,v=h?up(p):null,w={index:l.draggable.index,droppableId:l.droppable.id},x={draggableId:u.descriptor.id,type:u.descriptor.type,source:w,reason:o,mode:s.movementMode,destination:g,combine:v},y=Z$({impact:p,draggable:u,dimensions:c,viewport:s.viewport,afterCritical:s.afterCritical}),b={critical:s.critical,afterCritical:s.afterCritical,result:x,impact:p},S=!Bi(s.current.client.offset,y)||!!x.combine;if(!S){r(rx({completed:b}));return}var C=Y$({current:s.current.client.offset,destination:y,reason:o}),D={newHomeClientOffset:y,dropDuration:C,completed:b};r(W$(D))}}}},WD=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function eB(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(r){r.target!==window&&r.target!==window.document||e()}}}function tB(e){var t=e.onWindowScroll;function r(){t(WD())}var n=Jl(r),i=eB(n),s=$i;function o(){return s!==$i}function a(){o()&&Y(),s=Ir(window,[i])}function l(){o()||Y(),n.cancel(),s(),s=$i}return{start:a,stop:l,isActive:o}}var rB=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},nB=function(e){var t=tB({onWindowScroll:function(n){e.dispatch(F$({newScroll:n}))}});return function(r){return function(n){!t.isActive()&&n.type==="INITIAL_PUBLISH"&&t.start(),t.isActive()&&rB(n)&&t.stop(),r(n)}}},iB=function(e){var t=!1,r=!1,n=setTimeout(function(){r=!0}),i=function(o){t||r||(t=!0,e(o),clearTimeout(n))};return i.wasCalled=function(){return t},i},sB=function(){var e=[],t=function(s){var o=qy(e,function(c){return c.timerId===s});o===-1&&Y();var a=e.splice(o,1),l=a[0];l.callback()},r=function(s){var o=setTimeout(function(){return t(o)}),a={timerId:o,callback:s};e.push(a)},n=function(){if(e.length){var s=[].concat(e);e.length=0,s.forEach(function(o){clearTimeout(o.timerId),o.callback()})}};return{add:r,flush:n}},oB=function(t,r){return t==null&&r==null?!0:t==null||r==null?!1:t.droppableId===r.droppableId&&t.index===r.index},aB=function(t,r){return t==null&&r==null?!0:t==null||r==null?!1:t.draggableId===r.draggableId&&t.droppableId===r.droppableId},lB=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},qa=function(t,r){r()},wu=function(t,r){return{draggableId:t.draggable.id,type:t.droppable.type,source:{droppableId:t.droppable.id,index:t.draggable.index},mode:r}},Vh=function(t,r,n,i){if(!t){n(i(r));return}var s=iB(n),o={announce:s};t(r,o),s.wasCalled()||n(i(r))},cB=function(e,t){var r=sB(),n=null,i=function(p,h){n&&Y(),qa("onBeforeCapture",function(){var g=e().onBeforeCapture;if(g){var v={draggableId:p,mode:h};g(v)}})},s=function(p,h){n&&Y(),qa("onBeforeDragStart",function(){var g=e().onBeforeDragStart;g&&g(wu(p,h))})},o=function(p,h){n&&Y();var g=wu(p,h);n={mode:h,lastCritical:p,lastLocation:g.source,lastCombine:null},r.add(function(){qa("onDragStart",function(){return Vh(e().onDragStart,g,t,ed.onDragStart)})})},a=function(p,h){var g=Qy(h),v=up(h);n||Y();var w=!lB(p,n.lastCritical);w&&(n.lastCritical=p);var x=!oB(n.lastLocation,g);x&&(n.lastLocation=g);var y=!aB(n.lastCombine,v);if(y&&(n.lastCombine=v),!(!w&&!x&&!y)){var b=ye({},wu(p,n.mode),{combine:v,destination:g});r.add(function(){qa("onDragUpdate",function(){return Vh(e().onDragUpdate,b,t,ed.onDragUpdate)})})}},l=function(){n||Y(),r.flush()},c=function(p){n||Y(),n=null,qa("onDragEnd",function(){return Vh(e().onDragEnd,p,t,ed.onDragEnd)})},u=function(){if(n){var p=ye({},wu(n.lastCritical,n.mode),{combine:null,destination:null,reason:"CANCEL"});c(p)}};return{beforeCapture:i,beforeStart:s,start:o,update:a,flush:l,drop:c,abort:u}},uB=function(e,t){var r=cB(e,t);return function(n){return function(i){return function(s){if(s.type==="BEFORE_INITIAL_CAPTURE"){r.beforeCapture(s.payload.draggableId,s.payload.movementMode);return}if(s.type==="INITIAL_PUBLISH"){var o=s.payload.critical;r.beforeStart(o,s.payload.movementMode),i(s),r.start(o,s.payload.movementMode);return}if(s.type==="DROP_COMPLETE"){var a=s.payload.completed.result;r.flush(),i(s),r.drop(a);return}if(i(s),s.type==="FLUSH"){r.abort();return}var l=n.getState();l.phase==="DRAGGING"&&r.update(l.critical,l.impact)}}}},dB=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"&&Y(),e.dispatch(rx({completed:n.completed}))}}},fB=function(e){var t=null,r=null;function n(){r&&(cancelAnimationFrame(r),r=null),t&&(t(),t=null)}return function(i){return function(s){if((s.type==="FLUSH"||s.type==="DROP_COMPLETE"||s.type==="DROP_ANIMATION_FINISHED")&&n(),i(s),s.type==="DROP_ANIMATE"){var o={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var l=e.getState();l.phase==="DROP_ANIMATING"&&e.dispatch(UD())}};r=requestAnimationFrame(function(){r=null,t=Ir(window,[o])})}}}},pB=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)}}}},hB=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()}}}}}},mB=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},gB=function(e){return function(t){return function(r){return function(n){if(mB(n)){e.stop(),r(n);return}if(n.type==="INITIAL_PUBLISH"){r(n);var i=t.getState();i.phase!=="DRAGGING"&&Y(),e.start(i);return}r(n),e.scroll(t.getState())}}}},vB=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(BD({reason:n.reason})))}}}},yB=YP,xB=function(e){var t=e.dimensionMarshal,r=e.focusMarshal,n=e.styleMarshal,i=e.getResponders,s=e.announce,o=e.autoScroller;return QP(N$,yB(sF(K$(n),pB(t),G$(t),J$,dB,fB,vB,gB(o),nB,hB(r),uB(i,s))))},$h=function(){return{additions:{},removals:{},modified:{}}};function wB(e){var t=e.registry,r=e.callbacks,n=$h(),i=null,s=function(){i||(r.collectionStarting(),i=requestAnimationFrame(function(){i=null;var u=n,d=u.additions,p=u.removals,h=u.modified,g=Object.keys(d).map(function(x){return t.draggable.getById(x).getDimension(Et)}).sort(function(x,y){return x.descriptor.index-y.descriptor.index}),v=Object.keys(h).map(function(x){var y=t.droppable.getById(x),b=y.callbacks.getScrollWhileDragging();return{droppableId:x,scroll:b}}),w={additions:g,removals:Object.keys(p),modified:v};n=$h(),r.publish(w)}))},o=function(u){var d=u.descriptor.id;n.additions[d]=u,n.modified[u.descriptor.droppableId]=!0,n.removals[d]&&delete n.removals[d],s()},a=function(u){var d=u.descriptor;n.removals[d.id]=!0,n.modified[d.droppableId]=!0,n.additions[d.id]&&delete n.additions[d.id],s()},l=function(){i&&(cancelAnimationFrame(i),i=null,n=$h())};return{add:o,remove:a,stop:l}}var HD=function(e){var t=e.scrollHeight,r=e.scrollWidth,n=e.height,i=e.width,s=fr({x:r,y:t},{x:i,y:n}),o={x:Math.max(0,s.x),y:Math.max(0,s.y)};return o},GD=function(){var e=document.documentElement;return e||Y(),e},KD=function(){var e=GD(),t=HD({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight});return t},bB=function(){var e=WD(),t=KD(),r=e.y,n=e.x,i=GD(),s=i.clientWidth,o=i.clientHeight,a=n+s,l=r+o,c=Zr({top:r,left:n,right:a,bottom:l}),u={frame:c,scroll:{initial:e,current:e,max:t,diff:{value:Et,displacement:Et}}};return u},SB=function(e){var t=e.critical,r=e.scrollOptions,n=e.registry,i=bB(),s=i.scroll.current,o=t.droppable,a=n.droppable.getAllByType(o.type).map(function(d){return d.callbacks.getDimensionAndWatchScroll(s,r)}),l=n.draggable.getAllByType(t.draggable.type).map(function(d){return d.getDimension(s)}),c={draggables:SD(l),droppables:bD(a)},u={dimensions:c,critical:t,viewport:i};return u};function zb(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 CB=function(e,t){var r=null,n=wB({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=function(h,g){e.droppable.exists(h)||Y(),r&&t.updateDroppableIsEnabled({id:h,isEnabled:g})},s=function(h,g){r&&(e.droppable.exists(h)||Y(),t.updateDroppableIsCombineEnabled({id:h,isCombineEnabled:g}))},o=function(h,g){r&&(e.droppable.exists(h)||Y(),t.updateDroppableScroll({id:h,newScroll:g}))},a=function(h,g){r&&e.droppable.getById(h).callbacks.scroll(g)},l=function(){if(r){n.stop();var h=r.critical.droppable;e.droppable.getAllByType(h.type).forEach(function(g){return g.callbacks.dragStopped()}),r.unsubscribe(),r=null}},c=function(h){r||Y();var g=r.critical.draggable;h.type==="ADDITION"&&zb(e,g,h.value)&&n.add(h.value),h.type==="REMOVAL"&&zb(e,g,h.value)&&n.remove(h.value)},u=function(h){r&&Y();var g=e.draggable.getById(h.draggableId),v=e.droppable.getById(g.descriptor.droppableId),w={draggable:g.descriptor,droppable:v.descriptor},x=e.subscribe(c);return r={critical:w,unsubscribe:x},SB({critical:w,registry:e,scrollOptions:h.scrollOptions})},d={updateDroppableIsEnabled:i,updateDroppableIsCombineEnabled:s,scrollDroppable:a,updateDroppableScroll:o,startPublishing:u,stopPublishing:l};return d},qD=function(e,t){return e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP"},EB=function(e){window.scrollBy(e.x,e.y)},TB=Ct(function(e){return cp(e).filter(function(t){return!(!t.isEnabled||!t.frame)})}),PB=function(t,r){var n=ns(TB(r),function(i){return i.frame||Y(),jD(i.frame.pageMarginBox)(t)});return n},DB=function(e){var t=e.center,r=e.destination,n=e.droppables;if(r){var i=n[r];return i.frame?i:null}var s=PB(t,n);return s},Ui={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(t){return Math.pow(t,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},AB=function(e,t){var r=e[t.size]*Ui.startFromPercentage,n=e[t.size]*Ui.maxScrollAtPercentage,i={startScrollingFrom:r,maxScrollValueAt:n};return i},QD=function(e){var t=e.startOfRange,r=e.endOfRange,n=e.current,i=r-t;if(i===0)return 0;var s=n-t,o=s/i;return o},sx=1,NB=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return Ui.maxPixelScroll;if(e===t.startScrollingFrom)return sx;var r=QD({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),n=1-r,i=Ui.maxPixelScroll*Ui.ease(n);return Math.ceil(i)},Wb=Ui.durationDampening.accelerateAt,Hb=Ui.durationDampening.stopDampeningAt,kB=function(e,t){var r=t,n=Hb,i=Date.now(),s=i-r;if(s>=Hb)return e;if(st.height,s=r.width>t.width;return!s&&!i?n:s&&i?null:{x:s?0:n.x,y:i?0:n.y}},jB=xD(function(e){return e===0?0:e}),YD=function(e){var t=e.dragStartTime,r=e.container,n=e.subject,i=e.center,s=e.shouldUseTimeDampening,o={top:i.y-r.top,right:r.right-i.x,bottom:r.bottom-i.y,left:i.x-r.left},a=Kb({container:r,distanceToEdges:o,dragStartTime:t,axis:Yy,shouldUseTimeDampening:s}),l=Kb({container:r,distanceToEdges:o,dragStartTime:t,axis:TD,shouldUseTimeDampening:s}),c=jB({x:l,y:a});if(Bi(c,Et))return null;var u=RB({container:r,subject:n,proposedScroll:c});return u?Bi(u,Et)?null:u:null},IB=xD(function(e){return e===0?0:e>0?1:-1}),ox=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,s=Nt(r,i),o={x:e(s.x,n.x),y:e(s.y,n.y)};return Bi(o,Et)?null:o}}(),ZD=function(t){var r=t.max,n=t.current,i=t.change,s={x:Math.max(n.x,r.x),y:Math.max(n.y,r.y)},o=IB(i),a=ox({max:s,current:n,change:o});return!a||o.x!==0&&a.x===0||o.y!==0&&a.y===0},ax=function(t,r){return ZD({current:t.scroll.current,max:t.scroll.max,change:r})},MB=function(t,r){if(!ax(t,r))return null;var n=t.scroll.max,i=t.scroll.current;return ox({current:i,max:n,change:r})},lx=function(t,r){var n=t.frame;return n?ZD({current:n.scroll.current,max:n.scroll.max,change:r}):!1},OB=function(t,r){var n=t.frame;return!n||!lx(t,r)?null:ox({current:n.scroll.current,max:n.scroll.max,change:r})},_B=function(e){var t=e.viewport,r=e.subject,n=e.center,i=e.dragStartTime,s=e.shouldUseTimeDampening,o=YD({dragStartTime:i,container:t.frame,subject:r,center:n,shouldUseTimeDampening:s});return o&&ax(t,o)?o:null},LB=function(e){var t=e.droppable,r=e.subject,n=e.center,i=e.dragStartTime,s=e.shouldUseTimeDampening,o=t.frame;if(!o)return null;var a=YD({dragStartTime:i,container:o.pageMarginBox,subject:r,center:n,shouldUseTimeDampening:s});return a&&lx(t,a)?a:null},qb=function(e){var t=e.state,r=e.dragStartTime,n=e.shouldUseTimeDampening,i=e.scrollWindow,s=e.scrollDroppable,o=t.current.page.borderBoxCenter,a=t.dimensions.draggables[t.critical.draggable.id],l=a.page.marginBox;if(t.isWindowScrollAllowed){var c=t.viewport,u=_B({dragStartTime:r,viewport:c,subject:l,center:o,shouldUseTimeDampening:n});if(u){i(u);return}}var d=DB({center:o,destination:hr(t.impact),droppables:t.dimensions.droppables});if(d){var p=LB({dragStartTime:r,droppable:d,subject:l,center:o,shouldUseTimeDampening:n});p&&s(d.descriptor.id,p)}},FB=function(e){var t=e.scrollWindow,r=e.scrollDroppable,n=Jl(t),i=Jl(r),s=null,o=function(u){s||Y();var d=s,p=d.shouldUseTimeDampening,h=d.dragStartTime;qb({state:u,scrollWindow:n,scrollDroppable:i,dragStartTime:h,shouldUseTimeDampening:p})},a=function(u){s&&Y();var d=Date.now(),p=!1,h=function(){p=!0};qb({state:u,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:h,scrollDroppable:h}),s={dragStartTime:d,shouldUseTimeDampening:p},p&&o(u)},l=function(){s&&(n.cancel(),i.cancel(),s=null)};return{start:a,stop:l,scroll:o}},VB=function(e){var t=e.move,r=e.scrollDroppable,n=e.scrollWindow,i=function(c,u){var d=Nt(c.current.client.selection,u);t({client:d})},s=function(c,u){if(!lx(c,u))return u;var d=OB(c,u);if(!d)return r(c.descriptor.id,u),null;var p=fr(u,d);r(c.descriptor.id,p);var h=fr(u,p);return h},o=function(c,u,d){if(!c||!ax(u,d))return d;var p=MB(u,d);if(!p)return n(d),null;var h=fr(d,p);n(h);var g=fr(d,h);return g},a=function(c){var u=c.scrollJumpRequest;if(u){var d=hr(c.impact);d||Y();var p=s(c.dimensions.droppables[d],u);if(p){var h=c.viewport,g=o(c.isWindowScrollAllowed,h,p);g&&i(c,g)}}};return a},$B=function(e){var t=e.scrollDroppable,r=e.scrollWindow,n=e.move,i=FB({scrollWindow:r,scrollDroppable:t}),s=VB({move:n,scrollWindow:r,scrollDroppable:t}),o=function(c){if(c.phase==="DRAGGING"){if(c.movementMode==="FLUID"){i.scroll(c);return}c.scrollJumpRequest&&s(c)}},a={scroll:o,start:i.start,stop:i.stop};return a},fa="data-rbd",pa=function(){var e=fa+"-drag-handle";return{base:e,draggableId:e+"-draggable-id",contextId:e+"-context-id"}}(),zg=function(){var e=fa+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),BB=function(){var e=fa+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),Qb={contextId:fa+"-scroll-container-context-id"},UB=function(t){return function(r){return"["+r+'="'+t+'"]'}},Qa=function(t,r){return t.map(function(n){var i=n.styles[r];return i?n.selector+" { "+i+" }":""}).join(" ")},zB="pointer-events: none;",WB=function(e){var t=UB(e),r=function(){var a=` cursor: -webkit-grab; cursor: grab; `;return{selector:t(pa.contextId),styles:{always:` -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(0,0,0,0); touch-action: manipulation; `,resting:a,dragging:zB,dropAnimating:a}}}(),n=function(){var a=` transition: `+Pl.outOfTheWay+`; `;return{selector:t(zg.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}}(),i={selector:t(BB.contextId),styles:{always:"overflow-anchor: none;"}},s={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; `}},o=[n,r,i,s];return{always:Qa(o,"always"),resting:Qa(o,"resting"),dragging:Qa(o,"dragging"),dropAnimating:Qa(o,"dropAnimating"),userCancel:Qa(o,"userCancel")}},mr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?m.useLayoutEffect:m.useEffect,Bh=function(){var t=document.querySelector("head");return t||Y(),t},Yb=function(t){var r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.type="text/css",r};function HB(e,t){var r=Oe(function(){return WB(e)},[e]),n=m.useRef(null),i=m.useRef(null),s=pe(Ct(function(d){var p=i.current;p||Y(),p.textContent=d}),[]),o=pe(function(d){var p=n.current;p||Y(),p.textContent=d},[]);mr(function(){!n.current&&!i.current||Y();var d=Yb(t),p=Yb(t);return n.current=d,i.current=p,d.setAttribute(fa+"-always",e),p.setAttribute(fa+"-dynamic",e),Bh().appendChild(d),Bh().appendChild(p),o(r.always),s(r.resting),function(){var h=function(v){var w=v.current;w||Y(),Bh().removeChild(w),v.current=null};h(n),h(i)}},[t,o,s,r.always,r.resting,e]);var a=pe(function(){return s(r.dragging)},[s,r.dragging]),l=pe(function(d){if(d==="DROP"){s(r.dropAnimating);return}s(r.userCancel)},[s,r.dropAnimating,r.userCancel]),c=pe(function(){i.current&&s(r.resting)},[s,r.resting]),u=Oe(function(){return{dragging:a,dropping:l,resting:c}},[a,l,c]);return u}var XD=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function pp(e){return e instanceof XD(e).HTMLElement}function GB(e,t){var r="["+pa.contextId+'="'+e+'"]',n=wD(document.querySelectorAll(r));if(!n.length)return null;var i=ns(n,function(s){return s.getAttribute(pa.draggableId)===t});return!i||!pp(i)?null:i}function KB(e){var t=m.useRef({}),r=m.useRef(null),n=m.useRef(null),i=m.useRef(!1),s=pe(function(p,h){var g={id:p,focus:h};return t.current[p]=g,function(){var w=t.current,x=w[p];x!==g&&delete w[p]}},[]),o=pe(function(p){var h=GB(e,p);h&&h!==document.activeElement&&h.focus()},[e]),a=pe(function(p,h){r.current===p&&(r.current=h)},[]),l=pe(function(){n.current||i.current&&(n.current=requestAnimationFrame(function(){n.current=null;var p=r.current;p&&o(p)}))},[o]),c=pe(function(p){r.current=null;var h=document.activeElement;h&&h.getAttribute(pa.draggableId)===p&&(r.current=p)},[]);mr(function(){return i.current=!0,function(){i.current=!1;var p=n.current;p&&cancelAnimationFrame(p)}},[]);var u=Oe(function(){return{register:s,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:a}},[s,c,l,a]);return u}function qB(){var e={draggables:{},droppables:{}},t=[];function r(d){return t.push(d),function(){var h=t.indexOf(d);h!==-1&&t.splice(h,1)}}function n(d){t.length&&t.forEach(function(p){return p(d)})}function i(d){return e.draggables[d]||null}function s(d){var p=i(d);return p||Y(),p}var o={register:function(p){e.draggables[p.descriptor.id]=p,n({type:"ADDITION",value:p})},update:function(p,h){var g=e.draggables[h.descriptor.id];g&&g.uniqueId===p.uniqueId&&(delete e.draggables[h.descriptor.id],e.draggables[p.descriptor.id]=p)},unregister:function(p){var h=p.descriptor.id,g=i(h);g&&p.uniqueId===g.uniqueId&&(delete e.draggables[h],n({type:"REMOVAL",value:p}))},getById:s,findById:i,exists:function(p){return!!i(p)},getAllByType:function(p){return Ud(e.draggables).filter(function(h){return h.descriptor.type===p})}};function a(d){return e.droppables[d]||null}function l(d){var p=a(d);return p||Y(),p}var c={register:function(p){e.droppables[p.descriptor.id]=p},unregister:function(p){var h=a(p.descriptor.id);h&&p.uniqueId===h.uniqueId&&delete e.droppables[p.descriptor.id]},getById:l,findById:a,exists:function(p){return!!a(p)},getAllByType:function(p){return Ud(e.droppables).filter(function(h){return h.descriptor.type===p})}};function u(){e.draggables={},e.droppables={},t.length=0}return{draggable:o,droppable:c,subscribe:r,clean:u}}function QB(){var e=Oe(qB,[]);return m.useEffect(function(){return function(){requestAnimationFrame(e.clean)}},[e]),e}var cx=ee.createContext(null),Wd=function(){var e=document.body;return e||Y(),e},YB={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},ZB=function(t){return"rbd-announcement-"+t};function XB(e){var t=Oe(function(){return ZB(e)},[e]),r=m.useRef(null);m.useEffect(function(){var s=document.createElement("div");return r.current=s,s.id=t,s.setAttribute("aria-live","assertive"),s.setAttribute("aria-atomic","true"),ye(s.style,YB),Wd().appendChild(s),function(){setTimeout(function(){var l=Wd();l.contains(s)&&l.removeChild(s),s===r.current&&(r.current=null)})}},[t]);var n=pe(function(i){var s=r.current;if(s){s.textContent=i;return}},[]);return n}var JB=0,e4={separator:"::"};function ux(e,t){return t===void 0&&(t=e4),Oe(function(){return""+e+t.separator+JB++},[t.separator,e])}function t4(e){var t=e.contextId,r=e.uniqueId;return"rbd-hidden-text-"+t+"-"+r}function r4(e){var t=e.contextId,r=e.text,n=ux("hidden-text",{separator:"-"}),i=Oe(function(){return t4({contextId:t,uniqueId:n})},[n,t]);return m.useEffect(function(){var o=document.createElement("div");return o.id=i,o.textContent=r,o.style.display="none",Wd().appendChild(o),function(){var l=Wd();l.contains(o)&&l.removeChild(o)}},[i,r]),i}var hp=ee.createContext(null);function JD(e){var t=m.useRef(e);return m.useEffect(function(){t.current=e}),t}function n4(){var e=null;function t(){return!!e}function r(o){return o===e}function n(o){e&&Y();var a={abandon:o};return e=a,a}function i(){e||Y(),e=null}function s(){e&&(e.abandon(),i())}return{isClaimed:t,isActive:r,claim:n,release:i,tryAbandon:s}}var i4=9,s4=13,dx=27,eA=32,o4=33,a4=34,l4=35,c4=36,u4=37,d4=38,f4=39,p4=40,bu,h4=(bu={},bu[s4]=!0,bu[i4]=!0,bu),tA=function(e){h4[e.keyCode]&&e.preventDefault()},mp=function(){var e="visibilitychange";if(typeof document>"u")return e;var t=[e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],r=ns(t,function(n){return"on"+n in document});return r||e}(),rA=0,Zb=5;function m4(e,t){return Math.abs(t.x-e.x)>=Zb||Math.abs(t.y-e.y)>=Zb}var Xb={type:"IDLE"};function g4(e){var t=e.cancel,r=e.completed,n=e.getPhase,i=e.setPhase;return[{eventName:"mousemove",fn:function(o){var a=o.button,l=o.clientX,c=o.clientY;if(a===rA){var u={x:l,y:c},d=n();if(d.type==="DRAGGING"){o.preventDefault(),d.actions.move(u);return}d.type!=="PENDING"&&Y();var p=d.point;if(m4(p,u)){o.preventDefault();var h=d.actions.fluidLift(u);i({type:"DRAGGING",actions:h})}}}},{eventName:"mouseup",fn:function(o){var a=n();if(a.type!=="DRAGGING"){t();return}o.preventDefault(),a.actions.drop({shouldBlockNextClick:!0}),r()}},{eventName:"mousedown",fn:function(o){n().type==="DRAGGING"&&o.preventDefault(),t()}},{eventName:"keydown",fn:function(o){var a=n();if(a.type==="PENDING"){t();return}if(o.keyCode===dx){o.preventDefault(),t();return}tA(o)}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){n().type==="PENDING"&&t()}},{eventName:"webkitmouseforcedown",fn:function(o){var a=n();if(a.type==="IDLE"&&Y(),a.actions.shouldRespectForcePress()){t();return}o.preventDefault()}},{eventName:mp,fn:t}]}function v4(e){var t=m.useRef(Xb),r=m.useRef($i),n=Oe(function(){return{eventName:"mousedown",fn:function(d){if(!d.defaultPrevented&&d.button===rA&&!(d.ctrlKey||d.metaKey||d.shiftKey||d.altKey)){var p=e.findClosestDraggableId(d);if(p){var h=e.tryGetLock(p,o,{sourceEvent:d});if(h){d.preventDefault();var g={x:d.clientX,y:d.clientY};r.current(),c(h,g)}}}}}},[e]),i=Oe(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(d){if(!d.defaultPrevented){var p=e.findClosestDraggableId(d);if(p){var h=e.findOptionsForDraggable(p);h&&(h.shouldRespectForcePress||e.canGetLock(p)&&d.preventDefault())}}}}},[e]),s=pe(function(){var d={passive:!1,capture:!0};r.current=Ir(window,[i,n],d)},[i,n]),o=pe(function(){var u=t.current;u.type!=="IDLE"&&(t.current=Xb,r.current(),s())},[s]),a=pe(function(){var u=t.current;o(),u.type==="DRAGGING"&&u.actions.cancel({shouldBlockNextClick:!0}),u.type==="PENDING"&&u.actions.abort()},[o]),l=pe(function(){var d={capture:!0,passive:!1},p=g4({cancel:a,completed:o,getPhase:function(){return t.current},setPhase:function(g){t.current=g}});r.current=Ir(window,p,d)},[a,o]),c=pe(function(d,p){t.current.type!=="IDLE"&&Y(),t.current={type:"PENDING",point:p,actions:d},l()},[l]);mr(function(){return s(),function(){r.current()}},[s])}var no;function y4(){}var x4=(no={},no[a4]=!0,no[o4]=!0,no[c4]=!0,no[l4]=!0,no);function w4(e,t){function r(){t(),e.cancel()}function n(){t(),e.drop()}return[{eventName:"keydown",fn:function(s){if(s.keyCode===dx){s.preventDefault(),r();return}if(s.keyCode===eA){s.preventDefault(),n();return}if(s.keyCode===p4){s.preventDefault(),e.moveDown();return}if(s.keyCode===d4){s.preventDefault(),e.moveUp();return}if(s.keyCode===f4){s.preventDefault(),e.moveRight();return}if(s.keyCode===u4){s.preventDefault(),e.moveLeft();return}if(x4[s.keyCode]){s.preventDefault();return}tA(s)}},{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:mp,fn:r}]}function b4(e){var t=m.useRef(y4),r=Oe(function(){return{eventName:"keydown",fn:function(s){if(s.defaultPrevented||s.keyCode!==eA)return;var o=e.findClosestDraggableId(s);if(!o)return;var a=e.tryGetLock(o,u,{sourceEvent:s});if(!a)return;s.preventDefault();var l=!0,c=a.snapLift();t.current();function u(){l||Y(),l=!1,t.current(),n()}t.current=Ir(window,w4(c,u),{capture:!0,passive:!1})}}},[e]),n=pe(function(){var s={passive:!1,capture:!0};t.current=Ir(window,[r],s)},[r]);mr(function(){return n(),function(){t.current()}},[n])}var Uh={type:"IDLE"},S4=120,C4=.15;function E4(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===dx&&i.preventDefault(),t()}},{eventName:mp,fn:t}]}function T4(e){var t=e.cancel,r=e.completed,n=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(s){var o=n();if(o.type!=="DRAGGING"){t();return}o.hasMoved=!0;var a=s.touches[0],l=a.clientX,c=a.clientY,u={x:l,y:c};s.preventDefault(),o.actions.move(u)}},{eventName:"touchend",fn:function(s){var o=n();if(o.type!=="DRAGGING"){t();return}s.preventDefault(),o.actions.drop({shouldBlockNextClick:!0}),r()}},{eventName:"touchcancel",fn:function(s){if(n().type!=="DRAGGING"){t();return}s.preventDefault(),t()}},{eventName:"touchforcechange",fn:function(s){var o=n();o.type==="IDLE"&&Y();var a=s.touches[0];if(a){var l=a.force>=C4;if(l){var c=o.actions.shouldRespectForcePress();if(o.type==="PENDING"){c&&t();return}if(c){if(o.hasMoved){s.preventDefault();return}t();return}s.preventDefault()}}}},{eventName:mp,fn:t}]}function P4(e){var t=m.useRef(Uh),r=m.useRef($i),n=pe(function(){return t.current},[]),i=pe(function(h){t.current=h},[]),s=Oe(function(){return{eventName:"touchstart",fn:function(h){if(!h.defaultPrevented){var g=e.findClosestDraggableId(h);if(g){var v=e.tryGetLock(g,a,{sourceEvent:h});if(v){var w=h.touches[0],x=w.clientX,y=w.clientY,b={x,y};r.current(),d(v,b)}}}}}},[e]),o=pe(function(){var h={capture:!0,passive:!1};r.current=Ir(window,[s],h)},[s]),a=pe(function(){var p=t.current;p.type!=="IDLE"&&(p.type==="PENDING"&&clearTimeout(p.longPressTimerId),i(Uh),r.current(),o())},[o,i]),l=pe(function(){var p=t.current;a(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[a]),c=pe(function(){var h={capture:!0,passive:!1},g={cancel:l,completed:a,getPhase:n},v=Ir(window,T4(g),h),w=Ir(window,E4(g),h);r.current=function(){v(),w()}},[l,n,a]),u=pe(function(){var h=n();h.type!=="PENDING"&&Y();var g=h.actions.fluidLift(h.point);i({type:"DRAGGING",actions:g,hasMoved:!1})},[n,i]),d=pe(function(h,g){n().type!=="IDLE"&&Y();var v=setTimeout(u,S4);i({type:"PENDING",point:g,actions:h,longPressTimerId:v}),c()},[c,n,i,u]);mr(function(){return o(),function(){r.current();var g=n();g.type==="PENDING"&&(clearTimeout(g.longPressTimerId),i(Uh))}},[n,o,i]),mr(function(){var h=Ir(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return h},[])}var D4={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function nA(e,t){if(t==null)return!1;var r=!!D4[t.tagName.toLowerCase()];if(r)return!0;var n=t.getAttribute("contenteditable");return n==="true"||n===""?!0:t===e?!1:nA(e,t.parentElement)}function A4(e,t){var r=t.target;return pp(r)?nA(e,r):!1}var N4=function(e){return Zr(e.getBoundingClientRect()).center};function k4(e){return e instanceof XD(e).Element}var R4=function(){var e="matches";if(typeof document>"u")return e;var t=[e,"msMatchesSelector","webkitMatchesSelector"],r=ns(t,function(n){return n in Element.prototype});return r||e}();function iA(e,t){return e==null?null:e[R4](t)?e:iA(e.parentElement,t)}function j4(e,t){return e.closest?e.closest(t):iA(e,t)}function I4(e){return"["+pa.contextId+'="'+e+'"]'}function M4(e,t){var r=t.target;if(!k4(r))return null;var n=I4(e),i=j4(r,n);return!i||!pp(i)?null:i}function O4(e,t){var r=M4(e,t);return r?r.getAttribute(pa.draggableId):null}function _4(e,t){var r="["+zg.contextId+'="'+e+'"]',n=wD(document.querySelectorAll(r)),i=ns(n,function(s){return s.getAttribute(zg.id)===t});return!i||!pp(i)?null:i}function L4(e){e.preventDefault()}function Su(e){var t=e.expected,r=e.phase,n=e.isLockActive;return e.shouldWarn,!(!n()||t!==r)}function sA(e){var t=e.lockAPI,r=e.store,n=e.registry,i=e.draggableId;if(t.isClaimed())return!1;var s=n.draggable.findById(i);return!(!s||!s.options.isEnabled||!qD(r.getState(),i))}function F4(e){var t=e.lockAPI,r=e.contextId,n=e.store,i=e.registry,s=e.draggableId,o=e.forceSensorStop,a=e.sourceEvent,l=sA({lockAPI:t,store:n,registry:i,draggableId:s});if(!l)return null;var c=i.draggable.getById(s),u=_4(r,c.descriptor.id);if(!u||a&&!c.options.canDragInteractiveElements&&A4(u,a))return null;var d=t.claim(o||$i),p="PRE_DRAG";function h(){return c.options.shouldRespectForcePress}function g(){return t.isActive(d)}function v(D,N){Su({expected:D,phase:p,isLockActive:g,shouldWarn:!0})&&n.dispatch(N())}var w=v.bind(null,"DRAGGING");function x(D){function N(){t.release(),p="COMPLETED"}p!=="PRE_DRAG"&&(N(),p!=="PRE_DRAG"&&Y()),n.dispatch(R$(D.liftActionArgs)),p="DRAGGING";function k(R,M){if(M===void 0&&(M={shouldBlockNextClick:!1}),D.cleanup(),M.shouldBlockNextClick){var W=Ir(window,[{eventName:"click",fn:L4,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(W)}N(),n.dispatch(BD({reason:R}))}return ye({isActive:function(){return Su({expected:"DRAGGING",phase:p,isLockActive:g,shouldWarn:!1})},shouldRespectForcePress:h,drop:function(M){return k("DROP",M)},cancel:function(M){return k("CANCEL",M)}},D.actions)}function y(D){var N=Jl(function(R){w(function(){return $D({client:R})})}),k=x({liftActionArgs:{id:s,clientSelection:D,movementMode:"FLUID"},cleanup:function(){return N.cancel()},actions:{move:N}});return ye({},k,{move:N})}function b(){var D={moveUp:function(){return w($$)},moveRight:function(){return w(U$)},moveDown:function(){return w(B$)},moveLeft:function(){return w(z$)}};return x({liftActionArgs:{id:s,clientSelection:N4(u),movementMode:"SNAP"},cleanup:$i,actions:D})}function S(){var D=Su({expected:"PRE_DRAG",phase:p,isLockActive:g,shouldWarn:!0});D&&t.release()}var C={isActive:function(){return Su({expected:"PRE_DRAG",phase:p,isLockActive:g,shouldWarn:!1})},shouldRespectForcePress:h,fluidLift:y,snapLift:b,abort:S};return C}var V4=[v4,b4,P4];function $4(e){var t=e.contextId,r=e.store,n=e.registry,i=e.customSensors,s=e.enableDefaultSensors,o=[].concat(s?V4:[],i||[]),a=m.useState(function(){return n4()})[0],l=pe(function(y,b){y.isDragging&&!b.isDragging&&a.tryAbandon()},[a]);mr(function(){var y=r.getState(),b=r.subscribe(function(){var S=r.getState();l(y,S),y=S});return b},[a,r,l]),mr(function(){return a.tryAbandon},[a.tryAbandon]);for(var c=pe(function(x){return sA({lockAPI:a,registry:n,store:r,draggableId:x})},[a,n,r]),u=pe(function(x,y,b){return F4({lockAPI:a,registry:n,contextId:t,store:r,draggableId:x,forceSensorStop:y,sourceEvent:b&&b.sourceEvent?b.sourceEvent:null})},[t,a,n,r]),d=pe(function(x){return O4(t,x)},[t]),p=pe(function(x){var y=n.draggable.findById(x);return y?y.options:null},[n.draggable]),h=pe(function(){a.isClaimed()&&(a.tryAbandon(),r.getState().phase!=="IDLE"&&r.dispatch(tx()))},[a,r]),g=pe(a.isClaimed,[a]),v=Oe(function(){return{canGetLock:c,tryGetLock:u,findClosestDraggableId:d,findOptionsForDraggable:p,tryReleaseLock:h,isLockClaimed:g}},[c,u,d,p,h,g]),w=0;w"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 gp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Hg=e=>Array.isArray(e);function fA(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 px(e,t,r,n){if(typeof t=="function"){const[i,s]=iS(n);t=t(r!==void 0?r:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=iS(n);t=t(r!==void 0?r:e.custom,i,s)}return t}function vp(e,t,r){const n=e.getProps();return px(n,t,r!==void 0?r:n.custom,e)}const hx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],mx=["initial",...hx],Bc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ys=new Set(Bc),qn=e=>e*1e3,Qn=e=>e/1e3,O3={type:"spring",stiffness:500,damping:25,restSpeed:10},_3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),L3={type:"keyframes",duration:.8},F3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},V3=(e,{keyframes:t})=>t.length>2?L3:Ys.has(e)?e.startsWith("scale")?_3(t[1]):O3:F3;function gx(e,t){return e?e[t]||e.default||e:void 0}const $3={skipAnimations:!1,useManualTiming:!1},B3=e=>e!==null;function yp(e,{repeat:t,repeatType:r="loop"},n){const i=e.filter(B3),s=t&&r!=="loop"&&t%2===1?0:i.length-1;return!s||n===void 0?i[s]:n}const gr=e=>e;let Gg=gr;function U3(e){let t=new Set,r=new Set,n=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(l.schedule(c),e()),c(o)}const l={schedule:(c,u=!1,d=!1)=>{const h=d&&n?t:r;return u&&s.add(c),h.has(c)||h.add(c),c},cancel:c=>{r.delete(c),s.delete(c)},process:c=>{if(o=c,n){i=!0;return}n=!0,[t,r]=[r,t],t.forEach(a),t.clear(),n=!1,i&&(i=!1,l.process(c))}};return l}const Eu=["read","resolveKeyframes","update","preRender","render","postRender"],z3=40;function pA(e,t){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,o=Eu.reduce((x,y)=>(x[y]=U3(s),x),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:p}=o,h=()=>{const x=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(x-i.timestamp,z3),1),i.timestamp=x,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),d.process(i),p.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(h))},g=()=>{r=!0,n=!0,i.isProcessing||e(h)};return{schedule:Eu.reduce((x,y)=>{const b=o[y];return x[y]=(S,C=!1,D=!1)=>(r||g(),b.schedule(S,C,D)),x},{}),cancel:x=>{for(let y=0;y(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,W3=1e-7,H3=12;function G3(e,t,r,n,i){let s,o,a=0;do o=t+(r-t)/2,s=hA(o,n,i)-e,s>0?r=o:t=o;while(Math.abs(s)>W3&&++aG3(s,0,1,e,r);return s=>s===0||s===1?s:hA(i(s),t,n)}const mA=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,gA=e=>t=>1-e(1-t),vA=Uc(.33,1.53,.69,.99),vx=gA(vA),yA=mA(vx),xA=e=>(e*=2)<1?.5*vx(e):.5*(2-Math.pow(2,-10*(e-1))),yx=e=>1-Math.sin(Math.acos(e)),wA=gA(yx),bA=mA(yx),SA=e=>/^0[^.\s]+$/u.test(e);function K3(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||SA(e):!0}const CA=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),EA=e=>t=>typeof t=="string"&&t.startsWith(e),TA=EA("--"),q3=EA("var(--"),xx=e=>q3(e)?Q3.test(e.split("/*")[0].trim()):!1,Q3=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Y3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Z3(e){const t=Y3.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}function PA(e,t,r=1){const[n,i]=Z3(e);if(!n)return;const s=window.getComputedStyle(t).getPropertyValue(n);if(s){const o=s.trim();return CA(o)?parseFloat(o):o}return xx(i)?PA(i,t,r+1):i}const ri=(e,t,r)=>r>t?t:rtypeof e=="number",parse:parseFloat,transform:e=>e},sc={...Ia,transform:e=>ri(0,1,e)},Tu={...Ia,default:1},zc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),hi=zc("deg"),Pn=zc("%"),xe=zc("px"),X3=zc("vh"),J3=zc("vw"),sS={...Pn,parse:e=>Pn.parse(e)/100,transform:e=>Pn.transform(e*100)},e5=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),oS=e=>e===Ia||e===xe,aS=(e,t)=>parseFloat(e.split(", ")[t]),lS=(e,t)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return aS(i[1],t);{const s=n.match(/^matrix\((.+)\)$/u);return s?aS(s[1],e):0}},t5=new Set(["x","y","z"]),r5=Bc.filter(e=>!t5.has(e));function n5(e){const t=[];return r5.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const ha={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:lS(4,13),y:lS(5,14)};ha.translateX=ha.x;ha.translateY=ha.y;const DA=e=>t=>t.test(e),i5={test:e=>e==="auto",parse:e=>e},AA=[Ia,xe,Pn,hi,J3,X3,i5],cS=e=>AA.find(DA(e)),js=new Set;let Kg=!1,qg=!1;function NA(){if(qg){const e=Array.from(js).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const i=n5(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(([s,o])=>{var a;(a=n.getValue(s))===null||a===void 0||a.set(o)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}qg=!1,Kg=!1,js.forEach(e=>e.complete()),js.clear()}function kA(){js.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(qg=!0)})}function s5(){kA(),NA()}class wx{constructor(t,r,n,i,s,o=!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=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(js.add(this),Kg||(Kg=!0,Xe.read(kA),Xe.resolveKeyframes(NA))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;for(let s=0;sMath.round(e*1e5)/1e5,bx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function o5(e){return e==null}const a5=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Sx=(e,t)=>r=>!!(typeof r=="string"&&a5.test(r)&&r.startsWith(e)||t&&!o5(r)&&Object.prototype.hasOwnProperty.call(r,t)),RA=(e,t,r)=>n=>{if(typeof n!="string")return n;const[i,s,o,a]=n.match(bx);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},l5=e=>ri(0,255,e),Gh={...Ia,transform:e=>Math.round(l5(e))},ws={test:Sx("rgb","red"),parse:RA("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Gh.transform(e)+", "+Gh.transform(t)+", "+Gh.transform(r)+", "+Dl(sc.transform(n))+")"};function c5(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 Qg={test:Sx("#"),parse:c5,transform:ws.transform},So={test:Sx("hsl","hue"),parse:RA("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Pn.transform(Dl(t))+", "+Pn.transform(Dl(r))+", "+Dl(sc.transform(n))+")"},Ot={test:e=>ws.test(e)||Qg.test(e)||So.test(e),parse:e=>ws.test(e)?ws.parse(e):So.test(e)?So.parse(e):Qg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ws.transform(e):So.transform(e)},u5=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function d5(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(bx))===null||t===void 0?void 0:t.length)||0)+(((r=e.match(u5))===null||r===void 0?void 0:r.length)||0)>0}const jA="number",IA="color",f5="var",p5="var(",uS="${}",h5=/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 oc(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(h5,l=>(Ot.test(l)?(n.color.push(s),i.push(IA),r.push(Ot.parse(l))):l.startsWith(p5)?(n.var.push(s),i.push(f5),r.push(l)):(n.number.push(s),i.push(jA),r.push(parseFloat(l))),++s,uS)).split(uS);return{values:r,split:a,indexes:n,types:i}}function MA(e){return oc(e).values}function OA(e){const{split:t,types:r}=oc(e),n=t.length;return i=>{let s="";for(let o=0;otypeof e=="number"?0:e;function g5(e){const t=MA(e);return OA(e)(t.map(m5))}const Qi={test:d5,parse:MA,createTransformer:OA,getAnimatableNone:g5},v5=new Set(["brightness","contrast","saturate","opacity"]);function y5(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(bx)||[];if(!n)return e;const i=r.replace(n,"");let s=v5.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+i+")"}const x5=/\b([a-z-]*)\(.*?\)/gu,Yg={...Qi,getAnimatableNone:e=>{const t=e.match(x5);return t?t.map(y5).join(" "):e}},w5={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,backgroundPositionX:xe,backgroundPositionY:xe},b5={rotate:hi,rotateX:hi,rotateY:hi,rotateZ:hi,scale:Tu,scaleX:Tu,scaleY:Tu,scaleZ:Tu,skew:hi,skewX:hi,skewY:hi,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:sc,originX:sS,originY:sS,originZ:xe},dS={...Ia,transform:Math.round},Cx={...w5,...b5,zIndex:dS,size:xe,fillOpacity:sc,strokeOpacity:sc,numOctaves:dS},S5={...Cx,color:Ot,backgroundColor:Ot,outlineColor:Ot,fill:Ot,stroke:Ot,borderColor:Ot,borderTopColor:Ot,borderRightColor:Ot,borderBottomColor:Ot,borderLeftColor:Ot,filter:Yg,WebkitFilter:Yg},Ex=e=>S5[e];function _A(e,t){let r=Ex(e);return r!==Yg&&(r=Qi),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const C5=new Set(["auto","none","0"]);function E5(e,t,r){let n=0,i;for(;n{r.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function Tx(e){return typeof e=="function"}let td;function T5(){td=void 0}const Dn={now:()=>(td===void 0&&Dn.set(At.isProcessing||$3.useManualTiming?At.timestamp:performance.now()),td),set:e=>{td=e,queueMicrotask(T5)}},fS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Qi.test(e)||e==="0")&&!e.startsWith("url("));function P5(e){const t=e[0];if(e.length===1)return!0;for(let r=0;rA5?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&s5(),this._resolved}onKeyframesResolved(t,r){this.resolvedAt=Dn.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!D5(t,n,i,s))if(o)this.options.duration=0;else{l==null||l(yp(t,this.options,r)),a==null||a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,r);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:r,...u},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 ma=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n},VA=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let s=0;s{const u=c*o,d=u*e,p=u-r,h=Zg(c,o),g=Math.exp(-d);return Kh-p/h*g},s=c=>{const d=c*o*e,p=d*r+r,h=Math.pow(o,2)*Math.pow(c,2)*e,g=Math.exp(-d),v=Zg(Math.pow(c,2),o);return(-i(c)+Kh>0?-1:1)*((p-h)*g)/v}):(i=c=>{const u=Math.exp(-c*e),d=(c-r)*e+1;return-Kh+u*d},s=c=>{const u=Math.exp(-c*e),d=(r-c)*(e*e);return u*d});const a=5/e,l=j5(i,s,a);if(e=qn(e),isNaN(l))return{stiffness:at.stiffness,damping:at.damping,duration:e};{const c=Math.pow(l,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:e}}}const R5=12;function j5(e,t,r){let n=r;for(let i=1;i=Xg?1/0:t}const I5=["duration","bounce"],M5=["stiffness","damping","mass"];function pS(e,t){return t.some(r=>e[r]!==void 0)}function O5(e){let t={velocity:at.velocity,stiffness:at.stiffness,damping:at.damping,mass:at.mass,isResolvedFromDuration:!1,...e};if(!pS(e,M5)&&pS(e,I5))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,s=2*ri(.05,1,1-e.bounce)*Math.sqrt(i);t={...t,mass:at.mass,stiffness:i,damping:s}}else{const r=k5(e);t={...t,...r,mass:at.mass},t.isResolvedFromDuration=!0}return t}function zA(e=at.visualDuration,t=at.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:i}=r;const s=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:c,mass:u,duration:d,velocity:p,isResolvedFromDuration:h}=O5({...r,velocity:-Qn(r.velocity||0)}),g=p||0,v=c/(2*Math.sqrt(l*u)),w=o-s,x=Qn(Math.sqrt(l/u)),y=Math.abs(w)<5;n||(n=y?at.restSpeed.granular:at.restSpeed.default),i||(i=y?at.restDelta.granular:at.restDelta.default);let b;if(v<1){const C=Zg(x,v);b=D=>{const N=Math.exp(-v*x*D);return o-N*((g+v*x*w)/C*Math.sin(C*D)+w*Math.cos(C*D))}}else if(v===1)b=C=>o-Math.exp(-x*C)*(w+(g+x*w)*C);else{const C=x*Math.sqrt(v*v-1);b=D=>{const N=Math.exp(-v*x*D),k=Math.min(C*D,300);return o-N*((g+v*x*w)*Math.sinh(k)+C*w*Math.cosh(k))/C}}const S={calculatedDuration:h&&d||null,next:C=>{const D=b(C);if(h)a.done=C>=d;else{let N=0;v<1&&(N=C===0?qn(g):BA(b,C,D));const k=Math.abs(N)<=n,R=Math.abs(o-D)<=i;a.done=k&&R}return a.value=a.done?o:D,a},toString:()=>{const C=Math.min(UA(S),Xg),D=VA(N=>S.next(C*N).value,C,30);return C+"ms "+D}};return S}function hS({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],p={done:!1,value:d},h=k=>a!==void 0&&kl,g=k=>a===void 0?l:l===void 0||Math.abs(a-k)-v*Math.exp(-k/n),b=k=>x+y(k),S=k=>{const R=y(k),M=b(k);p.done=Math.abs(R)<=c,p.value=p.done?x:M};let C,D;const N=k=>{h(p.value)&&(C=k,D=zA({keyframes:[p.value,g(p.value)],velocity:BA(b,k,p.value),damping:i,stiffness:s,restDelta:c,restSpeed:u}))};return N(0),{calculatedDuration:null,next:k=>{let R=!1;return!D&&C===void 0&&(R=!0,S(k),N(k)),C!==void 0&&k>=C?D.next(k-C):(!R&&S(k),p)}}}const _5=Uc(.42,0,1,1),L5=Uc(0,0,.58,1),WA=Uc(.42,0,.58,1),F5=e=>Array.isArray(e)&&typeof e[0]!="number",Px=e=>Array.isArray(e)&&typeof e[0]=="number",mS={linear:gr,easeIn:_5,easeInOut:WA,easeOut:L5,circIn:yx,circInOut:bA,circOut:wA,backIn:vx,backInOut:yA,backOut:vA,anticipate:xA},gS=e=>{if(Px(e)){Gg(e.length===4);const[t,r,n,i]=e;return Uc(t,r,n,i)}else if(typeof e=="string")return Gg(mS[e]!==void 0),mS[e];return e},V5=(e,t)=>r=>t(e(r)),Wc=(...e)=>e.reduce(V5),tt=(e,t,r)=>e+(t-e)*r;function qh(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 $5({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,s=0,o=0;if(!t)i=s=o=r;else{const a=r<.5?r*(1+t):r+t-r*t,l=2*r-a;i=qh(l,a,e+1/3),s=qh(l,a,e),o=qh(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function Gd(e,t){return r=>r>0?t:e}const Qh=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},B5=[Qg,ws,So],U5=e=>B5.find(t=>t.test(e));function vS(e){const t=U5(e);if(!t)return!1;let r=t.parse(e);return t===So&&(r=$5(r)),r}const yS=(e,t)=>{const r=vS(e),n=vS(t);if(!r||!n)return Gd(e,t);const i={...r};return s=>(i.red=Qh(r.red,n.red,s),i.green=Qh(r.green,n.green,s),i.blue=Qh(r.blue,n.blue,s),i.alpha=tt(r.alpha,n.alpha,s),ws.transform(i))},Jg=new Set(["none","hidden"]);function z5(e,t){return Jg.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function W5(e,t){return r=>tt(e,t,r)}function Dx(e){return typeof e=="number"?W5:typeof e=="string"?xx(e)?Gd:Ot.test(e)?yS:K5:Array.isArray(e)?HA:typeof e=="object"?Ot.test(e)?yS:H5:Gd}function HA(e,t){const r=[...e],n=r.length,i=e.map((s,o)=>Dx(s)(s,t[o]));return s=>{for(let o=0;o{for(const s in n)r[s]=n[s](i);return r}}function G5(e,t){var r;const n=[],i={color:0,var:0,number:0};for(let s=0;s{const r=Qi.createTransformer(t),n=oc(e),i=oc(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?Jg.has(e)&&!i.values.length||Jg.has(t)&&!n.values.length?z5(e,t):Wc(HA(G5(n,i),i.values),r):Gd(e,t)};function GA(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?tt(e,t,r):Dx(e)(e,t)}function q5(e,t,r){const n=[],i=r||GA,s=e.length-1;for(let o=0;ot[0];if(s===2&&e[0]===e[1])return()=>t[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=q5(t,n,i),a=o.length,l=c=>{let u=0;if(a>1)for(;ul(ri(e[0],e[s-1],c)):l}function Y5(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=ma(0,t,n);e.push(tt(r,1,i))}}function Z5(e){const t=[0];return Y5(t,e.length-1),t}function X5(e,t){return e.map(r=>r*t)}function J5(e,t){return e.map(()=>t||WA).splice(0,e.length-1)}function Kd({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=F5(n)?n.map(gS):gS(n),s={done:!1,value:t[0]},o=X5(r&&r.length===t.length?r:Z5(t),e),a=Q5(o,t,{ease:Array.isArray(i)?i:J5(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const eU=e=>{const t=({timestamp:r})=>e(r);return{start:()=>Xe.update(t,!0),stop:()=>qi(t),now:()=>At.isProcessing?At.timestamp:Dn.now()}},tU={decay:hS,inertia:hS,tween:Kd,keyframes:Kd,spring:zA},rU=e=>e/100;class Ax extends FA{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:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||wx,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(s,a,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:s,velocity:o=0}=this.options,a=Tx(r)?r:tU[r]||Kd;let l,c;a!==Kd&&typeof t[0]!="number"&&(l=Wc(rU,GA(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=UA(u));const{calculatedDuration:d}=u,p=d+i,h=p*(n+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:p,totalDuration:h}}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:k}=this.options;return{done:!0,value:k[k.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:d}=n;if(this.startTime===null)return s.next(0);const{delay:p,repeat:h,repeatType:g,repeatDelay:v,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/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 x=this.currentTime-p*(this.speed>=0?1:-1),y=this.speed>=0?x<0:x>u;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let b=this.currentTime,S=s;if(h){const k=Math.min(this.currentTime,u)/d;let R=Math.floor(k),M=k%1;!M&&k>=1&&(M=1),M===1&&R--,R=Math.min(R,h+1),!!(R%2)&&(g==="reverse"?(M=1-M,v&&(M-=v/d)):g==="mirror"&&(S=o)),b=ri(0,1,M)*d}const C=y?{done:!1,value:l[0]}:S.next(b);a&&(C.value=a(C.value));let{done:D}=C;!y&&c!==null&&(D=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return N&&i!==void 0&&(C.value=yp(l,this.options,i)),w&&w(C.value),N&&this.finish(),C}get duration(){const{resolved:t}=this;return t?Qn(t.calculatedDuration):0}get time(){return Qn(this.currentTime)}set time(t){t=qn(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=Qn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=eU,onPlay:r,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),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 nU=new Set(["opacity","clipPath","filter","transform"]);function Nx(e){let t;return()=>(t===void 0&&(t=e()),t)}const iU={linearEasing:void 0};function sU(e,t){const r=Nx(e);return()=>{var n;return(n=iU[t])!==null&&n!==void 0?n:r()}}const qd=sU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function KA(e){return!!(typeof e=="function"&&qd()||!e||typeof e=="string"&&(e in ev||qd())||Px(e)||Array.isArray(e)&&e.every(KA))}const sl=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,ev={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:sl([0,.65,.55,1]),circOut:sl([.55,0,1,.45]),backIn:sl([.31,.01,.66,-.59]),backOut:sl([.33,1.53,.69,.99])};function qA(e,t){if(e)return typeof e=="function"&&qd()?VA(e,t):Px(e)?sl(e):Array.isArray(e)?e.map(r=>qA(r,t)||ev.easeOut):ev[e]}function oU(e,t,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[t]:r};l&&(c.offset=l);const u=qA(a,i);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:n,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function xS(e,t){e.timeline=t,e.onfinish=null}const aU=Nx(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Qd=10,lU=2e4;function cU(e){return Tx(e.type)||e.type==="spring"||!KA(e.ease)}function uU(e,t){const r=new Ax({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const i=[];let s=0;for(;!n.done&&sthis.onKeyframesResolved(o,a),r,n,i),this.resolver.scheduleResolve()}initPlayback(t,r){var n;let{duration:i=300,times:s,ease:o,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!(!((n=l.owner)===null||n===void 0)&&n.current))return!1;if(typeof o=="string"&&qd()&&dU(o)&&(o=QA[o]),cU(this.options)){const{onComplete:p,onUpdate:h,motionValue:g,element:v,...w}=this.options,x=uU(t,w);t=x.keyframes,t.length===1&&(t[1]=t[0]),i=x.duration,s=x.times,o=x.ease,a="keyframes"}const d=oU(l.owner.current,c,t,{...this.options,duration:i,times:s,ease:o});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(xS(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:p}=this.options;l.set(yp(t,this.options,r)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:i,times:s,type:a,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:r}=t;return Qn(r)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:r}=t;return Qn(r.currentTime||0)}set time(t){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=qn(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 gr;const{animation:n}=r;xS(n,t)}return gr}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:s,ease:o,times:a}=t;if(r.playState==="idle"||r.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:d,element:p,...h}=this.options,g=new Ax({...h,keyframes:n,duration:i,type:s,ease:o,times:a,isGenerator:!0}),v=qn(this.time);c.setWithVelocity(g.sample(v-Qd).value,g.sample(v).value,Qd)}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:s,damping:o,type:a}=t;return aU()&&n&&nU.has(n)&&r&&r.owner&&r.owner.current instanceof HTMLElement&&!r.owner.getProps().onUpdate&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const fU=Nx(()=>window.ScrollTimeline!==void 0);class pU{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;nfU()&&i.attachTimeline?i.attachTimeline(t):r(i));return()=>{n.forEach((i,s)=>{i&&i(),this.animations[s].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 hU({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const kx=(e,t,r,n={},i,s)=>o=>{const a=gx(n,e)||{},l=a.delay||n.delay||0;let{elapsed:c=0}=n;c=c-qn(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};hU(a)||(u={...u,...V3(e,u)}),u.duration&&(u.duration=qn(u.duration)),u.repeatDelay&&(u.repeatDelay=qn(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(d=!0)),d&&!s&&t.get()!==void 0){const p=yp(u.keyframes,a);if(p!==void 0)return Xe.update(()=>{u.onUpdate(p),u.onComplete()}),new pU([])}return!s&&wS.supports(u)?new wS(u):new Ax(u)},mU=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),gU=e=>Hg(e)?e[e.length-1]||0:e;function Rx(e,t){e.indexOf(t)===-1&&e.push(t)}function jx(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class Ix{constructor(){this.subscriptions=[]}add(t){return Rx(this.subscriptions,t),()=>jx(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 s=0;s!isNaN(parseFloat(e));class yU{constructor(t,r={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const s=Dn.now();this.updatedAt!==s&&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=Dn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=vU(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 Ix);const n=this.events[t].add(r);return t==="change"?()=>{n(),Xe.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=Dn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>bS)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,bS);return $A(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 ac(e,t){return new yU(e,t)}function xU(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,ac(r))}function wU(e,t){const r=vp(e,t);let{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(const o in s){const a=gU(s[o]);xU(e,o,a)}}const Mx=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),bU="framerAppearId",YA="data-"+Mx(bU);function ZA(e){return e.props[YA]}const Lt=e=>!!(e&&e.getVelocity);function SU(e){return!!(Lt(e)&&e.add)}function tv(e,t){const r=e.getValue("willChange");if(SU(r))return r.add(t)}function CU({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function XA(e,t,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;n&&(o=n);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in l){const p=e.getValue(d,(s=e.latestValues[d])!==null&&s!==void 0?s:null),h=l[d];if(h===void 0||u&&CU(u,d))continue;const g={delay:r,...gx(o||{},d)};let v=!1;if(window.MotionHandoffAnimation){const x=ZA(e);if(x){const y=window.MotionHandoffAnimation(x,d,Xe);y!==null&&(g.startTime=y,v=!0)}}tv(e,d),p.start(kx(d,p,h,e.shouldReduceMotion&&Ys.has(d)?{type:!1}:g,e,v));const w=p.animation;w&&c.push(w)}return a&&Promise.all(c).then(()=>{Xe.update(()=>{a&&wU(e,a)})}),c}function rv(e,t,r={}){var n;const i=vp(e,t,r.type==="exit"?(n=e.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const o=i?()=>Promise.all(XA(e,i,r)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:p}=s;return EU(e,t,u+c,d,p,r)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,u]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>u())}else return Promise.all([o(),a(r.delay)])}function EU(e,t,r=0,n=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*n,l=i===1?(c=0)=>c*n:(c=0)=>a-c*n;return Array.from(e.variantChildren).sort(TU).forEach((c,u)=>{c.notify("AnimationStart",t),o.push(rv(c,t,{...s,delay:r+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function TU(e,t){return e.sortNodePosition(t)}function PU(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(s=>rv(e,s,r));n=Promise.all(i)}else if(typeof t=="string")n=rv(e,t,r);else{const i=typeof t=="function"?vp(e,t,r.custom):t;n=Promise.all(XA(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}const DU=mx.length;function JA(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?JA(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})=>PU(e,r,n)))}function RU(e){let t=kU(e),r=SS(),n=!0;const i=l=>(c,u)=>{var d;const p=vp(e,u,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(p){const{transition:h,transitionEnd:g,...v}=p;c={...c,...v,...g}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,u=JA(e.parent)||{},d=[],p=new Set;let h={},g=1/0;for(let w=0;wg&&S,R=!1;const M=Array.isArray(b)?b:[b];let W=M.reduce(i(x),{});C===!1&&(W={});const{prevResolvedValues:V={}}=y,q={...V,...W},B=X=>{k=!0,p.has(X)&&(R=!0,p.delete(X)),y.needsAnimating[X]=!0;const F=e.getValue(X);F&&(F.liveStyle=!1)};for(const X in q){const F=W[X],$=V[X];if(h.hasOwnProperty(X))continue;let A=!1;Hg(F)&&Hg($)?A=!fA(F,$):A=F!==$,A?F!=null?B(X):p.add(X):F!==void 0&&p.has(X)?B(X):y.protectedKeys[X]=!0}y.prevProp=b,y.prevResolvedValues=W,y.isActive&&(h={...h,...W}),n&&e.blockInitialAnimation&&(k=!1),k&&(!(D&&N)||R)&&d.push(...M.map(X=>({animation:X,options:{type:x}})))}if(p.size){const w={};p.forEach(x=>{const y=e.getBaseTarget(x),b=e.getValue(x);b&&(b.liveStyle=!0),w[x]=y??null}),d.push({animation:w})}let v=!!d.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(v=!1),n=!1,v?t(d):Promise.resolve()}function a(l,c){var u;if(r[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(p=>{var h;return(h=p.animationState)===null||h===void 0?void 0:h.setActive(l,c)}),r[l].isActive=c;const d=o(l);for(const p in r)r[p].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r,reset:()=>{r=SS(),n=!0}}}function jU(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!fA(t,e):!1}function cs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function SS(){return{animate:cs(!0),whileInView:cs(),whileHover:cs(),whileTap:cs(),whileDrag:cs(),whileFocus:cs(),exit:cs()}}class is{constructor(t){this.isMounted=!1,this.node=t}update(){}}class IU extends is{constructor(t){super(t),t.animationState||(t.animationState=RU(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();gp(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 MU=0;class OU extends is{constructor(){super(...arguments),this.id=MU++}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 _U={animation:{Feature:IU},exit:{Feature:OU}},Ur={x:!1,y:!1};function eN(){return Ur.x||Ur.y}function LU(e,t,r){var n;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const s=(n=void 0)!==null&&n!==void 0?n:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function tN(e,t){const r=LU(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function CS(e){return t=>{t.pointerType==="touch"||eN()||e(t)}}function FU(e,t,r={}){const[n,i,s]=tN(e,r),o=CS(a=>{const{target:l}=a,c=t(a);if(!c||!l)return;const u=CS(d=>{c(d),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,i)});return n.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const Ox=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,ol=new WeakSet;function ES(e){return t=>{t.key==="Enter"&&e(t)}}function Yh(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const VU=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=ES(()=>{if(ol.has(r))return;Yh(r,"down");const i=ES(()=>{Yh(r,"up")}),s=()=>Yh(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",s,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)},$U=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function BU(e){return $U.has(e.tagName)||e.tabIndex!==-1}const rN=(e,t)=>t?e===t?!0:rN(e,t.parentElement):!1;function TS(e){return Ox(e)&&!eN()}function UU(e,t,r={}){const[n,i,s]=tN(e,r),o=a=>{const l=a.currentTarget;if(!TS(a)||ol.has(l))return;ol.add(l);const c=t(a),u=(h,g)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",p),!(!TS(h)||!ol.has(l))&&(ol.delete(l),c&&c(h,{success:g}))},d=h=>{u(h,r.useGlobalTarget||rN(l,h.target))},p=h=>{u(h,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",p,i)};return n.forEach(a=>{BU(a)||(a.tabIndex=0),(r.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",c=>VU(c,i),i)}),s}function zU(e){return e==="x"||e==="y"?Ur[e]?null:(Ur[e]=!0,()=>{Ur[e]=!1}):Ur.x||Ur.y?null:(Ur.x=Ur.y=!0,()=>{Ur.x=Ur.y=!1})}function Hc(e){return{point:{x:e.pageX,y:e.pageY}}}const WU=e=>t=>Ox(t)&&e(t,Hc(t));function lc(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function Al(e,t,r,n){return lc(e,t,WU(r),n)}const PS=(e,t)=>Math.abs(e-t);function HU(e,t){const r=PS(e.x,t.x),n=PS(e.y,t.y);return Math.sqrt(r**2+n**2)}class nN{constructor(t,r,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Xh(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=HU(d.offset,{x:0,y:0})>=3;if(!p&&!h)return;const{point:g}=d,{timestamp:v}=At;this.history.push({...g,timestamp:v});const{onStart:w,onMove:x}=this.handlers;p||(w&&w(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=Zh(p,this.transformPagePoint),Xe.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:h,onSessionEnd:g,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=Xh(d.type==="pointercancel"?this.lastMoveEventInfo:Zh(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(d,w),g&&g(d,w)},!Ox(t))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const o=Hc(t),a=Zh(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=At;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=r;u&&u(t,Xh(a,this.history)),this.removeListeners=Wc(Al(this.contextWindow,"pointermove",this.handlePointerMove),Al(this.contextWindow,"pointerup",this.handlePointerUp),Al(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),qi(this.updatePoint)}}function Zh(e,t){return t?{point:t(e.point)}:e}function DS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xh({point:e},t){return{point:e,delta:DS(e,iN(t)),offset:DS(e,GU(t)),velocity:KU(t,.1)}}function GU(e){return e[0]}function iN(e){return e[e.length-1]}function KU(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const i=iN(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>qn(t)));)r--;if(!n)return{x:0,y:0};const s=Qn(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Co(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const sN=1e-4,qU=1-sN,QU=1+sN,oN=.01,YU=0-oN,ZU=0+oN;function xr(e){return e.max-e.min}function XU(e,t,r){return Math.abs(e-t)<=r}function AS(e,t,r,n=.5){e.origin=n,e.originPoint=tt(t.min,t.max,e.origin),e.scale=xr(r)/xr(t),e.translate=tt(r.min,r.max,e.origin)-e.originPoint,(e.scale>=qU&&e.scale<=QU||isNaN(e.scale))&&(e.scale=1),(e.translate>=YU&&e.translate<=ZU||isNaN(e.translate))&&(e.translate=0)}function Nl(e,t,r,n){AS(e.x,t.x,r.x,n?n.originX:void 0),AS(e.y,t.y,r.y,n?n.originY:void 0)}function NS(e,t,r){e.min=r.min+t.min,e.max=e.min+xr(t)}function JU(e,t,r){NS(e.x,t.x,r.x),NS(e.y,t.y,r.y)}function kS(e,t,r){e.min=t.min-r.min,e.max=e.min+xr(t)}function kl(e,t,r){kS(e.x,t.x,r.x),kS(e.y,t.y,r.y)}function ez(e,{min:t,max:r},n){return t!==void 0&&er&&(e=n?tt(r,e,n.max):Math.min(e,r)),e}function RS(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 tz(e,{top:t,left:r,bottom:n,right:i}){return{x:RS(e.x,r,i),y:RS(e.y,t,n)}}function jS(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.minn?r=ma(t.min,t.max-n,e.min):n>i&&(r=ma(e.min,e.max-i,t.min)),ri(0,1,r)}function iz(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 nv=.35;function sz(e=nv){return e===!1?e=0:e===!0&&(e=nv),{x:IS(e,"left","right"),y:IS(e,"top","bottom")}}function IS(e,t,r){return{min:MS(e,t),max:MS(e,r)}}function MS(e,t){return typeof e=="number"?e:e[t]||0}const OS=()=>({translate:0,scale:1,origin:0,originPoint:0}),Eo=()=>({x:OS(),y:OS()}),_S=()=>({min:0,max:0}),pt=()=>({x:_S(),y:_S()});function Tr(e){return[e("x"),e("y")]}function aN({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function oz({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function az(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 Jh(e){return e===void 0||e===1}function iv({scale:e,scaleX:t,scaleY:r}){return!Jh(e)||!Jh(t)||!Jh(r)}function ps(e){return iv(e)||lN(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function lN(e){return LS(e.x)||LS(e.y)}function LS(e){return e&&e!=="0%"}function Yd(e,t,r){const n=e-r,i=t*n;return r+i}function FS(e,t,r,n,i){return i!==void 0&&(e=Yd(e,i,n)),Yd(e,r,n)+t}function sv(e,t=0,r=1,n,i){e.min=FS(e.min,t,r,n,i),e.max=FS(e.max,t,r,n,i)}function cN(e,{x:t,y:r}){sv(e.x,t.translate,t.scale,t.originPoint),sv(e.y,r.translate,r.scale,r.originPoint)}const VS=.999999999999,$S=1.0000000000001;function lz(e,t,r,n=!1){const i=r.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;aVS&&(t.x=1),t.y<$S&&t.y>VS&&(t.y=1)}function To(e,t){e.min=e.min+t,e.max=e.max+t}function BS(e,t,r,n,i=.5){const s=tt(e.min,e.max,i);sv(e,t,r,s,n)}function Po(e,t){BS(e.x,t.x,t.scaleX,t.scale,t.originX),BS(e.y,t.y,t.scaleY,t.scale,t.originY)}function uN(e,t){return aN(az(e.getBoundingClientRect(),t))}function cz(e,t,r){const n=uN(e,r),{scroll:i}=t;return i&&(To(n.x,i.offset.x),To(n.y,i.offset.y)),n}const dN=({current:e})=>e?e.ownerDocument.defaultView:null,uz=new WeakMap;class dz{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=pt(),this.visualElement=t}start(t,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=u=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(Hc(u).point)},s=(u,d)=>{const{drag:p,dragPropagation:h,onDragStart:g}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=zU(p),!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),Tr(w=>{let x=this.getAxisMotionValue(w).get()||0;if(Pn.test(x)){const{projection:y}=this.visualElement;if(y&&y.layout){const b=y.layout.layoutBox[w];b&&(x=xr(b)*(parseFloat(x)/100))}}this.originPoint[w]=x}),g&&Xe.postRender(()=>g(u,d)),tv(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(u,d)=>{const{dragPropagation:p,dragDirectionLock:h,onDirectionLock:g,onDrag:v}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:w}=d;if(h&&this.currentDirection===null){this.currentDirection=fz(w),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",d.point,w),this.updateAxis("y",d.point,w),this.visualElement.render(),v&&v(u,d)},a=(u,d)=>this.stop(u,d),l=()=>Tr(u=>{var d;return this.getAnimationState(u)==="paused"&&((d=this.getAxisMotionValue(u).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new nN(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:dN(this.visualElement)})}stop(t,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&Xe.postRender(()=>s(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||!Pu(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=ez(o,this.constraints[t],this.elastic[t])),s.set(o)}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,s=this.constraints;r&&Co(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=tz(i.layoutBox,r):this.constraints=!1,this.elastic=sz(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Tr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=iz(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Co(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=cz(n,i.root,this.visualElement.getTransformPagePoint());let o=rz(i.layout.layoutBox,s);if(r){const a=r(oz(o));this.hasMutatedConstraints=!!a,a&&(o=aN(a))}return o}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Tr(u=>{if(!Pu(u,r,this.currentDirection))return;let d=l&&l[u]||{};o&&(d={min:0,max:0});const p=i?200:1e6,h=i?40:1e7,g={type:"inertia",velocity:n?t[u]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(u,g)});return Promise.all(c).then(a)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return tv(this.visualElement,t),n.start(kx(t,n,0,r,this.visualElement,!1))}stopAnimation(){Tr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Tr(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){Tr(r=>{const{drag:n}=this.getProps();if(!Pu(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(t[r]-tt(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Co(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Tr(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=nz({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Tr(o=>{if(!Pu(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(tt(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;uz.set(this.visualElement,this);const t=this.visualElement.current,r=Al(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();Co(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Xe.read(n);const o=lc(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Tr(u=>{const d=this.getAxisMotionValue(u);d&&(this.originPoint[u]+=l[u].translate,d.set(d.get()+l[u].translate))}),this.visualElement.render())});return()=>{o(),r(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=nv,dragMomentum:a=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Pu(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function fz(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class pz extends is{constructor(t){super(t),this.removeGroupControls=gr,this.removeListeners=gr,this.controls=new dz(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||gr}unmount(){this.removeGroupControls(),this.removeListeners()}}const US=e=>(t,r)=>{e&&Xe.postRender(()=>e(t,r))};class hz extends is{constructor(){super(...arguments),this.removePointerDownListener=gr}onPointerDown(t){this.session=new nN(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:dN(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:US(t),onStart:US(r),onMove:n,onEnd:(s,o)=>{delete this.session,i&&Xe.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Al(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 xp=m.createContext(null);function mz(){const e=m.useContext(xp);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:r,register:n}=e,i=m.useId();m.useEffect(()=>n(i),[]);const s=m.useCallback(()=>r&&r(i),[i,r]);return!t&&r?[!1,s]:[!0]}const _x=m.createContext({}),fN=m.createContext({}),rd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function zS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Za={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(xe.test(e))e=parseFloat(e);else return e;const r=zS(e,t.target.x),n=zS(e,t.target.y);return`${r}% ${n}%`}},gz={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,i=Qi.parse(e);if(i.length>5)return n;const s=Qi.createTransformer(e),o=typeof i[0]!="number"?1:0,a=r.x.scale*t.x,l=r.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const c=tt(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}},Zd={};function vz(e){Object.assign(Zd,e)}const{schedule:Lx,cancel:H7}=pA(queueMicrotask,!1);class yz extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;vz(xz),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),rd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||Xe.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Lx.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 pN(e){const[t,r]=mz(),n=m.useContext(_x);return f.jsx(yz,{...e,layoutGroup:n,switchLayoutGroup:m.useContext(fN),isPresent:t,safeToRemove:r})}const xz={borderRadius:{...Za,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Za,borderTopRightRadius:Za,borderBottomLeftRadius:Za,borderBottomRightRadius:Za,boxShadow:gz},hN=["TopLeft","TopRight","BottomLeft","BottomRight"],wz=hN.length,WS=e=>typeof e=="string"?parseFloat(e):e,HS=e=>typeof e=="number"||xe.test(e);function bz(e,t,r,n,i,s){i?(e.opacity=tt(0,r.opacity!==void 0?r.opacity:1,Sz(n)),e.opacityExit=tt(t.opacity!==void 0?t.opacity:1,0,Cz(n))):s&&(e.opacity=tt(t.opacity!==void 0?t.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;ont?1:r(ma(e,t,n))}function KS(e,t){e.min=t.min,e.max=t.max}function Er(e,t){KS(e.x,t.x),KS(e.y,t.y)}function qS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function QS(e,t,r,n,i){return e-=t,e=Yd(e,1/r,n),i!==void 0&&(e=Yd(e,1/i,n)),e}function Ez(e,t=0,r=1,n=.5,i,s=e,o=e){if(Pn.test(t)&&(t=parseFloat(t),t=tt(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=tt(s.min,s.max,n);e===s&&(a-=t),e.min=QS(e.min,t,r,a,i),e.max=QS(e.max,t,r,a,i)}function YS(e,t,[r,n,i],s,o){Ez(e,t[r],t[n],t[i],t.scale,s,o)}const Tz=["x","scaleX","originX"],Pz=["y","scaleY","originY"];function ZS(e,t,r,n){YS(e.x,t,Tz,r?r.x:void 0,n?n.x:void 0),YS(e.y,t,Pz,r?r.y:void 0,n?n.y:void 0)}function XS(e){return e.translate===0&&e.scale===1}function gN(e){return XS(e.x)&&XS(e.y)}function JS(e,t){return e.min===t.min&&e.max===t.max}function Dz(e,t){return JS(e.x,t.x)&&JS(e.y,t.y)}function e1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vN(e,t){return e1(e.x,t.x)&&e1(e.y,t.y)}function t1(e){return xr(e.x)/xr(e.y)}function r1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Az{constructor(){this.members=[]}add(t){Rx(this.members,t),t.scheduleRender()}remove(t){if(jx(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 s=this.members[i];if(s.isPresent!==!1){n=s;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 Nz(e,t,r){let n="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(r==null?void 0:r.z)||0;if((i||s||o)&&(n=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:c,rotate:u,rotateX:d,rotateY:p,skewX:h,skewY:g}=r;c&&(n=`perspective(${c}px) ${n}`),u&&(n+=`rotate(${u}deg) `),d&&(n+=`rotateX(${d}deg) `),p&&(n+=`rotateY(${p}deg) `),h&&(n+=`skewX(${h}deg) `),g&&(n+=`skewY(${g}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(n+=`scale(${a}, ${l})`),n||"none"}const kz=(e,t)=>e.depth-t.depth;class Rz{constructor(){this.children=[],this.isDirty=!1}add(t){Rx(this.children,t),this.isDirty=!0}remove(t){jx(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(kz),this.isDirty=!1,this.children.forEach(t)}}function nd(e){const t=Lt(e)?e.get():e;return mU(t)?t.toValue():t}function jz(e,t){const r=Dn.now(),n=({timestamp:i})=>{const s=i-r;s>=t&&(qi(n),e(s-t))};return Xe.read(n,!0),()=>qi(n)}function Iz(e){return e instanceof SVGElement&&e.tagName!=="svg"}function Mz(e,t,r){const n=Lt(e)?e:ac(e);return n.start(kx("",n,t,r)),n.animation}const hs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},al=typeof window<"u"&&window.MotionDebug!==void 0,em=["","X","Y","Z"],Oz={visibility:"hidden"},n1=1e3;let _z=0;function tm(e,t,r,n){const{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function yN(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=ZA(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",Xe,!(i||s))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&yN(n)}function xN({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=_z++,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,al&&(hs.totalNodes=hs.resolvedTargetDeltas=hs.recalculatedProjection=0),this.nodes.forEach(Vz),this.nodes.forEach(Wz),this.nodes.forEach(Hz),this.nodes.forEach($z),al&&window.MotionDebug.record(hs)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=jz(p,250),rd.hasAnimatedSinceResize&&(rd.hasAnimatedSinceResize=!1,this.nodes.forEach(s1))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeTargetChanged:h,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||u.getDefaultTransition()||Yz,{onLayoutAnimationStart:w,onLayoutAnimationComplete:x}=u.getProps(),y=!this.targetLayout||!vN(this.targetLayout,g)||h,b=!p&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||p&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,b);const S={...gx(v,"layout"),onPlay:w,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else p||s1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,qi(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(Gz),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yN(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u{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 C=S/1e3;o1(d.x,o.x,C),o1(d.y,o.y,C),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(kl(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),qz(this.relativeTarget,this.relativeTargetOrigin,p,C),b&&Dz(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=pt()),Er(b,this.relativeTarget)),v&&(this.animationValues=u,bz(u,c,this.latestValues,C,y,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(qi(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Xe.update(()=>{rd.hasAnimatedSinceResize=!0,this.currentAnimation=Mz(0,n1,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(n1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&wN(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||pt();const d=xr(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const p=xr(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}Er(a,l),Po(a,u),Nl(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Az),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&tm("z",o,c,this.animationValues);for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(i1),this.root.sharedNodes.clear()}}}function Lz(e){e.updateLayout()}function Fz(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:s}=e.options,o=r.source!==e.layout.source;s==="size"?Tr(d=>{const p=o?r.measuredBox[d]:r.layoutBox[d],h=xr(p);p.min=n[d].min,p.max=p.min+h}):wN(s,r.layoutBox,n)&&Tr(d=>{const p=o?r.measuredBox[d]:r.layoutBox[d],h=xr(n[d]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const a=Eo();Nl(a,n,r.layoutBox);const l=Eo();o?Nl(l,e.applyTransform(i,!0),r.measuredBox):Nl(l,n,r.layoutBox);const c=!gN(a);let u=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:p,layout:h}=d;if(p&&h){const g=pt();kl(g,r.layoutBox,p.layoutBox);const v=pt();kl(v,n,h.layoutBox),vN(g,v)||(u=!0),d.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=g,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Vz(e){al&&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 $z(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Bz(e){e.clearSnapshot()}function i1(e){e.clearMeasurements()}function Uz(e){e.isLayoutDirty=!1}function zz(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function s1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Wz(e){e.resolveTargetDelta()}function Hz(e){e.calcProjection()}function Gz(e){e.resetSkewAndRotation()}function Kz(e){e.removeLeadSnapshot()}function o1(e,t,r){e.translate=tt(t.translate,0,r),e.scale=tt(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function a1(e,t,r,n){e.min=tt(t.min,r.min,n),e.max=tt(t.max,r.max,n)}function qz(e,t,r,n){a1(e.x,t.x,r.x,n),a1(e.y,t.y,r.y,n)}function Qz(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Yz={duration:.45,ease:[.4,0,.1,1]},l1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),c1=l1("applewebkit/")&&!l1("chrome/")?Math.round:gr;function u1(e){e.min=c1(e.min),e.max=c1(e.max)}function Zz(e){u1(e.x),u1(e.y)}function wN(e,t,r){return e==="position"||e==="preserve-aspect"&&!XU(t1(t),t1(r),.2)}function Xz(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const Jz=xN({attachResizeListener:(e,t)=>lc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rm={current:void 0},bN=xN({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rm.current){const e=new Jz({});e.mount(window),e.setOptions({layoutScroll:!0}),rm.current=e}return rm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),e6={pan:{Feature:hz},drag:{Feature:pz,ProjectionNode:bN,MeasureLayout:pN}};function d1(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const i="onHover"+r,s=n[i];s&&Xe.postRender(()=>s(t,Hc(t)))}class t6 extends is{mount(){const{current:t}=this.node;t&&(this.unmount=FU(t,r=>(d1(this.node,r,"Start"),n=>d1(this.node,n,"End"))))}unmount(){}}class r6 extends is{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=Wc(lc(this.node.current,"focus",()=>this.onFocus()),lc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function f1(e,t,r){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const i="onTap"+(r==="End"?"":r),s=n[i];s&&Xe.postRender(()=>s(t,Hc(t)))}class n6 extends is{mount(){const{current:t}=this.node;t&&(this.unmount=UU(t,r=>(f1(this.node,r,"Start"),(n,{success:i})=>f1(this.node,n,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ov=new WeakMap,nm=new WeakMap,i6=e=>{const t=ov.get(e.target);t&&t(e)},s6=e=>{e.forEach(i6)};function o6({root:e,...t}){const r=e||document;nm.has(r)||nm.set(r,{});const n=nm.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(s6,{root:e,...t})),n[i]}function a6(e,t,r){const n=o6(t);return ov.set(e,r),n.observe(e),()=>{ov.delete(e),n.unobserve(e)}}const l6={some:0,all:1};class c6 extends is{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:s}=t,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:l6[i]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,s&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:d}=this.node.getProps(),p=c?u:d;p&&p(l)};return a6(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(u6(t,r))&&this.startObserver()}unmount(){}}function u6({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const d6={inView:{Feature:c6},tap:{Feature:n6},focus:{Feature:r6},hover:{Feature:t6}},f6={layout:{ProjectionNode:bN,MeasureLayout:pN}},Fx=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),wp=m.createContext({}),Vx=typeof window<"u",SN=Vx?m.useLayoutEffect:m.useEffect,CN=m.createContext({strict:!1});function p6(e,t,r,n,i){var s,o;const{visualElement:a}=m.useContext(wp),l=m.useContext(CN),c=m.useContext(xp),u=m.useContext(Fx).reducedMotion,d=m.useRef(null);n=n||l.renderer,!d.current&&n&&(d.current=n(e,{visualState:t,parent:a,props:r,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const p=d.current,h=m.useContext(fN);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&h6(d.current,r,i,h);const g=m.useRef(!1);m.useInsertionEffect(()=>{p&&g.current&&p.update(r,c)});const v=r[YA],w=m.useRef(!!v&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,v))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,v)));return SN(()=>{p&&(g.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),Lx.render(p.render),w.current&&p.animationState&&p.animationState.animateChanges())}),m.useEffect(()=>{p&&(!w.current&&p.animationState&&p.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,v)}),w.current=!1))}),p}function h6(e,t,r,n){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:EN(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Co(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:c})}function EN(e){if(e)return e.options.allowProjection!==!1?e.projection:EN(e.parent)}function m6(e,t,r){return m.useCallback(n=>{n&&e.mount&&e.mount(n),t&&(n?t.mount(n):t.unmount()),r&&(typeof r=="function"?r(n):Co(r)&&(r.current=n))},[t])}function bp(e){return gp(e.animate)||mx.some(t=>ic(e[t]))}function TN(e){return!!(bp(e)||e.variants)}function g6(e,t){if(bp(e)){const{initial:r,animate:n}=e;return{initial:r===!1||ic(r)?r:void 0,animate:ic(n)?n:void 0}}return e.inherit!==!1?t:{}}function v6(e){const{initial:t,animate:r}=g6(e,m.useContext(wp));return m.useMemo(()=>({initial:t,animate:r}),[p1(t),p1(r)])}function p1(e){return Array.isArray(e)?e.join(" "):e}const h1={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"]},ga={};for(const e in h1)ga[e]={isEnabled:t=>h1[e].some(r=>!!t[r])};function y6(e){for(const t in e)ga[t]={...ga[t],...e[t]}}const x6=Symbol.for("motionComponentSymbol");function w6({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:n,Component:i}){e&&y6(e);function s(a,l){let c;const u={...m.useContext(Fx),...a,layoutId:b6(a)},{isStatic:d}=u,p=v6(a),h=n(a,d);if(!d&&Vx){S6();const g=C6(u);c=g.MeasureLayout,p.visualElement=p6(i,h,u,t,g.ProjectionNode)}return f.jsxs(wp.Provider,{value:p,children:[c&&p.visualElement?f.jsx(c,{visualElement:p.visualElement,...u}):null,r(i,a,m6(h,p.visualElement,l),h,d,p.visualElement)]})}const o=m.forwardRef(s);return o[x6]=i,o}function b6({layoutId:e}){const t=m.useContext(_x).id;return t&&e!==void 0?t+"-"+e:e}function S6(e,t){m.useContext(CN).strict}function C6(e){const{drag:t,layout:r}=ga;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 E6=["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 $x(e){return typeof e!="string"||e.includes("-")?!1:!!(E6.indexOf(e)>-1||/[A-Z]/u.test(e))}function PN(e,{style:t,vars:r},n,i){Object.assign(e.style,t,i&&i.getProjectionStyles(n));for(const s in r)e.style.setProperty(s,r[s])}const DN=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 AN(e,t,r,n){PN(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(DN.has(i)?i:Mx(i),t.attrs[i])}function NN(e,{layout:t,layoutId:r}){return Ys.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Zd[e]||e==="opacity")}function Bx(e,t,r){var n;const{style:i}=e,s={};for(const o in i)(Lt(i[o])||t.style&&Lt(t.style[o])||NN(o,e)||((n=r==null?void 0:r.getValue(o))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function kN(e,t,r){const n=Bx(e,t,r);for(const i in e)if(Lt(e[i])||Lt(t[i])){const s=Bc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}function Ux(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}function T6({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:r},n,i,s){const o={latestValues:P6(n,i,s,e),renderState:t()};return r&&(o.mount=a=>r(n,a,o)),o}const RN=e=>(t,r)=>{const n=m.useContext(wp),i=m.useContext(xp),s=()=>T6(e,t,n,i);return r?s():Ux(s)};function P6(e,t,r,n){const i={},s=n(e,{});for(const p in s)i[p]=nd(s[p]);let{initial:o,animate:a}=e;const l=bp(e),c=TN(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let u=r?r.initial===!1:!1;u=u||o===!1;const d=u?a:o;if(d&&typeof d!="boolean"&&!gp(d)){const p=Array.isArray(d)?d:[d];for(let h=0;h({style:{},transform:{},transformOrigin:{},vars:{}}),jN=()=>({...zx(),attrs:{}}),IN=(e,t)=>t&&typeof e=="number"?t.transform(e):e,D6={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},A6=Bc.length;function N6(e,t,r){let n="",i=!0;for(let s=0;stypeof e=="string"&&e.toLowerCase()==="svg",M6={useVisualState:RN({scrapeMotionValuesFromProps:kN,createRenderState:jN,onMount:(e,t,{renderState:r,latestValues:n})=>{Xe.read(()=>{try{r.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),Xe.render(()=>{Hx(r,n,Gx(t.tagName),e.transformTemplate),AN(t,r)})}})},O6={useVisualState:RN({scrapeMotionValuesFromProps:Bx,createRenderState:zx})};function MN(e,t,r){for(const n in t)!Lt(t[n])&&!NN(n,r)&&(e[n]=t[n])}function _6({transformTemplate:e},t){return m.useMemo(()=>{const r=zx();return Wx(r,t,e),Object.assign({},r.vars,r.style)},[t])}function L6(e,t){const r=e.style||{},n={};return MN(n,r,e),Object.assign(n,_6(e,t)),n}function F6(e,t){const r={},n=L6(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 V6=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 Xd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||V6.has(e)}let ON=e=>!Xd(e);function $6(e){e&&(ON=t=>t.startsWith("on")?!Xd(t):e(t))}try{$6(require("@emotion/is-prop-valid").default)}catch{}function B6(e,t,r){const n={};for(const i in e)i==="values"&&typeof e.values=="object"||(ON(i)||r===!0&&Xd(i)||!t&&!Xd(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}function U6(e,t,r,n){const i=m.useMemo(()=>{const s=jN();return Hx(s,t,Gx(n),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};MN(s,e.style,e),i.style={...s,...i.style}}return i}function z6(e=!1){return(r,n,i,{latestValues:s},o)=>{const l=($x(r)?U6:F6)(n,s,o,r),c=B6(n,typeof r=="string",e),u=r!==m.Fragment?{...c,...l,ref:i}:{},{children:d}=n,p=m.useMemo(()=>Lt(d)?d.get():d,[d]);return m.createElement(r,{...u,children:p})}}function W6(e,t){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...$x(n)?M6:O6,preloadedFeatures:e,useRender:z6(i),createVisualElement:t,Component:n};return w6(o)}}const av={current:null},_N={current:!1};function H6(){if(_N.current=!0,!!Vx)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>av.current=e.matches;e.addListener(t),t()}else av.current=!1}function G6(e,t,r){for(const n in t){const i=t[n],s=r[n];if(Lt(i))e.addValue(n,i);else if(Lt(s))e.addValue(n,ac(i,{owner:e}));else if(s!==i)if(e.hasValue(n)){const o=e.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(n);e.addValue(n,ac(o!==void 0?o:i,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const g1=new WeakMap,K6=[...AA,Ot,Qi],q6=e=>K6.find(DA(e)),v1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Q6{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=wx,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 p=Dn.now();this.renderScheduledAtthis.bindToMotionValue(n,r)),_N.current||H6(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:av.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){g1.delete(this.current),this.projection&&this.projection.unmount(),qi(this.notifyUpdate),qi(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=Ys.has(t),i=r.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Xe.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),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 ga){const r=ga[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 s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;nr.variantChildren.delete(t)}addValue(t,r){const n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=ac(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"&&(CA(i)||SA(i))?i=parseFloat(i):!q6(i)&&Qi.test(r)&&(i=_A(t,r)),this.setBaseTarget(t,Lt(i)?i.get():i)),Lt(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 o=px(this.props,n,(r=this.presenceContext)===null||r===void 0?void 0:r.custom);o&&(i=o[t])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Lt(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Ix),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}}class LN extends Q6{constructor(){super(...arguments),this.KeyframeResolver=LA}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;Lt(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function Y6(e){return window.getComputedStyle(e)}class Z6 extends LN{constructor(){super(...arguments),this.type="html",this.renderInstance=PN}readValueFromInstance(t,r){if(Ys.has(r)){const n=Ex(r);return n&&n.default||0}else{const n=Y6(t),i=(TA(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:r}){return uN(t,r)}build(t,r,n){Wx(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return Bx(t,r,n)}}class X6 extends LN{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=pt}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Ys.has(r)){const n=Ex(r);return n&&n.default||0}return r=DN.has(r)?r:Mx(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return kN(t,r,n)}build(t,r,n){Hx(t,r,this.isSVGTag,n.transformTemplate)}renderInstance(t,r,n,i){AN(t,r,n,i)}mount(t){this.isSVGTag=Gx(t.tagName),super.mount(t)}}const J6=(e,t)=>$x(e)?new X6(t):new Z6(t,{allowProjection:e!==m.Fragment}),eW=W6({..._U,...d6,...e6,...f6},J6),y1=M3(eW);class tW extends m.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 rW({children:e,isPresent:t}){const r=m.useId(),n=m.useRef(null),i=m.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=m.useContext(Fx);return m.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:c}=i.current;if(t||!n.current||!o||!a)return;n.current.dataset.motionPopId=r;const u=document.createElement("style");return s&&(u.nonce=s),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${o}px !important; height: ${a}px !important; top: ${l}px !important; left: ${c}px !important; } `),()=>{document.head.removeChild(u)}},[t]),f.jsx(tW,{isPresent:t,childRef:n,sizeRef:i,children:m.cloneElement(e,{ref:n})})}const nW=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=Ux(iW),l=m.useId(),c=m.useCallback(d=>{a.set(d,!0);for(const p of a.values())if(!p)return;n&&n()},[a,n]),u=m.useMemo(()=>({id:l,initial:t,isPresent:r,custom:i,onExitComplete:c,register:d=>(a.set(d,!1),()=>a.delete(d))}),s?[Math.random(),c]:[r,c]);return m.useMemo(()=>{a.forEach((d,p)=>a.set(p,!1))},[r]),m.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(e=f.jsx(rW,{isPresent:r,children:e})),f.jsx(xp.Provider,{value:u,children:e})};function iW(){return new Map}const Du=e=>e.key||"";function x1(e){const t=[];return m.Children.forEach(e,r=>{m.isValidElement(r)&&t.push(r)}),t}const sW=({children:e,exitBeforeEnter:t,custom:r,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{const a=m.useMemo(()=>x1(e),[e]),l=a.map(Du),c=m.useRef(!0),u=m.useRef(a),d=Ux(()=>new Map),[p,h]=m.useState(a),[g,v]=m.useState(a);SN(()=>{c.current=!1,u.current=a;for(let y=0;y{const b=Du(y),S=a===g||l.includes(b),C=()=>{if(d.has(b))d.set(b,!0);else return;let D=!0;d.forEach(N=>{N||(D=!1)}),D&&(x==null||x(),v(u.current),i&&i())};return f.jsx(nW,{isPresent:S,initial:!c.current||n?void 0:!1,custom:S?void 0:r,presenceAffectsLayout:s,mode:o,onExitComplete:S?void 0:C,children:y},b)})})};var Gc={};(function e(t,r,n,i){var s=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",a=function(){if(!t.OffscreenCanvas)return!1;var A=new OffscreenCanvas(1,1),P=A.getContext("2d");P.fillRect(0,0,1,1);var H=A.transferToImageBitmap();try{P.createPattern(H,"no-repeat")}catch{return!1}return!0}();function l(){}function c(A){var P=r.exports.Promise,H=P!==void 0?P:t.Promise;return typeof H=="function"?new H(A):(A(l,l),null)}var u=function(A,P){return{transform:function(H){if(A)return H;if(P.has(H))return P.get(H);var ne=new OffscreenCanvas(H.width,H.height),ae=ne.getContext("2d");return ae.drawImage(H,0,0),P.set(H,ne),ne},clear:function(){P.clear()}}}(a,new Map),d=function(){var A=Math.floor(16.666666666666668),P,H,ne={},ae=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(P=function(de){var ue=Math.random();return ne[ue]=requestAnimationFrame(function re(ge){ae===ge||ae+A-1{const o=n?Hi:"button";return f.jsx(o,{className:Ce(Kx({variant:t,size:r,className:e})),ref:s,...i})});be.displayName="Button";var aW=m.createContext(void 0);function FN(e){const t=m.useContext(aW);return e||t||"ltr"}var im=0;function VN(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??w1()),document.body.insertAdjacentElement("beforeend",e[1]??w1()),im++,()=>{im===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),im--}},[])}function w1(){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 sm="focusScope.autoFocusOnMount",om="focusScope.autoFocusOnUnmount",b1={bubbles:!1,cancelable:!0},lW="FocusScope",qx=m.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,l]=m.useState(null),c=Ht(i),u=Ht(s),d=m.useRef(null),p=it(t,v=>l(v)),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(n){let v=function(b){if(h.paused||!a)return;const S=b.target;a.contains(S)?d.current=S:mi(d.current,{select:!0})},w=function(b){if(h.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||mi(d.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const C of b)C.removedNodes.length>0&&mi(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",w);const y=new MutationObserver(x);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",w),y.disconnect()}}},[n,a,h.paused]),m.useEffect(()=>{if(a){C1.add(h);const v=document.activeElement;if(!a.contains(v)){const x=new CustomEvent(sm,b1);a.addEventListener(sm,c),a.dispatchEvent(x),x.defaultPrevented||(cW(hW($N(a)),{select:!0}),document.activeElement===v&&mi(a))}return()=>{a.removeEventListener(sm,c),setTimeout(()=>{const x=new CustomEvent(om,b1);a.addEventListener(om,u),a.dispatchEvent(x),x.defaultPrevented||mi(v??document.body,{select:!0}),a.removeEventListener(om,u),C1.remove(h)},0)}}},[a,c,u,h]);const g=m.useCallback(v=>{if(!r&&!n||h.paused)return;const w=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(w&&x){const y=v.currentTarget,[b,S]=uW(y);b&&S?!v.shiftKey&&x===S?(v.preventDefault(),r&&mi(b,{select:!0})):v.shiftKey&&x===b&&(v.preventDefault(),r&&mi(S,{select:!0})):x===y&&v.preventDefault()}},[r,n,h.paused]);return f.jsx(We.div,{tabIndex:-1,...o,ref:p,onKeyDown:g})});qx.displayName=lW;function cW(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(mi(n,{select:t}),document.activeElement!==r)return}function uW(e){const t=$N(e),r=S1(t,e),n=S1(t.reverse(),e);return[r,n]}function $N(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 S1(e,t){for(const r of e)if(!dW(r,{upTo:t}))return r}function dW(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 fW(e){return e instanceof HTMLInputElement&&"select"in e}function mi(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&fW(e)&&t&&e.select()}}var C1=pW();function pW(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=E1(e,t),e.unshift(t)},remove(t){var r;e=E1(e,t),(r=e[0])==null||r.resume()}}}function E1(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function hW(e){return e.filter(t=>t.tagName!=="A")}var mW=EC.useId||(()=>{}),gW=0;function Is(e){const[t,r]=m.useState(mW());return Gi(()=>{r(n=>n??String(gW++))},[e]),t?`radix-${t}`:""}const vW=["top","right","bottom","left"],Yi=Math.min,ur=Math.max,Jd=Math.round,Au=Math.floor,An=e=>({x:e,y:e}),yW={left:"right",right:"left",bottom:"top",top:"bottom"},xW={start:"end",end:"start"};function lv(e,t,r){return ur(e,Yi(t,r))}function ni(e,t){return typeof e=="function"?e(t):e}function ii(e){return e.split("-")[0]}function Ma(e){return e.split("-")[1]}function Qx(e){return e==="x"?"y":"x"}function Yx(e){return e==="y"?"height":"width"}function Zi(e){return["top","bottom"].includes(ii(e))?"y":"x"}function Zx(e){return Qx(Zi(e))}function wW(e,t,r){r===void 0&&(r=!1);const n=Ma(e),i=Zx(e),s=Yx(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=ef(o)),[o,ef(o)]}function bW(e){const t=ef(e);return[cv(e),t,cv(t)]}function cv(e){return e.replace(/start|end/g,t=>xW[t])}function SW(e,t,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return r?t?i:n:t?n:i;case"left":case"right":return t?s:o;default:return[]}}function CW(e,t,r,n){const i=Ma(e);let s=SW(ii(e),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(cv)))),s}function ef(e){return e.replace(/left|right|bottom|top/g,t=>yW[t])}function EW(e){return{top:0,right:0,bottom:0,left:0,...e}}function BN(e){return typeof e!="number"?EW(e):{top:e,right:e,bottom:e,left:e}}function tf(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 T1(e,t,r){let{reference:n,floating:i}=e;const s=Zi(t),o=Zx(t),a=Yx(o),l=ii(t),c=s==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,p=n[a]/2-i[a]/2;let h;switch(l){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-i.width,y:d};break;default:h={x:n.x,y:n.y}}switch(Ma(t)){case"start":h[o]-=p*(r&&c?-1:1);break;case"end":h[o]+=p*(r&&c?-1:1);break}return h}const TW=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=T1(c,n,l),p=n,h={},g=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=ni(e,t)||{};if(c==null)return{};const d=BN(u),p={x:r,y:n},h=Zx(i),g=Yx(h),v=await o.getDimensions(c),w=h==="y",x=w?"top":"left",y=w?"bottom":"right",b=w?"clientHeight":"clientWidth",S=s.reference[g]+s.reference[h]-p[h]-s.floating[g],C=p[h]-s.reference[h],D=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let N=D?D[b]:0;(!N||!await(o.isElement==null?void 0:o.isElement(D)))&&(N=a.floating[b]||s.floating[g]);const k=S/2-C/2,R=N/2-v[g]/2-1,M=Yi(d[x],R),W=Yi(d[y],R),V=M,q=N-v[g]-W,B=N/2-v[g]/2+k,te=lv(V,B,q),J=!l.arrow&&Ma(i)!=null&&B!==te&&s.reference[g]/2-(BB<=0)){var W,V;const B=(((W=s.flip)==null?void 0:W.index)||0)+1,te=N[B];if(te)return{data:{index:B,overflows:M},reset:{placement:te}};let J=(V=M.filter(X=>X.overflows[0]<=0).sort((X,F)=>X.overflows[1]-F.overflows[1])[0])==null?void 0:V.placement;if(!J)switch(h){case"bestFit":{var q;const X=(q=M.filter(F=>{if(D){const $=Zi(F.placement);return $===y||$==="y"}return!0}).map(F=>[F.placement,F.overflows.filter($=>$>0).reduce(($,A)=>$+A,0)]).sort((F,$)=>F[1]-$[1])[0])==null?void 0:q[0];X&&(J=X);break}case"initialPlacement":J=a;break}if(i!==J)return{reset:{placement:J}}}return{}}}};function P1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function D1(e){return vW.some(t=>e[t]>=0)}const AW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=ni(e,t);switch(n){case"referenceHidden":{const s=await cc(t,{...i,elementContext:"reference"}),o=P1(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:D1(o)}}}case"escaped":{const s=await cc(t,{...i,altBoundary:!0}),o=P1(s,r.floating);return{data:{escapedOffsets:o,escaped:D1(o)}}}default:return{}}}}};async function NW(e,t){const{placement:r,platform:n,elements:i}=e,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=ii(r),a=Ma(r),l=Zi(r)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=ni(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const kW=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await NW(t,e);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},RW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x,y}=w;return{x,y}}},...l}=ni(e,t),c={x:r,y:n},u=await cc(t,l),d=Zi(ii(i)),p=Qx(d);let h=c[p],g=c[d];if(s){const w=p==="y"?"top":"left",x=p==="y"?"bottom":"right",y=h+u[w],b=h-u[x];h=lv(y,h,b)}if(o){const w=d==="y"?"top":"left",x=d==="y"?"bottom":"right",y=g+u[w],b=g-u[x];g=lv(y,g,b)}const v=a.fn({...t,[p]:h,[d]:g});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[p]:s,[d]:o}}}}}},jW=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ni(e,t),u={x:r,y:n},d=Zi(i),p=Qx(d);let h=u[p],g=u[d];const v=ni(a,t),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const b=p==="y"?"height":"width",S=s.reference[p]-s.floating[b]+w.mainAxis,C=s.reference[p]+s.reference[b]-w.mainAxis;hC&&(h=C)}if(c){var x,y;const b=p==="y"?"width":"height",S=["top","left"].includes(ii(i)),C=s.reference[d]-s.floating[b]+(S&&((x=o.offset)==null?void 0:x[d])||0)+(S?0:w.crossAxis),D=s.reference[d]+s.reference[b]+(S?0:((y=o.offset)==null?void 0:y[d])||0)-(S?w.crossAxis:0);gD&&(g=D)}return{[p]:h,[d]:g}}}},IW=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:l=()=>{},...c}=ni(e,t),u=await cc(t,c),d=ii(i),p=Ma(i),h=Zi(i)==="y",{width:g,height:v}=s.floating;let w,x;d==="top"||d==="bottom"?(w=d,x=p===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(x=d,w=p==="end"?"top":"bottom");const y=v-u.top-u.bottom,b=g-u.left-u.right,S=Yi(v-u[w],y),C=Yi(g-u[x],b),D=!t.middlewareData.shift;let N=S,k=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=b),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(N=y),D&&!p){const M=ur(u.left,0),W=ur(u.right,0),V=ur(u.top,0),q=ur(u.bottom,0);h?k=g-2*(M!==0||W!==0?M+W:ur(u.left,u.right)):N=v-2*(V!==0||q!==0?V+q:ur(u.top,u.bottom))}await l({...t,availableWidth:k,availableHeight:N});const R=await o.getDimensions(a.floating);return g!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function Sp(){return typeof window<"u"}function Oa(e){return UN(e)?(e.nodeName||"").toLowerCase():"#document"}function vr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function In(e){var t;return(t=(UN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function UN(e){return Sp()?e instanceof Node||e instanceof vr(e).Node:!1}function an(e){return Sp()?e instanceof Element||e instanceof vr(e).Element:!1}function kn(e){return Sp()?e instanceof HTMLElement||e instanceof vr(e).HTMLElement:!1}function A1(e){return!Sp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vr(e).ShadowRoot}function Kc(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=ln(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function MW(e){return["table","td","th"].includes(Oa(e))}function Cp(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Xx(e){const t=Jx(),r=an(e)?ln(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 OW(e){let t=Xi(e);for(;kn(t)&&!va(t);){if(Xx(t))return t;if(Cp(t))return null;t=Xi(t)}return null}function Jx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function va(e){return["html","body","#document"].includes(Oa(e))}function ln(e){return vr(e).getComputedStyle(e)}function Ep(e){return an(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xi(e){if(Oa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||A1(e)&&e.host||In(e);return A1(t)?t.host:t}function zN(e){const t=Xi(e);return va(t)?e.ownerDocument?e.ownerDocument.body:e.body:kn(t)&&Kc(t)?t:zN(t)}function uc(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=zN(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=vr(i);if(s){const a=uv(o);return t.concat(o,o.visualViewport||[],Kc(i)?i:[],a&&r?uc(a):[])}return t.concat(i,uc(i,[],r))}function uv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function WN(e){const t=ln(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=kn(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,a=Jd(r)!==s||Jd(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function e0(e){return an(e)?e:e.contextElement}function $o(e){const t=e0(e);if(!kn(t))return An(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:s}=WN(t);let o=(s?Jd(r.width):r.width)/n,a=(s?Jd(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const _W=An(0);function HN(e){const t=vr(e);return!Jx()||!t.visualViewport?_W:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function LW(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==vr(e)?!1:t}function Us(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),s=e0(e);let o=An(1);t&&(n?an(n)&&(o=$o(n)):o=$o(e));const a=LW(s,r,n)?HN(s):An(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const p=vr(s),h=n&&an(n)?vr(n):n;let g=p,v=uv(g);for(;v&&n&&h!==g;){const w=$o(v),x=v.getBoundingClientRect(),y=ln(v),b=x.left+(v.clientLeft+parseFloat(y.paddingLeft))*w.x,S=x.top+(v.clientTop+parseFloat(y.paddingTop))*w.y;l*=w.x,c*=w.y,u*=w.x,d*=w.y,l+=b,c+=S,g=vr(v),v=uv(g)}}return tf({width:u,height:d,x:l,y:c})}function t0(e,t){const r=Ep(e).scrollLeft;return t?t.left+r:Us(In(e)).left+r}function GN(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-(r?0:t0(e,n)),s=n.top+t.scrollTop;return{x:i,y:s}}function FW(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const s=i==="fixed",o=In(n),a=t?Cp(t.floating):!1;if(n===o||a&&s)return r;let l={scrollLeft:0,scrollTop:0},c=An(1);const u=An(0),d=kn(n);if((d||!d&&!s)&&((Oa(n)!=="body"||Kc(o))&&(l=Ep(n)),kn(n))){const h=Us(n);c=$o(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const p=o&&!d&&!s?GN(o,l,!0):An(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}}function VW(e){return Array.from(e.getClientRects())}function $W(e){const t=In(e),r=Ep(e),n=e.ownerDocument.body,i=ur(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ur(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+t0(e);const a=-r.scrollTop;return ln(n).direction==="rtl"&&(o+=ur(t.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function BW(e,t){const r=vr(e),n=In(e),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=Jx();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function UW(e,t){const r=Us(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,s=kn(e)?$o(e):An(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=n*s.y;return{width:o,height:a,x:l,y:c}}function N1(e,t,r){let n;if(t==="viewport")n=BW(e,r);else if(t==="document")n=$W(In(e));else if(an(t))n=UW(t,r);else{const i=HN(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return tf(n)}function KN(e,t){const r=Xi(e);return r===t||!an(r)||va(r)?!1:ln(r).position==="fixed"||KN(r,t)}function zW(e,t){const r=t.get(e);if(r)return r;let n=uc(e,[],!1).filter(a=>an(a)&&Oa(a)!=="body"),i=null;const s=ln(e).position==="fixed";let o=s?Xi(e):e;for(;an(o)&&!va(o);){const a=ln(o),l=Xx(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Kc(o)&&!l&&KN(e,o))?n=n.filter(u=>u!==o):i=a,o=Xi(o)}return t.set(e,n),n}function WW(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?Cp(t)?[]:zW(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((c,u)=>{const d=N1(t,u,i);return c.top=ur(d.top,c.top),c.right=Yi(d.right,c.right),c.bottom=Yi(d.bottom,c.bottom),c.left=ur(d.left,c.left),c},N1(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function HW(e){const{width:t,height:r}=WN(e);return{width:t,height:r}}function GW(e,t,r){const n=kn(t),i=In(t),s=r==="fixed",o=Us(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=An(0);if(n||!n&&!s)if((Oa(t)!=="body"||Kc(i))&&(a=Ep(t)),n){const p=Us(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&(l.x=t0(i));const c=i&&!n&&!s?GN(i,a):An(0),u=o.left+a.scrollLeft-l.x-c.x,d=o.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:o.width,height:o.height}}function am(e){return ln(e).position==="static"}function k1(e,t){if(!kn(e)||ln(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return In(e)===r&&(r=r.ownerDocument.body),r}function qN(e,t){const r=vr(e);if(Cp(e))return r;if(!kn(e)){let i=Xi(e);for(;i&&!va(i);){if(an(i)&&!am(i))return i;i=Xi(i)}return r}let n=k1(e,t);for(;n&&MW(n)&&am(n);)n=k1(n,t);return n&&va(n)&&am(n)&&!Xx(n)?r:n||OW(e)||r}const KW=async function(e){const t=this.getOffsetParent||qN,r=this.getDimensions,n=await r(e.floating);return{reference:GW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function qW(e){return ln(e).direction==="rtl"}const QW={convertOffsetParentRelativeRectToViewportRelativeRect:FW,getDocumentElement:In,getClippingRect:WW,getOffsetParent:qN,getElementRects:KW,getClientRects:VW,getDimensions:HW,getScale:$o,isElement:an,isRTL:qW};function YW(e,t){let r=null,n;const i=In(e);function s(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const h=Au(u),g=Au(i.clientWidth-(c+d)),v=Au(i.clientHeight-(u+p)),w=Au(c),y={rootMargin:-h+"px "+-g+"px "+-v+"px "+-w+"px",threshold:ur(0,Yi(1,l))||1};let b=!0;function S(C){const D=C[0].intersectionRatio;if(D!==l){if(!b)return o();D?o(!1,D):n=setTimeout(()=>{o(!1,1e-7)},1e3)}b=!1}try{r=new IntersectionObserver(S,{...y,root:i.ownerDocument})}catch{r=new IntersectionObserver(S,y)}r.observe(e)}return o(!0),s}function ZW(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=e0(e),u=i||s?[...c?uc(c):[],...uc(t)]:[];u.forEach(x=>{i&&x.addEventListener("scroll",r,{passive:!0}),s&&x.addEventListener("resize",r)});const d=c&&a?YW(c,r):null;let p=-1,h=null;o&&(h=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var b;(b=h)==null||b.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let g,v=l?Us(e):null;l&&w();function w(){const x=Us(e);v&&(x.x!==v.x||x.y!==v.y||x.width!==v.width||x.height!==v.height)&&r(),v=x,g=requestAnimationFrame(w)}return r(),()=>{var x;u.forEach(y=>{i&&y.removeEventListener("scroll",r),s&&y.removeEventListener("resize",r)}),d==null||d(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const XW=kW,JW=RW,e8=DW,t8=IW,r8=AW,R1=PW,n8=jW,i8=(e,t,r)=>{const n=new Map,i={platform:QW,...r},s={...i.platform,_c:n};return TW(e,t,{...i,platform:s})};var id=typeof document<"u"?m.useLayoutEffect:m.useEffect;function rf(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(!rf(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 s=i[n];if(!(s==="_owner"&&e.$$typeof)&&!rf(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function QN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function j1(e,t){const r=QN(e);return Math.round(t*r)/r}function lm(e){const t=m.useRef(e);return id(()=>{t.current=e}),t}function s8(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=m.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=m.useState(n);rf(p,n)||h(n);const[g,v]=m.useState(null),[w,x]=m.useState(null),y=m.useCallback(F=>{F!==D.current&&(D.current=F,v(F))},[]),b=m.useCallback(F=>{F!==N.current&&(N.current=F,x(F))},[]),S=s||g,C=o||w,D=m.useRef(null),N=m.useRef(null),k=m.useRef(u),R=l!=null,M=lm(l),W=lm(i),V=lm(c),q=m.useCallback(()=>{if(!D.current||!N.current)return;const F={placement:t,strategy:r,middleware:p};W.current&&(F.platform=W.current),i8(D.current,N.current,F).then($=>{const A={...$,isPositioned:V.current!==!1};B.current&&!rf(k.current,A)&&(k.current=A,Pa.flushSync(()=>{d(A)}))})},[p,t,r,W,V]);id(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[c]);const B=m.useRef(!1);id(()=>(B.current=!0,()=>{B.current=!1}),[]),id(()=>{if(S&&(D.current=S),C&&(N.current=C),S&&C){if(M.current)return M.current(S,C,q);q()}},[S,C,q,M,R]);const te=m.useMemo(()=>({reference:D,floating:N,setReference:y,setFloating:b}),[y,b]),J=m.useMemo(()=>({reference:S,floating:C}),[S,C]),X=m.useMemo(()=>{const F={position:r,left:0,top:0};if(!J.floating)return F;const $=j1(J.floating,u.x),A=j1(J.floating,u.y);return a?{...F,transform:"translate("+$+"px, "+A+"px)",...QN(J.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:A}},[r,a,J.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:q,refs:te,elements:J,floatingStyles:X}),[u,q,te,J,X])}const o8=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?R1({element:n.current,padding:i}).fn(r):{}:n?R1({element:n,padding:i}).fn(r):{}}}},a8=(e,t)=>({...XW(e),options:[e,t]}),l8=(e,t)=>({...JW(e),options:[e,t]}),c8=(e,t)=>({...n8(e),options:[e,t]}),u8=(e,t)=>({...e8(e),options:[e,t]}),d8=(e,t)=>({...t8(e),options:[e,t]}),f8=(e,t)=>({...r8(e),options:[e,t]}),p8=(e,t)=>({...o8(e),options:[e,t]});var h8="Arrow",YN=m.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...s}=e;return f.jsx(We.svg,{...s,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});YN.displayName=h8;var m8=YN;function g8(e,t=[]){let r=[];function n(s,o){const a=m.createContext(o),l=r.length;r=[...r,o];function c(d){const{scope:p,children:h,...g}=d,v=(p==null?void 0:p[e][l])||a,w=m.useMemo(()=>g,Object.values(g));return f.jsx(v.Provider,{value:w,children:h})}function u(d,p){const h=(p==null?void 0:p[e][l])||a,g=m.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=r.map(o=>m.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[n,v8(i,...t)]}function v8(...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(s){const o=n.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function y8(e){const[t,r]=m.useState(void 0);return Gi(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var r0="Popper",[ZN,Tp]=g8(r0),[x8,XN]=ZN(r0),JN=e=>{const{__scopePopper:t,children:r}=e,[n,i]=m.useState(null);return f.jsx(x8,{scope:t,anchor:n,onAnchorChange:i,children:r})};JN.displayName=r0;var ek="PopperAnchor",tk=m.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,s=XN(ek,r),o=m.useRef(null),a=it(t,o);return m.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:f.jsx(We.div,{...i,ref:a})});tk.displayName=ek;var n0="PopperContent",[w8,b8]=ZN(n0),rk=m.forwardRef((e,t)=>{var re,ge,we,ke,Ae,Fe;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:g,...v}=e,w=XN(n0,r),[x,y]=m.useState(null),b=it(t,Ve=>y(Ve)),[S,C]=m.useState(null),D=y8(S),N=(D==null?void 0:D.width)??0,k=(D==null?void 0:D.height)??0,R=n+(s!=="center"?"-"+s:""),M=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},W=Array.isArray(c)?c:[c],V=W.length>0,q={padding:M,boundary:W.filter(C8),altBoundary:V},{refs:B,floatingStyles:te,placement:J,isPositioned:X,middlewareData:F}=s8({strategy:"fixed",placement:R,whileElementsMounted:(...Ve)=>ZW(...Ve,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[a8({mainAxis:i+k,alignmentAxis:o}),l&&l8({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?c8():void 0,...q}),l&&u8({...q}),d8({...q,apply:({elements:Ve,rects:Ee,availableWidth:st,availableHeight:dt})=>{const{width:z,height:E}=Ee.reference,T=Ve.floating.style;T.setProperty("--radix-popper-available-width",`${st}px`),T.setProperty("--radix-popper-available-height",`${dt}px`),T.setProperty("--radix-popper-anchor-width",`${z}px`),T.setProperty("--radix-popper-anchor-height",`${E}px`)}}),S&&p8({element:S,padding:a}),E8({arrowWidth:N,arrowHeight:k}),p&&f8({strategy:"referenceHidden",...q})]}),[$,A]=sk(J),P=Ht(g);Gi(()=>{X&&(P==null||P())},[X,P]);const H=(re=F.arrow)==null?void 0:re.x,ne=(ge=F.arrow)==null?void 0:ge.y,ae=((we=F.arrow)==null?void 0:we.centerOffset)!==0,[de,ue]=m.useState();return Gi(()=>{x&&ue(window.getComputedStyle(x).zIndex)},[x]),f.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:X?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(ke=F.transformOrigin)==null?void 0:ke.x,(Ae=F.transformOrigin)==null?void 0:Ae.y].join(" "),...((Fe=F.hide)==null?void 0:Fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(w8,{scope:r,placedSide:$,onArrowChange:C,arrowX:H,arrowY:ne,shouldHideArrow:ae,children:f.jsx(We.div,{"data-side":$,"data-align":A,...v,ref:b,style:{...v.style,animation:X?void 0:"none"}})})})});rk.displayName=n0;var nk="PopperArrow",S8={top:"bottom",right:"left",bottom:"top",left:"right"},ik=m.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,s=b8(nk,n),o=S8[s.placedSide];return f.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:f.jsx(m8,{...i,ref:r,style:{...i.style,display:"block"}})})});ik.displayName=nk;function C8(e){return e!==null}var E8=e=>({name:"transformOrigin",options:e,fn(t){var w,x,y;const{placement:r,rects:n,middlewareData:i}=t,o=((w=i.arrow)==null?void 0:w.centerOffset)!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[c,u]=sk(r),d={start:"0%",center:"50%",end:"100%"}[u],p=(((x=i.arrow)==null?void 0:x.x)??0)+a/2,h=(((y=i.arrow)==null?void 0:y.y)??0)+l/2;let g="",v="";return c==="bottom"?(g=o?d:`${p}px`,v=`${-l}px`):c==="top"?(g=o?d:`${p}px`,v=`${n.floating.height+l}px`):c==="right"?(g=`${-l}px`,v=o?d:`${h}px`):c==="left"&&(g=`${n.floating.width+l}px`,v=o?d:`${h}px`),{data:{x:g,y:v}}}});function sk(e){const[t,r="center"]=e.split("-");return[t,r]}var ok=JN,ak=tk,lk=rk,ck=ik;function T8(e,t=[]){let r=[];function n(s,o){const a=m.createContext(o),l=r.length;r=[...r,o];function c(d){const{scope:p,children:h,...g}=d,v=(p==null?void 0:p[e][l])||a,w=m.useMemo(()=>g,Object.values(g));return f.jsx(v.Provider,{value:w,children:h})}function u(d,p){const h=(p==null?void 0:p[e][l])||a,g=m.useContext(h);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=r.map(o=>m.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[n,P8(i,...t)]}function P8(...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(s){const o=n.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var cm="rovingFocusGroup.onEntryFocus",D8={bubbles:!1,cancelable:!0},Pp="RovingFocusGroup",[dv,uk,A8]=Ny(Pp),[N8,dk]=T8(Pp,[A8]),[k8,R8]=N8(Pp),fk=m.forwardRef((e,t)=>f.jsx(dv.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(dv.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(j8,{...e,ref:t})})}));fk.displayName=Pp;var j8=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,p=m.useRef(null),h=it(t,p),g=FN(s),[v=null,w]=Ac({prop:o,defaultProp:a,onChange:l}),[x,y]=m.useState(!1),b=Ht(c),S=uk(r),C=m.useRef(!1),[D,N]=m.useState(0);return m.useEffect(()=>{const k=p.current;if(k)return k.addEventListener(cm,b),()=>k.removeEventListener(cm,b)},[b]),f.jsx(k8,{scope:r,orientation:n,dir:g,loop:i,currentTabStopId:v,onItemFocus:m.useCallback(k=>w(k),[w]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>N(k=>k+1),[]),onFocusableItemRemove:m.useCallback(()=>N(k=>k-1),[]),children:f.jsx(We.div,{tabIndex:x||D===0?-1:0,"data-orientation":n,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:he(e.onMouseDown,()=>{C.current=!0}),onFocus:he(e.onFocus,k=>{const R=!C.current;if(k.target===k.currentTarget&&R&&!x){const M=new CustomEvent(cm,D8);if(k.currentTarget.dispatchEvent(M),!M.defaultPrevented){const W=S().filter(J=>J.focusable),V=W.find(J=>J.active),q=W.find(J=>J.id===v),te=[V,q,...W].filter(Boolean).map(J=>J.ref.current);mk(te,u)}}C.current=!1}),onBlur:he(e.onBlur,()=>y(!1))})})}),pk="RovingFocusGroupItem",hk=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=e,a=Is(),l=s||a,c=R8(pk,r),u=c.currentTabStopId===l,d=uk(r),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return m.useEffect(()=>{if(n)return p(),()=>h()},[n,p,h]),f.jsx(dv.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:f.jsx(We.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...o,ref:t,onMouseDown:he(e.onMouseDown,g=>{n?c.onItemFocus(l):g.preventDefault()}),onFocus:he(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:he(e.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){c.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const v=O8(g,c.orientation,c.dir);if(v!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let x=d().filter(y=>y.focusable).map(y=>y.ref.current);if(v==="last")x.reverse();else if(v==="prev"||v==="next"){v==="prev"&&x.reverse();const y=x.indexOf(g.currentTarget);x=c.loop?_8(x,y+1):x.slice(y+1)}setTimeout(()=>mk(x))}})})})});hk.displayName=pk;var I8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function M8(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function O8(e,t,r){const n=M8(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return I8[n]}function mk(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function _8(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var L8=fk,F8=hk,V8=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},io=new WeakMap,Nu=new WeakMap,ku={},um=0,gk=function(e){return e&&(e.host||gk(e.parentNode))},$8=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=gk(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})},B8=function(e,t,r,n){var i=$8(t,Array.isArray(e)?e:[e]);ku[r]||(ku[r]=new WeakMap);var s=ku[r],o=[],a=new Set,l=new Set(i),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))u(p);else try{var h=p.getAttribute(n),g=h!==null&&h!=="false",v=(io.get(p)||0)+1,w=(s.get(p)||0)+1;io.set(p,v),s.set(p,w),o.push(p),v===1&&g&&Nu.set(p,!0),w===1&&p.setAttribute(r,"true"),g||p.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return u(t),a.clear(),um++,function(){o.forEach(function(d){var p=io.get(d)-1,h=s.get(d)-1;io.set(d,p),s.set(d,h),p||(Nu.has(d)||d.removeAttribute(n),Nu.delete(d)),h||d.removeAttribute(r)}),um--,um||(io=new WeakMap,io=new WeakMap,Nu=new WeakMap,ku={})}},vk=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=V8(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),B8(n,i,r,"aria-hidden")):function(){return null}},xn=function(){return xn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return iH;var t=sH(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])}},aH=bk(),Bo="data-scroll-locked",lH=function(e,t,r,n){var i=e.left,s=e.top,o=e.right,a=e.gap;return r===void 0&&(r="margin"),` .`.concat(z8,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; } body[`).concat(Bo,`] { overflow: hidden `).concat(n,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` padding-left: `.concat(i,`px; padding-top: `).concat(s,`px; padding-right: `).concat(o,`px; margin-left:0; margin-top:0; margin-right: `).concat(a,"px ").concat(n,`; `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` } .`).concat(sd,` { right: `).concat(a,"px ").concat(n,`; } .`).concat(od,` { margin-right: `).concat(a,"px ").concat(n,`; } .`).concat(sd," .").concat(sd,` { right: 0 `).concat(n,`; } .`).concat(od," .").concat(od,` { margin-right: 0 `).concat(n,`; } body[`).concat(Bo,`] { `).concat(W8,": ").concat(a,`px; } `)},M1=function(){var e=parseInt(document.body.getAttribute(Bo)||"0",10);return isFinite(e)?e:0},cH=function(){m.useEffect(function(){return document.body.setAttribute(Bo,(M1()+1).toString()),function(){var e=M1()-1;e<=0?document.body.removeAttribute(Bo):document.body.setAttribute(Bo,e.toString())}},[])},uH=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;cH();var s=m.useMemo(function(){return oH(i)},[i]);return m.createElement(aH,{styles:lH(s,!t,i,r?"":"!important")})},fv=!1;if(typeof window<"u")try{var Ru=Object.defineProperty({},"passive",{get:function(){return fv=!0,!0}});window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{fv=!1}var so=fv?{passive:!1}:!1,dH=function(e){return e.tagName==="TEXTAREA"},Sk=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!dH(e)&&r[t]==="visible")},fH=function(e){return Sk(e,"overflowY")},pH=function(e){return Sk(e,"overflowX")},O1=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=Ck(e,n);if(i){var s=Ek(e,n),o=s[1],a=s[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},hH=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},mH=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Ck=function(e,t){return e==="v"?fH(t):pH(t)},Ek=function(e,t){return e==="v"?hH(t):mH(t)},gH=function(e,t){return e==="h"&&t==="rtl"?-1:1},vH=function(e,t,r,n,i){var s=gH(e,window.getComputedStyle(t).direction),o=s*n,a=r.target,l=t.contains(a),c=!1,u=o>0,d=0,p=0;do{var h=Ek(e,a),g=h[0],v=h[1],w=h[2],x=v-w-s*g;(g||x)&&Ck(e,a)&&(d+=x,p+=g),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(Math.abs(d)<1||!i)||!u&&(Math.abs(p)<1||!i))&&(c=!0),c},ju=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_1=function(e){return[e.deltaX,e.deltaY]},L1=function(e){return e&&"current"in e?e.current:e},yH=function(e,t){return e[0]===t[0]&&e[1]===t[1]},xH=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},wH=0,oo=[];function bH(e){var t=m.useRef([]),r=m.useRef([0,0]),n=m.useRef(),i=m.useState(wH++)[0],s=m.useState(bk)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=U8([e.lockRef.current],(e.shards||[]).map(L1),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(v,w){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var x=ju(v),y=r.current,b="deltaX"in v?v.deltaX:y[0]-x[0],S="deltaY"in v?v.deltaY:y[1]-x[1],C,D=v.target,N=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in v&&N==="h"&&D.type==="range")return!1;var k=O1(N,D);if(!k)return!0;if(k?C=N:(C=N==="v"?"h":"v",k=O1(N,D)),!k)return!1;if(!n.current&&"changedTouches"in v&&(b||S)&&(n.current=C),!C)return!0;var R=n.current||C;return vH(R,w,v,R==="h"?b:S,!0)},[]),l=m.useCallback(function(v){var w=v;if(!(!oo.length||oo[oo.length-1]!==s)){var x="deltaY"in w?_1(w):ju(w),y=t.current.filter(function(C){return C.name===w.type&&(C.target===w.target||w.target===C.shadowParent)&&yH(C.delta,x)})[0];if(y&&y.should){w.cancelable&&w.preventDefault();return}if(!y){var b=(o.current.shards||[]).map(L1).filter(Boolean).filter(function(C){return C.contains(w.target)}),S=b.length>0?a(w,b[0]):!o.current.noIsolation;S&&w.cancelable&&w.preventDefault()}}},[]),c=m.useCallback(function(v,w,x,y){var b={name:v,delta:w,target:x,should:y,shadowParent:SH(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(S){return S!==b})},1)},[]),u=m.useCallback(function(v){r.current=ju(v),n.current=void 0},[]),d=m.useCallback(function(v){c(v.type,_1(v),v.target,a(v,e.lockRef.current))},[]),p=m.useCallback(function(v){c(v.type,ju(v),v.target,a(v,e.lockRef.current))},[]);m.useEffect(function(){return oo.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,so),document.addEventListener("touchmove",l,so),document.addEventListener("touchstart",u,so),function(){oo=oo.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,so),document.removeEventListener("touchmove",l,so),document.removeEventListener("touchstart",u,so)}},[]);var h=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(s,{styles:xH(i)}):null,h?m.createElement(uH,{gapMode:e.gapMode}):null)}function SH(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const CH=Z8(wk,bH);var i0=m.forwardRef(function(e,t){return m.createElement(Dp,xn({},e,{ref:t,sideCar:CH}))});i0.classNames=Dp.classNames;var pv=["Enter"," "],EH=["ArrowDown","PageUp","Home"],Tk=["ArrowUp","PageDown","End"],TH=[...EH,...Tk],PH={ltr:[...pv,"ArrowRight"],rtl:[...pv,"ArrowLeft"]},DH={ltr:["ArrowLeft"],rtl:["ArrowRight"]},qc="Menu",[dc,AH,NH]=Ny(qc),[Zs,Pk]=Aa(qc,[NH,Tp,dk]),Ap=Tp(),Dk=dk(),[kH,Xs]=Zs(qc),[RH,Qc]=Zs(qc),Ak=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:s,modal:o=!0}=e,a=Ap(t),[l,c]=m.useState(null),u=m.useRef(!1),d=Ht(s),p=FN(i);return m.useEffect(()=>{const h=()=>{u.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>u.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),f.jsx(ok,{...a,children:f.jsx(kH,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:c,children:f.jsx(RH,{scope:t,onClose:m.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:o,children:n})})})};Ak.displayName=qc;var jH="MenuAnchor",s0=m.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=Ap(r);return f.jsx(ak,{...i,...n,ref:t})});s0.displayName=jH;var o0="MenuPortal",[IH,Nk]=Zs(o0,{forceMount:void 0}),kk=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,s=Xs(o0,t);return f.jsx(IH,{scope:t,forceMount:r,children:f.jsx(jn,{present:r||s.open,children:f.jsx(Kf,{asChild:!0,container:i,children:n})})})};kk.displayName=o0;var Lr="MenuContent",[MH,a0]=Zs(Lr),Rk=m.forwardRef((e,t)=>{const r=Nk(Lr,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,s=Xs(Lr,e.__scopeMenu),o=Qc(Lr,e.__scopeMenu);return f.jsx(dc.Provider,{scope:e.__scopeMenu,children:f.jsx(jn,{present:n||s.open,children:f.jsx(dc.Slot,{scope:e.__scopeMenu,children:o.modal?f.jsx(OH,{...i,ref:t}):f.jsx(_H,{...i,ref:t})})})})}),OH=m.forwardRef((e,t)=>{const r=Xs(Lr,e.__scopeMenu),n=m.useRef(null),i=it(t,n);return m.useEffect(()=>{const s=n.current;if(s)return vk(s)},[]),f.jsx(l0,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:he(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),_H=m.forwardRef((e,t)=>{const r=Xs(Lr,e.__scopeMenu);return f.jsx(l0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),l0=m.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:g,...v}=e,w=Xs(Lr,r),x=Qc(Lr,r),y=Ap(r),b=Dk(r),S=AH(r),[C,D]=m.useState(null),N=m.useRef(null),k=it(t,N,w.onContentChange),R=m.useRef(0),M=m.useRef(""),W=m.useRef(0),V=m.useRef(null),q=m.useRef("right"),B=m.useRef(0),te=g?i0:m.Fragment,J=g?{as:Hi,allowPinchZoom:!0}:void 0,X=$=>{var re,ge;const A=M.current+$,P=S().filter(we=>!we.disabled),H=document.activeElement,ne=(re=P.find(we=>we.ref.current===H))==null?void 0:re.textValue,ae=P.map(we=>we.textValue),de=qH(ae,A,ne),ue=(ge=P.find(we=>we.textValue===de))==null?void 0:ge.ref.current;(function we(ke){M.current=ke,window.clearTimeout(R.current),ke!==""&&(R.current=window.setTimeout(()=>we(""),1e3))})(A),ue&&setTimeout(()=>ue.focus())};m.useEffect(()=>()=>window.clearTimeout(R.current),[]),VN();const F=m.useCallback($=>{var P,H;return q.current===((P=V.current)==null?void 0:P.side)&&YH($,(H=V.current)==null?void 0:H.area)},[]);return f.jsx(MH,{scope:r,searchRef:M,onItemEnter:m.useCallback($=>{F($)&&$.preventDefault()},[F]),onItemLeave:m.useCallback($=>{var A;F($)||((A=N.current)==null||A.focus(),D(null))},[F]),onTriggerLeave:m.useCallback($=>{F($)&&$.preventDefault()},[F]),pointerGraceTimerRef:W,onPointerGraceIntentChange:m.useCallback($=>{V.current=$},[]),children:f.jsx(te,{...J,children:f.jsx(qx,{asChild:!0,trapped:i,onMountAutoFocus:he(s,$=>{var A;$.preventDefault(),(A=N.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:f.jsx(Dc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:f.jsx(L8,{asChild:!0,...b,dir:x.dir,orientation:"vertical",loop:n,currentTabStopId:C,onCurrentTabStopIdChange:D,onEntryFocus:he(l,$=>{x.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(lk,{role:"menu","aria-orientation":"vertical","data-state":Kk(w.open),"data-radix-menu-content":"",dir:x.dir,...y,...v,ref:k,style:{outline:"none",...v.style},onKeyDown:he(v.onKeyDown,$=>{const P=$.target.closest("[data-radix-menu-content]")===$.currentTarget,H=$.ctrlKey||$.altKey||$.metaKey,ne=$.key.length===1;P&&($.key==="Tab"&&$.preventDefault(),!H&&ne&&X($.key));const ae=N.current;if($.target!==ae||!TH.includes($.key))return;$.preventDefault();const ue=S().filter(re=>!re.disabled).map(re=>re.ref.current);Tk.includes($.key)&&ue.reverse(),GH(ue)}),onBlur:he(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(R.current),M.current="")}),onPointerMove:he(e.onPointerMove,fc($=>{const A=$.target,P=B.current!==$.clientX;if($.currentTarget.contains(A)&&P){const H=$.clientX>B.current?"right":"left";q.current=H,B.current=$.clientX}}))})})})})})})});Rk.displayName=Lr;var LH="MenuGroup",c0=m.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return f.jsx(We.div,{role:"group",...n,ref:t})});c0.displayName=LH;var FH="MenuLabel",jk=m.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return f.jsx(We.div,{...n,ref:t})});jk.displayName=FH;var nf="MenuItem",F1="menu.itemSelect",Np=m.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,s=m.useRef(null),o=Qc(nf,e.__scopeMenu),a=a0(nf,e.__scopeMenu),l=it(t,s),c=m.useRef(!1),u=()=>{const d=s.current;if(!r&&d){const p=new CustomEvent(F1,{bubbles:!0,cancelable:!0});d.addEventListener(F1,h=>n==null?void 0:n(h),{once:!0}),ky(d,p),p.defaultPrevented?c.current=!1:o.onClose()}};return f.jsx(Ik,{...i,ref:l,disabled:r,onClick:he(e.onClick,u),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),c.current=!0},onPointerUp:he(e.onPointerUp,d=>{var p;c.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:he(e.onKeyDown,d=>{const p=a.searchRef.current!=="";r||p&&d.key===" "||pv.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Np.displayName=nf;var Ik=m.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=e,o=a0(nf,r),a=Dk(r),l=m.useRef(null),c=it(t,l),[u,d]=m.useState(!1),[p,h]=m.useState("");return m.useEffect(()=>{const g=l.current;g&&h((g.textContent??"").trim())},[s.children]),f.jsx(dc.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:f.jsx(F8,{asChild:!0,...a,focusable:!n,children:f.jsx(We.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:c,onPointerMove:he(e.onPointerMove,fc(g=>{n?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:he(e.onPointerLeave,fc(g=>o.onItemLeave(g))),onFocus:he(e.onFocus,()=>d(!0)),onBlur:he(e.onBlur,()=>d(!1))})})})}),VH="MenuCheckboxItem",Mk=m.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...i}=e;return f.jsx(Vk,{scope:e.__scopeMenu,checked:r,children:f.jsx(Np,{role:"menuitemcheckbox","aria-checked":sf(r)?"mixed":r,...i,ref:t,"data-state":d0(r),onSelect:he(i.onSelect,()=>n==null?void 0:n(sf(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Mk.displayName=VH;var Ok="MenuRadioGroup",[$H,BH]=Zs(Ok,{value:void 0,onValueChange:()=>{}}),_k=m.forwardRef((e,t)=>{const{value:r,onValueChange:n,...i}=e,s=Ht(n);return f.jsx($H,{scope:e.__scopeMenu,value:r,onValueChange:s,children:f.jsx(c0,{...i,ref:t})})});_k.displayName=Ok;var Lk="MenuRadioItem",Fk=m.forwardRef((e,t)=>{const{value:r,...n}=e,i=BH(Lk,e.__scopeMenu),s=r===i.value;return f.jsx(Vk,{scope:e.__scopeMenu,checked:s,children:f.jsx(Np,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":d0(s),onSelect:he(n.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})})});Fk.displayName=Lk;var u0="MenuItemIndicator",[Vk,UH]=Zs(u0,{checked:!1}),$k=m.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...i}=e,s=UH(u0,r);return f.jsx(jn,{present:n||sf(s.checked)||s.checked===!0,children:f.jsx(We.span,{...i,ref:t,"data-state":d0(s.checked)})})});$k.displayName=u0;var zH="MenuSeparator",Bk=m.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return f.jsx(We.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});Bk.displayName=zH;var WH="MenuArrow",Uk=m.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=Ap(r);return f.jsx(ck,{...i,...n,ref:t})});Uk.displayName=WH;var HH="MenuSub",[K7,zk]=Zs(HH),ll="MenuSubTrigger",Wk=m.forwardRef((e,t)=>{const r=Xs(ll,e.__scopeMenu),n=Qc(ll,e.__scopeMenu),i=zk(ll,e.__scopeMenu),s=a0(ll,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),f.jsx(s0,{asChild:!0,...c,children:f.jsx(Ik,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":Kk(r.open),...e,ref:Gf(t,i.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:he(e.onPointerMove,fc(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!r.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),u()},100))})),onPointerLeave:he(e.onPointerLeave,fc(d=>{var h,g;u();const p=(h=r.content)==null?void 0:h.getBoundingClientRect();if(p){const v=(g=r.content)==null?void 0:g.dataset.side,w=v==="right",x=w?-5:5,y=p[w?"left":"right"],b=p[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:y,y:p.top},{x:b,y:p.top},{x:b,y:p.bottom},{x:y,y:p.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:he(e.onKeyDown,d=>{var h;const p=s.searchRef.current!=="";e.disabled||p&&d.key===" "||PH[n.dir].includes(d.key)&&(r.onOpenChange(!0),(h=r.content)==null||h.focus(),d.preventDefault())})})})});Wk.displayName=ll;var Hk="MenuSubContent",Gk=m.forwardRef((e,t)=>{const r=Nk(Lr,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,s=Xs(Lr,e.__scopeMenu),o=Qc(Lr,e.__scopeMenu),a=zk(Hk,e.__scopeMenu),l=m.useRef(null),c=it(t,l);return f.jsx(dc.Provider,{scope:e.__scopeMenu,children:f.jsx(jn,{present:n||s.open,children:f.jsx(dc.Slot,{scope:e.__scopeMenu,children:f.jsx(l0,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:c,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:he(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:he(e.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:he(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),p=DH[o.dir].includes(u.key);d&&p&&(s.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});Gk.displayName=Hk;function Kk(e){return e?"open":"closed"}function sf(e){return e==="indeterminate"}function d0(e){return sf(e)?"indeterminate":e?"checked":"unchecked"}function GH(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function KH(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function qH(e,t,r){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=r?e.indexOf(r):-1;let o=KH(e,Math.max(s,0));i.length===1&&(o=o.filter(c=>c!==r));const l=o.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function QH(e,t){const{x:r,y:n}=e;let i=!1;for(let s=0,o=t.length-1;sn!=u>n&&r<(c-a)*(n-l)/(u-l)+a&&(i=!i)}return i}function YH(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return QH(r,t)}function fc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ZH=Ak,XH=s0,JH=kk,eG=Rk,tG=c0,rG=jk,nG=Np,iG=Mk,sG=_k,oG=Fk,aG=$k,lG=Bk,cG=Uk,uG=Wk,dG=Gk,f0="DropdownMenu",[fG,q7]=Aa(f0,[Pk]),Qt=Pk(),[pG,qk]=fG(f0),Qk=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=Qt(t),c=m.useRef(null),[u=!1,d]=Ac({prop:i,defaultProp:s,onChange:o});return f.jsx(pG,{scope:t,triggerId:Is(),triggerRef:c,contentId:Is(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(p=>!p),[d]),modal:a,children:f.jsx(ZH,{...l,open:u,onOpenChange:d,dir:n,modal:a,children:r})})};Qk.displayName=f0;var Yk="DropdownMenuTrigger",Zk=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,s=qk(Yk,r),o=Qt(r);return f.jsx(XH,{asChild:!0,...o,children:f.jsx(We.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...i,ref:Gf(t,s.triggerRef),onPointerDown:he(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:he(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});Zk.displayName=Yk;var hG="DropdownMenuPortal",Xk=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Qt(t);return f.jsx(JH,{...n,...r})};Xk.displayName=hG;var Jk="DropdownMenuContent",eR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=qk(Jk,r),s=Qt(r),o=m.useRef(!1);return f.jsx(eG,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...n,ref:t,onCloseAutoFocus:he(e.onCloseAutoFocus,a=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:he(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});eR.displayName=Jk;var mG="DropdownMenuGroup",gG=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Qt(r);return f.jsx(tG,{...i,...n,ref:t})});gG.displayName=mG;var vG="DropdownMenuLabel",tR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Qt(r);return f.jsx(rG,{...i,...n,ref:t})});tR.displayName=vG;var yG="DropdownMenuItem",rR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Qt(r);return f.jsx(nG,{...i,...n,ref:t})});rR.displayName=yG;var xG="DropdownMenuCheckboxItem",nR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Qt(r);return f.jsx(iG,{...i,...n,ref:t})});nR.displayName=xG;var wG="DropdownMenuRadioGroup",bG=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Qt(r);return f.jsx(sG,{...i,...n,ref:t})});bG.displayName=wG;var SG="DropdownMenuRadioItem",iR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Qt(r);return f.jsx(oG,{...i,...n,ref:t})});iR.displayName=SG;var CG="DropdownMenuItemIndicator",sR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Qt(r);return f.jsx(aG,{...i,...n,ref:t})});sR.displayName=CG;var EG="DropdownMenuSeparator",oR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Qt(r);return f.jsx(lG,{...i,...n,ref:t})});oR.displayName=EG;var TG="DropdownMenuArrow",PG=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Qt(r);return f.jsx(cG,{...i,...n,ref:t})});PG.displayName=TG;var DG="DropdownMenuSubTrigger",aR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Qt(r);return f.jsx(uG,{...i,...n,ref:t})});aR.displayName=DG;var AG="DropdownMenuSubContent",lR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=Qt(r);return f.jsx(dG,{...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)"}})});lR.displayName=AG;var NG=Qk,kG=Zk,RG=Xk,cR=eR,uR=tR,dR=rR,fR=nR,pR=iR,hR=sR,mR=oR,gR=aR,vR=lR;const jG=NG,IG=kG,MG=m.forwardRef(({className:e,inset:t,children:r,...n},i)=>f.jsxs(gR,{ref:i,className:Ce("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,f.jsx(tL,{className:"ml-auto h-4 w-4"})]}));MG.displayName=gR.displayName;const OG=m.forwardRef(({className:e,...t},r)=>f.jsx(vR,{ref:r,className:Ce("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}));OG.displayName=vR.displayName;const yR=m.forwardRef(({className:e,sideOffset:t=4,...r},n)=>f.jsx(RG,{children:f.jsx(cR,{ref:n,sideOffset:t,className:Ce("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})}));yR.displayName=cR.displayName;const xR=m.forwardRef(({className:e,inset:t,...r},n)=>f.jsx(dR,{ref:n,className:Ce("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}));xR.displayName=dR.displayName;const _G=m.forwardRef(({className:e,children:t,checked:r,...n},i)=>f.jsxs(fR,{ref:i,className:Ce("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:[f.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(hR,{children:f.jsx(Kn,{className:"h-4 w-4"})})}),t]}));_G.displayName=fR.displayName;const LG=m.forwardRef(({className:e,children:t,...r},n)=>f.jsxs(pR,{ref:n,className:Ce("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:[f.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(hR,{children:f.jsx(nL,{className:"h-2 w-2 fill-current"})})}),t]}));LG.displayName=pR.displayName;const FG=m.forwardRef(({className:e,inset:t,...r},n)=>f.jsx(uR,{ref:n,className:Ce("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));FG.displayName=uR.displayName;const VG=m.forwardRef(({className:e,...t},r)=>f.jsx(mR,{ref:r,className:Ce("-mx-1 my-1 h-px bg-muted",e),...t}));VG.displayName=mR.displayName;var Yc=e=>e.type==="checkbox",bs=e=>e instanceof Date,zt=e=>e==null;const wR=e=>typeof e=="object";var mt=e=>!zt(e)&&!Array.isArray(e)&&wR(e)&&!bs(e),bR=e=>mt(e)&&e.target?Yc(e.target)?e.target.checked:e.target.value:e,$G=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,SR=(e,t)=>e.has($G(t)),BG=e=>{const t=e.constructor&&e.constructor.prototype;return mt(t)&&t.hasOwnProperty("isPrototypeOf")},p0=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Zt(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(!(p0&&(e instanceof Blob||e instanceof FileList))&&(r||mt(e)))if(t=r?[]:{},!r&&!BG(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Zt(e[n]));else return e;return t}var kp=e=>Array.isArray(e)?e.filter(Boolean):[],ut=e=>e===void 0,Z=(e,t,r)=>{if(!t||!mt(e))return r;const n=kp(t.split(/[,[\].]+?/)).reduce((i,s)=>zt(i)?i:i[s],e);return ut(n)||n===e?ut(e[t])?r:e[t]:n},Nr=e=>typeof e=="boolean",h0=e=>/^\w*$/.test(e),CR=e=>kp(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Be=(e,t,r)=>{let n=-1;const i=h0(t)?[t]:CR(t),s=i.length,o=s-1;for(;++nee.useContext(ER),UG=e=>{const{children:t,...r}=e;return ee.createElement(ER.Provider,{value:r},t)};var TR=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const o=s;return t._proxyFormState[o]!==Qr.all&&(t._proxyFormState[o]=!n||Qr.all),r&&(r[o]=!0),e[o]}});return i},er=e=>mt(e)&&!Object.keys(e).length,PR=(e,t,r,n)=>{r(e);const{name:i,...s}=e;return er(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(o=>t[o]===(!n||Qr.all))},Rl=e=>Array.isArray(e)?e:[e],DR=(e,t,r)=>!e||!t||e===t||Rl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function m0(e){const t=ee.useRef(e);t.current=e,ee.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function zG(e){const t=Rp(),{control:r=t.control,disabled:n,name:i,exact:s}=e||{},[o,a]=ee.useState(r._formState),l=ee.useRef(!0),c=ee.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=ee.useRef(i);return u.current=i,m0({disabled:n,next:d=>l.current&&DR(u.current,d.name,s)&&PR(d,c.current,r._updateFormState)&&a({...r._formState,...d}),subject:r._subjects.state}),ee.useEffect(()=>(l.current=!0,c.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),TR(o,r,c.current,!1)}var wn=e=>typeof e=="string",AR=(e,t,r,n,i)=>wn(e)?(n&&t.watch.add(e),Z(r,e,i)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),Z(r,s))):(n&&(t.watchAll=!0),r);function WG(e){const t=Rp(),{control:r=t.control,name:n,defaultValue:i,disabled:s,exact:o}=e||{},a=ee.useRef(n);a.current=n,m0({disabled:s,subject:r._subjects.values,next:u=>{DR(a.current,u.name,o)&&c(Zt(AR(a.current,r._names,u.values||r._formValues,!1,i)))}});const[l,c]=ee.useState(r._getWatch(n,i));return ee.useEffect(()=>r._removeUnmounted()),l}function HG(e){const t=Rp(),{name:r,disabled:n,control:i=t.control,shouldUnregister:s}=e,o=SR(i._names.array,r),a=WG({control:i,name:r,defaultValue:Z(i._formValues,r,Z(i._defaultValues,r,e.defaultValue)),exact:!0}),l=zG({control:i,name:r,exact:!0}),c=ee.useRef(i.register(r,{...e.rules,value:a,...Nr(e.disabled)?{disabled:e.disabled}:{}}));return ee.useEffect(()=>{const u=i._options.shouldUnregister||s,d=(p,h)=>{const g=Z(i._fields,p);g&&g._f&&(g._f.mount=h)};if(d(r,!0),u){const p=Zt(Z(i._options.defaultValues,r));Be(i._defaultValues,r,p),ut(Z(i._formValues,r))&&Be(i._formValues,r,p)}return()=>{(o?u&&!i._state.action:u)?i.unregister(r):d(r,!1)}},[r,i,o,s]),ee.useEffect(()=>{Z(i._fields,r)&&i._updateDisabledField({disabled:n,fields:i._fields,name:r,value:Z(i._fields,r)._f.value})},[n,r,i]),{field:{name:r,value:a,...Nr(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:ee.useCallback(u=>c.current.onChange({target:{value:bR(u),name:r},type:of.CHANGE}),[r]),onBlur:ee.useCallback(()=>c.current.onBlur({target:{value:Z(i._formValues,r),name:r},type:of.BLUR}),[r,i]),ref:ee.useCallback(u=>{const d=Z(i._fields,r);d&&u&&(d._f.ref={focus:()=>u.focus(),select:()=>u.select(),setCustomValidity:p=>u.setCustomValidity(p),reportValidity:()=>u.reportValidity()})},[i._fields,r])},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Z(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!Z(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Z(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Z(l.validatingFields,r)},error:{enumerable:!0,get:()=>Z(l.errors,r)}})}}const GG=e=>e.render(HG(e));var NR=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},V1=e=>({isOnSubmit:!e||e===Qr.onSubmit,isOnBlur:e===Qr.onBlur,isOnChange:e===Qr.onChange,isOnAll:e===Qr.all,isOnTouch:e===Qr.onTouched}),$1=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const jl=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const s=Z(e,i);if(s){const{_f:o,...a}=s;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(jl(a,t))break}else if(mt(a)&&jl(a,t))break}}};var KG=(e,t,r)=>{const n=Rl(Z(e,r));return Be(n,"root",t[r]),Be(e,r,n),e},g0=e=>e.type==="file",Wn=e=>typeof e=="function",af=e=>{if(!p0)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},ad=e=>wn(e),v0=e=>e.type==="radio",lf=e=>e instanceof RegExp;const B1={value:!1,isValid:!1},U1={value:!0,isValid:!0};var kR=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!ut(e[0].attributes.value)?ut(e[0].value)||e[0].value===""?U1:{value:e[0].value,isValid:!0}:U1:B1}return B1};const z1={isValid:!1,value:null};var RR=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,z1):z1;function W1(e,t,r="validate"){if(ad(e)||Array.isArray(e)&&e.every(ad)||Nr(e)&&!e)return{type:r,message:ad(e)?e:"",ref:t}}var ao=e=>mt(e)&&!lf(e)?e:{value:e,message:""},H1=async(e,t,r,n,i)=>{const{ref:s,refs:o,required:a,maxLength:l,minLength:c,min:u,max:d,pattern:p,validate:h,name:g,valueAsNumber:v,mount:w,disabled:x}=e._f,y=Z(t,g);if(!w||x)return{};const b=o?o[0]:s,S=V=>{n&&b.reportValidity&&(b.setCustomValidity(Nr(V)?"":V||""),b.reportValidity())},C={},D=v0(s),N=Yc(s),k=D||N,R=(v||g0(s))&&ut(s.value)&&ut(y)||af(s)&&s.value===""||y===""||Array.isArray(y)&&!y.length,M=NR.bind(null,g,r,C),W=(V,q,B,te=_n.maxLength,J=_n.minLength)=>{const X=V?q:B;C[g]={type:V?te:J,message:X,ref:s,...M(V?te:J,X)}};if(i?!Array.isArray(y)||!y.length:a&&(!k&&(R||zt(y))||Nr(y)&&!y||N&&!kR(o).isValid||D&&!RR(o).isValid)){const{value:V,message:q}=ad(a)?{value:!!a,message:a}:ao(a);if(V&&(C[g]={type:_n.required,message:q,ref:b,...M(_n.required,q)},!r))return S(q),C}if(!R&&(!zt(u)||!zt(d))){let V,q;const B=ao(d),te=ao(u);if(!zt(y)&&!isNaN(y)){const J=s.valueAsNumber||y&&+y;zt(B.value)||(V=J>B.value),zt(te.value)||(q=Jnew Date(new Date().toDateString()+" "+A),F=s.type=="time",$=s.type=="week";wn(B.value)&&y&&(V=F?X(y)>X(B.value):$?y>B.value:J>new Date(B.value)),wn(te.value)&&y&&(q=F?X(y)+V.value,te=!zt(q.value)&&y.length<+q.value;if((B||te)&&(W(B,V.message,q.message),!r))return S(C[g].message),C}if(p&&!R&&wn(y)){const{value:V,message:q}=ao(p);if(lf(V)&&!y.match(V)&&(C[g]={type:_n.pattern,message:q,ref:s,...M(_n.pattern,q)},!r))return S(q),C}if(h){if(Wn(h)){const V=await h(y,t),q=W1(V,b);if(q&&(C[g]={...q,...M(_n.validate,q.message)},!r))return S(q.message),C}else if(mt(h)){let V={};for(const q in h){if(!er(V)&&!r)break;const B=W1(await h[q](y,t),b,q);B&&(V={...B,...M(q,B.message)},S(B.message),r&&(C[g]=V))}if(!er(V)&&(C[g]={ref:b,...V},!r))return C}}return S(!0),C};function qG(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 s of e)s.next&&s.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(s=>s!==i)}}),unsubscribe:()=>{e=[]}}},hv=e=>zt(e)||!wR(e);function wi(e,t){if(hv(e)||hv(t))return e===t;if(bs(e)&&bs(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 s=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const o=t[i];if(bs(s)&&bs(o)||mt(s)&&mt(o)||Array.isArray(s)&&Array.isArray(o)?!wi(s,o):s!==o)return!1}}return!0}var jR=e=>e.type==="select-multiple",YG=e=>v0(e)||Yc(e),mm=e=>af(e)&&e.isConnected,IR=e=>{for(const t in e)if(Wn(e[t]))return!0;return!1};function cf(e,t={}){const r=Array.isArray(e);if(mt(e)||r)for(const n in e)Array.isArray(e[n])||mt(e[n])&&!IR(e[n])?(t[n]=Array.isArray(e[n])?[]:{},cf(e[n],t[n])):zt(e[n])||(t[n]=!0);return t}function MR(e,t,r){const n=Array.isArray(e);if(mt(e)||n)for(const i in e)Array.isArray(e[i])||mt(e[i])&&!IR(e[i])?ut(t)||hv(r[i])?r[i]=Array.isArray(e[i])?cf(e[i],[]):{...cf(e[i])}:MR(e[i],zt(t)?{}:t[i],r[i]):r[i]=!wi(e[i],t[i]);return r}var Xa=(e,t)=>MR(e,t,cf(t)),OR=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>ut(e)?e:t?e===""?NaN:e&&+e:r&&wn(e)?new Date(e):n?n(e):e;function gm(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return g0(t)?t.files:v0(t)?RR(e.refs).value:jR(t)?[...t.selectedOptions].map(({value:r})=>r):Yc(t)?kR(e.refs).value:OR(ut(t.value)?e.ref.value:t.value,e)}var ZG=(e,t,r,n)=>{const i={};for(const s of e){const o=Z(t,s);o&&Be(i,s,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Ja=e=>ut(e)?e:lf(e)?e.source:mt(e)?lf(e.value)?e.value.source:e.value:e;const G1="AsyncFunction";var XG=e=>(!e||!e.validate)&&!!(Wn(e.validate)&&e.validate.constructor.name===G1||mt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===G1)),JG=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function K1(e,t,r){const n=Z(e,r);if(n||h0(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const s=i.join("."),o=Z(t,s),a=Z(e,s);if(o&&!Array.isArray(o)&&r!==s)return{name:r};if(a&&a.type)return{name:s,error:a};i.pop()}return{name:r}}var e9=(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,t9=(e,t)=>!kp(Z(e,t)).length&&vt(e,t);const r9={mode:Qr.onSubmit,reValidateMode:Qr.onChange,shouldFocusError:!0};function n9(e={}){let t={...r9,...e},r={submitCount:0,isDirty:!1,isLoading:Wn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=mt(t.defaultValues)||mt(t.values)?Zt(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Zt(i),o={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:hm(),array:hm(),state:hm()},p=V1(t.mode),h=V1(t.reValidateMode),g=t.criteriaMode===Qr.all,v=E=>T=>{clearTimeout(c),c=setTimeout(E,T)},w=async E=>{if(!e.disabled&&(u.isValid||E)){const T=t.resolver?er((await k()).errors):await M(n,!0);T!==r.isValid&&d.state.next({isValid:T})}},x=(E,T)=>{!e.disabled&&(u.isValidating||u.validatingFields)&&((E||Array.from(a.mount)).forEach(I=>{I&&(T?Be(r.validatingFields,I,T):vt(r.validatingFields,I))}),d.state.next({validatingFields:r.validatingFields,isValidating:!er(r.validatingFields)}))},y=(E,T=[],I,O,L=!0,_=!0)=>{if(O&&I&&!e.disabled){if(o.action=!0,_&&Array.isArray(Z(n,E))){const U=I(Z(n,E),O.argA,O.argB);L&&Be(n,E,U)}if(_&&Array.isArray(Z(r.errors,E))){const U=I(Z(r.errors,E),O.argA,O.argB);L&&Be(r.errors,E,U),t9(r.errors,E)}if(u.touchedFields&&_&&Array.isArray(Z(r.touchedFields,E))){const U=I(Z(r.touchedFields,E),O.argA,O.argB);L&&Be(r.touchedFields,E,U)}u.dirtyFields&&(r.dirtyFields=Xa(i,s)),d.state.next({name:E,isDirty:V(E,T),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Be(s,E,T)},b=(E,T)=>{Be(r.errors,E,T),d.state.next({errors:r.errors})},S=E=>{r.errors=E,d.state.next({errors:r.errors,isValid:!1})},C=(E,T,I,O)=>{const L=Z(n,E);if(L){const _=Z(s,E,ut(I)?Z(i,E):I);ut(_)||O&&O.defaultChecked||T?Be(s,E,T?_:gm(L._f)):te(E,_),o.mount&&w()}},D=(E,T,I,O,L)=>{let _=!1,U=!1;const G={name:E};if(!e.disabled){const ce=!!(Z(n,E)&&Z(n,E)._f&&Z(n,E)._f.disabled);if(!I||O){u.isDirty&&(U=r.isDirty,r.isDirty=G.isDirty=V(),_=U!==G.isDirty);const me=ce||wi(Z(i,E),T);U=!!(!ce&&Z(r.dirtyFields,E)),me||ce?vt(r.dirtyFields,E):Be(r.dirtyFields,E,!0),G.dirtyFields=r.dirtyFields,_=_||u.dirtyFields&&U!==!me}if(I){const me=Z(r.touchedFields,E);me||(Be(r.touchedFields,E,I),G.touchedFields=r.touchedFields,_=_||u.touchedFields&&me!==I)}_&&L&&d.state.next(G)}return _?G:{}},N=(E,T,I,O)=>{const L=Z(r.errors,E),_=u.isValid&&Nr(T)&&r.isValid!==T;if(e.delayError&&I?(l=v(()=>b(E,I)),l(e.delayError)):(clearTimeout(c),l=null,I?Be(r.errors,E,I):vt(r.errors,E)),(I?!wi(L,I):L)||!er(O)||_){const U={...O,..._&&Nr(T)?{isValid:T}:{},errors:r.errors,name:E};r={...r,...U},d.state.next(U)}},k=async E=>{x(E,!0);const T=await t.resolver(s,t.context,ZG(E||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return x(E),T},R=async E=>{const{errors:T}=await k(E);if(E)for(const I of E){const O=Z(T,I);O?Be(r.errors,I,O):vt(r.errors,I)}else r.errors=T;return T},M=async(E,T,I={valid:!0})=>{for(const O in E){const L=E[O];if(L){const{_f:_,...U}=L;if(_){const G=a.array.has(_.name),ce=L._f&&XG(L._f);ce&&u.validatingFields&&x([O],!0);const me=await H1(L,s,g,t.shouldUseNativeValidation&&!T,G);if(ce&&u.validatingFields&&x([O]),me[_.name]&&(I.valid=!1,T))break;!T&&(Z(me,_.name)?G?KG(r.errors,me,_.name):Be(r.errors,_.name,me[_.name]):vt(r.errors,_.name))}!er(U)&&await M(U,T,I)}}return I.valid},W=()=>{for(const E of a.unMount){const T=Z(n,E);T&&(T._f.refs?T._f.refs.every(I=>!mm(I)):!mm(T._f.ref))&&ue(E)}a.unMount=new Set},V=(E,T)=>!e.disabled&&(E&&T&&Be(s,E,T),!wi(P(),i)),q=(E,T,I)=>AR(E,a,{...o.mount?s:ut(T)?i:wn(E)?{[E]:T}:T},I,T),B=E=>kp(Z(o.mount?s:i,E,e.shouldUnregister?Z(i,E,[]):[])),te=(E,T,I={})=>{const O=Z(n,E);let L=T;if(O){const _=O._f;_&&(!_.disabled&&Be(s,E,OR(T,_)),L=af(_.ref)&&zt(T)?"":T,jR(_.ref)?[..._.ref.options].forEach(U=>U.selected=L.includes(U.value)):_.refs?Yc(_.ref)?_.refs.length>1?_.refs.forEach(U=>(!U.defaultChecked||!U.disabled)&&(U.checked=Array.isArray(L)?!!L.find(G=>G===U.value):L===U.value)):_.refs[0]&&(_.refs[0].checked=!!L):_.refs.forEach(U=>U.checked=U.value===L):g0(_.ref)?_.ref.value="":(_.ref.value=L,_.ref.type||d.values.next({name:E,values:{...s}})))}(I.shouldDirty||I.shouldTouch)&&D(E,L,I.shouldTouch,I.shouldDirty,!0),I.shouldValidate&&A(E)},J=(E,T,I)=>{for(const O in T){const L=T[O],_=`${E}.${O}`,U=Z(n,_);(a.array.has(E)||mt(L)||U&&!U._f)&&!bs(L)?J(_,L,I):te(_,L,I)}},X=(E,T,I={})=>{const O=Z(n,E),L=a.array.has(E),_=Zt(T);Be(s,E,_),L?(d.array.next({name:E,values:{...s}}),(u.isDirty||u.dirtyFields)&&I.shouldDirty&&d.state.next({name:E,dirtyFields:Xa(i,s),isDirty:V(E,_)})):O&&!O._f&&!zt(_)?J(E,_,I):te(E,_,I),$1(E,a)&&d.state.next({...r}),d.values.next({name:o.mount?E:void 0,values:{...s}})},F=async E=>{o.mount=!0;const T=E.target;let I=T.name,O=!0;const L=Z(n,I),_=()=>T.type?gm(L._f):bR(E),U=G=>{O=Number.isNaN(G)||bs(G)&&isNaN(G.getTime())||wi(G,Z(s,I,G))};if(L){let G,ce;const me=_(),$e=E.type===of.BLUR||E.type===of.FOCUS_OUT,ft=!JG(L._f)&&!t.resolver&&!Z(r.errors,I)&&!L._f.deps||e9($e,Z(r.touchedFields,I),r.isSubmitted,h,p),qe=$1(I,a,$e);Be(s,I,me),$e?(L._f.onBlur&&L._f.onBlur(E),l&&l(0)):L._f.onChange&&L._f.onChange(E);const ar=D(I,me,$e,!1),ci=!er(ar)||qe;if(!$e&&d.values.next({name:I,type:E.type,values:{...s}}),ft)return u.isValid&&(e.mode==="onBlur"?$e&&w():w()),ci&&d.state.next({name:I,...qe?{}:ar});if(!$e&&qe&&d.state.next({...r}),t.resolver){const{errors:eo}=await k([I]);if(U(me),O){const Wj=K1(r.errors,n,I),k0=K1(eo,n,Wj.name||I);G=k0.error,I=k0.name,ce=er(eo)}}else x([I],!0),G=(await H1(L,s,g,t.shouldUseNativeValidation))[I],x([I]),U(me),O&&(G?ce=!1:u.isValid&&(ce=await M(n,!0)));O&&(L._f.deps&&A(L._f.deps),N(I,ce,G,ar))}},$=(E,T)=>{if(Z(r.errors,T)&&E.focus)return E.focus(),1},A=async(E,T={})=>{let I,O;const L=Rl(E);if(t.resolver){const _=await R(ut(E)?E:L);I=er(_),O=E?!L.some(U=>Z(_,U)):I}else E?(O=(await Promise.all(L.map(async _=>{const U=Z(n,_);return await M(U&&U._f?{[_]:U}:U)}))).every(Boolean),!(!O&&!r.isValid)&&w()):O=I=await M(n);return d.state.next({...!wn(E)||u.isValid&&I!==r.isValid?{}:{name:E},...t.resolver||!E?{isValid:I}:{},errors:r.errors}),T.shouldFocus&&!O&&jl(n,$,E?L:a.mount),O},P=E=>{const T={...o.mount?s:i};return ut(E)?T:wn(E)?Z(T,E):E.map(I=>Z(T,I))},H=(E,T)=>({invalid:!!Z((T||r).errors,E),isDirty:!!Z((T||r).dirtyFields,E),error:Z((T||r).errors,E),isValidating:!!Z(r.validatingFields,E),isTouched:!!Z((T||r).touchedFields,E)}),ne=E=>{E&&Rl(E).forEach(T=>vt(r.errors,T)),d.state.next({errors:E?r.errors:{}})},ae=(E,T,I)=>{const O=(Z(n,E,{_f:{}})._f||{}).ref,L=Z(r.errors,E)||{},{ref:_,message:U,type:G,...ce}=L;Be(r.errors,E,{...ce,...T,ref:O}),d.state.next({name:E,errors:r.errors,isValid:!1}),I&&I.shouldFocus&&O&&O.focus&&O.focus()},de=(E,T)=>Wn(E)?d.values.subscribe({next:I=>E(q(void 0,T),I)}):q(E,T,!0),ue=(E,T={})=>{for(const I of E?Rl(E):a.mount)a.mount.delete(I),a.array.delete(I),T.keepValue||(vt(n,I),vt(s,I)),!T.keepError&&vt(r.errors,I),!T.keepDirty&&vt(r.dirtyFields,I),!T.keepTouched&&vt(r.touchedFields,I),!T.keepIsValidating&&vt(r.validatingFields,I),!t.shouldUnregister&&!T.keepDefaultValue&&vt(i,I);d.values.next({values:{...s}}),d.state.next({...r,...T.keepDirty?{isDirty:V()}:{}}),!T.keepIsValid&&w()},re=({disabled:E,name:T,field:I,fields:O,value:L})=>{if(Nr(E)&&o.mount||E){const _=E?void 0:ut(L)?gm(I?I._f:Z(O,T)._f):L;Be(s,T,_),D(T,_,!1,!1,!0)}},ge=(E,T={})=>{let I=Z(n,E);const O=Nr(T.disabled)||Nr(e.disabled);return Be(n,E,{...I||{},_f:{...I&&I._f?I._f:{ref:{name:E}},name:E,mount:!0,...T}}),a.mount.add(E),I?re({field:I,disabled:Nr(T.disabled)?T.disabled:e.disabled,name:E,value:T.value}):C(E,!0,T.value),{...O?{disabled:T.disabled||e.disabled}:{},...t.progressive?{required:!!T.required,min:Ja(T.min),max:Ja(T.max),minLength:Ja(T.minLength),maxLength:Ja(T.maxLength),pattern:Ja(T.pattern)}:{},name:E,onChange:F,onBlur:F,ref:L=>{if(L){ge(E,T),I=Z(n,E);const _=ut(L.value)&&L.querySelectorAll&&L.querySelectorAll("input,select,textarea")[0]||L,U=YG(_),G=I._f.refs||[];if(U?G.find(ce=>ce===_):_===I._f.ref)return;Be(n,E,{_f:{...I._f,...U?{refs:[...G.filter(mm),_,...Array.isArray(Z(i,E))?[{}]:[]],ref:{type:_.type,name:E}}:{ref:_}}}),C(E,!1,void 0,_)}else I=Z(n,E,{}),I._f&&(I._f.mount=!1),(t.shouldUnregister||T.shouldUnregister)&&!(SR(a.array,E)&&o.action)&&a.unMount.add(E)}}},we=()=>t.shouldFocusError&&jl(n,$,a.mount),ke=E=>{Nr(E)&&(d.state.next({disabled:E}),jl(n,(T,I)=>{const O=Z(n,I);O&&(T.disabled=O._f.disabled||E,Array.isArray(O._f.refs)&&O._f.refs.forEach(L=>{L.disabled=O._f.disabled||E}))},0,!1))},Ae=(E,T)=>async I=>{let O;I&&(I.preventDefault&&I.preventDefault(),I.persist&&I.persist());let L=Zt(s);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:_,values:U}=await k();r.errors=_,L=U}else await M(n);if(vt(r.errors,"root"),er(r.errors)){d.state.next({errors:{}});try{await E(L,I)}catch(_){O=_}}else T&&await T({...r.errors},I),we(),setTimeout(we);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:er(r.errors)&&!O,submitCount:r.submitCount+1,errors:r.errors}),O)throw O},Fe=(E,T={})=>{Z(n,E)&&(ut(T.defaultValue)?X(E,Zt(Z(i,E))):(X(E,T.defaultValue),Be(i,E,Zt(T.defaultValue))),T.keepTouched||vt(r.touchedFields,E),T.keepDirty||(vt(r.dirtyFields,E),r.isDirty=T.defaultValue?V(E,Zt(Z(i,E))):V()),T.keepError||(vt(r.errors,E),u.isValid&&w()),d.state.next({...r}))},Ve=(E,T={})=>{const I=E?Zt(E):i,O=Zt(I),L=er(E),_=L?i:O;if(T.keepDefaultValues||(i=I),!T.keepValues){if(T.keepDirtyValues){const U=new Set([...a.mount,...Object.keys(Xa(i,s))]);for(const G of Array.from(U))Z(r.dirtyFields,G)?Be(_,G,Z(s,G)):X(G,Z(_,G))}else{if(p0&&ut(E))for(const U of a.mount){const G=Z(n,U);if(G&&G._f){const ce=Array.isArray(G._f.refs)?G._f.refs[0]:G._f.ref;if(af(ce)){const me=ce.closest("form");if(me){me.reset();break}}}}n={}}s=e.shouldUnregister?T.keepDefaultValues?Zt(i):{}:Zt(_),d.array.next({values:{..._}}),d.values.next({values:{..._}})}a={mount:T.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!u.isValid||!!T.keepIsValid||!!T.keepDirtyValues,o.watch=!!e.shouldUnregister,d.state.next({submitCount:T.keepSubmitCount?r.submitCount:0,isDirty:L?!1:T.keepDirty?r.isDirty:!!(T.keepDefaultValues&&!wi(E,i)),isSubmitted:T.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:L?{}:T.keepDirtyValues?T.keepDefaultValues&&s?Xa(i,s):r.dirtyFields:T.keepDefaultValues&&E?Xa(i,E):T.keepDirty?r.dirtyFields:{},touchedFields:T.keepTouched?r.touchedFields:{},errors:T.keepErrors?r.errors:{},isSubmitSuccessful:T.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Ee=(E,T)=>Ve(Wn(E)?E(s):E,T);return{control:{register:ge,unregister:ue,getFieldState:H,handleSubmit:Ae,setError:ae,_executeSchema:k,_getWatch:q,_getDirty:V,_updateValid:w,_removeUnmounted:W,_updateFieldArray:y,_updateDisabledField:re,_getFieldArray:B,_reset:Ve,_resetDefaultValues:()=>Wn(t.defaultValues)&&t.defaultValues().then(E=>{Ee(E,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:E=>{r={...r,...E}},_disableForm:ke,_subjects:d,_proxyFormState:u,_setErrors:S,get _fields(){return n},get _formValues(){return s},get _state(){return o},set _state(E){o=E},get _defaultValues(){return i},get _names(){return a},set _names(E){a=E},get _formState(){return r},set _formState(E){r=E},get _options(){return t},set _options(E){t={...t,...E}}},trigger:A,register:ge,handleSubmit:Ae,watch:de,setValue:X,getValues:P,reset:Ee,resetField:Fe,clearErrors:ne,unregister:ue,setError:ae,setFocus:(E,T={})=>{const I=Z(n,E),O=I&&I._f;if(O){const L=O.refs?O.refs[0]:O.ref;L.focus&&(L.focus(),T.shouldSelect&&L.select())}},getFieldState:H}}function jp(e={}){const t=ee.useRef(),r=ee.useRef(),[n,i]=ee.useState({isDirty:!1,isValidating:!1,isLoading:Wn(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Wn(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...n9(e),formState:n});const s=t.current.control;return s._options=e,m0({subject:s._subjects.state,next:o=>{PR(o,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),ee.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),ee.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==n.isDirty&&s._subjects.state.next({isDirty:o})}},[s,n.isDirty]),ee.useEffect(()=>{e.values&&!wi(e.values,r.current)?(s._reset(e.values,s._options.resetOptions),r.current=e.values,i(o=>({...o}))):s._resetDefaultValues()},[e.values,s]),ee.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),ee.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),ee.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),ee.useEffect(()=>{t.current&&(t.current.watch=t.current.watch.bind({}))},[n]),t.current.formState=TR(n,s),t.current}const q1=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Z(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},_R=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?q1(n.ref,r,e):n.refs&&n.refs.forEach(i=>q1(i,r,e))}},i9=(e,t)=>{t.shouldUseNativeValidation&&_R(e,t);const r={};for(const n in e){const i=Z(t.fields,n),s=Object.assign(e[n]||{},{ref:i&&i.ref});if(s9(t.names||Object.keys(e),n)){const o=Object.assign({},Z(r,n));Be(o,"root",s),Be(r,n,o)}else Be(r,n,s)}return r},s9=(e,t)=>e.some(r=>r.startsWith(t+"."));var o9=function(e,t){for(var r={};e.length;){var n=e[0],i=n.code,s=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var a=n.unionErrors[0].errors[0];r[o]={message:a.message,type:a.code}}else r[o]={message:s,type:i};if("unionErrors"in n&&n.unionErrors.forEach(function(u){return u.errors.forEach(function(d){return e.push(d)})}),t){var l=r[o].types,c=l&&l[n.code];r[o]=NR(o,t,r,i,c?[].concat(c,n.message):n.message)}e.shift()}return r},Ip=function(e,t,r){return r===void 0&&(r={}),function(n,i,s){try{return Promise.resolve(function(o,a){try{var l=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(c){return s.shouldUseNativeValidation&&_R({},s),{errors:{},values:r.raw?n:c}})}catch(c){return a(c)}return l&&l.then?l.then(void 0,a):l}(0,function(o){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(o))return{values:{},errors:i9(o9(o.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw o}))}catch(o){return Promise.reject(o)}}},_e;(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 s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(_e||(_e={}));var Q1;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Q1||(Q1={}));const oe=_e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ms=e=>{switch(typeof e){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(e)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(e)?oe.array:e===null?oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?oe.promise:typeof Map<"u"&&e instanceof Map?oe.map:typeof Set<"u"&&e instanceof Set?oe.set:typeof Date<"u"&&e instanceof Date?oe.date:oe.object;default:return oe.unknown}},Q=_e.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 Fr 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(s){return s.message},n={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=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()}}Fr.create=e=>new Fr(e);const pc=(e,t)=>{let r;switch(e.code){case Q.invalid_type:e.received===oe.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Q.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,_e.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:r=`Unrecognized key(s) in object: ${_e.joinValues(e.keys,", ")}`;break;case Q.invalid_union:r="Invalid input";break;case Q.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${_e.joinValues(e.options)}`;break;case Q.invalid_enum_value:r=`Invalid enum value. Expected ${_e.joinValues(e.options)}, received '${e.received}'`;break;case Q.invalid_arguments:r="Invalid function arguments";break;case Q.invalid_return_type:r="Invalid function return type";break;case Q.invalid_date:r="Invalid date";break;case Q.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}"`:_e.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Q.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 Q.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 Q.custom:r="Invalid input";break;case Q.invalid_intersection_types:r="Intersection results could not be merged";break;case Q.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Q.not_finite:r="Number must be finite";break;default:r=t.defaultError,_e.assertNever(e)}return{message:r}};let a9=pc;function mv(){return a9}const gv=e=>{const{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const l=n.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:t,defaultError:a}).message;return{...i,path:s,message:a}};function ie(e,t){const r=mv(),n=gv({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===pc?void 0:pc].filter(i=>!!i)});e.common.issues.push(n)}class Gt{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 Te;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 s=await i.key,o=await i.value;n.push({key:s,value:o})}return Gt.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const i of r){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Te;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:t.value,value:n}}}const Te=Object.freeze({status:"aborted"}),cl=e=>({status:"dirty",value:e}),or=e=>({status:"valid",value:e}),Y1=e=>e.status==="aborted",Z1=e=>e.status==="dirty",uf=e=>e.status==="valid",df=e=>typeof Promise<"u"&&e instanceof Promise;function ff(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 LR(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 fe;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(fe||(fe={}));var ul,dl;class Rn{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 X1=(e,t)=>{if(uf(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 Fr(e.common.issues);return this._error=r,this._error}}};function Pe(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:(o,a)=>{var l,c;const{message:u}=e;return o.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??n)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??r)!==null&&c!==void 0?c:a.defaultError}},description:i}}class je{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 ms(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ms(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Gt,ctx:{common:t.parent.common,data:t.data,parsedType:ms(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(df(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:ms(t)},s=this._parseSync({data:t,path:i.path,parent:i});return X1(i,s)}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:ms(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(df(i)?i:Promise.resolve(i));return X1(n,s)}refine(t,r){const n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{const o=t(i),a=()=>s.addIssue({code:Q.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!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 oi({schema:this,typeName:Se.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Yn.create(this,this._def)}nullable(){return Ws.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nn.create(this,this._def)}promise(){return mc.create(this,this._def)}or(t){return mf.create([this,t],this._def)}and(t){return gf.create(this,t,this._def)}transform(t){return new oi({...Pe(this._def),schema:this,typeName:Se.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new bf({...Pe(this._def),innerType:this,defaultValue:r,typeName:Se.ZodDefault})}brand(){return new BR({typeName:Se.ZodBranded,type:this,...Pe(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Sf({...Pe(this._def),innerType:this,catchValue:r,typeName:Se.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Mp.create(this,t)}readonly(){return Cf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const l9=/^c[^\s-]{8,}$/i,c9=/^[0-9a-z]+$/,u9=/^[0-9A-HJKMNP-TV-Z]{26}$/,d9=/^[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,f9=/^[a-z0-9_-]{21}$/i,p9=/^[-+]?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)?)??$/,h9=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,m9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let vm;const g9=/^(?:(?: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])$/,v9=/^(([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})))$/,y9=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,FR="((\\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])))",x9=new RegExp(`^${FR}$`);function VR(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 w9(e){return new RegExp(`^${VR(e)}$`)}function b9(e){let t=`${FR}T${VR(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 S9(e,t){return!!((t==="v4"||!t)&&g9.test(e)||(t==="v6"||!t)&&v9.test(e))}class Hn extends je{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==oe.string){const s=this._getOrReturnCtx(t);return ie(s,{code:Q.invalid_type,expected:oe.string,received:s.parsedType}),Te}const n=new Gt;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.lengths.value&&(i=this._getOrReturnCtx(t,i),ie(i,{code:Q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.lengtht.test(i),{validation:r,code:Q.invalid_string,...fe.errToObj(n)})}_addCheck(t){return new Hn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...fe.errToObj(t)})}url(t){return this._addCheck({kind:"url",...fe.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...fe.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...fe.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...fe.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...fe.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...fe.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...fe.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...fe.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...fe.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,...fe.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,...fe.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...fe.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...fe.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...fe.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...fe.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...fe.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...fe.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...fe.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...fe.errToObj(r)})}nonempty(t){return this.min(1,fe.errToObj(t))}trim(){return new Hn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Hn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Hn({...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 Hn({checks:[],typeName:Se.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Pe(e)})};function C9(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class ya extends je{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)!==oe.number){const s=this._getOrReturnCtx(t);return ie(s,{code:Q.invalid_type,expected:oe.number,received:s.parsedType}),Te}let n;const i=new Gt;for(const s of this._def.checks)s.kind==="int"?_e.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:Q.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Q.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?C9(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Q.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ie(n,{code:Q.not_finite,message:s.message}),i.dirty()):_e.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,fe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,fe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,fe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,fe.toString(r))}setLimit(t,r,n,i){return new ya({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:fe.toString(i)}]})}_addCheck(t){return new ya({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:fe.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:fe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:fe.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:fe.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:fe.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:fe.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"&&_e.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 ya({checks:[],typeName:Se.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Pe(e)});class xa extends je{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)!==oe.bigint){const s=this._getOrReturnCtx(t);return ie(s,{code:Q.invalid_type,expected:oe.bigint,received:s.parsedType}),Te}let n;const i=new Gt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Q.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ie(n,{code:Q.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):_e.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,fe.toString(r))}gt(t,r){return this.setLimit("min",t,!1,fe.toString(r))}lte(t,r){return this.setLimit("max",t,!0,fe.toString(r))}lt(t,r){return this.setLimit("max",t,!1,fe.toString(r))}setLimit(t,r,n,i){return new xa({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:fe.toString(i)}]})}_addCheck(t){return new xa({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:fe.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:fe.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:fe.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 xa({checks:[],typeName:Se.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Pe(e)})};class vv extends je{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==oe.boolean){const n=this._getOrReturnCtx(t);return ie(n,{code:Q.invalid_type,expected:oe.boolean,received:n.parsedType}),Te}return or(t.data)}}vv.create=e=>new vv({typeName:Se.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Pe(e)});class hc extends je{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==oe.date){const s=this._getOrReturnCtx(t);return ie(s,{code:Q.invalid_type,expected:oe.date,received:s.parsedType}),Te}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return ie(s,{code:Q.invalid_date}),Te}const n=new Gt;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()s.value&&(i=this._getOrReturnCtx(t,i),ie(i,{code:Q.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):_e.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new hc({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:fe.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:fe.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 hc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Se.ZodDate,...Pe(e)});class yv extends je{_parse(t){if(this._getType(t)!==oe.symbol){const n=this._getOrReturnCtx(t);return ie(n,{code:Q.invalid_type,expected:oe.symbol,received:n.parsedType}),Te}return or(t.data)}}yv.create=e=>new yv({typeName:Se.ZodSymbol,...Pe(e)});class pf extends je{_parse(t){if(this._getType(t)!==oe.undefined){const n=this._getOrReturnCtx(t);return ie(n,{code:Q.invalid_type,expected:oe.undefined,received:n.parsedType}),Te}return or(t.data)}}pf.create=e=>new pf({typeName:Se.ZodUndefined,...Pe(e)});class hf extends je{_parse(t){if(this._getType(t)!==oe.null){const n=this._getOrReturnCtx(t);return ie(n,{code:Q.invalid_type,expected:oe.null,received:n.parsedType}),Te}return or(t.data)}}hf.create=e=>new hf({typeName:Se.ZodNull,...Pe(e)});class xv extends je{constructor(){super(...arguments),this._any=!0}_parse(t){return or(t.data)}}xv.create=e=>new xv({typeName:Se.ZodAny,...Pe(e)});class Uo extends je{constructor(){super(...arguments),this._unknown=!0}_parse(t){return or(t.data)}}Uo.create=e=>new Uo({typeName:Se.ZodUnknown,...Pe(e)});class Ji extends je{_parse(t){const r=this._getOrReturnCtx(t);return ie(r,{code:Q.invalid_type,expected:oe.never,received:r.parsedType}),Te}}Ji.create=e=>new Ji({typeName:Se.ZodNever,...Pe(e)});class wv extends je{_parse(t){if(this._getType(t)!==oe.undefined){const n=this._getOrReturnCtx(t);return ie(n,{code:Q.invalid_type,expected:oe.void,received:n.parsedType}),Te}return or(t.data)}}wv.create=e=>new wv({typeName:Se.ZodVoid,...Pe(e)});class Nn extends je{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==oe.array)return ie(r,{code:Q.invalid_type,expected:oe.array,received:r.parsedType}),Te;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,a=r.data.lengthi.maxLength.value&&(ie(r,{code:Q.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((o,a)=>i.type._parseAsync(new Rn(r,o,r.path,a)))).then(o=>Gt.mergeArray(n,o));const s=[...r.data].map((o,a)=>i.type._parseSync(new Rn(r,o,r.path,a)));return Gt.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new Nn({...this._def,minLength:{value:t,message:fe.toString(r)}})}max(t,r){return new Nn({...this._def,maxLength:{value:t,message:fe.toString(r)}})}length(t,r){return new Nn({...this._def,exactLength:{value:t,message:fe.toString(r)}})}nonempty(t){return this.min(1,t)}}Nn.create=(e,t)=>new Nn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Se.ZodArray,...Pe(t)});function lo(e){if(e instanceof lt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Yn.create(lo(n))}return new lt({...e._def,shape:()=>t})}else return e instanceof Nn?new Nn({...e._def,type:lo(e.element)}):e instanceof Yn?Yn.create(lo(e.unwrap())):e instanceof Ws?Ws.create(lo(e.unwrap())):e instanceof si?si.create(e.items.map(t=>lo(t))):e}class lt extends je{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=_e.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==oe.object){const c=this._getOrReturnCtx(t);return ie(c,{code:Q.invalid_type,expected:oe.object,received:c.parsedType}),Te}const{status:n,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Ji&&this._def.unknownKeys==="strip"))for(const c in i.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const u=s[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Rn(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Ji){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(ie(i,{code:Q.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Rn(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,p=await u.value;c.push({key:d,value:p,alwaysSet:u.alwaysSet})}return c}).then(c=>Gt.mergeObjectSync(n,c)):Gt.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return fe.errToObj,new lt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,s,o,a;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=fe.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new lt({...this._def,unknownKeys:"strip"})}passthrough(){return new lt({...this._def,unknownKeys:"passthrough"})}extend(t){return new lt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new lt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Se.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new lt({...this._def,catchall:t})}pick(t){const r={};return _e.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new lt({...this._def,shape:()=>r})}omit(t){const r={};return _e.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new lt({...this._def,shape:()=>r})}deepPartial(){return lo(this)}partial(t){const r={};return _e.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}),new lt({...this._def,shape:()=>r})}required(t){const r={};return _e.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Yn;)s=s._def.innerType;r[n]=s}}),new lt({...this._def,shape:()=>r})}keyof(){return $R(_e.objectKeys(this.shape))}}lt.create=(e,t)=>new lt({shape:()=>e,unknownKeys:"strip",catchall:Ji.create(),typeName:Se.ZodObject,...Pe(t)});lt.strictCreate=(e,t)=>new lt({shape:()=>e,unknownKeys:"strict",catchall:Ji.create(),typeName:Se.ZodObject,...Pe(t)});lt.lazycreate=(e,t)=>new lt({shape:e,unknownKeys:"strip",catchall:Ji.create(),typeName:Se.ZodObject,...Pe(t)});class mf extends je{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Fr(a.ctx.common.issues));return ie(r,{code:Q.invalid_union,unionErrors:o}),Te}if(r.common.async)return Promise.all(n.map(async s=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of n){const c={...r,common:{...r.common,issues:[]},parent:null},u=l._parseSync({data:r.data,path:r.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Fr(l));return ie(r,{code:Q.invalid_union,unionErrors:a}),Te}}get options(){return this._def.options}}mf.create=(e,t)=>new mf({options:e,typeName:Se.ZodUnion,...Pe(t)});const Fn=e=>e instanceof yf?Fn(e.schema):e instanceof oi?Fn(e.innerType()):e instanceof xf?[e.value]:e instanceof zs?e.options:e instanceof wf?_e.objectValues(e.enum):e instanceof bf?Fn(e._def.innerType):e instanceof pf?[void 0]:e instanceof hf?[null]:e instanceof Yn?[void 0,...Fn(e.unwrap())]:e instanceof Ws?[null,...Fn(e.unwrap())]:e instanceof BR||e instanceof Cf?Fn(e.unwrap()):e instanceof Sf?Fn(e._def.innerType):[];class y0 extends je{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.object)return ie(r,{code:Q.invalid_type,expected:oe.object,received:r.parsedType}),Te;const n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ie(r,{code:Q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Te)}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 s of r){const o=Fn(s.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,s)}}return new y0({typeName:Se.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...Pe(n)})}}function bv(e,t){const r=ms(e),n=ms(t);if(e===t)return{valid:!0,data:e};if(r===oe.object&&n===oe.object){const i=_e.objectKeys(t),s=_e.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const l=bv(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===oe.array&&n===oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s{if(Y1(s)||Y1(o))return Te;const a=bv(s.value,o.value);return a.valid?((Z1(s)||Z1(o))&&r.dirty(),{status:r.value,value:a.data}):(ie(n,{code:Q.invalid_intersection_types}),Te)};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(([s,o])=>i(s,o)):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}))}}gf.create=(e,t,r)=>new gf({left:e,right:t,typeName:Se.ZodIntersection,...Pe(r)});class si extends je{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.array)return ie(n,{code:Q.invalid_type,expected:oe.array,received:n.parsedType}),Te;if(n.data.lengththis._def.items.length&&(ie(n,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new Rn(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Gt.mergeArray(r,o)):Gt.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new si({...this._def,rest:t})}}si.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new si({items:e,typeName:Se.ZodTuple,rest:null,...Pe(t)})};class vf extends je{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!==oe.object)return ie(n,{code:Q.invalid_type,expected:oe.object,received:n.parsedType}),Te;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in n.data)i.push({key:s._parse(new Rn(n,a,n.path,a)),value:o._parse(new Rn(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Gt.mergeObjectAsync(r,i):Gt.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof je?new vf({keyType:t,valueType:r,typeName:Se.ZodRecord,...Pe(n)}):new vf({keyType:Hn.create(),valueType:t,typeName:Se.ZodRecord,...Pe(r)})}}class Sv extends je{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!==oe.map)return ie(n,{code:Q.invalid_type,expected:oe.map,received:n.parsedType}),Te;const i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,l],c)=>({key:i._parse(new Rn(n,a,n.path,[c,"key"])),value:s._parse(new Rn(n,l,n.path,[c,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Te;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(c.value,u.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Te;(c.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(c.value,u.value)}return{status:r.value,value:a}}}}Sv.create=(e,t,r)=>new Sv({valueType:t,keyType:e,typeName:Se.ZodMap,...Pe(r)});class wa extends je{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==oe.set)return ie(n,{code:Q.invalid_type,expected:oe.set,received:n.parsedType}),Te;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(ie(n,{code:Q.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const s=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Te;u.status==="dirty"&&r.dirty(),c.add(u.value)}return{status:r.value,value:c}}const a=[...n.data.values()].map((l,c)=>s._parse(new Rn(n,l,n.path,c)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,r){return new wa({...this._def,minSize:{value:t,message:fe.toString(r)}})}max(t,r){return new wa({...this._def,maxSize:{value:t,message:fe.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}wa.create=(e,t)=>new wa({valueType:e,minSize:null,maxSize:null,typeName:Se.ZodSet,...Pe(t)});class Il extends je{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.function)return ie(r,{code:Q.invalid_type,expected:oe.function,received:r.parsedType}),Te;function n(a,l){return gv({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,mv(),pc].filter(c=>!!c),issueData:{code:Q.invalid_arguments,argumentsError:l}})}function i(a,l){return gv({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,mv(),pc].filter(c=>!!c),issueData:{code:Q.invalid_return_type,returnTypeError:l}})}const s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof mc){const a=this;return or(async function(...l){const c=new Fr([]),u=await a._def.args.parseAsync(l,s).catch(h=>{throw c.addIssue(n(l,h)),c}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(h=>{throw c.addIssue(i(d,h)),c})})}else{const a=this;return or(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new Fr([n(l,c.error)]);const u=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new Fr([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Il({...this._def,args:si.create(t).rest(Uo.create())})}returns(t){return new Il({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Il({args:t||si.create([]).rest(Uo.create()),returns:r||Uo.create(),typeName:Se.ZodFunction,...Pe(n)})}}class yf extends je{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})}}yf.create=(e,t)=>new yf({getter:e,typeName:Se.ZodLazy,...Pe(t)});class xf extends je{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ie(r,{received:r.data,code:Q.invalid_literal,expected:this._def.value}),Te}return{status:"valid",value:t.data}}get value(){return this._def.value}}xf.create=(e,t)=>new xf({value:e,typeName:Se.ZodLiteral,...Pe(t)});function $R(e,t){return new zs({values:e,typeName:Se.ZodEnum,...Pe(t)})}class zs extends je{constructor(){super(...arguments),ul.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ie(r,{expected:_e.joinValues(n),received:r.parsedType,code:Q.invalid_type}),Te}if(ff(this,ul)||LR(this,ul,new Set(this._def.values)),!ff(this,ul).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ie(r,{received:r.data,code:Q.invalid_enum_value,options:n}),Te}return or(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 zs.create(t,{...this._def,...r})}exclude(t,r=this._def){return zs.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}ul=new WeakMap;zs.create=$R;class wf extends je{constructor(){super(...arguments),dl.set(this,void 0)}_parse(t){const r=_e.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==oe.string&&n.parsedType!==oe.number){const i=_e.objectValues(r);return ie(n,{expected:_e.joinValues(i),received:n.parsedType,code:Q.invalid_type}),Te}if(ff(this,dl)||LR(this,dl,new Set(_e.getValidEnumValues(this._def.values))),!ff(this,dl).has(t.data)){const i=_e.objectValues(r);return ie(n,{received:n.data,code:Q.invalid_enum_value,options:i}),Te}return or(t.data)}get enum(){return this._def.values}}dl=new WeakMap;wf.create=(e,t)=>new wf({values:e,typeName:Se.ZodNativeEnum,...Pe(t)});class mc extends je{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==oe.promise&&r.common.async===!1)return ie(r,{code:Q.invalid_type,expected:oe.promise,received:r.parsedType}),Te;const n=r.parsedType===oe.promise?r.data:Promise.resolve(r.data);return or(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}mc.create=(e,t)=>new mc({type:e,typeName:Se.ZodPromise,...Pe(t)});class oi extends je{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{ie(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return Te;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Te:l.status==="dirty"||r.value==="dirty"?cl(l.value):l});{if(r.value==="aborted")return Te;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?Te:a.status==="dirty"||r.value==="dirty"?cl(a.value):a}}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);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 a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Te:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Te:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!uf(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>uf(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);_e.assertNever(i)}}oi.create=(e,t,r)=>new oi({schema:e,typeName:Se.ZodEffects,effect:t,...Pe(r)});oi.createWithPreprocess=(e,t,r)=>new oi({schema:t,effect:{type:"preprocess",transform:e},typeName:Se.ZodEffects,...Pe(r)});class Yn extends je{_parse(t){return this._getType(t)===oe.undefined?or(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Yn.create=(e,t)=>new Yn({innerType:e,typeName:Se.ZodOptional,...Pe(t)});class Ws extends je{_parse(t){return this._getType(t)===oe.null?or(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ws.create=(e,t)=>new Ws({innerType:e,typeName:Se.ZodNullable,...Pe(t)});class bf extends je{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===oe.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}bf.create=(e,t)=>new bf({innerType:e,typeName:Se.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Pe(t)});class Sf extends je{_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 df(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Fr(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Fr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Sf.create=(e,t)=>new Sf({innerType:e,typeName:Se.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Pe(t)});class Cv extends je{_parse(t){if(this._getType(t)!==oe.nan){const n=this._getOrReturnCtx(t);return ie(n,{code:Q.invalid_type,expected:oe.nan,received:n.parsedType}),Te}return{status:"valid",value:t.data}}}Cv.create=e=>new Cv({typeName:Se.ZodNaN,...Pe(e)});class BR extends je{_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 Mp extends je{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Te:s.status==="dirty"?(r.dirty(),cl(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Te: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 Mp({in:t,out:r,typeName:Se.ZodPipeline})}}class Cf extends je{_parse(t){const r=this._def.innerType._parse(t),n=i=>(uf(i)&&(i.value=Object.freeze(i.value)),i);return df(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}Cf.create=(e,t)=>new Cf({innerType:e,typeName:Se.ZodReadonly,...Pe(t)});lt.lazycreate;var Se;(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"})(Se||(Se={}));const bn=Hn.create;ya.create;Cv.create;xa.create;vv.create;hc.create;yv.create;pf.create;hf.create;xv.create;Uo.create;Ji.create;wv.create;Nn.create;const Op=lt.create;lt.strictCreate;mf.create;y0.create;gf.create;si.create;vf.create;Sv.create;wa.create;Il.create;yf.create;xf.create;zs.create;wf.create;mc.create;oi.create;Yn.create;Ws.create;oi.createWithPreprocess;Mp.create;var x0="Dialog",[UR,zR]=Aa(x0),[E9,un]=UR(x0),WR=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,u]=Ac({prop:n,defaultProp:i,onChange:s});return f.jsx(E9,{scope:t,triggerRef:a,contentRef:l,contentId:Is(),titleId:Is(),descriptionId:Is(),open:c,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(d=>!d),[u]),modal:o,children:r})};WR.displayName=x0;var HR="DialogTrigger",GR=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=un(HR,r),s=it(t,i.triggerRef);return f.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":S0(i.open),...n,ref:s,onClick:he(e.onClick,i.onOpenToggle)})});GR.displayName=HR;var w0="DialogPortal",[T9,KR]=UR(w0,{forceMount:void 0}),qR=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,s=un(w0,t);return f.jsx(T9,{scope:t,forceMount:r,children:m.Children.map(n,o=>f.jsx(jn,{present:r||s.open,children:f.jsx(Kf,{asChild:!0,container:i,children:o})}))})};qR.displayName=w0;var Ef="DialogOverlay",QR=m.forwardRef((e,t)=>{const r=KR(Ef,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=un(Ef,e.__scopeDialog);return s.modal?f.jsx(jn,{present:n||s.open,children:f.jsx(P9,{...i,ref:t})}):null});QR.displayName=Ef;var P9=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=un(Ef,r);return f.jsx(i0,{as:Hi,allowPinchZoom:!0,shards:[i.contentRef],children:f.jsx(We.div,{"data-state":S0(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Hs="DialogContent",YR=m.forwardRef((e,t)=>{const r=KR(Hs,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=un(Hs,e.__scopeDialog);return f.jsx(jn,{present:n||s.open,children:s.modal?f.jsx(D9,{...i,ref:t}):f.jsx(A9,{...i,ref:t})})});YR.displayName=Hs;var D9=m.forwardRef((e,t)=>{const r=un(Hs,e.__scopeDialog),n=m.useRef(null),i=it(t,r.contentRef,n);return m.useEffect(()=>{const s=n.current;if(s)return vk(s)},[]),f.jsx(ZR,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:he(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:he(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:he(e.onFocusOutside,s=>s.preventDefault())})}),A9=m.forwardRef((e,t)=>{const r=un(Hs,e.__scopeDialog),n=m.useRef(!1),i=m.useRef(!1);return f.jsx(ZR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((c=r.triggerRef.current)==null?void 0:c.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),ZR=m.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=un(Hs,r),l=m.useRef(null),c=it(t,l);return VN(),f.jsxs(f.Fragment,{children:[f.jsx(qx,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:f.jsx(Dc,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":S0(a.open),...o,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(k9,{titleId:a.titleId}),f.jsx(j9,{contentRef:l,descriptionId:a.descriptionId})]})]})}),b0="DialogTitle",XR=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=un(b0,r);return f.jsx(We.h2,{id:i.titleId,...n,ref:t})});XR.displayName=b0;var JR="DialogDescription",ej=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=un(JR,r);return f.jsx(We.p,{id:i.descriptionId,...n,ref:t})});ej.displayName=JR;var tj="DialogClose",rj=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=un(tj,r);return f.jsx(We.button,{type:"button",...n,ref:t,onClick:he(e.onClick,()=>i.onOpenChange(!1))})});rj.displayName=tj;function S0(e){return e?"open":"closed"}var nj="DialogTitleWarning",[N9,ij]=d_(nj,{contentName:Hs,titleName:b0,docsSlug:"dialog"}),k9=({titleId:e})=>{const t=ij(nj),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 m.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},R9="DialogDescriptionWarning",j9=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ij(R9).contentName}}.`;return m.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},sj=WR,I9=GR,oj=qR,C0=QR,E0=YR,T0=XR,P0=ej,D0=rj;const Js=sj,M9=oj,aj=m.forwardRef(({className:e,...t},r)=>f.jsx(C0,{ref:r,className:Ce("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}));aj.displayName=C0.displayName;const ss=m.forwardRef(({className:e,children:t,...r},n)=>f.jsxs(M9,{children:[f.jsx(aj,{}),f.jsxs(E0,{ref:n,className:Ce("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,f.jsxs(D0,{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:[f.jsx(El,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ss.displayName=E0.displayName;const os=({className:e,...t})=>f.jsx("div",{className:Ce("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});os.displayName="DialogHeader";const lj=({className:e,...t})=>f.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});lj.displayName="DialogFooter";const as=m.forwardRef(({className:e,...t},r)=>f.jsx(T0,{ref:r,className:Ce("text-lg font-semibold leading-none tracking-tight",e),...t}));as.displayName=T0.displayName;const Zc=m.forwardRef(({className:e,...t},r)=>f.jsx(P0,{ref:r,className:Ce("text-sm text-muted-foreground",e),...t}));Zc.displayName=P0.displayName;var O9="Label",cj=m.forwardRef((e,t)=>f.jsx(We.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())}}));cj.displayName=O9;var uj=cj;const _9=Nc("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),dj=m.forwardRef(({className:e,...t},r)=>f.jsx(uj,{ref:r,className:Ce(_9(),e),...t}));dj.displayName=uj.displayName;const _p=UG,fj=m.createContext({}),Sn=({...e})=>f.jsx(fj.Provider,{value:{name:e.name},children:f.jsx(GG,{...e})}),Lp=()=>{const e=m.useContext(fj),t=m.useContext(pj),{getFieldState:r,formState:n}=Rp(),i=r(e.name,n);if(!e)throw new Error("useFormField should be used within ");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...i}},pj=m.createContext({}),Xr=m.forwardRef(({className:e,...t},r)=>{const n=m.useId();return f.jsx(pj.Provider,{value:{id:n},children:f.jsx("div",{ref:r,className:Ce("space-y-2",e),...t})})});Xr.displayName="FormItem";const Jr=m.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:i}=Lp();return f.jsx(dj,{ref:r,className:Ce(n&&"text-destructive",e),htmlFor:i,...t})});Jr.displayName="FormLabel";const en=m.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:i,formMessageId:s}=Lp();return f.jsx(Hi,{ref:t,id:n,"aria-describedby":r?`${i} ${s}`:`${i}`,"aria-invalid":!!r,...e})});en.displayName="FormControl";const L9=m.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=Lp();return f.jsx("p",{ref:r,id:n,className:Ce("text-sm text-muted-foreground",e),...t})});L9.displayName="FormDescription";const tn=m.forwardRef(({className:e,children:t,...r},n)=>{const{error:i,formMessageId:s}=Lp(),o=i?String(i==null?void 0:i.message):t;return o?f.jsx("p",{ref:n,id:s,className:Ce("text-sm font-medium text-destructive",e),...r,children:o}):null});tn.displayName="FormMessage";const Mr=m.forwardRef(({className:e,type:t,...r},n)=>f.jsx("input",{type:t,className:Ce("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}));Mr.displayName="Input";const F9=Op({name:bn().min(2,{message:"Exercise name must be at least 2 characters."}),weight:bn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Weight must be a positive number."}),reps:bn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Reps must be a positive number."}),sets:bn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Sets must be a positive number."})});function V9({open:e,onOpenChange:t,onSubmit:r}){const n=jp({resolver:Ip(F9),defaultValues:{name:"",weight:"",reps:"",sets:""}});function i(s){r({name:s.name,weight:Number(s.weight),reps:Number(s.reps),sets:Number(s.sets)}),n.reset(),t(!1)}return f.jsx(Js,{open:e,onOpenChange:t,children:f.jsxs(ss,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[f.jsxs(os,{children:[f.jsx(as,{children:"Add Exercise"}),f.jsx(Zc,{children:"What's your next challenge?"})]}),f.jsx(_p,{...n,children:f.jsxs("form",{onSubmit:n.handleSubmit(i),className:"space-y-4",children:[f.jsx(Sn,{control:n.control,name:"name",render:({field:s})=>f.jsxs(Xr,{children:[f.jsx(Jr,{className:"text-foreground",children:"Exercise Name"}),f.jsx(en,{children:f.jsx(Mr,{placeholder:"e.g. Bench Press",...s})}),f.jsx(tn,{})]})}),f.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[f.jsx(Sn,{control:n.control,name:"weight",render:({field:s})=>f.jsxs(Xr,{children:[f.jsx(Jr,{className:"text-foreground",children:"Weight (kg)"}),f.jsx(en,{children:f.jsx(Mr,{type:"number",step:"any",placeholder:"e.g. 70.5",className:"placeholder:text-muted-foreground",...s})}),f.jsx(tn,{})]})}),f.jsx(Sn,{control:n.control,name:"reps",render:({field:s})=>f.jsxs(Xr,{children:[f.jsx(Jr,{className:"text-foreground",children:"Reps"}),f.jsx(en,{children:f.jsx(Mr,{type:"number",placeholder:"e.g. 8",className:"placeholder:text-muted-foreground",...s})}),f.jsx(tn,{})]})}),f.jsx(Sn,{control:n.control,name:"sets",render:({field:s})=>f.jsxs(Xr,{children:[f.jsx(Jr,{className:"text-foreground",children:"Sets"}),f.jsx(en,{children:f.jsx(Mr,{type:"number",placeholder:"e.g. 3",className:"placeholder:text-muted-foreground",...s})}),f.jsx(tn,{})]})})]}),f.jsx(be,{type:"submit",className:"w-full",children:"Add Exercise"})]})})]})})}var hj="AlertDialog",[$9,Q7]=Aa(hj,[zR]),li=zR(),mj=e=>{const{__scopeAlertDialog:t,...r}=e,n=li(t);return f.jsx(sj,{...n,...r,modal:!0})};mj.displayName=hj;var B9="AlertDialogTrigger",U9=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=li(r);return f.jsx(I9,{...i,...n,ref:t})});U9.displayName=B9;var z9="AlertDialogPortal",gj=e=>{const{__scopeAlertDialog:t,...r}=e,n=li(t);return f.jsx(oj,{...n,...r})};gj.displayName=z9;var W9="AlertDialogOverlay",vj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=li(r);return f.jsx(C0,{...i,...n,ref:t})});vj.displayName=W9;var zo="AlertDialogContent",[H9,G9]=$9(zo),yj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...i}=e,s=li(r),o=m.useRef(null),a=it(t,o),l=m.useRef(null);return f.jsx(N9,{contentName:zo,titleName:xj,docsSlug:"alert-dialog",children:f.jsx(H9,{scope:r,cancelRef:l,children:f.jsxs(E0,{role:"alertdialog",...s,...i,ref:a,onOpenAutoFocus:he(i.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[f.jsx(Ay,{children:n}),f.jsx(q9,{contentRef:o})]})})})});yj.displayName=zo;var xj="AlertDialogTitle",wj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=li(r);return f.jsx(T0,{...i,...n,ref:t})});wj.displayName=xj;var bj="AlertDialogDescription",Sj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=li(r);return f.jsx(P0,{...i,...n,ref:t})});Sj.displayName=bj;var K9="AlertDialogAction",Cj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=li(r);return f.jsx(D0,{...i,...n,ref:t})});Cj.displayName=K9;var Ej="AlertDialogCancel",Tj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:i}=G9(Ej,r),s=li(r),o=it(t,i);return f.jsx(D0,{...s,...n,ref:o})});Tj.displayName=Ej;var q9=({contentRef:e})=>{const t=`\`${zo}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${zo}\` by passing a \`${bj}\` 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 \`${zo}\`. 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 m.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Q9=mj,Y9=gj,Pj=vj,Dj=yj,Aj=Cj,Nj=Tj,kj=wj,Rj=Sj;const A0=Q9,Z9=Y9,jj=m.forwardRef(({className:e,...t},r)=>f.jsx(Pj,{className:Ce("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}));jj.displayName=Pj.displayName;const Fp=m.forwardRef(({className:e,...t},r)=>f.jsxs(Z9,{children:[f.jsx(jj,{}),f.jsx(Dj,{ref:r,className:Ce("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})]}));Fp.displayName=Dj.displayName;const Vp=({className:e,...t})=>f.jsx("div",{className:Ce("flex flex-col space-y-2 text-center sm:text-left",e),...t});Vp.displayName="AlertDialogHeader";const $p=({className:e,...t})=>f.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});$p.displayName="AlertDialogFooter";const Bp=m.forwardRef(({className:e,...t},r)=>f.jsx(kj,{ref:r,className:Ce("text-lg font-semibold",e),...t}));Bp.displayName=kj.displayName;const Up=m.forwardRef(({className:e,...t},r)=>f.jsx(Rj,{ref:r,className:Ce("text-sm text-muted-foreground",e),...t}));Up.displayName=Rj.displayName;const zp=m.forwardRef(({className:e,...t},r)=>f.jsx(Aj,{ref:r,className:Ce(Kx(),e),...t}));zp.displayName=Aj.displayName;const Wp=m.forwardRef(({className:e,...t},r)=>f.jsx(Nj,{ref:r,className:Ce(Kx({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Wp.displayName=Nj.displayName;const X9=Op({weight:bn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Weight must be a positive number."}),reps:bn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Reps must be a positive number."}),sets:bn().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Sets must be a positive number."})});function J9({exercise:e,open:t,onOpenChange:r,onDelete:n,onRefresh:i}){const[s,o]=m.useState(!1),[a,l]=m.useState(e.name),[c,u]=m.useState([]),[d,p]=m.useState(!1),[h,g]=m.useState({open:!1,variationId:null,variationInfo:""}),{toast:v}=Pc(),[w,x]=m.useState(null);ee.useEffect(()=>{(async()=>{try{const M=await fetch("/api/user",{credentials:"include"});if(M.ok){const W=await M.json();x(W)}}catch{console.log("User not authenticated")}})()},[]);const y=jp({resolver:Ip(X9),defaultValues:{weight:e.weight.toString(),reps:e.reps.toString(),sets:e.sets.toString()}});m.useEffect(()=>{t&&e.id&&(b(),l(e.name),o(!1))},[t,e.id]),m.useEffect(()=>{if(t&&c.length>0){const R=c[0];y.reset({weight:R.targetWeight.toString(),reps:R.targetReps.toString(),sets:R.targetSets.toString()})}else t&&y.reset({weight:e.weight.toString(),reps:e.reps.toString(),sets:e.sets.toString()})},[t,c,e,y]);const b=async()=>{try{p(!0);const R=await fetch(`/api/v2/exercises/${e.id}/variations`,{credentials:"include"});if(R.ok){const M=await R.json();u(M)}else console.error("Failed to fetch variations:",R.status,R.statusText),u([])}catch(R){console.error("Error fetching variations:",R),u([])}finally{p(!1)}},S=async R=>{const M=Number(R.weight),W=Number(R.reps),V=Number(R.sets);if(c.some(B=>B.targetWeight===M&&B.targetReps===W&&B.targetSets===V)){v({title:"Variation Already Exists",description:`A variation with ${M}kg × ${W} reps × ${V} sets already exists for this exercise.`,variant:"destructive"});return}try{p(!0);const B=await fetch(`/api/v2/exercises/${e.id}/variations`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({targetWeight:M,targetReps:W,targetSets:V,isActive:!0})});if(B.ok){const te=await B.json();await b(),y.reset()}else throw new Error("Failed to create variation")}catch(B){console.error("Error creating variation:",B),v({title:"That variation didn't want to join the party!",description:"Failed to add variation",variant:"destructive"})}finally{p(!1)}},C=async R=>{try{if(p(!0),(await fetch(`/api/v2/exercises/${e.id}/variations/${R}/set-current`,{method:"PUT",credentials:"include"})).ok)await b();else throw new Error("Failed to set variation as current")}catch(M){console.error("Error setting variation as current:",M),v({title:"That variation is being stubborn!",description:"Failed to update current variation",variant:"destructive"})}finally{p(!1)}},D=async()=>{if(h.variationId){if(c.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"}),g({open:!1,variationId:null,variationInfo:""});return}try{const R=w?`/api/v2/variations/${h.variationId}`:`/api/demo/v2/variations/${h.variationId}`;if(!(await fetch(R,{method:"DELETE",credentials:"include"})).ok)throw new Error("Failed to delete variation");await b(),v({title:"Set variation dropped like it's hot! ⚡",description:"Successfully removed variation and its workout logs."})}catch(R){console.error("Error deleting variation:",R),v({title:"That variation is holding on tight!",description:"Couldn't delete the variation. Please try again.",variant:"destructive"})}finally{g({open:!1,variationId:null,variationInfo:""})}}},N=async()=>{if(a.trim()===e.name||!a.trim()){o(!1),l(e.name);return}try{const R=w?`/api/v2/exercises/${e.id}/name`:`/api/demo/v2/exercises/${e.id}/name`;if(!(await fetch(R,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a.trim()}),...w?{credentials:"include"}:{}})).ok)throw new Error("Failed to update exercise name");v({title:"Exercise leveled up! đŸ’Ē",description:"Successfully renamed the exercise."}),o(!1),i()}catch(R){console.error("Error updating exercise name:",R),v({title:"That name didn't stick!",description:"Couldn't update the exercise name. Please try again.",variant:"destructive"}),l(e.name)}},k=R=>{R.key==="Enter"?N():R.key==="Escape"&&(o(!1),l(e.name))};return f.jsxs(Js,{open:t,onOpenChange:r,children:[f.jsxs(ss,{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:[f.jsxs(os,{children:[f.jsx(as,{className:"flex items-center justify-start gap-4",children:s?f.jsxs(f.Fragment,{children:[f.jsx(Mr,{value:a,onChange:R=>l(R.target.value),className:"text-lg font-semibold max-w-[300px]",autoFocus:!0,onKeyDown:k,onBlur:()=>{a.trim()!==e.name?N():o(!1)}}),f.jsx(be,{type:"button",variant:"ghost",size:"sm",onClick:N,className:"h-8 w-8 p-0 flex-shrink-0",children:f.jsx(Kn,{className:"h-4 w-4 text-green-600"})})]}):f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-lg font-semibold",children:e.name}),f.jsx(be,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>o(!0),children:f.jsx(_P,{className:"h-3 w-3"})})]})}),f.jsx(Zc,{className:"text-left",children:"Add new exercise variations and view existing ones."})]}),f.jsxs("div",{className:"flex-1 flex flex-col space-y-6 overflow-hidden",children:[f.jsx("div",{className:"flex-shrink-0",children:f.jsx(_p,{...y,children:f.jsxs("form",{onSubmit:y.handleSubmit(S),className:"space-y-3",children:[f.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[f.jsx(Sn,{control:y.control,name:"weight",render:({field:R})=>f.jsxs(Xr,{children:[f.jsx(Jr,{className:"text-foreground text-sm",children:"Weight (kg)"}),f.jsx(en,{children:f.jsx(Mr,{type:"number",step:"any",placeholder:"e.g. 70.5",className:"placeholder:text-muted-foreground",...R})}),f.jsx(tn,{})]})}),f.jsx(Sn,{control:y.control,name:"reps",render:({field:R})=>f.jsxs(Xr,{children:[f.jsx(Jr,{className:"text-foreground text-sm",children:"Reps"}),f.jsx(en,{children:f.jsx(Mr,{type:"number",placeholder:"e.g. 8",className:"placeholder:text-muted-foreground",...R})}),f.jsx(tn,{})]})}),f.jsx(Sn,{control:y.control,name:"sets",render:({field:R})=>f.jsxs(Xr,{children:[f.jsx(Jr,{className:"text-foreground text-sm",children:"Sets"}),f.jsx(en,{children:f.jsx(Mr,{type:"number",placeholder:"e.g. 3",className:"placeholder:text-muted-foreground",...R})}),f.jsx(tn,{})]})})]}),f.jsxs(be,{type:"submit",size:"sm",disabled:d,className:"flex items-center gap-1",children:[f.jsx(Lo,{className:"h-3 w-3"}),"Add Variation"]})]})})}),f.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden relative",children:[f.jsx("div",{className:"flex items-center justify-between mb-3 flex-shrink-0",children:f.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Exercise variants"})}),f.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent",children:d?f.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading variations..."}):c.length===0?f.jsx("div",{className:"text-sm text-muted-foreground",children:"No variations yet. Add one above to get started."}):f.jsxs("div",{className:"space-y-2 pr-1",children:[c.map(R=>{const M=R.isCurrent;return f.jsx("div",{className:"flex items-center gap-2 transition-all duration-200 min-h-[60px]",children:f.jsx("div",{className:`flex ${M?"w-full":"w-full justify-center"}`,children:f.jsxs("div",{onClick:()=>!M&&C(R.id),className:`flex items-center justify-between p-3 rounded border transition-all duration-200 ${M?"border-slate-900 shadow-lg w-full":"border-gray-200 hover:bg-gray-50 cursor-pointer w-[95%]"}`,children:[f.jsxs("div",{className:"flex-1",children:[f.jsx("div",{className:"mb-2",children:f.jsxs("span",{className:"text-sm font-medium",children:[R.targetWeight,"kg | ",R.targetReps," reps | ",R.targetSets," sets"]})}),f.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:R.completions&&R.completions.length>0?f.jsxs(f.Fragment,{children:[R.completions.slice(-10).map((W,V)=>(console.log("Completion object structure:",{id:W.id,success:W.success,completedAt:W.completedAt,fullObject:W}),f.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded-full text-xs ${W.success?"bg-green-100 text-green-700 border border-green-200":"bg-red-100 text-red-700 border border-red-200"}`,title:`${W.success?"Success":"Failed"} - ${new Date(W.completedAt).toLocaleString()}`,children:W.success?"✓":"✗"},V))),R.completions.length>10&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",R.completions.length-10," more"]})]}):f.jsx(f.Fragment,{children:Array.from({length:3}).map((W,V)=>f.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"},V))})})]}),f.jsx("div",{className:"flex items-center ml-3",children:f.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:W=>{W.stopPropagation(),g({open:!0,variationId:R.id,variationInfo:`${R.targetWeight}kg | ${R.targetReps} reps | ${R.targetSets} sets`})},children:f.jsx(_d,{className:"h-3 w-3"})})})]})})},R.id)}),c.length===1&&f.jsx(f.Fragment,{children:Array.from({length:2}).map((R,M)=>f.jsx("div",{className:"flex items-center gap-2 transition-all duration-200 min-h-[60px] opacity-50",children:f.jsx("div",{className:"flex w-full justify-center",children:f.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:[f.jsxs("div",{className:"flex-1",children:[f.jsx("div",{className:"mb-2",children:f.jsx("span",{className:"text-sm font-medium text-gray-500",children:"Add more variations above"})}),f.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:Array.from({length:3}).map((W,V)=>f.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"},V))})]}),f.jsx("div",{className:"flex items-center ml-3",children:f.jsx("div",{className:"w-6 h-6 p-0 flex-shrink-0 opacity-30",children:f.jsx(Lo,{className:"h-3 w-3 text-gray-400"})})})]})})},`placeholder-${M}`))})]})}),c.length>3&&f.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-4 bg-gradient-to-t from-background to-transparent pointer-events-none"})]})]}),f.jsxs("div",{className:"flex justify-between items-center pt-4 border-t flex-shrink-0",children:[f.jsx(be,{type:"button",variant:"destructive",size:"sm",onClick:()=>{n(),r(!1)},className:"px-3",children:f.jsx(_d,{className:"h-4 w-4"})}),f.jsx(be,{type:"button",onClick:()=>r(!1),variant:"outline",className:"bg-white hover:bg-gray-50",children:"Done"})]})]}),f.jsx(A0,{open:h.open,onOpenChange:R=>g({...h,open:R}),children:f.jsxs(Fp,{children:[f.jsxs(Vp,{children:[f.jsx(Bp,{children:"Drop this variation?"}),f.jsxs(Up,{children:['This will delete "',h.variationInfo,'" and all its workout logs.',f.jsx("br",{}),f.jsx("br",{}),"This action can't be undone."]})]}),f.jsxs($p,{children:[f.jsx(Wp,{children:"Keep it"}),f.jsx(zp,{onClick:D,className:"bg-red-600 hover:bg-red-700",children:"Delete variation"})]})]})})]})}function e7({open:e,onOpenChange:t,onConfirm:r,isSuccess:n}){return f.jsx(Js,{open:e,onOpenChange:t,children:f.jsxs(ss,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[f.jsxs(os,{children:[f.jsx(as,{children:"Remove Set Status"}),f.jsxs(Zc,{children:["Are you sure you want to remove this ",n?"success":"failure"," status?"]})]}),f.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[f.jsx(be,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(be,{onClick:()=>{r(),t(!1)},children:"Remove"})]})]})})}const t7=Op({name:bn().min(2,{message:"Routine name must be at least 2 characters."})});function r7({open:e,onOpenChange:t,onSubmit:r,onDelete:n,routine:i,mode:s,existingRoutines:o}){const a=jp({resolver:Ip(t7),defaultValues:{name:(i==null?void 0:i.name)||""}});ee.useEffect(()=>{e&&(i!=null&&i.name)&&a.reset({name:i.name})},[e,i==null?void 0:i.name,a]);function l(u){r(u.name),a.reset(),t(!1)}const c=o.length===1;return f.jsx(Js,{open:e,onOpenChange:t,children:f.jsxs(ss,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[f.jsxs(os,{children:[f.jsx(as,{children:s==="create"?"Create Routine":"Edit Routine"}),f.jsx(Zc,{children:s==="create"?"Create a new routine.":"Edit routine name or delete the routine."})]}),f.jsx(_p,{...a,children:f.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[f.jsx(Sn,{control:a.control,name:"name",render:({field:u})=>f.jsxs(Xr,{children:[f.jsx(Jr,{className:"text-foreground",children:"Routine Name"}),f.jsx(en,{children:f.jsx(Mr,{placeholder:"e.g. Upper Body",...u})}),f.jsx(tn,{})]})}),f.jsxs("div",{className:"flex justify-between pt-4",children:[s==="edit"&&n&&!c&&f.jsx(be,{type:"button",variant:"destructive",className:"px-3",onClick:()=>{n(),t(!1)},children:f.jsx(_d,{className:"h-4 w-4"})}),f.jsxs("div",{className:`space-x-2 ${s==="create"||c?"ml-auto":""}`,children:[f.jsx(be,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(be,{type:"submit",children:s==="create"?"Create Routine":"Save Changes"})]})]})]})})]})})}const Ij=m.forwardRef(({className:e,...t},r)=>f.jsx("textarea",{className:Ce("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}));Ij.displayName="Textarea";const J1=300;function n7({open:e,onOpenChange:t,initialNote:r,onSave:n}){const[i,s]=m.useState(r||"");m.useEffect(()=>{e&&s(r||"")},[e,r]);const o=()=>{n(i.trim()),t(!1)},a=()=>{s("")},l=J1-i.length;return f.jsx(Js,{open:e,onOpenChange:t,children:f.jsxs(ss,{className:"sm:max-w-md sm:top-[20%] top-[10%] translate-y-0",children:[f.jsx(os,{children:f.jsxs(as,{className:"flex items-center gap-2",children:[f.jsx(OP,{className:"h-5 w-5"}),"Gym diary time! 📝"]})}),f.jsxs("div",{className:"space-y-4",children:[f.jsx(Ij,{value:i,onChange:c=>s(c.target.value),placeholder:"Add a note for this exercise...",maxLength:J1,rows:4,className:"resize-none"}),f.jsx("div",{className:"flex justify-between items-center text-sm",children:f.jsxs("span",{className:`${l<20?"text-orange-500":"text-gray-500"}`,children:[l," characters remaining"]})})]}),f.jsxs(lj,{className:"gap-2",children:[f.jsx(be,{variant:"outline",onClick:a,disabled:i.length===0,children:"Clear"}),f.jsx(be,{onClick:o,children:"Save"})]})]})})}async function ym(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 i7(){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 Hp(){const e=zf(),{data:t,error:r,isLoading:n}=UT({queryKey:["user"],queryFn:i7,staleTime:1/0,retry:!1}),i=Mo({mutationFn:a=>ym("/api/login","POST",a),onSuccess:()=>{e.invalidateQueries({queryKey:["user"]})}}),s=Mo({mutationFn:()=>ym("/api/logout","POST"),onSuccess:()=>{e.invalidateQueries({queryKey:["user"]}),window.location.href="/"}}),o=Mo({mutationFn:a=>ym("/api/register","POST",a),onSuccess:()=>{e.invalidateQueries({queryKey:["user"]})}});return{user:t,isLoading:n,error:r,login:i.mutateAsync,logout:s.mutateAsync,register:o.mutateAsync}}const s7=Nc("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Mj=m.forwardRef(({className:e,variant:t,...r},n)=>f.jsx("div",{ref:n,role:"alert",className:Ce(s7({variant:t}),e),...r}));Mj.displayName="Alert";const o7=m.forwardRef(({className:e,...t},r)=>f.jsx("h5",{ref:r,className:Ce("mb-1 font-medium leading-none tracking-tight",e),...t}));o7.displayName="AlertTitle";const Oj=m.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:Ce("text-sm [&_p]:leading-relaxed",e),...t}));Oj.displayName="AlertDescription";function a7(){const[e,t]=m.useState(!1),[r,n]=m.useState(0),[i,s]=m.useState(!1),[o,a]=m.useState(null);m.useEffect(()=>{let p;return i&&o&&(p=window.setInterval(()=>{n(Date.now()-o)},10)),()=>{p&&clearInterval(p)}},[i,o]);const l=()=>{i||a(Date.now()-r),s(!i)},c=()=>{n(0),s(!1),a(null)},u=p=>{const h=Math.floor(p/1e3),g=Math.floor(h/60),v=h%60,w=Math.floor(p%1e3/10);return`${g.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}.${w.toString().padStart(2,"0")}`},d=p=>{const h=Math.floor(p/1e3),g=Math.floor(h/60),v=h%60;return`${g.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}`};return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"fixed bottom-6 z-50 flex items-center gap-3",style:{right:"max(1.5rem, calc((100vw - 72rem) / 2 + 1.5rem))"},children:[i&&!e&&r>0&&f.jsx("div",{className:"bg-primary text-primary-foreground px-3 py-2 rounded-lg shadow-lg font-mono font-bold text-lg border-2 border-white",children:d(r)}),f.jsx(be,{size:"icon",className:"h-14 w-14 rounded-full shadow-lg hover:shadow-xl transition-shadow p-0 flex items-center justify-center bg-primary hover:bg-primary/90 border-4 border-white",onClick:()=>t(!0),children:f.jsx(_y,{className:"h-12 w-12 text-primary-foreground"})})]}),f.jsx(Js,{open:e,onOpenChange:t,children:f.jsxs(ss,{className:"sm:max-w-md",children:[f.jsx(os,{children:f.jsx(as,{children:"Workout Timer"})}),f.jsxs("div",{className:"flex flex-col items-center gap-8 py-8",children:[f.jsx("div",{className:"text-6xl font-mono font-bold",children:u(r)}),f.jsxs("div",{className:"flex gap-4",children:[f.jsx(be,{size:"lg",className:"h-16 w-32 text-lg",onClick:l,children:i?f.jsxs(f.Fragment,{children:[f.jsx(aL,{className:"mr-2 h-6 w-6"}),"Pause"]}):f.jsxs(f.Fragment,{children:[f.jsx(lL,{className:"mr-2 h-6 w-6"}),"Start"]})}),f.jsxs(be,{variant:"outline",size:"lg",className:"h-16 w-32 text-lg",onClick:c,children:[f.jsx(uL,{className:"mr-2 h-6 w-6"}),"Reset"]})]})]})]})})]})}var[Gp,Y7]=Aa("Tooltip",[Tp]),Kp=Tp(),_j="TooltipProvider",l7=700,Ev="tooltip.open",[c7,N0]=Gp(_j),Lj=e=>{const{__scopeTooltip:t,delayDuration:r=l7,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:s}=e,[o,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),f.jsx(c7,{scope:t,isOpenDelayed:o,delayDuration:r,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:i,children:s})};Lj.displayName=_j;var qp="Tooltip",[u7,Qp]=Gp(qp),Fj=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=e,l=N0(qp,e.__scopeTooltip),c=Kp(t),[u,d]=m.useState(null),p=Is(),h=m.useRef(0),g=o??l.disableHoverableContent,v=a??l.delayDuration,w=m.useRef(!1),[x=!1,y]=Ac({prop:n,defaultProp:i,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(Ev))):l.onClose(),s==null||s(N)}}),b=m.useMemo(()=>x?w.current?"delayed-open":"instant-open":"closed",[x]),S=m.useCallback(()=>{window.clearTimeout(h.current),w.current=!1,y(!0)},[y]),C=m.useCallback(()=>{window.clearTimeout(h.current),y(!1)},[y]),D=m.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{w.current=!0,y(!0)},v)},[v,y]);return m.useEffect(()=>()=>window.clearTimeout(h.current),[]),f.jsx(ok,{...c,children:f.jsx(u7,{scope:t,contentId:p,open:x,stateAttribute:b,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?D():S()},[l.isOpenDelayed,D,S]),onTriggerLeave:m.useCallback(()=>{g?C():window.clearTimeout(h.current)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:r})})};Fj.displayName=qp;var Tv="TooltipTrigger",Vj=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=Qp(Tv,r),s=N0(Tv,r),o=Kp(r),a=m.useRef(null),l=it(t,a,i.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),d=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),f.jsx(ak,{asChild:!0,...o,children:f.jsx(We.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:l,onPointerMove:he(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:he(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:he(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:he(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:he(e.onBlur,i.onClose),onClick:he(e.onClick,i.onClose)})})});Vj.displayName=Tv;var d7="TooltipPortal",[Z7,f7]=Gp(d7,{forceMount:void 0}),ba="TooltipContent",$j=m.forwardRef((e,t)=>{const r=f7(ba,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...s}=e,o=Qp(ba,e.__scopeTooltip);return f.jsx(jn,{present:n||o.open,children:o.disableHoverableContent?f.jsx(Bj,{side:i,...s,ref:t}):f.jsx(p7,{side:i,...s,ref:t})})}),p7=m.forwardRef((e,t)=>{const r=Qp(ba,e.__scopeTooltip),n=N0(ba,e.__scopeTooltip),i=m.useRef(null),s=it(t,i),[o,a]=m.useState(null),{trigger:l,onClose:c}=r,u=i.current,{onPointerInTransitChange:d}=n,p=m.useCallback(()=>{a(null),d(!1)},[d]),h=m.useCallback((g,v)=>{const w=g.currentTarget,x={x:g.clientX,y:g.clientY},y=v7(x,w.getBoundingClientRect()),b=y7(x,y),S=x7(v.getBoundingClientRect()),C=b7([...b,...S]);a(C),d(!0)},[d]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(l&&u){const g=w=>h(w,u),v=w=>h(w,l);return l.addEventListener("pointerleave",g),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",v)}}},[l,u,h,p]),m.useEffect(()=>{if(o){const g=v=>{const w=v.target,x={x:v.clientX,y:v.clientY},y=(l==null?void 0:l.contains(w))||(u==null?void 0:u.contains(w)),b=!w7(x,o);y?p():b&&(p(),c())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,u,o,c,p]),f.jsx(Bj,{...e,ref:s})}),[h7,m7]=Gp(qp,{isInside:!1}),Bj=m.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=e,l=Qp(ba,r),c=Kp(r),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(Ev,u),()=>document.removeEventListener(Ev,u)),[u]),m.useEffect(()=>{if(l.trigger){const d=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),f.jsx(Dc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:f.jsxs(lk,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[f.jsx(Ay,{children:n}),f.jsx(h7,{scope:r,isInside:!0,children:f.jsx(N_,{id:l.contentId,role:"tooltip",children:i||n})})]})})});$j.displayName=ba;var Uj="TooltipArrow",g7=m.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=Kp(r);return m7(Uj,r).isInside?null:f.jsx(ck,{...i,...n,ref:t})});g7.displayName=Uj;function v7(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(r,n,i,s)){case s:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function y7(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function x7(e){const{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}function w7(e,t){const{x:r,y:n}=e;let i=!1;for(let s=0,o=t.length-1;sn!=u>n&&r<(c-a)*(n-l)/(u-l)+a&&(i=!i)}return i}function b7(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),S7(t)}function S7(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const i=e[n];for(;r.length>=2;){const s=r[r.length-1],o=r[r.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var C7=Lj,E7=Fj,T7=Vj,zj=$j;const Iu=C7,Mu=E7,Ou=T7,fl=m.forwardRef(({className:e,sideOffset:t=4,...r},n)=>f.jsx(zj,{ref:n,sideOffset:t,className:Ce("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));fl.displayName=zj.displayName;function P7({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:f.jsx(pb,{className:"h-4 w-4 text-orange-500"})},{text:"Add 2-3 more reps to challenge yourself",icon:f.jsx(Lo,{className:"h-4 w-4 text-blue-500"})},{text:"Throw in an extra set for volume",icon:f.jsx(Od,{className:"h-4 w-4 text-purple-500"})},{text:"Try a slower, more controlled tempo",icon:f.jsx(Md,{className:"h-4 w-4 text-indigo-500"})},{text:"Reduce rest time between sets",icon:f.jsx(_y,{className:"h-4 w-4 text-red-500"})}],footer:"Progress is progress, no matter how small!",icon:f.jsx(Fo,{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:f.jsx(Cl,{className:"h-4 w-4 text-red-500"})},{text:"Focus on 2-3 fewer reps with perfect form",icon:f.jsx(Od,{className:"h-4 w-4 text-green-500"})},{text:"Take an extra day to recover fully",icon:f.jsx(Md,{className:"h-4 w-4 text-blue-500"})},{text:"Try lighter warm-up sets first",icon:f.jsx(pb,{className:"h-4 w-4 text-yellow-500"})},{text:"Check your sleep and nutrition",icon:f.jsx(Kn,{className:"h-4 w-4 text-purple-500"})}],footer:"Remember: Form > Weight. You've got this!",icon:f.jsx(Cl,{className:"h-10 w-10 text-red-500"})}};return f.jsx(Js,{open:e,onOpenChange:t,children:f.jsxs(ss,{className:"max-w-md",children:[f.jsxs(os,{children:[f.jsxs("div",{className:"flex flex-col items-center text-center gap-4 mb-6",children:[f.jsx("div",{className:"p-4 rounded-full bg-gray-50 border-2",children:i[r].icon}),f.jsx(as,{className:"text-2xl font-bold",children:i[r].title})]}),f.jsxs("div",{className:"space-y-4",children:[f.jsx("p",{className:"text-base text-gray-700 text-center font-medium",children:i[r].subtitle}),f.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:f.jsx("ul",{className:"space-y-3 text-left",children:i[r].suggestions.map((s,o)=>f.jsxs("li",{className:"flex items-start gap-3 text-base",children:[f.jsx("span",{className:"mt-0.5 flex-shrink-0",children:s.icon}),f.jsx("span",{className:"text-gray-700",children:s.text})]},o))})}),f.jsx("p",{className:"text-sm text-gray-600 text-center italic",children:i[r].footer})]})]}),f.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[f.jsx(be,{variant:"outline",onClick:()=>t(!1),children:"Got it"}),f.jsx(be,{onClick:()=>{n==null||n(),t(!1)},children:"Edit Exercise"})]})]})})}function D7({routines:e}){const[t,r]=m.useState(!1),[n,i]=m.useState(!1),s=m.useMemo(()=>{const c=[],u=new Date;for(let d=29;d>=0;d--){const p=new Date(u);p.setDate(u.getDate()-d);const h=p.toISOString().split("T")[0],g=d===0;let v=0,w=0,x=0,y=!1;e.forEach(b=>{b.exercises&&Array.isArray(b.exercises)&&b.exercises.forEach(S=>{S.completedSets&&Array.isArray(S.completedSets)&&S.completedSets.forEach(C=>{if(new Date(C.timestamp).toISOString().split("T")[0]===h&&C.metrics){y=!0;const N=(C.metrics.weight||0)*(C.metrics.reps||0);v+=N,C.completed?w+=N:x+=N}})})}),c.push({date:h,hasActivity:y,totalWeight:v,completedWeight:w,failedWeight:x,isToday:g})}return c},[e]),o=m.useMemo(()=>{const c=s.filter(C=>C.hasActivity).length,u=s.reduce((C,D)=>C+D.totalWeight,0),d=u/(30/7),p=new Date;let h=0;for(let C=60;C>=31;C--){const D=new Date(p);D.setDate(p.getDate()-C);const N=D.toISOString().split("T")[0];e.forEach(k=>{k.exercises&&Array.isArray(k.exercises)&&k.exercises.forEach(R=>{R.completedSets&&Array.isArray(R.completedSets)&&R.completedSets.forEach(M=>{if(new Date(M.timestamp).toISOString().split("T")[0]===N&&M.metrics&&M.completed){const V=(M.metrics.weight||0)*(M.metrics.reps||0);h+=V}})})})}const g=s.reduce((C,D)=>C+D.completedWeight,0),v=h>0?(g-h)/h*100:g>0?100:0;let w=0;e.forEach(C=>{C.exercises&&Array.isArray(C.exercises)&&C.exercises.forEach(D=>{D.completedSets&&Array.isArray(D.completedSets)&&D.completedSets.forEach(N=>{if(N.metrics&&N.completed){const k=(N.metrics.weight||0)*(N.metrics.reps||0);w+=k}})})});let x=0;const y=new Date(p),b=p.getDay(),S=b===0?6:b-1;y.setDate(p.getDate()-S),y.setHours(0,0,0,0);for(let C=1;C<=52;C++){const D=new Date(y);D.setDate(y.getDate()-C*7);const N=new Date(D);N.setDate(D.getDate()+6),N.setHours(23,59,59,999);let k=!1;if(e.forEach(R=>{R.exercises&&Array.isArray(R.exercises)&&R.exercises.forEach(M=>{M.completedSets&&Array.isArray(M.completedSets)&&M.completedSets.forEach(W=>{const V=new Date(W.timestamp);V>=D&&V<=N&&(k=!0)})})}),k)x++;else break}return{activeDays:c,totalWeightAllTime:w,totalWeightLast30Days:u,averageWeightPerWeek:d,weightChangePercent:v,weekStreak:x}},[s,e]),a=(c,u)=>{const d=new Date(c),p=d.getDate(),h=d.toLocaleDateString("en-US",{weekday:"short"}),g=d.toLocaleDateString("en-US",{month:"short"});return`${h} ${p} ${g}`},l=()=>{i(!0),r(!t),setTimeout(()=>i(!1),300)};return f.jsxs("div",{className:"mb-4 bg-white border border-gray-200 rounded-lg overflow-hidden shadow-sm",children:[f.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer",onClick:l,children:[f.jsx("h3",{className:"text-sm font-medium text-gray-700",children:"Activity (30 days)"}),f.jsx("div",{className:"h-6 w-6 flex items-center justify-center",children:f.jsx("div",{className:`transform transition-transform duration-300 ${t?"rotate-180":"rotate-0"}`,children:f.jsx(IP,{className:"h-4 w-4 text-gray-700"})})})]}),f.jsx("div",{className:`transition-all duration-300 ease-in-out ${t?"max-h-0 opacity-0 overflow-hidden":"max-h-20 opacity-100 pb-3 px-3"}`,children:f.jsx("div",{className:"flex gap-1",children:s.map((c,u)=>f.jsx("div",{className:`w-2 h-2 rounded-full transition-colors ${c.hasActivity?"bg-green-400":"bg-gray-200"}`,title:`${new Date(c.date).toLocaleDateString()} - ${c.hasActivity?`${c.totalWeight.toLocaleString()} kg total (${c.completedWeight.toLocaleString()} completed, ${c.failedWeight.toLocaleString()} failed)`:"No activity"}`},c.date))})}),f.jsxs("div",{className:`transition-all duration-300 ease-in-out ${t?"max-h-96 opacity-100 px-4 pb-4":"max-h-0 opacity-0 overflow-hidden"}`,children:[f.jsx("div",{className:"relative",children:f.jsxs("div",{children:[f.jsx("div",{className:"flex items-end gap-1 h-16 mb-2",children:s.map((c,u)=>{const p=c.totalWeight,h=Math.max(...s.map(w=>w.totalWeight)),g=p>0?Math.max(4,Math.min(48,p/Math.max(1,h)*48)):2,v=u%8===0;return f.jsx("div",{className:"flex flex-col items-center flex-1 min-w-0",children:f.jsx("div",{className:"flex flex-col justify-end h-12 w-full",children:c.hasActivity?f.jsxs("div",{className:"flex flex-col w-full gap-px",children:[c.completedWeight>0&&f.jsx("div",{className:"bg-green-400 rounded-sm w-full",style:{height:`${c.completedWeight/Math.max(1,p)*g}px`}}),c.failedWeight>0&&f.jsx("div",{className:"bg-red-400 rounded-sm w-full",style:{height:`${c.failedWeight/Math.max(1,p)*g}px`}})]}):f.jsx("div",{className:`w-full rounded-sm ${c.isToday?"bg-blue-300":v?"bg-black":"bg-gray-200"}`,style:{height:"2px"}})})},c.date)})}),f.jsx("div",{className:"flex gap-1 relative -top-1",children:s.map((c,u)=>{const d=u%8===0;return f.jsx("div",{className:"flex-1 flex justify-center",children:d&&f.jsx("div",{className:"w-1 h-1 bg-black rounded-full"})},c.date)})}),f.jsx("div",{className:"relative h-4 mt-0.5",children:s.map((c,u)=>{if(!(u%8===0))return null;const p=u/(s.length-1)*100,h=u===0,g=u===s.length-1;return f.jsx("div",{className:`absolute text-xs text-black ${h?"":g?"transform -translate-x-full":"transform -translate-x-1/2"}`,style:{left:`${p}%`},children:f.jsx("div",{className:"text-center whitespace-nowrap font-medium",children:a(c.date)})},c.date)})})]})}),f.jsxs("div",{className:"flex mt-3 pt-3 border-t",children:[f.jsxs("div",{className:"flex flex-col text-sm text-gray-500 space-y-1 flex-1",children:[f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(My,{className:"h-4 w-4"}),f.jsxs("span",{children:[o.activeDays," active days"]})]}),f.jsxs("div",{className:"flex items-center gap-1 text-purple-600",children:[f.jsx(vL,{className:"h-4 w-4"}),f.jsxs("span",{className:"font-medium",children:[o.totalWeightLast30Days.toLocaleString()," kg last 30d"]})]}),f.jsx("div",{className:"flex items-center gap-1",children:f.jsxs("span",{className:`text-sm ${o.weightChangePercent>=0?"text-green-600":"text-red-600"}`,children:[o.weightChangePercent>=0?"↗":"↘"," ",Math.abs(o.weightChangePercent).toFixed(1),"% vs prev 30d"]})})]}),f.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 border-l pl-3",children:[f.jsxs("div",{className:"flex items-center gap-1 text-orange-600 mb-1",children:[f.jsx(Oy,{className:"h-4 w-4"}),f.jsx("span",{className:"text-sm font-medium",children:"Streak"})]}),f.jsx("div",{className:"text-2xl font-bold text-orange-600",children:o.weekStreak}),f.jsx("div",{className:"text-sm font-normal text-orange-600",children:o.weekStreak===1?"week":"weeks"})]})]})]})]})}function A7({open:e,onOpenChange:t,onConfirm:r,title:n,description:i,confirmText:s="Delete",cancelText:o="Cancel"}){const a=()=>{r(),t(!1)};return f.jsx(A0,{open:e,onOpenChange:t,children:f.jsxs(Fp,{children:[f.jsxs(Vp,{children:[f.jsx(Bp,{children:n}),f.jsx(Up,{children:i})]}),f.jsxs($p,{children:[f.jsx(Wp,{onClick:()=>t(!1),children:o}),f.jsx(zp,{onClick:a,className:"bg-red-600 hover:bg-red-700",children:s})]})]})})}const xm="routine-tracker-data",eC="selected-routine-id",N7=()=>Math.floor(Math.random()*1e6),tC=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(),s=r.toLocaleString("en-US",{weekday:"short"}),o=r.toLocaleString("en-US",{month:"short"});return`${s} ${i} ${o} @ ${n}`}catch(r){return console.error("Error formatting date:",r),""}};function rC(){return f.jsx("div",{className:"flex items-center justify-center p-4",children:f.jsx(xs,{className:"h-6 w-6 animate-spin text-primary"})})}function _u(){var dt;const{user:e,logout:t}=Hp(),[r,n]=m.useState(!0),[i,s]=m.useState([]),[o,a]=m.useState(null),[l,c]=m.useState({index:-1,exercise:null}),[u,d]=m.useState(null);m.useState(null);const[p,h]=m.useState({open:!1,mode:"create"}),[g,v]=m.useState(!1),[w,x]=m.useState(!1),[y,b]=m.useState(null),[S,C]=m.useState(new Set),[D,N]=m.useState(!1),[k,R]=m.useState(null),[M,W]=m.useState(null),[V,q]=m.useState(!1),B=Pc(),[te,J]=m.useState({}),[X,F]=m.useState({open:!1,type:"routine",id:0,name:""}),[$,A]=m.useState(null),P=()=>({id:N7(),name:"My First Routine",exercises:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});m.useEffect(()=>{let z=!0;return(async()=>{try{n(!0);const T=k===!0&&!e;if(e){localStorage.removeItem(xm);const I=localStorage.getItem(eC),O=await fetch("/api/routines",{credentials:"include"});if(!O.ok)throw new Error("Failed to fetch routines");const L=await O.json();if(z){const _=L.map(G=>({...G,exercises:G.exercises.map(ce=>({...ce,date:ce.date||ce.updatedAt||G.updatedAt||new Date().toISOString(),notes:ce.notes||""}))}));s(_);const U=I?_.find(G=>G.id===parseInt(I)):_[0];U?(a(U),Ae(U).then(G=>{z&&(a(G),s(ce=>ce.map(me=>me.id===U.id?G:me)))}).catch(G=>{console.error("Error loading complete routine data:",G)})):a(_[0])}}else{const I=await fetch("/api/demo/routines");if(I.ok){const O=await I.json();if(console.log("Fetched demo routines from server:",O.length),O.length>0&&z){const L=O.map(_=>{var U;return{..._,exercises:(U=_.exercises)==null?void 0:U.map(G=>({...G,date:G.date||G.updatedAt||_.updatedAt||new Date().toISOString(),notes:G.notes||""}))}});s(L),a(L[0])}else if(z){const L=await fetch("/api/demo/routines",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"My First Routine"})});if(L.ok){const _=await L.json();s([_]),a(_)}else{const _=P();s([_]),a(_)}}}else if(z){const O=P();s([O]),a(O)}}R(!!e)}catch(T){console.error("Error initializing data:",T),z&&(s([]),a(null))}finally{z&&n(!1)}})(),()=>{z=!1}},[e,k]),m.useEffect(()=>{e&&o&&o.id!=null&&localStorage.setItem(eC,o.id.toString())},[e,o==null?void 0:o.id]),m.useEffect(()=>{if(!e&&i.length>0){const z={routines:i,selectedRoutineId:o==null?void 0:o.id};localStorage.setItem(xm,JSON.stringify(z))}else e&&localStorage.removeItem(xm)},[i,o==null?void 0:o.id,e]),m.useEffect(()=>{if(!g)return;const z=setTimeout(()=>{const E=()=>{v(!1)};return window.addEventListener("click",E),()=>window.removeEventListener("click",E)},500);return()=>clearTimeout(z)},[g]),m.useEffect(()=>{if(g&&!w){const z=setTimeout(()=>{const E={title:"Ready to crush it? đŸ’Ē",description:"Tap Success or Fail once you've completed all your sets!",duration:5e3};B.toast(E),x(!0)},300);return()=>clearTimeout(z)}},[g,w,B]),m.useEffect(()=>{if(o!=null&&o.exercises){const z={};o.exercises.forEach(E=>{var I;const T=((I=E.completedSets)==null?void 0:I.filter(O=>O.metrics.weight===E.weight&&O.metrics.reps===E.reps&&O.metrics.sets===E.sets))||[];if(T.length>=4){const O=T.slice(-4),L=O.every(U=>U.completed),_=O.every(U=>!U.completed);L||_?z[E.id]=L?"increase":"decrease":z[E.id]=null}else z[E.id]=null}),J(z)}},[o==null?void 0:o.exercises]);const H=async(z,E)=>{if(o)try{const T=e?`/api/routines/${o.id}/exercises/${z}/notes`:`/api/demo/routines/${o.id}/exercises/${z}/notes`,I=await fetch(T,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({notes:E||""}),credentials:"include"});if(!I.ok){const O=await I.text();throw console.error("Failed to update note:",O),new Error("Failed to update note")}s(O=>{const L=O.map(U=>U.id===o.id?{...U,exercises:U.exercises.map(G=>G.id===z?{...G,notes:E||""}:G)}:U),_=L.find(U=>U.id===o.id);return _&&a(_),L})}catch(T){console.error("Error updating note:",T),B.toast({title:"Oops! Your note got away from us!",description:"Failed to save note. Please try again.",variant:"destructive"})}},ne=async z=>{if(o)try{const E=e?`/api/routines/${o.id}/exercises`:`/api/demo/routines/${o.id}/exercises`,T=e?{credentials:"include"}:{},I=await fetch(E,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...z,order:(o.exercises||[]).length,date:new Date().toISOString()}),...T});if(!I.ok)throw new Error("Failed to save exercise");const O=await I.json();s(L=>{const _=L.map(G=>{if(G.id===o.id){const ce=G.exercises||[];return ce.length===0&&v(!0),{...G,exercises:[...ce,{...O,date:O.date||new Date().toISOString()}],updatedAt:new Date().toISOString()}}return G}),U=_.find(G=>G.id===o.id);return U&&a(U),_})}catch(E){console.error("Error saving exercise:",E)}},ae=async(z,E)=>{v(!1),x(!1),E&&oW({particleCount:100,spread:70,origin:{y:.6}});const T=new Date().toISOString(),I=(O,L)=>{const _=L.filter(U=>U.metrics.weight===O.weight&&U.metrics.reps===O.reps&&U.metrics.sets===O.sets);if(_.length>=4){const U=_.slice(-4),G=U.every(me=>me.completed),ce=U.every(me=>!me.completed);if(G||ce){let me=!1;_.length===4?me=!0:_.length>4&&(me=_[_.length-5].completed!==U[0].completed),me&&setTimeout(()=>{W({open:!0,type:G?"increase":"decrease"})},1e3)}}};try{const O=e?`/api/routines/${o==null?void 0:o.id}/exercises/${z}/status`:`/api/demo/routines/${o==null?void 0:o.id}/exercises/${z}/status`,L=e?{credentials:"include"}:{},_=await fetch(O,{method:"PATCH",headers:{"Content-Type":"application/json","Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"},body:JSON.stringify({success:E,date:T}),...L});if(!_.ok)throw new Error("Failed to update exercise status");const U=await _.json();e?(s(G=>G.map(ce=>ce.id===(o==null?void 0:o.id)?{...ce,exercises:ce.exercises.map(me=>me.id===z?{...me,...U,date:T,completedSets:U.completedSets||[],success:U.success||!1}:me)}:ce)),a(G=>{if(!G)return null;const ce={...G,exercises:G.exercises.map($e=>$e.id===z?{...$e,...U,date:T,completedSets:U.completedSets||[],success:U.success||!1}:$e)},me=ce.exercises.find($e=>$e.id===z);return me&&I(me,me.completedSets),ce})):s(G=>{const ce=G.map($e=>{if($e.id===(o==null?void 0:o.id)){const ft=$e.exercises.map(qe=>{if(qe.id===z){const ar=[...qe.completedSets,{completed:E,timestamp:T,metrics:{weight:qe.weight,reps:qe.reps,sets:qe.sets}}],ci={...qe,completedSets:ar,success:ar.every(eo=>eo.completed),date:T};return I(ci,ar),ci}return qe});return{...$e,exercises:ft,updatedAt:T}}return $e}),me=ce.find($e=>$e.id===(o==null?void 0:o.id));return me&&a(me),ce})}catch(O){console.error("Error updating exercise status:",O)}},de=async()=>{if(!u||!o)return;console.log("đŸ—‘ī¸ Deleting log for",e?"authenticated":"demo","user"),N(!0);const z=`${u.exerciseId}-${u.setIndex}`;C(E=>new Set(E).add(z)),setTimeout(async()=>{var E,T;try{let I=!1;if(e){console.log("🔐 AUTHENTICATED USER: Processing deletion...");const O=o.exercises.find(_=>_.id===u.exerciseId);if(!O||!O.completedSets||u.setIndex>=O.completedSets.length){console.error("❌ AUTHENTICATED: Exercise or set not found",{exerciseFound:!!O,completedSetsLength:((E=O==null?void 0:O.completedSets)==null?void 0:E.length)||0,requestedIndex:u.setIndex});return}const L=O.completedSets[u.setIndex];if(console.log("đŸŽ¯ AUTHENTICATED: Target set to remove:",{setToRemove:L,hasCompletionId:!!L.completionId,completionId:L.completionId}),L&&L.completionId)try{console.log("📤 AUTHENTICATED: Sending delete request for completion:",L.completionId);const _=await fetch(`/api/v2/completions/${L.completionId}`,{method:"DELETE",credentials:"include",headers:{"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(_.ok){const U=await _.json();console.log("✅ AUTHENTICATED: Server delete response:",U),U.verified?(I=!0,console.log("✅ AUTHENTICATED: Backend verified deletion:",U.deletedId)):(console.warn("âš ī¸ AUTHENTICATED: Backend did not verify deletion"),I=!1)}else console.error("Server deletion failed, status:",_.status),I=!1}catch(_){console.error("Error deleting completion from server:",_),I=!1}else console.log("â„šī¸ AUTHENTICATED: No server-side completion to delete (newly added log), proceeding with client-side deletion"),I=!0;if(I){const _=O.completedSets.filter((G,ce)=>ce!==u.setIndex),U={...O,completedSets:_,success:_.length>0?(T=_[_.length-1])==null?void 0:T.completed:!1,date:_.length>0?_[_.length-1].timestamp:O.date};s(G=>G.map(ce=>ce.id===o.id?{...ce,exercises:ce.exercises.map(me=>me.id===O.id?U:me),updatedAt:new Date().toISOString()}:ce)),a(G=>G?{...G,exercises:G.exercises.map(ce=>ce.id===O.id?U:ce),updatedAt:new Date().toISOString()}:null),console.log("✅ AUTHENTICATED: UI state updated - deleted log removed")}}else{console.log("đŸ‘Ĩ DEMO USER: Processing client-side deletion...");const O=o.exercises.find(L=>L.id===u.exerciseId);if(O&&O.completedSets&&u.setIndex{const _=L.map(G=>{if(G.id!==o.id)return G;const ce=G.exercises.map(me=>{if(me.id===u.exerciseId){const $e=me.completedSets.length,ft=[...me.completedSets];ft.splice(u.setIndex,1);const qe=ft.length;console.log("📊 DEMO: Client-side set removal:",{beforeCount:$e,afterCount:qe,removedIndex:u.setIndex,success:$e>qe});const ar=ft.length>0?ft[ft.length-1].timestamp:new Date().toISOString();return{...me,completedSets:ft,success:ft.length>0&&ft.every(ci=>ci.completed),date:ar}}return me});return{...G,exercises:ce,updatedAt:new Date().toISOString()}}),U=_.find(G=>G.id===o.id);return U&&(a(U),console.log("✅ DEMO: Client-side state updated successfully")),_})}}catch(I){console.error("❌ FATAL ERROR in handleRemoveSet:",I),N(!1)}C(I=>{const O=new Set(I);return O.delete(z),O}),d(null),N(!1),console.log("🏁 REMOVE SET: Process completed")},300)},ue=async z=>{b(z),setTimeout(async()=>{c({index:-1,exercise:null});try{const E=e?`/api/routines/${o==null?void 0:o.id}/exercises/${z}`:`/api/demo/routines/${o==null?void 0:o.id}/exercises/${z}`,I=await fetch(E,{method:"DELETE",...e?{credentials:"include"}:{}});if(!I.ok)throw new Error("Failed to delete exercise");const O=await I.json();a(O),s(L=>L.map(_=>_.id===O.id?O:_))}catch(E){console.error("Error deleting exercise:",E)}finally{b(null)}},300)},re=z=>{F({open:!0,type:"exercise",id:z.id,name:z.name})},ge=()=>{X.type==="routine"?Fe(X.id):ue(X.id)},we=async z=>{try{if(e){const E=await fetch("/api/routines",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:z}),credentials:"include"});if(!E.ok)throw new Error("Failed to add routine");const T=await E.json();s([...i,T]),a(T)}else{const E=await fetch("/api/demo/routines",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:z})});if(!E.ok)throw new Error("Failed to add demo routine");const T=await E.json();s([...i,T]),a(T)}}catch(E){console.error("Error adding routine:",E)}},ke=async(z,E)=>{try{if(e){const T=await fetch(`/api/routines/${z}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:E}),credentials:"include"});if(!T.ok)throw new Error("Failed to edit routine");const I=await T.json();s(O=>O.map(L=>L.id===z?I:L)),a(I)}else s(T=>T.map(O=>{if(O.id===z){const L={...O,name:E,updatedAt:new Date().toISOString()};return(o==null?void 0:o.id)===z&&a(L),L}return O}))}catch(T){console.error("Error editing routine:",T)}},Ae=async z=>{if(!z.exercises||z.exercises.length===0)return z;try{if(e){const E=await Promise.all(z.exercises.map(async T=>{var I,O;try{const L=await fetch(`/api/v2/exercises/${T.id}/variations`,{credentials:"include",headers:{"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(L.ok){const _=await L.json();if(_&&_.length>0){const U=_.find(ce=>ce.isCurrent)||_[0],G=((I=U==null?void 0:U.completions)==null?void 0:I.map(ce=>({completed:ce.success,timestamp:ce.completedAt||new Date().toISOString(),completionId:ce.id,metrics:{weight:U.targetWeight,reps:U.targetReps,sets:U.targetSets}})))||[];return{...T,weight:(U==null?void 0:U.targetWeight)||T.weight,reps:(U==null?void 0:U.targetReps)||T.reps,sets:(U==null?void 0:U.targetSets)||T.sets,completedSets:G,success:G.length>0?(O=G[G.length-1])==null?void 0:O.completed:!1}}}}catch(L){console.error(`Error fetching variations for exercise ${T.id}:`,L)}return T}));return{...z,exercises:E}}return z}catch(E){return console.error("Error loading complete routine data:",E),z}},Fe=async z=>{try{const E=e?`/api/routines/${z}`:`/api/demo/routines/${z}`,I=await fetch(E,{method:"DELETE",...e?{credentials:"include"}:{}});if(!I.ok)throw new Error("Failed to delete routine");const O=await I.json();if(s(O),O.length>0){const L=O[0],_=await Ae(L),U=O.map(G=>G.id===L.id?_:G);s(U),a(_)}else a(null)}catch(E){console.error("Error deleting routine:",E)}},Ve=z=>{F({open:!0,type:"routine",id:z.id,name:z.name})},Ee=(z,E)=>{const T=te[E.id];if(!z||z.length===0)return f.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[f.jsxs("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full border border-dashed border-gray-300 bg-gray-50 relative overflow-hidden opacity-100",children:[f.jsx("span",{className:"absolute inset-0 flex items-center justify-center animate-[pulseSuccess_3s_ease-in-out_infinite] bg-green-100 border-green-700 rounded-full",children:f.jsx(Kn,{size:14,className:"text-green-700"})}),f.jsx("span",{className:"absolute inset-0 flex items-center justify-center animate-[pulseFail_3s_ease-in-out_infinite] bg-red-100 border-red-700 rounded-full",children:f.jsx(El,{size:14,className:"text-red-700"})})]}),f.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full border border-dashed border-gray-300 bg-gray-50 opacity-90"}),f.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full border border-dashed border-gray-300 bg-gray-50 opacity-75"}),f.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full border border-dashed border-gray-300 bg-gray-50 opacity-60"}),f.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full border border-dashed border-gray-300 bg-gray-50 opacity-45"}),f.jsx("span",{className:"inline-flex items-center justify-center w-6 h-6 rounded-full border border-dashed border-gray-300 bg-gray-50 opacity-30"}),T&&f.jsx(Iu,{children:f.jsxs(Mu,{children:[f.jsx(Ou,{asChild:!0,children:f.jsx(be,{variant:"ghost",size:"sm",className:"w-6 h-6 p-0 flex items-center justify-center ml-1",onClick:()=>{W({open:!0,type:T})},children:T==="increase"?f.jsx(Fo,{className:"h-4 w-4 text-green-500"}):f.jsx(Cl,{className:"h-4 w-4 text-red-500"})})}),f.jsx(fl,{children:T==="increase"?"Suggest increasing difficulty":"Suggest decreasing difficulty"})]})})]});const I=z.filter(O=>O.metrics.weight===E.weight&&O.metrics.reps===E.reps&&O.metrics.sets===E.sets);return I.length===0?f.jsx("div",{className:"flex items-center gap-1",children:T&&f.jsx(Iu,{children:f.jsxs(Mu,{children:[f.jsx(Ou,{asChild:!0,children:f.jsx(be,{variant:"ghost",size:"sm",className:"w-6 h-6 p-0 flex items-center justify-center ml-1",onClick:()=>{W({open:!0,type:T})},children:T==="increase"?f.jsx(Fo,{className:"h-4 w-4 text-green-500"}):f.jsx(Cl,{className:"h-4 w-4 text-red-500"})})}),f.jsx(fl,{children:T==="increase"?"Suggest increasing difficulty":"Suggest decreasing difficulty"})]})})}):f.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[I.map((O,L)=>f.jsx("span",{className:`inline-flex items-center justify-center w-6 h-6 rounded-full border cursor-pointer transition-all duration-300 hover:scale-110 ${O.completed?"bg-green-100 text-green-700 border-green-700 hover:bg-green-200":"bg-red-100 text-red-700 border-red-700 hover:bg-red-200"} ${S.has(`${E.id}-${L}`)?"log-fade-out":""}`,onClick:()=>d({exerciseId:E.id,setIndex:L,isSuccess:O.completed}),title:`${tC(E)} ${O.metrics.weight}kg | ${O.metrics.reps} reps | ${O.metrics.sets} sets`,children:O.completed?f.jsx(Kn,{size:14}):f.jsx(El,{size:14})},L)),T&&f.jsx(Iu,{children:f.jsxs(Mu,{children:[f.jsx(Ou,{asChild:!0,children:f.jsx(be,{variant:"ghost",size:"sm",className:"w-6 h-6 p-0 flex items-center justify-center ml-1",onClick:()=>{W({open:!0,type:T})},children:T==="increase"?f.jsx(Fo,{className:"h-4 w-4 text-green-500"}):f.jsx(Cl,{className:"h-4 w-4 text-red-500"})})}),f.jsx(fl,{children:T==="increase"?"Suggest increasing difficulty":"Suggest decreasing difficulty"})]})}),f.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-400 italic ml-2",children:[f.jsx(Md,{className:"h-3 w-3"}),tC(E).split(" @ ")[0]]})]})},st=async z=>{if(!z.destination||!(o!=null&&o.exercises))return;const E=z.source.index,T=z.destination.index,I=[...i],O=o;try{const L=Array.from(o.exercises),[_]=L.splice(E,1);L.splice(T,0,_);const U=L.map((ft,qe)=>({...ft,order:qe})),G={...o,exercises:U,updatedAt:new Date().toISOString()};s(ft=>ft.map(qe=>qe.id===G.id?G:qe)),a(G);const ce=e?`/api/routines/${o.id}/exercises/reorder`:`/api/demo/routines/${o.id}/exercises/reorder`,me=await fetch(ce,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({exercises:U}),credentials:"include"});if(!me.ok)throw new Error("Failed to save exercise order");const $e=await me.json();s(ft=>ft.map(qe=>qe.id===$e.id?$e:qe)),a($e)}catch(L){console.error("Error saving exercise order:",L),s(I),a(O)}};return f.jsx(H4,{onDragEnd:st,children:f.jsx(m.Suspense,{fallback:f.jsx(rC,{}),children:f.jsx("div",{className:"w-full pb-8 px-4",children:r?f.jsx(rC,{}):f.jsxs(f.Fragment,{children:[!e&&(o==null?void 0:o.exercises)&&o.exercises.length>0&&f.jsx(sW,{children:f.jsx(y1.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{type:"spring",stiffness:100,damping:15},className:"mt-4",children:f.jsx(qr,{href:"/register",children:f.jsx(Mj,{className:"bg-yellow-100 border-0 shadow-none cursor-pointer hover:bg-yellow-200 transition-colors",children:f.jsxs("div",{className:"flex items-center space-x-3",children:[f.jsx(dL,{className:"h-8 w-8 text-black"}),f.jsx(Oj,{className:"text-black",children:"Don't let those gains vanish into thin air! Sign up to keep your progress safe and sound."})]})})})})}),f.jsx("div",{className:"py-4 space-y-4",children:o&&f.jsxs(f.Fragment,{children:[f.jsx(D7,{routines:i}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(jG,{children:[f.jsx(IG,{asChild:!0,children:f.jsxs(be,{variant:"outline",className:"flex-1 justify-between",children:[o.name,f.jsx(IP,{className:"ml-2 h-4 w-4"})]})}),f.jsx(yR,{className:"w-[var(--radix-dropdown-menu-trigger-width)]",children:i.map(z=>f.jsxs(xR,{className:"flex items-center justify-between pr-2",onClick:()=>a(z),children:[f.jsx("span",{children:z.name}),f.jsx(be,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 ml-2",onClick:E=>{E.stopPropagation(),h({open:!0,mode:"edit"}),a(z)},children:f.jsx(_P,{className:"h-3 w-3"})})]},z.id))})]}),f.jsxs(be,{onClick:()=>h({open:!0,mode:"create"}),className:"flex items-center gap-2 whitespace-nowrap",children:[f.jsx(Lo,{className:"h-4 w-4"}),"Add routine"]})]}),f.jsx(dA,{droppableId:`exercises-${o.id}`,children:z=>{var E;return f.jsxs("div",{...z.droppableProps,ref:z.innerRef,className:"space-y-4",children:[((E=o.exercises)==null?void 0:E.length)>0?o.exercises.map((T,I)=>f.jsx(A3,{draggableId:T.id.toString(),index:I,children:(O,L)=>f.jsx(y1.div,{ref:O.innerRef,...O.draggableProps,className:`border rounded-lg bg-white transition-all duration-300 ${L.isDragging?"shadow-lg":""} ${y===T.id?"exercise-fade-out":""}`,children:f.jsxs("div",{className:"flex",children:[f.jsxs("div",{className:"flex-1 p-4 space-y-2",children:[f.jsxs("div",{className:"grid grid-cols-[1fr,auto] items-center gap-4",children:[f.jsx("h3",{className:"font-medium truncate",children:T.name}),f.jsx("div",{className:"grid grid-flow-col auto-cols-[32px] gap-2 items-center",children:f.jsx(Iu,{children:f.jsxs(Mu,{children:[f.jsx(Ou,{asChild:!0,children:f.jsx(be,{variant:"ghost",size:"sm",className:"w-8 h-8 p-0 flex items-center justify-center",onClick:()=>{c({index:I,exercise:T})},children:f.jsx(fL,{className:"h-4 w-4"})})}),f.jsx(fl,{children:"Edit exercise"})]})})})]}),f.jsxs("p",{className:"text-sm text-gray-600",children:[T.weight,"kg | ",T.reps," reps | ",T.sets," sets"]}),Ee(T.completedSets,T),f.jsxs("div",{className:"flex gap-2 pt-2",children:[f.jsxs(be,{variant:"outline",size:"sm",className:"flex items-center gap-1 bg-white hover:border-green-500",onClick:()=>ae(T.id,!0),children:["Success",f.jsx(Kn,{className:"h-4 w-4 text-green-500"})]}),f.jsxs(be,{variant:"outline",size:"sm",className:"flex items-center gap-1 bg-white hover:border-red-500",onClick:()=>ae(T.id,!1),children:["Fail",f.jsx(El,{className:"h-4 w-4 text-red-500"})]})]}),f.jsx("div",{className:"mt-3 cursor-pointer hover:bg-gray-50 rounded px-2 pt-2 transition-colors",onClick:()=>A({open:!0,exerciseId:T.id,currentNote:T.notes||""}),children:f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx(OP,{className:"h-4 w-4 text-gray-400 mt-0.5 flex-shrink-0"}),T.notes&&typeof T.notes=="string"&&T.notes.trim()?f.jsx("p",{className:"text-sm text-gray-400 line-clamp-2 break-words",children:T.notes}):f.jsx("p",{className:"text-sm text-gray-400 italic",children:"Note to self"})]})})]}),f.jsx("div",{...O.dragHandleProps,className:"flex items-center px-2 border-l",children:f.jsx(sL,{className:"h-4 w-4 text-gray-400"})})]})})},T.id.toString())):f.jsxs("div",{className:"border-2 border-dashed border-gray-200 rounded-lg p-8 text-center",children:[f.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-1",children:"No exercises yet"}),f.jsx("p",{className:"text-gray-500 mb-4",children:"Add your first exercise to get started with your routine"}),f.jsxs(be,{onClick:()=>q(!0),className:"inline-flex items-center gap-2",children:[f.jsx(Lo,{className:"h-4 w-4"}),"Add First Exercise"]})]}),z.placeholder]})}}),((dt=o.exercises)==null?void 0:dt.length)>0&&f.jsxs(be,{className:"w-full mb-8",onClick:()=>q(!0),children:[f.jsx(Lo,{className:"h-4 w-4 mr-2"}),"Add Exercise"]})]})}),f.jsx(V9,{open:V,onOpenChange:q,onSubmit:ne}),l.exercise&&f.jsx(J9,{open:l.index!==-1,onOpenChange:async z=>{if(!z){if(console.log("🔄 Edit dialog closing - refreshing data..."),e&&o){const E=await Ae(o);a(E),s(T=>T.map(I=>I.id===o.id?E:I)),console.log("✅ Refreshed routine data after edit dialog close")}else if(!e){const E=await fetch("/api/demo/routines");if(E.ok){const T=await E.json();console.log("✅ Refreshed demo routine data after edit dialog close");const I=T.map(L=>{var _;return{...L,exercises:(_=L.exercises)==null?void 0:_.map(U=>({...U,date:U.date||U.updatedAt||L.updatedAt||new Date().toISOString(),notes:U.notes||""}))}});s(I);const O=I.find(L=>L.id===(o==null?void 0:o.id));a(O||I[0]||null)}}c({index:-1,exercise:null})}},exercise:l.exercise,onDelete:()=>re(l.exercise),onRefresh:async()=>{if(console.log("🔄 Refreshing after variant change..."),e&&o){const z=await Ae(o);a(z),s(E=>E.map(T=>T.id===o.id?z:T)),console.log("✅ Refreshed routine data after variant change")}else if(!e){const z=await fetch("/api/demo/routines");if(z.ok){const E=await z.json();console.log("✅ Refreshed demo routine data after variant change");const T=E.map(O=>{var L;return{...O,exercises:(L=O.exercises)==null?void 0:L.map(_=>({..._,date:_.date||_.updatedAt||O.updatedAt||new Date().toISOString(),notes:_.notes||""}))}});s(T);const I=T.find(O=>O.id===(o==null?void 0:o.id));a(I||T[0]||null)}}}}),f.jsx(r7,{open:p.open,onOpenChange:z=>h({...p,open:z}),onSubmit:p.mode==="create"?we:z=>ke(o.id,z),onDelete:p.mode==="edit"?()=>Ve(o):void 0,routine:p.mode==="edit"&&o||void 0,mode:p.mode,existingRoutines:i}),u&&f.jsx(e7,{open:!!u,onOpenChange:()=>d(null),onConfirm:de,isSuccess:u.isSuccess}),M&&f.jsx(P7,{open:M.open,onOpenChange:z=>W(z?M:null),type:M.type,onEditExercise:()=>{const z=o==null?void 0:o.exercises.find(E=>E.completedSets.length>=4&&(M.type==="increase"&&E.completedSets.slice(-4).every(T=>T.completed)||M.type==="decrease"&&E.completedSets.slice(-4).every(T=>!T.completed)));if(z){const E=o==null?void 0:o.exercises.indexOf(z);E!==void 0&&E!==-1&&c({index:E,exercise:z})}}}),f.jsx(a7,{}),$&&f.jsx(n7,{open:$.open,onOpenChange:z=>A(z?$:null),initialNote:$.currentNote,onSave:z=>H($.exerciseId,z)}),f.jsx(A7,{open:X.open,onOpenChange:z=>F(E=>({...E,open:z})),onConfirm:ge,title:X.type==="routine"?"Drop this routine?":"Cut this exercise?",description:`This will delete "${X.name}" ${X.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=m.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:Ce("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));rn.displayName="Card";const Gs=m.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:Ce("flex flex-col space-y-1.5 p-6",e),...t}));Gs.displayName="CardHeader";const Ks=m.forwardRef(({className:e,...t},r)=>f.jsx("h3",{ref:r,className:Ce("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ks.displayName="CardTitle";const Tf=m.forwardRef(({className:e,...t},r)=>f.jsx("p",{ref:r,className:Ce("text-sm text-muted-foreground",e),...t}));Tf.displayName="CardDescription";const Cn=m.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:Ce("p-6 pt-0",e),...t}));Cn.displayName="CardContent";const Pf=m.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:Ce("flex items-center p-6 pt-0",e),...t}));Pf.displayName="CardFooter";const k7=Nc("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 Pv({className:e,variant:t,...r}){return f.jsx("div",{className:Ce(k7({variant:t}),e),...r})}function R7(){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 f.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})}function wm(){const e=[{icon:f.jsx(MP,{className:"h-6 w-6"}),title:"Simple Workout Logging",description:"Quick and intuitive workout tracking without the complexity"},{icon:f.jsx(_y,{className:"h-6 w-6"}),title:"Rest Timer",description:"Built-in timer to track breaks between sets"},{icon:f.jsx(Fo,{className:"h-6 w-6"}),title:"Progress Tracking",description:"Monitor your improvement over time with clear workout history"},{icon:f.jsx(pL,{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 f.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-blue-100/45 via-purple-100/45 to-pink-100/45",children:[f.jsx("div",{className:"container mx-auto px-4 pt-8 pb-8",children:f.jsxs("div",{className:"text-center max-w-4xl mx-auto",children:[f.jsx(Pv,{variant:"secondary",className:"mb-4 bg-gray-900 text-white hover:bg-gray-800",children:"Simple. Powerful. Effective."}),f.jsxs("h1",{className:"text-4xl md:text-6xl font-bold tracking-tight mb-6",children:["Track Workouts",f.jsx("span",{className:"block text-primary",children:"The Simple Way"})]}),f.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."}),f.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center mb-6",children:[f.jsx(qr,{href:"/workout",children:f.jsxs(be,{size:"lg",className:"px-8 py-6 text-lg",children:["Try Now",f.jsx(Rh,{className:"ml-2 h-5 w-5"})]})}),f.jsx(qr,{href:"/register",children:f.jsx(be,{variant:"outline",size:"lg",className:"px-8 py-6 text-lg",children:"Sign Up Free"})})]}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"No commitment â€ĸ Start tracking immediately"})]})}),f.jsx("div",{className:"bg-gradient-to-br from-purple-100/55 via-blue-100/55 to-pink-100/55 py-16",children:f.jsx("div",{className:"container mx-auto px-4",children:f.jsxs("div",{className:"max-w-6xl mx-auto",children:[f.jsxs("div",{className:"text-center mb-12",children:[f.jsx("h2",{className:"text-3xl font-bold tracking-tight mb-4",children:"Clean, Focused Interface"}),f.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."})]}),f.jsx("div",{className:"flex justify-center",children:f.jsx("div",{className:"bg-white rounded-3xl p-1 shadow-2xl border border-gray-200",children:f.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"})})})]})})}),f.jsx("div",{className:"container mx-auto px-4 py-16",children:f.jsx("div",{className:"max-w-6xl mx-auto",children:f.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[f.jsxs("div",{children:[f.jsx(Pv,{variant:"secondary",className:"mb-4 bg-gradient-to-r from-purple-600 to-blue-600 text-white",children:"Advanced Analytics"}),f.jsxs("h2",{className:"text-3xl font-bold tracking-tight mb-6",children:["Track Your Progress with",f.jsx("span",{className:"block text-primary",children:"Smart Analytics"})]}),f.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."}),f.jsxs("div",{className:"space-y-6",children:[f.jsxs("div",{className:"flex items-start gap-4",children:[f.jsx("div",{className:"p-2 bg-purple-100 rounded-lg",children:f.jsx(J_,{className:"h-6 w-6 text-purple-600"})}),f.jsxs("div",{children:[f.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Daily Activity Visualization"}),f.jsx("p",{className:"text-muted-foreground",children:"See your workout patterns at a glance with intuitive activity bars and completion rates."})]})]}),f.jsxs("div",{className:"flex items-start gap-4",children:[f.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:f.jsx(My,{className:"h-6 w-6 text-blue-600"})}),f.jsxs("div",{children:[f.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Progress Comparison"}),f.jsx("p",{className:"text-muted-foreground",children:"Compare your current performance against previous periods to track real improvement."})]})]}),f.jsxs("div",{className:"flex items-start gap-4",children:[f.jsx("div",{className:"p-2 bg-orange-100 rounded-lg",children:f.jsx(Oy,{className:"h-6 w-6 text-orange-600"})}),f.jsxs("div",{children:[f.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Workout Streaks"}),f.jsx("p",{className:"text-muted-foreground",children:"Build consistency with streak tracking that motivates you to keep going week after week."})]})]})]})]}),f.jsx("div",{className:"flex justify-center lg:justify-end",children:f.jsxs("div",{className:"relative",children:[f.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"}),f.jsx("div",{className:"relative bg-white rounded-2xl p-4 shadow-2xl border border-gray-200 max-w-sm",children:f.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"})})]})})]})})}),f.jsxs("div",{className:"container mx-auto px-4 py-16",children:[f.jsxs("div",{className:"text-center mb-12",children:[f.jsx("h2",{className:"text-3xl font-bold tracking-tight mb-4",children:"Everything You Need, Nothing You Don't"}),f.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."})]}),f.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-6 max-w-6xl mx-auto",children:e.map((r,n)=>f.jsxs(rn,{className:"border-muted hover:border-primary/20 transition-colors bg-white",children:[f.jsx(Gs,{className:"pb-3",children:f.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[f.jsx("div",{className:"p-2 bg-primary/10 rounded-lg text-primary",children:r.icon}),f.jsx(Ks,{className:"text-lg",children:r.title})]})}),f.jsx(Cn,{children:f.jsx("p",{className:"text-muted-foreground leading-relaxed",children:r.description})})]},n))})]}),f.jsx("div",{className:"bg-gradient-to-br from-pink-100/55 via-purple-100/55 to-blue-100/55 py-16",children:f.jsx("div",{className:"container mx-auto px-4",children:f.jsxs("div",{className:"max-w-4xl mx-auto",children:[f.jsxs("div",{className:"text-center mb-12",children:[f.jsx(Od,{className:"h-12 w-12 text-primary mx-auto mb-4"}),f.jsx("h2",{className:"text-3xl font-bold tracking-tight mb-4",children:"Why Choose LiftEasy?"}),f.jsx("p",{className:"text-lg text-muted-foreground",children:"We believe fitness tracking should enhance your workout, not complicate it."})]}),f.jsxs("div",{className:"grid md:grid-cols-2 gap-8 items-center",children:[f.jsxs("div",{children:[f.jsx("h3",{className:"text-2xl font-semibold mb-6",children:"Built for Real Workouts"}),f.jsx("div",{className:"space-y-4",children:t.map((r,n)=>f.jsxs("div",{className:"flex items-start gap-3",children:[f.jsx(Kn,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),f.jsx("p",{className:"text-muted-foreground",children:r})]},n))})]}),f.jsx(rn,{className:"p-8 bg-white border rounded-lg",children:f.jsxs("div",{className:"text-center",children:[f.jsx("div",{className:"text-3xl font-bold text-primary mb-2",children:"No Setup Required"}),f.jsx("p",{className:"text-muted-foreground mb-6",children:"Start tracking your first workout in under 30 seconds. No tutorials, no configuration, no complexity."}),f.jsx(qr,{href:"/workout",children:f.jsxs(be,{className:"w-full",children:["Start Your First Workout",f.jsx(Rh,{className:"ml-2 h-4 w-4"})]})})]})})]})]})})}),f.jsx("div",{className:"container mx-auto px-4 py-16",children:f.jsxs("div",{className:"text-center max-w-3xl mx-auto",children:[f.jsx("h2",{className:"text-3xl font-bold tracking-tight mb-4",children:"Ready to Simplify Your Fitness Journey?"}),f.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."}),f.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center mb-6",children:[f.jsx(qr,{href:"/workout",children:f.jsxs(be,{size:"lg",className:"px-8 py-6 text-lg",children:["Try Now",f.jsx(Rh,{className:"ml-2 h-5 w-5"})]})}),f.jsx(qr,{href:"/register",children:f.jsx(be,{variant:"outline",size:"lg",className:"px-8 py-6 text-lg",children:"Sign Up Free"})})]}),f.jsx("p",{className:"text-sm text-muted-foreground",children:"No commitment â€ĸ Start tracking immediately"})]})}),f.jsx("footer",{className:"border-t bg-white py-8",children:f.jsx("div",{className:"container mx-auto px-4",children:f.jsxs("div",{className:"text-center",children:[f.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[f.jsx("span",{className:"text-2xl",children:"đŸ’Ē"}),f.jsx("span",{className:"text-xl font-bold",children:"LiftEasy"})]}),f.jsx("p",{className:"text-muted-foreground",children:"Simple workout tracking for focused fitness"})]})})}),f.jsx(R7,{})]})}const j7=Op({email:bn().email("Please enter a valid email address"),password:bn().min(6,"Password must be at least 6 characters")});function nC({mode:e}){const{login:t,register:r}=Hp(),{toast:n}=Pc(),[,i]=Hf(),s=jp({resolver:Ip(j7),defaultValues:{email:"",password:""}}),o=async a=>{try{const u=await(e==="login"?t:r)(a);if(!u.ok)throw new Error(u.message);n({title:`${e==="login"?"Welcome back, champion! đŸ’Ē":"You're in! Let's get swole! 🎉"}`,description:`Successfully ${e==="login"?"logged in":"registered"}!`}),i("/workout",{replace:!0})}catch(l){n({variant:"destructive",title:"Oops! That didn't go as planned! 😅",description:l.message})}};return f.jsx("div",{className:"flex items-center justify-center px-4 pt-8",children:f.jsxs(rn,{className:"w-full max-w-md",children:[f.jsxs(Gs,{children:[f.jsx(Ks,{children:e==="login"?"Welcome Back! đŸ’Ē":"Let's go! 🚀"}),f.jsx(Tf,{children:e==="login"?"Track your workouts and see your progress":"Create an account to start tracking your fitness journey"})]}),f.jsx(Cn,{children:f.jsx(_p,{...s,children:f.jsxs("form",{onSubmit:s.handleSubmit(o),className:"space-y-4",children:[f.jsx(Sn,{control:s.control,name:"email",render:({field:a})=>f.jsxs(Xr,{children:[f.jsx(Jr,{children:"Email"}),f.jsx(en,{children:f.jsx(Mr,{placeholder:"john@example.com",type:"email",autoComplete:"email",autoFocus:!0,...a})}),f.jsx(tn,{})]})}),f.jsx(Sn,{control:s.control,name:"password",render:({field:a})=>f.jsxs(Xr,{children:[f.jsx(Jr,{children:"Password"}),f.jsx(en,{children:f.jsx(Mr,{type:"password",placeholder:"â€ĸâ€ĸâ€ĸâ€ĸâ€ĸâ€ĸ",autoComplete:"current-password",...a})}),f.jsx(tn,{})]})}),f.jsxs(be,{type:"submit",className:"w-full",disabled:s.formState.isSubmitting,children:[s.formState.isSubmitting&&f.jsx(xs,{className:"mr-2 h-4 w-4 animate-spin"}),e==="login"?"Login":"Sign Up"]})]})})}),f.jsxs(Pf,{className:"flex flex-col items-center",children:[f.jsx("p",{className:"text-sm text-muted-foreground",children:e==="login"?"Don't have an account?":"Already have an account?"}),f.jsx(qr,{href:e==="login"?"/register":"/login",children:f.jsx(be,{variant:"link",className:"mt-1",type:"button",children:e==="login"?"Sign up now":"Login instead"})})]})]})})}function I7(){const{user:e,logout:t}=Hp(),[,r]=Hf(),{toast:n}=Pc(),i=zf(),[s,o]=ee.useState(null);ee.useEffect(()=>{e!=null&&e.isAdmin||r("/")},[e,r]);const{data:a,isLoading:l,error:c}=UT({queryKey:["/api/admin/users"],enabled:!!(e!=null&&e.isAdmin)}),u=Mo({mutationFn:async h=>{const g=await fetch(`/api/admin/users/${h}`,{method:"DELETE",credentials:"include"});if(!g.ok)throw new Error(await g.text());return g.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["/api/admin/users"]}),n({title:"User successfully yeeted! ✨",description:"User and all associated data have been removed."}),o(null)},onError:h=>{n({variant:"destructive",title:"Couldn't complete the deletion mission!",description:h.message})}}),d=Mo({mutationFn:async()=>{const h=await fetch("/api/admin/generate-demo-data",{method:"POST",credentials:"include"});if(!h.ok)throw new Error(await h.text());return h.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:h=>{n({variant:"destructive",title:"Demo gains are being stubborn!",description:h.message})}}),p=Mo({mutationFn:async()=>{const h=await fetch("/api/admin/demo-completions",{method:"DELETE",credentials:"include"});if(!h.ok)throw new Error(await h.text());return h.json()},onSuccess:()=>{i.invalidateQueries({queryKey:["/api/admin/users"]}),n({title:"Demo slate wiped clean! ✨",description:"Successfully deleted all workout completions for demo account."})},onError:h=>{n({variant:"destructive",title:"Demo data is being stubborn!",description:h.message})}});return e!=null&&e.isAdmin?l?f.jsx("div",{className:"flex items-center justify-center min-h-screen",children:f.jsx(xs,{className:"h-8 w-8 animate-spin text-border"})}):c?f.jsx("div",{className:"flex items-center justify-center min-h-screen",children:f.jsx(rn,{className:"w-full max-w-md mx-4",children:f.jsxs(Cn,{className:"pt-6",children:[f.jsxs("div",{className:"flex mb-4 gap-2",children:[f.jsx(mL,{className:"h-8 w-8 text-red-500"}),f.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Error Loading Users"})]}),f.jsx("p",{className:"mt-4 text-sm text-gray-600",children:c instanceof Error?c.message:"Failed to load users"})]})})}):f.jsxs("div",{className:"container mx-auto p-4 max-w-4xl",children:[f.jsxs("div",{className:"flex items-center justify-between mb-6",children:[f.jsx("h1",{className:"text-xl font-bold tracking-tight font-display",children:"đŸ’Ē Lifteasy Admin"}),f.jsxs(be,{variant:"outline",onClick:()=>t(),className:"flex items-center gap-2",children:[f.jsx(oL,{className:"h-4 w-4"}),"Logout"]})]}),f.jsxs(rn,{className:"mb-6",children:[f.jsx(Gs,{children:f.jsxs(Ks,{className:"flex items-center gap-2",children:[f.jsx(iL,{className:"h-5 w-5"}),"Demo Account Management"]})}),f.jsx(Cn,{children:f.jsxs("div",{className:"bg-blue-50 p-4 rounded-lg border border-blue-200",children:[f.jsx("h3",{className:"font-semibold text-blue-800 mb-2",children:"Demo Workout Data Management"}),f.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."}),f.jsxs("div",{className:"flex gap-3",children:[f.jsx(be,{onClick:()=>d.mutate(),disabled:d.isPending||p.isPending,className:"flex items-center gap-2",variant:"outline",children:d.isPending?f.jsxs(f.Fragment,{children:[f.jsx(xs,{className:"h-4 w-4 animate-spin"}),"Generating..."]}):f.jsxs(f.Fragment,{children:[f.jsx(cL,{className:"h-4 w-4"}),"Generate Demo Data"]})}),f.jsx(be,{onClick:()=>p.mutate(),disabled:p.isPending||d.isPending,className:"flex items-center gap-2",variant:"destructive",children:p.isPending?f.jsxs(f.Fragment,{children:[f.jsx(xs,{className:"h-4 w-4 animate-spin"}),"Deleting..."]}):f.jsxs(f.Fragment,{children:[f.jsx(_d,{className:"h-4 w-4"}),"Clear All Completions"]})})]})]})})]}),f.jsxs(rn,{children:[f.jsx(Gs,{children:f.jsx(Ks,{children:"User Management"})}),f.jsx(Cn,{children:f.jsx("div",{className:"space-y-6",children:a==null?void 0:a.map(h=>f.jsx(rn,{className:"border-l-4 border-l-blue-500",children:f.jsxs(Cn,{className:"pt-4",children:[f.jsxs("div",{className:"flex items-start justify-between mb-4",children:[f.jsxs("div",{children:[f.jsx("h3",{className:"font-semibold text-lg",children:h.email}),f.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[f.jsx(My,{className:"h-4 w-4 text-gray-500"}),f.jsxs("span",{className:"text-sm text-gray-600",children:["Joined ",new Date(h.createdAt).toLocaleDateString()," (",h.daysSinceJoined," days ago)"]})]})]}),f.jsx("div",{className:"flex items-center gap-2",children:h.isAdmin?f.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-3 py-1 rounded-full font-medium",children:"Admin"}):f.jsxs(be,{variant:"destructive",size:"sm",onClick:()=>o(h),children:[f.jsx(gL,{className:"h-4 w-4 mr-2"}),"Delete"]})})]}),f.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[f.jsxs("div",{className:"bg-blue-50 p-3 rounded-lg",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx(X_,{className:"h-4 w-4 text-blue-600"}),f.jsx("span",{className:"text-sm font-medium text-blue-800",children:"Routines"})]}),f.jsx("div",{className:"text-xl font-bold text-blue-700",children:h.routinesCount})]}),f.jsxs("div",{className:"bg-green-50 p-3 rounded-lg",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx(Od,{className:"h-4 w-4 text-green-600"}),f.jsx("span",{className:"text-sm font-medium text-green-800",children:"Exercises"})]}),f.jsx("div",{className:"text-xl font-bold text-green-700",children:h.exercisesCount})]}),f.jsxs("div",{className:"bg-purple-50 p-3 rounded-lg",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx(Fo,{className:"h-4 w-4 text-purple-600"}),f.jsx("span",{className:"text-sm font-medium text-purple-800",children:"Total Logs"})]}),f.jsx("div",{className:"text-xl font-bold text-purple-700",children:h.totalLogs}),f.jsxs("div",{className:"text-xs text-purple-600 mt-1",children:[h.completedLogs," completed, ",h.failedLogs," failed"]})]}),f.jsxs("div",{className:"bg-orange-50 p-3 rounded-lg",children:[f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsx(Oy,{className:"h-4 w-4 text-orange-600"}),f.jsx("span",{className:"text-sm font-medium text-orange-800",children:"Streak"})]}),f.jsx("div",{className:"text-xl font-bold text-orange-700",children:h.weekStreak}),f.jsx("div",{className:"text-xs text-orange-600 mt-1",children:h.weekStreak===1?"week":"weeks"})]})]}),h.lastLogDate&&f.jsx("div",{className:"mt-4 pt-3 border-t border-gray-200",children:f.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[f.jsx(Md,{className:"h-4 w-4"}),f.jsxs("span",{children:["Last activity: ",new Date(h.lastLogDate).toLocaleString()]}),f.jsxs("span",{className:"text-gray-400",children:["(",Math.floor((Date.now()-new Date(h.lastLogDate).getTime())/(1e3*60*60*24))," days ago)"]})]})}),!h.lastLogDate&&h.totalLogs===0&&f.jsx("div",{className:"mt-4 pt-3 border-t border-gray-200",children:f.jsx("div",{className:"text-sm text-gray-500 italic",children:"No routine activity yet"})})]})},h.id))})})]}),f.jsx(A0,{open:!!s,onOpenChange:()=>o(null),children:f.jsxs(Fp,{children:[f.jsxs(Vp,{children:[f.jsx(Bp,{children:"Are you sure?"}),f.jsxs(Up,{children:["This will permanently delete the user account for ",s==null?void 0:s.email," and all associated routines and exercises. This action cannot be undone."]})]}),f.jsxs($p,{children:[f.jsx(Wp,{children:"Cancel"}),f.jsx(zp,{onClick:()=>s&&u.mutate(s.id),className:"bg-red-600 hover:bg-red-700",children:u.isPending?f.jsx(xs,{className:"h-4 w-4 animate-spin"}):"Delete"})]})]})})]}):null}function M7(){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 f.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted flex flex-col items-center px-4 py-16",children:[f.jsxs("div",{className:"text-center mb-12 max-w-2xl",children:[f.jsx("h1",{className:"text-4xl font-bold tracking-tight mb-4",children:"Less Setup, More Gains"}),f.jsx("p",{className:"text-lg text-muted-foreground",children:"The simplest way to track your fitness progress"})]}),f.jsx("div",{className:"w-full max-w-5xl px-4 pt-4",children:f.jsxs("div",{className:"flex space-x-6 pb-4 overflow-x-auto snap-x snap-mandatory",children:[f.jsx(rn,{className:"w-[280px] flex-shrink-0 snap-center",children:f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsxs(Gs,{children:[f.jsxs("div",{className:"flex justify-between items-start",children:[f.jsxs("div",{children:[f.jsx(Ks,{className:"text-2xl",children:"Free"}),f.jsx(Tf,{children:"Perfect for getting started"})]}),f.jsx(MP,{className:"h-6 w-6 text-primary"})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("span",{className:"text-3xl font-bold",children:"ÂŖ0"}),f.jsx("span",{className:"text-muted-foreground",children:"/month"})]})]}),f.jsx(Cn,{className:"flex-grow",children:f.jsx("ul",{className:"space-y-3",children:e.map((r,n)=>f.jsxs("li",{className:"flex items-center gap-2",children:[f.jsx(Kn,{className:"h-4 w-4 text-primary"}),f.jsx("span",{children:r})]},n))})}),f.jsx(Pf,{children:f.jsx(qr,{href:"/register",children:f.jsx(be,{className:"w-full",children:"Get Started"})})})]})}),f.jsxs(rn,{className:"w-[280px] flex-shrink-0 snap-center relative border-dashed",children:[f.jsx("div",{className:"absolute -top-1 -right-1",children:f.jsxs(Pv,{variant:"secondary",className:"font-semibold",children:[f.jsx(hL,{className:"h-3 w-3 mr-1"}),"Coming Soon"]})}),f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsxs(Gs,{children:[f.jsxs("div",{className:"flex justify-between items-start",children:[f.jsxs("div",{children:[f.jsx(Ks,{className:"text-2xl",children:"Pro"}),f.jsx(Tf,{children:"For the dedicated athlete"})]}),f.jsx(eL,{className:"h-6 w-6 text-primary"})]}),f.jsxs("div",{className:"mt-4",children:[f.jsx("span",{className:"text-3xl font-bold",children:"ÂŖ2"}),f.jsx("span",{className:"text-muted-foreground",children:"/month"})]})]}),f.jsx(Cn,{className:"flex-grow",children:f.jsx("ul",{className:"space-y-3",children:t.map((r,n)=>f.jsxs("li",{className:"flex items-center gap-2",children:[f.jsx(Kn,{className:"h-4 w-4 text-muted-foreground"}),f.jsx("span",{className:"text-muted-foreground",children:r})]},n))})}),f.jsx(Pf,{children:f.jsx(be,{className:"w-full",variant:"outline",disabled:!0,children:"Coming Soon"})})]})]})]})})]})}function O7({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 f.jsxs(YT,{children:[f.jsx("title",{children:e}),f.jsx("meta",{name:"description",content:t}),f.jsx("link",{rel:"canonical",href:r}),f.jsx("meta",{property:"og:site_name",content:"LiftEasy"}),f.jsx("meta",{property:"og:title",content:e}),f.jsx("meta",{property:"og:description",content:t}),f.jsx("meta",{property:"og:type",content:"website"}),f.jsx("meta",{property:"og:url",content:r}),f.jsx("meta",{name:"twitter:card",content:"summary"}),f.jsx("meta",{name:"twitter:title",content:e}),f.jsx("meta",{name:"twitter:description",content:t}),f.jsx("meta",{name:"robots",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),f.jsx("meta",{name:"googlebot",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),f.jsx("meta",{name:"bingbot",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),f.jsx("meta",{name:"author",content:"LiftEasy"}),f.jsx("meta",{name:"revisit-after",content:"1 days"}),f.jsx("meta",{httpEquiv:"Content-Language",content:"en-US"}),f.jsx("meta",{name:"application-name",content:"LiftEasy"}),f.jsx("meta",{name:"mobile-web-app-capable",content:"yes"}),f.jsx("meta",{name:"apple-mobile-web-app-capable",content:"yes"}),f.jsx("meta",{name:"apple-mobile-web-app-title",content:"LiftEasy"}),f.jsx("link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/favicon-32x32.png"}),f.jsx("link",{rel:"icon",type:"image/png",sizes:"16x16",href:"/favicon-16x16.png"}),f.jsx("link",{rel:"mask-icon",href:"/safari-pinned-tab.svg",color:"#5bbad5"}),f.jsx("meta",{name:"msapplication-TileColor",content:"#ffffff"}),f.jsx("meta",{name:"theme-color",content:"#2563eb"})]})}function _7({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 f.jsx(YT,{children:f.jsx("script",{type:"application/ld+json",children:JSON.stringify(r)})})}function L7(){const[e]=Hf(),r={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:(n=>{const i="https://lifteasy.app",s=[{"@type":"ListItem",position:1,name:"Home",item:i}];if(n==="/")return s;const o=n.split("/").filter(Boolean);return o.forEach((a,l)=>{const c=l+2,u=`${i}/${o.slice(0,l+1).join("/")}`;let d=a.charAt(0).toUpperCase()+a.slice(1);a==="workout"&&(d="Workout Tracker"),a==="login"&&(d="Login"),a==="register"&&(d="Sign Up"),a==="subscription"&&(d="Premium Features"),s.push({"@type":"ListItem",position:c,name:d,item:u})}),s})(e)};return f.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(r)}})}const F7=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 V7(){const{user:e,isLoading:t,logout:r}=Hp(),[n,i]=Hf();if(m.useEffect(()=>{e!=null&&e.isAdmin?i("/admin"):e&&n==="/"&&i("/workout",{replace:!0})},[e,n,i]),t)return f.jsx("div",{className:"flex items-center justify-center min-h-screen",children:f.jsx(xs,{className:"h-8 w-8 animate-spin text-border"})});const s=F7(n),o=n==="/"&&!e,a=o;return f.jsxs(f.Fragment,{children:[f.jsx(O7,{...s}),f.jsx(_7,{pathname:n}),f.jsx(L7,{}),f.jsx("div",{className:"border-b",children:f.jsx("div",{className:`px-4 ${o?"max-w-7xl mx-auto":"max-w-md mx-auto"}`,children:f.jsxs("div",{className:"flex items-center justify-between py-4",children:[f.jsx("div",{className:"flex items-center gap-4",children:f.jsx(qr,{href:e?"/workout":"/",children:f.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:[f.jsxs("div",{className:"w-6 h-6 overflow-hidden relative",children:[f.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"}),f.jsx("img",{src:"/muscle frame.gif",alt:"Flexed biceps static",className:"w-6 h-6 group-hover:opacity-0 transition-opacity duration-200"})]}),"LiftEasy"]})})}),f.jsx("div",{className:"flex gap-2",children:e?f.jsx(be,{variant:"ghost",onClick:()=>r(),children:"Logout"}):f.jsxs(f.Fragment,{children:[f.jsx(qr,{href:"/login",children:f.jsx(be,{variant:"ghost",children:"Login"})}),f.jsx(qr,{href:"/register",children:f.jsx(be,{variant:"default",children:"Sign Up"})})]})})]})})}),a?f.jsxs(ob,{children:[f.jsx(fn,{path:"/",children:()=>e?f.jsx("div",{className:"min-h-screen bg-gray-50",children:f.jsx(_u,{})}):f.jsx(wm,{})}),f.jsx(fn,{path:"/workout",children:()=>f.jsx("div",{className:"min-h-screen bg-gray-50",children:f.jsx(_u,{})})}),f.jsx(fn,{children:()=>f.jsx(wm,{})})]}):f.jsxs(ob,{children:[f.jsx(fn,{path:"/",children:()=>e?f.jsx("div",{className:"min-h-screen bg-gray-50",children:f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx(_u,{})})}):f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx(wm,{})})}),f.jsx(fn,{path:"/workout",children:()=>f.jsx("div",{className:"min-h-screen bg-gray-50",children:f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx(_u,{})})})}),f.jsx(fn,{path:"/login",children:()=>f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx(nC,{mode:"login"})})}),f.jsx(fn,{path:"/register",children:()=>f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx(nC,{mode:"register"})})}),f.jsx(fn,{path:"/subscription",children:()=>f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx(M7,{})})}),f.jsx(fn,{path:"/admin",children:()=>f.jsx("div",{className:"max-w-4xl mx-auto",children:f.jsx(I7,{})})}),f.jsx(fn,{children:()=>f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx($7,{})})})]})]})}function $7(){return f.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:f.jsx(rn,{className:"w-full max-w-md mx-4",children:f.jsxs(Cn,{className:"pt-6",children:[f.jsxs("div",{className:"flex mb-4 gap-2",children:[f.jsx(rL,{className:"h-8 w-8 text-red-500"}),f.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),f.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Sorry, the page you're looking for cannot be found."})]})})})}AT(document.getElementById("root")).render(f.jsx(m.StrictMode,{children:f.jsx(aP,{children:f.jsx(QT,{children:f.jsxs(V2,{client:JO,children:[f.jsx(V7,{}),f.jsx(eF,{})]})})})}))});export default B7();