var XI=Object.defineProperty;var e0=e=>{throw TypeError(e)};var JI=(e,t,r)=>t in e?XI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var eM=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Qn=(e,t,r)=>JI(e,typeof t!="symbol"?t+"":t,r),vh=(e,t,r)=>t.has(e)||e0("Cannot "+r);var R=(e,t,r)=>(vh(e,t,"read from private field"),r?r.call(e):t.get(e)),ke=(e,t,r)=>t.has(e)?e0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),he=(e,t,r,n)=>(vh(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Be=(e,t,r)=>(vh(e,t,"access private method"),r);var Eu=(e,t,r,n)=>({set _(i){he(e,t,i,r)},get _(){return R(e,t,n)}});var aq=eM((vq,yu)=>{function tM(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 Ha(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $1={exports:{}},Qf={},B1={exports:{}},We={};/** * @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"),rM=Symbol.for("react.portal"),nM=Symbol.for("react.fragment"),iM=Symbol.for("react.strict_mode"),sM=Symbol.for("react.profiler"),oM=Symbol.for("react.provider"),aM=Symbol.for("react.context"),lM=Symbol.for("react.forward_ref"),cM=Symbol.for("react.suspense"),uM=Symbol.for("react.memo"),dM=Symbol.for("react.lazy"),t0=Symbol.iterator;function fM(e){return e===null||typeof e!="object"?null:(e=t0&&e[t0]||e["@@iterator"],typeof e=="function"?e:null)}var U1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z1=Object.assign,W1={};function Ga(e,t,r){this.props=e,this.context=t,this.refs=W1,this.updater=r||U1}Ga.prototype.isReactComponent={};Ga.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")};Ga.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function H1(){}H1.prototype=Ga.prototype;function Xv(e,t,r){this.props=e,this.context=t,this.refs=W1,this.updater=r||U1}var Jv=Xv.prototype=new H1;Jv.constructor=Xv;z1(Jv,Ga.prototype);Jv.isPureReactComponent=!0;var r0=Array.isArray,G1=Object.prototype.hasOwnProperty,ey={current:null},K1={key:!0,ref:!0,__self:!0,__source:!0};function q1(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)G1.call(t,n)&&!K1.hasOwnProperty(n)&&(i[n]=t[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1>>1,z=M[E];if(0>>1;Ei(ye,T))fei(W,ye)?(M[E]=W,M[fe]=T,E=fe):(M[E]=ye,M[le]=T,E=le);else if(fei(W,T))M[E]=W,M[fe]=T,E=fe;else break e}}return O}function i(M,O){var T=M.sortIndex-O.sortIndex;return T!==0?T:M.id-O.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=[],d=1,u=null,p=3,h=!1,y=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,v=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(M){for(var O=r(c);O!==null;){if(O.callback===null)n(c);else if(O.startTime<=M)n(c),O.sortIndex=O.expirationTime,t(l,O);else break;O=r(c)}}function S(M){if(g=!1,b(M),!y)if(r(l)!==null)y=!0,Q(C);else{var O=r(c);O!==null&&re(S,O.startTime-M)}}function C(M,O){y=!1,g&&(g=!1,x(k),k=-1),h=!0;var T=p;try{for(b(O),u=r(l);u!==null&&(!(u.expirationTime>O)||M&&!$());){var E=u.callback;if(typeof E=="function"){u.callback=null,p=u.priorityLevel;var z=E(u.expirationTime<=O);O=e.unstable_now(),typeof z=="function"?u.callback=z:u===r(l)&&n(l),b(O)}else n(l);u=r(l)}if(u!==null)var ae=!0;else{var le=r(c);le!==null&&re(S,le.startTime-O),ae=!1}return ae}finally{u=null,p=T,h=!1}}var P=!1,D=null,k=-1,A=5,I=-1;function $(){return!(e.unstable_now()-IM||125E?(M.sortIndex=T,t(c,M),r(l)===null&&M===r(c)&&(g?(x(k),k=-1):g=!0,re(S,T-E))):(M.sortIndex=z,t(l,M),y||h||(y=!0,Q(C))),M},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(M){var O=p;return function(){var T=p;p=O;try{return M.apply(this,arguments)}finally{p=T}}}})(eE);J1.exports=eE;var CM=J1.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 EM=m,Rr=CM;function Z(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"),zm=Object.prototype.hasOwnProperty,TM=/^[: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]*$/,i0={},s0={};function PM(e){return zm.call(s0,e)?!0:zm.call(i0,e)?!1:TM.test(e)?s0[e]=!0:(i0[e]=!0,!1)}function NM(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 DM(e,t,r,n){if(t===null||typeof t>"u"||NM(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 ar(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 Ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ut[e]=new ar(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ut[t]=new ar(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ut[e]=new ar(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ut[e]=new ar(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){Ut[e]=new ar(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ut[e]=new ar(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ut[e]=new ar(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ut[e]=new ar(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ut[e]=new ar(e,5,!1,e.toLowerCase(),null,!1,!1)});var ry=/[\-:]([a-z])/g;function ny(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(ry,ny);Ut[t]=new ar(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(ry,ny);Ut[t]=new ar(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(ry,ny);Ut[t]=new ar(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ut[e]=new ar(e,1,!1,e.toLowerCase(),null,!1,!1)});Ut.xlinkHref=new ar("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ut[e]=new ar(e,1,!1,e.toLowerCase(),null,!0,!0)});function iy(e,t,r,n){var i=Ut.hasOwnProperty(t)?Ut[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{wh=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?El(e):""}function kM(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=bh(e.type,!1),e;case 11:return e=bh(e.type.render,!1),e;case 1:return e=bh(e.type,!0),e;default:return""}}function Km(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 Mo:return"Fragment";case Io:return"Portal";case Wm:return"Profiler";case sy:return"StrictMode";case Hm:return"Suspense";case Gm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case nE:return(e.displayName||"Context")+".Consumer";case rE:return(e._context.displayName||"Context")+".Provider";case oy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ay:return t=e.displayName||null,t!==null?t:Km(e.type)||"Memo";case Li:t=e._payload,e=e._init;try{return Km(e(t))}catch{}}return null}function AM(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 Km(t);case 8:return t===sy?"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 us(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function RM(e){var t=sE(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 Nu(e){e._valueTracker||(e._valueTracker=RM(e))}function oE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=sE(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Rd(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 qm(e,t){var r=t.checked;return mt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function a0(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=us(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 aE(e,t){t=t.checked,t!=null&&iy(e,"checked",t,!1)}function Qm(e,t){aE(e,t);var r=us(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")?Ym(e,t.type,r):t.hasOwnProperty("defaultValue")&&Ym(e,t.type,us(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function l0(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 Ym(e,t,r){(t!=="number"||Rd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Tl=Array.isArray;function Zo(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Du.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ll={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},jM=["Webkit","ms","Moz","O"];Object.keys(Ll).forEach(function(e){jM.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ll[t]=Ll[e]})});function dE(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ll.hasOwnProperty(e)&&Ll[e]?(""+t).trim():t+"px"}function fE(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=dE(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var IM=mt({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(IM[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Z(62))}}function eg(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 tg=null;function ly(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rg=null,Xo=null,Jo=null;function d0(e){if(e=Kc(e)){if(typeof rg!="function")throw Error(Z(280));var t=e.stateNode;t&&(t=ep(t),rg(e.stateNode,e.type,t))}}function pE(e){Xo?Jo?Jo.push(e):Jo=[e]:Xo=e}function hE(){if(Xo){var e=Xo,t=Jo;if(Jo=Xo=null,d0(e),t)for(e=0;e>>=0,e===0?32:31-(WM(e)/HM|0)|0}var ku=64,Au=4194304;function Pl(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 Od(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=Pl(a):(s&=o,s!==0&&(n=Pl(s)))}else o=r&~i,o!==0?n=Pl(o):s!==0&&(n=Pl(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 Hc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-xn(t),e[t]=r}function QM(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=Vl),w0=" ",b0=!1;function ME(e,t){switch(e){case"keyup":return CO.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function OE(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Oo=!1;function TO(e,t){switch(e){case"compositionend":return OE(t);case"keypress":return t.which!==32?null:(b0=!0,w0);case"textInput":return e=t.data,e===w0&&b0?null:e;default:return null}}function PO(e,t){if(Oo)return e==="compositionend"||!gy&&ME(e,t)?(e=jE(),cd=py=Zi=null,Oo=!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=T0(r)}}function VE(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?VE(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $E(){for(var e=window,t=Rd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Rd(e.document)}return t}function vy(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 OO(e){var t=$E(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&VE(r.ownerDocument.documentElement,r)){if(n!==null&&vy(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=P0(r,s);var o=P0(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,_o=null,lg=null,Bl=null,cg=!1;function N0(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;cg||_o==null||_o!==Rd(n)||(n=_o,"selectionStart"in n&&vy(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}),Bl&&cc(Bl,n)||(Bl=n,n=Fd(lg,"onSelect"),0Vo||(e.current=mg[Vo],mg[Vo]=null,Vo--)}function nt(e,t){Vo++,mg[Vo]=e.current,e.current=t}var ds={},Yt=Ss(ds),vr=Ss(!1),io=ds;function Na(e,t){var r=e.type.contextTypes;if(!r)return ds;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 yr(e){return e=e.childContextTypes,e!=null}function $d(){ot(vr),ot(Yt)}function M0(e,t,r){if(Yt.current!==ds)throw Error(Z(168));nt(Yt,t),nt(vr,r)}function QE(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(Z(108,AM(e)||"Unknown",i));return mt({},r,n)}function Bd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ds,io=Yt.current,nt(Yt,e),nt(vr,vr.current),!0}function O0(e,t,r){var n=e.stateNode;if(!n)throw Error(Z(169));r?(e=QE(e,t,io),n.__reactInternalMemoizedMergedChildContext=e,ot(vr),ot(Yt),nt(Yt,e)):ot(vr),nt(vr,r)}var ti=null,tp=!1,Oh=!1;function YE(e){ti===null?ti=[e]:ti.push(e)}function KO(e){tp=!0,YE(e)}function Cs(){if(!Oh&&ti!==null){Oh=!0;var e=0,t=Xe;try{var r=ti;for(Xe=1;e>=o,i-=o,ni=1<<32-xn(t)+i|r<k?(A=D,D=null):A=D.sibling;var I=p(x,D,b[k],S);if(I===null){D===null&&(D=A);break}e&&D&&I.alternate===null&&t(x,D),v=s(I,v,k),P===null?C=I:P.sibling=I,P=I,D=A}if(k===b.length)return r(x,D),ut&&Os(x,k),C;if(D===null){for(;kk?(A=D,D=null):A=D.sibling;var $=p(x,D,I.value,S);if($===null){D===null&&(D=A);break}e&&D&&$.alternate===null&&t(x,D),v=s($,v,k),P===null?C=$:P.sibling=$,P=$,D=A}if(I.done)return r(x,D),ut&&Os(x,k),C;if(D===null){for(;!I.done;k++,I=b.next())I=u(x,I.value,S),I!==null&&(v=s(I,v,k),P===null?C=I:P.sibling=I,P=I);return ut&&Os(x,k),C}for(D=n(x,D);!I.done;k++,I=b.next())I=h(D,x,k,I.value,S),I!==null&&(e&&I.alternate!==null&&D.delete(I.key===null?k:I.key),v=s(I,v,k),P===null?C=I:P.sibling=I,P=I);return e&&D.forEach(function(_){return t(x,_)}),ut&&Os(x,k),C}function w(x,v,b,S){if(typeof b=="object"&&b!==null&&b.type===Mo&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Pu:e:{for(var C=b.key,P=v;P!==null;){if(P.key===C){if(C=b.type,C===Mo){if(P.tag===7){r(x,P.sibling),v=i(P,b.props.children),v.return=x,x=v;break e}}else if(P.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Li&&F0(C)===P.type){r(x,P.sibling),v=i(P,b.props),v.ref=dl(x,P,b),v.return=x,x=v;break e}r(x,P);break}else t(x,P);P=P.sibling}b.type===Mo?(v=ro(b.props.children,x.mode,S,b.key),v.return=x,x=v):(S=vd(b.type,b.key,b.props,null,x.mode,S),S.ref=dl(x,v,b),S.return=x,x=S)}return o(x);case Io:e:{for(P=b.key;v!==null;){if(v.key===P)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){r(x,v.sibling),v=i(v,b.children||[]),v.return=x,x=v;break e}else{r(x,v);break}else t(x,v);v=v.sibling}v=zh(b,x.mode,S),v.return=x,x=v}return o(x);case Li:return P=b._init,w(x,v,P(b._payload),S)}if(Tl(b))return y(x,v,b,S);if(ol(b))return g(x,v,b,S);Lu(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,v!==null&&v.tag===6?(r(x,v.sibling),v=i(v,b),v.return=x,x=v):(r(x,v),v=Uh(b,x.mode,S),v.return=x,x=v),o(x)):r(x,v)}return w}var ka=eT(!0),tT=eT(!1),Wd=Ss(null),Hd=null,Uo=null,by=null;function Sy(){by=Uo=Hd=null}function Cy(e){var t=Wd.current;ot(Wd),e._currentValue=t}function yg(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 ta(e,t){Hd=e,by=Uo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(gr=!0),e.firstContext=null)}function Xr(e){var t=e._currentValue;if(by!==e)if(e={context:e,memoizedValue:t,next:null},Uo===null){if(Hd===null)throw Error(Z(308));Uo=e,Hd.dependencies={lanes:0,firstContext:e}}else Uo=Uo.next=e;return t}var Us=null;function Ey(e){Us===null?Us=[e]:Us.push(e)}function rT(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Ey(t)):(r.next=i.next,i.next=r),t.interleaved=r,gi(e,n)}function gi(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 Fi=!1;function Ty(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function nT(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 li(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ns(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,qe&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,gi(e,r)}return i=n.interleaved,i===null?(t.next=t,Ey(n)):(t.next=i.next,i.next=t),n.interleaved=t,gi(e,r)}function dd(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,uy(e,r)}}function V0(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 Gd(e,t,r,n){var i=e.updateQueue;Fi=!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 d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(s!==null){var u=i.baseState;o=0,d=c=l=null,a=s;do{var p=a.lane,h=a.eventTime;if((n&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,g=a;switch(p=t,h=r,g.tag){case 1:if(y=g.payload,typeof y=="function"){u=y.call(h,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,p=typeof y=="function"?y.call(h,u,p):y,p==null)break e;u=mt({},u,p);break e;case 2:Fi=!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},d===null?(c=d=h,l=u):d=d.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(d===null&&(l=u),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=d,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);ao|=o,e.lanes=o,e.memoizedState=u}}function $0(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Lh.transition;Lh.transition={};try{e(!1),t()}finally{Xe=r,Lh.transition=n}}function wT(){return Jr().memoizedState}function ZO(e,t,r){var n=ss(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},bT(e))ST(t,r);else if(r=rT(e,t,r,n),r!==null){var i=ir();wn(r,e,n,i),CT(r,t,n)}}function XO(e,t,r){var n=ss(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(bT(e))ST(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,Sn(a,o)){var l=t.interleaved;l===null?(i.next=i,Ey(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=rT(e,t,i,n),r!==null&&(i=ir(),wn(r,e,n,i),CT(r,t,n))}}function bT(e){var t=e.alternate;return e===ht||t!==null&&t===ht}function ST(e,t){Ul=qd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function CT(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,uy(e,r)}}var Qd={readContext:Xr,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useInsertionEffect:zt,useLayoutEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useMutableSource:zt,useSyncExternalStore:zt,useId:zt,unstable_isNewReconciler:!1},JO={readContext:Xr,useCallback:function(e,t){return Dn().memoizedState=[e,t===void 0?null:t],e},useContext:Xr,useEffect:U0,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,pd(4194308,4,mT.bind(null,t,e),r)},useLayoutEffect:function(e,t){return pd(4194308,4,e,t)},useInsertionEffect:function(e,t){return pd(4,2,e,t)},useMemo:function(e,t){var r=Dn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Dn();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=ZO.bind(null,ht,e),[n.memoizedState,e]},useRef:function(e){var t=Dn();return e={current:e},t.memoizedState=e},useState:B0,useDebugValue:Iy,useDeferredValue:function(e){return Dn().memoizedState=e},useTransition:function(){var e=B0(!1),t=e[0];return e=YO.bind(null,e[1]),Dn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ht,i=Dn();if(ut){if(r===void 0)throw Error(Z(407));r=r()}else{if(r=t(),It===null)throw Error(Z(349));oo&30||aT(n,t,r)}i.memoizedState=r;var s={value:r,getSnapshot:t};return i.queue=s,U0(cT.bind(null,n,s,e),[e]),n.flags|=2048,vc(9,lT.bind(null,n,s,r,t),void 0,null),r},useId:function(){var e=Dn(),t=It.identifierPrefix;if(ut){var r=ii,n=ni;r=(n&~(1<<32-xn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=mc++,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[In]=t,e[fc]=n,IT(e,t,!1,!1),t.stateNode=e;e:{switch(o=eg(r,n),r){case"dialog":st("cancel",e),st("close",e),i=n;break;case"iframe":case"object":case"embed":st("load",e),i=n;break;case"video":case"audio":for(i=0;ija&&(t.flags|=128,n=!0,fl(s,!1),t.lanes=4194304)}else{if(!n)if(e=Kd(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),fl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ut)return Wt(t),null}else 2*Et()-s.renderingStartTime>ja&&r!==1073741824&&(t.flags|=128,n=!0,fl(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=Et(),t.sibling=null,r=ft.current,nt(ft,n?r&1|2:r&1),t):(Wt(t),null);case 22:case 23:return Vy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Sr&1073741824&&(Wt(t),t.subtreeFlags&6&&(t.flags|=8192)):Wt(t),null;case 24:return null;case 25:return null}throw Error(Z(156,t.tag))}function a_(e,t){switch(xy(t),t.tag){case 1:return yr(t.type)&&$d(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Aa(),ot(vr),ot(Yt),Dy(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ny(t),null;case 13:if(ot(ft),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));Da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ot(ft),null;case 4:return Aa(),null;case 10:return Cy(t.type._context),null;case 22:case 23:return Vy(),null;case 24:return null;default:return null}}var Vu=!1,Kt=!1,l_=typeof WeakSet=="function"?WeakSet:Set,xe=null;function zo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){wt(e,t,n)}else r.current=null}function Ng(e,t,r){try{r()}catch(n){wt(e,t,n)}}var J0=!1;function c_(e,t){if(ug=_d,e=$E(),vy(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,d=0,u=e,p=null;t:for(;;){for(var h;u!==r||i!==0&&u.nodeType!==3||(a=o+i),u!==s||n!==0&&u.nodeType!==3||(l=o+n),u.nodeType===3&&(o+=u.nodeValue.length),(h=u.firstChild)!==null;)p=u,u=h;for(;;){if(u===e)break t;if(p===r&&++c===i&&(a=o),p===s&&++d===n&&(l=o),(h=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=h}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(dg={focusedElem:e,selectionRange:r},_d=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,w=y.memoizedState,x=t.stateNode,v=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:sn(t.type,g),w);x.__reactInternalSnapshotBeforeUpdate=v}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(Z(163))}}catch(S){wt(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return y=J0,J0=!1,y}function zl(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&&Ng(t,r,s)}i=i.next}while(i!==n)}}function ip(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 Dg(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 _T(e){var t=e.alternate;t!==null&&(e.alternate=null,_T(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[In],delete t[fc],delete t[hg],delete t[HO],delete t[GO])),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 LT(e){return e.tag===5||e.tag===3||e.tag===4}function eb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||LT(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 kg(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=Vd));else if(n!==4&&(e=e.child,e!==null))for(kg(e,t,r),e=e.sibling;e!==null;)kg(e,t,r),e=e.sibling}function Ag(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(Ag(e,t,r),e=e.sibling;e!==null;)Ag(e,t,r),e=e.sibling}var Ft=null,an=!1;function Ri(e,t,r){for(r=r.child;r!==null;)FT(e,t,r),r=r.sibling}function FT(e,t,r){if(Fn&&typeof Fn.onCommitFiberUnmount=="function")try{Fn.onCommitFiberUnmount(Yf,r)}catch{}switch(r.tag){case 5:Kt||zo(r,t);case 6:var n=Ft,i=an;Ft=null,Ri(e,t,r),Ft=n,an=i,Ft!==null&&(an?(e=Ft,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ft.removeChild(r.stateNode));break;case 18:Ft!==null&&(an?(e=Ft,r=r.stateNode,e.nodeType===8?Mh(e.parentNode,r):e.nodeType===1&&Mh(e,r),ac(e)):Mh(Ft,r.stateNode));break;case 4:n=Ft,i=an,Ft=r.stateNode.containerInfo,an=!0,Ri(e,t,r),Ft=n,an=i;break;case 0:case 11:case 14:case 15:if(!Kt&&(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)&&Ng(r,t,o),i=i.next}while(i!==n)}Ri(e,t,r);break;case 1:if(!Kt&&(zo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){wt(r,t,a)}Ri(e,t,r);break;case 21:Ri(e,t,r);break;case 22:r.mode&1?(Kt=(n=Kt)||r.memoizedState!==null,Ri(e,t,r),Kt=n):Ri(e,t,r);break;default:Ri(e,t,r)}}function tb(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new l_),t.forEach(function(n){var i=y_.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function en(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Et()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*d_(n/1960))-n,10e?16:e,Xi===null)var n=!1;else{if(e=Xi,Xi=null,Xd=0,qe&6)throw Error(Z(331));var i=qe;for(qe|=4,xe=e.current;xe!==null;){var s=xe,o=s.child;if(xe.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lEt()-Ly?to(e,0):_y|=r),xr(e,t)}function GT(e,t){t===0&&(e.mode&1?(t=Au,Au<<=1,!(Au&130023424)&&(Au=4194304)):t=1);var r=ir();e=gi(e,t),e!==null&&(Hc(e,t,r),xr(e,r))}function v_(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),GT(e,r)}function y_(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(Z(314))}n!==null&&n.delete(t),GT(e,r)}var KT;KT=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||vr.current)gr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return gr=!1,s_(e,t,r);gr=!!(e.flags&131072)}else gr=!1,ut&&t.flags&1048576&&ZE(t,zd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;hd(e,t),e=t.pendingProps;var i=Na(t,Yt.current);ta(t,r),i=Ay(null,t,n,e,i,r);var s=Ry();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,yr(n)?(s=!0,Bd(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Ty(t),i.updater=np,t.stateNode=i,i._reactInternals=t,wg(t,n,e,r),t=Cg(null,t,n,!0,s,r)):(t.tag=0,ut&&s&&yy(t),rr(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(hd(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=w_(n),e=sn(n,e),i){case 0:t=Sg(null,t,n,e,r);break e;case 1:t=Y0(null,t,n,e,r);break e;case 11:t=q0(null,t,n,e,r);break e;case 14:t=Q0(null,t,n,sn(n.type,e),r);break e}throw Error(Z(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),Sg(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),Y0(e,t,n,i,r);case 3:e:{if(AT(t),e===null)throw Error(Z(387));n=t.pendingProps,s=t.memoizedState,i=s.element,nT(e,t),Gd(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=Ra(Error(Z(423)),t),t=Z0(e,t,n,r,i);break e}else if(n!==i){i=Ra(Error(Z(424)),t),t=Z0(e,t,n,r,i);break e}else for(Er=rs(t.stateNode.containerInfo.firstChild),Pr=t,ut=!0,ln=null,r=tT(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Da(),n===i){t=vi(e,t,r);break e}rr(e,t,n,r)}t=t.child}return t;case 5:return iT(t),e===null&&vg(t),n=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,fg(n,i)?o=null:s!==null&&fg(n,s)&&(t.flags|=32),kT(e,t),rr(e,t,o,r),t.child;case 6:return e===null&&vg(t),null;case 13:return RT(e,t,r);case 4:return Py(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ka(t,null,n,r):rr(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),q0(e,t,n,i,r);case 7:return rr(e,t,t.pendingProps,r),t.child;case 8:return rr(e,t,t.pendingProps.children,r),t.child;case 12:return rr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,nt(Wd,n._currentValue),n._currentValue=o,s!==null)if(Sn(s.value,o)){if(s.children===i.children&&!vr.current){t=vi(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=li(-1,r&-r),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}s.lanes|=r,l=s.alternate,l!==null&&(l.lanes|=r),yg(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(Z(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),yg(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}rr(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ta(t,r),i=Xr(i),n=n(i),t.flags|=1,rr(e,t,n,r),t.child;case 14:return n=t.type,i=sn(n,t.pendingProps),i=sn(n.type,i),Q0(e,t,n,i,r);case 15:return NT(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:sn(n,i),hd(e,t),t.tag=1,yr(n)?(e=!0,Bd(t)):e=!1,ta(t,r),ET(t,n,i),wg(t,n,i,r),Cg(null,t,n,!0,e,r);case 19:return jT(e,t,r);case 22:return DT(e,t,r)}throw Error(Z(156,t.tag))};function qT(e,t){return bE(e,t)}function x_(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 Hr(e,t,r,n){return new x_(e,t,r,n)}function By(e){return e=e.prototype,!(!e||!e.isReactComponent)}function w_(e){if(typeof e=="function")return By(e)?1:0;if(e!=null){if(e=e.$$typeof,e===oy)return 11;if(e===ay)return 14}return 2}function os(e,t){var r=e.alternate;return r===null?(r=Hr(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 vd(e,t,r,n,i,s){var o=2;if(n=e,typeof e=="function")By(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Mo:return ro(r.children,i,s,t);case sy:o=8,i|=8;break;case Wm:return e=Hr(12,r,t,i|2),e.elementType=Wm,e.lanes=s,e;case Hm:return e=Hr(13,r,t,i),e.elementType=Hm,e.lanes=s,e;case Gm:return e=Hr(19,r,t,i),e.elementType=Gm,e.lanes=s,e;case iE:return op(r,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rE:o=10;break e;case nE:o=9;break e;case oy:o=11;break e;case ay:o=14;break e;case Li:o=16,n=null;break e}throw Error(Z(130,e==null?e:typeof e,""))}return t=Hr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=s,t}function ro(e,t,r,n){return e=Hr(7,e,n,t),e.lanes=r,e}function op(e,t,r,n){return e=Hr(22,e,n,t),e.elementType=iE,e.lanes=r,e.stateNode={isHidden:!1},e}function Uh(e,t,r){return e=Hr(6,e,null,t),e.lanes=r,e}function zh(e,t,r){return t=Hr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function b_(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=Ch(0),this.expirationTimes=Ch(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ch(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Uy(e,t,r,n,i,s,o,a,l){return e=new b_(e,t,r,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Hr(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ty(s),e}function S_(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(XT)}catch(e){console.error(e)}}XT(),X1.exports=Ir;var Es=X1.exports;const JT=Ha(Es);var eP,cb=Es;eP=cb.createRoot,cb.hydrateRoot;var Qa=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(){}},co=typeof window>"u"||"Deno"in globalThis;function Br(){}function N_(e,t){return typeof e=="function"?e(t):e}function Og(e){return typeof e=="number"&&e>=0&&e!==1/0}function tP(e,t){return Math.max(e+(t||0)-Date.now(),0)}function na(e,t){return typeof e=="function"?e(t):e}function cn(e,t){return typeof e=="function"?e(t):e}function ub(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==Gy(o,t.options))return!1}else if(!xc(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 db(e,t){const{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(uo(t.options.mutationKey)!==uo(s))return!1}else if(!xc(t.options.mutationKey,s))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Gy(e,t){return((t==null?void 0:t.queryKeyHashFn)||uo)(e)}function uo(e){return JSON.stringify(e,(t,r)=>_g(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function xc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!xc(e[r],t[r])):!1}function rP(e,t){if(e===t)return e;const r=fb(e)&&fb(t);if(r||_g(e)&&_g(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 Lg(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?rP(e,t):t}function k_(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function A_(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ky=Symbol();function nP(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ky?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Ks,Ui,pa,A1,R_=(A1=class extends Qa{constructor(){super();ke(this,Ks);ke(this,Ui);ke(this,pa);he(this,pa,t=>{if(!co&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){R(this,Ui)||this.setEventListener(R(this,pa))}onUnsubscribe(){var t;this.hasListeners()||((t=R(this,Ui))==null||t.call(this),he(this,Ui,void 0))}setEventListener(t){var r;he(this,pa,t),(r=R(this,Ui))==null||r.call(this),he(this,Ui,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){R(this,Ks)!==t&&(he(this,Ks,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof R(this,Ks)=="boolean"?R(this,Ks):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ks=new WeakMap,Ui=new WeakMap,pa=new WeakMap,A1),qy=new R_,ha,zi,ma,R1,j_=(R1=class extends Qa{constructor(){super();ke(this,ha,!0);ke(this,zi);ke(this,ma);he(this,ma,t=>{if(!co&&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(){R(this,zi)||this.setEventListener(R(this,ma))}onUnsubscribe(){var t;this.hasListeners()||((t=R(this,zi))==null||t.call(this),he(this,zi,void 0))}setEventListener(t){var r;he(this,ma,t),(r=R(this,zi))==null||r.call(this),he(this,zi,t(this.setOnline.bind(this)))}setOnline(t){R(this,ha)!==t&&(he(this,ha,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return R(this,ha)}},ha=new WeakMap,zi=new WeakMap,ma=new WeakMap,R1),rf=new j_;function Fg(){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 I_(e){return Math.min(1e3*2**e,3e4)}function iP(e){return(e??"online")==="online"?rf.isOnline():!0}var sP=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Wh(e){return e instanceof sP}function oP(e){let t=!1,r=0,n=!1,i;const s=Fg(),o=g=>{var w;n||(p(new sP(g)),(w=e.abort)==null||w.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>qy.isFocused()&&(e.networkMode==="always"||rf.isOnline())&&e.canRun(),d=()=>iP(e.networkMode)&&e.canRun(),u=g=>{var w;n||(n=!0,(w=e.onSuccess)==null||w.call(e,g),i==null||i(),s.resolve(g))},p=g=>{var w;n||(n=!0,(w=e.onError)==null||w.call(e,g),i==null||i(),s.reject(g))},h=()=>new Promise(g=>{var w;i=x=>{(n||c())&&g(x)},(w=e.onPause)==null||w.call(e)}).then(()=>{var g;i=void 0,n||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(n)return;let g;const w=r===0?e.initialPromise:void 0;try{g=w??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(u).catch(x=>{var P;if(n)return;const v=e.retry??(co?0:3),b=e.retryDelay??I_,S=typeof b=="function"?b(r,x):b,C=v===!0||typeof v=="number"&&rc()?void 0:h()).then(()=>{t?p(x):y()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?y():h().then(y),s)}}function M_(){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 At=M_(),qs,j1,aP=(j1=class{constructor(){ke(this,qs)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Og(this.gcTime)&&he(this,qs,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(co?1/0:5*60*1e3))}clearGcTimeout(){R(this,qs)&&(clearTimeout(R(this,qs)),he(this,qs,void 0))}},qs=new WeakMap,j1),ga,va,$r,Ht,$c,Qs,on,Xn,I1,O_=(I1=class extends aP{constructor(t){super();ke(this,on);ke(this,ga);ke(this,va);ke(this,$r);ke(this,Ht);ke(this,$c);ke(this,Qs);he(this,Qs,!1),he(this,$c,t.defaultOptions),this.setOptions(t.options),this.observers=[],he(this,$r,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,he(this,ga,__(this.options)),this.state=t.state??R(this,ga),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=R(this,Ht))==null?void 0:t.promise}setOptions(t){this.options={...R(this,$c),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&R(this,$r).remove(this)}setData(t,r){const n=Lg(this.state.data,t,this.options);return Be(this,on,Xn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Be(this,on,Xn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=R(this,Ht))==null?void 0:n.promise;return(i=R(this,Ht))==null||i.cancel(t),r?r.then(Br).catch(Br):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(R(this,ga))}isActive(){return this.observers.some(t=>cn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ky||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||!tP(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=R(this,Ht))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=R(this,Ht))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),R(this,$r).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(R(this,Ht)&&(R(this,Qs)?R(this,Ht).cancel({revert:!0}):R(this,Ht).cancelRetry()),this.scheduleGc()),R(this,$r).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Be(this,on,Xn).call(this,{type:"invalidate"})}fetch(t,r){var l,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(R(this,Ht))return R(this,Ht).continueRetry(),R(this,Ht).promise}if(t&&this.setOptions(t),!this.options.queryFn){const u=this.observers.find(p=>p.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,i=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(he(this,Qs,!0),n.signal)})},s=()=>{const u=nP(this.options,r),p={queryKey:this.queryKey,meta:this.meta};return i(p),he(this,Qs,!1),this.options.persister?this.options.persister(u,p,this):u(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),he(this,va,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=o.fetchOptions)==null?void 0:c.meta))&&Be(this,on,Xn).call(this,{type:"fetch",meta:(d=o.fetchOptions)==null?void 0:d.meta});const a=u=>{var p,h,y,g;Wh(u)&&u.silent||Be(this,on,Xn).call(this,{type:"error",error:u}),Wh(u)||((h=(p=R(this,$r).config).onError)==null||h.call(p,u,this),(g=(y=R(this,$r).config).onSettled)==null||g.call(y,this.state.data,u,this)),this.scheduleGc()};return he(this,Ht,oP({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:u=>{var p,h,y,g;if(u===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(u)}catch(w){a(w);return}(h=(p=R(this,$r).config).onSuccess)==null||h.call(p,u,this),(g=(y=R(this,$r).config).onSettled)==null||g.call(y,u,this.state.error,this),this.scheduleGc()},onError:a,onFail:(u,p)=>{Be(this,on,Xn).call(this,{type:"failed",failureCount:u,error:p})},onPause:()=>{Be(this,on,Xn).call(this,{type:"pause"})},onContinue:()=>{Be(this,on,Xn).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),R(this,Ht).start()}},ga=new WeakMap,va=new WeakMap,$r=new WeakMap,Ht=new WeakMap,$c=new WeakMap,Qs=new WeakMap,on=new WeakSet,Xn=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,...lP(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 Wh(i)&&i.revert&&R(this,va)?{...R(this,va),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),At.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),R(this,$r).notify({query:this,type:"updated",action:t})})},I1);function lP(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:iP(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function __(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 kn,M1,L_=(M1=class extends Qa{constructor(t={}){super();ke(this,kn);this.config=t,he(this,kn,new Map)}build(t,r,n){const i=r.queryKey,s=r.queryHash??Gy(i,r);let o=this.get(s);return o||(o=new O_({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){R(this,kn).has(t.queryHash)||(R(this,kn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=R(this,kn).get(t.queryHash);r&&(t.destroy(),r===t&&R(this,kn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){At.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return R(this,kn).get(t)}getAll(){return[...R(this,kn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ub(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>ub(t,n)):r}notify(t){At.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){At.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){At.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},kn=new WeakMap,M1),An,er,Ys,Rn,Mi,O1,F_=(O1=class extends aP{constructor(t){super();ke(this,Rn);ke(this,An);ke(this,er);ke(this,Ys);this.mutationId=t.mutationId,he(this,er,t.mutationCache),he(this,An,[]),this.state=t.state||cP(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){R(this,An).includes(t)||(R(this,An).push(t),this.clearGcTimeout(),R(this,er).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){he(this,An,R(this,An).filter(r=>r!==t)),this.scheduleGc(),R(this,er).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){R(this,An).length||(this.state.status==="pending"?this.scheduleGc():R(this,er).remove(this))}continue(){var t;return((t=R(this,Ys))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,o,a,l,c,d,u,p,h,y,g,w,x,v,b,S,C,P,D;he(this,Ys,oP({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,A)=>{Be(this,Rn,Mi).call(this,{type:"failed",failureCount:k,error:A})},onPause:()=>{Be(this,Rn,Mi).call(this,{type:"pause"})},onContinue:()=>{Be(this,Rn,Mi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>R(this,er).canRun(this)}));const r=this.state.status==="pending",n=!R(this,Ys).canStart();try{if(!r){Be(this,Rn,Mi).call(this,{type:"pending",variables:t,isPaused:n}),await((s=(i=R(this,er).config).onMutate)==null?void 0:s.call(i,t,this));const A=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t));A!==this.state.context&&Be(this,Rn,Mi).call(this,{type:"pending",context:A,variables:t,isPaused:n})}const k=await R(this,Ys).start();return await((c=(l=R(this,er).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((u=(d=this.options).onSuccess)==null?void 0:u.call(d,k,t,this.state.context)),await((h=(p=R(this,er).config).onSettled)==null?void 0:h.call(p,k,null,this.state.variables,this.state.context,this)),await((g=(y=this.options).onSettled)==null?void 0:g.call(y,k,null,t,this.state.context)),Be(this,Rn,Mi).call(this,{type:"success",data:k}),k}catch(k){try{throw await((x=(w=R(this,er).config).onError)==null?void 0:x.call(w,k,t,this.state.context,this)),await((b=(v=this.options).onError)==null?void 0:b.call(v,k,t,this.state.context)),await((C=(S=R(this,er).config).onSettled)==null?void 0:C.call(S,void 0,k,this.state.variables,this.state.context,this)),await((D=(P=this.options).onSettled)==null?void 0:D.call(P,void 0,k,t,this.state.context)),k}finally{Be(this,Rn,Mi).call(this,{type:"error",error:k})}}finally{R(this,er).runNext(this)}}},An=new WeakMap,er=new WeakMap,Ys=new WeakMap,Rn=new WeakSet,Mi=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),At.batch(()=>{R(this,An).forEach(n=>{n.onMutationUpdate(t)}),R(this,er).notify({mutation:this,type:"updated",action:t})})},O1);function cP(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var br,Bc,_1,V_=(_1=class extends Qa{constructor(t={}){super();ke(this,br);ke(this,Bc);this.config=t,he(this,br,new Map),he(this,Bc,Date.now())}build(t,r,n){const i=new F_({mutationCache:this,mutationId:++Eu(this,Bc)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){const r=Uu(t),n=R(this,br).get(r)??[];n.push(t),R(this,br).set(r,n),this.notify({type:"added",mutation:t})}remove(t){var n;const r=Uu(t);if(R(this,br).has(r)){const i=(n=R(this,br).get(r))==null?void 0:n.filter(s=>s!==t);i&&(i.length===0?R(this,br).delete(r):R(this,br).set(r,i))}this.notify({type:"removed",mutation:t})}canRun(t){var n;const r=(n=R(this,br).get(Uu(t)))==null?void 0:n.find(i=>i.state.status==="pending");return!r||r===t}runNext(t){var n;const r=(n=R(this,br).get(Uu(t)))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){At.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...R(this,br).values()].flat()}find(t){const r={exact:!0,...t};return this.getAll().find(n=>db(r,n))}findAll(t={}){return this.getAll().filter(r=>db(t,r))}notify(t){At.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return At.batch(()=>Promise.all(t.map(r=>r.continue().catch(Br))))}},br=new WeakMap,Bc=new WeakMap,_1);function Uu(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function hb(e){return{onFetch:(t,r)=>{var d,u,p,h,y;const n=t.options,i=(p=(u=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:u.fetchMore)==null?void 0:p.direction,s=((h=t.state.data)==null?void 0:h.pages)||[],o=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const w=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},x=nP(t.options,t.fetchOptions),v=async(b,S,C)=>{if(g)return Promise.reject();if(S==null&&b.pages.length)return Promise.resolve(b);const P={queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};w(P);const D=await x(P),{maxPages:k}=t.options,A=C?A_:k_;return{pages:A(b.pages,D,k),pageParams:A(b.pageParams,S,k)}};if(i&&s.length){const b=i==="backward",S=b?$_:mb,C={pages:s,pageParams:o},P=S(n,C);a=await v(C,P,b)}else{const b=e??s.length;do{const S=l===0?o[0]??n.initialPageParam:mb(n,a);if(l>0&&S==null)break;a=await v(a,S),l++}while(l{var g,w;return(w=(g=t.options).persister)==null?void 0:w.call(g,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=c}}}function mb(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 $_(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 vt,Wi,Hi,ya,xa,Gi,wa,ba,L1,B_=(L1=class{constructor(e={}){ke(this,vt);ke(this,Wi);ke(this,Hi);ke(this,ya);ke(this,xa);ke(this,Gi);ke(this,wa);ke(this,ba);he(this,vt,e.queryCache||new L_),he(this,Wi,e.mutationCache||new V_),he(this,Hi,e.defaultOptions||{}),he(this,ya,new Map),he(this,xa,new Map),he(this,Gi,0)}mount(){Eu(this,Gi)._++,R(this,Gi)===1&&(he(this,wa,qy.subscribe(async e=>{e&&(await this.resumePausedMutations(),R(this,vt).onFocus())})),he(this,ba,rf.subscribe(async e=>{e&&(await this.resumePausedMutations(),R(this,vt).onOnline())})))}unmount(){var e,t;Eu(this,Gi)._--,R(this,Gi)===0&&((e=R(this,wa))==null||e.call(this),he(this,wa,void 0),(t=R(this,ba))==null||t.call(this),he(this,ba,void 0))}isFetching(e){return R(this,vt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return R(this,Wi).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=R(this,vt).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=R(this,vt).build(this,r);return e.revalidateIfStale&&n.isStaleByTime(na(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(t)}}getQueriesData(e){return R(this,vt).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=R(this,vt).get(n.queryHash),s=i==null?void 0:i.state.data,o=N_(t,s);if(o!==void 0)return R(this,vt).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return At.batch(()=>R(this,vt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=R(this,vt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=R(this,vt);At.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=R(this,vt),n={type:"active",...e};return At.batch(()=>(r.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=At.batch(()=>R(this,vt).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Br).catch(Br)}invalidateQueries(e={},t={}){return At.batch(()=>{if(R(this,vt).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=At.batch(()=>R(this,vt).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(Br)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(Br)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=R(this,vt).build(this,t);return r.isStaleByTime(na(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Br).catch(Br)}fetchInfiniteQuery(e){return e.behavior=hb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Br).catch(Br)}ensureInfiniteQueryData(e){return e.behavior=hb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return rf.isOnline()?R(this,Wi).resumePausedMutations():Promise.resolve()}getQueryCache(){return R(this,vt)}getMutationCache(){return R(this,Wi)}getDefaultOptions(){return R(this,Hi)}setDefaultOptions(e){he(this,Hi,e)}setQueryDefaults(e,t){R(this,ya).set(uo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...R(this,ya).values()];let r={};return t.forEach(n=>{xc(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){R(this,xa).set(uo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...R(this,xa).values()];let r={};return t.forEach(n=>{xc(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...R(this,Hi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Gy(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===Ky&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...R(this,Hi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){R(this,vt).clear(),R(this,Wi).clear()}},vt=new WeakMap,Wi=new WeakMap,Hi=new WeakMap,ya=new WeakMap,xa=new WeakMap,Gi=new WeakMap,wa=new WeakMap,ba=new WeakMap,L1),fr,He,Uc,tr,Zs,Sa,Ki,jn,zc,Ca,Ea,Xs,Js,qi,Ta,Ze,Dl,Vg,$g,Bg,Ug,zg,Wg,Hg,uP,F1,U_=(F1=class extends Qa{constructor(t,r){super();ke(this,Ze);ke(this,fr);ke(this,He);ke(this,Uc);ke(this,tr);ke(this,Zs);ke(this,Sa);ke(this,Ki);ke(this,jn);ke(this,zc);ke(this,Ca);ke(this,Ea);ke(this,Xs);ke(this,Js);ke(this,qi);ke(this,Ta,new Set);this.options=r,he(this,fr,t),he(this,jn,null),he(this,Ki,Fg()),this.options.experimental_prefetchInRender||R(this,Ki).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&&(R(this,He).addObserver(this),gb(R(this,He),this.options)?Be(this,Ze,Dl).call(this):this.updateResult(),Be(this,Ze,Ug).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gg(R(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gg(R(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Be(this,Ze,zg).call(this),Be(this,Ze,Wg).call(this),R(this,He).removeObserver(this)}setOptions(t,r){const n=this.options,i=R(this,He);if(this.options=R(this,fr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof cn(this.options.enabled,R(this,He))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Be(this,Ze,Hg).call(this),R(this,He).setOptions(this.options),n._defaulted&&!tf(this.options,n)&&R(this,fr).getQueryCache().notify({type:"observerOptionsUpdated",query:R(this,He),observer:this});const s=this.hasListeners();s&&vb(R(this,He),i,this.options,n)&&Be(this,Ze,Dl).call(this),this.updateResult(r),s&&(R(this,He)!==i||cn(this.options.enabled,R(this,He))!==cn(n.enabled,R(this,He))||na(this.options.staleTime,R(this,He))!==na(n.staleTime,R(this,He)))&&Be(this,Ze,Vg).call(this);const o=Be(this,Ze,$g).call(this);s&&(R(this,He)!==i||cn(this.options.enabled,R(this,He))!==cn(n.enabled,R(this,He))||o!==R(this,qi))&&Be(this,Ze,Bg).call(this,o)}getOptimisticResult(t){const r=R(this,fr).getQueryCache().build(R(this,fr),t),n=this.createResult(r,t);return W_(this,n)&&(he(this,tr,n),he(this,Sa,this.options),he(this,Zs,R(this,He).state)),n}getCurrentResult(){return R(this,tr)}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){R(this,Ta).add(t)}getCurrentQuery(){return R(this,He)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=R(this,fr).defaultQueryOptions(t),n=R(this,fr).getQueryCache().build(R(this,fr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Be(this,Ze,Dl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),R(this,tr)))}createResult(t,r){var k;const n=R(this,He),i=this.options,s=R(this,tr),o=R(this,Zs),a=R(this,Sa),c=t!==n?t.state:R(this,Uc),{state:d}=t;let u={...d},p=!1,h;if(r._optimisticResults){const A=this.hasListeners(),I=!A&&gb(t,r),$=A&&vb(t,n,r,i);(I||$)&&(u={...u,...lP(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(u.fetchStatus="idle")}let{error:y,errorUpdatedAt:g,status:w}=u;if(r.select&&u.data!==void 0)if(s&&u.data===(o==null?void 0:o.data)&&r.select===R(this,zc))h=R(this,Ca);else try{he(this,zc,r.select),h=r.select(u.data),h=Lg(s==null?void 0:s.data,h,r),he(this,Ca,h),he(this,jn,null)}catch(A){he(this,jn,A)}else h=u.data;if(r.placeholderData!==void 0&&h===void 0&&w==="pending"){let A;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))A=s.data;else if(A=typeof r.placeholderData=="function"?r.placeholderData((k=R(this,Ea))==null?void 0:k.state.data,R(this,Ea)):r.placeholderData,r.select&&A!==void 0)try{A=r.select(A),he(this,jn,null)}catch(I){he(this,jn,I)}A!==void 0&&(w="success",h=Lg(s==null?void 0:s.data,A,r),p=!0)}R(this,jn)&&(y=R(this,jn),h=R(this,Ca),g=Date.now(),w="error");const x=u.fetchStatus==="fetching",v=w==="pending",b=w==="error",S=v&&x,C=h!==void 0,D={status:w,fetchStatus:u.fetchStatus,isPending:v,isSuccess:w==="success",isError:b,isInitialLoading:S,isLoading:S,data:h,dataUpdatedAt:u.dataUpdatedAt,error:y,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!v,isLoadingError:b&&!C,isPaused:u.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:b&&C,isStale:Qy(t,r),refetch:this.refetch,promise:R(this,Ki)};if(this.options.experimental_prefetchInRender){const A=_=>{D.status==="error"?_.reject(D.error):D.data!==void 0&&_.resolve(D.data)},I=()=>{const _=he(this,Ki,D.promise=Fg());A(_)},$=R(this,Ki);switch($.status){case"pending":t.queryHash===n.queryHash&&A($);break;case"fulfilled":(D.status==="error"||D.data!==$.value)&&I();break;case"rejected":(D.status!=="error"||D.error!==$.reason)&&I();break}}return D}updateResult(t){const r=R(this,tr),n=this.createResult(R(this,He),this.options);if(he(this,Zs,R(this,He).state),he(this,Sa,this.options),R(this,Zs).data!==void 0&&he(this,Ea,R(this,He)),tf(n,r))return;he(this,tr,n);const i={},s=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!R(this,Ta).size)return!0;const l=new Set(a??R(this,Ta));return this.options.throwOnError&&l.add("error"),Object.keys(R(this,tr)).some(c=>{const d=c;return R(this,tr)[d]!==r[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),Be(this,Ze,uP).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Be(this,Ze,Ug).call(this)}},fr=new WeakMap,He=new WeakMap,Uc=new WeakMap,tr=new WeakMap,Zs=new WeakMap,Sa=new WeakMap,Ki=new WeakMap,jn=new WeakMap,zc=new WeakMap,Ca=new WeakMap,Ea=new WeakMap,Xs=new WeakMap,Js=new WeakMap,qi=new WeakMap,Ta=new WeakMap,Ze=new WeakSet,Dl=function(t){Be(this,Ze,Hg).call(this);let r=R(this,He).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Br)),r},Vg=function(){Be(this,Ze,zg).call(this);const t=na(this.options.staleTime,R(this,He));if(co||R(this,tr).isStale||!Og(t))return;const n=tP(R(this,tr).dataUpdatedAt,t)+1;he(this,Xs,setTimeout(()=>{R(this,tr).isStale||this.updateResult()},n))},$g=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(R(this,He)):this.options.refetchInterval)??!1},Bg=function(t){Be(this,Ze,Wg).call(this),he(this,qi,t),!(co||cn(this.options.enabled,R(this,He))===!1||!Og(R(this,qi))||R(this,qi)===0)&&he(this,Js,setInterval(()=>{(this.options.refetchIntervalInBackground||qy.isFocused())&&Be(this,Ze,Dl).call(this)},R(this,qi)))},Ug=function(){Be(this,Ze,Vg).call(this),Be(this,Ze,Bg).call(this,Be(this,Ze,$g).call(this))},zg=function(){R(this,Xs)&&(clearTimeout(R(this,Xs)),he(this,Xs,void 0))},Wg=function(){R(this,Js)&&(clearInterval(R(this,Js)),he(this,Js,void 0))},Hg=function(){const t=R(this,fr).getQueryCache().build(R(this,fr),this.options);if(t===R(this,He))return;const r=R(this,He);he(this,He,t),he(this,Uc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},uP=function(t){At.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(R(this,tr))}),R(this,fr).getQueryCache().notify({query:R(this,He),type:"observerResultsUpdated"})})},F1);function z_(e,t){return cn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function gb(e,t){return z_(e,t)||e.state.data!==void 0&&Gg(e,t,t.refetchOnMount)}function Gg(e,t,r){if(cn(t.enabled,e)!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Qy(e,t)}return!1}function vb(e,t,r,n){return(e!==t||cn(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Qy(e,r)}function Qy(e,t){return cn(t.enabled,e)!==!1&&e.isStaleByTime(na(t.staleTime,e))}function W_(e,t){return!tf(e.getCurrentResult(),t)}var Qi,Yi,pr,ri,pi,yd,Kg,V1,H_=(V1=class extends Qa{constructor(r,n){super();ke(this,pi);ke(this,Qi);ke(this,Yi);ke(this,pr);ke(this,ri);he(this,Qi,r),this.setOptions(n),this.bindMethods(),Be(this,pi,yd).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=R(this,Qi).defaultMutationOptions(r),tf(this.options,n)||R(this,Qi).getMutationCache().notify({type:"observerOptionsUpdated",mutation:R(this,pr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&uo(n.mutationKey)!==uo(this.options.mutationKey)?this.reset():((i=R(this,pr))==null?void 0:i.state.status)==="pending"&&R(this,pr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=R(this,pr))==null||r.removeObserver(this)}onMutationUpdate(r){Be(this,pi,yd).call(this),Be(this,pi,Kg).call(this,r)}getCurrentResult(){return R(this,Yi)}reset(){var r;(r=R(this,pr))==null||r.removeObserver(this),he(this,pr,void 0),Be(this,pi,yd).call(this),Be(this,pi,Kg).call(this)}mutate(r,n){var i;return he(this,ri,n),(i=R(this,pr))==null||i.removeObserver(this),he(this,pr,R(this,Qi).getMutationCache().build(R(this,Qi),this.options)),R(this,pr).addObserver(this),R(this,pr).execute(r)}},Qi=new WeakMap,Yi=new WeakMap,pr=new WeakMap,ri=new WeakMap,pi=new WeakSet,yd=function(){var n;const r=((n=R(this,pr))==null?void 0:n.state)??cP();he(this,Yi,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Kg=function(r){At.batch(()=>{var n,i,s,o,a,l,c,d;if(R(this,ri)&&this.hasListeners()){const u=R(this,Yi).variables,p=R(this,Yi).context;(r==null?void 0:r.type)==="success"?((i=(n=R(this,ri)).onSuccess)==null||i.call(n,r.data,u,p),(o=(s=R(this,ri)).onSettled)==null||o.call(s,r.data,null,u,p)):(r==null?void 0:r.type)==="error"&&((l=(a=R(this,ri)).onError)==null||l.call(a,r.error,u,p),(d=(c=R(this,ri)).onSettled)==null||d.call(c,void 0,r.error,u,p))}this.listeners.forEach(u=>{u(R(this,Yi))})})},V1),dP=m.createContext(void 0),Qc=e=>{const t=m.useContext(dP);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},G_=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(dP.Provider,{value:e,children:t})),fP=m.createContext(!1),K_=()=>m.useContext(fP);fP.Provider;function q_(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Q_=m.createContext(q_()),Y_=()=>m.useContext(Q_);function pP(e,t){return typeof e=="function"?e(...t):!!e}function qg(){}var Z_=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},X_=e=>{m.useEffect(()=>{e.clearReset()},[e])},J_=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&pP(r,[e.error,n]),e2=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},t2=(e,t)=>e.isLoading&&e.isFetching&&!t,r2=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,yb=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function n2(e,t,r){var d,u,p,h,y;const n=Qc(),i=K_(),s=Y_(),o=n.defaultQueryOptions(e);(u=(d=n.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||u.call(d,o),o._optimisticResults=i?"isRestoring":"optimistic",e2(o),Z_(o,s),X_(s);const a=!n.getQueryCache().get(o.queryHash),[l]=m.useState(()=>new t(n,o)),c=l.getOptimisticResult(o);if(m.useSyncExternalStore(m.useCallback(g=>{const w=i?qg:l.subscribe(At.batchCalls(g));return l.updateResult(),w},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),m.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),r2(o,c))throw yb(o,l,s);if(J_({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&&!co&&t2(c,i)){const g=a?yb(o,l,s):(y=n.getQueryCache().get(o.queryHash))==null?void 0:y.promise;g==null||g.catch(qg).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function hP(e,t){return n2(e,U_)}function ia(e,t){const r=Qc(),[n]=m.useState(()=>new H_(r,e));m.useEffect(()=>{n.setOptions(e)},[n,e]);const i=m.useSyncExternalStore(m.useCallback(o=>n.subscribe(At.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=m.useCallback((o,a)=>{n.mutate(o,a).catch(qg)},[n]);if(i.error&&pP(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}var i2=typeof Element<"u",s2=typeof Map=="function",o2=typeof Set=="function",a2=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function xd(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(!xd(e[n],t[n]))return!1;return!0}var s;if(s2&&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(!xd(n.value[1],t.get(n.value[0])))return!1;return!0}if(o2&&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(a2&&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(i2&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!xd(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}var l2=function(t,r){try{return xd(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 c2=Ha(l2);var u2=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],d=0;l=new Error(t.replace(/%s/g,function(){return c[d++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},d2=u2;const xb=Ha(d2);var f2=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))(mP||{}),Hh={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"]}},wb=Object.values(mP),Yy={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},h2=Object.entries(Yy).reduce((e,[t,r])=>(e[r]=t,e),{}),fn="data-rh",sa={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},oa=(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},m2=e=>{let t=oa(e,"title");const r=oa(e,sa.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=oa(e,sa.DEFAULT_TITLE);return t||n||void 0},g2=e=>oa(e,sa.ON_CHANGE_CLIENT_STATE)||(()=>{}),Gh=(e,t)=>t.filter(r=>typeof r[e]<"u").map(r=>r[e]).reduce((r,n)=>({...r,...n}),{}),v2=(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),hl=(e,t,r)=>{const n={};return r.filter(i=>Array.isArray(i[e])?!0:(typeof i[e]<"u"&&y2(`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 d=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:v2(["href"],e),bodyAttributes:Gh("bodyAttributes",e),defer:oa(e,sa.DEFER),encode:oa(e,sa.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Gh("htmlAttributes",e),linkTags:hl("link",["rel","href"],e),metaTags:hl("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:hl("noscript",["innerHTML"],e),onChangeClientState:g2(e),scriptTags:hl("script",["src","innerHTML"],e),styleTags:hl("style",["cssText"],e),title:m2(e),titleAttributes:Gh("titleAttributes",e),prioritizeSeoTags:x2(e,sa.PRIORITIZE_SEO_TAGS)}),gP=e=>Array.isArray(e)?e.join(""):e,b2=(e,t)=>{const r=Object.keys(e);for(let n=0;nArray.isArray(e)?e.reduce((r,n)=>(b2(n,t)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:e,priority:[]},bb=(e,t)=>({...e,[t]:void 0}),S2=["noscript","script","style"],Qg=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),vP=e=>Object.keys(e).reduce((t,r)=>{const n=typeof e[r]<"u"?`${r}="${e[r]}"`:`${r}`;return t?`${t} ${n}`:n},""),C2=(e,t,r,n)=>{const i=vP(r),s=gP(t);return i?`<${e} ${fn}="true" ${i}>${Qg(s,n)}`:`<${e} ${fn}="true">${Qg(s,n)}`},E2=(e,t,r=!0)=>t.reduce((n,i)=>{const s=i,o=Object.keys(s).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,d)=>{const u=typeof s[d]>"u"?d:`${d}="${Qg(s[d],r)}"`;return c?`${c} ${u}`:u},""),a=s.innerHTML||s.cssText||"",l=S2.indexOf(e)===-1;return`${n}<${e} ${fn}="true" ${o}${l?"/>":`>${a}`}`},""),yP=(e,t={})=>Object.keys(e).reduce((r,n)=>{const i=Yy[n];return r[i||n]=e[n],r},t),T2=(e,t,r)=>{const n={key:t,[fn]:!0},i=yP(r,n);return[de.createElement("title",i,t)]},wd=(e,t)=>t.map((r,n)=>{const i={key:n,[fn]:!0};return Object.keys(r).forEach(s=>{const a=Yy[s]||s;if(a==="innerHTML"||a==="cssText"){const l=r.innerHTML||r.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[a]=r[s]}),de.createElement(e,i)}),Vr=(e,t,r=!0)=>{switch(e){case"title":return{toComponent:()=>T2(e,t.title,t.titleAttributes),toString:()=>C2(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>yP(t),toString:()=>vP(t)};default:return{toComponent:()=>wd(e,t),toString:()=>E2(e,t,r)}}},P2=({metaTags:e,linkTags:t,scriptTags:r,encode:n})=>{const i=Kh(e,Hh.meta),s=Kh(t,Hh.link),o=Kh(r,Hh.script);return{priorityMethods:{toComponent:()=>[...wd("meta",i.priority),...wd("link",s.priority),...wd("script",o.priority)],toString:()=>`${Vr("meta",i.priority,n)} ${Vr("link",s.priority,n)} ${Vr("script",o.priority,n)}`},metaTags:i.default,linkTags:s.default,scriptTags:o.default}},N2=e=>{const{baseTag:t,bodyAttributes:r,encode:n=!0,htmlAttributes:i,noscriptTags:s,styleTags:o,title:a="",titleAttributes:l,prioritizeSeoTags:c}=e;let{linkTags:d,metaTags:u,scriptTags:p}=e,h={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:h,linkTags:d,metaTags:u,scriptTags:p}=P2(e)),{priority:h,base:Vr("base",t,n),bodyAttributes:Vr("bodyAttributes",r,n),htmlAttributes:Vr("htmlAttributes",i,n),link:Vr("link",d,n),meta:Vr("meta",u,n),noscript:Vr("noscript",s,n),script:Vr("script",p,n),style:Vr("style",o,n),title:Vr("title",{title:a,titleAttributes:l},n)}},Yg=N2,zu=[],xP=!!(typeof window<"u"&&window.document&&window.document.createElement),Zg=class{constructor(e,t){Qn(this,"instances",[]);Qn(this,"canUseDOM",xP);Qn(this,"context");Qn(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?zu:this.instances,add:e=>{(this.canUseDOM?zu:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?zu:this.instances).indexOf(e);(this.canUseDOM?zu:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=Yg({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},D2={},wP=de.createContext(D2),eo,bP=(eo=class extends m.Component{constructor(r){super(r);Qn(this,"helmetData");this.helmetData=new Zg(this.props.context||{},eo.canUseDOM)}render(){return de.createElement(wP.Provider,{value:this.helmetData.value},this.props.children)}},Qn(eo,"canUseDOM",xP),eo),Po=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${e}[${fn}]`),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 d=c,u=typeof a[d]>"u"?"":a[d];l.setAttribute(c,u)}l.setAttribute(fn,"true"),i.some((c,d)=>(o=d,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}},Xg=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(fn),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(fn):r.getAttribute(fn)!==o.join(",")&&r.setAttribute(fn,o.join(","))},k2=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=gP(e)),Xg("title",t)},Sb=(e,t)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:i,linkTags:s,metaTags:o,noscriptTags:a,onChangeClientState:l,scriptTags:c,styleTags:d,title:u,titleAttributes:p}=e;Xg("body",n),Xg("html",i),k2(u,p);const h={baseTag:Po("base",r),linkTags:Po("link",s),metaTags:Po("meta",o),noscriptTags:Po("noscript",a),scriptTags:Po("script",c),styleTags:Po("style",d)},y={},g={};Object.keys(h).forEach(w=>{const{newTags:x,oldTags:v}=h[w];x.length&&(y[w]=x),v.length&&(g[w]=h[w].oldTags)}),t&&t(),l(e,y,g)},ml=null,A2=e=>{ml&&cancelAnimationFrame(ml),e.defer?ml=requestAnimationFrame(()=>{Sb(e,()=>{ml=null})}):(Sb(e),ml=null)},R2=A2,Cb=class extends m.Component{constructor(){super(...arguments);Qn(this,"rendered",!1)}shouldComponentUpdate(t){return!p2(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=w2(t.get().map(s=>{const o={...s.props};return delete o.context,o}));bP.canUseDOM?R2(i):Yg&&(n=Yg(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}},Um,SP=(Um=class extends m.Component{shouldComponentUpdate(e){return!c2(bb(this.props,"helmetData"),bb(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 xb(wb.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 ${wb.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),xb(!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 de.Children.forEach(e,n=>{if(!n||!n.props)return;const{children:i,...s}=n.props,o=Object.keys(s).reduce((l,c)=>(l[h2[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 Zg)){const i=n;n=new Zg(i.context,!0),delete r.helmetData}return n?de.createElement(Cb,{...r,context:n.value}):de.createElement(wP.Consumer,null,i=>de.createElement(Cb,{...r,context:i}))}},Qn(Um,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Um);function j2(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 CP={exports:{}},EP={};/** * @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 Ia=m;function I2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var M2=typeof Object.is=="function"?Object.is:I2,O2=Ia.useState,_2=Ia.useEffect,L2=Ia.useLayoutEffect,F2=Ia.useDebugValue;function V2(e,t){var r=t(),n=O2({inst:{value:r,getSnapshot:t}}),i=n[0].inst,s=n[1];return L2(function(){i.value=r,i.getSnapshot=t,qh(i)&&s({inst:i})},[e,r,t]),_2(function(){return qh(i)&&s({inst:i}),e(function(){qh(i)&&s({inst:i})})},[e]),F2(r),r}function qh(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!M2(e,r)}catch{return!0}}function $2(e,t){return t()}var B2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$2:V2;EP.useSyncExternalStore=Ia.useSyncExternalStore!==void 0?Ia.useSyncExternalStore:B2;CP.exports=EP;var U2=CP.exports;const z2=Y1.useInsertionEffect,W2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",H2=W2?m.useLayoutEffect:m.useEffect,G2=z2||H2,TP=e=>{const t=m.useRef([e,(...r)=>t[0](...r)]).current;return G2(()=>{t[0]=e}),t[1]},K2="popstate",Zy="pushState",Xy="replaceState",q2="hashchange",Eb=[K2,Zy,Xy,q2],Q2=e=>{for(const t of Eb)addEventListener(t,e);return()=>{for(const t of Eb)removeEventListener(t,e)}},PP=(e,t)=>U2.useSyncExternalStore(Q2,e,t),Y2=()=>location.search,Z2=({ssrSearch:e=""}={})=>PP(Y2,()=>e),Tb=()=>location.pathname,X2=({ssrPath:e}={})=>PP(Tb,e?()=>e:Tb),J2=(e,{replace:t=!1,state:r=null}={})=>history[t?Xy:Zy](r,"",e),eL=(e={})=>[X2(e),J2],Pb=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[Pb]>"u"){for(const e of[Zy,Xy]){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,Pb,{value:!0})}const tL=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",NP=(e="")=>e==="/"?"":e,rL=(e,t)=>e[0]==="~"?e.slice(1):NP(t)+e,nL=(e="",t)=>tL(Nb(NP(e)),Nb(t)),Nb=e=>{try{return decodeURI(e)}catch{return e}},DP={hook:eL,searchHook:Z2,parser:j2,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},kP=m.createContext(DP),Yc=()=>m.useContext(kP),AP={},RP=m.createContext(AP),iL=()=>m.useContext(RP),dp=e=>{const[t,r]=e.hook(e);return[nL(e.base,t),TP((n,i)=>r(rL(n,e.base),i))]},Zc=()=>dp(Yc()),jP=(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((u,p)=>[u,l[p]])):o.groups;let d={...l};return c&&Object.assign(d,c),d})(),...n?[a]:[]]:[!1,null]},IP=({children:e,...t})=>{var d,u;const r=Yc(),n=t.hook?DP:r;let i=n;const[s,o]=((d=t.ssrPath)==null?void 0:d.split("?"))??[];o&&(t.ssrSearch=o,t.ssrPath=s),t.hrefs=t.hrefs??((u=t.hook)==null?void 0:u.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(kP.Provider,{value:i,children:e})},Db=({children:e,component:t},r)=>t?m.createElement(t,{params:r}):typeof e=="function"?e(r):e,sL=e=>{let t=m.useRef(AP),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},tn=({path:e,nest:t,match:r,...n})=>{const i=Yc(),[s]=dp(i),[o,a,l]=r??jP(i.parser,e,s,t),c=sL({...iL(),...a});if(!o)return null;const d=l?m.createElement(IP,{base:l},Db(n,c)):Db(n,c);return m.createElement(RP.Provider,{value:c,children:d})},un=m.forwardRef((e,t)=>{const r=Yc(),[n,i]=dp(r),{to:s="",href:o=s,onClick:a,asChild:l,children:c,className:d,replace:u,state:p,...h}=e,y=TP(w=>{w.ctrlKey||w.metaKey||w.altKey||w.shiftKey||w.button!==0||(a==null||a(w),w.defaultPrevented||(w.preventDefault(),i(o,e)))}),g=r.hrefs(o[0]==="~"?o.slice(1):r.base+o,r);return l&&m.isValidElement(c)?m.cloneElement(c,{onClick:y,href:g}):m.createElement("a",{...h,onClick:y,href:g,className:d!=null&&d.call?d(n===o):d,children:c,ref:t})}),MP=e=>Array.isArray(e)?e.flatMap(t=>MP(t&&t.type===m.Fragment?t.props.children:t)):[e],kb=({children:e,location:t})=>{const r=Yc(),[n]=dp(r);for(const i of MP(e)){let s=0;if(m.isValidElement(i)&&(s=jP(r.parser,i.props.path,t||n,i.props.nest))[0])return m.cloneElement(i,{match:s})}return null},oL=new B_({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}}}),aL=1,lL=1e6;let Qh=0;function cL(){return Qh=(Qh+1)%Number.MAX_SAFE_INTEGER,Qh.toString()}const Yh=new Map,Ab=e=>{if(Yh.has(e))return;const t=setTimeout(()=>{Yh.delete(e),Gl({type:"REMOVE_TOAST",toastId:e})},lL);Yh.set(e,t)},uL=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,aL)};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)}}},bd=[];let Sd={toasts:[]};function Gl(e){Sd=uL(Sd,e),bd.forEach(t=>{t(Sd)})}function dL({...e}){const t=cL(),r=i=>Gl({type:"UPDATE_TOAST",toast:{...i,id:t}}),n=()=>Gl({type:"DISMISS_TOAST",toastId:t});return Gl({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||n()}}}),{id:t,dismiss:n,update:r}}function Xc(){const[e,t]=m.useState(Sd);return m.useEffect(()=>(bd.push(t),()=>{const r=bd.indexOf(t);r>-1&&bd.splice(r,1)}),[e]),{...e,toast:dL,dismiss:r=>Gl({type:"DISMISS_TOAST",toastId:r})}}function ve(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 fL(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function fp(...e){return t=>e.forEach(r=>fL(r,t))}function Qe(...e){return m.useCallback(fp(...e),e)}function pL(e,t=[]){let r=[];function n(s,o){const a=m.createContext(o),l=r.length;r=[...r,o];function c(u){const{scope:p,children:h,...y}=u,g=(p==null?void 0:p[e][l])||a,w=m.useMemo(()=>y,Object.values(y));return f.jsx(g.Provider,{value:w,children:h})}function d(u,p){const h=(p==null?void 0:p[e][l])||a,y=m.useContext(h);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,d]}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,hL(i,...t)]}function hL(...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 u=l(s)[`__scope${c}`];return{...a,...u}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var yi=m.forwardRef((e,t)=>{const{children:r,...n}=e,i=m.Children.toArray(r),s=i.find(mL);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})});yi.displayName="Slot";var Jg=m.forwardRef((e,t)=>{const{children:r,...n}=e;if(m.isValidElement(r)){const i=vL(r);return m.cloneElement(r,{...gL(n,r.props),ref:t?fp(t,i):i})}return m.Children.count(r)>1?m.Children.only(null):null});Jg.displayName="SlotClone";var OP=({children:e})=>f.jsx(f.Fragment,{children:e});function mL(e){return m.isValidElement(e)&&e.type===OP}function gL(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 vL(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 pp(e){const t=e+"CollectionProvider",[r,n]=pL(t),[i,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=h=>{const{scope:y,children:g}=h,w=de.useRef(null),x=de.useRef(new Map).current;return f.jsx(i,{scope:y,itemMap:x,collectionRef:w,children:g})};o.displayName=t;const a=e+"CollectionSlot",l=de.forwardRef((h,y)=>{const{scope:g,children:w}=h,x=s(a,g),v=Qe(y,x.collectionRef);return f.jsx(yi,{ref:v,children:w})});l.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",u=de.forwardRef((h,y)=>{const{scope:g,children:w,...x}=h,v=de.useRef(null),b=Qe(y,v),S=s(c,g);return de.useEffect(()=>(S.itemMap.set(v,{ref:v,...x}),()=>void S.itemMap.delete(v))),f.jsx(yi,{[d]:"",ref:b,children:w})});u.displayName=c;function p(h){const y=s(e+"CollectionConsumer",h);return de.useCallback(()=>{const w=y.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((S,C)=>x.indexOf(S.ref.current)-x.indexOf(C.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:l,ItemSlot:u},p,n]}function yL(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 Ya(e,t=[]){let r=[];function n(s,o){const a=m.createContext(o),l=r.length;r=[...r,o];const c=u=>{var x;const{scope:p,children:h,...y}=u,g=((x=p==null?void 0:p[e])==null?void 0:x[l])||a,w=m.useMemo(()=>y,Object.values(y));return f.jsx(g.Provider,{value:w,children:h})};c.displayName=s+"Provider";function d(u,p){var g;const h=((g=p==null?void 0:p[e])==null?void 0:g[l])||a,y=m.useContext(h);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${s}\``)}return[c,d]}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,xL(i,...t)]}function xL(...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 u=l(s)[`__scope${c}`];return{...a,...u}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var wL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ue=wL.reduce((e,t)=>{const r=m.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?yi: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 Jy(e,t){e&&Es.flushSync(()=>e.dispatchEvent(t))}function Zt(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 bL(e,t=globalThis==null?void 0:globalThis.document){const r=Zt(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 SL="DismissableLayer",ev="dismissableLayer.update",CL="dismissableLayer.pointerDownOutside",EL="dismissableLayer.focusOutside",Rb,_P=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jc=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=e,c=m.useContext(_P),[d,u]=m.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=m.useState({}),y=Qe(t,D=>u(D)),g=Array.from(c.layers),[w]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(w),v=d?g.indexOf(d):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,S=v>=x,C=PL(D=>{const k=D.target,A=[...c.branches].some(I=>I.contains(k));!S||A||(i==null||i(D),o==null||o(D),D.defaultPrevented||a==null||a())},p),P=NL(D=>{const k=D.target;[...c.branches].some(I=>I.contains(k))||(s==null||s(D),o==null||o(D),D.defaultPrevented||a==null||a())},p);return bL(D=>{v===c.layers.size-1&&(n==null||n(D),!D.defaultPrevented&&a&&(D.preventDefault(),a()))},p),m.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Rb=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),jb(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Rb)}},[d,p,r,c]),m.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),jb())},[d,c]),m.useEffect(()=>{const D=()=>h({});return document.addEventListener(ev,D),()=>document.removeEventListener(ev,D)},[]),f.jsx(Ue.div,{...l,ref:y,style:{pointerEvents:b?S?"auto":"none":void 0,...e.style},onFocusCapture:ve(e.onFocusCapture,P.onFocusCapture),onBlurCapture:ve(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:ve(e.onPointerDownCapture,C.onPointerDownCapture)})});Jc.displayName=SL;var TL="DismissableLayerBranch",LP=m.forwardRef((e,t)=>{const r=m.useContext(_P),n=m.useRef(null),i=Qe(t,n);return m.useEffect(()=>{const s=n.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),f.jsx(Ue.div,{...e,ref:i})});LP.displayName=TL;function PL(e,t=globalThis==null?void 0:globalThis.document){const r=Zt(e),n=m.useRef(!1),i=m.useRef(()=>{});return m.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let l=function(){FP(CL,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 NL(e,t=globalThis==null?void 0:globalThis.document){const r=Zt(e),n=m.useRef(!1);return m.useEffect(()=>{const i=s=>{s.target&&!n.current&&FP(EL,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 jb(){const e=new CustomEvent(ev);document.dispatchEvent(e)}function FP(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?Jy(i,s):i.dispatchEvent(s)}var DL=Jc,kL=LP,Xt=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},AL="Portal",eu=m.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[i,s]=m.useState(!1);Xt(()=>s(!0),[]);const o=r||i&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?JT.createPortal(f.jsx(Ue.div,{...n,ref:t}),o):null});eu.displayName=AL;function RL(e,t){return m.useReducer((r,n)=>t[r][n]??r,e)}var Ti=e=>{const{present:t,children:r}=e,n=jL(t),i=typeof r=="function"?r({present:n.isPresent}):m.Children.only(r),s=Qe(n.ref,IL(i));return typeof r=="function"||n.isPresent?m.cloneElement(i,{ref:s}):null};Ti.displayName="Presence";function jL(e){const[t,r]=m.useState(),n=m.useRef({}),i=m.useRef(e),s=m.useRef("none"),o=e?"mounted":"unmounted",[a,l]=RL(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Wu(n.current);s.current=a==="mounted"?c:"none"},[a]),Xt(()=>{const c=n.current,d=i.current;if(d!==e){const p=s.current,h=Wu(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Xt(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=h=>{const g=Wu(n.current).includes(h.animationName);if(h.target===t&&g&&(l("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},p=h=>{h.target===t&&(s.current=Wu(n.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function Wu(e){return(e==null?void 0:e.animationName)||"none"}function IL(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 Ma({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,i]=ML({defaultProp:t,onChange:r}),s=e!==void 0,o=s?e:n,a=Zt(r),l=m.useCallback(c=>{if(s){const u=typeof c=="function"?c(e):c;u!==e&&a(u)}else i(c)},[s,e,i,a]);return[o,l]}function ML({defaultProp:e,onChange:t}){const r=m.useState(e),[n]=r,i=m.useRef(n),s=Zt(t);return m.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}var OL="VisuallyHidden",hp=m.forwardRef((e,t)=>f.jsx(Ue.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}}));hp.displayName=OL;var ex="ToastProvider",[tx,_L,LL]=pp("Toast"),[VP,uq]=Ya("Toast",[LL]),[FL,mp]=VP(ex),$P=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,d]=m.useState(0),u=m.useRef(!1),p=m.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${ex}\`. Expected non-empty \`string\`.`),f.jsx(tx.Provider,{scope:t,children:f.jsx(FL,{scope:t,label:r,duration:n,swipeDirection:i,swipeThreshold:s,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:m.useCallback(()=>d(h=>h+1),[]),onToastRemove:m.useCallback(()=>d(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:u,isClosePausedRef:p,children:o})})};$P.displayName=ex;var BP="ToastViewport",VL=["F8"],tv="toast.viewportPause",rv="toast.viewportResume",UP=m.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=VL,label:i="Notifications ({hotkey})",...s}=e,o=mp(BP,r),a=_L(r),l=m.useRef(null),c=m.useRef(null),d=m.useRef(null),u=m.useRef(null),p=Qe(t,u,o.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;m.useEffect(()=>{const w=x=>{var b;n.length!==0&&n.every(S=>x[S]||x.code===S)&&((b=u.current)==null||b.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),m.useEffect(()=>{const w=l.current,x=u.current;if(y&&w&&x){const v=()=>{if(!o.isClosePausedRef.current){const P=new CustomEvent(tv);x.dispatchEvent(P),o.isClosePausedRef.current=!0}},b=()=>{if(o.isClosePausedRef.current){const P=new CustomEvent(rv);x.dispatchEvent(P),o.isClosePausedRef.current=!1}},S=P=>{!w.contains(P.relatedTarget)&&b()},C=()=>{w.contains(document.activeElement)||b()};return w.addEventListener("focusin",v),w.addEventListener("focusout",S),w.addEventListener("pointermove",v),w.addEventListener("pointerleave",C),window.addEventListener("blur",v),window.addEventListener("focus",b),()=>{w.removeEventListener("focusin",v),w.removeEventListener("focusout",S),w.removeEventListener("pointermove",v),w.removeEventListener("pointerleave",C),window.removeEventListener("blur",v),window.removeEventListener("focus",b)}}},[y,o.isClosePausedRef]);const g=m.useCallback(({tabbingDirection:w})=>{const v=a().map(b=>{const S=b.ref.current,C=[S,...XL(S)];return w==="forwards"?C:C.reverse()});return(w==="forwards"?v.reverse():v).flat()},[a]);return m.useEffect(()=>{const w=u.current;if(w){const x=v=>{var C,P,D;const b=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!b){const k=document.activeElement,A=v.shiftKey;if(v.target===w&&A){(C=c.current)==null||C.focus();return}const _=g({tabbingDirection:A?"backwards":"forwards"}),q=_.findIndex(V=>V===k);Zh(_.slice(q+1))?v.preventDefault():A?(P=c.current)==null||P.focus():(D=d.current)==null||D.focus()}};return w.addEventListener("keydown",x),()=>w.removeEventListener("keydown",x)}},[a,g]),f.jsxs(kL,{ref:l,role:"region","aria-label":i.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&f.jsx(nv,{ref:c,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"forwards"});Zh(w)}}),f.jsx(tx.Slot,{scope:r,children:f.jsx(Ue.ol,{tabIndex:-1,...s,ref:p})}),y&&f.jsx(nv,{ref:d,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"backwards"});Zh(w)}})]})});UP.displayName=BP;var zP="ToastFocusProxy",nv=m.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...i}=e,s=mp(zP,r);return f.jsx(hp,{"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()}})});nv.displayName=zP;var gp="Toast",$L="toast.swipeStart",BL="toast.swipeMove",UL="toast.swipeCancel",zL="toast.swipeEnd",WP=m.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:i,onOpenChange:s,...o}=e,[a=!0,l]=Ma({prop:n,defaultProp:i,onChange:s});return f.jsx(Ti,{present:r||a,children:f.jsx(GL,{open:a,...o,ref:t,onClose:()=>l(!1),onPause:Zt(e.onPause),onResume:Zt(e.onResume),onSwipeStart:ve(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ve(e.onSwipeMove,c=>{const{x:d,y:u}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${u}px`)}),onSwipeCancel:ve(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:ve(e.onSwipeEnd,c=>{const{x:d,y:u}=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",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${u}px`),l(!1)})})})});WP.displayName=gp;var[WL,HL]=VP(gp,{onClose(){}}),GL=m.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:d,onSwipeMove:u,onSwipeCancel:p,onSwipeEnd:h,...y}=e,g=mp(gp,r),[w,x]=m.useState(null),v=Qe(t,V=>x(V)),b=m.useRef(null),S=m.useRef(null),C=i||g.duration,P=m.useRef(0),D=m.useRef(C),k=m.useRef(0),{onToastAdd:A,onToastRemove:I}=g,$=Zt(()=>{var ee;(w==null?void 0:w.contains(document.activeElement))&&((ee=g.viewport)==null||ee.focus()),o()}),_=m.useCallback(V=>{!V||V===1/0||(window.clearTimeout(k.current),P.current=new Date().getTime(),k.current=window.setTimeout($,V))},[$]);m.useEffect(()=>{const V=g.viewport;if(V){const ee=()=>{_(D.current),c==null||c()},Q=()=>{const re=new Date().getTime()-P.current;D.current=D.current-re,window.clearTimeout(k.current),l==null||l()};return V.addEventListener(tv,Q),V.addEventListener(rv,ee),()=>{V.removeEventListener(tv,Q),V.removeEventListener(rv,ee)}}},[g.viewport,C,l,c,_]),m.useEffect(()=>{s&&!g.isClosePausedRef.current&&_(C)},[s,C,g.isClosePausedRef,_]),m.useEffect(()=>(A(),()=>I()),[A,I]);const q=m.useMemo(()=>w?ZP(w):null,[w]);return g.viewport?f.jsxs(f.Fragment,{children:[q&&f.jsx(KL,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:q}),f.jsx(WL,{scope:r,onClose:$,children:Es.createPortal(f.jsx(tx.ItemSlot,{scope:r,children:f.jsx(DL,{asChild:!0,onEscapeKeyDown:ve(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||$(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:f.jsx(Ue.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":g.swipeDirection,...y,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ve(e.onKeyDown,V=>{V.key==="Escape"&&(a==null||a(V.nativeEvent),V.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:ve(e.onPointerDown,V=>{V.button===0&&(b.current={x:V.clientX,y:V.clientY})}),onPointerMove:ve(e.onPointerMove,V=>{if(!b.current)return;const ee=V.clientX-b.current.x,Q=V.clientY-b.current.y,re=!!S.current,M=["left","right"].includes(g.swipeDirection),O=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,T=M?O(0,ee):0,E=M?0:O(0,Q),z=V.pointerType==="touch"?10:2,ae={x:T,y:E},le={originalEvent:V,delta:ae};re?(S.current=ae,Hu(BL,u,le,{discrete:!1})):Ib(ae,g.swipeDirection,z)?(S.current=ae,Hu($L,d,le,{discrete:!1}),V.target.setPointerCapture(V.pointerId)):(Math.abs(ee)>z||Math.abs(Q)>z)&&(b.current=null)}),onPointerUp:ve(e.onPointerUp,V=>{const ee=S.current,Q=V.target;if(Q.hasPointerCapture(V.pointerId)&&Q.releasePointerCapture(V.pointerId),S.current=null,b.current=null,ee){const re=V.currentTarget,M={originalEvent:V,delta:ee};Ib(ee,g.swipeDirection,g.swipeThreshold)?Hu(zL,h,M,{discrete:!0}):Hu(UL,p,M,{discrete:!0}),re.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),KL=e=>{const{__scopeToast:t,children:r,...n}=e,i=mp(gp,t),[s,o]=m.useState(!1),[a,l]=m.useState(!1);return YL(()=>o(!0)),m.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:f.jsx(eu,{asChild:!0,children:f.jsx(hp,{...n,children:s&&f.jsxs(f.Fragment,{children:[i.label," ",r]})})})},qL="ToastTitle",HP=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return f.jsx(Ue.div,{...n,ref:t})});HP.displayName=qL;var QL="ToastDescription",GP=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return f.jsx(Ue.div,{...n,ref:t})});GP.displayName=QL;var KP="ToastAction",qP=m.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?f.jsx(YP,{altText:r,asChild:!0,children:f.jsx(rx,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${KP}\`. Expected non-empty \`string\`.`),null)});qP.displayName=KP;var QP="ToastClose",rx=m.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,i=HL(QP,r);return f.jsx(YP,{asChild:!0,children:f.jsx(Ue.button,{type:"button",...n,ref:t,onClick:ve(e.onClick,i.onClose)})})});rx.displayName=QP;var YP=m.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...i}=e;return f.jsx(Ue.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...i,ref:t})});function ZP(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),ZL(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(...ZP(n))}}),t}function Hu(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?Jy(i,s):i.dispatchEvent(s)}var Ib=(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 YL(e=()=>{}){const t=Zt(e);Xt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function ZL(e){return e.nodeType===e.ELEMENT_NODE}function XL(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 Zh(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var JL=$P,XP=UP,JP=WP,eN=HP,tN=GP,rN=qP,nN=rx;function iN(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,Ob=eF,tu=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Ob(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 d=r==null?void 0:r[c],u=s==null?void 0:s[c];if(d===null)return null;const p=Mb(d)||Mb(u);return i[c][p]}),a=r&&Object.entries(r).reduce((c,d)=>{let[u,p]=d;return p===void 0||(c[u]=p),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:u,className:p,...h}=d;return Object.entries(h).every(y=>{let[g,w]=y;return Array.isArray(w)?w.includes({...s,...a}[g]):{...s,...a}[g]===w})?[...c,u,p]:c},[]);return Ob(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 tF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sN=(...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 rF={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 nF=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,...rF,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:sN("lucide",i),...a},[...o.map(([c,d])=>m.createElement(c,d)),...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 $e=(e,t)=>{const r=m.forwardRef(({className:n,...i},s)=>m.createElement(nF,{ref:s,iconNode:t,className:sN(`lucide-${tF(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 iF=$e("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 Xh=$e("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 oN=$e("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 sF=$e("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 oF=$e("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 bn=$e("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 nx=$e("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 aF=$e("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 lF=$e("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cF=$e("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 uF=$e("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dF=$e("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fF=$e("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 nf=$e("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 pF=$e("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 aN=$e("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 lN=$e("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 hF=$e("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 si=$e("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 mF=$e("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 cN=$e("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 gF=$e("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 iv=$e("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 vF=$e("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 aa=$e("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 yF=$e("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 xF=$e("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 wF=$e("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 bF=$e("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SF=$e("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 CF=$e("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 sf=$e("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 uN=$e("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 wc=$e("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 _b=$e("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 ix=$e("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 EF=$e("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 TF=$e("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 PF=$e("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dN=$e("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 Lb=$e("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 fN(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=AF(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const a=o.split(sx);return a[0]===""&&a.length!==1&&a.shift(),pN(a,t)||kF(o)},getConflictingClassGroupIds:(o,a)=>{const l=r[o]||[];return a&&n[o]?[...l,...n[o]]:l}}},pN=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?pN(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(sx);return(o=t.validators.find(({validator:a})=>a(s)))==null?void 0:o.classGroupId},Fb=/^\[(.+)\]$/,kF=e=>{if(Fb.test(e)){const t=Fb.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},AF=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return jF(Object.entries(e.classGroups),r).forEach(([s,o])=>{sv(o,n,s,t)}),n},sv=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:Vb(t,i);s.classGroupId=r;return}if(typeof i=="function"){if(RF(i)){sv(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([s,o])=>{sv(o,Vb(t,s),r,n)})})},Vb=(e,t)=>{let r=e;return t.split(sx).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},RF=e=>e.isThemeGetter,jF=(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,IF=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)}}},hN="!",MF=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],s=t.length,o=a=>{const l=[];let c=0,d=0,u;for(let w=0;wd?u-d:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:g}};return r?a=>r({className:a,parseClassName:o}):o},OF=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},_F=e=>({cache:IF(e.cacheSize),parseClassName:MF(e),...DF(e)}),LF=/\s+/,FF=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,s=[],o=e.trim().split(LF);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:d,hasImportantModifier:u,baseClassName:p,maybePostfixModifierPosition:h}=r(c);let y=!!h,g=n(y?p.substring(0,h):p);if(!g){if(!y){a=c+(a.length>0?" "+a:a);continue}if(g=n(p),!g){a=c+(a.length>0?" "+a:a);continue}y=!1}const w=OF(d).join(":"),x=u?w+hN:w,v=x+g;if(s.includes(v))continue;s.push(v);const b=i(g,y);for(let S=0;S0?" "+a:a)}return a};function VF(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nu(d),e());return r=_F(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 d=FF(l,r);return i(l,d),d}return function(){return s(VF.apply(null,arguments))}}const it=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},gN=/^\[(?:([a-z-]+):)?(.+)\]$/i,BF=/^\d+\/\d+$/,UF=new Set(["px","full","screen"]),zF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WF=/\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$/,HF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,GF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,KF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yn=e=>la(e)||UF.has(e)||BF.test(e),ji=e=>Za(e,"length",tV),la=e=>!!e&&!Number.isNaN(Number(e)),Jh=e=>Za(e,"number",la),gl=e=>!!e&&Number.isInteger(Number(e)),qF=e=>e.endsWith("%")&&la(e.slice(0,-1)),Ve=e=>gN.test(e),Ii=e=>zF.test(e),QF=new Set(["length","size","percentage"]),YF=e=>Za(e,QF,vN),ZF=e=>Za(e,"position",vN),XF=new Set(["image","url"]),JF=e=>Za(e,XF,nV),eV=e=>Za(e,"",rV),vl=()=>!0,Za=(e,t,r)=>{const n=gN.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},tV=e=>WF.test(e)&&!HF.test(e),vN=()=>!1,rV=e=>GF.test(e),nV=e=>KF.test(e),iV=()=>{const e=it("colors"),t=it("spacing"),r=it("blur"),n=it("brightness"),i=it("borderColor"),s=it("borderRadius"),o=it("borderSpacing"),a=it("borderWidth"),l=it("contrast"),c=it("grayscale"),d=it("hueRotate"),u=it("invert"),p=it("gap"),h=it("gradientColorStops"),y=it("gradientColorStopPositions"),g=it("inset"),w=it("margin"),x=it("opacity"),v=it("padding"),b=it("saturate"),S=it("scale"),C=it("sepia"),P=it("skew"),D=it("space"),k=it("translate"),A=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],$=()=>["auto",Ve,t],_=()=>[Ve,t],q=()=>["",Yn,ji],V=()=>["auto",la,Ve],ee=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Q=()=>["solid","dashed","dotted","double","none"],re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",Ve],T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>[la,Ve];return{cacheSize:500,separator:":",theme:{colors:[vl],spacing:[Yn,ji],blur:["none","",Ii,Ve],brightness:E(),borderColor:[e],borderRadius:["none","","full",Ii,Ve],borderSpacing:_(),borderWidth:q(),contrast:E(),grayscale:O(),hueRotate:E(),invert:O(),gap:_(),gradientColorStops:[e],gradientColorStopPositions:[qF,ji],inset:$(),margin:$(),opacity:E(),padding:_(),saturate:E(),scale:E(),sepia:O(),skew:E(),space:_(),translate:_()},classGroups:{aspect:[{aspect:["auto","square","video",Ve]}],container:["container"],columns:[{columns:[Ii]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:[...ee(),Ve]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gl,Ve]}],basis:[{basis:$()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ve]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",gl,Ve]}],"grid-cols":[{"grid-cols":[vl]}],"col-start-end":[{col:["auto",{span:["full",gl,Ve]},Ve]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[vl]}],"row-start-end":[{row:["auto",{span:[gl,Ve]},Ve]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ve]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ve]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],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":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ve,t]}],"min-w":[{"min-w":[Ve,t,"min","max","fit"]}],"max-w":[{"max-w":[Ve,t,"none","full","min","max","fit","prose",{screen:[Ii]},Ii]}],h:[{h:[Ve,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ve,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ve,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ve,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ii,ji]}],"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:[vl]}],"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",Ve]}],"line-clamp":[{"line-clamp":["none",la,Jh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Yn,Ve]}],"list-image":[{"list-image":["none",Ve]}],"list-style-type":[{list:["none","disc","decimal",Ve]}],"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:[...Q(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Yn,ji]}],"underline-offset":[{"underline-offset":["auto",Yn,Ve]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ve]}],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",Ve]}],"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:[...ee(),ZF]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",YF]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},JF]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"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:[...Q(),"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:Q()}],"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:["",...Q()]}],"outline-offset":[{"outline-offset":[Yn,Ve]}],"outline-w":[{outline:[Yn,ji]}],"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":[Yn,ji]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ii,eV]}],"shadow-color":[{shadow:[vl]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...re(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":re()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ii,Ve]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],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":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"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",Ve]}],duration:[{duration:E()}],ease:[{ease:["linear","in","out","in-out",Ve]}],delay:[{delay:E()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ve]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[gl,Ve]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ve]}],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",Ve]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ve]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Yn,ji,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"]}}},sV=$F(iV);function De(...e){return sV(NF(e))}const oV=JL,yN=m.forwardRef(({className:e,...t},r)=>f.jsx(XP,{ref:r,className:De("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}));yN.displayName=XP.displayName;const aV=tu("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"}}),xN=m.forwardRef(({className:e,variant:t,...r},n)=>f.jsx(JP,{ref:n,className:De(aV({variant:t}),e),...r}));xN.displayName=JP.displayName;const lV=m.forwardRef(({className:e,...t},r)=>f.jsx(rN,{ref:r,className:De("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}));lV.displayName=rN.displayName;const wN=m.forwardRef(({className:e,...t},r)=>f.jsx(nN,{ref:r,className:De("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(dN,{className:"h-4 w-4"})}));wN.displayName=nN.displayName;const bN=m.forwardRef(({className:e,...t},r)=>f.jsx(eN,{ref:r,className:De("text-sm font-semibold",e),...t}));bN.displayName=eN.displayName;const SN=m.forwardRef(({className:e,...t},r)=>f.jsx(tN,{ref:r,className:De("text-sm opacity-90",e),...t}));SN.displayName=tN.displayName;function cV(){const{toasts:e}=Xc();return f.jsxs(oV,{children:[e.map(function({id:t,title:r,description:n,action:i,...s}){return f.jsxs(xN,{...s,children:[f.jsxs("div",{className:"grid gap-1",children:[r&&f.jsx(bN,{children:r}),n&&f.jsx(SN,{children:n})]}),i,f.jsx(wN,{})]},t)}),f.jsx(yN,{})]})}function ov(e,t){return ov=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},ov(e,t)}function CN(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ov(e,t)}function Ae(){return Ae=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(ur(1));return r(EN)(e,t)}if(typeof e!="function")throw new Error(ur(2));var i=e,s=t,o=[],a=o,l=!1;function c(){a===o&&(a=o.slice())}function d(){if(l)throw new Error(ur(3));return s}function u(g){if(typeof g!="function")throw new Error(ur(4));if(l)throw new Error(ur(5));var w=!0;return c(),a.push(g),function(){if(w){if(l)throw new Error(ur(6));w=!1,c();var v=a.indexOf(g);a.splice(v,1),o=null}}}function p(g){if(!pV(g))throw new Error(ur(7));if(typeof g.type>"u")throw new Error(ur(8));if(l)throw new Error(ur(9));try{l=!0,s=i(s,g)}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 y$(e,t){return e===t}function x$(e){var t=e===void 0?{}:e,r=t.connectHOC,n=r===void 0?JV:r,i=t.mapStateToPropsFactories,s=i===void 0?a$:i,o=t.mapDispatchToPropsFactories,a=o===void 0?i$:o,l=t.mergePropsFactories,c=l===void 0?f$:l,d=t.selectorFactory,u=d===void 0?g$:d;return function(h,y,g,w){w===void 0&&(w={});var x=w,v=x.pure,b=v===void 0?!0:v,S=x.areStatesEqual,C=S===void 0?y$:S,P=x.areOwnPropsEqual,D=P===void 0?tm:P,k=x.areStatePropsEqual,A=k===void 0?tm:k,I=x.areMergedPropsEqual,$=I===void 0?tm:I,_=of(x,v$),q=rm(h,s,"mapStateToProps"),V=rm(y,a,"mapDispatchToProps"),ee=rm(g,c,"mergeProps");return n(u,Ae({methodName:"connect",getDisplayName:function(re){return"Connect("+re+")"},shouldHandleStateChanges:!!h,initMapStateToProps:q,initMapDispatchToProps:V,initMergeProps:ee,pure:b,areStatesEqual:C,areOwnPropsEqual:D,areStatePropsEqual:A,areMergedPropsEqual:$},_))}}const BN=x$();gV(Es.unstable_batchedUpdates);function w$(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=Gr(window,[{eventName:"error",fn:this.onWindowError}])},r.componentDidCatch=function(i){if(i instanceof cf){this.setState({});return}throw i},r.componentWillUnmount=function(){this.unbind()},r.render=function(){return this.props.children(this.setCallbacks)},t}(de.Component),R$=` 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 `,uf=function(t){return t+1},j$=function(t){return` You have lifted an item in position `+uf(t.source.index)+` `},GN=function(t,r){var n=t.droppableId===r.droppableId,i=uf(t.index),s=uf(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+` `},KN=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+` `},I$=function(t){var r=t.destination;if(r)return GN(t.source,r);var n=t.combine;return n?KN(t.draggableId,t.source,n):"You are over an area that cannot be dropped on"},rS=function(t){return` The item has returned to its starting position of `+uf(t.index)+` `},M$=function(t){if(t.reason==="CANCEL")return` Movement cancelled. `+rS(t.source)+` `;var r=t.destination,n=t.combine;return r?` You have dropped the item. `+GN(t.source,r)+` `:n?` You have dropped the item. `+KN(t.draggableId,t.source,n)+` `:` The item has been dropped while not over a drop area. `+rS(t.source)+` `},Cd={dragHandleUsageInstructions:R$,onDragStart:j$,onDragUpdate:I$,onDragEnd:M$},Ot={x:0,y:0},$t=function(t,r){return{x:t.x+r.x,y:t.y+r.y}},Tr=function(t,r){return{x:t.x-r.x,y:t.y-r.y}},ls=function(t,r){return t.x===r.x&&t.y===r.y},Xa=function(t){return{x:t.x!==0?-t.x:0,y:t.y!==0?-t.y:0}},fo=function(t,r,n){var i;return n===void 0&&(n=0),i={},i[t]=r,i[t==="x"?"y":"x"]=n,i},Cc=function(t,r){return Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))},nS=function(t,r){return Math.min.apply(Math,r.map(function(n){return Cc(t,n)}))},qN=function(t){return function(r){return{x:t(r.x),y:t(r.y)}}},O$=function(e,t){var r=pn({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},du=function(t,r){return{top:t.top+r.y,left:t.left+r.x,bottom:t.bottom+r.y,right:t.right+r.x}},iS=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}]},_$={top:0,right:0,bottom:0,left:0},L$=function(t,r){return r?du(t,r.scroll.diff.displacement):t},F$=function(t,r,n){if(n&&n.increasedBy){var i;return Ae({},t,(i={},i[r.end]=t[r.end]+n.increasedBy[r.line],i))}return t},V$=function(t,r){return r&&r.shouldClipSubject?O$(r.pageMarginBox,t):pn(t)},Oa=function(e){var t=e.page,r=e.withPlaceholder,n=e.axis,i=e.frame,s=L$(t.marginBox,i),o=F$(s,n,r),a=V$(o,i);return{page:t,withPlaceholder:r,active:a}},mx=function(e,t){e.frame||ne();var r=e.frame,n=Tr(t,r.scroll.initial),i=Xa(n),s=Ae({},r,{scroll:{initial:r.scroll.initial,current:t,diff:{value:n,displacement:i},max:r.scroll.max}}),o=Oa({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:s}),a=Ae({},e,{frame:s,subject:o});return a};function df(e){return Object.values?Object.values(e):Object.keys(e).map(function(t){return e[t]})}function gx(e,t){if(e.findIndex)return e.findIndex(t);for(var r=0;re.bottom,c=n.lefte.right,d=l&&c;if(d)return!0;var u=l&&o||c&&s;return u}},z$=function(e){var t=Qr(e.top,e.bottom),r=Qr(e.left,e.right);return function(n){var i=t(n.top)&&t(n.bottom)&&r(n.left)&&r(n.right);return i}},yx={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},eD={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},W$=function(e){return function(t){var r=Qr(t.top,t.bottom),n=Qr(t.left,t.right);return function(i){return e===yx?r(i.top)&&r(i.bottom):n(i.left)&&n(i.right)}}},H$=function(t,r){var n=r.frame?r.frame.scroll.diff.displacement:Ot;return du(t,n)},G$=function(t,r,n){return r.subject.active?n(r.subject.active)(t):!1},K$=function(t,r,n){return n(r)(t)},xx=function(t){var r=t.target,n=t.destination,i=t.viewport,s=t.withDroppableDisplacement,o=t.isVisibleThroughFrameFn,a=s?H$(r,n):r;return G$(a,n,o)&&K$(a,i,o)},q$=function(t){return xx(Ae({},t,{isVisibleThroughFrameFn:JN}))},tD=function(t){return xx(Ae({},t,{isVisibleThroughFrameFn:z$}))},Q$=function(t){return xx(Ae({},t,{isVisibleThroughFrameFn:W$(t.destination.axis)}))},Y$=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 Z$(e,t){var r=e.page.marginBox,n={top:t.point.y,right:0,bottom:0,left:t.point.x};return pn(px(r,n))}function Tc(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 d=Z$(c,n),u=c.descriptor.id;l.all.push(u);var p=q$({target:d,destination:r,viewport:i,withDroppableDisplacement:!0});if(!p)return l.invisible[c.descriptor.id]=!0,l;var h=Y$(u,o,s),y={draggableId:u,shouldAnimate:h};return l.visible[u]=y,l},{all:[],visible:{},invisible:{}})}function X$(e,t){if(!e.length)return 0;var r=e[e.length-1].descriptor.index;return t.inHomeList?r:r+1}function sS(e){var t=e.insideDestination,r=e.inHomeList,n=e.displacedBy,i=e.destination,s=X$(t,{inHomeList:r});return{displaced:Ec,displacedBy:n,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:s}}}}function ff(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=el(t,n);if(a==null)return sS({insideDestination:r,inHomeList:c,displacedBy:s,destination:n});var d=Ts(r,function(g){return g.descriptor.index===a});if(!d)return sS({insideDestination:r,inHomeList:c,displacedBy:s,destination:n});var u=Rp(t,r),p=r.indexOf(d),h=u.slice(p),y=Tc({afterDragging:h,destination:n,displacedBy:s,last:o,viewport:i.frame,forceShouldAnimate:l});return{displaced:y,displacedBy:s,at:{type:"REORDER",destination:{droppableId:n.descriptor.id,index:a}}}}function fs(e,t){return!!t.effected[e]}var J$=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=fs(o,s);return c?t?l:l-1:t?l+1:l},eB=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},tB=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,d=a.at;if(d||ne(),d.type==="REORDER"){var u=eB({isMovingForward:t,isInHomeList:r,location:d.destination,insideDestination:o});return u==null?null:ff({draggable:n,insideDestination:o,destination:s,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:u})}var p=J$({isMovingForward:t,destination:s,displaced:a.displaced,draggables:i,combine:d.combine,afterCritical:c});return p==null?null:ff({draggable:n,insideDestination:o,destination:s,viewport:l,last:a.displaced,displacedBy:a.displacedBy,index:p})},rB=function(e){var t=e.displaced,r=e.afterCritical,n=e.combineWith,i=e.displacedBy,s=!!(t.visible[n]||t.invisible[n]);return fs(n,r)?s?Ot:Xa(i.point):s?i.point:Ot},nB=function(e){var t=e.afterCritical,r=e.impact,n=e.draggables,i=Ap(r);i||ne();var s=i.draggableId,o=n[s].page.borderBox.center,a=rB({displaced:r.displaced,afterCritical:t,combineWith:s,displacedBy:r.displacedBy});return $t(o,a)},rD=function(t,r){return r.margin[t.start]+r.borderBox[t.size]/2},iB=function(t,r){return r.margin[t.end]+r.borderBox[t.size]/2},wx=function(t,r,n){return r[t.crossAxisStart]+n.margin[t.crossAxisStart]+n.borderBox[t.crossAxisSize]/2},oS=function(t){var r=t.axis,n=t.moveRelativeTo,i=t.isMoving;return fo(r.line,n.marginBox[r.end]+rD(r,i),wx(r,n.marginBox,i))},aS=function(t){var r=t.axis,n=t.moveRelativeTo,i=t.isMoving;return fo(r.line,n.marginBox[r.start]-iB(r,i),wx(r,n.marginBox,i))},sB=function(t){var r=t.axis,n=t.moveInto,i=t.isMoving;return fo(r.line,n.contentBox[r.start]+rD(r,i),wx(r,n.contentBox,i))},oB=function(e){var t=e.impact,r=e.draggable,n=e.draggables,i=e.droppable,s=e.afterCritical,o=Ja(i.descriptor.id,n),a=r.page,l=i.axis;if(!o.length)return sB({axis:l,moveInto:i.page,isMoving:a});var c=t.displaced,d=t.displacedBy,u=c.all[0];if(u){var p=n[u];if(fs(u,s))return aS({axis:l,moveRelativeTo:p.page,isMoving:a});var h=af(p.page,d.point);return aS({axis:l,moveRelativeTo:h,isMoving:a})}var y=o[o.length-1];if(y.descriptor.id===r.descriptor.id)return a.borderBox.center;if(fs(y.descriptor.id,s)){var g=af(y.page,Xa(s.displacedBy.point));return oS({axis:l,moveRelativeTo:g,isMoving:a})}return oS({axis:l,moveRelativeTo:y.page,isMoving:a})},av=function(e,t){var r=e.frame;return r?$t(t,r.scroll.diff.displacement):t},aB=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"?oB({impact:r,draggable:n,draggables:s,droppable:i,afterCritical:o}):nB({impact:r,draggables:s,afterCritical:o})},jp=function(e){var t=aB(e),r=e.droppable,n=r?av(r,t):t;return n},nD=function(e,t){var r=Tr(t,e.scroll.initial),n=Xa(r),i=pn({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 lS(e,t){return e.map(function(r){return t[r]})}function lB(e,t){for(var r=0;r1?d.sort(function(u,p){return Jt(u)[a.start]-Jt(p)[a.start]})[0]:c.sort(function(u,p){var h=nS(r,iS(Jt(u))),y=nS(r,iS(Jt(p)));return h!==y?h-y:Jt(u)[a.start]-Jt(p)[a.start]})[0]},cS=function(t,r){var n=t.page.borderBox.center;return fs(t.descriptor.id,r)?Tr(n,r.displacedBy.point):n},pB=function(t,r){var n=t.page.borderBox;return fs(t.descriptor.id,r)?du(n,Xa(r.displacedBy.point)):n},hB=function(e){var t=e.pageBorderBoxCenter,r=e.viewport,n=e.destination,i=e.insideDestination,s=e.afterCritical,o=i.filter(function(a){return tD({target:pB(a,s),destination:n,viewport:r.frame,withDroppableDisplacement:!0})}).sort(function(a,l){var c=Cc(t,av(n,cS(a,s))),d=Cc(t,av(n,cS(l,s)));return ct.left&&e.topt.top}function SB(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=fo(o.axis.line,t.center[a.line],o.page.borderBox.center[a.crossAxisLine]);return{id:o.descriptor.id,distance:Cc(i,l)}}).sort(function(o,a){return a.distance-o.distance});return s[0]?s[0].id:null}function CB(e){var t=e.pageBorderBox,r=e.draggable,n=e.droppables,i=kp(n).filter(function(s){if(!s.isEnabled)return!1;var o=s.subject.active;if(!o||!bB(t,o))return!1;if(aD(o)(t.center))return!0;var a=s.axis,l=o.center[a.crossAxisLine],c=t[a.crossAxisStart],d=t[a.crossAxisEnd],u=Qr(o[a.crossAxisStart],o[a.crossAxisEnd]),p=u(c),h=u(d);return!p&&!h?!0:p?cl});return i.length?i.length===1?i[0].descriptor.id:SB({pageBorderBox:t,draggable:r,candidates:i}):null}var lD=function(t,r){return pn(du(t,r))},EB=function(e,t){var r=e.frame;return r?lD(t,r.scroll.diff.value):t};function cD(e){var t=e.displaced,r=e.id;return!!(t.visible[r]||t.invisible[r])}function TB(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 PB=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=fu(n.axis,r.displaceBy),d=c.value,u=t[l.start],p=t[l.end],h=Rp(r,i),y=Ts(h,function(w){var x=w.descriptor.id,v=w.page.borderBox.center[l.line],b=fs(x,a),S=cD({displaced:s,id:x});return b?S?p<=v:ux[a.start]+b&&ux[a.start]-c+b&&dx[a.start]+c+b&&ux[a.start]+b&&d=fS)return yD;var s=i/fS,o=uv+n4*s,a=n==="CANCEL"?o*i4:o;return Number(a.toFixed(2))},o4=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=Nr(t),c=l?a[l]:null,d=a[r.descriptor.droppableId],u=fD({impact:t,draggable:r,draggables:o,afterCritical:s,droppable:c||d,viewport:i}),p=Tr(u,r.client.borderBox.center);return p},a4=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=dD({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=Ae({},n,{displaced:Ec});return{impact:l,didDropInsideDroppable:!0}},l4=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(e4({reason:o}));return}if(s.phase!=="IDLE"){var a=s.phase==="DROP_PENDING"&&s.isWaiting;a&&ne(),s.phase==="DRAGGING"||s.phase==="DROP_PENDING"||ne();var l=s.critical,c=s.dimensions,d=c.draggables[s.critical.draggable.id],u=a4({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=u.impact,h=u.didDropInsideDroppable,y=h?vx(p):null,g=h?Ap(p):null,w={index:l.draggable.index,droppableId:l.droppable.id},x={draggableId:d.descriptor.id,type:d.descriptor.type,source:w,reason:o,mode:s.movementMode,destination:y,combine:g},v=o4({impact:p,draggable:d,dimensions:c,viewport:s.viewport,afterCritical:s.afterCritical}),b={critical:s.critical,afterCritical:s.afterCritical,result:x,impact:p},S=!ls(s.current.client.offset,v)||!!x.combine;if(!S){r(Ex({completed:b}));return}var C=s4({current:s.current.client.offset,destination:v,reason:o}),P={newHomeClientOffset:v,dropDuration:C,completed:b};r(JB(P))}}}},xD=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function c4(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(r){r.target!==window&&r.target!==window.document||e()}}}function u4(e){var t=e.onWindowScroll;function r(){t(xD())}var n=Sc(r),i=c4(n),s=as;function o(){return s!==as}function a(){o()&&ne(),s=Gr(window,[i])}function l(){o()||ne(),n.cancel(),s(),s=as}return{start:a,stop:l,isActive:o}}var d4=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},f4=function(e){var t=u4({onWindowScroll:function(n){e.dispatch(KB({newScroll:n}))}});return function(r){return function(n){!t.isActive()&&n.type==="INITIAL_PUBLISH"&&t.start(),t.isActive()&&d4(n)&&t.stop(),r(n)}}},p4=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},h4=function(){var e=[],t=function(s){var o=gx(e,function(c){return c.timerId===s});o===-1&&ne();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}},m4=function(t,r){return t==null&&r==null?!0:t==null||r==null?!1:t.droppableId===r.droppableId&&t.index===r.index},g4=function(t,r){return t==null&&r==null?!0:t==null||r==null?!1:t.draggableId===r.draggableId&&t.droppableId===r.droppableId},v4=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},yl=function(t,r){r()},Gu=function(t,r){return{draggableId:t.draggable.id,type:t.droppable.type,source:{droppableId:t.droppable.id,index:t.draggable.index},mode:r}},om=function(t,r,n,i){if(!t){n(i(r));return}var s=p4(n),o={announce:s};t(r,o),s.wasCalled()||n(i(r))},y4=function(e,t){var r=h4(),n=null,i=function(p,h){n&&ne(),yl("onBeforeCapture",function(){var y=e().onBeforeCapture;if(y){var g={draggableId:p,mode:h};y(g)}})},s=function(p,h){n&&ne(),yl("onBeforeDragStart",function(){var y=e().onBeforeDragStart;y&&y(Gu(p,h))})},o=function(p,h){n&&ne();var y=Gu(p,h);n={mode:h,lastCritical:p,lastLocation:y.source,lastCombine:null},r.add(function(){yl("onDragStart",function(){return om(e().onDragStart,y,t,Cd.onDragStart)})})},a=function(p,h){var y=vx(h),g=Ap(h);n||ne();var w=!v4(p,n.lastCritical);w&&(n.lastCritical=p);var x=!m4(n.lastLocation,y);x&&(n.lastLocation=y);var v=!g4(n.lastCombine,g);if(v&&(n.lastCombine=g),!(!w&&!x&&!v)){var b=Ae({},Gu(p,n.mode),{combine:g,destination:y});r.add(function(){yl("onDragUpdate",function(){return om(e().onDragUpdate,b,t,Cd.onDragUpdate)})})}},l=function(){n||ne(),r.flush()},c=function(p){n||ne(),n=null,yl("onDragEnd",function(){return om(e().onDragEnd,p,t,Cd.onDragEnd)})},d=function(){if(n){var p=Ae({},Gu(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:d}},x4=function(e,t){var r=y4(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)}}}},w4=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"&&ne(),e.dispatch(Ex({completed:n.completed}))}}},b4=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(vD())}};r=requestAnimationFrame(function(){r=null,t=Gr(window,[o])})}}}},S4=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)}}}},C4=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()}}}}}},E4=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},T4=function(e){return function(t){return function(r){return function(n){if(E4(n)){e.stop(),r(n);return}if(n.type==="INITIAL_PUBLISH"){r(n);var i=t.getState();i.phase!=="DRAGGING"&&ne(),e.start(i);return}r(n),e.scroll(t.getState())}}}},P4=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(gD({reason:n.reason})))}}}},N4=TN,D4=function(e){var t=e.dimensionMarshal,r=e.focusMarshal,n=e.styleMarshal,i=e.getResponders,s=e.announce,o=e.autoScroller;return EN(FB,N4(hV(r4(n),S4(t),t4(t),l4,w4,b4,P4,T4(o),f4,C4(r),x4(i,s))))},am=function(){return{additions:{},removals:{},modified:{}}};function k4(e){var t=e.registry,r=e.callbacks,n=am(),i=null,s=function(){i||(r.collectionStarting(),i=requestAnimationFrame(function(){i=null;var d=n,u=d.additions,p=d.removals,h=d.modified,y=Object.keys(u).map(function(x){return t.draggable.getById(x).getDimension(Ot)}).sort(function(x,v){return x.descriptor.index-v.descriptor.index}),g=Object.keys(h).map(function(x){var v=t.droppable.getById(x),b=v.callbacks.getScrollWhileDragging();return{droppableId:x,scroll:b}}),w={additions:y,removals:Object.keys(p),modified:g};n=am(),r.publish(w)}))},o=function(d){var u=d.descriptor.id;n.additions[u]=d,n.modified[d.descriptor.droppableId]=!0,n.removals[u]&&delete n.removals[u],s()},a=function(d){var u=d.descriptor;n.removals[u.id]=!0,n.modified[u.droppableId]=!0,n.additions[u.id]&&delete n.additions[u.id],s()},l=function(){i&&(cancelAnimationFrame(i),i=null,n=am())};return{add:o,remove:a,stop:l}}var wD=function(e){var t=e.scrollHeight,r=e.scrollWidth,n=e.height,i=e.width,s=Tr({x:r,y:t},{x:i,y:n}),o={x:Math.max(0,s.x),y:Math.max(0,s.y)};return o},bD=function(){var e=document.documentElement;return e||ne(),e},SD=function(){var e=bD(),t=wD({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight});return t},A4=function(){var e=xD(),t=SD(),r=e.y,n=e.x,i=bD(),s=i.clientWidth,o=i.clientHeight,a=n+s,l=r+o,c=pn({top:r,left:n,right:a,bottom:l}),d={frame:c,scroll:{initial:e,current:e,max:t,diff:{value:Ot,displacement:Ot}}};return d},R4=function(e){var t=e.critical,r=e.scrollOptions,n=e.registry,i=A4(),s=i.scroll.current,o=t.droppable,a=n.droppable.getAllByType(o.type).map(function(u){return u.callbacks.getDimensionAndWatchScroll(s,r)}),l=n.draggable.getAllByType(t.draggable.type).map(function(u){return u.getDimension(s)}),c={draggables:ZN(l),droppables:YN(a)},d={dimensions:c,critical:t,viewport:i};return d};function pS(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 j4=function(e,t){var r=null,n=k4({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=function(h,y){e.droppable.exists(h)||ne(),r&&t.updateDroppableIsEnabled({id:h,isEnabled:y})},s=function(h,y){r&&(e.droppable.exists(h)||ne(),t.updateDroppableIsCombineEnabled({id:h,isCombineEnabled:y}))},o=function(h,y){r&&(e.droppable.exists(h)||ne(),t.updateDroppableScroll({id:h,newScroll:y}))},a=function(h,y){r&&e.droppable.getById(h).callbacks.scroll(y)},l=function(){if(r){n.stop();var h=r.critical.droppable;e.droppable.getAllByType(h.type).forEach(function(y){return y.callbacks.dragStopped()}),r.unsubscribe(),r=null}},c=function(h){r||ne();var y=r.critical.draggable;h.type==="ADDITION"&&pS(e,y,h.value)&&n.add(h.value),h.type==="REMOVAL"&&pS(e,y,h.value)&&n.remove(h.value)},d=function(h){r&&ne();var y=e.draggable.getById(h.draggableId),g=e.droppable.getById(y.descriptor.droppableId),w={draggable:y.descriptor,droppable:g.descriptor},x=e.subscribe(c);return r={critical:w,unsubscribe:x},R4({critical:w,registry:e,scrollOptions:h.scrollOptions})},u={updateDroppableIsEnabled:i,updateDroppableIsCombineEnabled:s,scrollDroppable:a,updateDroppableScroll:o,startPublishing:d,stopPublishing:l};return u},CD=function(e,t){return e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP"},I4=function(e){window.scrollBy(e.x,e.y)},M4=Mt(function(e){return kp(e).filter(function(t){return!(!t.isEnabled||!t.frame)})}),O4=function(t,r){var n=Ts(M4(r),function(i){return i.frame||ne(),aD(i.frame.pageMarginBox)(t)});return n},_4=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=O4(t,n);return s},cs={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(t){return Math.pow(t,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},L4=function(e,t){var r=e[t.size]*cs.startFromPercentage,n=e[t.size]*cs.maxScrollAtPercentage,i={startScrollingFrom:r,maxScrollValueAt:n};return i},ED=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},Nx=1,F4=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return cs.maxPixelScroll;if(e===t.startScrollingFrom)return Nx;var r=ED({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),n=1-r,i=cs.maxPixelScroll*cs.ease(n);return Math.ceil(i)},hS=cs.durationDampening.accelerateAt,mS=cs.durationDampening.stopDampeningAt,V4=function(e,t){var r=t,n=mS,i=Date.now(),s=i-r;if(s>=mS)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}},B4=qN(function(e){return e===0?0:e}),TD=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=vS({container:r,distanceToEdges:o,dragStartTime:t,axis:yx,shouldUseTimeDampening:s}),l=vS({container:r,distanceToEdges:o,dragStartTime:t,axis:eD,shouldUseTimeDampening:s}),c=B4({x:l,y:a});if(ls(c,Ot))return null;var d=$4({container:r,subject:n,proposedScroll:c});return d?ls(d,Ot)?null:d:null},U4=qN(function(e){return e===0?0:e>0?1:-1}),Dx=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=$t(r,i),o={x:e(s.x,n.x),y:e(s.y,n.y)};return ls(o,Ot)?null:o}}(),PD=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=U4(i),a=Dx({max:s,current:n,change:o});return!a||o.x!==0&&a.x===0||o.y!==0&&a.y===0},kx=function(t,r){return PD({current:t.scroll.current,max:t.scroll.max,change:r})},z4=function(t,r){if(!kx(t,r))return null;var n=t.scroll.max,i=t.scroll.current;return Dx({current:i,max:n,change:r})},Ax=function(t,r){var n=t.frame;return n?PD({current:n.scroll.current,max:n.scroll.max,change:r}):!1},W4=function(t,r){var n=t.frame;return!n||!Ax(t,r)?null:Dx({current:n.scroll.current,max:n.scroll.max,change:r})},H4=function(e){var t=e.viewport,r=e.subject,n=e.center,i=e.dragStartTime,s=e.shouldUseTimeDampening,o=TD({dragStartTime:i,container:t.frame,subject:r,center:n,shouldUseTimeDampening:s});return o&&kx(t,o)?o:null},G4=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=TD({dragStartTime:i,container:o.pageMarginBox,subject:r,center:n,shouldUseTimeDampening:s});return a&&Ax(t,a)?a:null},yS=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,d=H4({dragStartTime:r,viewport:c,subject:l,center:o,shouldUseTimeDampening:n});if(d){i(d);return}}var u=_4({center:o,destination:Nr(t.impact),droppables:t.dimensions.droppables});if(u){var p=G4({dragStartTime:r,droppable:u,subject:l,center:o,shouldUseTimeDampening:n});p&&s(u.descriptor.id,p)}},K4=function(e){var t=e.scrollWindow,r=e.scrollDroppable,n=Sc(t),i=Sc(r),s=null,o=function(d){s||ne();var u=s,p=u.shouldUseTimeDampening,h=u.dragStartTime;yS({state:d,scrollWindow:n,scrollDroppable:i,dragStartTime:h,shouldUseTimeDampening:p})},a=function(d){s&&ne();var u=Date.now(),p=!1,h=function(){p=!0};yS({state:d,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:h,scrollDroppable:h}),s={dragStartTime:u,shouldUseTimeDampening:p},p&&o(d)},l=function(){s&&(n.cancel(),i.cancel(),s=null)};return{start:a,stop:l,scroll:o}},q4=function(e){var t=e.move,r=e.scrollDroppable,n=e.scrollWindow,i=function(c,d){var u=$t(c.current.client.selection,d);t({client:u})},s=function(c,d){if(!Ax(c,d))return d;var u=W4(c,d);if(!u)return r(c.descriptor.id,d),null;var p=Tr(d,u);r(c.descriptor.id,p);var h=Tr(d,p);return h},o=function(c,d,u){if(!c||!kx(d,u))return u;var p=z4(d,u);if(!p)return n(u),null;var h=Tr(u,p);n(h);var y=Tr(u,h);return y},a=function(c){var d=c.scrollJumpRequest;if(d){var u=Nr(c.impact);u||ne();var p=s(c.dimensions.droppables[u],d);if(p){var h=c.viewport,y=o(c.isWindowScrollAllowed,h,p);y&&i(c,y)}}};return a},Q4=function(e){var t=e.scrollDroppable,r=e.scrollWindow,n=e.move,i=K4({scrollWindow:r,scrollDroppable:t}),s=q4({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},_a="data-rbd",La=function(){var e=_a+"-drag-handle";return{base:e,draggableId:e+"-draggable-id",contextId:e+"-context-id"}}(),dv=function(){var e=_a+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),Y4=function(){var e=_a+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),xS={contextId:_a+"-scroll-container-context-id"},Z4=function(t){return function(r){return"["+r+'="'+t+'"]'}},xl=function(t,r){return t.map(function(n){var i=n.styles[r];return i?n.selector+" { "+i+" }":""}).join(" ")},X4="pointer-events: none;",J4=function(e){var t=Z4(e),r=function(){var a=` cursor: -webkit-grab; cursor: grab; `;return{selector:t(La.contextId),styles:{always:` -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(0,0,0,0); touch-action: manipulation; `,resting:a,dragging:X4,dropAnimating:a}}}(),n=function(){var a=` transition: `+ql.outOfTheWay+`; `;return{selector:t(dv.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}}(),i={selector:t(Y4.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:xl(o,"always"),resting:xl(o,"resting"),dragging:xl(o,"dragging"),dropAnimating:xl(o,"dropAnimating"),userCancel:xl(o,"userCancel")}},Dr=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?m.useLayoutEffect:m.useEffect,lm=function(){var t=document.querySelector("head");return t||ne(),t},wS=function(t){var r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.type="text/css",r};function e3(e,t){var r=Ge(function(){return J4(e)},[e]),n=m.useRef(null),i=m.useRef(null),s=Te(Mt(function(u){var p=i.current;p||ne(),p.textContent=u}),[]),o=Te(function(u){var p=n.current;p||ne(),p.textContent=u},[]);Dr(function(){!n.current&&!i.current||ne();var u=wS(t),p=wS(t);return n.current=u,i.current=p,u.setAttribute(_a+"-always",e),p.setAttribute(_a+"-dynamic",e),lm().appendChild(u),lm().appendChild(p),o(r.always),s(r.resting),function(){var h=function(g){var w=g.current;w||ne(),lm().removeChild(w),g.current=null};h(n),h(i)}},[t,o,s,r.always,r.resting,e]);var a=Te(function(){return s(r.dragging)},[s,r.dragging]),l=Te(function(u){if(u==="DROP"){s(r.dropAnimating);return}s(r.userCancel)},[s,r.dropAnimating,r.userCancel]),c=Te(function(){i.current&&s(r.resting)},[s,r.resting]),d=Ge(function(){return{dragging:a,dropping:l,resting:c}},[a,l,c]);return d}var ND=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function Ip(e){return e instanceof ND(e).HTMLElement}function t3(e,t){var r="["+La.contextId+'="'+e+'"]',n=QN(document.querySelectorAll(r));if(!n.length)return null;var i=Ts(n,function(s){return s.getAttribute(La.draggableId)===t});return!i||!Ip(i)?null:i}function r3(e){var t=m.useRef({}),r=m.useRef(null),n=m.useRef(null),i=m.useRef(!1),s=Te(function(p,h){var y={id:p,focus:h};return t.current[p]=y,function(){var w=t.current,x=w[p];x!==y&&delete w[p]}},[]),o=Te(function(p){var h=t3(e,p);h&&h!==document.activeElement&&h.focus()},[e]),a=Te(function(p,h){r.current===p&&(r.current=h)},[]),l=Te(function(){n.current||i.current&&(n.current=requestAnimationFrame(function(){n.current=null;var p=r.current;p&&o(p)}))},[o]),c=Te(function(p){r.current=null;var h=document.activeElement;h&&h.getAttribute(La.draggableId)===p&&(r.current=p)},[]);Dr(function(){return i.current=!0,function(){i.current=!1;var p=n.current;p&&cancelAnimationFrame(p)}},[]);var d=Ge(function(){return{register:s,tryRecordFocus:c,tryRestoreFocusRecorded:l,tryShiftRecord:a}},[s,c,l,a]);return d}function n3(){var e={draggables:{},droppables:{}},t=[];function r(u){return t.push(u),function(){var h=t.indexOf(u);h!==-1&&t.splice(h,1)}}function n(u){t.length&&t.forEach(function(p){return p(u)})}function i(u){return e.draggables[u]||null}function s(u){var p=i(u);return p||ne(),p}var o={register:function(p){e.draggables[p.descriptor.id]=p,n({type:"ADDITION",value:p})},update:function(p,h){var y=e.draggables[h.descriptor.id];y&&y.uniqueId===p.uniqueId&&(delete e.draggables[h.descriptor.id],e.draggables[p.descriptor.id]=p)},unregister:function(p){var h=p.descriptor.id,y=i(h);y&&p.uniqueId===y.uniqueId&&(delete e.draggables[h],n({type:"REMOVAL",value:p}))},getById:s,findById:i,exists:function(p){return!!i(p)},getAllByType:function(p){return df(e.draggables).filter(function(h){return h.descriptor.type===p})}};function a(u){return e.droppables[u]||null}function l(u){var p=a(u);return p||ne(),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 df(e.droppables).filter(function(h){return h.descriptor.type===p})}};function d(){e.draggables={},e.droppables={},t.length=0}return{draggable:o,droppable:c,subscribe:r,clean:d}}function i3(){var e=Ge(n3,[]);return m.useEffect(function(){return function(){requestAnimationFrame(e.clean)}},[e]),e}var Rx=de.createContext(null),pf=function(){var e=document.body;return e||ne(),e},s3={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},o3=function(t){return"rbd-announcement-"+t};function a3(e){var t=Ge(function(){return o3(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"),Ae(s.style,s3),pf().appendChild(s),function(){setTimeout(function(){var l=pf();l.contains(s)&&l.removeChild(s),s===r.current&&(r.current=null)})}},[t]);var n=Te(function(i){var s=r.current;if(s){s.textContent=i;return}},[]);return n}var l3=0,c3={separator:"::"};function jx(e,t){return t===void 0&&(t=c3),Ge(function(){return""+e+t.separator+l3++},[t.separator,e])}function u3(e){var t=e.contextId,r=e.uniqueId;return"rbd-hidden-text-"+t+"-"+r}function d3(e){var t=e.contextId,r=e.text,n=jx("hidden-text",{separator:"-"}),i=Ge(function(){return u3({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",pf().appendChild(o),function(){var l=pf();l.contains(o)&&l.removeChild(o)}},[i,r]),i}var Mp=de.createContext(null);function DD(e){var t=m.useRef(e);return m.useEffect(function(){t.current=e}),t}function f3(){var e=null;function t(){return!!e}function r(o){return o===e}function n(o){e&&ne();var a={abandon:o};return e=a,a}function i(){e||ne(),e=null}function s(){e&&(e.abandon(),i())}return{isClaimed:t,isActive:r,claim:n,release:i,tryAbandon:s}}var p3=9,h3=13,Ix=27,kD=32,m3=33,g3=34,v3=35,y3=36,x3=37,w3=38,b3=39,S3=40,Ku,C3=(Ku={},Ku[h3]=!0,Ku[p3]=!0,Ku),AD=function(e){C3[e.keyCode]&&e.preventDefault()},Op=function(){var e="visibilitychange";if(typeof document>"u")return e;var t=[e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],r=Ts(t,function(n){return"on"+n in document});return r||e}(),RD=0,bS=5;function E3(e,t){return Math.abs(t.x-e.x)>=bS||Math.abs(t.y-e.y)>=bS}var SS={type:"IDLE"};function T3(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===RD){var d={x:l,y:c},u=n();if(u.type==="DRAGGING"){o.preventDefault(),u.actions.move(d);return}u.type!=="PENDING"&&ne();var p=u.point;if(E3(p,d)){o.preventDefault();var h=u.actions.fluidLift(d);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===Ix){o.preventDefault(),t();return}AD(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"&&ne(),a.actions.shouldRespectForcePress()){t();return}o.preventDefault()}},{eventName:Op,fn:t}]}function P3(e){var t=m.useRef(SS),r=m.useRef(as),n=Ge(function(){return{eventName:"mousedown",fn:function(u){if(!u.defaultPrevented&&u.button===RD&&!(u.ctrlKey||u.metaKey||u.shiftKey||u.altKey)){var p=e.findClosestDraggableId(u);if(p){var h=e.tryGetLock(p,o,{sourceEvent:u});if(h){u.preventDefault();var y={x:u.clientX,y:u.clientY};r.current(),c(h,y)}}}}}},[e]),i=Ge(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(u){if(!u.defaultPrevented){var p=e.findClosestDraggableId(u);if(p){var h=e.findOptionsForDraggable(p);h&&(h.shouldRespectForcePress||e.canGetLock(p)&&u.preventDefault())}}}}},[e]),s=Te(function(){var u={passive:!1,capture:!0};r.current=Gr(window,[i,n],u)},[i,n]),o=Te(function(){var d=t.current;d.type!=="IDLE"&&(t.current=SS,r.current(),s())},[s]),a=Te(function(){var d=t.current;o(),d.type==="DRAGGING"&&d.actions.cancel({shouldBlockNextClick:!0}),d.type==="PENDING"&&d.actions.abort()},[o]),l=Te(function(){var u={capture:!0,passive:!1},p=T3({cancel:a,completed:o,getPhase:function(){return t.current},setPhase:function(y){t.current=y}});r.current=Gr(window,p,u)},[a,o]),c=Te(function(u,p){t.current.type!=="IDLE"&&ne(),t.current={type:"PENDING",point:p,actions:u},l()},[l]);Dr(function(){return s(),function(){r.current()}},[s])}var No;function N3(){}var D3=(No={},No[g3]=!0,No[m3]=!0,No[y3]=!0,No[v3]=!0,No);function k3(e,t){function r(){t(),e.cancel()}function n(){t(),e.drop()}return[{eventName:"keydown",fn:function(s){if(s.keyCode===Ix){s.preventDefault(),r();return}if(s.keyCode===kD){s.preventDefault(),n();return}if(s.keyCode===S3){s.preventDefault(),e.moveDown();return}if(s.keyCode===w3){s.preventDefault(),e.moveUp();return}if(s.keyCode===b3){s.preventDefault(),e.moveRight();return}if(s.keyCode===x3){s.preventDefault(),e.moveLeft();return}if(D3[s.keyCode]){s.preventDefault();return}AD(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:Op,fn:r}]}function A3(e){var t=m.useRef(N3),r=Ge(function(){return{eventName:"keydown",fn:function(s){if(s.defaultPrevented||s.keyCode!==kD)return;var o=e.findClosestDraggableId(s);if(!o)return;var a=e.tryGetLock(o,d,{sourceEvent:s});if(!a)return;s.preventDefault();var l=!0,c=a.snapLift();t.current();function d(){l||ne(),l=!1,t.current(),n()}t.current=Gr(window,k3(c,d),{capture:!0,passive:!1})}}},[e]),n=Te(function(){var s={passive:!1,capture:!0};t.current=Gr(window,[r],s)},[r]);Dr(function(){return n(),function(){t.current()}},[n])}var cm={type:"IDLE"},R3=120,j3=.15;function I3(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===Ix&&i.preventDefault(),t()}},{eventName:Op,fn:t}]}function M3(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,d={x:l,y:c};s.preventDefault(),o.actions.move(d)}},{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"&&ne();var a=s.touches[0];if(a){var l=a.force>=j3;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:Op,fn:t}]}function O3(e){var t=m.useRef(cm),r=m.useRef(as),n=Te(function(){return t.current},[]),i=Te(function(h){t.current=h},[]),s=Ge(function(){return{eventName:"touchstart",fn:function(h){if(!h.defaultPrevented){var y=e.findClosestDraggableId(h);if(y){var g=e.tryGetLock(y,a,{sourceEvent:h});if(g){var w=h.touches[0],x=w.clientX,v=w.clientY,b={x,y:v};r.current(),u(g,b)}}}}}},[e]),o=Te(function(){var h={capture:!0,passive:!1};r.current=Gr(window,[s],h)},[s]),a=Te(function(){var p=t.current;p.type!=="IDLE"&&(p.type==="PENDING"&&clearTimeout(p.longPressTimerId),i(cm),r.current(),o())},[o,i]),l=Te(function(){var p=t.current;a(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[a]),c=Te(function(){var h={capture:!0,passive:!1},y={cancel:l,completed:a,getPhase:n},g=Gr(window,M3(y),h),w=Gr(window,I3(y),h);r.current=function(){g(),w()}},[l,n,a]),d=Te(function(){var h=n();h.type!=="PENDING"&&ne();var y=h.actions.fluidLift(h.point);i({type:"DRAGGING",actions:y,hasMoved:!1})},[n,i]),u=Te(function(h,y){n().type!=="IDLE"&&ne();var g=setTimeout(d,R3);i({type:"PENDING",point:y,actions:h,longPressTimerId:g}),c()},[c,n,i,d]);Dr(function(){return o(),function(){r.current();var y=n();y.type==="PENDING"&&(clearTimeout(y.longPressTimerId),i(cm))}},[n,o,i]),Dr(function(){var h=Gr(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return h},[])}var _3={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function jD(e,t){if(t==null)return!1;var r=!!_3[t.tagName.toLowerCase()];if(r)return!0;var n=t.getAttribute("contenteditable");return n==="true"||n===""?!0:t===e?!1:jD(e,t.parentElement)}function L3(e,t){var r=t.target;return Ip(r)?jD(e,r):!1}var F3=function(e){return pn(e.getBoundingClientRect()).center};function V3(e){return e instanceof ND(e).Element}var $3=function(){var e="matches";if(typeof document>"u")return e;var t=[e,"msMatchesSelector","webkitMatchesSelector"],r=Ts(t,function(n){return n in Element.prototype});return r||e}();function ID(e,t){return e==null?null:e[$3](t)?e:ID(e.parentElement,t)}function B3(e,t){return e.closest?e.closest(t):ID(e,t)}function U3(e){return"["+La.contextId+'="'+e+'"]'}function z3(e,t){var r=t.target;if(!V3(r))return null;var n=U3(e),i=B3(r,n);return!i||!Ip(i)?null:i}function W3(e,t){var r=z3(e,t);return r?r.getAttribute(La.draggableId):null}function H3(e,t){var r="["+dv.contextId+'="'+e+'"]',n=QN(document.querySelectorAll(r)),i=Ts(n,function(s){return s.getAttribute(dv.id)===t});return!i||!Ip(i)?null:i}function G3(e){e.preventDefault()}function qu(e){var t=e.expected,r=e.phase,n=e.isLockActive;return e.shouldWarn,!(!n()||t!==r)}function MD(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||!CD(r.getState(),i))}function K3(e){var t=e.lockAPI,r=e.contextId,n=e.store,i=e.registry,s=e.draggableId,o=e.forceSensorStop,a=e.sourceEvent,l=MD({lockAPI:t,store:n,registry:i,draggableId:s});if(!l)return null;var c=i.draggable.getById(s),d=H3(r,c.descriptor.id);if(!d||a&&!c.options.canDragInteractiveElements&&L3(d,a))return null;var u=t.claim(o||as),p="PRE_DRAG";function h(){return c.options.shouldRespectForcePress}function y(){return t.isActive(u)}function g(P,D){qu({expected:P,phase:p,isLockActive:y,shouldWarn:!0})&&n.dispatch(D())}var w=g.bind(null,"DRAGGING");function x(P){function D(){t.release(),p="COMPLETED"}p!=="PRE_DRAG"&&(D(),p!=="PRE_DRAG"&&ne()),n.dispatch($B(P.liftActionArgs)),p="DRAGGING";function k(A,I){if(I===void 0&&(I={shouldBlockNextClick:!1}),P.cleanup(),I.shouldBlockNextClick){var $=Gr(window,[{eventName:"click",fn:G3,options:{once:!0,passive:!1,capture:!0}}]);setTimeout($)}D(),n.dispatch(gD({reason:A}))}return Ae({isActive:function(){return qu({expected:"DRAGGING",phase:p,isLockActive:y,shouldWarn:!1})},shouldRespectForcePress:h,drop:function(I){return k("DROP",I)},cancel:function(I){return k("CANCEL",I)}},P.actions)}function v(P){var D=Sc(function(A){w(function(){return mD({client:A})})}),k=x({liftActionArgs:{id:s,clientSelection:P,movementMode:"FLUID"},cleanup:function(){return D.cancel()},actions:{move:D}});return Ae({},k,{move:D})}function b(){var P={moveUp:function(){return w(QB)},moveRight:function(){return w(ZB)},moveDown:function(){return w(YB)},moveLeft:function(){return w(XB)}};return x({liftActionArgs:{id:s,clientSelection:F3(d),movementMode:"SNAP"},cleanup:as,actions:P})}function S(){var P=qu({expected:"PRE_DRAG",phase:p,isLockActive:y,shouldWarn:!0});P&&t.release()}var C={isActive:function(){return qu({expected:"PRE_DRAG",phase:p,isLockActive:y,shouldWarn:!1})},shouldRespectForcePress:h,fluidLift:v,snapLift:b,abort:S};return C}var q3=[P3,A3,O3];function Q3(e){var t=e.contextId,r=e.store,n=e.registry,i=e.customSensors,s=e.enableDefaultSensors,o=[].concat(s?q3:[],i||[]),a=m.useState(function(){return f3()})[0],l=Te(function(v,b){v.isDragging&&!b.isDragging&&a.tryAbandon()},[a]);Dr(function(){var v=r.getState(),b=r.subscribe(function(){var S=r.getState();l(v,S),v=S});return b},[a,r,l]),Dr(function(){return a.tryAbandon},[a.tryAbandon]);for(var c=Te(function(x){return MD({lockAPI:a,registry:n,store:r,draggableId:x})},[a,n,r]),d=Te(function(x,v,b){return K3({lockAPI:a,registry:n,contextId:t,store:r,draggableId:x,forceSensorStop:v,sourceEvent:b&&b.sourceEvent?b.sourceEvent:null})},[t,a,n,r]),u=Te(function(x){return W3(t,x)},[t]),p=Te(function(x){var v=n.draggable.findById(x);return v?v.options:null},[n.draggable]),h=Te(function(){a.isClaimed()&&(a.tryAbandon(),r.getState().phase!=="IDLE"&&r.dispatch(Cx()))},[a,r]),y=Te(a.isClaimed,[a]),g=Ge(function(){return{canGetLock:c,tryGetLock:d,findClosestDraggableId:u,findOptionsForDraggable:p,tryReleaseLock:h,isLockClaimed:y}},[c,d,u,p,h,y]),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 _p(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const pv=e=>Array.isArray(e);function BD(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 Ox(e,t,r,n){if(typeof t=="function"){const[i,s]=DS(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]=DS(n);t=t(r!==void 0?r:e.custom,i,s)}return t}function Lp(e,t,r){const n=e.getProps();return Ox(n,t,r!==void 0?r:n.custom,e)}const _x=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Lx=["initial",..._x],pu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wo=new Set(pu),ci=e=>e*1e3,ui=e=>e/1e3,W5={type:"spring",stiffness:500,damping:25,restSpeed:10},H5=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),G5={type:"keyframes",duration:.8},K5={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},q5=(e,{keyframes:t})=>t.length>2?G5:wo.has(e)?e.startsWith("scale")?H5(t[1]):W5:K5;function Fx(e,t){return e?e[t]||e.default||e:void 0}const Q5={skipAnimations:!1,useManualTiming:!1},Y5=e=>e!==null;function Fp(e,{repeat:t,repeatType:r="loop"},n){const i=e.filter(Y5),s=t&&r!=="loop"&&t%2===1?0:i.length-1;return!s||n===void 0?i[s]:n}const kr=e=>e;let hv=kr;function Z5(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,d=!1,u=!1)=>{const h=u&&n?t:r;return d&&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 Yu=["read","resolveKeyframes","update","preRender","render","postRender"],X5=40;function UD(e,t){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,o=Yu.reduce((x,v)=>(x[v]=Z5(s),x),{}),{read:a,resolveKeyframes:l,update:c,preRender:d,render:u,postRender:p}=o,h=()=>{const x=performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(x-i.timestamp,X5),1),i.timestamp=x,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),d.process(i),u.process(i),p.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(h))},y=()=>{r=!0,n=!0,i.isProcessing||e(h)};return{schedule:Yu.reduce((x,v)=>{const b=o[v];return x[v]=(S,C=!1,P=!1)=>(r||y(),b.schedule(S,C,P)),x},{}),cancel:x=>{for(let v=0;v(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,J5=1e-7,eU=12;function tU(e,t,r,n,i){let s,o,a=0;do o=t+(r-t)/2,s=zD(o,n,i)-e,s>0?r=o:t=o;while(Math.abs(s)>J5&&++atU(s,0,1,e,r);return s=>s===0||s===1?s:zD(i(s),t,n)}const WD=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,HD=e=>t=>1-e(1-t),GD=hu(.33,1.53,.69,.99),Vx=HD(GD),KD=WD(Vx),qD=e=>(e*=2)<1?.5*Vx(e):.5*(2-Math.pow(2,-10*(e-1))),$x=e=>1-Math.sin(Math.acos(e)),QD=HD($x),YD=WD($x),ZD=e=>/^0[^.\s]+$/u.test(e);function rU(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ZD(e):!0}const XD=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),JD=e=>t=>typeof t=="string"&&t.startsWith(e),ek=JD("--"),nU=JD("var(--"),Bx=e=>nU(e)?iU.test(e.split("/*")[0].trim()):!1,iU=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,sU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function oU(e){const t=sU.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}function tk(e,t,r=1){const[n,i]=oU(e);if(!n)return;const s=window.getComputedStyle(t).getPropertyValue(n);if(s){const o=s.trim();return XD(o)?parseFloat(o):o}return Bx(i)?tk(i,t,r+1):i}const xi=(e,t,r)=>r>t?t:rtypeof e=="number",parse:parseFloat,transform:e=>e},Dc={...tl,transform:e=>xi(0,1,e)},Zu={...tl,default:1},mu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Oi=mu("deg"),$n=mu("%"),Re=mu("px"),aU=mu("vh"),lU=mu("vw"),kS={...$n,parse:e=>$n.parse(e)/100,transform:e=>$n.transform(e*100)},cU=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),AS=e=>e===tl||e===Re,RS=(e,t)=>parseFloat(e.split(", ")[t]),jS=(e,t)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/u);if(i)return RS(i[1],t);{const s=n.match(/^matrix\((.+)\)$/u);return s?RS(s[1],e):0}},uU=new Set(["x","y","z"]),dU=pu.filter(e=>!uU.has(e));function fU(e){const t=[];return dU.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const Fa={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:jS(4,13),y:jS(5,14)};Fa.translateX=Fa.x;Fa.translateY=Fa.y;const rk=e=>t=>t.test(e),pU={test:e=>e==="auto",parse:e=>e},nk=[tl,Re,$n,Oi,lU,aU,pU],IS=e=>nk.find(rk(e)),no=new Set;let mv=!1,gv=!1;function ik(){if(gv){const e=Array.from(no).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const i=fU(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)})}gv=!1,mv=!1,no.forEach(e=>e.complete()),no.clear()}function sk(){no.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(gv=!0)})}function hU(){sk(),ik()}class Ux{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?(no.add(this),mv||(mv=!0,at.read(sk),at.resolveKeyframes(ik))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;for(let s=0;sMath.round(e*1e5)/1e5,zx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function mU(e){return e==null}const gU=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wx=(e,t)=>r=>!!(typeof r=="string"&&gU.test(r)&&r.startsWith(e)||t&&!mU(r)&&Object.prototype.hasOwnProperty.call(r,t)),ok=(e,t,r)=>n=>{if(typeof n!="string")return n;const[i,s,o,a]=n.match(zx);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},vU=e=>xi(0,255,e),pm={...tl,transform:e=>Math.round(vU(e))},Ws={test:Wx("rgb","red"),parse:ok("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+pm.transform(e)+", "+pm.transform(t)+", "+pm.transform(r)+", "+Ql(Dc.transform(n))+")"};function yU(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 vv={test:Wx("#"),parse:yU,transform:Ws.transform},Ho={test:Wx("hsl","hue"),parse:ok("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+$n.transform(Ql(t))+", "+$n.transform(Ql(r))+", "+Ql(Dc.transform(n))+")"},Gt={test:e=>Ws.test(e)||vv.test(e)||Ho.test(e),parse:e=>Ws.test(e)?Ws.parse(e):Ho.test(e)?Ho.parse(e):vv.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ws.transform(e):Ho.transform(e)},xU=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function wU(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(zx))===null||t===void 0?void 0:t.length)||0)+(((r=e.match(xU))===null||r===void 0?void 0:r.length)||0)>0}const ak="number",lk="color",bU="var",SU="var(",MS="${}",CU=/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 kc(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(CU,l=>(Gt.test(l)?(n.color.push(s),i.push(lk),r.push(Gt.parse(l))):l.startsWith(SU)?(n.var.push(s),i.push(bU),r.push(l)):(n.number.push(s),i.push(ak),r.push(parseFloat(l))),++s,MS)).split(MS);return{values:r,split:a,indexes:n,types:i}}function ck(e){return kc(e).values}function uk(e){const{split:t,types:r}=kc(e),n=t.length;return i=>{let s="";for(let o=0;otypeof e=="number"?0:e;function TU(e){const t=ck(e);return uk(e)(t.map(EU))}const hs={test:wU,parse:ck,createTransformer:uk,getAnimatableNone:TU},PU=new Set(["brightness","contrast","saturate","opacity"]);function NU(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(zx)||[];if(!n)return e;const i=r.replace(n,"");let s=PU.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+i+")"}const DU=/\b([a-z-]*)\(.*?\)/gu,yv={...hs,getAnimatableNone:e=>{const t=e.match(DU);return t?t.map(NU).join(" "):e}},kU={borderWidth:Re,borderTopWidth:Re,borderRightWidth:Re,borderBottomWidth:Re,borderLeftWidth:Re,borderRadius:Re,radius:Re,borderTopLeftRadius:Re,borderTopRightRadius:Re,borderBottomRightRadius:Re,borderBottomLeftRadius:Re,width:Re,maxWidth:Re,height:Re,maxHeight:Re,top:Re,right:Re,bottom:Re,left:Re,padding:Re,paddingTop:Re,paddingRight:Re,paddingBottom:Re,paddingLeft:Re,margin:Re,marginTop:Re,marginRight:Re,marginBottom:Re,marginLeft:Re,backgroundPositionX:Re,backgroundPositionY:Re},AU={rotate:Oi,rotateX:Oi,rotateY:Oi,rotateZ:Oi,scale:Zu,scaleX:Zu,scaleY:Zu,scaleZ:Zu,skew:Oi,skewX:Oi,skewY:Oi,distance:Re,translateX:Re,translateY:Re,translateZ:Re,x:Re,y:Re,z:Re,perspective:Re,transformPerspective:Re,opacity:Dc,originX:kS,originY:kS,originZ:Re},OS={...tl,transform:Math.round},Hx={...kU,...AU,zIndex:OS,size:Re,fillOpacity:Dc,strokeOpacity:Dc,numOctaves:OS},RU={...Hx,color:Gt,backgroundColor:Gt,outlineColor:Gt,fill:Gt,stroke:Gt,borderColor:Gt,borderTopColor:Gt,borderRightColor:Gt,borderBottomColor:Gt,borderLeftColor:Gt,filter:yv,WebkitFilter:yv},Gx=e=>RU[e];function dk(e,t){let r=Gx(e);return r!==yv&&(r=hs),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const jU=new Set(["auto","none","0"]);function IU(e,t,r){let n=0,i;for(;n{r.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function Kx(e){return typeof e=="function"}let Ed;function MU(){Ed=void 0}const Bn={now:()=>(Ed===void 0&&Bn.set(Vt.isProcessing||Q5.useManualTiming?Vt.timestamp:performance.now()),Ed),set:e=>{Ed=e,queueMicrotask(MU)}},_S=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hs.test(e)||e==="0")&&!e.startsWith("url("));function OU(e){const t=e[0];if(e.length===1)return!0;for(let r=0;rLU?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&hU(),this._resolved}onKeyframesResolved(t,r){this.resolvedAt=Bn.now(),this.hasAttemptedResolve=!0;const{name:n,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!_U(t,n,i,s))if(o)this.options.duration=0;else{l==null||l(Fp(t,this.options,r)),a==null||a(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,r);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:r,...d},this.onPostResolved())}onPostResolved(){}then(t,r){return this.currentFinishedPromise.then(t,r)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Va=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n},hk=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let s=0;s{const d=c*o,u=d*e,p=d-r,h=xv(c,o),y=Math.exp(-u);return hm-p/h*y},s=c=>{const u=c*o*e,p=u*r+r,h=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-u),g=xv(Math.pow(c,2),o);return(-i(c)+hm>0?-1:1)*((p-h)*y)/g}):(i=c=>{const d=Math.exp(-c*e),u=(c-r)*e+1;return-hm+d*u},s=c=>{const d=Math.exp(-c*e),u=(r-c)*(e*e);return d*u});const a=5/e,l=BU(i,s,a);if(e=ci(e),isNaN(l))return{stiffness:yt.stiffness,damping:yt.damping,duration:e};{const c=Math.pow(l,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:e}}}const $U=12;function BU(e,t,r){let n=r;for(let i=1;i<$U;i++)n=n-e(n)/t(n);return n}function xv(e,t){return e*Math.sqrt(1-t*t)}const wv=2e4;function vk(e){let t=0;const r=50;let n=e.next(t);for(;!n.done&&t=wv?1/0:t}const UU=["duration","bounce"],zU=["stiffness","damping","mass"];function LS(e,t){return t.some(r=>e[r]!==void 0)}function WU(e){let t={velocity:yt.velocity,stiffness:yt.stiffness,damping:yt.damping,mass:yt.mass,isResolvedFromDuration:!1,...e};if(!LS(e,zU)&&LS(e,UU))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,s=2*xi(.05,1,1-e.bounce)*Math.sqrt(i);t={...t,mass:yt.mass,stiffness:i,damping:s}}else{const r=VU(e);t={...t,...r,mass:yt.mass},t.isResolvedFromDuration=!0}return t}function yk(e=yt.visualDuration,t=yt.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:d,duration:u,velocity:p,isResolvedFromDuration:h}=WU({...r,velocity:-ui(r.velocity||0)}),y=p||0,g=c/(2*Math.sqrt(l*d)),w=o-s,x=ui(Math.sqrt(l/d)),v=Math.abs(w)<5;n||(n=v?yt.restSpeed.granular:yt.restSpeed.default),i||(i=v?yt.restDelta.granular:yt.restDelta.default);let b;if(g<1){const C=xv(x,g);b=P=>{const D=Math.exp(-g*x*P);return o-D*((y+g*x*w)/C*Math.sin(C*P)+w*Math.cos(C*P))}}else if(g===1)b=C=>o-Math.exp(-x*C)*(w+(y+x*w)*C);else{const C=x*Math.sqrt(g*g-1);b=P=>{const D=Math.exp(-g*x*P),k=Math.min(C*P,300);return o-D*((y+g*x*w)*Math.sinh(k)+C*w*Math.cosh(k))/C}}const S={calculatedDuration:h&&u||null,next:C=>{const P=b(C);if(h)a.done=C>=u;else{let D=0;g<1&&(D=C===0?ci(y):gk(b,C,P));const k=Math.abs(D)<=n,A=Math.abs(o-P)<=i;a.done=k&&A}return a.value=a.done?o:P,a},toString:()=>{const C=Math.min(vk(S),wv),P=hk(D=>S.next(C*D).value,C,30);return C+"ms "+P}};return S}function FS({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:d}){const u=e[0],p={done:!1,value:u},h=k=>a!==void 0&&kl,y=k=>a===void 0?l:l===void 0||Math.abs(a-k)-g*Math.exp(-k/n),b=k=>x+v(k),S=k=>{const A=v(k),I=b(k);p.done=Math.abs(A)<=c,p.value=p.done?x:I};let C,P;const D=k=>{h(p.value)&&(C=k,P=yk({keyframes:[p.value,y(p.value)],velocity:gk(b,k,p.value),damping:i,stiffness:s,restDelta:c,restSpeed:d}))};return D(0),{calculatedDuration:null,next:k=>{let A=!1;return!P&&C===void 0&&(A=!0,S(k),D(k)),C!==void 0&&k>=C?P.next(k-C):(!A&&S(k),p)}}}const HU=hu(.42,0,1,1),GU=hu(0,0,.58,1),xk=hu(.42,0,.58,1),KU=e=>Array.isArray(e)&&typeof e[0]!="number",qx=e=>Array.isArray(e)&&typeof e[0]=="number",VS={linear:kr,easeIn:HU,easeInOut:xk,easeOut:GU,circIn:$x,circInOut:YD,circOut:QD,backIn:Vx,backInOut:KD,backOut:GD,anticipate:qD},$S=e=>{if(qx(e)){hv(e.length===4);const[t,r,n,i]=e;return hu(t,r,n,i)}else if(typeof e=="string")return hv(VS[e]!==void 0),VS[e];return e},qU=(e,t)=>r=>t(e(r)),gu=(...e)=>e.reduce(qU),pt=(e,t,r)=>e+(t-e)*r;function mm(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 QU({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=mm(l,a,e+1/3),s=mm(l,a,e),o=mm(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function mf(e,t){return r=>r>0?t:e}const gm=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},YU=[vv,Ws,Ho],ZU=e=>YU.find(t=>t.test(e));function BS(e){const t=ZU(e);if(!t)return!1;let r=t.parse(e);return t===Ho&&(r=QU(r)),r}const US=(e,t)=>{const r=BS(e),n=BS(t);if(!r||!n)return mf(e,t);const i={...r};return s=>(i.red=gm(r.red,n.red,s),i.green=gm(r.green,n.green,s),i.blue=gm(r.blue,n.blue,s),i.alpha=pt(r.alpha,n.alpha,s),Ws.transform(i))},bv=new Set(["none","hidden"]);function XU(e,t){return bv.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function JU(e,t){return r=>pt(e,t,r)}function Qx(e){return typeof e=="number"?JU:typeof e=="string"?Bx(e)?mf:Gt.test(e)?US:rz:Array.isArray(e)?wk:typeof e=="object"?Gt.test(e)?US:ez:mf}function wk(e,t){const r=[...e],n=r.length,i=e.map((s,o)=>Qx(s)(s,t[o]));return s=>{for(let o=0;o{for(const s in n)r[s]=n[s](i);return r}}function tz(e,t){var r;const n=[],i={color:0,var:0,number:0};for(let s=0;s{const r=hs.createTransformer(t),n=kc(e),i=kc(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?bv.has(e)&&!i.values.length||bv.has(t)&&!n.values.length?XU(e,t):gu(wk(tz(n,i),i.values),r):mf(e,t)};function bk(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?pt(e,t,r):Qx(e)(e,t)}function nz(e,t,r){const n=[],i=r||bk,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=nz(t,n,i),a=o.length,l=c=>{let d=0;if(a>1)for(;dl(xi(e[0],e[s-1],c)):l}function sz(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=Va(0,t,n);e.push(pt(r,1,i))}}function oz(e){const t=[0];return sz(t,e.length-1),t}function az(e,t){return e.map(r=>r*t)}function lz(e,t){return e.map(()=>t||xk).splice(0,e.length-1)}function gf({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=KU(n)?n.map($S):$S(n),s={done:!1,value:t[0]},o=az(r&&r.length===t.length?r:oz(t),e),a=iz(o,t,{ease:Array.isArray(i)?i:lz(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const cz=e=>{const t=({timestamp:r})=>e(r);return{start:()=>at.update(t,!0),stop:()=>ps(t),now:()=>Vt.isProcessing?Vt.timestamp:Bn.now()}},uz={decay:FS,inertia:FS,tween:gf,keyframes:gf,spring:yk},dz=e=>e/100;class Yx extends pk{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)||Ux,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=Kx(r)?r:uz[r]||gf;let l,c;a!==gf&&typeof t[0]!="number"&&(l=gu(dz,bk(t[0],t[1])),t=[0,100]);const d=a({...this.options,keyframes:t});s==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=vk(d));const{calculatedDuration:u}=d,p=u+i,h=p*(n+1)-i;return{generator:d,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:u,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:d,resolvedDuration:u}=n;if(this.startTime===null)return s.next(0);const{delay:p,repeat:h,repeatType:y,repeatDelay:g,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),r?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const x=this.currentTime-p*(this.speed>=0?1:-1),v=this.speed>=0?x<0:x>d;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let b=this.currentTime,S=s;if(h){const k=Math.min(this.currentTime,d)/u;let A=Math.floor(k),I=k%1;!I&&k>=1&&(I=1),I===1&&A--,A=Math.min(A,h+1),!!(A%2)&&(y==="reverse"?(I=1-I,g&&(I-=g/u)):y==="mirror"&&(S=o)),b=xi(0,1,I)*u}const C=v?{done:!1,value:l[0]}:S.next(b);a&&(C.value=a(C.value));let{done:P}=C;!v&&c!==null&&(P=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return D&&i!==void 0&&(C.value=Fp(l,this.options,i)),w&&w(C.value),D&&this.finish(),C}get duration(){const{resolved:t}=this;return t?ui(t.calculatedDuration):0}get time(){return ui(this.currentTime)}set time(t){t=ci(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=ui(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=cz,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 fz=new Set(["opacity","clipPath","filter","transform"]);function Zx(e){let t;return()=>(t===void 0&&(t=e()),t)}const pz={linearEasing:void 0};function hz(e,t){const r=Zx(e);return()=>{var n;return(n=pz[t])!==null&&n!==void 0?n:r()}}const vf=hz(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function Sk(e){return!!(typeof e=="function"&&vf()||!e||typeof e=="string"&&(e in Sv||vf())||qx(e)||Array.isArray(e)&&e.every(Sk))}const kl=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,Sv={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:kl([0,.65,.55,1]),circOut:kl([.55,0,1,.45]),backIn:kl([.31,.01,.66,-.59]),backOut:kl([.33,1.53,.69,.99])};function Ck(e,t){if(e)return typeof e=="function"&&vf()?hk(e,t):qx(e)?kl(e):Array.isArray(e)?e.map(r=>Ck(r,t)||Sv.easeOut):Sv[e]}function mz(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 d=Ck(a,i);return Array.isArray(d)&&(c.easing=d),e.animate(c,{delay:n,duration:i,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function zS(e,t){e.timeline=t,e.onfinish=null}const gz=Zx(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),yf=10,vz=2e4;function yz(e){return Kx(e.type)||e.type==="spring"||!Sk(e.ease)}function xz(e,t){const r=new Yx({...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:d}=this.options;if(!(!((n=l.owner)===null||n===void 0)&&n.current))return!1;if(typeof o=="string"&&vf()&&wz(o)&&(o=Ek[o]),yz(this.options)){const{onComplete:p,onUpdate:h,motionValue:y,element:g,...w}=this.options,x=xz(t,w);t=x.keyframes,t.length===1&&(t[1]=t[0]),i=x.duration,s=x.times,o=x.ease,a="keyframes"}const u=mz(l.owner.current,c,t,{...this.options,duration:i,times:s,ease:o});return u.startTime=d??this.calcStartTime(),this.pendingTimeline?(zS(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:p}=this.options;l.set(Fp(t,this.options,r)),p&&p(),this.cancel(),this.resolveFinishedPromise()},{animation:u,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 ui(r)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:r}=t;return ui(r.currentTime||0)}set time(t){const{resolved:r}=this;if(!r)return;const{animation:n}=r;n.currentTime=ci(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 kr;const{animation:n}=r;zS(n,t)}return kr}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:d,onComplete:u,element:p,...h}=this.options,y=new Yx({...h,keyframes:n,duration:i,type:s,ease:o,times:a,isGenerator:!0}),g=ci(this.time);c.setWithVelocity(y.sample(g-yf).value,y.sample(g).value,yf)}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 gz()&&n&&fz.has(n)&&r&&r.owner&&r.owner.current instanceof HTMLElement&&!r.owner.getProps().onUpdate&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const bz=Zx(()=>window.ScrollTimeline!==void 0);class Sz{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;nbz()&&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 Cz({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:c,...d}){return!!Object.keys(d).length}const Xx=(e,t,r,n={},i,s)=>o=>{const a=Fx(n,e)||{},l=a.delay||n.delay||0;let{elapsed:c=0}=n;c=c-ci(l);let d={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};Cz(a)||(d={...d,...q5(e,d)}),d.duration&&(d.duration=ci(d.duration)),d.repeatDelay&&(d.repeatDelay=ci(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let u=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(u=!0)),u&&!s&&t.get()!==void 0){const p=Fp(d.keyframes,a);if(p!==void 0)return at.update(()=>{d.onUpdate(p),d.onComplete()}),new Sz([])}return!s&&WS.supports(d)?new WS(d):new Yx(d)},Ez=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Tz=e=>pv(e)?e[e.length-1]||0:e;function Jx(e,t){e.indexOf(t)===-1&&e.push(t)}function ew(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class tw{constructor(){this.subscriptions=[]}add(t){return Jx(this.subscriptions,t),()=>ew(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 Nz{constructor(t,r={}){this.version="11.15.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,i=!0)=>{const s=Bn.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=Bn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Pz(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 tw);const n=this.events[t].add(r);return t==="change"?()=>{n(),at.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t,r=!0){!r||!this.passiveEffect?this.updateAndNotify(t,r):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Bn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>HS)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,HS);return mk(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 Nz(e,t)}function Dz(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,Ac(r))}function kz(e,t){const r=Lp(e,t);let{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(const o in s){const a=Tz(s[o]);Dz(e,o,a)}}const rw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Az="framerAppearId",Tk="data-"+rw(Az);function Pk(e){return e.props[Tk]}const qt=e=>!!(e&&e.getVelocity);function Rz(e){return!!(qt(e)&&e.add)}function Cv(e,t){const r=e.getValue("willChange");if(Rz(r))return r.add(t)}function jz({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function Nk(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=[],d=i&&e.animationState&&e.animationState.getState()[i];for(const u in l){const p=e.getValue(u,(s=e.latestValues[u])!==null&&s!==void 0?s:null),h=l[u];if(h===void 0||d&&jz(d,u))continue;const y={delay:r,...Fx(o||{},u)};let g=!1;if(window.MotionHandoffAnimation){const x=Pk(e);if(x){const v=window.MotionHandoffAnimation(x,u,at);v!==null&&(y.startTime=v,g=!0)}}Cv(e,u),p.start(Xx(u,p,h,e.shouldReduceMotion&&wo.has(u)?{type:!1}:y,e,g));const w=p.animation;w&&c.push(w)}return a&&Promise.all(c).then(()=>{at.update(()=>{a&&kz(e,a)})}),c}function Ev(e,t,r={}){var n;const i=Lp(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(Nk(e,i,r)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:u,staggerDirection:p}=s;return Iz(e,t,d+c,u,p,r)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,d]=l==="beforeChildren"?[o,a]:[a,o];return c().then(()=>d())}else return Promise.all([o(),a(r.delay)])}function Iz(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(Mz).forEach((c,d)=>{c.notify("AnimationStart",t),o.push(Ev(c,t,{...s,delay:r+l(d)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(o)}function Mz(e,t){return e.sortNodePosition(t)}function Oz(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(s=>Ev(e,s,r));n=Promise.all(i)}else if(typeof t=="string")n=Ev(e,t,r);else{const i=typeof t=="function"?Lp(e,t,r.custom):t;n=Promise.all(Nk(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}const _z=Lx.length;function Dk(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?Dk(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const t={};for(let r=0;r<_z;r++){const n=Lx[r],i=e.props[n];(Nc(i)||i===!1)&&(t[n]=i)}return t}const Lz=[..._x].reverse(),Fz=_x.length;function Vz(e){return t=>Promise.all(t.map(({animation:r,options:n})=>Oz(e,r,n)))}function $z(e){let t=Vz(e),r=GS(),n=!0;const i=l=>(c,d)=>{var u;const p=Lp(e,d,l==="exit"?(u=e.presenceContext)===null||u===void 0?void 0:u.custom:void 0);if(p){const{transition:h,transitionEnd:y,...g}=p;c={...c,...g,...y}}return c};function s(l){t=l(e)}function o(l){const{props:c}=e,d=Dk(e.parent)||{},u=[],p=new Set;let h={},y=1/0;for(let w=0;wy&&S,A=!1;const I=Array.isArray(b)?b:[b];let $=I.reduce(i(x),{});C===!1&&($={});const{prevResolvedValues:_={}}=v,q={..._,...$},V=re=>{k=!0,p.has(re)&&(A=!0,p.delete(re)),v.needsAnimating[re]=!0;const M=e.getValue(re);M&&(M.liveStyle=!1)};for(const re in q){const M=$[re],O=_[re];if(h.hasOwnProperty(re))continue;let T=!1;pv(M)&&pv(O)?T=!BD(M,O):T=M!==O,T?M!=null?V(re):p.add(re):M!==void 0&&p.has(re)?V(re):v.protectedKeys[re]=!0}v.prevProp=b,v.prevResolvedValues=$,v.isActive&&(h={...h,...$}),n&&e.blockInitialAnimation&&(k=!1),k&&(!(P&&D)||A)&&u.push(...I.map(re=>({animation:re,options:{type:x}})))}if(p.size){const w={};p.forEach(x=>{const v=e.getBaseTarget(x),b=e.getValue(x);b&&(b.liveStyle=!0),w[x]=v??null}),u.push({animation:w})}let g=!!u.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(g=!1),n=!1,g?t(u):Promise.resolve()}function a(l,c){var d;if(r[l].isActive===c)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(p=>{var h;return(h=p.animationState)===null||h===void 0?void 0:h.setActive(l,c)}),r[l].isActive=c;const u=o(l);for(const p in r)r[p].protectedKeys={};return u}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r,reset:()=>{r=GS(),n=!0}}}function Bz(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!BD(t,e):!1}function Ms(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function GS(){return{animate:Ms(!0),whileInView:Ms(),whileHover:Ms(),whileTap:Ms(),whileDrag:Ms(),whileFocus:Ms(),exit:Ms()}}class Ps{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Uz extends Ps{constructor(t){super(t),t.animationState||(t.animationState=$z(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();_p(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 zz=0;class Wz extends Ps{constructor(){super(...arguments),this.id=zz++}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 Hz={animation:{Feature:Uz},exit:{Feature:Wz}},rn={x:!1,y:!1};function kk(){return rn.x||rn.y}function Gz(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 Ak(e,t){const r=Gz(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function KS(e){return t=>{t.pointerType==="touch"||kk()||e(t)}}function Kz(e,t,r={}){const[n,i,s]=Ak(e,r),o=KS(a=>{const{target:l}=a,c=t(a);if(!c||!l)return;const d=KS(u=>{c(u),l.removeEventListener("pointerleave",d)});l.addEventListener("pointerleave",d,i)});return n.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const nw=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Al=new WeakSet;function qS(e){return t=>{t.key==="Enter"&&e(t)}}function vm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const qz=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=qS(()=>{if(Al.has(r))return;vm(r,"down");const i=qS(()=>{vm(r,"up")}),s=()=>vm(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)},Qz=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Yz(e){return Qz.has(e.tagName)||e.tabIndex!==-1}const Rk=(e,t)=>t?e===t?!0:Rk(e,t.parentElement):!1;function QS(e){return nw(e)&&!kk()}function Zz(e,t,r={}){const[n,i,s]=Ak(e,r),o=a=>{const l=a.currentTarget;if(!QS(a)||Al.has(l))return;Al.add(l);const c=t(a),d=(h,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",p),!(!QS(h)||!Al.has(l))&&(Al.delete(l),c&&c(h,{success:y}))},u=h=>{d(h,r.useGlobalTarget||Rk(l,h.target))},p=h=>{d(h,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",p,i)};return n.forEach(a=>{Yz(a)||(a.tabIndex=0),(r.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",c=>qz(c,i),i)}),s}function Xz(e){return e==="x"||e==="y"?rn[e]?null:(rn[e]=!0,()=>{rn[e]=!1}):rn.x||rn.y?null:(rn.x=rn.y=!0,()=>{rn.x=rn.y=!1})}function vu(e){return{point:{x:e.pageX,y:e.pageY}}}const Jz=e=>t=>nw(t)&&e(t,vu(t));function Rc(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function Yl(e,t,r,n){return Rc(e,t,Jz(r),n)}const YS=(e,t)=>Math.abs(e-t);function e6(e,t){const r=YS(e.x,t.x),n=YS(e.y,t.y);return Math.sqrt(r**2+n**2)}class jk{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 u=xm(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=e6(u.offset,{x:0,y:0})>=3;if(!p&&!h)return;const{point:y}=u,{timestamp:g}=Vt;this.history.push({...y,timestamp:g});const{onStart:w,onMove:x}=this.handlers;p||(w&&w(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,u)},this.handlePointerMove=(u,p)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=ym(p,this.transformPagePoint),at.update(this.updatePoint,!0)},this.handlePointerUp=(u,p)=>{this.end();const{onEnd:h,onSessionEnd:y,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=xm(u.type==="pointercancel"?this.lastMoveEventInfo:ym(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(u,w),y&&y(u,w)},!nw(t))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.contextWindow=i||window;const o=vu(t),a=ym(o,this.transformPagePoint),{point:l}=a,{timestamp:c}=Vt;this.history=[{...l,timestamp:c}];const{onSessionStart:d}=r;d&&d(t,xm(a,this.history)),this.removeListeners=gu(Yl(this.contextWindow,"pointermove",this.handlePointerMove),Yl(this.contextWindow,"pointerup",this.handlePointerUp),Yl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ps(this.updatePoint)}}function ym(e,t){return t?{point:t(e.point)}:e}function ZS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function xm({point:e},t){return{point:e,delta:ZS(e,Ik(t)),offset:ZS(e,t6(t)),velocity:r6(t,.1)}}function t6(e){return e[0]}function Ik(e){return e[e.length-1]}function r6(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const i=Ik(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>ci(t)));)r--;if(!n)return{x:0,y:0};const s=ui(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 Go(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const Mk=1e-4,n6=1-Mk,i6=1+Mk,Ok=.01,s6=0-Ok,o6=0+Ok;function jr(e){return e.max-e.min}function a6(e,t,r){return Math.abs(e-t)<=r}function XS(e,t,r,n=.5){e.origin=n,e.originPoint=pt(t.min,t.max,e.origin),e.scale=jr(r)/jr(t),e.translate=pt(r.min,r.max,e.origin)-e.originPoint,(e.scale>=n6&&e.scale<=i6||isNaN(e.scale))&&(e.scale=1),(e.translate>=s6&&e.translate<=o6||isNaN(e.translate))&&(e.translate=0)}function Zl(e,t,r,n){XS(e.x,t.x,r.x,n?n.originX:void 0),XS(e.y,t.y,r.y,n?n.originY:void 0)}function JS(e,t,r){e.min=r.min+t.min,e.max=e.min+jr(t)}function l6(e,t,r){JS(e.x,t.x,r.x),JS(e.y,t.y,r.y)}function eC(e,t,r){e.min=t.min-r.min,e.max=e.min+jr(t)}function Xl(e,t,r){eC(e.x,t.x,r.x),eC(e.y,t.y,r.y)}function c6(e,{min:t,max:r},n){return t!==void 0&&er&&(e=n?pt(r,e,n.max):Math.min(e,r)),e}function tC(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 u6(e,{top:t,left:r,bottom:n,right:i}){return{x:tC(e.x,r,i),y:tC(e.y,t,n)}}function rC(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.minn?r=Va(t.min,t.max-n,e.min):n>i&&(r=Va(e.min,e.max-i,t.min)),xi(0,1,r)}function p6(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 Tv=.35;function h6(e=Tv){return e===!1?e=0:e===!0&&(e=Tv),{x:nC(e,"left","right"),y:nC(e,"top","bottom")}}function nC(e,t,r){return{min:iC(e,t),max:iC(e,r)}}function iC(e,t){return typeof e=="number"?e:e[t]||0}const sC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ko=()=>({x:sC(),y:sC()}),oC=()=>({min:0,max:0}),Ct=()=>({x:oC(),y:oC()});function Fr(e){return[e("x"),e("y")]}function _k({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function m6({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function g6(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 wm(e){return e===void 0||e===1}function Pv({scale:e,scaleX:t,scaleY:r}){return!wm(e)||!wm(t)||!wm(r)}function Fs(e){return Pv(e)||Lk(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Lk(e){return aC(e.x)||aC(e.y)}function aC(e){return e&&e!=="0%"}function xf(e,t,r){const n=e-r,i=t*n;return r+i}function lC(e,t,r,n,i){return i!==void 0&&(e=xf(e,i,n)),xf(e,r,n)+t}function Nv(e,t=0,r=1,n,i){e.min=lC(e.min,t,r,n,i),e.max=lC(e.max,t,r,n,i)}function Fk(e,{x:t,y:r}){Nv(e.x,t.translate,t.scale,t.originPoint),Nv(e.y,r.translate,r.scale,r.originPoint)}const cC=.999999999999,uC=1.0000000000001;function v6(e,t,r,n=!1){const i=r.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;acC&&(t.x=1),t.ycC&&(t.y=1)}function qo(e,t){e.min=e.min+t,e.max=e.max+t}function dC(e,t,r,n,i=.5){const s=pt(e.min,e.max,i);Nv(e,t,r,s,n)}function Qo(e,t){dC(e.x,t.x,t.scaleX,t.scale,t.originX),dC(e.y,t.y,t.scaleY,t.scale,t.originY)}function Vk(e,t){return _k(g6(e.getBoundingClientRect(),t))}function y6(e,t,r){const n=Vk(e,r),{scroll:i}=t;return i&&(qo(n.x,i.offset.x),qo(n.y,i.offset.y)),n}const $k=({current:e})=>e?e.ownerDocument.defaultView:null,x6=new WeakMap;class w6{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=Ct(),this.visualElement=t}start(t,{snapToCursor:r=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const i=d=>{const{dragSnapToOrigin:u}=this.getProps();u?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(vu(d).point)},s=(d,u)=>{const{drag:p,dragPropagation:h,onDragStart:y}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Xz(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),Fr(w=>{let x=this.getAxisMotionValue(w).get()||0;if($n.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const b=v.layout.layoutBox[w];b&&(x=jr(b)*(parseFloat(x)/100))}}this.originPoint[w]=x}),y&&at.postRender(()=>y(d,u)),Cv(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(d,u)=>{const{dragPropagation:p,dragDirectionLock:h,onDirectionLock:y,onDrag:g}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:w}=u;if(h&&this.currentDirection===null){this.currentDirection=b6(w),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",u.point,w),this.updateAxis("y",u.point,w),this.visualElement.render(),g&&g(d,u)},a=(d,u)=>this.stop(d,u),l=()=>Fr(d=>{var u;return this.getAnimationState(d)==="paused"&&((u=this.getAxisMotionValue(d).animation)===null||u===void 0?void 0:u.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new jk(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:$k(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&&at.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||!Xu(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=c6(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&&Go(r)?this.constraints||(this.constraints=this.resolveRefConstraints()):r&&i?this.constraints=u6(i.layoutBox,r):this.constraints=!1,this.elastic=h6(n),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Fr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=p6(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Go(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=y6(n,i.root,this.visualElement.getTransformPagePoint());let o=d6(i.layout.layoutBox,s);if(r){const a=r(m6(o));this.hasMutatedConstraints=!!a,a&&(o=_k(a))}return o}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Fr(d=>{if(!Xu(d,r,this.currentDirection))return;let u=l&&l[d]||{};o&&(u={min:0,max:0});const p=i?200:1e6,h=i?40:1e7,y={type:"inertia",velocity:n?t[d]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...u};return this.startAxisValueAnimation(d,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return Cv(this.visualElement,t),n.start(Xx(t,n,0,r,this.visualElement,!1))}stopAnimation(){Fr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Fr(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){Fr(r=>{const{drag:n}=this.getProps();if(!Xu(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]-pt(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Go(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Fr(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=f6({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(),Fr(o=>{if(!Xu(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set(pt(l,c,i[o]))})}addListeners(){if(!this.visualElement.current)return;x6.set(this.visualElement,this);const t=this.visualElement.current,r=Yl(t,"pointerdown",l=>{const{drag:c,dragListener:d=!0}=this.getProps();c&&d&&this.start(l)}),n=()=>{const{dragConstraints:l}=this.getProps();Go(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()),at.read(n);const o=Rc(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(Fr(d=>{const u=this.getAxisMotionValue(d);u&&(this.originPoint[d]+=l[d].translate,u.set(u.get()+l[d].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=Tv,dragMomentum:a=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Xu(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function b6(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class S6 extends Ps{constructor(t){super(t),this.removeGroupControls=kr,this.removeListeners=kr,this.controls=new w6(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||kr}unmount(){this.removeGroupControls(),this.removeListeners()}}const fC=e=>(t,r)=>{e&&at.postRender(()=>e(t,r))};class C6 extends Ps{constructor(){super(...arguments),this.removePointerDownListener=kr}onPointerDown(t){this.session=new jk(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$k(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:fC(t),onStart:fC(r),onMove:n,onEnd:(s,o)=>{delete this.session,i&&at.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Yl(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 Vp=m.createContext(null);function E6(){const e=m.useContext(Vp);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 iw=m.createContext({}),Bk=m.createContext({}),Td={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const bl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Re.test(e))e=parseFloat(e);else return e;const r=pC(e,t.target.x),n=pC(e,t.target.y);return`${r}% ${n}%`}},T6={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,i=hs.parse(e);if(i.length>5)return n;const s=hs.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=pt(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}},wf={};function P6(e){Object.assign(wf,e)}const{schedule:sw,cancel:dq}=UD(queueMicrotask,!1);class N6 extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;P6(D6),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()})),Td.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()||at.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),sw.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 Uk(e){const[t,r]=E6(),n=m.useContext(iw);return f.jsx(N6,{...e,layoutGroup:n,switchLayoutGroup:m.useContext(Bk),isPresent:t,safeToRemove:r})}const D6={borderRadius:{...bl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bl,borderTopRightRadius:bl,borderBottomLeftRadius:bl,borderBottomRightRadius:bl,boxShadow:T6},zk=["TopLeft","TopRight","BottomLeft","BottomRight"],k6=zk.length,hC=e=>typeof e=="string"?parseFloat(e):e,mC=e=>typeof e=="number"||Re.test(e);function A6(e,t,r,n,i,s){i?(e.opacity=pt(0,r.opacity!==void 0?r.opacity:1,R6(n)),e.opacityExit=pt(t.opacity!==void 0?t.opacity:1,0,j6(n))):s&&(e.opacity=pt(t.opacity!==void 0?t.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;ont?1:r(Va(e,t,n))}function vC(e,t){e.min=t.min,e.max=t.max}function Lr(e,t){vC(e.x,t.x),vC(e.y,t.y)}function yC(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function xC(e,t,r,n,i){return e-=t,e=xf(e,1/r,n),i!==void 0&&(e=xf(e,1/i,n)),e}function I6(e,t=0,r=1,n=.5,i,s=e,o=e){if($n.test(t)&&(t=parseFloat(t),t=pt(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=pt(s.min,s.max,n);e===s&&(a-=t),e.min=xC(e.min,t,r,a,i),e.max=xC(e.max,t,r,a,i)}function wC(e,t,[r,n,i],s,o){I6(e,t[r],t[n],t[i],t.scale,s,o)}const M6=["x","scaleX","originX"],O6=["y","scaleY","originY"];function bC(e,t,r,n){wC(e.x,t,M6,r?r.x:void 0,n?n.x:void 0),wC(e.y,t,O6,r?r.y:void 0,n?n.y:void 0)}function SC(e){return e.translate===0&&e.scale===1}function Hk(e){return SC(e.x)&&SC(e.y)}function CC(e,t){return e.min===t.min&&e.max===t.max}function _6(e,t){return CC(e.x,t.x)&&CC(e.y,t.y)}function EC(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Gk(e,t){return EC(e.x,t.x)&&EC(e.y,t.y)}function TC(e){return jr(e.x)/jr(e.y)}function PC(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class L6{constructor(){this.members=[]}add(t){Jx(this.members,t),t.scheduleRender()}remove(t){if(ew(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 F6(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:d,rotateX:u,rotateY:p,skewX:h,skewY:y}=r;c&&(n=`perspective(${c}px) ${n}`),d&&(n+=`rotate(${d}deg) `),u&&(n+=`rotateX(${u}deg) `),p&&(n+=`rotateY(${p}deg) `),h&&(n+=`skewX(${h}deg) `),y&&(n+=`skewY(${y}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 V6=(e,t)=>e.depth-t.depth;class $6{constructor(){this.children=[],this.isDirty=!1}add(t){Jx(this.children,t),this.isDirty=!0}remove(t){ew(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(V6),this.isDirty=!1,this.children.forEach(t)}}function Pd(e){const t=qt(e)?e.get():e;return Ez(t)?t.toValue():t}function B6(e,t){const r=Bn.now(),n=({timestamp:i})=>{const s=i-r;s>=t&&(ps(n),e(s-t))};return at.read(n,!0),()=>ps(n)}function U6(e){return e instanceof SVGElement&&e.tagName!=="svg"}function z6(e,t,r){const n=qt(e)?e:Ac(e);return n.start(Xx("",n,t,r)),n.animation}const Vs={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Rl=typeof window<"u"&&window.MotionDebug!==void 0,bm=["","X","Y","Z"],W6={visibility:"hidden"},NC=1e3;let H6=0;function Sm(e,t,r,n){const{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function Kk(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=Pk(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",at,!(i||s))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&Kk(n)}function qk({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=H6++,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,Rl&&(Vs.totalNodes=Vs.resolvedTargetDeltas=Vs.recalculatedProjection=0),this.nodes.forEach(q6),this.nodes.forEach(J6),this.nodes.forEach(eW),this.nodes.forEach(Q6),Rl&&window.MotionDebug.record(Vs)},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,u&&u(),u=B6(p,250),Td.hasAnimatedSinceResize&&(Td.hasAnimatedSinceResize=!1,this.nodes.forEach(kC))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeTargetChanged:h,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||d.getDefaultTransition()||sW,{onLayoutAnimationStart:w,onLayoutAnimationComplete:x}=d.getProps(),v=!this.targetLayout||!Gk(this.targetLayout,y)||h,b=!p&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||b||p&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(u,b);const S={...Fx(g,"layout"),onPlay:w,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S)}else p||kC(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}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,ps(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(tW),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&&Kk(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const C=S/1e3;AC(u.x,o.x,C),AC(u.y,o.y,C),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Xl(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),nW(this.relativeTarget,this.relativeTargetOrigin,p,C),b&&_6(this.relativeTarget,b)&&(this.isProjectionDirty=!1),b||(b=Ct()),Lr(b,this.relativeTarget)),g&&(this.animationValues=d,A6(d,c,this.latestValues,C,v,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&&(ps(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=at.update(()=>{Td.hasAnimatedSinceResize=!0,this.currentAnimation=z6(0,NC,{...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(NC),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&Qk(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Ct();const u=jr(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+u;const p=jr(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}Lr(a,l),Qo(a,d),Zl(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new L6),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&&Sm("z",o,c,this.animationValues);for(let d=0;d{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(DC),this.root.sharedNodes.clear()}}}function G6(e){e.updateLayout()}function K6(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"?Fr(u=>{const p=o?r.measuredBox[u]:r.layoutBox[u],h=jr(p);p.min=n[u].min,p.max=p.min+h}):Qk(s,r.layoutBox,n)&&Fr(u=>{const p=o?r.measuredBox[u]:r.layoutBox[u],h=jr(n[u]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+h)});const a=Ko();Zl(a,n,r.layoutBox);const l=Ko();o?Zl(l,e.applyTransform(i,!0),r.measuredBox):Zl(l,n,r.layoutBox);const c=!Hk(a);let d=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:h}=u;if(p&&h){const y=Ct();Xl(y,r.layoutBox,p.layoutBox);const g=Ct();Xl(g,n,h.layoutBox),Gk(y,g)||(d=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=y,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:r,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:d})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function q6(e){Rl&&Vs.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 Q6(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Y6(e){e.clearSnapshot()}function DC(e){e.clearMeasurements()}function Z6(e){e.isLayoutDirty=!1}function X6(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function kC(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function J6(e){e.resolveTargetDelta()}function eW(e){e.calcProjection()}function tW(e){e.resetSkewAndRotation()}function rW(e){e.removeLeadSnapshot()}function AC(e,t,r){e.translate=pt(t.translate,0,r),e.scale=pt(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function RC(e,t,r,n){e.min=pt(t.min,r.min,n),e.max=pt(t.max,r.max,n)}function nW(e,t,r,n){RC(e.x,t.x,r.x,n),RC(e.y,t.y,r.y,n)}function iW(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const sW={duration:.45,ease:[.4,0,.1,1]},jC=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),IC=jC("applewebkit/")&&!jC("chrome/")?Math.round:kr;function MC(e){e.min=IC(e.min),e.max=IC(e.max)}function oW(e){MC(e.x),MC(e.y)}function Qk(e,t,r){return e==="position"||e==="preserve-aspect"&&!a6(TC(t),TC(r),.2)}function aW(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const lW=qk({attachResizeListener:(e,t)=>Rc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cm={current:void 0},Yk=qk({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Cm.current){const e=new lW({});e.mount(window),e.setOptions({layoutScroll:!0}),Cm.current=e}return Cm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),cW={pan:{Feature:C6},drag:{Feature:S6,ProjectionNode:Yk,MeasureLayout:Uk}};function OC(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&&at.postRender(()=>s(t,vu(t)))}class uW extends Ps{mount(){const{current:t}=this.node;t&&(this.unmount=Kz(t,r=>(OC(this.node,r,"Start"),n=>OC(this.node,n,"End"))))}unmount(){}}class dW extends Ps{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=gu(Rc(this.node.current,"focus",()=>this.onFocus()),Rc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function _C(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&&at.postRender(()=>s(t,vu(t)))}class fW extends Ps{mount(){const{current:t}=this.node;t&&(this.unmount=Zz(t,r=>(_C(this.node,r,"Start"),(n,{success:i})=>_C(this.node,n,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Dv=new WeakMap,Em=new WeakMap,pW=e=>{const t=Dv.get(e.target);t&&t(e)},hW=e=>{e.forEach(pW)};function mW({root:e,...t}){const r=e||document;Em.has(r)||Em.set(r,{});const n=Em.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(hW,{root:e,...t})),n[i]}function gW(e,t,r){const n=mW(t);return Dv.set(e,r),n.observe(e),()=>{Dv.delete(e),n.unobserve(e)}}const vW={some:0,all:1};class yW extends Ps{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:vW[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:d,onViewportLeave:u}=this.node.getProps(),p=c?d:u;p&&p(l)};return gW(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(xW(t,r))&&this.startObserver()}unmount(){}}function xW({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const wW={inView:{Feature:yW},tap:{Feature:fW},focus:{Feature:dW},hover:{Feature:uW}},bW={layout:{ProjectionNode:Yk,MeasureLayout:Uk}},ow=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),$p=m.createContext({}),aw=typeof window<"u",Zk=aw?m.useLayoutEffect:m.useEffect,Xk=m.createContext({strict:!1});function SW(e,t,r,n,i){var s,o;const{visualElement:a}=m.useContext($p),l=m.useContext(Xk),c=m.useContext(Vp),d=m.useContext(ow).reducedMotion,u=m.useRef(null);n=n||l.renderer,!u.current&&n&&(u.current=n(e,{visualState:t,parent:a,props:r,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d}));const p=u.current,h=m.useContext(Bk);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&CW(u.current,r,i,h);const y=m.useRef(!1);m.useInsertionEffect(()=>{p&&y.current&&p.update(r,c)});const g=r[Tk],w=m.useRef(!!g&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,g))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,g)));return Zk(()=>{p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),sw.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,g)}),w.current=!1))}),p}function CW(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:Jk(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Go(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:c})}function Jk(e){if(e)return e.options.allowProjection!==!1?e.projection:Jk(e.parent)}function EW(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):Go(r)&&(r.current=n))},[t])}function Bp(e){return _p(e.animate)||Lx.some(t=>Nc(e[t]))}function eA(e){return!!(Bp(e)||e.variants)}function TW(e,t){if(Bp(e)){const{initial:r,animate:n}=e;return{initial:r===!1||Nc(r)?r:void 0,animate:Nc(n)?n:void 0}}return e.inherit!==!1?t:{}}function PW(e){const{initial:t,animate:r}=TW(e,m.useContext($p));return m.useMemo(()=>({initial:t,animate:r}),[LC(t),LC(r)])}function LC(e){return Array.isArray(e)?e.join(" "):e}const FC={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"]},$a={};for(const e in FC)$a[e]={isEnabled:t=>FC[e].some(r=>!!t[r])};function NW(e){for(const t in e)$a[t]={...$a[t],...e[t]}}const DW=Symbol.for("motionComponentSymbol");function kW({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:n,Component:i}){e&&NW(e);function s(a,l){let c;const d={...m.useContext(ow),...a,layoutId:AW(a)},{isStatic:u}=d,p=PW(a),h=n(a,u);if(!u&&aw){RW();const y=jW(d);c=y.MeasureLayout,p.visualElement=SW(i,h,d,t,y.ProjectionNode)}return f.jsxs($p.Provider,{value:p,children:[c&&p.visualElement?f.jsx(c,{visualElement:p.visualElement,...d}):null,r(i,a,EW(h,p.visualElement,l),h,u,p.visualElement)]})}const o=m.forwardRef(s);return o[DW]=i,o}function AW({layoutId:e}){const t=m.useContext(iw).id;return t&&e!==void 0?t+"-"+e:e}function RW(e,t){m.useContext(Xk).strict}function jW(e){const{drag:t,layout:r}=$a;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 IW=["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 lw(e){return typeof e!="string"||e.includes("-")?!1:!!(IW.indexOf(e)>-1||/[A-Z]/u.test(e))}function tA(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 rA=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 nA(e,t,r,n){tA(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(rA.has(i)?i:rw(i),t.attrs[i])}function iA(e,{layout:t,layoutId:r}){return wo.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!wf[e]||e==="opacity")}function cw(e,t,r){var n;const{style:i}=e,s={};for(const o in i)(qt(i[o])||t.style&&qt(t.style[o])||iA(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 sA(e,t,r){const n=cw(e,t,r);for(const i in e)if(qt(e[i])||qt(t[i])){const s=pu.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}function uw(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}function MW({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:r},n,i,s){const o={latestValues:OW(n,i,s,e),renderState:t()};return r&&(o.mount=a=>r(n,a,o)),o}const oA=e=>(t,r)=>{const n=m.useContext($p),i=m.useContext(Vp),s=()=>MW(e,t,n,i);return r?s():uw(s)};function OW(e,t,r,n){const i={},s=n(e,{});for(const p in s)i[p]=Pd(s[p]);let{initial:o,animate:a}=e;const l=Bp(e),c=eA(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=r?r.initial===!1:!1;d=d||o===!1;const u=d?a:o;if(u&&typeof u!="boolean"&&!_p(u)){const p=Array.isArray(u)?u:[u];for(let h=0;h({style:{},transform:{},transformOrigin:{},vars:{}}),aA=()=>({...dw(),attrs:{}}),lA=(e,t)=>t&&typeof e=="number"?t.transform(e):e,_W={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},LW=pu.length;function FW(e,t,r){let n="",i=!0;for(let s=0;stypeof e=="string"&&e.toLowerCase()==="svg",zW={useVisualState:oA({scrapeMotionValuesFromProps:sA,createRenderState:aA,onMount:(e,t,{renderState:r,latestValues:n})=>{at.read(()=>{try{r.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}}),at.render(()=>{pw(r,n,hw(t.tagName),e.transformTemplate),nA(t,r)})}})},WW={useVisualState:oA({scrapeMotionValuesFromProps:cw,createRenderState:dw})};function cA(e,t,r){for(const n in t)!qt(t[n])&&!iA(n,r)&&(e[n]=t[n])}function HW({transformTemplate:e},t){return m.useMemo(()=>{const r=dw();return fw(r,t,e),Object.assign({},r.vars,r.style)},[t])}function GW(e,t){const r=e.style||{},n={};return cA(n,r,e),Object.assign(n,HW(e,t)),n}function KW(e,t){const r={},n=GW(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 qW=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 bf(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||qW.has(e)}let uA=e=>!bf(e);function QW(e){e&&(uA=t=>t.startsWith("on")?!bf(t):e(t))}try{QW(require("@emotion/is-prop-valid").default)}catch{}function YW(e,t,r){const n={};for(const i in e)i==="values"&&typeof e.values=="object"||(uA(i)||r===!0&&bf(i)||!t&&!bf(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}function ZW(e,t,r,n){const i=m.useMemo(()=>{const s=aA();return pw(s,t,hw(n),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};cA(s,e.style,e),i.style={...s,...i.style}}return i}function XW(e=!1){return(r,n,i,{latestValues:s},o)=>{const l=(lw(r)?ZW:KW)(n,s,o,r),c=YW(n,typeof r=="string",e),d=r!==m.Fragment?{...c,...l,ref:i}:{},{children:u}=n,p=m.useMemo(()=>qt(u)?u.get():u,[u]);return m.createElement(r,{...d,children:p})}}function JW(e,t){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...lw(n)?zW:WW,preloadedFeatures:e,useRender:XW(i),createVisualElement:t,Component:n};return kW(o)}}const kv={current:null},dA={current:!1};function eH(){if(dA.current=!0,!!aw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>kv.current=e.matches;e.addListener(t),t()}else kv.current=!1}function tH(e,t,r){for(const n in t){const i=t[n],s=r[n];if(qt(i))e.addValue(n,i);else if(qt(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 $C=new WeakMap,rH=[...nk,Gt,hs],nH=e=>rH.find(rk(e)),BC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class iH{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=Ux,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=Bn.now();this.renderScheduledAtthis.bindToMotionValue(n,r)),dA.current||eH(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:kv.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){$C.delete(this.current),this.projection&&this.projection.unmount(),ps(this.notifyUpdate),ps(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=wo.has(t),i=r.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&at.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 $a){const r=$a[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):Ct()}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"&&(XD(i)||ZD(i))?i=parseFloat(i):!nH(i)&&hs.test(r)&&(i=dk(t,r)),this.setBaseTarget(t,qt(i)?i.get():i)),qt(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=Ox(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&&!qt(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 tw),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}}class fA extends iH{constructor(){super(...arguments),this.KeyframeResolver=fk}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;qt(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function sH(e){return window.getComputedStyle(e)}class oH extends fA{constructor(){super(...arguments),this.type="html",this.renderInstance=tA}readValueFromInstance(t,r){if(wo.has(r)){const n=Gx(r);return n&&n.default||0}else{const n=sH(t),i=(ek(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:r}){return Vk(t,r)}build(t,r,n){fw(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return cw(t,r,n)}}class aH extends fA{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ct}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(wo.has(r)){const n=Gx(r);return n&&n.default||0}return r=rA.has(r)?r:rw(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return sA(t,r,n)}build(t,r,n){pw(t,r,this.isSVGTag,n.transformTemplate)}renderInstance(t,r,n,i){nA(t,r,n,i)}mount(t){this.isSVGTag=hw(t.tagName),super.mount(t)}}const lH=(e,t)=>lw(e)?new aH(t):new oH(t,{allowProjection:e!==m.Fragment}),cH=JW({...Hz,...wW,...cW,...bW},lH),UC=z5(cH);class uH 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 dH({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(ow);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 d=document.createElement("style");return s&&(d.nonce=s),document.head.appendChild(d),d.sheet&&d.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(d)}},[t]),f.jsx(uH,{isPresent:t,childRef:n,sizeRef:i,children:m.cloneElement(e,{ref:n})})}const fH=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=uw(pH),l=m.useId(),c=m.useCallback(u=>{a.set(u,!0);for(const p of a.values())if(!p)return;n&&n()},[a,n]),d=m.useMemo(()=>({id:l,initial:t,isPresent:r,custom:i,onExitComplete:c,register:u=>(a.set(u,!1),()=>a.delete(u))}),s?[Math.random(),c]:[r,c]);return m.useMemo(()=>{a.forEach((u,p)=>a.set(p,!1))},[r]),m.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(e=f.jsx(dH,{isPresent:r,children:e})),f.jsx(Vp.Provider,{value:d,children:e})};function pH(){return new Map}const Ju=e=>e.key||"";function zC(e){const t=[];return m.Children.forEach(e,r=>{m.isValidElement(r)&&t.push(r)}),t}const hH=({children:e,exitBeforeEnter:t,custom:r,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{const a=m.useMemo(()=>zC(e),[e]),l=a.map(Ju),c=m.useRef(!0),d=m.useRef(a),u=uw(()=>new Map),[p,h]=m.useState(a),[y,g]=m.useState(a);Zk(()=>{c.current=!1,d.current=a;for(let v=0;v{const b=Ju(v),S=a===y||l.includes(b),C=()=>{if(u.has(b))u.set(b,!0);else return;let P=!0;u.forEach(D=>{D||(P=!1)}),P&&(x==null||x(),g(d.current),i&&i())};return f.jsx(fH,{isPresent:S,initial:!c.current||n?void 0:!1,custom:S?void 0:r,presenceAffectsLayout:s,mode:o,onExitComplete:S?void 0:C,children:v},b)})})};var yu={};(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 T=new OffscreenCanvas(1,1),E=T.getContext("2d");E.fillRect(0,0,1,1);var z=T.transferToImageBitmap();try{E.createPattern(z,"no-repeat")}catch{return!1}return!0}();function l(){}function c(T){var E=r.exports.Promise,z=E!==void 0?E:t.Promise;return typeof z=="function"?new z(T):(T(l,l),null)}var d=function(T,E){return{transform:function(z){if(T)return z;if(E.has(z))return E.get(z);var ae=new OffscreenCanvas(z.width,z.height),le=ae.getContext("2d");return le.drawImage(z,0,0),E.set(z,ae),ae},clear:function(){E.clear()}}}(a,new Map),u=function(){var T=Math.floor(16.666666666666668),E,z,ae={},le=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(E=function(ye){var fe=Math.random();return ae[fe]=requestAnimationFrame(function W(ie){le===ie||le+T-1{const o=n?yi:"button";return f.jsx(o,{className:De(mw({variant:t,size:r,className:e})),ref:s,...i})});je.displayName="Button";var gH=m.createContext(void 0);function gw(e){const t=m.useContext(gH);return e||t||"ltr"}var Tm=0;function vw(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??WC()),document.body.insertAdjacentElement("beforeend",e[1]??WC()),Tm++,()=>{Tm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Tm--}},[])}function WC(){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 Pm="focusScope.autoFocusOnMount",Nm="focusScope.autoFocusOnUnmount",HC={bubbles:!1,cancelable:!0},vH="FocusScope",Up=m.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,l]=m.useState(null),c=Zt(i),d=Zt(s),u=m.useRef(null),p=Qe(t,g=>l(g)),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(n){let g=function(b){if(h.paused||!a)return;const S=b.target;a.contains(S)?u.current=S:_i(u.current,{select:!0})},w=function(b){if(h.paused||!a)return;const S=b.relatedTarget;S!==null&&(a.contains(S)||_i(u.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const C of b)C.removedNodes.length>0&&_i(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",w);const v=new MutationObserver(x);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",w),v.disconnect()}}},[n,a,h.paused]),m.useEffect(()=>{if(a){KC.add(h);const g=document.activeElement;if(!a.contains(g)){const x=new CustomEvent(Pm,HC);a.addEventListener(Pm,c),a.dispatchEvent(x),x.defaultPrevented||(yH(CH(pA(a)),{select:!0}),document.activeElement===g&&_i(a))}return()=>{a.removeEventListener(Pm,c),setTimeout(()=>{const x=new CustomEvent(Nm,HC);a.addEventListener(Nm,d),a.dispatchEvent(x),x.defaultPrevented||_i(g??document.body,{select:!0}),a.removeEventListener(Nm,d),KC.remove(h)},0)}}},[a,c,d,h]);const y=m.useCallback(g=>{if(!r&&!n||h.paused)return;const w=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(w&&x){const v=g.currentTarget,[b,S]=xH(v);b&&S?!g.shiftKey&&x===S?(g.preventDefault(),r&&_i(b,{select:!0})):g.shiftKey&&x===b&&(g.preventDefault(),r&&_i(S,{select:!0})):x===v&&g.preventDefault()}},[r,n,h.paused]);return f.jsx(Ue.div,{tabIndex:-1,...o,ref:p,onKeyDown:y})});Up.displayName=vH;function yH(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(_i(n,{select:t}),document.activeElement!==r)return}function xH(e){const t=pA(e),r=GC(t,e),n=GC(t.reverse(),e);return[r,n]}function pA(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 GC(e,t){for(const r of e)if(!wH(r,{upTo:t}))return r}function wH(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 bH(e){return e instanceof HTMLInputElement&&"select"in e}function _i(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&bH(e)&&t&&e.select()}}var KC=SH();function SH(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=qC(e,t),e.unshift(t)},remove(t){var r;e=qC(e,t),(r=e[0])==null||r.resume()}}}function qC(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function CH(e){return e.filter(t=>t.tagName!=="A")}var EH=Y1.useId||(()=>{}),TH=0;function di(e){const[t,r]=m.useState(EH());return Xt(()=>{r(n=>n??String(TH++))},[e]),t?`radix-${t}`:""}const PH=["top","right","bottom","left"],ms=Math.min,Cr=Math.max,Sf=Math.round,ed=Math.floor,Un=e=>({x:e,y:e}),NH={left:"right",right:"left",bottom:"top",top:"bottom"},DH={start:"end",end:"start"};function Av(e,t,r){return Cr(e,ms(t,r))}function wi(e,t){return typeof e=="function"?e(t):e}function bi(e){return e.split("-")[0]}function rl(e){return e.split("-")[1]}function yw(e){return e==="x"?"y":"x"}function xw(e){return e==="y"?"height":"width"}function gs(e){return["top","bottom"].includes(bi(e))?"y":"x"}function ww(e){return yw(gs(e))}function kH(e,t,r){r===void 0&&(r=!1);const n=rl(e),i=ww(e),s=xw(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Cf(o)),[o,Cf(o)]}function AH(e){const t=Cf(e);return[Rv(e),t,Rv(t)]}function Rv(e){return e.replace(/start|end/g,t=>DH[t])}function RH(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 jH(e,t,r,n){const i=rl(e);let s=RH(bi(e),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Rv)))),s}function Cf(e){return e.replace(/left|right|bottom|top/g,t=>NH[t])}function IH(e){return{top:0,right:0,bottom:0,left:0,...e}}function hA(e){return typeof e!="number"?IH(e):{top:e,right:e,bottom:e,left:e}}function Ef(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 QC(e,t,r){let{reference:n,floating:i}=e;const s=gs(t),o=ww(t),a=xw(o),l=bi(t),c=s==="y",d=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,p=n[a]/2-i[a]/2;let h;switch(l){case"top":h={x:d,y:n.y-i.height};break;case"bottom":h={x:d,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:u};break;case"left":h={x:n.x-i.width,y:u};break;default:h={x:n.x,y:n.y}}switch(rl(t)){case"start":h[o]-=p*(r&&c?-1:1);break;case"end":h[o]+=p*(r&&c?-1:1);break}return h}const MH=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:d,y:u}=QC(c,n,l),p=n,h={},y=0;for(let g=0;g({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:d=0}=wi(e,t)||{};if(c==null)return{};const u=hA(d),p={x:r,y:n},h=ww(i),y=xw(h),g=await o.getDimensions(c),w=h==="y",x=w?"top":"left",v=w?"bottom":"right",b=w?"clientHeight":"clientWidth",S=s.reference[y]+s.reference[h]-p[h]-s.floating[y],C=p[h]-s.reference[h],P=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let D=P?P[b]:0;(!D||!await(o.isElement==null?void 0:o.isElement(P)))&&(D=a.floating[b]||s.floating[y]);const k=S/2-C/2,A=D/2-g[y]/2-1,I=ms(u[x],A),$=ms(u[v],A),_=I,q=D-g[y]-$,V=D/2-g[y]/2+k,ee=Av(_,V,q),Q=!l.arrow&&rl(i)!=null&&V!==ee&&s.reference[y]/2-(V<_?I:$)-g[y]/2<0,re=Q?V<_?V-_:V-q:0;return{[h]:p[h]+re,data:{[h]:ee,centerOffset:V-ee-re,...Q&&{alignmentOffset:re}},reset:Q}}}),_H=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...w}=wi(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const x=bi(i),v=gs(a),b=bi(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(b||!g?[Cf(a)]:AH(a)),P=y!=="none";!p&&P&&C.push(...jH(a,g,y,S));const D=[a,...C],k=await jc(t,w),A=[];let I=((n=s.flip)==null?void 0:n.overflows)||[];if(d&&A.push(k[x]),u){const V=kH(i,o,S);A.push(k[V[0]],k[V[1]])}if(I=[...I,{placement:i,overflows:A}],!A.every(V=>V<=0)){var $,_;const V=((($=s.flip)==null?void 0:$.index)||0)+1,ee=D[V];if(ee)return{data:{index:V,overflows:I},reset:{placement:ee}};let Q=(_=I.filter(re=>re.overflows[0]<=0).sort((re,M)=>re.overflows[1]-M.overflows[1])[0])==null?void 0:_.placement;if(!Q)switch(h){case"bestFit":{var q;const re=(q=I.filter(M=>{if(P){const O=gs(M.placement);return O===v||O==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(O=>O>0).reduce((O,T)=>O+T,0)]).sort((M,O)=>M[1]-O[1])[0])==null?void 0:q[0];re&&(Q=re);break}case"initialPlacement":Q=a;break}if(i!==Q)return{reset:{placement:Q}}}return{}}}};function YC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ZC(e){return PH.some(t=>e[t]>=0)}const LH=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...i}=wi(e,t);switch(n){case"referenceHidden":{const s=await jc(t,{...i,elementContext:"reference"}),o=YC(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:ZC(o)}}}case"escaped":{const s=await jc(t,{...i,altBoundary:!0}),o=YC(s,r.floating);return{data:{escapedOffsets:o,escaped:ZC(o)}}}default:return{}}}}};async function FH(e,t){const{placement:r,platform:n,elements:i}=e,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=bi(r),a=rl(r),l=gs(r)==="y",c=["left","top"].includes(o)?-1:1,d=s&&l?-1:1,u=wi(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:y}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof y=="number"&&(h=a==="end"?y*-1:y),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}const VH=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 FH(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}}}}},$H=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:v}=w;return{x,y:v}}},...l}=wi(e,t),c={x:r,y:n},d=await jc(t,l),u=gs(bi(i)),p=yw(u);let h=c[p],y=c[u];if(s){const w=p==="y"?"top":"left",x=p==="y"?"bottom":"right",v=h+d[w],b=h-d[x];h=Av(v,h,b)}if(o){const w=u==="y"?"top":"left",x=u==="y"?"bottom":"right",v=y+d[w],b=y-d[x];y=Av(v,y,b)}const g=a.fn({...t,[p]:h,[u]:y});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[p]:s,[u]:o}}}}}},BH=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}=wi(e,t),d={x:r,y:n},u=gs(i),p=yw(u);let h=d[p],y=d[u];const g=wi(a,t),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};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,v;const b=p==="y"?"width":"height",S=["top","left"].includes(bi(i)),C=s.reference[u]-s.floating[b]+(S&&((x=o.offset)==null?void 0:x[u])||0)+(S?0:w.crossAxis),P=s.reference[u]+s.reference[b]+(S?0:((v=o.offset)==null?void 0:v[u])||0)-(S?w.crossAxis:0);yP&&(y=P)}return{[p]:h,[u]:y}}}},UH=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}=wi(e,t),d=await jc(t,c),u=bi(i),p=rl(i),h=gs(i)==="y",{width:y,height:g}=s.floating;let w,x;u==="top"||u==="bottom"?(w=u,x=p===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(x=u,w=p==="end"?"top":"bottom");const v=g-d.top-d.bottom,b=y-d.left-d.right,S=ms(g-d[w],v),C=ms(y-d[x],b),P=!t.middlewareData.shift;let D=S,k=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=b),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(D=v),P&&!p){const I=Cr(d.left,0),$=Cr(d.right,0),_=Cr(d.top,0),q=Cr(d.bottom,0);h?k=y-2*(I!==0||$!==0?I+$:Cr(d.left,d.right)):D=g-2*(_!==0||q!==0?_+q:Cr(d.top,d.bottom))}await l({...t,availableWidth:k,availableHeight:D});const A=await o.getDimensions(a.floating);return y!==A.width||g!==A.height?{reset:{rects:!0}}:{}}}};function zp(){return typeof window<"u"}function nl(e){return mA(e)?(e.nodeName||"").toLowerCase():"#document"}function Ar(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gn(e){var t;return(t=(mA(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mA(e){return zp()?e instanceof Node||e instanceof Ar(e).Node:!1}function Cn(e){return zp()?e instanceof Element||e instanceof Ar(e).Element:!1}function Wn(e){return zp()?e instanceof HTMLElement||e instanceof Ar(e).HTMLElement:!1}function XC(e){return!zp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ar(e).ShadowRoot}function xu(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=En(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(i)}function zH(e){return["table","td","th"].includes(nl(e))}function Wp(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function bw(e){const t=Sw(),r=Cn(e)?En(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 WH(e){let t=vs(e);for(;Wn(t)&&!Ba(t);){if(bw(t))return t;if(Wp(t))return null;t=vs(t)}return null}function Sw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ba(e){return["html","body","#document"].includes(nl(e))}function En(e){return Ar(e).getComputedStyle(e)}function Hp(e){return Cn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function vs(e){if(nl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||XC(e)&&e.host||Gn(e);return XC(t)?t.host:t}function gA(e){const t=vs(e);return Ba(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wn(t)&&xu(t)?t:gA(t)}function Ic(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=gA(e),s=i===((n=e.ownerDocument)==null?void 0:n.body),o=Ar(i);if(s){const a=jv(o);return t.concat(o,o.visualViewport||[],xu(i)?i:[],a&&r?Ic(a):[])}return t.concat(i,Ic(i,[],r))}function jv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vA(e){const t=En(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Wn(e),s=i?e.offsetWidth:r,o=i?e.offsetHeight:n,a=Sf(r)!==s||Sf(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function Cw(e){return Cn(e)?e:e.contextElement}function ca(e){const t=Cw(e);if(!Wn(t))return Un(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:s}=vA(t);let o=(s?Sf(r.width):r.width)/n,a=(s?Sf(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const HH=Un(0);function yA(e){const t=Ar(e);return!Sw()||!t.visualViewport?HH:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function GH(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ar(e)?!1:t}function po(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),s=Cw(e);let o=Un(1);t&&(n?Cn(n)&&(o=ca(n)):o=ca(e));const a=GH(s,r,n)?yA(s):Un(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,d=i.width/o.x,u=i.height/o.y;if(s){const p=Ar(s),h=n&&Cn(n)?Ar(n):n;let y=p,g=jv(y);for(;g&&n&&h!==y;){const w=ca(g),x=g.getBoundingClientRect(),v=En(g),b=x.left+(g.clientLeft+parseFloat(v.paddingLeft))*w.x,S=x.top+(g.clientTop+parseFloat(v.paddingTop))*w.y;l*=w.x,c*=w.y,d*=w.x,u*=w.y,l+=b,c+=S,y=Ar(g),g=jv(y)}}return Ef({width:d,height:u,x:l,y:c})}function Ew(e,t){const r=Hp(e).scrollLeft;return t?t.left+r:po(Gn(e)).left+r}function xA(e,t,r){r===void 0&&(r=!1);const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-(r?0:Ew(e,n)),s=n.top+t.scrollTop;return{x:i,y:s}}function KH(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const s=i==="fixed",o=Gn(n),a=t?Wp(t.floating):!1;if(n===o||a&&s)return r;let l={scrollLeft:0,scrollTop:0},c=Un(1);const d=Un(0),u=Wn(n);if((u||!u&&!s)&&((nl(n)!=="body"||xu(o))&&(l=Hp(n)),Wn(n))){const h=po(n);c=ca(n),d.x=h.x+n.clientLeft,d.y=h.y+n.clientTop}const p=o&&!u&&!s?xA(o,l,!0):Un(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:r.y*c.y-l.scrollTop*c.y+d.y+p.y}}function qH(e){return Array.from(e.getClientRects())}function QH(e){const t=Gn(e),r=Hp(e),n=e.ownerDocument.body,i=Cr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Cr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Ew(e);const a=-r.scrollTop;return En(n).direction==="rtl"&&(o+=Cr(t.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function YH(e,t){const r=Ar(e),n=Gn(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=Sw();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function ZH(e,t){const r=po(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,s=Wn(e)?ca(e):Un(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 JC(e,t,r){let n;if(t==="viewport")n=YH(e,r);else if(t==="document")n=QH(Gn(e));else if(Cn(t))n=ZH(t,r);else{const i=yA(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ef(n)}function wA(e,t){const r=vs(e);return r===t||!Cn(r)||Ba(r)?!1:En(r).position==="fixed"||wA(r,t)}function XH(e,t){const r=t.get(e);if(r)return r;let n=Ic(e,[],!1).filter(a=>Cn(a)&&nl(a)!=="body"),i=null;const s=En(e).position==="fixed";let o=s?vs(e):e;for(;Cn(o)&&!Ba(o);){const a=En(o),l=bw(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||xu(o)&&!l&&wA(e,o))?n=n.filter(d=>d!==o):i=a,o=vs(o)}return t.set(e,n),n}function JH(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const o=[...r==="clippingAncestors"?Wp(t)?[]:XH(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((c,d)=>{const u=JC(t,d,i);return c.top=Cr(u.top,c.top),c.right=ms(u.right,c.right),c.bottom=ms(u.bottom,c.bottom),c.left=Cr(u.left,c.left),c},JC(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function e8(e){const{width:t,height:r}=vA(e);return{width:t,height:r}}function t8(e,t,r){const n=Wn(t),i=Gn(t),s=r==="fixed",o=po(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Un(0);if(n||!n&&!s)if((nl(t)!=="body"||xu(i))&&(a=Hp(t)),n){const p=po(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&(l.x=Ew(i));const c=i&&!n&&!s?xA(i,a):Un(0),d=o.left+a.scrollLeft-l.x-c.x,u=o.top+a.scrollTop-l.y-c.y;return{x:d,y:u,width:o.width,height:o.height}}function Dm(e){return En(e).position==="static"}function e1(e,t){if(!Wn(e)||En(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Gn(e)===r&&(r=r.ownerDocument.body),r}function bA(e,t){const r=Ar(e);if(Wp(e))return r;if(!Wn(e)){let i=vs(e);for(;i&&!Ba(i);){if(Cn(i)&&!Dm(i))return i;i=vs(i)}return r}let n=e1(e,t);for(;n&&zH(n)&&Dm(n);)n=e1(n,t);return n&&Ba(n)&&Dm(n)&&!bw(n)?r:n||WH(e)||r}const r8=async function(e){const t=this.getOffsetParent||bA,r=this.getDimensions,n=await r(e.floating);return{reference:t8(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function n8(e){return En(e).direction==="rtl"}const i8={convertOffsetParentRelativeRectToViewportRelativeRect:KH,getDocumentElement:Gn,getClippingRect:JH,getOffsetParent:bA,getElementRects:r8,getClientRects:qH,getDimensions:e8,getScale:ca,isElement:Cn,isRTL:n8};function s8(e,t){let r=null,n;const i=Gn(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:d,width:u,height:p}=e.getBoundingClientRect();if(a||t(),!u||!p)return;const h=ed(d),y=ed(i.clientWidth-(c+u)),g=ed(i.clientHeight-(d+p)),w=ed(c),v={rootMargin:-h+"px "+-y+"px "+-g+"px "+-w+"px",threshold:Cr(0,ms(1,l))||1};let b=!0;function S(C){const P=C[0].intersectionRatio;if(P!==l){if(!b)return o();P?o(!1,P):n=setTimeout(()=>{o(!1,1e-7)},1e3)}b=!1}try{r=new IntersectionObserver(S,{...v,root:i.ownerDocument})}catch{r=new IntersectionObserver(S,v)}r.observe(e)}return o(!0),s}function o8(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=Cw(e),d=i||s?[...c?Ic(c):[],...Ic(t)]:[];d.forEach(x=>{i&&x.addEventListener("scroll",r,{passive:!0}),s&&x.addEventListener("resize",r)});const u=c&&a?s8(c,r):null;let p=-1,h=null;o&&(h=new ResizeObserver(x=>{let[v]=x;v&&v.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 y,g=l?po(e):null;l&&w();function w(){const x=po(e);g&&(x.x!==g.x||x.y!==g.y||x.width!==g.width||x.height!==g.height)&&r(),g=x,y=requestAnimationFrame(w)}return r(),()=>{var x;d.forEach(v=>{i&&v.removeEventListener("scroll",r),s&&v.removeEventListener("resize",r)}),u==null||u(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(y)}}const a8=VH,l8=$H,c8=_H,u8=UH,d8=LH,t1=OH,f8=BH,p8=(e,t,r)=>{const n=new Map,i={platform:i8,...r},s={...i.platform,_c:n};return MH(e,t,{...i,platform:s})};var Nd=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Tf(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(!Tf(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)&&!Tf(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function SA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function r1(e,t){const r=SA(e);return Math.round(t*r)/r}function km(e){const t=m.useRef(e);return Nd(()=>{t.current=e}),t}function h8(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,[d,u]=m.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=m.useState(n);Tf(p,n)||h(n);const[y,g]=m.useState(null),[w,x]=m.useState(null),v=m.useCallback(M=>{M!==P.current&&(P.current=M,g(M))},[]),b=m.useCallback(M=>{M!==D.current&&(D.current=M,x(M))},[]),S=s||y,C=o||w,P=m.useRef(null),D=m.useRef(null),k=m.useRef(d),A=l!=null,I=km(l),$=km(i),_=km(c),q=m.useCallback(()=>{if(!P.current||!D.current)return;const M={placement:t,strategy:r,middleware:p};$.current&&(M.platform=$.current),p8(P.current,D.current,M).then(O=>{const T={...O,isPositioned:_.current!==!1};V.current&&!Tf(k.current,T)&&(k.current=T,Es.flushSync(()=>{u(T)}))})},[p,t,r,$,_]);Nd(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,u(M=>({...M,isPositioned:!1})))},[c]);const V=m.useRef(!1);Nd(()=>(V.current=!0,()=>{V.current=!1}),[]),Nd(()=>{if(S&&(P.current=S),C&&(D.current=C),S&&C){if(I.current)return I.current(S,C,q);q()}},[S,C,q,I,A]);const ee=m.useMemo(()=>({reference:P,floating:D,setReference:v,setFloating:b}),[v,b]),Q=m.useMemo(()=>({reference:S,floating:C}),[S,C]),re=m.useMemo(()=>{const M={position:r,left:0,top:0};if(!Q.floating)return M;const O=r1(Q.floating,d.x),T=r1(Q.floating,d.y);return a?{...M,transform:"translate("+O+"px, "+T+"px)",...SA(Q.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:O,top:T}},[r,a,Q.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:q,refs:ee,elements:Q,floatingStyles:re}),[d,q,ee,Q,re])}const m8=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?t1({element:n.current,padding:i}).fn(r):{}:n?t1({element:n,padding:i}).fn(r):{}}}},g8=(e,t)=>({...a8(e),options:[e,t]}),v8=(e,t)=>({...l8(e),options:[e,t]}),y8=(e,t)=>({...f8(e),options:[e,t]}),x8=(e,t)=>({...c8(e),options:[e,t]}),w8=(e,t)=>({...u8(e),options:[e,t]}),b8=(e,t)=>({...d8(e),options:[e,t]}),S8=(e,t)=>({...m8(e),options:[e,t]});var C8="Arrow",CA=m.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...s}=e;return f.jsx(Ue.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"})})});CA.displayName=C8;var E8=CA;function T8(e,t=[]){let r=[];function n(s,o){const a=m.createContext(o),l=r.length;r=[...r,o];function c(u){const{scope:p,children:h,...y}=u,g=(p==null?void 0:p[e][l])||a,w=m.useMemo(()=>y,Object.values(y));return f.jsx(g.Provider,{value:w,children:h})}function d(u,p){const h=(p==null?void 0:p[e][l])||a,y=m.useContext(h);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,d]}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 u=l(s)[`__scope${c}`];return{...a,...u}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function N8(e){const[t,r]=m.useState(void 0);return Xt(()=>{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 Tw="Popper",[EA,Gp]=T8(Tw),[D8,TA]=EA(Tw),PA=e=>{const{__scopePopper:t,children:r}=e,[n,i]=m.useState(null);return f.jsx(D8,{scope:t,anchor:n,onAnchorChange:i,children:r})};PA.displayName=Tw;var NA="PopperAnchor",DA=m.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,s=TA(NA,r),o=m.useRef(null),a=Qe(t,o);return m.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:f.jsx(Ue.div,{...i,ref:a})});DA.displayName=NA;var Pw="PopperContent",[k8,A8]=EA(Pw),kA=m.forwardRef((e,t)=>{var W,ie,be,ge,we,Se;const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:y,...g}=e,w=TA(Pw,r),[x,v]=m.useState(null),b=Qe(t,Fe=>v(Fe)),[S,C]=m.useState(null),P=N8(S),D=(P==null?void 0:P.width)??0,k=(P==null?void 0:P.height)??0,A=n+(s!=="center"?"-"+s:""),I=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},$=Array.isArray(c)?c:[c],_=$.length>0,q={padding:I,boundary:$.filter(j8),altBoundary:_},{refs:V,floatingStyles:ee,placement:Q,isPositioned:re,middlewareData:M}=h8({strategy:"fixed",placement:A,whileElementsMounted:(...Fe)=>o8(...Fe,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[g8({mainAxis:i+k,alignmentAxis:o}),l&&v8({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?y8():void 0,...q}),l&&x8({...q}),w8({...q,apply:({elements:Fe,rects:Pe,availableWidth:rt,availableHeight:lt})=>{const{width:ct,height:N}=Pe.reference,j=Fe.floating.style;j.setProperty("--radix-popper-available-width",`${rt}px`),j.setProperty("--radix-popper-available-height",`${lt}px`),j.setProperty("--radix-popper-anchor-width",`${ct}px`),j.setProperty("--radix-popper-anchor-height",`${N}px`)}}),S&&S8({element:S,padding:a}),I8({arrowWidth:D,arrowHeight:k}),p&&b8({strategy:"referenceHidden",...q})]}),[O,T]=jA(Q),E=Zt(y);Xt(()=>{re&&(E==null||E())},[re,E]);const z=(W=M.arrow)==null?void 0:W.x,ae=(ie=M.arrow)==null?void 0:ie.y,le=((be=M.arrow)==null?void 0:be.centerOffset)!==0,[ye,fe]=m.useState();return Xt(()=>{x&&fe(window.getComputedStyle(x).zIndex)},[x]),f.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...ee,transform:re?ee.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[(ge=M.transformOrigin)==null?void 0:ge.x,(we=M.transformOrigin)==null?void 0:we.y].join(" "),...((Se=M.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(k8,{scope:r,placedSide:O,onArrowChange:C,arrowX:z,arrowY:ae,shouldHideArrow:le,children:f.jsx(Ue.div,{"data-side":O,"data-align":T,...g,ref:b,style:{...g.style,animation:re?void 0:"none"}})})})});kA.displayName=Pw;var AA="PopperArrow",R8={top:"bottom",right:"left",bottom:"top",left:"right"},RA=m.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,s=A8(AA,n),o=R8[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(E8,{...i,ref:r,style:{...i.style,display:"block"}})})});RA.displayName=AA;function j8(e){return e!==null}var I8=e=>({name:"transformOrigin",options:e,fn(t){var w,x,v;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,d]=jA(r),u={start:"0%",center:"50%",end:"100%"}[d],p=(((x=i.arrow)==null?void 0:x.x)??0)+a/2,h=(((v=i.arrow)==null?void 0:v.y)??0)+l/2;let y="",g="";return c==="bottom"?(y=o?u:`${p}px`,g=`${-l}px`):c==="top"?(y=o?u:`${p}px`,g=`${n.floating.height+l}px`):c==="right"?(y=`${-l}px`,g=o?u:`${h}px`):c==="left"&&(y=`${n.floating.width+l}px`,g=o?u:`${h}px`),{data:{x:y,y:g}}}});function jA(e){const[t,r="center"]=e.split("-");return[t,r]}var IA=PA,MA=DA,OA=kA,_A=RA;function M8(e,t=[]){let r=[];function n(s,o){const a=m.createContext(o),l=r.length;r=[...r,o];function c(u){const{scope:p,children:h,...y}=u,g=(p==null?void 0:p[e][l])||a,w=m.useMemo(()=>y,Object.values(y));return f.jsx(g.Provider,{value:w,children:h})}function d(u,p){const h=(p==null?void 0:p[e][l])||a,y=m.useContext(h);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,d]}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,O8(i,...t)]}function O8(...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 u=l(s)[`__scope${c}`];return{...a,...u}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Am="rovingFocusGroup.onEntryFocus",_8={bubbles:!1,cancelable:!0},Kp="RovingFocusGroup",[Iv,LA,L8]=pp(Kp),[F8,FA]=M8(Kp,[L8]),[V8,$8]=F8(Kp),VA=m.forwardRef((e,t)=>f.jsx(Iv.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Iv.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(B8,{...e,ref:t})})}));VA.displayName=Kp;var B8=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...u}=e,p=m.useRef(null),h=Qe(t,p),y=gw(s),[g=null,w]=Ma({prop:o,defaultProp:a,onChange:l}),[x,v]=m.useState(!1),b=Zt(c),S=LA(r),C=m.useRef(!1),[P,D]=m.useState(0);return m.useEffect(()=>{const k=p.current;if(k)return k.addEventListener(Am,b),()=>k.removeEventListener(Am,b)},[b]),f.jsx(V8,{scope:r,orientation:n,dir:y,loop:i,currentTabStopId:g,onItemFocus:m.useCallback(k=>w(k),[w]),onItemShiftTab:m.useCallback(()=>v(!0),[]),onFocusableItemAdd:m.useCallback(()=>D(k=>k+1),[]),onFocusableItemRemove:m.useCallback(()=>D(k=>k-1),[]),children:f.jsx(Ue.div,{tabIndex:x||P===0?-1:0,"data-orientation":n,...u,ref:h,style:{outline:"none",...e.style},onMouseDown:ve(e.onMouseDown,()=>{C.current=!0}),onFocus:ve(e.onFocus,k=>{const A=!C.current;if(k.target===k.currentTarget&&A&&!x){const I=new CustomEvent(Am,_8);if(k.currentTarget.dispatchEvent(I),!I.defaultPrevented){const $=S().filter(Q=>Q.focusable),_=$.find(Q=>Q.active),q=$.find(Q=>Q.id===g),ee=[_,q,...$].filter(Boolean).map(Q=>Q.ref.current);UA(ee,d)}}C.current=!1}),onBlur:ve(e.onBlur,()=>v(!1))})})}),$A="RovingFocusGroupItem",BA=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=e,a=di(),l=s||a,c=$8($A,r),d=c.currentTabStopId===l,u=LA(r),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return m.useEffect(()=>{if(n)return p(),()=>h()},[n,p,h]),f.jsx(Iv.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:f.jsx(Ue.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...o,ref:t,onMouseDown:ve(e.onMouseDown,y=>{n?c.onItemFocus(l):y.preventDefault()}),onFocus:ve(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:ve(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){c.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const g=W8(y,c.orientation,c.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let x=u().filter(v=>v.focusable).map(v=>v.ref.current);if(g==="last")x.reverse();else if(g==="prev"||g==="next"){g==="prev"&&x.reverse();const v=x.indexOf(y.currentTarget);x=c.loop?H8(x,v+1):x.slice(v+1)}setTimeout(()=>UA(x))}})})})});BA.displayName=$A;var U8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function z8(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function W8(e,t,r){const n=z8(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return U8[n]}function UA(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function H8(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var G8=VA,K8=BA,q8=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Do=new WeakMap,td=new WeakMap,rd={},Rm=0,zA=function(e){return e&&(e.host||zA(e.parentNode))},Q8=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=zA(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})},Y8=function(e,t,r,n){var i=Q8(t,Array.isArray(e)?e:[e]);rd[r]||(rd[r]=new WeakMap);var s=rd[r],o=[],a=new Set,l=new Set(i),c=function(u){!u||a.has(u)||(a.add(u),c(u.parentNode))};i.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(p){if(a.has(p))d(p);else try{var h=p.getAttribute(n),y=h!==null&&h!=="false",g=(Do.get(p)||0)+1,w=(s.get(p)||0)+1;Do.set(p,g),s.set(p,w),o.push(p),g===1&&y&&td.set(p,!0),w===1&&p.setAttribute(r,"true"),y||p.setAttribute(n,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return d(t),a.clear(),Rm++,function(){o.forEach(function(u){var p=Do.get(u)-1,h=s.get(u)-1;Do.set(u,p),s.set(u,h),p||(td.has(u)||u.removeAttribute(n),td.delete(u)),h||u.removeAttribute(r)}),Rm--,Rm||(Do=new WeakMap,Do=new WeakMap,td=new WeakMap,rd={})}},Nw=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=q8(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),Y8(n,i,r,"aria-hidden")):function(){return null}},Mn=function(){return Mn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return pG;var t=hG(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])}},gG=KA(),ua="data-scroll-locked",vG=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(X8,` { overflow: hidden `).concat(n,`; padding-right: `).concat(a,"px ").concat(n,`; } body[`).concat(ua,`] { 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(Dd,` { right: `).concat(a,"px ").concat(n,`; } .`).concat(kd,` { margin-right: `).concat(a,"px ").concat(n,`; } .`).concat(Dd," .").concat(Dd,` { right: 0 `).concat(n,`; } .`).concat(kd," .").concat(kd,` { margin-right: 0 `).concat(n,`; } body[`).concat(ua,`] { `).concat(J8,": ").concat(a,`px; } `)},i1=function(){var e=parseInt(document.body.getAttribute(ua)||"0",10);return isFinite(e)?e:0},yG=function(){m.useEffect(function(){return document.body.setAttribute(ua,(i1()+1).toString()),function(){var e=i1()-1;e<=0?document.body.removeAttribute(ua):document.body.setAttribute(ua,e.toString())}},[])},xG=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;yG();var s=m.useMemo(function(){return mG(i)},[i]);return m.createElement(gG,{styles:vG(s,!t,i,r?"":"!important")})},Mv=!1;if(typeof window<"u")try{var nd=Object.defineProperty({},"passive",{get:function(){return Mv=!0,!0}});window.addEventListener("test",nd,nd),window.removeEventListener("test",nd,nd)}catch{Mv=!1}var ko=Mv?{passive:!1}:!1,wG=function(e){return e.tagName==="TEXTAREA"},qA=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!wG(e)&&r[t]==="visible")},bG=function(e){return qA(e,"overflowY")},SG=function(e){return qA(e,"overflowX")},s1=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=QA(e,n);if(i){var s=YA(e,n),o=s[1],a=s[2];if(o>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},CG=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},EG=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},QA=function(e,t){return e==="v"?bG(t):SG(t)},YA=function(e,t){return e==="v"?CG(t):EG(t)},TG=function(e,t){return e==="h"&&t==="rtl"?-1:1},PG=function(e,t,r,n,i){var s=TG(e,window.getComputedStyle(t).direction),o=s*n,a=r.target,l=t.contains(a),c=!1,d=o>0,u=0,p=0;do{var h=YA(e,a),y=h[0],g=h[1],w=h[2],x=g-w-s*y;(y||x)&&QA(e,a)&&(u+=x,p+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(Math.abs(u)<1||!i)||!d&&(Math.abs(p)<1||!i))&&(c=!0),c},id=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},o1=function(e){return[e.deltaX,e.deltaY]},a1=function(e){return e&&"current"in e?e.current:e},NG=function(e,t){return e[0]===t[0]&&e[1]===t[1]},DG=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},kG=0,Ao=[];function AG(e){var t=m.useRef([]),r=m.useRef([0,0]),n=m.useRef(),i=m.useState(kG++)[0],s=m.useState(KA)[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 g=Z8([e.lockRef.current],(e.shards||[]).map(a1),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var x=id(g),v=r.current,b="deltaX"in g?g.deltaX:v[0]-x[0],S="deltaY"in g?g.deltaY:v[1]-x[1],C,P=g.target,D=Math.abs(b)>Math.abs(S)?"h":"v";if("touches"in g&&D==="h"&&P.type==="range")return!1;var k=s1(D,P);if(!k)return!0;if(k?C=D:(C=D==="v"?"h":"v",k=s1(D,P)),!k)return!1;if(!n.current&&"changedTouches"in g&&(b||S)&&(n.current=C),!C)return!0;var A=n.current||C;return PG(A,w,g,A==="h"?b:S,!0)},[]),l=m.useCallback(function(g){var w=g;if(!(!Ao.length||Ao[Ao.length-1]!==s)){var x="deltaY"in w?o1(w):id(w),v=t.current.filter(function(C){return C.name===w.type&&(C.target===w.target||w.target===C.shadowParent)&&NG(C.delta,x)})[0];if(v&&v.should){w.cancelable&&w.preventDefault();return}if(!v){var b=(o.current.shards||[]).map(a1).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(g,w,x,v){var b={name:g,delta:w,target:x,should:v,shadowParent:RG(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(S){return S!==b})},1)},[]),d=m.useCallback(function(g){r.current=id(g),n.current=void 0},[]),u=m.useCallback(function(g){c(g.type,o1(g),g.target,a(g,e.lockRef.current))},[]),p=m.useCallback(function(g){c(g.type,id(g),g.target,a(g,e.lockRef.current))},[]);m.useEffect(function(){return Ao.push(s),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:p}),document.addEventListener("wheel",l,ko),document.addEventListener("touchmove",l,ko),document.addEventListener("touchstart",d,ko),function(){Ao=Ao.filter(function(g){return g!==s}),document.removeEventListener("wheel",l,ko),document.removeEventListener("touchmove",l,ko),document.removeEventListener("touchstart",d,ko)}},[]);var h=e.removeScrollBar,y=e.inert;return m.createElement(m.Fragment,null,y?m.createElement(s,{styles:DG(i)}):null,h?m.createElement(xG,{gapMode:e.gapMode}):null)}function RG(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const jG=oG(GA,AG);var Qp=m.forwardRef(function(e,t){return m.createElement(qp,Mn({},e,{ref:t,sideCar:jG}))});Qp.classNames=qp.classNames;var Ov=["Enter"," "],IG=["ArrowDown","PageUp","Home"],ZA=["ArrowUp","PageDown","End"],MG=[...IG,...ZA],OG={ltr:[...Ov,"ArrowRight"],rtl:[...Ov,"ArrowLeft"]},_G={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wu="Menu",[Mc,LG,FG]=pp(wu),[bo,XA]=Ya(wu,[FG,Gp,FA]),Yp=Gp(),JA=FA(),[VG,So]=bo(wu),[$G,bu]=bo(wu),eR=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:i,onOpenChange:s,modal:o=!0}=e,a=Yp(t),[l,c]=m.useState(null),d=m.useRef(!1),u=Zt(s),p=gw(i);return m.useEffect(()=>{const h=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),f.jsx(IA,{...a,children:f.jsx(VG,{scope:t,open:r,onOpenChange:u,content:l,onContentChange:c,children:f.jsx($G,{scope:t,onClose:m.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:d,dir:p,modal:o,children:n})})})};eR.displayName=wu;var BG="MenuAnchor",Dw=m.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=Yp(r);return f.jsx(MA,{...i,...n,ref:t})});Dw.displayName=BG;var kw="MenuPortal",[UG,tR]=bo(kw,{forceMount:void 0}),rR=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:i}=e,s=So(kw,t);return f.jsx(UG,{scope:t,forceMount:r,children:f.jsx(Ti,{present:r||s.open,children:f.jsx(eu,{asChild:!0,container:i,children:n})})})};rR.displayName=kw;var Yr="MenuContent",[zG,Aw]=bo(Yr),nR=m.forwardRef((e,t)=>{const r=tR(Yr,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,s=So(Yr,e.__scopeMenu),o=bu(Yr,e.__scopeMenu);return f.jsx(Mc.Provider,{scope:e.__scopeMenu,children:f.jsx(Ti,{present:n||s.open,children:f.jsx(Mc.Slot,{scope:e.__scopeMenu,children:o.modal?f.jsx(WG,{...i,ref:t}):f.jsx(HG,{...i,ref:t})})})})}),WG=m.forwardRef((e,t)=>{const r=So(Yr,e.__scopeMenu),n=m.useRef(null),i=Qe(t,n);return m.useEffect(()=>{const s=n.current;if(s)return Nw(s)},[]),f.jsx(Rw,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ve(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),HG=m.forwardRef((e,t)=>{const r=So(Yr,e.__scopeMenu);return f.jsx(Rw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),Rw=m.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:h,disableOutsideScroll:y,...g}=e,w=So(Yr,r),x=bu(Yr,r),v=Yp(r),b=JA(r),S=LG(r),[C,P]=m.useState(null),D=m.useRef(null),k=Qe(t,D,w.onContentChange),A=m.useRef(0),I=m.useRef(""),$=m.useRef(0),_=m.useRef(null),q=m.useRef("right"),V=m.useRef(0),ee=y?Qp:m.Fragment,Q=y?{as:yi,allowPinchZoom:!0}:void 0,re=O=>{var W,ie;const T=I.current+O,E=S().filter(be=>!be.disabled),z=document.activeElement,ae=(W=E.find(be=>be.ref.current===z))==null?void 0:W.textValue,le=E.map(be=>be.textValue),ye=n9(le,T,ae),fe=(ie=E.find(be=>be.textValue===ye))==null?void 0:ie.ref.current;(function be(ge){I.current=ge,window.clearTimeout(A.current),ge!==""&&(A.current=window.setTimeout(()=>be(""),1e3))})(T),fe&&setTimeout(()=>fe.focus())};m.useEffect(()=>()=>window.clearTimeout(A.current),[]),vw();const M=m.useCallback(O=>{var E,z;return q.current===((E=_.current)==null?void 0:E.side)&&s9(O,(z=_.current)==null?void 0:z.area)},[]);return f.jsx(zG,{scope:r,searchRef:I,onItemEnter:m.useCallback(O=>{M(O)&&O.preventDefault()},[M]),onItemLeave:m.useCallback(O=>{var T;M(O)||((T=D.current)==null||T.focus(),P(null))},[M]),onTriggerLeave:m.useCallback(O=>{M(O)&&O.preventDefault()},[M]),pointerGraceTimerRef:$,onPointerGraceIntentChange:m.useCallback(O=>{_.current=O},[]),children:f.jsx(ee,{...Q,children:f.jsx(Up,{asChild:!0,trapped:i,onMountAutoFocus:ve(s,O=>{var T;O.preventDefault(),(T=D.current)==null||T.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:f.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:u,onInteractOutside:p,onDismiss:h,children:f.jsx(G8,{asChild:!0,...b,dir:x.dir,orientation:"vertical",loop:n,currentTabStopId:C,onCurrentTabStopIdChange:P,onEntryFocus:ve(l,O=>{x.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(OA,{role:"menu","aria-orientation":"vertical","data-state":xR(w.open),"data-radix-menu-content":"",dir:x.dir,...v,...g,ref:k,style:{outline:"none",...g.style},onKeyDown:ve(g.onKeyDown,O=>{const E=O.target.closest("[data-radix-menu-content]")===O.currentTarget,z=O.ctrlKey||O.altKey||O.metaKey,ae=O.key.length===1;E&&(O.key==="Tab"&&O.preventDefault(),!z&&ae&&re(O.key));const le=D.current;if(O.target!==le||!MG.includes(O.key))return;O.preventDefault();const fe=S().filter(W=>!W.disabled).map(W=>W.ref.current);ZA.includes(O.key)&&fe.reverse(),t9(fe)}),onBlur:ve(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(A.current),I.current="")}),onPointerMove:ve(e.onPointerMove,Oc(O=>{const T=O.target,E=V.current!==O.clientX;if(O.currentTarget.contains(T)&&E){const z=O.clientX>V.current?"right":"left";q.current=z,V.current=O.clientX}}))})})})})})})});nR.displayName=Yr;var GG="MenuGroup",jw=m.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return f.jsx(Ue.div,{role:"group",...n,ref:t})});jw.displayName=GG;var KG="MenuLabel",iR=m.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return f.jsx(Ue.div,{...n,ref:t})});iR.displayName=KG;var Pf="MenuItem",l1="menu.itemSelect",Zp=m.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...i}=e,s=m.useRef(null),o=bu(Pf,e.__scopeMenu),a=Aw(Pf,e.__scopeMenu),l=Qe(t,s),c=m.useRef(!1),d=()=>{const u=s.current;if(!r&&u){const p=new CustomEvent(l1,{bubbles:!0,cancelable:!0});u.addEventListener(l1,h=>n==null?void 0:n(h),{once:!0}),Jy(u,p),p.defaultPrevented?c.current=!1:o.onClose()}};return f.jsx(sR,{...i,ref:l,disabled:r,onClick:ve(e.onClick,d),onPointerDown:u=>{var p;(p=e.onPointerDown)==null||p.call(e,u),c.current=!0},onPointerUp:ve(e.onPointerUp,u=>{var p;c.current||(p=u.currentTarget)==null||p.click()}),onKeyDown:ve(e.onKeyDown,u=>{const p=a.searchRef.current!=="";r||p&&u.key===" "||Ov.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Zp.displayName=Pf;var sR=m.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=e,o=Aw(Pf,r),a=JA(r),l=m.useRef(null),c=Qe(t,l),[d,u]=m.useState(!1),[p,h]=m.useState("");return m.useEffect(()=>{const y=l.current;y&&h((y.textContent??"").trim())},[s.children]),f.jsx(Mc.ItemSlot,{scope:r,disabled:n,textValue:i??p,children:f.jsx(K8,{asChild:!0,...a,focusable:!n,children:f.jsx(Ue.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...s,ref:c,onPointerMove:ve(e.onPointerMove,Oc(y=>{n?o.onItemLeave(y):(o.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ve(e.onPointerLeave,Oc(y=>o.onItemLeave(y))),onFocus:ve(e.onFocus,()=>u(!0)),onBlur:ve(e.onBlur,()=>u(!1))})})})}),qG="MenuCheckboxItem",oR=m.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...i}=e;return f.jsx(dR,{scope:e.__scopeMenu,checked:r,children:f.jsx(Zp,{role:"menuitemcheckbox","aria-checked":Nf(r)?"mixed":r,...i,ref:t,"data-state":Mw(r),onSelect:ve(i.onSelect,()=>n==null?void 0:n(Nf(r)?!0:!r),{checkForDefaultPrevented:!1})})})});oR.displayName=qG;var aR="MenuRadioGroup",[QG,YG]=bo(aR,{value:void 0,onValueChange:()=>{}}),lR=m.forwardRef((e,t)=>{const{value:r,onValueChange:n,...i}=e,s=Zt(n);return f.jsx(QG,{scope:e.__scopeMenu,value:r,onValueChange:s,children:f.jsx(jw,{...i,ref:t})})});lR.displayName=aR;var cR="MenuRadioItem",uR=m.forwardRef((e,t)=>{const{value:r,...n}=e,i=YG(cR,e.__scopeMenu),s=r===i.value;return f.jsx(dR,{scope:e.__scopeMenu,checked:s,children:f.jsx(Zp,{role:"menuitemradio","aria-checked":s,...n,ref:t,"data-state":Mw(s),onSelect:ve(n.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})})});uR.displayName=cR;var Iw="MenuItemIndicator",[dR,ZG]=bo(Iw,{checked:!1}),fR=m.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...i}=e,s=ZG(Iw,r);return f.jsx(Ti,{present:n||Nf(s.checked)||s.checked===!0,children:f.jsx(Ue.span,{...i,ref:t,"data-state":Mw(s.checked)})})});fR.displayName=Iw;var XG="MenuSeparator",pR=m.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return f.jsx(Ue.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});pR.displayName=XG;var JG="MenuArrow",hR=m.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,i=Yp(r);return f.jsx(_A,{...i,...n,ref:t})});hR.displayName=JG;var e9="MenuSub",[pq,mR]=bo(e9),jl="MenuSubTrigger",gR=m.forwardRef((e,t)=>{const r=So(jl,e.__scopeMenu),n=bu(jl,e.__scopeMenu),i=mR(jl,e.__scopeMenu),s=Aw(jl,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const u=a.current;return()=>{window.clearTimeout(u),l(null)}},[a,l]),f.jsx(Dw,{asChild:!0,...c,children:f.jsx(sR,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":i.contentId,"data-state":xR(r.open),...e,ref:fp(t,i.onTriggerChange),onClick:u=>{var p;(p=e.onClick)==null||p.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ve(e.onPointerMove,Oc(u=>{s.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!r.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:ve(e.onPointerLeave,Oc(u=>{var h,y;d();const p=(h=r.content)==null?void 0:h.getBoundingClientRect();if(p){const g=(y=r.content)==null?void 0:y.dataset.side,w=g==="right",x=w?-5:5,v=p[w?"left":"right"],b=p[w?"right":"left"];s.onPointerGraceIntentChange({area:[{x:u.clientX+x,y:u.clientY},{x:v,y:p.top},{x:b,y:p.top},{x:b,y:p.bottom},{x:v,y:p.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(u),u.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:ve(e.onKeyDown,u=>{var h;const p=s.searchRef.current!=="";e.disabled||p&&u.key===" "||OG[n.dir].includes(u.key)&&(r.onOpenChange(!0),(h=r.content)==null||h.focus(),u.preventDefault())})})})});gR.displayName=jl;var vR="MenuSubContent",yR=m.forwardRef((e,t)=>{const r=tR(Yr,e.__scopeMenu),{forceMount:n=r.forceMount,...i}=e,s=So(Yr,e.__scopeMenu),o=bu(Yr,e.__scopeMenu),a=mR(vR,e.__scopeMenu),l=m.useRef(null),c=Qe(t,l);return f.jsx(Mc.Provider,{scope:e.__scopeMenu,children:f.jsx(Ti,{present:n||s.open,children:f.jsx(Mc.Slot,{scope:e.__scopeMenu,children:f.jsx(Rw,{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:d=>{var u;o.isUsingKeyboardRef.current&&((u=l.current)==null||u.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ve(e.onFocusOutside,d=>{d.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:ve(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:ve(e.onKeyDown,d=>{var h;const u=d.currentTarget.contains(d.target),p=_G[o.dir].includes(d.key);u&&p&&(s.onOpenChange(!1),(h=a.trigger)==null||h.focus(),d.preventDefault())})})})})})});yR.displayName=vR;function xR(e){return e?"open":"closed"}function Nf(e){return e==="indeterminate"}function Mw(e){return Nf(e)?"indeterminate":e?"checked":"unchecked"}function t9(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function r9(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function n9(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=r9(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 i9(e,t){const{x:r,y:n}=e;let i=!1;for(let s=0,o=t.length-1;sn!=d>n&&r<(c-a)*(n-l)/(d-l)+a&&(i=!i)}return i}function s9(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return i9(r,t)}function Oc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var o9=eR,a9=Dw,l9=rR,c9=nR,u9=jw,d9=iR,f9=Zp,p9=oR,h9=lR,m9=uR,g9=fR,v9=pR,y9=hR,x9=gR,w9=yR,Ow="DropdownMenu",[b9,hq]=Ya(Ow,[XA]),lr=XA(),[S9,wR]=b9(Ow),bR=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=lr(t),c=m.useRef(null),[d=!1,u]=Ma({prop:i,defaultProp:s,onChange:o});return f.jsx(S9,{scope:t,triggerId:di(),triggerRef:c,contentId:di(),open:d,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(p=>!p),[u]),modal:a,children:f.jsx(o9,{...l,open:d,onOpenChange:u,dir:n,modal:a,children:r})})};bR.displayName=Ow;var SR="DropdownMenuTrigger",CR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...i}=e,s=wR(SR,r),o=lr(r);return f.jsx(a9,{asChild:!0,...o,children:f.jsx(Ue.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:fp(t,s.triggerRef),onPointerDown:ve(e.onPointerDown,a=>{!n&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:ve(e.onKeyDown,a=>{n||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});CR.displayName=SR;var C9="DropdownMenuPortal",ER=e=>{const{__scopeDropdownMenu:t,...r}=e,n=lr(t);return f.jsx(l9,{...n,...r})};ER.displayName=C9;var TR="DropdownMenuContent",PR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=wR(TR,r),s=lr(r),o=m.useRef(!1);return f.jsx(c9,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...n,ref:t,onCloseAutoFocus:ve(e.onCloseAutoFocus,a=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ve(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!i.modal||d)&&(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)"}})});PR.displayName=TR;var E9="DropdownMenuGroup",T9=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=lr(r);return f.jsx(u9,{...i,...n,ref:t})});T9.displayName=E9;var P9="DropdownMenuLabel",NR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=lr(r);return f.jsx(d9,{...i,...n,ref:t})});NR.displayName=P9;var N9="DropdownMenuItem",DR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=lr(r);return f.jsx(f9,{...i,...n,ref:t})});DR.displayName=N9;var D9="DropdownMenuCheckboxItem",kR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=lr(r);return f.jsx(p9,{...i,...n,ref:t})});kR.displayName=D9;var k9="DropdownMenuRadioGroup",A9=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=lr(r);return f.jsx(h9,{...i,...n,ref:t})});A9.displayName=k9;var R9="DropdownMenuRadioItem",AR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=lr(r);return f.jsx(m9,{...i,...n,ref:t})});AR.displayName=R9;var j9="DropdownMenuItemIndicator",RR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=lr(r);return f.jsx(g9,{...i,...n,ref:t})});RR.displayName=j9;var I9="DropdownMenuSeparator",jR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=lr(r);return f.jsx(v9,{...i,...n,ref:t})});jR.displayName=I9;var M9="DropdownMenuArrow",O9=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=lr(r);return f.jsx(y9,{...i,...n,ref:t})});O9.displayName=M9;var _9="DropdownMenuSubTrigger",IR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=lr(r);return f.jsx(x9,{...i,...n,ref:t})});IR.displayName=_9;var L9="DropdownMenuSubContent",MR=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,i=lr(r);return f.jsx(w9,{...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)"}})});MR.displayName=L9;var F9=bR,V9=CR,$9=ER,OR=PR,_R=NR,LR=DR,FR=kR,VR=AR,$R=RR,BR=jR,UR=IR,zR=MR;const WR=F9,HR=V9,B9=m.forwardRef(({className:e,inset:t,children:r,...n},i)=>f.jsxs(UR,{ref:i,className:De("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(aF,{className:"ml-auto h-4 w-4"})]}));B9.displayName=UR.displayName;const U9=m.forwardRef(({className:e,...t},r)=>f.jsx(zR,{ref:r,className:De("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}));U9.displayName=zR.displayName;const _w=m.forwardRef(({className:e,sideOffset:t=4,...r},n)=>f.jsx($9,{children:f.jsx(OR,{ref:n,sideOffset:t,className:De("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})}));_w.displayName=OR.displayName;const Yo=m.forwardRef(({className:e,inset:t,...r},n)=>f.jsx(LR,{ref:n,className:De("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}));Yo.displayName=LR.displayName;const z9=m.forwardRef(({className:e,children:t,checked:r,...n},i)=>f.jsxs(FR,{ref:i,className:De("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($R,{children:f.jsx(bn,{className:"h-4 w-4"})})}),t]}));z9.displayName=FR.displayName;const W9=m.forwardRef(({className:e,children:t,...r},n)=>f.jsxs(VR,{ref:n,className:De("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($R,{children:f.jsx(fF,{className:"h-2 w-2 fill-current"})})}),t]}));W9.displayName=VR.displayName;const GR=m.forwardRef(({className:e,inset:t,...r},n)=>f.jsx(_R,{ref:n,className:De("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));GR.displayName=_R.displayName;const KR=m.forwardRef(({className:e,...t},r)=>f.jsx(BR,{ref:r,className:De("-mx-1 my-1 h-px bg-muted",e),...t}));KR.displayName=BR.displayName;var Su=e=>e.type==="checkbox",Hs=e=>e instanceof Date,nr=e=>e==null;const qR=e=>typeof e=="object";var Tt=e=>!nr(e)&&!Array.isArray(e)&&qR(e)&&!Hs(e),QR=e=>Tt(e)&&e.target?Su(e.target)?e.target.checked:e.target.value:e,H9=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,YR=(e,t)=>e.has(H9(t)),G9=e=>{const t=e.constructor&&e.constructor.prototype;return Tt(t)&&t.hasOwnProperty("isPrototypeOf")},Lw=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function dr(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(!(Lw&&(e instanceof Blob||e instanceof FileList))&&(r||Tt(e)))if(t=r?[]:{},!r&&!G9(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=dr(e[n]));else return e;return t}var Xp=e=>Array.isArray(e)?e.filter(Boolean):[],bt=e=>e===void 0,oe=(e,t,r)=>{if(!t||!Tt(e))return r;const n=Xp(t.split(/[,[\].]+?/)).reduce((i,s)=>nr(i)?i:i[s],e);return bt(n)||n===e?bt(e[t])?r:e[t]:n},Ur=e=>typeof e=="boolean",Fw=e=>/^\w*$/.test(e),ZR=e=>Xp(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ye=(e,t,r)=>{let n=-1;const i=Fw(t)?[t]:ZR(t),s=i.length,o=s-1;for(;++nde.useContext(XR),K9=e=>{const{children:t,...r}=e;return de.createElement(XR.Provider,{value:r},t)};var JR=(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]!==dn.all&&(t._proxyFormState[o]=!n||dn.all),r&&(r[o]=!0),e[o]}});return i},hr=e=>Tt(e)&&!Object.keys(e).length,ej=(e,t,r,n)=>{r(e);const{name:i,...s}=e;return hr(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(o=>t[o]===(!n||dn.all))},Jl=e=>Array.isArray(e)?e:[e],tj=(e,t,r)=>!e||!t||e===t||Jl(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function Vw(e){const t=de.useRef(e);t.current=e,de.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function q9(e){const t=Jp(),{control:r=t.control,disabled:n,name:i,exact:s}=e||{},[o,a]=de.useState(r._formState),l=de.useRef(!0),c=de.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=de.useRef(i);return d.current=i,Vw({disabled:n,next:u=>l.current&&tj(d.current,u.name,s)&&ej(u,c.current,r._updateFormState)&&a({...r._formState,...u}),subject:r._subjects.state}),de.useEffect(()=>(l.current=!0,c.current.isValid&&r._updateValid(!0),()=>{l.current=!1}),[r]),JR(o,r,c.current,!1)}var On=e=>typeof e=="string",rj=(e,t,r,n,i)=>On(e)?(n&&t.watch.add(e),oe(r,e,i)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),oe(r,s))):(n&&(t.watchAll=!0),r);function Q9(e){const t=Jp(),{control:r=t.control,name:n,defaultValue:i,disabled:s,exact:o}=e||{},a=de.useRef(n);a.current=n,Vw({disabled:s,subject:r._subjects.values,next:d=>{tj(a.current,d.name,o)&&c(dr(rj(a.current,r._names,d.values||r._formValues,!1,i)))}});const[l,c]=de.useState(r._getWatch(n,i));return de.useEffect(()=>r._removeUnmounted()),l}function Y9(e){const t=Jp(),{name:r,disabled:n,control:i=t.control,shouldUnregister:s}=e,o=YR(i._names.array,r),a=Q9({control:i,name:r,defaultValue:oe(i._formValues,r,oe(i._defaultValues,r,e.defaultValue)),exact:!0}),l=q9({control:i,name:r,exact:!0}),c=de.useRef(i.register(r,{...e.rules,value:a,...Ur(e.disabled)?{disabled:e.disabled}:{}}));return de.useEffect(()=>{const d=i._options.shouldUnregister||s,u=(p,h)=>{const y=oe(i._fields,p);y&&y._f&&(y._f.mount=h)};if(u(r,!0),d){const p=dr(oe(i._options.defaultValues,r));Ye(i._defaultValues,r,p),bt(oe(i._formValues,r))&&Ye(i._formValues,r,p)}return()=>{(o?d&&!i._state.action:d)?i.unregister(r):u(r,!1)}},[r,i,o,s]),de.useEffect(()=>{oe(i._fields,r)&&i._updateDisabledField({disabled:n,fields:i._fields,name:r,value:oe(i._fields,r)._f.value})},[n,r,i]),{field:{name:r,value:a,...Ur(n)||l.disabled?{disabled:l.disabled||n}:{},onChange:de.useCallback(d=>c.current.onChange({target:{value:QR(d),name:r},type:Df.CHANGE}),[r]),onBlur:de.useCallback(()=>c.current.onBlur({target:{value:oe(i._formValues,r),name:r},type:Df.BLUR}),[r,i]),ref:de.useCallback(d=>{const u=oe(i._fields,r);u&&d&&(u._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:p=>d.setCustomValidity(p),reportValidity:()=>d.reportValidity()})},[i._fields,r])},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!oe(l.errors,r)},isDirty:{enumerable:!0,get:()=>!!oe(l.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!oe(l.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!oe(l.validatingFields,r)},error:{enumerable:!0,get:()=>oe(l.errors,r)}})}}const Z9=e=>e.render(Y9(e));var nj=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},c1=e=>({isOnSubmit:!e||e===dn.onSubmit,isOnBlur:e===dn.onBlur,isOnChange:e===dn.onChange,isOnAll:e===dn.all,isOnTouch:e===dn.onTouched}),u1=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const ec=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const s=oe(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(ec(a,t))break}else if(Tt(a)&&ec(a,t))break}}};var X9=(e,t,r)=>{const n=Jl(oe(e,r));return Ye(n,"root",t[r]),Ye(e,r,n),e},$w=e=>e.type==="file",oi=e=>typeof e=="function",kf=e=>{if(!Lw)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ad=e=>On(e),Bw=e=>e.type==="radio",Af=e=>e instanceof RegExp;const d1={value:!1,isValid:!1},f1={value:!0,isValid:!0};var ij=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&&!bt(e[0].attributes.value)?bt(e[0].value)||e[0].value===""?f1:{value:e[0].value,isValid:!0}:f1:d1}return d1};const p1={isValid:!1,value:null};var sj=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,p1):p1;function h1(e,t,r="validate"){if(Ad(e)||Array.isArray(e)&&e.every(Ad)||Ur(e)&&!e)return{type:r,message:Ad(e)?e:"",ref:t}}var Ro=e=>Tt(e)&&!Af(e)?e:{value:e,message:""},m1=async(e,t,r,n,i)=>{const{ref:s,refs:o,required:a,maxLength:l,minLength:c,min:d,max:u,pattern:p,validate:h,name:y,valueAsNumber:g,mount:w,disabled:x}=e._f,v=oe(t,y);if(!w||x)return{};const b=o?o[0]:s,S=_=>{n&&b.reportValidity&&(b.setCustomValidity(Ur(_)?"":_||""),b.reportValidity())},C={},P=Bw(s),D=Su(s),k=P||D,A=(g||$w(s))&&bt(s.value)&&bt(v)||kf(s)&&s.value===""||v===""||Array.isArray(v)&&!v.length,I=nj.bind(null,y,r,C),$=(_,q,V,ee=Zn.maxLength,Q=Zn.minLength)=>{const re=_?q:V;C[y]={type:_?ee:Q,message:re,ref:s,...I(_?ee:Q,re)}};if(i?!Array.isArray(v)||!v.length:a&&(!k&&(A||nr(v))||Ur(v)&&!v||D&&!ij(o).isValid||P&&!sj(o).isValid)){const{value:_,message:q}=Ad(a)?{value:!!a,message:a}:Ro(a);if(_&&(C[y]={type:Zn.required,message:q,ref:b,...I(Zn.required,q)},!r))return S(q),C}if(!A&&(!nr(d)||!nr(u))){let _,q;const V=Ro(u),ee=Ro(d);if(!nr(v)&&!isNaN(v)){const Q=s.valueAsNumber||v&&+v;nr(V.value)||(_=Q>V.value),nr(ee.value)||(q=Qnew Date(new Date().toDateString()+" "+T),M=s.type=="time",O=s.type=="week";On(V.value)&&v&&(_=M?re(v)>re(V.value):O?v>V.value:Q>new Date(V.value)),On(ee.value)&&v&&(q=M?re(v)+_.value,ee=!nr(q.value)&&v.length<+q.value;if((V||ee)&&($(V,_.message,q.message),!r))return S(C[y].message),C}if(p&&!A&&On(v)){const{value:_,message:q}=Ro(p);if(Af(_)&&!v.match(_)&&(C[y]={type:Zn.pattern,message:q,ref:s,...I(Zn.pattern,q)},!r))return S(q),C}if(h){if(oi(h)){const _=await h(v,t),q=h1(_,b);if(q&&(C[y]={...q,...I(Zn.validate,q.message)},!r))return S(q.message),C}else if(Tt(h)){let _={};for(const q in h){if(!hr(_)&&!r)break;const V=h1(await h[q](v,t),b,q);V&&(_={...V,...I(q,V.message)},S(V.message),r&&(C[y]=_))}if(!hr(_)&&(C[y]={ref:b,..._},!r))return C}}return S(!0),C};function J9(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=[]}}},_v=e=>nr(e)||!qR(e);function Bi(e,t){if(_v(e)||_v(t))return e===t;if(Hs(e)&&Hs(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(Hs(s)&&Hs(o)||Tt(s)&&Tt(o)||Array.isArray(s)&&Array.isArray(o)?!Bi(s,o):s!==o)return!1}}return!0}var oj=e=>e.type==="select-multiple",tK=e=>Bw(e)||Su(e),_m=e=>kf(e)&&e.isConnected,aj=e=>{for(const t in e)if(oi(e[t]))return!0;return!1};function Rf(e,t={}){const r=Array.isArray(e);if(Tt(e)||r)for(const n in e)Array.isArray(e[n])||Tt(e[n])&&!aj(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Rf(e[n],t[n])):nr(e[n])||(t[n]=!0);return t}function lj(e,t,r){const n=Array.isArray(e);if(Tt(e)||n)for(const i in e)Array.isArray(e[i])||Tt(e[i])&&!aj(e[i])?bt(t)||_v(r[i])?r[i]=Array.isArray(e[i])?Rf(e[i],[]):{...Rf(e[i])}:lj(e[i],nr(t)?{}:t[i],r[i]):r[i]=!Bi(e[i],t[i]);return r}var Sl=(e,t)=>lj(e,t,Rf(t)),cj=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>bt(e)?e:t?e===""?NaN:e&&+e:r&&On(e)?new Date(e):n?n(e):e;function Lm(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return $w(t)?t.files:Bw(t)?sj(e.refs).value:oj(t)?[...t.selectedOptions].map(({value:r})=>r):Su(t)?ij(e.refs).value:cj(bt(t.value)?e.ref.value:t.value,e)}var rK=(e,t,r,n)=>{const i={};for(const s of e){const o=oe(t,s);o&&Ye(i,s,o._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Cl=e=>bt(e)?e:Af(e)?e.source:Tt(e)?Af(e.value)?e.value.source:e.value:e;const g1="AsyncFunction";var nK=e=>(!e||!e.validate)&&!!(oi(e.validate)&&e.validate.constructor.name===g1||Tt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===g1)),iK=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function v1(e,t,r){const n=oe(e,r);if(n||Fw(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const s=i.join("."),o=oe(t,s),a=oe(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 sK=(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,oK=(e,t)=>!Xp(oe(e,t)).length&&Dt(e,t);const aK={mode:dn.onSubmit,reValidateMode:dn.onChange,shouldFocusError:!0};function lK(e={}){let t={...aK,...e},r={submitCount:0,isDirty:!1,isLoading:oi(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},i=Tt(t.defaultValues)||Tt(t.values)?dr(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:dr(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 d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={values:Om(),array:Om(),state:Om()},p=c1(t.mode),h=c1(t.reValidateMode),y=t.criteriaMode===dn.all,g=N=>j=>{clearTimeout(c),c=setTimeout(N,j)},w=async N=>{if(!e.disabled&&(d.isValid||N)){const j=t.resolver?hr((await k()).errors):await I(n,!0);j!==r.isValid&&u.state.next({isValid:j})}},x=(N,j)=>{!e.disabled&&(d.isValidating||d.validatingFields)&&((N||Array.from(a.mount)).forEach(F=>{F&&(j?Ye(r.validatingFields,F,j):Dt(r.validatingFields,F))}),u.state.next({validatingFields:r.validatingFields,isValidating:!hr(r.validatingFields)}))},v=(N,j=[],F,ce,se=!0,J=!0)=>{if(ce&&F&&!e.disabled){if(o.action=!0,J&&Array.isArray(oe(n,N))){const Ce=F(oe(n,N),ce.argA,ce.argB);se&&Ye(n,N,Ce)}if(J&&Array.isArray(oe(r.errors,N))){const Ce=F(oe(r.errors,N),ce.argA,ce.argB);se&&Ye(r.errors,N,Ce),oK(r.errors,N)}if(d.touchedFields&&J&&Array.isArray(oe(r.touchedFields,N))){const Ce=F(oe(r.touchedFields,N),ce.argA,ce.argB);se&&Ye(r.touchedFields,N,Ce)}d.dirtyFields&&(r.dirtyFields=Sl(i,s)),u.state.next({name:N,isDirty:_(N,j),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ye(s,N,j)},b=(N,j)=>{Ye(r.errors,N,j),u.state.next({errors:r.errors})},S=N=>{r.errors=N,u.state.next({errors:r.errors,isValid:!1})},C=(N,j,F,ce)=>{const se=oe(n,N);if(se){const J=oe(s,N,bt(F)?oe(i,N):F);bt(J)||ce&&ce.defaultChecked||j?Ye(s,N,j?J:Lm(se._f)):ee(N,J),o.mount&&w()}},P=(N,j,F,ce,se)=>{let J=!1,Ce=!1;const _e={name:N};if(!e.disabled){const dt=!!(oe(n,N)&&oe(n,N)._f&&oe(n,N)._f.disabled);if(!F||ce){d.isDirty&&(Ce=r.isDirty,r.isDirty=_e.isDirty=_(),J=Ce!==_e.isDirty);const gt=dt||Bi(oe(i,N),j);Ce=!!(!dt&&oe(r.dirtyFields,N)),gt||dt?Dt(r.dirtyFields,N):Ye(r.dirtyFields,N,!0),_e.dirtyFields=r.dirtyFields,J=J||d.dirtyFields&&Ce!==!gt}if(F){const gt=oe(r.touchedFields,N);gt||(Ye(r.touchedFields,N,F),_e.touchedFields=r.touchedFields,J=J||d.touchedFields&>!==F)}J&&se&&u.state.next(_e)}return J?_e:{}},D=(N,j,F,ce)=>{const se=oe(r.errors,N),J=d.isValid&&Ur(j)&&r.isValid!==j;if(e.delayError&&F?(l=g(()=>b(N,F)),l(e.delayError)):(clearTimeout(c),l=null,F?Ye(r.errors,N,F):Dt(r.errors,N)),(F?!Bi(se,F):se)||!hr(ce)||J){const Ce={...ce,...J&&Ur(j)?{isValid:j}:{},errors:r.errors,name:N};r={...r,...Ce},u.state.next(Ce)}},k=async N=>{x(N,!0);const j=await t.resolver(s,t.context,rK(N||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return x(N),j},A=async N=>{const{errors:j}=await k(N);if(N)for(const F of N){const ce=oe(j,F);ce?Ye(r.errors,F,ce):Dt(r.errors,F)}else r.errors=j;return j},I=async(N,j,F={valid:!0})=>{for(const ce in N){const se=N[ce];if(se){const{_f:J,...Ce}=se;if(J){const _e=a.array.has(J.name),dt=se._f&&nK(se._f);dt&&d.validatingFields&&x([ce],!0);const gt=await m1(se,s,y,t.shouldUseNativeValidation&&!j,_e);if(dt&&d.validatingFields&&x([ce]),gt[J.name]&&(F.valid=!1,j))break;!j&&(oe(gt,J.name)?_e?X9(r.errors,gt,J.name):Ye(r.errors,J.name,gt[J.name]):Dt(r.errors,J.name))}!hr(Ce)&&await I(Ce,j,F)}}return F.valid},$=()=>{for(const N of a.unMount){const j=oe(n,N);j&&(j._f.refs?j._f.refs.every(F=>!_m(F)):!_m(j._f.ref))&&fe(N)}a.unMount=new Set},_=(N,j)=>!e.disabled&&(N&&j&&Ye(s,N,j),!Bi(E(),i)),q=(N,j,F)=>rj(N,a,{...o.mount?s:bt(j)?i:On(N)?{[N]:j}:j},F,j),V=N=>Xp(oe(o.mount?s:i,N,e.shouldUnregister?oe(i,N,[]):[])),ee=(N,j,F={})=>{const ce=oe(n,N);let se=j;if(ce){const J=ce._f;J&&(!J.disabled&&Ye(s,N,cj(j,J)),se=kf(J.ref)&&nr(j)?"":j,oj(J.ref)?[...J.ref.options].forEach(Ce=>Ce.selected=se.includes(Ce.value)):J.refs?Su(J.ref)?J.refs.length>1?J.refs.forEach(Ce=>(!Ce.defaultChecked||!Ce.disabled)&&(Ce.checked=Array.isArray(se)?!!se.find(_e=>_e===Ce.value):se===Ce.value)):J.refs[0]&&(J.refs[0].checked=!!se):J.refs.forEach(Ce=>Ce.checked=Ce.value===se):$w(J.ref)?J.ref.value="":(J.ref.value=se,J.ref.type||u.values.next({name:N,values:{...s}})))}(F.shouldDirty||F.shouldTouch)&&P(N,se,F.shouldTouch,F.shouldDirty,!0),F.shouldValidate&&T(N)},Q=(N,j,F)=>{for(const ce in j){const se=j[ce],J=`${N}.${ce}`,Ce=oe(n,J);(a.array.has(N)||Tt(se)||Ce&&!Ce._f)&&!Hs(se)?Q(J,se,F):ee(J,se,F)}},re=(N,j,F={})=>{const ce=oe(n,N),se=a.array.has(N),J=dr(j);Ye(s,N,J),se?(u.array.next({name:N,values:{...s}}),(d.isDirty||d.dirtyFields)&&F.shouldDirty&&u.state.next({name:N,dirtyFields:Sl(i,s),isDirty:_(N,J)})):ce&&!ce._f&&!nr(J)?Q(N,J,F):ee(N,J,F),u1(N,a)&&u.state.next({...r}),u.values.next({name:o.mount?N:void 0,values:{...s}})},M=async N=>{o.mount=!0;const j=N.target;let F=j.name,ce=!0;const se=oe(n,F),J=()=>j.type?Lm(se._f):QR(N),Ce=_e=>{ce=Number.isNaN(_e)||Hs(_e)&&isNaN(_e.getTime())||Bi(_e,oe(s,F,_e))};if(se){let _e,dt;const gt=J(),cr=N.type===Df.BLUR||N.type===Df.FOCUS_OUT,Eo=!iK(se._f)&&!t.resolver&&!oe(r.errors,F)&&!se._f.deps||sK(cr,oe(r.touchedFields,F),r.isSubmitted,h,p),Ai=u1(F,a,cr);Ye(s,F,gt),cr?(se._f.onBlur&&se._f.onBlur(N),l&&l(0)):se._f.onChange&&se._f.onChange(N);const Kn=P(F,gt,cr,!1),sl=!hr(Kn)||Ai;if(!cr&&u.values.next({name:F,type:N.type,values:{...s}}),Eo)return d.isValid&&(e.mode==="onBlur"?cr&&w():w()),sl&&u.state.next({name:F,...Ai?{}:Kn});if(!cr&&Ai&&u.state.next({...r}),t.resolver){const{errors:As}=await k([F]);if(Ce(gt),ce){const L=v1(r.errors,n,F),B=v1(As,n,L.name||F);_e=B.error,F=B.name,dt=hr(As)}}else x([F],!0),_e=(await m1(se,s,y,t.shouldUseNativeValidation))[F],x([F]),Ce(gt),ce&&(_e?dt=!1:d.isValid&&(dt=await I(n,!0)));ce&&(se._f.deps&&T(se._f.deps),D(F,dt,_e,Kn))}},O=(N,j)=>{if(oe(r.errors,j)&&N.focus)return N.focus(),1},T=async(N,j={})=>{let F,ce;const se=Jl(N);if(t.resolver){const J=await A(bt(N)?N:se);F=hr(J),ce=N?!se.some(Ce=>oe(J,Ce)):F}else N?(ce=(await Promise.all(se.map(async J=>{const Ce=oe(n,J);return await I(Ce&&Ce._f?{[J]:Ce}:Ce)}))).every(Boolean),!(!ce&&!r.isValid)&&w()):ce=F=await I(n);return u.state.next({...!On(N)||d.isValid&&F!==r.isValid?{}:{name:N},...t.resolver||!N?{isValid:F}:{},errors:r.errors}),j.shouldFocus&&!ce&&ec(n,O,N?se:a.mount),ce},E=N=>{const j={...o.mount?s:i};return bt(N)?j:On(N)?oe(j,N):N.map(F=>oe(j,F))},z=(N,j)=>({invalid:!!oe((j||r).errors,N),isDirty:!!oe((j||r).dirtyFields,N),error:oe((j||r).errors,N),isValidating:!!oe(r.validatingFields,N),isTouched:!!oe((j||r).touchedFields,N)}),ae=N=>{N&&Jl(N).forEach(j=>Dt(r.errors,j)),u.state.next({errors:N?r.errors:{}})},le=(N,j,F)=>{const ce=(oe(n,N,{_f:{}})._f||{}).ref,se=oe(r.errors,N)||{},{ref:J,message:Ce,type:_e,...dt}=se;Ye(r.errors,N,{...dt,...j,ref:ce}),u.state.next({name:N,errors:r.errors,isValid:!1}),F&&F.shouldFocus&&ce&&ce.focus&&ce.focus()},ye=(N,j)=>oi(N)?u.values.subscribe({next:F=>N(q(void 0,j),F)}):q(N,j,!0),fe=(N,j={})=>{for(const F of N?Jl(N):a.mount)a.mount.delete(F),a.array.delete(F),j.keepValue||(Dt(n,F),Dt(s,F)),!j.keepError&&Dt(r.errors,F),!j.keepDirty&&Dt(r.dirtyFields,F),!j.keepTouched&&Dt(r.touchedFields,F),!j.keepIsValidating&&Dt(r.validatingFields,F),!t.shouldUnregister&&!j.keepDefaultValue&&Dt(i,F);u.values.next({values:{...s}}),u.state.next({...r,...j.keepDirty?{isDirty:_()}:{}}),!j.keepIsValid&&w()},W=({disabled:N,name:j,field:F,fields:ce,value:se})=>{if(Ur(N)&&o.mount||N){const J=N?void 0:bt(se)?Lm(F?F._f:oe(ce,j)._f):se;Ye(s,j,J),P(j,J,!1,!1,!0)}},ie=(N,j={})=>{let F=oe(n,N);const ce=Ur(j.disabled)||Ur(e.disabled);return Ye(n,N,{...F||{},_f:{...F&&F._f?F._f:{ref:{name:N}},name:N,mount:!0,...j}}),a.mount.add(N),F?W({field:F,disabled:Ur(j.disabled)?j.disabled:e.disabled,name:N,value:j.value}):C(N,!0,j.value),{...ce?{disabled:j.disabled||e.disabled}:{},...t.progressive?{required:!!j.required,min:Cl(j.min),max:Cl(j.max),minLength:Cl(j.minLength),maxLength:Cl(j.maxLength),pattern:Cl(j.pattern)}:{},name:N,onChange:M,onBlur:M,ref:se=>{if(se){ie(N,j),F=oe(n,N);const J=bt(se.value)&&se.querySelectorAll&&se.querySelectorAll("input,select,textarea")[0]||se,Ce=tK(J),_e=F._f.refs||[];if(Ce?_e.find(dt=>dt===J):J===F._f.ref)return;Ye(n,N,{_f:{...F._f,...Ce?{refs:[..._e.filter(_m),J,...Array.isArray(oe(i,N))?[{}]:[]],ref:{type:J.type,name:N}}:{ref:J}}}),C(N,!1,void 0,J)}else F=oe(n,N,{}),F._f&&(F._f.mount=!1),(t.shouldUnregister||j.shouldUnregister)&&!(YR(a.array,N)&&o.action)&&a.unMount.add(N)}}},be=()=>t.shouldFocusError&&ec(n,O,a.mount),ge=N=>{Ur(N)&&(u.state.next({disabled:N}),ec(n,(j,F)=>{const ce=oe(n,F);ce&&(j.disabled=ce._f.disabled||N,Array.isArray(ce._f.refs)&&ce._f.refs.forEach(se=>{se.disabled=ce._f.disabled||N}))},0,!1))},we=(N,j)=>async F=>{let ce;F&&(F.preventDefault&&F.preventDefault(),F.persist&&F.persist());let se=dr(s);if(u.state.next({isSubmitting:!0}),t.resolver){const{errors:J,values:Ce}=await k();r.errors=J,se=Ce}else await I(n);if(Dt(r.errors,"root"),hr(r.errors)){u.state.next({errors:{}});try{await N(se,F)}catch(J){ce=J}}else j&&await j({...r.errors},F),be(),setTimeout(be);if(u.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:hr(r.errors)&&!ce,submitCount:r.submitCount+1,errors:r.errors}),ce)throw ce},Se=(N,j={})=>{oe(n,N)&&(bt(j.defaultValue)?re(N,dr(oe(i,N))):(re(N,j.defaultValue),Ye(i,N,dr(j.defaultValue))),j.keepTouched||Dt(r.touchedFields,N),j.keepDirty||(Dt(r.dirtyFields,N),r.isDirty=j.defaultValue?_(N,dr(oe(i,N))):_()),j.keepError||(Dt(r.errors,N),d.isValid&&w()),u.state.next({...r}))},Fe=(N,j={})=>{const F=N?dr(N):i,ce=dr(F),se=hr(N),J=se?i:ce;if(j.keepDefaultValues||(i=F),!j.keepValues){if(j.keepDirtyValues){const Ce=new Set([...a.mount,...Object.keys(Sl(i,s))]);for(const _e of Array.from(Ce))oe(r.dirtyFields,_e)?Ye(J,_e,oe(s,_e)):re(_e,oe(J,_e))}else{if(Lw&&bt(N))for(const Ce of a.mount){const _e=oe(n,Ce);if(_e&&_e._f){const dt=Array.isArray(_e._f.refs)?_e._f.refs[0]:_e._f.ref;if(kf(dt)){const gt=dt.closest("form");if(gt){gt.reset();break}}}}n={}}s=e.shouldUnregister?j.keepDefaultValues?dr(i):{}:dr(J),u.array.next({values:{...J}}),u.values.next({values:{...J}})}a={mount:j.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!j.keepIsValid||!!j.keepDirtyValues,o.watch=!!e.shouldUnregister,u.state.next({submitCount:j.keepSubmitCount?r.submitCount:0,isDirty:se?!1:j.keepDirty?r.isDirty:!!(j.keepDefaultValues&&!Bi(N,i)),isSubmitted:j.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:se?{}:j.keepDirtyValues?j.keepDefaultValues&&s?Sl(i,s):r.dirtyFields:j.keepDefaultValues&&N?Sl(i,N):j.keepDirty?r.dirtyFields:{},touchedFields:j.keepTouched?r.touchedFields:{},errors:j.keepErrors?r.errors:{},isSubmitSuccessful:j.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},Pe=(N,j)=>Fe(oi(N)?N(s):N,j);return{control:{register:ie,unregister:fe,getFieldState:z,handleSubmit:we,setError:le,_executeSchema:k,_getWatch:q,_getDirty:_,_updateValid:w,_removeUnmounted:$,_updateFieldArray:v,_updateDisabledField:W,_getFieldArray:V,_reset:Fe,_resetDefaultValues:()=>oi(t.defaultValues)&&t.defaultValues().then(N=>{Pe(N,t.resetOptions),u.state.next({isLoading:!1})}),_updateFormState:N=>{r={...r,...N}},_disableForm:ge,_subjects:u,_proxyFormState:d,_setErrors:S,get _fields(){return n},get _formValues(){return s},get _state(){return o},set _state(N){o=N},get _defaultValues(){return i},get _names(){return a},set _names(N){a=N},get _formState(){return r},set _formState(N){r=N},get _options(){return t},set _options(N){t={...t,...N}}},trigger:T,register:ie,handleSubmit:we,watch:ye,setValue:re,getValues:E,reset:Pe,resetField:Se,clearErrors:ae,unregister:fe,setError:le,setFocus:(N,j={})=>{const F=oe(n,N),ce=F&&F._f;if(ce){const se=ce.refs?ce.refs[0]:ce.ref;se.focus&&(se.focus(),j.shouldSelect&&se.select())}},getFieldState:z}}function eh(e={}){const t=de.useRef(),r=de.useRef(),[n,i]=de.useState({isDirty:!1,isValidating:!1,isLoading:oi(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:oi(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...lK(e),formState:n});const s=t.current.control;return s._options=e,Vw({subject:s._subjects.state,next:o=>{ej(o,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),de.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),de.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==n.isDirty&&s._subjects.state.next({isDirty:o})}},[s,n.isDirty]),de.useEffect(()=>{e.values&&!Bi(e.values,r.current)?(s._reset(e.values,s._options.resetOptions),r.current=e.values,i(o=>({...o}))):s._resetDefaultValues()},[e.values,s]),de.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),de.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()}),de.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),de.useEffect(()=>{t.current&&(t.current.watch=t.current.watch.bind({}))},[n]),t.current.formState=JR(n,s),t.current}const y1=(e,t,r)=>{if(e&&"reportValidity"in e){const n=oe(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},uj=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?y1(n.ref,r,e):n.refs&&n.refs.forEach(i=>y1(i,r,e))}},cK=(e,t)=>{t.shouldUseNativeValidation&&uj(e,t);const r={};for(const n in e){const i=oe(t.fields,n),s=Object.assign(e[n]||{},{ref:i&&i.ref});if(uK(t.names||Object.keys(e),n)){const o=Object.assign({},oe(r,n));Ye(o,"root",s),Ye(r,n,o)}else Ye(r,n,s)}return r},uK=(e,t)=>e.some(r=>r.startsWith(t+"."));var dK=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(d){return d.errors.forEach(function(u){return e.push(u)})}),t){var l=r[o].types,c=l&&l[n.code];r[o]=nj(o,t,r,i,c?[].concat(c,n.message):n.message)}e.shift()}return r},th=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&&uj({},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:cK(dK(o.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw o}))}catch(o){return Promise.reject(o)}}},Ke;(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})(Ke||(Ke={}));var x1;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(x1||(x1={}));const me=Ke.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$s=e=>{switch(typeof e){case"undefined":return me.undefined;case"string":return me.string;case"number":return isNaN(e)?me.nan:me.number;case"boolean":return me.boolean;case"function":return me.function;case"bigint":return me.bigint;case"symbol":return me.symbol;case"object":return Array.isArray(e)?me.array:e===null?me.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?me.promise:typeof Map<"u"&&e instanceof Map?me.map:typeof Set<"u"&&e instanceof Set?me.set:typeof Date<"u"&&e instanceof Date?me.date:me.object;default:return me.unknown}},X=Ke.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 Zr 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()}}Zr.create=e=>new Zr(e);const _c=(e,t)=>{let r;switch(e.code){case X.invalid_type:e.received===me.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case X.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Ke.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ke.joinValues(e.keys,", ")}`;break;case X.invalid_union:r="Invalid input";break;case X.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ke.joinValues(e.options)}`;break;case X.invalid_enum_value:r=`Invalid enum value. Expected ${Ke.joinValues(e.options)}, received '${e.received}'`;break;case X.invalid_arguments:r="Invalid function arguments";break;case X.invalid_return_type:r="Invalid function return type";break;case X.invalid_date:r="Invalid date";break;case X.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}"`:Ke.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case X.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 X.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 X.custom:r="Invalid input";break;case X.invalid_intersection_types:r="Intersection results could not be merged";break;case X.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case X.not_finite:r="Number must be finite";break;default:r=t.defaultError,Ke.assertNever(e)}return{message:r}};let fK=_c;function Lv(){return fK}const Fv=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 pe(e,t){const r=Lv(),n=Fv({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===_c?void 0:_c].filter(i=>!!i)});e.common.issues.push(n)}class sr{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 Oe;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 sr.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 Oe;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 Oe=Object.freeze({status:"aborted"}),Il=e=>({status:"dirty",value:e}),wr=e=>({status:"valid",value:e}),w1=e=>e.status==="aborted",b1=e=>e.status==="dirty",jf=e=>e.status==="valid",If=e=>typeof Promise<"u"&&e instanceof Promise;function Mf(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 dj(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 Ee;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ee||(Ee={}));var Ml,Ol;class Hn{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 S1=(e,t)=>{if(jf(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 Zr(e.common.issues);return this._error=r,this._error}}};function Le(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:d}=e;return o.code==="invalid_enum_value"?{message:d??a.defaultError}:typeof a.data>"u"?{message:(l=d??n)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(c=d??r)!==null&&c!==void 0?c:a.defaultError}},description:i}}class ze{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 $s(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new sr,ctx:{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(If(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:$s(t)},s=this._parseSync({data:t,path:i.path,parent:i});return S1(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:$s(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(If(i)?i:Promise.resolve(i));return S1(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:X.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 Ci({schema:this,typeName:Me.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return fi.create(this,this._def)}nullable(){return mo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zn.create(this,this._def)}promise(){return Fc.create(this,this._def)}or(t){return Lf.create([this,t],this._def)}and(t){return Ff.create(this,t,this._def)}transform(t){return new Ci({...Le(this._def),schema:this,typeName:Me.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new zf({...Le(this._def),innerType:this,defaultValue:r,typeName:Me.ZodDefault})}brand(){return new mj({typeName:Me.ZodBranded,type:this,...Le(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Wf({...Le(this._def),innerType:this,catchValue:r,typeName:Me.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return rh.create(this,t)}readonly(){return Hf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pK=/^c[^\s-]{8,}$/i,hK=/^[0-9a-z]+$/,mK=/^[0-9A-HJKMNP-TV-Z]{26}$/,gK=/^[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,vK=/^[a-z0-9_-]{21}$/i,yK=/^[-+]?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)?)??$/,xK=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Fm;const bK=/^(?:(?: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])$/,SK=/^(([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})))$/,CK=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,fj="((\\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])))",EK=new RegExp(`^${fj}$`);function pj(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 TK(e){return new RegExp(`^${pj(e)}$`)}function PK(e){let t=`${fj}T${pj(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 NK(e,t){return!!((t==="v4"||!t)&&bK.test(e)||(t==="v6"||!t)&&SK.test(e))}class ai extends ze{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==me.string){const s=this._getOrReturnCtx(t);return pe(s,{code:X.invalid_type,expected:me.string,received:s.parsedType}),Oe}const n=new sr;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.lengths.value&&(i=this._getOrReturnCtx(t,i),pe(i,{code:X.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:X.invalid_string,...Ee.errToObj(n)})}_addCheck(t){return new ai({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ee.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ee.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ee.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ee.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ee.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ee.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ee.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ee.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ee.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ee.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,...Ee.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,...Ee.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Ee.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ee.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Ee.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ee.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ee.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ee.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ee.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ee.errToObj(r)})}nonempty(t){return this.min(1,Ee.errToObj(t))}trim(){return new ai({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ai({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ai({...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 ai({checks:[],typeName:Me.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Le(e)})};function DK(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 Ua extends ze{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)!==me.number){const s=this._getOrReturnCtx(t);return pe(s,{code:X.invalid_type,expected:me.number,received:s.parsedType}),Oe}let n;const i=new sr;for(const s of this._def.checks)s.kind==="int"?Ke.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:X.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),pe(n,{code:X.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?DK(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),pe(n,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),pe(n,{code:X.not_finite,message:s.message}),i.dirty()):Ke.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ee.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ee.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ee.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ee.toString(r))}setLimit(t,r,n,i){return new Ua({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ee.toString(i)}]})}_addCheck(t){return new Ua({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ee.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ee.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ee.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ee.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ee.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ee.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ee.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ee.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ee.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"&&Ke.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 Ua({checks:[],typeName:Me.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class za extends ze{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)!==me.bigint){const s=this._getOrReturnCtx(t);return pe(s,{code:X.invalid_type,expected:me.bigint,received:s.parsedType}),Oe}let n;const i=new sr;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),pe(n,{code:X.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),pe(n,{code:X.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Ke.assertNever(s);return{status:i.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ee.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ee.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ee.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ee.toString(r))}setLimit(t,r,n,i){return new za({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Ee.toString(i)}]})}_addCheck(t){return new za({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ee.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ee.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ee.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ee.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ee.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 za({checks:[],typeName:Me.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Le(e)})};class Vv extends ze{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==me.boolean){const n=this._getOrReturnCtx(t);return pe(n,{code:X.invalid_type,expected:me.boolean,received:n.parsedType}),Oe}return wr(t.data)}}Vv.create=e=>new Vv({typeName:Me.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Le(e)});class Lc extends ze{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==me.date){const s=this._getOrReturnCtx(t);return pe(s,{code:X.invalid_type,expected:me.date,received:s.parsedType}),Oe}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return pe(s,{code:X.invalid_date}),Oe}const n=new sr;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()s.value&&(i=this._getOrReturnCtx(t,i),pe(i,{code:X.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Ke.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Lc({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ee.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ee.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 Lc({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Me.ZodDate,...Le(e)});class $v extends ze{_parse(t){if(this._getType(t)!==me.symbol){const n=this._getOrReturnCtx(t);return pe(n,{code:X.invalid_type,expected:me.symbol,received:n.parsedType}),Oe}return wr(t.data)}}$v.create=e=>new $v({typeName:Me.ZodSymbol,...Le(e)});class Of extends ze{_parse(t){if(this._getType(t)!==me.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:X.invalid_type,expected:me.undefined,received:n.parsedType}),Oe}return wr(t.data)}}Of.create=e=>new Of({typeName:Me.ZodUndefined,...Le(e)});class _f extends ze{_parse(t){if(this._getType(t)!==me.null){const n=this._getOrReturnCtx(t);return pe(n,{code:X.invalid_type,expected:me.null,received:n.parsedType}),Oe}return wr(t.data)}}_f.create=e=>new _f({typeName:Me.ZodNull,...Le(e)});class Bv extends ze{constructor(){super(...arguments),this._any=!0}_parse(t){return wr(t.data)}}Bv.create=e=>new Bv({typeName:Me.ZodAny,...Le(e)});class da extends ze{constructor(){super(...arguments),this._unknown=!0}_parse(t){return wr(t.data)}}da.create=e=>new da({typeName:Me.ZodUnknown,...Le(e)});class ys extends ze{_parse(t){const r=this._getOrReturnCtx(t);return pe(r,{code:X.invalid_type,expected:me.never,received:r.parsedType}),Oe}}ys.create=e=>new ys({typeName:Me.ZodNever,...Le(e)});class Uv extends ze{_parse(t){if(this._getType(t)!==me.undefined){const n=this._getOrReturnCtx(t);return pe(n,{code:X.invalid_type,expected:me.void,received:n.parsedType}),Oe}return wr(t.data)}}Uv.create=e=>new Uv({typeName:Me.ZodVoid,...Le(e)});class zn extends ze{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==me.array)return pe(r,{code:X.invalid_type,expected:me.array,received:r.parsedType}),Oe;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,a=r.data.lengthi.maxLength.value&&(pe(r,{code:X.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 Hn(r,o,r.path,a)))).then(o=>sr.mergeArray(n,o));const s=[...r.data].map((o,a)=>i.type._parseSync(new Hn(r,o,r.path,a)));return sr.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new zn({...this._def,minLength:{value:t,message:Ee.toString(r)}})}max(t,r){return new zn({...this._def,maxLength:{value:t,message:Ee.toString(r)}})}length(t,r){return new zn({...this._def,exactLength:{value:t,message:Ee.toString(r)}})}nonempty(t){return this.min(1,t)}}zn.create=(e,t)=>new zn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Me.ZodArray,...Le(t)});function jo(e){if(e instanceof xt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=fi.create(jo(n))}return new xt({...e._def,shape:()=>t})}else return e instanceof zn?new zn({...e._def,type:jo(e.element)}):e instanceof fi?fi.create(jo(e.unwrap())):e instanceof mo?mo.create(jo(e.unwrap())):e instanceof Si?Si.create(e.items.map(t=>jo(t))):e}class xt extends ze{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=Ke.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==me.object){const c=this._getOrReturnCtx(t);return pe(c,{code:X.invalid_type,expected:me.object,received:c.parsedType}),Oe}const{status:n,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ys&&this._def.unknownKeys==="strip"))for(const c in i.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const d=s[c],u=i.data[c];l.push({key:{status:"valid",value:c},value:d._parse(new Hn(i,u,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof ys){const c=this._def.unknownKeys;if(c==="passthrough")for(const d of a)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(c==="strict")a.length>0&&(pe(i,{code:X.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 d of a){const u=i.data[d];l.push({key:{status:"valid",value:d},value:c._parse(new Hn(i,u,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const d of l){const u=await d.key,p=await d.value;c.push({key:u,value:p,alwaysSet:d.alwaysSet})}return c}).then(c=>sr.mergeObjectSync(n,c)):sr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Ee.errToObj,new xt({...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=Ee.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new xt({...this._def,unknownKeys:"strip"})}passthrough(){return new xt({...this._def,unknownKeys:"passthrough"})}extend(t){return new xt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new xt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Me.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new xt({...this._def,catchall:t})}pick(t){const r={};return Ke.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new xt({...this._def,shape:()=>r})}omit(t){const r={};return Ke.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new xt({...this._def,shape:()=>r})}deepPartial(){return jo(this)}partial(t){const r={};return Ke.objectKeys(this.shape).forEach(n=>{const i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}),new xt({...this._def,shape:()=>r})}required(t){const r={};return Ke.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof fi;)s=s._def.innerType;r[n]=s}}),new xt({...this._def,shape:()=>r})}keyof(){return hj(Ke.objectKeys(this.shape))}}xt.create=(e,t)=>new xt({shape:()=>e,unknownKeys:"strip",catchall:ys.create(),typeName:Me.ZodObject,...Le(t)});xt.strictCreate=(e,t)=>new xt({shape:()=>e,unknownKeys:"strict",catchall:ys.create(),typeName:Me.ZodObject,...Le(t)});xt.lazycreate=(e,t)=>new xt({shape:e,unknownKeys:"strip",catchall:ys.create(),typeName:Me.ZodObject,...Le(t)});class Lf extends ze{_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 Zr(a.ctx.common.issues));return pe(r,{code:X.invalid_union,unionErrors:o}),Oe}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},d=l._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,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 Zr(l));return pe(r,{code:X.invalid_union,unionErrors:a}),Oe}}get options(){return this._def.options}}Lf.create=(e,t)=>new Lf({options:e,typeName:Me.ZodUnion,...Le(t)});const Jn=e=>e instanceof $f?Jn(e.schema):e instanceof Ci?Jn(e.innerType()):e instanceof Bf?[e.value]:e instanceof ho?e.options:e instanceof Uf?Ke.objectValues(e.enum):e instanceof zf?Jn(e._def.innerType):e instanceof Of?[void 0]:e instanceof _f?[null]:e instanceof fi?[void 0,...Jn(e.unwrap())]:e instanceof mo?[null,...Jn(e.unwrap())]:e instanceof mj||e instanceof Hf?Jn(e.unwrap()):e instanceof Wf?Jn(e._def.innerType):[];class Uw extends ze{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==me.object)return pe(r,{code:X.invalid_type,expected:me.object,received:r.parsedType}),Oe;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}):(pe(r,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Oe)}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=Jn(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 Uw({typeName:Me.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...Le(n)})}}function zv(e,t){const r=$s(e),n=$s(t);if(e===t)return{valid:!0,data:e};if(r===me.object&&n===me.object){const i=Ke.objectKeys(t),s=Ke.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const l=zv(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===me.array&&n===me.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s{if(w1(s)||w1(o))return Oe;const a=zv(s.value,o.value);return a.valid?((b1(s)||b1(o))&&r.dirty(),{status:r.value,value:a.data}):(pe(n,{code:X.invalid_intersection_types}),Oe)};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}))}}Ff.create=(e,t,r)=>new Ff({left:e,right:t,typeName:Me.ZodIntersection,...Le(r)});class Si extends ze{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==me.array)return pe(n,{code:X.invalid_type,expected:me.array,received:n.parsedType}),Oe;if(n.data.lengththis._def.items.length&&(pe(n,{code:X.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 Hn(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>sr.mergeArray(r,o)):sr.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:Me.ZodTuple,rest:null,...Le(t)})};class Vf extends ze{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!==me.object)return pe(n,{code:X.invalid_type,expected:me.object,received:n.parsedType}),Oe;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in n.data)i.push({key:s._parse(new Hn(n,a,n.path,a)),value:o._parse(new Hn(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?sr.mergeObjectAsync(r,i):sr.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof ze?new Vf({keyType:t,valueType:r,typeName:Me.ZodRecord,...Le(n)}):new Vf({keyType:ai.create(),valueType:t,typeName:Me.ZodRecord,...Le(r)})}}class Wv extends ze{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!==me.map)return pe(n,{code:X.invalid_type,expected:me.map,received:n.parsedType}),Oe;const i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,l],c)=>({key:i._parse(new Hn(n,a,n.path,[c,"key"])),value:s._parse(new Hn(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,d=await l.value;if(c.status==="aborted"||d.status==="aborted")return Oe;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,d=l.value;if(c.status==="aborted"||d.status==="aborted")return Oe;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(c.value,d.value)}return{status:r.value,value:a}}}}Wv.create=(e,t,r)=>new Wv({valueType:t,keyType:e,typeName:Me.ZodMap,...Le(r)});class Wa extends ze{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==me.set)return pe(n,{code:X.invalid_type,expected:me.set,received:n.parsedType}),Oe;const i=this._def;i.minSize!==null&&n.data.sizei.maxSize.value&&(pe(n,{code:X.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 d of l){if(d.status==="aborted")return Oe;d.status==="dirty"&&r.dirty(),c.add(d.value)}return{status:r.value,value:c}}const a=[...n.data.values()].map((l,c)=>s._parse(new Hn(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:Ee.toString(r)}})}max(t,r){return new Wa({...this._def,maxSize:{value:t,message:Ee.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:Me.ZodSet,...Le(t)});class tc extends ze{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==me.function)return pe(r,{code:X.invalid_type,expected:me.function,received:r.parsedType}),Oe;function n(a,l){return Fv({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Lv(),_c].filter(c=>!!c),issueData:{code:X.invalid_arguments,argumentsError:l}})}function i(a,l){return Fv({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Lv(),_c].filter(c=>!!c),issueData:{code:X.invalid_return_type,returnTypeError:l}})}const s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Fc){const a=this;return wr(async function(...l){const c=new Zr([]),d=await a._def.args.parseAsync(l,s).catch(h=>{throw c.addIssue(n(l,h)),c}),u=await Reflect.apply(o,this,d);return await a._def.returns._def.type.parseAsync(u,s).catch(h=>{throw c.addIssue(i(u,h)),c})})}else{const a=this;return wr(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new Zr([n(l,c.error)]);const d=Reflect.apply(o,this,c.data),u=a._def.returns.safeParse(d,s);if(!u.success)throw new Zr([i(d,u.error)]);return u.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new tc({...this._def,args:Si.create(t).rest(da.create())})}returns(t){return new tc({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new tc({args:t||Si.create([]).rest(da.create()),returns:r||da.create(),typeName:Me.ZodFunction,...Le(n)})}}class $f extends ze{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})}}$f.create=(e,t)=>new $f({getter:e,typeName:Me.ZodLazy,...Le(t)});class Bf extends ze{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return pe(r,{received:r.data,code:X.invalid_literal,expected:this._def.value}),Oe}return{status:"valid",value:t.data}}get value(){return this._def.value}}Bf.create=(e,t)=>new Bf({value:e,typeName:Me.ZodLiteral,...Le(t)});function hj(e,t){return new ho({values:e,typeName:Me.ZodEnum,...Le(t)})}class ho extends ze{constructor(){super(...arguments),Ml.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{expected:Ke.joinValues(n),received:r.parsedType,code:X.invalid_type}),Oe}if(Mf(this,Ml)||dj(this,Ml,new Set(this._def.values)),!Mf(this,Ml).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return pe(r,{received:r.data,code:X.invalid_enum_value,options:n}),Oe}return wr(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 ho.create(t,{...this._def,...r})}exclude(t,r=this._def){return ho.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Ml=new WeakMap;ho.create=hj;class Uf extends ze{constructor(){super(...arguments),Ol.set(this,void 0)}_parse(t){const r=Ke.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==me.string&&n.parsedType!==me.number){const i=Ke.objectValues(r);return pe(n,{expected:Ke.joinValues(i),received:n.parsedType,code:X.invalid_type}),Oe}if(Mf(this,Ol)||dj(this,Ol,new Set(Ke.getValidEnumValues(this._def.values))),!Mf(this,Ol).has(t.data)){const i=Ke.objectValues(r);return pe(n,{received:n.data,code:X.invalid_enum_value,options:i}),Oe}return wr(t.data)}get enum(){return this._def.values}}Ol=new WeakMap;Uf.create=(e,t)=>new Uf({values:e,typeName:Me.ZodNativeEnum,...Le(t)});class Fc extends ze{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==me.promise&&r.common.async===!1)return pe(r,{code:X.invalid_type,expected:me.promise,received:r.parsedType}),Oe;const n=r.parsedType===me.promise?r.data:Promise.resolve(r.data);return wr(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Fc.create=(e,t)=>new Fc({type:e,typeName:Me.ZodPromise,...Le(t)});class Ci extends ze{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Me.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=>{pe(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 Oe;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?Oe:l.status==="dirty"||r.value==="dirty"?Il(l.value):l});{if(r.value==="aborted")return Oe;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?Oe:a.status==="dirty"||r.value==="dirty"?Il(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"?Oe:(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"?Oe:(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(!jf(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=>jf(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Ke.assertNever(i)}}Ci.create=(e,t,r)=>new Ci({schema:e,typeName:Me.ZodEffects,effect:t,...Le(r)});Ci.createWithPreprocess=(e,t,r)=>new Ci({schema:t,effect:{type:"preprocess",transform:e},typeName:Me.ZodEffects,...Le(r)});class fi extends ze{_parse(t){return this._getType(t)===me.undefined?wr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}fi.create=(e,t)=>new fi({innerType:e,typeName:Me.ZodOptional,...Le(t)});class mo extends ze{_parse(t){return this._getType(t)===me.null?wr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}mo.create=(e,t)=>new mo({innerType:e,typeName:Me.ZodNullable,...Le(t)});class zf extends ze{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===me.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}zf.create=(e,t)=>new zf({innerType:e,typeName:Me.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Le(t)});class Wf extends ze{_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 If(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Zr(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Zr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Wf.create=(e,t)=>new Wf({innerType:e,typeName:Me.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Le(t)});class Hv extends ze{_parse(t){if(this._getType(t)!==me.nan){const n=this._getOrReturnCtx(t);return pe(n,{code:X.invalid_type,expected:me.nan,received:n.parsedType}),Oe}return{status:"valid",value:t.data}}}Hv.create=e=>new Hv({typeName:Me.ZodNaN,...Le(e)});class mj extends ze{_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 rh extends ze{_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"?Oe:s.status==="dirty"?(r.dirty(),Il(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"?Oe: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 rh({in:t,out:r,typeName:Me.ZodPipeline})}}class Hf extends ze{_parse(t){const r=this._def.innerType._parse(t),n=i=>(jf(i)&&(i.value=Object.freeze(i.value)),i);return If(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}Hf.create=(e,t)=>new Hf({innerType:e,typeName:Me.ZodReadonly,...Le(t)});xt.lazycreate;var Me;(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"})(Me||(Me={}));const _n=ai.create;Ua.create;Hv.create;za.create;Vv.create;Lc.create;$v.create;Of.create;_f.create;Bv.create;da.create;ys.create;Uv.create;zn.create;const nh=xt.create;xt.strictCreate;Lf.create;Uw.create;Ff.create;Si.create;Vf.create;Wv.create;Wa.create;tc.create;$f.create;Bf.create;ho.create;Uf.create;Fc.create;Ci.create;fi.create;mo.create;Ci.createWithPreprocess;rh.create;var zw="Dialog",[gj,vj]=Ya(zw),[kK,Pn]=gj(zw),yj=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,d]=Ma({prop:n,defaultProp:i,onChange:s});return f.jsx(kK,{scope:t,triggerRef:a,contentRef:l,contentId:di(),titleId:di(),descriptionId:di(),open:c,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(u=>!u),[d]),modal:o,children:r})};yj.displayName=zw;var xj="DialogTrigger",wj=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Pn(xj,r),s=Qe(t,i.triggerRef);return f.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Gw(i.open),...n,ref:s,onClick:ve(e.onClick,i.onOpenToggle)})});wj.displayName=xj;var Ww="DialogPortal",[AK,bj]=gj(Ww,{forceMount:void 0}),Sj=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,s=Pn(Ww,t);return f.jsx(AK,{scope:t,forceMount:r,children:m.Children.map(n,o=>f.jsx(Ti,{present:r||s.open,children:f.jsx(eu,{asChild:!0,container:i,children:o})}))})};Sj.displayName=Ww;var Gf="DialogOverlay",Cj=m.forwardRef((e,t)=>{const r=bj(Gf,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=Pn(Gf,e.__scopeDialog);return s.modal?f.jsx(Ti,{present:n||s.open,children:f.jsx(RK,{...i,ref:t})}):null});Cj.displayName=Gf;var RK=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Pn(Gf,r);return f.jsx(Qp,{as:yi,allowPinchZoom:!0,shards:[i.contentRef],children:f.jsx(Ue.div,{"data-state":Gw(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),go="DialogContent",Ej=m.forwardRef((e,t)=>{const r=bj(go,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,s=Pn(go,e.__scopeDialog);return f.jsx(Ti,{present:n||s.open,children:s.modal?f.jsx(jK,{...i,ref:t}):f.jsx(IK,{...i,ref:t})})});Ej.displayName=go;var jK=m.forwardRef((e,t)=>{const r=Pn(go,e.__scopeDialog),n=m.useRef(null),i=Qe(t,r.contentRef,n);return m.useEffect(()=>{const s=n.current;if(s)return Nw(s)},[]),f.jsx(Tj,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:ve(e.onFocusOutside,s=>s.preventDefault())})}),IK=m.forwardRef((e,t)=>{const r=Pn(go,e.__scopeDialog),n=m.useRef(!1),i=m.useRef(!1);return f.jsx(Tj,{...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()}})}),Tj=m.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=Pn(go,r),l=m.useRef(null),c=Qe(t,l);return vw(),f.jsxs(f.Fragment,{children:[f.jsx(Up,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:f.jsx(Jc,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Gw(a.open),...o,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),f.jsxs(f.Fragment,{children:[f.jsx(OK,{titleId:a.titleId}),f.jsx(LK,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Hw="DialogTitle",Pj=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Pn(Hw,r);return f.jsx(Ue.h2,{id:i.titleId,...n,ref:t})});Pj.displayName=Hw;var Nj="DialogDescription",Dj=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Pn(Nj,r);return f.jsx(Ue.p,{id:i.descriptionId,...n,ref:t})});Dj.displayName=Nj;var kj="DialogClose",Aj=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Pn(kj,r);return f.jsx(Ue.button,{type:"button",...n,ref:t,onClick:ve(e.onClick,()=>i.onOpenChange(!1))})});Aj.displayName=kj;function Gw(e){return e?"open":"closed"}var Rj="DialogTitleWarning",[MK,jj]=yL(Rj,{contentName:go,titleName:Hw,docsSlug:"dialog"}),OK=({titleId:e})=>{const t=jj(Rj),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},_K="DialogDescriptionWarning",LK=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jj(_K).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},Ij=yj,FK=wj,Mj=Sj,Kw=Cj,qw=Ej,Qw=Pj,Yw=Dj,Zw=Aj;const Ns=Ij,VK=Mj,Oj=m.forwardRef(({className:e,...t},r)=>f.jsx(Kw,{ref:r,className:De("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}));Oj.displayName=Kw.displayName;const Pi=m.forwardRef(({className:e,children:t,...r},n)=>f.jsxs(VK,{children:[f.jsx(Oj,{}),f.jsxs(qw,{ref:n,className:De("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(Zw,{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(dN,{className:"h-4 w-4"}),f.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Pi.displayName=qw.displayName;const Ni=({className:e,...t})=>f.jsx("div",{className:De("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ni.displayName="DialogHeader";const _j=({className:e,...t})=>f.jsx("div",{className:De("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});_j.displayName="DialogFooter";const Di=m.forwardRef(({className:e,...t},r)=>f.jsx(Qw,{ref:r,className:De("text-lg font-semibold leading-none tracking-tight",e),...t}));Di.displayName=Qw.displayName;const Co=m.forwardRef(({className:e,...t},r)=>f.jsx(Yw,{ref:r,className:De("text-sm text-muted-foreground",e),...t}));Co.displayName=Yw.displayName;var $K="Label",Lj=m.forwardRef((e,t)=>f.jsx(Ue.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())}}));Lj.displayName=$K;var Fj=Lj;const BK=tu("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Gs=m.forwardRef(({className:e,...t},r)=>f.jsx(Fj,{ref:r,className:De(BK(),e),...t}));Gs.displayName=Fj.displayName;const ih=K9,Vj=m.createContext({}),Ln=({...e})=>f.jsx(Vj.Provider,{value:{name:e.name},children:f.jsx(Z9,{...e})}),sh=()=>{const e=m.useContext(Vj),t=m.useContext($j),{getFieldState:r,formState:n}=Jp(),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}},$j=m.createContext({}),hn=m.forwardRef(({className:e,...t},r)=>{const n=m.useId();return f.jsx($j.Provider,{value:{id:n},children:f.jsx("div",{ref:r,className:De("space-y-2",e),...t})})});hn.displayName="FormItem";const mn=m.forwardRef(({className:e,...t},r)=>{const{error:n,formItemId:i}=sh();return f.jsx(Gs,{ref:r,className:De(n&&"text-destructive",e),htmlFor:i,...t})});mn.displayName="FormLabel";const gn=m.forwardRef(({...e},t)=>{const{error:r,formItemId:n,formDescriptionId:i,formMessageId:s}=sh();return f.jsx(yi,{ref:t,id:n,"aria-describedby":r?`${i} ${s}`:`${i}`,"aria-invalid":!!r,...e})});gn.displayName="FormControl";const UK=m.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:n}=sh();return f.jsx("p",{ref:r,id:n,className:De("text-sm text-muted-foreground",e),...t})});UK.displayName="FormDescription";const vn=m.forwardRef(({className:e,children:t,...r},n)=>{const{error:i,formMessageId:s}=sh(),o=i?String(i==null?void 0:i.message):t;return o?f.jsx("p",{ref:n,id:s,className:De("text-sm font-medium text-destructive",e),...r,children:o}):null});vn.displayName="FormMessage";const Qt=m.forwardRef(({className:e,type:t,...r},n)=>f.jsx("input",{type:t,className:De("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}));Qt.displayName="Input";const zK=nh({name:_n().min(2,{message:"Exercise name must be at least 2 characters."}),weight:_n().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Weight must be a positive number."}),reps:_n().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Reps must be a positive number."}),sets:_n().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Sets must be a positive number."})});function WK({open:e,onOpenChange:t,onSubmit:r}){const n=eh({resolver:th(zK),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(Ns,{open:e,onOpenChange:t,children:f.jsxs(Pi,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[f.jsxs(Ni,{children:[f.jsx(Di,{children:"Add Exercise"}),f.jsx(Co,{children:"What's your next challenge?"})]}),f.jsx(ih,{...n,children:f.jsxs("form",{onSubmit:n.handleSubmit(i),className:"space-y-4",children:[f.jsx(Ln,{control:n.control,name:"name",render:({field:s})=>f.jsxs(hn,{children:[f.jsx(mn,{className:"text-foreground",children:"Exercise Name"}),f.jsx(gn,{children:f.jsx(Qt,{placeholder:"e.g. Bench Press",...s})}),f.jsx(vn,{})]})}),f.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[f.jsx(Ln,{control:n.control,name:"weight",render:({field:s})=>f.jsxs(hn,{children:[f.jsx(mn,{className:"text-foreground",children:"Weight (kg)"}),f.jsx(gn,{children:f.jsx(Qt,{type:"number",step:"any",placeholder:"e.g. 70.5",className:"placeholder:text-muted-foreground",...s})}),f.jsx(vn,{})]})}),f.jsx(Ln,{control:n.control,name:"reps",render:({field:s})=>f.jsxs(hn,{children:[f.jsx(mn,{className:"text-foreground",children:"Reps"}),f.jsx(gn,{children:f.jsx(Qt,{type:"number",placeholder:"e.g. 8",className:"placeholder:text-muted-foreground",...s})}),f.jsx(vn,{})]})}),f.jsx(Ln,{control:n.control,name:"sets",render:({field:s})=>f.jsxs(hn,{children:[f.jsx(mn,{className:"text-foreground",children:"Sets"}),f.jsx(gn,{children:f.jsx(Qt,{type:"number",placeholder:"e.g. 3",className:"placeholder:text-muted-foreground",...s})}),f.jsx(vn,{})]})})]}),f.jsx(je,{type:"submit",className:"w-full",children:"Add Exercise"})]})})]})})}var Bj="AlertDialog",[HK,mq]=Ya(Bj,[vj]),ki=vj(),Uj=e=>{const{__scopeAlertDialog:t,...r}=e,n=ki(t);return f.jsx(Ij,{...n,...r,modal:!0})};Uj.displayName=Bj;var GK="AlertDialogTrigger",KK=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=ki(r);return f.jsx(FK,{...i,...n,ref:t})});KK.displayName=GK;var qK="AlertDialogPortal",zj=e=>{const{__scopeAlertDialog:t,...r}=e,n=ki(t);return f.jsx(Mj,{...n,...r})};zj.displayName=qK;var QK="AlertDialogOverlay",Wj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=ki(r);return f.jsx(Kw,{...i,...n,ref:t})});Wj.displayName=QK;var fa="AlertDialogContent",[YK,ZK]=HK(fa),Hj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...i}=e,s=ki(r),o=m.useRef(null),a=Qe(t,o),l=m.useRef(null);return f.jsx(MK,{contentName:fa,titleName:Gj,docsSlug:"alert-dialog",children:f.jsx(YK,{scope:r,cancelRef:l,children:f.jsxs(qw,{role:"alertdialog",...s,...i,ref:a,onOpenAutoFocus:ve(i.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[f.jsx(OP,{children:n}),f.jsx(JK,{contentRef:o})]})})})});Hj.displayName=fa;var Gj="AlertDialogTitle",Kj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=ki(r);return f.jsx(Qw,{...i,...n,ref:t})});Kj.displayName=Gj;var qj="AlertDialogDescription",Qj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=ki(r);return f.jsx(Yw,{...i,...n,ref:t})});Qj.displayName=qj;var XK="AlertDialogAction",Yj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,i=ki(r);return f.jsx(Zw,{...i,...n,ref:t})});Yj.displayName=XK;var Zj="AlertDialogCancel",Xj=m.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:i}=ZK(Zj,r),s=ki(r),o=Qe(t,i);return f.jsx(Zw,{...s,...n,ref:o})});Xj.displayName=Zj;var JK=({contentRef:e})=>{const t=`\`${fa}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${fa}\` by passing a \`${qj}\` 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 \`${fa}\`. 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},e7=Uj,t7=zj,Jj=Wj,eI=Hj,tI=Yj,rI=Xj,nI=Kj,iI=Qj;const Xw=e7,r7=t7,sI=m.forwardRef(({className:e,...t},r)=>f.jsx(Jj,{className:De("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}));sI.displayName=Jj.displayName;const oh=m.forwardRef(({className:e,...t},r)=>f.jsxs(r7,{children:[f.jsx(sI,{}),f.jsx(eI,{ref:r,className:De("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})]}));oh.displayName=eI.displayName;const ah=({className:e,...t})=>f.jsx("div",{className:De("flex flex-col space-y-2 text-center sm:text-left",e),...t});ah.displayName="AlertDialogHeader";const lh=({className:e,...t})=>f.jsx("div",{className:De("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});lh.displayName="AlertDialogFooter";const ch=m.forwardRef(({className:e,...t},r)=>f.jsx(nI,{ref:r,className:De("text-lg font-semibold",e),...t}));ch.displayName=nI.displayName;const uh=m.forwardRef(({className:e,...t},r)=>f.jsx(iI,{ref:r,className:De("text-sm text-muted-foreground",e),...t}));uh.displayName=iI.displayName;const dh=m.forwardRef(({className:e,...t},r)=>f.jsx(tI,{ref:r,className:De(mw(),e),...t}));dh.displayName=tI.displayName;const fh=m.forwardRef(({className:e,...t},r)=>f.jsx(rI,{ref:r,className:De(mw({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));fh.displayName=rI.displayName;const n7=nh({weight:_n().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Weight must be a positive number."}),reps:_n().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Reps must be a positive number."}),sets:_n().refine(e=>!isNaN(Number(e))&&Number(e)>0,{message:"Sets must be a positive number."})});function i7({exercise:e,open:t,onOpenChange:r,onDelete:n,onRefresh:i}){const[s,o]=m.useState(!1),[a,l]=m.useState(e.name),[c,d]=m.useState([]),[u,p]=m.useState(!1),[h,y]=m.useState({open:!1,variationId:null,variationInfo:""}),{toast:g}=Xc(),[w,x]=m.useState(null);de.useEffect(()=>{(async()=>{try{const I=await fetch("/api/user",{credentials:"include"});if(I.ok){const $=await I.json();x($)}}catch{console.log("User not authenticated")}})()},[]);const v=eh({resolver:th(n7),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 A=c[0];v.reset({weight:A.targetWeight.toString(),reps:A.targetReps.toString(),sets:A.targetSets.toString()})}else t&&v.reset({weight:e.weight.toString(),reps:e.reps.toString(),sets:e.sets.toString()})},[t,c,e,v]);const b=async()=>{try{p(!0);const A=await fetch(`/api/v2/exercises/${e.id}/variations`,{credentials:"include"});if(A.ok){const I=await A.json();d(I)}else console.error("Failed to fetch variations:",A.status,A.statusText),d([])}catch(A){console.error("Error fetching variations:",A),d([])}finally{p(!1)}},S=async A=>{const I=Number(A.weight),$=Number(A.reps),_=Number(A.sets);if(c.some(V=>V.targetWeight===I&&V.targetReps===$&&V.targetSets===_)){g({title:"Variation Already Exists",description:`A variation with ${I}kg × ${$} reps × ${_} sets already exists for this exercise.`,variant:"destructive"});return}try{p(!0);const V=await fetch(`/api/v2/exercises/${e.id}/variations`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({targetWeight:I,targetReps:$,targetSets:_,isActive:!0})});if(V.ok){const ee=await V.json();await b(),v.reset()}else throw new Error("Failed to create variation")}catch(V){console.error("Error creating variation:",V),g({title:"That variation didn't want to join the party!",description:"Failed to add variation",variant:"destructive"})}finally{p(!1)}},C=async A=>{try{if(p(!0),(await fetch(`/api/v2/exercises/${e.id}/variations/${A}/set-current`,{method:"PUT",credentials:"include"})).ok)await b();else throw new Error("Failed to set variation as current")}catch(I){console.error("Error setting variation as current:",I),g({title:"That variation is being stubborn!",description:"Failed to update current variation",variant:"destructive"})}finally{p(!1)}},P=async()=>{if(h.variationId){if(c.length<=1){g({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"}),y({open:!1,variationId:null,variationInfo:""});return}try{const A=w?`/api/v2/variations/${h.variationId}`:`/api/demo/v2/variations/${h.variationId}`;if(!(await fetch(A,{method:"DELETE",credentials:"include"})).ok)throw new Error("Failed to delete variation");await b(),g({title:"Set variation dropped like it's hot! ⚡",description:"Successfully removed variation and its workout logs."})}catch(A){console.error("Error deleting variation:",A),g({title:"That variation is holding on tight!",description:"Couldn't delete the variation. Please try again.",variant:"destructive"})}finally{y({open:!1,variationId:null,variationInfo:""})}}},D=async()=>{if(a.trim()===e.name||!a.trim()){o(!1),l(e.name);return}try{const A=w?`/api/v2/exercises/${e.id}/name`:`/api/demo/v2/exercises/${e.id}/name`;if(!(await fetch(A,{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");g({title:"Exercise leveled up! đŸ’Ē",description:"Successfully renamed the exercise."}),o(!1),i()}catch(A){console.error("Error updating exercise name:",A),g({title:"That name didn't stick!",description:"Couldn't update the exercise name. Please try again.",variant:"destructive"}),l(e.name)}},k=A=>{A.key==="Enter"?D():A.key==="Escape"&&(o(!1),l(e.name))};return f.jsxs(Ns,{open:t,onOpenChange:r,children:[f.jsxs(Pi,{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(Ni,{children:[f.jsx(Di,{className:"flex items-center justify-start gap-4",children:s?f.jsxs(f.Fragment,{children:[f.jsx(Qt,{value:a,onChange:A=>l(A.target.value),className:"text-lg font-semibold max-w-[300px]",autoFocus:!0,onKeyDown:k,onBlur:()=>{a.trim()!==e.name?D():o(!1)}}),f.jsx(je,{type:"button",variant:"ghost",size:"sm",onClick:D,className:"h-8 w-8 p-0 flex-shrink-0",children:f.jsx(bn,{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(je,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",onClick:()=>o(!0),children:f.jsx(iv,{className:"h-3 w-3"})})]})}),f.jsx(Co,{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(ih,{...v,children:f.jsxs("form",{onSubmit:v.handleSubmit(S),className:"space-y-3",children:[f.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[f.jsx(Ln,{control:v.control,name:"weight",render:({field:A})=>f.jsxs(hn,{children:[f.jsx(mn,{className:"text-foreground text-sm",children:"Weight (kg)"}),f.jsx(gn,{children:f.jsx(Qt,{type:"number",step:"any",placeholder:"e.g. 70.5",className:"placeholder:text-muted-foreground",...A})}),f.jsx(vn,{})]})}),f.jsx(Ln,{control:v.control,name:"reps",render:({field:A})=>f.jsxs(hn,{children:[f.jsx(mn,{className:"text-foreground text-sm",children:"Reps"}),f.jsx(gn,{children:f.jsx(Qt,{type:"number",placeholder:"e.g. 8",className:"placeholder:text-muted-foreground",...A})}),f.jsx(vn,{})]})}),f.jsx(Ln,{control:v.control,name:"sets",render:({field:A})=>f.jsxs(hn,{children:[f.jsx(mn,{className:"text-foreground text-sm",children:"Sets"}),f.jsx(gn,{children:f.jsx(Qt,{type:"number",placeholder:"e.g. 3",className:"placeholder:text-muted-foreground",...A})}),f.jsx(vn,{})]})})]}),f.jsxs(je,{type:"submit",size:"sm",disabled:u,className:"flex items-center gap-1",children:[f.jsx(aa,{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:u?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(A=>{const I=A.isCurrent;return f.jsx("div",{className:"flex items-center gap-2 transition-all duration-200 min-h-[60px]",children:f.jsx("div",{className:`flex ${I?"w-full":"w-full justify-center"}`,children:f.jsxs("div",{onClick:()=>!I&&C(A.id),className:`flex items-center justify-between p-3 rounded border transition-all duration-200 ${I?"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:[A.targetWeight,"kg | ",A.targetReps," reps | ",A.targetSets," sets"]})}),f.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:A.completions&&A.completions.length>0?f.jsxs(f.Fragment,{children:[A.completions.slice(-10).map(($,_)=>(console.log("Completion object structure:",{id:$.id,success:$.success,completedAt:$.completedAt,fullObject:$}),f.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded-full text-xs ${$.success?"bg-green-100 text-green-700 border border-green-200":"bg-red-100 text-red-700 border border-red-200"}`,title:`${$.success?"Success":"Failed"} - ${new Date($.completedAt).toLocaleString()}`,children:$.success?"✓":"✗"},_))),A.completions.length>10&&f.jsxs("span",{className:"text-xs text-muted-foreground",children:["+",A.completions.length-10," more"]})]}):f.jsx(f.Fragment,{children:Array.from({length:3}).map(($,_)=>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"},_))})})]}),f.jsx("div",{className:"flex items-center ml-3",children:f.jsx(je,{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:$=>{$.stopPropagation(),y({open:!0,variationId:A.id,variationInfo:`${A.targetWeight}kg | ${A.targetReps} reps | ${A.targetSets} sets`})},children:f.jsx(wc,{className:"h-3 w-3"})})})]})})},A.id)}),c.length===1&&f.jsx(f.Fragment,{children:Array.from({length:2}).map((A,I)=>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(($,_)=>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"},_))})]}),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(aa,{className:"h-3 w-3 text-gray-400"})})})]})})},`placeholder-${I}`))})]})}),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(je,{type:"button",variant:"destructive",size:"sm",onClick:()=>{n(),r(!1)},className:"px-3",children:f.jsx(wc,{className:"h-4 w-4"})}),f.jsx(je,{type:"button",onClick:()=>r(!1),variant:"outline",className:"bg-white hover:bg-gray-50",children:"End"})]})]}),f.jsx(Xw,{open:h.open,onOpenChange:A=>y({...h,open:A}),children:f.jsxs(oh,{children:[f.jsxs(ah,{children:[f.jsx(ch,{children:"Drop this variation?"}),f.jsxs(uh,{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(lh,{children:[f.jsx(fh,{children:"Keep it"}),f.jsx(dh,{onClick:P,className:"bg-red-600 hover:bg-red-700",children:"Delete variation"})]})]})})]})}function s7({open:e,onOpenChange:t,onConfirm:r,isSuccess:n}){return f.jsx(Ns,{open:e,onOpenChange:t,children:f.jsxs(Pi,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[f.jsxs(Ni,{children:[f.jsx(Di,{children:"Delete last exercise?"}),f.jsx(Co,{children:"This will remove the most recent workout completion."})]}),f.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[f.jsx(je,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(je,{onClick:()=>{r(),t(!1)},children:"Delete"})]})]})})}const o7=nh({name:_n().min(2,{message:"Routine name must be at least 2 characters."})});function a7({open:e,onOpenChange:t,onSubmit:r,onDelete:n,routine:i,mode:s,existingRoutines:o}){const a=eh({resolver:th(o7),defaultValues:{name:(i==null?void 0:i.name)||""}});de.useEffect(()=>{e&&(i!=null&&i.name)&&a.reset({name:i.name})},[e,i==null?void 0:i.name,a]);function l(d){r(d.name),a.reset(),t(!1)}const c=o.length===1;return f.jsx(Ns,{open:e,onOpenChange:t,children:f.jsxs(Pi,{className:"sm:max-w-[425px] fixed left-[50%] top-[25%] -translate-x-1/2",children:[f.jsxs(Ni,{children:[f.jsx(Di,{children:s==="create"?"Create Routine":"Edit Routine"}),f.jsx(Co,{children:s==="create"?"Create a new routine.":"Edit routine name or delete the routine."})]}),f.jsx(ih,{...a,children:f.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[f.jsx(Ln,{control:a.control,name:"name",render:({field:d})=>f.jsxs(hn,{children:[f.jsx(mn,{className:"text-foreground",children:"Routine Name"}),f.jsx(gn,{children:f.jsx(Qt,{placeholder:"e.g. Upper Body",...d})}),f.jsx(vn,{})]})}),f.jsxs("div",{className:"flex justify-between pt-4",children:[s==="edit"&&n&&!c&&f.jsx(je,{type:"button",variant:"destructive",className:"px-3",onClick:()=>{n(),t(!1)},children:f.jsx(wc,{className:"h-4 w-4"})}),f.jsxs("div",{className:`space-x-2 ${s==="create"||c?"ml-auto":""}`,children:[f.jsx(je,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(je,{type:"submit",children:s==="create"?"Create Routine":"Save Changes"})]})]})]})})]})})}const oI=m.forwardRef(({className:e,...t},r)=>f.jsx("textarea",{className:De("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}));oI.displayName="Textarea";const C1=300;function l7({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=C1-i.length;return f.jsx(Ns,{open:e,onOpenChange:t,children:f.jsxs(Pi,{className:"sm:max-w-md sm:top-[20%] top-[10%] translate-y-0",children:[f.jsx(Ni,{children:f.jsxs(Di,{className:"flex items-center gap-2",children:[f.jsx(cN,{className:"h-5 w-5"}),"Gym diary time! 📝"]})}),f.jsxs("div",{className:"space-y-4",children:[f.jsx(oI,{value:i,onChange:c=>s(c.target.value),placeholder:"Add a note for this exercise...",maxLength:C1,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(_j,{className:"gap-2",children:[f.jsx(je,{variant:"outline",onClick:a,disabled:i.length===0,children:"Clear"}),f.jsx(je,{onClick:o,children:"Save"})]})]})})}function c7({open:e,onOpenChange:t,currentName:r,onSave:n}){const[i,s]=m.useState(r),o=()=>{i.trim()&&(n(i.trim()),t(!1))};return f.jsx(Ns,{open:e,onOpenChange:t,children:f.jsxs(Pi,{className:"sm:max-w-[425px]",children:[f.jsxs(Ni,{children:[f.jsx(Di,{children:"Edit Exercise Name"}),f.jsx(Co,{children:"Update the name of this exercise."})]}),f.jsxs("div",{className:"space-y-4 pt-4",children:[f.jsxs("div",{className:"space-y-2",children:[f.jsx(Gs,{htmlFor:"name",children:"Exercise Name"}),f.jsx(Qt,{id:"name",value:i,onChange:a=>s(a.target.value),placeholder:"Enter exercise name",onKeyDown:a=>{a.key==="Enter"&&o()}})]}),f.jsxs("div",{className:"flex justify-end space-x-2",children:[f.jsx(je,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(je,{onClick:o,children:"Save"})]})]})]})})}function E1(e,[t,r]){return Math.min(r,Math.max(t,e))}function u7(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var d7=[" ","Enter","ArrowUp","ArrowDown"],f7=[" ","Enter"],Cu="Select",[ph,hh,p7]=pp(Cu),[il,gq]=Ya(Cu,[p7,Gp]),mh=Gp(),[h7,Ds]=il(Cu),[m7,g7]=il(Cu),aI=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:u,disabled:p,required:h,form:y}=e,g=mh(t),[w,x]=m.useState(null),[v,b]=m.useState(null),[S,C]=m.useState(!1),P=gw(c),[D=!1,k]=Ma({prop:n,defaultProp:i,onChange:s}),[A,I]=Ma({prop:o,defaultProp:a,onChange:l}),$=m.useRef(null),_=w?y||!!w.closest("form"):!0,[q,V]=m.useState(new Set),ee=Array.from(q).map(Q=>Q.props.value).join(";");return f.jsx(IA,{...g,children:f.jsxs(h7,{required:h,scope:t,trigger:w,onTriggerChange:x,valueNode:v,onValueNodeChange:b,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:di(),value:A,onValueChange:I,open:D,onOpenChange:k,dir:P,triggerPointerDownPosRef:$,disabled:p,children:[f.jsx(ph.Provider,{scope:t,children:f.jsx(m7,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(Q=>{V(re=>new Set(re).add(Q))},[]),onNativeOptionRemove:m.useCallback(Q=>{V(re=>{const M=new Set(re);return M.delete(Q),M})},[]),children:r})}),_?f.jsxs(jI,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:u,value:A,onChange:Q=>I(Q.target.value),disabled:p,form:y,children:[A===void 0?f.jsx("option",{value:""}):null,Array.from(q)]},ee):null]})})};aI.displayName=Cu;var lI="SelectTrigger",cI=m.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,s=mh(r),o=Ds(lI,r),a=o.disabled||n,l=Qe(t,o.onTriggerChange),c=hh(r),d=m.useRef("touch"),[u,p,h]=II(g=>{const w=c().filter(b=>!b.disabled),x=w.find(b=>b.value===o.value),v=MI(w,g,x);v!==void 0&&o.onValueChange(v.value)}),y=g=>{a||(o.onOpenChange(!0),h()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return f.jsx(MA,{asChild:!0,...s,children:f.jsx(Ue.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":RI(o.value)?"":void 0,...i,ref:l,onClick:ve(i.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&y(g)}),onPointerDown:ve(i.onPointerDown,g=>{d.current=g.pointerType;const w=g.target;w.hasPointerCapture(g.pointerId)&&w.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(y(g),g.preventDefault())}),onKeyDown:ve(i.onKeyDown,g=>{const w=u.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(w&&g.key===" ")&&d7.includes(g.key)&&(y(),g.preventDefault())})})})});cI.displayName=lI;var uI="SelectValue",dI=m.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=e,l=Ds(uI,r),{onValueNodeHasChildrenChange:c}=l,d=s!==void 0,u=Qe(t,l.onValueNodeChange);return Xt(()=>{c(d)},[c,d]),f.jsx(Ue.span,{...a,ref:u,style:{pointerEvents:"none"},children:RI(l.value)?f.jsx(f.Fragment,{children:o}):s})});dI.displayName=uI;var v7="SelectIcon",fI=m.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return f.jsx(Ue.span,{"aria-hidden":!0,...i,ref:t,children:n||"â–ŧ"})});fI.displayName=v7;var y7="SelectPortal",pI=e=>f.jsx(eu,{asChild:!0,...e});pI.displayName=y7;var vo="SelectContent",hI=m.forwardRef((e,t)=>{const r=Ds(vo,e.__scopeSelect),[n,i]=m.useState();if(Xt(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?Es.createPortal(f.jsx(mI,{scope:e.__scopeSelect,children:f.jsx(ph.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),s):null}return f.jsx(gI,{...e,ref:t})});hI.displayName=vo;var nn=10,[mI,ks]=il(vo),x7="SelectContentImpl",gI=m.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:g,avoidCollisions:w,...x}=e,v=Ds(vo,r),[b,S]=m.useState(null),[C,P]=m.useState(null),D=Qe(t,W=>S(W)),[k,A]=m.useState(null),[I,$]=m.useState(null),_=hh(r),[q,V]=m.useState(!1),ee=m.useRef(!1);m.useEffect(()=>{if(b)return Nw(b)},[b]),vw();const Q=m.useCallback(W=>{const[ie,...be]=_().map(Se=>Se.ref.current),[ge]=be.slice(-1),we=document.activeElement;for(const Se of W)if(Se===we||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===ie&&C&&(C.scrollTop=0),Se===ge&&C&&(C.scrollTop=C.scrollHeight),Se==null||Se.focus(),document.activeElement!==we))return},[_,C]),re=m.useCallback(()=>Q([k,b]),[Q,k,b]);m.useEffect(()=>{q&&re()},[q,re]);const{onOpenChange:M,triggerPointerDownPosRef:O}=v;m.useEffect(()=>{if(b){let W={x:0,y:0};const ie=ge=>{var we,Se;W={x:Math.abs(Math.round(ge.pageX)-(((we=O.current)==null?void 0:we.x)??0)),y:Math.abs(Math.round(ge.pageY)-(((Se=O.current)==null?void 0:Se.y)??0))}},be=ge=>{W.x<=10&&W.y<=10?ge.preventDefault():b.contains(ge.target)||M(!1),document.removeEventListener("pointermove",ie),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",be,{capture:!0})}}},[b,M,O]),m.useEffect(()=>{const W=()=>M(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[M]);const[T,E]=II(W=>{const ie=_().filter(we=>!we.disabled),be=ie.find(we=>we.ref.current===document.activeElement),ge=MI(ie,W,be);ge&&setTimeout(()=>ge.ref.current.focus())}),z=m.useCallback((W,ie,be)=>{const ge=!ee.current&&!be;(v.value!==void 0&&v.value===ie||ge)&&(A(W),ge&&(ee.current=!0))},[v.value]),ae=m.useCallback(()=>b==null?void 0:b.focus(),[b]),le=m.useCallback((W,ie,be)=>{const ge=!ee.current&&!be;(v.value!==void 0&&v.value===ie||ge)&&$(W)},[v.value]),ye=n==="popper"?Gv:vI,fe=ye===Gv?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:u,collisionBoundary:p,collisionPadding:h,sticky:y,hideWhenDetached:g,avoidCollisions:w}:{};return f.jsx(mI,{scope:r,content:b,viewport:C,onViewportChange:P,itemRefCallback:z,selectedItem:k,onItemLeave:ae,itemTextRefCallback:le,focusSelectedItem:re,selectedItemText:I,position:n,isPositioned:q,searchRef:T,children:f.jsx(Qp,{as:yi,allowPinchZoom:!0,children:f.jsx(Up,{asChild:!0,trapped:v.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:ve(i,W=>{var ie;(ie=v.trigger)==null||ie.focus({preventScroll:!0}),W.preventDefault()}),children:f.jsx(Jc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:f.jsx(ye,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:W=>W.preventDefault(),...x,...fe,onPlaced:()=>V(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ve(x.onKeyDown,W=>{const ie=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ie&&W.key.length===1&&E(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let ge=_().filter(we=>!we.disabled).map(we=>we.ref.current);if(["ArrowUp","End"].includes(W.key)&&(ge=ge.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const we=W.target,Se=ge.indexOf(we);ge=ge.slice(Se+1)}setTimeout(()=>Q(ge)),W.preventDefault()}})})})})})})});gI.displayName=x7;var w7="SelectItemAlignedPosition",vI=m.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,s=Ds(vo,r),o=ks(vo,r),[a,l]=m.useState(null),[c,d]=m.useState(null),u=Qe(t,D=>d(D)),p=hh(r),h=m.useRef(!1),y=m.useRef(!0),{viewport:g,selectedItem:w,selectedItemText:x,focusSelectedItem:v}=o,b=m.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&c&&g&&w&&x){const D=s.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),A=s.valueNode.getBoundingClientRect(),I=x.getBoundingClientRect();if(s.dir!=="rtl"){const we=I.left-k.left,Se=A.left-we,Fe=D.left-Se,Pe=D.width+Fe,rt=Math.max(Pe,k.width),lt=window.innerWidth-nn,ct=E1(Se,[nn,Math.max(nn,lt-rt)]);a.style.minWidth=Pe+"px",a.style.left=ct+"px"}else{const we=k.right-I.right,Se=window.innerWidth-A.right-we,Fe=window.innerWidth-D.right-Se,Pe=D.width+Fe,rt=Math.max(Pe,k.width),lt=window.innerWidth-nn,ct=E1(Se,[nn,Math.max(nn,lt-rt)]);a.style.minWidth=Pe+"px",a.style.right=ct+"px"}const $=p(),_=window.innerHeight-nn*2,q=g.scrollHeight,V=window.getComputedStyle(c),ee=parseInt(V.borderTopWidth,10),Q=parseInt(V.paddingTop,10),re=parseInt(V.borderBottomWidth,10),M=parseInt(V.paddingBottom,10),O=ee+Q+q+M+re,T=Math.min(w.offsetHeight*5,O),E=window.getComputedStyle(g),z=parseInt(E.paddingTop,10),ae=parseInt(E.paddingBottom,10),le=D.top+D.height/2-nn,ye=_-le,fe=w.offsetHeight/2,W=w.offsetTop+fe,ie=ee+Q+W,be=O-ie;if(ie<=le){const we=$.length>0&&w===$[$.length-1].ref.current;a.style.bottom="0px";const Se=c.clientHeight-g.offsetTop-g.offsetHeight,Fe=Math.max(ye,fe+(we?ae:0)+Se+re),Pe=ie+Fe;a.style.height=Pe+"px"}else{const we=$.length>0&&w===$[0].ref.current;a.style.top="0px";const Fe=Math.max(le,ee+g.offsetTop+(we?z:0)+fe)+be;a.style.height=Fe+"px",g.scrollTop=ie-le+g.offsetTop}a.style.margin=`${nn}px 0`,a.style.minHeight=T+"px",a.style.maxHeight=_+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,a,c,g,w,x,s.dir,n]);Xt(()=>b(),[b]);const[S,C]=m.useState();Xt(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const P=m.useCallback(D=>{D&&y.current===!0&&(b(),v==null||v(),y.current=!1)},[b,v]);return f.jsx(S7,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:P,children:f.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:f.jsx(Ue.div,{...i,ref:u,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});vI.displayName=w7;var b7="SelectPopperPosition",Gv=m.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=nn,...s}=e,o=mh(r);return f.jsx(OA,{...o,...s,ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Gv.displayName=b7;var[S7,Jw]=il(vo,{}),Kv="SelectViewport",yI=m.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...i}=e,s=ks(Kv,r),o=Jw(Kv,r),a=Qe(t,s.onViewportChange),l=m.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),f.jsx(ph.Slot,{scope:r,children:f.jsx(Ue.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ve(i.onScroll,c=>{const d=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&u){const h=Math.abs(l.current-d.scrollTop);if(h>0){const y=window.innerHeight-nn*2,g=parseFloat(u.style.minHeight),w=parseFloat(u.style.height),x=Math.max(g,w);if(x0?S:0,u.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});yI.displayName=Kv;var xI="SelectGroup",[C7,E7]=il(xI),T7=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=di();return f.jsx(C7,{scope:r,id:i,children:f.jsx(Ue.div,{role:"group","aria-labelledby":i,...n,ref:t})})});T7.displayName=xI;var wI="SelectLabel",bI=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=E7(wI,r);return f.jsx(Ue.div,{id:i.id,...n,ref:t})});bI.displayName=wI;var Kf="SelectItem",[P7,SI]=il(Kf),CI=m.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=e,a=Ds(Kf,r),l=ks(Kf,r),c=a.value===n,[d,u]=m.useState(s??""),[p,h]=m.useState(!1),y=Qe(t,v=>{var b;return(b=l.itemRefCallback)==null?void 0:b.call(l,v,n,i)}),g=di(),w=m.useRef("touch"),x=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(P7,{scope:r,value:n,disabled:i,textId:g,isSelected:c,onItemTextChange:m.useCallback(v=>{u(b=>b||((v==null?void 0:v.textContent)??"").trim())},[]),children:f.jsx(ph.ItemSlot,{scope:r,value:n,disabled:i,textValue:d,children:f.jsx(Ue.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:y,onFocus:ve(o.onFocus,()=>h(!0)),onBlur:ve(o.onBlur,()=>h(!1)),onClick:ve(o.onClick,()=>{w.current!=="mouse"&&x()}),onPointerUp:ve(o.onPointerUp,()=>{w.current==="mouse"&&x()}),onPointerDown:ve(o.onPointerDown,v=>{w.current=v.pointerType}),onPointerMove:ve(o.onPointerMove,v=>{var b;w.current=v.pointerType,i?(b=l.onItemLeave)==null||b.call(l):w.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ve(o.onPointerLeave,v=>{var b;v.currentTarget===document.activeElement&&((b=l.onItemLeave)==null||b.call(l))}),onKeyDown:ve(o.onKeyDown,v=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&v.key===" "||(f7.includes(v.key)&&x(),v.key===" "&&v.preventDefault())})})})})});CI.displayName=Kf;var _l="SelectItemText",EI=m.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...s}=e,o=Ds(_l,r),a=ks(_l,r),l=SI(_l,r),c=g7(_l,r),[d,u]=m.useState(null),p=Qe(t,x=>u(x),l.onItemTextChange,x=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,x,l.value,l.disabled)}),h=d==null?void 0:d.textContent,y=m.useMemo(()=>f.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:g,onNativeOptionRemove:w}=c;return Xt(()=>(g(y),()=>w(y)),[g,w,y]),f.jsxs(f.Fragment,{children:[f.jsx(Ue.span,{id:l.textId,...s,ref:p}),l.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Es.createPortal(s.children,o.valueNode):null]})});EI.displayName=_l;var TI="SelectItemIndicator",PI=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return SI(TI,r).isSelected?f.jsx(Ue.span,{"aria-hidden":!0,...n,ref:t}):null});PI.displayName=TI;var qv="SelectScrollUpButton",NI=m.forwardRef((e,t)=>{const r=ks(qv,e.__scopeSelect),n=Jw(qv,e.__scopeSelect),[i,s]=m.useState(!1),o=Qe(t,n.onScrollButtonChange);return Xt(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;s(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),i?f.jsx(kI,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});NI.displayName=qv;var Qv="SelectScrollDownButton",DI=m.forwardRef((e,t)=>{const r=ks(Qv,e.__scopeSelect),n=Jw(Qv,e.__scopeSelect),[i,s]=m.useState(!1),o=Qe(t,n.onScrollButtonChange);return Xt(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),i?f.jsx(kI,{...e,ref:o,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});DI.displayName=Qv;var kI=m.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,s=ks("SelectScrollButton",r),o=m.useRef(null),a=hh(r),l=m.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),Xt(()=>{var d;const c=a().find(u=>u.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),f.jsx(Ue.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ve(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:ve(i.onPointerMove,()=>{var c;(c=s.onItemLeave)==null||c.call(s),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:ve(i.onPointerLeave,()=>{l()})})}),N7="SelectSeparator",AI=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return f.jsx(Ue.div,{"aria-hidden":!0,...n,ref:t})});AI.displayName=N7;var Yv="SelectArrow",D7=m.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=mh(r),s=Ds(Yv,r),o=ks(Yv,r);return s.open&&o.position==="popper"?f.jsx(_A,{...i,...n,ref:t}):null});D7.displayName=Yv;function RI(e){return e===""||e===void 0}var jI=m.forwardRef((e,t)=>{const{value:r,...n}=e,i=m.useRef(null),s=Qe(t,i),o=u7(r);return m.useEffect(()=>{const a=i.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==r&&d){const u=new Event("change",{bubbles:!0});d.call(a,r),a.dispatchEvent(u)}},[o,r]),f.jsx(hp,{asChild:!0,children:f.jsx("select",{...n,ref:s,defaultValue:r})})});jI.displayName="BubbleSelect";function II(e){const t=Zt(e),r=m.useRef(""),n=m.useRef(0),i=m.useCallback(o=>{const a=r.current+o;t(a),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),s=m.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function MI(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=k7(e,Math.max(s,0));i.length===1&&(o=o.filter(c=>c!==r));const l=o.find(c=>c.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==r?l:void 0}function k7(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var A7=aI,OI=cI,R7=dI,j7=fI,I7=pI,_I=hI,M7=yI,LI=bI,FI=CI,O7=EI,_7=PI,VI=NI,$I=DI,BI=AI;const L7=A7,F7=R7,UI=m.forwardRef(({className:e,children:t,...r},n)=>f.jsxs(OI,{ref:n,className:De("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,f.jsx(j7,{asChild:!0,children:f.jsx(nx,{className:"h-4 w-4 opacity-50"})})]}));UI.displayName=OI.displayName;const zI=m.forwardRef(({className:e,...t},r)=>f.jsx(VI,{ref:r,className:De("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(lF,{className:"h-4 w-4"})}));zI.displayName=VI.displayName;const WI=m.forwardRef(({className:e,...t},r)=>f.jsx($I,{ref:r,className:De("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(nx,{className:"h-4 w-4"})}));WI.displayName=$I.displayName;const HI=m.forwardRef(({className:e,children:t,position:r="popper",...n},i)=>f.jsx(I7,{children:f.jsxs(_I,{ref:i,className:De("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[f.jsx(zI,{}),f.jsx(M7,{className:De("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(WI,{})]})}));HI.displayName=_I.displayName;const V7=m.forwardRef(({className:e,...t},r)=>f.jsx(LI,{ref:r,className:De("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));V7.displayName=LI.displayName;const GI=m.forwardRef(({className:e,children:t,...r},n)=>f.jsxs(FI,{ref:n,className:De("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[f.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(_7,{children:f.jsx(bn,{className:"h-4 w-4"})})}),f.jsx(O7,{children:t})]}));GI.displayName=FI.displayName;const $7=m.forwardRef(({className:e,...t},r)=>f.jsx(BI,{ref:r,className:De("-mx-1 my-1 h-px bg-muted",e),...t}));$7.displayName=BI.displayName;function B7({open:e,onOpenChange:t,currentMetrics:r,routines:n,currentRoutineId:i,onSave:s,onDelete:o}){const[a,l]=m.useState(r.weight.toString()),[c,d]=m.useState(r.reps.toString()),[u,p]=m.useState(r.sets.toString()),[h,y]=m.useState((i==null?void 0:i.toString())||"");m.useEffect(()=>{e&&i&&y(i.toString())},[e,i]);const g=()=>{const w=parseFloat(a),x=parseInt(c),v=parseInt(u);if(!isNaN(w)&&!isNaN(x)&&!isNaN(v)&&w>0&&x>0&&v>0){const b=parseInt(h);s({weight:w,reps:x,sets:v,routineId:i&&b!==i?b:void 0}),t(!1)}};return f.jsx(Ns,{open:e,onOpenChange:t,children:f.jsxs(Pi,{className:"sm:max-w-[425px]",children:[f.jsxs(Ni,{children:[f.jsx(Di,{children:"Edit Exercise Metrics"}),f.jsx(Co,{children:"Update the weight, reps, and sets for this exercise."})]}),f.jsxs("div",{className:"space-y-4 pt-4",children:[n&&n.length>1&&f.jsxs("div",{className:"space-y-2",children:[f.jsx(Gs,{htmlFor:"routine",children:"Routine"}),f.jsxs(L7,{value:h,onValueChange:y,children:[f.jsx(UI,{id:"routine",children:f.jsx(F7,{placeholder:"Select routine"})}),f.jsx(HI,{children:n.map(w=>f.jsx(GI,{value:w.id.toString(),children:w.name},w.id))})]})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Gs,{htmlFor:"weight",children:"Weight (kg)"}),f.jsx(Qt,{id:"weight",type:"number",step:"0.01",value:a,onChange:w=>l(w.target.value),placeholder:"Enter weight"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Gs,{htmlFor:"reps",children:"Reps"}),f.jsx(Qt,{id:"reps",type:"number",value:c,onChange:w=>d(w.target.value),placeholder:"Enter reps"})]}),f.jsxs("div",{className:"space-y-2",children:[f.jsx(Gs,{htmlFor:"sets",children:"Sets"}),f.jsx(Qt,{id:"sets",type:"number",value:u,onChange:w=>p(w.target.value),placeholder:"Enter sets"})]}),f.jsxs("div",{className:"flex justify-between items-center",children:[o&&f.jsx(je,{variant:"ghost",onClick:()=>{o(),t(!1)},className:"text-red-600 hover:text-red-700 hover:bg-red-50",children:f.jsx(wc,{className:"h-4 w-4"})}),f.jsxs("div",{className:`flex space-x-2 ${o?"":"ml-auto"}`,children:[f.jsx(je,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),f.jsx(je,{onClick:g,children:"Save"})]})]})]})]})})}async function Vm(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 U7(){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 gh(){const e=Qc(),{data:t,error:r,isLoading:n}=hP({queryKey:["user"],queryFn:U7,staleTime:1/0,retry:!1}),i=ia({mutationFn:a=>Vm("/api/login","POST",a),onSuccess:()=>{e.invalidateQueries({queryKey:["user"]})}}),s=ia({mutationFn:()=>Vm("/api/logout","POST"),onSuccess:()=>{e.invalidateQueries({queryKey:["user"]}),window.location.href="/"}}),o=ia({mutationFn:a=>Vm("/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 z7=tu("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"}}),KI=m.forwardRef(({className:e,variant:t,...r},n)=>f.jsx("div",{ref:n,role:"alert",className:De(z7({variant:t}),e),...r}));KI.displayName="Alert";const W7=m.forwardRef(({className:e,...t},r)=>f.jsx("h5",{ref:r,className:De("mb-1 font-medium leading-none tracking-tight",e),...t}));W7.displayName="AlertTitle";const qI=m.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:De("text-sm [&_p]:leading-relaxed",e),...t}));qI.displayName="AlertDescription";const QI=m.forwardRef((e,t)=>{const{textSize:r}=ZI(),[n,i]=m.useState(0),[s,o]=m.useState(!1),[a,l]=m.useState(null),d=(()=>{switch(r){case"large":return{text:"text-6xl",icon:"h-5 w-5",button:"default"};case"extra-large":return{text:"text-7xl",icon:"h-6 w-6",button:"lg"};default:return{text:"text-5xl",icon:"h-4 w-4",button:"sm"}}})();m.useEffect(()=>{let w;return s&&a&&(w=window.setInterval(()=>{i(Date.now()-a)},10)),()=>{w&&clearInterval(w)}},[s,a]);const u=()=>{l(Date.now()-n),o(!0)},p=()=>{i(0),o(!1),l(null)},h=()=>{i(0),l(Date.now()),o(!0)},y=()=>{o(!1)};m.useImperativeHandle(t,()=>({start:u,reset:p,resetAndStart:h}));const g=w=>{const x=Math.floor(w/1e3),v=Math.floor(x/60),b=x%60;return`${v.toString().padStart(2,"0")}:${b.toString().padStart(2,"0")}`};return f.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 pb-safe p-4",children:f.jsx("div",{className:"max-w-7xl mx-auto bg-black border-2 border-gray-800 rounded-lg shadow-2xl overflow-hidden",children:f.jsxs("div",{className:"px-4 py-3 flex items-center justify-between gap-4 min-w-0",children:[f.jsx("div",{className:"flex-1 text-center min-w-0 overflow-hidden",children:f.jsx("div",{className:`${d.text} font-mono font-bold ${n===0?"text-gray-500":"text-white"} whitespace-nowrap`,children:g(n)})}),f.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[f.jsx(je,{size:"icon",variant:"outline",className:"aspect-square",onClick:s?y:u,children:s?f.jsx(gF,{className:d.icon}):f.jsx(vF,{className:d.icon})}),f.jsx(je,{variant:"outline",size:"icon",className:"aspect-square",onClick:p,children:f.jsx(xF,{className:d.icon})})]})]})})})});QI.displayName="TimerDialog";function H7({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(Lb,{className:"h-4 w-4 text-orange-500"})},{text:"Add 2-3 more reps to challenge yourself",icon:f.jsx(aa,{className:"h-4 w-4 text-blue-500"})},{text:"Throw in an extra set for volume",icon:f.jsx(sf,{className:"h-4 w-4 text-purple-500"})},{text:"Try a slower, more controlled tempo",icon:f.jsx(nf,{className:"h-4 w-4 text-indigo-500"})},{text:"Reduce rest time between sets",icon:f.jsx(uN,{className:"h-4 w-4 text-red-500"})}],footer:"Progress is progress, no matter how small!",icon:f.jsx(ix,{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(_b,{className:"h-4 w-4 text-red-500"})},{text:"Focus on 2-3 fewer reps with perfect form",icon:f.jsx(sf,{className:"h-4 w-4 text-green-500"})},{text:"Take an extra day to recover fully",icon:f.jsx(nf,{className:"h-4 w-4 text-blue-500"})},{text:"Try lighter warm-up sets first",icon:f.jsx(Lb,{className:"h-4 w-4 text-yellow-500"})},{text:"Check your sleep and nutrition",icon:f.jsx(bn,{className:"h-4 w-4 text-purple-500"})}],footer:"Remember: Form > Weight. You've got this!",icon:f.jsx(_b,{className:"h-10 w-10 text-red-500"})}};return f.jsx(Ns,{open:e,onOpenChange:t,children:f.jsxs(Pi,{className:"max-w-md",children:[f.jsxs(Ni,{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(Di,{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(je,{variant:"outline",onClick:()=>t(!1),children:"Got it"}),f.jsx(je,{onClick:()=>{n==null||n(),t(!1)},children:"Edit Exercise"})]})]})})}function G7({routines:e}){const t=m.useMemo(()=>{const n=[],i=new Date;for(let s=29;s>=0;s--){const o=new Date(i);o.setDate(i.getDate()-s);const a=o.toISOString().split("T")[0],l=s===0;let c=0,d=0,u=0,p=!1;e.forEach(h=>{h.exercises&&Array.isArray(h.exercises)&&h.exercises.forEach(y=>{y.completedSets&&Array.isArray(y.completedSets)&&y.completedSets.forEach(g=>{if(new Date(g.timestamp).toISOString().split("T")[0]===a&&g.metrics){p=!0;const x=(g.metrics.weight||0)*(g.metrics.reps||0);c+=x,g.completed?d+=x:u+=x}})})}),n.push({date:a,hasActivity:p,totalWeight:c,completedWeight:d,failedWeight:u,isToday:l})}return n},[e]),r=m.useMemo(()=>{for(let n=t.length-1;n>=0;n--)if(t[n].hasActivity){const i=new Date,s=new Date(t[n].date),o=Math.abs(i.getTime()-s.getTime());return Math.floor(o/(1e3*60*60*24))}return 30},[t]);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",children:[f.jsx("h3",{className:"text-sm font-medium text-gray-700",children:r===0?"Last workout was today":r>=30?"No workouts in last 30 days":`Last workout ${r} ${r===1?"day":"days"} ago`}),f.jsx("span",{className:"text-xs text-gray-400",children:"Today ↓"})]}),f.jsx("div",{className:"pb-3 px-3",children:f.jsx("div",{className:"flex gap-0.5 h-3 rounded overflow-hidden",children:t.map(n=>f.jsx("div",{className:`flex-1 transition-colors ${n.hasActivity?"bg-blue-500":"bg-gray-200"}`,title:`${new Date(n.date).toLocaleDateString()} - ${n.hasActivity?`${n.totalWeight.toLocaleString()} kg total (${n.completedWeight.toLocaleString()} completed, ${n.failedWeight.toLocaleString()} failed)`:"No activity"}`},n.date))})})]})}function K7({open:e,onOpenChange:t,onConfirm:r,title:n,description:i,confirmText:s="Delete",cancelText:o="Cancel"}){const a=()=>{r(),t(!1)};return f.jsx(Xw,{open:e,onOpenChange:t,children:f.jsxs(oh,{children:[f.jsxs(ah,{children:[f.jsx(ch,{children:n}),f.jsx(uh,{children:i})]}),f.jsxs(lh,{children:[f.jsx(fh,{onClick:()=>t(!1),children:o}),f.jsx(dh,{onClick:a,className:"bg-red-600 hover:bg-red-700",children:s})]})]})})}const $m="routine-tracker-data",T1="selected-routine-id",q7=()=>Math.floor(Math.random()*1e6),P1=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 N1(){return f.jsx("div",{className:"flex items-center justify-center p-4",children:f.jsx(si,{className:"h-6 w-6 animate-spin text-primary"})})}function sd(){var As;const{user:e,logout:t}=gh(),{textSize:r}=ZI(),n=m.useRef(null),[i,s]=m.useState(!0),a=(()=>{switch(r){case"large":return{exerciseName:"text-2xl",exerciseMetrics:"text-lg",setButton:"text-base",buttonSize:"w-12 h-12",buttonHeight:"h-12",date:"text-base",noteText:"text-base"};case"extra-large":return{exerciseName:"text-3xl",exerciseMetrics:"text-xl",setButton:"text-lg",buttonSize:"w-14 h-14",buttonHeight:"h-14",date:"text-lg",noteText:"text-lg"};default:return{exerciseName:"text-xl",exerciseMetrics:"text-base",setButton:"text-sm",buttonSize:"w-10 h-10",buttonHeight:"h-10",date:"text-sm",noteText:"text-sm"}}})(),l="w-1.5 h-3",[c,d]=m.useState([]),[u,p]=m.useState(null),[h,y]=m.useState({index:-1,exercise:null}),[g,w]=m.useState(null);m.useState(null);const[x,v]=m.useState({open:!1,mode:"create"}),[b,S]=m.useState(!1),[C,P]=m.useState(!1),[D,k]=m.useState(null),[A,I]=m.useState(new Set),[$,_]=m.useState(!1),[q,V]=m.useState(null),[ee,Q]=m.useState(null),[re,M]=m.useState(!1),O=Xc(),[T,E]=m.useState({}),[z,ae]=m.useState({open:!1,type:"routine",id:0,name:""}),[le,ye]=m.useState(null),[fe,W]=m.useState(null),[ie,be]=m.useState(null),[ge,we]=m.useState({}),[Se,Fe]=m.useState(null),Pe=()=>({id:q7(),name:"My First Routine",exercises:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()});m.useEffect(()=>{let L=!0;return(async()=>{try{s(!0);const U=q===!0&&!e;if(e){localStorage.removeItem($m);const ue=localStorage.getItem(T1),G=await fetch("/api/routines",{credentials:"include"});if(!G.ok)throw new Error("Failed to fetch routines");const K=await G.json();if(L){const H=K.map(te=>({...te,exercises:te.exercises.map(Ne=>({...Ne,date:Ne.date||Ne.updatedAt||te.updatedAt||new Date().toISOString(),notes:Ne.notes||""}))}));d(H);const Y=ue?H.find(te=>te.id===parseInt(ue)):H[0];Y?(p(Y),cr(Y).then(te=>{L&&(p(te),d(Ne=>Ne.map(Ie=>Ie.id===Y.id?te:Ie)))}).catch(te=>{console.error("Error loading complete routine data:",te)})):p(H[0])}}else{const ue=await fetch("/api/demo/routines");if(ue.ok){const G=await ue.json();if(console.log("Fetched demo routines from server:",G.length),G.length>0&&L){const K=G.map(H=>{var Y;return{...H,exercises:(Y=H.exercises)==null?void 0:Y.map(te=>({...te,date:te.date||te.updatedAt||H.updatedAt||new Date().toISOString(),notes:te.notes||""}))}});d(K),p(K[0])}else if(L){const K=await fetch("/api/demo/routines",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"My First Routine"})});if(K.ok){const H=await K.json();d([H]),p(H)}else{const H=Pe();d([H]),p(H)}}}else if(L){const G=Pe();d([G]),p(G)}}V(!!e)}catch(U){console.error("Error initializing data:",U),L&&(d([]),p(null))}finally{L&&s(!1)}})(),()=>{L=!1}},[e,q]),m.useEffect(()=>{e&&u&&u.id!=null&&localStorage.setItem(T1,u.id.toString())},[e,u==null?void 0:u.id]),m.useEffect(()=>{if(!e&&c.length>0){const L={routines:c,selectedRoutineId:u==null?void 0:u.id};localStorage.setItem($m,JSON.stringify(L))}else e&&localStorage.removeItem($m)},[c,u==null?void 0:u.id,e]),m.useEffect(()=>{if(!b)return;const L=setTimeout(()=>{const B=()=>{S(!1)};return window.addEventListener("click",B),()=>window.removeEventListener("click",B)},500);return()=>clearTimeout(L)},[b]),m.useEffect(()=>{if(b&&!C){const L=setTimeout(()=>{const B={title:"Ready to crush it? đŸ’Ē",description:"Tap Success or Fail once you've completed all your sets!",duration:5e3};O.toast(B),P(!0)},300);return()=>clearTimeout(L)}},[b,C,O]),m.useEffect(()=>{if(u!=null&&u.exercises){const L={};u.exercises.forEach(B=>{var ue;const U=((ue=B.completedSets)==null?void 0:ue.filter(G=>G.metrics.weight===B.weight&&G.metrics.reps===B.reps&&G.metrics.sets===B.sets))||[];if(U.length>=4){const G=U.slice(-4),K=G.every(Y=>Y.completed),H=G.every(Y=>!Y.completed);K||H?L[B.id]=K?"increase":"decrease":L[B.id]=null}else L[B.id]=null}),E(L)}},[u==null?void 0:u.exercises]);const rt=async(L,B)=>{if(u)try{const U=e?`/api/routines/${u.id}/exercises/${L}/notes`:`/api/demo/routines/${u.id}/exercises/${L}/notes`,ue=await fetch(U,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({notes:B||""}),credentials:"include"});if(!ue.ok){const G=await ue.text();throw console.error("Failed to update note:",G),new Error("Failed to update note")}d(G=>{const K=G.map(Y=>Y.id===u.id?{...Y,exercises:Y.exercises.map(te=>te.id===L?{...te,notes:B||""}:te)}:Y),H=K.find(Y=>Y.id===u.id);return H&&p(H),K})}catch(U){console.error("Error updating note:",U),O.toast({title:"Oops! Your note got away from us!",description:"Failed to save note. Please try again.",variant:"destructive"})}},lt=async(L,B)=>{if(u)try{const U=e?`/api/v2/exercises/${L}/name`:`/api/demo/v2/exercises/${L}/name`;if(!(await fetch(U,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:B}),credentials:"include"})).ok)throw new Error("Failed to update exercise name");d(G=>{const K=G.map(Y=>Y.id===u.id?{...Y,exercises:Y.exercises.map(te=>te.id===L?{...te,name:B}:te)}:Y),H=K.find(Y=>Y.id===u.id);return H&&p(H),K})}catch(U){console.error("Error updating exercise name:",U),O.toast({title:"Failed to update exercise name",description:"Please try again.",variant:"destructive"})}},ct=async(L,B)=>{var U;if(u)try{if(B.routineId&&B.routineId!==u.id){if(console.log("Moving exercise",L,"to routine",B.routineId),!u.exercises.find(te=>te.id===L))return;const K=e?`/api/routines/${u.id}/exercises/${L}/move`:`/api/demo/routines/${u.id}/exercises/${L}/move`,H=e?{credentials:"include"}:{};if(!(await fetch(K,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetRoutineId:B.routineId,targetOrder:0}),...H})).ok)throw new Error("Failed to move exercise to new routine");if(e){const te=await fetch("/api/routines",{credentials:"include"});if(te.ok){const Ne=await te.json();d(Ne);const Ie=Ne.find(et=>et.id===u.id);Ie&&p(Ie)}}else{const te=await fetch("/api/demo/routines");if(te.ok){const Ne=await te.json();d(Ne);const Ie=Ne.find(et=>et.id===u.id);Ie&&p(Ie)}}O.toast({title:"Exercise moved",description:`Moved to ${(U=c.find(te=>te.id===B.routineId))==null?void 0:U.name}`});return}const ue=await fetch(`/api/v2/exercises/${L}/variations`,{credentials:"include"});if(ue.ok){const G=await ue.json();console.log("Checking for existing variation with metrics:",B),console.log("Existing variations:",G.map(H=>({id:H.id,weight:H.targetWeight,reps:H.targetReps,sets:H.targetSets})));const K=G.find(H=>{const Y=Math.abs(H.targetWeight-B.weight)<.01,te=H.targetReps===B.reps,Ne=H.targetSets===B.sets;return Y&&te&&Ne});if(K){if(console.log("Found existing variation:",K.id,"Switching to it..."),!(await fetch(`/api/v2/exercises/${L}/variations/${K.id}/set-current`,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include"})).ok)throw new Error("Failed to switch to existing variation");console.log("Successfully switched to existing variation")}else{if(console.log("No existing variation found, creating new one..."),!(await fetch(`/api/v2/exercises/${L}/variations`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({targetWeight:B.weight,targetReps:B.reps,targetSets:B.sets,isActive:!0}),credentials:"include"})).ok)throw new Error("Failed to create new variation");console.log("Successfully created new variation")}}if(we(G=>{const K={...G};return delete K[L],K}),e){const G=await fetch("/api/routines",{credentials:"include"});if(G.ok){const K=await G.json();d(K);const H=K.find(Y=>Y.id===u.id);H&&p(H)}}}catch(ue){console.error("Error updating exercise metrics:",ue),O.toast({title:"Failed to update exercise metrics",description:"Please try again.",variant:"destructive"})}},N=async L=>{if(u)try{const B=e?`/api/routines/${u.id}/exercises`:`/api/demo/routines/${u.id}/exercises`,U=e?{credentials:"include"}:{},ue=await fetch(B,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...L,order:(u.exercises||[]).length,date:new Date().toISOString()}),...U});if(!ue.ok)throw new Error("Failed to save exercise");const G=await ue.json();d(K=>{const H=K.map(te=>{if(te.id===u.id){const Ne=te.exercises||[];return Ne.length===0&&S(!0),{...te,exercises:[...Ne,{...G,date:G.date||new Date().toISOString()}],updatedAt:new Date().toISOString()}}return te}),Y=H.find(te=>te.id===u.id);return Y&&p(Y),H})}catch(B){console.error("Error saving exercise:",B)}},j=(L,B,U)=>{let ue=!1;we(G=>{var Y,te,Ne;const K=G[L]||new Set,H=new Set(K);return H.has(B)?(H.delete(B),(Y=n.current)==null||Y.reset()):(H.add(B),H.size===U?((te=n.current)==null||te.reset(),ue=!0):(Ne=n.current)==null||Ne.resetAndStart()),{...G,[L]:H}}),ue&&(Fe({exerciseId:L,setNumber:B}),setTimeout(()=>{Fe(null),F(L,!0)},500))},F=(L,B)=>{var G;(G=n.current)==null||G.reset();const U=u==null?void 0:u.exercises.find(K=>K.id===L);if(!U)return;let ue;B!==void 0?ue=B:ue=(ge[L]||new Set).size===U.sets,ce(L,ue)},ce=async(L,B)=>{S(!1),P(!1),we(G=>{const K={...G};return delete K[L],K}),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),B&&mH({particleCount:100,spread:70,origin:{y:.6}});const U=new Date().toISOString(),ue=(G,K)=>{const H=K.filter(Y=>Y.metrics.weight===G.weight&&Y.metrics.reps===G.reps&&Y.metrics.sets===G.sets);if(H.length>=4){const Y=H.slice(-4),te=Y.every(Ie=>Ie.completed),Ne=Y.every(Ie=>!Ie.completed);if(te||Ne){let Ie=!1;H.length===4?Ie=!0:H.length>4&&(Ie=H[H.length-5].completed!==Y[0].completed),Ie&&setTimeout(()=>{Q({open:!0,type:te?"increase":"decrease"})},1e3)}}};try{const G=e?`/api/routines/${u==null?void 0:u.id}/exercises/${L}/status`:`/api/demo/routines/${u==null?void 0:u.id}/exercises/${L}/status`,K=e?{credentials:"include"}:{},H=await fetch(G,{method:"PATCH",headers:{"Content-Type":"application/json","Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"},body:JSON.stringify({success:B,date:U}),...K});if(!H.ok)throw new Error("Failed to update exercise status");const Y=await H.json();e?(d(te=>te.map(Ne=>Ne.id===(u==null?void 0:u.id)?{...Ne,exercises:Ne.exercises.map(Ie=>Ie.id===L?{...Ie,...Y,date:U,completedSets:Y.completedSets||[],success:Y.success||!1}:Ie)}:Ne)),p(te=>{if(!te)return null;const Ne={...te,exercises:te.exercises.map(et=>et.id===L?{...et,...Y,date:U,completedSets:Y.completedSets||[],success:Y.success||!1}:et)},Ie=Ne.exercises.find(et=>et.id===L);return Ie&&ue(Ie,Ie.completedSets),Ne})):d(te=>{const Ne=te.map(et=>{if(et.id===(u==null?void 0:u.id)){const Nt=et.exercises.map(St=>{if(St.id===L){const Rs=[...St.completedSets,{completed:B,timestamp:U,metrics:{weight:St.weight,reps:St.reps,sets:St.sets}}],js={...St,completedSets:Rs,success:Rs.every(qn=>qn.completed),date:U};return ue(js,Rs),js}return St});return{...et,exercises:Nt,updatedAt:U}}return et}),Ie=Ne.find(et=>et.id===(u==null?void 0:u.id));return Ie&&p(Ie),Ne})}catch(G){console.error("Error updating exercise status:",G)}},se=async()=>{if(!g||!u)return;console.log("đŸ—‘ī¸ Deleting log for",e?"authenticated":"demo","user"),_(!0);const L=`${g.exerciseId}-${g.setIndex}`;I(B=>new Set(B).add(L)),setTimeout(async()=>{var B,U;try{let ue=!1;if(e){console.log("🔐 AUTHENTICATED USER: Processing deletion...");const G=u.exercises.find(H=>H.id===g.exerciseId);if(!G||!G.completedSets||g.setIndex>=G.completedSets.length){console.error("❌ AUTHENTICATED: Exercise or set not found",{exerciseFound:!!G,completedSetsLength:((B=G==null?void 0:G.completedSets)==null?void 0:B.length)||0,requestedIndex:g.setIndex});return}const K=G.completedSets[g.setIndex];if(console.log("đŸŽ¯ AUTHENTICATED: Target set to remove:",{setToRemove:K,hasCompletionId:!!K.completionId,completionId:K.completionId}),K&&K.completionId)try{console.log("📤 AUTHENTICATED: Sending delete request for completion:",K.completionId);const H=await fetch(`/api/v2/completions/${K.completionId}`,{method:"DELETE",credentials:"include",headers:{"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(H.ok){const Y=await H.json();console.log("✅ AUTHENTICATED: Server delete response:",Y),Y.verified?(ue=!0,console.log("✅ AUTHENTICATED: Backend verified deletion:",Y.deletedId)):(console.warn("âš ī¸ AUTHENTICATED: Backend did not verify deletion"),ue=!1)}else console.error("Server deletion failed, status:",H.status),ue=!1}catch(H){console.error("Error deleting completion from server:",H),ue=!1}else console.log("â„šī¸ AUTHENTICATED: No server-side completion to delete (newly added log), proceeding with client-side deletion"),ue=!0;if(ue){const H=G.completedSets.filter((te,Ne)=>Ne!==g.setIndex),Y={...G,completedSets:H,success:H.length>0?(U=H[H.length-1])==null?void 0:U.completed:!1,date:H.length>0?H[H.length-1].timestamp:G.date};d(te=>te.map(Ne=>Ne.id===u.id?{...Ne,exercises:Ne.exercises.map(Ie=>Ie.id===G.id?Y:Ie),updatedAt:new Date().toISOString()}:Ne)),p(te=>te?{...te,exercises:te.exercises.map(Ne=>Ne.id===G.id?Y:Ne),updatedAt:new Date().toISOString()}:null),console.log("✅ AUTHENTICATED: UI state updated - deleted log removed")}}else{console.log("đŸ‘Ĩ DEMO USER: Processing client-side deletion...");const G=u.exercises.find(K=>K.id===g.exerciseId);if(G&&G.completedSets&&g.setIndex{const H=K.map(te=>{if(te.id!==u.id)return te;const Ne=te.exercises.map(Ie=>{if(Ie.id===g.exerciseId){const et=Ie.completedSets.length,Nt=[...Ie.completedSets];Nt.splice(g.setIndex,1);const St=Nt.length;console.log("📊 DEMO: Client-side set removal:",{beforeCount:et,afterCount:St,removedIndex:g.setIndex,success:et>St});const Rs=Nt.length>0?Nt[Nt.length-1].timestamp:new Date().toISOString();return{...Ie,completedSets:Nt,success:Nt.length>0&&Nt.every(js=>js.completed),date:Rs}}return Ie});return{...te,exercises:Ne,updatedAt:new Date().toISOString()}}),Y=H.find(te=>te.id===u.id);return Y&&(p(Y),console.log("✅ DEMO: Client-side state updated successfully")),H})}}catch(ue){console.error("❌ FATAL ERROR in handleRemoveSet:",ue),_(!1)}I(ue=>{const G=new Set(ue);return G.delete(L),G}),w(null),_(!1),console.log("🏁 REMOVE SET: Process completed")},300)},J=async L=>{k(L),setTimeout(async()=>{y({index:-1,exercise:null});try{const B=e?`/api/routines/${u==null?void 0:u.id}/exercises/${L}`:`/api/demo/routines/${u==null?void 0:u.id}/exercises/${L}`,ue=await fetch(B,{method:"DELETE",...e?{credentials:"include"}:{}});if(!ue.ok)throw new Error("Failed to delete exercise");const G=await ue.json();p(G),d(K=>K.map(H=>H.id===G.id?G:H))}catch(B){console.error("Error deleting exercise:",B)}finally{k(null)}},300)},Ce=L=>{ae({open:!0,type:"exercise",id:L.id,name:L.name})},_e=()=>{z.type==="routine"?Eo(z.id):J(z.id)},dt=async L=>{try{if(e){const B=await fetch("/api/routines",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:L}),credentials:"include"});if(!B.ok)throw new Error("Failed to add routine");const U=await B.json();d([...c,U]),p(U)}else{const B=await fetch("/api/demo/routines",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:L})});if(!B.ok)throw new Error("Failed to add demo routine");const U=await B.json();d([...c,U]),p(U)}}catch(B){console.error("Error adding routine:",B)}},gt=async(L,B)=>{try{if(e){const U=await fetch(`/api/routines/${L}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:B}),credentials:"include"});if(!U.ok)throw new Error("Failed to edit routine");const ue=await U.json();d(G=>G.map(K=>K.id===L?ue:K)),p(ue)}else d(U=>U.map(G=>{if(G.id===L){const K={...G,name:B,updatedAt:new Date().toISOString()};return(u==null?void 0:u.id)===L&&p(K),K}return G}))}catch(U){console.error("Error editing routine:",U)}},cr=async L=>{if(!L.exercises||L.exercises.length===0)return L;try{if(e){const B=await Promise.all(L.exercises.map(async U=>{var ue,G;try{const K=await fetch(`/api/v2/exercises/${U.id}/variations`,{credentials:"include",headers:{"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(K.ok){const H=await K.json();if(H&&H.length>0){const Y=H.find(Ne=>Ne.isCurrent)||H[0],te=((ue=Y==null?void 0:Y.completions)==null?void 0:ue.map(Ne=>({completed:Ne.success,timestamp:Ne.completedAt||new Date().toISOString(),completionId:Ne.id,metrics:{weight:Y.targetWeight,reps:Y.targetReps,sets:Y.targetSets}})))||[];return{...U,weight:(Y==null?void 0:Y.targetWeight)||U.weight,reps:(Y==null?void 0:Y.targetReps)||U.reps,sets:(Y==null?void 0:Y.targetSets)||U.sets,completedSets:te,success:te.length>0?(G=te[te.length-1])==null?void 0:G.completed:!1}}}}catch(K){console.error(`Error fetching variations for exercise ${U.id}:`,K)}return U}));return{...L,exercises:B}}return L}catch(B){return console.error("Error loading complete routine data:",B),L}},Eo=async L=>{try{const B=e?`/api/routines/${L}`:`/api/demo/routines/${L}`,ue=await fetch(B,{method:"DELETE",...e?{credentials:"include"}:{}});if(!ue.ok)throw new Error("Failed to delete routine");const G=await ue.json();if(d(G),G.length>0){const K=G[0],H=await cr(K),Y=G.map(te=>te.id===K.id?H:te);d(Y),p(H)}else p(null)}catch(B){console.error("Error deleting routine:",B)}},Ai=L=>{ae({open:!0,type:"routine",id:L.id,name:L.name})},Kn=(L,B)=>{const U=(L==null?void 0:L.filter(K=>K.metrics.weight===B.weight&&K.metrics.reps===B.reps&&K.metrics.sets===B.sets))||[];if(U.length===0)return null;const ue=U.length-1,G=U[ue];return f.jsx("div",{className:"mt-2 cursor-pointer hover:opacity-70 transition-opacity",onClick:()=>w({exerciseId:B.id,setIndex:ue,isSuccess:G.completed}),title:"Click to delete most recent completion",children:f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("div",{className:"flex gap-0.5",children:U.map((K,H)=>f.jsx("div",{className:`${l} transition-all duration-300 ${K.completed?"bg-green-400":"bg-red-400"} ${A.has(`${B.id}-${ue}`)&&H===ue?"log-fade-out":""} ${H===ue&&!A.has(`${B.id}-${ue}`)?"animate-pulse-square":""}`},H))}),P1(B)&&f.jsxs("div",{className:`flex items-center gap-1 ${a.date} text-gray-400`,children:[f.jsx(nf,{className:"h-3 w-3"}),f.jsx("span",{children:P1(B).split(" @ ")[0]})]})]})})},sl=async L=>{if(!L.destination||!(u!=null&&u.exercises))return;const B=L.source.index,U=L.destination.index,ue=[...c],G=u;try{const K=Array.from(u.exercises),[H]=K.splice(B,1);K.splice(U,0,H);const Y=K.map((Nt,St)=>({...Nt,order:St})),te={...u,exercises:Y,updatedAt:new Date().toISOString()};d(Nt=>Nt.map(St=>St.id===te.id?te:St)),p(te);const Ne=e?`/api/routines/${u.id}/exercises/reorder`:`/api/demo/routines/${u.id}/exercises/reorder`,Ie=await fetch(Ne,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({exercises:Y}),credentials:"include"});if(!Ie.ok)throw new Error("Failed to save exercise order");const et=await Ie.json();d(Nt=>Nt.map(St=>St.id===et.id?et:St)),p(et)}catch(K){console.error("Error saving exercise order:",K),d(ue),p(G)}};return f.jsx(e5,{onDragEnd:sl,children:f.jsx(m.Suspense,{fallback:f.jsx(N1,{}),children:f.jsx("div",{className:"w-full pb-24 px-4",children:i?f.jsx(N1,{}):f.jsxs(f.Fragment,{children:[!e&&(u==null?void 0:u.exercises)&&u.exercises.length>0&&f.jsx(hH,{children:f.jsx(UC.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(un,{href:"/register",children:f.jsx(KI,{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(wF,{className:"h-8 w-8 text-black"}),f.jsx(qI,{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:u&&f.jsxs(f.Fragment,{children:[f.jsx(G7,{routines:c}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsxs(WR,{children:[f.jsx(HR,{asChild:!0,children:f.jsxs(je,{variant:"outline",className:"flex-1 justify-between",children:[u.name,f.jsx(nx,{className:"ml-2 h-4 w-4"})]})}),f.jsx(_w,{className:"w-[var(--radix-dropdown-menu-trigger-width)]",children:c.map(L=>f.jsxs(Yo,{className:"flex items-center justify-between pr-2",onClick:()=>p(L),children:[f.jsx("span",{children:L.name}),f.jsx(je,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 ml-2",onClick:B=>{B.stopPropagation(),v({open:!0,mode:"edit"}),p(L)},children:f.jsx(iv,{className:"h-3 w-3"})})]},L.id))})]}),f.jsxs(je,{onClick:()=>v({open:!0,mode:"create"}),className:"flex items-center gap-2 whitespace-nowrap",children:[f.jsx(aa,{className:"h-4 w-4"}),"Add routine"]})]}),f.jsx($D,{droppableId:`exercises-${u.id}`,children:L=>{var B;return f.jsxs("div",{...L.droppableProps,ref:L.innerRef,className:"space-y-6",children:[((B=u.exercises)==null?void 0:B.length)>0?u.exercises.map((U,ue)=>f.jsx(L5,{draggableId:U.id.toString(),index:ue,children:(G,K)=>{var H,Y;return f.jsxs(UC.div,{ref:G.innerRef,...G.draggableProps,className:`transition-all duration-300 ${D===U.id?"exercise-fade-out":""}`,children:[f.jsx("div",{className:`border rounded-lg bg-white ${K.isDragging?"shadow-lg":""}`,children:f.jsxs("div",{className:"flex",children:[f.jsxs("div",{className:"flex-1 p-4 space-y-2",children:[f.jsx("h3",{className:`${a.exerciseName} font-bold truncate cursor-pointer hover:text-primary transition-colors`,onClick:()=>W({open:!0,exerciseId:U.id,currentName:U.name}),children:U.name}),f.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[f.jsxs("p",{className:`${a.exerciseMetrics} text-gray-600 cursor-pointer hover:text-primary transition-colors`,onClick:()=>be({open:!0,exerciseId:U.id,currentMetrics:{weight:U.weight,reps:U.reps,sets:U.sets}}),children:[U.weight%1===0?Math.floor(U.weight):U.weight,"kg | ",U.reps," reps | ",U.sets," sets"]}),f.jsx(iv,{className:"h-3.5 w-3.5 text-gray-400 cursor-pointer hover:text-primary transition-colors",onClick:()=>be({open:!0,exerciseId:U.id,currentMetrics:{weight:U.weight,reps:U.reps,sets:U.sets}})})]}),f.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[Array.from({length:U.sets},(te,Ne)=>{var js;const Ie=Ne+1,et=((js=ge[U.id])==null?void 0:js.has(Ie))||!1,Nt=ge[U.id]||new Set;let St=null;for(let qn=1;qn<=U.sets;qn++)if(!Nt.has(qn)){St=qn;break}const Rs=!et&&Ie===St&&Nt.size>0;return f.jsx(je,{variant:"outline",size:"sm",className:`${a.setButton} ${a.buttonSize} transition-colors relative overflow-hidden rounded-full p-0 flex items-center justify-center border-2 font-semibold outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-0 active:outline-none touch-none select-none ${et?"set-button-tapped shadow-md":"set-button-untapped"} ${Rs?"animate-pulse-green":""} ${(Se==null?void 0:Se.exerciseId)===U.id&&(Se==null?void 0:Se.setNumber)===Ie?"animate-explode-shake":""}`,style:{WebkitTapHighlightColor:"transparent"},onClick:qn=>{qn.preventDefault(),j(U.id,Ie,U.sets),qn.currentTarget.blur()},children:et?f.jsx(bn,{className:"h-4 w-4 stroke-[3] text-white"}):Ie},Ie)}),(((H=ge[U.id])==null?void 0:H.size)||0)>0&&f.jsx(je,{variant:"outline",size:"sm",className:`${a.setButton} ${a.buttonHeight} bg-white text-green-600 rounded-full px-6 border-2 border-gray-300 font-semibold transition-colors outline-none focus:outline-none focus-visible:outline-none focus-visible:ring-0 active:outline-none touch-none select-none ${(((Y=ge[U.id])==null?void 0:Y.size)||0)===U.sets?"animate-pulse-finished":""}`,style:{WebkitTapHighlightColor:"transparent"},onClick:te=>{te.preventDefault(),F(U.id),te.currentTarget.blur()},children:"End"})]}),f.jsx("div",{className:"mt-3 cursor-pointer hover:bg-gray-50 rounded px-2 pt-2 transition-colors",onClick:()=>ye({open:!0,exerciseId:U.id,currentNote:U.notes||""}),children:f.jsxs("div",{className:"flex items-start gap-2",children:[f.jsx(cN,{className:"h-4 w-4 text-gray-400 mt-0.5 flex-shrink-0"}),U.notes&&typeof U.notes=="string"&&U.notes.trim()?f.jsx("p",{className:`${a.noteText} text-gray-400 line-clamp-2 break-words`,children:U.notes}):f.jsx("p",{className:`${a.noteText} text-gray-400 italic`,children:"Note to self"})]})})]}),f.jsx("div",{...G.dragHandleProps,className:"flex items-center px-2 border-l",children:f.jsx(hF,{className:"h-4 w-4 text-gray-400"})})]})}),f.jsx("div",{className:"pl-4",children:Kn(U.completedSets,U)})]})}},U.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(je,{onClick:()=>M(!0),className:"inline-flex items-center gap-2",children:[f.jsx(aa,{className:"h-4 w-4"}),"Add First Exercise"]})]}),L.placeholder]})}}),((As=u.exercises)==null?void 0:As.length)>0&&f.jsxs(je,{className:"w-full mb-8",onClick:()=>M(!0),children:[f.jsx(aa,{className:"h-4 w-4 mr-2"}),"Add Exercise"]})]})}),f.jsx(WK,{open:re,onOpenChange:M,onSubmit:N}),h.exercise&&f.jsx(i7,{open:h.index!==-1,onOpenChange:async L=>{if(!L){if(console.log("🔄 Edit dialog closing - refreshing data..."),e&&u){const B=await cr(u);p(B),d(U=>U.map(ue=>ue.id===u.id?B:ue)),console.log("✅ Refreshed routine data after edit dialog close")}else if(!e){const B=await fetch("/api/demo/routines");if(B.ok){const U=await B.json();console.log("✅ Refreshed demo routine data after edit dialog close");const ue=U.map(K=>{var H;return{...K,exercises:(H=K.exercises)==null?void 0:H.map(Y=>({...Y,date:Y.date||Y.updatedAt||K.updatedAt||new Date().toISOString(),notes:Y.notes||""}))}});d(ue);const G=ue.find(K=>K.id===(u==null?void 0:u.id));p(G||ue[0]||null)}}y({index:-1,exercise:null})}},exercise:h.exercise,onDelete:()=>Ce(h.exercise),onRefresh:async()=>{if(console.log("🔄 Refreshing after variant change..."),e&&u){const L=await cr(u);p(L),d(B=>B.map(U=>U.id===u.id?L:U)),console.log("✅ Refreshed routine data after variant change")}else if(!e){const L=await fetch("/api/demo/routines");if(L.ok){const B=await L.json();console.log("✅ Refreshed demo routine data after variant change");const U=B.map(G=>{var K;return{...G,exercises:(K=G.exercises)==null?void 0:K.map(H=>({...H,date:H.date||H.updatedAt||G.updatedAt||new Date().toISOString(),notes:H.notes||""}))}});d(U);const ue=U.find(G=>G.id===(u==null?void 0:u.id));p(ue||U[0]||null)}}}}),f.jsx(a7,{open:x.open,onOpenChange:L=>v({...x,open:L}),onSubmit:x.mode==="create"?dt:L=>gt(u.id,L),onDelete:x.mode==="edit"?()=>Ai(u):void 0,routine:x.mode==="edit"&&u||void 0,mode:x.mode,existingRoutines:c}),g&&f.jsx(s7,{open:!!g,onOpenChange:()=>w(null),onConfirm:se,isSuccess:g.isSuccess}),ee&&f.jsx(H7,{open:ee.open,onOpenChange:L=>Q(L?ee:null),type:ee.type,onEditExercise:()=>{const L=u==null?void 0:u.exercises.find(B=>B.completedSets.length>=4&&(ee.type==="increase"&&B.completedSets.slice(-4).every(U=>U.completed)||ee.type==="decrease"&&B.completedSets.slice(-4).every(U=>!U.completed)));if(L){const B=u==null?void 0:u.exercises.indexOf(L);B!==void 0&&B!==-1&&y({index:B,exercise:L})}}}),f.jsx(QI,{ref:n}),le&&f.jsx(l7,{open:le.open,onOpenChange:L=>ye(L?le:null),initialNote:le.currentNote,onSave:L=>rt(le.exerciseId,L)}),fe&&f.jsx(c7,{open:fe.open,onOpenChange:L=>W(L?fe:null),currentName:fe.currentName,onSave:L=>lt(fe.exerciseId,L)}),ie&&f.jsx(B7,{open:ie.open,onOpenChange:L=>be(L?ie:null),currentMetrics:ie.currentMetrics,routines:c.map(L=>({id:L.id,name:L.name})),currentRoutineId:u==null?void 0:u.id,onSave:L=>ct(ie.exerciseId,L),onDelete:()=>{const L=u==null?void 0:u.exercises.find(B=>B.id===ie.exerciseId);L&&Ce(L)}}),f.jsx(K7,{open:z.open,onOpenChange:L=>ae(B=>({...B,open:L})),onConfirm:_e,title:z.type==="routine"?"Drop this routine?":"Cut this exercise?",description:`This will delete "${z.name}" ${z.type==="routine"?"and all its exercises.":"and all its variations and workout logs."} This action can't be undone.`,confirmText:"Delete",cancelText:"Cancel"})]})})})})}const Kr=m.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:De("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Kr.displayName="Card";const xs=m.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:De("flex flex-col space-y-1.5 p-6",e),...t}));xs.displayName="CardHeader";const ws=m.forwardRef(({className:e,...t},r)=>f.jsx("h3",{ref:r,className:De("text-2xl font-semibold leading-none tracking-tight",e),...t}));ws.displayName="CardTitle";const Vc=m.forwardRef(({className:e,...t},r)=>f.jsx("p",{ref:r,className:De("text-sm text-muted-foreground",e),...t}));Vc.displayName="CardDescription";const yn=m.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:De("p-6 pt-0",e),...t}));yn.displayName="CardContent";const qf=m.forwardRef(({className:e,...t},r)=>f.jsx("div",{ref:r,className:De("flex items-center p-6 pt-0",e),...t}));qf.displayName="CardFooter";const Q7=tu("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 Zv({className:e,variant:t,...r}){return f.jsx("div",{className:De(Q7({variant:t}),e),...r})}function Y7(){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 Bm(){const e=[{icon:f.jsx(aN,{className:"h-6 w-6"}),title:"Simple Workout Logging",description:"Quick and intuitive workout tracking without the complexity"},{icon:f.jsx(uN,{className:"h-6 w-6"}),title:"Rest Timer",description:"Built-in timer to track breaks between sets"},{icon:f.jsx(ix,{className:"h-6 w-6"}),title:"Progress Tracking",description:"Monitor your improvement over time with clear workout history"},{icon:f.jsx(SF,{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(Zv,{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(un,{href:"/workout",children:f.jsxs(je,{size:"lg",className:"px-8 py-6 text-lg",children:["Try Now",f.jsx(Xh,{className:"ml-2 h-5 w-5"})]})}),f.jsx(un,{href:"/register",children:f.jsx(je,{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(Zv,{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(sF,{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(oN,{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(lN,{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(Kr,{className:"border-muted hover:border-primary/20 transition-colors bg-white",children:[f.jsx(xs,{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(ws,{className:"text-lg",children:r.title})]})}),f.jsx(yn,{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(sf,{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(bn,{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(Kr,{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(un,{href:"/workout",children:f.jsxs(je,{className:"w-full",children:["Start Your First Workout",f.jsx(Xh,{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(un,{href:"/workout",children:f.jsxs(je,{size:"lg",className:"px-8 py-6 text-lg",children:["Try Now",f.jsx(Xh,{className:"ml-2 h-5 w-5"})]})}),f.jsx(un,{href:"/register",children:f.jsx(je,{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(Y7,{})]})}const Z7=nh({email:_n().email("Please enter a valid email address"),password:_n().min(6,"Password must be at least 6 characters")});function D1({mode:e}){const{login:t,register:r}=gh(),{toast:n}=Xc(),[,i]=Zc(),[s,o]=m.useState(!1),a=eh({resolver:th(Z7),defaultValues:{email:"",password:""}}),l=async d=>{try{const h=await(e==="login"?t:r)(d);if(!h.ok)throw new Error(h.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(u){n({variant:"destructive",title:"Oops! That didn't go as planned! 😅",description:u.message})}},c=async()=>{const d=a.getValues("email");if(!d||!d.includes("@")){n({variant:"destructive",title:"Email required",description:"Please enter your email address"});return}o(!0);try{const u=await fetch("/api/magic-link/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:d})}),p=await u.json();if(!u.ok)throw new Error(p.message||"Failed to send magic link");n({title:"Magic link sent! ✨",description:"Check your email for the login link"})}catch(u){n({variant:"destructive",title:"Failed to send link",description:u.message})}finally{o(!1)}};return f.jsx("div",{className:"flex items-center justify-center px-4 pt-8",children:f.jsxs(Kr,{className:"w-full max-w-md",children:[f.jsxs(xs,{children:[f.jsx(ws,{children:e==="login"?"Welcome Back! đŸ’Ē":"Let's go! 🚀"}),f.jsx(Vc,{children:e==="login"?"Track your workouts and see your progress":"Create an account to start tracking your fitness journey"})]}),f.jsxs(yn,{children:[f.jsx(ih,{...a,children:f.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[f.jsx(Ln,{control:a.control,name:"email",render:({field:d})=>f.jsxs(hn,{children:[f.jsx(mn,{children:"Email"}),f.jsx(gn,{children:f.jsx(Qt,{placeholder:"john@example.com",type:"email",autoComplete:"email",autoFocus:!0,...d})}),f.jsx(vn,{})]})}),f.jsx(Ln,{control:a.control,name:"password",render:({field:d})=>f.jsxs(hn,{children:[f.jsx(mn,{children:"Password"}),f.jsx(gn,{children:f.jsx(Qt,{type:"password",placeholder:"â€ĸâ€ĸâ€ĸâ€ĸâ€ĸâ€ĸ",autoComplete:"current-password",...d})}),f.jsx(vn,{})]})}),f.jsxs(je,{type:"submit",className:"w-full",disabled:a.formState.isSubmitting,children:[a.formState.isSubmitting&&f.jsx(si,{className:"mr-2 h-4 w-4 animate-spin"}),e==="login"?"Login":"Sign Up"]})]})}),e==="login"&&f.jsxs("div",{className:"mt-4 relative",children:[f.jsx("div",{className:"absolute inset-0 flex items-center",children:f.jsx("span",{className:"w-full border-t"})}),f.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:f.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or"})})]}),e==="login"&&f.jsxs(je,{type:"button",variant:"outline",className:"w-full mt-4",disabled:s,onClick:c,children:[s?f.jsx(si,{className:"mr-2 h-4 w-4 animate-spin"}):f.jsx(PF,{className:"mr-2 h-4 w-4"}),"Email me a login link"]})]}),f.jsxs(qf,{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(un,{href:e==="login"?"/register":"/login",children:f.jsx(je,{variant:"link",className:"mt-1",type:"button",children:e==="login"?"Sign up now":"Login instead"})})]})]})})}function X7(){const{user:e,logout:t}=gh(),[,r]=Zc(),{toast:n}=Xc(),i=Qc(),[s,o]=de.useState(null);de.useEffect(()=>{e!=null&&e.isAdmin||r("/")},[e,r]);const{data:a,isLoading:l,error:c}=hP({queryKey:["/api/admin/users"],enabled:!!(e!=null&&e.isAdmin)}),d=ia({mutationFn:async h=>{const y=await fetch(`/api/admin/users/${h}`,{method:"DELETE",credentials:"include"});if(!y.ok)throw new Error(await y.text());return y.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})}}),u=ia({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=ia({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(si,{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(Kr,{className:"w-full max-w-md mx-4",children:f.jsxs(yn,{className:"pt-6",children:[f.jsxs("div",{className:"flex mb-4 gap-2",children:[f.jsx(EF,{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(je,{variant:"outline",onClick:()=>t(),className:"flex items-center gap-2",children:[f.jsx(mF,{className:"h-4 w-4"}),"Logout"]})]}),f.jsxs(Kr,{className:"mb-6",children:[f.jsx(xs,{children:f.jsxs(ws,{className:"flex items-center gap-2",children:[f.jsx(pF,{className:"h-5 w-5"}),"Demo Account Management"]})}),f.jsx(yn,{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(je,{onClick:()=>u.mutate(),disabled:u.isPending||p.isPending,className:"flex items-center gap-2",variant:"outline",children:u.isPending?f.jsxs(f.Fragment,{children:[f.jsx(si,{className:"h-4 w-4 animate-spin"}),"Generating..."]}):f.jsxs(f.Fragment,{children:[f.jsx(yF,{className:"h-4 w-4"}),"Generate Demo Data"]})}),f.jsx(je,{onClick:()=>p.mutate(),disabled:p.isPending||u.isPending,className:"flex items-center gap-2",variant:"destructive",children:p.isPending?f.jsxs(f.Fragment,{children:[f.jsx(si,{className:"h-4 w-4 animate-spin"}),"Deleting..."]}):f.jsxs(f.Fragment,{children:[f.jsx(wc,{className:"h-4 w-4"}),"Clear All Completions"]})})]})]})})]}),f.jsxs(Kr,{children:[f.jsx(xs,{children:f.jsx(ws,{children:"User Management"})}),f.jsx(yn,{children:f.jsx("div",{className:"space-y-6",children:a==null?void 0:a.map(h=>f.jsx(Kr,{className:"border-l-4 border-l-blue-500",children:f.jsxs(yn,{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(oN,{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(je,{variant:"destructive",size:"sm",onClick:()=>o(h),children:[f.jsx(TF,{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(iF,{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(sf,{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(ix,{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(lN,{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(nf,{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(Xw,{open:!!s,onOpenChange:()=>o(null),children:f.jsxs(oh,{children:[f.jsxs(ah,{children:[f.jsx(ch,{children:"Are you sure?"}),f.jsxs(uh,{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(lh,{children:[f.jsx(fh,{children:"Cancel"}),f.jsx(dh,{onClick:()=>s&&d.mutate(s.id),className:"bg-red-600 hover:bg-red-700",children:d.isPending?f.jsx(si,{className:"h-4 w-4 animate-spin"}):"Delete"})]})]})})]}):null}function J7(){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(Kr,{className:"w-[280px] flex-shrink-0 snap-center",children:f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsxs(xs,{children:[f.jsxs("div",{className:"flex justify-between items-start",children:[f.jsxs("div",{children:[f.jsx(ws,{className:"text-2xl",children:"Free"}),f.jsx(Vc,{children:"Perfect for getting started"})]}),f.jsx(aN,{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(yn,{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(bn,{className:"h-4 w-4 text-primary"}),f.jsx("span",{children:r})]},n))})}),f.jsx(qf,{children:f.jsx(un,{href:"/register",children:f.jsx(je,{className:"w-full",children:"Get Started"})})})]})}),f.jsxs(Kr,{className:"w-[280px] flex-shrink-0 snap-center relative border-dashed",children:[f.jsx("div",{className:"absolute -top-1 -right-1",children:f.jsxs(Zv,{variant:"secondary",className:"font-semibold",children:[f.jsx(CF,{className:"h-3 w-3 mr-1"}),"Coming Soon"]})}),f.jsxs("div",{className:"h-full flex flex-col",children:[f.jsxs(xs,{children:[f.jsxs("div",{className:"flex justify-between items-start",children:[f.jsxs("div",{children:[f.jsx(ws,{className:"text-2xl",children:"Pro"}),f.jsx(Vc,{children:"For the dedicated athlete"})]}),f.jsx(oF,{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(yn,{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(bn,{className:"h-4 w-4 text-muted-foreground"}),f.jsx("span",{className:"text-muted-foreground",children:r})]},n))})}),f.jsx(qf,{children:f.jsx(je,{className:"w-full",variant:"outline",disabled:!0,children:"Coming Soon"})})]})]})]})})]})}function eq(){const[,e]=Zc(),t=Qc(),[r,n]=m.useState("loading"),[i,s]=m.useState("");return m.useEffect(()=>{(async()=>{try{const l=new URLSearchParams(window.location.search).get("token");if(!l){n("error"),s("No verification token found");return}const c=await fetch("/api/magic-link/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:l})});let d;try{d=await c.json()}catch{throw new Error("Server error - invalid response")}if(!c.ok)throw new Error(d.message||"Verification failed");n("success"),s("Successfully logged in!"),await t.invalidateQueries({queryKey:["user"]}),setTimeout(()=>{window.location.href="/workout"},1500)}catch(a){n("error"),s(a.message||"Failed to verify magic link")}})()},[e,t]),f.jsx("div",{className:"flex items-center justify-center min-h-screen px-4",children:f.jsxs(Kr,{className:"w-full max-w-md",children:[f.jsxs(xs,{children:[f.jsxs(ws,{children:[r==="loading"&&"Verifying...",r==="success"&&"Welcome! 🎉",r==="error"&&"Verification Failed"]}),f.jsxs(Vc,{children:[r==="loading"&&"Please wait while we log you in",r==="success"&&"Redirecting to your workouts...",r==="error"&&i]})]}),f.jsxs(yn,{className:"flex justify-center py-8",children:[r==="loading"&&f.jsx(si,{className:"h-12 w-12 animate-spin text-primary"}),r==="success"&&f.jsx(uF,{className:"h-12 w-12 text-green-500"}),r==="error"&&f.jsxs("div",{className:"flex flex-col items-center gap-4",children:[f.jsx(dF,{className:"h-12 w-12 text-destructive"}),f.jsx(je,{onClick:()=>e("/login"),children:"Go to Login"})]})]})]})})}function tq({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(SP,{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 rq({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(SP,{children:f.jsx("script",{type:"application/ld+json",children:JSON.stringify(r)})})}function nq(){const[e]=Zc(),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,d=`${i}/${o.slice(0,l+1).join("/")}`;let u=a.charAt(0).toUpperCase()+a.slice(1);a==="workout"&&(u="Workout Tracker"),a==="login"&&(u="Login"),a==="register"&&(u="Sign Up"),a==="subscription"&&(u="Premium Features"),s.push({"@type":"ListItem",position:c,name:u,item:d})}),s})(e)};return f.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(r)}})}const YI=m.createContext({textSize:"normal",setTextSize:()=>{}}),ZI=()=>m.useContext(YI),k1="lift-easy-text-size",iq=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 sq(){const{user:e,isLoading:t,logout:r}=gh(),[n,i]=Zc(),[s,o]=m.useState(()=>localStorage.getItem(k1)||"normal"),a=u=>{o(u),localStorage.setItem(k1,u)};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(si,{className:"h-8 w-8 animate-spin text-border"})});const l=iq(n),c=n==="/"&&!e,d=c;return f.jsxs(YI.Provider,{value:{textSize:s,setTextSize:a},children:[f.jsx(tq,{...l}),f.jsx(rq,{pathname:n}),f.jsx(nq,{}),f.jsx("div",{className:"border-b",children:f.jsx("div",{className:`px-4 ${c?"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(un,{href:e?"/workout":"/",children:f.jsxs(je,{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.jsxs(WR,{children:[f.jsx(HR,{asChild:!0,children:f.jsx(je,{variant:"ghost",size:"icon",children:f.jsx(bF,{className:"h-5 w-5"})})}),f.jsxs(_w,{align:"end",className:"w-48",children:[f.jsx(GR,{children:"Text Size"}),f.jsxs(Yo,{onClick:()=>a("normal"),children:[f.jsx(bn,{className:`mr-2 h-4 w-4 ${s==="normal"?"opacity-100":"opacity-0"}`}),"Normal"]}),f.jsxs(Yo,{onClick:()=>a("large"),children:[f.jsx(bn,{className:`mr-2 h-4 w-4 ${s==="large"?"opacity-100":"opacity-0"}`}),"Large"]}),f.jsxs(Yo,{onClick:()=>a("extra-large"),children:[f.jsx(bn,{className:`mr-2 h-4 w-4 ${s==="extra-large"?"opacity-100":"opacity-0"}`}),"Extra Large"]}),f.jsx(KR,{}),f.jsx(Yo,{onClick:()=>r(),children:"Logout"})]})]}):f.jsxs(f.Fragment,{children:[f.jsx(un,{href:"/login",children:f.jsx(je,{variant:"ghost",children:"Login"})}),f.jsx(un,{href:"/register",children:f.jsx(je,{variant:"default",children:"Sign Up"})})]})})]})})}),d?f.jsxs(kb,{children:[f.jsx(tn,{path:"/",children:()=>e?f.jsx("div",{className:"min-h-screen bg-gray-50",children:f.jsx(sd,{})}):f.jsx(Bm,{})}),f.jsx(tn,{path:"/workout",children:()=>f.jsx("div",{className:"min-h-screen bg-gray-50",children:f.jsx(sd,{})})}),f.jsx(tn,{children:()=>f.jsx(Bm,{})})]}):f.jsxs(kb,{children:[f.jsx(tn,{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(sd,{})})}):f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx(Bm,{})})}),f.jsx(tn,{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(sd,{})})})}),f.jsx(tn,{path:"/login",children:()=>f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx(D1,{mode:"login"})})}),f.jsx(tn,{path:"/register",children:()=>f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx(D1,{mode:"register"})})}),f.jsx(tn,{path:"/subscription",children:()=>f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx(J7,{})})}),f.jsx(tn,{path:"/verify-magic-link",children:()=>f.jsx(eq,{})}),f.jsx(tn,{path:"/admin",children:()=>f.jsx("div",{className:"max-w-4xl mx-auto",children:f.jsx(X7,{})})}),f.jsx(tn,{children:()=>f.jsx("div",{className:"max-w-md mx-auto",children:f.jsx(oq,{})})})]})]})}function oq(){return f.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:f.jsx(Kr,{className:"w-full max-w-md mx-4",children:f.jsxs(yn,{className:"pt-6",children:[f.jsxs("div",{className:"flex mb-4 gap-2",children:[f.jsx(cF,{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."})]})})})}eP(document.getElementById("root")).render(f.jsx(m.StrictMode,{children:f.jsx(IP,{children:f.jsx(bP,{children:f.jsxs(G_,{client:oL,children:[f.jsx(sq,{}),f.jsx(cV,{})]})})})}))});export default aq();