function vh(n,o){for(var i=0;iu[d]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&u(m)}).observe(document,{childList:!0,subtree:!0});function i(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=i(d);fetch(d.href,f)}})();var il=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ba(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function yh(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var o=n.default;if(typeof o=="function"){var i=function u(){var d=!1;try{d=this instanceof u}catch{}return d?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};i.prototype=o.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(n).forEach(function(u){var d=Object.getOwnPropertyDescriptor(n,u);Object.defineProperty(i,u,d.get?d:{enumerable:!0,get:function(){return n[u]}})}),i}var ll={exports:{}},va={},ul={exports:{}},ye={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var zd;function xh(){if(zd)return ye;zd=1;var n=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),m=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),j=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),y=Symbol.iterator;function N(E){return E===null||typeof E!="object"?null:(E=y&&E[y]||E["@@iterator"],typeof E=="function"?E:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,z={};function D(E,F,me){this.props=E,this.context=F,this.refs=z,this.updater=me||P}D.prototype.isReactComponent={},D.prototype.setState=function(E,F){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,F,"setState")},D.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function B(){}B.prototype=D.prototype;function C(E,F,me){this.props=E,this.context=F,this.refs=z,this.updater=me||P}var x=C.prototype=new B;x.constructor=C,A(x,D.prototype),x.isPureReactComponent=!0;var $=Array.isArray,M=Object.prototype.hasOwnProperty,L={current:null},U={key:!0,ref:!0,__self:!0,__source:!0};function I(E,F,me){var ge,xe={},we=null,b=null;if(F!=null)for(ge in F.ref!==void 0&&(b=F.ref),F.key!==void 0&&(we=""+F.key),F)M.call(F,ge)&&!U.hasOwnProperty(ge)&&(xe[ge]=F[ge]);var ee=arguments.length-2;if(ee===1)xe.children=me;else if(1>>1,F=Q[E];if(0>>1;Ed(xe,G))wed(b,xe)?(Q[E]=b,Q[we]=G,E=we):(Q[E]=xe,Q[ge]=G,E=ge);else if(wed(b,G))Q[E]=b,Q[we]=G,E=we;else break e}}return oe}function d(Q,oe){var G=Q.sortIndex-oe.sortIndex;return G!==0?G:Q.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var m=Date,v=m.now();n.unstable_now=function(){return m.now()-v}}var g=[],j=[],h=1,y=null,N=3,P=!1,A=!1,z=!1,D=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(Q){for(var oe=i(j);oe!==null;){if(oe.callback===null)u(j);else if(oe.startTime<=Q)u(j),oe.sortIndex=oe.expirationTime,o(g,oe);else break;oe=i(j)}}function $(Q){if(z=!1,x(Q),!A)if(i(g)!==null)A=!0,fe(M);else{var oe=i(j);oe!==null&&ue($,oe.startTime-Q)}}function M(Q,oe){A=!1,z&&(z=!1,B(I),I=-1),P=!0;var G=N;try{for(x(oe),y=i(g);y!==null&&(!(y.expirationTime>oe)||Q&&!ne());){var E=y.callback;if(typeof E=="function"){y.callback=null,N=y.priorityLevel;var F=E(y.expirationTime<=oe);oe=n.unstable_now(),typeof F=="function"?y.callback=F:y===i(g)&&u(g),x(oe)}else u(g);y=i(g)}if(y!==null)var me=!0;else{var ge=i(j);ge!==null&&ue($,ge.startTime-oe),me=!1}return me}finally{y=null,N=G,P=!1}}var L=!1,U=null,I=-1,Y=5,pe=-1;function ne(){return!(n.unstable_now()-peQ||125E?(Q.sortIndex=G,o(j,Q),i(g)===null&&Q===i(j)&&(z?(B(I),I=-1):z=!0,ue($,G-E))):(Q.sortIndex=F,o(g,Q),A||P||(A=!0,fe(M))),Q},n.unstable_shouldYield=ne,n.unstable_wrapCallback=function(Q){var oe=N;return function(){var G=N;N=oe;try{return Q.apply(this,arguments)}finally{N=G}}}})(fl)),fl}var Hd;function kh(){return Hd||(Hd=1,dl.exports=bh()),dl.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Bd;function Sh(){if(Bd)return mt;Bd=1;var n=Rl(),o=kh();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,j=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},y={};function N(e){return g.call(y,e)?!0:g.call(h,e)?!1:j.test(e)?y[e]=!0:(h[e]=!0,!1)}function P(e,t,r,s){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function A(e,t,r,s){if(t===null||typeof t>"u"||P(e,t,r,s))return!0;if(s)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function z(e,t,r,s,l,c,p){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=l,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=p}var D={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){D[e]=new z(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];D[t]=new z(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){D[e]=new z(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){D[e]=new z(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){D[e]=new z(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){D[e]=new z(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){D[e]=new z(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){D[e]=new z(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){D[e]=new z(e,5,!1,e.toLowerCase(),null,!1,!1)});var B=/[\-:]([a-z])/g;function C(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(B,C);D[t]=new z(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(B,C);D[t]=new z(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(B,C);D[t]=new z(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){D[e]=new z(e,1,!1,e.toLowerCase(),null,!1,!1)}),D.xlinkHref=new z("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){D[e]=new z(e,1,!1,e.toLowerCase(),null,!0,!0)});function x(e,t,r,s){var l=D.hasOwnProperty(t)?D[t]:null;(l!==null?l.type!==0:s||!(2w||l[p]!==c[w]){var k=` `+l[p].replace(" at new "," at ");return e.displayName&&k.includes("")&&(k=k.replace("",e.displayName)),k}while(1<=p&&0<=w);break}}}finally{me=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?F(e):""}function xe(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=ge(e.type,!1),e;case 11:return e=ge(e.type.render,!1),e;case 1:return e=ge(e.type,!0),e;default:return""}}function we(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case U:return"Fragment";case L:return"Portal";case Y:return"Profiler";case I:return"StrictMode";case ve:return"Suspense";case X:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ne:return(e.displayName||"Context")+".Consumer";case pe:return(e._context.displayName||"Context")+".Provider";case le:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case fe:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}function b(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return we(t);case 8:return t===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ee(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function he(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _e(e){var t=he(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var l=r.get,c=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(p){s=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(p){s=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Fe(e){e._valueTracker||(e._valueTracker=_e(e))}function yt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=he(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function Ea(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ps(e,t){var r=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Wl(e,t){var r=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;r=ee(t.value!=null?t.value:r),e._wrapperState={initialChecked:s,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ql(e,t){t=t.checked,t!=null&&x(e,"checked",t,!1)}function hs(e,t){ql(e,t);var r=ee(t.value),s=t.type;if(r!=null)s==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?gs(e,t.type,r):t.hasOwnProperty("defaultValue")&&gs(e,t.type,ee(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vl(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function gs(e,t,r){(t!=="number"||Ea(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Mn=Array.isArray;function Jr(e,t,r,s){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Ta.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function On(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ln={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},jm=["Webkit","ms","Moz","O"];Object.keys(Ln).forEach(function(e){jm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ln[t]=Ln[e]})});function Jl(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ln.hasOwnProperty(e)&&Ln[e]?(""+t).trim():t+"px"}function Zl(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var s=r.indexOf("--")===0,l=Jl(r,t[r],s);r==="float"&&(r="cssFloat"),s?e.setProperty(r,l):e[r]=l}}var Nm=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function xs(e,t){if(t){if(Nm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function ws(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var js=null;function Ns(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bs=null,Zr=null,en=null;function eu(e){if(e=ra(e)){if(typeof bs!="function")throw Error(i(280));var t=e.stateNode;t&&(t=Ja(t),bs(e.stateNode,e.type,t))}}function tu(e){Zr?en?en.push(e):en=[e]:Zr=e}function ru(){if(Zr){var e=Zr,t=en;if(en=Zr=null,eu(e),t)for(e=0;e>>=0,e===0?32:31-(Om(e)/Lm|0)|0}var La=64,Ra=4194304;function $n(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ia(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,l=e.suspendedLanes,c=e.pingedLanes,p=r&268435455;if(p!==0){var w=p&~l;w!==0?s=$n(w):(c&=p,c!==0&&(s=$n(c)))}else p=r&~l,p!==0?s=$n(p):c!==0&&(s=$n(c));if(s===0)return 0;if(t!==0&&t!==s&&(t&l)===0&&(l=s&-s,c=t&-t,l>=c||l===16&&(c&4194240)!==0))return t;if((s&4)!==0&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0r;r++)t.push(e);return t}function An(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_t(t),e[t]=r}function $m(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0=Qn),Pu=" ",Du=!1;function Mu(e,t){switch(e){case"keyup":return fp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ou(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var nn=!1;function pp(e,t){switch(e){case"compositionend":return Ou(t);case"keypress":return t.which!==32?null:(Du=!0,Pu);case"textInput":return e=t.data,e===Pu&&Du?null:e;default:return null}}function hp(e,t){if(nn)return e==="compositionend"||!Fs&&Mu(e,t)?(e=ku(),Fa=Rs=lr=null,nn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Uu(r)}}function Hu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bu(){for(var e=window,t=Ea();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ea(e.document)}return t}function Ws(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function kp(e){var t=Bu(),r=e.focusedElem,s=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Hu(r.ownerDocument.documentElement,r)){if(s!==null&&Ws(r)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=r.textContent.length,c=Math.min(s.start,l);s=s.end===void 0?c:Math.min(s.end,l),!e.extend&&c>s&&(l=s,s=c,c=l),l=Fu(r,c);var p=Fu(r,s);l&&p&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==p.node||e.focusOffset!==p.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),c>s?(e.addRange(t),e.extend(p.node,p.offset)):(t.setEnd(p.node,p.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,an=null,qs=null,Gn=null,Vs=!1;function Wu(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Vs||an==null||an!==Ea(s)||(s=an,"selectionStart"in s&&Ws(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Gn&&Kn(Gn,s)||(Gn=s,s=Xa(qs,"onSelect"),0cn||(e.current=ai[cn],ai[cn]=null,cn--)}function Ee(e,t){cn++,ai[cn]=e.current,e.current=t}var fr={},Ze=dr(fr),lt=dr(!1),Rr=fr;function dn(e,t){var r=e.type.contextTypes;if(!r)return fr;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var l={},c;for(c in r)l[c]=t[c];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function ut(e){return e=e.childContextTypes,e!=null}function Za(){De(lt),De(Ze)}function oc(e,t,r){if(Ze.current!==fr)throw Error(i(168));Ee(Ze,t),Ee(lt,r)}function sc(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var l in s)if(!(l in t))throw Error(i(108,b(e)||"Unknown",l));return G({},r,s)}function eo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fr,Rr=Ze.current,Ee(Ze,e),Ee(lt,lt.current),!0}function ic(e,t,r){var s=e.stateNode;if(!s)throw Error(i(169));r?(e=sc(e,t,Rr),s.__reactInternalMemoizedMergedChildContext=e,De(lt),De(Ze),Ee(Ze,e)):De(lt),Ee(lt,r)}var qt=null,to=!1,oi=!1;function lc(e){qt===null?qt=[e]:qt.push(e)}function Ip(e){to=!0,lc(e)}function mr(){if(!oi&&qt!==null){oi=!0;var e=0,t=be;try{var r=qt;for(be=1;e>=p,l-=p,Vt=1<<32-_t(t)+l|r<de?(Xe=ie,ie=null):Xe=ie.sibling;var Ne=H(T,ie,O[de],V);if(Ne===null){ie===null&&(ie=Xe);break}e&&ie&&Ne.alternate===null&&t(T,ie),S=c(Ne,S,de),se===null?re=Ne:se.sibling=Ne,se=Ne,ie=Xe}if(de===O.length)return r(T,ie),Me&&zr(T,de),re;if(ie===null){for(;dede?(Xe=ie,ie=null):Xe=ie.sibling;var Nr=H(T,ie,Ne.value,V);if(Nr===null){ie===null&&(ie=Xe);break}e&&ie&&Nr.alternate===null&&t(T,ie),S=c(Nr,S,de),se===null?re=Nr:se.sibling=Nr,se=Nr,ie=Xe}if(Ne.done)return r(T,ie),Me&&zr(T,de),re;if(ie===null){for(;!Ne.done;de++,Ne=O.next())Ne=q(T,Ne.value,V),Ne!==null&&(S=c(Ne,S,de),se===null?re=Ne:se.sibling=Ne,se=Ne);return Me&&zr(T,de),re}for(ie=s(T,ie);!Ne.done;de++,Ne=O.next())Ne=K(ie,T,de,Ne.value,V),Ne!==null&&(e&&Ne.alternate!==null&&ie.delete(Ne.key===null?de:Ne.key),S=c(Ne,S,de),se===null?re=Ne:se.sibling=Ne,se=Ne);return e&&ie.forEach(function(gh){return t(T,gh)}),Me&&zr(T,de),re}function Ae(T,S,O,V){if(typeof O=="object"&&O!==null&&O.type===U&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case M:e:{for(var re=O.key,se=S;se!==null;){if(se.key===re){if(re=O.type,re===U){if(se.tag===7){r(T,se.sibling),S=l(se,O.props.children),S.return=T,T=S;break e}}else if(se.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===fe&&pc(re)===se.type){r(T,se.sibling),S=l(se,O.props),S.ref=na(T,se,O),S.return=T,T=S;break e}r(T,se);break}else t(T,se);se=se.sibling}O.type===U?(S=qr(O.props.children,T.mode,V,O.key),S.return=T,T=S):(V=Po(O.type,O.key,O.props,null,T.mode,V),V.ref=na(T,S,O),V.return=T,T=V)}return p(T);case L:e:{for(se=O.key;S!==null;){if(S.key===se)if(S.tag===4&&S.stateNode.containerInfo===O.containerInfo&&S.stateNode.implementation===O.implementation){r(T,S.sibling),S=l(S,O.children||[]),S.return=T,T=S;break e}else{r(T,S);break}else t(T,S);S=S.sibling}S=rl(O,T.mode,V),S.return=T,T=S}return p(T);case fe:return se=O._init,Ae(T,S,se(O._payload),V)}if(Mn(O))return Z(T,S,O,V);if(oe(O))return te(T,S,O,V);oo(T,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,S!==null&&S.tag===6?(r(T,S.sibling),S=l(S,O),S.return=T,T=S):(r(T,S),S=tl(O,T.mode,V),S.return=T,T=S),p(T)):r(T,S)}return Ae}var hn=hc(!0),gc=hc(!1),so=dr(null),io=null,gn=null,di=null;function fi(){di=gn=io=null}function mi(e){var t=so.current;De(so),e._currentValue=t}function pi(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function vn(e,t){io=e,di=gn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ct=!0),e.firstContext=null)}function jt(e){var t=e._currentValue;if(di!==e)if(e={context:e,memoizedValue:t,next:null},gn===null){if(io===null)throw Error(i(308));gn=e,io.dependencies={lanes:0,firstContext:e}}else gn=gn.next=e;return t}var $r=null;function hi(e){$r===null?$r=[e]:$r.push(e)}function vc(e,t,r,s){var l=t.interleaved;return l===null?(r.next=r,hi(t)):(r.next=l.next,l.next=r),t.interleaved=r,Yt(e,s)}function Yt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var pr=!1;function gi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Xt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function hr(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(je&2)!==0){var l=s.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),s.pending=t,Yt(e,r)}return l=s.interleaved,l===null?(t.next=t,hi(s)):(t.next=l.next,l.next=t),s.interleaved=t,Yt(e,r)}function lo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Ps(e,r)}}function xc(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var l=null,c=null;if(r=r.firstBaseUpdate,r!==null){do{var p={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};c===null?l=c=p:c=c.next=p,r=r.next}while(r!==null);c===null?l=c=t:c=c.next=t}else l=c=t;r={baseState:s.baseState,firstBaseUpdate:l,lastBaseUpdate:c,shared:s.shared,effects:s.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function uo(e,t,r,s){var l=e.updateQueue;pr=!1;var c=l.firstBaseUpdate,p=l.lastBaseUpdate,w=l.shared.pending;if(w!==null){l.shared.pending=null;var k=w,R=k.next;k.next=null,p===null?c=R:p.next=R,p=k;var W=e.alternate;W!==null&&(W=W.updateQueue,w=W.lastBaseUpdate,w!==p&&(w===null?W.firstBaseUpdate=R:w.next=R,W.lastBaseUpdate=k))}if(c!==null){var q=l.baseState;p=0,W=R=k=null,w=c;do{var H=w.lane,K=w.eventTime;if((s&H)===H){W!==null&&(W=W.next={eventTime:K,lane:0,tag:w.tag,payload:w.payload,callback:w.callback,next:null});e:{var Z=e,te=w;switch(H=t,K=r,te.tag){case 1:if(Z=te.payload,typeof Z=="function"){q=Z.call(K,q,H);break e}q=Z;break e;case 3:Z.flags=Z.flags&-65537|128;case 0:if(Z=te.payload,H=typeof Z=="function"?Z.call(K,q,H):Z,H==null)break e;q=G({},q,H);break e;case 2:pr=!0}}w.callback!==null&&w.lane!==0&&(e.flags|=64,H=l.effects,H===null?l.effects=[w]:H.push(w))}else K={eventTime:K,lane:H,tag:w.tag,payload:w.payload,callback:w.callback,next:null},W===null?(R=W=K,k=q):W=W.next=K,p|=H;if(w=w.next,w===null){if(w=l.shared.pending,w===null)break;H=w,w=H.next,H.next=null,l.lastBaseUpdate=H,l.shared.pending=null}}while(!0);if(W===null&&(k=q),l.baseState=k,l.firstBaseUpdate=R,l.lastBaseUpdate=W,t=l.shared.interleaved,t!==null){l=t;do p|=l.lane,l=l.next;while(l!==t)}else c===null&&(l.shared.lanes=0);Fr|=p,e.lanes=p,e.memoizedState=q}}function wc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var s=ji.transition;ji.transition={};try{e(!1),t()}finally{be=r,ji.transition=s}}function Ac(){return Nt().memoizedState}function Up(e,t,r){var s=xr(e);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},Uc(e))Fc(t,r);else if(r=vc(e,t,r,s),r!==null){var l=ot();Ot(r,e,s,l),Hc(r,t,s)}}function Fp(e,t,r){var s=xr(e),l={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(Uc(e))Fc(t,l);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,w=c(p,r);if(l.hasEagerState=!0,l.eagerState=w,Et(w,p)){var k=t.interleaved;k===null?(l.next=l,hi(t)):(l.next=k.next,k.next=l),t.interleaved=l;return}}catch{}finally{}r=vc(e,t,l,s),r!==null&&(l=ot(),Ot(r,e,s,l),Hc(r,t,s))}}function Uc(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Fc(e,t){ia=mo=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Hc(e,t,r){if((r&4194240)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Ps(e,r)}}var go={readContext:jt,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},Hp={readContext:jt,useCallback:function(e,t){return At().memoizedState=[e,t===void 0?null:t],e},useContext:jt,useEffect:Dc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,po(4194308,4,Lc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return po(4194308,4,e,t)},useInsertionEffect:function(e,t){return po(4,2,e,t)},useMemo:function(e,t){var r=At();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=At();return t=r!==void 0?r(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=Up.bind(null,Le,e),[s.memoizedState,e]},useRef:function(e){var t=At();return e={current:e},t.memoizedState=e},useState:Tc,useDebugValue:Ei,useDeferredValue:function(e){return At().memoizedState=e},useTransition:function(){var e=Tc(!1),t=e[0];return e=Ap.bind(null,e[1]),At().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=Le,l=At();if(Me){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),Ye===null)throw Error(i(349));(Ur&30)!==0||kc(s,t,r)}l.memoizedState=r;var c={value:r,getSnapshot:t};return l.queue=c,Dc(Cc.bind(null,s,c,e),[e]),s.flags|=2048,ca(9,Sc.bind(null,s,c,r,t),void 0,null),r},useId:function(){var e=At(),t=Ye.identifierPrefix;if(Me){var r=Qt,s=Vt;r=(s&~(1<<32-_t(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=la++,0<\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=p.createElement(r,{is:s.is}):(e=p.createElement(r),r==="select"&&(p=e,s.multiple?p.multiple=!0:s.size&&(p.size=s.size))):e=p.createElementNS(e,r),e[zt]=t,e[ta]=s,ld(e,t,!1,!1),t.stateNode=e;e:{switch(p=ws(r,s),r){case"dialog":Pe("cancel",e),Pe("close",e),l=s;break;case"iframe":case"object":case"embed":Pe("load",e),l=s;break;case"video":case"audio":for(l=0;lNn&&(t.flags|=128,s=!0,da(c,!1),t.lanes=4194304)}else{if(!s)if(e=co(p),e!==null){if(t.flags|=128,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),da(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!Me)return tt(t),null}else 2*$e()-c.renderingStartTime>Nn&&r!==1073741824&&(t.flags|=128,s=!0,da(c,!1),t.lanes=4194304);c.isBackwards?(p.sibling=t.child,t.child=p):(r=c.last,r!==null?r.sibling=p:t.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=$e(),t.sibling=null,r=Oe.current,Ee(Oe,s?r&1|2:r&1),t):(tt(t),null);case 22:case 23:return Ji(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&(t.mode&1)!==0?(vt&1073741824)!==0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function Kp(e,t){switch(ii(t),t.tag){case 1:return ut(t.type)&&Za(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yn(),De(lt),De(Ze),wi(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return yi(t),null;case 13:if(De(Oe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return De(Oe),null;case 4:return yn(),null;case 10:return mi(t.type._context),null;case 22:case 23:return Ji(),null;case 24:return null;default:return null}}var wo=!1,rt=!1,Gp=typeof WeakSet=="function"?WeakSet:Set,J=null;function wn(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){ze(e,t,s)}else r.current=null}function Ui(e,t,r){try{r()}catch(s){ze(e,t,s)}}var dd=!1;function Jp(e,t){if(Js=Aa,e=Bu(),Ws(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var l=s.anchorOffset,c=s.focusNode;s=s.focusOffset;try{r.nodeType,c.nodeType}catch{r=null;break e}var p=0,w=-1,k=-1,R=0,W=0,q=e,H=null;t:for(;;){for(var K;q!==r||l!==0&&q.nodeType!==3||(w=p+l),q!==c||s!==0&&q.nodeType!==3||(k=p+s),q.nodeType===3&&(p+=q.nodeValue.length),(K=q.firstChild)!==null;)H=q,q=K;for(;;){if(q===e)break t;if(H===r&&++R===l&&(w=p),H===c&&++W===s&&(k=p),(K=q.nextSibling)!==null)break;q=H,H=q.parentNode}q=K}r=w===-1||k===-1?null:{start:w,end:k}}else r=null}r=r||{start:0,end:0}}else r=null;for(Zs={focusedElem:e,selectionRange:r},Aa=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var Z=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(Z!==null){var te=Z.memoizedProps,Ae=Z.memoizedState,T=t.stateNode,S=T.getSnapshotBeforeUpdate(t.elementType===t.type?te:Pt(t.type,te),Ae);T.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var O=t.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(V){ze(t,t.return,V)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return Z=dd,dd=!1,Z}function fa(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var l=s=s.next;do{if((l.tag&e)===e){var c=l.destroy;l.destroy=void 0,c!==void 0&&Ui(t,r,c)}l=l.next}while(l!==s)}}function jo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var s=r.create;r.destroy=s()}r=r.next}while(r!==t)}}function Fi(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function fd(e){var t=e.alternate;t!==null&&(e.alternate=null,fd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zt],delete t[ta],delete t[ni],delete t[Lp],delete t[Rp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function md(e){return e.tag===5||e.tag===3||e.tag===4}function pd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||md(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hi(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ga));else if(s!==4&&(e=e.child,e!==null))for(Hi(e,t,r),e=e.sibling;e!==null;)Hi(e,t,r),e=e.sibling}function Bi(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Bi(e,t,r),e=e.sibling;e!==null;)Bi(e,t,r),e=e.sibling}var Ke=null,Dt=!1;function gr(e,t,r){for(r=r.child;r!==null;)hd(e,t,r),r=r.sibling}function hd(e,t,r){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(Oa,r)}catch{}switch(r.tag){case 5:rt||wn(r,t);case 6:var s=Ke,l=Dt;Ke=null,gr(e,t,r),Ke=s,Dt=l,Ke!==null&&(Dt?(e=Ke,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ke.removeChild(r.stateNode));break;case 18:Ke!==null&&(Dt?(e=Ke,r=r.stateNode,e.nodeType===8?ri(e.parentNode,r):e.nodeType===1&&ri(e,r),Wn(e)):ri(Ke,r.stateNode));break;case 4:s=Ke,l=Dt,Ke=r.stateNode.containerInfo,Dt=!0,gr(e,t,r),Ke=s,Dt=l;break;case 0:case 11:case 14:case 15:if(!rt&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){l=s=s.next;do{var c=l,p=c.destroy;c=c.tag,p!==void 0&&((c&2)!==0||(c&4)!==0)&&Ui(r,t,p),l=l.next}while(l!==s)}gr(e,t,r);break;case 1:if(!rt&&(wn(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(w){ze(r,t,w)}gr(e,t,r);break;case 21:gr(e,t,r);break;case 22:r.mode&1?(rt=(s=rt)||r.memoizedState!==null,gr(e,t,r),rt=s):gr(e,t,r);break;default:gr(e,t,r)}}function gd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Gp),t.forEach(function(s){var l=ih.bind(null,e,s);r.has(s)||(r.add(s),s.then(l,l))})}}function Mt(e,t){var r=t.deletions;if(r!==null)for(var s=0;sl&&(l=p),s&=~c}if(s=l,s=$e()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*eh(s/1960))-s,10e?16:e,yr===null)var s=!1;else{if(e=yr,yr=null,Co=0,(je&6)!==0)throw Error(i(331));var l=je;for(je|=4,J=e.current;J!==null;){var c=J,p=c.child;if((J.flags&16)!==0){var w=c.deletions;if(w!==null){for(var k=0;k$e()-Vi?Br(e,0):qi|=r),ft(e,t)}function Td(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ra,Ra<<=1,(Ra&130023424)===0&&(Ra=4194304)));var r=ot();e=Yt(e,t),e!==null&&(An(e,t,r),ft(e,r))}function sh(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Td(e,r)}function ih(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,l=e.memoizedState;l!==null&&(r=l.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(i(314))}s!==null&&s.delete(t),Td(e,r)}var Pd;Pd=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||lt.current)ct=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return ct=!1,Yp(e,t,r);ct=(e.flags&131072)!==0}else ct=!1,Me&&(t.flags&1048576)!==0&&uc(t,no,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;xo(e,t),e=t.pendingProps;var l=dn(t,Ze.current);vn(t,r),l=bi(null,t,s,e,l,r);var c=ki();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ut(s)?(c=!0,eo(t)):c=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,gi(t),l.updater=vo,t.stateNode=l,l._reactInternals=t,Pi(t,s,e,r),t=Li(null,t,s,!0,c,r)):(t.tag=0,Me&&c&&si(t),at(null,t,l,r),t=t.child),t;case 16:s=t.elementType;e:{switch(xo(e,t),e=t.pendingProps,l=s._init,s=l(s._payload),t.type=s,l=t.tag=uh(s),e=Pt(s,e),l){case 0:t=Oi(null,t,s,e,r);break e;case 1:t=rd(null,t,s,e,r);break e;case 11:t=Gc(null,t,s,e,r);break e;case 14:t=Jc(null,t,s,Pt(s.type,e),r);break e}throw Error(i(306,s,""))}return t;case 0:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Pt(s,l),Oi(e,t,s,l,r);case 1:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Pt(s,l),rd(e,t,s,l,r);case 3:e:{if(nd(t),e===null)throw Error(i(387));s=t.pendingProps,c=t.memoizedState,l=c.element,yc(e,t),uo(t,s,null,r);var p=t.memoizedState;if(s=p.element,c.isDehydrated)if(c={element:s,isDehydrated:!1,cache:p.cache,pendingSuspenseBoundaries:p.pendingSuspenseBoundaries,transitions:p.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){l=xn(Error(i(423)),t),t=ad(e,t,s,r,l);break e}else if(s!==l){l=xn(Error(i(424)),t),t=ad(e,t,s,r,l);break e}else for(gt=cr(t.stateNode.containerInfo.firstChild),ht=t,Me=!0,Tt=null,r=gc(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(pn(),s===l){t=Kt(e,t,r);break e}at(e,t,s,r)}t=t.child}return t;case 5:return jc(t),e===null&&ui(t),s=t.type,l=t.pendingProps,c=e!==null?e.memoizedProps:null,p=l.children,ei(s,l)?p=null:c!==null&&ei(s,c)&&(t.flags|=32),td(e,t),at(e,t,p,r),t.child;case 6:return e===null&&ui(t),null;case 13:return od(e,t,r);case 4:return vi(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=hn(t,null,s,r):at(e,t,s,r),t.child;case 11:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Pt(s,l),Gc(e,t,s,l,r);case 7:return at(e,t,t.pendingProps,r),t.child;case 8:return at(e,t,t.pendingProps.children,r),t.child;case 12:return at(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,l=t.pendingProps,c=t.memoizedProps,p=l.value,Ee(so,s._currentValue),s._currentValue=p,c!==null)if(Et(c.value,p)){if(c.children===l.children&&!lt.current){t=Kt(e,t,r);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var w=c.dependencies;if(w!==null){p=c.child;for(var k=w.firstContext;k!==null;){if(k.context===s){if(c.tag===1){k=Xt(-1,r&-r),k.tag=2;var R=c.updateQueue;if(R!==null){R=R.shared;var W=R.pending;W===null?k.next=k:(k.next=W.next,W.next=k),R.pending=k}}c.lanes|=r,k=c.alternate,k!==null&&(k.lanes|=r),pi(c.return,r,t),w.lanes|=r;break}k=k.next}}else if(c.tag===10)p=c.type===t.type?null:c.child;else if(c.tag===18){if(p=c.return,p===null)throw Error(i(341));p.lanes|=r,w=p.alternate,w!==null&&(w.lanes|=r),pi(p,r,t),p=c.sibling}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===t){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}at(e,t,l.children,r),t=t.child}return t;case 9:return l=t.type,s=t.pendingProps.children,vn(t,r),l=jt(l),s=s(l),t.flags|=1,at(e,t,s,r),t.child;case 14:return s=t.type,l=Pt(s,t.pendingProps),l=Pt(s.type,l),Jc(e,t,s,l,r);case 15:return Zc(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,l=t.pendingProps,l=t.elementType===s?l:Pt(s,l),xo(e,t),t.tag=1,ut(s)?(e=!0,eo(t)):e=!1,vn(t,r),Wc(t,s,l),Pi(t,s,l,r),Li(null,t,s,!0,e,r);case 19:return id(e,t,r);case 22:return ed(e,t,r)}throw Error(i(156,t.tag))};function Dd(e,t){return cu(e,t)}function lh(e,t,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(e,t,r,s){return new lh(e,t,r,s)}function el(e){return e=e.prototype,!(!e||!e.isReactComponent)}function uh(e){if(typeof e=="function")return el(e)?1:0;if(e!=null){if(e=e.$$typeof,e===le)return 11;if(e===ae)return 14}return 2}function jr(e,t){var r=e.alternate;return r===null?(r=kt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Po(e,t,r,s,l,c){var p=2;if(s=e,typeof e=="function")el(e)&&(p=1);else if(typeof e=="string")p=5;else e:switch(e){case U:return qr(r.children,l,c,t);case I:p=8,l|=8;break;case Y:return e=kt(12,r,t,l|2),e.elementType=Y,e.lanes=c,e;case ve:return e=kt(13,r,t,l),e.elementType=ve,e.lanes=c,e;case X:return e=kt(19,r,t,l),e.elementType=X,e.lanes=c,e;case ue:return Do(r,l,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pe:p=10;break e;case ne:p=9;break e;case le:p=11;break e;case ae:p=14;break e;case fe:p=16,s=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=kt(p,r,t,l),t.elementType=e,t.type=s,t.lanes=c,t}function qr(e,t,r,s){return e=kt(7,e,s,t),e.lanes=r,e}function Do(e,t,r,s){return e=kt(22,e,s,t),e.elementType=ue,e.lanes=r,e.stateNode={isHidden:!1},e}function tl(e,t,r){return e=kt(6,e,null,t),e.lanes=r,e}function rl(e,t,r){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ch(e,t,r,s,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ts(0),this.expirationTimes=Ts(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ts(0),this.identifierPrefix=s,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function nl(e,t,r,s,l,c,p,w,k){return e=new ch(e,t,r,w,k),t===1?(t=1,c===!0&&(t|=8)):t=0,c=kt(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},gi(c),e}function dh(e,t,r){var s=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(o){console.error(o)}}return n(),cl.exports=Sh(),cl.exports}var qd;function Ch(){if(qd)return $o;qd=1;var n=Pf();return $o.createRoot=n.createRoot,$o.hydrateRoot=n.hydrateRoot,$o}var _h=Ch();Pf();/** * @remix-run/router v1.23.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 */function wa(){return wa=Object.assign?Object.assign.bind():function(n){for(var o=1;o"u")throw new Error(o)}function Df(n,o){if(!n){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function Th(){return Math.random().toString(36).substr(2,8)}function Qd(n,o){return{usr:n.state,key:n.key,idx:o}}function yl(n,o,i,u){return i===void 0&&(i=null),wa({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof o=="string"?En(o):o,{state:i,key:o&&o.key||u||Th()})}function Jo(n){let{pathname:o="/",search:i="",hash:u=""}=n;return i&&i!=="?"&&(o+=i.charAt(0)==="?"?i:"?"+i),u&&u!=="#"&&(o+=u.charAt(0)==="#"?u:"#"+u),o}function En(n){let o={};if(n){let i=n.indexOf("#");i>=0&&(o.hash=n.substr(i),n=n.substr(0,i));let u=n.indexOf("?");u>=0&&(o.search=n.substr(u),n=n.substr(0,u)),n&&(o.pathname=n)}return o}function Ph(n,o,i,u){u===void 0&&(u={});let{window:d=document.defaultView,v5Compat:f=!1}=u,m=d.history,v=Sr.Pop,g=null,j=h();j==null&&(j=0,m.replaceState(wa({},m.state,{idx:j}),""));function h(){return(m.state||{idx:null}).idx}function y(){v=Sr.Pop;let D=h(),B=D==null?null:D-j;j=D,g&&g({action:v,location:z.location,delta:B})}function N(D,B){v=Sr.Push;let C=yl(z.location,D,B);j=h()+1;let x=Qd(C,j),$=z.createHref(C);try{m.pushState(x,"",$)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;d.location.assign($)}f&&g&&g({action:v,location:z.location,delta:1})}function P(D,B){v=Sr.Replace;let C=yl(z.location,D,B);j=h();let x=Qd(C,j),$=z.createHref(C);m.replaceState(x,"",$),f&&g&&g({action:v,location:z.location,delta:0})}function A(D){let B=d.location.origin!=="null"?d.location.origin:d.location.href,C=typeof D=="string"?D:Jo(D);return C=C.replace(/ $/,"%20"),Ue(B,"No window.location.(origin|href) available to create URL for href: "+C),new URL(C,B)}let z={get action(){return v},get location(){return n(d,m)},listen(D){if(g)throw new Error("A history only accepts one active listener");return d.addEventListener(Vd,y),g=D,()=>{d.removeEventListener(Vd,y),g=null}},createHref(D){return o(d,D)},createURL:A,encodeLocation(D){let B=A(D);return{pathname:B.pathname,search:B.search,hash:B.hash}},push:N,replace:P,go(D){return m.go(D)}};return z}var Yd;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(Yd||(Yd={}));function Dh(n,o,i){return i===void 0&&(i="/"),Mh(n,o,i)}function Mh(n,o,i,u){let d=typeof o=="string"?En(o):o,f=Il(d.pathname||"/",i);if(f==null)return null;let m=Mf(n);Oh(m);let v=null;for(let g=0;v==null&&g{let g={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:m,route:f};g.relativePath.startsWith("/")&&(Ue(g.relativePath.startsWith(u),'Absolute route path "'+g.relativePath+'" nested under path '+('"'+u+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),g.relativePath=g.relativePath.slice(u.length));let j=_r([u,g.relativePath]),h=i.concat(g);f.children&&f.children.length>0&&(Ue(f.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+j+'".')),Mf(f.children,o,h,j)),!(f.path==null&&!f.index)&&o.push({path:j,score:Uh(j,f.index),routesMeta:h})};return n.forEach((f,m)=>{var v;if(f.path===""||!((v=f.path)!=null&&v.includes("?")))d(f,m);else for(let g of Of(f.path))d(f,m,g)}),o}function Of(n){let o=n.split("/");if(o.length===0)return[];let[i,...u]=o,d=i.endsWith("?"),f=i.replace(/\?$/,"");if(u.length===0)return d?[f,""]:[f];let m=Of(u.join("/")),v=[];return v.push(...m.map(g=>g===""?f:[f,g].join("/"))),d&&v.push(...m),v.map(g=>n.startsWith("/")&&g===""?"/":g)}function Oh(n){n.sort((o,i)=>o.score!==i.score?i.score-o.score:Fh(o.routesMeta.map(u=>u.childrenIndex),i.routesMeta.map(u=>u.childrenIndex)))}const Lh=/^:[\w-]+$/,Rh=3,Ih=2,zh=1,$h=10,Ah=-2,Xd=n=>n==="*";function Uh(n,o){let i=n.split("/"),u=i.length;return i.some(Xd)&&(u+=Ah),o&&(u+=Ih),i.filter(d=>!Xd(d)).reduce((d,f)=>d+(Lh.test(f)?Rh:f===""?zh:$h),u)}function Fh(n,o){return n.length===o.length&&n.slice(0,-1).every((u,d)=>u===o[d])?n[n.length-1]-o[o.length-1]:0}function Hh(n,o,i){let{routesMeta:u}=n,d={},f="/",m=[];for(let v=0;v{let{paramName:N,isOptional:P}=h;if(N==="*"){let z=v[y]||"";m=f.slice(0,f.length-z.length).replace(/(.)\/+$/,"$1")}const A=v[y];return P&&!A?j[N]=void 0:j[N]=(A||"").replace(/%2F/g,"/"),j},{}),pathname:f,pathnameBase:m,pattern:n}}function Wh(n,o,i){o===void 0&&(o=!1),i===void 0&&(i=!0),Df(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let u=[],d="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,v,g)=>(u.push({paramName:v,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(u.push({paramName:"*"}),d+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?d+="\\/*$":n!==""&&n!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,o?void 0:"i"),u]}function qh(n){try{return n.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return Df(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+o+").")),n}}function Il(n,o){if(o==="/")return n;if(!n.toLowerCase().startsWith(o.toLowerCase()))return null;let i=o.endsWith("/")?o.length-1:o.length,u=n.charAt(i);return u&&u!=="/"?null:n.slice(i)||"/"}function Vh(n,o){o===void 0&&(o="/");let{pathname:i,search:u="",hash:d=""}=typeof n=="string"?En(n):n;return{pathname:i?i.startsWith("/")?i:Qh(i,o):o,search:Kh(u),hash:Gh(d)}}function Qh(n,o){let i=o.replace(/\/+$/,"").split("/");return n.split("/").forEach(d=>{d===".."?i.length>1&&i.pop():d!=="."&&i.push(d)}),i.length>1?i.join("/"):"/"}function ml(n,o,i,u){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+o+"` field ["+JSON.stringify(u)+"]. Please separate it out to the ")+("`to."+i+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Yh(n){return n.filter((o,i)=>i===0||o.route.path&&o.route.path.length>0)}function zl(n,o){let i=Yh(n);return o?i.map((u,d)=>d===i.length-1?u.pathname:u.pathnameBase):i.map(u=>u.pathnameBase)}function $l(n,o,i,u){u===void 0&&(u=!1);let d;typeof n=="string"?d=En(n):(d=wa({},n),Ue(!d.pathname||!d.pathname.includes("?"),ml("?","pathname","search",d)),Ue(!d.pathname||!d.pathname.includes("#"),ml("#","pathname","hash",d)),Ue(!d.search||!d.search.includes("#"),ml("#","search","hash",d)));let f=n===""||d.pathname==="",m=f?"/":d.pathname,v;if(m==null)v=i;else{let y=o.length-1;if(!u&&m.startsWith("..")){let N=m.split("/");for(;N[0]==="..";)N.shift(),y-=1;d.pathname=N.join("/")}v=y>=0?o[y]:"/"}let g=Vh(d,v),j=m&&m!=="/"&&m.endsWith("/"),h=(f||m===".")&&i.endsWith("/");return!g.pathname.endsWith("/")&&(j||h)&&(g.pathname+="/"),g}const _r=n=>n.join("/").replace(/\/\/+/g,"/"),Xh=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),Kh=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,Gh=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function Jh(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const Lf=["post","put","patch","delete"];new Set(Lf);const Zh=["get",...Lf];new Set(Zh);/** * React Router v6.30.1 * * 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 */function ja(){return ja=Object.assign?Object.assign.bind():function(n){for(var o=1;o{v.current=!0}),_.useCallback(function(j,h){if(h===void 0&&(h={}),!v.current)return;if(typeof j=="number"){u.go(j);return}let y=$l(j,JSON.parse(m),f,h.relative==="path");n==null&&o!=="/"&&(y.pathname=y.pathname==="/"?o:_r([o,y.pathname])),(h.replace?u.replace:u.push)(y,h.state,h)},[o,u,m,f,n])}function zf(n,o){let{relative:i}=o===void 0?{}:o,{future:u}=_.useContext(Tr),{matches:d}=_.useContext(Pr),{pathname:f}=Pn(),m=JSON.stringify(zl(d,u.v7_relativeSplatPath));return _.useMemo(()=>$l(n,JSON.parse(m),f,i==="path"),[n,m,f,i])}function n0(n,o){return a0(n,o)}function a0(n,o,i,u){Tn()||Ue(!1);let{navigator:d}=_.useContext(Tr),{matches:f}=_.useContext(Pr),m=f[f.length-1],v=m?m.params:{};m&&m.pathname;let g=m?m.pathnameBase:"/";m&&m.route;let j=Pn(),h;if(o){var y;let D=typeof o=="string"?En(o):o;g==="/"||(y=D.pathname)!=null&&y.startsWith(g)||Ue(!1),h=D}else h=j;let N=h.pathname||"/",P=N;if(g!=="/"){let D=g.replace(/^\//,"").split("/");P="/"+N.replace(/^\//,"").split("/").slice(D.length).join("/")}let A=Dh(n,{pathname:P}),z=u0(A&&A.map(D=>Object.assign({},D,{params:Object.assign({},v,D.params),pathname:_r([g,d.encodeLocation?d.encodeLocation(D.pathname).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?g:_r([g,d.encodeLocation?d.encodeLocation(D.pathnameBase).pathname:D.pathnameBase])})),f,i,u);return o&&z?_.createElement(ss.Provider,{value:{location:ja({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Sr.Pop}},z):z}function o0(){let n=m0(),o=Jh(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,d={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},o),i?_.createElement("pre",{style:d},i):null,null)}const s0=_.createElement(o0,null);class i0 extends _.Component{constructor(o){super(o),this.state={location:o.location,revalidation:o.revalidation,error:o.error}}static getDerivedStateFromError(o){return{error:o}}static getDerivedStateFromProps(o,i){return i.location!==o.location||i.revalidation!=="idle"&&o.revalidation==="idle"?{error:o.error,location:o.location,revalidation:o.revalidation}:{error:o.error!==void 0?o.error:i.error,location:i.location,revalidation:o.revalidation||i.revalidation}}componentDidCatch(o,i){console.error("React Router caught the following error during render",o,i)}render(){return this.state.error!==void 0?_.createElement(Pr.Provider,{value:this.props.routeContext},_.createElement(Rf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function l0(n){let{routeContext:o,match:i,children:u}=n,d=_.useContext(Al);return d&&d.static&&d.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(d.staticContext._deepestRenderedBoundaryId=i.route.id),_.createElement(Pr.Provider,{value:o},u)}function u0(n,o,i,u){var d;if(o===void 0&&(o=[]),i===void 0&&(i=null),u===void 0&&(u=null),n==null){var f;if(!i)return null;if(i.errors)n=i.matches;else if((f=u)!=null&&f.v7_partialHydration&&o.length===0&&!i.initialized&&i.matches.length>0)n=i.matches;else return null}let m=n,v=(d=i)==null?void 0:d.errors;if(v!=null){let h=m.findIndex(y=>y.route.id&&v?.[y.route.id]!==void 0);h>=0||Ue(!1),m=m.slice(0,Math.min(m.length,h+1))}let g=!1,j=-1;if(i&&u&&u.v7_partialHydration)for(let h=0;h=0?m=m.slice(0,j+1):m=[m[0]];break}}}return m.reduceRight((h,y,N)=>{let P,A=!1,z=null,D=null;i&&(P=v&&y.route.id?v[y.route.id]:void 0,z=y.route.errorElement||s0,g&&(j<0&&N===0?(h0("route-fallback"),A=!0,D=null):j===N&&(A=!0,D=y.route.hydrateFallbackElement||null)));let B=o.concat(m.slice(0,N+1)),C=()=>{let x;return P?x=z:A?x=D:y.route.Component?x=_.createElement(y.route.Component,null):y.route.element?x=y.route.element:x=h,_.createElement(l0,{match:y,routeContext:{outlet:h,matches:B,isDataRoute:i!=null},children:x})};return i&&(y.route.ErrorBoundary||y.route.errorElement||N===0)?_.createElement(i0,{location:i.location,revalidation:i.revalidation,component:z,error:P,children:C(),routeContext:{outlet:null,matches:B,isDataRoute:!0}}):C()},null)}var $f=(function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n})($f||{}),Af=(function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n})(Af||{});function c0(n){let o=_.useContext(Al);return o||Ue(!1),o}function d0(n){let o=_.useContext(e0);return o||Ue(!1),o}function f0(n){let o=_.useContext(Pr);return o||Ue(!1),o}function Uf(n){let o=f0(),i=o.matches[o.matches.length-1];return i.route.id||Ue(!1),i.route.id}function m0(){var n;let o=_.useContext(Rf),i=d0(),u=Uf();return o!==void 0?o:(n=i.errors)==null?void 0:n[u]}function p0(){let{router:n}=c0($f.UseNavigateStable),o=Uf(Af.UseNavigateStable),i=_.useRef(!1);return If(()=>{i.current=!0}),_.useCallback(function(d,f){f===void 0&&(f={}),i.current&&(typeof d=="number"?n.navigate(d):n.navigate(d,ja({fromRouteId:o},f)))},[n,o])}const Kd={};function h0(n,o,i){Kd[n]||(Kd[n]=!0)}function g0(n,o){n?.v7_startTransition,n?.v7_relativeSplatPath}function v0(n){let{to:o,replace:i,state:u,relative:d}=n;Tn()||Ue(!1);let{future:f,static:m}=_.useContext(Tr),{matches:v}=_.useContext(Pr),{pathname:g}=Pn(),j=Dr(),h=$l(o,zl(v,f.v7_relativeSplatPath),g,d==="path"),y=JSON.stringify(h);return _.useEffect(()=>j(JSON.parse(y),{replace:i,state:u,relative:d}),[j,y,d,i,u]),null}function Lt(n){Ue(!1)}function y0(n){let{basename:o="/",children:i=null,location:u,navigationType:d=Sr.Pop,navigator:f,static:m=!1,future:v}=n;Tn()&&Ue(!1);let g=o.replace(/^\/*/,"/"),j=_.useMemo(()=>({basename:g,navigator:f,static:m,future:ja({v7_relativeSplatPath:!1},v)}),[g,v,f,m]);typeof u=="string"&&(u=En(u));let{pathname:h="/",search:y="",hash:N="",state:P=null,key:A="default"}=u,z=_.useMemo(()=>{let D=Il(h,g);return D==null?null:{location:{pathname:D,search:y,hash:N,state:P,key:A},navigationType:d}},[g,h,y,N,P,A,d]);return z==null?null:_.createElement(Tr.Provider,{value:j},_.createElement(ss.Provider,{children:i,value:z}))}function x0(n){let{children:o,location:i}=n;return n0(xl(o),i)}new Promise(()=>{});function xl(n,o){o===void 0&&(o=[]);let i=[];return _.Children.forEach(n,(u,d)=>{if(!_.isValidElement(u))return;let f=[...o,d];if(u.type===_.Fragment){i.push.apply(i,xl(u.props.children,f));return}u.type!==Lt&&Ue(!1),!u.props.index||!u.props.children||Ue(!1);let m={id:u.props.id||f.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,loader:u.props.loader,action:u.props.action,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(m.children=xl(u.props.children,f)),i.push(m)}),i}/** * React Router DOM v6.30.1 * * 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 */function wl(){return wl=Object.assign?Object.assign.bind():function(n){for(var o=1;o=0)&&(i[d]=n[d]);return i}function j0(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function N0(n,o){return n.button===0&&(!o||o==="_self")&&!j0(n)}const b0=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],k0="6";try{window.__reactRouterVersion=k0}catch{}const S0="startTransition",Gd=Nh[S0];function C0(n){let{basename:o,children:i,future:u,window:d}=n,f=_.useRef();f.current==null&&(f.current=Eh({window:d,v5Compat:!0}));let m=f.current,[v,g]=_.useState({action:m.action,location:m.location}),{v7_startTransition:j}=u||{},h=_.useCallback(y=>{j&&Gd?Gd(()=>g(y)):g(y)},[g,j]);return _.useLayoutEffect(()=>m.listen(h),[m,h]),_.useEffect(()=>g0(u),[u]),_.createElement(y0,{basename:o,children:i,location:v.location,navigationType:v.action,navigator:m,future:u})}const _0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",E0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Jt=_.forwardRef(function(o,i){let{onClick:u,relative:d,reloadDocument:f,replace:m,state:v,target:g,to:j,preventScrollReset:h,viewTransition:y}=o,N=w0(o,b0),{basename:P}=_.useContext(Tr),A,z=!1;if(typeof j=="string"&&E0.test(j)&&(A=j,_0))try{let x=new URL(window.location.href),$=j.startsWith("//")?new URL(x.protocol+j):new URL(j),M=Il($.pathname,P);$.origin===x.origin&&M!=null?j=M+$.search+$.hash:z=!0}catch{}let D=t0(j,{relative:d}),B=T0(j,{replace:m,state:v,target:g,preventScrollReset:h,relative:d,viewTransition:y});function C(x){u&&u(x),x.defaultPrevented||B(x)}return _.createElement("a",wl({},N,{href:A||D,onClick:z||f?u:C,ref:i,target:g}))});var Jd;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(Jd||(Jd={}));var Zd;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(Zd||(Zd={}));function T0(n,o){let{target:i,replace:u,state:d,preventScrollReset:f,relative:m,viewTransition:v}=o===void 0?{}:o,g=Dr(),j=Pn(),h=zf(n,{relative:m});return _.useCallback(y=>{if(N0(y,i)){y.preventDefault();let N=u!==void 0?u:Jo(j)===Jo(h);g(n,{replace:N,state:d,preventScrollReset:f,relative:m,viewTransition:v})}},[j,g,h,u,d,i,n,f,m,v])}let P0={data:""},D0=n=>typeof window=="object"?((n?n.querySelector("#_goober"):window._goober)||Object.assign((n||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:n||P0,M0=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,O0=/\/\*[^]*?\*\/| +/g,ef=/\n+/g,kr=(n,o)=>{let i="",u="",d="";for(let f in n){let m=n[f];f[0]=="@"?f[1]=="i"?i=f+" "+m+";":u+=f[1]=="f"?kr(m,f):f+"{"+kr(m,f[1]=="k"?"":o)+"}":typeof m=="object"?u+=kr(m,o?o.replace(/([^,])+/g,v=>f.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,g=>/&/.test(g)?g.replace(/&/g,v):v?v+" "+g:g)):f):m!=null&&(f=/^--/.test(f)?f:f.replace(/[A-Z]/g,"-$&").toLowerCase(),d+=kr.p?kr.p(f,m):f+":"+m+";")}return i+(o&&d?o+"{"+d+"}":d)+u},Zt={},Ff=n=>{if(typeof n=="object"){let o="";for(let i in n)o+=i+Ff(n[i]);return o}return n},L0=(n,o,i,u,d)=>{let f=Ff(n),m=Zt[f]||(Zt[f]=(g=>{let j=0,h=11;for(;j>>0;return"go"+h})(f));if(!Zt[m]){let g=f!==n?n:(j=>{let h,y,N=[{}];for(;h=M0.exec(j.replace(O0,""));)h[4]?N.shift():h[3]?(y=h[3].replace(ef," ").trim(),N.unshift(N[0][y]=N[0][y]||{})):N[0][h[1]]=h[2].replace(ef," ").trim();return N[0]})(n);Zt[m]=kr(d?{["@keyframes "+m]:g}:g,i?"":"."+m)}let v=i&&Zt.g?Zt.g:null;return i&&(Zt.g=Zt[m]),((g,j,h,y)=>{y?j.data=j.data.replace(y,g):j.data.indexOf(g)===-1&&(j.data=h?g+j.data:j.data+g)})(Zt[m],o,u,v),m},R0=(n,o,i)=>n.reduce((u,d,f)=>{let m=o[f];if(m&&m.call){let v=m(i),g=v&&v.props&&v.props.className||/^go/.test(v)&&v;m=g?"."+g:v&&typeof v=="object"?v.props?"":kr(v,""):v===!1?"":v}return u+d+(m??"")},"");function is(n){let o=this||{},i=n.call?n(o.p):n;return L0(i.unshift?i.raw?R0(i,[].slice.call(arguments,1),o.p):i.reduce((u,d)=>Object.assign(u,d&&d.call?d(o.p):d),{}):i,D0(o.target),o.g,o.o,o.k)}let Hf,jl,Nl;is.bind({g:1});let tr=is.bind({k:1});function I0(n,o,i,u){kr.p=o,Hf=n,jl=i,Nl=u}function Mr(n,o){let i=this||{};return function(){let u=arguments;function d(f,m){let v=Object.assign({},f),g=v.className||d.className;i.p=Object.assign({theme:jl&&jl()},v),i.o=/ *go\d+/.test(g),v.className=is.apply(i,u)+(g?" "+g:"");let j=n;return n[0]&&(j=v.as||n,delete v.as),Nl&&j[0]&&Nl(v),Hf(j,v)}return d}}var z0=n=>typeof n=="function",Zo=(n,o)=>z0(n)?n(o):n,$0=(()=>{let n=0;return()=>(++n).toString()})(),Bf=(()=>{let n;return()=>{if(n===void 0&&typeof window<"u"){let o=matchMedia("(prefers-reduced-motion: reduce)");n=!o||o.matches}return n}})(),A0=20,Ul="default",Wf=(n,o)=>{let{toastLimit:i}=n.settings;switch(o.type){case 0:return{...n,toasts:[o.toast,...n.toasts].slice(0,i)};case 1:return{...n,toasts:n.toasts.map(m=>m.id===o.toast.id?{...m,...o.toast}:m)};case 2:let{toast:u}=o;return Wf(n,{type:n.toasts.find(m=>m.id===u.id)?1:0,toast:u});case 3:let{toastId:d}=o;return{...n,toasts:n.toasts.map(m=>m.id===d||d===void 0?{...m,dismissed:!0,visible:!1}:m)};case 4:return o.toastId===void 0?{...n,toasts:[]}:{...n,toasts:n.toasts.filter(m=>m.id!==o.toastId)};case 5:return{...n,pausedAt:o.time};case 6:let f=o.time-(n.pausedAt||0);return{...n,pausedAt:void 0,toasts:n.toasts.map(m=>({...m,pauseDuration:m.pauseDuration+f}))}}},Ho=[],qf={toasts:[],pausedAt:void 0,settings:{toastLimit:A0}},Bt={},Vf=(n,o=Ul)=>{Bt[o]=Wf(Bt[o]||qf,n),Ho.forEach(([i,u])=>{i===o&&u(Bt[o])})},Qf=n=>Object.keys(Bt).forEach(o=>Vf(n,o)),U0=n=>Object.keys(Bt).find(o=>Bt[o].toasts.some(i=>i.id===n)),ls=(n=Ul)=>o=>{Vf(o,n)},F0={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},H0=(n={},o=Ul)=>{let[i,u]=_.useState(Bt[o]||qf),d=_.useRef(Bt[o]);_.useEffect(()=>(d.current!==Bt[o]&&u(Bt[o]),Ho.push([o,u]),()=>{let m=Ho.findIndex(([v])=>v===o);m>-1&&Ho.splice(m,1)}),[o]);let f=i.toasts.map(m=>{var v,g,j;return{...n,...n[m.type],...m,removeDelay:m.removeDelay||((v=n[m.type])==null?void 0:v.removeDelay)||n?.removeDelay,duration:m.duration||((g=n[m.type])==null?void 0:g.duration)||n?.duration||F0[m.type],style:{...n.style,...(j=n[m.type])==null?void 0:j.style,...m.style}}});return{...i,toasts:f}},B0=(n,o="blank",i)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:o,ariaProps:{role:"status","aria-live":"polite"},message:n,pauseDuration:0,...i,id:i?.id||$0()}),ka=n=>(o,i)=>{let u=B0(o,n,i);return ls(u.toasterId||U0(u.id))({type:2,toast:u}),u.id},Ve=(n,o)=>ka("blank")(n,o);Ve.error=ka("error");Ve.success=ka("success");Ve.loading=ka("loading");Ve.custom=ka("custom");Ve.dismiss=(n,o)=>{let i={type:3,toastId:n};o?ls(o)(i):Qf(i)};Ve.dismissAll=n=>Ve.dismiss(void 0,n);Ve.remove=(n,o)=>{let i={type:4,toastId:n};o?ls(o)(i):Qf(i)};Ve.removeAll=n=>Ve.remove(void 0,n);Ve.promise=(n,o,i)=>{let u=Ve.loading(o.loading,{...i,...i?.loading});return typeof n=="function"&&(n=n()),n.then(d=>{let f=o.success?Zo(o.success,d):void 0;return f?Ve.success(f,{id:u,...i,...i?.success}):Ve.dismiss(u),d}).catch(d=>{let f=o.error?Zo(o.error,d):void 0;f?Ve.error(f,{id:u,...i,...i?.error}):Ve.dismiss(u)}),n};var W0=1e3,q0=(n,o="default")=>{let{toasts:i,pausedAt:u}=H0(n,o),d=_.useRef(new Map).current,f=_.useCallback((y,N=W0)=>{if(d.has(y))return;let P=setTimeout(()=>{d.delete(y),m({type:4,toastId:y})},N);d.set(y,P)},[]);_.useEffect(()=>{if(u)return;let y=Date.now(),N=i.map(P=>{if(P.duration===1/0)return;let A=(P.duration||0)+P.pauseDuration-(y-P.createdAt);if(A<0){P.visible&&Ve.dismiss(P.id);return}return setTimeout(()=>Ve.dismiss(P.id,o),A)});return()=>{N.forEach(P=>P&&clearTimeout(P))}},[i,u,o]);let m=_.useCallback(ls(o),[o]),v=_.useCallback(()=>{m({type:5,time:Date.now()})},[m]),g=_.useCallback((y,N)=>{m({type:1,toast:{id:y,height:N}})},[m]),j=_.useCallback(()=>{u&&m({type:6,time:Date.now()})},[u,m]),h=_.useCallback((y,N)=>{let{reverseOrder:P=!1,gutter:A=8,defaultPosition:z}=N||{},D=i.filter(x=>(x.position||z)===(y.position||z)&&x.height),B=D.findIndex(x=>x.id===y.id),C=D.filter((x,$)=>$x.visible).slice(...P?[C+1]:[0,C]).reduce((x,$)=>x+($.height||0)+A,0)},[i]);return _.useEffect(()=>{i.forEach(y=>{if(y.dismissed)f(y.id,y.removeDelay);else{let N=d.get(y.id);N&&(clearTimeout(N),d.delete(y.id))}})},[i,f]),{toasts:i,handlers:{updateHeight:g,startPause:v,endPause:j,calculateOffset:h}}},V0=tr` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,Q0=tr` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,Y0=tr` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,X0=Mr("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${n=>n.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${V0} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${Q0} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${n=>n.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${Y0} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,K0=tr` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,G0=Mr("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${n=>n.secondary||"#e0e0e0"}; border-right-color: ${n=>n.primary||"#616161"}; animation: ${K0} 1s linear infinite; `,J0=tr` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,Z0=tr` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,eg=Mr("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${n=>n.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${J0} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${Z0} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${n=>n.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,tg=Mr("div")` position: absolute; `,rg=Mr("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,ng=tr` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,ag=Mr("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${ng} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,og=({toast:n})=>{let{icon:o,type:i,iconTheme:u}=n;return o!==void 0?typeof o=="string"?_.createElement(ag,null,o):o:i==="blank"?null:_.createElement(rg,null,_.createElement(G0,{...u}),i!=="loading"&&_.createElement(tg,null,i==="error"?_.createElement(X0,{...u}):_.createElement(eg,{...u})))},sg=n=>` 0% {transform: translate3d(0,${n*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,ig=n=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${n*-150}%,-1px) scale(.6); opacity:0;} `,lg="0%{opacity:0;} 100%{opacity:1;}",ug="0%{opacity:1;} 100%{opacity:0;}",cg=Mr("div")` display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; `,dg=Mr("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,fg=(n,o)=>{let i=n.includes("top")?1:-1,[u,d]=Bf()?[lg,ug]:[sg(i),ig(i)];return{animation:o?`${tr(u)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${tr(d)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},mg=_.memo(({toast:n,position:o,style:i,children:u})=>{let d=n.height?fg(n.position||o||"top-center",n.visible):{opacity:0},f=_.createElement(og,{toast:n}),m=_.createElement(dg,{...n.ariaProps},Zo(n.message,n));return _.createElement(cg,{className:n.className,style:{...d,...i,...n.style}},typeof u=="function"?u({icon:f,message:m}):_.createElement(_.Fragment,null,f,m))});I0(_.createElement);var pg=({id:n,className:o,style:i,onHeightUpdate:u,children:d})=>{let f=_.useCallback(m=>{if(m){let v=()=>{let g=m.getBoundingClientRect().height;u(n,g)};v(),new MutationObserver(v).observe(m,{subtree:!0,childList:!0,characterData:!0})}},[n,u]);return _.createElement("div",{ref:f,className:o,style:i},d)},hg=(n,o)=>{let i=n.includes("top"),u=i?{top:0}:{bottom:0},d=n.includes("center")?{justifyContent:"center"}:n.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Bf()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${o*(i?1:-1)}px)`,...u,...d}},gg=is` z-index: 9999; > * { pointer-events: auto; } `,Ao=16,vg=({reverseOrder:n,position:o="top-center",toastOptions:i,gutter:u,children:d,toasterId:f,containerStyle:m,containerClassName:v})=>{let{toasts:g,handlers:j}=q0(i,f);return _.createElement("div",{"data-rht-toaster":f||"",style:{position:"fixed",zIndex:9999,top:Ao,left:Ao,right:Ao,bottom:Ao,pointerEvents:"none",...m},className:v,onMouseEnter:j.startPause,onMouseLeave:j.endPause},g.map(h=>{let y=h.position||o,N=j.calculateOffset(h,{reverseOrder:n,gutter:u,defaultPosition:o}),P=hg(y,N);return _.createElement(pg,{id:h.id,key:h.id,onHeightUpdate:j.updateHeight,className:h.visible?gg:"",style:P},h.type==="custom"?Zo(h.message,h):d?d(h):_.createElement(mg,{toast:h,position:y}))}))},ce=Ve;/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yg=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),xg=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,i,u)=>u?u.toUpperCase():i.toLowerCase()),tf=n=>{const o=xg(n);return o.charAt(0).toUpperCase()+o.slice(1)},Yf=(...n)=>n.filter((o,i,u)=>!!o&&o.trim()!==""&&u.indexOf(o)===i).join(" ").trim(),wg=n=>{for(const o in n)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var jg={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ng=_.forwardRef(({color:n="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:u,className:d="",children:f,iconNode:m,...v},g)=>_.createElement("svg",{ref:g,...jg,width:o,height:o,stroke:n,strokeWidth:u?Number(i)*24/Number(o):i,className:Yf("lucide",d),...!f&&!wg(v)&&{"aria-hidden":"true"},...v},[...m.map(([j,h])=>_.createElement(j,h)),...Array.isArray(f)?f:[f]]));/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Te=(n,o)=>{const i=_.forwardRef(({className:u,...d},f)=>_.createElement(Ng,{ref:f,iconNode:o,className:Yf(`lucide-${yg(tf(n))}`,`lucide-${n}`,u),...d}));return i.displayName=tf(n),i};/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bg=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],bl=Te("activity",bg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kg=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Er=Te("calendar",kg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sg=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Xf=Te("circle-alert",Sg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Cg=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],es=Te("circle-check-big",Cg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _g=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],rf=Te("circle-x",_g);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Eg=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],kl=Te("clipboard",Eg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tg=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Sn=Te("clock",Tg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pg=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Dg=Te("eye",Pg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Mg=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],us=Te("file-text",Mg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Og=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],Lg=Te("funnel",Og);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Rg=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],nf=Te("heart",Rg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ig=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Kf=Te("lock",Ig);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zg=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Gf=Te("log-out",zg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $g=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Fl=Te("mail",$g);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ag=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Ug=Te("map-pin",Ag);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Fg=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],Jf=Te("phone",Fg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hg=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],af=Te("plus",Hg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bg=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Bo=Te("search",Bg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wg=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],qg=Te("square-pen",Wg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Vg=[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]],pl=Te("stethoscope",Vg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qg=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Yg=Te("trash-2",Qg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xg=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],of=Te("user-check",Xg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kg=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],ts=Te("user-plus",Kg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gg=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],_n=Te("user",Gg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jg=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Yr=Te("users",Jg);/** * @license lucide-react v0.540.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zg=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Wo=Te("x",Zg),ev=()=>{const n=Pn(),o=i=>n.pathname===i;return a.jsx("header",{className:"bg-white shadow-lg border-b border-gray-200",children:a.jsxs("div",{className:"container mx-auto px-4",children:[a.jsxs("div",{className:"flex items-center justify-between h-16",children:[a.jsxs(Jt,{to:"/",className:"flex items-center space-x-3",children:[a.jsx("div",{className:"bg-gradient-to-r from-blue-700 to-blue-400 p-2 rounded-lg",children:a.jsx(pl,{className:"h-6 w-6 text-white"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold text-gray-900",children:"MediConnect"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Sistema de Agendamento"})]})]}),a.jsxs("nav",{className:"hidden md:flex items-center space-x-1",children:[a.jsxs(Jt,{to:"/",className:`flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${o("/")?"bg-gradient-to-r from-blue-700 to-blue-400 text-white":"text-gray-600 hover:text-blue-600 hover:bg-blue-50"}`,children:[a.jsx(nf,{className:"w-4 h-4"}),a.jsx("span",{children:"Início"})]}),a.jsxs(Jt,{to:"/paciente",className:`flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${o("/paciente")||o("/agendamento")?"bg-gradient-to-r from-blue-700 to-blue-400 text-white":"text-gray-600 hover:text-blue-600 hover:bg-blue-50"}`,children:[a.jsx(_n,{className:"w-4 h-4"}),a.jsx("span",{children:"Sou Paciente"})]}),a.jsxs(Jt,{to:"/login-secretaria",className:`flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${o("/login-secretaria")||o("/secretaria")?"bg-gradient-to-r from-green-600 to-green-400 text-white":"text-gray-600 hover:text-green-600 hover:bg-green-50"}`,children:[a.jsx(kl,{className:"w-4 h-4"}),a.jsx("span",{children:" Menu da Secretaria"})]}),a.jsxs(Jt,{to:"/login-medico",className:`flex items-center space-x-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${o("/login-medico")||o("/medico")?"bg-gradient-to-r from-indigo-600 to-indigo-400 text-white":"text-gray-600 hover:text-indigo-600 hover:bg-indigo-50"}`,children:[a.jsx(pl,{className:"w-4 h-4"}),a.jsx("span",{children:"Sou Médico"})]})]}),a.jsx("div",{className:"md:hidden",children:a.jsx("button",{className:"text-gray-600 hover:text-blue-600",children:a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})})]}),a.jsx("div",{className:"md:hidden border-t border-gray-200 py-3",children:a.jsxs("div",{className:"flex flex-col space-y-2",children:[a.jsxs(Jt,{to:"/",className:`flex items-center space-x-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${o("/")?"bg-gradient-to-r from-blue-700 to-blue-400 text-white":"text-gray-600 hover:text-blue-600 hover:bg-blue-50"}`,children:[a.jsx(nf,{className:"w-4 h-4"}),a.jsx("span",{children:"Início"})]}),a.jsxs(Jt,{to:"/paciente",className:`flex items-center space-x-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${o("/paciente")||o("/agendamento")?"bg-gradient-to-r from-blue-700 to-blue-400 text-white":"text-gray-600 hover:text-blue-600 hover:bg-blue-50"}`,children:[a.jsx(_n,{className:"w-4 h-4"}),a.jsx("span",{children:"Sou Paciente"})]}),a.jsxs(Jt,{to:"/login-secretaria",className:`flex items-center space-x-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${o("/login-secretaria")||o("/secretaria")?"bg-gradient-to-r from-green-600 to-green-400 text-white":"text-gray-600 hover:text-green-600 hover:bg-green-50"}`,children:[a.jsx(kl,{className:"w-4 h-4"}),a.jsx("span",{children:"Secretaria"})]}),a.jsxs(Jt,{to:"/login-medico",className:`flex items-center space-x-2 px-3 py-2 rounded-lg text-sm font-medium transition-colors ${o("/login-medico")||o("/medico")?"bg-gradient-to-r from-indigo-600 to-indigo-400 text-white":"text-gray-600 hover:text-indigo-600 hover:bg-indigo-50"}`,children:[a.jsx(pl,{className:"w-4 h-4"}),a.jsx("span",{children:"Sou Médico"})]})]})})]})})},Je=[];for(let n=0;n<256;++n)Je.push((n+256).toString(16).slice(1));function tv(n,o=0){return(Je[n[o+0]]+Je[n[o+1]]+Je[n[o+2]]+Je[n[o+3]]+"-"+Je[n[o+4]]+Je[n[o+5]]+"-"+Je[n[o+6]]+Je[n[o+7]]+"-"+Je[n[o+8]]+Je[n[o+9]]+"-"+Je[n[o+10]]+Je[n[o+11]]+Je[n[o+12]]+Je[n[o+13]]+Je[n[o+14]]+Je[n[o+15]]).toLowerCase()}let hl;const rv=new Uint8Array(16);function nv(){if(!hl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");hl=crypto.getRandomValues.bind(crypto)}return hl(rv)}const av=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),sf={randomUUID:av};function ov(n,o,i){if(sf.randomUUID&&!n)return sf.randomUUID();n=n||{};const u=n.random??n.rng?.()??nv();if(u.length<16)throw new Error("Random bytes length must be >= 16");return u[6]=u[6]&15|64,u[8]=u[8]&63|128,tv(u)}var qo={exports:{}};function sv(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Vo={exports:{}};const iv={},lv=Object.freeze(Object.defineProperty({__proto__:null,default:iv},Symbol.toStringTag,{value:"Module"})),uv=yh(lv);var cv=Vo.exports,lf;function Sa(){return lf||(lf=1,(function(n,o){(function(i,u){n.exports=u()})(cv,function(){var i=i||(function(u,d){var f;if(typeof window<"u"&&window.crypto&&(f=window.crypto),typeof self<"u"&&self.crypto&&(f=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(f=globalThis.crypto),!f&&typeof window<"u"&&window.msCrypto&&(f=window.msCrypto),!f&&typeof il<"u"&&il.crypto&&(f=il.crypto),!f&&typeof sv=="function")try{f=uv}catch{}var m=function(){if(f){if(typeof f.getRandomValues=="function")try{return f.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof f.randomBytes=="function")try{return f.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},v=Object.create||(function(){function C(){}return function(x){var $;return C.prototype=x,$=new C,C.prototype=null,$}})(),g={},j=g.lib={},h=j.Base=(function(){return{extend:function(C){var x=v(this);return C&&x.mixIn(C),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var C=this.extend();return C.init.apply(C,arguments),C},init:function(){},mixIn:function(C){for(var x in C)C.hasOwnProperty(x)&&(this[x]=C[x]);C.hasOwnProperty("toString")&&(this.toString=C.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),y=j.WordArray=h.extend({init:function(C,x){C=this.words=C||[],x!=d?this.sigBytes=x:this.sigBytes=C.length*4},toString:function(C){return(C||P).stringify(this)},concat:function(C){var x=this.words,$=C.words,M=this.sigBytes,L=C.sigBytes;if(this.clamp(),M%4)for(var U=0;U>>2]>>>24-U%4*8&255;x[M+U>>>2]|=I<<24-(M+U)%4*8}else for(var Y=0;Y>>2]=$[Y>>>2];return this.sigBytes+=L,this},clamp:function(){var C=this.words,x=this.sigBytes;C[x>>>2]&=4294967295<<32-x%4*8,C.length=u.ceil(x/4)},clone:function(){var C=h.clone.call(this);return C.words=this.words.slice(0),C},random:function(C){for(var x=[],$=0;$>>2]>>>24-L%4*8&255;M.push((U>>>4).toString(16)),M.push((U&15).toString(16))}return M.join("")},parse:function(C){for(var x=C.length,$=[],M=0;M>>3]|=parseInt(C.substr(M,2),16)<<24-M%8*4;return new y.init($,x/2)}},A=N.Latin1={stringify:function(C){for(var x=C.words,$=C.sigBytes,M=[],L=0;L<$;L++){var U=x[L>>>2]>>>24-L%4*8&255;M.push(String.fromCharCode(U))}return M.join("")},parse:function(C){for(var x=C.length,$=[],M=0;M>>2]|=(C.charCodeAt(M)&255)<<24-M%4*8;return new y.init($,x)}},z=N.Utf8={stringify:function(C){try{return decodeURIComponent(escape(A.stringify(C)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(C){return A.parse(unescape(encodeURIComponent(C)))}},D=j.BufferedBlockAlgorithm=h.extend({reset:function(){this._data=new y.init,this._nDataBytes=0},_append:function(C){typeof C=="string"&&(C=z.parse(C)),this._data.concat(C),this._nDataBytes+=C.sigBytes},_process:function(C){var x,$=this._data,M=$.words,L=$.sigBytes,U=this.blockSize,I=U*4,Y=L/I;C?Y=u.ceil(Y):Y=u.max((Y|0)-this._minBufferSize,0);var pe=Y*U,ne=u.min(pe*4,L);if(pe){for(var le=0;le>>2]>>>24-P%4*8&255,z=j[P+1>>>2]>>>24-(P+1)%4*8&255,D=j[P+2>>>2]>>>24-(P+2)%4*8&255,B=A<<16|z<<8|D,C=0;C<4&&P+C*.75>>6*(3-C)&63));var x=y.charAt(64);if(x)for(;N.length%4;)N.push(x);return N.join("")},parse:function(g){var j=g.length,h=this._map,y=this._reverseMap;if(!y){y=this._reverseMap=[];for(var N=0;N>>6-P%4*2,D=A|z;y[N>>>2]|=D<<24-N%4*8,N++}return f.create(y,N)}})(),i.enc.Base64})})(qo)),qo.exports}var mv=fv();const pv=ba(mv);var Qo={exports:{}},hv=Qo.exports,cf;function gv(){return cf||(cf=1,(function(n,o){(function(i,u){n.exports=u(Sa())})(hv,function(i){return i.enc.Hex})})(Qo)),Qo.exports}var vv=gv();const yv=ba(vv);var Yo={exports:{}},Xo={exports:{}},xv=Xo.exports,df;function Zf(){return df||(df=1,(function(n,o){(function(i,u){n.exports=u(Sa())})(xv,function(i){return(function(u){var d=i,f=d.lib,m=f.WordArray,v=f.Hasher,g=d.algo,j=[],h=[];(function(){function P(B){for(var C=u.sqrt(B),x=2;x<=C;x++)if(!(B%x))return!1;return!0}function A(B){return(B-(B|0))*4294967296|0}for(var z=2,D=0;D<64;)P(z)&&(D<8&&(j[D]=A(u.pow(z,1/2))),h[D]=A(u.pow(z,1/3)),D++),z++})();var y=[],N=g.SHA256=v.extend({_doReset:function(){this._hash=new m.init(j.slice(0))},_doProcessBlock:function(P,A){for(var z=this._hash.words,D=z[0],B=z[1],C=z[2],x=z[3],$=z[4],M=z[5],L=z[6],U=z[7],I=0;I<64;I++){if(I<16)y[I]=P[A+I]|0;else{var Y=y[I-15],pe=(Y<<25|Y>>>7)^(Y<<14|Y>>>18)^Y>>>3,ne=y[I-2],le=(ne<<15|ne>>>17)^(ne<<13|ne>>>19)^ne>>>10;y[I]=pe+y[I-7]+le+y[I-16]}var ve=$&M^~$&L,X=D&B^D&C^B&C,ae=(D<<30|D>>>2)^(D<<19|D>>>13)^(D<<10|D>>>22),fe=($<<26|$>>>6)^($<<21|$>>>11)^($<<7|$>>>25),ue=U+fe+ve+h[I]+y[I],Q=ae+X;U=L,L=M,M=$,$=x+ue|0,x=C,C=B,B=D,D=ue+Q|0}z[0]=z[0]+D|0,z[1]=z[1]+B|0,z[2]=z[2]+C|0,z[3]=z[3]+x|0,z[4]=z[4]+$|0,z[5]=z[5]+M|0,z[6]=z[6]+L|0,z[7]=z[7]+U|0},_doFinalize:function(){var P=this._data,A=P.words,z=this._nDataBytes*8,D=P.sigBytes*8;return A[D>>>5]|=128<<24-D%32,A[(D+64>>>9<<4)+14]=u.floor(z/4294967296),A[(D+64>>>9<<4)+15]=z,P.sigBytes=A.length*4,this._process(),this._hash},clone:function(){var P=v.clone.call(this);return P._hash=this._hash.clone(),P}});d.SHA256=v._createHelper(N),d.HmacSHA256=v._createHmacHelper(N)})(Math),i.SHA256})})(Xo)),Xo.exports}var Ko={exports:{}},wv=Ko.exports,ff;function jv(){return ff||(ff=1,(function(n,o){(function(i,u){n.exports=u(Sa())})(wv,function(i){(function(){var u=i,d=u.lib,f=d.Base,m=u.enc,v=m.Utf8,g=u.algo;g.HMAC=f.extend({init:function(j,h){j=this._hasher=new j.init,typeof h=="string"&&(h=v.parse(h));var y=j.blockSize,N=y*4;h.sigBytes>N&&(h=j.finalize(h)),h.clamp();for(var P=this._oKey=h.clone(),A=this._iKey=h.clone(),z=P.words,D=A.words,B=0;B`${gl(n)}=${Sl(i)}`).join("&"):`${gl(n)}=${Sl(o)}`:gl(n)}function Qv(n){return Object.keys(n).filter(o=>n[o]!==void 0).map(o=>Vv(o,n[o])).filter(Boolean).join("&")}const Yv=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Xv=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Kv=/^([/\\]\s*){2,}[^/\\]/,Gv=/^\.?\//;function tm(n,o={}){return typeof o=="boolean"&&(o={acceptRelative:o}),o.strict?Yv.test(n):Xv.test(n)||(o.acceptRelative?Kv.test(n):!1)}function Jv(n="",o){return n.endsWith("/")}function Zv(n="",o){return(Jv(n)?n.slice(0,-1):n)||"/"}function ey(n="",o){return n.endsWith("/")?n:n+"/"}function ty(n,o){if(ny(o)||tm(n))return n;const i=Zv(o);return n.startsWith(i)?n:oy(i,n)}function ry(n,o){const i=sy(n),u={...qv(i.search),...o};return i.search=Qv(u),iy(i)}function ny(n){return!n||n==="/"}function ay(n){return n&&n!=="/"}function oy(n,...o){let i=n||"";for(const u of o.filter(d=>ay(d)))if(i){const d=u.replace(Gv,"");i=ey(i)+d}else i=u;return i}const rm=Symbol.for("ufo:protocolRelative");function sy(n="",o){const i=n.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(i){const[,y,N=""]=i;return{protocol:y.toLowerCase(),pathname:N,href:y+N,auth:"",host:"",search:"",hash:""}}if(!tm(n,{acceptRelative:!0}))return pf(n);const[,u="",d,f=""]=n.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,m="",v=""]=f.match(/([^#/?]*)(.*)?/)||[];u==="file:"&&(v=v.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:g,search:j,hash:h}=pf(v);return{protocol:u.toLowerCase(),auth:d?d.slice(0,Math.max(0,d.length-1)):"",host:m,pathname:g,search:j,hash:h,[rm]:!u}}function pf(n=""){const[o="",i="",u=""]=(n.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:o,search:i,hash:u}}function iy(n){const o=n.pathname||"",i=n.search?(n.search.startsWith("?")?"":"?")+n.search:"",u=n.hash||"",d=n.auth?n.auth+"@":"",f=n.host||"";return(n.protocol||n[rm]?(n.protocol||"")+"//":"")+d+f+o+i+u}class ly extends Error{constructor(o,i){super(o,i),this.name="FetchError",i?.cause&&!this.cause&&(this.cause=i.cause)}}function uy(n){const o=n.error?.message||n.error?.toString()||"",i=n.request?.method||n.options?.method||"GET",u=n.request?.url||String(n.request)||"/",d=`[${i}] ${JSON.stringify(u)}`,f=n.response?`${n.response.status} ${n.response.statusText}`:"",m=`${d}: ${f}${o?` ${o}`:""}`,v=new ly(m,n.error?{cause:n.error}:void 0);for(const g of["request","options","response"])Object.defineProperty(v,g,{get(){return n[g]}});for(const[g,j]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(v,g,{get(){return n.response&&n.response[j]}});return v}const cy=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function hf(n="GET"){return cy.has(n.toUpperCase())}function dy(n){if(n===void 0)return!1;const o=typeof n;return o==="string"||o==="number"||o==="boolean"||o===null?!0:o!=="object"?!1:Array.isArray(n)?!0:n.buffer?!1:n.constructor&&n.constructor.name==="Object"||typeof n.toJSON=="function"}const fy=new Set(["image/svg","application/xml","application/xhtml","application/html"]),my=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function py(n=""){if(!n)return"json";const o=n.split(";").shift()||"";return my.test(o)?"json":fy.has(o)||o.startsWith("text/")?"text":"blob"}function hy(n,o,i,u){const d=gy(o?.headers??n?.headers,i?.headers,u);let f;return(i?.query||i?.params||o?.params||o?.query)&&(f={...i?.params,...i?.query,...o?.params,...o?.query}),{...i,...o,query:f,params:f,headers:d}}function gy(n,o,i){if(!o)return new i(n);const u=new i(o);if(n)for(const[d,f]of Symbol.iterator in n||Array.isArray(n)?n:new i(n))u.set(d,f);return u}async function Uo(n,o){if(o)if(Array.isArray(o))for(const i of o)await i(n);else await o(n)}const vy=new Set([408,409,425,429,500,502,503,504]),yy=new Set([101,204,205,304]);function nm(n={}){const{fetch:o=globalThis.fetch,Headers:i=globalThis.Headers,AbortController:u=globalThis.AbortController}=n;async function d(v){const g=v.error&&v.error.name==="AbortError"&&!v.options.timeout||!1;if(v.options.retry!==!1&&!g){let h;typeof v.options.retry=="number"?h=v.options.retry:h=hf(v.options.method)?0:1;const y=v.response&&v.response.status||500;if(h>0&&(Array.isArray(v.options.retryStatusCodes)?v.options.retryStatusCodes.includes(y):vy.has(y))){const N=typeof v.options.retryDelay=="function"?v.options.retryDelay(v):v.options.retryDelay||0;return N>0&&await new Promise(P=>setTimeout(P,N)),f(v.request,{...v.options,retry:h-1})}}const j=uy(v);throw Error.captureStackTrace&&Error.captureStackTrace(j,f),j}const f=async function(g,j={}){const h={request:g,options:hy(g,j,n.defaults,i),response:void 0,error:void 0};h.options.method&&(h.options.method=h.options.method.toUpperCase()),h.options.onRequest&&await Uo(h,h.options.onRequest),typeof h.request=="string"&&(h.options.baseURL&&(h.request=ty(h.request,h.options.baseURL)),h.options.query&&(h.request=ry(h.request,h.options.query),delete h.options.query),"query"in h.options&&delete h.options.query,"params"in h.options&&delete h.options.params),h.options.body&&hf(h.options.method)&&(dy(h.options.body)?(h.options.body=typeof h.options.body=="string"?h.options.body:JSON.stringify(h.options.body),h.options.headers=new i(h.options.headers||{}),h.options.headers.has("content-type")||h.options.headers.set("content-type","application/json"),h.options.headers.has("accept")||h.options.headers.set("accept","application/json")):("pipeTo"in h.options.body&&typeof h.options.body.pipeTo=="function"||typeof h.options.body.pipe=="function")&&("duplex"in h.options||(h.options.duplex="half")));let y;if(!h.options.signal&&h.options.timeout){const P=new u;y=setTimeout(()=>{const A=new Error("[TimeoutError]: The operation was aborted due to timeout");A.name="TimeoutError",A.code=23,P.abort(A)},h.options.timeout),h.options.signal=P.signal}try{h.response=await o(h.request,h.options)}catch(P){return h.error=P,h.options.onRequestError&&await Uo(h,h.options.onRequestError),await d(h)}finally{y&&clearTimeout(y)}if((h.response.body||h.response._bodyInit)&&!yy.has(h.response.status)&&h.options.method!=="HEAD"){const P=(h.options.parseResponse?"json":h.options.responseType)||py(h.response.headers.get("content-type")||"");switch(P){case"json":{const A=await h.response.text(),z=h.options.parseResponse||Ov;h.response._data=z(A);break}case"stream":{h.response._data=h.response.body||h.response._bodyInit;break}default:h.response._data=await h.response[P]()}}return h.options.onResponse&&await Uo(h,h.options.onResponse),!h.options.ignoreResponseError&&h.response.status>=400&&h.response.status<600?(h.options.onResponseError&&await Uo(h,h.options.onResponseError),await d(h)):h.response},m=async function(g,j){return(await f(g,j))._data};return m.raw=f,m.native=(...v)=>o(...v),m.create=(v={},g={})=>nm({...n,...g,defaults:{...n.defaults,...g.defaults,...v}}),m}const rs=(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")})(),xy=rs.fetch?(...n)=>rs.fetch(...n):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),wy=rs.Headers,jy=rs.AbortController,Ny=nm({fetch:xy,Headers:wy,AbortController:jy});var by=Object.defineProperty,ky=Object.defineProperties,Sy=Object.getOwnPropertyDescriptors,gf=Object.getOwnPropertySymbols,Cy=Object.prototype.hasOwnProperty,_y=Object.prototype.propertyIsEnumerable,am=n=>{throw TypeError(n)},vf=(n,o,i)=>o in n?by(n,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[o]=i,Cl=(n,o)=>{for(var i in o||(o={}))Cy.call(o,i)&&vf(n,i,o[i]);if(gf)for(var i of gf(o))_y.call(o,i)&&vf(n,i,o[i]);return n},Ey=(n,o)=>ky(n,Sy(o)),om=(n,o,i)=>o.has(n)||am("Cannot "+i),Re=(n,o,i)=>(om(n,o,"read from private field"),i?i.call(n):o.get(n)),Kr=(n,o,i)=>o.has(n)?am("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(n):o.set(n,i),Dn=(n,o,i,u)=>(om(n,o,"write to private field"),o.set(n,i),i),Rt=(n,o,i)=>new Promise((u,d)=>{var f=g=>{try{v(i.next(g))}catch(j){d(j)}},m=g=>{try{v(i.throw(g))}catch(j){d(j)}},v=g=>g.done?u(g.value):Promise.resolve(g.value).then(f,m);v((i=i.apply(n,o)).next())}),Ty="6QrJZ7pFCmBZAeIJF7IArvkCz+EtzA0RVcpHkiQIsQyhs7QtCS9P+CueZdHfB2OtJcgX3BbqY9pfpWeAVTqCwQ==";function yf(n){return encodeURIComponent(n).replace(/[!'()*]/g,o=>`%${o.charCodeAt(0).toString(16).toUpperCase()}`)}function Py(n){return o=>{let{options:i}=o,u=Math.floor(Date.now()/1e3).toString(),d=Math.random().toString(36).substring(2,15),f=Cl({},i.query),m=Object.keys(f).sort().map(A=>`${yf(A)}=${yf(String(f[A]))}`).join("&"),v={"x-timestamp":u,"x-nonce":d},g=Object.keys(v).sort().map(A=>`${A}:${v[A]}`).join(` `),j=i.body&&!(i.body instanceof FormData)?JSON.stringify(i.body):"",h=_v(j).toString(yv),y=[m,g,h].join(` `);console.warn(`Client-side Canonical Request V3: `,y);let N=pv.stringify(Sv(y,n)),P=new Headers(i.headers);Object.entries(v).forEach(([A,z])=>{P.set(A,z)}),P.set("X-Sign",N),i.headers=P}}function Ct(n,o,i={}){return n.auth.accessToken&&(i.headers=Cl({Authorization:`Bearer ${n.auth.accessToken}`},i.headers)),Ny(o,Ey(Cl({baseURL:n.config.apiBaseUrl},i),{onRequest:Py(Ty)}))}function Dy(){var n,o;return(o=(n=document.querySelector('link[rel="icon"]'))==null?void 0:n.href)!=null?o:null}function My(){var n;return(n=document.title)!=null?n:null}function xf(n,o,i=localStorage){let u=i.getItem(n),d=o?JSON.stringify(o):null;d?i.setItem(n,d):i.removeItem(n),window.dispatchEvent(new StorageEvent("storage",{key:n,oldValue:u,newValue:d,storageArea:i}))}function wf(n,o=localStorage){let i=o.getItem(n);try{return i?JSON.parse(i):null}catch{return null}}var er,_l,Oy=class{constructor(o){Kr(this,er),Kr(this,_l,`lumi-auth-${ov()}`),Dn(this,er,o)}get accessToken(){return wf("lumi-access-token")}set accessToken(o){xf("lumi-access-token",o)}get user(){return wf("lumi-user")}set user(o){xf("lumi-user",o)}get isAuthenticated(){return!!this.accessToken}signIn(){let o=(window.screen.width-800)/2,i=(window.screen.height-600)/2,u=window.open(Re(this,er).config.authOrigin,Re(this,_l),`width=800,height=600,left=${o},top=${i}`),d;return new Promise((f,m)=>{if(!u)return m(new Error("Open auth window failed"));let v=setInterval(()=>{u.closed&&m(new Error("Auth window closed"))},1e3),g=h=>{u.closed||(u.focus(),h.stopPropagation(),h.preventDefault())},j=({data:h,origin:y,source:N})=>{if(!(y!==Re(this,er).config.authOrigin||N!==u))switch(h?.type){case"lumi-ready":{u.postMessage({type:"lumi-init",data:{projectId:Re(this,er).config.projectId,icon:Dy(),title:My()}},Re(this,er).config.authOrigin);break}case"lumi-sign-in":{if(h.data.projectId!==Re(this,er).config.projectId)break;u.close(),window.focus(),this.accessToken=h.data.accessToken,this.user=h.data.user,f(h.data);break}}};window.addEventListener("message",j),document.addEventListener("click",g,!0),d=()=>{clearInterval(v),window.removeEventListener("message",j),document.removeEventListener("click",g,!0)}}).finally(()=>d?.())}signOut(){this.accessToken=null,this.user=null}refreshUser(){return Rt(this,null,function*(){let o=yield Ct(Re(this,er),"/lm/user/info",{method:"POST"});if(o.code!==200)throw new Error(o.message);return this.user=o.data,o.data})}onAuthChange(o){let i=u=>{(u.key==="lumi-access-token"||u.key==="lumi-user"||u.key===null)&&o({isAuthenticated:this.isAuthenticated,user:this.user})};return window.addEventListener("storage",i),()=>{window.removeEventListener("storage",i)}}};er=new WeakMap,_l=new WeakMap;var St,Ly=class{constructor(n,o){Kr(this,St),Dn(this,St,n),this.entityName=o}list(){return Rt(this,arguments,function*({filter:n,sort:o,limit:i,skip:u}={}){if(i){let d=yield Ct(Re(this,St),this.uri("/find"),{method:"POST",body:{filter:n,sort:o,limit:i,skip:u}});if(d.code!==200)throw new Error(d.message);return d.data}else{let d=yield Ct(Re(this,St),this.uri("/list"),{method:"POST",body:{filter:n,sort:o}});if(d.code!==200)throw new Error(d.message);return{total:d.data.length,list:d.data}}})}get(n){return Rt(this,null,function*(){let o=yield Ct(Re(this,St),this.uri(`/${n}`),{method:"GET"});if(o.code!==200)throw new Error(o.message);return o.data})}create(n){return Rt(this,null,function*(){let o=yield Ct(Re(this,St),this.uri(),{method:"POST",body:n});if(o.code!==200)throw new Error(o.message);return o.data})}createMany(n){return Rt(this,null,function*(){let o=yield Ct(Re(this,St),this.uri("/batch"),{method:"POST",body:n});if(o.code!==200)throw new Error(o.message);return o.data})}update(n,o){return Rt(this,null,function*(){let i=yield Ct(Re(this,St),this.uri(),{method:"PUT",body:{filter:{_id:n},update:o}});if(i.code!==200)throw new Error(i.message);return i.data})}delete(n){return Rt(this,null,function*(){let o=yield Ct(Re(this,St),this.uri(`/${n}`),{method:"DELETE"});if(o.code!==200)throw new Error(o.message)})}deleteMany(n){return Rt(this,null,function*(){let o=yield Ct(Re(this,St),this.uri("/batch-by-ids"),{method:"DELETE",params:{ids:n}});if(o.code!==200)throw new Error(o.message)})}uri(n=""){return`/lm/${Re(this,St).config.projectId}/${this.entityName}/documents${n}`}};St=new WeakMap;var Go,Ry=class{constructor(o){return Kr(this,Go),Dn(this,Go,o),new Proxy(this,{get(i,u){return u in i||(i[u]=new Ly(Re(i,Go),u)),i[u]}})}};Go=new WeakMap;var El=class extends Error{constructor(n,o){super(o),this.name="LumiError",this.code=n}},xa,Iy=class{constructor(n){Kr(this,xa),Dn(this,xa,n)}send(n){return Rt(this,arguments,function*({to:o,subject:i,fromName:u,html:d,text:f="",replyTo:m,scheduledAt:v}){if(!o||!i||!d&&!f)throw new Error("Failed to send email: Missing required parameters.");typeof o=="string"&&(o=[o]),typeof m=="string"&&(m=[m]);let g=yield Ct(Re(this,xa),`/lm/${Re(this,xa).config.projectId}/email/send`,{method:"POST",body:{to:o,subject:i,fromName:u,html:d,text:f,replyTo:m,scheduledAt:v}});if(g.code!==200)throw new El(g.code,g.message)})}};xa=new WeakMap;var Vr,zy=class{constructor(n){Kr(this,Vr),Dn(this,Vr,n)}upload(n){return Rt(this,null,function*(){let o=new FormData;n.forEach(u=>{o.append("files",u)});let i=yield Ct(Re(this,Vr),`/lm/${Re(this,Vr).config.projectId}/file/batch`,{method:"POST",body:o});if(i.code!==200)throw new El(i.code,i.message);return i.data})}delete(n){return Rt(this,null,function*(){let o=yield Ct(Re(this,Vr),`/lm/${Re(this,Vr).config.projectId}/file/batch`,{method:"DELETE",body:{fileUrls:n}});if(o.code!==200)throw new El(o.code,o.message)})}};Vr=new WeakMap;var Tl,$y=class{constructor(n){Kr(this,Tl),Dn(this,Tl,n),this.email=new Iy(n),this.file=new zy(n)}};Tl=new WeakMap;var Ay=class{constructor(o){this.config=o,this.auth=new Oy(this),this.entities=new Ry(this),this.tools=new $y(this)}};function Uy(n){return new Ay(n)}const Be=Uy({projectId:"p355815126673022976",apiBaseUrl:"https://api.lumi.new",authOrigin:"https://auth.lumi.new"}),Fy=()=>{const[n,o]=_.useState({totalPacientes:0,totalMedicos:0,consultasHoje:0,consultasPendentes:0});return _.useEffect(()=>{(async()=>{try{const[u,d,f]=await Promise.all([Be.entities.pacientes.list(),Be.entities.medicos.list(),Be.entities.consultas.list()]),m=new Date().toISOString().split("T")[0],v=f.list?.filter(j=>j.dataHora?.startsWith(m)).length||0,g=f.list?.filter(j=>j.status==="agendada"||j.status==="confirmada").length||0;o({totalPacientes:u.list?.length||0,totalMedicos:d.list?.length||0,consultasHoje:v,consultasPendentes:g})}catch(u){console.error("Erro ao carregar estatísticas:",u)}})()},[]),a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{className:"text-center py-12 bg-gradient-to-l from-blue-800 to-blue-500 text-white rounded-xl shadow-lg",children:[a.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Sistema de Agendamento Médico"}),a.jsx("p",{className:"text-xl opacity-90",children:"Gerencie consultas, pacientes e médicos de forma eficiente"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[a.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-3 bg-gradient-to-l from-blue-700 to-blue-400 rounded-full",children:a.jsx(Yr,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total de Pacientes"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.totalPacientes})]})]})}),a.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-3 bg-green-100 rounded-full",children:a.jsx(of,{className:"w-6 h-6 text-green-600"})}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Médicos Ativos"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.totalMedicos})]})]})}),a.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-3 bg-yellow-100 rounded-full",children:a.jsx(Er,{className:"w-6 h-6 text-yellow-600"})}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Consultas Hoje"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.consultasHoje})]})]})}),a.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-3 bg-purple-100 rounded-full",children:a.jsx(Sn,{className:"w-6 h-6 text-purple-600"})}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Pendentes"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.consultasPendentes})]})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[a.jsx("div",{className:"w-12 h-12 bg-gradient-to-l from-blue-700 to-blue-400 rounded-lg flex items-center justify-center mb-4",children:a.jsx(Er,{className:"w-6 h-6 text-white"})}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Agendar Consulta"}),a.jsx("p",{className:"text-gray-600 mb-4",children:"Interface para pacientes agendarem suas consultas médicas"}),a.jsx("a",{href:"/paciente",className:"btn-primary inline-block",children:"Acessar Agendamento"})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[a.jsx(of,{className:"w-12 h-12 text-green-600 mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Painel do Médico"}),a.jsx("p",{className:"text-gray-600 mb-4 whitespace-nowrap",children:"Gerencie suas consultas, horários e informações dos pacientes"}),a.jsx("a",{href:"/login-medico",className:"btn-primary inline-block",children:"Acessar Painel"})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[a.jsx(Yr,{className:"w-12 h-12 text-purple-600 mb-4"}),a.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Cadastro de Pacientes"}),a.jsx("p",{className:"text-gray-600 mb-4",children:"Área da secretaria para cadastrar e gerenciar pacientes"}),a.jsx("a",{href:"/login-secretaria",className:"btn-primary inline-block",children:"Acessar Cadastro"})]})]})]})},Hy=()=>{const[n,o]=_.useState({email:"",senha:""}),[i,u]=_.useState(!1),[d,f]=_.useState(!1),[m,v]=_.useState({nome:"",email:"",senha:"",confirmarSenha:"",telefone:"",cpf:"",dataNascimento:"",convenio:"",altura:"",peso:""}),g=Dr(),j=async y=>{y.preventDefault(),u(!0);try{const P=(await Be.entities.pacientes.list({filter:{email:n.email,ativo:!0}})).list?.[0];if(!P){ce.error("Email não encontrado. Cadastre-se primeiro."),u(!1);return}P.senha===n.senha?(ce.success(`Bem-vindo(a), ${P.nome}!`),localStorage.setItem("pacienteLogado",JSON.stringify(P)),g("/acompanhamento")):ce.error("Senha incorreta")}catch(N){console.error("Erro no login:",N),ce.error("Erro ao fazer login. Tente novamente.")}finally{u(!1)}},h=async y=>{if(y.preventDefault(),m.senha!==m.confirmarSenha){ce.error("As senhas não coincidem");return}if(m.senha.length<6){ce.error("A senha deve ter pelo menos 6 caracteres");return}u(!0);try{const N=await Be.entities.pacientes.list({filter:{email:m.email}});if(N.list&&N.list.length>0){ce.error("Este email já está cadastrado"),u(!1);return}const P=await Be.entities.pacientes.create({nome:m.nome,email:m.email,senha:m.senha,telefone:m.telefone,cpf:m.cpf,dataNascimento:m.dataNascimento,convenio:m.convenio||"Particular",altura:m.altura?parseFloat(m.altura):void 0,peso:m.peso?parseFloat(m.peso):void 0,ativo:!0,criadoEm:new Date().toISOString(),atualizadoEm:new Date().toISOString()});ce.success("Cadastro realizado com sucesso!"),localStorage.setItem("pacienteLogado",JSON.stringify(P)),g("/acompanhamento")}catch(N){console.error("Erro no cadastro:",N),ce.error("Erro ao criar cadastro. Tente novamente.")}finally{u(!1)}};return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-white flex items-center justify-center p-4",children:a.jsxs("div",{className:"max-w-md w-full",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("div",{className:"bg-gradient-to-r from-blue-700 to-blue-400 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(_n,{className:"w-8 h-8 text-white"})}),a.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:d?"Criar Conta":"Área do Paciente"}),a.jsx("p",{className:"text-gray-600",children:d?"Preencha seus dados para criar sua conta":"Faça login para acompanhar suas consultas"})]}),a.jsx("div",{className:"bg-white rounded-lg shadow-lg p-8",children:d?a.jsxs("form",{onSubmit:h,className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Nome Completo"}),a.jsx("input",{type:"text",value:m.nome,onChange:y=>v(N=>({...N,nome:y.target.value})),className:"form-input",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"CPF"}),a.jsx("input",{type:"text",value:m.cpf,onChange:y=>v(N=>({...N,cpf:y.target.value})),className:"form-input",placeholder:"000.000.000-00",required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),a.jsx("input",{type:"email",value:m.email,onChange:y=>v(N=>({...N,email:y.target.value})),className:"form-input",required:!0})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Senha"}),a.jsx("input",{type:"password",value:m.senha,onChange:y=>v(N=>({...N,senha:y.target.value})),className:"form-input",minLength:6,required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Confirmar Senha"}),a.jsx("input",{type:"password",value:m.confirmarSenha,onChange:y=>v(N=>({...N,confirmarSenha:y.target.value})),className:"form-input",required:!0})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Telefone"}),a.jsx("input",{type:"tel",value:m.telefone,onChange:y=>v(N=>({...N,telefone:y.target.value})),className:"form-input",placeholder:"(11) 99999-9999",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Data de Nascimento"}),a.jsx("input",{type:"date",value:m.dataNascimento,onChange:y=>v(N=>({...N,dataNascimento:y.target.value})),className:"form-input",required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Convênio"}),a.jsxs("select",{value:m.convenio,onChange:y=>v(N=>({...N,convenio:y.target.value})),className:"form-input",children:[a.jsx("option",{value:"",children:"Selecione"}),a.jsx("option",{value:"Particular",children:"Particular"}),a.jsx("option",{value:"Unimed",children:"Unimed"}),a.jsx("option",{value:"Bradesco Saúde",children:"Bradesco Saúde"}),a.jsx("option",{value:"SulAmérica",children:"SulAmérica"}),a.jsx("option",{value:"Amil",children:"Amil"}),a.jsx("option",{value:"NotreDame",children:"NotreDame"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Altura (cm)"}),a.jsx("input",{type:"number",value:m.altura,onChange:y=>v(N=>({...N,altura:y.target.value})),className:"form-input",placeholder:"170",min:"50",max:"250"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Peso (kg)"}),a.jsx("input",{type:"number",value:m.peso,onChange:y=>v(N=>({...N,peso:y.target.value})),className:"form-input",placeholder:"70",min:"20",max:"300",step:"0.1"})]})]}),a.jsxs("div",{className:"flex space-x-4",children:[a.jsx("button",{type:"button",onClick:()=>f(!1),className:"flex-1 bg-gray-100 text-gray-700 py-3 px-4 rounded-lg font-medium hover:bg-gray-200 transition-colors",children:"Voltar"}),a.jsx("button",{type:"submit",disabled:i,className:"flex-1 bg-gradient-to-r from-blue-700 to-blue-400 text-white py-3 px-4 rounded-lg font-medium hover:from-blue-800 hover:to-blue-500 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:i?"Cadastrando...":"Cadastrar"})]})]}):a.jsxs("form",{onSubmit:j,className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),a.jsxs("div",{className:"relative",children:[a.jsx(Fl,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),a.jsx("input",{type:"email",value:n.email,onChange:y=>o(N=>({...N,email:y.target.value})),className:"form-input pl-10",placeholder:"seu@email.com",required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Senha"}),a.jsxs("div",{className:"relative",children:[a.jsx(Kf,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),a.jsx("input",{type:"password",value:n.senha,onChange:y=>o(N=>({...N,senha:y.target.value})),className:"form-input pl-10",placeholder:"Sua senha",required:!0})]})]}),a.jsx("button",{type:"submit",disabled:i,className:"w-full bg-gradient-to-r from-blue-700 to-blue-400 text-white py-3 px-4 rounded-lg font-medium hover:from-blue-800 hover:to-blue-500 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:i?"Entrando...":"Entrar"}),a.jsx("div",{className:"text-center",children:a.jsx("button",{type:"button",onClick:()=>f(!0),className:"text-blue-600 hover:text-blue-800 text-sm font-medium",children:"Não tem conta? Cadastre-se aqui"})})]})})]})})},By=()=>{const[n,o]=_.useState({email:"",senha:""}),[i,u]=_.useState(!1),[d,f]=_.useState(!1),[m,v]=_.useState({nome:"",email:"",senha:"",confirmarSenha:"",telefone:"",cpf:""}),g=Dr(),j={email:"secretaria@clinica.com",senha:"secretaria123"},h=async y=>{y.preventDefault(),u(!0);try{n.email===j.email&&n.senha===j.senha?(ce.success("Login realizado com sucesso!"),localStorage.setItem("secretariaLogada",JSON.stringify({nome:"Secretária",email:n.email,tipo:"secretaria"})),g("/painel-secretaria")):ce.error("Email ou senha incorretos")}catch(N){console.error("Erro no login:",N),ce.error("Erro ao fazer login. Tente novamente.")}finally{u(!1)}};return a.jsx("div",{className:"min-h-screen bg-gradient-to-br from-green-50 to-white flex items-center justify-center p-4",children:a.jsxs("div",{className:"max-w-md w-full",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("div",{className:"bg-gradient-to-r from-green-600 to-green-400 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(kl,{className:"w-8 h-8 text-white"})}),a.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:d?"Criar Conta de Secretária":"Área da Secretaria"}),a.jsx("p",{className:"text-gray-600",children:d?"Preencha os dados para criar uma conta de secretária":"Faça login para acessar o sistema de gestão"})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-8",children:[d?a.jsxs("form",{onSubmit:y=>{y.preventDefault()},className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Nome Completo"}),a.jsx("input",{type:"text",value:m.nome,onChange:y=>v(N=>({...N,nome:y.target.value})),className:"form-input",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"CPF"}),a.jsx("input",{type:"text",value:m.cpf,onChange:y=>v(N=>({...N,cpf:y.target.value})),className:"form-input",placeholder:"000.000.000-00",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Telefone"}),a.jsx("input",{type:"tel",value:m.telefone,onChange:y=>v(N=>({...N,telefone:y.target.value})),className:"form-input",placeholder:"(11) 99999-9999",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),a.jsx("input",{type:"email",value:m.email,onChange:y=>v(N=>({...N,email:y.target.value})),className:"form-input",required:!0})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Senha"}),a.jsx("input",{type:"password",value:m.senha,onChange:y=>v(N=>({...N,senha:y.target.value})),className:"form-input",minLength:6,required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Confirmar Senha"}),a.jsx("input",{type:"password",value:m.confirmarSenha,onChange:y=>v(N=>({...N,confirmarSenha:y.target.value})),className:"form-input",required:!0})]})]}),a.jsxs("div",{className:"flex space-x-4",children:[a.jsx("button",{type:"button",onClick:()=>f(!1),className:"flex-1 bg-gray-100 text-gray-700 py-3 px-4 rounded-lg font-medium hover:bg-gray-200 transition-colors",children:"Voltar"}),a.jsx("button",{type:"submit",disabled:i,className:"flex-1 bg-gradient-to-r from-green-600 to-green-400 text-white py-3 px-4 rounded-lg font-medium hover:from-green-700 hover:to-green-500 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:i?"Cadastrando...":"Cadastrar"})]})]}):a.jsxs("form",{onSubmit:h,className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),a.jsxs("div",{className:"relative",children:[a.jsx(Fl,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),a.jsx("input",{type:"email",value:n.email,onChange:y=>o(N=>({...N,email:y.target.value})),className:"form-input pl-10",placeholder:"secretaria@clinica.com",required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Senha"}),a.jsxs("div",{className:"relative",children:[a.jsx(Kf,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),a.jsx("input",{type:"password",value:n.senha,onChange:y=>o(N=>({...N,senha:y.target.value})),className:"form-input pl-10",placeholder:"Sua senha",required:!0})]})]}),a.jsx("button",{type:"submit",disabled:i,className:"w-full bg-gradient-to-r from-green-600 to-green-400 text-white py-3 px-4 rounded-lg font-medium hover:from-green-700 hover:to-green-500 disabled:opacity-50 disabled:cursor-not-allowed transition-all",children:i?"Entrando...":"Entrar"}),a.jsx("div",{className:"text-center",children:a.jsx("button",{type:"button",onClick:()=>f(!0),className:"text-green-600 hover:text-green-800 text-sm font-medium",children:"Não tem conta? Cadastre-se aqui"})})]}),!d&&a.jsxs("div",{className:"mt-6 p-4 bg-green-50 rounded-lg",children:[a.jsx("h3",{className:"text-sm font-medium text-green-800 mb-2",children:"Credenciais de Demonstração:"}),a.jsxs("div",{className:"text-sm text-green-700",children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Email:"})," secretaria@clinica.com"]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Senha:"})," secretaria123"]})]})]})]})]})})},Wy=()=>{const[n,o]=_.useState({email:"",senha:""}),[i,u]=_.useState(!1),d=Dr();async function f(v){const j=new TextEncoder().encode(v),h=await window.crypto.subtle.digest("SHA-256",j);return Array.from(new Uint8Array(h)).map(y=>y.toString(16).padStart(2,"0")).join("")}const m=async v=>{v.preventDefault(),u(!0);try{const h=(await(await fetch("/api/medicos?email="+encodeURIComponent(n.email))).json())[0];if(!h){ce.error("Email não encontrado");return}const y=await f(n.senha);h.senha===y?(ce.success("Login realizado com sucesso!"),localStorage.setItem("medicoLogado",JSON.stringify(h)),d("/painel-medico")):ce.error("Senha incorreta")}catch{ce.error("Erro ao fazer login. Tente novamente.")}finally{u(!1)}};return a.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-green-50 to-white p-4",children:a.jsxs("form",{onSubmit:m,className:"max-w-md w-full bg-white rounded-lg shadow-md p-8",children:[a.jsx("h2",{className:"text-2xl font-bold mb-6 text-green-700 text-center",children:"Login Médico"}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-gray-700 mb-2",children:"Email"}),a.jsx("input",{type:"email",className:"w-full px-4 py-2 border rounded focus:outline-none focus:ring-2 focus:ring-green-400",value:n.email,onChange:v=>o({...n,email:v.target.value}),required:!0})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-gray-700 mb-2",children:"Senha"}),a.jsx("input",{type:"password",className:"w-full px-4 py-2 border rounded focus:outline-none focus:ring-2 focus:ring-green-400",value:n.senha,onChange:v=>o({...n,senha:v.target.value}),required:!0})]}),a.jsx("button",{type:"submit",className:"w-full bg-green-600 text-white py-2 rounded hover:bg-green-700 transition-colors",disabled:i,children:i?"Entrando...":"Entrar"}),a.jsxs("p",{className:"text-sm text-indigo-700 mt-4 text-center",children:["Use as credenciais de qualquer médico cadastrado no sistema.",a.jsx("br",{}),"Se não houver médicos cadastrados, acesse primeiro a área da secretaria para criar um."]})]})})};function ns(n){"@babel/helpers - typeof";return ns=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},ns(n)}function rr(n){if(n===null||n===!0||n===!1)return NaN;var o=Number(n);return isNaN(o)?o:o<0?Math.ceil(o):Math.floor(o)}function Ie(n,o){if(o.length1?"s":"")+" required, but only "+o.length+" present")}function nt(n){Ie(1,arguments);var o=Object.prototype.toString.call(n);return n instanceof Date||ns(n)==="object"&&o==="[object Date]"?new Date(n.getTime()):typeof n=="number"||o==="[object Number]"?new Date(n):((typeof n=="string"||o==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Bl(n,o){Ie(2,arguments);var i=nt(n),u=rr(o);return isNaN(u)?new Date(NaN):(u&&i.setDate(i.getDate()+u),i)}function qy(n,o){Ie(2,arguments);var i=nt(n).getTime(),u=rr(o);return new Date(i+u)}var Vy={};function cs(){return Vy}function Qy(n){var o=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return o.setUTCFullYear(n.getFullYear()),n.getTime()-o.getTime()}function jf(n){Ie(1,arguments);var o=nt(n);return o.setHours(0,0,0,0),o}var sm=6e4,im=36e5;function lm(n,o){Ie(2,arguments);var i=jf(n),u=jf(o);return i.getTime()===u.getTime()}function Yy(n){return Ie(1,arguments),n instanceof Date||ns(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Xy(n){if(Ie(1,arguments),!Yy(n)&&typeof n!="number")return!1;var o=nt(n);return!isNaN(Number(o))}function Ky(n,o){Ie(2,arguments);var i=rr(o);return qy(n,-i)}var Gy=864e5;function Jy(n){Ie(1,arguments);var o=nt(n),i=o.getTime();o.setUTCMonth(0,1),o.setUTCHours(0,0,0,0);var u=o.getTime(),d=i-u;return Math.floor(d/Gy)+1}function as(n){Ie(1,arguments);var o=1,i=nt(n),u=i.getUTCDay(),d=(u=d.getTime()?i+1:o.getTime()>=m.getTime()?i:i-1}function Zy(n){Ie(1,arguments);var o=um(n),i=new Date(0);i.setUTCFullYear(o,0,4),i.setUTCHours(0,0,0,0);var u=as(i);return u}var ex=6048e5;function tx(n){Ie(1,arguments);var o=nt(n),i=as(o).getTime()-Zy(o).getTime();return Math.round(i/ex)+1}function os(n,o){var i,u,d,f,m,v,g,j;Ie(1,arguments);var h=cs(),y=rr((i=(u=(d=(f=o?.weekStartsOn)!==null&&f!==void 0?f:o==null||(m=o.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&d!==void 0?d:h.weekStartsOn)!==null&&u!==void 0?u:(g=h.locale)===null||g===void 0||(j=g.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&i!==void 0?i:0);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var N=nt(n),P=N.getUTCDay(),A=(P=1&&P<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var A=new Date(0);A.setUTCFullYear(y+1,0,P),A.setUTCHours(0,0,0,0);var z=os(A,o),D=new Date(0);D.setUTCFullYear(y,0,P),D.setUTCHours(0,0,0,0);var B=os(D,o);return h.getTime()>=z.getTime()?y+1:h.getTime()>=B.getTime()?y:y-1}function rx(n,o){var i,u,d,f,m,v,g,j;Ie(1,arguments);var h=cs(),y=rr((i=(u=(d=(f=o?.firstWeekContainsDate)!==null&&f!==void 0?f:o==null||(m=o.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:h.firstWeekContainsDate)!==null&&u!==void 0?u:(g=h.locale)===null||g===void 0||(j=g.options)===null||j===void 0?void 0:j.firstWeekContainsDate)!==null&&i!==void 0?i:1),N=cm(n,o),P=new Date(0);P.setUTCFullYear(N,0,y),P.setUTCHours(0,0,0,0);var A=os(P,o);return A}var nx=6048e5;function ax(n,o){Ie(1,arguments);var i=nt(n),u=os(i,o).getTime()-rx(i,o).getTime();return Math.round(u/nx)+1}function ke(n,o){for(var i=n<0?"-":"",u=Math.abs(n).toString();u.length0?u:1-u;return ke(i==="yy"?d%100:d,i.length)},M:function(o,i){var u=o.getUTCMonth();return i==="M"?String(u+1):ke(u+1,2)},d:function(o,i){return ke(o.getUTCDate(),i.length)},a:function(o,i){var u=o.getUTCHours()/12>=1?"pm":"am";switch(i){case"a":case"aa":return u.toUpperCase();case"aaa":return u;case"aaaaa":return u[0];case"aaaa":default:return u==="am"?"a.m.":"p.m."}},h:function(o,i){return ke(o.getUTCHours()%12||12,i.length)},H:function(o,i){return ke(o.getUTCHours(),i.length)},m:function(o,i){return ke(o.getUTCMinutes(),i.length)},s:function(o,i){return ke(o.getUTCSeconds(),i.length)},S:function(o,i){var u=i.length,d=o.getUTCMilliseconds(),f=Math.floor(d*Math.pow(10,u-3));return ke(f,i.length)}},kn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ox={G:function(o,i,u){var d=o.getUTCFullYear()>0?1:0;switch(i){case"G":case"GG":case"GGG":return u.era(d,{width:"abbreviated"});case"GGGGG":return u.era(d,{width:"narrow"});case"GGGG":default:return u.era(d,{width:"wide"})}},y:function(o,i,u){if(i==="yo"){var d=o.getUTCFullYear(),f=d>0?d:1-d;return u.ordinalNumber(f,{unit:"year"})}return br.y(o,i)},Y:function(o,i,u,d){var f=cm(o,d),m=f>0?f:1-f;if(i==="YY"){var v=m%100;return ke(v,2)}return i==="Yo"?u.ordinalNumber(m,{unit:"year"}):ke(m,i.length)},R:function(o,i){var u=um(o);return ke(u,i.length)},u:function(o,i){var u=o.getUTCFullYear();return ke(u,i.length)},Q:function(o,i,u){var d=Math.ceil((o.getUTCMonth()+1)/3);switch(i){case"Q":return String(d);case"QQ":return ke(d,2);case"Qo":return u.ordinalNumber(d,{unit:"quarter"});case"QQQ":return u.quarter(d,{width:"abbreviated",context:"formatting"});case"QQQQQ":return u.quarter(d,{width:"narrow",context:"formatting"});case"QQQQ":default:return u.quarter(d,{width:"wide",context:"formatting"})}},q:function(o,i,u){var d=Math.ceil((o.getUTCMonth()+1)/3);switch(i){case"q":return String(d);case"qq":return ke(d,2);case"qo":return u.ordinalNumber(d,{unit:"quarter"});case"qqq":return u.quarter(d,{width:"abbreviated",context:"standalone"});case"qqqqq":return u.quarter(d,{width:"narrow",context:"standalone"});case"qqqq":default:return u.quarter(d,{width:"wide",context:"standalone"})}},M:function(o,i,u){var d=o.getUTCMonth();switch(i){case"M":case"MM":return br.M(o,i);case"Mo":return u.ordinalNumber(d+1,{unit:"month"});case"MMM":return u.month(d,{width:"abbreviated",context:"formatting"});case"MMMMM":return u.month(d,{width:"narrow",context:"formatting"});case"MMMM":default:return u.month(d,{width:"wide",context:"formatting"})}},L:function(o,i,u){var d=o.getUTCMonth();switch(i){case"L":return String(d+1);case"LL":return ke(d+1,2);case"Lo":return u.ordinalNumber(d+1,{unit:"month"});case"LLL":return u.month(d,{width:"abbreviated",context:"standalone"});case"LLLLL":return u.month(d,{width:"narrow",context:"standalone"});case"LLLL":default:return u.month(d,{width:"wide",context:"standalone"})}},w:function(o,i,u,d){var f=ax(o,d);return i==="wo"?u.ordinalNumber(f,{unit:"week"}):ke(f,i.length)},I:function(o,i,u){var d=tx(o);return i==="Io"?u.ordinalNumber(d,{unit:"week"}):ke(d,i.length)},d:function(o,i,u){return i==="do"?u.ordinalNumber(o.getUTCDate(),{unit:"date"}):br.d(o,i)},D:function(o,i,u){var d=Jy(o);return i==="Do"?u.ordinalNumber(d,{unit:"dayOfYear"}):ke(d,i.length)},E:function(o,i,u){var d=o.getUTCDay();switch(i){case"E":case"EE":case"EEE":return u.day(d,{width:"abbreviated",context:"formatting"});case"EEEEE":return u.day(d,{width:"narrow",context:"formatting"});case"EEEEEE":return u.day(d,{width:"short",context:"formatting"});case"EEEE":default:return u.day(d,{width:"wide",context:"formatting"})}},e:function(o,i,u,d){var f=o.getUTCDay(),m=(f-d.weekStartsOn+8)%7||7;switch(i){case"e":return String(m);case"ee":return ke(m,2);case"eo":return u.ordinalNumber(m,{unit:"day"});case"eee":return u.day(f,{width:"abbreviated",context:"formatting"});case"eeeee":return u.day(f,{width:"narrow",context:"formatting"});case"eeeeee":return u.day(f,{width:"short",context:"formatting"});case"eeee":default:return u.day(f,{width:"wide",context:"formatting"})}},c:function(o,i,u,d){var f=o.getUTCDay(),m=(f-d.weekStartsOn+8)%7||7;switch(i){case"c":return String(m);case"cc":return ke(m,i.length);case"co":return u.ordinalNumber(m,{unit:"day"});case"ccc":return u.day(f,{width:"abbreviated",context:"standalone"});case"ccccc":return u.day(f,{width:"narrow",context:"standalone"});case"cccccc":return u.day(f,{width:"short",context:"standalone"});case"cccc":default:return u.day(f,{width:"wide",context:"standalone"})}},i:function(o,i,u){var d=o.getUTCDay(),f=d===0?7:d;switch(i){case"i":return String(f);case"ii":return ke(f,i.length);case"io":return u.ordinalNumber(f,{unit:"day"});case"iii":return u.day(d,{width:"abbreviated",context:"formatting"});case"iiiii":return u.day(d,{width:"narrow",context:"formatting"});case"iiiiii":return u.day(d,{width:"short",context:"formatting"});case"iiii":default:return u.day(d,{width:"wide",context:"formatting"})}},a:function(o,i,u){var d=o.getUTCHours(),f=d/12>=1?"pm":"am";switch(i){case"a":case"aa":return u.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"aaa":return u.dayPeriod(f,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return u.dayPeriod(f,{width:"narrow",context:"formatting"});case"aaaa":default:return u.dayPeriod(f,{width:"wide",context:"formatting"})}},b:function(o,i,u){var d=o.getUTCHours(),f;switch(d===12?f=kn.noon:d===0?f=kn.midnight:f=d/12>=1?"pm":"am",i){case"b":case"bb":return u.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"bbb":return u.dayPeriod(f,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return u.dayPeriod(f,{width:"narrow",context:"formatting"});case"bbbb":default:return u.dayPeriod(f,{width:"wide",context:"formatting"})}},B:function(o,i,u){var d=o.getUTCHours(),f;switch(d>=17?f=kn.evening:d>=12?f=kn.afternoon:d>=4?f=kn.morning:f=kn.night,i){case"B":case"BB":case"BBB":return u.dayPeriod(f,{width:"abbreviated",context:"formatting"});case"BBBBB":return u.dayPeriod(f,{width:"narrow",context:"formatting"});case"BBBB":default:return u.dayPeriod(f,{width:"wide",context:"formatting"})}},h:function(o,i,u){if(i==="ho"){var d=o.getUTCHours()%12;return d===0&&(d=12),u.ordinalNumber(d,{unit:"hour"})}return br.h(o,i)},H:function(o,i,u){return i==="Ho"?u.ordinalNumber(o.getUTCHours(),{unit:"hour"}):br.H(o,i)},K:function(o,i,u){var d=o.getUTCHours()%12;return i==="Ko"?u.ordinalNumber(d,{unit:"hour"}):ke(d,i.length)},k:function(o,i,u){var d=o.getUTCHours();return d===0&&(d=24),i==="ko"?u.ordinalNumber(d,{unit:"hour"}):ke(d,i.length)},m:function(o,i,u){return i==="mo"?u.ordinalNumber(o.getUTCMinutes(),{unit:"minute"}):br.m(o,i)},s:function(o,i,u){return i==="so"?u.ordinalNumber(o.getUTCSeconds(),{unit:"second"}):br.s(o,i)},S:function(o,i){return br.S(o,i)},X:function(o,i,u,d){var f=d._originalDate||o,m=f.getTimezoneOffset();if(m===0)return"Z";switch(i){case"X":return bf(m);case"XXXX":case"XX":return Qr(m);case"XXXXX":case"XXX":default:return Qr(m,":")}},x:function(o,i,u,d){var f=d._originalDate||o,m=f.getTimezoneOffset();switch(i){case"x":return bf(m);case"xxxx":case"xx":return Qr(m);case"xxxxx":case"xxx":default:return Qr(m,":")}},O:function(o,i,u,d){var f=d._originalDate||o,m=f.getTimezoneOffset();switch(i){case"O":case"OO":case"OOO":return"GMT"+Nf(m,":");case"OOOO":default:return"GMT"+Qr(m,":")}},z:function(o,i,u,d){var f=d._originalDate||o,m=f.getTimezoneOffset();switch(i){case"z":case"zz":case"zzz":return"GMT"+Nf(m,":");case"zzzz":default:return"GMT"+Qr(m,":")}},t:function(o,i,u,d){var f=d._originalDate||o,m=Math.floor(f.getTime()/1e3);return ke(m,i.length)},T:function(o,i,u,d){var f=d._originalDate||o,m=f.getTime();return ke(m,i.length)}};function Nf(n,o){var i=n>0?"-":"+",u=Math.abs(n),d=Math.floor(u/60),f=u%60;if(f===0)return i+String(d);var m=o;return i+String(d)+m+ke(f,2)}function bf(n,o){if(n%60===0){var i=n>0?"-":"+";return i+ke(Math.abs(n)/60,2)}return Qr(n,o)}function Qr(n,o){var i=o||"",u=n>0?"-":"+",d=Math.abs(n),f=ke(Math.floor(d/60),2),m=ke(d%60,2);return u+f+i+m}var kf=function(o,i){switch(o){case"P":return i.date({width:"short"});case"PP":return i.date({width:"medium"});case"PPP":return i.date({width:"long"});case"PPPP":default:return i.date({width:"full"})}},dm=function(o,i){switch(o){case"p":return i.time({width:"short"});case"pp":return i.time({width:"medium"});case"ppp":return i.time({width:"long"});case"pppp":default:return i.time({width:"full"})}},sx=function(o,i){var u=o.match(/(P+)(p+)?/)||[],d=u[1],f=u[2];if(!f)return kf(o,i);var m;switch(d){case"P":m=i.dateTime({width:"short"});break;case"PP":m=i.dateTime({width:"medium"});break;case"PPP":m=i.dateTime({width:"long"});break;case"PPPP":default:m=i.dateTime({width:"full"});break}return m.replace("{{date}}",kf(d,i)).replace("{{time}}",dm(f,i))},ix={p:dm,P:sx},lx=["D","DD"],ux=["YY","YYYY"];function cx(n){return lx.indexOf(n)!==-1}function dx(n){return ux.indexOf(n)!==-1}function Sf(n,o,i){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(o,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(o,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(o,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(o,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var fx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},mx=function(o,i,u){var d,f=fx[o];return typeof f=="string"?d=f:i===1?d=f.one:d=f.other.replace("{{count}}",i.toString()),u!=null&&u.addSuffix?u.comparison&&u.comparison>0?"in "+d:d+" ago":d};function Cn(n){return function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=o.width?String(o.width):n.defaultWidth,u=n.formats[i]||n.formats[n.defaultWidth];return u}}var px={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},hx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vx={date:Cn({formats:px,defaultWidth:"full"}),time:Cn({formats:hx,defaultWidth:"full"}),dateTime:Cn({formats:gx,defaultWidth:"full"})},yx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xx=function(o,i,u,d){return yx[o]};function Ft(n){return function(o,i){var u=i!=null&&i.context?String(i.context):"standalone",d;if(u==="formatting"&&n.formattingValues){var f=n.defaultFormattingWidth||n.defaultWidth,m=i!=null&&i.width?String(i.width):f;d=n.formattingValues[m]||n.formattingValues[f]}else{var v=n.defaultWidth,g=i!=null&&i.width?String(i.width):n.defaultWidth;d=n.values[g]||n.values[v]}var j=n.argumentCallback?n.argumentCallback(o):o;return d[j]}}var wx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},jx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Nx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},bx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},kx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Sx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Cx=function(o,i){var u=Number(o),d=u%100;if(d>20||d<10)switch(d%10){case 1:return u+"st";case 2:return u+"nd";case 3:return u+"rd"}return u+"th"},_x={ordinalNumber:Cx,era:Ft({values:wx,defaultWidth:"wide"}),quarter:Ft({values:jx,defaultWidth:"wide",argumentCallback:function(o){return o-1}}),month:Ft({values:Nx,defaultWidth:"wide"}),day:Ft({values:bx,defaultWidth:"wide"}),dayPeriod:Ft({values:kx,defaultWidth:"wide",formattingValues:Sx,defaultFormattingWidth:"wide"})};function Ht(n){return function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=i.width,d=u&&n.matchPatterns[u]||n.matchPatterns[n.defaultMatchWidth],f=o.match(d);if(!f)return null;var m=f[0],v=u&&n.parsePatterns[u]||n.parsePatterns[n.defaultParseWidth],g=Array.isArray(v)?Tx(v,function(y){return y.test(m)}):Ex(v,function(y){return y.test(m)}),j;j=n.valueCallback?n.valueCallback(g):g,j=i.valueCallback?i.valueCallback(j):j;var h=o.slice(m.length);return{value:j,rest:h}}}function Ex(n,o){for(var i in n)if(n.hasOwnProperty(i)&&o(n[i]))return i}function Tx(n,o){for(var i=0;i1&&arguments[1]!==void 0?arguments[1]:{},u=o.match(n.matchPattern);if(!u)return null;var d=u[0],f=o.match(n.parsePattern);if(!f)return null;var m=n.valueCallback?n.valueCallback(f[0]):f[0];m=i.valueCallback?i.valueCallback(m):m;var v=o.slice(d.length);return{value:m,rest:v}}}var Px=/^(\d+)(th|st|nd|rd)?/i,Dx=/\d+/i,Mx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ox={any:[/^b/i,/^(a|c)/i]},Lx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Rx={any:[/1/i,/2/i,/3/i,/4/i]},Ix={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},zx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$x={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ax={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Ux={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Fx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Hx={ordinalNumber:fm({matchPattern:Px,parsePattern:Dx,valueCallback:function(o){return parseInt(o,10)}}),era:Ht({matchPatterns:Mx,defaultMatchWidth:"wide",parsePatterns:Ox,defaultParseWidth:"any"}),quarter:Ht({matchPatterns:Lx,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any",valueCallback:function(o){return o+1}}),month:Ht({matchPatterns:Ix,defaultMatchWidth:"wide",parsePatterns:zx,defaultParseWidth:"any"}),day:Ht({matchPatterns:$x,defaultMatchWidth:"wide",parsePatterns:Ax,defaultParseWidth:"any"}),dayPeriod:Ht({matchPatterns:Ux,defaultMatchWidth:"any",parsePatterns:Fx,defaultParseWidth:"any"})},Bx={code:"en-US",formatDistance:mx,formatLong:vx,formatRelative:xx,localize:_x,match:Hx,options:{weekStartsOn:0,firstWeekContainsDate:1}},Wx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vx=/^'([^]*?)'?$/,Qx=/''/g,Yx=/[a-zA-Z]/;function st(n,o,i){var u,d,f,m,v,g,j,h,y,N,P,A,z,D,B,C,x,$;Ie(2,arguments);var M=String(o),L=cs(),U=(u=(d=i?.locale)!==null&&d!==void 0?d:L.locale)!==null&&u!==void 0?u:Bx,I=rr((f=(m=(v=(g=i?.firstWeekContainsDate)!==null&&g!==void 0?g:i==null||(j=i.locale)===null||j===void 0||(h=j.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&v!==void 0?v:L.firstWeekContainsDate)!==null&&m!==void 0?m:(y=L.locale)===null||y===void 0||(N=y.options)===null||N===void 0?void 0:N.firstWeekContainsDate)!==null&&f!==void 0?f:1);if(!(I>=1&&I<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Y=rr((P=(A=(z=(D=i?.weekStartsOn)!==null&&D!==void 0?D:i==null||(B=i.locale)===null||B===void 0||(C=B.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&z!==void 0?z:L.weekStartsOn)!==null&&A!==void 0?A:(x=L.locale)===null||x===void 0||($=x.options)===null||$===void 0?void 0:$.weekStartsOn)!==null&&P!==void 0?P:0);if(!(Y>=0&&Y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!U.localize)throw new RangeError("locale must contain localize property");if(!U.formatLong)throw new RangeError("locale must contain formatLong property");var pe=nt(n);if(!Xy(pe))throw new RangeError("Invalid time value");var ne=Qy(pe),le=Ky(pe,ne),ve={firstWeekContainsDate:I,weekStartsOn:Y,locale:U,_originalDate:pe},X=M.match(qx).map(function(ae){var fe=ae[0];if(fe==="p"||fe==="P"){var ue=ix[fe];return ue(ae,U.formatLong)}return ae}).join("").match(Wx).map(function(ae){if(ae==="''")return"'";var fe=ae[0];if(fe==="'")return Xx(ae);var ue=ox[fe];if(ue)return!(i!=null&&i.useAdditionalWeekYearTokens)&&dx(ae)&&Sf(ae,o,String(n)),!(i!=null&&i.useAdditionalDayOfYearTokens)&&cx(ae)&&Sf(ae,o,String(n)),ue(le,ae,U.localize,ve);if(fe.match(Yx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+fe+"`");return ae}).join("");return X}function Xx(n){var o=n.match(Vx);return o?o[1].replace(Qx,"'"):n}function Cf(n,o){Ie(2,arguments);var i=nt(n),u=nt(o);return i.getTime()>u.getTime()}function _f(n,o){Ie(2,arguments);var i=nt(n),u=nt(o);return i.getTime()2)return o;if(/:/.test(i[0])?u=i[0]:(o.date=i[0],u=i[1],Fo.timeZoneDelimiter.test(o.date)&&(o.date=n.split(Fo.timeZoneDelimiter)[0],u=n.substr(o.date.length,n.length))),u){var d=Fo.timezone.exec(u);d?(o.time=u.replace(d[1],""),o.timezone=d[1]):o.time=u}return o}function t1(n,o){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+o)+"})|(\\d{2}|[+-]\\d{"+(2+o)+"})$)"),u=n.match(i);if(!u)return{year:NaN,restDateString:""};var d=u[1]?parseInt(u[1]):null,f=u[2]?parseInt(u[2]):null;return{year:f===null?d:f*100,restDateString:n.slice((u[1]||u[2]).length)}}function r1(n,o){if(o===null)return new Date(NaN);var i=n.match(Gx);if(!i)return new Date(NaN);var u=!!i[4],d=ya(i[1]),f=ya(i[2])-1,m=ya(i[3]),v=ya(i[4]),g=ya(i[5])-1;if(u)return u1(o,v,g)?o1(o,v,g):new Date(NaN);var j=new Date(0);return!i1(o,f,m)||!l1(o,d)?new Date(NaN):(j.setUTCFullYear(o,f,Math.max(d,m)),j)}function ya(n){return n?parseInt(n):1}function n1(n){var o=n.match(Jx);if(!o)return NaN;var i=vl(o[1]),u=vl(o[2]),d=vl(o[3]);return c1(i,u,d)?i*im+u*sm+d*1e3:NaN}function vl(n){return n&&parseFloat(n.replace(",","."))||0}function a1(n){if(n==="Z")return 0;var o=n.match(Zx);if(!o)return 0;var i=o[1]==="+"?-1:1,u=parseInt(o[2]),d=o[3]&&parseInt(o[3])||0;return d1(u,d)?i*(u*im+d*sm):NaN}function o1(n,o,i){var u=new Date(0);u.setUTCFullYear(n,0,4);var d=u.getUTCDay()||7,f=(o-1)*7+i+1-d;return u.setUTCDate(u.getUTCDate()+f),u}var s1=[31,null,31,30,31,30,31,31,30,31,30,31];function mm(n){return n%400===0||n%4===0&&n%100!==0}function i1(n,o,i){return o>=0&&o<=11&&i>=1&&i<=(s1[o]||(mm(n)?29:28))}function l1(n,o){return o>=1&&o<=(mm(n)?366:365)}function u1(n,o,i){return o>=1&&o<=53&&i>=0&&i<=6}function c1(n,o,i){return n===24?o===0&&i===0:i>=0&&i<60&&o>=0&&o<60&&n>=0&&n<25}function d1(n,o){return o>=0&&o<=59}var f1={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},m1=function(o,i,u){var d,f=f1[o];return typeof f=="string"?d=f:i===1?d=f.one:d=f.other.replace("{{count}}",String(i)),u!=null&&u.addSuffix?u.comparison&&u.comparison>0?"em "+d:"há "+d:d},p1={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},h1={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},g1={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},v1={date:Cn({formats:p1,defaultWidth:"full"}),time:Cn({formats:h1,defaultWidth:"full"}),dateTime:Cn({formats:g1,defaultWidth:"full"})},y1={lastWeek:function(o){var i=o.getUTCDay(),u=i===0||i===6?"último":"última";return"'"+u+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},x1=function(o,i,u,d){var f=y1[o];return typeof f=="function"?f(i):f},w1={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},j1={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},N1={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},b1={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},k1={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},S1={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},C1=function(o,i){var u=Number(o);return i?.unit==="week"?u+"ª":u+"º"},_1={ordinalNumber:C1,era:Ft({values:w1,defaultWidth:"wide"}),quarter:Ft({values:j1,defaultWidth:"wide",argumentCallback:function(o){return o-1}}),month:Ft({values:N1,defaultWidth:"wide"}),day:Ft({values:b1,defaultWidth:"wide"}),dayPeriod:Ft({values:k1,defaultWidth:"wide",formattingValues:S1,defaultFormattingWidth:"wide"})},E1=/^(\d+)[ºªo]?/i,T1=/\d+/i,P1={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},D1={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},M1={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},O1={any:[/1/i,/2/i,/3/i,/4/i]},L1={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},R1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},I1={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},z1={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},$1={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},A1={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},U1={ordinalNumber:fm({matchPattern:E1,parsePattern:T1,valueCallback:function(o){return parseInt(o,10)}}),era:Ht({matchPatterns:P1,defaultMatchWidth:"wide",parsePatterns:D1,defaultParseWidth:"any"}),quarter:Ht({matchPatterns:M1,defaultMatchWidth:"wide",parsePatterns:O1,defaultParseWidth:"any",valueCallback:function(o){return o+1}}),month:Ht({matchPatterns:L1,defaultMatchWidth:"wide",parsePatterns:R1,defaultParseWidth:"any"}),day:Ht({matchPatterns:I1,defaultMatchWidth:"wide",parsePatterns:z1,defaultParseWidth:"any"}),dayPeriod:Ht({matchPatterns:$1,defaultMatchWidth:"any",parsePatterns:A1,defaultParseWidth:"any"})},Cr={code:"pt-BR",formatDistance:m1,formatLong:v1,formatRelative:x1,localize:_1,match:U1,options:{weekStartsOn:0,firstWeekContainsDate:1}};const F1=()=>{const[n,o]=_.useState([]),[i,u]=_.useState(null),[d,f]=_.useState(!1),[m,v]=_.useState(1),[g,j]=_.useState({medicoId:"",data:"",horario:"",tipoConsulta:"primeira-vez",motivoConsulta:"",observacoes:""}),[h,y]=_.useState([]),N=Dr();_.useEffect(()=>{const L=localStorage.getItem("pacienteLogado");if(!L){N("/paciente");return}try{const U=JSON.parse(L);u(U),P()}catch(U){console.error("Erro ao carregar dados do paciente:",U),N("/paciente")}},[N]);const P=async()=>{try{const L=await Be.entities.medicos.list({filter:{ativo:!0}});o(L.list||[])}catch(L){console.error("Erro ao carregar médicos:",L),ce.error("Erro ao carregar lista de médicos")}},A=async(L,U)=>{try{const I=n.find(fe=>fe._id===L);if(!I)return;const Y=new Date(U),pe=["domingo","segunda","terca","quarta","quinta","sexta","sabado"][Y.getDay()],ne=I.horarioAtendimento[pe]||[],X=((await Be.entities.consultas.list({filter:{medicoId:L,dataHora:{$regex:U.split("T")[0]}}})).list||[]).map(fe=>new Date(fe.dataHora).toTimeString().slice(0,5)),ae=ne.filter(fe=>!X.includes(fe));y(ae)}catch(I){console.error("Erro ao buscar horários:",I),ce.error("Erro ao carregar horários disponíveis")}},z=L=>{j(U=>({...U,medicoId:L,data:"",horario:""})),y([])},D=L=>{j(U=>({...U,data:L,horario:""})),g.medicoId&&L&&A(g.medicoId,L)},B=async()=>{if(i)try{f(!0);const L=new Date(`${g.data}T${g.horario}:00.000Z`);await Be.entities.consultas.create({pacienteId:i._id,medicoId:g.medicoId,dataHora:L.toISOString(),status:"agendada",tipoConsulta:g.tipoConsulta,motivoConsulta:g.motivoConsulta,observacoes:g.observacoes,lembrete:!1,criadoPor:"paciente",criadoEm:new Date().toISOString(),atualizadoEm:new Date().toISOString()}),ce.success("Consulta agendada com sucesso!"),v(4)}catch(L){console.error("Erro ao agendar consulta:",L),ce.error("Erro ao agendar consulta. Tente novamente.")}finally{f(!1)}},C=()=>{j({medicoId:"",data:"",horario:"",tipoConsulta:"primeira-vez",motivoConsulta:"",observacoes:""}),y([]),v(1)},x=()=>{localStorage.removeItem("pacienteLogado"),N("/paciente")},$=()=>{const L=[];for(let U=1;U<=7;U++){const I=Bl(new Date,U);L.push({valor:st(I,"yyyy-MM-dd"),label:st(I,"EEEE, dd/MM",{locale:Cr})})}return L},M=n.find(L=>L._id===g.medicoId);return i?m===4?a.jsx("div",{className:"max-w-2xl mx-auto",children:a.jsxs("div",{className:"bg-white rounded-lg shadow-md p-8 text-center",children:[a.jsx(es,{className:"w-16 h-16 text-green-500 mx-auto mb-4"}),a.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Consulta Agendada com Sucesso!"}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-6 mb-6 text-left",children:[a.jsx("h3",{className:"font-semibold mb-3",children:"Detalhes do Agendamento:"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Paciente:"})," ",i.nome]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Médico:"})," ",M?.nome]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Especialidade:"})," ",M?.especialidade]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Data:"})," ",st(new Date(g.data),"dd/MM/yyyy",{locale:Cr})]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Horário:"})," ",g.horario]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Tipo:"})," ",g.tipoConsulta]}),g.motivoConsulta&&a.jsxs("p",{children:[a.jsx("strong",{children:"Motivo:"})," ",g.motivoConsulta]})]})]}),a.jsx("button",{onClick:C,className:"btn-primary",children:"Fazer Novo Agendamento"})]})}):a.jsxs("div",{className:"max-w-4xl mx-auto",children:[a.jsx("div",{className:"bg-gradient-to-r from-blue-700 to-blue-400 rounded-lg p-6 mb-8 text-white",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl font-bold",children:["Bem-vindo(a), ",i.nome,"!"]}),a.jsx("p",{className:"opacity-90",children:"Agende sua consulta médica"})]}),a.jsxs("button",{onClick:x,className:"flex items-center space-x-2 bg-white/20 hover:bg-white/30 px-4 py-2 rounded-lg transition-colors",children:[a.jsx(Gf,{className:"w-4 h-4"}),a.jsx("span",{children:"Sair"})]})]})}),a.jsx("div",{className:"flex items-center justify-center mb-8",children:[1,2,3].map(L=>a.jsxs(Ce.Fragment,{children:[a.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center ${m>=L?"bg-blue-600 text-white":"bg-gray-300 text-gray-600"}`,children:L}),L<3&&a.jsx("div",{className:`w-16 h-1 ${m>L?"bg-blue-600":"bg-gray-300"}`})]},L))}),a.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[m===1&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("h2",{className:"text-xl font-semibold flex items-center",children:[a.jsx(_n,{className:"w-5 h-5 mr-2"}),"Selecione o Médico"]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Médico/Especialidade"}),a.jsxs("select",{value:g.medicoId,onChange:L=>z(L.target.value),className:"form-input",required:!0,children:[a.jsx("option",{value:"",children:"Selecione um médico"}),n.map(L=>a.jsxs("option",{value:L._id,children:[L.nome," - ",L.especialidade," (R$ ",L.valorConsulta,")"]},L._id))]})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx("button",{onClick:()=>v(2),disabled:!g.medicoId,className:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:"Próximo"})})]}),m===2&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("h2",{className:"text-xl font-semibold flex items-center",children:[a.jsx(Er,{className:"w-5 h-5 mr-2"}),"Selecione Data e Horário"]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Data da Consulta"}),a.jsxs("select",{value:g.data,onChange:L=>D(L.target.value),className:"form-input",required:!0,children:[a.jsx("option",{value:"",children:"Selecione uma data"}),$().map(L=>a.jsx("option",{value:L.valor,children:L.label},L.valor))]})]}),g.data&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Horário Disponível"}),h.length>0?a.jsx("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-3",children:h.map(L=>a.jsx("button",{onClick:()=>j(U=>({...U,horario:L})),className:`p-3 border rounded-lg text-center transition-colors ${g.horario===L?"bg-blue-600 text-white border-blue-600":"bg-white text-gray-700 border-gray-300 hover:border-blue-300"}`,children:L},L))}):a.jsx("p",{className:"text-gray-500 text-center py-4",children:"Nenhum horário disponível para esta data"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("button",{onClick:()=>v(1),className:"btn-secondary",children:"Voltar"}),a.jsx("button",{onClick:()=>v(3),disabled:!g.data||!g.horario,className:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:"Próximo"})]})]}),m===3&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("h2",{className:"text-xl font-semibold flex items-center",children:[a.jsx(us,{className:"w-5 h-5 mr-2"}),"Informações da Consulta"]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Tipo de Consulta"}),a.jsxs("select",{value:g.tipoConsulta,onChange:L=>j(U=>({...U,tipoConsulta:L.target.value})),className:"form-input",children:[a.jsx("option",{value:"primeira-vez",children:"Primeira Consulta"}),a.jsx("option",{value:"retorno",children:"Retorno"}),a.jsx("option",{value:"urgencia",children:"Urgência"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Motivo da Consulta"}),a.jsx("textarea",{value:g.motivoConsulta,onChange:L=>j(U=>({...U,motivoConsulta:L.target.value})),className:"form-input",rows:3,placeholder:"Descreva brevemente o motivo da consulta"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Observações (opcional)"}),a.jsx("textarea",{value:g.observacoes,onChange:L=>j(U=>({...U,observacoes:L.target.value})),className:"form-input",rows:2,placeholder:"Informações adicionais relevantes"})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[a.jsx("h3",{className:"font-semibold mb-3",children:"Resumo do Agendamento:"}),a.jsxs("div",{className:"space-y-1 text-sm",children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Paciente:"})," ",i.nome]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Médico:"})," ",M?.nome]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Data:"})," ",st(new Date(g.data),"dd/MM/yyyy",{locale:Cr})]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Horário:"})," ",g.horario]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Valor:"})," R$ ",M?.valorConsulta]})]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("button",{onClick:()=>v(2),className:"btn-secondary",children:"Voltar"}),a.jsx("button",{onClick:B,disabled:d,className:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:d?"Agendando...":"Confirmar Agendamento"})]})]})]})]}):a.jsx("div",{className:"flex justify-center items-center min-h-screen",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})},H1=()=>{const[n,o]=_.useState([]),[i,u]=_.useState([]),[d,f]=_.useState(null),[m,v]=_.useState(!0),[g,j]=_.useState("todas"),[h,y]=_.useState("todos"),[N,P]=_.useState(null),[A,z]=_.useState(!1),D=Dr();_.useEffect(()=>{const X=localStorage.getItem("pacienteLogado");if(!X){D("/paciente");return}try{const ae=JSON.parse(X);f(ae),B(ae._id),C()}catch(ae){console.error("Erro ao carregar dados do paciente:",ae),D("/paciente")}},[D]);const B=async X=>{try{const ae=await Be.entities.consultas.list({filter:{pacienteId:X},sort:{dataHora:-1}});o(ae.list||[])}catch(ae){console.error("Erro ao carregar consultas:",ae),ce.error("Erro ao carregar suas consultas")}finally{v(!1)}},C=async()=>{try{const X=await Be.entities.medicos.list({});u(X.list||[])}catch(X){console.error("Erro ao carregar médicos:",X)}},x=X=>{const ae=i.find(fe=>fe._id===X);return ae?ae.nome:"Médico não encontrado"},$=X=>{const ae=i.find(fe=>fe._id===X);return ae?ae.especialidade:""},M=X=>{switch(X){case"agendada":return"bg-blue-100 text-blue-800";case"confirmada":return"bg-green-100 text-green-800";case"realizada":return"bg-gray-100 text-gray-800";case"cancelada":return"bg-red-100 text-red-800";case"faltou":return"bg-orange-100 text-orange-800";default:return"bg-gray-100 text-gray-800"}},L=X=>{switch(X){case"agendada":return a.jsx(Sn,{className:"w-4 h-4"});case"confirmada":return a.jsx(es,{className:"w-4 h-4"});case"realizada":return a.jsx(es,{className:"w-4 h-4"});case"cancelada":return a.jsx(rf,{className:"w-4 h-4"});case"faltou":return a.jsx(Xf,{className:"w-4 h-4"});default:return a.jsx(Sn,{className:"w-4 h-4"})}},U=X=>{switch(X){case"agendada":return"Agendada";case"confirmada":return"Confirmada";case"realizada":return"Realizada";case"cancelada":return"Cancelada";case"faltou":return"Faltou";default:return X}},I=()=>{let X=[...n];g!=="todas"&&(X=X.filter(fe=>fe.status===g));const ae=new Date;switch(h){case"proximas":X=X.filter(ue=>Cf(new Date(ue.dataHora),ae)&&(ue.status==="agendada"||ue.status==="confirmada"));break;case"hoje":X=X.filter(ue=>Pl(new Date(ue.dataHora)));break;case"semana":const fe=Bl(ae,7);X=X.filter(ue=>Cf(new Date(ue.dataHora),ae)&&_f(new Date(ue.dataHora),fe));break;case"historico":X=X.filter(ue=>_f(new Date(ue.dataHora),ae));break}return X},Y=X=>{P(X),z(!0)},pe=()=>{P(null),z(!1)},ne=()=>{D("/agendamento")},le=()=>{localStorage.removeItem("pacienteLogado"),D("/paciente")};if(!d)return a.jsx("div",{className:"flex justify-center items-center min-h-screen",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})});const ve=I();return a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsx("div",{className:"bg-gradient-to-r from-blue-700 to-blue-400 rounded-lg p-6 mb-8 text-white",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-2xl font-bold",children:["Olá, ",d.nome,"!"]}),a.jsx("p",{className:"opacity-90",children:"Acompanhe suas consultas e exames"})]}),a.jsxs("div",{className:"flex space-x-4",children:[a.jsx("button",{onClick:ne,className:"bg-white/20 hover:bg-white/30 px-4 py-2 rounded-lg transition-colors",children:"Nova Consulta"}),a.jsxs("button",{onClick:le,className:"flex items-center space-x-2 bg-white/20 hover:bg-white/30 px-4 py-2 rounded-lg transition-colors",children:[a.jsx(Gf,{className:"w-4 h-4"}),a.jsx("span",{children:"Sair"})]})]})]})}),a.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-4 mb-4",children:[a.jsx(Lg,{className:"w-5 h-5 text-gray-600"}),a.jsx("h2",{className:"text-lg font-semibold",children:"Filtros"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Status"}),a.jsxs("select",{value:g,onChange:X=>j(X.target.value),className:"form-input",children:[a.jsx("option",{value:"todas",children:"Todas"}),a.jsx("option",{value:"agendada",children:"Agendadas"}),a.jsx("option",{value:"confirmada",children:"Confirmadas"}),a.jsx("option",{value:"realizada",children:"Realizadas"}),a.jsx("option",{value:"cancelada",children:"Canceladas"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Período"}),a.jsxs("select",{value:h,onChange:X=>y(X.target.value),className:"form-input",children:[a.jsx("option",{value:"todos",children:"Todos"}),a.jsx("option",{value:"proximas",children:"Próximas"}),a.jsx("option",{value:"hoje",children:"Hoje"}),a.jsx("option",{value:"semana",children:"Próximos 7 dias"}),a.jsx("option",{value:"historico",children:"Histórico"})]})]})]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow-md",children:[a.jsx("div",{className:"p-6 border-b border-gray-200",children:a.jsxs("h2",{className:"text-xl font-semibold",children:["Suas Consultas (",ve.length,")"]})}),m?a.jsx("div",{className:"flex justify-center items-center p-8",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):ve.length===0?a.jsxs("div",{className:"text-center p-8",children:[a.jsx(Er,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Nenhuma consulta encontrada"}),a.jsx("p",{className:"text-gray-500 mb-4",children:g!=="todas"||h!=="todos"?"Tente ajustar os filtros para ver mais consultas.":"Você ainda não tem consultas agendadas."}),a.jsx("button",{onClick:ne,className:"btn-primary",children:"Agendar Primeira Consulta"})]}):a.jsx("div",{className:"divide-y divide-gray-200",children:ve.map(X=>a.jsx("div",{className:"p-6 hover:bg-gray-50 transition-colors",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center space-x-4 mb-2",children:[a.jsxs("span",{className:`inline-flex items-center space-x-1 px-2.5 py-0.5 rounded-full text-xs font-medium ${M(X.status)}`,children:[L(X.status),a.jsx("span",{children:U(X.status)})]}),a.jsx("span",{className:"text-sm text-gray-500",children:X.tipoConsulta})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(_n,{className:"w-4 h-4 text-gray-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-900",children:x(X.medicoId)}),a.jsx("p",{className:"text-sm text-gray-500",children:$(X.medicoId)})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Er,{className:"w-4 h-4 text-gray-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-900",children:st(new Date(X.dataHora),"dd/MM/yyyy",{locale:Cr})}),a.jsx("p",{className:"text-sm text-gray-500",children:st(new Date(X.dataHora),"EEEE",{locale:Cr})})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Sn,{className:"w-4 h-4 text-gray-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-900",children:st(new Date(X.dataHora),"HH:mm")}),a.jsx("p",{className:"text-sm text-gray-500",children:X.motivoConsulta||"Consulta de rotina"})]})]})]})]}),a.jsx("button",{onClick:()=>Y(X),className:"ml-4 p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors",children:a.jsx(Dg,{className:"w-5 h-5"})})]})},X._id))})]}),A&&N&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:a.jsxs("div",{className:"bg-white rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[a.jsx("div",{className:"p-6 border-b border-gray-200",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Detalhes da Consulta"}),a.jsx("button",{onClick:pe,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:a.jsx(rf,{className:"w-5 h-5"})})]})}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold mb-3",children:"Informações da Consulta"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Médico:"}),a.jsx("p",{className:"font-medium",children:x(N.medicoId)})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Especialidade:"}),a.jsx("p",{className:"font-medium",children:$(N.medicoId)})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Data:"}),a.jsx("p",{className:"font-medium",children:st(new Date(N.dataHora),"dd/MM/yyyy - HH:mm",{locale:Cr})})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Status:"}),a.jsxs("span",{className:`inline-flex items-center space-x-1 px-2.5 py-0.5 rounded-full text-xs font-medium ${M(N.status)}`,children:[L(N.status),a.jsx("span",{children:U(N.status)})]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Tipo:"}),a.jsx("p",{className:"font-medium",children:N.tipoConsulta})]})]})]}),N.motivoConsulta&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold mb-2",children:"Motivo da Consulta"}),a.jsx("p",{className:"text-gray-700 bg-gray-50 p-3 rounded-lg",children:N.motivoConsulta})]}),N.observacoes&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold mb-2",children:"Observações"}),a.jsx("p",{className:"text-gray-700 bg-gray-50 p-3 rounded-lg",children:N.observacoes})]}),N.status==="realizada"&&N.resultados&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold mb-2",children:"Resultados da Consulta"}),a.jsx("p",{className:"text-gray-700 bg-green-50 p-3 rounded-lg border-l-4 border-green-400",children:N.resultados})]}),N.prescricoes&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold mb-2",children:"Prescrições Médicas"}),a.jsx("p",{className:"text-gray-700 bg-blue-50 p-3 rounded-lg border-l-4 border-blue-400",children:N.prescricoes})]}),N.proximaConsulta&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold mb-2",children:"Próxima Consulta Recomendada"}),a.jsx("p",{className:"text-gray-700 bg-yellow-50 p-3 rounded-lg border-l-4 border-yellow-400",children:N.proximaConsulta})]}),a.jsxs("div",{className:"text-xs text-gray-500 pt-4 border-t",children:["Agendado em: ",st(new Date(N.criadoEm),"dd/MM/yyyy às HH:mm",{locale:Cr})]})]})]})})]})},B1=()=>{const[n,o]=_.useState([]),[i,u]=_.useState(!0),[d,f]=_.useState(""),[m,v]=_.useState(!1),[g,j]=_.useState(null),[h,y]=_.useState({nome:"",cpf:"",telefone:"",email:"",dataNascimento:"",altura:"",peso:"",endereco:{rua:"",numero:"",bairro:"",cidade:"",cep:""},convenio:"",numeroCarteirinha:"",observacoes:""});_.useEffect(()=>{N()},[]);const N=async()=>{try{u(!0);const x=await Be.entities.pacientes.list({filter:{ativo:!0},sort:{nome:1}});o(x.list||[])}catch(x){console.error("Erro ao carregar pacientes:",x),ce.error("Erro ao carregar lista de pacientes")}finally{u(!1)}},P=(x,$)=>{if(!x||!$)return null;const M=x/100;return($/(M*M)).toFixed(1)},A=x=>x<18.5?{status:"Abaixo do peso",color:"text-blue-600"}:x<25?{status:"Peso normal",color:"text-green-600"}:x<30?{status:"Sobrepeso",color:"text-yellow-600"}:{status:"Obesidade",color:"text-red-600"},z=async x=>{x.preventDefault();try{u(!0);const $={...h,altura:h.altura?parseFloat(h.altura):void 0,peso:h.peso?parseFloat(h.peso):void 0,ativo:!0,criadoPor:"secretaria",criadoEm:new Date().toISOString(),atualizadoEm:new Date().toISOString()};if(g?(await Be.entities.pacientes.update(g._id,{...$,atualizadoEm:new Date().toISOString()}),ce.success("Paciente atualizado com sucesso!")):(await Be.entities.pacientes.create($),ce.success("Paciente cadastrado com sucesso!")),!g&&h.email&&h.nome&&h.cpf){const M=JSON.parse(localStorage.getItem("secretarias")||"[]");M.push({nome:h.nome,email:h.email,cpf:h.cpf,telefone:h.telefone,criadoEm:new Date().toISOString()}),localStorage.setItem("secretarias",JSON.stringify(M)),ce.success("Secretária cadastrada localmente!")}resetForm(),j(null),v(!1)}catch($){console.error("Erro ao salvar paciente:",$),ce.error("Erro ao salvar paciente. Tente novamente.")}finally{u(!1)}},D=x=>{y({nome:x.nome||"",cpf:x.cpf||"",telefone:x.telefone||"",email:x.email||"",dataNascimento:x.dataNascimento?x.dataNascimento.split("T")[0]:"",altura:x.altura?.toString()||"",peso:x.peso?.toString()||"",endereco:{rua:x.endereco?.rua||"",numero:x.endereco?.numero||"",bairro:x.endereco?.bairro||"",cidade:x.endereco?.cidade||"",cep:x.endereco?.cep||""},convenio:x.convenio||"",numeroCarteirinha:x.numeroCarteirinha||"",observacoes:x.observacoes||""}),j(x),v(!0)},B=async x=>{if(window.confirm("Tem certeza que deseja excluir este paciente?"))try{await Be.entities.pacientes.update(x,{ativo:!1,atualizadoEm:new Date().toISOString()}),ce.success("Paciente removido com sucesso!"),N()}catch($){console.error("Erro ao remover paciente:",$),ce.error("Erro ao remover paciente")}},C=n.filter(x=>(x.nome||"").toLowerCase().includes(d.toLowerCase())||(x.cpf||"").includes(d)||(x.telefone||"").includes(d));return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Cadastro de Pacientes"}),a.jsx("p",{className:"text-gray-600",children:"Gerencie o cadastro de pacientes da clínica"})]}),a.jsxs("button",{onClick:()=>v(!0),className:"btn-primary mt-4 md:mt-0",children:[a.jsx(ts,{className:"w-5 h-5 mr-2"}),"Novo Paciente"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[a.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-3 bg-gradient-to-l from-blue-700 to-blue-400 rounded-full",children:a.jsx(Yr,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total de Pacientes"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.length})]})]})}),a.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-3 bg-green-100 rounded-full",children:a.jsx(us,{className:"w-6 h-6 text-green-600"})}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Com Convênio"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.filter(x=>x.convenio&&x.convenio!=="Particular").length})]})]})}),a.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-3 bg-purple-100 rounded-full",children:a.jsx(ts,{className:"w-6 h-6 text-purple-600"})}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Cadastros Hoje"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.filter(x=>{const $=new Date().toISOString().split("T")[0];return x.criadoEm?.startsWith($)}).length})]})]})}),a.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"p-3 bg-orange-100 rounded-full",children:a.jsx(bl,{className:"w-6 h-6 text-orange-600"})}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Com Dados Físicos"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:n.filter(x=>x.altura&&x.peso).length})]})]})})]}),a.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:a.jsxs("div",{className:"relative",children:[a.jsx(Bo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),a.jsx("input",{type:"text",placeholder:"Buscar por nome, CPF ou telefone...",value:d,onChange:x=>f(x.target.value),className:"pl-10 form-input"})]})}),i?a.jsx("div",{className:"flex justify-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):a.jsx("div",{className:"bg-white rounded-lg shadow-md overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[a.jsx("thead",{className:"bg-gradient-to-l from-blue-700 to-blue-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider",children:"Paciente"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider",children:"Contato"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider",children:"Dados Físicos"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider",children:"Convênio"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-white uppercase tracking-wider",children:"Ações"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:C.map(x=>{const $=P(x.altura,x.peso),M=$?A(parseFloat($)):null;return a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-gray-900",children:x.nome||"Nome não informado"}),a.jsxs("div",{className:"text-sm text-gray-500",children:["CPF: ",x.cpf||"Não informado"]}),a.jsxs("div",{className:"text-sm text-gray-500",children:["Nascimento: ",x.dataNascimento?st(new Date(x.dataNascimento),"dd/MM/yyyy"):"Não informado"]})]})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center text-sm text-gray-900",children:[a.jsx(Jf,{className:"w-4 h-4 mr-2 text-gray-400"}),x.telefone||"Não informado"]}),a.jsxs("div",{className:"flex items-center text-sm text-gray-900",children:[a.jsx(Fl,{className:"w-4 h-4 mr-2 text-gray-400"}),x.email||"Não informado"]}),a.jsxs("div",{className:"flex items-center text-sm text-gray-500",children:[a.jsx(Ug,{className:"w-4 h-4 mr-2 text-gray-400"}),x.endereco?.cidade||"Cidade não informada"]})]})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("div",{className:"space-y-1",children:[x.altura&&a.jsxs("div",{className:"text-sm text-gray-900",children:["Altura: ",x.altura," cm"]}),x.peso&&a.jsxs("div",{className:"text-sm text-gray-900",children:["Peso: ",x.peso," kg"]}),$&&M&&a.jsxs("div",{className:"text-sm",children:[a.jsx("span",{className:"text-gray-600",children:"IMC: "}),a.jsxs("span",{className:`font-medium ${M.color}`,children:[$," (",M.status,")"]})]}),!x.altura&&!x.peso&&a.jsx("div",{className:"text-sm text-gray-400",children:"Dados não informados"})]})}),a.jsxs("td",{className:"px-6 py-4 whitespace-nowrap",children:[a.jsx("div",{className:"text-sm text-gray-900",children:x.convenio||"Não informado"}),x.numeroCarteirinha&&a.jsxs("div",{className:"text-sm text-gray-500",children:["Carteirinha: ",x.numeroCarteirinha]})]}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("button",{onClick:()=>D(x),className:"text-blue-600 hover:text-blue-900",children:a.jsx(qg,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>B(x._id),className:"text-red-600 hover:text-red-900",children:a.jsx(Yg,{className:"w-4 h-4"})})]})})]},x._id)})})]})})}),m&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:a.jsx("div",{className:"bg-white rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:a.jsxs("div",{className:"p-6",children:[a.jsx("h3",{className:"text-lg font-semibold mb-6",children:g?"Editar Paciente":"Novo Paciente"}),a.jsxs("form",{onSubmit:z,className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Nome Completo"}),a.jsx("input",{type:"text",value:h.nome,onChange:x=>y({...h,nome:x.target.value}),className:"form-input",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CPF"}),a.jsx("input",{type:"text",value:h.cpf,onChange:x=>y({...h,cpf:x.target.value}),className:"form-input",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Telefone"}),a.jsx("input",{type:"tel",value:h.telefone,onChange:x=>y({...h,telefone:x.target.value}),className:"form-input",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),a.jsx("input",{type:"email",value:h.email,onChange:x=>y({...h,email:x.target.value}),className:"form-input",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Data de Nascimento"}),a.jsx("input",{type:"date",value:h.dataNascimento,onChange:x=>y({...h,dataNascimento:x.target.value}),className:"form-input",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Altura (cm)"}),a.jsx("input",{type:"number",min:"50",max:"250",step:"0.1",value:h.altura,onChange:x=>y({...h,altura:x.target.value}),className:"form-input",placeholder:"Ex: 170"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Peso (kg)"}),a.jsx("input",{type:"number",min:"10",max:"300",step:"0.1",value:h.peso,onChange:x=>y({...h,peso:x.target.value}),className:"form-input",placeholder:"Ex: 70.5"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CEP"}),a.jsx("input",{type:"text",value:h.endereco.cep,onChange:x=>y({...h,endereco:{...h.endereco,cep:x.target.value}}),className:"form-input"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Rua"}),a.jsx("input",{type:"text",value:h.endereco.rua,onChange:x=>y({...h,endereco:{...h.endereco,rua:x.target.value}}),className:"form-input"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Número"}),a.jsx("input",{type:"text",value:h.endereco.numero,onChange:x=>y({...h,endereco:{...h.endereco,numero:x.target.value}}),className:"form-input"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Bairro"}),a.jsx("input",{type:"text",value:h.endereco.bairro,onChange:x=>y({...h,endereco:{...h.endereco,bairro:x.target.value}}),className:"form-input"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Cidade"}),a.jsx("input",{type:"text",value:h.endereco.cidade,onChange:x=>y({...h,endereco:{...h.endereco,cidade:x.target.value}}),className:"form-input"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Convênio"}),a.jsxs("select",{value:h.convenio,onChange:x=>y({...h,convenio:x.target.value}),className:"form-input",children:[a.jsx("option",{value:"",children:"Selecione"}),a.jsx("option",{value:"Particular",children:"Particular"}),a.jsx("option",{value:"Unimed",children:"Unimed"}),a.jsx("option",{value:"SulAmérica",children:"SulAmérica"}),a.jsx("option",{value:"Bradesco Saúde",children:"Bradesco Saúde"}),a.jsx("option",{value:"Amil",children:"Amil"}),a.jsx("option",{value:"NotreDame",children:"NotreDame"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Número da Carteirinha"}),a.jsx("input",{type:"text",value:h.numeroCarteirinha,onChange:x=>y({...h,numeroCarteirinha:x.target.value}),className:"form-input"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Observações"}),a.jsx("textarea",{value:h.observacoes,onChange:x=>y({...h,observacoes:x.target.value}),className:"form-input",rows:3})]}),a.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[a.jsx("button",{type:"button",onClick:resetForm,className:"btn-secondary",children:"Cancelar"}),a.jsx("button",{type:"submit",disabled:i,className:"btn-primary disabled:opacity-50",children:i?"Salvando...":g?"Atualizar":"Cadastrar"})]})]})]})})})]})},W1=()=>{const[n,o]=_.useState([]),[i,u]=_.useState({}),[d,f]=_.useState([]),[m,v]=_.useState(""),[g,j]=_.useState("hoje"),[h,y]=_.useState(!0),[N,P]=_.useState(null);_.useEffect(()=>{A()},[]),_.useEffect(()=>{m&&z()},[m,g]);const A=async()=>{try{const M=await Be.entities.medicos.list({filter:{ativo:!0}});f(M.list||[]),M.list&&M.list.length>0&&v(M.list[0]._id)}catch(M){console.error("Erro ao carregar médicos:",M),ce.error("Erro ao carregar lista de médicos")}},z=async()=>{try{y(!0);let M={};const L=new Date,U=new Date(L);if(U.setDate(L.getDate()+1),g==="hoje")M={dataHora:{$regex:st(L,"yyyy-MM-dd")}};else if(g==="amanha")M={dataHora:{$regex:st(U,"yyyy-MM-dd")}};else if(g==="semana"){const le=new Date(L);le.setDate(L.getDate()-L.getDay());const ve=new Date(le);ve.setDate(le.getDate()+6),M={dataHora:{$gte:le.toISOString(),$lte:ve.toISOString()}}}const Y=(await Be.entities.consultas.list({filter:{medicoId:m,...M},sort:{dataHora:1}})).list||[];o(Y);const pe=[...new Set(Y.map(le=>le.pacienteId))],ne={};for(const le of pe)try{const ve=await Be.entities.pacientes.get(le);ve&&(ne[le]=ve)}catch(ve){console.error(`Erro ao carregar paciente ${le}:`,ve)}u(ne)}catch(M){console.error("Erro ao carregar consultas:",M),ce.error("Erro ao carregar consultas")}finally{y(!1)}},D=async(M,L)=>{try{await Be.entities.consultas.update(M,{status:L,atualizadoEm:new Date().toISOString()}),o(U=>U.map(I=>I._id===M?{...I,status:L}:I)),ce.success("Status da consulta atualizado")}catch(U){console.error("Erro ao atualizar status:",U),ce.error("Erro ao atualizar status da consulta")}},B=async(M,L)=>{try{await Be.entities.consultas.update(M,{observacoes:L,atualizadoEm:new Date().toISOString()}),o(U=>U.map(I=>I._id===M?{...I,observacoes:L}:I)),ce.success("Observação adicionada"),P(null)}catch(U){console.error("Erro ao adicionar observação:",U),ce.error("Erro ao adicionar observação")}},C=M=>({agendada:"bg-yellow-100 text-yellow-800",confirmada:"bg-gradient-to-l from-blue-700 to-blue-400 text-white",realizada:"bg-green-100 text-green-800",cancelada:"bg-red-100 text-red-800",faltou:"bg-gray-100 text-gray-800"})[M]||"bg-gray-100 text-gray-800",x=M=>{const L=Ef(M);return Pl(L)?`Hoje, ${st(L,"HH:mm")}`:Kx(L)?`Amanhã, ${st(L,"HH:mm")}`:st(L,"dd/MM/yyyy, HH:mm",{locale:Cr})},$=d.find(M=>M._id===m);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Painel do Médico"}),a.jsx("p",{className:"text-gray-600",children:"Gerencie suas consultas e agenda"})]}),a.jsxs("div",{className:"flex flex-col md:flex-row gap-4 mt-4 md:mt-0",children:[a.jsxs("select",{value:m,onChange:M=>v(M.target.value),className:"form-input",children:[a.jsx("option",{value:"",children:"Selecione um médico"}),d.map(M=>a.jsxs("option",{value:M._id,children:[M.nome," - ",M.especialidade]},M._id))]}),a.jsxs("select",{value:g,onChange:M=>j(M.target.value),className:"form-input",children:[a.jsx("option",{value:"hoje",children:"Hoje"}),a.jsx("option",{value:"amanha",children:"Amanhã"}),a.jsx("option",{value:"semana",children:"Esta Semana"}),a.jsx("option",{value:"todas",children:"Todas"})]})]})]}),$&&a.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[a.jsxs("h2",{className:"text-xl font-semibold mb-4",children:["Dr(a). ",$.nome," - ",$.especialidade]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx("div",{className:"bg-gradient-to-l from-blue-600 to-blue-400 rounded-lg p-4 text-white",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Er,{className:"w-6 h-6 mr-2"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm opacity-90",children:"Consultas Hoje"}),a.jsx("p",{className:"text-2xl font-bold",children:n.filter(M=>Pl(Ef(M.dataHora))).length})]})]})}),a.jsx("div",{className:"bg-green-50 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(es,{className:"w-6 h-6 text-green-600 mr-2"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Realizadas"}),a.jsx("p",{className:"text-2xl font-bold text-green-600",children:n.filter(M=>M.status==="realizada").length})]})]})}),a.jsx("div",{className:"bg-yellow-50 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Sn,{className:"w-6 h-6 text-yellow-600 mr-2"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-gray-600",children:"Pendentes"}),a.jsx("p",{className:"text-2xl font-bold text-yellow-600",children:n.filter(M=>M.status==="agendada"||M.status==="confirmada").length})]})]})})]})]}),h?a.jsx("div",{className:"flex justify-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):n.length>0?a.jsx("div",{className:"space-y-4",children:n.map(M=>{const L=i[M.pacienteId];return a.jsx("div",{className:"bg-white rounded-lg shadow-md p-6",children:a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center space-x-4 mb-3",children:[a.jsx("h3",{className:"text-lg font-semibold",children:L?.nome||"Paciente não encontrado"}),a.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${C(M.status)}`,children:M.status})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm text-gray-600",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Sn,{className:"w-4 h-4 mr-2"}),x(M.dataHora)]}),L?.telefone&&a.jsxs("div",{className:"flex items-center",children:[a.jsx(Jf,{className:"w-4 h-4 mr-2"}),L.telefone]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(_n,{className:"w-4 h-4 mr-2"}),M.tipoConsulta]}),L?.convenio&&a.jsxs("div",{className:"flex items-center",children:[a.jsx(us,{className:"w-4 h-4 mr-2"}),L.convenio]})]}),M.motivoConsulta&&a.jsx("div",{className:"mt-3",children:a.jsxs("p",{className:"text-sm text-gray-700",children:[a.jsx("strong",{children:"Motivo:"})," ",M.motivoConsulta]})}),M.observacoes&&a.jsx("div",{className:"mt-2",children:a.jsxs("p",{className:"text-sm text-gray-700",children:[a.jsx("strong",{children:"Observações:"})," ",M.observacoes]})})]}),a.jsxs("div",{className:"flex flex-col space-y-2 mt-4 md:mt-0 md:ml-4",children:[M.status==="agendada"&&a.jsx("button",{onClick:()=>D(M._id,"confirmada"),className:"btn-primary text-sm",children:"Confirmar"}),(M.status==="confirmada"||M.status==="agendada")&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>D(M._id,"realizada"),className:"bg-green-600 text-white px-3 py-1 rounded text-sm hover:bg-green-700",children:"Realizada"}),a.jsx("button",{onClick:()=>D(M._id,"faltou"),className:"bg-gray-600 text-white px-3 py-1 rounded text-sm hover:bg-gray-700",children:"Faltou"}),a.jsx("button",{onClick:()=>D(M._id,"cancelada"),className:"bg-red-600 text-white px-3 py-1 rounded text-sm hover:bg-red-700",children:"Cancelar"})]}),a.jsx("button",{onClick:()=>P(M),className:"btn-secondary text-sm",children:"Observações"})]})]})},M._id)})}):a.jsxs("div",{className:"bg-white rounded-lg shadow-md p-12 text-center",children:[a.jsx(Xf,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Nenhuma consulta encontrada"}),a.jsx("p",{className:"text-gray-600",children:"Não há consultas agendadas para o período selecionado."})]}),N&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-white rounded-lg p-6 max-w-md w-full mx-4",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Observações da Consulta"}),a.jsx("button",{onClick:()=>P(null),className:"text-gray-400 hover:text-gray-600",children:a.jsx(Wo,{className:"w-5 h-5"})})]}),a.jsxs("form",{onSubmit:M=>{M.preventDefault();const U=new FormData(M.currentTarget).get("observacao");B(N._id,U)},children:[a.jsx("textarea",{name:"observacao",defaultValue:N.observacoes,className:"form-input",rows:4,placeholder:"Digite suas observações sobre a consulta..."}),a.jsxs("div",{className:"flex justify-end space-x-3 mt-4",children:[a.jsx("button",{type:"button",onClick:()=>P(null),className:"btn-secondary",children:"Cancelar"}),a.jsx("button",{type:"submit",className:"btn-primary",children:"Salvar"})]})]})]})})]})};async function q1(){const n=await fetch("https://mock.apidog.com/m1/1053378-0-default/pacientes");if(!n.ok)throw new Error("Erro ao buscar pacientes");const o=await n.json();return Array.isArray(o.data)?o.data:[]}const V1=()=>{const[n,o]=_.useState(""),i=async b=>{if(window.confirm(`Deseja realmente apagar o paciente ${b.nome}?`)){N(!0);try{if(!(await fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${b._id}`,{method:"DELETE"})).ok)throw new Error("Erro ao apagar paciente");m(he=>he.filter(_e=>_e._id!==b._id)),ce.success("Paciente apagado com sucesso!")}catch(ee){console.error("Erro ao apagar paciente:",ee),ce.error("Erro ao apagar paciente. Tente novamente.")}finally{N(!1)}}},[u,d]=_.useState("dashboard"),[f,m]=_.useState([]),[v,g]=_.useState([]),[j,h]=_.useState([]),[y,N]=_.useState(!0),[P,A]=_.useState(""),[z,D]=_.useState(!1),[B,C]=_.useState(null),[x,$]=_.useState(!1),[M,L]=_.useState(!1),U=Dr(),[I,Y]=_.useState({nome:"",cpf:"",telefone:"",email:"",dataNascimento:"",altura:"",peso:"",endereco:{rua:"",numero:"",bairro:"",cidade:"",cep:""},convenio:"",numeroCarteirinha:"",observacoes:""}),pe=b=>({_id:b._id||b.id||b._ID||b.Id||b.idPaciente||Math.random().toString(36).slice(2,9),nome:b.nome||b.name||"",email:b.email||"",telefone:b.telefone||b.phone||"",dataNascimento:b.dataNascimento||b.data_nascimento||b.createdAt||"",altura:b.altura,peso:b.peso,endereco:b.endereco||{},cpf:b.cpf||"",convenio:b.convenio||"",numeroCarteirinha:b.numeroCarteirinha||b.numero_carteirinha||"",observacoes:b.observacoes||""}),[ne,le]=_.useState({nome:"",especialidade:"",crm:"",telefone:"",email:"",senha:""});_.useEffect(()=>{if(!localStorage.getItem("secretariaLogada")){U("/secretaria");return}ve()},[U]);const ve=async()=>{try{N(!0);const ee=(await q1()||[]).map(Fe=>pe(Fe));m(ee);const _e=await(await fetch("https://mock.apidog.com/m1/1053378-0-default/medicos")).json();g(_e.list||[]);try{const Fe=await fetch("https://mock.apidog.com/m1/1053378-0-default/consultas");if(Fe.ok){const yt=await Fe.json();h(yt.list||[])}}catch(Fe){console.warn("Não foi possível carregar consultas:",Fe)}}catch(b){console.error("Erro ao carregar dados:",b),ce.error("Erro ao carregar dados do sistema")}finally{N(!1)}},X=b=>{C(b),Y({nome:b.nome||"",cpf:b.cpf||"",telefone:b.telefone||"",email:b.email||"",dataNascimento:b.dataNascimento||"",altura:b.altura?String(b.altura):"",peso:b.peso?String(b.peso):"",endereco:{rua:b.endereco?.rua||"",numero:b.endereco?.numero||"",bairro:b.endereco?.bairro||"",cidade:b.endereco?.cidade||"",cep:b.endereco?.cep||""},convenio:b.convenio||"",numeroCarteirinha:b.numeroCarteirinha||"",observacoes:b.observacoes||""}),$(!0),D(!1),d("pacientes")},ae=async b=>{if(b.preventDefault(),!ne.nome||!ne.email||!ne.crm){ce.error("Preencha os campos obrigatórios do médico");return}try{N(!0);const ee=await fetch("https://mock.apidog.com/m1/1053378-0-default/medicos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ne)});if(!ee.ok)throw new Error("Erro ao cadastrar médico");const he=await ee.json();g(_e=>[..._e,he]),G(),ce.success("Médico cadastrado com sucesso!")}catch(ee){console.error(ee),ce.error("Erro ao cadastrar médico")}finally{N(!1)}},fe=()=>{localStorage.removeItem("secretariaLogada"),ce.success("Logout realizado com sucesso!"),U("/secretaria")},ue=()=>{Y({nome:"",cpf:"",telefone:"",email:"",dataNascimento:"",altura:"",peso:"",endereco:{rua:"",numero:"",bairro:"",cidade:"",cep:""},convenio:"",numeroCarteirinha:"",observacoes:""}),C(null),D(!0),$(!1),d("pacientes")},Q=()=>{L(!0),d("medicos")},oe=()=>{Y({nome:"",cpf:"",telefone:"",email:"",dataNascimento:"",altura:"",peso:"",endereco:{rua:"",numero:"",bairro:"",cidade:"",cep:""},convenio:"",numeroCarteirinha:"",observacoes:""}),D(!1)},G=()=>{le({nome:"",especialidade:"",crm:"",telefone:"",email:"",senha:""}),L(!1)},E=async b=>{if(b.preventDefault(),!I.nome||!I.cpf||!I.email){ce.error("Preencha todos os campos obrigatórios");return}try{N(!0);const ee={nome:I.nome,cpf:I.cpf,data_nascimento:I.dataNascimento,telefone:I.telefone,email:I.email},he=await fetch("https://mock.apidog.com/m1/1053378-0-default/pacientes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ee)});if(!he.ok)throw new Error("Erro ao cadastrar paciente na API");const _e=await he.json();m(Fe=>[...Fe,pe(_e)]),oe(),ce.success("Paciente cadastrado com sucesso!")}catch(ee){console.error("Erro ao cadastrar paciente:",ee),ce.error("Erro ao cadastrar paciente. Tente novamente.")}finally{N(!1)}},F=b=>new Date(b).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}),me=b=>{switch(b){case"agendada":return"bg-blue-100 text-blue-800";case"confirmada":return"bg-green-100 text-green-800";case"cancelada":return"bg-red-100 text-red-800";case"realizada":return"bg-gray-100 text-gray-800";default:return"bg-gray-100 text-gray-800"}},ge=f.filter(b=>(b.nome||"").toLowerCase().includes(P.toLowerCase())||(b.email||"").toLowerCase().includes(P.toLowerCase())),xe=v.filter(b=>(b.nome||"").toLowerCase().includes(P.toLowerCase())||(b.especialidade||"").toLowerCase().includes(P.toLowerCase())),we=j.filter(b=>(b.pacienteNome||"").toLowerCase().includes(P.toLowerCase())||(b.medicoNome||"").toLowerCase().includes(P.toLowerCase())||(b.tipo||"").toLowerCase().includes(P.toLowerCase()));return y&&!z&&!M&&!x?a.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-green-600 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-600",children:"Carregando painel da secretária..."})]})}):a.jsxs("div",{className:"min-h-screen bg-gray-50",children:[a.jsx("div",{className:"bg-white shadow-sm border-b",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex justify-between items-center py-4",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Painel da Secretária"}),a.jsx("p",{className:"text-gray-600",children:"Sistema de Gestão Médica"})]}),a.jsxs("div",{className:"flex space-x-3",children:[a.jsxs("button",{onClick:ue,className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition-colors flex items-center",children:[a.jsx(af,{className:"w-5 h-5 mr-2"}),"Novo Paciente"]}),a.jsxs("button",{onClick:Q,className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors flex items-center",children:[a.jsx(ts,{className:"w-5 h-5 mr-2"}),"Novo Médico"]}),a.jsx("button",{onClick:fe,className:"bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700 transition-colors",children:"Sair"})]})]})})}),a.jsx("div",{className:"bg-white border-b",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsx("nav",{className:"flex space-x-8",children:[{id:"dashboard",label:"Dashboard",icon:bl},{id:"pacientes",label:"Pacientes",icon:Yr},{id:"medicos",label:"Médicos",icon:Yr},{id:"consultas",label:"Consultas",icon:Er},{id:"relatorios",label:"Relatórios",icon:us}].map(b=>{const ee=b.icon;return a.jsxs("button",{onClick:()=>d(b.id),className:`flex items-center px-3 py-4 border-b-2 font-medium text-sm ${u===b.id?"border-green-500 text-green-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[a.jsx(ee,{className:"w-5 h-5 mr-2"}),b.label]},b.id)})})})}),a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[u==="dashboard"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[a.jsx("div",{className:"bg-white p-6 rounded-lg shadow",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Yr,{className:"w-8 h-8 text-blue-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Pacientes"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:f.length})]})]})}),a.jsx("div",{className:"bg-white p-6 rounded-lg shadow",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Yr,{className:"w-8 h-8 text-green-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Médicos"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:v.length})]})]})}),a.jsx("div",{className:"bg-white p-6 rounded-lg shadow",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Er,{className:"w-8 h-8 text-purple-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Consultas Hoje"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:j.filter(b=>{const ee=new Date().toDateString();return new Date(b.dataHora).toDateString()===ee}).length})]})]})}),a.jsx("div",{className:"bg-white p-6 rounded-lg shadow",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(bl,{className:"w-8 h-8 text-orange-600"}),a.jsxs("div",{className:"ml-4",children:[a.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Consultas Pendentes"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:j.filter(b=>b.status==="agendada").length})]})]})})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow",children:[a.jsx("div",{className:"px-6 py-4 border-b",children:a.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Próximas Consultas"})}),a.jsx("div",{className:"p-6",children:a.jsx("div",{className:"space-y-4",children:j.filter(b=>new Date(b.dataHora)>=new Date).sort((b,ee)=>new Date(b.dataHora).getTime()-new Date(ee.dataHora).getTime()).slice(0,5).map(b=>a.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 rounded-lg",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-900",children:b.pacienteNome}),a.jsxs("p",{className:"text-sm text-gray-600",children:["Dr(a). ",b.medicoNome]}),a.jsx("p",{className:"text-sm text-gray-500",children:F(b.dataHora)})]}),a.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium ${me(b.status)}`,children:b.status})]},b._id))})})]})]}),u==="pacientes"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-xl font-bold text-gray-900",children:"Gerenciar Pacientes"}),a.jsxs("button",{onClick:ue,className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition-colors flex items-center",children:[a.jsx(af,{className:"w-5 h-5 mr-2"}),"Novo Paciente"]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow",children:[a.jsx("div",{className:"p-6 border-b",children:a.jsx("div",{className:"flex items-center space-x-4",children:a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Bo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),a.jsx("input",{type:"text",placeholder:"Buscar pacientes...",value:P,onChange:b=>A(b.target.value),className:"pl-10 pr-4 py-2 w-full border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]})})}),a.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[a.jsx("input",{type:"text",placeholder:"Buscar paciente por ID...",value:n,onChange:b=>o(b.target.value),className:"border px-3 py-2 rounded-lg w-64"}),a.jsx("button",{className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors",onClick:async()=>{if(!n)return ce.error("Informe o ID do paciente");N(!0);try{const b=await fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${n}`);if(!b.ok)throw new Error("Paciente não encontrado");const ee=await b.json();m(ee?[pe(ee)]:[])}catch{ce.error("Paciente não encontrado ou erro na busca.")}finally{N(!1)}},children:"Buscar por ID"}),a.jsx("button",{className:"bg-gray-300 text-gray-800 px-4 py-2 rounded-lg hover:bg-gray-400 transition-colors",onClick:()=>{o(""),ve()},children:"Limpar"})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Paciente"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Contato"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Data Nascimento"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Altura/Peso"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:ge.map(b=>a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:()=>X(b),className:"bg-green-600 text-white px-3 py-1 rounded-md hover:bg-green-700 transition-colors flex items-center text-sm min-w-[70px] justify-center",children:"Editar"}),a.jsx("button",{onClick:()=>i(b),className:"bg-red-600 text-white px-3 py-1 rounded-md hover:bg-red-700 transition-colors flex items-center text-sm min-w-[70px] justify-center",children:"Apagar"})]})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-gray-900",children:b.nome||"Nome não informado"}),a.jsx("div",{className:"text-sm text-gray-500",children:b.endereco?.cidade||"Cidade não informada"})]})}),a.jsxs("td",{className:"px-6 py-4 whitespace-nowrap",children:[a.jsx("div",{className:"text-sm text-gray-900",children:b.email||"Email não informado"}),a.jsx("div",{className:"text-sm text-gray-500",children:b.telefone||"Telefone não informado"})]}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:b.dataNascimento?new Date(b.dataNascimento).toLocaleDateString("pt-BR"):"Não informado"}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:b.altura&&b.peso?`${b.altura}m / ${b.peso}kg`:"Não informado"})]},b._id))})]})})]})]}),u==="medicos"&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-xl font-bold text-gray-900",children:"Gerenciar Médicos"}),a.jsxs("button",{onClick:Q,className:"bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 transition-colors flex items-center",children:[a.jsx(ts,{className:"w-5 h-5 mr-2"}),"Novo Médico"]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow",children:[a.jsx("div",{className:"p-6 border-b",children:a.jsxs("div",{className:"relative",children:[a.jsx(Bo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),a.jsx("input",{type:"text",placeholder:"Buscar médicos...",value:P,onChange:b=>A(b.target.value),className:"pl-10 pr-4 py-2 w-full border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]})}),a.jsx("div",{className:"overflow-x-auto mb-8",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Médico"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Especialidade"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"CRM"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Contato"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:xe.map(b=>a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("div",{className:"text-sm font-medium text-gray-900",children:["Dr(a). ",b.nome||"Nome não informado"]})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("div",{className:"text-sm text-gray-900",children:b.especialidade||"Não informado"})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("div",{className:"text-sm text-gray-900",children:b.crm||"Não informado"})}),a.jsxs("td",{className:"px-6 py-4 whitespace-nowrap",children:[a.jsx("div",{className:"text-sm text-gray-900",children:b.email||"Email não informado"}),a.jsx("div",{className:"text-sm text-gray-500",children:b.telefone||"Telefone não informado"})]})]},b._id))})]})}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 p-6",children:xe.map(b=>a.jsxs("div",{className:"bg-gray-50 rounded-lg shadow p-4 flex flex-col gap-2",children:[a.jsxs("div",{className:"font-bold text-lg text-blue-700",children:["Dr(a). ",b.nome]}),a.jsxs("div",{className:"text-sm text-gray-700",children:[a.jsx("strong",{children:"Especialidade:"})," ",b.especialidade]}),a.jsxs("div",{className:"text-sm text-gray-700",children:[a.jsx("strong",{children:"CRM:"})," ",b.crm]}),a.jsxs("div",{className:"text-sm text-gray-700",children:[a.jsx("strong",{children:"Email:"})," ",b.email]}),a.jsxs("div",{className:"text-sm text-gray-700",children:[a.jsx("strong",{children:"Telefone:"})," ",b.telefone]})]},b._id))})]})]}),u==="consultas"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"flex justify-between items-center",children:a.jsx("h2",{className:"text-xl font-bold text-gray-900",children:"Gerenciar Consultas"})}),a.jsxs("div",{className:"bg-white rounded-lg shadow",children:[a.jsx("div",{className:"p-6 border-b",children:a.jsxs("div",{className:"relative",children:[a.jsx(Bo,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-gray-400"}),a.jsx("input",{type:"text",placeholder:"Buscar consultas...",value:P,onChange:b=>A(b.target.value),className:"pl-10 pr-4 py-2 w-full border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Paciente"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Médico"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Data/Hora"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Tipo"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:we.map(b=>a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("div",{className:"text-sm font-medium text-gray-900",children:b.pacienteNome})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("div",{className:"text-sm text-gray-900",children:["Dr(a). ",b.medicoNome]})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("div",{className:"text-sm text-gray-900",children:F(b.dataHora)})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("div",{className:"text-sm text-gray-900",children:b.tipo||"Não informado"})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium ${me(b.status)}`,children:b.status})})]},b._id))})]})})]})]}),u==="relatorios"&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-xl font-bold text-gray-900",children:"Relatórios"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white p-6 rounded-lg shadow",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Consultas por Status"}),a.jsx("div",{className:"space-y-3",children:["agendada","confirmada","realizada","cancelada"].map(b=>{const ee=j.filter(_e=>_e.status===b).length,he=j.length>0?ee/j.length*100:0;return a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm font-medium text-gray-600 capitalize",children:b}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-20 bg-gray-200 rounded-full h-2",children:a.jsx("div",{className:"bg-green-600 h-2 rounded-full",style:{width:`${he}%`}})}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:ee})]})]},b)})})]}),a.jsxs("div",{className:"bg-white p-6 rounded-lg shadow",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Médicos por Especialidade"}),a.jsx("div",{className:"space-y-3",children:[...new Set(v.map(b=>b.especialidade).filter(Boolean))].map(b=>{const ee=v.filter(he=>he.especialidade===b).length;return a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm font-medium text-gray-600",children:b}),a.jsx("span",{className:"text-sm font-medium text-gray-900",children:ee})]},b)})})]})]})]})]}),z&&!x&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:a.jsx("div",{className:"bg-white rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Cadastrar Novo Paciente"}),a.jsx("button",{onClick:oe,className:"text-gray-400 hover:text-gray-600",children:a.jsx(Wo,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:E,className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Nome Completo *"}),a.jsx("input",{type:"text",value:I.nome,onChange:b=>Y({...I,nome:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CPF *"}),a.jsx("input",{type:"text",value:I.cpf,onChange:b=>Y({...I,cpf:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Telefone *"}),a.jsx("input",{type:"tel",value:I.telefone,onChange:b=>Y({...I,telefone:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email *"}),a.jsx("input",{type:"email",value:I.email,onChange:b=>Y({...I,email:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Data de Nascimento *"}),a.jsx("input",{type:"date",value:I.dataNascimento,onChange:b=>Y({...I,dataNascimento:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Altura (cm)"}),a.jsx("input",{type:"number",min:"50",max:"250",step:"0.1",value:I.altura,onChange:b=>Y({...I,altura:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",placeholder:"Ex: 170"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Peso (kg)"}),a.jsx("input",{type:"number",min:"10",max:"300",step:"0.1",value:I.peso,onChange:b=>Y({...I,peso:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",placeholder:"Ex: 70.5"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CEP"}),a.jsx("input",{type:"text",value:I.endereco.cep,onChange:b=>Y({...I,endereco:{...I.endereco,cep:b.target.value}}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Cidade"}),a.jsx("input",{type:"text",value:I.endereco.cidade,onChange:b=>Y({...I,endereco:{...I.endereco,cidade:b.target.value}}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Convênio"}),a.jsxs("select",{value:I.convenio,onChange:b=>Y({...I,convenio:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",children:[a.jsx("option",{value:"",children:"Selecione"}),a.jsx("option",{value:"Particular",children:"Particular"}),a.jsx("option",{value:"Unimed",children:"Unimed"}),a.jsx("option",{value:"SulAmérica",children:"SulAmérica"}),a.jsx("option",{value:"Bradesco Saúde",children:"Bradesco Saúde"}),a.jsx("option",{value:"Amil",children:"Amil"}),a.jsx("option",{value:"NotreDame",children:"NotreDame"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Observações"}),a.jsx("textarea",{value:I.observacoes,onChange:b=>Y({...I,observacoes:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",rows:3})]}),a.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[a.jsx("button",{type:"button",onClick:oe,className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",children:"Cancelar"}),a.jsx("button",{type:"submit",disabled:y,className:"px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 transition-colors disabled:opacity-50",children:y?"Cadastrando...":"Cadastrar Paciente"})]})]})]})})}),x&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:a.jsx("div",{className:"bg-white rounded-lg max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Editar Paciente"}),a.jsx("button",{onClick:()=>{$(!1),C(null)},className:"text-gray-400 hover:text-gray-600",children:a.jsx(Wo,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:async b=>{b.preventDefault(),N(!0);try{const ee=B?._id;if(!ee){ce.error("Paciente inválido para edição"),N(!1);return}const he={...B,...I,altura:I.altura?Number(I.altura):B?.altura,peso:I.peso?Number(I.peso):B?.peso,endereco:{...B?.endereco||{},...I.endereco||{}}};let _e=he;try{const Fe=await fetch(`https://mock.apidog.com/m1/1053378-0-default/pacientes/${ee}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(he)});if(Fe.ok)try{const yt=await Fe.json();yt&&typeof yt=="object"&&(_e=yt)}catch{}else console.warn("API não retornou OK ao editar paciente, aplicando atualização localmente")}catch(Fe){console.warn("Falha ao chamar API de edição, aplicando atualização localmente",Fe)}m(Fe=>Fe.map(yt=>yt._id===ee?_e:yt)),ce.success("Paciente atualizado com sucesso!"),$(!1),C(null)}catch(ee){console.error("Erro ao editar paciente:",ee),ce.error("Erro ao editar paciente. Tente novamente.")}finally{N(!1)}},className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Nome Completo *"}),a.jsx("input",{type:"text",value:I.nome,onChange:b=>Y({...I,nome:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CPF *"}),a.jsx("input",{type:"text",value:I.cpf,onChange:b=>Y({...I,cpf:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Telefone *"}),a.jsx("input",{type:"tel",value:I.telefone,onChange:b=>Y({...I,telefone:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email *"}),a.jsx("input",{type:"email",value:I.email,onChange:b=>Y({...I,email:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Data de Nascimento *"}),a.jsx("input",{type:"date",value:I.dataNascimento,onChange:b=>Y({...I,dataNascimento:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Altura (cm)"}),a.jsx("input",{type:"number",min:"50",max:"250",step:"0.1",value:I.altura,onChange:b=>Y({...I,altura:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",placeholder:"Ex: 170"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Peso (kg)"}),a.jsx("input",{type:"number",min:"10",max:"300",step:"0.1",value:I.peso,onChange:b=>Y({...I,peso:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",placeholder:"Ex: 70.5"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CEP"}),a.jsx("input",{type:"text",value:I.endereco.cep,onChange:b=>Y({...I,endereco:{...I.endereco,cep:b.target.value}}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Cidade"}),a.jsx("input",{type:"text",value:I.endereco.cidade,onChange:b=>Y({...I,endereco:{...I.endereco,cidade:b.target.value}}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Convênio"}),a.jsxs("select",{value:I.convenio,onChange:b=>Y({...I,convenio:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",children:[a.jsx("option",{value:"",children:"Selecione"}),a.jsx("option",{value:"Particular",children:"Particular"}),a.jsx("option",{value:"Unimed",children:"Unimed"}),a.jsx("option",{value:"SulAmérica",children:"SulAmérica"}),a.jsx("option",{value:"Bradesco Saúde",children:"Bradesco Saúde"}),a.jsx("option",{value:"Amil",children:"Amil"}),a.jsx("option",{value:"NotreDame",children:"NotreDame"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Observações"}),a.jsx("textarea",{value:I.observacoes,onChange:b=>Y({...I,observacoes:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent",rows:3})]}),a.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[a.jsx("button",{type:"button",onClick:()=>{$(!1),C(null)},className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",children:"Cancelar"}),a.jsx("button",{type:"submit",disabled:y,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50",children:y?"Salvando...":"Salvar Alterações"})]})]})]})})}),M&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:a.jsx("div",{className:"bg-white rounded-lg max-w-md w-full max-h-[90vh] overflow-y-auto",children:a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Cadastrar Novo Médico"}),a.jsx("button",{onClick:G,className:"text-gray-400 hover:text-gray-600",children:a.jsx(Wo,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:ae,className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Nome Completo *"}),a.jsx("input",{type:"text",value:ne.nome,onChange:b=>le({...ne,nome:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Especialidade *"}),a.jsxs("select",{value:ne.especialidade,onChange:b=>le({...ne,especialidade:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:!0,children:[a.jsx("option",{value:"",children:"Selecione"}),a.jsx("option",{value:"Cardiologia",children:"Cardiologia"}),a.jsx("option",{value:"Dermatologia",children:"Dermatologia"}),a.jsx("option",{value:"Endocrinologia",children:"Endocrinologia"}),a.jsx("option",{value:"Gastroenterologia",children:"Gastroenterologia"}),a.jsx("option",{value:"Ginecologia",children:"Ginecologia"}),a.jsx("option",{value:"Neurologia",children:"Neurologia"}),a.jsx("option",{value:"Oftalmologia",children:"Oftalmologia"}),a.jsx("option",{value:"Ortopedia",children:"Ortopedia"}),a.jsx("option",{value:"Pediatria",children:"Pediatria"}),a.jsx("option",{value:"Psiquiatria",children:"Psiquiatria"}),a.jsx("option",{value:"Urologia",children:"Urologia"}),a.jsx("option",{value:"Clínico Geral",children:"Clínico Geral"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CRM *"}),a.jsx("input",{type:"text",value:ne.crm,onChange:b=>le({...ne,crm:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Ex: CRM/SP 123456",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Telefone *"}),a.jsx("input",{type:"tel",value:ne.telefone,onChange:b=>le({...ne,telefone:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email *"}),a.jsx("input",{type:"email",value:ne.email,onChange:b=>le({...ne,email:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Senha *"}),a.jsx("input",{type:"password",value:ne.senha,onChange:b=>le({...ne,senha:b.target.value}),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:!0,minLength:6})]}),a.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[a.jsx("button",{type:"button",onClick:G,className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",children:"Cancelar"}),a.jsx("button",{type:"submit",disabled:y,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-50",children:y?"Cadastrando...":"Cadastrar Médico"})]})]})]})})})]})};function Q1(){return a.jsx(C0,{children:a.jsxs("div",{className:"min-h-screen bg-gray-50",children:[a.jsx(ev,{}),a.jsx("main",{className:"container mx-auto px-4 py-8",children:a.jsxs(x0,{children:[a.jsx(Lt,{path:"/",element:a.jsx(Fy,{})}),a.jsx(Lt,{path:"/paciente",element:a.jsx(Hy,{})}),a.jsx(Lt,{path:"/login-secretaria",element:a.jsx(By,{})}),a.jsx(Lt,{path:"/login-medico",element:a.jsx(Wy,{})}),a.jsx(Lt,{path:"/agendamento",element:a.jsx(F1,{})}),a.jsx(Lt,{path:"/acompanhamento",element:a.jsx(H1,{})}),a.jsx(Lt,{path:"/cadastro",element:a.jsx(B1,{})}),a.jsx(Lt,{path:"/painel-medico",element:a.jsx(W1,{})}),a.jsx(Lt,{path:"/painel-secretaria",element:a.jsx(V1,{})}),a.jsx(Lt,{path:"*",element:a.jsx(v0,{to:"/",replace:!0})})]})}),a.jsx(vg,{position:"top-right"})]})})}function pm(n){var o,i,u="";if(typeof n=="string"||typeof n=="number")u+=n;else if(typeof n=="object")if(Array.isArray(n)){var d=n.length;for(o=0;o"u")return;let o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}Y1(`: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 Ca=n=>typeof n=="number"&&!isNaN(n),Gr=n=>typeof n=="string",nr=n=>typeof n=="function",X1=n=>Gr(n)||Ca(n),Dl=n=>Gr(n)||nr(n)?n:null,K1=(n,o)=>n===!1||Ca(n)&&n>0?n:o,Ml=n=>_.isValidElement(n)||Gr(n)||nr(n)||Ca(n);function G1(n,o,i=300){let{scrollHeight:u,style:d}=n;requestAnimationFrame(()=>{d.minHeight="initial",d.height=u+"px",d.transition=`all ${i}ms`,requestAnimationFrame(()=>{d.height="0",d.padding="0",d.margin="0",setTimeout(o,i)})})}function J1({enter:n,exit:o,appendPosition:i=!1,collapse:u=!0,collapseDuration:d=300}){return function({children:f,position:m,preventExitTransition:v,done:g,nodeRef:j,isIn:h,playToast:y}){let N=i?`${n}--${m}`:n,P=i?`${o}--${m}`:o,A=_.useRef(0);return _.useLayoutEffect(()=>{let z=j.current,D=N.split(" "),B=C=>{C.target===j.current&&(y(),z.removeEventListener("animationend",B),z.removeEventListener("animationcancel",B),A.current===0&&C.type!=="animationcancel"&&z.classList.remove(...D))};z.classList.add(...D),z.addEventListener("animationend",B),z.addEventListener("animationcancel",B)},[]),_.useEffect(()=>{let z=j.current,D=()=>{z.removeEventListener("animationend",D),u?G1(z,g,d):g()};h||(v?D():(A.current=1,z.className+=` ${P}`,z.addEventListener("animationend",D)))},[h]),Ce.createElement(Ce.Fragment,null,f)}}function Tf(n,o){return{content:hm(n.content,n.props),containerId:n.props.containerId,id:n.props.toastId,theme:n.props.theme,type:n.props.type,data:n.props.data||{},isLoading:n.props.isLoading,icon:n.props.icon,reason:n.removalReason,status:o}}function hm(n,o,i=!1){return _.isValidElement(n)&&!Gr(n.type)?_.cloneElement(n,{closeToast:o.closeToast,toastProps:o,data:o.data,isPaused:i}):nr(n)?n({closeToast:o.closeToast,toastProps:o,data:o.data,isPaused:i}):n}function Z1({closeToast:n,theme:o,ariaLabel:i="close"}){return Ce.createElement("button",{className:`Toastify__close-button Toastify__close-button--${o}`,type:"button",onClick:u=>{u.stopPropagation(),n(!0)},"aria-label":i},Ce.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Ce.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 ew({delay:n,isRunning:o,closeToast:i,type:u="default",hide:d,className:f,controlledProgress:m,progress:v,rtl:g,isIn:j,theme:h}){let y=d||m&&v===0,N={animationDuration:`${n}ms`,animationPlayState:o?"running":"paused"};m&&(N.transform=`scaleX(${v})`);let P=Xr("Toastify__progress-bar",m?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${h}`,`Toastify__progress-bar--${u}`,{"Toastify__progress-bar--rtl":g}),A=nr(f)?f({rtl:g,type:u,defaultClassName:P}):Xr(P,f),z={[m&&v>=1?"onTransitionEnd":"onAnimationEnd"]:m&&v<1?null:()=>{j&&i()}};return Ce.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":y},Ce.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${h} Toastify__progress-bar--${u}`}),Ce.createElement("div",{role:"progressbar","aria-hidden":y?"true":"false","aria-label":"notification timer",className:A,style:N,...z}))}var tw=1,gm=()=>`${tw++}`;function rw(n,o,i){let u=1,d=0,f=[],m=[],v=o,g=new Map,j=new Set,h=C=>(j.add(C),()=>j.delete(C)),y=()=>{m=Array.from(g.values()),j.forEach(C=>C())},N=({containerId:C,toastId:x,updateId:$})=>{let M=C?C!==n:n!==1,L=g.has(x)&&$==null;return M||L},P=(C,x)=>{g.forEach($=>{var M;(x==null||x===$.props.toastId)&&((M=$.toggle)==null||M.call($,C))})},A=C=>{var x,$;($=(x=C.props)==null?void 0:x.onClose)==null||$.call(x,C.removalReason),C.isActive=!1},z=C=>{if(C==null)g.forEach(A);else{let x=g.get(C);x&&A(x)}y()},D=()=>{d-=f.length,f=[]},B=C=>{var x,$;let{toastId:M,updateId:L}=C.props,U=L==null;C.staleId&&g.delete(C.staleId),C.isActive=!0,g.set(M,C),y(),i(Tf(C,U?"added":"updated")),U&&(($=(x=C.props).onOpen)==null||$.call(x))};return{id:n,props:v,observe:h,toggle:P,removeToast:z,toasts:g,clearQueue:D,buildToast:(C,x)=>{if(N(x))return;let{toastId:$,updateId:M,data:L,staleId:U,delay:I}=x,Y=M==null;Y&&d++;let pe={...v,style:v.toastStyle,key:u++,...Object.fromEntries(Object.entries(x).filter(([le,ve])=>ve!=null)),toastId:$,updateId:M,data:L,isIn:!1,className:Dl(x.className||v.toastClassName),progressClassName:Dl(x.progressClassName||v.progressClassName),autoClose:x.isLoading?!1:K1(x.autoClose,v.autoClose),closeToast(le){g.get($).removalReason=le,z($)},deleteToast(){let le=g.get($);if(le!=null){if(i(Tf(le,"removed")),g.delete($),d--,d<0&&(d=0),f.length>0){B(f.shift());return}y()}}};pe.closeButton=v.closeButton,x.closeButton===!1||Ml(x.closeButton)?pe.closeButton=x.closeButton:x.closeButton===!0&&(pe.closeButton=Ml(v.closeButton)?v.closeButton:!0);let ne={content:C,props:pe,staleId:U};v.limit&&v.limit>0&&d>v.limit&&Y?f.push(ne):Ca(I)?setTimeout(()=>{B(ne)},I):B(ne)},setProps(C){v=C},setToggle:(C,x)=>{let $=g.get(C);$&&($.toggle=x)},isToastActive:C=>{var x;return(x=g.get(C))==null?void 0:x.isActive},getSnapshot:()=>m}}var it=new Map,Na=[],Ol=new Set,nw=n=>Ol.forEach(o=>o(n)),vm=()=>it.size>0;function aw(){Na.forEach(n=>xm(n.content,n.options)),Na=[]}var ow=(n,{containerId:o})=>{var i;return(i=it.get(o||1))==null?void 0:i.toasts.get(n)};function ym(n,o){var i;if(o)return!!((i=it.get(o))!=null&&i.isToastActive(n));let u=!1;return it.forEach(d=>{d.isToastActive(n)&&(u=!0)}),u}function sw(n){if(!vm()){Na=Na.filter(o=>n!=null&&o.options.toastId!==n);return}if(n==null||X1(n))it.forEach(o=>{o.removeToast(n)});else if(n&&("containerId"in n||"id"in n)){let o=it.get(n.containerId);o?o.removeToast(n.id):it.forEach(i=>{i.removeToast(n.id)})}}var iw=(n={})=>{it.forEach(o=>{o.props.limit&&(!n.containerId||o.id===n.containerId)&&o.clearQueue()})};function xm(n,o){Ml(n)&&(vm()||Na.push({content:n,options:o}),it.forEach(i=>{i.buildToast(n,o)}))}function lw(n){var o;(o=it.get(n.containerId||1))==null||o.setToggle(n.id,n.fn)}function wm(n,o){it.forEach(i=>{(o==null||!(o!=null&&o.containerId)||o?.containerId===i.id)&&i.toggle(n,o?.id)})}function uw(n){let o=n.containerId||1;return{subscribe(i){let u=rw(o,n,nw);it.set(o,u);let d=u.observe(i);return aw(),()=>{d(),it.delete(o)}},setProps(i){var u;(u=it.get(o))==null||u.setProps(i)},getSnapshot(){var i;return(i=it.get(o))==null?void 0:i.getSnapshot()}}}function cw(n){return Ol.add(n),()=>{Ol.delete(n)}}function dw(n){return n&&(Gr(n.toastId)||Ca(n.toastId))?n.toastId:gm()}function _a(n,o){return xm(n,o),o.toastId}function ds(n,o){return{...o,type:o&&o.type||n,toastId:dw(o)}}function fs(n){return(o,i)=>_a(o,ds(n,i))}function Se(n,o){return _a(n,ds("default",o))}Se.loading=(n,o)=>_a(n,ds("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...o}));function fw(n,{pending:o,error:i,success:u},d){let f;o&&(f=Gr(o)?Se.loading(o,d):Se.loading(o.render,{...d,...o}));let m={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},v=(j,h,y)=>{if(h==null){Se.dismiss(f);return}let N={type:j,...m,...d,data:y},P=Gr(h)?{render:h}:h;return f?Se.update(f,{...N,...P}):Se(P.render,{...N,...P}),y},g=nr(n)?n():n;return g.then(j=>v("success",u,j)).catch(j=>v("error",i,j)),g}Se.promise=fw;Se.success=fs("success");Se.info=fs("info");Se.error=fs("error");Se.warning=fs("warning");Se.warn=Se.warning;Se.dark=(n,o)=>_a(n,ds("default",{theme:"dark",...o}));function mw(n){sw(n)}Se.dismiss=mw;Se.clearWaitingQueue=iw;Se.isActive=ym;Se.update=(n,o={})=>{let i=ow(n,o);if(i){let{props:u,content:d}=i,f={delay:100,...u,...o,toastId:o.toastId||n,updateId:gm()};f.toastId!==n&&(f.staleId=n);let m=f.render||d;delete f.render,_a(m,f)}};Se.done=n=>{Se.update(n,{progress:1})};Se.onChange=cw;Se.play=n=>wm(!0,n);Se.pause=n=>wm(!1,n);function pw(n){var o;let{subscribe:i,getSnapshot:u,setProps:d}=_.useRef(uw(n)).current;d(n);let f=(o=_.useSyncExternalStore(i,u,u))==null?void 0:o.slice();function m(v){if(!f)return[];let g=new Map;return n.newestOnTop&&f.reverse(),f.forEach(j=>{let{position:h}=j.props;g.has(h)||g.set(h,[]),g.get(h).push(j)}),Array.from(g,j=>v(j[0],j[1]))}return{getToastToRender:m,isToastActive:ym,count:f?.length}}function hw(n){let[o,i]=_.useState(!1),[u,d]=_.useState(!1),f=_.useRef(null),m=_.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:v,pauseOnHover:g,closeToast:j,onClick:h,closeOnClick:y}=n;lw({id:n.toastId,containerId:n.containerId,fn:i}),_.useEffect(()=>{if(n.pauseOnFocusLoss)return N(),()=>{P()}},[n.pauseOnFocusLoss]);function N(){document.hasFocus()||B(),window.addEventListener("focus",D),window.addEventListener("blur",B)}function P(){window.removeEventListener("focus",D),window.removeEventListener("blur",B)}function A(U){if(n.draggable===!0||n.draggable===U.pointerType){C();let I=f.current;m.canCloseOnClick=!0,m.canDrag=!0,I.style.transition="none",n.draggableDirection==="x"?(m.start=U.clientX,m.removalDistance=I.offsetWidth*(n.draggablePercent/100)):(m.start=U.clientY,m.removalDistance=I.offsetHeight*(n.draggablePercent===80?n.draggablePercent*1.5:n.draggablePercent)/100)}}function z(U){let{top:I,bottom:Y,left:pe,right:ne}=f.current.getBoundingClientRect();U.nativeEvent.type!=="touchend"&&n.pauseOnHover&&U.clientX>=pe&&U.clientX<=ne&&U.clientY>=I&&U.clientY<=Y?B():D()}function D(){i(!0)}function B(){i(!1)}function C(){m.didMove=!1,document.addEventListener("pointermove",$),document.addEventListener("pointerup",M)}function x(){document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",M)}function $(U){let I=f.current;if(m.canDrag&&I){m.didMove=!0,o&&B(),n.draggableDirection==="x"?m.delta=U.clientX-m.start:m.delta=U.clientY-m.start,m.start!==U.clientX&&(m.canCloseOnClick=!1);let Y=n.draggableDirection==="x"?`${m.delta}px, var(--y)`:`0, calc(${m.delta}px + var(--y))`;I.style.transform=`translate3d(${Y},0)`,I.style.opacity=`${1-Math.abs(m.delta/m.removalDistance)}`}}function M(){x();let U=f.current;if(m.canDrag&&m.didMove&&U){if(m.canDrag=!1,Math.abs(m.delta)>m.removalDistance){d(!0),n.closeToast(!0),n.collapseAll();return}U.style.transition="transform 0.2s, opacity 0.2s",U.style.removeProperty("transform"),U.style.removeProperty("opacity")}}let L={onPointerDown:A,onPointerUp:z};return v&&g&&(L.onMouseEnter=B,n.stacked||(L.onMouseLeave=D)),y&&(L.onClick=U=>{h&&h(U),m.canCloseOnClick&&j(!0)}),{playToast:D,pauseToast:B,isRunning:o,preventExitTransition:u,toastRef:f,eventHandlers:L}}var gw=typeof window<"u"?_.useLayoutEffect:_.useEffect,ms=({theme:n,type:o,isLoading:i,...u})=>Ce.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:n==="colored"?"currentColor":`var(--toastify-icon-color-${o})`,...u});function vw(n){return Ce.createElement(ms,{...n},Ce.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 yw(n){return Ce.createElement(ms,{...n},Ce.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 xw(n){return Ce.createElement(ms,{...n},Ce.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 ww(n){return Ce.createElement(ms,{...n},Ce.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 jw(){return Ce.createElement("div",{className:"Toastify__spinner"})}var Ll={info:yw,warning:vw,success:xw,error:ww,spinner:jw},Nw=n=>n in Ll;function bw({theme:n,type:o,isLoading:i,icon:u}){let d=null,f={theme:n,type:o};return u===!1||(nr(u)?d=u({...f,isLoading:i}):_.isValidElement(u)?d=_.cloneElement(u,f):i?d=Ll.spinner():Nw(o)&&(d=Ll[o](f))),d}var kw=n=>{let{isRunning:o,preventExitTransition:i,toastRef:u,eventHandlers:d,playToast:f}=hw(n),{closeButton:m,children:v,autoClose:g,onClick:j,type:h,hideProgressBar:y,closeToast:N,transition:P,position:A,className:z,style:D,progressClassName:B,updateId:C,role:x,progress:$,rtl:M,toastId:L,deleteToast:U,isIn:I,isLoading:Y,closeOnClick:pe,theme:ne,ariaLabel:le}=n,ve=Xr("Toastify__toast",`Toastify__toast-theme--${ne}`,`Toastify__toast--${h}`,{"Toastify__toast--rtl":M},{"Toastify__toast--close-on-click":pe}),X=nr(z)?z({rtl:M,position:A,type:h,defaultClassName:ve}):Xr(ve,z),ae=bw(n),fe=!!$||!g,ue={closeToast:N,type:h,theme:ne},Q=null;return m===!1||(nr(m)?Q=m(ue):_.isValidElement(m)?Q=_.cloneElement(m,ue):Q=Z1(ue)),Ce.createElement(P,{isIn:I,done:U,position:A,preventExitTransition:i,nodeRef:u,playToast:f},Ce.createElement("div",{id:L,tabIndex:0,onClick:j,"data-in":I,className:X,...d,style:D,ref:u,...I&&{role:x,"aria-label":le}},ae!=null&&Ce.createElement("div",{className:Xr("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!Y})},ae),hm(v,n,!o),Q,!n.customProgressBar&&Ce.createElement(ew,{...C&&!fe?{key:`p-${C}`}:{},rtl:M,theme:ne,delay:g,isRunning:o,isIn:I,closeToast:N,hide:y,type:h,className:B,controlledProgress:fe,progress:$||0})))},Sw=(n,o=!1)=>({enter:`Toastify--animate Toastify__${n}-enter`,exit:`Toastify--animate Toastify__${n}-exit`,appendPosition:o}),Cw=J1(Sw("bounce",!0)),_w={position:"top-right",transition:Cw,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:n=>n.altKey&&n.code==="KeyT"};function Ew(n){let o={..._w,...n},i=n.stacked,[u,d]=_.useState(!0),f=_.useRef(null),{getToastToRender:m,isToastActive:v,count:g}=pw(o),{className:j,style:h,rtl:y,containerId:N,hotKeys:P}=o;function A(D){let B=Xr("Toastify__toast-container",`Toastify__toast-container--${D}`,{"Toastify__toast-container--rtl":y});return nr(j)?j({position:D,rtl:y,defaultClassName:B}):Xr(B,Dl(j))}function z(){i&&(d(!0),Se.play())}return gw(()=>{var D;if(i){let B=f.current.querySelectorAll('[data-in="true"]'),C=12,x=(D=o.position)==null?void 0:D.includes("top"),$=0,M=0;Array.from(B).reverse().forEach((L,U)=>{let I=L;I.classList.add("Toastify__toast--stacked"),U>0&&(I.dataset.collapsed=`${u}`),I.dataset.pos||(I.dataset.pos=x?"top":"bot");let Y=$*(u?.2:1)+(u?0:C*U);I.style.setProperty("--y",`${x?Y:Y*-1}px`),I.style.setProperty("--g",`${C}`),I.style.setProperty("--s",`${1-(u?M:0)}`),$+=I.offsetHeight,M+=.025})}},[u,g,i]),_.useEffect(()=>{function D(B){var C;let x=f.current;P(B)&&((C=x.querySelector('[tabIndex="0"]'))==null||C.focus(),d(!1),Se.pause()),B.key==="Escape"&&(document.activeElement===x||x!=null&&x.contains(document.activeElement))&&(d(!0),Se.play())}return document.addEventListener("keydown",D),()=>{document.removeEventListener("keydown",D)}},[P]),Ce.createElement("section",{ref:f,className:"Toastify",id:N,onMouseEnter:()=>{i&&(d(!1),Se.pause())},onMouseLeave:z,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":o["aria-label"]},m((D,B)=>{let C=B.length?{...h}:{...h,pointerEvents:"none"};return Ce.createElement("div",{tabIndex:-1,className:A(D),"data-stacked":i,style:C,key:`c-${D}`},B.map(({content:x,props:$})=>Ce.createElement(kw,{...$,stacked:i,collapseAll:z,isIn:v($.toastId,$.containerId),key:`t-${$.key}`},x)))}))}_h.createRoot(document.getElementById("root")).render(a.jsxs(_.StrictMode,{children:[a.jsx(Q1,{}),a.jsx(Ew,{position:"top-right",autoClose:3e3,hideProgressBar:!1,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0,theme:"colored"})]}));