(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))r(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).observe(document,{childList:!0,subtree:!0});function o(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function r(d){if(d.ep)return;d.ep=!0;const m=o(d);fetch(d.href,m)}})();function ch(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var uo={exports:{}},ei={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var km;function Cy(){if(km)return ei;km=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function o(r,d,m){var h=null;if(m!==void 0&&(h=""+m),d.key!==void 0&&(h=""+d.key),"key"in d){m={};for(var v in d)v!=="key"&&(m[v]=d[v])}else m=d;return d=m.ref,{$$typeof:i,type:r,key:h,ref:d!==void 0?d:null,props:m}}return ei.Fragment=u,ei.jsx=o,ei.jsxs=o,ei}var qm;function wy(){return qm||(qm=1,uo.exports=Cy()),uo.exports}var f=wy(),ro={exports:{}},ti={},oo={exports:{}},co={};/** * @license React * scheduler.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ym;function zy(){return Ym||(Ym=1,(function(i){function u(D,J){var ae=D.length;D.push(J);e:for(;0>>1,ue=D[Ee];if(0>>1;Ee<_;){var R=2*(Ee+1)-1,Z=D[R],F=R+1,ce=D[F];if(0>d(Z,ae))Fd(ce,Z)?(D[Ee]=ce,D[F]=ae,Ee=F):(D[Ee]=Z,D[R]=ae,Ee=R);else if(Fd(ce,ae))D[Ee]=ce,D[F]=ae,Ee=F;else break e}}return J}function d(D,J){var ae=D.sortIndex-J.sortIndex;return ae!==0?ae:D.id-J.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;i.unstable_now=function(){return m.now()}}else{var h=Date,v=h.now();i.unstable_now=function(){return h.now()-v}}var g=[],y=[],S=1,x=null,j=3,z=!1,B=!1,H=!1,Y=!1,U=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function K(D){for(var J=o(y);J!==null;){if(J.callback===null)r(y);else if(J.startTime<=D)r(y),J.sortIndex=J.expirationTime,u(g,J);else break;J=o(y)}}function P(D){if(H=!1,K(D),!B)if(o(g)!==null)B=!0,$||($=!0,ne());else{var J=o(y);J!==null&&Oe(P,J.startTime-D)}}var $=!1,k=-1,V=5,W=-1;function Q(){return Y?!0:!(i.unstable_now()-WD&&Q());){var Ee=x.callback;if(typeof Ee=="function"){x.callback=null,j=x.priorityLevel;var ue=Ee(x.expirationTime<=D);if(D=i.unstable_now(),typeof ue=="function"){x.callback=ue,K(D),J=!0;break t}x===o(g)&&r(g),K(D)}else r(g);x=o(g)}if(x!==null)J=!0;else{var _=o(y);_!==null&&Oe(P,_.startTime-D),J=!1}}break e}finally{x=null,j=ae,z=!1}J=void 0}}finally{J?ne():$=!1}}}var ne;if(typeof M=="function")ne=function(){M(ee)};else if(typeof MessageChannel<"u"){var ye=new MessageChannel,Te=ye.port2;ye.port1.onmessage=ee,ne=function(){Te.postMessage(null)}}else ne=function(){U(ee,0)};function Oe(D,J){k=U(function(){D(i.unstable_now())},J)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(D){D.callback=null},i.unstable_forceFrameRate=function(D){0>D||125Ee?(D.sortIndex=ae,u(y,D),o(g)===null&&D===o(y)&&(H?(q(k),k=-1):H=!0,Oe(P,ae-Ee))):(D.sortIndex=ue,u(g,D),B||z||(B=!0,$||($=!0,ne()))),D},i.unstable_shouldYield=Q,i.unstable_wrapCallback=function(D){var J=j;return function(){var ae=j;j=J;try{return D.apply(this,arguments)}finally{j=ae}}}})(co)),co}var Gm;function My(){return Gm||(Gm=1,oo.exports=zy()),oo.exports}var fo={exports:{}},oe={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Xm;function Oy(){if(Xm)return oe;Xm=1;var i=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),h=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),j=Symbol.iterator;function z(_){return _===null||typeof _!="object"?null:(_=j&&_[j]||_["@@iterator"],typeof _=="function"?_:null)}var B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},H=Object.assign,Y={};function U(_,R,Z){this.props=_,this.context=R,this.refs=Y,this.updater=Z||B}U.prototype.isReactComponent={},U.prototype.setState=function(_,R){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,R,"setState")},U.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function q(){}q.prototype=U.prototype;function M(_,R,Z){this.props=_,this.context=R,this.refs=Y,this.updater=Z||B}var K=M.prototype=new q;K.constructor=M,H(K,U.prototype),K.isPureReactComponent=!0;var P=Array.isArray;function $(){}var k={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function W(_,R,Z){var F=Z.ref;return{$$typeof:i,type:_,key:R,ref:F!==void 0?F:null,props:Z}}function Q(_,R){return W(_.type,R,_.props)}function ee(_){return typeof _=="object"&&_!==null&&_.$$typeof===i}function ne(_){var R={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(Z){return R[Z]})}var ye=/\/+/g;function Te(_,R){return typeof _=="object"&&_!==null&&_.key!=null?ne(""+_.key):R.toString(36)}function Oe(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then($,$):(_.status="pending",_.then(function(R){_.status==="pending"&&(_.status="fulfilled",_.value=R)},function(R){_.status==="pending"&&(_.status="rejected",_.reason=R)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function D(_,R,Z,F,ce){var me=typeof _;(me==="undefined"||me==="boolean")&&(_=null);var Ne=!1;if(_===null)Ne=!0;else switch(me){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(_.$$typeof){case i:case u:Ne=!0;break;case S:return Ne=_._init,D(Ne(_._payload),R,Z,F,ce)}}if(Ne)return ce=ce(_),Ne=F===""?"."+Te(_,0):F,P(ce)?(Z="",Ne!=null&&(Z=Ne.replace(ye,"$&/")+"/"),D(ce,R,Z,"",function(un){return un})):ce!=null&&(ee(ce)&&(ce=Q(ce,Z+(ce.key==null||_&&_.key===ce.key?"":(""+ce.key).replace(ye,"$&/")+"/")+Ne)),R.push(ce)),1;Ne=0;var lt=F===""?".":F+":";if(P(_))for(var qe=0;qe<_.length;qe++)F=_[qe],me=lt+Te(F,qe),Ne+=D(F,R,Z,me,ce);else if(qe=z(_),typeof qe=="function")for(_=qe.call(_),qe=0;!(F=_.next()).done;)F=F.value,me=lt+Te(F,qe++),Ne+=D(F,R,Z,me,ce);else if(me==="object"){if(typeof _.then=="function")return D(Oe(_),R,Z,F,ce);throw R=String(_),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function J(_,R,Z){if(_==null)return _;var F=[],ce=0;return D(_,F,"","",function(me){return R.call(Z,me,ce++)}),F}function ae(_){if(_._status===-1){var R=_._result;R=R(),R.then(function(Z){(_._status===0||_._status===-1)&&(_._status=1,_._result=Z)},function(Z){(_._status===0||_._status===-1)&&(_._status=2,_._result=Z)}),_._status===-1&&(_._status=0,_._result=R)}if(_._status===1)return _._result.default;throw _._result}var Ee=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(R))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},ue={map:J,forEach:function(_,R,Z){J(_,function(){R.apply(this,arguments)},Z)},count:function(_){var R=0;return J(_,function(){R++}),R},toArray:function(_){return J(_,function(R){return R})||[]},only:function(_){if(!ee(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return oe.Activity=x,oe.Children=ue,oe.Component=U,oe.Fragment=o,oe.Profiler=d,oe.PureComponent=M,oe.StrictMode=r,oe.Suspense=g,oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,oe.__COMPILER_RUNTIME={__proto__:null,c:function(_){return k.H.useMemoCache(_)}},oe.cache=function(_){return function(){return _.apply(null,arguments)}},oe.cacheSignal=function(){return null},oe.cloneElement=function(_,R,Z){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var F=H({},_.props),ce=_.key;if(R!=null)for(me in R.key!==void 0&&(ce=""+R.key),R)!V.call(R,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&R.ref===void 0||(F[me]=R[me]);var me=arguments.length-2;if(me===1)F.children=Z;else if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(u){console.error(u)}}return i(),mo.exports=Ry(),mo.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Km;function By(){if(Km)return ti;Km=1;var i=My(),u=zo(),o=Dy();function r(e){var t="https://react.dev/errors/"+e;if(1ue||(e.current=Ee[ue],Ee[ue]=null,ue--)}function Z(e,t){ue++,Ee[ue]=e.current,e.current=t}var F=_(null),ce=_(null),me=_(null),Ne=_(null);function lt(e,t){switch(Z(me,t),Z(ce,e),Z(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?rm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=rm(t),e=om(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}R(F),Z(F,e)}function qe(){R(F),R(ce),R(me)}function un(e){e.memoizedState!==null&&Z(Ne,e);var t=F.current,a=om(t,e.type);t!==a&&(Z(ce,e),Z(F,a))}function di(e){ce.current===e&&(R(F),R(ce)),Ne.current===e&&(R(Ne),Fn._currentValue=ae)}var Xs,Lo;function Ja(e){if(Xs===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Xs=t&&t[1]||"",Lo=-1)":-1n||E[l]!==C[n]){var L=` `+E[l].replace(" at new "," at ");return e.displayName&&L.includes("")&&(L=L.replace("",e.displayName)),L}while(1<=l&&0<=n);break}}}finally{Qs=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ja(a):""}function i0(e,t){switch(e.tag){case 26:case 27:case 5:return Ja(e.type);case 16:return Ja("Lazy");case 13:return e.child!==t&&t!==null?Ja("Suspense Fallback"):Ja("Suspense");case 19:return Ja("SuspenseList");case 0:case 15:return Vs(e.type,!1);case 11:return Vs(e.type.render,!1);case 1:return Vs(e.type,!0);case 31:return Ja("Activity");default:return""}}function Ho(e){try{var t="",a=null;do t+=i0(e,a),a=e,e=e.return;while(e);return t}catch(l){return` Error generating stack: `+l.message+` `+l.stack}}var Zs=Object.prototype.hasOwnProperty,Ks=i.unstable_scheduleCallback,Js=i.unstable_cancelCallback,s0=i.unstable_shouldYield,u0=i.unstable_requestPaint,mt=i.unstable_now,r0=i.unstable_getCurrentPriorityLevel,ko=i.unstable_ImmediatePriority,qo=i.unstable_UserBlockingPriority,mi=i.unstable_NormalPriority,o0=i.unstable_LowPriority,Yo=i.unstable_IdlePriority,c0=i.log,f0=i.unstable_setDisableYieldValue,rn=null,ht=null;function xa(e){if(typeof c0=="function"&&f0(e),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(rn,e)}catch{}}var pt=Math.clz32?Math.clz32:h0,d0=Math.log,m0=Math.LN2;function h0(e){return e>>>=0,e===0?32:31-(d0(e)/m0|0)|0}var hi=256,pi=262144,yi=4194304;function $a(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function gi(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var n=0,s=e.suspendedLanes,c=e.pingedLanes;e=e.warmLanes;var p=l&134217727;return p!==0?(l=p&~s,l!==0?n=$a(l):(c&=p,c!==0?n=$a(c):a||(a=p&~e,a!==0&&(n=$a(a))))):(p=l&~s,p!==0?n=$a(p):c!==0?n=$a(c):a||(a=l&~e,a!==0&&(n=$a(a)))),n===0?0:t!==0&&t!==n&&(t&s)===0&&(s=n&-n,a=t&-t,s>=a||s===32&&(a&4194048)!==0)?t:n}function on(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function p0(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Go(){var e=yi;return yi<<=1,(yi&62914560)===0&&(yi=4194304),e}function $s(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function cn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function y0(e,t,a,l,n,s){var c=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var p=e.entanglements,E=e.expirationTimes,C=e.hiddenUpdates;for(a=c&~a;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var E0=/[\n"\\]/g;function jt(e){return e.replace(E0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function tu(e,t,a,l,n,s,c,p){e.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?e.type=c:e.removeAttribute("type"),t!=null?c==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Nt(t)):e.value!==""+Nt(t)&&(e.value=""+Nt(t)):c!=="submit"&&c!=="reset"||e.removeAttribute("value"),t!=null?au(e,c,Nt(t)):a!=null?au(e,c,Nt(a)):l!=null&&e.removeAttribute("value"),n==null&&s!=null&&(e.defaultChecked=!!s),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Nt(p):e.removeAttribute("name")}function tc(e,t,a,l,n,s,c,p){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||a!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){eu(e);return}a=a!=null?""+Nt(a):"",t=t!=null?""+Nt(t):a,p||t===e.value||(e.value=t),e.defaultValue=t}l=l??n,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=p?e.checked:!!l,e.defaultChecked=!!l,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.name=c),eu(e)}function au(e,t,a){t==="number"&&bi(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function El(e,t,a,l){if(e=e.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),uu=!1;if($t)try{var hn={};Object.defineProperty(hn,"passive",{get:function(){uu=!0}}),window.addEventListener("test",hn,hn),window.removeEventListener("test",hn,hn)}catch{uu=!1}var Sa=null,ru=null,Ei=null;function rc(){if(Ei)return Ei;var e,t=ru,a=t.length,l,n="value"in Sa?Sa.value:Sa.textContent,s=n.length;for(e=0;e=gn),hc=" ",pc=!1;function yc(e,t){switch(e){case"keyup":return F0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var jl=!1;function I0(e,t){switch(e){case"compositionend":return gc(t);case"keypress":return t.which!==32?null:(pc=!0,hc);case"textInput":return e=t.data,e===hc&&pc?null:e;default:return null}}function P0(e,t){if(jl)return e==="compositionend"||!mu&&yc(e,t)?(e=rc(),Ei=ru=Sa=null,jl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Nc(a)}}function Ac(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ac(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=bi(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=bi(e.document)}return t}function yu(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")}var up=$t&&"documentMode"in document&&11>=document.documentMode,Al=null,gu=null,Sn=null,vu=!1;function wc(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;vu||Al==null||Al!==bi(l)||(l=Al,"selectionStart"in l&&yu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Sn&&bn(Sn,l)||(Sn=l,l=ps(gu,"onSelect"),0>=c,n-=c,Gt=1<<32-pt(t)+n|a<de?(ve=te,te=null):ve=te.sibling;var Se=w(N,te,A[de],G);if(Se===null){te===null&&(te=ve);break}e&&te&&Se.alternate===null&&t(N,te),T=s(Se,T,de),be===null?le=Se:be.sibling=Se,be=Se,te=ve}if(de===A.length)return a(N,te),xe&&Wt(N,de),le;if(te===null){for(;dede?(ve=te,te=null):ve=te.sibling;var Xa=w(N,te,Se.value,G);if(Xa===null){te===null&&(te=ve);break}e&&te&&Xa.alternate===null&&t(N,te),T=s(Xa,T,de),be===null?le=Xa:be.sibling=Xa,be=Xa,te=ve}if(Se.done)return a(N,te),xe&&Wt(N,de),le;if(te===null){for(;!Se.done;de++,Se=A.next())Se=X(N,Se.value,G),Se!==null&&(T=s(Se,T,de),be===null?le=Se:be.sibling=Se,be=Se);return xe&&Wt(N,de),le}for(te=l(te);!Se.done;de++,Se=A.next())Se=O(te,N,de,Se.value,G),Se!==null&&(e&&Se.alternate!==null&&te.delete(Se.key===null?de:Se.key),T=s(Se,T,de),be===null?le=Se:be.sibling=Se,be=Se);return e&&te.forEach(function(Ay){return t(N,Ay)}),xe&&Wt(N,de),le}function ze(N,T,A,G){if(typeof A=="object"&&A!==null&&A.type===H&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case z:e:{for(var le=A.key;T!==null;){if(T.key===le){if(le=A.type,le===H){if(T.tag===7){a(N,T.sibling),G=n(T,A.props.children),G.return=N,N=G;break e}}else if(T.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===V&&sl(le)===T.type){a(N,T.sibling),G=n(T,A.props),An(G,A),G.return=N,N=G;break e}a(N,T);break}else t(N,T);T=T.sibling}A.type===H?(G=tl(A.props.children,N.mode,G,A.key),G.return=N,N=G):(G=Oi(A.type,A.key,A.props,null,N.mode,G),An(G,A),G.return=N,N=G)}return c(N);case B:e:{for(le=A.key;T!==null;){if(T.key===le)if(T.tag===4&&T.stateNode.containerInfo===A.containerInfo&&T.stateNode.implementation===A.implementation){a(N,T.sibling),G=n(T,A.children||[]),G.return=N,N=G;break e}else{a(N,T);break}else t(N,T);T=T.sibling}G=Nu(A,N.mode,G),G.return=N,N=G}return c(N);case V:return A=sl(A),ze(N,T,A,G)}if(Oe(A))return I(N,T,A,G);if(ne(A)){if(le=ne(A),typeof le!="function")throw Error(r(150));return A=le.call(A),se(N,T,A,G)}if(typeof A.then=="function")return ze(N,T,ki(A),G);if(A.$$typeof===M)return ze(N,T,Bi(N,A),G);qi(N,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,T!==null&&T.tag===6?(a(N,T.sibling),G=n(T,A),G.return=N,N=G):(a(N,T),G=Tu(A,N.mode,G),G.return=N,N=G),c(N)):a(N,T)}return function(N,T,A,G){try{jn=0;var le=ze(N,T,A,G);return Hl=null,le}catch(te){if(te===Ll||te===Li)throw te;var be=gt(29,te,null,N.mode);return be.lanes=G,be.return=N,be}finally{}}}var rl=Ic(!0),Pc=Ic(!1),ja=!1;function Lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Aa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ca(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(_e&2)!==0){var n=l.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),l.pending=t,t=Mi(e),Uc(e,null,a),t}return zi(e,l,t,a),Mi(e)}function Cn(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Qo(e,a)}}function ku(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var n=null,s=null;if(a=a.firstBaseUpdate,a!==null){do{var c={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};s===null?n=s=c:s=s.next=c,a=a.next}while(a!==null);s===null?n=s=t:s=s.next=t}else n=s=t;a={baseState:l.baseState,firstBaseUpdate:n,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var qu=!1;function wn(){if(qu){var e=Ul;if(e!==null)throw e}}function zn(e,t,a,l){qu=!1;var n=e.updateQueue;ja=!1;var s=n.firstBaseUpdate,c=n.lastBaseUpdate,p=n.shared.pending;if(p!==null){n.shared.pending=null;var E=p,C=E.next;E.next=null,c===null?s=C:c.next=C,c=E;var L=e.alternate;L!==null&&(L=L.updateQueue,p=L.lastBaseUpdate,p!==c&&(p===null?L.firstBaseUpdate=C:p.next=C,L.lastBaseUpdate=E))}if(s!==null){var X=n.baseState;c=0,L=C=E=null,p=s;do{var w=p.lane&-536870913,O=w!==p.lane;if(O?(ge&w)===w:(l&w)===w){w!==0&&w===Bl&&(qu=!0),L!==null&&(L=L.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var I=e,se=p;w=t;var ze=a;switch(se.tag){case 1:if(I=se.payload,typeof I=="function"){X=I.call(ze,X,w);break e}X=I;break e;case 3:I.flags=I.flags&-65537|128;case 0:if(I=se.payload,w=typeof I=="function"?I.call(ze,X,w):I,w==null)break e;X=x({},X,w);break e;case 2:ja=!0}}w=p.callback,w!==null&&(e.flags|=64,O&&(e.flags|=8192),O=n.callbacks,O===null?n.callbacks=[w]:O.push(w))}else O={lane:w,tag:p.tag,payload:p.payload,callback:p.callback,next:null},L===null?(C=L=O,E=X):L=L.next=O,c|=w;if(p=p.next,p===null){if(p=n.shared.pending,p===null)break;O=p,p=O.next,O.next=null,n.lastBaseUpdate=O,n.shared.pending=null}}while(!0);L===null&&(E=X),n.baseState=E,n.firstBaseUpdate=C,n.lastBaseUpdate=L,s===null&&(n.shared.lanes=0),Ra|=c,e.lanes=c,e.memoizedState=X}}function ef(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function tf(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;es?s:8;var c=D.T,p={};D.T=p,ir(e,!1,t,a);try{var E=n(),C=D.S;if(C!==null&&C(p,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var L=yp(E,l);Rn(e,t,L,Et(e))}else Rn(e,t,l,Et(e))}catch(X){Rn(e,t,{then:function(){},status:"rejected",reason:X},Et())}finally{J.p=s,c!==null&&p.types!==null&&(c.types=p.types),D.T=c}}function Ep(){}function lr(e,t,a,l){if(e.tag!==5)throw Error(r(476));var n=Df(e).queue;Rf(e,n,t,ae,a===null?Ep:function(){return Bf(e),a(l)})}function Df(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:ae},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ta,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Bf(e){var t=Df(e);t.next===null&&(t=e.alternate.memoizedState),Rn(e,t.next.queue,{},Et())}function nr(){return Ie(Fn)}function Uf(){return Ge().memoizedState}function Lf(){return Ge().memoizedState}function _p(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Et();e=Aa(a);var l=Ca(t,e,a);l!==null&&(dt(l,t,a),Cn(l,t,a)),t={cache:Ru()},e.payload=t;return}t=t.return}}function Tp(e,t,a){var l=Et();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Fi(e)?kf(t,a):(a=Eu(e,t,a,l),a!==null&&(dt(a,e,l),qf(a,t,l)))}function Hf(e,t,a){var l=Et();Rn(e,t,a,l)}function Rn(e,t,a,l){var n={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Fi(e))kf(t,n);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var c=t.lastRenderedState,p=s(c,a);if(n.hasEagerState=!0,n.eagerState=p,yt(p,c))return zi(e,t,n,0),Me===null&&wi(),!1}catch{}finally{}if(a=Eu(e,t,n,l),a!==null)return dt(a,e,l),qf(a,t,l),!0}return!1}function ir(e,t,a,l){if(l={lane:2,revertLane:Lr(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Fi(e)){if(t)throw Error(r(479))}else t=Eu(e,a,l,2),t!==null&&dt(t,e,2)}function Fi(e){var t=e.alternate;return e===fe||t!==null&&t===fe}function kf(e,t){ql=Xi=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function qf(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Qo(e,a)}}var Dn={readContext:Ie,use:Zi,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useLayoutEffect:He,useInsertionEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useSyncExternalStore:He,useId:He,useHostTransitionStatus:He,useFormState:He,useActionState:He,useOptimistic:He,useMemoCache:He,useCacheRefresh:He};Dn.useEffectEvent=He;var Yf={readContext:Ie,use:Zi,useCallback:function(e,t){return nt().memoizedState=[e,t===void 0?null:t],e},useContext:Ie,useEffect:Tf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Ji(4194308,4,Cf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Ji(4194308,4,e,t)},useInsertionEffect:function(e,t){Ji(4,2,e,t)},useMemo:function(e,t){var a=nt();t=t===void 0?null:t;var l=e();if(ol){xa(!0);try{e()}finally{xa(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=nt();if(a!==void 0){var n=a(t);if(ol){xa(!0);try{a(t)}finally{xa(!1)}}}else n=t;return l.memoizedState=l.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=Tp.bind(null,fe,e),[l.memoizedState,e]},useRef:function(e){var t=nt();return e={current:e},t.memoizedState=e},useState:function(e){e=Iu(e);var t=e.queue,a=Hf.bind(null,fe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:tr,useDeferredValue:function(e,t){var a=nt();return ar(a,e,t)},useTransition:function(){var e=Iu(!1);return e=Rf.bind(null,fe,e.queue,!0,!1),nt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=fe,n=nt();if(xe){if(a===void 0)throw Error(r(407));a=a()}else{if(a=t(),Me===null)throw Error(r(349));(ge&127)!==0||rf(l,t,a)}n.memoizedState=a;var s={value:a,getSnapshot:t};return n.queue=s,Tf(cf.bind(null,l,s,e),[e]),l.flags|=2048,Gl(9,{destroy:void 0},of.bind(null,l,s,a,t),null),a},useId:function(){var e=nt(),t=Me.identifierPrefix;if(xe){var a=Xt,l=Gt;a=(l&~(1<<32-pt(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Qi++,0<\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?c.createElement("select",{is:l.is}):c.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?c.createElement(n,{is:l.is}):c.createElement(n)}}s[Fe]=t,s[st]=l;e:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)s.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break e;for(;c.sibling===null;){if(c.return===null||c.return===t)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=s;e:switch(et(s,n,l),n){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&la(t)}}return De(t),xr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&la(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(e=me.current,Rl(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,n=We,n!==null)switch(n.tag){case 27:case 5:l=n.memoizedProps}e[Fe]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||sm(e.nodeValue,a)),e||Ta(t,!0)}else e=ys(e).createTextNode(l),e[Fe]=t,t.stateNode=e}return De(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=Rl(t),a!==null){if(e===null){if(!l)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Fe]=t}else al(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),e=!1}else a=wu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(xt(t),t):(xt(t),null);if((t.flags&128)!==0)throw Error(r(558))}return De(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=Rl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!n)throw Error(r(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));n[Fe]=t}else al(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),n=!1}else n=wu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(xt(t),t):(xt(t),null)}return xt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,n=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(n=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==n&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),ts(t,t.updateQueue),De(t),null);case 4:return qe(),e===null&&Yr(t.stateNode.containerInfo),De(t),null;case 10:return Pt(t.type),De(t),null;case 19:if(R(Ye),l=t.memoizedState,l===null)return De(t),null;if(n=(t.flags&128)!==0,s=l.rendering,s===null)if(n)Un(l,!1);else{if(ke!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Gi(e),s!==null){for(t.flags|=128,Un(l,!1),e=s.updateQueue,t.updateQueue=e,ts(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Lc(a,e),a=a.sibling;return Z(Ye,Ye.current&1|2),xe&&Wt(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&mt()>ss&&(t.flags|=128,n=!0,Un(l,!1),t.lanes=4194304)}else{if(!n)if(e=Gi(s),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,ts(t,e),Un(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!xe)return De(t),null}else 2*mt()-l.renderingStartTime>ss&&a!==536870912&&(t.flags|=128,n=!0,Un(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(e=l.last,e!==null?e.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=mt(),e.sibling=null,a=Ye.current,Z(Ye,n?a&1|2:a&1),xe&&Wt(t,l.treeForkCount),e):(De(t),null);case 22:case 23:return xt(t),Gu(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),a=t.updateQueue,a!==null&&ts(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&R(il),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Pt(Xe),De(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function wp(e,t){switch(Au(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pt(Xe),qe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return di(t),null;case 31:if(t.memoizedState!==null){if(xt(t),t.alternate===null)throw Error(r(340));al()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(xt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));al()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(Ye),null;case 4:return qe(),null;case 10:return Pt(t.type),null;case 22:case 23:return xt(t),Gu(),e!==null&&R(il),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Pt(Xe),null;case 25:return null;default:return null}}function fd(e,t){switch(Au(t),t.tag){case 3:Pt(Xe),qe();break;case 26:case 27:case 5:di(t);break;case 4:qe();break;case 31:t.memoizedState!==null&&xt(t);break;case 13:xt(t);break;case 19:R(Ye);break;case 10:Pt(t.type);break;case 22:case 23:xt(t),Gu(),e!==null&&R(il);break;case 24:Pt(Xe)}}function Ln(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var n=l.next;a=n;do{if((a.tag&e)===e){l=void 0;var s=a.create,c=a.inst;l=s(),c.destroy=l}a=a.next}while(a!==n)}}catch(p){Ae(t,t.return,p)}}function Ma(e,t,a){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var s=n.next;l=s;do{if((l.tag&e)===e){var c=l.inst,p=c.destroy;if(p!==void 0){c.destroy=void 0,n=t;var E=a,C=p;try{C()}catch(L){Ae(n,E,L)}}}l=l.next}while(l!==s)}}catch(L){Ae(t,t.return,L)}}function dd(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{tf(t,a)}catch(l){Ae(e,e.return,l)}}}function md(e,t,a){a.props=cl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Ae(e,t,l)}}function Hn(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(n){Ae(e,t,n)}}function Qt(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(n){Ae(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(n){Ae(e,t,n)}else a.current=null}function hd(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(n){Ae(e,e.return,n)}}function br(e,t,a){try{var l=e.stateNode;Wp(l,e.type,a,t),l[st]=t}catch(n){Ae(e,e.return,n)}}function pd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ha(e.type)||e.tag===4}function Sr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ha(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Er(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Jt));else if(l!==4&&(l===27&&Ha(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Er(e,t,a),e=e.sibling;e!==null;)Er(e,t,a),e=e.sibling}function as(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&Ha(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(as(e,t,a),e=e.sibling;e!==null;)as(e,t,a),e=e.sibling}function yd(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);et(t,l,a),t[Fe]=e,t[st]=a}catch(s){Ae(e,e.return,s)}}var na=!1,Ze=!1,_r=!1,gd=typeof WeakSet=="function"?WeakSet:Set,$e=null;function zp(e,t){if(e=e.containerInfo,Qr=_s,e=Cc(e),yu(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var n=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{a.nodeType,s.nodeType}catch{a=null;break e}var c=0,p=-1,E=-1,C=0,L=0,X=e,w=null;t:for(;;){for(var O;X!==a||n!==0&&X.nodeType!==3||(p=c+n),X!==s||l!==0&&X.nodeType!==3||(E=c+l),X.nodeType===3&&(c+=X.nodeValue.length),(O=X.firstChild)!==null;)w=X,X=O;for(;;){if(X===e)break t;if(w===a&&++C===n&&(p=c),w===s&&++L===l&&(E=c),(O=X.nextSibling)!==null)break;X=w,w=X.parentNode}X=O}a=p===-1||E===-1?null:{start:p,end:E}}else a=null}a=a||{start:0,end:0}}else a=null;for(Vr={focusedElem:e,selectionRange:a},_s=!1,$e=t;$e!==null;)if(t=$e,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,$e=e;else for(;$e!==null;){switch(t=$e,s=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a title"))),et(s,l,a),s[Fe]=e,Je(s),l=s;break e;case"link":var c=_m("link","href",n).get(l+(a.href||""));if(c){for(var p=0;pze&&(c=ze,ze=se,se=c);var N=jc(p,se),T=jc(p,ze);if(N&&T&&(O.rangeCount!==1||O.anchorNode!==N.node||O.anchorOffset!==N.offset||O.focusNode!==T.node||O.focusOffset!==T.offset)){var A=X.createRange();A.setStart(N.node,N.offset),O.removeAllRanges(),se>ze?(O.addRange(A),O.extend(T.node,T.offset)):(A.setEnd(T.node,T.offset),O.addRange(A))}}}}for(X=[],O=p;O=O.parentNode;)O.nodeType===1&&X.push({element:O,left:O.scrollLeft,top:O.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;pa?32:a,D.T=null,a=zr,zr=null;var s=Ba,c=oa;if(Ke=0,Kl=Ba=null,oa=0,(_e&6)!==0)throw Error(r(331));var p=_e;if(_e|=4,Cd(s.current),Nd(s,s.current,c,a),_e=p,Qn(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(rn,s)}catch{}return!0}finally{J.p=n,D.T=l,Zd(e,t)}}function Jd(e,t,a){t=Ct(a,t),t=or(e.stateNode,t,2),e=Ca(e,t,2),e!==null&&(cn(e,2),Vt(e))}function Ae(e,t,a){if(e.tag===3)Jd(e,e,a);else for(;t!==null;){if(t.tag===3){Jd(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Da===null||!Da.has(l))){e=Ct(a,e),a=$f(2),l=Ca(t,a,2),l!==null&&(Ff(a,l,t,e),cn(l,2),Vt(l));break}}t=t.return}}function Dr(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Rp;var n=new Set;l.set(t,n)}else n=l.get(t),n===void 0&&(n=new Set,l.set(t,n));n.has(a)||(jr=!0,n.add(a),e=Hp.bind(null,e,t,a),t.then(e,e))}function Hp(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Me===e&&(ge&a)===a&&(ke===4||ke===3&&(ge&62914560)===ge&&300>mt()-is?(_e&2)===0&&Jl(e,0):Ar|=a,Zl===ge&&(Zl=0)),Vt(e)}function $d(e,t){t===0&&(t=Go()),e=el(e,t),e!==null&&(cn(e,t),Vt(e))}function kp(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),$d(e,a)}function qp(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,n=e.memoizedState;n!==null&&(a=n.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(t),$d(e,a)}function Yp(e,t){return Ks(e,t)}var ds=null,Fl=null,Br=!1,ms=!1,Ur=!1,La=0;function Vt(e){e!==Fl&&e.next===null&&(Fl===null?ds=Fl=e:Fl=Fl.next=e),ms=!0,Br||(Br=!0,Xp())}function Qn(e,t){if(!Ur&&ms){Ur=!0;do for(var a=!1,l=ds;l!==null;){if(e!==0){var n=l.pendingLanes;if(n===0)var s=0;else{var c=l.suspendedLanes,p=l.pingedLanes;s=(1<<31-pt(42|e)+1)-1,s&=n&~(c&~p),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(a=!0,Pd(l,s))}else s=ge,s=gi(l,l===Me?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||on(l,s)||(a=!0,Pd(l,s));l=l.next}while(a);Ur=!1}}function Gp(){Fd()}function Fd(){ms=Br=!1;var e=0;La!==0&&Pp()&&(e=La);for(var t=mt(),a=null,l=ds;l!==null;){var n=l.next,s=Wd(l,t);s===0?(l.next=null,a===null?ds=n:a.next=n,n===null&&(Fl=a)):(a=l,(e!==0||(s&3)!==0)&&(ms=!0)),l=n}Ke!==0&&Ke!==5||Qn(e),La!==0&&(La=0)}function Wd(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,n=e.expirationTimes,s=e.pendingLanes&-62914561;0p)break;var L=E.transferSize,X=E.initiatorType;L&&um(X)&&(E=E.responseEnd,c+=L*(E"u"?null:document;function xm(e,t,a){var l=Wl;if(l&&typeof t=="string"&&t){var n=jt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof a=="string"&&(n+='[crossorigin="'+a+'"]'),vm.has(n)||(vm.add(n),e={rel:e,crossOrigin:a,href:t},l.querySelector(n)===null&&(t=l.createElement("link"),et(t,"link",e),Je(t),l.head.appendChild(t)))}}function ry(e){ca.D(e),xm("dns-prefetch",e,null)}function oy(e,t){ca.C(e,t),xm("preconnect",e,t)}function cy(e,t,a){ca.L(e,t,a);var l=Wl;if(l&&e&&t){var n='link[rel="preload"][as="'+jt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(n+='[imagesrcset="'+jt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(n+='[imagesizes="'+jt(a.imageSizes)+'"]')):n+='[href="'+jt(e)+'"]';var s=n;switch(t){case"style":s=Il(e);break;case"script":s=Pl(e)}Dt.has(s)||(e=x({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Dt.set(s,e),l.querySelector(n)!==null||t==="style"&&l.querySelector(Jn(s))||t==="script"&&l.querySelector($n(s))||(t=l.createElement("link"),et(t,"link",e),Je(t),l.head.appendChild(t)))}}function fy(e,t){ca.m(e,t);var a=Wl;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+jt(l)+'"][href="'+jt(e)+'"]',s=n;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Pl(e)}if(!Dt.has(s)&&(e=x({rel:"modulepreload",href:e},t),Dt.set(s,e),a.querySelector(n)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($n(s)))return}l=a.createElement("link"),et(l,"link",e),Je(l),a.head.appendChild(l)}}}function dy(e,t,a){ca.S(e,t,a);var l=Wl;if(l&&e){var n=bl(l).hoistableStyles,s=Il(e);t=t||"default";var c=n.get(s);if(!c){var p={loading:0,preload:null};if(c=l.querySelector(Jn(s)))p.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Dt.get(s))&&Ir(e,a);var E=c=l.createElement("link");Je(E),et(E,"link",e),E._p=new Promise(function(C,L){E.onload=C,E.onerror=L}),E.addEventListener("load",function(){p.loading|=1}),E.addEventListener("error",function(){p.loading|=2}),p.loading|=4,vs(c,t,l)}c={type:"stylesheet",instance:c,count:1,state:p},n.set(s,c)}}}function my(e,t){ca.X(e,t);var a=Wl;if(a&&e){var l=bl(a).hoistableScripts,n=Pl(e),s=l.get(n);s||(s=a.querySelector($n(n)),s||(e=x({src:e,async:!0},t),(t=Dt.get(n))&&Pr(e,t),s=a.createElement("script"),Je(s),et(s,"link",e),a.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(n,s))}}function hy(e,t){ca.M(e,t);var a=Wl;if(a&&e){var l=bl(a).hoistableScripts,n=Pl(e),s=l.get(n);s||(s=a.querySelector($n(n)),s||(e=x({src:e,async:!0,type:"module"},t),(t=Dt.get(n))&&Pr(e,t),s=a.createElement("script"),Je(s),et(s,"link",e),a.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(n,s))}}function bm(e,t,a,l){var n=(n=me.current)?gs(n):null;if(!n)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Il(a.href),a=bl(n).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Il(a.href);var s=bl(n).hoistableStyles,c=s.get(e);if(c||(n=n.ownerDocument||n,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,c),(s=n.querySelector(Jn(e)))&&!s._p&&(c.instance=s,c.state.loading=5),Dt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Dt.set(e,a),s||py(n,e,a,c.state))),t&&l===null)throw Error(r(528,""));return c}if(t&&l!==null)throw Error(r(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Pl(a),a=bl(n).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Il(e){return'href="'+jt(e)+'"'}function Jn(e){return'link[rel="stylesheet"]['+e+"]"}function Sm(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function py(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),et(t,"link",a),Je(t),e.head.appendChild(t))}function Pl(e){return'[src="'+jt(e)+'"]'}function $n(e){return"script[async]"+e}function Em(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+jt(a.href)+'"]');if(l)return t.instance=l,Je(l),l;var n=x({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Je(l),et(l,"style",n),vs(l,a.precedence,e),t.instance=l;case"stylesheet":n=Il(a.href);var s=e.querySelector(Jn(n));if(s)return t.state.loading|=4,t.instance=s,Je(s),s;l=Sm(a),(n=Dt.get(n))&&Ir(l,n),s=(e.ownerDocument||e).createElement("link"),Je(s);var c=s;return c._p=new Promise(function(p,E){c.onload=p,c.onerror=E}),et(s,"link",l),t.state.loading|=4,vs(s,a.precedence,e),t.instance=s;case"script":return s=Pl(a.src),(n=e.querySelector($n(s)))?(t.instance=n,Je(n),n):(l=a,(n=Dt.get(s))&&(l=x({},a),Pr(l,n)),e=e.ownerDocument||e,n=e.createElement("script"),Je(n),et(n,"link",l),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,vs(l,a.precedence,e));return t.instance}function vs(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=l.length?l[l.length-1]:null,s=n,c=0;c title"):null)}function yy(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Nm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function gy(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var n=Il(l.href),s=t.querySelector(Jn(n));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=bs.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=s,Je(s);return}s=t.ownerDocument||t,l=Sm(l),(n=Dt.get(n))&&Ir(l,n),s=s.createElement("link"),Je(s);var c=s;c._p=new Promise(function(p,E){c.onload=p,c.onerror=E}),et(s,"link",l),a.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=bs.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var eo=0;function vy(e,t){return e.stylesheets&&e.count===0&&Es(e,e.stylesheets),0eo?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(n)}}:null}function bs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Es(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ss=null;function Es(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ss=new Map,t.forEach(xy,e),Ss=null,bs.call(e))}function xy(e,t){if(!(t.state.loading&4)){var a=Ss.get(e);if(a)var l=a.get(null);else{a=new Map,Ss.set(e,a);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(u){console.error(u)}}return i(),ro.exports=By(),ro.exports}var Ly=Uy();const Hy=ch(Ly);var b=zo();const Be=ch(b),fh="/express/assets/no_image-DuvbomyT.png";function da(i){return Intl.NumberFormat("es-ES",{style:"currency",currency:"CLP",unitDisplay:"long"}).format(i)}const dh=b.createContext(void 0),ii=()=>{const i=b.useContext(dh);if(!i)throw new Error("useDialog debe ser usado dentro de un DialogProvider");return i},ky=({children:i})=>{var Q,ee,ne,ye,Te,Oe,D,J,ae,Ee;const[u,o]=b.useState(!1),[r,d]=b.useState({type:"confirm"}),[m,h]=b.useState(""),[v,g]=b.useState(!1),[y,S]=b.useState({}),[x,j]=b.useState(!1),[z,B]=b.useState({method:()=>{}}),H=b.useRef(()=>{}),Y=b.useRef(null),U=ue=>{const _=Math.min(window.innerWidth-32,400),R=500,Z=(window.innerHeight-R)/2,F=(window.innerWidth-_)/2;return{top:`${Z}px`,left:`${F}px`,width:`${_}px`,height:`${R}px`,opacity:1,borderRadius:"16px"}},q=b.useCallback((ue,_,R)=>{var Z;return d({type:"confirm",message:ue,icon:_,options:R}),g(((Z=R==null?void 0:R.checkboxOptions)==null?void 0:Z.defaultChecked)||!1),o(!0),new Promise(F=>{H.current=F})},[]),M=b.useCallback((ue,_,R)=>{var Z;return d({type:"prompt",message:ue,icon:_,options:R}),h((R==null?void 0:R.defaultValue)||""),g(((Z=R==null?void 0:R.checkboxOptions)==null?void 0:Z.defaultChecked)||!1),o(!0),setTimeout(()=>{var F;return(F=Y.current)==null?void 0:F.focus()},50),new Promise(F=>{H.current=F})},[]),K=b.useCallback((ue,_,R)=>(d({type:"choose",message:ue,icon:_,options:R}),o(!0),new Promise(Z=>{H.current=Z})),[]),P=b.useCallback((ue,_,R)=>(d({type:"product",options:{product:ue,originRect:R}}),R?(j(!0),S({position:"fixed",top:`${R.top}px`,left:`${R.left}px`,width:`${R.width}px`,height:`${R.height}px`,opacity:0,zIndex:50,filter:"blur(50px)",borderRadius:"12px",overflow:"hidden",transition:"all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1)"}),o(!0),B({method:()=>_(ue)}),setTimeout(()=>{S(Z=>({...Z,...U(),filter:"blur(0px)",opacity:1,height:"auto",minHeight:"400px"})),setTimeout(()=>j(!1),300)},10)):o(!0),new Promise(Z=>{H.current=Z})),[]),$=b.useCallback(()=>{z.method(),k()},[z]),k=b.useCallback((ue=null)=>{o(!1),H.current(ue),setTimeout(()=>S({}),300)},[z]),V=ue=>{var R,Z;ue.key==="Escape"&&k(!1);const _=((Z=(R=r.options)==null?void 0:R.checkboxOptions)==null?void 0:Z.required)&&!v;r.type==="prompt"&&ue.key==="Enter"&&!_&&k(m)},W=((ee=(Q=r.options)==null?void 0:Q.checkboxOptions)==null?void 0:ee.required)&&!v;return f.jsxs(dh.Provider,{value:{confirm:q,prompt:M,choose:K,showProduct:P},children:[i,u&&f.jsxs("div",{"aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center px-4",role:"dialog",children:[f.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm transition-opacity duration-300 animate-in fade-in",onClick:()=>k(null)}),r.type==="product"&&((ne=r.options)!=null&&ne.product)?f.jsxs("div",{style:y,className:"bg-[#201512] border border-white/10 shadow-2xl flex flex-col relative",children:[f.jsxs("div",{className:"h-48 w-full relative shrink-0",children:[f.jsx("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:`url("${r.options.product.image||fh}")`}}),f.jsx("button",{onClick:()=>k(),className:"absolute top-2 right-2 bg-black/50 hover:bg-black/70 text-white rounded-full p-1 transition-colors z-10",children:f.jsx("span",{className:"material-symbols-outlined text-xl",children:"close"})})]}),f.jsxs("div",{className:`p-6 flex flex-col flex-1 transition-opacity duration-300 delay-100 ${x?"opacity-0":"opacity-100"}`,children:[f.jsxs("div",{className:"flex justify-between items-start mb-2",children:[f.jsx("h2",{className:"text-2xl font-bold text-white font-display",children:r.options.product.name}),f.jsxs("span",{className:"text-xl font-bold text-[#a33f1e]",children:["$",da(r.options.product.price)]})]}),f.jsx("p",{className:"text-gray-300 text-sm leading-relaxed mb-6",children:r.options.product.description}),f.jsx("div",{className:"mt-auto",children:f.jsx("button",{onClick:()=>$(),className:"w-full bg-[#a33f1e] text-white font-bold py-3 rounded-xl hover:bg-[#8f3322] transition-all active:scale-95",children:"Agregar al Pedido"})})]})]}):f.jsxs("div",{className:`relative bg-[#201512] rounded-2xl border border-white/10 shadow-2xl w-full transform transition-all p-6 overflow-hidden animate-in fade-in zoom-in duration-200 ${r.type==="choose"&&((ye=r.options)==null?void 0:ye.style)==="block"?"max-w-md":"max-w-xs"}`,children:[f.jsx("div",{className:"flex justify-center mb-4",children:f.jsx("div",{className:"bg-[#a33f1e]/20 p-3 rounded-full",children:f.jsx("span",{className:"material-symbols-outlined text-[#a33f1e] text-3xl select-none",children:r.icon})})}),f.jsx("p",{className:"text-white text-lg font-bold text-center mb-2 font-display leading-tight",children:r.message}),r.type==="prompt"&&f.jsx("div",{className:"mb-6 mt-4",children:f.jsx("input",{ref:Y,type:((Te=r.options)==null?void 0:Te.inputType)||"text",value:m,onChange:ue=>h(ue.target.value),onKeyDown:V,placeholder:(Oe=r.options)==null?void 0:Oe.placeholder,className:"w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 text-white placeholder-white/30 focus:outline-none focus:border-[#a33f1e] transition-all"})}),((D=r.options)==null?void 0:D.checkboxOptions)&&f.jsxs("div",{className:"mt-4 flex items-start gap-3 p-3 rounded-xl cursor-pointer hover:bg-white/10 transition-colors",onClick:()=>g(!v),children:[f.jsx("div",{className:`mt-0.5 w-5 h-5 aspect-square rounded border flex items-center justify-center transition-all ${v?"bg-[#a33f1e] border-[#a33f1e]":"border-white/30"}`,children:v&&f.jsx("span",{className:"material-symbols-outlined text-white text-sm font-bold",children:"check"})}),f.jsx("span",{className:"text-sm text-gray-300 select-none leading-tight",children:r.options.checkboxOptions.label})]}),r.type==="choose"&&((J=r.options)==null?void 0:J.choices)&&f.jsx("div",{className:`mt-6 ${r.options.style==="block"?"grid grid-cols-2 gap-3":"flex flex-col space-y-2"}`,children:r.options.choices.map(ue=>{var _;return f.jsx("button",{onClick:()=>{o(!1),H.current(ue.value)},className:`group relative overflow-hidden rounded-xl border border-white/10 transition-all hover:border-[#a33f1e]/50 hover:bg-white/5 ${((_=r.options)==null?void 0:_.style)==="block"?"flex flex-col items-center p-4":"flex items-center w-full p-3"}`,children:f.jsx("span",{className:"text-white text-sm",children:ue.label})},ue.value)})}),f.jsxs("div",{className:`grid ${r.type==="choose"?"grid-cols-1 mt-6":"grid-cols-2 gap-3 mt-6"}`,children:[f.jsx("button",{onClick:()=>k(!1),className:"px-4 py-3 rounded-xl border border-white/20 text-white text-sm hover:bg-white/5",children:((ae=r.options)==null?void 0:ae.cancelText)||"Cancelar"}),r.type!=="choose"&&f.jsx("button",{disabled:W,onClick:()=>k(r.type==="prompt"?m:!0),className:`px-4 py-3 rounded-xl text-white text-sm transition-all ${W?"bg-gray-600 opacity-50 cursor-not-allowed":"bg-[#a33f1e] hover:bg-[#8f3322]"} `,children:((Ee=r.options)==null?void 0:Ee.confirmText)||(r.type==="prompt"?"Aceptar":"Sí")})]})]})]})]})},qy=({product:i,onAdd:u})=>{const o=ii(),r=m=>{const h=m.currentTarget.getBoundingClientRect();o.showProduct(i,u,h)},d=m=>{m.stopPropagation(),u(i)};return f.jsxs("div",{onClick:r,className:"group bg-[#2a201c] rounded-xl overflow-hidden border border-white/5 flex flex-col h-full shadow-md hover:border-white/10 transition-colors cursor-pointer",children:[f.jsxs("div",{className:"aspect-square w-full relative overflow-hidden bg-gray-800",children:[f.jsx("div",{className:"absolute inset-0 bg-cover bg-center transition-transform duration-500 group-hover:scale-110",style:{backgroundImage:`url("${i.image||fh}")`}}),i.badges&&i.badges.length>0&&f.jsx("div",{className:"absolute top-2 left-2 flex flex-col gap-1 z-10 pointer-events-none",children:i.badges.map((m,h)=>f.jsx("span",{className:`${m.color} text-white text-[10px] font-bold px-2 py-0.5 rounded uppercase tracking-wide shadow-sm w-fit`,children:m.text},`${m.text}-${h}`))})]}),f.jsxs("div",{className:"p-3 flex flex-col flex-1",children:[f.jsx("h3",{className:"text-white font-bold text-lg leading-tight mb-1 group-hover:text-[#a33f1e] transition-colors",children:i.name}),f.jsx("p",{className:"text-gray-400 text-xs line-clamp-2 mb-3 leading-relaxed",children:i.description}),f.jsxs("div",{className:"mt-auto flex items-center justify-between",children:[f.jsxs("span",{className:"text-white font-bold text-lg",children:["$",da(i.price)]}),f.jsx("button",{onClick:d,className:"size-8 rounded-lg bg-primary flex items-center justify-center text-white hover:bg-orange-600 active:bg-orange-700 transition-colors shadow-lg shadow-primary/20 z-20 relative",children:f.jsx("span",{className:"material-symbols-outlined text-lg",children:"add"})})]})]})]})};function Yy(i,u=500){const[o,r]=b.useState(i);return b.useEffect(()=>{const d=setTimeout(()=>{r(i)},u);return()=>{clearTimeout(d)}},[i,u]),o}function pa(i){return Array.isArray?Array.isArray(i):ph(i)==="[object Array]"}function Gy(i){if(typeof i=="string")return i;let u=i+"";return u=="0"&&1/i==-1/0?"-0":u}function Xy(i){return i==null?"":Gy(i)}function Zt(i){return typeof i=="string"}function mh(i){return typeof i=="number"}function Qy(i){return i===!0||i===!1||Vy(i)&&ph(i)=="[object Boolean]"}function hh(i){return typeof i=="object"}function Vy(i){return hh(i)&&i!==null}function _t(i){return i!=null}function ho(i){return!i.trim().length}function ph(i){return i==null?i===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(i)}const Zy="Incorrect 'index' type",Ky=i=>`Invalid value for key ${i}`,Jy=i=>`Pattern length exceeds max of ${i}.`,$y=i=>`Missing ${i} property in key`,Fy=i=>`Property 'weight' in key '${i}' must be a positive integer`,$m=Object.prototype.hasOwnProperty;class Wy{constructor(u){this._keys=[],this._keyMap={};let o=0;u.forEach(r=>{let d=yh(r);this._keys.push(d),this._keyMap[d.id]=d,o+=d.weight}),this._keys.forEach(r=>{r.weight/=o})}get(u){return this._keyMap[u]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function yh(i){let u=null,o=null,r=null,d=1,m=null;if(Zt(i)||pa(i))r=i,u=Fm(i),o=vo(i);else{if(!$m.call(i,"name"))throw new Error($y("name"));const h=i.name;if(r=h,$m.call(i,"weight")&&(d=i.weight,d<=0))throw new Error(Fy(h));u=Fm(h),o=vo(h),m=i.getFn}return{path:u,id:o,weight:d,src:r,getFn:m}}function Fm(i){return pa(i)?i:i.split(".")}function vo(i){return pa(i)?i.join("."):i}function Iy(i,u){let o=[],r=!1;const d=(m,h,v)=>{if(_t(m))if(!h[v])o.push(m);else{let g=h[v];const y=m[g];if(!_t(y))return;if(v===h.length-1&&(Zt(y)||mh(y)||Qy(y)))o.push(Xy(y));else if(pa(y)){r=!0;for(let S=0,x=y.length;Si.score===u.score?i.idx{this._keysMap[o.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Zt(this.docs[0])?this.docs.forEach((u,o)=>{this._addString(u,o)}):this.docs.forEach((u,o)=>{this._addObject(u,o)}),this.norm.clear())}add(u){const o=this.size();Zt(u)?this._addString(u,o):this._addObject(u,o)}removeAt(u){this.records.splice(u,1);for(let o=u,r=this.size();o{let h=d.getFn?d.getFn(u):this.getFn(u,d.path);if(_t(h)){if(pa(h)){let v=[];const g=[{nestedArrIndex:-1,value:h}];for(;g.length;){const{nestedArrIndex:y,value:S}=g.pop();if(_t(S))if(Zt(S)&&!ho(S)){let x={v:S,i:y,n:this.norm.get(S)};v.push(x)}else pa(S)&&S.forEach((x,j)=>{g.push({nestedArrIndex:j,value:x})})}r.$[m]=v}else if(Zt(h)&&!ho(h)){let v={v:h,n:this.norm.get(h)};r.$[m]=v}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function gh(i,u,{getFn:o=re.getFn,fieldNormWeight:r=re.fieldNormWeight}={}){const d=new Mo({getFn:o,fieldNormWeight:r});return d.setKeys(i.map(yh)),d.setSources(u),d.create(),d}function ig(i,{getFn:u=re.getFn,fieldNormWeight:o=re.fieldNormWeight}={}){const{keys:r,records:d}=i,m=new Mo({getFn:u,fieldNormWeight:o});return m.setKeys(r),m.setIndexRecords(d),m}function zs(i,{errors:u=0,currentLocation:o=0,expectedLocation:r=0,distance:d=re.distance,ignoreLocation:m=re.ignoreLocation}={}){const h=u/i.length;if(m)return h;const v=Math.abs(r-o);return d?h+v/d:v?1:h}function sg(i=[],u=re.minMatchCharLength){let o=[],r=-1,d=-1,m=0;for(let h=i.length;m=u&&o.push([r,d]),r=-1)}return i[m-1]&&m-r>=u&&o.push([r,m-1]),o}const ml=32;function ug(i,u,o,{location:r=re.location,distance:d=re.distance,threshold:m=re.threshold,findAllMatches:h=re.findAllMatches,minMatchCharLength:v=re.minMatchCharLength,includeMatches:g=re.includeMatches,ignoreLocation:y=re.ignoreLocation}={}){if(u.length>ml)throw new Error(Jy(ml));const S=u.length,x=i.length,j=Math.max(0,Math.min(r,x));let z=m,B=j;const H=v>1||g,Y=H?Array(x):[];let U;for(;(U=i.indexOf(u,B))>-1;){let k=zs(u,{currentLocation:U,expectedLocation:j,distance:d,ignoreLocation:y});if(z=Math.min(k,z),B=U+S,H){let V=0;for(;V=Q;Te-=1){let Oe=Te-1,D=o[i.charAt(Oe)];if(H&&(Y[Oe]=+!!D),ne[Te]=(ne[Te+1]<<1|1)&D,k&&(ne[Te]|=(q[Te+1]|q[Te])<<1|1|q[Te+1]),ne[Te]&P&&(M=zs(u,{errors:k,currentLocation:Oe,expectedLocation:j,distance:d,ignoreLocation:y}),M<=z)){if(z=M,B=Oe,B<=j)break;Q=Math.max(1,2*j-B)}}if(zs(u,{errors:k+1,currentLocation:j,expectedLocation:j,distance:d,ignoreLocation:y})>z)break;q=ne}const $={isMatch:B>=0,score:Math.max(.001,M)};if(H){const k=sg(Y,v);k.length?g&&($.indices=k):$.isMatch=!1}return $}function rg(i){let u={};for(let o=0,r=i.length;oi.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(i=>i);class vh{constructor(u,{location:o=re.location,threshold:r=re.threshold,distance:d=re.distance,includeMatches:m=re.includeMatches,findAllMatches:h=re.findAllMatches,minMatchCharLength:v=re.minMatchCharLength,isCaseSensitive:g=re.isCaseSensitive,ignoreDiacritics:y=re.ignoreDiacritics,ignoreLocation:S=re.ignoreLocation}={}){if(this.options={location:o,threshold:r,distance:d,includeMatches:m,findAllMatches:h,minMatchCharLength:v,isCaseSensitive:g,ignoreDiacritics:y,ignoreLocation:S},u=g?u:u.toLowerCase(),u=y?Bs(u):u,this.pattern=u,this.chunks=[],!this.pattern.length)return;const x=(z,B)=>{this.chunks.push({pattern:z,alphabet:rg(z),startIndex:B})},j=this.pattern.length;if(j>ml){let z=0;const B=j%ml,H=j-B;for(;z{const{isMatch:q,score:M,indices:K}=ug(u,H,Y,{location:m+U,distance:h,threshold:v,findAllMatches:g,minMatchCharLength:y,includeMatches:d,ignoreLocation:S});q&&(z=!0),j+=M,q&&K&&(x=[...x,...K])});let B={isMatch:z,score:z?j/this.chunks.length:1};return z&&d&&(B.indices=x),B}}class Va{constructor(u){this.pattern=u}static isMultiMatch(u){return Wm(u,this.multiRegex)}static isSingleMatch(u){return Wm(u,this.singleRegex)}search(){}}function Wm(i,u){const o=i.match(u);return o?o[1]:null}class og extends Va{constructor(u){super(u)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(u){const o=u===this.pattern;return{isMatch:o,score:o?0:1,indices:[0,this.pattern.length-1]}}}class cg extends Va{constructor(u){super(u)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(u){const r=u.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,u.length-1]}}}class fg extends Va{constructor(u){super(u)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(u){const o=u.startsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,this.pattern.length-1]}}}class dg extends Va{constructor(u){super(u)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(u){const o=!u.startsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,u.length-1]}}}class mg extends Va{constructor(u){super(u)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(u){const o=u.endsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[u.length-this.pattern.length,u.length-1]}}}class hg extends Va{constructor(u){super(u)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(u){const o=!u.endsWith(this.pattern);return{isMatch:o,score:o?0:1,indices:[0,u.length-1]}}}class xh extends Va{constructor(u,{location:o=re.location,threshold:r=re.threshold,distance:d=re.distance,includeMatches:m=re.includeMatches,findAllMatches:h=re.findAllMatches,minMatchCharLength:v=re.minMatchCharLength,isCaseSensitive:g=re.isCaseSensitive,ignoreDiacritics:y=re.ignoreDiacritics,ignoreLocation:S=re.ignoreLocation}={}){super(u),this._bitapSearch=new vh(u,{location:o,threshold:r,distance:d,includeMatches:m,findAllMatches:h,minMatchCharLength:v,isCaseSensitive:g,ignoreDiacritics:y,ignoreLocation:S})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(u){return this._bitapSearch.searchIn(u)}}class bh extends Va{constructor(u){super(u)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(u){let o=0,r;const d=[],m=this.pattern.length;for(;(r=u.indexOf(this.pattern,o))>-1;)o=r+m,d.push([r,o-1]);const h=!!d.length;return{isMatch:h,score:h?0:1,indices:d}}}const xo=[og,bh,fg,dg,hg,mg,cg,xh],Im=xo.length,pg=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,yg="|";function gg(i,u={}){return i.split(yg).map(o=>{let r=o.trim().split(pg).filter(m=>m&&!!m.trim()),d=[];for(let m=0,h=r.length;m!!(i[Us.AND]||i[Us.OR]),Sg=i=>!!i[Eo.PATH],Eg=i=>!pa(i)&&hh(i)&&!_o(i),Pm=i=>({[Us.AND]:Object.keys(i).map(u=>({[u]:i[u]}))});function Sh(i,u,{auto:o=!0}={}){const r=d=>{let m=Object.keys(d);const h=Sg(d);if(!h&&m.length>1&&!_o(d))return r(Pm(d));if(Eg(d)){const g=h?d[Eo.PATH]:m[0],y=h?d[Eo.PATTERN]:d[g];if(!Zt(y))throw new Error(Ky(g));const S={keyId:vo(g),pattern:y};return o&&(S.searcher=So(y,u)),S}let v={children:[],operator:m[0]};return m.forEach(g=>{const y=d[g];pa(y)&&y.forEach(S=>{v.children.push(r(S))})}),v};return _o(i)||(i=Pm(i)),r(i)}function _g(i,{ignoreFieldNorm:u=re.ignoreFieldNorm}){i.forEach(o=>{let r=1;o.matches.forEach(({key:d,norm:m,score:h})=>{const v=d?d.weight:null;r*=Math.pow(h===0&&v?Number.EPSILON:h,(v||1)*(u?1:m))}),o.score=r})}function Tg(i,u){const o=i.matches;u.matches=[],_t(o)&&o.forEach(r=>{if(!_t(r.indices)||!r.indices.length)return;const{indices:d,value:m}=r;let h={indices:d,value:m};r.key&&(h.key=r.key.src),r.idx>-1&&(h.refIndex=r.idx),u.matches.push(h)})}function Ng(i,u){u.score=i.score}function jg(i,u,{includeMatches:o=re.includeMatches,includeScore:r=re.includeScore}={}){const d=[];return o&&d.push(Tg),r&&d.push(Ng),i.map(m=>{const{idx:h}=m,v={item:u[h],refIndex:h};return d.length&&d.forEach(g=>{g(m,v)}),v})}class tn{constructor(u,o={},r){this.options={...re,...o},this.options.useExtendedSearch,this._keyStore=new Wy(this.options.keys),this.setCollection(u,r)}setCollection(u,o){if(this._docs=u,o&&!(o instanceof Mo))throw new Error(Zy);this._myIndex=o||gh(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(u){_t(u)&&(this._docs.push(u),this._myIndex.add(u))}remove(u=()=>!1){const o=[];for(let r=0,d=this._docs.length;r-1&&(g=g.slice(0,o)),jg(g,this._docs,{includeMatches:r,includeScore:d})}_searchStringList(u){const o=So(u,this.options),{records:r}=this._myIndex,d=[];return r.forEach(({v:m,i:h,n:v})=>{if(!_t(m))return;const{isMatch:g,score:y,indices:S}=o.searchIn(m);g&&d.push({item:m,idx:h,matches:[{score:y,value:m,norm:v,indices:S}]})}),d}_searchLogical(u){const o=Sh(u,this.options),r=(v,g,y)=>{if(!v.children){const{keyId:x,searcher:j}=v,z=this._findMatches({key:this._keyStore.get(x),value:this._myIndex.getValueForItemAtKeyId(g,x),searcher:j});return z&&z.length?[{idx:y,item:g,matches:z}]:[]}const S=[];for(let x=0,j=v.children.length;x{if(_t(v)){let y=r(o,v,g);y.length&&(m[g]||(m[g]={idx:g,item:v,matches:[]},h.push(m[g])),y.forEach(({matches:S})=>{m[g].matches.push(...S)}))}}),h}_searchObjectList(u){const o=So(u,this.options),{keys:r,records:d}=this._myIndex,m=[];return d.forEach(({$:h,i:v})=>{if(!_t(h))return;let g=[];r.forEach((y,S)=>{g.push(...this._findMatches({key:y,value:h[S],searcher:o}))}),g.length&&m.push({idx:v,item:h,matches:g})}),m}_findMatches({key:u,value:o,searcher:r}){if(!_t(o))return[];let d=[];if(pa(o))o.forEach(({v:m,i:h,n:v})=>{if(!_t(m))return;const{isMatch:g,score:y,indices:S}=r.searchIn(m);g&&d.push({score:y,key:u,value:m,idx:h,norm:v,indices:S})});else{const{v:m,n:h}=o,{isMatch:v,score:g,indices:y}=r.searchIn(m);v&&d.push({score:g,key:u,value:m,norm:h,indices:y})}return d}}tn.version="7.1.0";tn.createIndex=gh;tn.parseIndex=ig;tn.config=re;tn.parseQuery=Sh;bg(xg);const Ag=(i,u,o=.5)=>{const[r,d]=b.useState(""),m=b.useMemo(()=>new tn(i,{keys:u,threshold:o,ignoreLocation:!0,minMatchCharLength:2}),[i,u,o]),h=b.useMemo(()=>r?m.search(r).map(v=>v.item):i,[m,r,i]);return{query:r,setQuery:d,results:h}},Yt=window.location.hostname==="localhost"?"http://localhost:6001":"https://kleinexpress.store",Cg=[{id:"1",sender:"system",text:"Initiating connection...",timestamp:"18:04"}],Eh=i=>{localStorage.setItem("token",i)},Za=()=>localStorage.getItem("token"),wg=async(i,u)=>await(await fetch(`${Yt}/api/users/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i,pin:u})})).json(),an=async()=>(await fetch(`${Yt}/api/users/guest`,{method:"GET",headers:{"Content-Type":"application/json"}})).json(),zg=async i=>await(await fetch(`${Yt}/api/users/user`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}})).json(),Mg=async i=>{const u=i?Za():(await an()).data.token;return await(await fetch(`${Yt}/api/products?status=1`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`}})).json()},Og=async(i,u)=>{const o=u?Za():(await an()).data.token;return await(await fetch(`${Yt}/api/orders/send`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`},body:JSON.stringify(i)})).json()},_h=async(i,u)=>{const o=u?Za():(await an()).data.token;return await(await fetch(`${Yt}/api/products/table/${i}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}})).json()},Th=async(i,u,o)=>{const r=i?Za():(await an()).data.token;return await(await fetch(`${Yt}/api/orders/billing`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r}`},body:JSON.stringify({table:u,payment:o})})).json()},Rg=async(i,u)=>{const o=i?Za():(await an()).data.token,r=await fetch(`${Yt}/api/products/free-beer/${u}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}}),d=await r.json();return{success:r.status===200,message:d.message}},Dg=async i=>{const u=i?Za():(await an()).data.token,r=await(await fetch(`${Yt}/api/store/state`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`}})).json();return console.log("data",r),r.data.state},Nh=b.createContext(void 0),Bg=({children:i})=>{const[u,o]=b.useState(!1),[r,d]=b.useState(),[m,h]=b.useState(0),[v,g]=b.useState(""),y=b.useCallback((z,B)=>{B&&!B.token&&(B.token=Za()),o(z),d(B),h(B?B.reward_progress:0),g(B?B.token:"")},[]),S=b.useCallback(z=>{g(z)},[]),x=b.useCallback(z=>{h(z)},[]),j=b.useMemo(()=>({isLogged:u,user:r,token:v,setIsLoggedIn:y,promoPercent:m,setPromoPercent:x,setToken:S}),[u,r,v,y,m,x,S]);return f.jsx(Nh.Provider,{value:j,children:i})},Tt=()=>b.useContext(Nh);function Ug(i){return i.map(u=>{const o={...u};if(o.badges=[],o.type==="Cervezas"&&o.description){const m=/IBU\s*:?\s*(\d+(?:\.\d+)?)/i.exec(o.description);m&&o.badges.push({text:"IBU "+m[1],color:"bg-black/60 backdrop-blur"});const v=/(\d+(?:[\.,]\d+)?)\s*(?:º|grados)/i.exec(o.description);if(v){let g=v[1].replace(".",",");g.includes(",")||(g+=",0"),o.badges.push({text:`${g}º`,color:"bg-black/60 backdrop-blur"})}}return["Pizza Medianas","Pizzas Familiares","Sandwich de Autor"].includes(u.type)&&(o.description.toLowerCase().includes("veggie")||o.description.toLowerCase().includes("vegetarian")||o.description.toLowerCase().includes("vegan")||o.name.toLowerCase().includes("veggie")||o.name.toLowerCase().includes("vegetarian")||o.name.toLowerCase().includes("vegan"))&&o.badges.push({text:"VEGGIE",color:"bg-green-600"}),o})}const jh=b.createContext(void 0),Lg=({children:i})=>{const[u,o]=b.useState(!1),[r,d]=b.useState("Cargando..."),m=(h,v="Cargando...")=>{o(h),setTimeout(()=>{d(v)},h?0:2e3)};return f.jsxs(jh.Provider,{value:{isLoading:u,setIsLoading:m},children:[f.jsx("div",{children:f.jsx("div",{className:`fixed inset-0 z-50 flex items-center justify-center bg-background-dark/60 backdrop-blur-sm pointer-events-none transition-opacity duration-300 opacity-0 ${u?"opacity-100":"opacity-0"}`,children:f.jsxs("div",{className:"flex flex-col items-center justify-center w-full h-full",children:[f.jsxs("div",{className:"animate-spin relative not-first:animate-spin flex justify-center space-x-8 h-12 w-full max-w-xsrounded-xl",children:[f.jsx("div",{className:"h-2 w-2 rounded-full bg-white"}),f.jsx("div",{className:"h-2 w-2 rounded-full bg-white -translate-y-19"}),f.jsx("div",{className:"h-2 w-2 rounded-full bg-white translate-y-19"}),f.jsx("div",{className:"h-2 w-2 rounded-full bg-white absolute left-1/2 top-1/2 -translate-y-1/2"}),f.jsx("div",{className:"h-2 w-2 rounded-full bg-white"})]}),f.jsx("div",{className:"text-white text-center text-md font-display translate-y-25",children:r})]})})}),i]})},si=()=>b.useContext(jh),Ah=b.createContext(void 0),Hg=({children:i})=>{const[u,o]=b.useState([]),[r,d]=b.useState(void 0),m=b.useCallback((...y)=>{const S=u.filter(x=>y.some(j=>j.id===x.id));return S.forEach(x=>x.quantity=0),S.map(x=>{const j={...x};return j.quantity=y.filter(z=>z.id===x.id).reduce((z,B)=>z+B.quantity,0),j})},[u]),h=b.useCallback((y,S)=>{const x=u.map(j=>j.id===y?{...j,price:S}:j);o(x)},[u]),v=b.useCallback(y=>{const S=u.filter(x=>x.id!==y);o(S)},[u]),g=b.useMemo(()=>({products:u,setProducts:o,table:r,setTable:d,getItems:m,updateProduct:h,removeProduct:v}),[u,o,r,d,m,h,v]);return f.jsx(Ah.Provider,{value:g,children:i})},ln=()=>b.useContext(Ah),fa="Todos",kg=({onAddProduct:i})=>{const[u,o]=b.useState(""),[r,d]=b.useState([]),[m,h]=b.useState(fa),{products:v,setProducts:g}=ln(),{setQuery:y,results:S}=Ag(v,["name","description"],.4),x=Yy(u,500),{setIsLoading:j}=si(),{isLogged:z}=Tt(),B=b.useRef(null),H=U=>{m!==fa&&h(fa),o(U)},Y=b.useCallback(U=>{var q=B.current;q&&(console.log("animation"),q.animate([{filter:"blur(0px)"},{filter:"blur(10px)"},{filter:"blur(0px)"}],{duration:300,fill:"forwards"})),setTimeout(()=>{h(U)},300)},[B]);return b.useEffect(()=>{m!==fa&&h(fa);var U=B.current;U&&U.animate([{filter:"blur(0px)"},{filter:"blur(10px)"},{filter:"blur(0px)"}],{duration:150,fill:"forwards"}),setTimeout(()=>{y(x)},150)},[x]),b.useEffect(()=>{(async()=>{if(v.length>0)return;j(!0,"Cargando Productos...");const q=await Mg(z),M=q.data.products;if(q.success){const K=Ug(M);g(K);const P=M.reduce(($,k)=>($.includes(k.type)||$.push(k.type),$),[]);d(P),v.length>0&&setTimeout(()=>{j(!1)},1e3)}})()},[]),f.jsxs("section",{className:"flex-1 bg-background-dark overflow-y-auto relative flex flex-col z-10 h-full",children:[f.jsxs("div",{className:"sticky top-0 z-20 bg-background-dark/95 backdrop-blur-sm border-b border-white/5 px-4 py-4",children:[f.jsx("div",{className:"flex justify-between items-end mb-4",children:f.jsxs("div",{children:[f.jsx("h2",{className:"text-white text-2xl font-bold leading-tight",children:"Pide directo a tu mesa"}),f.jsx("p",{className:"text-gray-400 text-sm",children:"Cervezas locales de corte artesanal"})]})}),f.jsxs("div",{className:"relative mb-4 group",children:[f.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:f.jsx("span",{className:"material-symbols-outlined text-gray-500 group-focus-within:text-primary transition-colors",children:"search"})}),f.jsx("input",{className:"block w-full pl-10 pr-3 py-2.5 border border-white/10 rounded-xl leading-5 bg-[#2a201c] text-gray-100 placeholder-gray-500 focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary sm:text-sm transition-all shadow-sm",placeholder:"Busca lo que quieras...",type:"text",onChange:U=>H(U.target.value)})]}),f.jsxs("div",{className:"flex gap-3 overflow-x-auto scrollbar-hide pb-1",children:[f.jsx("button",{className:"px-5 py-2 rounded-full text-white text-sm font-medium whitespace-nowrap shadow-lg"+(m===fa?" bg-primary shadow-primary/20":" bg-[#2a201c] hover:bg-[#3a2c26]"),onClick:()=>Y(fa),children:fa}),r.map(U=>f.jsx("button",{className:"px-5 py-2 rounded-full bg-[#2a201c] text-gray-300 text-sm font-medium whitespace-nowrap border border-white/5"+(m===U?" bg-primary shadow-primary/20":" hover:bg-[#3a2c26]"),onClick:()=>Y(U),children:U},U))]})]}),f.jsx("div",{ref:B,id:"productGrid",className:"p-4 grid grid-cols-2 gap-4 pb-28",children:S?S.map(U=>{if(m===fa||U.type===m)return f.jsx(qy,{product:U,onAdd:i},U.id)}):"No se encontraron productos"})]})},eh=`${Yt}/api/chat`;class qg{constructor(){this.socket=null,this.messageHandler=null,this.errorHandler=null,this.closeHandler=null,this.mentionHandler=null}connect(u){this.socket&&this.socket.close();const r=`${Yt.replace(/^http/,"ws")}/api/chat/ws?token=${encodeURIComponent(u)}`;return this.socket=new WebSocket(r),this.socket.onopen=()=>{console.log("WebSocket conectado")},this.socket.onmessage=d=>{try{const m=JSON.parse(d.data);if(m.type==="ping"){this.send({type:"pong"});return}if(m.type==="mention"){this.mentionHandler&&this.mentionHandler(m.username);return}this.messageHandler&&this.messageHandler(m)}catch(m){console.error("Error al parsear mensaje del WS:",m)}},this.socket.onerror=d=>{console.error("WebSocket error:",d),this.errorHandler&&this.errorHandler(d)},this.socket.onclose=()=>{console.log("WebSocket desconectado"),this.closeHandler&&this.closeHandler()},!0}send(u){this.socket&&this.socket.readyState===WebSocket.OPEN?this.socket.send(JSON.stringify(u)):console.warn("No se pudo enviar el mensaje: WebSocket no conectado.")}join(u){this.send({type:"join",username:u})}sendMessage(u,o){this.send({type:"message",username:u,message:o})}sendAiMessage(u,o){this.send({type:"ai_message",username:u,message:o})}sendMention(u,o){this.send({type:"mention",username:o})}leave(u){this.send({type:"leave",username:u}),setTimeout(()=>{this.disconnect()},3e3)}disconnect(){this.socket&&(this.socket.close(),this.socket=null)}onMessage(u){this.messageHandler=u}onError(u){this.errorHandler=u}onClose(u){this.closeHandler=u}onMention(u){this.mentionHandler=u}async getConnectedUsers(u,o){var h;const r=new URL(`${eh}/users`);o&&r.searchParams.append("q",o);const d=await fetch(r.toString(),{headers:{Authorization:`Bearer ${u}`,"Content-Type":"application/json"}});if(!d.ok)throw new Error("Error fetching users");const m=await d.json();return((h=m.data)==null?void 0:h.users)||m.data||[]}async getOnlineCount(u){var d;const o=await fetch(`${eh}/onlines`,{headers:{Authorization:`Bearer ${u}`,"Content-Type":"application/json"}});if(!o.ok)throw new Error("Error fetching count");return((d=(await o.json()).data)==null?void 0:d.count)||0}async mention(u){this.send({type:"mention",username:u})}}const at=new qg;function Ch(i){var u,o,r="";if(typeof i=="string"||typeof i=="number")r+=i;else if(typeof i=="object")if(Array.isArray(i)){var d=i.length;for(u=0;u"u")return;let u=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",u.firstChild?u.insertBefore(o,u.firstChild):u.appendChild(o),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i))}Yg(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}} `);var ui=i=>typeof i=="number"&&!isNaN(i),pl=i=>typeof i=="string",ya=i=>typeof i=="function",Gg=i=>pl(i)||ui(i),To=i=>pl(i)||ya(i)?i:null,Xg=(i,u)=>i===!1||ui(i)&&i>0?i:u,No=i=>b.isValidElement(i)||pl(i)||ya(i)||ui(i);function Qg(i,u,o=300){let{scrollHeight:r,style:d}=i;requestAnimationFrame(()=>{d.minHeight="initial",d.height=r+"px",d.transition=`all ${o}ms`,requestAnimationFrame(()=>{d.height="0",d.padding="0",d.margin="0",setTimeout(u,o)})})}function Vg({enter:i,exit:u,appendPosition:o=!1,collapse:r=!0,collapseDuration:d=300}){return function({children:m,position:h,preventExitTransition:v,done:g,nodeRef:y,isIn:S,playToast:x}){let j=o?`${i}--${h}`:i,z=o?`${u}--${h}`:u,B=b.useRef(0);return b.useLayoutEffect(()=>{let H=y.current,Y=j.split(" "),U=q=>{q.target===y.current&&(x(),H.removeEventListener("animationend",U),H.removeEventListener("animationcancel",U),B.current===0&&q.type!=="animationcancel"&&H.classList.remove(...Y))};H.classList.add(...Y),H.addEventListener("animationend",U),H.addEventListener("animationcancel",U)},[]),b.useEffect(()=>{let H=y.current,Y=()=>{H.removeEventListener("animationend",Y),r?Qg(H,g,d):g()};S||(v?Y():(B.current=1,H.className+=` ${z}`,H.addEventListener("animationend",Y)))},[S]),Be.createElement(Be.Fragment,null,m)}}function th(i,u){return{content:wh(i.content,i.props),containerId:i.props.containerId,id:i.props.toastId,theme:i.props.theme,type:i.props.type,data:i.props.data||{},isLoading:i.props.isLoading,icon:i.props.icon,reason:i.removalReason,status:u}}function wh(i,u,o=!1){return b.isValidElement(i)&&!pl(i.type)?b.cloneElement(i,{closeToast:u.closeToast,toastProps:u,data:u.data,isPaused:o}):ya(i)?i({closeToast:u.closeToast,toastProps:u,data:u.data,isPaused:o}):i}function Zg({closeToast:i,theme:u,ariaLabel:o="close"}){return Be.createElement("button",{className:`Toastify__close-button Toastify__close-button--${u}`,type:"button",onClick:r=>{r.stopPropagation(),i(!0)},"aria-label":o},Be.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Be.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function Kg({delay:i,isRunning:u,closeToast:o,type:r="default",hide:d,className:m,controlledProgress:h,progress:v,rtl:g,isIn:y,theme:S}){let x=d||h&&v===0,j={animationDuration:`${i}ms`,animationPlayState:u?"running":"paused"};h&&(j.transform=`scaleX(${v})`);let z=hl("Toastify__progress-bar",h?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${S}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":g}),B=ya(m)?m({rtl:g,type:r,defaultClassName:z}):hl(z,m),H={[h&&v>=1?"onTransitionEnd":"onAnimationEnd"]:h&&v<1?null:()=>{y&&o()}};return Be.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":x},Be.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${S} Toastify__progress-bar--${r}`}),Be.createElement("div",{role:"progressbar","aria-hidden":x?"true":"false","aria-label":"notification timer",className:B,style:j,...H}))}var Jg=1,zh=()=>`${Jg++}`;function $g(i,u,o){let r=1,d=0,m=[],h=[],v=u,g=new Map,y=new Set,S=q=>(y.add(q),()=>y.delete(q)),x=()=>{h=Array.from(g.values()),y.forEach(q=>q())},j=({containerId:q,toastId:M,updateId:K})=>{let P=q?q!==i:i!==1,$=g.has(M)&&K==null;return P||$},z=(q,M)=>{g.forEach(K=>{var P;(M==null||M===K.props.toastId)&&((P=K.toggle)==null||P.call(K,q))})},B=q=>{var M,K;(K=(M=q.props)==null?void 0:M.onClose)==null||K.call(M,q.removalReason),q.isActive=!1},H=q=>{if(q==null)g.forEach(B);else{let M=g.get(q);M&&B(M)}x()},Y=()=>{d-=m.length,m=[]},U=q=>{var M,K;let{toastId:P,updateId:$}=q.props,k=$==null;q.staleId&&g.delete(q.staleId),q.isActive=!0,g.set(P,q),x(),o(th(q,k?"added":"updated")),k&&((K=(M=q.props).onOpen)==null||K.call(M))};return{id:i,props:v,observe:S,toggle:z,removeToast:H,toasts:g,clearQueue:Y,buildToast:(q,M)=>{if(j(M))return;let{toastId:K,updateId:P,data:$,staleId:k,delay:V}=M,W=P==null;W&&d++;let Q={...v,style:v.toastStyle,key:r++,...Object.fromEntries(Object.entries(M).filter(([ne,ye])=>ye!=null)),toastId:K,updateId:P,data:$,isIn:!1,className:To(M.className||v.toastClassName),progressClassName:To(M.progressClassName||v.progressClassName),autoClose:M.isLoading?!1:Xg(M.autoClose,v.autoClose),closeToast(ne){g.get(K).removalReason=ne,H(K)},deleteToast(){let ne=g.get(K);if(ne!=null){if(o(th(ne,"removed")),g.delete(K),d--,d<0&&(d=0),m.length>0){U(m.shift());return}x()}}};Q.closeButton=v.closeButton,M.closeButton===!1||No(M.closeButton)?Q.closeButton=M.closeButton:M.closeButton===!0&&(Q.closeButton=No(v.closeButton)?v.closeButton:!0);let ee={content:q,props:Q,staleId:k};v.limit&&v.limit>0&&d>v.limit&&W?m.push(ee):ui(V)?setTimeout(()=>{U(ee)},V):U(ee)},setProps(q){v=q},setToggle:(q,M)=>{let K=g.get(q);K&&(K.toggle=M)},isToastActive:q=>{var M;return(M=g.get(q))==null?void 0:M.isActive},getSnapshot:()=>h}}var it=new Map,li=[],jo=new Set,Fg=i=>jo.forEach(u=>u(i)),Mh=()=>it.size>0;function Wg(){li.forEach(i=>Rh(i.content,i.options)),li=[]}var Ig=(i,{containerId:u})=>{var o;return(o=it.get(u||1))==null?void 0:o.toasts.get(i)};function Oh(i,u){var o;if(u)return!!((o=it.get(u))!=null&&o.isToastActive(i));let r=!1;return it.forEach(d=>{d.isToastActive(i)&&(r=!0)}),r}function Pg(i){if(!Mh()){li=li.filter(u=>i!=null&&u.options.toastId!==i);return}if(i==null||Gg(i))it.forEach(u=>{u.removeToast(i)});else if(i&&("containerId"in i||"id"in i)){let u=it.get(i.containerId);u?u.removeToast(i.id):it.forEach(o=>{o.removeToast(i.id)})}}var ev=(i={})=>{it.forEach(u=>{u.props.limit&&(!i.containerId||u.id===i.containerId)&&u.clearQueue()})};function Rh(i,u){No(i)&&(Mh()||li.push({content:i,options:u}),it.forEach(o=>{o.buildToast(i,u)}))}function tv(i){var u;(u=it.get(i.containerId||1))==null||u.setToggle(i.id,i.fn)}function Dh(i,u){it.forEach(o=>{(u==null||!(u!=null&&u.containerId)||(u==null?void 0:u.containerId)===o.id)&&o.toggle(i,u==null?void 0:u.id)})}function av(i){let u=i.containerId||1;return{subscribe(o){let r=$g(u,i,Fg);it.set(u,r);let d=r.observe(o);return Wg(),()=>{d(),it.delete(u)}},setProps(o){var r;(r=it.get(u))==null||r.setProps(o)},getSnapshot(){var o;return(o=it.get(u))==null?void 0:o.getSnapshot()}}}function lv(i){return jo.add(i),()=>{jo.delete(i)}}function nv(i){return i&&(pl(i.toastId)||ui(i.toastId))?i.toastId:zh()}function ri(i,u){return Rh(i,u),u.toastId}function Hs(i,u){return{...u,type:u&&u.type||i,toastId:nv(u)}}function ks(i){return(u,o)=>ri(u,Hs(i,o))}function ie(i,u){return ri(i,Hs("default",u))}ie.loading=(i,u)=>ri(i,Hs("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...u}));function iv(i,{pending:u,error:o,success:r},d){let m;u&&(m=pl(u)?ie.loading(u,d):ie.loading(u.render,{...d,...u}));let h={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},v=(y,S,x)=>{if(S==null){ie.dismiss(m);return}let j={type:y,...h,...d,data:x},z=pl(S)?{render:S}:S;return m?ie.update(m,{...j,...z}):ie(z.render,{...j,...z}),x},g=ya(i)?i():i;return g.then(y=>v("success",r,y)).catch(y=>v("error",o,y)),g}ie.promise=iv;ie.success=ks("success");ie.info=ks("info");ie.error=ks("error");ie.warning=ks("warning");ie.warn=ie.warning;ie.dark=(i,u)=>ri(i,Hs("default",{theme:"dark",...u}));function sv(i){Pg(i)}ie.dismiss=sv;ie.clearWaitingQueue=ev;ie.isActive=Oh;ie.update=(i,u={})=>{let o=Ig(i,u);if(o){let{props:r,content:d}=o,m={delay:100,...r,...u,toastId:u.toastId||i,updateId:zh()};m.toastId!==i&&(m.staleId=i);let h=m.render||d;delete m.render,ri(h,m)}};ie.done=i=>{ie.update(i,{progress:1})};ie.onChange=lv;ie.play=i=>Dh(!0,i);ie.pause=i=>Dh(!1,i);function uv(i){var u;let{subscribe:o,getSnapshot:r,setProps:d}=b.useRef(av(i)).current;d(i);let m=(u=b.useSyncExternalStore(o,r,r))==null?void 0:u.slice();function h(v){if(!m)return[];let g=new Map;return i.newestOnTop&&m.reverse(),m.forEach(y=>{let{position:S}=y.props;g.has(S)||g.set(S,[]),g.get(S).push(y)}),Array.from(g,y=>v(y[0],y[1]))}return{getToastToRender:h,isToastActive:Oh,count:m==null?void 0:m.length}}function rv(i){let[u,o]=b.useState(!1),[r,d]=b.useState(!1),m=b.useRef(null),h=b.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:v,pauseOnHover:g,closeToast:y,onClick:S,closeOnClick:x}=i;tv({id:i.toastId,containerId:i.containerId,fn:o}),b.useEffect(()=>{if(i.pauseOnFocusLoss)return j(),()=>{z()}},[i.pauseOnFocusLoss]);function j(){document.hasFocus()||U(),window.addEventListener("focus",Y),window.addEventListener("blur",U)}function z(){window.removeEventListener("focus",Y),window.removeEventListener("blur",U)}function B(k){if(i.draggable===!0||i.draggable===k.pointerType){q();let V=m.current;h.canCloseOnClick=!0,h.canDrag=!0,V.style.transition="none",i.draggableDirection==="x"?(h.start=k.clientX,h.removalDistance=V.offsetWidth*(i.draggablePercent/100)):(h.start=k.clientY,h.removalDistance=V.offsetHeight*(i.draggablePercent===80?i.draggablePercent*1.5:i.draggablePercent)/100)}}function H(k){let{top:V,bottom:W,left:Q,right:ee}=m.current.getBoundingClientRect();k.nativeEvent.type!=="touchend"&&i.pauseOnHover&&k.clientX>=Q&&k.clientX<=ee&&k.clientY>=V&&k.clientY<=W?U():Y()}function Y(){o(!0)}function U(){o(!1)}function q(){h.didMove=!1,document.addEventListener("pointermove",K),document.addEventListener("pointerup",P)}function M(){document.removeEventListener("pointermove",K),document.removeEventListener("pointerup",P)}function K(k){let V=m.current;if(h.canDrag&&V){h.didMove=!0,u&&U(),i.draggableDirection==="x"?h.delta=k.clientX-h.start:h.delta=k.clientY-h.start,h.start!==k.clientX&&(h.canCloseOnClick=!1);let W=i.draggableDirection==="x"?`${h.delta}px, var(--y)`:`0, calc(${h.delta}px + var(--y))`;V.style.transform=`translate3d(${W},0)`,V.style.opacity=`${1-Math.abs(h.delta/h.removalDistance)}`}}function P(){M();let k=m.current;if(h.canDrag&&h.didMove&&k){if(h.canDrag=!1,Math.abs(h.delta)>h.removalDistance){d(!0),i.closeToast(!0),i.collapseAll();return}k.style.transition="transform 0.2s, opacity 0.2s",k.style.removeProperty("transform"),k.style.removeProperty("opacity")}}let $={onPointerDown:B,onPointerUp:H};return v&&g&&($.onMouseEnter=U,i.stacked||($.onMouseLeave=Y)),x&&($.onClick=k=>{S&&S(k),h.canCloseOnClick&&y(!0)}),{playToast:Y,pauseToast:U,isRunning:u,preventExitTransition:r,toastRef:m,eventHandlers:$}}var ov=typeof window<"u"?b.useLayoutEffect:b.useEffect,qs=({theme:i,type:u,isLoading:o,...r})=>Be.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:i==="colored"?"currentColor":`var(--toastify-icon-color-${u})`,...r});function cv(i){return Be.createElement(qs,{...i},Be.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function fv(i){return Be.createElement(qs,{...i},Be.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function dv(i){return Be.createElement(qs,{...i},Be.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function mv(i){return Be.createElement(qs,{...i},Be.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function hv(){return Be.createElement("div",{className:"Toastify__spinner"})}var Ao={info:fv,warning:cv,success:dv,error:mv,spinner:hv},pv=i=>i in Ao;function yv({theme:i,type:u,isLoading:o,icon:r}){let d=null,m={theme:i,type:u};return r===!1||(ya(r)?d=r({...m,isLoading:o}):b.isValidElement(r)?d=b.cloneElement(r,m):o?d=Ao.spinner():pv(u)&&(d=Ao[u](m))),d}var gv=i=>{let{isRunning:u,preventExitTransition:o,toastRef:r,eventHandlers:d,playToast:m}=rv(i),{closeButton:h,children:v,autoClose:g,onClick:y,type:S,hideProgressBar:x,closeToast:j,transition:z,position:B,className:H,style:Y,progressClassName:U,updateId:q,role:M,progress:K,rtl:P,toastId:$,deleteToast:k,isIn:V,isLoading:W,closeOnClick:Q,theme:ee,ariaLabel:ne}=i,ye=hl("Toastify__toast",`Toastify__toast-theme--${ee}`,`Toastify__toast--${S}`,{"Toastify__toast--rtl":P},{"Toastify__toast--close-on-click":Q}),Te=ya(H)?H({rtl:P,position:B,type:S,defaultClassName:ye}):hl(ye,H),Oe=yv(i),D=!!K||!g,J={closeToast:j,type:S,theme:ee},ae=null;return h===!1||(ya(h)?ae=h(J):b.isValidElement(h)?ae=b.cloneElement(h,J):ae=Zg(J)),Be.createElement(z,{isIn:V,done:k,position:B,preventExitTransition:o,nodeRef:r,playToast:m},Be.createElement("div",{id:$,tabIndex:0,onClick:y,"data-in":V,className:Te,...d,style:Y,ref:r,...V&&{role:M,"aria-label":ne}},Oe!=null&&Be.createElement("div",{className:hl("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!W})},Oe),wh(v,i,!u),ae,!i.customProgressBar&&Be.createElement(Kg,{...q&&!D?{key:`p-${q}`}:{},rtl:P,theme:ee,delay:g,isRunning:u,isIn:V,closeToast:j,hide:x,type:S,className:U,controlledProgress:D,progress:K||0})))},vv=(i,u=!1)=>({enter:`Toastify--animate Toastify__${i}-enter`,exit:`Toastify--animate Toastify__${i}-exit`,appendPosition:u}),xv=Vg(vv("bounce",!0)),bv={position:"top-right",transition:xv,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:i=>i.altKey&&i.code==="KeyT"};function Sv(i){let u={...bv,...i},o=i.stacked,[r,d]=b.useState(!0),m=b.useRef(null),{getToastToRender:h,isToastActive:v,count:g}=uv(u),{className:y,style:S,rtl:x,containerId:j,hotKeys:z}=u;function B(Y){let U=hl("Toastify__toast-container",`Toastify__toast-container--${Y}`,{"Toastify__toast-container--rtl":x});return ya(y)?y({position:Y,rtl:x,defaultClassName:U}):hl(U,To(y))}function H(){o&&(d(!0),ie.play())}return ov(()=>{var Y;if(o){let U=m.current.querySelectorAll('[data-in="true"]'),q=12,M=(Y=u.position)==null?void 0:Y.includes("top"),K=0,P=0;Array.from(U).reverse().forEach(($,k)=>{let V=$;V.classList.add("Toastify__toast--stacked"),k>0&&(V.dataset.collapsed=`${r}`),V.dataset.pos||(V.dataset.pos=M?"top":"bot");let W=K*(r?.2:1)+(r?0:q*k);V.style.setProperty("--y",`${M?W:W*-1}px`),V.style.setProperty("--g",`${q}`),V.style.setProperty("--s",`${1-(r?P:0)}`),K+=V.offsetHeight,P+=.025})}},[r,g,o]),b.useEffect(()=>{function Y(U){var q;let M=m.current;z(U)&&((q=M.querySelector('[tabIndex="0"]'))==null||q.focus(),d(!1),ie.pause()),U.key==="Escape"&&(document.activeElement===M||M!=null&&M.contains(document.activeElement))&&(d(!0),ie.play())}return document.addEventListener("keydown",Y),()=>{document.removeEventListener("keydown",Y)}},[z]),Be.createElement("section",{ref:m,className:"Toastify",id:j,onMouseEnter:()=>{o&&(d(!1),ie.pause())},onMouseLeave:H,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":u["aria-label"]},h((Y,U)=>{let q=U.length?{...S}:{...S,pointerEvents:"none"};return Be.createElement("div",{tabIndex:-1,className:B(Y),"data-stacked":o,style:q,key:`c-${Y}`},U.map(({content:M,props:K})=>Be.createElement(gv,{...K,stacked:o,collapseAll:H,isIn:v(K.toastId,K.containerId),key:`t-${K.key}`},M)))}))}const Bh=b.createContext(void 0),Ev=(i,u)=>`${i.name.split(" ")[0].toLowerCase()}_${u}`,_v=({children:i})=>{const[u,o]=b.useState([]),[r,d]=b.useState([]),[m,h]=b.useState(0),[v,g]=b.useState(!1),[y,S]=b.useState(null),[x,j]=b.useState(null),{isLogged:z,user:B,token:H}=Tt(),{table:Y}=ln();b.useEffect(()=>(at.onMessage(Q=>{o(ee=>[...ee,Q]),Q.type==="join"&&Q.username?(d(ee=>Array.from(new Set([...ee,Q.username]))),h(ee=>ee+1)):Q.type==="leave"&&Q.username&&(d(ee=>ee.filter(ne=>ne!==Q.username)),h(ee=>Math.max(0,ee-1)))}),at.onError(()=>{S("Error de conexión en el WebSocket."),g(!1)}),at.onClose(()=>{g(!1)}),at.onMention(Q=>{console.log("mencion",Q),Q===x&&ie.info("has sido mencionado en el chat",{position:"top-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,theme:"dark",toastId:`mention-${Date.now()}`})}),()=>{at.disconnect()}),[]);const U=b.useCallback(async()=>{try{const Q=await at.getConnectedUsers(H),ee=await at.getOnlineCount(H);d(Q),h(ee)}catch(Q){console.error("Error refreshing users",Q)}},[H]),q=b.useCallback(()=>{try{S(null),console.log(B);const Q=at.connect(H);if(!Q){S("Error de conexión en el WebSocket."),console.log("connect fail",Q),g(!1);return}const ee=Ev(B,Y);j(ee),console.log("connect",Q),g(Q),U(),setTimeout(()=>{at.join(ee)},500)}catch(Q){S(Q.message||"Error al conectar"),g(!1)}},[U,B]),M=b.useCallback(()=>{x&&v&&at.leave(x),console.log("Username",x),console.log("IsConnected",v),at.disconnect(),g(!1),o([]),j(null)},[x]),K=b.useCallback(Q=>{B&&at.sendMessage(x,Q)},[B,x]),P=b.useCallback(async Q=>{B&&at.sendAiMessage(x,Q)},[B,x]),$=b.useCallback(Q=>{at.join(Q),j(Q)},[]),k=b.useCallback(async()=>await at.getConnectedUsers(H),[H]),V=b.useCallback(Q=>{at.mention(Q)},[]);b.useEffect(()=>{!z&&v&&M()},[z]);const W=b.useMemo(()=>({username:x,messages:u,onlineUsers:r,onlineCount:m,isConnected:v,error:y,connectChat:q,disconnectChat:M,sendMessage:K,sendAiMessage:P,mentionUser:V,joinRoom:$,refreshUsers:U,getUsers:k}),[x,u,r,V,m,v,y,q,M,K,P,$,U,k]);return f.jsx(Bh.Provider,{value:W,children:i})},Tv=()=>{const i=b.useContext(Bh);if(i===void 0)throw new Error("useChat debe ser usado dentro de un ChatProvider");return i},ah=["text-red-600","text-green-600","text-blue-600","text-yellow-600","text-purple-600","text-pink-600","text-orange-600","text-cyan-600","text-sky-600","text-lime-600","text-emerald-600","text-teal-600","text-indigo-600"],Nv=i=>{const u=Math.abs(i.split("").reduce((o,r)=>o+r.charCodeAt(0),0))%ah.length;return ah[u]},jv=({onBrowseMenu:i})=>{const{username:u,messages:o,sendMessage:r,sendAiMessage:d,connectChat:m,onlineCount:h,isConnected:v,getUsers:g,mentionUser:y}=Tv(),{user:S}=Tt(),[x,j]=b.useState(""),[z,B]=b.useState(!1),[H,Y]=b.useState(""),[U,q]=b.useState([]),M=b.useRef(null),K=b.useRef(null);b.useEffect(()=>{v||m()},[]),b.useEffect(()=>{M.current&&(M.current.scrollTop=M.current.scrollHeight)},[o]),b.useEffect(()=>{const Q=o[o.length-1];Q&&Q.type==="mentioned"&&Q.username===u&&ie.info("has sido mencionado en el chat",{position:"top-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0,theme:"dark",toastId:`mention-${Date.now()}`})},[o,u]),b.useEffect(()=>{z&&g().then(Q=>{Q.push("IAKlein"),Q=Q.filter(ee=>ee!==u),q(Q)})},[z,g]);const P=b.useMemo(()=>o.filter(Q=>!["mentioned","ping","pong"].includes(Q.type)).map((Q,ee)=>{const ne=new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});let ye=Q.username||"Unknown",Te=Q.message||"",Oe=!1,D=!1;switch(Q.type){case"join":ye="system",Te=`${Q.username} se ha conectado al chat`,Oe=!0;break;case"leave":ye="system",Te=`${Q.username} se ha desconectado del chat`,Oe=!0;break;case"ai_message":ye="ai",D=!0;break}return{id:ee,timestamp:ne,sender:ye,text:Te,isSystem:Oe,isAi:D}}),[o]),$=Q=>{const ee=Q.target.value;j(ee);const ne=ee.split(" ").pop();ne&&ne.startsWith("@")?(Y(ne.slice(1)),B(!0)):B(!1)},k=Q=>{var ne;const ee=x.split(" ");ee.pop(),ee.push(`@${Q} `),j(ee.join(" ")),B(!1),(ne=K.current)==null||ne.focus()},V=Q=>{if(Q.preventDefault(),!x.trim())return;r(x.trim());const ee=x.match(/@(\w+)/g);console.log("menciones",ee),ee&&ee.forEach(ne=>{const ye=ne.substring(1);ye==="IAKlein"?(d(x.trim()),console.log("enviar",x.trim())):ye!==u&&(y(ye),console.log("mencion",ye))}),j(""),B(!1)},W=U.filter(Q=>Q.toLowerCase().includes(H.toLowerCase()));return f.jsxs("section",{className:"absolute inset-0 bg-terminal-bg flex flex-col z-0",children:[f.jsx("div",{className:"absolute inset-0 scanlines z-10 opacity-30 pointer-events-none"}),f.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-[#1a1a1a] border-b border-[#333] z-20 shrink-0",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("span",{className:`size-2 rounded-full ${v?"bg-green-500":"bg-red-500"} animate-pulse-fast`}),f.jsxs("h3",{className:"text-terminal-text tracking-widest text-xs uppercase font-bold",children:[v?"ONLINE":"OFFLINE"," (",h,")"]})]}),f.jsxs("div",{className:"flex items-center gap-4",children:[f.jsxs("button",{onClick:i,className:"text-terminal-text text-sm cursor-pointer hover:text-white transition-colors flex items-center gap-1 font-bold",children:[f.jsx("span",{className:"material-symbols-outlined text-base",children:"storefront"}),f.jsx("span",{children:"Browse Menu"})]}),f.jsx("span",{className:"text-[#666] text-xs font-mono",children:"v2.4.0"})]})]}),f.jsxs("div",{ref:M,className:"flex-1 overflow-y-auto p-4 space-y-3 font-mono text-sm z-0 relative pb-18",children:[P.map(Q=>f.jsx("div",{className:"flex gap-3 group",children:f.jsxs("div",{className:"flex-1 break-words",children:[f.jsxs("span",{className:"text-primary font-bold text-xs mr-2",children:["[",Q.timestamp,"]"]}),Q.isSystem?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-white font-bold mr-1",children:""}),f.jsx("span",{className:"text-gray-300",children:Q.text})]}):Q.isAi?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"text-terminal-text font-bold mr-1",children:"<@IAKlein>"}),f.jsx("span",{className:"text-white",children:Q.text})]}):f.jsxs(f.Fragment,{children:[f.jsxs("span",{className:`${Nv(Q.sender)} font-bold mr-1`,children:["<",Q.sender,">"]}),f.jsx("span",{className:"text-white",children:Q.text.split(" ").map((ee,ne)=>ee.startsWith("@")?f.jsxs("span",{className:"text-yellow-400 font-bold",children:[ee," "]},ne):ee+" ")})]})]})},Q.id)),!v&&o.length>0&&f.jsx("div",{className:"text-red-500 font-bold text-xs mt-2",children:"> CONNECTION LOST. RECONNECTING..."})]}),z&&W.length>0&&f.jsxs("div",{className:"absolute bottom-16 left-4 bg-[#0d0d0d] border border-[#333] w-48 max-h-40 overflow-y-auto z-30 shadow-lg",children:[f.jsx("div",{className:"text-xs text-gray-500 px-2 py-1 border-b border-[#333]",children:"SUGGESTIONS"}),W.map(Q=>f.jsxs("button",{type:"button",onClick:()=>k(Q),className:"w-full text-left px-3 py-2 text-terminal-text hover:bg-[#222] hover:text-white text-sm font-mono transition-colors",children:["@",Q]},Q))]}),f.jsx("form",{className:"absolute bottom-0 left-0 right-0 p-2 bg-[#1a1a1a] z-20 shrink-0 pb-18",onSubmit:V,children:f.jsxs("div",{className:"flex w-full items-center rounded bg-black border border-[#333] px-3 py-2",children:[f.jsx("span",{className:"text-primary font-bold mr-2",children:">"}),f.jsx("input",{ref:K,value:x,onChange:$,className:"flex-1 bg-transparent border-none text-white font-mono text-sm focus:ring-0 focus:outline-none placeholder:text-gray-600 p-0",placeholder:v?"Type command... use @ to mention":"Connecting...",autoFocus:!0,disabled:!v}),f.jsx("button",{type:"submit",className:`text-terminal-text hover:text-white transition-colors ${v?"":"opacity-50 cursor-not-allowed"}`,disabled:!v,children:f.jsx("span",{className:"material-symbols-outlined text-lg",children:"send"})})]})})]})};/** * react-router v7.12.0 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */var lh="popstate";function Av(i={}){function u(r,d){let{pathname:m,search:h,hash:v}=r.location;return Co("",{pathname:m,search:h,hash:v},d.state&&d.state.usr||null,d.state&&d.state.key||"default")}function o(r,d){return typeof d=="string"?d:ni(d)}return wv(u,o,null,i)}function Le(i,u){if(i===!1||i===null||typeof i>"u")throw new Error(u)}function qt(i,u){if(!i){typeof console<"u"&&console.warn(u);try{throw new Error(u)}catch{}}}function Cv(){return Math.random().toString(36).substring(2,10)}function nh(i,u){return{usr:i.state,key:i.key,idx:u}}function Co(i,u,o=null,r){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof u=="string"?nn(u):u,state:o,key:u&&u.key||r||Cv()}}function ni({pathname:i="/",search:u="",hash:o=""}){return u&&u!=="?"&&(i+=u.charAt(0)==="?"?u:"?"+u),o&&o!=="#"&&(i+=o.charAt(0)==="#"?o:"#"+o),i}function nn(i){let u={};if(i){let o=i.indexOf("#");o>=0&&(u.hash=i.substring(o),i=i.substring(0,o));let r=i.indexOf("?");r>=0&&(u.search=i.substring(r),i=i.substring(0,r)),i&&(u.pathname=i)}return u}function wv(i,u,o,r={}){let{window:d=document.defaultView,v5Compat:m=!1}=r,h=d.history,v="POP",g=null,y=S();y==null&&(y=0,h.replaceState({...h.state,idx:y},""));function S(){return(h.state||{idx:null}).idx}function x(){v="POP";let Y=S(),U=Y==null?null:Y-y;y=Y,g&&g({action:v,location:H.location,delta:U})}function j(Y,U){v="PUSH";let q=Co(H.location,Y,U);y=S()+1;let M=nh(q,y),K=H.createHref(q);try{h.pushState(M,"",K)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;d.location.assign(K)}m&&g&&g({action:v,location:H.location,delta:1})}function z(Y,U){v="REPLACE";let q=Co(H.location,Y,U);y=S();let M=nh(q,y),K=H.createHref(q);h.replaceState(M,"",K),m&&g&&g({action:v,location:H.location,delta:0})}function B(Y){return zv(Y)}let H={get action(){return v},get location(){return i(d,h)},listen(Y){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(lh,x),g=Y,()=>{d.removeEventListener(lh,x),g=null}},createHref(Y){return u(d,Y)},createURL:B,encodeLocation(Y){let U=B(Y);return{pathname:U.pathname,search:U.search,hash:U.hash}},push:j,replace:z,go(Y){return h.go(Y)}};return H}function zv(i,u=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),Le(o,"No window.location.(origin|href) available to create URL");let r=typeof i=="string"?i:ni(i);return r=r.replace(/ $/,"%20"),!u&&r.startsWith("//")&&(r=o+r),new URL(r,o)}function Uh(i,u,o="/"){return Mv(i,u,o,!1)}function Mv(i,u,o,r){let d=typeof u=="string"?nn(u):u,m=ga(d.pathname||"/",o);if(m==null)return null;let h=Lh(i);Ov(h);let v=null;for(let g=0;v==null&&g{let S={relativePath:y===void 0?h.path||"":y,caseSensitive:h.caseSensitive===!0,childrenIndex:v,route:h};if(S.relativePath.startsWith("/")){if(!S.relativePath.startsWith(r)&&g)return;Le(S.relativePath.startsWith(r),`Absolute route path "${S.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),S.relativePath=S.relativePath.slice(r.length)}let x=ma([r,S.relativePath]),j=o.concat(S);h.children&&h.children.length>0&&(Le(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),Lh(h.children,u,j,x,g)),!(h.path==null&&!h.index)&&u.push({path:x,score:kv(x,h.index),routesMeta:j})};return i.forEach((h,v)=>{var g;if(h.path===""||!((g=h.path)!=null&&g.includes("?")))m(h,v);else for(let y of Hh(h.path))m(h,v,!0,y)}),u}function Hh(i){let u=i.split("/");if(u.length===0)return[];let[o,...r]=u,d=o.endsWith("?"),m=o.replace(/\?$/,"");if(r.length===0)return d?[m,""]:[m];let h=Hh(r.join("/")),v=[];return v.push(...h.map(g=>g===""?m:[m,g].join("/"))),d&&v.push(...h),v.map(g=>i.startsWith("/")&&g===""?"/":g)}function Ov(i){i.sort((u,o)=>u.score!==o.score?o.score-u.score:qv(u.routesMeta.map(r=>r.childrenIndex),o.routesMeta.map(r=>r.childrenIndex)))}var Rv=/^:[\w-]+$/,Dv=3,Bv=2,Uv=1,Lv=10,Hv=-2,ih=i=>i==="*";function kv(i,u){let o=i.split("/"),r=o.length;return o.some(ih)&&(r+=Hv),u&&(r+=Bv),o.filter(d=>!ih(d)).reduce((d,m)=>d+(Rv.test(m)?Dv:m===""?Uv:Lv),r)}function qv(i,u){return i.length===u.length&&i.slice(0,-1).every((r,d)=>r===u[d])?i[i.length-1]-u[u.length-1]:0}function Yv(i,u,o=!1){let{routesMeta:r}=i,d={},m="/",h=[];for(let v=0;v{if(S==="*"){let B=v[j]||"";h=m.slice(0,m.length-B.length).replace(/(.)\/+$/,"$1")}const z=v[j];return x&&!z?y[S]=void 0:y[S]=(z||"").replace(/%2F/g,"/"),y},{}),pathname:m,pathnameBase:h,pattern:i}}function Gv(i,u=!1,o=!0){qt(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let r=[],d="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,v,g)=>(r.push({paramName:v,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(r.push({paramName:"*"}),d+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?d+="\\/*$":i!==""&&i!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,u?void 0:"i"),r]}function Xv(i){try{return i.split("/").map(u=>decodeURIComponent(u).replace(/\//g,"%2F")).join("/")}catch(u){return qt(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${u}).`),i}}function ga(i,u){if(u==="/")return i;if(!i.toLowerCase().startsWith(u.toLowerCase()))return null;let o=u.endsWith("/")?u.length-1:u.length,r=i.charAt(o);return r&&r!=="/"?null:i.slice(o)||"/"}var kh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Qv=i=>kh.test(i);function Vv(i,u="/"){let{pathname:o,search:r="",hash:d=""}=typeof i=="string"?nn(i):i,m;if(o)if(Qv(o))m=o;else{if(o.includes("//")){let h=o;o=o.replace(/\/\/+/g,"/"),qt(!1,`Pathnames cannot have embedded double slashes - normalizing ${h} -> ${o}`)}o.startsWith("/")?m=sh(o.substring(1),"/"):m=sh(o,u)}else m=u;return{pathname:m,search:Jv(r),hash:$v(d)}}function sh(i,u){let o=u.replace(/\/+$/,"").split("/");return i.split("/").forEach(d=>{d===".."?o.length>1&&o.pop():d!=="."&&o.push(d)}),o.length>1?o.join("/"):"/"}function po(i,u,o,r){return`Cannot include a '${i}' character in a manually specified \`to.${u}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function Zv(i){return i.filter((u,o)=>o===0||u.route.path&&u.route.path.length>0)}function qh(i){let u=Zv(i);return u.map((o,r)=>r===u.length-1?o.pathname:o.pathnameBase)}function Yh(i,u,o,r=!1){let d;typeof i=="string"?d=nn(i):(d={...i},Le(!d.pathname||!d.pathname.includes("?"),po("?","pathname","search",d)),Le(!d.pathname||!d.pathname.includes("#"),po("#","pathname","hash",d)),Le(!d.search||!d.search.includes("#"),po("#","search","hash",d)));let m=i===""||d.pathname==="",h=m?"/":d.pathname,v;if(h==null)v=o;else{let x=u.length-1;if(!r&&h.startsWith("..")){let j=h.split("/");for(;j[0]==="..";)j.shift(),x-=1;d.pathname=j.join("/")}v=x>=0?u[x]:"/"}let g=Vv(d,v),y=h&&h!=="/"&&h.endsWith("/"),S=(m||h===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(y||S)&&(g.pathname+="/"),g}var ma=i=>i.join("/").replace(/\/\/+/g,"/"),Kv=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),Jv=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,$v=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,Fv=class{constructor(i,u,o,r=!1){this.status=i,this.statusText=u||"",this.internal=r,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function Wv(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function Iv(i){return i.map(u=>u.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Gh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Xh(i,u){let o=i;if(typeof o!="string"||!kh.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let r=o,d=!1;if(Gh)try{let m=new URL(window.location.href),h=o.startsWith("//")?new URL(m.protocol+o):new URL(o),v=ga(h.pathname,u);h.origin===m.origin&&v!=null?o=v+h.search+h.hash:d=!0}catch{qt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:d,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Qh=["POST","PUT","PATCH","DELETE"];new Set(Qh);var Pv=["GET",...Qh];new Set(Pv);var sn=b.createContext(null);sn.displayName="DataRouter";var Ys=b.createContext(null);Ys.displayName="DataRouterState";var ex=b.createContext(!1),Vh=b.createContext({isTransitioning:!1});Vh.displayName="ViewTransition";var tx=b.createContext(new Map);tx.displayName="Fetchers";var ax=b.createContext(null);ax.displayName="Await";var Bt=b.createContext(null);Bt.displayName="Navigation";var oi=b.createContext(null);oi.displayName="Location";var va=b.createContext({outlet:null,matches:[],isDataRoute:!1});va.displayName="Route";var Oo=b.createContext(null);Oo.displayName="RouteError";var Zh="REACT_ROUTER_ERROR",lx="REDIRECT",nx="ROUTE_ERROR_RESPONSE";function ix(i){if(i.startsWith(`${Zh}:${lx}:{`))try{let u=JSON.parse(i.slice(28));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string"&&typeof u.location=="string"&&typeof u.reloadDocument=="boolean"&&typeof u.replace=="boolean")return u}catch{}}function sx(i){if(i.startsWith(`${Zh}:${nx}:{`))try{let u=JSON.parse(i.slice(40));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string")return new Fv(u.status,u.statusText,u.data)}catch{}}function ux(i,{relative:u}={}){Le(ci(),"useHref() may be used only in the context of a component.");let{basename:o,navigator:r}=b.useContext(Bt),{hash:d,pathname:m,search:h}=fi(i,{relative:u}),v=m;return o!=="/"&&(v=m==="/"?o:ma([o,m])),r.createHref({pathname:v,search:h,hash:d})}function ci(){return b.useContext(oi)!=null}function Ka(){return Le(ci(),"useLocation() may be used only in the context of a component."),b.useContext(oi).location}var Kh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Jh(i){b.useContext(Bt).static||b.useLayoutEffect(i)}function yl(){let{isDataRoute:i}=b.useContext(va);return i?bx():rx()}function rx(){Le(ci(),"useNavigate() may be used only in the context of a component.");let i=b.useContext(sn),{basename:u,navigator:o}=b.useContext(Bt),{matches:r}=b.useContext(va),{pathname:d}=Ka(),m=JSON.stringify(qh(r)),h=b.useRef(!1);return Jh(()=>{h.current=!0}),b.useCallback((g,y={})=>{if(qt(h.current,Kh),!h.current)return;if(typeof g=="number"){o.go(g);return}let S=Yh(g,JSON.parse(m),d,y.relative==="path");i==null&&u!=="/"&&(S.pathname=S.pathname==="/"?u:ma([u,S.pathname])),(y.replace?o.replace:o.push)(S,y.state,y)},[u,o,m,d,i])}b.createContext(null);function fi(i,{relative:u}={}){let{matches:o}=b.useContext(va),{pathname:r}=Ka(),d=JSON.stringify(qh(o));return b.useMemo(()=>Yh(i,JSON.parse(d),r,u==="path"),[i,d,r,u])}function ox(i,u){return $h(i,u)}function $h(i,u,o,r,d){var q;Le(ci(),"useRoutes() may be used only in the context of a component.");let{navigator:m}=b.useContext(Bt),{matches:h}=b.useContext(va),v=h[h.length-1],g=v?v.params:{},y=v?v.pathname:"/",S=v?v.pathnameBase:"/",x=v&&v.route;{let M=x&&x.path||"";Wh(y,!x||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${y}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. Please change the parent to .`)}let j=Ka(),z;if(u){let M=typeof u=="string"?nn(u):u;Le(S==="/"||((q=M.pathname)==null?void 0:q.startsWith(S)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${S}" but pathname "${M.pathname}" was given in the \`location\` prop.`),z=M}else z=j;let B=z.pathname||"/",H=B;if(S!=="/"){let M=S.replace(/^\//,"").split("/");H="/"+B.replace(/^\//,"").split("/").slice(M.length).join("/")}let Y=Uh(i,{pathname:H});qt(x||Y!=null,`No routes matched location "${z.pathname}${z.search}${z.hash}" `),qt(Y==null||Y[Y.length-1].route.element!==void 0||Y[Y.length-1].route.Component!==void 0||Y[Y.length-1].route.lazy!==void 0,`Matched leaf route at location "${z.pathname}${z.search}${z.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let U=hx(Y&&Y.map(M=>Object.assign({},M,{params:Object.assign({},g,M.params),pathname:ma([S,m.encodeLocation?m.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?S:ma([S,m.encodeLocation?m.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),h,o,r,d);return u&&U?b.createElement(oi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...z},navigationType:"POP"}},U):U}function cx(){let i=xx(),u=Wv(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),o=i instanceof Error?i.stack:null,r="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:r},m={padding:"2px 4px",backgroundColor:r},h=null;return console.error("Error handled by React Router default ErrorBoundary:",i),h=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:m},"ErrorBoundary")," or"," ",b.createElement("code",{style:m},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},u),o?b.createElement("pre",{style:d},o):null,h)}var fx=b.createElement(cx,null),Fh=class extends b.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,u){return u.location!==i.location||u.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:u.error,location:u.location,revalidation:i.revalidation||u.revalidation}}componentDidCatch(i,u){this.props.onError?this.props.onError(i,u):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const o=sx(i.digest);o&&(i=o)}let u=i!==void 0?b.createElement(va.Provider,{value:this.props.routeContext},b.createElement(Oo.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?b.createElement(dx,{error:i},u):u}};Fh.contextType=ex;var yo=new WeakMap;function dx({children:i,error:u}){let{basename:o}=b.useContext(Bt);if(typeof u=="object"&&u&&"digest"in u&&typeof u.digest=="string"){let r=ix(u.digest);if(r){let d=yo.get(u);if(d)throw d;let m=Xh(r.location,o);if(Gh&&!yo.get(u))if(m.isExternal||r.reloadDocument)window.location.href=m.absoluteURL||m.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:r.replace}));throw yo.set(u,h),h}return b.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m.absoluteURL||m.to}`})}}return i}function mx({routeContext:i,match:u,children:o}){let r=b.useContext(sn);return r&&r.static&&r.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=u.route.id),b.createElement(va.Provider,{value:i},o)}function hx(i,u=[],o=null,r=null,d=null){if(i==null){if(!o)return null;if(o.errors)i=o.matches;else if(u.length===0&&!o.initialized&&o.matches.length>0)i=o.matches;else return null}let m=i,h=o==null?void 0:o.errors;if(h!=null){let S=m.findIndex(x=>x.route.id&&(h==null?void 0:h[x.route.id])!==void 0);Le(S>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),m=m.slice(0,Math.min(m.length,S+1))}let v=!1,g=-1;if(o)for(let S=0;S=0?m=m.slice(0,g+1):m=[m[0]];break}}}let y=o&&r?(S,x)=>{var j,z;r(S,{location:o.location,params:((z=(j=o.matches)==null?void 0:j[0])==null?void 0:z.params)??{},unstable_pattern:Iv(o.matches),errorInfo:x})}:void 0;return m.reduceRight((S,x,j)=>{let z,B=!1,H=null,Y=null;o&&(z=h&&x.route.id?h[x.route.id]:void 0,H=x.route.errorElement||fx,v&&(g<0&&j===0?(Wh("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),B=!0,Y=null):g===j&&(B=!0,Y=x.route.hydrateFallbackElement||null)));let U=u.concat(m.slice(0,j+1)),q=()=>{let M;return z?M=H:B?M=Y:x.route.Component?M=b.createElement(x.route.Component,null):x.route.element?M=x.route.element:M=S,b.createElement(mx,{match:x,routeContext:{outlet:S,matches:U,isDataRoute:o!=null},children:M})};return o&&(x.route.ErrorBoundary||x.route.errorElement||j===0)?b.createElement(Fh,{location:o.location,revalidation:o.revalidation,component:H,error:z,children:q(),routeContext:{outlet:null,matches:U,isDataRoute:!0},onError:y}):q()},null)}function Ro(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function px(i){let u=b.useContext(sn);return Le(u,Ro(i)),u}function yx(i){let u=b.useContext(Ys);return Le(u,Ro(i)),u}function gx(i){let u=b.useContext(va);return Le(u,Ro(i)),u}function Do(i){let u=gx(i),o=u.matches[u.matches.length-1];return Le(o.route.id,`${i} can only be used on routes that contain a unique "id"`),o.route.id}function vx(){return Do("useRouteId")}function xx(){var r;let i=b.useContext(Oo),u=yx("useRouteError"),o=Do("useRouteError");return i!==void 0?i:(r=u.errors)==null?void 0:r[o]}function bx(){let{router:i}=px("useNavigate"),u=Do("useNavigate"),o=b.useRef(!1);return Jh(()=>{o.current=!0}),b.useCallback(async(d,m={})=>{qt(o.current,Kh),o.current&&(typeof d=="number"?await i.navigate(d):await i.navigate(d,{fromRouteId:u,...m}))},[i,u])}var uh={};function Wh(i,u,o){!u&&!uh[i]&&(uh[i]=!0,qt(!1,o))}b.memo(Sx);function Sx({routes:i,future:u,state:o,onError:r}){return $h(i,void 0,o,r,u)}function kt(i){Le(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function Ex({basename:i="/",children:u=null,location:o,navigationType:r="POP",navigator:d,static:m=!1,unstable_useTransitions:h}){Le(!ci(),"You cannot render a inside another . You should never have more than one in your app.");let v=i.replace(/^\/*/,"/"),g=b.useMemo(()=>({basename:v,navigator:d,static:m,unstable_useTransitions:h,future:{}}),[v,d,m,h]);typeof o=="string"&&(o=nn(o));let{pathname:y="/",search:S="",hash:x="",state:j=null,key:z="default"}=o,B=b.useMemo(()=>{let H=ga(y,v);return H==null?null:{location:{pathname:H,search:S,hash:x,state:j,key:z},navigationType:r}},[v,y,S,x,j,z,r]);return qt(B!=null,` is not able to match the URL "${y}${S}${x}" because it does not start with the basename, so the won't render anything.`),B==null?null:b.createElement(Bt.Provider,{value:g},b.createElement(oi.Provider,{children:u,value:B}))}function _x({children:i,location:u}){return ox(wo(i),u)}function wo(i,u=[]){let o=[];return b.Children.forEach(i,(r,d)=>{if(!b.isValidElement(r))return;let m=[...u,d];if(r.type===b.Fragment){o.push.apply(o,wo(r.props.children,m));return}Le(r.type===kt,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),Le(!r.props.index||!r.props.children,"An index route cannot have child routes.");let h={id:r.props.id||m.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(h.children=wo(r.props.children,m)),o.push(h)}),o}var Rs="get",Ds="application/x-www-form-urlencoded";function Gs(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function Tx(i){return Gs(i)&&i.tagName.toLowerCase()==="button"}function Nx(i){return Gs(i)&&i.tagName.toLowerCase()==="form"}function jx(i){return Gs(i)&&i.tagName.toLowerCase()==="input"}function Ax(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function Cx(i,u){return i.button===0&&(!u||u==="_self")&&!Ax(i)}var Ms=null;function wx(){if(Ms===null)try{new FormData(document.createElement("form"),0),Ms=!1}catch{Ms=!0}return Ms}var zx=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function go(i){return i!=null&&!zx.has(i)?(qt(!1,`"${i}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Ds}"`),null):i}function Mx(i,u){let o,r,d,m,h;if(Nx(i)){let v=i.getAttribute("action");r=v?ga(v,u):null,o=i.getAttribute("method")||Rs,d=go(i.getAttribute("enctype"))||Ds,m=new FormData(i)}else if(Tx(i)||jx(i)&&(i.type==="submit"||i.type==="image")){let v=i.form;if(v==null)throw new Error('Cannot submit a